Skip to content

Commit e6069cd

Browse files
authored
Merge pull request #854 from rappasoft/develop
v2.8.0
2 parents 60d60c2 + 518e474 commit e6069cd

29 files changed

+477
-52
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
44

55
## [Unreleased]
66

7+
## [2.8.0] - 2022-07-24
8+
9+
### Added
10+
11+
- Added functionality to bookmark or deep link column selection
12+
- Added functionality to identify different datatable components as unique in column selection
13+
- Added funcitonality to configure query string alias
14+
- Added funcitonality to configure session key for column selection (dataTableFingerprint)
15+
- Added functionality to select/desect all columns in column selection dropdown
16+
- Added French translation - https://github.com/rappasoft/laravel-livewire-tables/pull/816
17+
- Added Malay translation - https://github.com/rappasoft/laravel-livewire-tables/pull/821
18+
- Added Dutch translation - https://github.com/rappasoft/laravel-livewire-tables/pull/834
19+
- Added Ukranian translation - https://github.com/rappasoft/laravel-livewire-tables/pull/840
20+
21+
### Changed
22+
23+
- Fixed bug with sort callback on newer versions of Livewire - https://github.com/rappasoft/laravel-livewire-tables/pull/805
24+
- Fixed: Removed :mixed return type hint as it requires PHP8.0 - https://github.com/rappasoft/laravel-livewire-tables/pull/822
725
## [2.7.0] - 2022-05-07
826

927
### Added
@@ -13,6 +31,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1331
- Added functionality to hide individual filters from the active filter count
1432
- Added functionality to say which filters get reset by the clear button
1533
- Added functionality to set filters as secondaryHeader or footer of columns
34+
- Added Brazilian Portuguese translation - https://github.com/rappasoft/laravel-livewire-tables/pull/797
1635

1736
## [2.6.0] - 2022-05-05
1837

@@ -669,7 +688,8 @@ Ground Up Rebuild
669688

670689
- Initial release
671690

672-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v2.7.0...development
691+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v2.8.0...development
692+
[2.8.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v2.7.0...v2.8.0
673693
[2.7.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v2.6.0...v2.7.0
674694
[2.6.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v2.5.0...v2.6.0
675695
[2.5.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v2.4.0...v2.5.0

docs/columns/column-selection.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,19 @@ public function configure(): void
9595
// Shorthand for $this->setRememberColumnSelectionStatus(false)
9696
$this->setRememberColumnSelectionDisabled();
9797
}
98-
```
98+
```
99+
100+
### setDataTableFingerprint
101+
102+
In order to idenfify each table and prevent conflicts on column selection, each table is given a unique fingerprint.
103+
This fingerprint is generated using the static::class name of the component. If you are reusing
104+
the same component in different parts of your application, you may need to set your own custom fingerprint.
105+
106+
```php
107+
public function configure(): void
108+
{
109+
// Default fingerprint is output of protected method dataTableFingerprint()
110+
// Below will prepend the current route name
111+
$this->setDataTableFingerprint(route()->getName() . '-' . $this->dataTableFingerprint());
112+
}
113+
```

docs/columns/other-column-types.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,20 @@ ButtonGroupColumn::make('Actions')
142142
->buttons([
143143
LinkColumn::make('View') // make() has no effect in this case but needs to be set anyway
144144
->title(fn($row) => 'View ' . $row->name)
145-
->location(fn($row) => route('user.show', $row)),
145+
->location(fn($row) => route('user.show', $row))
146146
->attributes(function($row) {
147147
return [
148148
'class' => 'underline text-blue-500 hover:no-underline',
149149
];
150150
}),
151151
LinkColumn::make('Edit')
152152
->title(fn($row) => 'Edit ' . $row->name)
153-
->location(fn($row) => route('user.edit', $row)),
153+
->location(fn($row) => route('user.edit', $row))
154154
->attributes(function($row) {
155155
return [
156156
'target' => '_blank',
157157
'class' => 'underline text-blue-500 hover:no-underline',
158158
];
159159
}),
160160
]),
161-
```
161+
```

docs/misc/multiple-tables.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,14 @@ public function configure(): void
9292
$this->setQueryStringDisabled();
9393
}
9494
```
95+
96+
## Disabling column selection for multiple of the same component
97+
98+
You should also disable the columns selection for those components so the column selection state does not get replaced by one or the other:
99+
100+
```php
101+
public function configure(): void
102+
{
103+
$this->setColumnSelectStatus(false);
104+
}
105+
```

resources/lang/fr.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"All": "Tous",
3+
"Applied Filters": "Filtres appliqués",
4+
"Applied Sorting": "Tris appliqués",
5+
"Bulk Actions": "Actions en masse",
6+
"Clear": "Effacer",
7+
"Columns": "Colonnes",
8+
"Debugging Values": "Debugging Values",
9+
"Done Reordering": "Réordonnancement terminé",
10+
"Filters": "Filtres",
11+
"Remove filter option": "Supprimer l'option de filtrage",
12+
"Remove sort option": "Supprimer l'option de tri",
13+
"Search": "Rechercher",
14+
"Select All": "Tout sélectionner",
15+
"Showing": "Montrant",
16+
"Deselect All": "Tout désélectionner ",
17+
"You are currently selecting all": "Vous êtes en train de sélectionner ",
18+
"You are not connected to the internet.": "Vous n'êtes pas connecté à l'Internet.",
19+
"You have selected": "Vous avez sélectionné",
20+
"of": "sur",
21+
"Reorder": "Réordonner",
22+
"results": "résultats",
23+
"rows": "lignes",
24+
"rows, do you want to select all": "lignes, voulez-vous tout sélectionner ?",
25+
"No items found. Try to broaden your search.": "Aucun élément trouvé. Essayez d'élargir votre recherche.",
26+
"to": "à"
27+
}

resources/lang/ms.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"All": "Semua",
3+
"Applied Filters": "Tapisan Digunakan",
4+
"Applied Sorting": "Susunan Digunakan",
5+
"Bulk Actions": "Tindakan Pukal",
6+
"Clear": "Kosongkan",
7+
"Columns": "Kolum",
8+
"Done Reordering": "Selesai Menyusun Semula",
9+
"Filters": "Tapisan",
10+
"Remove filter option": "Keluarkan pilihan tapisan",
11+
"Remove sort option": "Keluarkan pilihan sususan",
12+
"Search": "Carian",
13+
"Select All": "Pilih Semua",
14+
"Showing": "Menunjukkan",
15+
"Deselect All": "Nyahpilih semua",
16+
"You are currently selecting all": "Anda sedang memilih semua",
17+
"You are not connected to the internet.": "Anda tidak disambungkan ke internet.",
18+
"You have selected": "Anda telah memilih",
19+
"of": "daripada",
20+
"Reorder": "menyusun semula",
21+
"results": "keputusan",
22+
"rows": "barisan",
23+
"rows, do you want to select all": "barisan, adakah anda mahu pilih semua?",
24+
"No items found. Try to broaden your search.": "Tiada data ditemui. Sila perluaskan carian anda",
25+
"to": "ke"
26+
}

resources/lang/nl.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"All": "Alle",
3+
"Applied Filters": "Toegepaste filters",
4+
"Applied Sorting": "Toegepaste sortering",
5+
"Bulk Actions": "Bulkacties",
6+
"Clear": "Wissen",
7+
"Columns": "Kolommen",
8+
"Debugging Values": "Debugging waarden",
9+
"Done Reordering": "Hersortering voltooid",
10+
"Filters": "Filters",
11+
"Remove filter option": "Filteroptie verwijderen",
12+
"Remove sort option": "Sorteeroptie verwijderen",
13+
"Search": "Zoeken",
14+
"Select All": "Alles selecteren",
15+
"Showing": "Toont",
16+
"Deselect All": "Alles deselecteren",
17+
"You are currently selecting all": "U selecteerde alle",
18+
"You are not connected to the internet.": "U bent niet verbonden met het internet.",
19+
"You have selected": "U selecteerde",
20+
"of": "van",
21+
"Reorder": "Hersorteren",
22+
"results": "resultaten",
23+
"rows": "rijen",
24+
"rows, do you want to select all": "rijen, wilt u alles selecteren",
25+
"No items found. Try to broaden your search.": "Geen items gevonden. Probeer uw zoekopdracht te verfijnen.",
26+
"to": "tot"
27+
}

resources/lang/pt_BR.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"All": "Tudo",
3+
"Applied Filters": "Filtros aplicados",
4+
"Applied Sorting": "Ordenação aplicada",
5+
"Bulk Actions": "Ações em massa",
6+
"Clear": "Limpar",
7+
"Columns": "Colunas",
8+
"Done Reordering": "Ordenação finalizada",
9+
"Filters": "Filtros",
10+
"Remove filter option": "Remover opção de filtro",
11+
"Remove sort option": "Remover opção de ordenação",
12+
"Search": "Pesquisar",
13+
"Select All": "Selecionar tudo",
14+
"Showing": "Exibindo",
15+
"Deselect All": "Desmarcar Tudo",
16+
"You are currently selecting all": "Você selecionou tudo",
17+
"You are not connected to the internet.": "Você não está conectado na internet.",
18+
"You have selected": "Você selecionou",
19+
"of": "de",
20+
"Reorder": "Reordenar",
21+
"results": "resultados",
22+
"row": "linha",
23+
"rows": "linhas",
24+
"rows, do you want to select all": "linhas, você deseja selecionar tudo?",
25+
"No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.",
26+
"to": "a"
27+
}

resources/lang/uk.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"All": "Всі",
3+
"Applied Filters": "Застосовані фільтри",
4+
"Applied Sorting": "Застосовані сортування",
5+
"Bulk Actions": "Масові дії",
6+
"Clear": "Очистити",
7+
"Columns": "Колонки",
8+
"Done Reordering": "Сортування виконанно",
9+
"Filters": "Фільтри",
10+
"Remove filter option": "Видалити опцію фільтра",
11+
"Remove sort option": "Видалити параметр сортування",
12+
"Search": "Пошук",
13+
"Select All": "Вибрати все",
14+
"Showing": "Показано",
15+
"Unselect All": "Прибрати вибір усіх",
16+
"You are currently selecting all": "Наразі ви вибираєте всі",
17+
"You are not connected to the internet.": "Ви не підключені до Інтернету.",
18+
"You have selected": "Ви вибрали",
19+
"of": "від",
20+
"Reorder": "Змінити порядок",
21+
"results": "результатів",
22+
"rows": "рядки",
23+
"rows, do you want to select all": "рядків, ви хочете вибрати всі",
24+
"No items found. Try to broaden your search.": "Немає елементів. Спробуйте розширити пошук.",
25+
"to": "до"
26+
}

resources/views/components/tools/toolbar.blade.php

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,26 @@ class="absolute right-0 z-50 mt-2 w-full bg-white rounded-md divide-y divide-gra
246246
>
247247
<div class="bg-white rounded-md shadow-xs dark:bg-gray-700 dark:text-white">
248248
<div class="p-2" role="menu" aria-orientation="vertical" aria-labelledby="column-select-menu">
249+
<div>
250+
<label
251+
wire:loading.attr="disabled"
252+
class="inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait"
253+
>
254+
<input
255+
class="text-indigo-600 transition duration-150 ease-in-out border-gray-300 rounded shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait"
256+
@if($component->allDefaultVisibleColumnsAreSelected())
257+
checked
258+
wire:click="deselectAllColumns"
259+
@else
260+
unchecked
261+
wire:click="selectAllColumns"
262+
@endif
263+
wire:loading.attr="disabled"
264+
type="checkbox"
265+
/>
266+
<span class="ml-2">{{ __('All Columns') }}</span>
267+
</label>
268+
</div>
249269
@foreach($component->getColumns() as $column)
250270
@if ($column->isVisible() && $column->isSelectable())
251271
<div wire:key="columnSelect-{{ $loop->index }}-{{ $component->getTableName() }}">
@@ -260,7 +280,7 @@ class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150
260280
wire:target="selectedColumns"
261281
wire:loading.attr="disabled"
262282
type="checkbox"
263-
value="{{ $column->getHash() }}"
283+
value="{{ $column->getSlug() }}"
264284
/>
265285
<span class="ml-2">{{ $column->getTitle() }}</span>
266286
</label>
@@ -498,6 +518,25 @@ class="dropdown-menu dropdown-menu-right w-100 mt-0 mt-md-3"
498518
x-bind:class="{'show' : open}"
499519
aria-labelledby="columnSelect-{{ $component->getTableName() }}"
500520
>
521+
<div>
522+
<label
523+
wire:loading.attr="disabled"
524+
class="px-2 mb-1"
525+
>
526+
<input
527+
@if($component->allDefaultVisibleColumnsAreSelected())
528+
checked
529+
wire:click="deselectAllColumns"
530+
@else
531+
unchecked
532+
wire:click="selectAllColumns"
533+
@endif
534+
wire:loading.attr="disabled"
535+
type="checkbox"
536+
/>
537+
<span class="ml-2">{{ __('All Columns') }}</span>
538+
</label>
539+
</div>
501540
@foreach($component->getColumns() as $column)
502541
@if ($column->isVisible() && $column->isSelectable())
503542
<div wire:key="columnSelect-{{ $loop->index }}-{{ $component->getTableName() }}">
@@ -511,7 +550,7 @@ class="px-2 {{ $loop->last ? 'mb-0' : 'mb-1' }}"
511550
wire:target="selectedColumns"
512551
wire:loading.attr="disabled"
513552
type="checkbox"
514-
value="{{ $column->getHash() }}"
553+
value="{{ $column->getSlug() }}"
515554
/>
516555
<span class="ml-2">{{ $column->getTitle() }}</span>
517556
</label>
@@ -741,6 +780,25 @@ class="dropdown-menu dropdown-menu-end w-100"
741780
x-bind:class="{'show' : open}"
742781
aria-labelledby="columnSelect-{{ $component->getTableName() }}"
743782
>
783+
<div>
784+
<label
785+
wire:loading.attr="disabled"
786+
class="px-2 mb-1"
787+
>
788+
<input
789+
@if($component->allDefaultVisibleColumnsAreSelected())
790+
checked
791+
wire:click="deselectAllColumns"
792+
@else
793+
unchecked
794+
wire:click="selectAllColumns"
795+
@endif
796+
wire:loading.attr="disabled"
797+
type="checkbox"
798+
/>
799+
<span class="ml-2">{{ __('All Columns') }}</span>
800+
</label>
801+
</div>
744802
@foreach($component->getColumns() as $column)
745803
@if ($column->isVisible() && $column->isSelectable())
746804
<div wire:key="columnSelect-{{ $loop->index }}-{{ $component->getTableName() }}">
@@ -754,7 +812,7 @@ class="px-2 {{ $loop->last ? 'mb-0' : 'mb-1' }}"
754812
wire:target="selectedColumns"
755813
wire:loading.attr="disabled"
756814
type="checkbox"
757-
value="{{ $column->getHash() }}"
815+
value="{{ $column->getSlug() }}"
758816
/>
759817
<span class="ml-2">{{ $column->getTitle() }}</span>
760818
</label>
@@ -813,4 +871,4 @@ class="d-block">
813871

814872
@if ($component->hasConfigurableAreaFor('after-toolbar'))
815873
@include($component->getConfigurableAreaFor('after-toolbar'), $component->getParametersForConfigurableArea('after-toolbar'))
816-
@endif
874+
@endif

0 commit comments

Comments
 (0)