Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set separate views for column and entry #4

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
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
40 changes: 40 additions & 0 deletions resources/views/popover-entry.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<div x-data class="fi-popover">
@php
$getState = $getState();
$getTrigger = $getTrigger();
$getPlacement = $getPlacement();
$getOffset = $getOffset();
$getPopOverMaxWidth = $getPopOverMaxWidth();
$getIcon = $getIcon($getState);
@endphp
<template x-ref="template">
<div class="fi-popover-content">
{{ $getContent() }}
</div>
</template>

<button
class="w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
x-tooltip="{
trigger: '{{ $getTrigger }}',
placement: '{{ $getPlacement }}',
offset: @js($getOffset),
maxWidth: '{{ $getPopOverMaxWidth }}',

content: () => $refs.template.innerHTML,
appendTo: $root,
allowHTML: true,
interactive: true,
theme: $store.theme,
}">

{{ $getState }}

@if($getIcon)
<x-filament::icon
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
/>
@endif
</button>
</div>
2 changes: 1 addition & 1 deletion src/Infolists/PopoverEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ class PopoverEntry extends Entry
use HasIcon;
use HasPopover;

protected string $view = 'zeus-popover::popover';
protected string $view = 'zeus-popover::popover-entry';
}
2 changes: 1 addition & 1 deletion src/Tables/PopoverColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PopoverColumn extends Column
use HasDescription;
use HasPopover;

protected string $view = 'zeus-popover::popover';
protected string $view = 'zeus-popover::popover-column';

protected function setUp(): void
{
Expand Down
Loading