phases one of time logged now with log display
This commit is contained in:
+64
-135
@@ -34,7 +34,8 @@
|
||||
|
||||
$dropdownJs = match ($mode) {
|
||||
'inline' => "(!withinDropdownMounted || withinDropdownIndex === null || {$index} < withinDropdownIndex)",
|
||||
'trigger' => "(withinDropdownMounted && withinDropdownIndex !== null && {$index} >= withinDropdownIndex && '{$tabKey}' === tab)",
|
||||
'trigger'
|
||||
=> "(withinDropdownMounted && withinDropdownIndex !== null && {$index} >= withinDropdownIndex && '{$tabKey}' === tab)",
|
||||
default => null,
|
||||
};
|
||||
|
||||
@@ -43,63 +44,45 @@
|
||||
@endphp
|
||||
|
||||
@if (blank($livewireProperty))
|
||||
<div
|
||||
x-data="tabsSchemaComponent({
|
||||
activeTab: @js($activeTab),
|
||||
isScrollable: @js($isScrollable),
|
||||
isTabPersisted: @js($isTabPersisted()),
|
||||
isTabPersistedInQueryString: @js($isTabPersistedInQueryString()),
|
||||
livewireId: @js($this->getId()),
|
||||
schemaKey: @js($getRootContainer()->getKey()),
|
||||
tab: @if ($isTabPersisted() && filled($id)) $persist(null).as(@js($id)) @else @js(null) @endif,
|
||||
tabQueryStringKey: @js($getTabQueryStringKey()),
|
||||
})"
|
||||
x-load
|
||||
<div x-data="tabsSchemaComponent({
|
||||
activeTab: @js($activeTab),
|
||||
isScrollable: @js($isScrollable),
|
||||
isTabPersisted: @js($isTabPersisted()),
|
||||
isTabPersistedInQueryString: @js($isTabPersistedInQueryString()),
|
||||
livewireId: @js($this->getId()),
|
||||
schemaKey: @js($getRootContainer()->getKey()),
|
||||
tab: @if ($isTabPersisted() && filled($id)) $persist(null).as(@js($id)) @else @js(null) @endif,
|
||||
tabQueryStringKey: @js($getTabQueryStringKey()),
|
||||
})" x-load
|
||||
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('tabs', 'filament/schemas') }}"
|
||||
wire:ignore.self
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
{{ $attributes->merge(
|
||||
[
|
||||
'id' => $id,
|
||||
'wire:key' => $getLivewireKey() . '.container',
|
||||
], escape: false)
|
||||
->merge($getExtraAttributes(), escape: false)
|
||||
->merge($getExtraAlpineAttributes(), escape: false)
|
||||
->class([
|
||||
'fi-sc-tabs',
|
||||
'fi-contained' => $isContained,
|
||||
'fi-vertical' => $isVertical,
|
||||
])
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="hidden"
|
||||
value="{{ collect($tabs)->filter(static fn (Tab $tab): bool => $tab->isVisible())->map(static fn (Tab $tab) => $tab->getKey(isAbsolute: false))->values()->toJson() }}"
|
||||
x-ref="tabsData"
|
||||
/>
|
||||
],
|
||||
escape: false,
|
||||
)->merge($getExtraAttributes(), escape: false)->merge($getExtraAlpineAttributes(), escape: false)->class(['fi-sc-tabs', 'fi-contained' => $isContained, 'fi-vertical' => $isVertical]) }}>
|
||||
<input type="hidden"
|
||||
value="{{ collect($tabs)->filter(static fn(Tab $tab): bool => $tab->isVisible())->map(static fn(Tab $tab) => $tab->getKey(isAbsolute: false))->values()->toJson() }}"
|
||||
x-ref="tabsData" />
|
||||
|
||||
<x-filament::tabs
|
||||
:contained="$isContained"
|
||||
:label="$label"
|
||||
:vertical="$isVertical"
|
||||
x-cloak
|
||||
:x-bind:class="! $isScrollable ? '{ \'fi-invisible\': ! withinDropdownMounted }' : null"
|
||||
:x-data="
|
||||
$hasDeferredBadges ? '{
|
||||
deferredBadges: {},
|
||||
isLoadingDeferredBadges: true,
|
||||
|
||||
async init() {
|
||||
try {
|
||||
const badges = await $wire.callSchemaComponentMethod(' . \Illuminate\Support\Js::from($tabsKey) . ', \'getDeferredTabBadges\')
|
||||
<x-filament::tabs :contained="$isContained" :label="$label" :vertical="$isVertical" x-cloak
|
||||
:x-bind:class="!$isScrollable ? '{ \'fi-invisible\': ! withinDropdownMounted }' : null" :x-data="$hasDeferredBadges ? '{
|
||||
deferredBadges: {},
|
||||
isLoadingDeferredBadges: true,
|
||||
|
||||
async init() {
|
||||
try {
|
||||
const badges = await $wire.callSchemaComponentMethod(' . \Illuminate\Support\Js::from($tabsKey) . ', \'getDeferredTabBadges\')
|
||||
this.deferredBadges = badges ?? {}
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
this.isLoadingDeferredBadges = false
|
||||
}
|
||||
},
|
||||
}' : null
|
||||
"
|
||||
>
|
||||
}
|
||||
' : null">
|
||||
@foreach ($getStartRenderHooks() as $startRenderHook)
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook($startRenderHook, scopes: $renderHookScopes) }}
|
||||
@endforeach
|
||||
@@ -120,31 +103,16 @@
|
||||
$tabVisibilityJs = $getTabVisibilityJs($tab, $index, 'inline');
|
||||
@endphp
|
||||
|
||||
<x-filament::tabs.item
|
||||
:alpine-active="'tab === \'' . $tabKey . '\''"
|
||||
:alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']' : null"
|
||||
:alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null"
|
||||
:attributes="$tabExtraAttributeBag"
|
||||
:badge="$tabBadge"
|
||||
:badge-color="$tabBadgeColor"
|
||||
:badge-icon="$tabBadgeIcon"
|
||||
:badge-icon-position="$tabBadgeIconPosition"
|
||||
:badge-tooltip="$tabBadgeTooltip"
|
||||
:data-tab-key="$tabKey"
|
||||
:icon="$tabIcon"
|
||||
:icon-position="$tabIconPosition"
|
||||
:x-cloak="$tabVisibilityJs !== null"
|
||||
:x-on:click="'tab = \'' . $tabKey . '\''"
|
||||
:x-show="$tabVisibilityJs"
|
||||
>
|
||||
<x-filament::tabs.item :alpine-active="'tab === \'' . $tabKey . '\''" :alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']' : null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null" :attributes="$tabExtraAttributeBag"
|
||||
:badge="$tabBadge" :badge-color="$tabBadgeColor" :badge-icon="$tabBadgeIcon" :badge-icon-position="$tabBadgeIconPosition" :badge-tooltip="$tabBadgeTooltip"
|
||||
:data-tab-key="$tabKey" :icon="$tabIcon" :icon-position="$tabIconPosition" :x-cloak="$tabVisibilityJs !== null"
|
||||
:x-on:click="'tab = \'' . $tabKey . '\''" :x-show="$tabVisibilityJs">
|
||||
{{ $tabLabel }}
|
||||
</x-filament::tabs.item>
|
||||
@endforeach
|
||||
|
||||
@if (! $isScrollable)
|
||||
<x-filament::dropdown
|
||||
:placement="__('filament-panels::layout.direction') === 'ltr' ? 'bottom-start' : 'bottom-end'"
|
||||
>
|
||||
@if (!$isScrollable)
|
||||
<x-filament::dropdown :placement="__('filament-panels::layout.direction') === 'ltr' ? 'bottom-start' : 'bottom-end'">
|
||||
<x-slot name="trigger">
|
||||
@foreach ($tabs as $index => $tab)
|
||||
@php
|
||||
@@ -158,30 +126,20 @@
|
||||
$tabVisibilityJs = $getTabVisibilityJs($tab, $index, 'trigger');
|
||||
@endphp
|
||||
|
||||
<x-filament::tabs.item
|
||||
:alpine-active="'tab === \'' . $tabKey . '\''"
|
||||
:alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']' : null"
|
||||
:alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null"
|
||||
:attributes="$tabExtraAttributeBag"
|
||||
:badge="$tabBadge"
|
||||
:badge-color="$tabBadgeColor"
|
||||
:badge-tooltip="$tabBadgeTooltip"
|
||||
:icon="Heroicon::ChevronDown"
|
||||
:icon-alias="SchemaIconAlias::COMPONENTS_TABS_DROPDOWN_TRIGGER_BUTTON"
|
||||
:x-cloak="$tabVisibilityJs !== null"
|
||||
:x-show="$tabVisibilityJs"
|
||||
>
|
||||
<x-filament::tabs.item :alpine-active="'tab === \'' . $tabKey . '\''" :alpine-deferred-badge-data="$isTabBadgeDeferred
|
||||
? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']'
|
||||
: null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null"
|
||||
:attributes="$tabExtraAttributeBag" :badge="$tabBadge" :badge-color="$tabBadgeColor" :badge-tooltip="$tabBadgeTooltip"
|
||||
:icon="Heroicon::ChevronDown" :icon-alias="SchemaIconAlias::COMPONENTS_TABS_DROPDOWN_TRIGGER_BUTTON" :x-cloak="$tabVisibilityJs !== null" :x-show="$tabVisibilityJs">
|
||||
{{ $tabLabel }}
|
||||
</x-filament::tabs.item>
|
||||
@endforeach
|
||||
|
||||
<x-filament::tabs.item x-show="isDropdownButtonVisible">
|
||||
{{
|
||||
\Filament\Support\generate_icon_html(
|
||||
Heroicon::EllipsisHorizontal,
|
||||
alias: SchemaIconAlias::COMPONENTS_TABS_MORE_TABS_BUTTON,
|
||||
)
|
||||
}}
|
||||
{{ \Filament\Support\generate_icon_html(
|
||||
Heroicon::EllipsisHorizontal,
|
||||
alias: SchemaIconAlias::COMPONENTS_TABS_MORE_TABS_BUTTON,
|
||||
) }}
|
||||
</x-filament::tabs.item>
|
||||
</x-slot>
|
||||
|
||||
@@ -197,17 +155,12 @@
|
||||
$tabLabel = $tab->getLabel();
|
||||
@endphp
|
||||
|
||||
<x-filament::dropdown.list.item
|
||||
:alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']' : null"
|
||||
:alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null"
|
||||
:badge="$tabBadge"
|
||||
:badge-color="$tabBadgeColor"
|
||||
:badge-tooltip="$tabBadgeTooltip"
|
||||
:icon="$tabIcon"
|
||||
<x-filament::dropdown.list.item :alpine-deferred-badge-data="$isTabBadgeDeferred
|
||||
? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']'
|
||||
: null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null" :badge="$tabBadge"
|
||||
:badge-color="$tabBadgeColor" :badge-tooltip="$tabBadgeTooltip" :icon="$tabIcon"
|
||||
x-bind:class="{ 'fi-selected': tab === '{{ $tabKey }}' }"
|
||||
:x-on:click="'tab = \'' . $tabKey . '\'; close($event);'"
|
||||
:x-show="$index . ' >= withinDropdownIndex'"
|
||||
>
|
||||
:x-on:click="'tab = \'' . $tabKey . '\'; close($event);'" :x-show="$index . ' >= withinDropdownIndex'">
|
||||
{{ $tabLabel }}
|
||||
</x-filament::dropdown.list.item>
|
||||
@endforeach
|
||||
@@ -239,9 +192,7 @@
|
||||
$activeTab = strval($this->{$livewireProperty});
|
||||
@endphp
|
||||
|
||||
<div
|
||||
@if ($hasDeferredBadges)
|
||||
x-data="{
|
||||
<div @if ($hasDeferredBadges) x-data="{
|
||||
deferredBadges: {},
|
||||
isLoadingDeferredBadges: true,
|
||||
|
||||
@@ -257,27 +208,15 @@
|
||||
this.isLoadingDeferredBadges = false
|
||||
}
|
||||
},
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
}" @endif
|
||||
{{ $attributes->merge(
|
||||
[
|
||||
'id' => $id,
|
||||
'wire:key' => $getLivewireKey() . '.container',
|
||||
], escape: false)
|
||||
->merge($getExtraAttributes(), escape: false)
|
||||
->class([
|
||||
'fi-sc-tabs',
|
||||
'fi-contained' => $isContained,
|
||||
'fi-vertical' => $isVertical,
|
||||
])
|
||||
}}
|
||||
>
|
||||
<x-filament::tabs
|
||||
:contained="$isContained"
|
||||
:label="$label"
|
||||
:vertical="$isVertical"
|
||||
>
|
||||
],
|
||||
escape: false,
|
||||
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-tabs', 'fi-contained' => $isContained, 'fi-vertical' => $isVertical]) }}>
|
||||
<x-filament::tabs :contained="$isContained" :label="$label" :vertical="$isVertical">
|
||||
@foreach ($getStartRenderHooks() as $startRenderHook)
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook($startRenderHook, scopes: $renderHookScopes) }}
|
||||
@endforeach
|
||||
@@ -297,20 +236,10 @@
|
||||
$tabLabel = $tab->getLabel() ?? $this->generateTabLabel($tabKey);
|
||||
@endphp
|
||||
|
||||
<x-filament::tabs.item
|
||||
:active="$activeTab === $tabKey"
|
||||
:alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($tabKey) . ']' : null"
|
||||
:alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null"
|
||||
:attributes="$tabExtraAttributeBag"
|
||||
:badge="$tabBadge"
|
||||
:badge-color="$tabBadgeColor"
|
||||
:badge-icon="$tabBadgeIcon"
|
||||
:badge-icon-position="$tabBadgeIconPosition"
|
||||
:badge-tooltip="$tabBadgeTooltip"
|
||||
:icon="$tabIcon"
|
||||
:icon-position="$tabIconPosition"
|
||||
:wire:click="'$set(\'' . $livewireProperty . '\', ' . (filled($tabKey) ? ('\'' . $tabKey . '\'') : 'null') . ')'"
|
||||
>
|
||||
<x-filament::tabs.item :active="$activeTab === $tabKey" :alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($tabKey) . ']' : null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null" :attributes="$tabExtraAttributeBag"
|
||||
:badge="$tabBadge" :badge-color="$tabBadgeColor" :badge-icon="$tabBadgeIcon" :badge-icon-position="$tabBadgeIconPosition" :badge-tooltip="$tabBadgeTooltip"
|
||||
:icon="$tabIcon" :icon-position="$tabIconPosition"
|
||||
:wire:click="'$set(\'' . $livewireProperty . '\', ' . (filled($tabKey) ? ('\'' . $tabKey . '\'') : 'null') . ')'">
|
||||
{{ $tabLabel }}
|
||||
</x-filament::tabs.item>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user