Skip to content

Commit a840e41

Browse files
authored
Merge pull request #322 from rappasoft/develop
v1.8.0
2 parents d03b95c + cf50ebc commit a840e41

File tree

19 files changed

+188
-108
lines changed

19 files changed

+188
-108
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.8.0] - 2021-06-06
8+
9+
### Added
10+
11+
- [Actual default sorting](https://github.com/rappasoft/laravel-livewire-tables/pull/313)
12+
- [Added place to put modals in the scope of the component](https://github.com/rappasoft/laravel-livewire-tables/wiki/Working-with-modals)
13+
- Added `setTableRowClass`, `setTableRowId`, `setTableRowAttributes`, `setTableDataClass`, `setTableDataId`, `setTableDataAttributes` methods to modify cells and rows depending on data for non-custom rows.
14+
15+
### Changed
16+
17+
- [Fix tailwind style for div containing checkbox](https://github.com/rappasoft/laravel-livewire-tables/pull/314)
18+
719
## [1.7.1] - 2021-05-30
820

921
### Added
@@ -351,7 +363,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
351363

352364
- Initial release
353365

354-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.7.1...development
366+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.8.0...development
367+
[1.8.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.7.1...v1.8.0
355368
[1.7.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.7.0...v1.7.1
356369
[1.7.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.6.1...v1.7.0
357370
[1.6.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.6.0...v1.6.1
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
<td {{ $attributes }}>
1+
@props(['customAttributes' => []])
2+
3+
<td {{ $attributes->merge($customAttributes) }}>
24
{{ $slot }}
35
</td>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
@foreach($columns as $column)
22
@if ($column->isVisible())
3-
<td>
3+
<x-livewire-tables::bs4.table.cell
4+
:class="method_exists($this, 'setTableDataClass') ? $this->setTableDataClass($column, $row) : ''"
5+
:id="method_exists($this, 'setTableDataId') ? $this->setTableDataId($column, $row) : ''"
6+
:customAttributes="method_exists($this, 'setTableDataAttributes') ? $this->setTableDataAttributes($column, $row) : []"
7+
>
48
@if ($column->asHtml)
59
{{ new \Illuminate\Support\HtmlString($column->formatted($row)) }}
610
@else
711
{{ $column->formatted($row) }}
812
@endif
9-
</td>
13+
</x-livewire-tables::bs4.table.cell>
1014
@endif
1115
@endforeach

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@props(['url' => null])
1+
@props(['url' => null, 'customAttributes' => []])
22

33
<tr
4-
{{ $attributes }}
4+
{{ $attributes->merge($customAttributes) }}
55

66
@if ($url)
77
onclick="window.location='{{ $url }}';"
Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1-
<div
2-
@if (is_numeric($refresh))
3-
wire:poll.{{ $refresh }}ms
4-
@elseif(is_string($refresh))
5-
@if ($refresh === '.keep-alive' || $refresh === 'keep-alive')
6-
wire:poll.keep-alive
7-
@elseif($refresh === '.visible' || $refresh === 'visible')
8-
wire:poll.visible
9-
@else
10-
wire:poll="{{ $refresh }}"
1+
<div>
2+
<div
3+
@if (is_numeric($refresh))
4+
wire:poll.{{ $refresh }}ms
5+
@elseif(is_string($refresh))
6+
@if ($refresh === '.keep-alive' || $refresh === 'keep-alive')
7+
wire:poll.keep-alive
8+
@elseif($refresh === '.visible' || $refresh === 'visible')
9+
wire:poll.visible
10+
@else
11+
wire:poll="{{ $refresh }}"
12+
@endif
1113
@endif
12-
@endif
13-
class="container-fluid p-0"
14-
>
15-
@include('livewire-tables::bootstrap-4.includes.offline')
16-
@include('livewire-tables::bootstrap-4.includes.sorting-pills')
17-
@include('livewire-tables::bootstrap-4.includes.filter-pills')
14+
class="container-fluid p-0"
15+
>
16+
@include('livewire-tables::bootstrap-4.includes.offline')
17+
@include('livewire-tables::bootstrap-4.includes.sorting-pills')
18+
@include('livewire-tables::bootstrap-4.includes.filter-pills')
1819

19-
<div class="d-md-flex justify-content-between mb-3">
20-
<div class="d-md-flex">
21-
@include('livewire-tables::bootstrap-4.includes.search')
20+
<div class="d-md-flex justify-content-between mb-3">
21+
<div class="d-md-flex">
22+
@include('livewire-tables::bootstrap-4.includes.search')
2223

23-
@if ($showFilterDropdown)
24-
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
25-
@include('livewire-tables::bootstrap-4.includes.filters')
26-
</div>
27-
@endif
28-
</div>
24+
@if ($showFilterDropdown)
25+
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
26+
@include('livewire-tables::bootstrap-4.includes.filters')
27+
</div>
28+
@endif
29+
</div>
2930

30-
<div class="d-md-flex">
31-
@include('livewire-tables::bootstrap-4.includes.bulk-actions')
32-
@include('livewire-tables::bootstrap-4.includes.per-page')
31+
<div class="d-md-flex">
32+
@include('livewire-tables::bootstrap-4.includes.bulk-actions')
33+
@include('livewire-tables::bootstrap-4.includes.per-page')
34+
</div>
3335
</div>
36+
37+
@include('livewire-tables::bootstrap-4.includes.table')
38+
@include('livewire-tables::bootstrap-4.includes.pagination')
3439
</div>
3540

36-
@include('livewire-tables::bootstrap-4.includes.table')
37-
@include('livewire-tables::bootstrap-4.includes.pagination')
41+
@isset($modalsView)
42+
@include($modalsView)
43+
@endisset
3844
</div>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
<x-livewire-tables::bs4.table.row
3434
wire:loading.class.delay="text-muted"
3535
wire:key="table-row-{{ $row->getKey() }}"
36-
:url="method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : null"
36+
:url="method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : ''"
37+
:class="method_exists($this, 'setTableRowClass') ? ' ' . $this->setTableRowClass($row) : ''"
38+
:id="method_exists($this, 'setTableRowId') ? $this->setTableRowId($row) : ''"
39+
:customAttributes="method_exists($this, 'setTableRowAttributes') ? $this->setTableRowAttributes($row) : []"
3740
>
3841
@if (count($bulkActions))
3942
<x-livewire-tables::bs4.table.cell>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
<td {{ $attributes }}>
1+
@props(['customAttributes' => []])
2+
3+
<td {{ $attributes->merge($customAttributes) }}>
24
{{ $slot }}
35
</td>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
@foreach($columns as $column)
22
@if ($column->isVisible())
3-
<td>
3+
<x-livewire-tables::bs5.table.cell
4+
:class="method_exists($this, 'setTableDataClass') ? $this->setTableDataClass($column, $row) : ''"
5+
:id="method_exists($this, 'setTableDataId') ? $this->setTableDataId($column, $row) : ''"
6+
:customAttributes="method_exists($this, 'setTableDataAttributes') ? $this->setTableDataAttributes($column, $row) : []"
7+
>
48
@if ($column->asHtml)
59
{{ new \Illuminate\Support\HtmlString($column->formatted($row)) }}
610
@else
711
{{ $column->formatted($row) }}
812
@endif
9-
</td>
13+
</x-livewire-tables::bs5.table.cell>
1014
@endif
1115
@endforeach

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@props(['url' => null])
1+
@props(['url' => null, 'customAttributes' => []])
22

33
<tr
4-
{{ $attributes }}
4+
{{ $attributes->merge($customAttributes) }}
55

66
@if ($url)
77
onclick="window.location='{{ $url }}';"
Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1-
<div
2-
@if (is_numeric($refresh))
3-
wire:poll.{{ $refresh }}ms
4-
@elseif(is_string($refresh))
5-
@if ($refresh === '.keep-alive' || $refresh === 'keep-alive')
6-
wire:poll.keep-alive
7-
@elseif($refresh === '.visible' || $refresh === 'visible')
8-
wire:poll.visible
9-
@else
10-
wire:poll="{{ $refresh }}"
1+
<div>
2+
<div
3+
@if (is_numeric($refresh))
4+
wire:poll.{{ $refresh }}ms
5+
@elseif(is_string($refresh))
6+
@if ($refresh === '.keep-alive' || $refresh === 'keep-alive')
7+
wire:poll.keep-alive
8+
@elseif($refresh === '.visible' || $refresh === 'visible')
9+
wire:poll.visible
10+
@else
11+
wire:poll="{{ $refresh }}"
12+
@endif
1113
@endif
12-
@endif
13-
class="container-fluid p-0"
14-
>
15-
@include('livewire-tables::bootstrap-5.includes.offline')
16-
@include('livewire-tables::bootstrap-5.includes.sorting-pills')
17-
@include('livewire-tables::bootstrap-5.includes.filter-pills')
14+
class="container-fluid p-0"
15+
>
16+
@include('livewire-tables::bootstrap-5.includes.offline')
17+
@include('livewire-tables::bootstrap-5.includes.sorting-pills')
18+
@include('livewire-tables::bootstrap-5.includes.filter-pills')
1819

19-
<div class="d-md-flex justify-content-between mb-3">
20-
<div class="d-md-flex">
21-
@include('livewire-tables::bootstrap-5.includes.search')
20+
<div class="d-md-flex justify-content-between mb-3">
21+
<div class="d-md-flex">
22+
@include('livewire-tables::bootstrap-5.includes.search')
2223

23-
@if ($showFilterDropdown)
24-
<div class="ms-0 ms-md-3 mb-3 mb-md-0">
25-
@include('livewire-tables::bootstrap-5.includes.filters')
26-
</div>
27-
@endif
28-
</div>
24+
@if ($showFilterDropdown)
25+
<div class="ms-0 ms-md-3 mb-3 mb-md-0">
26+
@include('livewire-tables::bootstrap-5.includes.filters')
27+
</div>
28+
@endif
29+
</div>
2930

30-
<div class="d-md-flex">
31-
@include('livewire-tables::bootstrap-5.includes.bulk-actions')
32-
@include('livewire-tables::bootstrap-5.includes.per-page')
31+
<div class="d-md-flex">
32+
@include('livewire-tables::bootstrap-5.includes.bulk-actions')
33+
@include('livewire-tables::bootstrap-5.includes.per-page')
34+
</div>
3335
</div>
36+
37+
@include('livewire-tables::bootstrap-5.includes.table')
38+
@include('livewire-tables::bootstrap-5.includes.pagination')
3439
</div>
3540

36-
@include('livewire-tables::bootstrap-5.includes.table')
37-
@include('livewire-tables::bootstrap-5.includes.pagination')
41+
@isset($modalsView)
42+
@include($modalsView)
43+
@endisset
3844
</div>

0 commit comments

Comments
 (0)