@@ -9,13 +9,13 @@ trait HasBulkActionsStyling
99{
1010 protected array $ bulkActionsCheckboxAttributes = [];
1111
12- protected array $ bulkActionsThAttributes = ['default ' => true ];
12+ protected array $ bulkActionsThAttributes = ['default ' => null , ' default-colors ' => null , ' default-styling ' => null ];
1313
14- protected array $ bulkActionsThCheckboxAttributes = ['default ' => true ];
14+ protected array $ bulkActionsThCheckboxAttributes = ['default ' => null , ' default-colors ' => null , ' default-styling ' => null ];
1515
16- protected array $ bulkActionsTdAttributes = ['default ' => true ];
17-
18- protected array $ bulkActionsTdCheckboxAttributes = ['default ' => true , 'default-colors ' => false , 'default-styling ' => false ];
16+ protected array $ bulkActionsTdAttributes = ['default ' => null , ' default-colors ' => null , ' default-styling ' => null ];
17+
18+ protected array $ bulkActionsTdCheckboxAttributes = ['default ' => null , 'default-colors ' => null , 'default-styling ' => null ];
1919
2020 protected array $ bulkActionsButtonAttributes = ['default-colors ' => true , 'default-styling ' => true ];
2121
@@ -69,7 +69,7 @@ public function getBulkActionsMenuItemAttributes(): array
6969 #[Computed]
7070 public function getBulkActionsThAttributes (): array
7171 {
72- return $ this ->getCustomAttributes ('bulkActionsThAttributes ' );
72+ return $ this ->getCustomAttributesNew ('bulkActionsThAttributes ' , true , true );
7373
7474 }
7575
@@ -79,7 +79,7 @@ public function getBulkActionsThAttributes(): array
7979 #[Computed]
8080 public function hasBulkActionsThAttributes (): bool
8181 {
82- return $ this ->getBulkActionsThAttributes () != ['default ' => true , 'default-colors ' => false , 'default-styling ' => false ];
82+ return $ this ->getBulkActionsThAttributes () != ['default ' => true , 'default-colors ' => true , 'default-styling ' => true ];
8383 }
8484
8585 /**
@@ -89,41 +89,38 @@ public function hasBulkActionsThAttributes(): bool
8989 */
9090 public function getBulkActionsThCheckboxAttributes (): array
9191 {
92- return $ this ->getCustomAttributes ('bulkActionsThCheckboxAttributes ' );
92+ return $ this ->getCustomAttributesNew ('bulkActionsThCheckboxAttributes ' , true , true );
93+
9394 }
9495
9596 /**
9697 * Used to get attributes for the Bulk Actions TD
9798 *
9899 * @return array<mixed>
99100 */
101+ #[Computed]
100102 public function getBulkActionsTdAttributes (): array
101103 {
102- return $ this ->getCustomAttributes ('bulkActionsTdAttributes ' );
104+ return $ this ->getCustomAttributesNew ('bulkActionsTdAttributes ' , true , true );
103105 }
104106
105107 /**
106108 * Used to get attributes for the Bulk Actions TD
107109 *
108110 * @return array<mixed>
109111 */
112+ #[Computed]
110113 public function getBulkActionsTdCheckboxAttributes (): array
111114 {
112- return $ this ->getCustomAttributes ('bulkActionsTdCheckboxAttributes ' );
113- $ array = array_merge (
115+ return array_merge (
114116 [
115- 'x-cloak ' ,
116117 'x-show ' => '!currentlyReorderingStatus ' ,
117118 'x-model ' => 'selectedItems ' ,
118119 'wire:loading.attr.delay ' => 'disabled ' ,
119120 'type ' => 'checkbox ' ,
120121 ],
121- $ this ->getCustomAttributes ('bulkActionsTdCheckboxAttributes ' )
122+ $ this ->getCustomAttributesNew ('bulkActionsTdCheckboxAttributes ' , true , true )
122123 );
123- ksort ($ array );
124-
125- return $ array ;
126-
127124 }
128125
129126 /**
@@ -143,84 +140,69 @@ public function getBulkActionsRowButtonAttributesBag(): ComponentAttributeBag
143140 {
144141 return $ this ->getCustomAttributesBagFromArray ($ this ->getBulkActionsRowButtonAttributes ());
145142 }
146-
143+
147144 /**
148145 * Used to set attributes for the Bulk Actions Menu Button
149146 */
150147 public function setBulkActionsButtonAttributes (array $ bulkActionsButtonAttributes ): self
151148 {
152- $ this ->setCustomAttributes ('bulkActionsButtonAttributes ' , $ bulkActionsButtonAttributes );
153-
154- return $ this ;
149+ return $ this ->setCustomAttributes ('bulkActionsButtonAttributes ' , $ bulkActionsButtonAttributes );
155150 }
156151
157152 /**
158153 * Used to set attributes for the Bulk Actions Menu
159154 */
160155 public function setBulkActionsMenuAttributes (array $ bulkActionsMenuAttributes ): self
161156 {
162- $ this ->setCustomAttributes ('bulkActionsMenuAttributes ' , $ bulkActionsMenuAttributes );
163-
164- return $ this ;
157+ return $ this ->setCustomAttributes ('bulkActionsMenuAttributes ' , $ bulkActionsMenuAttributes );
165158 }
166159
167160 /**
168161 * Used to set attributes for the Bulk Actions Menu Items
169162 */
170163 public function setBulkActionsMenuItemAttributes (array $ bulkActionsMenuItemAttributes ): self
171164 {
172- $ this ->setCustomAttributes ('bulkActionsMenuItemAttributes ' , $ bulkActionsMenuItemAttributes );
173-
174- return $ this ;
165+ return $ this ->setCustomAttributes ('bulkActionsMenuItemAttributes ' , $ bulkActionsMenuItemAttributes );
175166 }
176167
177168 /**
178169 * Used to set attributes for the Bulk Actions TD in the Row
179170 */
180171 public function setBulkActionsTdAttributes (array $ bulkActionsTdAttributes ): self
181172 {
182- $ this ->setCustomAttributes ('bulkActionsTdAttributes ' , $ bulkActionsTdAttributes );
173+ return $ this ->setCustomAttributesDefaults ('bulkActionsTdAttributes ' , $ bulkActionsTdAttributes );
183174
184- return $ this ;
185175 }
186176
187177 /**
188178 * Used to set attributes for the Bulk Actions Checkbox in the Row
189179 */
190180 public function setBulkActionsTdCheckboxAttributes (array $ bulkActionsTdCheckboxAttributes ): self
191181 {
192- $ this ->setCustomAttributes ('bulkActionsTdCheckboxAttributes ' , $ bulkActionsTdCheckboxAttributes );
193-
194- return $ this ;
182+ return $ this ->setCustomAttributesDefaults ('bulkActionsTdCheckboxAttributes ' , $ bulkActionsTdCheckboxAttributes );
195183 }
196184
197185 /**
198186 * Used to set attributes for the <th> for Bulk Actions
199187 */
200188 public function setBulkActionsThAttributes (array $ bulkActionsThAttributes ): self
201189 {
202- $ this ->setCustomAttributes ('bulkActionsThAttributes ' , $ bulkActionsThAttributes );
203-
204- return $ this ;
190+ return $ this ->setCustomAttributesDefaults ('bulkActionsThAttributes ' , $ bulkActionsThAttributes );
205191 }
206192
207193 /**
208194 * Used to set attributes for the Bulk Actions Checkbox in the <th>
209195 */
210196 public function setBulkActionsThCheckboxAttributes (array $ bulkActionsThCheckboxAttributes ): self
211197 {
212- $ this ->setCustomAttributes ('bulkActionsThCheckboxAttributes ' , $ bulkActionsThCheckboxAttributes );
213-
214- return $ this ;
198+ return $ this ->setCustomAttributesDefaults ('bulkActionsThCheckboxAttributes ' , $ bulkActionsThCheckboxAttributes );
215199 }
216200
217201 /**
218202 * Used to set attributes for the Bulk Actions Row Buttons
219203 */
220204 public function setBulkActionsRowButtonAttributes (array $ bulkActionsRowButtonAttributes ): self
221205 {
222- $ this ->setCustomAttributes ('bulkActionsRowButtonAttributes ' , $ bulkActionsRowButtonAttributes );
223-
224- return $ this ;
206+ return $ this ->setCustomAttributes ('bulkActionsRowButtonAttributes ' , $ bulkActionsRowButtonAttributes );
225207 }
226208}
0 commit comments