This commit is contained in:
Dan Harrin
2023-09-10 09:07:45 +01:00
parent a802bb8b92
commit cddc93c3a6
4 changed files with 3 additions and 6 deletions
@@ -72,8 +72,8 @@
:grouped="filled($label)"
:icon="$item->getIcon()"
:last="$loop->last"
:should-open-url-in-new-tab="$item->shouldOpenUrlInNewTab()"
:url="$item->getUrl()"
:should-open-url-in-new-tab="$item->shouldOpenUrlInNewTab()"
>
{{ $item->getLabel() }}
</x-filament-panels::sidebar.item>
@@ -78,7 +78,6 @@ class MenuItem extends Component
return $this;
}
public function openUrlInNewTab(bool | Closure $condition = true): static
{
$this->shouldOpenUrlInNewTab = $condition;
@@ -86,7 +85,6 @@ class MenuItem extends Component
return $this;
}
public function hidden(bool | Closure $condition = true): static
{
$this->isHidden = $condition;
@@ -143,7 +141,6 @@ class MenuItem extends Component
return $this->evaluate($this->url);
}
public function shouldOpenUrlInNewTab(): bool
{
return (bool) $this->evaluate($this->shouldOpenUrlInNewTab);
@@ -125,7 +125,7 @@ class NavigationItem extends Component
public function url(string | Closure | null $url, bool | Closure $shouldOpenInNewTab = false): static
{
$this->shouldOpenUrlInNewTab = $shouldOpenInNewTab;
$this->openUrlInNewTab($shouldOpenInNewTab);
$this->url = $url;
return $this;
@@ -146,7 +146,7 @@ class Stat extends Component implements Htmlable
public function url(?string $url, bool $shouldOpenInNewTab = false): static
{
$this->shouldOpenUrlInNewTab = $shouldOpenInNewTab;
$this->openUrlInNewTab($shouldOpenInNewTab);
$this->url = $url;
return $this;