diff --git a/CHANGELOG.md b/CHANGELOG.md index ea686d326..93bd62c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to `laravel-livewire-tables` will be documented in this file +## [v3.5.7] - 2024-12-01 +### New Features +- IncrementColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2096 +- Add setFilterPopoverAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2101 + +### Tweaks +- Remove View TypeHinting in blades due to reported errors by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2097 + +### Blades +- Remove $component from blades to improve performance by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2098 + +### Testing +- Exclude config/database from sources by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2102 +- Add missing tests for WithCustomisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2104 +- Ignore WithEvents Coverage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2105 +- Add Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2106 +- Add extra Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2107 + + ## [v3.5.6] - 2024-11-28 ### New Features - Add Icon to Search Input by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2092 diff --git a/docs/column-types/increment_column.md b/docs/column-types/increment_column.md new file mode 100644 index 000000000..76ea7496c --- /dev/null +++ b/docs/column-types/increment_column.md @@ -0,0 +1,12 @@ +--- +title: Increment Column (beta) +weight: 12 +--- + +The IncrementColumn provides an easy way to display the row's index in the loop. + +Please note - this is not linked to the row's primary key! + +```php + IncrementColumn::make('#'), +``` \ No newline at end of file diff --git a/docs/column-types/link_columns.md b/docs/column-types/link_columns.md index 1e4aa7fa1..7c36ee077 100644 --- a/docs/column-types/link_columns.md +++ b/docs/column-types/link_columns.md @@ -1,6 +1,6 @@ --- title: Link Columns -weight: 12 +weight: 13 --- Link columns provide a way to display HTML links in your table without having to use `format()` or partial views: diff --git a/docs/column-types/livewire_component_column.md b/docs/column-types/livewire_component_column.md index 6a6af2eea..ebeb72724 100644 --- a/docs/column-types/livewire_component_column.md +++ b/docs/column-types/livewire_component_column.md @@ -1,6 +1,6 @@ --- title: Livewire Component (beta) -weight: 13 +weight: 14 --- Livewire Component Columns allow for the use of a Livewire Component as a Column. diff --git a/docs/column-types/sum_column.md b/docs/column-types/sum_column.md index b15288ef2..638818b23 100644 --- a/docs/column-types/sum_column.md +++ b/docs/column-types/sum_column.md @@ -1,6 +1,6 @@ --- title: Sum Columns (beta) -weight: 14 +weight: 15 --- Sum columns provide an easy way to display the "Sum" of a field on a relation. diff --git a/docs/column-types/view_component_column.md b/docs/column-types/view_component_column.md index f3dd04276..5fdb4b46d 100644 --- a/docs/column-types/view_component_column.md +++ b/docs/column-types/view_component_column.md @@ -1,6 +1,6 @@ --- title: View Component Columns -weight: 15 +weight: 16 --- View Component columns let you specify a component name and attributes and provide attributes to the View Component. This will render the View Component in it's entirety. diff --git a/docs/column-types/wire_link_column.md b/docs/column-types/wire_link_column.md index 253544cd0..63c23e8a2 100644 --- a/docs/column-types/wire_link_column.md +++ b/docs/column-types/wire_link_column.md @@ -1,6 +1,6 @@ --- title: Wire Link Column (beta) -weight: 16 +weight: 17 --- WireLink columns provide a way to display Wired Links in your table without having to use `format()` or partial views, with or without a Confirmation Message diff --git a/docs/filters/available-methods.md b/docs/filters/available-methods.md index 5246704e9..820916003 100644 --- a/docs/filters/available-methods.md +++ b/docs/filters/available-methods.md @@ -206,6 +206,30 @@ public function configure(): void } ``` +### setFilterPopoverAttributes + +Allows for the customisation of the appearance of the Filter Popover Menu. + +Note the addition of a "default-width" boolean, allowing you to customise the width more smoothly without impacting other applied classes. + +You may also replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +You can also replace the default transition behaviours (Tailwind) by specifying replacement attributes in the array. + +```php +public function configure(): void +{ + $this->setFilterPopoverAttributes( + [ + 'class' => 'w-96', + 'default-width' => false, + 'default-colors' => true, + 'default-styling' => true, + 'x-transition:enter' => 'transition ease-out duration-100', + ] + ); +} +``` ---- diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5dea165fe..1d717c349 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,8 +21,6 @@ - config - database src diff --git a/resources/views/components/pagination.blade.php b/resources/views/components/pagination.blade.php index dedf4507d..4a9ffca95 100644 --- a/resources/views/components/pagination.blade.php +++ b/resources/views/components/pagination.blade.php @@ -1,4 +1,4 @@ -@aware(['component','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) +@aware(['isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) @includeWhen( $this->hasConfigurableAreaFor('before-pagination'), diff --git a/resources/views/components/table.blade.php b/resources/views/components/table.blade.php index 331c0b25f..87d0c3c05 100644 --- a/resources/views/components/table.blade.php +++ b/resources/views/components/table.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap']) +@aware([ 'tableName','isTailwind','isBootstrap']) @php $customAttributes = [ diff --git a/resources/views/components/table/collapsed-columns.blade.php b/resources/views/components/table/collapsed-columns.blade.php index b15e9cf20..f773bd8ae 100644 --- a/resources/views/components/table/collapsed-columns.blade.php +++ b/resources/views/components/table/collapsed-columns.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName', 'primaryKey','isTailwind','isBootstrap']) +@aware([ 'tableName', 'primaryKey','isTailwind','isBootstrap']) @props(['row', 'rowIndex']) @php @@ -50,7 +50,6 @@ colspan="{{ $colspan }}" >
- @php /** @var \Rappasoft\LaravelLivewireTables\Views\Column $column */ @endphp @foreach($columns as $colIndex => $column) @continue($column->isHidden()) @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) diff --git a/resources/views/components/table/empty.blade.php b/resources/views/components/table/empty.blade.php index a5f1b5d22..705f93d48 100644 --- a/resources/views/components/table/empty.blade.php +++ b/resources/views/components/table/empty.blade.php @@ -1,4 +1,4 @@ -@aware(['component','isTailwind','isBootstrap']) +@aware(['isTailwind','isBootstrap']) @php($attributes = $attributes->merge(['wire:key' => 'empty-message-'.$this->getId()])) diff --git a/resources/views/components/table/td.blade.php b/resources/views/components/table/td.blade.php index 8320d2d9f..546bf33fe 100644 --- a/resources/views/components/table/td.blade.php +++ b/resources/views/components/table/td.blade.php @@ -1,8 +1,7 @@ -@aware(['component', 'row', 'rowIndex', 'tableName', 'primaryKey','isTailwind','isBootstrap']) +@aware([ 'row', 'rowIndex', 'tableName', 'primaryKey','isTailwind','isBootstrap']) @props(['column', 'colIndex']) @php - /** @var \Rappasoft\LaravelLivewireTables\Views\Column $column */ $customAttributes = $this->getTdAttributes($column, $row, $colIndex, $rowIndex) @endphp diff --git a/resources/views/components/table/td/bulk-actions.blade.php b/resources/views/components/table/td/bulk-actions.blade.php index 918743395..df5338f7f 100644 --- a/resources/views/components/table/td/bulk-actions.blade.php +++ b/resources/views/components/table/td/bulk-actions.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','primaryKey']) +@aware([ 'tableName','primaryKey']) @props(['row', 'rowIndex']) @php diff --git a/resources/views/components/table/td/collapsed-columns.blade.php b/resources/views/components/table/td/collapsed-columns.blade.php index 166a62138..3bf65e170 100644 --- a/resources/views/components/table/td/collapsed-columns.blade.php +++ b/resources/views/components/table/td/collapsed-columns.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap']) +@aware([ 'tableName','isTailwind','isBootstrap']) @props(['rowIndex', 'hidden' => false]) @if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) diff --git a/resources/views/components/table/td/plain.blade.php b/resources/views/components/table/td/plain.blade.php index 824bcf2af..417f6c6b6 100644 --- a/resources/views/components/table/td/plain.blade.php +++ b/resources/views/components/table/td/plain.blade.php @@ -1,7 +1,6 @@ -@aware(['component', 'rowIndex', 'rowID','isTailwind','isBootstrap']) +@aware([ 'rowIndex', 'rowID','isTailwind','isBootstrap']) @props(['column' => null, 'customAttributes' => [], 'displayMinimisedOnReorder' => false, 'hideUntilReorder' => false]) -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Column|null $column */ @endphp @if ($isTailwind) getTheme()) diff --git a/resources/views/components/table/th.blade.php b/resources/views/components/table/th.blade.php index ee837bf28..525833fe7 100644 --- a/resources/views/components/table/th.blade.php +++ b/resources/views/components/table/th.blade.php @@ -1,8 +1,7 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap']) +@aware([ 'tableName','isTailwind','isBootstrap']) @props(['column', 'index']) @php - /** @var \Rappasoft\LaravelLivewireTables\Views\Column $column */ $attributes = $attributes->merge(['wire:key' => $tableName . '-header-col-'.$column->getSlug()]); $allThAttributes = $this->getAllThAttributes($column); diff --git a/resources/views/components/table/th/bulk-actions.blade.php b/resources/views/components/table/th/bulk-actions.blade.php index c5c6d3e6c..d15f5a728 100644 --- a/resources/views/components/table/th/bulk-actions.blade.php +++ b/resources/views/components/table/th/bulk-actions.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName']) @php $customAttributes = $this->hasBulkActionsThAttributes ? $this->getBulkActionsThAttributes : $this->getAllThAttributes($this->getBulkActionsColumn())['customAttributes']; diff --git a/resources/views/components/table/th/collapsed-columns.blade.php b/resources/views/components/table/th/collapsed-columns.blade.php index 4965c2dd2..eebc53e70 100644 --- a/resources/views/components/table/th/collapsed-columns.blade.php +++ b/resources/views/components/table/th/collapsed-columns.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap']) +@aware([ 'tableName','isTailwind','isBootstrap']) @if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) @if ($isTailwind) diff --git a/resources/views/components/table/th/plain.blade.php b/resources/views/components/table/th/plain.blade.php index 3a0a56d36..0b9c8326e 100644 --- a/resources/views/components/table/th/plain.blade.php +++ b/resources/views/components/table/th/plain.blade.php @@ -1,4 +1,4 @@ -@aware(['component','isTailwind','isBootstrap']) +@aware(['isTailwind','isBootstrap']) @props(['displayMinimisedOnReorder' => false, 'hideUntilReorder' => false, 'customAttributes' => ['default' => true]]) bulkActionsAreEnabled() && $this->hasBulkActions()) @php diff --git a/resources/views/components/table/tr/footer.blade.php b/resources/views/components/table/tr/footer.blade.php index ba0ecc51e..d9681d779 100644 --- a/resources/views/components/table/tr/footer.blade.php +++ b/resources/views/components/table/tr/footer.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName']) [], 'displayMinimisedOnReorder' => true]) @if ($isTailwind) diff --git a/resources/views/components/table/tr/secondary-header.blade.php b/resources/views/components/table/tr/secondary-header.blade.php index a6a7cc5f3..6e3ca28c0 100644 --- a/resources/views/components/table/tr/secondary-header.blade.php +++ b/resources/views/components/table/tr/secondary-header.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName']) getToolsAttributesBag())
'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false, 'for' => null]) @php - /** @var \Rappasoft\LaravelLivewireTables\Views\Filter $filter */ $filterLabelAttributes = $filter->getFilterLabelAttributes(); $customLabelAttributes = $filter->getLabelAttributes(); @endphp diff --git a/resources/views/components/tools/filter-pills.blade.php b/resources/views/components/tools/filter-pills.blade.php index 400de52b9..c0817ea97 100644 --- a/resources/views/components/tools/filter-pills.blade.php +++ b/resources/views/components/tools/filter-pills.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) @if ($this->filtersAreEnabled() && $this->filterPillsAreEnabled() && $this->hasAppliedVisibleFiltersForPills())
@@ -14,7 +14,6 @@ @foreach($this->getAppliedFiltersWithValues() as $filterSelectName => $value) - @php /** @var \Rappasoft\LaravelLivewireTables\Views\Filter $filter */ @endphp @php($filter = $this->getFilterByKey($filterSelectName)) @continue(is_null($filter) || $filter->isHiddenFromPills()) @php( $filterPillTitle = $filter->getFilterPillTitle()) diff --git a/resources/views/components/tools/filters/boolean.blade.php b/resources/views/components/tools/filters/boolean.blade.php index ce7eb38c5..abc983581 100644 --- a/resources/views/components/tools/filters/boolean.blade.php +++ b/resources/views/components/tools/filters/boolean.blade.php @@ -1,5 +1,4 @@ @php - /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\BooleanFilter $filter */ $defaultValue = ($filter->hasFilterDefaultValue() ? (bool) $filter->getFilterDefaultValue() : false) @endphp
getKey(); @endphp diff --git a/resources/views/components/tools/filters/date.blade.php b/resources/views/components/tools/filters/date.blade.php index 3d008c9c2..e3c75f0b0 100644 --- a/resources/views/components/tools/filters/date.blade.php +++ b/resources/views/components/tools/filters/date.blade.php @@ -1,4 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\DateFilter $filter */ @endphp
diff --git a/resources/views/components/tools/filters/livewire-component-array-filter.blade.php b/resources/views/components/tools/filters/livewire-component-array-filter.blade.php index e3b5f32f8..237d062fa 100644 --- a/resources/views/components/tools/filters/livewire-component-array-filter.blade.php +++ b/resources/views/components/tools/filters/livewire-component-array-filter.blade.php @@ -1,5 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\LivewireComponentArrayFilter $filter */ @endphp -
diff --git a/resources/views/components/tools/filters/livewire-component-filter.blade.php b/resources/views/components/tools/filters/livewire-component-filter.blade.php index 1b0efa654..a430faf9f 100644 --- a/resources/views/components/tools/filters/livewire-component-filter.blade.php +++ b/resources/views/components/tools/filters/livewire-component-filter.blade.php @@ -1,5 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\LivewireComponentFilter $filter */ @endphp -
diff --git a/resources/views/components/tools/filters/multi-select-dropdown.blade.php b/resources/views/components/tools/filters/multi-select-dropdown.blade.php index f1aa4afd1..a9c86ff68 100644 --- a/resources/views/components/tools/filters/multi-select-dropdown.blade.php +++ b/resources/views/components/tools/filters/multi-select-dropdown.blade.php @@ -1,4 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\MultiSelectDropdownFilter $filter */ @endphp
diff --git a/resources/views/components/tools/filters/multi-select.blade.php b/resources/views/components/tools/filters/multi-select.blade.php index 97cc7edf7..582848bd3 100644 --- a/resources/views/components/tools/filters/multi-select.blade.php +++ b/resources/views/components/tools/filters/multi-select.blade.php @@ -1,4 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\MultiSelectFilter $filter */ @endphp
diff --git a/resources/views/components/tools/filters/number-range.blade.php b/resources/views/components/tools/filters/number-range.blade.php index f4ebef1a4..ecdc29573 100644 --- a/resources/views/components/tools/filters/number-range.blade.php +++ b/resources/views/components/tools/filters/number-range.blade.php @@ -1,5 +1,4 @@ @php - /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\NumberRangeFilter $filter */ $filterKey = $filter->getKey(); $currentMin = $minRange = $filter->getConfig('minRange'); $currentMax = $maxRange = $filter->getConfig('maxRange'); diff --git a/resources/views/components/tools/filters/number.blade.php b/resources/views/components/tools/filters/number.blade.php index c130ef6d1..bca4f1956 100644 --- a/resources/views/components/tools/filters/number.blade.php +++ b/resources/views/components/tools/filters/number.blade.php @@ -1,5 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\NumberFilter $filter */ @endphp -
diff --git a/resources/views/components/tools/filters/select.blade.php b/resources/views/components/tools/filters/select.blade.php index 9eb3c3fdd..7ff281a76 100644 --- a/resources/views/components/tools/filters/select.blade.php +++ b/resources/views/components/tools/filters/select.blade.php @@ -1,5 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\SelectFilter $filter */ @endphp -
diff --git a/resources/views/components/tools/filters/text-field.blade.php b/resources/views/components/tools/filters/text-field.blade.php index b87f22b08..edf6898bc 100644 --- a/resources/views/components/tools/filters/text-field.blade.php +++ b/resources/views/components/tools/filters/text-field.blade.php @@ -1,4 +1,3 @@ -@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\TextFilter $filter */ @endphp
diff --git a/resources/views/components/tools/sorting-pills.blade.php b/resources/views/components/tools/sorting-pills.blade.php index 8e959e3eb..6e4266583 100644 --- a/resources/views/components/tools/sorting-pills.blade.php +++ b/resources/views/components/tools/sorting-pills.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) @if ($this->isTailwind)
@@ -7,7 +7,6 @@ {{ __($this->getLocalisationPath.'Applied Sorting') }}: @foreach($this->getSorts() as $columnSelectName => $direction) - @php /** @var \Rappasoft\LaravelLivewireTables\Views\Column|null $column */ @endphp @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @continue(is_null($column)) @@ -49,7 +48,6 @@ class="focus:outline-none active:outline-none" {{ __($this->getLocalisationPath.'Applied Sorting') }}: @foreach($this->getSorts() as $columnSelectName => $direction) - @php /** @var \Rappasoft\LaravelLivewireTables\Views\Column|null $column */ @endphp @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @continue(is_null($column)) @@ -90,7 +88,6 @@ class="badge badge-pill badge-light" {{ __($this->getLocalisationPath.'Applied Sorting') }}: @foreach($this->getSorts() as $columnSelectName => $direction) - @php /** @var \Rappasoft\LaravelLivewireTables\Views\Column|null $column */ @endphp @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @continue(is_null($column)) diff --git a/resources/views/components/tools/toolbar.blade.php b/resources/views/components/tools/toolbar.blade.php index bb3d57e97..36a78e787 100644 --- a/resources/views/components/tools/toolbar.blade.php +++ b/resources/views/components/tools/toolbar.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap']) +@aware([ 'tableName','isTailwind','isBootstrap']) @props([]) @php($toolBarAttributes = $this->getToolBarAttributesBag()) diff --git a/resources/views/components/tools/toolbar/items/bulk-actions.blade.php b/resources/views/components/tools/toolbar/items/bulk-actions.blade.php index e4c9b9b25..92180299c 100644 --- a/resources/views/components/tools/toolbar/items/bulk-actions.blade.php +++ b/resources/views/components/tools/toolbar/items/bulk-actions.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])