Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/panels/src/Panel/Concerns/HasMaxContentWidth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

namespace Filament\Panel\Concerns;

use Closure;
use Filament\Support\Enums\Width;

trait HasMaxContentWidth
{
protected Width | string | null $maxContentWidth = null;
protected Width | string | Closure | null $maxContentWidth = null;

protected Width | string | null $simplePageMaxContentWidth = null;
protected Width | string | Closure | null $simplePageMaxContentWidth = null;

public function maxContentWidth(Width | string | null $maxContentWidth): static
public function maxContentWidth(Width | string | Closure | null $maxContentWidth): static
{
$this->maxContentWidth = $maxContentWidth;

Expand All @@ -19,10 +20,10 @@ public function maxContentWidth(Width | string | null $maxContentWidth): static

public function getMaxContentWidth(): Width | string | null
{
return $this->maxContentWidth;
return $this->evaluate($this->maxContentWidth);
}

public function simplePageMaxContentWidth(Width | string | null $width): static
public function simplePageMaxContentWidth(Width | string | Closure | null $width): static
{
$this->simplePageMaxContentWidth = $width;

Expand All @@ -31,6 +32,6 @@ public function simplePageMaxContentWidth(Width | string | null $width): static

public function getSimplePageMaxContentWidth(): Width | string | null
{
return $this->simplePageMaxContentWidth;
return $this->evaluate($this->simplePageMaxContentWidth);
}
}