[增添]添加了datasource的setting数据库以及默认值
This commit is contained in:
11
vendor/filament/notifications/resources/views/components/actions.blade.php
vendored
Normal file
11
vendor/filament/notifications/resources/views/components/actions.blade.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
@props([
|
||||
'actions',
|
||||
])
|
||||
|
||||
<div
|
||||
{{ $attributes->class(['fi-no-notification-actions flex gap-x-3']) }}
|
||||
>
|
||||
@foreach ($actions as $action)
|
||||
{{ $action }}
|
||||
@endforeach
|
||||
</div>
|
||||
5
vendor/filament/notifications/resources/views/components/body.blade.php
vendored
Normal file
5
vendor/filament/notifications/resources/views/components/body.blade.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<div
|
||||
{{ $attributes->class(['fi-no-notification-body overflow-hidden break-words text-sm text-gray-500 dark:text-gray-400']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
7
vendor/filament/notifications/resources/views/components/close-button.blade.php
vendored
Normal file
7
vendor/filament/notifications/resources/views/components/close-button.blade.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<x-filament::icon-button
|
||||
color="gray"
|
||||
icon="heroicon-m-x-mark"
|
||||
icon-alias="notifications::notification.close-button"
|
||||
x-on:click="close"
|
||||
class="fi-no-notification-close-btn"
|
||||
/>
|
||||
19
vendor/filament/notifications/resources/views/components/database/echo.blade.php
vendored
Normal file
19
vendor/filament/notifications/resources/views/components/database/echo.blade.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
@props([
|
||||
'channel',
|
||||
])
|
||||
|
||||
<div
|
||||
x-data="{}"
|
||||
x-init="
|
||||
window.addEventListener('EchoLoaded', () => {
|
||||
window.Echo.private(@js($channel)).listen('.database-notifications.sent', () => {
|
||||
setTimeout(() => $wire.call('$refresh'), 500)
|
||||
})
|
||||
})
|
||||
|
||||
if (window.Echo) {
|
||||
window.dispatchEvent(new CustomEvent('EchoLoaded'))
|
||||
}
|
||||
"
|
||||
{{ $attributes }}
|
||||
></div>
|
||||
27
vendor/filament/notifications/resources/views/components/database/modal/actions.blade.php
vendored
Normal file
27
vendor/filament/notifications/resources/views/components/database/modal/actions.blade.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
@props([
|
||||
'notifications',
|
||||
'unreadNotificationsCount',
|
||||
])
|
||||
|
||||
<div {{ $attributes->class('mt-2 flex gap-x-3') }}>
|
||||
@if ($unreadNotificationsCount)
|
||||
<x-filament::link
|
||||
color="primary"
|
||||
tabindex="-1"
|
||||
tag="button"
|
||||
wire:click="markAllNotificationsAsRead"
|
||||
>
|
||||
{{ __('filament-notifications::database.modal.actions.mark_all_as_read.label') }}
|
||||
</x-filament::link>
|
||||
@endif
|
||||
|
||||
<x-filament::link
|
||||
color="danger"
|
||||
tabindex="-1"
|
||||
tag="button"
|
||||
wire:click="clearNotifications"
|
||||
x-on:click="close()"
|
||||
>
|
||||
{{ __('filament-notifications::database.modal.actions.clear.label') }}
|
||||
</x-filament::link>
|
||||
</div>
|
||||
18
vendor/filament/notifications/resources/views/components/database/modal/heading.blade.php
vendored
Normal file
18
vendor/filament/notifications/resources/views/components/database/modal/heading.blade.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
@props([
|
||||
'unreadNotificationsCount',
|
||||
])
|
||||
|
||||
<x-filament::modal.heading>
|
||||
<span class="relative">
|
||||
{{ __('filament-notifications::database.modal.heading') }}
|
||||
|
||||
@if ($unreadNotificationsCount)
|
||||
<x-filament::badge
|
||||
size="xs"
|
||||
class="absolute -top-1 start-full ms-1 w-max"
|
||||
>
|
||||
{{ $unreadNotificationsCount }}
|
||||
</x-filament::badge>
|
||||
@endif
|
||||
</span>
|
||||
</x-filament::modal.heading>
|
||||
64
vendor/filament/notifications/resources/views/components/database/modal/index.blade.php
vendored
Normal file
64
vendor/filament/notifications/resources/views/components/database/modal/index.blade.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
@props([
|
||||
'notifications',
|
||||
'unreadNotificationsCount',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\Alignment;
|
||||
|
||||
$hasNotifications = $notifications->count();
|
||||
$isPaginated = $notifications instanceof \Illuminate\Contracts\Pagination\Paginator && $notifications->hasPages();
|
||||
@endphp
|
||||
|
||||
<x-filament::modal
|
||||
:alignment="$hasNotifications ? null : Alignment::Center"
|
||||
close-button
|
||||
:description="$hasNotifications ? null : __('filament-notifications::database.modal.empty.description')"
|
||||
:heading="$hasNotifications ? null : __('filament-notifications::database.modal.empty.heading')"
|
||||
:icon="$hasNotifications ? null : 'heroicon-o-bell-slash'"
|
||||
:icon-alias="$hasNotifications ? null : 'notifications::database.modal.empty-state'"
|
||||
:icon-color="$hasNotifications ? null : 'gray'"
|
||||
id="database-notifications"
|
||||
slide-over
|
||||
:sticky-header="$hasNotifications"
|
||||
width="md"
|
||||
>
|
||||
@if ($hasNotifications)
|
||||
<x-slot name="header">
|
||||
<div>
|
||||
<x-filament-notifications::database.modal.heading
|
||||
:unread-notifications-count="$unreadNotificationsCount"
|
||||
/>
|
||||
|
||||
<x-filament-notifications::database.modal.actions
|
||||
:notifications="$notifications"
|
||||
:unread-notifications-count="$unreadNotificationsCount"
|
||||
/>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div
|
||||
@class([
|
||||
'-mx-6 -mt-6 divide-y divide-gray-200 dark:divide-white/10',
|
||||
'-mb-6' => ! $isPaginated,
|
||||
'border-b border-gray-200 dark:border-white/10' => $isPaginated,
|
||||
])
|
||||
>
|
||||
@foreach ($notifications as $notification)
|
||||
<div
|
||||
@class([
|
||||
'relative before:absolute before:start-0 before:h-full before:w-0.5 before:bg-primary-600 dark:before:bg-primary-500' => $notification->unread(),
|
||||
])
|
||||
>
|
||||
{{ $this->getNotification($notification)->inline() }}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@if ($isPaginated)
|
||||
<x-slot name="footer">
|
||||
<x-filament::pagination :paginator="$notifications" />
|
||||
</x-slot>
|
||||
@endif
|
||||
@endif
|
||||
</x-filament::modal>
|
||||
7
vendor/filament/notifications/resources/views/components/database/trigger.blade.php
vendored
Normal file
7
vendor/filament/notifications/resources/views/components/database/trigger.blade.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<div
|
||||
x-data="{}"
|
||||
x-on:click="$dispatch('open-modal', { id: 'database-notifications' })"
|
||||
{{ $attributes->class(['inline-block']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
5
vendor/filament/notifications/resources/views/components/date.blade.php
vendored
Normal file
5
vendor/filament/notifications/resources/views/components/date.blade.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<time
|
||||
{{ $attributes->class(['fi-no-notification-date text-sm text-gray-500 dark:text-gray-400']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</time>
|
||||
19
vendor/filament/notifications/resources/views/components/echo.blade.php
vendored
Normal file
19
vendor/filament/notifications/resources/views/components/echo.blade.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
@props([
|
||||
'channel',
|
||||
])
|
||||
|
||||
<div
|
||||
x-data="{}"
|
||||
x-init="
|
||||
window.addEventListener('EchoLoaded', () => {
|
||||
window.Echo.private(@js($channel)).notification((notification) => {
|
||||
setTimeout(() => $wire.handleBroadcastNotification(notification), 500)
|
||||
})
|
||||
})
|
||||
|
||||
if (window.Echo) {
|
||||
window.dispatchEvent(new CustomEvent('EchoLoaded'))
|
||||
}
|
||||
"
|
||||
{{ $attributes }}
|
||||
></div>
|
||||
37
vendor/filament/notifications/resources/views/components/icon.blade.php
vendored
Normal file
37
vendor/filament/notifications/resources/views/components/icon.blade.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
@endphp
|
||||
|
||||
@props([
|
||||
'color' => 'gray',
|
||||
'icon',
|
||||
'size' => IconSize::Large,
|
||||
])
|
||||
|
||||
<x-filament::icon
|
||||
:icon="$icon"
|
||||
:attributes="
|
||||
$attributes
|
||||
->class([
|
||||
'fi-no-notification-icon',
|
||||
match ($color) {
|
||||
'gray' => 'text-gray-400',
|
||||
default => 'fi-color-custom text-custom-400',
|
||||
},
|
||||
is_string($color) ? 'fi-color-' . $color : null,
|
||||
match ($size) {
|
||||
IconSize::Small, 'sm' => 'h-4 w-4',
|
||||
IconSize::Medium, 'md' => 'h-5 w-5',
|
||||
IconSize::Large, 'lg' => 'h-6 w-6',
|
||||
default => $size,
|
||||
},
|
||||
])
|
||||
->style([
|
||||
\Filament\Support\get_color_css_variables(
|
||||
$color,
|
||||
shades: [400],
|
||||
alias: 'notifications::notification.icon',
|
||||
),
|
||||
])
|
||||
"
|
||||
/>
|
||||
16
vendor/filament/notifications/resources/views/components/notification.blade.php
vendored
Normal file
16
vendor/filament/notifications/resources/views/components/notification.blade.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
@props([
|
||||
'notification',
|
||||
])
|
||||
|
||||
<div
|
||||
x-data="notificationComponent({ notification: @js($notification) })"
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'wire:key' => "{$this->getId()}.notifications.{$notification->getId()}",
|
||||
], escape: false)
|
||||
->class(['pointer-events-auto invisible'])
|
||||
}}
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
5
vendor/filament/notifications/resources/views/components/title.blade.php
vendored
Normal file
5
vendor/filament/notifications/resources/views/components/title.blade.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<h3
|
||||
{{ $attributes->class(['fi-no-notification-title text-sm font-medium text-gray-950 dark:text-white']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</h3>
|
||||
Reference in New Issue
Block a user