From a0a989767e99f2b1a8f655f0c78f0696d0e3aef8 Mon Sep 17 00:00:00 2001 From: Paul Sharypov Date: Tue, 7 Mar 2023 10:14:58 +0300 Subject: [PATCH] fix(Field): hide action buttons on update/detail/creation views by default, #2 --- src/ActionButton.php | 23 +++++++++++++++++++++++ src/ActionButtons.php | 25 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/ActionButton.php b/src/ActionButton.php index 550ff49..a9f1483 100644 --- a/src/ActionButton.php +++ b/src/ActionButton.php @@ -14,6 +14,29 @@ class ActionButton extends Field */ public $component = 'action-button'; + + /** + * Indicates if the element should be shown on the update view. + * + * @var bool + */ + public $showOnUpdate = false; + + + /** + * Indicates if the element should be shown on the detail view. + * + * @var bool + */ + public $showOnDetail = false; + + + /** + * Indicates if the element should be shown on the creation view. + * + * @var bool + */ + public $showOnCreation = false; /** * @param Action $action diff --git a/src/ActionButtons.php b/src/ActionButtons.php index 7d51cf2..0ca7421 100644 --- a/src/ActionButtons.php +++ b/src/ActionButtons.php @@ -13,6 +13,7 @@ class ActionButtons extends Field */ public $component = 'action-buttons'; + /** * The text alignment for the field's text in tables. * @@ -21,6 +22,30 @@ class ActionButtons extends Field public $textAlign = 'center'; + /** + * Indicates if the element should be shown on the update view. + * + * @var bool + */ + public $showOnUpdate = false; + + + /** + * Indicates if the element should be shown on the detail view. + * + * @var bool + */ + public $showOnDetail = false; + + + /** + * Indicates if the element should be shown on the creation view. + * + * @var bool + */ + public $showOnCreation = false; + + /** * @param array $collection * @return $this