Merge branch '3.x' into shades-registration

This commit is contained in:
Zep Fietje
2023-09-18 10:45:34 +02:00
3 changed files with 44 additions and 0 deletions
+20
View File
@@ -77,6 +77,26 @@ FilamentView::registerRenderHook(
- `panels::user-menu.profile.after` - After the profile item in the [user menu](../panels/navigation#customizing-the-user-menu)
- `panels::user-menu.profile.before` - Before the profile item in the [user menu](../panels/navigation#customizing-the-user-menu)
### Table Builder render hooks
All these render hooks [can be scoped](#scoping-render-hooks) to any table Livewire component class. When using the Panel Builder, these classes might be the List or Manage page of a resource, or a relation manager. Table widgets are also Livewire component classes.
- `tables::toolbar.end` - The end of the toolbar
- `tables::toolbar.grouping-selector.after` - After the [grouping](../tables/grouping) selector
- `tables::toolbar.grouping-selector.before` - Before the [grouping](../tables/grouping) selector
- `tables::toolbar.reorder-trigger.after` - After the [reorder](../tables/advanced#reordering-records) trigger
- `tables::toolbar.reorder-trigger.before` - Before the [reorder](../tables/advanced#reordering-records) trigger
- `tables::toolbar.search.after` - After the [search](../tables/getting-started#making-columns-sortable-and-searchable) container
- `tables::toolbar.search.before` - Before the [search](../tables/getting-started#making-columns-sortable-and-searchable) container
- `tables::toolbar.start` - The start of the toolbar
- `tables::toolbar.toggle-column-trigger.after` - After the [toggle columns](../tables/columns/getting-started#toggling-column-visibility) trigger
- `tables::toolbar.toggle-column-trigger.before` - Before the [toggle columns](../tables/columns/getting-started#toggling-column-visibility) trigger
### Widgets render hooks
- `widgets::table-widget.end` - End of the [table widget](../panels/dashboard#table-widgets), after the table itself, also [can be scoped](#scoping-render-hooks) to the table widget class
- `widgets::table-widget.start` - Start of the [table widget](../panels/dashboard#table-widgets), before the table itself, also [can be scoped](#scoping-render-hooks) to the table widget class
## Scoping render hooks
Some render hooks can be given a "scope", which allows them to only be output on a specific page or Livewire component. For instance, you might want to register a render hook for just 1 page. To do that, you can pass the class of the page or component as the second argument to `registerRenderHook()`:
@@ -180,7 +180,11 @@
x-show="@js($hasHeaderToolbar) || (selectedRecords.length && @js(count($bulkActions)))"
class="fi-ta-header-toolbar flex items-center justify-between gap-3 px-4 py-3 sm:px-6"
>
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.start', scopes: static::class) }}
<div class="flex shrink-0 items-center gap-x-3">
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.before', scopes: static::class) }}
@if ($isReorderable)
<span
x-show="! selectedRecords.length"
@@ -193,6 +197,8 @@
</span>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.after', scopes: static::class) }}
@if ((! $isReordering) && count($bulkActions))
<x-filament-tables::actions
:actions="$bulkActions"
@@ -201,6 +207,8 @@
/>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.grouping-selector.before', scopes: static::class) }}
@if (count($groups))
<x-filament-tables::groups
:dropdown-on-desktop="$areGroupsInDropdownOnDesktop()"
@@ -208,6 +216,8 @@
:trigger-action="$getGroupRecordsTriggerAction()"
/>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.grouping-selector.after', scopes: static::class) }}
</div>
@if ($isGlobalSearchVisible || $hasFiltersDropdown || $hasColumnToggleDropdown)
@@ -218,10 +228,14 @@
'gap-x-4' => $filtersTriggerAction->isIconButton() && $toggleColumnsTriggerAction->isIconButton(),
])
>
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.before', scopes: static::class) }}
@if ($isGlobalSearchVisible)
<x-filament-tables::search-field />
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.after', scopes: static::class) }}
@if ($hasFiltersDropdown || $hasColumnToggleDropdown)
@if ($hasFiltersDropdown)
<x-filament-tables::filters.dropdown
@@ -233,6 +247,8 @@
/>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.toggle-column-trigger.before', scopes: static::class) }}
@if ($hasColumnToggleDropdown)
<x-filament-tables::column-toggle.dropdown
:form="$getColumnToggleForm()"
@@ -241,9 +257,13 @@
:width="$getColumnToggleFormWidth()"
/>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.toggle-column-trigger.after', scopes: static::class) }}
@endif
</div>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.end') }}
</div>
</div>
@@ -1,3 +1,7 @@
<x-filament-widgets::widget class="fi-wi-table">
{{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.start', scopes: static::class) }}
{{ $this->table }}
{{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.end', scopes: static::class) }}
</x-filament-widgets::widget>