true];
- protected array $bulkActionsTdCheckboxAttributes = ['default' => true];
+ protected array $bulkActionsTdCheckboxAttributes = ['default' => true, 'default-colors' => false, 'default-styling' => false];
protected array $bulkActionsButtonAttributes = ['default-colors' => true, 'default-styling' => true];
diff --git a/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php b/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php
index adc3cea89..aad42b286 100644
--- a/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php
+++ b/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php
@@ -85,13 +85,25 @@ public function getBulkActionsTdAttributes(): array
}
/**
- * Used to get attributes for the Bulk Actions TD
+ * Used to get attributes for the Bulk Actions TD Checkbox
*
* @return array
*/
public function getBulkActionsTdCheckboxAttributes(): array
{
- return $this->getCustomAttributes('bulkActionsTdCheckboxAttributes');
+ $array = array_merge(
+ [
+ 'x-cloak',
+ 'x-show' => '!currentlyReorderingStatus',
+ 'x-model' => 'selectedItems',
+ 'wire:loading.attr.delay' => 'disabled',
+ 'type' => 'checkbox',
+ ],
+ $this->getCustomAttributes('bulkActionsTdCheckboxAttributes')
+ );
+ ksort($array);
+
+ return $array;
}
diff --git a/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php b/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php
index 019c13d22..3eb389975 100644
--- a/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php
+++ b/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php
@@ -78,7 +78,7 @@ public function test_can_set_bulk_actions_attributes_via_provider(string $setMet
'default' => $default,
'default-colors' => $defaultColors,
'default-styling' => $defaultStyling,
- ], $this->basicTable->{$getMethod}());
+ ], collect($this->basicTable->{$getMethod}())->only(['class', 'default', 'default-colors', 'default-styling'])->toArray());
$this->basicTable->{$setMethod}([
'default' => $default,
@@ -92,7 +92,7 @@ public function test_can_set_bulk_actions_attributes_via_provider(string $setMet
'default' => $default,
'default-colors' => ! $defaultColors,
'default-styling' => $defaultStyling,
- ], $this->basicTable->{$getMethod}());
+ ], collect($this->basicTable->{$getMethod}())->only(['class', 'default', 'default-colors', 'default-styling'])->toArray());
}
#[DataProvider('bulkActionAttributesProvider')]
@@ -107,7 +107,7 @@ public function test_can_get_bulk_actions_attributes_bag_via_provider(string $se
$this->basicTable->{$setMethod}($data);
- $this->assertSame($data, $this->basicTable->{$getMethod}());
+ $this->assertSame($data, collect($this->basicTable->{$getMethod}())->only(['class', 'default', 'default-colors', 'default-styling'])->toArray());
$attributeBag = new ComponentAttributeBag($data);
@@ -121,11 +121,26 @@ public function test_bulk_actions_td_attributes_returns_default_true_if_not_set(
public function test_bulk_actions_td_checkbox_attributes_returns_default_true_if_not_set(): void
{
- $this->assertSame(['default' => true, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getBulkActionsTdCheckboxAttributes());
+ $data = [
+ 'x-cloak',
+ 'x-show' => '!currentlyReorderingStatus',
+ 'x-model' => 'selectedItems',
+ 'wire:loading.attr.delay' => 'disabled',
+ 'type' => 'checkbox',
+ 'default' => true,
+ 'default-colors' => false,
+ 'default-styling' => false,
+ ];
+ ksort($data);
+ $returnedData = $this->basicTable->getBulkActionsTdCheckboxAttributes();
+ ksort($returnedData);
+
+ $this->assertSame($data, $returnedData);
}
public function test_bulk_actions_th_attributes_returns_default_true_if_not_set(): void
{
+
$this->assertSame(['default' => true, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getBulkActionsThAttributes());
}