File tree Expand file tree Collapse file tree 5 files changed +27
-4
lines changed
resources/views/bootstrap-5 Expand file tree Collapse file tree 5 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 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
2
8
3
9
<tr
4
10
{{ $attributes -> merge ($customAttributes ) } }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class="container-fluid p-0"
19
19
20
20
<div class =" d-md-flex justify-content-between mb-3" >
21
21
<div class =" d-md-flex" >
22
+ @include (' livewire-tables::bootstrap-5.includes.reorder' )
22
23
@include (' livewire-tables::bootstrap-5.includes.search' )
23
24
24
25
@if ($filtersEnabled && $showFilterDropdown )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class="btn dropdown-toggle d-block w-100 d-md-inline"
22
22
<span class =" caret" ></span >
23
23
</button >
24
24
<ul
25
- class =" dropdown-menu w-200 mt-3 "
25
+ class =" dropdown-menu w-100 "
26
26
:class =" {'show' : open}"
27
27
role =" menu"
28
28
>
Original file line number Diff line number Diff line change
1
+ @if ($reorderEnabled )
2
+ <div class =" me-0 me-md-3 mb-3 mb-md-0" >
3
+ <button
4
+ wire:click =" {{ $reordering ? ' disableReordering' : ' enableReordering' } }"
5
+ type =" button"
6
+ class =" btn btn-default d-block w-100 d-md-inline"
7
+ >
8
+ @if ($reordering )
9
+ @lang (' Done Reordering' )
10
+ @else
11
+ @lang (' Reorder' )
12
+ @endif
13
+ </button >
14
+ </div >
15
+ @endif
Original file line number Diff line number Diff line change 1
- <x-livewire-tables::bs5 .table wire:sortable =" {{ $reorderingMethod } }" >
1
+ <x-livewire-tables::bs5 .table wire:sortable =" {{ $reordering ? $ reorderingMethod : ' ' } }" >
2
2
<x-slot name =" head" >
3
3
@if ($reordering )
4
4
<x-livewire-tables::bs5 .table.heading />
@@ -48,14 +48,15 @@ class="form-check-input"
48
48
wire:loading.class.delay =" text-muted"
49
49
wire:key =" table-row-{{ $row -> {$primaryKey } } }"
50
50
wire:sortable.item =" {{ $row -> {$primaryKey } } }"
51
+ :reordering =" $reordering"
51
52
:url =" method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : ''"
52
53
:class =" method_exists($this, 'setTableRowClass') ? ' ' . $this->setTableRowClass($row) : ''"
53
54
:id =" method_exists($this, 'setTableRowId') ? $this->setTableRowId($row) : ''"
54
55
:customAttributes =" method_exists($this, 'setTableRowAttributes') ? $this->setTableRowAttributes($row) : []"
55
56
>
56
57
@if ($reordering )
57
58
<x-livewire-tables::bs5 .table.cell wire:sortable.handle >
58
- <svg xmlns =" http://www.w3.org/2000/svg" style =" width :1em ;height :1em ;" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
59
+ <svg xmlns =" http://www.w3.org/2000/svg" class = " d-inline " style =" width :1em ;height :1em ;" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
59
60
<path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 6h16M4 12h16M4 18h16" />
60
61
</svg >
61
62
</x-livewire-tables::bs5 .table.cell >
You can’t perform that action at this time.
0 commit comments