From f42820d53c211ed95f49462326d5faec4a6fb42e Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Sun, 29 Oct 2023 21:44:33 +0000 Subject: [PATCH] wip --- packages/tables/src/Filters/Indicator.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/tables/src/Filters/Indicator.php b/packages/tables/src/Filters/Indicator.php index 12102245ab9..13b681e79ba 100644 --- a/packages/tables/src/Filters/Indicator.php +++ b/packages/tables/src/Filters/Indicator.php @@ -12,23 +12,25 @@ class Indicator extends Component protected bool | Closure $isRemovable = true; - protected string | Closure | null $label = null; + protected string | Closure $label; protected string | Closure | null $removeField = null; protected string | Closure | null $removeLivewireClickHandler = null; - public function __construct(string $label) + protected string $evaluationIdentifier = 'indicator'; + + public function __construct(string | Closure $label) { $this->label($label); } - public static function make(string | Closure | null $label = null): static + public static function make(string | Closure $label): static { return app(static::class, ['label' => $label]); } - public function label(string $label): static + public function label(string | Closure $label): static { $this->label = $label; @@ -37,7 +39,7 @@ public function label(string $label): static public function getLabel(): string { - return $this->label; + return $this->evaluate($this->label); } public function removable(bool | Closure $condition = true): static