Skip to content

Commit 9939041

Browse files
authored
Merge pull request #468 from rappasoft/develop
v1.16.0
2 parents 56485a1 + 3c12c47 commit 9939041

32 files changed

+394
-35
lines changed

CHANGELOG.md

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

55
## [Unreleased]
66

7+
## [1.16.0] - 2021-09-26
8+
9+
### Added
10+
11+
- Ability to use the header as the footer
12+
- Ability to define a custom footer cell per column
13+
- Ability to set the footer row classes/id/attributes
14+
- Ability to set the footer cell classes/id/attributes
15+
- Added isHtml method on the column and replace use of property in views for internal use.
16+
- [Ability to define bulk actions with a method](https://github.com/rappasoft/laravel-livewire-tables/pull/467)
17+
- [Allow to disable responsive status of the table](https://github.com/rappasoft/laravel-livewire-tables/pull/458)
18+
- [Ability to link each cell](https://github.com/rappasoft/laravel-livewire-tables/pull/461)
19+
20+
### Changed
21+
22+
- [Reduce horizontal spacing in Tailwind responsive view](https://github.com/rappasoft/laravel-livewire-tables/pull/464)
23+
724
## [1.15.0] - 2021-09-19
825

926
### Added
@@ -467,7 +484,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
467484

468485
- Initial release
469486

470-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.15.0...development
487+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.16.0...development
488+
[1.16.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.15.0...v1.16.0
471489
[1.15.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.14.0...v1.15.0
472490
[1.14.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.13.0...v1.14.0
473491
[1.13.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.12.0...v1.13.0

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.6.2",
22+
"livewire/livewire": "^2.6.5",
2323
"spatie/laravel-package-tools": "^1.4.3",
2424
"illuminate/contracts": "^8.0"
2525
},
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@props(['text' => null, 'customAttributes' => []])
2+
3+
<td {{ $attributes->merge($customAttributes) }}>
4+
{{ $text ?? $slot }}
5+
</td>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:id="method_exists($this, 'setTableDataId') ? $this->setTableDataId($column, $row) : ''"
88
:customAttributes="method_exists($this, 'setTableDataAttributes') ? $this->setTableDataAttributes($column, $row) : []"
99
>
10-
@if ($column->asHtml)
10+
@if ($column->isHtml())
1111
{{ new \Illuminate\Support\HtmlString($column->formatted($row)) }}
1212
@else
1313
{{ $column->formatted($row) }}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="table-responsive">
1+
<div class="{{ $this->responsive ? 'table-responsive' : '' }}">
22
<table {{ $attributes->except('wire:sortable') }} class="table table-striped">
33
<thead>
44
<tr>
@@ -9,5 +9,17 @@
99
<tbody {{ $attributes->only('wire:sortable') }}>
1010
{{ $body }}
1111
</tbody>
12+
13+
@if ($useHeaderAsFooter || $customFooter)
14+
<tfoot>
15+
@if ($useHeaderAsFooter)
16+
<tr>
17+
{{ $head }}
18+
</tr>
19+
@elseif($customFooter)
20+
{{ $foot }}
21+
@endif
22+
</tfoot>
23+
@endif
1224
</table>
1325
</div>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
</button>
77

88
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="bulkActions">
9-
@foreach($bulkActions as $action => $title)
9+
@foreach($this->bulkActions as $action => $title)
1010
<a
1111
href="#"
12-
wire:click.prevent="{{ $action }}"
13-
wire:key="bulk-action-{{ $action }}"
14-
class="dropdown-item"
12+
wire:click.prevent="{{ $action }}"
13+
wire:key="bulk-action-{{ $action }}"
14+
class="dropdown-item"
1515
>
1616
{{ $title }}
1717
</a>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@if ($bulkActionsEnabled && count($bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
1+
@if ($bulkActionsEnabled && count($this->bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
22
<x-livewire-tables::bs4.table.row wire:key="row-message">
33
<x-livewire-tables::bs4.table.cell colspan="{{ $colspan }}">
44
@if (count($selected) && !$selectAll && !$selectPage)

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

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
<x-livewire-tables::bs4.table wire:sortable="{{ $reordering ? $reorderingMethod : '' }}">
1+
<x-livewire-tables::bs4.table
2+
wire:sortable="{{ $reordering ? $reorderingMethod : '' }}"
3+
:useHeaderAsFooter="$useHeaderAsFooter"
4+
:customFooter="$customFooter"
5+
>
26
<x-slot name="head">
37
@if ($reordering)
48
<x-livewire-tables::bs4.table.heading />
59
@endif
610

7-
@if ($bulkActionsEnabled && count($bulkActions))
11+
@if ($bulkActionsEnabled && count($this->bulkActions))
812
<x-livewire-tables::bs4.table.heading>
913
<input
1014
wire:model="selectPage"
@@ -37,7 +41,7 @@
3741
<x-slot name="body">
3842
@php
3943
$colspan = count($columns);
40-
if ($bulkActionsEnabled && count($bulkActions)) $colspan++;
44+
if ($bulkActionsEnabled && count($this->bulkActions)) $colspan++;
4145
if ($reordering) $colspan++;
4246
@endphp
4347

@@ -62,7 +66,7 @@
6266
</x-livewire-tables::bs4.table.cell>
6367
@endif
6468

65-
@if ($bulkActionsEnabled && count($bulkActions))
69+
@if ($bulkActionsEnabled && count($this->bulkActions))
6670
<x-livewire-tables::bs4.table.cell>
6771
<input
6872
wire:model="selected"
@@ -84,4 +88,45 @@
8488
</x-livewire-tables::bs4.table.row>
8589
@endforelse
8690
</x-slot>
91+
92+
@if ($customFooter)
93+
<x-slot name="foot">
94+
<x-livewire-tables::bs4.table.row
95+
wire:loading.class.delay="text-muted"
96+
:class="method_exists($this, 'setFooterRowClass') ? ' ' . $this->setFooterRowClass($rows) : ''"
97+
:id="method_exists($this, 'setFooterRowId') ? $this->setFooterRowId($rows) : ''"
98+
:customAttributes="method_exists($this, 'setFooterRowAttributes') ? $this->setFooterRowAttributes($rows) : []"
99+
>
100+
@if ($reordering)
101+
<x-livewire-tables::bs4.table.footer />
102+
@endif
103+
104+
@if ($bulkActionsEnabled && count($this->bulkActions))
105+
<x-livewire-tables::bs4.table.footer />
106+
@endif
107+
108+
@foreach($columns as $column)
109+
@if ($column->isVisible())
110+
@continue($columnSelect && ! $this->isColumnSelectEnabled($column))
111+
112+
@if ($column->hasFooter())
113+
<x-livewire-tables::bs4.table.footer
114+
:class="method_exists($this, 'setFooterDataClass') ? $this->setFooterDataClass($column, $rows) : ''"
115+
:id="method_exists($this, 'setFooterDataId') ? $this->setFooterDataId($column, $rows) : ''"
116+
:customAttributes="method_exists($this, 'setFooterDataAttributes') ? $this->setFooterDataAttributes($column, $rows) : []"
117+
>
118+
@if ($column->isHtml())
119+
{{ new \Illuminate\Support\HtmlString($column->footerFormatted($rows)) }}
120+
@else
121+
{{ $column->footerFormatted($rows) }}
122+
@endif
123+
</x-livewire-tables::bs4.table.footer>
124+
@else
125+
<x-livewire-tables::bs4.table.footer />
126+
@endif
127+
@endif
128+
@endforeach
129+
</x-livewire-tables::bs4.table.row>
130+
</x-slot>
131+
@endif
87132
</x-livewire-tables::bs4.table>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@props(['text' => null, 'customAttributes' => []])
2+
3+
<td {{ $attributes->merge($customAttributes) }}>
4+
{{ $text ?? $slot }}
5+
</td>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:id="method_exists($this, 'setTableDataId') ? $this->setTableDataId($column, $row) : ''"
88
:customAttributes="method_exists($this, 'setTableDataAttributes') ? $this->setTableDataAttributes($column, $row) : []"
99
>
10-
@if ($column->asHtml)
10+
@if ($column->isHtml())
1111
{{ new \Illuminate\Support\HtmlString($column->formatted($row)) }}
1212
@else
1313
{{ $column->formatted($row) }}

0 commit comments

Comments
 (0)