Skip to content

Commit 5ec4a23

Browse files
authored
Merge pull request rappasoft#566 from rappasoft/develop
1.21.0
2 parents 9d6bb5e + 274ab1d commit 5ec4a23

20 files changed

+216
-38
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.21.0] - 2021-11-20
8+
9+
### Added
10+
11+
- Added Chinese translation - https://github.com/rappasoft/laravel-livewire-tables/pull/540
12+
- Added 'select all' checkbox for multiselect filters - https://github.com/rappasoft/laravel-livewire-tables/pull/551
13+
- Added attributes to filters - https://github.com/rappasoft/laravel-livewire-tables/pull/558
14+
- Added 4th option for pills fallback value - https://github.com/rappasoft/laravel-livewire-tables/pull/538
15+
16+
### Changed
17+
18+
- Removed excess left padding on Bootstrap 5 form check on multiselect filters.
19+
- Patch bulk actions random wire:key - https://github.com/rappasoft/laravel-livewire-tables/pull/557
20+
721
## [1.20.1] - 2021-11-01
822

923
### Changed
@@ -561,7 +575,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
561575
- Initial release
562576

563577
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.20.1...development
564-
[1.20.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.3...v1.20.1
578+
[1.21.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.20.1...v1.21.0
579+
[1.20.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.20.0...v1.20.1
565580
[1.20.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.3...v1.20.0
566581
[1.19.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.2...v1.19.3
567582
[1.19.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.19.1...v1.19.2

resources/lang/tw.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/bootstrap-4/components/table/row.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@props(['url' => null, 'target' => '_self', 'reordering' => false, 'customAttributes' => []])
22

3-
@if (!$reordering && $attributes->has('wire:sortable.item'))
3+
@if (!$reordering && (method_exists($attributes, 'has') ? $attributes->has('wire:sortable.item') : array_key_exists('wire:sortable.item', $attributes->getAttributes())))
44
@php
55
$attributes = $attributes->filter(fn ($value, $key) => $key !== 'wire:sortable.item');
66
@endphp

resources/views/bootstrap-4/includes/filter-pills.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
wire:key="filter-pill-{{ $key }}"
1010
class="badge badge-pill badge-info d-inline-flex align-items-center"
1111
>
12-
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
12+
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, isset($customFilters[$key]) && property_exists($customFilters[$key], 'name') ? $customFilters[$key]->name : ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
1313
@if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options'))
1414
@if(is_array($value))
1515
@foreach($value as $selectedValue)

resources/views/bootstrap-4/includes/filter-type-multiselect.blade.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<div class="form-check">
2+
<input
3+
class="form-check-input"
4+
onclick="event.stopPropagation();"
5+
type="checkbox"
6+
id="filter-{{$key}}-select-all"
7+
wire:input="selectAllFilters('{{ $key }}')"
8+
{{ count($filters[$key]) === count($filter->options()) ? 'checked' : ''}}
9+
>
10+
<label class="form-check-label" for="filter-{{$key}}-select-all">@lang('All')</label>
11+
</div>
112
@foreach($filter->options() as $optionKey => $value)
213
<div class="form-check" wire:key="filter-{{ $key }}-multiselect-{{ $optionKey }}">
314
<input

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
@forelse ($rows as $index => $row)
9494
<x-livewire-tables::bs4.table.row
9595
wire:loading.class.delay="text-muted"
96-
wire:key="table-row-{{ $row->{$primaryKey} }}"
96+
wire:key="table-row-{{ md5(mt_rand()) }}-{{ $row->{$this->parseField($primaryKey)} }}"
9797
wire:sortable.item="{{ $row->{$primaryKey} }}"
9898
:reordering="$reordering"
9999
:url="method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : ''"
@@ -115,7 +115,7 @@
115115
<input
116116
wire:model="selected"
117117
wire:loading.attr.delay="disabled"
118-
value="{{ $row->{\Rappasoft\LaravelLivewireTables\Utilities\ColumnUtilities::parseField($primaryKey)} }}"
118+
value="{{ $row->{$this->parseField($primaryKey)} }}"
119119
onclick="event.stopPropagation();return true;"
120120
type="checkbox"
121121
/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@props(['url' => null, 'target' => '_self', 'reordering' => false, 'customAttributes' => []])
22

3-
@if (!$reordering && $attributes->has('wire:sortable.item'))
3+
@if (!$reordering && (method_exists($attributes, 'has') ? $attributes->has('wire:sortable.item') : array_key_exists('wire:sortable.item', $attributes->getAttributes())))
44
@php
55
$attributes = $attributes->filter(fn ($value, $key) => $key !== 'wire:sortable.item');
66
@endphp

resources/views/bootstrap-5/includes/filter-pills.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
wire:key="filter-pill-{{ $key }}"
1010
class="badge rounded-pill bg-info d-inline-flex align-items-center"
1111
>
12-
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
12+
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, isset($customFilters[$key]) && property_exists($customFilters[$key], 'name') ? $customFilters[$key]->name : ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
1313
@if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options'))
1414
@if(is_array($value))
1515
@foreach($value as $selectedValue)

resources/views/bootstrap-5/includes/filter-type-multiselect.blade.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
<div class="form-check p-0">
2+
<input
3+
onclick="event.stopPropagation();"
4+
type="checkbox"
5+
id="filter-{{$key}}-select-all"
6+
wire:input="selectAllFilters('{{ $key }}')"
7+
{{ count($filters[$key]) === count($filter->options()) ? 'checked' : ''}}
8+
>
9+
<label class="form-check-label" for="filter-{{$key}}-select-all">@lang('All')</label>
10+
</div>
111
@foreach($filter->options() as $optionKey => $value)
2-
<div class="form-check" wire:key="filter-{{ $key }}-multiselect-{{ $optionKey }}">
12+
<div class="form-check p-0" wire:key="filter-{{ $key }}-multiselect-{{ $optionKey }}">
313
<input
414
onclick="event.stopPropagation();"
515
type="checkbox"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class="form-check-input"
9494
@forelse ($rows as $index => $row)
9595
<x-livewire-tables::bs5.table.row
9696
wire:loading.class.delay="text-muted"
97-
wire:key="table-row-{{ $row->{$primaryKey} }}"
97+
wire:key="table-row-{{ md5(mt_rand()) }}-{{ $row->{$this->parseField($primaryKey)} }}"
9898
wire:sortable.item="{{ $row->{$primaryKey} }}"
9999
:reordering="$reordering"
100100
:url="method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : ''"
@@ -116,7 +116,7 @@ class="form-check-input"
116116
<input
117117
wire:model="selected"
118118
wire:loading.attr.delay="disabled"
119-
value="{{ $row->{\Rappasoft\LaravelLivewireTables\Utilities\ColumnUtilities::parseField($primaryKey)} }}"
119+
value="{{ $row->{$this->parseField($primaryKey)} }}"
120120
onclick="event.stopPropagation();return true;"
121121
class="form-check-input"
122122
type="checkbox"

0 commit comments

Comments
 (0)