Skip to content

Commit

Permalink
Merge pull request #3 from a7medKhalid/add-description
Browse files Browse the repository at this point in the history
add description
  • Loading branch information
atmonshi authored Jan 9, 2024
2 parents 5f26c62 + 7ce88e5 commit 56c542c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions resources/views/popover.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,27 @@
$getOffset = $getOffset();
$getPopOverMaxWidth = $getPopOverMaxWidth();
$getIcon = $getIcon($getState);
$descriptionAbove = $getDescriptionAbove();
$descriptionBelow = $getDescriptionBelow();
$canWrap = $canWrap();
@endphp
<template x-ref="template">
<div class="fi-popover-content">
{{ $getContent() }}
</div>
</template>

@if (filled($descriptionAbove))
<p
@class([
'text-sm text-gray-500 dark:text-gray-400',
'whitespace-normal' => $canWrap,
])
>
{{ $descriptionAbove }}
</p>
@endif

<button
class="w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
x-tooltip="{
Expand All @@ -37,4 +51,15 @@ class="h-5 w-5 text-gray-500 dark:text-gray-400"
/>
@endif
</button>

@if (filled($descriptionBelow))
<p
@class([
'text-sm text-gray-500 dark:text-gray-400',
'whitespace-normal' => $canWrap,
])
>
{{ $descriptionBelow }}
</p>
@endif
</div>
4 changes: 4 additions & 0 deletions src/Tables/PopoverColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

use Filament\Support\Concerns;
use Filament\Tables\Columns\Column;
use Filament\Tables\Columns\Concerns\CanWrap;
use Filament\Tables\Columns\Concerns\HasDescription;
use LaraZeus\Popover\Concerns\HasPopover;

class PopoverColumn extends Column
{
use Concerns\HasIcon;
use HasPopover;
use HasDescription;
use CanWrap;

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

Expand Down

0 comments on commit 56c542c

Please sign in to comment.