From a3d6eb3f3cac44d120b86e4ef2d09c0a2bc45062 Mon Sep 17 00:00:00 2001 From: Romero Sarmiento Date: Wed, 1 Oct 2025 16:50:03 +0800 Subject: [PATCH 1/7] feat: Add required functionality --- src/Html/Editor/Fields/Field.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Html/Editor/Fields/Field.php b/src/Html/Editor/Fields/Field.php index f3c737a..2dd2a55 100644 --- a/src/Html/Editor/Fields/Field.php +++ b/src/Html/Editor/Fields/Field.php @@ -387,4 +387,20 @@ public function className(string $className): static return $this; } + + /** + * Add an additional format to indicate if a field is required. + * + * @return $this + */ + public function required(bool $required = true) : Field + { + /** @var Field $this */ + $requiredFieldHtml = $required ? '*' : ''; + + /** @var string $label */ + $label = $this->get('label'); + + return $this->label($label.' '.$requiredFieldHtml); + } } From 064306cfed30a37fbeb4fdd3e63acdde4151eae9 Mon Sep 17 00:00:00 2001 From: Romero Sarmiento Date: Wed, 1 Oct 2025 16:52:01 +0800 Subject: [PATCH 2/7] fix: return type to static --- src/Html/Editor/Fields/Field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html/Editor/Fields/Field.php b/src/Html/Editor/Fields/Field.php index 2dd2a55..fa4e51a 100644 --- a/src/Html/Editor/Fields/Field.php +++ b/src/Html/Editor/Fields/Field.php @@ -393,7 +393,7 @@ public function className(string $className): static * * @return $this */ - public function required(bool $required = true) : Field + public function required(bool $required = true) : static { /** @var Field $this */ $requiredFieldHtml = $required ? '*' : ''; From 5b4f380c134bf34d3e8fac9f5c4a0524a83ed6a0 Mon Sep 17 00:00:00 2001 From: Romero Sarmiento Date: Wed, 1 Oct 2025 16:52:46 +0800 Subject: [PATCH 3/7] style: remove whitespace --- src/Html/Editor/Fields/Field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html/Editor/Fields/Field.php b/src/Html/Editor/Fields/Field.php index fa4e51a..144cf2d 100644 --- a/src/Html/Editor/Fields/Field.php +++ b/src/Html/Editor/Fields/Field.php @@ -393,7 +393,7 @@ public function className(string $className): static * * @return $this */ - public function required(bool $required = true) : static + public function required(bool $required = true): static { /** @var Field $this */ $requiredFieldHtml = $required ? '*' : ''; From 5a9651b9d165795e94c676f0e4c950b1f4e01505 Mon Sep 17 00:00:00 2001 From: Romero Sarmiento Date: Wed, 1 Oct 2025 16:53:47 +0800 Subject: [PATCH 4/7] fix: error with @var --- src/Html/Editor/Fields/Field.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Html/Editor/Fields/Field.php b/src/Html/Editor/Fields/Field.php index 144cf2d..1160e82 100644 --- a/src/Html/Editor/Fields/Field.php +++ b/src/Html/Editor/Fields/Field.php @@ -395,10 +395,7 @@ public function className(string $className): static */ public function required(bool $required = true): static { - /** @var Field $this */ $requiredFieldHtml = $required ? '*' : ''; - - /** @var string $label */ $label = $this->get('label'); return $this->label($label.' '.$requiredFieldHtml); From f6020cf11125025e7c854062ee65b8690c7f0267 Mon Sep 17 00:00:00 2001 From: Romero Sarmiento Date: Wed, 1 Oct 2025 17:03:26 +0800 Subject: [PATCH 5/7] fix: error with $label --- src/Html/Editor/Fields/Field.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Html/Editor/Fields/Field.php b/src/Html/Editor/Fields/Field.php index 1160e82..f0eb20a 100644 --- a/src/Html/Editor/Fields/Field.php +++ b/src/Html/Editor/Fields/Field.php @@ -389,7 +389,7 @@ public function className(string $className): static } /** - * Add an additional format to indicate if a field is required. + * Add a format to indicate if a field is required. * * @return $this */ @@ -398,6 +398,6 @@ public function required(bool $required = true): static $requiredFieldHtml = $required ? '*' : ''; $label = $this->get('label'); - return $this->label($label.' '.$requiredFieldHtml); + return $this->label(($label ?? '').' '.$requiredFieldHtml); } } From cf875dbb841153b5f96c096c38ad5ae5d68ed51e Mon Sep 17 00:00:00 2001 From: yajra <2687997+yajra@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:16:08 +0000 Subject: [PATCH 6/7] fix: pint :robot: --- src/Html/Editor/Fields/Field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html/Editor/Fields/Field.php b/src/Html/Editor/Fields/Field.php index f0eb20a..b59a29d 100644 --- a/src/Html/Editor/Fields/Field.php +++ b/src/Html/Editor/Fields/Field.php @@ -388,7 +388,7 @@ public function className(string $className): static return $this; } - /** + /** * Add a format to indicate if a field is required. * * @return $this From f0a95f20e7a4b5673d0866a78542388b1de275c8 Mon Sep 17 00:00:00 2001 From: Tushar Nain Date: Fri, 3 Oct 2025 03:23:12 +0530 Subject: [PATCH 7/7] Add ->style() method to Column for inline CSS attribute in Column --- src/Html/Column.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Html/Column.php b/src/Html/Column.php index 34933d5..724e3f7 100644 --- a/src/Html/Column.php +++ b/src/Html/Column.php @@ -88,6 +88,18 @@ public function title(string $value): static return $this; } + /** + * Set column style. + * + * @return $this + */ + public function style(string $css): static + { + $this->attributes['style'] = $css; + + return $this; + } + /** * Create a computed column that is not searchable/orderable. */