Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions docs/column-types/increment_column.md
Original file line number Diff line number Diff line change
@@ -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('#'),
```
2 changes: 1 addition & 1 deletion docs/column-types/link_columns.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/column-types/livewire_component_column.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/column-types/sum_column.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/column-types/view_component_column.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/column-types/wire_link_column.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 24 additions & 0 deletions docs/filters/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
);
}
```

----

Expand Down
2 changes: 0 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
</testsuites>
<source>
<include>
<directory>config</directory>
<directory>database</directory>
<directory>src</directory>
</include>
</source>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/pagination.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])
@aware(['isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])

@includeWhen(
$this->hasConfigurableAreaFor('before-pagination'),
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap'])
@aware([ 'tableName','isTailwind','isBootstrap'])

@php
$customAttributes = [
Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/table/collapsed-columns.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName', 'primaryKey','isTailwind','isBootstrap'])
@aware([ 'tableName', 'primaryKey','isTailwind','isBootstrap'])
@props(['row', 'rowIndex'])

@php
Expand Down Expand Up @@ -50,7 +50,6 @@
colspan="{{ $colspan }}"
>
<div>
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Column $column */ @endphp
@foreach($columns as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/empty.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component','isTailwind','isBootstrap'])
@aware(['isTailwind','isBootstrap'])

@php($attributes = $attributes->merge(['wire:key' => 'empty-message-'.$this->getId()]))

Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/table/td.blade.php
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/td/bulk-actions.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','primaryKey'])
@aware([ 'tableName','primaryKey'])
@props(['row', 'rowIndex'])

@php
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap'])
@aware([ 'tableName','isTailwind','isBootstrap'])
@props(['rowIndex', 'hidden' => false])

@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns())
Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/table/td/plain.blade.php
Original file line number Diff line number Diff line change
@@ -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)
<td x-cloak {{ $attributes
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/td/reorder.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName'])
@aware([ 'tableName'])
@props(['rowID', 'rowIndex'])

@php($theme = $this->getTheme())
Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/table/th.blade.php
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/th/bulk-actions.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName'])
@aware([ 'tableName'])
@php
$customAttributes = $this->hasBulkActionsThAttributes ? $this->getBulkActionsThAttributes : $this->getAllThAttributes($this->getBulkActionsColumn())['customAttributes'];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap'])
@aware([ 'tableName','isTailwind','isBootstrap'])

@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns())
@if ($isTailwind)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/th/plain.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component','isTailwind','isBootstrap'])
@aware(['isTailwind','isBootstrap'])
@props(['displayMinimisedOnReorder' => false, 'hideUntilReorder' => false, 'customAttributes' => ['default' => true]])

<th x-cloak {{ $attributes }} scope="col"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/tr.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','primaryKey','isTailwind','isBootstrap'])
@aware([ 'tableName','primaryKey','isTailwind','isBootstrap'])
@props(['row', 'rowIndex'])

@php
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/tr/bulk-actions.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap'])
@aware([ 'tableName','isTailwind','isBootstrap'])

@if ($this->bulkActionsAreEnabled() && $this->hasBulkActions())
@php
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/tr/footer.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName'])
@aware([ 'tableName'])

<x-livewire-tables::table.tr.plain
:customAttributes="$this->getFooterTrAttributes($this->getRows)"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table/tr/plain.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component','isTailwind','isBootstrap'])
@aware(['isTailwind','isBootstrap'])
@props(['customAttributes' => [], 'displayMinimisedOnReorder' => true])

@if ($isTailwind)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName'])
@aware([ 'tableName'])

<x-livewire-tables::table.tr.plain
:customAttributes="$this->getSecondaryHeaderTrAttributes($this->getRows)"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/tools.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component','isTailwind','isBootstrap'])
@aware(['isTailwind','isBootstrap'])
@php($toolsAttributes = $this->getToolsAttributesBag())

<div {{
Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/tools/filter-label.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@aware(['component', 'tableName'])
@aware([ 'tableName'])
@props(['filter', 'filterLayout' => '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
Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/tools/filter-pills.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])
@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])

@if ($this->filtersAreEnabled() && $this->filterPillsAreEnabled() && $this->hasAppliedVisibleFiltersForPills())
<div>
Expand All @@ -14,7 +14,6 @@
</small>

@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())
Expand Down
1 change: 0 additions & 1 deletion resources/views/components/tools/filters/boolean.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@php
/** @var \Rappasoft\LaravelLivewireTables\Views\Filters\BooleanFilter $filter */
$defaultValue = ($filter->hasFilterDefaultValue() ? (bool) $filter->getFilterDefaultValue() : false)
@endphp
<div class="flex flex-cols"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@php
/** @var \Rappasoft\LaravelLivewireTables\Views\Filters\DateRangeFilter $filter */
$filterKey = $filter->getKey();
@endphp

Expand Down
1 change: 0 additions & 1 deletion resources/views/components/tools/filters/date.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\DateFilter $filter */ @endphp
<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />
<div @class([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\DateTimeFilter $filter */ @endphp
<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\LivewireComponentArrayFilter $filter */ @endphp

<div wire:key="filterComponents.{{ $filter->getKey() }}-wrapper">
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />
<livewire:dynamic-component :is="$livewireComponent" :tableComponent="get_class($this)" :filterKey="$filter->getKey()" :$tableName :key="'filterComponents-'.$filter->getKey()" wire:model="filterComponents.{{ $filter->getKey() }}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\LivewireComponentFilter $filter */ @endphp

<div wire:key="filterComponents.{{ $filter->getKey() }}-wrapper">
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />
<livewire:dynamic-component :is="$livewireComponent" :tableComponent="get_class($this)" :filterKey="$filter->getKey()" :$tableName :key="'filterComponents-'.$filter->getKey()" wire:model.live="filterComponents.{{ $filter->getKey() }}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\MultiSelectDropdownFilter $filter */ @endphp
<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\MultiSelectFilter $filter */ @endphp
<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />

Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 0 additions & 2 deletions resources/views/components/tools/filters/number.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\NumberFilter $filter */ @endphp

<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />

Expand Down
2 changes: 0 additions & 2 deletions resources/views/components/tools/filters/select.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\SelectFilter $filter */ @endphp

<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\TextFilter $filter */ @endphp
<div>
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />

Expand Down
5 changes: 1 addition & 4 deletions resources/views/components/tools/sorting-pills.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])
@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])

@if ($this->isTailwind)
<div>
Expand All @@ -7,7 +7,6 @@
<small class="text-gray-700 dark:text-white">{{ __($this->getLocalisationPath.'Applied Sorting') }}:</small>

@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))
Expand Down Expand Up @@ -49,7 +48,6 @@ class="focus:outline-none active:outline-none"
<small>{{ __($this->getLocalisationPath.'Applied Sorting') }}:</small>

@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))
Expand Down Expand Up @@ -90,7 +88,6 @@ class="badge badge-pill badge-light"
<small>{{ __($this->getLocalisationPath.'Applied Sorting') }}:</small>

@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))
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/tools/toolbar.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap'])
@aware([ 'tableName','isTailwind','isBootstrap'])
@props([])
@php($toolBarAttributes = $this->getToolBarAttributesBag())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@aware(['component', 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])
@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])
<div
x-data="{ open: false, childElementOpen: false, isTailwind: @js($isTailwind), isBootstrap: @js($isBootstrap) }"
x-cloak x-show="(selectedItems.length > 0 || hideBulkActionsWhenEmpty == false)"
Expand Down
Loading
Loading