Use dispatch() instead of dispatchBrowserEvent()

This commit is contained in:
Dan Harrin
2023-06-10 08:33:05 +01:00
parent 9200e75755
commit 754fcdb234
11 changed files with 25 additions and 25 deletions
@@ -154,7 +154,7 @@ trait InteractsWithActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-action",
]);
@@ -350,7 +350,7 @@ trait InteractsWithActions
}
if (! count($this->mountedActions)) {
$this->dispatchBrowserEvent('close-modal', [
$this->dispatch('close-modal', [
'id' => "{$this->id}-action",
]);
@@ -368,7 +368,7 @@ trait InteractsWithActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-action",
]);
}
+1 -1
View File
@@ -389,7 +389,7 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe
/** @var LivewireComponent $livewire */
$livewire = $component->getLivewire();
$livewire->dispatchBrowserEvent('filament-forms::select.refreshSelectedOptionLabel', [
$livewire->dispatch('filament-forms::select.refreshSelectedOptionLabel', [
'livewireId' => $livewire->id,
'statePath' => $statePath,
]);
+1 -1
View File
@@ -78,7 +78,7 @@ class Wizard extends Component
/** @var LivewireComponent $livewire */
$livewire = $component->getLivewire();
$livewire->dispatchBrowserEvent('next-wizard-step', [
$livewire->dispatch('next-wizard-step', [
'statePath' => $statePath,
]);
},
@@ -151,11 +151,11 @@ trait HasFormComponentActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-form-component-action",
]);
$this->dispatchBrowserEvent('opened-form-component-action-modal', [
$this->dispatch('opened-form-component-action-modal', [
'id' => $this->id,
]);
@@ -271,11 +271,11 @@ trait HasFormComponentActions
}
if (! count($this->mountedFormComponentActions)) {
$this->dispatchBrowserEvent('close-modal', [
$this->dispatch('close-modal', [
'id' => "{$this->id}-form-component-action",
]);
$this->dispatchBrowserEvent('closed-form-component-action-modal', [
$this->dispatch('closed-form-component-action-modal', [
'id' => $this->id,
]);
@@ -284,11 +284,11 @@ trait HasFormComponentActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-form-component-action",
]);
$this->dispatchBrowserEvent('opened-form-component-action-modal', [
$this->dispatch('opened-form-component-action-modal', [
'id' => $this->id,
]);
}
@@ -172,7 +172,7 @@ trait InteractsWithForms
} catch (ValidationException $exception) {
$this->onValidationError($exception);
$this->dispatchBrowserEvent('expand-concealing-component');
$this->dispatch('expand-concealing-component');
throw $exception;
}
@@ -197,7 +197,7 @@ trait InteractsWithForms
} catch (ValidationException $exception) {
$this->onValidationError($exception);
$this->dispatchBrowserEvent('expand-concealing-component');
$this->dispatch('expand-concealing-component');
throw $exception;
}
@@ -184,7 +184,7 @@ trait InteractsWithInfolists
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-infolist-action",
]);
@@ -281,7 +281,7 @@ trait InteractsWithInfolists
$this->mountedInfolistActionsComponent = null;
$this->mountedInfolistActionsInfolist = null;
$this->dispatchBrowserEvent('close-modal', [
$this->dispatch('close-modal', [
'id' => "{$this->id}-infolist-action",
]);
@@ -295,7 +295,7 @@ trait InteractsWithInfolists
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-infolist-action",
]);
}
@@ -25,7 +25,7 @@ class GlobalSearch extends Component
return $results;
}
$this->dispatchBrowserEvent('open-global-search-results');
$this->dispatch('open-global-search-results');
return $results;
}
@@ -182,7 +182,7 @@ class EditRecord extends Page
public function openDeleteModal(): void
{
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => 'delete',
]);
}
@@ -232,7 +232,7 @@ use Filament\Tables\Columns\TextColumn;
TextColumn::make('title')
->action(function (Post $record): void {
$this->dispatchBrowserEvent('open-post-edit-modal', [
$this->dispatch('open-post-edit-modal', [
'post' => $record->getKey(),
]);
})
@@ -251,7 +251,7 @@ TextColumn::make('title')
Action::make('select')
->requiresConfirmation()
->action(function (Post $record): void {
$this->dispatchBrowserEvent('select-post', [
$this->dispatch('select-post', [
'post' => $record->getKey(),
]);
}),
+3 -3
View File
@@ -159,7 +159,7 @@ trait HasActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-table-action",
]);
@@ -260,7 +260,7 @@ trait HasActions
}
if (! count($this->mountedTableActions)) {
$this->dispatchBrowserEvent('close-modal', [
$this->dispatch('close-modal', [
'id' => "{$this->id}-table-action",
]);
@@ -277,7 +277,7 @@ trait HasActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-table-action",
]);
}
@@ -88,7 +88,7 @@ trait HasBulkActions
$action->resetArguments();
$action->resetFormData();
$this->dispatchBrowserEvent('close-modal', [
$this->dispatch('close-modal', [
'id' => "{$this->id}-table-bulk-action",
]);
@@ -147,7 +147,7 @@ trait HasBulkActions
$this->resetErrorBag();
$this->dispatchBrowserEvent('open-modal', [
$this->dispatch('open-modal', [
'id' => "{$this->id}-table-bulk-action",
]);