|
1 | | -@aware([ 'tableName','isTailwind','isBootstrap']) |
| 1 | +@aware([ 'tableName']) |
2 | 2 |
|
3 | 3 | @if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) |
4 | 4 | @php |
|
7 | 7 | $simplePagination = $this->isPaginationMethod('simple'); |
8 | 8 | @endphp |
9 | 9 |
|
10 | | - @if ($isTailwind) |
11 | | - <x-livewire-tables::table.tr.plain |
12 | | - x-cloak x-show="selectedItems.length > 0 && !currentlyReorderingStatus" |
13 | | - wire:key="{{ $tableName }}-bulk-select-message" |
14 | | - class="bg-indigo-50 dark:bg-gray-900 dark:text-white" |
15 | | - > |
16 | | - <x-livewire-tables::table.td.plain :colspan="$colspan"> |
17 | | - <template x-if="selectedItems.length == paginationTotalItemCount || selectAllStatus"> |
18 | | - <div wire:key="{{ $tableName }}-all-selected"> |
19 | | - <span> |
20 | | - {{ __($this->getLocalisationPath.'You are currently selecting all') }} |
21 | | - @if(!$simplePagination) <strong><span x-text="paginationTotalItemCount"></span></strong> @endif |
22 | | - {{ __($this->getLocalisationPath.'rows') }}. |
23 | | - </span> |
24 | | - |
25 | | - <button |
26 | | - x-on:click="clearSelected" |
27 | | - wire:loading.attr="disabled" |
28 | | - type="button" |
29 | | - class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400" |
30 | | - > |
31 | | - {{ __($this->getLocalisationPath.'Deselect All') }} |
32 | | - </button> |
33 | | - </div> |
34 | | - </template> |
35 | | - |
36 | | - <template x-if="selectedItems.length !== paginationTotalItemCount && !selectAllStatus"> |
37 | | - <div wire:key="{{ $tableName }}-some-selected"> |
38 | | - <span> |
39 | | - {{ __($this->getLocalisationPath.'You have selected') }} |
40 | | - <strong><span x-text="selectedItems.length"></span></strong> |
41 | | - {{ __($this->getLocalisationPath.'rows, do you want to select all') }} |
42 | | - @if(!$simplePagination) <strong><span x-text="paginationTotalItemCount"></span></strong> @endif |
43 | | - </span> |
44 | | - |
45 | | - <button |
46 | | - x-on:click="selectAllOnPage()" |
47 | | - wire:loading.attr="disabled" |
48 | | - type="button" |
49 | | - class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400" |
50 | | - >{{ __($this->getLocalisationPath.'Select All On Page') }} |
51 | | - </button> |
52 | | - |
53 | | - <button |
54 | | - x-on:click="setAllSelected()" |
55 | | - wire:loading.attr="disabled" |
56 | | - type="button" |
57 | | - class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400" |
58 | | - > |
59 | | - {{ __($this->getLocalisationPath.'Select All') }} |
60 | | - </button> |
61 | | - |
62 | | - <button |
63 | | - x-on:click="clearSelected" |
64 | | - wire:loading.attr="disabled" |
65 | | - type="button" |
66 | | - class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400" |
67 | | - > |
68 | | - {{ __($this->getLocalisationPath.'Deselect All') }} |
69 | | - </button> |
70 | | - </div> |
71 | | - </template> |
72 | | - </x-livewire-tables::table.td.plain> |
73 | | - </x-livewire-tables::table.tr.plain> |
74 | | - @elseif ($isBootstrap) |
75 | | - <x-livewire-tables::table.tr.plain |
76 | | - x-cloak x-show="selectedItems.length > 0 && !currentlyReorderingStatus" |
77 | | - wire:key="{{ $tableName }}-bulk-select-message" |
78 | | - > |
79 | | - <x-livewire-tables::table.td.plain :colspan="$colspan"> |
80 | | - <template x-if="selectedItems.length == paginationTotalItemCount || selectAllStatus"> |
81 | | - <div wire:key="{{ $tableName }}-all-selected"> |
82 | | - <span> |
| 10 | + <x-livewire-tables::table.tr.plain |
| 11 | + x-cloak x-show="selectedItems.length > 0 && !currentlyReorderingStatus" |
| 12 | + wire:key="{{ $tableName }}-bulk-select-message" |
| 13 | + @class([ |
| 14 | + 'bg-indigo-50 dark:bg-gray-900 dark:text-white' => $this->isTailwind, |
| 15 | + ]) |
| 16 | + > |
| 17 | + <x-livewire-tables::table.td.plain :colspan="$colspan"> |
| 18 | + <template x-if="selectedItems.length == paginationTotalItemCount || selectAllStatus"> |
| 19 | + <div wire:key="{{ $tableName }}-all-selected"> |
| 20 | + <span> |
83 | 21 | {{ __($this->getLocalisationPath.'You are currently selecting all') }} |
84 | 22 | @if(!$simplePagination) <strong><span x-text="paginationTotalItemCount"></span></strong> @endif |
85 | | - {{ __($this->getLocalisationPath.'rows') }}. |
| 23 | + {{ __($this->getLocalisationPath.'rows') }}. |
| 24 | + </span> |
86 | 25 |
|
87 | | - </span> |
88 | | - |
89 | | - <button |
90 | | - x-on:click="clearSelected" |
91 | | - wire:loading.attr="disabled" |
92 | | - type="button" |
93 | | - class="btn btn-primary btn-sm" |
94 | | - > |
| 26 | + <button |
| 27 | + x-on:click="clearSelected" |
| 28 | + wire:loading.attr="disabled" |
| 29 | + type="button" |
| 30 | + {{ |
| 31 | + $attributes->merge($this->getBulkActionsRowButtonAttributes)->class([ |
| 32 | + 'ml-1 underline text-sm leading-5 font-medium focus:outline-none focus:underline transition duration-150 ease-in-out' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true), |
| 33 | + 'text-blue-600 text-gray-700 focus:text-gray-800 dark:text-white dark:hover:text-gray-400' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-colors'] ?? true), |
| 34 | + 'btn btn-primary btn-sm' => $this->isBootstrap && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true) |
| 35 | + ]) |
| 36 | + }} |
| 37 | + > |
95 | 38 | {{ __($this->getLocalisationPath.'Deselect All') }} |
96 | | - </button> |
97 | | - </div> |
98 | | - </template> |
| 39 | + </button> |
| 40 | + </div> |
| 41 | + </template> |
| 42 | + |
| 43 | + <template x-if="selectedItems.length !== paginationTotalItemCount && !selectAllStatus"> |
| 44 | + <div wire:key="{{ $tableName }}-some-selected"> |
| 45 | + <span> |
| 46 | + {{ __($this->getLocalisationPath.'You have selected') }} |
| 47 | + <strong><span x-text="selectedItems.length"></span></strong> |
| 48 | + {{ __($this->getLocalisationPath.'rows, do you want to select all') }} |
| 49 | + @if(!$simplePagination) <strong><span x-text="paginationTotalItemCount"></span></strong> @endif |
| 50 | + </span> |
99 | 51 |
|
100 | | - <template x-if="selectedItems.length !== paginationTotalItemCount && !selectAllStatus"> |
101 | | - <div wire:key="{{ $tableName }}-some-selected"> |
102 | | - <span> |
103 | | - {{ __($this->getLocalisationPath.'You have selected') }} |
104 | | - <strong><span x-text="selectedItems.length"></span></strong> |
105 | | - {{ __($this->getLocalisationPath.'rows, do you want to select all') }} |
106 | | - @if(!$simplePagination) <strong><span x-text="paginationTotalItemCount"></span></strong> @endif |
107 | | - </span> |
| 52 | + <button |
| 53 | + x-on:click="selectAllOnPage()" |
| 54 | + wire:loading.attr="disabled" |
| 55 | + type="button" |
| 56 | + {{ |
| 57 | + $attributes->merge($this->getBulkActionsRowButtonAttributes)->class([ |
| 58 | + 'ml-1 underline text-sm leading-5 font-medium focus:outline-none focus:underline transition duration-150 ease-in-out' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true), |
| 59 | + 'text-blue-600 text-gray-700 focus:text-gray-800 dark:text-white dark:hover:text-gray-400' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-colors'] ?? true), |
| 60 | + 'btn btn-primary btn-sm' => $this->isBootstrap && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true) |
| 61 | + ]) |
| 62 | + }} |
108 | 63 |
|
109 | | - <button |
110 | | - x-on:click="selectAllOnPage" |
111 | | - wire:loading.attr="disabled" |
112 | | - type="button" |
113 | | - class="btn btn-primary btn-sm" |
114 | | - > |
115 | | - {{ __($this->getLocalisationPath.'Select All On Page') }} |
116 | | - </button> |
| 64 | + >{{ __($this->getLocalisationPath.'Select All On Page') }} |
| 65 | + </button> |
117 | 66 |
|
118 | | - <button |
119 | | - x-on:click="setAllSelected()" |
120 | | - wire:loading.attr="disabled" |
121 | | - type="button" |
122 | | - class="btn btn-primary btn-sm" |
123 | | - > |
124 | | - {{ __($this->getLocalisationPath.'Select All') }} |
125 | | - </button> |
| 67 | + <button |
| 68 | + x-on:click="setAllSelected()" |
| 69 | + wire:loading.attr="disabled" |
| 70 | + type="button" |
| 71 | + {{ |
| 72 | + $attributes->merge($this->getBulkActionsRowButtonAttributes)->class([ |
| 73 | + 'ml-1 underline text-sm leading-5 font-medium focus:outline-none focus:underline transition duration-150 ease-in-out' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true), |
| 74 | + 'text-blue-600 text-gray-700 focus:text-gray-800 dark:text-white dark:hover:text-gray-400' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-colors'] ?? true), |
| 75 | + 'btn btn-primary btn-sm' => $this->isBootstrap && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true) |
| 76 | + ]) |
| 77 | + }} |
| 78 | + > |
| 79 | + {{ __($this->getLocalisationPath.'Select All') }} |
| 80 | + </button> |
126 | 81 |
|
127 | | - <button |
128 | | - x-on:click="clearSelected" |
129 | | - wire:loading.attr="disabled" |
130 | | - type="button" |
131 | | - class="btn btn-primary btn-sm" |
132 | | - > |
133 | | - {{ __($this->getLocalisationPath.'Deselect All') }} |
134 | | - </button> |
135 | | - </div> |
136 | | - </template> |
137 | | - </x-livewire-tables::table.td.plain> |
138 | | - </x-livewire-tables::table.tr.plain> |
139 | | - @endif |
| 82 | + <button |
| 83 | + x-on:click="clearSelected" |
| 84 | + wire:loading.attr="disabled" |
| 85 | + type="button" |
| 86 | + {{ |
| 87 | + $attributes->merge($this->getBulkActionsRowButtonAttributes)->class([ |
| 88 | + 'ml-1 underline text-sm leading-5 font-medium focus:outline-none focus:underline transition duration-150 ease-in-out' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true), |
| 89 | + 'text-blue-600 text-gray-700 focus:text-gray-800 dark:text-white dark:hover:text-gray-400' => $this->isTailwind && ($this->getBulkActionsRowButtonAttributes['default-colors'] ?? true), |
| 90 | + 'btn btn-primary btn-sm' => $this->isBootstrap && ($this->getBulkActionsRowButtonAttributes['default-styling'] ?? true) |
| 91 | + ]) |
| 92 | + }} |
| 93 | + > |
| 94 | + {{ __($this->getLocalisationPath.'Deselect All') }} |
| 95 | + </button> |
| 96 | + </div> |
| 97 | + </template> |
| 98 | + </x-livewire-tables::table.td.plain> |
| 99 | + </x-livewire-tables::table.tr.plain> |
140 | 100 | @endif |
0 commit comments