Skip to content

Commit 1c83a63

Browse files
authored
Merge pull request #351 from rappasoft/develop
v1.10.0
2 parents 210a87b + 5eb2e0d commit 1c83a63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+609
-100
lines changed

CHANGELOG.md

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

55
## [Unreleased]
66

7+
## [1.10.0] - 2021-06-20
8+
9+
**This release requires re-publishing of assets.**
10+
11+
### Added
12+
13+
- [Column selector for users to show/hide columns](https://github.com/rappasoft/laravel-livewire-tables/wiki/User-column-selection)
14+
- [Drag & Drop reordering](https://github.com/rappasoft/laravel-livewire-tables/wiki/Drag-and-drop)
15+
716
## [1.9.0] - 2021-06-15
817

918
**This release requires re-publishing of assets.**
@@ -377,7 +386,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
377386

378387
- Initial release
379388

380-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.9.0...development
389+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.0...development
390+
[1.10.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.9.0...v1.10.0
381391
[1.9.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.8.0...v1.9.0
382392
[1.8.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.7.1...v1.8.0
383393
[1.7.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.7.0...v1.7.1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class UsersTable extends DataTableComponent
6666
- [x] Bootstrap 4 Template
6767
- [x] Bootstrap 5 Template
6868
- [x] Sorting By Relationships
69+
- [x] User Column Selection
70+
- [x] Drag & Drop (alpha)
6971
- [ ] Collection/Query Support
7072
- [ ] Test Suite (WIP)
7173
- [ ] Column Search

resources/lang/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"Applied Sorting": "Applied Sorting",
55
"Bulk Actions": "Bulk Actions",
66
"Clear": "Clear",
7+
"Columns": "Columns",
8+
"Done Reordering": "Done Reordering",
79
"Filters": "Filters",
810
"Remove filter option": "Remove filter option",
911
"Remove sort option": "Remove sort option",
@@ -15,6 +17,7 @@
1517
"You are not connected to the internet.": "You are not connected to the internet.",
1618
"You have selected": "You have selected",
1719
"of": "of",
20+
"Reorder": "Reorder",
1821
"results": "results",
1922
"rows": "rows",
2023
"rows, do you want to select all": "rows, do you want to select all",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
@props([
22
'column',
3+
'sortingEnabled' => true,
34
'sortable' => null,
45
'direction' => null,
56
'text' => null,
67
])
78

8-
@unless ($sortable)
9+
@unless ($sortingEnabled && $sortable)
910
<th {{ $attributes->only('class') }}>
1011
{{ $text ?? $slot }}
1112
</th>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@foreach($columns as $column)
22
@if ($column->isVisible())
3+
@continue($columnSelect && ! $this->isColumnSelectEnabled($column))
4+
35
<x-livewire-tables::bs4.table.cell
46
:class="method_exists($this, 'setTableDataClass') ? $this->setTableDataClass($column, $row) : ''"
57
:id="method_exists($this, 'setTableDataId') ? $this->setTableDataId($column, $row) : ''"

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
@props(['url' => null, 'customAttributes' => []])
1+
@props(['url' => null, 'reordering' => false, 'customAttributes' => []])
2+
3+
@if (!$reordering && $attributes->has('wire:sortable.item'))
4+
@php
5+
$attributes = $attributes->filter(fn ($value, $key) => $key !== 'wire:sortable.item');
6+
@endphp
7+
@endif
28

39
<tr
410
{{ $attributes->merge($customAttributes) }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="table-responsive">
2-
<table class="table table-striped">
2+
<table {{ $attributes->except('wire:sortable') }} class="table table-striped">
33
<thead>
44
<tr>
55
{{ $head }}
66
</tr>
77
</thead>
88

9-
<tbody>
9+
<tbody {{ $attributes->only('wire:sortable') }}>
1010
{{ $body }}
1111
</tbody>
1212
</table>

resources/views/bootstrap-4/datatable.blade.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ class="container-fluid p-0"
1919

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

24-
@if ($showFilterDropdown)
25-
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
25+
@if ($filtersEnabled && $showFilterDropdown)
26+
<div class="{{ $showSearch ? 'ml-0 ml-md-2' : '' }} mb-3 mb-md-0">
2627
@include('livewire-tables::bootstrap-4.includes.filters')
2728
</div>
2829
@endif
2930
</div>
3031

3132
<div class="d-md-flex">
32-
@include('livewire-tables::bootstrap-4.includes.bulk-actions')
33-
@include('livewire-tables::bootstrap-4.includes.per-page')
33+
<div>@include('livewire-tables::bootstrap-4.includes.bulk-actions')</div>
34+
<div>@include('livewire-tables::bootstrap-4.includes.column-select')</div>
35+
<div>@include('livewire-tables::bootstrap-4.includes.per-page')</div>
3436
</div>
3537
</div>
3638

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
@if (count($bulkActions))
2-
<div class="dropdown mb-3 mb-md-0 d-block d-md-inline">
3-
<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-
@lang('Bulk Actions')
5-
</button>
1+
@if ($bulkActionsEnabled && count($bulkActions))
2+
<div class="mb-3 mb-md-0">
3+
<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">
5+
@lang('Bulk Actions')
6+
</button>
67

7-
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="bulkActions">
8-
@foreach($bulkActions as $action => $title)
9-
<a
10-
href="#"
11-
wire:click.prevent="{{ $action }}"
12-
wire:key="bulk-action-{{ $action }}"
13-
class="dropdown-item"
14-
>
15-
{{ $title }}
16-
</a>
17-
@endforeach
8+
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="bulkActions">
9+
@foreach($bulkActions as $action => $title)
10+
<a
11+
href="#"
12+
wire:click.prevent="{{ $action }}"
13+
wire:key="bulk-action-{{ $action }}"
14+
class="dropdown-item"
15+
>
16+
{{ $title }}
17+
</a>
18+
@endforeach
19+
</div>
1820
</div>
1921
</div>
2022
@endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@if (count($bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
1+
@if ($bulkActionsEnabled && count($bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
22
<x-livewire-tables::bs4.table.row wire:key="row-message">
3-
<x-livewire-tables::bs4.table.cell colspan="{{ count($bulkActions) ? count($columns) + 1 : count($columns) }}">
3+
<x-livewire-tables::bs4.table.cell colspan="{{ $colspan }}">
44
@if (count($selected) && !$selectAll && !$selectPage)
55
<div>
66
<span>

0 commit comments

Comments
 (0)