Skip to content

Commit 7f672d8

Browse files
authored
Merge pull request #530 from rappasoft/develop
v1.20.0
2 parents cd08fdf + 3f66999 commit 7f672d8

File tree

9 files changed

+72
-23
lines changed

9 files changed

+72
-23
lines changed

CHANGELOG.md

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

55
## [Unreleased]
66

7+
## [1.20.0] - 2021-10-25
8+
9+
### Added
10+
11+
- Singular row translation - https://github.com/rappasoft/laravel-livewire-tables/pull/526
12+
13+
### Changed
14+
15+
- Fixed bulk actions dropdown on Bootstrap - https://github.com/rappasoft/laravel-livewire-tables/pull/519
16+
- Fixed bulk row/select with pagination off - https://github.com/rappasoft/laravel-livewire-tables/issues/510
17+
- Conditionally show cursor-pointer class instead of inline style - https://github.com/rappasoft/laravel-livewire-tables/pull/529
18+
719
## [1.19.3] - 2021-10-25
820

921
### Changed
@@ -542,7 +554,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
542554

543555
- Initial release
544556

545-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.3...development
557+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.20.0...development
558+
[1.20.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.3...v1.20.0
546559
[1.19.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.2...v1.19.3
547560
[1.19.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.1...v1.19.2
548561
[1.19.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.18.0...v1.19.1

resources/lang/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"of": "de",
2020
"Reorder": "Reordenar",
2121
"results": "resultados",
22+
"row": "fila",
2223
"rows": "filas",
2324
"rows, do you want to select all": "filas, desea seleccionar todas",
2425
"No items found. Try to broaden your search.": "No se encontraron elementos. Intente ampliar la búsqueda.",

resources/views/bootstrap-4/includes/bulk-actions.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@if ($this->showBulkActionsDropdown)
2-
<div class="mb-3 mb-md-0">
2+
<div class="mb-3 mb-md-0" id="{{ $bulkKey = \Illuminate\Support\Str::random() }}-bulkActionsWrapper">
33
<div class="dropdown d-block d-md-inline">
4-
<button class="btn dropdown-toggle d-block w-100 d-md-inline" type="button" id="bulkActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
4+
<button class="btn dropdown-toggle d-block w-100 d-md-inline" type="button" id="{{ $bulkKey }}-bulkActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
55
@lang('Bulk Actions')
66
</button>
77

8-
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="bulkActions">
8+
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="{{ $bulkKey }}-bulkActions">
99
@foreach($this->bulkActions as $action => $title)
1010
<a
1111
href="#"

resources/views/bootstrap-4/includes/bulk-select-row.blade.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
@if ($bulkActionsEnabled && count($this->bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
1+
@if (
2+
$bulkActionsEnabled &&
3+
count($this->bulkActions) &&
4+
(
5+
(
6+
$paginationEnabled && (
7+
($selectPage && $rows->total() > $rows->count()) ||
8+
count($selected)
9+
)
10+
) ||
11+
count($selected)
12+
)
13+
)
214
<x-livewire-tables::bs4.table.row wire:key="row-message">
315
<x-livewire-tables::bs4.table.cell colspan="{{ $colspan }}">
4-
@if (count($selected) && !$selectAll && !$selectPage)
16+
@if ((!$paginationEnabled && $selectPage) || (count($selected) && $paginationEnabled && !$selectAll && !$selectPage))
517
<div>
618
<span>
719
@lang('You have selected')

resources/views/bootstrap-5/includes/bulk-actions.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@if ($this->showBulkActionsDropdown)
2-
<div class="mb-3 mb-md-0">
2+
<div class="mb-3 mb-md-0" id="{{ $bulkKey = \Illuminate\Support\Str::random() }}-bulkActionsWrapper">
33
<div class="dropdown d-block d-md-inline">
4-
<button class="btn dropdown-toggle d-block w-100 d-md-inline" type="button" id="bulkActions" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
4+
<button class="btn dropdown-toggle d-block w-100 d-md-inline" type="button" id="{{ $bulkKey }}-bulkActions" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
55
@lang('Bulk Actions')
66
</button>
77

8-
<div class="dropdown-menu dropdown-menu-end w-100" aria-labelledby="bulkActions">
8+
<div class="dropdown-menu dropdown-menu-end w-100" aria-labelledby="{{ $bulkKey }}-bulkActions">
99
@foreach($this->bulkActions as $action => $title)
1010
<a
1111
href="#"

resources/views/bootstrap-5/includes/bulk-select-row.blade.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
@if ($bulkActionsEnabled && count($this->bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
1+
@if (
2+
$bulkActionsEnabled &&
3+
count($this->bulkActions) &&
4+
(
5+
(
6+
$paginationEnabled && (
7+
($selectPage && $rows->total() > $rows->count()) ||
8+
count($selected)
9+
)
10+
) ||
11+
count($selected)
12+
)
13+
)
214
<x-livewire-tables::bs5.table.row wire:key="row-message">
315
<x-livewire-tables::bs5.table.cell colspan="{{ $colspan }}">
4-
@if (count($selected) && !$selectAll && !$selectPage)
16+
@if ((!$paginationEnabled && $selectPage) || (count($selected) && $paginationEnabled && !$selectAll && !$selectPage))
517
<div>
618
<span>
719
@lang('You have selected')

resources/views/tailwind/components/table/row.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
@endif
88

99
<tr
10-
{{ $attributes->merge($customAttributes) }}
10+
{{ $attributes->merge($customAttributes)->class(['cursor-pointer' => $url]) }}
1111

1212
@if ($url)
1313
onclick="window.open('{{ $url }}', '{{ $target }}')"
14-
style="cursor:pointer"
1514
@endif
1615
>
1716
{{ $slot }}

resources/views/tailwind/includes/bulk-select-row.blade.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
@if ($bulkActionsEnabled && count($this->bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
1+
@if (
2+
$bulkActionsEnabled &&
3+
count($this->bulkActions) &&
4+
(
5+
(
6+
$paginationEnabled && (
7+
($selectPage && $rows->total() > $rows->count()) ||
8+
count($selected)
9+
)
10+
) ||
11+
count($selected)
12+
)
13+
)
214
<x-livewire-tables::table.row wire:key="row-message" class="bg-indigo-50 dark:bg-gray-900 dark:text-white">
315
<x-livewire-tables::table.cell :colspan="$colspan">
4-
@if (count($selected) && !$selectAll && !$selectPage)
16+
@if ((!$paginationEnabled && $selectPage) || (count($selected) && $paginationEnabled && !$selectAll && !$selectPage))
517
<div>
618
<span>
719
@lang('You have selected')

src/DataTableComponent.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ abstract class DataTableComponent extends Component
7979
*/
8080
public bool $responsive = true;
8181

82-
/**
83-
* Name of the page parameter for pagination
84-
* Good to change the default if you have more than one datatable on a page.
85-
*
86-
* @var string
87-
*/
88-
protected string $pageName = 'page';
89-
9082
/**
9183
* Unique name to use for this table if you want the 'per page' options to be remembered on a per table basis.
9284
* If not, all 'per page' stored in the session will default to the same option for every table with this default name.
@@ -97,6 +89,14 @@ abstract class DataTableComponent extends Component
9789
*/
9890
protected string $tableName = 'table';
9991

92+
/**
93+
* Name of the page parameter for pagination
94+
* Good to change the default if you have more than one datatable on a page.
95+
*
96+
* @var string
97+
*/
98+
protected string $pageName = 'page';
99+
100100
/**
101101
* @var \null[][]
102102
*/

0 commit comments

Comments
 (0)