From eec8eec03cb64e0f963d77da672ad671d582d992 Mon Sep 17 00:00:00 2001 From: Sandro Domianidze Date: Mon, 21 Apr 2025 19:17:25 +0400 Subject: [PATCH 01/36] fix(repeater): bubble afterStateUpdated to parents --- packages/forms/src/Components/Repeater.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/forms/src/Components/Repeater.php b/packages/forms/src/Components/Repeater.php index a49e432817..b9db60da8a 100644 --- a/packages/forms/src/Components/Repeater.php +++ b/packages/forms/src/Components/Repeater.php @@ -162,6 +162,21 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract }); } + protected function callAfterStateUpdatedOnParents(Component $component, bool $isLive = false): void + { + if (! $isLive && ! $component->isLive()) { + return; + } + + $parent = $component->getContainer()->getParentComponent(); + + if ($parent) { + $parent->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($parent, true); + } + } + public function getAddAction(): Action { $action = Action::make($this->getAddActionName()) @@ -185,6 +200,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->collapsed(false, shouldMakeComponentCollapsible: false); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->button() ->size(ActionSize::Small) @@ -260,6 +277,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->collapsed(false, shouldMakeComponentCollapsible: false); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->button() ->size(ActionSize::Small) @@ -320,6 +339,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->collapsed(false, shouldMakeComponentCollapsible: false); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->iconButton() ->size(ActionSize::Small) @@ -359,6 +380,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->state($items); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->iconButton() ->size(ActionSize::Small) @@ -397,6 +420,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->state($items); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->iconButton() ->size(ActionSize::Small) @@ -435,6 +460,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->state($items); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->iconButton() ->size(ActionSize::Small) @@ -476,6 +503,8 @@ class Repeater extends Field implements Contracts\CanConcealComponents, Contract $component->state($items); $component->callAfterStateUpdated(); + + $this->callAfterStateUpdatedOnParents($component); }) ->livewireClickHandlerEnabled(false) ->iconButton() From 1dbbf6549a6ea3d46bcf033b97c34ef74a90234e Mon Sep 17 00:00:00 2001 From: Alperen Ersoy Date: Thu, 1 May 2025 21:42:53 +0300 Subject: [PATCH 02/36] added id check to modal closed event --- .../views/components/modals.blade.php | 20 +++++++++++++++++++ .../views/components/modal/index.blade.php | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/actions/resources/views/components/modals.blade.php b/packages/actions/resources/views/components/modals.blade.php index b095a76e0a..3c4440fb6a 100644 --- a/packages/actions/resources/views/components/modals.blade.php +++ b/packages/actions/resources/views/components/modals.blade.php @@ -27,6 +27,10 @@ :wire:key="$action ? $this->getId() . '.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedActions.length) open()" x-on:modal-closed.stop=" + if ($event.detail.id !== '{{ $this->getId() }}-action') { + return + } + const mountedActionShouldOpenModal = {{ \Illuminate\Support\Js::from($action && $this->mountedActionShouldOpenModal(mountedAction: $action)) }} if (! mountedActionShouldOpenModal) { @@ -89,6 +93,10 @@ :wire:key="$action ? $this->getId() . '.table.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedTableActions.length) open()" x-on:modal-closed.stop=" + if ($event.detail.id !== '{{ $this->getId() }}-table-action') { + return + } + const mountedTableActionShouldOpenModal = {{ \Illuminate\Support\Js::from($action && $this->mountedTableActionShouldOpenModal(mountedAction: $action)) }} if (! mountedTableActionShouldOpenModal) { @@ -145,6 +153,10 @@ :wire:key="$action ? $this->getId() . '.table.bulk-actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedTableBulkAction) open()" x-on:modal-closed.stop=" + if ($event.detail.id !== '{{ $this->getId() }}-table-bulk-action') { + return + } + const mountedTableBulkActionShouldOpenModal = {{ \Illuminate\Support\Js::from($action && $this->mountedTableBulkActionShouldOpenModal(mountedBulkAction: $action)) }} if (! mountedTableBulkActionShouldOpenModal) { @@ -207,6 +219,10 @@ :wire:key="$action ? $this->getId() . '.infolist.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedInfolistActions.length) open()" x-on:modal-closed.stop=" + if ($event.detail.id !== '{{ $this->getId() }}-infolist-action') { + return + } + const mountedInfolistActionShouldOpenModal = {{ \Illuminate\Support\Js::from($action && $this->mountedInfolistActionShouldOpenModal(mountedAction: $action)) }} if (! mountedInfolistActionShouldOpenModal) { @@ -268,6 +284,10 @@ :width="$action?->getModalWidth()" :wire:key="$action ? $this->getId() . '.' . $action->getComponent()->getStatePath() . '.actions.' . $action->getName() . '.modal' : null" x-on:modal-closed.stop=" + if ($event.detail.id !== '{{ $this->getId() }}-form-component-action') { + return + } + const mountedFormComponentActionShouldOpenModal = {{ \Illuminate\Support\Js::from($action && $this->mountedFormComponentActionShouldOpenModal()) }} if (mountedFormComponentActionShouldOpenModal) { diff --git a/packages/support/resources/views/components/modal/index.blade.php b/packages/support/resources/views/components/modal/index.blade.php index 7a9fbe8ec7..4a2a642f42 100644 --- a/packages/support/resources/views/components/modal/index.blade.php +++ b/packages/support/resources/views/components/modal/index.blade.php @@ -72,7 +72,7 @@ this.isOpen = false this.$refs.modalContainer.dispatchEvent( - new CustomEvent('modal-closed', { id: '{{ $id }}' }), + new CustomEvent('modal-closed', { detail: { id: '{{ $id }}' } }), ) }, @@ -85,7 +85,7 @@ @endif this.$refs.modalContainer.dispatchEvent( - new CustomEvent('modal-opened', { id: '{{ $id }}' }), + new CustomEvent('modal-opened', { detail: { id: '{{ $id }}' } }), ) }) }, From 265413ad1592ccf6d5252ed7f9b4f0a7a881372f Mon Sep 17 00:00:00 2001 From: dvarilek Date: Wed, 28 May 2025 23:31:55 +0200 Subject: [PATCH 03/36] remove duplicate style conditionals --- .../tables/resources/views/columns/image-column.blade.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/tables/resources/views/columns/image-column.blade.php b/packages/tables/resources/views/columns/image-column.blade.php index cf2897a4de..d465114753 100644 --- a/packages/tables/resources/views/columns/image-column.blade.php +++ b/packages/tables/resources/views/columns/image-column.blade.php @@ -102,10 +102,6 @@ @if ($hasLimitedRemainingText && (! $isLimitedRemainingTextSeparate) && $isCircular)
$isCircular, From 18c88282942f208cb8d942626b93049f78f5512e Mon Sep 17 00:00:00 2001 From: Hyacinthe MEDJO Date: Thu, 29 May 2025 14:00:45 +0100 Subject: [PATCH 04/36] Update missing translations in forms/resources/lang/fr/components.php filament/forms/resources/lang\fr\components.php select.actions.create_option.label Missing select.actions.edit_option.label Missing --- packages/forms/resources/lang/fr/components.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/forms/resources/lang/fr/components.php b/packages/forms/resources/lang/fr/components.php index 81d23f1196..e2a5b7bc55 100644 --- a/packages/forms/resources/lang/fr/components.php +++ b/packages/forms/resources/lang/fr/components.php @@ -384,7 +384,7 @@ return [ 'actions' => [ 'create_option' => [ - + 'label' => 'Créer', 'modal' => [ 'heading' => 'Créer', @@ -406,7 +406,7 @@ return [ ], 'edit_option' => [ - + 'label' => 'Modifier', 'modal' => [ 'heading' => 'Modifier', From b11315ab38070f5bd7a232178dfeea234e911e36 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Fri, 30 May 2025 13:01:32 +0100 Subject: [PATCH 05/36] Update image-entry.blade.php --- .../resources/views/components/image-entry.blade.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/infolists/resources/views/components/image-entry.blade.php b/packages/infolists/resources/views/components/image-entry.blade.php index 00f7a38e72..ccb6cf545b 100644 --- a/packages/infolists/resources/views/components/image-entry.blade.php +++ b/packages/infolists/resources/views/components/image-entry.blade.php @@ -116,10 +116,6 @@ @if ($hasLimitedRemainingText && (! $isLimitedRemainingTextSeparate) && $isCircular)
$isCircular, From 8de3e3d3c878981753605a4ddeb26a17bef76fba Mon Sep 17 00:00:00 2001 From: ht3aa Date: Fri, 30 May 2025 15:44:38 +0300 Subject: [PATCH 06/36] adding limit when searchable is true --- packages/forms/src/Components/Select.php | 40 +++++++++++++----------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/packages/forms/src/Components/Select.php b/packages/forms/src/Components/Select.php index 7d2589bac1..450724d818 100644 --- a/packages/forms/src/Components/Select.php +++ b/packages/forms/src/Components/Select.php @@ -122,7 +122,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has { parent::setUp(); - $this->default(static fn (Select $component): ?array => $component->isMultiple() ? [] : null); + $this->default(static fn(Select $component): ?array => $component->isMultiple() ? [] : null); $this->afterStateHydrated(static function (Select $component, $state): void { if (! $component->isMultiple()) { @@ -186,18 +186,18 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $this->transformOptionsForJsUsing(static function (Select $component, array $options): array { return collect($options) - ->map(fn ($label, $value): array => is_array($label) + ->map(fn($label, $value): array => is_array($label) ? ['label' => $value, 'choices' => $component->transformOptionsForJs($label)] : ['label' => $label, 'value' => strval($value), 'disabled' => $component->isOptionDisabled($value, $label)]) ->values() ->all(); }); - $this->placeholder(static fn (Select $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder')); + $this->placeholder(static fn(Select $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder')); $this->suffixActions([ - static fn (Select $component): ?Action => $component->getCreateOptionAction(), - static fn (Select $component): ?Action => $component->getEditOptionAction(), + static fn(Select $component): ?Action => $component->getCreateOptionAction(), + static fn(Select $component): ?Action => $component->getEditOptionAction(), ]); } @@ -317,7 +317,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has ->iconButton() ->modalHeading($this->getCreateOptionModalHeading() ?? __('filament-forms::components.select.actions.create_option.modal.heading')) ->modalSubmitActionLabel(__('filament-forms::components.select.actions.create_option.modal.actions.create.label')) - ->extraModalFooterActions(fn (Action $action, Select $component): array => $component->isMultiple() ? [ + ->extraModalFooterActions(fn(Action $action, Select $component): array => $component->isMultiple() ? [ $action->makeModalSubmitAction('createAnother', arguments: ['another' => true]) ->label(__('filament-forms::components.select.actions.create_option.modal.actions.create_another.label')), ] : []); @@ -583,7 +583,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has public function getOptionLabel(): ?string { return $this->evaluate($this->getOptionLabelUsing, [ - 'value' => fn (): mixed => $this->getState(), + 'value' => fn(): mixed => $this->getState(), ]); } @@ -593,7 +593,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has public function getOptionLabels(): array { $labels = $this->evaluate($this->getOptionLabelsUsing, [ - 'values' => fn (): array => $this->getState(), + 'values' => fn(): array => $this->getState(), ]); if ($labels instanceof Arrayable) { @@ -700,7 +700,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $this->relationshipTitleAttribute = $titleAttribute; $this->getSearchResultsUsing(static function (Select $component, ?string $search) use ($modifyQueryUsing, $ignoreRecord): array { - $relationship = Relation::noConstraints(fn () => $component->getRelationship()); + $relationship = Relation::noConstraints(fn() => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -733,7 +733,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has if ($component->hasOptionLabelFromRecordUsingCallback()) { return $relationshipQuery ->get() - ->mapWithKeys(static fn (Model $record) => [ + ->mapWithKeys(static fn(Model $record) => [ $record->{Str::afterLast($qualifiedRelatedKeyName, '.')} => $component->getOptionLabelFromRecord($record), ]) ->toArray(); @@ -763,7 +763,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has return null; } - $relationship = Relation::noConstraints(fn () => $component->getRelationship()); + $relationship = Relation::noConstraints(fn() => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -783,7 +783,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has if ($component->hasOptionLabelFromRecordUsingCallback()) { return $relationshipQuery ->get() - ->mapWithKeys(static fn (Model $record) => [ + ->mapWithKeys(static fn(Model $record) => [ $record->{Str::afterLast($qualifiedRelatedKeyName, '.')} => $component->getOptionLabelFromRecord($record), ]) ->toArray(); @@ -803,6 +803,10 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $relationshipTitleAttribute = $relationshipQuery->qualifyColumn($relationshipTitleAttribute); } + if ($component->isSearchable()) { + $relationshipQuery->limit($component->getOptionsLimit()); + } + return $relationshipQuery ->pluck($relationshipTitleAttribute, $qualifiedRelatedKeyName) ->toArray(); @@ -836,7 +840,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has // https://github.com/filamentphp/filament/issues/1111 $relatedRecords ->pluck(($relationship instanceof BelongsToMany) ? $relationship->getRelatedKeyName() : $relationship->getRelated()->getKeyName()) - ->map(static fn ($key): string => strval($key)) + ->map(static fn($key): string => strval($key)) ->all(), ); @@ -906,7 +910,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has }); $this->getSelectedRecordUsing(static function (Select $component, $state) use ($modifyQueryUsing): ?Model { - $relationship = Relation::noConstraints(fn () => $component->getRelationship()); + $relationship = Relation::noConstraints(fn() => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -923,7 +927,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has }); $this->getOptionLabelsUsing(static function (Select $component, array $values) use ($modifyQueryUsing): array { - $relationship = Relation::noConstraints(fn () => $component->getRelationship()); + $relationship = Relation::noConstraints(fn() => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -941,7 +945,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has if ($component->hasOptionLabelFromRecordUsingCallback()) { return $relationshipQuery ->get() - ->mapWithKeys(static fn (Model $record) => [ + ->mapWithKeys(static fn(Model $record) => [ $record->{Str::afterLast($qualifiedRelatedKeyName, '.')} => $component->getOptionLabelFromRecord($record), ]) ->toArray(); @@ -1028,7 +1032,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $recordsToDetach = array_diff( $relatedRecords ->pluck($relationship->getRelatedKeyName()) - ->map(static fn ($key): string => strval($key)) + ->map(static fn($key): string => strval($key)) ->all(), $state, ); @@ -1066,7 +1070,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $form->getRecord()?->update($data); }); - $this->dehydrated(fn (Select $component): bool => ! $component->isMultiple()); + $this->dehydrated(fn(Select $component): bool => ! $component->isMultiple()); return $this; } From 063661ac242c0184b7191f10ccd34a9f43520fd3 Mon Sep 17 00:00:00 2001 From: ht3aa Date: Fri, 30 May 2025 15:52:17 +0300 Subject: [PATCH 07/36] using pint --- packages/forms/src/Components/Select.php | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/forms/src/Components/Select.php b/packages/forms/src/Components/Select.php index 450724d818..a15eb1fd56 100644 --- a/packages/forms/src/Components/Select.php +++ b/packages/forms/src/Components/Select.php @@ -122,7 +122,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has { parent::setUp(); - $this->default(static fn(Select $component): ?array => $component->isMultiple() ? [] : null); + $this->default(static fn (Select $component): ?array => $component->isMultiple() ? [] : null); $this->afterStateHydrated(static function (Select $component, $state): void { if (! $component->isMultiple()) { @@ -186,18 +186,18 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $this->transformOptionsForJsUsing(static function (Select $component, array $options): array { return collect($options) - ->map(fn($label, $value): array => is_array($label) + ->map(fn ($label, $value): array => is_array($label) ? ['label' => $value, 'choices' => $component->transformOptionsForJs($label)] : ['label' => $label, 'value' => strval($value), 'disabled' => $component->isOptionDisabled($value, $label)]) ->values() ->all(); }); - $this->placeholder(static fn(Select $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder')); + $this->placeholder(static fn (Select $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder')); $this->suffixActions([ - static fn(Select $component): ?Action => $component->getCreateOptionAction(), - static fn(Select $component): ?Action => $component->getEditOptionAction(), + static fn (Select $component): ?Action => $component->getCreateOptionAction(), + static fn (Select $component): ?Action => $component->getEditOptionAction(), ]); } @@ -317,7 +317,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has ->iconButton() ->modalHeading($this->getCreateOptionModalHeading() ?? __('filament-forms::components.select.actions.create_option.modal.heading')) ->modalSubmitActionLabel(__('filament-forms::components.select.actions.create_option.modal.actions.create.label')) - ->extraModalFooterActions(fn(Action $action, Select $component): array => $component->isMultiple() ? [ + ->extraModalFooterActions(fn (Action $action, Select $component): array => $component->isMultiple() ? [ $action->makeModalSubmitAction('createAnother', arguments: ['another' => true]) ->label(__('filament-forms::components.select.actions.create_option.modal.actions.create_another.label')), ] : []); @@ -583,7 +583,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has public function getOptionLabel(): ?string { return $this->evaluate($this->getOptionLabelUsing, [ - 'value' => fn(): mixed => $this->getState(), + 'value' => fn (): mixed => $this->getState(), ]); } @@ -593,7 +593,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has public function getOptionLabels(): array { $labels = $this->evaluate($this->getOptionLabelsUsing, [ - 'values' => fn(): array => $this->getState(), + 'values' => fn (): array => $this->getState(), ]); if ($labels instanceof Arrayable) { @@ -700,7 +700,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $this->relationshipTitleAttribute = $titleAttribute; $this->getSearchResultsUsing(static function (Select $component, ?string $search) use ($modifyQueryUsing, $ignoreRecord): array { - $relationship = Relation::noConstraints(fn() => $component->getRelationship()); + $relationship = Relation::noConstraints(fn () => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -733,7 +733,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has if ($component->hasOptionLabelFromRecordUsingCallback()) { return $relationshipQuery ->get() - ->mapWithKeys(static fn(Model $record) => [ + ->mapWithKeys(static fn (Model $record) => [ $record->{Str::afterLast($qualifiedRelatedKeyName, '.')} => $component->getOptionLabelFromRecord($record), ]) ->toArray(); @@ -763,7 +763,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has return null; } - $relationship = Relation::noConstraints(fn() => $component->getRelationship()); + $relationship = Relation::noConstraints(fn () => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -783,7 +783,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has if ($component->hasOptionLabelFromRecordUsingCallback()) { return $relationshipQuery ->get() - ->mapWithKeys(static fn(Model $record) => [ + ->mapWithKeys(static fn (Model $record) => [ $record->{Str::afterLast($qualifiedRelatedKeyName, '.')} => $component->getOptionLabelFromRecord($record), ]) ->toArray(); @@ -840,7 +840,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has // https://github.com/filamentphp/filament/issues/1111 $relatedRecords ->pluck(($relationship instanceof BelongsToMany) ? $relationship->getRelatedKeyName() : $relationship->getRelated()->getKeyName()) - ->map(static fn($key): string => strval($key)) + ->map(static fn ($key): string => strval($key)) ->all(), ); @@ -910,7 +910,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has }); $this->getSelectedRecordUsing(static function (Select $component, $state) use ($modifyQueryUsing): ?Model { - $relationship = Relation::noConstraints(fn() => $component->getRelationship()); + $relationship = Relation::noConstraints(fn () => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -927,7 +927,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has }); $this->getOptionLabelsUsing(static function (Select $component, array $values) use ($modifyQueryUsing): array { - $relationship = Relation::noConstraints(fn() => $component->getRelationship()); + $relationship = Relation::noConstraints(fn () => $component->getRelationship()); $relationshipQuery = app(RelationshipJoiner::class)->prepareQueryForNoConstraints($relationship); @@ -945,7 +945,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has if ($component->hasOptionLabelFromRecordUsingCallback()) { return $relationshipQuery ->get() - ->mapWithKeys(static fn(Model $record) => [ + ->mapWithKeys(static fn (Model $record) => [ $record->{Str::afterLast($qualifiedRelatedKeyName, '.')} => $component->getOptionLabelFromRecord($record), ]) ->toArray(); @@ -1032,7 +1032,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $recordsToDetach = array_diff( $relatedRecords ->pluck($relationship->getRelatedKeyName()) - ->map(static fn($key): string => strval($key)) + ->map(static fn ($key): string => strval($key)) ->all(), $state, ); @@ -1070,7 +1070,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $form->getRecord()?->update($data); }); - $this->dehydrated(fn(Select $component): bool => ! $component->isMultiple()); + $this->dehydrated(fn (Select $component): bool => ! $component->isMultiple()); return $this; } From d5f8fc6a092f8b1d57a7960766a285ee8b87a0e3 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Sat, 31 May 2025 10:32:48 +0100 Subject: [PATCH 08/36] Update Select.php --- packages/forms/src/Components/Select.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/forms/src/Components/Select.php b/packages/forms/src/Components/Select.php index a15eb1fd56..137c68df9b 100644 --- a/packages/forms/src/Components/Select.php +++ b/packages/forms/src/Components/Select.php @@ -778,6 +778,14 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has ]) ?? $relationshipQuery; } + $baseRelationshipQuery = $relationshipQuery->getQuery(); + + if (isset($baseRelationshipQuery->limit)) { + $component->optionsLimit($baseRelationshipQuery->limit); + } elseif ($component->isSearchable()) { + $relationshipQuery->limit($component->getOptionsLimit()); + } + $qualifiedRelatedKeyName = $component->getQualifiedRelatedKeyNameForRelationship($relationship); if ($component->hasOptionLabelFromRecordUsingCallback()) { @@ -803,10 +811,6 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has $relationshipTitleAttribute = $relationshipQuery->qualifyColumn($relationshipTitleAttribute); } - if ($component->isSearchable()) { - $relationshipQuery->limit($component->getOptionsLimit()); - } - return $relationshipQuery ->pluck($relationshipTitleAttribute, $qualifiedRelatedKeyName) ->toArray(); From de32089d674b62b507597f7f82cf6b660ce14902 Mon Sep 17 00:00:00 2001 From: Arthur Marchesi Date: Sat, 31 May 2025 10:33:10 -0300 Subject: [PATCH 09/36] Add missing pt_BR translation in request-password-reset. --- .../pages/auth/password-reset/request-password-reset.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/panels/resources/lang/pt_BR/pages/auth/password-reset/request-password-reset.php b/packages/panels/resources/lang/pt_BR/pages/auth/password-reset/request-password-reset.php index cb28a4a578..dff5cfcdef 100644 --- a/packages/panels/resources/lang/pt_BR/pages/auth/password-reset/request-password-reset.php +++ b/packages/panels/resources/lang/pt_BR/pages/auth/password-reset/request-password-reset.php @@ -32,6 +32,10 @@ return [ 'notifications' => [ + 'sent' => [ + 'body' => 'Se sua conta não existir, você não receberá o e-mail.', + ], + 'throttled' => [ 'title' => 'Muitas solicitações', 'body' => 'Por favor tente novamente em :seconds segundos.', From c5d5b9f785856a32e726c0a24b0c795c2c088177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Lundgren?= Date: Mon, 2 Jun 2025 13:02:48 +0200 Subject: [PATCH 10/36] Add missing translation --- .../sv/pages/auth/password-reset/request-password-reset.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php b/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php index 0c4b470b38..8c77c02ef3 100644 --- a/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php +++ b/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php @@ -32,6 +32,10 @@ return [ 'notifications' => [ + 'sent' => [ + 'body' => 'Om ditt konto inte finns, kommer du inte att få något meddelande.', + ], + 'throttled' => [ 'title' => 'För många förfrågningar', 'body' => 'Vänligen försök igen om :seconds sekunder.', From 652d1518767ca35e3bfcd5749eebbeea8d7bfc6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Lundgren?= Date: Mon, 2 Jun 2025 13:04:14 +0200 Subject: [PATCH 11/36] Update wording for password reset messages --- .../pages/auth/email-verification/email-verification-prompt.php | 2 +- .../sv/pages/auth/password-reset/request-password-reset.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/panels/resources/lang/sv/pages/auth/email-verification/email-verification-prompt.php b/packages/panels/resources/lang/sv/pages/auth/email-verification/email-verification-prompt.php index 67d37a94a1..02aa3bbb56 100644 --- a/packages/panels/resources/lang/sv/pages/auth/email-verification/email-verification-prompt.php +++ b/packages/panels/resources/lang/sv/pages/auth/email-verification/email-verification-prompt.php @@ -15,7 +15,7 @@ return [ ], 'messages' => [ - 'notification_not_received' => 'Inte fått mejlet vi skickade?', + 'notification_not_received' => 'Inte fått meddelandet vi skickade?', 'notification_sent' => 'Vi skickade ett meddelande till :email med instruktioner på hur du verifierar din mejladress.', ], diff --git a/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php b/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php index 8c77c02ef3..9599853aa2 100644 --- a/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php +++ b/packages/panels/resources/lang/sv/pages/auth/password-reset/request-password-reset.php @@ -23,7 +23,7 @@ return [ 'actions' => [ 'request' => [ - 'label' => 'Skicka mejlmeddelande', + 'label' => 'Skicka meddelande', ], ], From 6aeeba300539e6703138c4ba790bc1c8dd574c23 Mon Sep 17 00:00:00 2001 From: Alperen Ersoy Date: Mon, 2 Jun 2025 21:51:52 +0300 Subject: [PATCH 12/36] used starts with for modal closed event id check instead of exact match --- .../resources/views/components/modals.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/actions/resources/views/components/modals.blade.php b/packages/actions/resources/views/components/modals.blade.php index 3c4440fb6a..d7118f7951 100644 --- a/packages/actions/resources/views/components/modals.blade.php +++ b/packages/actions/resources/views/components/modals.blade.php @@ -27,7 +27,7 @@ :wire:key="$action ? $this->getId() . '.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedActions.length) open()" x-on:modal-closed.stop=" - if ($event.detail.id !== '{{ $this->getId() }}-action') { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { return } @@ -93,7 +93,7 @@ :wire:key="$action ? $this->getId() . '.table.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedTableActions.length) open()" x-on:modal-closed.stop=" - if ($event.detail.id !== '{{ $this->getId() }}-table-action') { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { return } @@ -153,7 +153,7 @@ :wire:key="$action ? $this->getId() . '.table.bulk-actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedTableBulkAction) open()" x-on:modal-closed.stop=" - if ($event.detail.id !== '{{ $this->getId() }}-table-bulk-action') { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { return } @@ -219,7 +219,7 @@ :wire:key="$action ? $this->getId() . '.infolist.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedInfolistActions.length) open()" x-on:modal-closed.stop=" - if ($event.detail.id !== '{{ $this->getId() }}-infolist-action') { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { return } @@ -284,7 +284,7 @@ :width="$action?->getModalWidth()" :wire:key="$action ? $this->getId() . '.' . $action->getComponent()->getStatePath() . '.actions.' . $action->getName() . '.modal' : null" x-on:modal-closed.stop=" - if ($event.detail.id !== '{{ $this->getId() }}-form-component-action') { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { return } From 1253dde2892313c331e0ec7afa1abd8916829f17 Mon Sep 17 00:00:00 2001 From: Alperen Ersoy Date: Mon, 2 Jun 2025 22:00:32 +0300 Subject: [PATCH 13/36] added trailing dash to id check in modal closed event --- .../resources/views/components/modals.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/actions/resources/views/components/modals.blade.php b/packages/actions/resources/views/components/modals.blade.php index d7118f7951..b2bb5f1300 100644 --- a/packages/actions/resources/views/components/modals.blade.php +++ b/packages/actions/resources/views/components/modals.blade.php @@ -27,7 +27,7 @@ :wire:key="$action ? $this->getId() . '.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedActions.length) open()" x-on:modal-closed.stop=" - if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}-')) { return } @@ -93,7 +93,7 @@ :wire:key="$action ? $this->getId() . '.table.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedTableActions.length) open()" x-on:modal-closed.stop=" - if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}-')) { return } @@ -153,7 +153,7 @@ :wire:key="$action ? $this->getId() . '.table.bulk-actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedTableBulkAction) open()" x-on:modal-closed.stop=" - if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}-')) { return } @@ -219,7 +219,7 @@ :wire:key="$action ? $this->getId() . '.infolist.actions.' . $action->getName() . '.modal' : null" x-on:closed-form-component-action-modal.window="if (($event.detail.id === '{{ $this->getId() }}') && $wire.mountedInfolistActions.length) open()" x-on:modal-closed.stop=" - if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}-')) { return } @@ -284,7 +284,7 @@ :width="$action?->getModalWidth()" :wire:key="$action ? $this->getId() . '.' . $action->getComponent()->getStatePath() . '.actions.' . $action->getName() . '.modal' : null" x-on:modal-closed.stop=" - if (!$event.detail?.id?.startsWith('{{ $this->getId() }}')) { + if (!$event.detail?.id?.startsWith('{{ $this->getId() }}-')) { return } From a372744729b9bf573c6b92aab2d525e5417df389 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Tue, 3 Jun 2025 07:11:40 +0100 Subject: [PATCH 14/36] Update Select.php --- packages/forms/src/Components/Select.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/forms/src/Components/Select.php b/packages/forms/src/Components/Select.php index 137c68df9b..b748879940 100644 --- a/packages/forms/src/Components/Select.php +++ b/packages/forms/src/Components/Select.php @@ -1215,10 +1215,6 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has public function hasDynamicSearchResults(): bool { - if ($this->hasRelationship() && empty($this->searchColumns)) { - return ! $this->isPreloaded(); - } - return $this->getSearchResultsUsing instanceof Closure; } From 91b80edc1ffc85a8fad76e852b02a71ee5200318 Mon Sep 17 00:00:00 2001 From: Tom Janssen Date: Tue, 3 Jun 2025 14:26:20 +0200 Subject: [PATCH 15/36] actually allow livewire to be null --- .../views/components/layout/base.blade.php | 16 ++++++++-------- .../views/components/layout/index.blade.php | 11 ++++++----- .../views/components/layout/simple.blade.php | 4 +++- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/panels/resources/views/components/layout/base.blade.php b/packages/panels/resources/views/components/layout/base.blade.php index 1bc67e2631..b70551b30b 100644 --- a/packages/panels/resources/views/components/layout/base.blade.php +++ b/packages/panels/resources/views/components/layout/base.blade.php @@ -12,7 +12,7 @@ ]) > - {{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::HEAD_START, scopes: $livewire->getRenderHookScopes()) }} + {{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::HEAD_START, scopes: $livewire?->getRenderHookScopes()) }} @@ -31,7 +31,7 @@ {{ filled($title) ? "{$title} - " : null }} {{ $brandName }} - {{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::STYLES_BEFORE, scopes: $livewire->getRenderHookScopes()) }} + {{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::STYLES_BEFORE, scopes: $livewire?->getRenderHookScopes()) }}