refactor: rename collapsible to isCollapsible and make non-nullable with false default

This commit is contained in:
André Domingues
2025-05-27 11:06:49 -03:00
parent 7748025b56
commit e0497e29a5
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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
@@ -7,7 +7,7 @@
$heading = $this->getHeading();
$description = $this->getDescription();
$filters = $this->getFilters();
$isCollapsible = $this->getCollapsible();
$isCollapsible = $this->isCollapsible();
@endphp
<x-filament-widgets::widget class="fi-wi-chart">
+3 -3
View File
@@ -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;
}
}