|
7 | 7 | @php($isBootstrap5 = $this->isBootstrap5) |
8 | 8 |
|
9 | 9 | <div> |
10 | | - <div {{ $this->getTopLevelAttributes() }}> |
11 | | - |
12 | | - @includeWhen( |
13 | | - $this->hasConfigurableAreaFor('before-wrapper'), |
14 | | - $this->getConfigurableAreaFor('before-wrapper'), |
15 | | - $this->getParametersForConfigurableArea('before-wrapper') |
16 | | - ) |
17 | | - |
18 | | - <x-livewire-tables::wrapper :component="$this" :tableName="$tableName" :$primaryKey :$isTailwind :$isBootstrap :$isBootstrap4 :$isBootstrap5> |
19 | | - @if($this->hasActions && !$this->showActionsInToolbar) |
20 | | - <x-livewire-tables::includes.actions/> |
21 | | - @endif |
| 10 | + <div x-data="{ currentlyReorderingStatus: false }"> |
| 11 | + <div {{ $this->getTopLevelAttributes() }}> |
22 | 12 |
|
23 | 13 | @includeWhen( |
24 | | - $this->hasConfigurableAreaFor('before-tools'), |
25 | | - $this->getConfigurableAreaFor('before-tools'), |
26 | | - $this->getParametersForConfigurableArea('before-tools') |
| 14 | + $this->hasConfigurableAreaFor('before-wrapper'), |
| 15 | + $this->getConfigurableAreaFor('before-wrapper'), |
| 16 | + $this->getParametersForConfigurableArea('before-wrapper') |
27 | 17 | ) |
28 | 18 |
|
29 | | - @if($this->shouldShowTools) |
30 | | - <x-livewire-tables::tools> |
31 | | - @if ($this->showSortPillsSection) |
32 | | - <x-livewire-tables::tools.sorting-pills /> |
33 | | - @endif |
34 | | - @if($this->showFilterPillsSection) |
35 | | - <x-livewire-tables::tools.filter-pills /> |
| 19 | + <x-livewire-tables::wrapper :component="$this" :tableName="$tableName" :$primaryKey :$isTailwind :$isBootstrap :$isBootstrap4 :$isBootstrap5> |
| 20 | + @if($this->hasActions && !$this->showActionsInToolbar) |
| 21 | + <x-livewire-tables::includes.actions/> |
36 | 22 | @endif |
37 | 23 |
|
38 | 24 | @includeWhen( |
39 | | - $this->hasConfigurableAreaFor('before-toolbar'), |
40 | | - $this->getConfigurableAreaFor('before-toolbar'), |
41 | | - $this->getParametersForConfigurableArea('before-toolbar') |
| 25 | + $this->hasConfigurableAreaFor('before-tools'), |
| 26 | + $this->getConfigurableAreaFor('before-tools'), |
| 27 | + $this->getParametersForConfigurableArea('before-tools') |
42 | 28 | ) |
43 | 29 |
|
44 | | - @if($this->shouldShowToolBar) |
45 | | - <x-livewire-tables::tools.toolbar /> |
46 | | - @endif |
47 | | - |
48 | | - @includeWhen( |
49 | | - $this->hasConfigurableAreaFor('after-toolbar'), |
50 | | - $this->getConfigurableAreaFor('after-toolbar'), |
51 | | - $this->getParametersForConfigurableArea('after-toolbar') |
52 | | - ) |
53 | | - |
54 | | - </x-livewire-tables::tools> |
55 | | - @endif |
56 | | - |
57 | | - @includeWhen( |
58 | | - $this->hasConfigurableAreaFor('after-tools'), |
59 | | - $this->getConfigurableAreaFor('after-tools'), |
60 | | - $this->getParametersForConfigurableArea('after-tools') |
61 | | - ) |
| 30 | + @if($this->shouldShowTools) |
| 31 | + <x-livewire-tables::tools> |
| 32 | + @if ($this->showSortPillsSection) |
| 33 | + <x-livewire-tables::tools.sorting-pills /> |
| 34 | + @endif |
| 35 | + @if($this->showFilterPillsSection) |
| 36 | + <x-livewire-tables::tools.filter-pills /> |
| 37 | + @endif |
62 | 38 |
|
63 | | - <x-livewire-tables::table> |
| 39 | + @includeWhen( |
| 40 | + $this->hasConfigurableAreaFor('before-toolbar'), |
| 41 | + $this->getConfigurableAreaFor('before-toolbar'), |
| 42 | + $this->getParametersForConfigurableArea('before-toolbar') |
| 43 | + ) |
64 | 44 |
|
65 | | - <x-slot name="thead"> |
66 | | - @if($this->getCurrentlyReorderingStatus) |
67 | | - <x-livewire-tables::table.th.reorder x-cloak x-show="currentlyReorderingStatus" /> |
68 | | - @endif |
69 | | - @if($this->showBulkActionsSections) |
70 | | - <x-livewire-tables::table.th.bulk-actions :displayMinimisedOnReorder="true" /> |
71 | | - @endif |
72 | | - @if ($this->showCollapsingColumnSections) |
73 | | - <x-livewire-tables::table.th.collapsed-columns /> |
74 | | - @endif |
| 45 | + @if($this->shouldShowToolBar) |
| 46 | + <x-livewire-tables::tools.toolbar /> |
| 47 | + @endif |
75 | 48 |
|
76 | | - @foreach($this->selectedVisibleColumns as $index => $column) |
77 | | - <x-livewire-tables::table.th wire:key="{{ $tableName.'-table-head-'.$index }}" :$column :$index /> |
78 | | - @endforeach |
79 | | - </x-slot> |
| 49 | + @includeWhen( |
| 50 | + $this->hasConfigurableAreaFor('after-toolbar'), |
| 51 | + $this->getConfigurableAreaFor('after-toolbar'), |
| 52 | + $this->getParametersForConfigurableArea('after-toolbar') |
| 53 | + ) |
80 | 54 |
|
81 | | - @if($this->secondaryHeaderIsEnabled() && $this->hasColumnsWithSecondaryHeader()) |
82 | | - <x-livewire-tables::table.tr.secondary-header /> |
83 | | - @endif |
84 | | - @if($this->hasDisplayLoadingPlaceholder()) |
85 | | - <x-livewire-tables::includes.loading colCount="{{ $this->columns->count()+1 }}" /> |
| 55 | + </x-livewire-tables::tools> |
86 | 56 | @endif |
87 | 57 |
|
88 | | - @if($this->showBulkActionsSections) |
89 | | - <x-livewire-tables::table.tr.bulk-actions :displayMinimisedOnReorder="true" /> |
90 | | - @endif |
| 58 | + @includeWhen( |
| 59 | + $this->hasConfigurableAreaFor('after-tools'), |
| 60 | + $this->getConfigurableAreaFor('after-tools'), |
| 61 | + $this->getParametersForConfigurableArea('after-tools') |
| 62 | + ) |
| 63 | + |
| 64 | + <x-livewire-tables::table> |
91 | 65 |
|
92 | | - @forelse ($this->getRows as $rowIndex => $row) |
93 | | - <x-livewire-tables::table.tr wire:key="{{ $tableName }}-row-wrap-{{ $row->{$primaryKey} }}" :$row :$rowIndex> |
| 66 | + <x-slot name="thead"> |
94 | 67 | @if($this->getCurrentlyReorderingStatus) |
95 | | - <x-livewire-tables::table.td.reorder x-cloak x-show="currentlyReorderingStatus" wire:key="{{ $tableName }}-row-reorder-{{ $row->{$primaryKey} }}" :rowID="$tableName.'-'.$row->{$this->getPrimaryKey()}" :$rowIndex /> |
| 68 | + <x-livewire-tables::table.th.reorder x-cloak x-show="currentlyReorderingStatus" /> |
96 | 69 | @endif |
97 | 70 | @if($this->showBulkActionsSections) |
98 | | - <x-livewire-tables::table.td.bulk-actions wire:key="{{ $tableName }}-row-bulk-act-{{ $row->{$primaryKey} }}" :$row :$rowIndex /> |
| 71 | + <x-livewire-tables::table.th.bulk-actions :displayMinimisedOnReorder="true" /> |
99 | 72 | @endif |
100 | 73 | @if ($this->showCollapsingColumnSections) |
101 | | - <x-livewire-tables::table.td.collapsed-columns wire:key="{{ $tableName }}-row-collapsed-{{ $row->{$primaryKey} }}" :$rowIndex /> |
| 74 | + <x-livewire-tables::table.th.collapsed-columns /> |
102 | 75 | @endif |
103 | 76 |
|
104 | | - @foreach($this->selectedVisibleColumns as $colIndex => $column) |
105 | | - <x-livewire-tables::table.td wire:key="{{ $tableName . '-' . $row->{$primaryKey} . '-datatable-td-' . $column->getSlug() }}" :$column :$colIndex> |
106 | | - @if($column->isHtml()) |
107 | | - {!! $column->setIndexes($rowIndex, $colIndex)->renderContents($row) !!} |
108 | | - @else |
109 | | - {{ $column->setIndexes($rowIndex, $colIndex)->renderContents($row) }} |
110 | | - @endif |
111 | | - </x-livewire-tables::table.td> |
| 77 | + @foreach($this->selectedVisibleColumns as $index => $column) |
| 78 | + <x-livewire-tables::table.th wire:key="{{ $tableName.'-table-head-'.$index }}" :$column :$index /> |
112 | 79 | @endforeach |
113 | | - </x-livewire-tables::table.tr> |
| 80 | + </x-slot> |
| 81 | + |
| 82 | + @if($this->secondaryHeaderIsEnabled() && $this->hasColumnsWithSecondaryHeader()) |
| 83 | + <x-livewire-tables::table.tr.secondary-header /> |
| 84 | + @endif |
| 85 | + @if($this->hasDisplayLoadingPlaceholder()) |
| 86 | + <x-livewire-tables::includes.loading colCount="{{ $this->columns->count()+1 }}" /> |
| 87 | + @endif |
114 | 88 |
|
115 | | - @if ($this->showCollapsingColumnSections) |
116 | | - <x-livewire-tables::table.collapsed-columns :$row :$rowIndex /> |
| 89 | + @if($this->showBulkActionsSections) |
| 90 | + <x-livewire-tables::table.tr.bulk-actions :displayMinimisedOnReorder="true" /> |
117 | 91 | @endif |
118 | | - @empty |
119 | | - <x-livewire-tables::table.empty /> |
120 | | - @endforelse |
121 | | - |
122 | | - @if ($this->footerIsEnabled() && $this->hasColumnsWithFooter()) |
123 | | - <x-slot name="tfoot"> |
124 | | - @if ($this->useHeaderAsFooterIsEnabled()) |
125 | | - <x-livewire-tables::table.tr.secondary-header /> |
126 | | - @else |
127 | | - <x-livewire-tables::table.tr.footer /> |
| 92 | + |
| 93 | + @forelse ($this->getRows as $rowIndex => $row) |
| 94 | + <x-livewire-tables::table.tr wire:key="{{ $tableName }}-row-wrap-{{ $row->{$primaryKey} }}" :$row :$rowIndex> |
| 95 | + @if($this->getCurrentlyReorderingStatus) |
| 96 | + <x-livewire-tables::table.td.reorder x-cloak x-show="currentlyReorderingStatus" wire:key="{{ $tableName }}-row-reorder-{{ $row->{$primaryKey} }}" :rowID="$tableName.'-'.$row->{$this->getPrimaryKey()}" :$rowIndex /> |
| 97 | + @endif |
| 98 | + @if($this->showBulkActionsSections) |
| 99 | + <x-livewire-tables::table.td.bulk-actions wire:key="{{ $tableName }}-row-bulk-act-{{ $row->{$primaryKey} }}" :$row :$rowIndex /> |
| 100 | + @endif |
| 101 | + @if ($this->showCollapsingColumnSections) |
| 102 | + <x-livewire-tables::table.td.collapsed-columns wire:key="{{ $tableName }}-row-collapsed-{{ $row->{$primaryKey} }}" :$rowIndex /> |
| 103 | + @endif |
| 104 | + |
| 105 | + @foreach($this->selectedVisibleColumns as $colIndex => $column) |
| 106 | + <x-livewire-tables::table.td wire:key="{{ $tableName . '-' . $row->{$primaryKey} . '-datatable-td-' . $column->getSlug() }}" :$column :$colIndex> |
| 107 | + @if($column->isHtml()) |
| 108 | + {!! $column->setIndexes($rowIndex, $colIndex)->renderContents($row) !!} |
| 109 | + @else |
| 110 | + {{ $column->setIndexes($rowIndex, $colIndex)->renderContents($row) }} |
| 111 | + @endif |
| 112 | + </x-livewire-tables::table.td> |
| 113 | + @endforeach |
| 114 | + </x-livewire-tables::table.tr> |
| 115 | + |
| 116 | + @if ($this->showCollapsingColumnSections) |
| 117 | + <x-livewire-tables::table.collapsed-columns :$row :$rowIndex /> |
128 | 118 | @endif |
129 | | - </x-slot> |
130 | | - @endif |
131 | | - </x-livewire-tables::table> |
| 119 | + @empty |
| 120 | + <x-livewire-tables::table.empty /> |
| 121 | + @endforelse |
| 122 | + |
| 123 | + @if ($this->footerIsEnabled() && $this->hasColumnsWithFooter()) |
| 124 | + <x-slot name="tfoot"> |
| 125 | + @if ($this->useHeaderAsFooterIsEnabled()) |
| 126 | + <x-livewire-tables::table.tr.secondary-header /> |
| 127 | + @else |
| 128 | + <x-livewire-tables::table.tr.footer /> |
| 129 | + @endif |
| 130 | + </x-slot> |
| 131 | + @endif |
| 132 | + </x-livewire-tables::table> |
132 | 133 |
|
133 | | - <x-livewire-tables::pagination /> |
| 134 | + <x-livewire-tables::pagination /> |
134 | 135 |
|
135 | | - @includeIf($customView) |
136 | | - </x-livewire-tables::wrapper> |
| 136 | + @includeIf($customView) |
| 137 | + </x-livewire-tables::wrapper> |
137 | 138 |
|
138 | | - @includeWhen( |
139 | | - $this->hasConfigurableAreaFor('after-wrapper'), |
140 | | - $this->getConfigurableAreaFor('after-wrapper'), |
141 | | - $this->getParametersForConfigurableArea('after-wrapper') |
142 | | - ) |
| 139 | + @includeWhen( |
| 140 | + $this->hasConfigurableAreaFor('after-wrapper'), |
| 141 | + $this->getConfigurableAreaFor('after-wrapper'), |
| 142 | + $this->getParametersForConfigurableArea('after-wrapper') |
| 143 | + ) |
143 | 144 |
|
| 145 | + </div> |
144 | 146 | </div> |
145 | 147 | </div> |
0 commit comments