Skip to content

Commit e273ef7

Browse files
authored
Merge pull request #391 from rappasoft/develop
v1.11.0
2 parents 7df7c00 + e32165b commit e273ef7

File tree

12 files changed

+69
-8
lines changed

12 files changed

+69
-8
lines changed

CHANGELOG.md

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

55
## [Unreleased]
66

7+
## [1.11.0] - 2021-07-10
8+
9+
### Added
10+
11+
- [Added `addAttributes` method to column headers](https://github.com/rappasoft/laravel-livewire-tables/pull/379)
12+
13+
### Changed
14+
15+
- Increased minimum Livewire version
16+
- Added default empty message to lang file.
17+
- [Fix people messing with sort direction from URL](https://github.com/rappasoft/laravel-livewire-tables/pull/389)
18+
- [Check to make sure column exists before sorting](https://github.com/rappasoft/laravel-livewire-tables/pull/390)
19+
- Removed ability to alter per page dropdown select to bypass allowed values.
20+
721
## [1.10.4] - 2021-06-23
822

923
### Added
@@ -414,7 +428,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
414428

415429
- Initial release
416430

417-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.4...development
431+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.11.0...development
432+
[1.11.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.4...v1.11.0
418433
[1.10.4]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.3...v1.10.4
419434
[1.10.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.2...v1.10.3
420435
[1.10.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.1...v1.10.2

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "^7.4|^8.0",
22-
"livewire/livewire": "^2.0",
22+
"livewire/livewire": "^2.5.3",
2323
"spatie/laravel-package-tools": "^1.4.3",
2424
"illuminate/contracts": "^8.0"
2525
},

resources/lang/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
"results": "results",
2222
"rows": "rows",
2323
"rows, do you want to select all": "rows, do you want to select all",
24+
"No items found. Try narrowing your search.": "No items found. Try narrowing your search.",
2425
"to": "to"
2526
}

resources/views/bootstrap-4/components/table/heading.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
'sortable' => null,
55
'direction' => null,
66
'text' => null,
7+
'customAttributes' => [],
78
])
89

910
@unless ($sortingEnabled && $sortable)
10-
<th {{ $attributes->only('class') }}>
11+
<th {{ $attributes->merge($customAttributes) }}>
1112
{{ $text ?? $slot }}
1213
</th>
1314
@else
1415
<th
1516
wire:click="sortBy('{{ $column }}', '{{ $text ?? $column }}')"
16-
{{ $attributes->only('class') }}
17+
{{ $attributes->merge($customAttributes) }}
1718
style="cursor:pointer;"
1819
>
1920
<div class="d-flex align-items-center">

resources/views/bootstrap-4/includes/table.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
:direction="$column->column() ? $sorts[$column->column()] ?? null : null"
2828
:text="$column->text() ?? ''"
2929
:class="$column->class() ?? ''"
30+
:customAttributes="$column->attributes()"
3031
/>
3132
@endif
3233
@endif

resources/views/bootstrap-5/components/table/heading.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
'sortable' => null,
55
'direction' => null,
66
'text' => null,
7+
'customAttributes' => [],
78
])
89

910
@unless ($sortingEnabled && $sortable)
10-
<th {{ $attributes->only('class') }}>
11+
<th {{ $attributes->merge($customAttributes) }}>
1112
{{ $text ?? $slot }}
1213
</th>
1314
@else
1415
<th
1516
wire:click="sortBy('{{ $column }}', '{{ $text ?? $column }}')"
16-
{{ $attributes->only('class') }}
17+
{{ $attributes->merge($customAttributes) }}
1718
style="cursor:pointer;"
1819
>
1920
<div class="d-flex align-items-center">

resources/views/bootstrap-5/includes/table.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class="form-check-input"
2828
:direction="$column->column() ? $sorts[$column->column()] ?? null : null"
2929
:text="$column->text() ?? ''"
3030
:class="$column->class() ?? ''"
31+
:customAttributes="$column->attributes()"
3132
/>
3233
@endif
3334
@endif

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
'sortable' => null,
55
'direction' => null,
66
'text' => null,
7+
'customAttributes' => [],
78
])
89

910
<th
10-
{{ $attributes->merge(['class' => 'px-3 py-2 md:px-6 md:py-3 bg-gray-50'])->only('class') }}
11+
{{ $attributes->merge(array_merge(['class' => 'px-3 py-2 md:px-6 md:py-3 bg-gray-50'], $customAttributes)) }}
1112
>
1213
@unless ($sortingEnabled && $sortable)
1314
<span class="block text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">

resources/views/tailwind/includes/table.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class="rounded-md shadow-sm border-gray-300 block transition duration-150 ease-i
3030
:direction="$column->column() ? $sorts[$column->column()] ?? null : null"
3131
:text="$column->text() ?? ''"
3232
:class="$column->class() ?? ''"
33+
:customAttributes="$column->attributes()"
3334
/>
3435
@endif
3536
@endif

src/Traits/WithPerPagePagination.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public function mountWithPerPagePagination(): void
2929

3030
public function updatedPerPage($value): void
3131
{
32+
if (! in_array($value, $this->perPageAccepted, false)) {
33+
$value = $this->perPage = $this->perPageAccepted[0] ?? 10;
34+
}
35+
3236
if (in_array(session()->get($this->getPerPagePaginationSessionKey(), $this->perPage), $this->perPageAccepted, true)) {
3337
session()->put($this->getPerPagePaginationSessionKey(), (int) $value);
3438
} else {

0 commit comments

Comments
 (0)