@sparklingopinions/sparkling-ui 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aliases.d.ts +43 -30
- package/dist/aliases.js +9 -9
- package/dist/aliases.js.map +1 -1
- package/dist/components/ActionBar/ActionBar.js.map +1 -1
- package/dist/components/ActionBar/ActionBar.vue.d.ts +20 -2
- package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js +106 -41
- package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ActionBar/index.d.ts +1 -1
- package/dist/components/Board/Board.js.map +1 -1
- package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js +80 -148
- package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.vue.d.ts +4 -4
- package/dist/components/DataList/DataList.js.map +1 -1
- package/dist/components/DataList/DataList.vue.d.ts +7 -1
- package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js +187 -147
- package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/Filters/FilterChip.vue.d.ts +3 -3
- package/dist/components/Filters/FilterMenu.vue.d.ts +3 -3
- package/dist/components/Filters/SortMenu.vue.d.ts +3 -3
- package/dist/components/PropertyList/Editable.vue.d.ts +1 -1
- package/dist/components/Toast/ToastMessage.vue.d.ts +1 -1
- package/dist/components/Toast/Toaster.vue.d.ts +1 -1
- package/dist/components/internal/useDragMove.d.ts +50 -0
- package/dist/components/internal/useDragMove.js +132 -0
- package/dist/components/internal/useDragMove.js.map +1 -0
- package/dist/composables/toast.d.ts +12 -1
- package/dist/composables/toast.js +40 -21
- package/dist/composables/toast.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +25 -24
- package/dist/utils/settle.d.ts +18 -0
- package/dist/utils/settle.js +24 -0
- package/dist/utils/settle.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataList.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_useSlots","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_Fragment","_renderList","_createElementVNode","_createCommentVNode","_createBlock","Skeleton","_createVNode","_unref","_resolveDynamicComponent","_withCtx","_createTextVNode","_toDisplayString","_withDirectives","ContextMenu","Checkbox","_vShow","Skeleton_default","Checkbox_default","ContextMenu_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","card","headerBar","iconButton","DataList_vue_vue_type_script_setup_true_lang_default","\"selected\"","\"selectedModifiers\"","\"collapsed\"","\"collapsedModifiers\"","__emit","props","__props","emit","selected","useModel","collapsed","slots","useSlots","id","useId","root","useTemplateRef","idOf","item","interactive","computed","isEmpty","group","toggleGroup","groupId","x","collapsibleGroup","isCollapsed","visibleItems","anchorKey","toggle","key","selectRange","keys","to","from","span","select","items","clickRow","event","leading","onRowMousedown","onKeydown","rows","row","i","down","up","j","next","cards","gutter","tones","headerTone","sizes","style","custom","groupName","skeletonWidths","skeletonGroupWidths","openBlock","createElementBlock","normalizeClass","normalizeStyle","_ctx","renderSlot","Fragment","renderList","g","createElementVNode","createCommentVNode","r","createBlock","createVNode","_cache","unref","resolveDynamicComponent","withCtx","createTextVNode","toDisplayString","withDirectives","$event","vShow"],"sources":["../../../src/components/DataList/DataList.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T extends Record<string, any>\">\nimport { computed, useId, useTemplateRef } from 'vue'\n\nimport Checkbox from '../Checkbox/Checkbox.vue'\nimport ContextMenu from '../ContextMenu/ContextMenu.vue'\nimport Skeleton from '../Skeleton/Skeleton.vue'\nimport type { DropdownMenuAction, DropdownMenuEntry } from '../internal/menu'\nimport type { DataListGroup } from './types'\n\nexport interface DataListProps<T> {\n groups: DataListGroup<T>[]\n /** The item field that identifies it. An item's `depth` indents it as a child. */\n rowKey?: keyof T & string\n /** A checkbox bound to `v-model:selected`: it shows on hover and focus, and on every row once anything is selected.\n * Shift-click (or Shift+Space) selects a range, Cmd or Ctrl-click toggles one row, Shift+↑ ↓ extends. */\n selectable?: boolean\n /** gutter: the checkbox in its own column. leading: it takes the place of the `leading` slot's first mark. */\n checkboxPlacement?: 'gutter' | 'leading'\n loading?: boolean\n /** While loading, the placeholder groups drawn, as each one's number of rows. */\n loadingGroups?: number[]\n /** joined: one frame, sticky sunken group headers. cards: each group its own card, 12px apart, headers not sticky. */\n variant?: 'joined' | 'cards'\n /** The group headings' level, to fit the page's outline. */\n headingLevel?: 2 | 3 | 4 | 5 | 6\n /** The group headers' ground; by default sunken when joined, surface as cards. */\n groupHeaderTone?: 'sunken' | 'surface' | 'canvas'\n /** The group headers' height in px (36 by default); sets `--sui-list-header`. */\n groupHeaderHeight?: number\n /** Groups fold away under a chevron; a group's own `collapsible` wins. */\n collapsible?: boolean\n /** The rows' height in px, such as 44 (40 by default); sets `--sui-list-row`. */\n rowHeight?: number\n /** A hairline between rows. */\n dividers?: boolean\n /** Wraps each row in a ContextMenu of these items (`@context-item`); return [] for none. */\n contextItems?: (item: T) => DropdownMenuEntry[]\n /** The context menu's accessible name. */\n contextLabel?: string\n /** Makes rows open on click and Enter (`@row-click`). */\n onRowClick?: (item: T) => void\n /** Adds a + to each group's header (`@new`). */\n onNew?: (group: DataListGroup<T>) => void\n /** The + button's name; `{group}` is the group's name. */\n newLabel?: string\n collapseLabel?: string\n expandLabel?: string\n selectLabel?: string\n}\n\nconst props = withDefaults(defineProps<DataListProps<T>>(), {\n rowKey: 'id' as never,\n loadingGroups: () => [4, 2],\n variant: 'joined',\n checkboxPlacement: 'gutter',\n headingLevel: 3,\n groupHeaderTone: undefined,\n groupHeaderHeight: undefined,\n collapsible: true,\n rowHeight: undefined,\n dividers: false,\n contextItems: undefined,\n contextLabel: undefined,\n onRowClick: undefined,\n onNew: undefined,\n newLabel: 'New in {group}',\n collapseLabel: 'Collapse group',\n expandLabel: 'Expand group',\n selectLabel: 'Select'\n})\n\nconst emit = defineEmits<{ 'context-item': [action: DropdownMenuAction, item: T] }>()\n\nconst selected = defineModel<unknown[]>('selected', { default: () => [] })\nconst collapsed = defineModel<string[]>('collapsed', { default: () => [] })\n\nconst slots = defineSlots<{\n /** Marks before a group's name, e.g. a status icon. */\n 'group-leading'?: (props: { group: DataListGroup<T> }) => unknown\n /** Your own group header in place of the name and count, e.g. a status Badge and a count; inside the heading. */\n 'group-header'?: (props: { group: DataListGroup<T>; count: number; collapsed: boolean }) => unknown\n /** Small marks before an item's title: a status icon, an id, an avatar. With `checkboxPlacement=\"leading\"`, the\n * first mark gives way to the checkbox. */\n leading?: (props: { item: T; selected: boolean; selecting: boolean; toggle: () => void }) => unknown\n /** The item's title; `item.name` by default. */\n title?: (props: { item: T }) => unknown\n /** Right-aligned meta: tags, an avatar, a date. Keep it to three or four things. */\n meta?: (props: { item: T }) => unknown\n /** Controls at the end of a group's header, e.g. Show and Hide. */\n 'group-actions'?: (props: { group: DataListGroup<T> }) => unknown\n /** Shown when every group is empty, e.g. an EmptyState. */\n empty?: () => unknown\n}>()\n\nconst id = useId()\nconst root = useTemplateRef<HTMLElement>('root')\n\nconst idOf = (item: T): unknown => item[props.rowKey ?? 'id']\nconst interactive = computed(() => !!props.onRowClick || props.selectable)\nconst isEmpty = computed(() => !props.loading && props.groups.every((group) => group.items.length === 0))\n\nfunction toggleGroup(groupId: string) {\n collapsed.value = collapsed.value.includes(groupId)\n ? collapsed.value.filter((x) => x !== groupId)\n : [...collapsed.value, groupId]\n}\n\nconst collapsibleGroup = (group: DataListGroup<T>) => group.collapsible ?? props.collapsible\nconst isCollapsed = (group: DataListGroup<T>) => collapsibleGroup(group) && collapsed.value.includes(group.id)\nconst visibleItems = computed(() => props.groups.filter((group) => !isCollapsed(group)).flatMap((group) => group.items))\n\n// Where a range starts: the row last toggled.\nlet anchorKey: unknown = undefined\n\nfunction toggle(item: T) {\n const key = idOf(item)\n anchorKey = key\n selected.value = selected.value.includes(key) ? selected.value.filter((x) => x !== key) : [...selected.value, key]\n}\n\nfunction selectRange(item: T) {\n const keys = visibleItems.value.map(idOf)\n const to = keys.indexOf(idOf(item))\n const from = keys.indexOf(anchorKey)\n const span = from < 0 ? [keys[to]] : keys.slice(Math.min(from, to), Math.max(from, to) + 1)\n if (from < 0) anchorKey = idOf(item)\n selected.value = [...selected.value, ...span.filter((key) => !selected.value.includes(key))]\n}\n\nfunction select(...items: T[]) {\n const keys = items.map(idOf).filter((key) => !selected.value.includes(key))\n if (keys.length) selected.value = [...selected.value, ...new Set(keys)]\n}\n\nfunction clickRow(event: MouseEvent, item: T) {\n if (props.selectable && event.shiftKey) selectRange(item)\n else if (props.selectable && (event.metaKey || event.ctrlKey)) toggle(item)\n // Leading checkboxes stand in for the row's mark, so while selecting a click selects, as in a mail list.\n else if (props.selectable && leading.value && selected.value.length) toggle(item)\n else props.onRowClick?.(item)\n}\n\n// A shift-click selects rather than highlighting the text between.\nfunction onRowMousedown(event: MouseEvent) {\n if (props.selectable && event.shiftKey) event.preventDefault()\n}\n\n// ↑ ↓ or j k move between rows, x selects, Enter and Space open; with Shift, ↑ ↓ extend the selection and Space\n// selects a range.\nfunction onKeydown(event: KeyboardEvent, item: T) {\n if (event.target !== event.currentTarget || event.metaKey || event.ctrlKey || event.altKey) return\n // A collapsed group's rows are still in the DOM, hidden.\n const rows = [...(root.value?.querySelectorAll<HTMLElement>('[data-list-row]') ?? [])].filter(\n (row) => row.closest('ul')?.style.display !== 'none'\n )\n const i = rows.indexOf(event.currentTarget as HTMLElement)\n const down = event.key === 'ArrowDown' || event.key === 'j'\n const up = event.key === 'ArrowUp' || event.key === 'k'\n if ((down || up) && event.shiftKey && props.selectable) {\n const j = down ? Math.min(rows.length - 1, i + 1) : Math.max(0, i - 1)\n const next = visibleItems.value[j]\n select(item, ...(next ? [next] : []))\n rows[j]?.focus()\n } else if (down) rows[Math.min(rows.length - 1, i + 1)]?.focus()\n else if (up) rows[Math.max(0, i - 1)]?.focus()\n else if (event.key === ' ' && event.shiftKey && props.selectable) selectRange(item)\n else if (event.key.toLowerCase() === 'x' && props.selectable) toggle(item)\n else if ((event.key === 'Enter' || event.key === ' ') && props.onRowClick) props.onRowClick(item)\n else return\n event.preventDefault()\n}\n\nconst cards = computed(() => props.variant === 'cards')\nconst leading = computed(() => props.selectable && props.checkboxPlacement === 'leading')\nconst gutter = computed(() => props.selectable && props.checkboxPlacement === 'gutter')\nconst tones = { sunken: 'sui-band', surface: 'bg-sui-surface', canvas: 'bg-sui-canvas' }\nconst headerTone = computed(() => tones[props.groupHeaderTone ?? (cards.value ? 'surface' : 'sunken')])\nconst sizes = computed(() => {\n const style: Record<string, string> = {}\n if (props.rowHeight !== undefined) style['--sui-list-row'] = `${props.rowHeight}px`\n if (props.groupHeaderHeight !== undefined) style['--sui-list-header'] = `${props.groupHeaderHeight}px`\n return Object.keys(style).length ? style : undefined\n})\nconst card = 'overflow-clip rounded-xl border border-sui-line-subtle bg-sui-surface'\nconst custom = (group: DataListGroup<T>) => !!slots['group-header'] || group.header !== undefined\nconst groupName = (group: DataListGroup<T>) => group.label ?? group.name ?? ''\n\nconst skeletonWidths = ['42%', '58%', '35%', '50%', '46%', '38%']\nconst skeletonGroupWidths = ['5.5rem', '4rem', '4.75rem']\nconst headerBar = 'animate-pulse bg-sui-fill-hover'\nconst iconButton =\n 'flex size-6 shrink-0 items-center justify-center rounded-md text-sui-ink-muted outline-hidden transition-colors duration-150 hover:bg-sui-fill-hover hover:text-sui-ink focus-visible:sui-ring-inset'\n</script>\n\n<!-- A grouped list: one dense line per record under sticky, collapsible group headers. -->\n<template>\n <div ref=\"root\" class=\"flex flex-col text-13 text-sui-ink\" :class=\"cards ? 'gap-3' : card\" :style=\"sizes\">\n <div v-if=\"isEmpty && $slots.empty\" :class=\"cards && card\">\n <slot name=\"empty\" />\n </div>\n <!-- Placeholder groups in the list's own shape: its header, rows, leading marks and meta. -->\n <template v-else-if=\"loading\">\n <section\n v-for=\"(rows, g) in loadingGroups\"\n :key=\"g\"\n aria-busy=\"true\"\n :class=\"cards ? card : 'border-t border-sui-line-subtle first:border-t-0'\"\n >\n <div\n aria-hidden=\"true\"\n class=\"flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2\"\n :class=\"[headerTone, collapsible ? 'pl-1.5' : 'pl-4']\"\n >\n <span v-if=\"collapsible\" class=\"size-6 shrink-0\" />\n <span\n v-if=\"$slots['group-leading'] || $slots['group-header']\"\n class=\"size-3.5 rounded-full\"\n :class=\"headerBar\"\n />\n <span class=\"h-2.5 rounded-md\" :class=\"headerBar\" :style=\"{ width: skeletonGroupWidths[g % 3] }\" />\n <span class=\"h-2.5 w-3.5 rounded-md\" :class=\"headerBar\" />\n </div>\n <div\n v-for=\"r in rows\"\n :key=\"r\"\n aria-hidden=\"true\"\n class=\"flex h-[var(--sui-list-row,2.5rem)] items-center gap-2.5 pr-4\"\n :class=\"[gutter ? 'pl-9.5' : 'pl-4', dividers && '[&+&]:border-t [&+&]:border-sui-line-subtle']\"\n >\n <Skeleton v-if=\"$slots.leading || leading\" shape=\"circle\" size=\"1.25rem\" />\n <Skeleton height=\"0.75rem\" :width=\"skeletonWidths[(g * 3 + r) % skeletonWidths.length]\" />\n <span class=\"flex-1\" />\n <template v-if=\"$slots.meta\">\n <Skeleton height=\"0.625rem\" width=\"6rem\" />\n <Skeleton height=\"0.625rem\" width=\"3.5rem\" />\n </template>\n </div>\n </section>\n </template>\n <template v-else>\n <section\n v-for=\"group in groups\"\n :key=\"group.id\"\n :aria-label=\"group.label\"\n :aria-labelledby=\"!group.label && (group.name || custom(group)) ? `${id}-${group.id}-name` : undefined\"\n :class=\"cards ? card : 'border-t border-sui-line-subtle first:border-t-0'\"\n >\n <header\n v-if=\"group.name || custom(group)\"\n class=\"flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2\"\n :class=\"[headerTone, !cards && 'sticky top-0 z-10', collapsibleGroup(group) ? 'pl-1.5' : 'pl-4']\"\n >\n <button\n v-if=\"collapsibleGroup(group)\"\n :aria-controls=\"`${id}-${group.id}`\"\n :aria-expanded=\"!collapsed.includes(group.id)\"\n :aria-label=\"collapsed.includes(group.id) ? expandLabel : collapseLabel\"\n :class=\"iconButton\"\n type=\"button\"\n @click=\"toggleGroup(group.id)\"\n >\n <svg\n aria-hidden=\"true\"\n class=\"size-3 fill-none stroke-current transition-transform duration-150\"\n :class=\"isCollapsed(group) && '-rotate-90'\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.5\"\n viewBox=\"0 0 12 12\"\n >\n <path d=\"M3 4.5 6 7.5l3-3\" />\n </svg>\n </button>\n <component\n :is=\"`h${headingLevel}`\"\n v-if=\"custom(group)\"\n :id=\"`${id}-${group.id}-name`\"\n class=\"m-0 flex min-w-0 items-center gap-2 text-13 font-medium text-sui-ink\"\n >\n <slot\n :collapsed=\"collapsed.includes(group.id)\"\n :count=\"group.count ?? group.items.length\"\n :group=\"group\"\n name=\"group-header\"\n >{{ group.header }}</slot\n >\n </component>\n <template v-else>\n <slot :group=\"group\" name=\"group-leading\" />\n <component\n :is=\"`h${headingLevel}`\"\n :id=\"`${id}-${group.id}-name`\"\n class=\"m-0 text-13 font-medium text-sui-ink\"\n >\n {{ group.name }}\n </component>\n <span class=\"text-13 text-sui-ink-muted tabular-nums\">{{ group.count ?? group.items.length }}</span>\n </template>\n <span class=\"ml-auto flex items-center gap-1\">\n <slot :group=\"group\" name=\"group-actions\" />\n </span>\n <button\n v-if=\"onNew\"\n :aria-label=\"newLabel.replace('{group}', groupName(group))\"\n :class=\"iconButton\"\n type=\"button\"\n @click=\"onNew(group)\"\n >\n <svg\n aria-hidden=\"true\"\n class=\"size-3.5 fill-none stroke-current\"\n stroke-linecap=\"round\"\n stroke-width=\"1.5\"\n viewBox=\"0 0 14 14\"\n >\n <path d=\"M7 2.5v9M2.5 7h9\" />\n </svg>\n </button>\n </header>\n <ul v-show=\"!isCollapsed(group)\" :id=\"`${id}-${group.id}`\" class=\"m-0 list-none p-0\">\n <ContextMenu\n v-for=\"item in group.items\"\n :key=\"idOf(item) as PropertyKey\"\n :disabled=\"!contextItems\"\n :items=\"contextItems?.(item)\"\n :label=\"contextLabel\"\n @click-item=\"emit('context-item', $event, item)\"\n >\n <li\n class=\"group/row relative flex h-[var(--sui-list-row,2.5rem)] items-center transition-colors duration-100 has-focus-visible:sui-ring-inset\"\n :class=\"[\n dividers && '[&+&]:border-t [&+&]:border-sui-line-subtle',\n selected.includes(idOf(item))\n ? 'bg-sui-accent-wash'\n : 'hover:bg-sui-fill-hover has-focus-visible:bg-sui-fill-hover'\n ]\"\n :style=\"item.depth ? { paddingLeft: `${item.depth * 22}px` } : undefined\"\n >\n <!-- Outside the row, which is a button, over the leading slot's first mark: 16px in, or more for a child. -->\n <span\n v-if=\"leading\"\n class=\"absolute top-1/2 z-[1] flex size-4 -translate-y-1/2 items-center justify-center\"\n :class=\"!selected.length && 'hidden group-hover/row:flex group-has-focus-visible/row:flex'\"\n data-list-check\n :style=\"{ left: `${16 + (item.depth ?? 0) * 22}px` }\"\n >\n <Checkbox\n :aria-label=\"selectLabel\"\n :model-value=\"selected.includes(idOf(item))\"\n tabindex=\"-1\"\n @update:model-value=\"toggle(item)\"\n />\n </span>\n <span\n v-if=\"gutter\"\n class=\"flex w-7 shrink-0 justify-end transition-opacity duration-100\"\n :class=\"selected.length ? 'opacity-100' : 'opacity-0 group-hover/row:opacity-100'\"\n >\n <Checkbox\n :aria-label=\"selectLabel\"\n :model-value=\"selected.includes(idOf(item))\"\n tabindex=\"-1\"\n @update:model-value=\"toggle(item)\"\n />\n </span>\n <div\n class=\"flex h-full min-w-0 flex-1 items-center gap-2.5 pr-4 outline-hidden\"\n :class=\"[gutter ? 'pl-2.5' : 'pl-4', (onRowClick || selectable) && 'cursor-pointer']\"\n data-list-row\n :role=\"onRowClick ? 'button' : undefined\"\n :tabindex=\"interactive ? 0 : undefined\"\n @click=\"clickRow($event, item)\"\n @keydown=\"onKeydown($event, item)\"\n @mousedown=\"onRowMousedown\"\n >\n <span\n v-if=\"$slots.leading\"\n class=\"flex shrink-0 items-center gap-2 text-sui-ink-muted tabular-nums\"\n :class=\"\n leading &&\n (selected.length\n ? '[&>*:first-child]:invisible'\n : 'group-hover/row:[&>*:first-child]:invisible group-has-focus-visible/row:[&>*:first-child]:invisible')\n \"\n >\n <slot\n :item=\"item\"\n name=\"leading\"\n :selected=\"selected.includes(idOf(item))\"\n :selecting=\"selected.length > 0\"\n :toggle=\"() => toggle(item)\"\n />\n </span>\n <span class=\"min-w-0 flex-1 truncate font-medium text-sui-ink\">\n <slot :item=\"item\" name=\"title\">{{ item.name }}</slot>\n </span>\n <span\n v-if=\"$slots.meta\"\n class=\"flex shrink-0 items-center gap-2 text-xs text-sui-ink-muted tabular-nums\"\n >\n <slot :item=\"item\" name=\"meta\" />\n </span>\n </div>\n </li>\n </ContextMenu>\n </ul>\n </section>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;A,GAuLMqC,IAAO,yEAMPC,IAAY,mCACZC,IACJ,wM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA7IF,IAAMO,IAAQC,GAqBRC,IAAOH,GAEPI,IAAWhD,EAAsB8C,GAAC,UAAiC,GACnEI,IAAYlD,EAAqB8C,GAAC,WAAkC,GAEpEK,KAAQlD,EAAA,GAkBRoD,IAAKC,EAAM,GACXC,IAAOC,GAA4B,MAAM,GAEzCC,KAAQ,MAAqBC,EAAKb,EAAM,UAAU,OAClDc,IAAc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PgC,GAKO,CADL7B,EAAiCmG,EAAA,QAAA,QAAA,EAApB,QAAI,CAAA,C;;;;;;;;;E,uBAjFd,CAAAnF,IAAA,CAAA6C,EAAYL,CAAK,CAAA,C"}
|
|
1
|
+
{"version":3,"file":"DataList.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_useSlots","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_Fragment","_renderList","_createElementVNode","_createCommentVNode","_createBlock","Skeleton","_createVNode","_unref","_resolveDynamicComponent","_withCtx","_createTextVNode","_toDisplayString","_withDirectives","ContextMenu","_withModifiers","Checkbox","_vShow","Skeleton_default","Checkbox_default","ContextMenu_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","card","headerBar","iconButton","DataList_vue_vue_type_script_setup_true_lang_default","\"selected\"","\"selectedModifiers\"","\"collapsed\"","\"collapsedModifiers\"","__emit","props","__props","emit","selected","useModel","collapsed","slots","useSlots","id","useId","root","useTemplateRef","idOf","item","interactive","computed","useDragMove","g","group","index","shownGroups","dragged","isTarget","target","dropsAtEnd","isEmpty","toggleGroup","groupId","x","collapsibleGroup","isCollapsed","visibleItems","anchorKey","toggle","key","selectRange","keys","to","from","span","select","items","clickRow","endedDrag","event","leading","onRowMousedown","onKeydown","rows","row","i","down","up","j","next","cards","gutter","tones","headerTone","sizes","style","custom","groupName","skeletonWidths","skeletonGroupWidths","openBlock","createElementBlock","normalizeClass","normalizeStyle","_ctx","renderSlot","Fragment","renderList","createElementVNode","createCommentVNode","r","createBlock","createVNode","_cache","unref","resolveDynamicComponent","withCtx","createTextVNode","toDisplayString","withDirectives","$event","withModifiers","onPointerDown","vShow"],"sources":["../../../src/components/DataList/DataList.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T extends Record<string, any>\">\nimport { computed, useId, useTemplateRef } from 'vue'\n\nimport Checkbox from '../Checkbox/Checkbox.vue'\nimport ContextMenu from '../ContextMenu/ContextMenu.vue'\nimport Skeleton from '../Skeleton/Skeleton.vue'\nimport type { DropdownMenuAction, DropdownMenuEntry } from '../internal/menu'\nimport { useDragMove } from '../internal/useDragMove'\nimport type { DataListGroup } from './types'\n\nexport interface DataListProps<T> {\n groups: DataListGroup<T>[]\n /** The item field that identifies it. An item's `depth` indents it as a child. */\n rowKey?: keyof T & string\n /** A checkbox bound to `v-model:selected`: it shows on hover and focus, and on every row once anything is selected.\n * Shift-click (or Shift+Space) selects a range, Cmd or Ctrl-click toggles one row, Shift+↑ ↓ extends. */\n selectable?: boolean\n /** gutter: the checkbox in its own column. leading: it takes the place of the `leading` slot's first mark. */\n checkboxPlacement?: 'gutter' | 'leading'\n loading?: boolean\n /** While loading, the placeholder groups drawn, as each one's number of rows. */\n loadingGroups?: number[]\n /** joined: one frame, sticky sunken group headers. cards: each group its own card, 12px apart, headers not sticky. */\n variant?: 'joined' | 'cards'\n /** The group headings' level, to fit the page's outline. */\n headingLevel?: 2 | 3 | 4 | 5 | 6\n /** The group headers' ground; by default sunken when joined, surface as cards. */\n groupHeaderTone?: 'sunken' | 'surface' | 'canvas'\n /** The group headers' height in px (36 by default); sets `--sui-list-header`. */\n groupHeaderHeight?: number\n /** Groups fold away under a chevron; a group's own `collapsible` wins. */\n collapsible?: boolean\n /** The rows' height in px, such as 44 (40 by default); sets `--sui-list-row`. */\n rowHeight?: number\n /** A hairline between rows. */\n dividers?: boolean\n /** Rows drag between groups (`@move`), e.g. to change a record's status: a copy follows the pointer and a line marks\n * where it lands. With a mouse after a few pixels, with a finger after a short press; Escape cancels. */\n draggable?: boolean\n /** Groups with no items are left out, except while a row is dragged, so one can still be dropped into them. */\n hideEmpty?: boolean\n /** Wraps each row in a ContextMenu of these items (`@context-item`); return [] for none. */\n contextItems?: (item: T) => DropdownMenuEntry[]\n /** The context menu's accessible name. */\n contextLabel?: string\n /** Makes rows open on click and Enter (`@row-click`). */\n onRowClick?: (item: T) => void\n /** Adds a + to each group's header (`@new`). */\n onNew?: (group: DataListGroup<T>) => void\n /** The + button's name; `{group}` is the group's name. */\n newLabel?: string\n collapseLabel?: string\n expandLabel?: string\n selectLabel?: string\n}\n\nconst props = withDefaults(defineProps<DataListProps<T>>(), {\n rowKey: 'id' as never,\n loadingGroups: () => [4, 2],\n variant: 'joined',\n checkboxPlacement: 'gutter',\n headingLevel: 3,\n groupHeaderTone: undefined,\n groupHeaderHeight: undefined,\n collapsible: true,\n rowHeight: undefined,\n dividers: false,\n draggable: false,\n hideEmpty: false,\n contextItems: undefined,\n contextLabel: undefined,\n onRowClick: undefined,\n onNew: undefined,\n newLabel: 'New in {group}',\n collapseLabel: 'Collapse group',\n expandLabel: 'Expand group',\n selectLabel: 'Select'\n})\n\nconst emit = defineEmits<{\n 'context-item': [action: DropdownMenuAction, item: T]\n /** A row dropped into another group, at its index there. Show it moved at once; put it back if saving fails. */\n move: [id: unknown, group: string, index: number]\n}>()\n\nconst selected = defineModel<unknown[]>('selected', { default: () => [] })\nconst collapsed = defineModel<string[]>('collapsed', { default: () => [] })\n\nconst slots = defineSlots<{\n /** Marks before a group's name, e.g. a status icon. */\n 'group-leading'?: (props: { group: DataListGroup<T> }) => unknown\n /** Your own group header in place of the name and count, e.g. a status Badge and a count; inside the heading. */\n 'group-header'?: (props: { group: DataListGroup<T>; count: number; collapsed: boolean }) => unknown\n /** Small marks before an item's title: a status icon, an id, an avatar. With `checkboxPlacement=\"leading\"`, the\n * first mark gives way to the checkbox. */\n leading?: (props: { item: T; selected: boolean; selecting: boolean; toggle: () => void }) => unknown\n /** The item's title; `item.name` by default. */\n title?: (props: { item: T }) => unknown\n /** Right-aligned meta: tags, an avatar, a date. Keep it to three or four things. */\n meta?: (props: { item: T }) => unknown\n /** Controls at the end of a group's header, e.g. Show and Hide. */\n 'group-actions'?: (props: { group: DataListGroup<T> }) => unknown\n /** Shown when every group is empty, e.g. an EmptyState. */\n empty?: () => unknown\n}>()\n\nconst id = useId()\nconst root = useTemplateRef<HTMLElement>('root')\n\nconst idOf = (item: T): unknown => item[props.rowKey ?? 'id']\nconst interactive = computed(() => !!props.onRowClick || props.selectable)\n\nconst { dragged, target, onPointerDown, endedDrag } = useDragMove({\n root,\n countOf: (group) => props.groups.find((g) => g.id === group)?.items.length ?? 0,\n onMove: (id, group, index) => emit('move', id, group, index),\n ghostMaxWidth: 360,\n tilt: false,\n // A row has no ground of its own: the copy takes the list's surface and a hairline.\n ghostStyle: {\n background: 'rgb(var(--sui-raised))',\n border: '1px solid rgb(var(--sui-edge))',\n borderRadius: '10px'\n }\n})\nconst shownGroups = computed(() =>\n props.hideEmpty && !dragged.value ? props.groups.filter((group) => group.items.length > 0) : props.groups\n)\nconst isTarget = (group: string, index: number, item: T) =>\n target.value?.zone === group &&\n target.value.index === index &&\n dragged.value?.id !== idOf(item) &&\n dragged.value?.zone !== group\n// Dropped past a group's last row, into an empty group, or onto a collapsed one: it lands at the end.\nconst dropsAtEnd = (group: DataListGroup<T>) =>\n target.value?.zone === group.id && dragged.value?.zone !== group.id && target.value.index >= group.items.length\nconst isEmpty = computed(() => !props.loading && props.groups.every((group) => group.items.length === 0))\n\nfunction toggleGroup(groupId: string) {\n collapsed.value = collapsed.value.includes(groupId)\n ? collapsed.value.filter((x) => x !== groupId)\n : [...collapsed.value, groupId]\n}\n\nconst collapsibleGroup = (group: DataListGroup<T>) => group.collapsible ?? props.collapsible\nconst isCollapsed = (group: DataListGroup<T>) => collapsibleGroup(group) && collapsed.value.includes(group.id)\nconst visibleItems = computed(() => props.groups.filter((group) => !isCollapsed(group)).flatMap((group) => group.items))\n\n// Where a range starts: the row last toggled.\nlet anchorKey: unknown = undefined\n\nfunction toggle(item: T) {\n const key = idOf(item)\n anchorKey = key\n selected.value = selected.value.includes(key) ? selected.value.filter((x) => x !== key) : [...selected.value, key]\n}\n\nfunction selectRange(item: T) {\n const keys = visibleItems.value.map(idOf)\n const to = keys.indexOf(idOf(item))\n const from = keys.indexOf(anchorKey)\n const span = from < 0 ? [keys[to]] : keys.slice(Math.min(from, to), Math.max(from, to) + 1)\n if (from < 0) anchorKey = idOf(item)\n selected.value = [...selected.value, ...span.filter((key) => !selected.value.includes(key))]\n}\n\nfunction select(...items: T[]) {\n const keys = items.map(idOf).filter((key) => !selected.value.includes(key))\n if (keys.length) selected.value = [...selected.value, ...new Set(keys)]\n}\n\nfunction clickRow(event: MouseEvent, item: T) {\n if (endedDrag()) return\n if (props.selectable && event.shiftKey) selectRange(item)\n else if (props.selectable && (event.metaKey || event.ctrlKey)) toggle(item)\n // Leading checkboxes stand in for the row's mark, so while selecting a click selects, as in a mail list.\n else if (props.selectable && leading.value && selected.value.length) toggle(item)\n else props.onRowClick?.(item)\n}\n\n// A shift-click selects rather than highlighting the text between.\nfunction onRowMousedown(event: MouseEvent) {\n if (props.selectable && event.shiftKey) event.preventDefault()\n}\n\n// ↑ ↓ or j k move between rows, x selects, Enter and Space open; with Shift, ↑ ↓ extend the selection and Space\n// selects a range.\nfunction onKeydown(event: KeyboardEvent, item: T) {\n if (event.target !== event.currentTarget || event.metaKey || event.ctrlKey || event.altKey) return\n // A collapsed group's rows are still in the DOM, hidden.\n const rows = [...(root.value?.querySelectorAll<HTMLElement>('[data-list-row]') ?? [])].filter(\n (row) => row.closest('ul')?.style.display !== 'none'\n )\n const i = rows.indexOf(event.currentTarget as HTMLElement)\n const down = event.key === 'ArrowDown' || event.key === 'j'\n const up = event.key === 'ArrowUp' || event.key === 'k'\n if ((down || up) && event.shiftKey && props.selectable) {\n const j = down ? Math.min(rows.length - 1, i + 1) : Math.max(0, i - 1)\n const next = visibleItems.value[j]\n select(item, ...(next ? [next] : []))\n rows[j]?.focus()\n } else if (down) rows[Math.min(rows.length - 1, i + 1)]?.focus()\n else if (up) rows[Math.max(0, i - 1)]?.focus()\n else if (event.key === ' ' && event.shiftKey && props.selectable) selectRange(item)\n else if (event.key.toLowerCase() === 'x' && props.selectable) toggle(item)\n else if ((event.key === 'Enter' || event.key === ' ') && props.onRowClick) props.onRowClick(item)\n else return\n event.preventDefault()\n}\n\nconst cards = computed(() => props.variant === 'cards')\nconst leading = computed(() => props.selectable && props.checkboxPlacement === 'leading')\nconst gutter = computed(() => props.selectable && props.checkboxPlacement === 'gutter')\nconst tones = { sunken: 'sui-band', surface: 'bg-sui-surface', canvas: 'bg-sui-canvas' }\nconst headerTone = computed(() => tones[props.groupHeaderTone ?? (cards.value ? 'surface' : 'sunken')])\nconst sizes = computed(() => {\n const style: Record<string, string> = {}\n if (props.rowHeight !== undefined) style['--sui-list-row'] = `${props.rowHeight}px`\n if (props.groupHeaderHeight !== undefined) style['--sui-list-header'] = `${props.groupHeaderHeight}px`\n return Object.keys(style).length ? style : undefined\n})\nconst card = 'overflow-clip rounded-xl border border-sui-line-subtle bg-sui-surface'\nconst custom = (group: DataListGroup<T>) => !!slots['group-header'] || group.header !== undefined\nconst groupName = (group: DataListGroup<T>) => group.label ?? group.name ?? ''\n\nconst skeletonWidths = ['42%', '58%', '35%', '50%', '46%', '38%']\nconst skeletonGroupWidths = ['5.5rem', '4rem', '4.75rem']\nconst headerBar = 'animate-pulse bg-sui-fill-hover'\nconst iconButton =\n 'flex size-6 shrink-0 items-center justify-center rounded-md text-sui-ink-muted outline-hidden transition-colors duration-150 hover:bg-sui-fill-hover hover:text-sui-ink focus-visible:sui-ring-inset'\n</script>\n\n<!-- A grouped list: one dense line per record under sticky, collapsible group headers. -->\n<template>\n <div ref=\"root\" class=\"flex flex-col text-13 text-sui-ink\" :class=\"cards ? 'gap-3' : card\" :style=\"sizes\">\n <div v-if=\"isEmpty && $slots.empty\" :class=\"cards && card\">\n <slot name=\"empty\" />\n </div>\n <!-- Placeholder groups in the list's own shape: its header, rows, leading marks and meta. -->\n <template v-else-if=\"loading\">\n <section\n v-for=\"(rows, g) in loadingGroups\"\n :key=\"g\"\n aria-busy=\"true\"\n :class=\"cards ? card : 'border-t border-sui-line-subtle first:border-t-0'\"\n >\n <div\n aria-hidden=\"true\"\n class=\"flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2\"\n :class=\"[headerTone, collapsible ? 'pl-1.5' : 'pl-4']\"\n >\n <span v-if=\"collapsible\" class=\"size-6 shrink-0\" />\n <span\n v-if=\"$slots['group-leading'] || $slots['group-header']\"\n class=\"size-3.5 rounded-full\"\n :class=\"headerBar\"\n />\n <span class=\"h-2.5 rounded-md\" :class=\"headerBar\" :style=\"{ width: skeletonGroupWidths[g % 3] }\" />\n <span class=\"h-2.5 w-3.5 rounded-md\" :class=\"headerBar\" />\n </div>\n <div\n v-for=\"r in rows\"\n :key=\"r\"\n aria-hidden=\"true\"\n class=\"flex h-[var(--sui-list-row,2.5rem)] items-center gap-2.5 pr-4\"\n :class=\"[gutter ? 'pl-9.5' : 'pl-4', dividers && '[&+&]:border-t [&+&]:border-sui-line-subtle']\"\n >\n <Skeleton v-if=\"$slots.leading || leading\" shape=\"circle\" size=\"1.25rem\" />\n <Skeleton height=\"0.75rem\" :width=\"skeletonWidths[(g * 3 + r) % skeletonWidths.length]\" />\n <span class=\"flex-1\" />\n <template v-if=\"$slots.meta\">\n <Skeleton height=\"0.625rem\" width=\"6rem\" />\n <Skeleton height=\"0.625rem\" width=\"3.5rem\" />\n </template>\n </div>\n </section>\n </template>\n <template v-else>\n <section\n v-for=\"group in shownGroups\"\n :key=\"group.id\"\n :aria-label=\"group.label\"\n :aria-labelledby=\"!group.label && (group.name || custom(group)) ? `${id}-${group.id}-name` : undefined\"\n :class=\"[\n cards ? card : 'border-t border-sui-line-subtle first:border-t-0',\n dragged && target?.zone === group.id && dragged.zone !== group.id && 'ring-2 ring-sui-accent-line ring-inset'\n ]\"\n :data-drag-zone=\"draggable ? group.id : undefined\"\n >\n <header\n v-if=\"group.name || custom(group)\"\n class=\"flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2\"\n :class=\"[headerTone, !cards && 'sticky top-0 z-10', collapsibleGroup(group) ? 'pl-1.5' : 'pl-4']\"\n >\n <button\n v-if=\"collapsibleGroup(group)\"\n :aria-controls=\"`${id}-${group.id}`\"\n :aria-expanded=\"!collapsed.includes(group.id)\"\n :aria-label=\"collapsed.includes(group.id) ? expandLabel : collapseLabel\"\n :class=\"iconButton\"\n type=\"button\"\n @click=\"toggleGroup(group.id)\"\n >\n <svg\n aria-hidden=\"true\"\n class=\"size-3 fill-none stroke-current transition-transform duration-150\"\n :class=\"isCollapsed(group) && '-rotate-90'\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.5\"\n viewBox=\"0 0 12 12\"\n >\n <path d=\"M3 4.5 6 7.5l3-3\" />\n </svg>\n </button>\n <component\n :is=\"`h${headingLevel}`\"\n v-if=\"custom(group)\"\n :id=\"`${id}-${group.id}-name`\"\n class=\"m-0 flex min-w-0 items-center gap-2 text-13 font-medium text-sui-ink\"\n >\n <slot\n :collapsed=\"collapsed.includes(group.id)\"\n :count=\"group.count ?? group.items.length\"\n :group=\"group\"\n name=\"group-header\"\n >{{ group.header }}</slot\n >\n </component>\n <template v-else>\n <slot :group=\"group\" name=\"group-leading\" />\n <component\n :is=\"`h${headingLevel}`\"\n :id=\"`${id}-${group.id}-name`\"\n class=\"m-0 text-13 font-medium text-sui-ink\"\n >\n {{ group.name }}\n </component>\n <span class=\"text-13 text-sui-ink-muted tabular-nums\">{{ group.count ?? group.items.length }}</span>\n </template>\n <span class=\"ml-auto flex items-center gap-1\">\n <slot :group=\"group\" name=\"group-actions\" />\n </span>\n <button\n v-if=\"onNew\"\n :aria-label=\"newLabel.replace('{group}', groupName(group))\"\n :class=\"iconButton\"\n type=\"button\"\n @click=\"onNew(group)\"\n >\n <svg\n aria-hidden=\"true\"\n class=\"size-3.5 fill-none stroke-current\"\n stroke-linecap=\"round\"\n stroke-width=\"1.5\"\n viewBox=\"0 0 14 14\"\n >\n <path d=\"M7 2.5v9M2.5 7h9\" />\n </svg>\n </button>\n </header>\n <ul v-show=\"!isCollapsed(group)\" :id=\"`${id}-${group.id}`\" class=\"m-0 list-none p-0\">\n <ContextMenu\n v-for=\"(item, index) in group.items\"\n :key=\"idOf(item) as PropertyKey\"\n :disabled=\"!contextItems\"\n :items=\"contextItems?.(item)\"\n :label=\"contextLabel\"\n @click-item=\"emit('context-item', $event, item)\"\n >\n <li\n class=\"group/row relative flex h-[var(--sui-list-row,2.5rem)] items-center transition-[background-color,opacity] duration-100 has-focus-visible:sui-ring-inset\"\n :class=\"[\n dividers && '[&+&]:border-t [&+&]:border-sui-line-subtle',\n draggable && 'select-none',\n dragged?.id === idOf(item) && 'opacity-40',\n isTarget(group.id, index, item) && 'shadow-[inset_0_2px_0_rgb(var(--sui-accent-solid))]',\n selected.includes(idOf(item))\n ? 'bg-sui-accent-wash'\n : 'hover:bg-sui-fill-hover has-focus-visible:bg-sui-fill-hover'\n ]\"\n :data-drag-index=\"draggable ? index : undefined\"\n :style=\"item.depth ? { paddingLeft: `${item.depth * 22}px` } : undefined\"\n @dragstart.prevent\n @pointerdown=\"draggable && onPointerDown($event, idOf(item), group.id, index)\"\n >\n <!-- Outside the row, which is a button, over the leading slot's first mark: 16px in, or more for a child. -->\n <span\n v-if=\"leading\"\n class=\"absolute top-1/2 z-[1] flex size-4 -translate-y-1/2 items-center justify-center\"\n :class=\"!selected.length && 'hidden group-hover/row:flex group-has-focus-visible/row:flex'\"\n data-list-check\n data-no-drag\n :style=\"{ left: `${16 + (item.depth ?? 0) * 22}px` }\"\n >\n <Checkbox\n :aria-label=\"selectLabel\"\n :model-value=\"selected.includes(idOf(item))\"\n tabindex=\"-1\"\n @update:model-value=\"toggle(item)\"\n />\n </span>\n <span\n v-if=\"gutter\"\n class=\"flex w-7 shrink-0 justify-end transition-opacity duration-100\"\n :class=\"selected.length ? 'opacity-100' : 'opacity-0 group-hover/row:opacity-100'\"\n data-no-drag\n >\n <Checkbox\n :aria-label=\"selectLabel\"\n :model-value=\"selected.includes(idOf(item))\"\n tabindex=\"-1\"\n @update:model-value=\"toggle(item)\"\n />\n </span>\n <div\n class=\"flex h-full min-w-0 flex-1 items-center gap-2.5 pr-4 outline-hidden\"\n :class=\"[gutter ? 'pl-2.5' : 'pl-4', (onRowClick || selectable) && 'cursor-pointer']\"\n data-list-row\n :role=\"onRowClick ? 'button' : undefined\"\n :tabindex=\"interactive ? 0 : undefined\"\n @click=\"clickRow($event, item)\"\n @keydown=\"onKeydown($event, item)\"\n @mousedown=\"onRowMousedown\"\n >\n <span\n v-if=\"$slots.leading\"\n class=\"flex shrink-0 items-center gap-2 text-sui-ink-muted tabular-nums\"\n :class=\"\n leading &&\n (selected.length\n ? '[&>*:first-child]:invisible'\n : 'group-hover/row:[&>*:first-child]:invisible group-has-focus-visible/row:[&>*:first-child]:invisible')\n \"\n >\n <slot\n :item=\"item\"\n name=\"leading\"\n :selected=\"selected.includes(idOf(item))\"\n :selecting=\"selected.length > 0\"\n :toggle=\"() => toggle(item)\"\n />\n </span>\n <span class=\"min-w-0 flex-1 truncate font-medium text-sui-ink\">\n <slot :item=\"item\" name=\"title\">{{ item.name }}</slot>\n </span>\n <span\n v-if=\"$slots.meta\"\n class=\"flex shrink-0 items-center gap-2 text-xs text-sui-ink-muted tabular-nums\"\n >\n <slot :item=\"item\" name=\"meta\" />\n </span>\n </div>\n </li>\n </ContextMenu>\n <li v-if=\"dragged && dropsAtEnd(group)\" aria-hidden=\"true\" class=\"h-0.5 bg-sui-accent-solid\" />\n </ul>\n </section>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,GA6NMwC,IAAO,yEAMPC,IAAY,mCACZC,IACJ,wM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA7KF,IAAMO,IAAQC,GAuBRC,IAAOH,GAMPI,IAAWnD,EAAsBiD,GAAC,UAAiC,GACnEI,IAAYrD,EAAqBiD,GAAC,WAAkC,GAEpEK,KAAQrD,EAAA,GAkBRuD,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sD+G,EAAA,QAAA,SAAA,EAAzC,QAAI,SAAqC,CAAnBpG,EAAAC,EAAA2C,EAAK,IAAI,GAAA,CAAA,C;KAGtC9D,EAAAA,OAAO,QADfG,EAAA,GAAAC,EAKO,QALPkC,IAKO,CADL/B,EAAiC+G,EAAA,QAAA,QAAA,EAApB,QAAI,CAAA,C;;;;;;;;;E,aAKfvG,EAAAuD,CAAA,KAAWG,GAAWN,CAAK,KAArChE,EAAA,GAAAC,EAA+F,MAA/FmC,EAA+F,K,qBA9FpF,CAAAf,IAAA,CAAAuD,EAAYZ,CAAK,CAAA,C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import e from "../Button/Button.js";
|
|
2
2
|
import t from "../Icon/Icon.js";
|
|
3
3
|
import n from "../Tooltip/Tooltip.js";
|
|
4
|
-
import r from "../
|
|
5
|
-
import i from "../
|
|
4
|
+
import r from "../Kbd/Kbd.js";
|
|
5
|
+
import i from "../internal/CloseIcon.js";
|
|
6
6
|
import a from "./ContextSeparator.js";
|
|
7
7
|
import { focusFirst as o, modifierKey as s } from "./focus.js";
|
|
8
8
|
import { useSheetDrag as c } from "./useSheetDrag.js";
|
|
@@ -149,7 +149,7 @@ var se = {
|
|
|
149
149
|
variant: "ghost",
|
|
150
150
|
onClick: Q
|
|
151
151
|
}, {
|
|
152
|
-
default: D(() => [g(
|
|
152
|
+
default: D(() => [g(i, { class: "fill-sui-ink-subtle stroke-sui-ink-subtle" })]),
|
|
153
153
|
_: 1
|
|
154
154
|
}, 8, ["aria-label"])]),
|
|
155
155
|
_: 1
|
|
@@ -206,7 +206,7 @@ var se = {
|
|
|
206
206
|
variant: "ghost",
|
|
207
207
|
onClick: Q
|
|
208
208
|
}, {
|
|
209
|
-
default: D(() => [g(
|
|
209
|
+
default: D(() => [g(i, { class: "fill-sui-ink-muted stroke-sui-ink-muted" })]),
|
|
210
210
|
_: 1
|
|
211
211
|
}, 8, ["aria-label"])]),
|
|
212
212
|
_: 1
|
|
@@ -231,7 +231,7 @@ var se = {
|
|
|
231
231
|
variant: "ghost",
|
|
232
232
|
onClick: Q
|
|
233
233
|
}, {
|
|
234
|
-
default: D(() => [g(
|
|
234
|
+
default: D(() => [g(i, { class: "fill-sui-ink-muted stroke-sui-ink-muted" })]),
|
|
235
235
|
_: 1
|
|
236
236
|
}, 8, ["aria-label"])]),
|
|
237
237
|
_: 1
|
|
@@ -248,10 +248,10 @@ var se = {
|
|
|
248
248
|
C(s.$slots, "footer-start"),
|
|
249
249
|
_.hint ? (S(), p("span", F, w(_.hint), 1)) : f("", !0),
|
|
250
250
|
c[8] ||= m("span", { class: "flex-1" }, null, -1),
|
|
251
|
-
_.confirmLabel ? (S(), p("span", I, [g(
|
|
251
|
+
_.confirmLabel ? (S(), p("span", I, [g(r, null, {
|
|
252
252
|
default: D(() => [h(w(T(H)), 1)]),
|
|
253
253
|
_: 1
|
|
254
|
-
}), g(
|
|
254
|
+
}), g(r, null, {
|
|
255
255
|
default: D(() => [...c[7] ||= [h("↵", -1)]]),
|
|
256
256
|
_: 1
|
|
257
257
|
})])) : f("", !0),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_normalizeClass","_normalizeStyle","_withKeys","_createElementBlock","_toDisplayString","_createCommentVNode","_createElementVNode","_mergeProps","_Fragment","_renderSlot","ContextSeparator","_createTextVNode","Tooltip","Button","CloseIcon","Icon","_withModifiers","Kbd","Button_default","Icon_default","Tooltip_default","CloseIcon_default","Kbd_default","ContextSeparator_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","Dialog_vue_vue_type_script_setup_true_lang_default","\"open\"","\"openModifiers\"","__emit","props","__props","emit","open","useModel","slots","useSlots","hasContext","computed","modKey","modifierKey","hasFooter","banded","sizes","width","bandColour","narrow","ref","query","onQuery","watch","presentation","below","onBeforeUnmount","sheet","panel","useTemplateRef","drag","useSheetDrag","cancel","isOpen","iconColours","onOutside","event","confirmFromKeyboard","openBlock","createBlock","unref","DialogRoot","_cache","$event","withCtx","createVNode","DialogPortal","DialogOverlay","normalizeClass","DialogContent","normalizeStyle","withKeys","focusFirst","createCommentVNode","createElementBlock","toDisplayString","createElementVNode","mergeProps","DialogTitle","createTextVNode","Fragment","renderSlot","_ctx","withModifiers"],"sources":["../../../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, ref, useSlots, useTemplateRef, watch } from 'vue'\n\nimport { DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle } from 'reka-ui'\n\nimport Button from '../Button/Button.vue'\nimport Icon from '../Icon/Icon.vue'\nimport Kbd from '../Kbd/Kbd.vue'\nimport Tooltip from '../Tooltip/Tooltip.vue'\nimport CloseIcon from '../internal/CloseIcon.vue'\nimport ContextSeparator from './ContextSeparator.vue'\nimport { focusFirst, modifierKey } from './focus'\nimport { useSheetDrag } from './useSheetDrag'\n\nexport interface DialogProps {\n title?: string\n /** The close button in the header. */\n closable?: boolean\n closeLabel?: string\n /** @deprecated A dialog has no Cancel button: Escape and the close button cancel. Kept so existing calls compile. */\n cancelLabel?: string\n /** Shows the standard footer's confirm button, which emits `confirm`, as ⌘ or Ctrl Enter does. */\n confirmLabel?: string\n confirmIcon?: string\n confirmVariant?: 'primary' | 'danger' | 'contrast'\n confirmDisabled?: boolean\n /** sm 432px, md 512px, record 520px (the default with a band), lg 672px, xl 768px. */\n size?: 'sm' | 'md' | 'record' | 'lg' | 'xl'\n /** A record form's tinted header band: a CSS colour such as `rgb(var(--sui-hue-blue-soft))`, or `true` for the accent\n * wash. The `hero` slot sits centred in it. */\n band?: string | boolean\n /** Muted text at the footer's start. The ⌘ or Ctrl Enter shortcut is drawn by the dialog next to its confirm. */\n hint?: string\n /** The body draws its own header, edge to edge. */\n headerless?: boolean\n /** sheet: a bottom sheet with a grab handle, drag to dismiss and a full-width confirm. auto: a sheet on a viewport\n * narrower than `sheetBelow`, a dialog otherwise. A sheet draws no Cancel and no band: dragging it down, the\n * scrim and Escape cancel. */\n presentation?: 'dialog' | 'sheet' | 'auto'\n /** The width in px below which `auto` is a sheet. */\n sheetBelow?: number\n}\n\nconst props = withDefaults(defineProps<DialogProps>(), {\n title: undefined,\n closable: true,\n closeLabel: 'Close',\n cancelLabel: 'Cancel',\n confirmLabel: undefined,\n confirmIcon: undefined,\n confirmVariant: 'primary',\n size: undefined,\n band: undefined,\n hint: undefined,\n presentation: 'dialog',\n sheetBelow: 640\n})\n\nconst emit = defineEmits<{ confirm: []; cancel: [] }>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst slots = useSlots()\nconst hasContext = computed(() => !!slots.context)\nconst modKey = modifierKey()\nconst hasFooter = computed(() => !!slots.footer || !!props.confirmLabel)\nconst banded = computed(() => !!props.band || !!slots.hero)\n\nconst sizes = {\n sm: 'max-w-[27rem]',\n md: 'max-w-lg',\n record: 'max-w-130',\n lg: 'max-w-2xl',\n xl: 'max-w-3xl'\n}\nconst width = computed(() => sizes[props.size ?? (banded.value ? 'record' : 'md')])\nconst bandColour = computed(() => (typeof props.band === 'string' ? props.band : 'rgb(var(--sui-accent-wash))'))\n\nconst narrow = ref(false)\nlet query: MediaQueryList | undefined\nconst onQuery = () => (narrow.value = !!query?.matches)\nwatch(\n () => [props.presentation, props.sheetBelow] as const,\n ([presentation, below]) => {\n query?.removeEventListener('change', onQuery)\n query =\n presentation === 'auto' && typeof window !== 'undefined'\n ? window.matchMedia(`(max-width: ${below - 0.02}px)`)\n : undefined\n query?.addEventListener('change', onQuery)\n onQuery()\n },\n { immediate: true }\n)\nonBeforeUnmount(() => query?.removeEventListener('change', onQuery))\n\nconst sheet = computed(() => props.presentation === 'sheet' || (props.presentation === 'auto' && narrow.value))\nconst panel = useTemplateRef<InstanceType<typeof DialogContent>>('panel')\nconst drag = useSheetDrag(\n computed(() => panel.value?.$el as HTMLElement | undefined),\n () => cancel()\n)\nwatch(open, (isOpen) => isOpen && drag.reset())\n\nconst iconColours = { primary: 'on-accent', danger: 'on-danger', contrast: 'on-contrast' } as const\n\nfunction cancel() {\n emit('cancel')\n open.value = false\n}\n\n// A sheet closes on a tap on the scrim; a dialog only from its buttons and Escape.\nfunction onOutside(event: Event) {\n if (sheet.value) emit('cancel')\n else event.preventDefault()\n}\n\nfunction confirmFromKeyboard(event: KeyboardEvent) {\n if (!event.metaKey && !event.ctrlKey) return\n event.preventDefault()\n if (props.confirmLabel && !props.confirmDisabled) emit('confirm')\n}\n</script>\n\n<!-- The one dialog: one raised piece with a title (after an optional `context`, such as where the thing lands), a body\n and a footer; or, with a `band` or `hero`, a record form under a tinted band; or a bottom sheet. -->\n<template>\n <DialogRoot v-model:open=\"open\">\n <DialogPortal>\n <DialogOverlay\n class=\"fixed inset-0 z-[1100] flex justify-center data-[state=closed]:animate-sui-scrim-out data-[state=open]:animate-sui-scrim-in\"\n :class=\"\n sheet\n ? 'items-end bg-sui-scrim/40 backdrop-blur-[4px]'\n : 'items-start bg-[rgb(var(--sui-scrim)/var(--sui-scrim-alpha))] px-4 pt-(--sui-dialog-offset) pb-4'\n \"\n >\n <DialogContent\n v-if=\"sheet\"\n ref=\"panel\"\n :aria-describedby=\"undefined\"\n class=\"relative flex max-h-[calc(100dvh-1.5rem)] w-full flex-col rounded-t-(--sui-radius-sheet) border border-b-0 border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-sheet-out data-[state=open]:animate-sui-sheet-in motion-reduce:animate-none motion-reduce:transition-none\"\n :class=\"!drag.dragging.value && 'transition-transform duration-[250ms] ease-[cubic-bezier(0.32,0.72,0,1)]'\"\n :style=\"drag.style.value\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside=\"onOutside\"\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <!-- Without a close button, keyboard and screen-reader users still get one: it shows when focused. -->\n <button\n v-if=\"!closable\"\n class=\"pointer-events-none absolute top-2 right-3 h-7 rounded-md bg-sui-fill px-2.5 text-13 font-medium text-sui-ink opacity-0 outline-hidden focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:sui-ring\"\n type=\"button\"\n @click=\"cancel\"\n >\n {{ closeLabel }}\n </button>\n <div class=\"shrink-0 cursor-grab touch-none pt-2\" data-modal-header v-bind=\"drag.handlers\">\n <span aria-hidden=\"true\" class=\"mx-auto block h-1 w-9 rounded-full bg-sui-mark-faint\" />\n <div v-if=\"!headerless\" class=\"flex min-h-11 items-center justify-between gap-3 pt-2 pr-4 pb-1 pl-5\">\n <div class=\"flex min-w-0 items-center gap-1\">\n <template v-if=\"hasContext\">\n <slot name=\"context\" />\n <ContextSeparator />\n </template>\n <DialogTitle class=\"min-w-0 truncate text-base font-semibold text-sui-ink\">\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n </div>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-subtle stroke-sui-ink-subtle\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n </div>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-2 pb-5 text-sm leading-5 text-sui-ink-emphasis\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 flex-col gap-2.5 border-t border-sui-fill-line bg-sui-raised px-4 pt-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <div v-if=\"$slots['footer-start'] || hint\" class=\"flex min-w-0 items-center justify-center gap-2\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n </div>\n <Button\n class=\"w-full\"\n :disabled=\"confirmDisabled\"\n size=\"lg\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n <DialogContent\n v-else\n :aria-describedby=\"undefined\"\n class=\"flex max-h-[calc(100dvh-var(--sui-dialog-offset)-1rem)] w-full flex-col border border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-dialog-out data-[state=open]:animate-sui-dialog-in\"\n :class=\"[width, banded ? 'rounded-2xl' : 'rounded-xl']\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside.prevent\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <div\n v-if=\"banded\"\n class=\"shrink-0 rounded-t-2xl pt-3.5 pr-3.5 pb-4.5 pl-5 transition-colors duration-200\"\n data-modal-header\n :style=\"{ backgroundColor: bandColour }\"\n >\n <div class=\"flex items-center justify-between gap-3\">\n <DialogTitle class=\"text-13 leading-5 font-medium text-sui-ink-body\">{{ title }}</DialogTitle>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <div v-if=\"$slots.hero\" class=\"mt-0.5 flex flex-col items-center gap-1.5 pr-1.5\">\n <slot name=\"hero\" />\n </div>\n </div>\n <div\n v-else-if=\"!headerless\"\n class=\"flex shrink-0 items-center justify-between gap-3 pt-3 pr-3 pl-4 text-sui-ink\"\n data-modal-header\n >\n <div class=\"flex min-h-7 min-w-0 items-center gap-1\">\n <template v-if=\"hasContext\">\n <slot name=\"context\" />\n <ContextSeparator />\n </template>\n <DialogTitle\n class=\"min-w-0 truncate text-sm font-semibold text-sui-ink\"\n :class=\"hasContext ? '' : 'pl-1'\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n </div>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n\n <div\n class=\"overflow-y-auto text-sm text-sui-ink-emphasis\"\n :class=\"[\n banded ? 'px-5 pt-0.5 pb-4' : headerless ? 'p-5' : 'px-5 pt-3.5 pb-5',\n !hasFooter && (banded ? 'rounded-b-2xl' : 'rounded-b-xl')\n ]\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 items-center gap-2.5 text-sui-ink\"\n :class=\"banded ? 'rounded-b-2xl py-3 pr-4 pl-5' : 'rounded-b-xl px-4 pt-1 pb-4 pl-5'\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n <span class=\"flex-1\" />\n <span v-if=\"confirmLabel\" aria-hidden=\"true\" class=\"flex shrink-0 items-center gap-1\">\n <Kbd>{{ modKey }}</Kbd\n ><Kbd>↵</Kbd>\n </span>\n <Button\n v-if=\"confirmLabel\"\n :aria-keyshortcuts=\"modKey === '⌘' ? 'Meta+Enter' : 'Control+Enter'\"\n :disabled=\"confirmDisabled\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confir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,AAAAsC,EAAA,QAAA,MAAErC,EAAI,SAAA;;SAEZ,SAAA5C,QAAoF,CAAxE2C,EAAA,eAAZ9C,EAAA,GAAAC,EAAoFmB,GAAA;;UAA1D,OAAOwD,EAAY9B,EAAA;UAAkB,MAAMA,EAAA;S,6CAAe9B,EAAA,MACpFP,EAAGqC,EAAA,YAAY,GAAA,CAAA,C"}
|
|
1
|
+
{"version":3,"file":"Dialog.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_normalizeClass","_normalizeStyle","_withKeys","_createElementBlock","_toDisplayString","_createCommentVNode","_createElementVNode","_mergeProps","_Fragment","_renderSlot","ContextSeparator","_createTextVNode","Tooltip","Button","CloseIcon","Icon","_withModifiers","Kbd","Button_default","Icon_default","Tooltip_default","Kbd_default","CloseIcon_default","ContextSeparator_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","Dialog_vue_vue_type_script_setup_true_lang_default","\"open\"","\"openModifiers\"","__emit","props","__props","emit","open","useModel","slots","useSlots","hasContext","computed","modKey","modifierKey","hasFooter","banded","sizes","width","bandColour","narrow","ref","query","onQuery","watch","presentation","below","onBeforeUnmount","sheet","panel","useTemplateRef","drag","useSheetDrag","cancel","isOpen","iconColours","onOutside","event","confirmFromKeyboard","openBlock","createBlock","unref","DialogRoot","_cache","$event","withCtx","createVNode","DialogPortal","DialogOverlay","normalizeClass","DialogContent","normalizeStyle","withKeys","focusFirst","createCommentVNode","createElementBlock","toDisplayString","createElementVNode","mergeProps","DialogTitle","createTextVNode","Fragment","renderSlot","_ctx","withModifiers"],"sources":["../../../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, ref, useSlots, useTemplateRef, watch } from 'vue'\n\nimport { DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle } from 'reka-ui'\n\nimport Button from '../Button/Button.vue'\nimport Icon from '../Icon/Icon.vue'\nimport Kbd from '../Kbd/Kbd.vue'\nimport Tooltip from '../Tooltip/Tooltip.vue'\nimport CloseIcon from '../internal/CloseIcon.vue'\nimport ContextSeparator from './ContextSeparator.vue'\nimport { focusFirst, modifierKey } from './focus'\nimport { useSheetDrag } from './useSheetDrag'\n\nexport interface DialogProps {\n title?: string\n /** The close button in the header. */\n closable?: boolean\n closeLabel?: string\n /** @deprecated A dialog has no Cancel button: Escape and the close button cancel. Kept so existing calls compile. */\n cancelLabel?: string\n /** Shows the standard footer's confirm button, which emits `confirm`, as ⌘ or Ctrl Enter does. */\n confirmLabel?: string\n confirmIcon?: string\n confirmVariant?: 'primary' | 'danger' | 'contrast'\n confirmDisabled?: boolean\n /** sm 432px, md 512px, record 520px (the default with a band), lg 672px, xl 768px. */\n size?: 'sm' | 'md' | 'record' | 'lg' | 'xl'\n /** A record form's tinted header band: a CSS colour such as `rgb(var(--sui-hue-blue-soft))`, or `true` for the accent\n * wash. The `hero` slot sits centred in it. */\n band?: string | boolean\n /** Muted text at the footer's start. The ⌘ or Ctrl Enter shortcut is drawn by the dialog next to its confirm. */\n hint?: string\n /** The body draws its own header, edge to edge. */\n headerless?: boolean\n /** sheet: a bottom sheet with a grab handle, drag to dismiss and a full-width confirm. auto: a sheet on a viewport\n * narrower than `sheetBelow`, a dialog otherwise. A sheet draws no Cancel and no band: dragging it down, the\n * scrim and Escape cancel. */\n presentation?: 'dialog' | 'sheet' | 'auto'\n /** The width in px below which `auto` is a sheet. */\n sheetBelow?: number\n}\n\nconst props = withDefaults(defineProps<DialogProps>(), {\n title: undefined,\n closable: true,\n closeLabel: 'Close',\n cancelLabel: 'Cancel',\n confirmLabel: undefined,\n confirmIcon: undefined,\n confirmVariant: 'primary',\n size: undefined,\n band: undefined,\n hint: undefined,\n presentation: 'dialog',\n sheetBelow: 640\n})\n\nconst emit = defineEmits<{ confirm: []; cancel: [] }>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst slots = useSlots()\nconst hasContext = computed(() => !!slots.context)\nconst modKey = modifierKey()\nconst hasFooter = computed(() => !!slots.footer || !!props.confirmLabel)\nconst banded = computed(() => !!props.band || !!slots.hero)\n\nconst sizes = {\n sm: 'max-w-[27rem]',\n md: 'max-w-lg',\n record: 'max-w-130',\n lg: 'max-w-2xl',\n xl: 'max-w-3xl'\n}\nconst width = computed(() => sizes[props.size ?? (banded.value ? 'record' : 'md')])\nconst bandColour = computed(() => (typeof props.band === 'string' ? props.band : 'rgb(var(--sui-accent-wash))'))\n\nconst narrow = ref(false)\nlet query: MediaQueryList | undefined\nconst onQuery = () => (narrow.value = !!query?.matches)\nwatch(\n () => [props.presentation, props.sheetBelow] as const,\n ([presentation, below]) => {\n query?.removeEventListener('change', onQuery)\n query =\n presentation === 'auto' && typeof window !== 'undefined'\n ? window.matchMedia(`(max-width: ${below - 0.02}px)`)\n : undefined\n query?.addEventListener('change', onQuery)\n onQuery()\n },\n { immediate: true }\n)\nonBeforeUnmount(() => query?.removeEventListener('change', onQuery))\n\nconst sheet = computed(() => props.presentation === 'sheet' || (props.presentation === 'auto' && narrow.value))\nconst panel = useTemplateRef<InstanceType<typeof DialogContent>>('panel')\nconst drag = useSheetDrag(\n computed(() => panel.value?.$el as HTMLElement | undefined),\n () => cancel()\n)\nwatch(open, (isOpen) => isOpen && drag.reset())\n\nconst iconColours = { primary: 'on-accent', danger: 'on-danger', contrast: 'on-contrast' } as const\n\nfunction cancel() {\n emit('cancel')\n open.value = false\n}\n\n// A sheet closes on a tap on the scrim; a dialog only from its buttons and Escape.\nfunction onOutside(event: Event) {\n if (sheet.value) emit('cancel')\n else event.preventDefault()\n}\n\nfunction confirmFromKeyboard(event: KeyboardEvent) {\n if (!event.metaKey && !event.ctrlKey) return\n event.preventDefault()\n if (props.confirmLabel && !props.confirmDisabled) emit('confirm')\n}\n</script>\n\n<!-- The one dialog: one raised piece with a title (after an optional `context`, such as where the thing lands), a body\n and a footer; or, with a `band` or `hero`, a record form under a tinted band; or a bottom sheet. -->\n<template>\n <DialogRoot v-model:open=\"open\">\n <DialogPortal>\n <DialogOverlay\n class=\"fixed inset-0 z-[1100] flex justify-center data-[state=closed]:animate-sui-scrim-out data-[state=open]:animate-sui-scrim-in\"\n :class=\"\n sheet\n ? 'items-end bg-sui-scrim/40 backdrop-blur-[4px]'\n : 'items-start bg-[rgb(var(--sui-scrim)/var(--sui-scrim-alpha))] px-4 pt-(--sui-dialog-offset) pb-4'\n \"\n >\n <DialogContent\n v-if=\"sheet\"\n ref=\"panel\"\n :aria-describedby=\"undefined\"\n class=\"relative flex max-h-[calc(100dvh-1.5rem)] w-full flex-col rounded-t-(--sui-radius-sheet) border border-b-0 border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-sheet-out data-[state=open]:animate-sui-sheet-in motion-reduce:animate-none motion-reduce:transition-none\"\n :class=\"!drag.dragging.value && 'transition-transform duration-[250ms] ease-[cubic-bezier(0.32,0.72,0,1)]'\"\n :style=\"drag.style.value\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside=\"onOutside\"\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <!-- Without a close button, keyboard and screen-reader users still get one: it shows when focused. -->\n <button\n v-if=\"!closable\"\n class=\"pointer-events-none absolute top-2 right-3 h-7 rounded-md bg-sui-fill px-2.5 text-13 font-medium text-sui-ink opacity-0 outline-hidden focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:sui-ring\"\n type=\"button\"\n @click=\"cancel\"\n >\n {{ closeLabel }}\n </button>\n <div class=\"shrink-0 cursor-grab touch-none pt-2\" data-modal-header v-bind=\"drag.handlers\">\n <span aria-hidden=\"true\" class=\"mx-auto block h-1 w-9 rounded-full bg-sui-mark-faint\" />\n <div v-if=\"!headerless\" class=\"flex min-h-11 items-center justify-between gap-3 pt-2 pr-4 pb-1 pl-5\">\n <div class=\"flex min-w-0 items-center gap-1\">\n <template v-if=\"hasContext\">\n <slot name=\"context\" />\n <ContextSeparator />\n </template>\n <DialogTitle class=\"min-w-0 truncate text-base font-semibold text-sui-ink\">\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n </div>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-subtle stroke-sui-ink-subtle\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n </div>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-2 pb-5 text-sm leading-5 text-sui-ink-emphasis\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 flex-col gap-2.5 border-t border-sui-fill-line bg-sui-raised px-4 pt-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <div v-if=\"$slots['footer-start'] || hint\" class=\"flex min-w-0 items-center justify-center gap-2\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n </div>\n <Button\n class=\"w-full\"\n :disabled=\"confirmDisabled\"\n size=\"lg\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n <DialogContent\n v-else\n :aria-describedby=\"undefined\"\n class=\"flex max-h-[calc(100dvh-var(--sui-dialog-offset)-1rem)] w-full flex-col border border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-dialog-out data-[state=open]:animate-sui-dialog-in\"\n :class=\"[width, banded ? 'rounded-2xl' : 'rounded-xl']\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside.prevent\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <div\n v-if=\"banded\"\n class=\"shrink-0 rounded-t-2xl pt-3.5 pr-3.5 pb-4.5 pl-5 transition-colors duration-200\"\n data-modal-header\n :style=\"{ backgroundColor: bandColour }\"\n >\n <div class=\"flex items-center justify-between gap-3\">\n <DialogTitle class=\"text-13 leading-5 font-medium text-sui-ink-body\">{{ title }}</DialogTitle>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <div v-if=\"$slots.hero\" class=\"mt-0.5 flex flex-col items-center gap-1.5 pr-1.5\">\n <slot name=\"hero\" />\n </div>\n </div>\n <div\n v-else-if=\"!headerless\"\n class=\"flex shrink-0 items-center justify-between gap-3 pt-3 pr-3 pl-4 text-sui-ink\"\n data-modal-header\n >\n <div class=\"flex min-h-7 min-w-0 items-center gap-1\">\n <template v-if=\"hasContext\">\n <slot name=\"context\" />\n <ContextSeparator />\n </template>\n <DialogTitle\n class=\"min-w-0 truncate text-sm font-semibold text-sui-ink\"\n :class=\"hasContext ? '' : 'pl-1'\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n </div>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n\n <div\n class=\"overflow-y-auto text-sm text-sui-ink-emphasis\"\n :class=\"[\n banded ? 'px-5 pt-0.5 pb-4' : headerless ? 'p-5' : 'px-5 pt-3.5 pb-5',\n !hasFooter && (banded ? 'rounded-b-2xl' : 'rounded-b-xl')\n ]\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 items-center gap-2.5 text-sui-ink\"\n :class=\"banded ? 'rounded-b-2xl py-3 pr-4 pl-5' : 'rounded-b-xl px-4 pt-1 pb-4 pl-5'\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n <span class=\"flex-1\" />\n <span v-if=\"confirmLabel\" aria-hidden=\"true\" class=\"flex shrink-0 items-center gap-1\">\n <Kbd>{{ modKey }}</Kbd\n ><Kbd>↵</Kbd>\n </span>\n <Button\n v-if=\"confirmLabel\"\n :aria-keyshortcuts=\"modKey === '⌘' ? 'Meta+Enter' : 'Control+Enter'\"\n :disabled=\"confirmDisabled\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n </DialogOverlay>\n </DialogPortal>\n </DialogRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,IAAM+C,IAAQC,GAeRC,IAAOH,GAEPI,IAAOjD,GAAoB+C,GAAC,MAA0B,GAEtDI,IAAQC,GAAS,GACjBC,IAAaC,QAAe,CAAC,CAACH,EAAM,OAAO,GAC3CI,IAASC,EAAY,GACrBC,IAAYH,QAAe,CAAC,CAACH,EAAM,UAAU,CAAC,CAACL,EAAM,YAAY,GACjEY,IAASJ,QAAe,CAAC,CAACR,EAAM,QAAQ,CAA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KH,EAAA,CAAC,mDACEoD,EAAA,QAAM,iCAAA,kCAAA,CAAA;QACd,qBAAA;O,IAEA3C,EAmBO0F,EAAA,QAAA,UAAA,CAAA,SAAA;QAlBL1F,EAA4B0F,EAAA,QAAA,cAAA;QAChB1D,EAAA,QAAZ9C,EAAA,GAAAQ,EAAuF,QAAvF+B,GAAuF9B,EAAdqC,EAAA,IAAI,GAAA,CAAA,K;QAC7E,AAAAsC,EAAA,OAAAzE,EAAuB,QAAA,EAAjB,OAAM,SAAQ,GAAA,MAAA,EAAA;QACRmC,EAAA,gBAAZ9C,EAAA,GAAAQ,EAGO,QAHPgC,GAGO,CAFLpC,EACCkB,GAAA,MAAA;SADI,SAAAnB,QAAY,CAATa,EAAAP,EAAAP,EAAAoD,CAAA,CAAM,GAAA,CAAA,C;;Q,IACblD,EAAYkB,GAAA,MAAA;SAAP,SAAAnB,QAAC,CAAA,GAAA,AAAAiF,EAAA,OAAA,CAADpE,EAAA,KAAC,EAAA,C;;;QAGD8B,EAAA,gBADR9C,EAAA,GAAAC,EAUSiB,GAAA;;SARN,qBAAmBhB,EAAAoD,CAAA,MAAM,MAAA,eAAA;SACzB,UAAUR,EAAA;SACX,MAAK;SACJ,SAASA,EAAA;SACT,SAAK,AAAAsC,EAAA,QAAA,MAAErC,EAAI,SAAA;;SAEZ,SAAA5C,QAAoF,CAAxE2C,EAAA,eAAZ9C,EAAA,GAAAC,EAAoFmB,GAAA;;UAA1D,OAAOwD,EAAY9B,EAAA;UAAkB,MAAMA,EAAA;S,6CAAe9B,EAAA,MACpFP,EAAGqC,EAAA,YAAY,GAAA,CAAA,C"}
|
|
@@ -30,12 +30,12 @@ declare const __VLS_base: import("vue").DefineComponent<DropdownMenuProps, {}, {
|
|
|
30
30
|
onHide?: (() => any) | undefined;
|
|
31
31
|
}>, {
|
|
32
32
|
align: "start" | "end";
|
|
33
|
-
confirmLabel: string;
|
|
34
|
-
cancelLabel: string;
|
|
35
33
|
id: string;
|
|
36
34
|
confirmTitle: string;
|
|
37
35
|
confirmMessage: string;
|
|
36
|
+
confirmLabel: string;
|
|
38
37
|
deleteLabel: string;
|
|
38
|
+
cancelLabel: string;
|
|
39
39
|
items: DropdownMenuEntry[];
|
|
40
40
|
buttonIcon: string;
|
|
41
41
|
buttonLabel: string;
|
|
@@ -42,23 +42,23 @@ type __VLS_ModelProps = {
|
|
|
42
42
|
};
|
|
43
43
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
44
44
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
-
"update:modelValue": (value: FilterValue) => any;
|
|
46
45
|
"update:open": (value: boolean) => any;
|
|
46
|
+
"update:modelValue": (value: FilterValue) => any;
|
|
47
47
|
"update:op": (value: string | undefined) => any;
|
|
48
48
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
49
|
-
"onUpdate:modelValue"?: ((value: FilterValue) => any) | undefined;
|
|
50
49
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
50
|
+
"onUpdate:modelValue"?: ((value: FilterValue) => any) | undefined;
|
|
51
51
|
"onUpdate:op"?: ((value: string | undefined) => any) | undefined;
|
|
52
52
|
}>, {
|
|
53
53
|
type: FilterFieldType;
|
|
54
54
|
summary: FilterSummary;
|
|
55
55
|
icon: string;
|
|
56
|
+
options: FilterOption[];
|
|
56
57
|
closeLabel: string;
|
|
57
58
|
status: string;
|
|
58
59
|
searchPlaceholder: string;
|
|
59
60
|
addLabel: string;
|
|
60
61
|
field: string;
|
|
61
|
-
options: FilterOption[];
|
|
62
62
|
doneLabel: string;
|
|
63
63
|
removeLabel: string;
|
|
64
64
|
onRemove: () => void;
|
|
@@ -36,17 +36,17 @@ type __VLS_ModelProps = {
|
|
|
36
36
|
};
|
|
37
37
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
38
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
-
pick: (name: string) => any;
|
|
40
39
|
"update:open": (value: boolean) => any;
|
|
40
|
+
pick: (name: string) => any;
|
|
41
41
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
42
|
-
onPick?: ((name: string) => any) | undefined;
|
|
43
42
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
43
|
+
onPick?: ((name: string) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
variant: "secondary" | "tinted" | "ghost";
|
|
46
46
|
as: "button" | "chip";
|
|
47
47
|
label: string;
|
|
48
|
-
closeLabel: string;
|
|
49
48
|
buttonLabel: string;
|
|
49
|
+
closeLabel: string;
|
|
50
50
|
status: string;
|
|
51
51
|
inUse: string[];
|
|
52
52
|
searchPlaceholder: string;
|
|
@@ -36,18 +36,18 @@ type __VLS_ModelProps = {
|
|
|
36
36
|
};
|
|
37
37
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
38
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
-
"update:modelValue": (value: ViewSort | null) => any;
|
|
40
39
|
"update:open": (value: boolean) => any;
|
|
40
|
+
"update:modelValue": (value: ViewSort | null) => any;
|
|
41
41
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
42
|
-
"onUpdate:modelValue"?: ((value: ViewSort | null) => any) | undefined;
|
|
43
42
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
43
|
+
"onUpdate:modelValue"?: ((value: ViewSort | null) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
variant: "secondary" | "tinted" | "ghost";
|
|
46
46
|
as: "button" | "chip";
|
|
47
47
|
title: string;
|
|
48
|
+
buttonLabel: string;
|
|
48
49
|
clearLabel: string;
|
|
49
50
|
closeLabel: string;
|
|
50
|
-
buttonLabel: string;
|
|
51
51
|
status: string;
|
|
52
52
|
directionLabels: Partial<Record<FilterFieldType, [string, string]>>;
|
|
53
53
|
directionLabel: string;
|
|
@@ -21,8 +21,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
21
21
|
"onUpdate:modelValue"?: ((value: SelectValue | null) => any) | undefined;
|
|
22
22
|
}>, {
|
|
23
23
|
variant: "text" | "select" | "title" | "multiline";
|
|
24
|
-
placeholder: string;
|
|
25
24
|
options: SelectOption<SelectValue>[];
|
|
25
|
+
placeholder: string;
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
28
28
|
export default _default;
|
|
@@ -22,9 +22,9 @@ declare const __VLS_export: import("vue").DefineComponent<ToastMessageProps, {},
|
|
|
22
22
|
onExpire?: (() => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
24
|
actions: ToastAction[];
|
|
25
|
-
detail: string;
|
|
26
25
|
closable: boolean;
|
|
27
26
|
closeLabel: string;
|
|
27
|
+
detail: string;
|
|
28
28
|
life: number;
|
|
29
29
|
severity: ToastSeverity;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -30,8 +30,8 @@ declare const __VLS_export: import("vue").DefineComponent<ToasterProps, {}, {},
|
|
|
30
30
|
onClose?: ((id: string | number, reason: ToastDismissReason) => any) | undefined;
|
|
31
31
|
}>, {
|
|
32
32
|
label: string;
|
|
33
|
-
closeLabel: string;
|
|
34
33
|
position: ToasterPosition;
|
|
34
|
+
closeLabel: string;
|
|
35
35
|
preview: ToastPreview[];
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
37
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Dragging an item between zones (a Board's columns, a DataList's groups) on pointer events, so it works with a mouse,
|
|
4
|
+
* a pen and a finger. A mouse drags once it moves a few pixels, so a click still clicks; a finger after a short press,
|
|
5
|
+
* so a swipe still scrolls. A copy of the item follows the pointer; Escape puts it back.
|
|
6
|
+
*
|
|
7
|
+
* Zones carry `data-drag-zone="<id>"` and items `data-drag-index="<i>"` inside them.
|
|
8
|
+
*/
|
|
9
|
+
export interface DragMoveOptions {
|
|
10
|
+
root: Ref<HTMLElement | null | undefined>;
|
|
11
|
+
/** How many items a zone holds, for a drop past its last one. */
|
|
12
|
+
countOf: (zone: string) => number;
|
|
13
|
+
/** Items also reorder within their zone. */
|
|
14
|
+
sortable?: () => boolean;
|
|
15
|
+
onMove: (id: unknown, zone: string, index: number) => void;
|
|
16
|
+
/** Extra inline style for the copy that follows the pointer, e.g. a ground for a row that has none of its own. */
|
|
17
|
+
ghostStyle?: Partial<CSSStyleDeclaration>;
|
|
18
|
+
/** The copy's widest, so a full-width row follows the pointer as a compact line. */
|
|
19
|
+
ghostMaxWidth?: number;
|
|
20
|
+
/** The copy leans a little, as a card picked up does; off for rows. */
|
|
21
|
+
tilt?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function useDragMove(options: DragMoveOptions): {
|
|
24
|
+
dragged: Ref<{
|
|
25
|
+
id: unknown;
|
|
26
|
+
zone: string;
|
|
27
|
+
index: number;
|
|
28
|
+
} | null, {
|
|
29
|
+
id: unknown;
|
|
30
|
+
zone: string;
|
|
31
|
+
index: number;
|
|
32
|
+
} | {
|
|
33
|
+
id: unknown;
|
|
34
|
+
zone: string;
|
|
35
|
+
index: number;
|
|
36
|
+
} | null>;
|
|
37
|
+
target: Ref<{
|
|
38
|
+
zone: string;
|
|
39
|
+
index: number;
|
|
40
|
+
} | null, {
|
|
41
|
+
zone: string;
|
|
42
|
+
index: number;
|
|
43
|
+
} | {
|
|
44
|
+
zone: string;
|
|
45
|
+
index: number;
|
|
46
|
+
} | null>;
|
|
47
|
+
onPointerDown: (event: PointerEvent, id: unknown, zone: string, index: number) => void;
|
|
48
|
+
/** The click that ended a drag, to ignore. */
|
|
49
|
+
endedDrag: () => boolean;
|
|
50
|
+
};
|