From e0497e29a5084d53293a26eef7b61a0e665e5fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Domingues?= <96439642+andrefelipe18@users.noreply.github.com> Date: Tue, 27 May 2025 11:06:49 -0300 Subject: [PATCH] refactor: rename collapsible to isCollapsible and make non-nullable with false default --- packages/widgets/docs/03-charts.md | 4 ++-- packages/widgets/resources/views/chart-widget.blade.php | 2 +- packages/widgets/src/ChartWidget.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/widgets/docs/03-charts.md b/packages/widgets/docs/03-charts.md index 183ef1ddce..95043133fa 100644 --- a/packages/widgets/docs/03-charts.md +++ b/packages/widgets/docs/03-charts.md @@ -184,10 +184,10 @@ protected ?string $maxHeight = '300px'; ## Making the chart collapsible -You may enable the chart to be collapsible by setting the `$collapsible` property: +You may enable the chart to be collapsible by setting the `$isCollapsible` property: ```php -protected ?bool $collapsible = true; +protected ?bool $isCollapsible = true; ``` ## Setting chart configuration options diff --git a/packages/widgets/resources/views/chart-widget.blade.php b/packages/widgets/resources/views/chart-widget.blade.php index 9b8548f136..99a4abd08d 100644 --- a/packages/widgets/resources/views/chart-widget.blade.php +++ b/packages/widgets/resources/views/chart-widget.blade.php @@ -7,7 +7,7 @@ $heading = $this->getHeading(); $description = $this->getDescription(); $filters = $this->getFilters(); - $isCollapsible = $this->getCollapsible(); + $isCollapsible = $this->isCollapsible(); @endphp diff --git a/packages/widgets/src/ChartWidget.php b/packages/widgets/src/ChartWidget.php index 6394dce741..45dc142160 100644 --- a/packages/widgets/src/ChartWidget.php +++ b/packages/widgets/src/ChartWidget.php @@ -36,7 +36,7 @@ abstract class ChartWidget extends Widget implements HasSchemas */ protected ?array $options = null; - protected ?bool $collapsible = true; + protected bool $isCollapsible = false; /** * @var view-string @@ -127,8 +127,8 @@ abstract class ChartWidget extends Widget implements HasSchemas return $this->color; } - public function getCollapsible(): ?bool + public function isCollapsible(): bool { - return $this->collapsible ?? false; + return $this->isCollapsible; } }