mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
Refactor date group actions from Svelte component to TypeScript class
• Convert asset-date-group-actions.svelte to date-group-actions-lib.svelte.ts class • Remove complex prop binding between asset-grid-without-scrubber and asset-date-group • Use class instance in asset-date-group with direct method access
This commit is contained in:
parent
0beeea6985
commit
9a30198238
4 changed files with 220 additions and 245 deletions
|
|
@ -2,7 +2,6 @@
|
|||
import { afterNavigate, beforeNavigate } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { resizeObserver, type OnResizeCallback } from '$lib/actions/resize-observer';
|
||||
import AssetDateGroupActions from '$lib/components/photos-page/asset-date-group-actions.svelte';
|
||||
import AssetGridActions from '$lib/components/photos-page/asset-grid-actions.svelte';
|
||||
import AssetViewerAndActions from '$lib/components/photos-page/asset-viewer-and-actions.svelte';
|
||||
import Skeleton from '$lib/components/photos-page/skeleton.svelte';
|
||||
|
|
@ -75,7 +74,7 @@
|
|||
album = null,
|
||||
person = null,
|
||||
isShowDeleteConfirmation = $bindable(false),
|
||||
onSelect = () => {},
|
||||
onSelect = (asset: TimelineAsset) => void 0,
|
||||
onEscape = () => {},
|
||||
children,
|
||||
empty,
|
||||
|
|
@ -278,16 +277,6 @@
|
|||
let onSelectAssetCandidates = <(asset: TimelineAsset | null) => void>$state();
|
||||
</script>
|
||||
|
||||
<AssetDateGroupActions
|
||||
{timelineManager}
|
||||
{assetInteraction}
|
||||
handleScrollTop={scrollTop}
|
||||
{onSelect}
|
||||
bind:onDateGroupSelect
|
||||
bind:onSelectAssets
|
||||
bind:onSelectAssetCandidates
|
||||
></AssetDateGroupActions>
|
||||
|
||||
<AssetGridActions {scrollToAsset} {timelineManager} {assetInteraction} bind:isShowDeleteConfirmation {onEscape}
|
||||
></AssetGridActions>
|
||||
|
||||
|
|
@ -356,9 +345,8 @@
|
|||
{isSelectionMode}
|
||||
{singleSelect}
|
||||
{monthGroup}
|
||||
onSelect={onDateGroupSelect}
|
||||
{onSelectAssetCandidates}
|
||||
{onSelectAssets}
|
||||
{onSelect}
|
||||
{scrollTop}
|
||||
onScrollCompensation={handleScrollCompensation}
|
||||
{customLayout}
|
||||
{onThumbnailClick}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue