diff --git a/src/Traits/Styling/Configuration/ToolsStylingConfiguration.php b/src/Traits/Styling/Configuration/ToolsStylingConfiguration.php index 27679f04b..9b2ca17f4 100644 --- a/src/Traits/Styling/Configuration/ToolsStylingConfiguration.php +++ b/src/Traits/Styling/Configuration/ToolsStylingConfiguration.php @@ -1,20 +1,20 @@ -setCustomAttributes(propertyName: 'toolsAttributes', customAttributes: $toolsAttributes); - - return $this; - } - - public function setToolBarAttributes(array $toolBarAttributes = []): self - { - $this->setCustomAttributes(propertyName: 'toolBarAttributes', customAttributes: $toolBarAttributes); - - return $this; - } -} \ No newline at end of file +setCustomAttributes(propertyName: 'toolsAttributes', customAttributes: $toolsAttributes); + + return $this; + } + + public function setToolBarAttributes(array $toolBarAttributes = []): self + { + $this->setCustomAttributes(propertyName: 'toolBarAttributes', customAttributes: $toolBarAttributes); + + return $this; + } +} diff --git a/src/Traits/Styling/HasToolsStyling.php b/src/Traits/Styling/HasToolsStyling.php index d5bab60ec..c4cb14369 100644 --- a/src/Traits/Styling/HasToolsStyling.php +++ b/src/Traits/Styling/HasToolsStyling.php @@ -1,17 +1,16 @@ - true, 'default-colors' => true, 'class' => '']; - - protected array $toolBarAttributes = ['default-styling' => true, 'default-colors' => true, 'class' => '']; - -} + true, 'default-colors' => true, 'class' => '']; + + protected array $toolBarAttributes = ['default-styling' => true, 'default-colors' => true, 'class' => '']; +} diff --git a/src/Traits/Styling/Helpers/ToolsStylingHelpers.php b/src/Traits/Styling/Helpers/ToolsStylingHelpers.php index 2b9f152d7..95aa8684f 100644 --- a/src/Traits/Styling/Helpers/ToolsStylingHelpers.php +++ b/src/Traits/Styling/Helpers/ToolsStylingHelpers.php @@ -1,33 +1,32 @@ -getCustomAttributes(propertyName: 'toolsAttributes', default: false, classicMode: false); - } - - #[Computed] - public function getToolsAttributesBag(): ComponentAttributeBag - { - return $this->getCustomAttributesBagFromArray($this->getToolsAttributes()); - } - - protected function getToolBarAttributes(): array - { - return $this->getCustomAttributes(propertyName: 'toolBarAttributes', default: false, classicMode: false); - } - - #[Computed] - public function getToolBarAttributesBag(): ComponentAttributeBag - { - return $this->getCustomAttributesBagFromArray($this->getToolBarAttributes()); - - } -} \ No newline at end of file +getCustomAttributes(propertyName: 'toolsAttributes', default: false, classicMode: false); + } + + #[Computed] + public function getToolsAttributesBag(): ComponentAttributeBag + { + return $this->getCustomAttributesBagFromArray($this->getToolsAttributes()); + } + + protected function getToolBarAttributes(): array + { + return $this->getCustomAttributes(propertyName: 'toolBarAttributes', default: false, classicMode: false); + } + + #[Computed] + public function getToolBarAttributesBag(): ComponentAttributeBag + { + return $this->getCustomAttributesBagFromArray($this->getToolBarAttributes()); + + } +} diff --git a/src/Traits/WithTools.php b/src/Traits/WithTools.php index 1c81fde6b..8ede2e382 100644 --- a/src/Traits/WithTools.php +++ b/src/Traits/WithTools.php @@ -15,6 +15,4 @@ trait WithTools protected bool $toolsStatus = true; protected bool $toolBarStatus = true; - - } diff --git a/tests/Traits/Helpers/ToolsStylingHelpersTest.php b/tests/Traits/Helpers/ToolsStylingHelpersTest.php index b56a0fe13..519e9e071 100644 --- a/tests/Traits/Helpers/ToolsStylingHelpersTest.php +++ b/tests/Traits/Helpers/ToolsStylingHelpersTest.php @@ -1,29 +1,28 @@ -assertTrue($this->basicTable->hasCustomAttributes('toolsAttributes')); - } - - public function test_can_get_tools_attributes_initial_values(): void - { - $this->assertSame(['default-styling' => true, 'default-colors' => true, 'class' => ''], $this->basicTable->getToolsAttributesBag()->getAttributes()); - } - - public function test_can_get_toolbar_attributes_initial_status(): void - { - $this->assertTrue($this->basicTable->hasCustomAttributes('toolBarAttributes')); - } - - public function test_can_get_toolbar_attributes_initial_values(): void - { - $this->assertSame(['default-styling' => true, 'default-colors' => true, 'class' => ''], $this->basicTable->getToolBarAttributesBag()->getAttributes()); - } - -} \ No newline at end of file +assertTrue($this->basicTable->hasCustomAttributes('toolsAttributes')); + } + + public function test_can_get_tools_attributes_initial_values(): void + { + $this->assertSame(['default-styling' => true, 'default-colors' => true, 'class' => ''], $this->basicTable->getToolsAttributesBag()->getAttributes()); + } + + public function test_can_get_toolbar_attributes_initial_status(): void + { + $this->assertTrue($this->basicTable->hasCustomAttributes('toolBarAttributes')); + } + + public function test_can_get_toolbar_attributes_initial_values(): void + { + $this->assertSame(['default-styling' => true, 'default-colors' => true, 'class' => ''], $this->basicTable->getToolBarAttributesBag()->getAttributes()); + } +}