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