Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Sep 10, 2023
1 parent a802bb8 commit cddc93c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class="fi-sidebar-group-items flex flex-col gap-y-1"
: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>
Expand Down
3 changes: 0 additions & 3 deletions packages/panels/src/Navigation/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ public function url(string | Closure | null $url, bool | Closure $shouldOpenInNe
return $this;
}


public function openUrlInNewTab(bool | Closure $condition = true): static
{
$this->shouldOpenUrlInNewTab = $condition;

return $this;
}


public function hidden(bool | Closure $condition = true): static
{
$this->isHidden = $condition;
Expand Down Expand Up @@ -143,7 +141,6 @@ public function getUrl(): ?string
return $this->evaluate($this->url);
}


public function shouldOpenUrlInNewTab(): bool
{
return (bool) $this->evaluate($this->shouldOpenUrlInNewTab);
Expand Down
2 changes: 1 addition & 1 deletion packages/panels/src/Navigation/NavigationItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function sort(int | Closure | null $sort): static

public function url(string | Closure | null $url, bool | Closure $shouldOpenInNewTab = false): static
{
$this->shouldOpenUrlInNewTab = $shouldOpenInNewTab;
$this->openUrlInNewTab($shouldOpenInNewTab);
$this->url = $url;

return $this;
Expand Down
2 changes: 1 addition & 1 deletion packages/widgets/src/StatsOverviewWidget/Stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function openUrlInNewTab(bool $condition = true): static

public function url(?string $url, bool $shouldOpenInNewTab = false): static
{
$this->shouldOpenUrlInNewTab = $shouldOpenInNewTab;
$this->openUrlInNewTab($shouldOpenInNewTab);
$this->url = $url;

return $this;
Expand Down

0 comments on commit cddc93c

Please sign in to comment.