diff --git a/resources/views/components/table/tr/bulk-actions.blade.php b/resources/views/components/table/tr/bulk-actions.blade.php index 11ecc95a8..e63d18df2 100644 --- a/resources/views/components/table/tr/bulk-actions.blade.php +++ b/resources/views/components/table/tr/bulk-actions.blade.php @@ -1,4 +1,4 @@ -@aware([ 'tableName','isTailwind','isBootstrap']) +@aware([ 'tableName']) @if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) @php @@ -7,134 +7,94 @@ $simplePagination = $this->isPaginationMethod('simple'); @endphp - @if ($isTailwind) - - - - - - - - @elseif ($isBootstrap) - - - + + + + @endif diff --git a/src/Traits/Styling/Configuration/BulkActionStylingConfiguration.php b/src/Traits/Styling/Configuration/BulkActionStylingConfiguration.php index 9c61f9eba..6f74ed5a3 100644 --- a/src/Traits/Styling/Configuration/BulkActionStylingConfiguration.php +++ b/src/Traits/Styling/Configuration/BulkActionStylingConfiguration.php @@ -73,4 +73,14 @@ public function setBulkActionsThCheckboxAttributes(array $bulkActionsThCheckboxA return $this; } + + /** + * Used to set attributes for the Bulk Actions Row Buttons + */ + public function setBulkActionsRowButtonAttributes(array $bulkActionsRowButtonAttributes): self + { + $this->setCustomAttributes('bulkActionsRowButtonAttributes', $bulkActionsRowButtonAttributes); + + return $this; + } } diff --git a/src/Traits/Styling/HasBulkActionsStyling.php b/src/Traits/Styling/HasBulkActionsStyling.php index c1f1b1aca..07bf1f133 100644 --- a/src/Traits/Styling/HasBulkActionsStyling.php +++ b/src/Traits/Styling/HasBulkActionsStyling.php @@ -25,4 +25,6 @@ trait HasBulkActionsStyling protected array $bulkActionsMenuAttributes = ['default-colors' => true, 'default-styling' => true]; protected array $bulkActionsMenuItemAttributes = ['default-colors' => true, 'default-styling' => true]; + + protected array $bulkActionsRowButtonAttributes = ['default-colors' => true, 'default-styling' => true]; } diff --git a/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php b/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php index 6c100c345..adc3cea89 100644 --- a/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php +++ b/src/Traits/Styling/Helpers/BulkActionStylingHelpers.php @@ -2,6 +2,7 @@ namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers; +use Illuminate\View\ComponentAttributeBag; use Livewire\Attributes\Computed; trait BulkActionStylingHelpers @@ -93,4 +94,22 @@ public function getBulkActionsTdCheckboxAttributes(): array return $this->getCustomAttributes('bulkActionsTdCheckboxAttributes'); } + + /** + * Used to get attributes for the Bulk Actions Row Buttons + * + * @return array + */ + #[Computed] + public function getBulkActionsRowButtonAttributes(): array + { + return $this->getCustomAttributes('bulkActionsRowButtonAttributes', true); + + } + + #[Computed] + public function getBulkActionsRowButtonAttributesBag(): ComponentAttributeBag + { + return $this->getCustomAttributesBagFromArray($this->getBulkActionsRowButtonAttributes()); + } } diff --git a/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php b/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php index fb321a1c4..019c13d22 100644 --- a/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php +++ b/tests/Unit/Traits/Configuration/BulkActionsStylingConfigurationTest.php @@ -32,6 +32,7 @@ public static function providesBulkActionMethodsToTest(): array 'BulkActionsThCheckboxAttributes', 'BulkActionsTdAttributes', 'BulkActionsTdCheckboxAttributes', + 'BulkActionsRowButtonAttributes', ]; }