merge($loaderWrapper)
- ->class(['hidden w-full text-center place-items-center align-middle' => $this->isTailwind && ($loaderWrapper['default'] ?? true)])
- ->class(['d-none w-100 text-center align-items-center' => $this->isBootstrap && ($loaderWrapper['default'] ?? true)])
+ $attributes->merge($loaderRow)
+ ->class(['hidden w-full text-center place-items-center align-middle' => $this->isTailwind && ($loaderRow['default'] ?? true)])
+ ->class(['d-none w-100 text-center align-items-center' => $this->isBootstrap && ($loaderRow['default'] ?? true)])
->except(['default','default-styling','default-colors'])
}}>
setCustomAttributes('loadingPlaceHolderRowAttributes', [...$this->getCustomAttributes(propertyName: 'loadingPlaceHolderRowAttributes', default: false, classicMode: true), ...$attributes]);
+
+ return $this;
+ }
+
public function setLoadingPlaceHolderWrapperAttributes(array $attributes): self
{
- $this->setCustomAttributes('loadingPlaceHolderWrapperAttributes', [...$this->getCustomAttributes(propertyName: 'loadingPlaceHolderWrapperAttributes', default: false, classicMode: true), ...$attributes]);
+ $this->setCustomAttributes('loadingPlaceHolderRowAttributes', [...$this->getCustomAttributes(propertyName: 'loadingPlaceHolderRowAttributes', default: false, classicMode: true), ...$attributes]);
return $this;
}
diff --git a/src/Traits/Styling/HasLoadingPlaceholderStyling.php b/src/Traits/Styling/HasLoadingPlaceholderStyling.php
index 2d2dda7dc..1dbb2b80d 100644
--- a/src/Traits/Styling/HasLoadingPlaceholderStyling.php
+++ b/src/Traits/Styling/HasLoadingPlaceholderStyling.php
@@ -16,5 +16,7 @@ trait HasLoadingPlaceholderStyling
protected array $loadingPlaceHolderWrapperAttributes = [];
+ protected array $loadingPlaceHolderRowAttributes = [];
+
protected array $loadingPlaceHolderCellAttributes = ['class' => '', 'default' => true];
}
diff --git a/src/Traits/Styling/Helpers/LoadingPlaceholderStylingHelpers.php b/src/Traits/Styling/Helpers/LoadingPlaceholderStylingHelpers.php
index 0d9c6f3b1..ef115641f 100644
--- a/src/Traits/Styling/Helpers/LoadingPlaceholderStylingHelpers.php
+++ b/src/Traits/Styling/Helpers/LoadingPlaceholderStylingHelpers.php
@@ -20,8 +20,12 @@ public function getLoadingPlaceHolderIconAttributes(): array
public function getLoadingPlaceHolderWrapperAttributes(): array
{
- return $this->getCustomAttributes(propertyName: 'loadingPlaceHolderWrapperAttributes', default: true, classicMode: true);
+ return $this->getCustomAttributes(propertyName: 'loadingPlaceHolderRowAttributes', default: true, classicMode: true);
+ }
+ public function getLoadingPlaceHolderRowAttributes(): array
+ {
+ return $this->getCustomAttributes(propertyName: 'loadingPlaceHolderRowAttributes', default: true, classicMode: true);
}
public function getLoadingPlaceHolderCellAttributes(): array
diff --git a/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php b/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php
index 03150e8b8..850efedb8 100644
--- a/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php
+++ b/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php
@@ -89,21 +89,49 @@ public function test_can_set_loading_placeholder_wrapper_attributes(): void
$this->basicTable->setLoadingPlaceholderEnabled();
$this->assertSame(['default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+ $this->assertSame(['default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderRowAttributes());
$this->basicTable->setLoadingPlaceHolderWrapperAttributes(['class' => 'test1234567-wrapper']);
$this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getLoadingPlaceHolderRowAttributes());
$this->basicTable->setLoadingPlaceHolderWrapperAttributes(['class' => 'test1234567-wrapper', 'default' => true, 'default-colors' => true, 'default-styling' => true]);
$this->assertSame(['class' => 'test1234567-wrapper', 'default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderRowAttributes());
$this->basicTable->setLoadingPlaceHolderWrapperAttributes(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => true]);
$this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderRowAttributes());
}
+ public function test_can_set_loading_placeholder_row_attributes(): void
+ {
+ $this->basicTable->setLoadingPlaceholderEnabled();
+
+ $this->assertSame(['default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderRowAttributes());
+
+ $this->basicTable->setLoadingPlaceHolderRowAttributes(['class' => 'test1234567-wrapper']);
+
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getLoadingPlaceHolderRowAttributes());
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+
+ $this->basicTable->setLoadingPlaceHolderRowAttributes(['class' => 'test1234567-wrapper', 'default' => true, 'default-colors' => true, 'default-styling' => true]);
+
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderRowAttributes());
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+
+ $this->basicTable->setLoadingPlaceHolderRowAttributes(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => true]);
+
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderRowAttributes());
+ $this->assertSame(['class' => 'test1234567-wrapper', 'default' => false, 'default-colors' => false, 'default-styling' => true], $this->basicTable->getLoadingPlaceHolderWrapperAttributes());
+
+ }
+
+
public function test_can_set_loading_placeholder_custom_blade(): void
{
$this->basicTable->setLoadingPlaceholderEnabled();
From 677882e986c40bfa1f94d84556b0c9c6b76fdfe4 Mon Sep 17 00:00:00 2001
From: lrljoe
Date: Sun, 20 Oct 2024 02:48:37 +0000
Subject: [PATCH 9/9] Fix styling
---
.../Configuration/LoadingPlaceholderStylingConfiguration.php | 1 -
.../Traits/Configuration/LoadingPlaceholderConfigurationTest.php | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/Traits/Styling/Configuration/LoadingPlaceholderStylingConfiguration.php b/src/Traits/Styling/Configuration/LoadingPlaceholderStylingConfiguration.php
index 2590535d7..c07780bdc 100644
--- a/src/Traits/Styling/Configuration/LoadingPlaceholderStylingConfiguration.php
+++ b/src/Traits/Styling/Configuration/LoadingPlaceholderStylingConfiguration.php
@@ -18,7 +18,6 @@ public function setLoadingPlaceHolderIconAttributes(array $attributes): self
return $this;
}
-
public function setLoadingPlaceHolderRowAttributes(array $attributes): self
{
$this->setCustomAttributes('loadingPlaceHolderRowAttributes', [...$this->getCustomAttributes(propertyName: 'loadingPlaceHolderRowAttributes', default: false, classicMode: true), ...$attributes]);
diff --git a/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php b/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php
index 850efedb8..28a3b97ad 100644
--- a/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php
+++ b/tests/Traits/Configuration/LoadingPlaceholderConfigurationTest.php
@@ -131,7 +131,6 @@ public function test_can_set_loading_placeholder_row_attributes(): void
}
-
public function test_can_set_loading_placeholder_custom_blade(): void
{
$this->basicTable->setLoadingPlaceholderEnabled();
|