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

fix popover in table #15

Merged
merged 4 commits into from
Mar 7, 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
12 changes: 0 additions & 12 deletions .github/dependabot.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
613 changes: 311 additions & 302 deletions composer.lock

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions resources/views/popover-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
@endphp
<div
wire:key="{{ $this->getId() }}.table.record.{{ $recordKey }}.column.{{ $getName() }}"
x-data="{ open: false }"
x-data

@if($getTrigger === 'hover')
@pointerleave="clearTimeout($time); open = false"
@else
@click.away="open = false"
@pointerleave="$refs.panel.close"
@endif

class="fi-popover fi-ta-text grid w-full gap-y-1 px-3 py-4"
Expand All @@ -36,27 +34,28 @@ class="fi-popover fi-ta-text grid w-full gap-y-1 px-3 py-4"

<div
class="relative w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
x-ref="button"
@if($getTrigger === 'hover')
@pointerenter="$time = setTimeout(() => { open = true }, 200)"
@pointerenter="$refs.panel.open"
@else
@click="open = ! open"
@click="$refs.panel.toggle"
@endif
>
{{ $getState }}

@if($getIcon)
<x-filament::icon
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
/>
@endif
</div>

<div class="z-50 fi-popover-content w-[{{ $getPopOverMaxWidth }}px] border border-gray-100 rounded-lg shadow-lg bg-white dark:bg-gray-800"
x-cloak x-trap="open"
x-show="open"
x-anchor.{{ $getPlacement }}.offset.{{ $getOffset }}="$refs.button"
<div class="z-50 fi-popover-content w-[{{ $getPopOverMaxWidth }}px] border border-gray-100 rounded-lg shadow-lg bg-white dark:bg-gray-800 transition"
x-transition:enter-start="opacity-0"
x-transition:leave-end="opacity-0"
x-cloak
x-ref="panel"
x-float.placement.{{ $getPlacement }}.flip.teleport.offset="{ offset: {{ $getOffset }} }"
>
{{ $getContent }}
</div>
Expand Down
41 changes: 19 additions & 22 deletions resources/views/popover-entry.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,37 @@
$getContent = $getContent();
@endphp
<div
wire:key="{{ $this->getId() }}.entry.record.{{ $getName() }}"
x-data="{ open: false }"

class="fi-popover grid w-full gap-y-1 px-3 py-4"
wire:key="{{ $this->getId() }}.entry.record.{{ $getName() }}"
x-data
@if($getTrigger === 'hover')
@pointerleave="$refs.panel.close"
@endif
>
<div
class="relative w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
@if($getTrigger === 'hover')
@pointerleave="clearTimeout($time); open = false"
@pointerenter="$refs.panel.open"
@else
@click.away="open = false"
@click="$refs.panel.toggle"
@endif

class="fi-popover grid w-full gap-y-1 px-3 py-4"
>
<div
class="relative w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
x-ref="button"
@if($getTrigger === 'hover')
@pointerenter="$time = setTimeout(() => { open = true }, 200)"
@else
@click="open = ! open"
@endif
>
{{ $getState }}

@if($getIcon)
<x-filament::icon
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
/>
@endif
</div>

<div class="z-50 fi-popover-content w-[{{ $getPopOverMaxWidth }}px] border border-gray-100 rounded-lg shadow-lg bg-white dark:bg-gray-800"
x-cloak x-trap="open"
x-show="open"
x-anchor.{{ $getPlacement }}.offset.{{ $getOffset }}="$refs.button"
<div class="z-50 fi-popover-content w-[{{ $getPopOverMaxWidth }}px] border border-gray-100 rounded-lg shadow-lg bg-white dark:bg-gray-800 transition"
x-transition:enter-start="opacity-0"
x-transition:leave-end="opacity-0"
x-cloak
x-ref="panel"
x-float.placement.{{ $getPlacement }}.flip.teleport.offset="{ offset: {{ $getOffset }} }"
>
{{ $getContent }}
</div>
Expand Down
19 changes: 9 additions & 10 deletions resources/views/popover-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,28 @@
:state-path="$getStatePath()"
>
<div
x-data="{ open: false }"
x-data
@if($getTrigger === 'hover')
@pointerleave="clearTimeout($time); open = false"
@else
@click.away="open = false"
@pointerleave="$refs.panel.close"
@endif
>
<div
class="relative w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
x-ref="button"
@if($getTrigger === 'hover')
@pointerenter="$time = setTimeout(() => { open = true }, 200)"
@pointerenter="$refs.panel.open"
@else
@click="open = ! open"
@click="$refs.panel.toggle"
@endif
>
{{ $getState }}
</div>

<div class="z-50 fi-popover-content w-[{{ $getPopOverMaxWidth }}px] border border-gray-100 rounded-lg shadow-lg bg-white dark:bg-gray-800"
x-cloak x-trap="open"
x-show="open"
x-anchor.{{ $getPlacement }}.offset.{{ $getOffset }}="$refs.button"
x-transition:enter-start="opacity-0"
x-transition:leave-end="opacity-0"
x-cloak
x-ref="panel"
x-float.placement.{{ $getPlacement }}.flip.teleport.offset="{ offset: {{ $getOffset }} }"
>
{{ $getContent }}
</div>
Expand Down
Loading