@vuetify/nightly 3.7.5-master.2024-12-15 → 3.7.5-master.2024-12-16
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/json/attributes.json +3125 -3125
- package/dist/json/importMap-labs.json +36 -36
- package/dist/json/importMap.json +174 -174
- package/dist/json/web-types.json +5732 -5732
- package/dist/vuetify-labs.css +3259 -3259
- package/dist/vuetify-labs.esm.js +15 -9
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +15 -9
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +3608 -3608
- package/dist/vuetify.d.ts +63 -63
- package/dist/vuetify.esm.js +15 -9
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +15 -9
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +33 -33
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +2 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +2 -1
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.mjs +2 -1
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +4 -2
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/virtual.mjs +3 -2
- package/lib/composables/virtual.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +63 -63
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VSelect.mjs","names":["VDialogTransition","VAvatar","VCheckboxBtn","VChip","VDefaultsProvider","VIcon","VList","VListItem","VMenu","makeVTextFieldProps","VTextField","VVirtualScroll","useScrolling","useForm","forwardRefs","IconValue","makeItemsProps","useItems","useLocale","useProxiedModel","makeTransitionProps","computed","mergeProps","nextTick","ref","shallowRef","watch","checkPrintable","ensureValidVNode","genericComponent","IN_BROWSER","matchesSelector","omit","propsFactory","useRender","wrapInArray","makeSelectProps","chips","Boolean","closableChips","closeText","type","String","default","openText","eager","hideNoData","hideSelected","listProps","Object","menu","menuIcon","menuProps","multiple","noDataText","openOnClear","itemColor","itemChildren","makeVSelectProps","modelValue","role","transition","component","VSelect","name","props","emits","focused","value","ue","setup","_ref","slots","t","vTextFieldRef","vMenuRef","vVirtualScrollRef","_menu","get","set","v","ΨopenChildren","size","items","transformIn","transformOut","model","transformed","counterValue","length","form","selectedValues","map","selection","isFocused","label","keyboardLookupPrefix","keyboardLookupLastTime","displayItems","filter","item","some","s","valueComparator","menuDisabled","isReadonly","isDisabled","computedMenuProps","activatorProps","listRef","listEvents","onClear","e","onMousedownControl","onListKeydown","onKeydown","key","includes","preventDefault","focus","KEYBOARD_LOOKUP_THRESHOLD","now","performance","toLowerCase","find","title","startsWith","undefined","index","indexOf","window","requestAnimationFrame","scrollToIndex","select","arguments","disabled","findIndex","add","splice","onBlur","$el","contains","relatedTarget","onAfterEnter","calculateVisibleItems","onAfterLeave","onFocusin","onModelUpdate","newVal","oldVal","hasChips","chip","hasList","isDirty","textFieldProps","filterProps","placeholder","persistentPlaceholder","_createVNode","_mergeProps","join","$event","externalValue","class","style","_Fragment","color","_ref2","itemRef","itemProps","onClick","prepend","_ref3","isSelected","prependAvatar","prependIcon","onChipClose","stopPropagation","slotProps","onMousedown","hasSlot","slotContent","closable","text","_createTextVNode","append-inner","_len","args","Array","_key"],"sources":["../../../src/components/VSelect/VSelect.tsx"],"sourcesContent":["// Styles\nimport './VSelect.sass'\n\n// Components\nimport { VDialogTransition } from '@/components/transitions'\nimport { VAvatar } from '@/components/VAvatar'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\nimport { VChip } from '@/components/VChip'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { VIcon } from '@/components/VIcon'\nimport { VList, VListItem } from '@/components/VList'\nimport { VMenu } from '@/components/VMenu'\nimport { makeVTextFieldProps, VTextField } from '@/components/VTextField/VTextField'\nimport { VVirtualScroll } from '@/components/VVirtualScroll'\n\n// Composables\nimport { useScrolling } from './useScrolling'\nimport { useForm } from '@/composables/form'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { IconValue } from '@/composables/icons'\nimport { makeItemsProps, useItems } from '@/composables/list-items'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeTransitionProps } from '@/composables/transition'\n\n// Utilities\nimport { computed, mergeProps, nextTick, ref, shallowRef, watch } from 'vue'\nimport {\n checkPrintable,\n ensureValidVNode,\n genericComponent,\n IN_BROWSER,\n matchesSelector,\n omit,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { Component, PropType } from 'vue'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps, SelectItemKey } from '@/util'\n\ntype Primitive = string | number | boolean | symbol\n\ntype Val <T, ReturnObject extends boolean> = [T] extends [Primitive]\n ? T\n : (ReturnObject extends true ? T : any)\n\ntype Value <T, ReturnObject extends boolean, Multiple extends boolean> =\n Multiple extends true\n ? readonly Val<T, ReturnObject>[]\n : Val<T, ReturnObject> | null\n\nexport const makeSelectProps = propsFactory({\n chips: Boolean,\n closableChips: Boolean,\n closeText: {\n type: String,\n default: '$vuetify.close',\n },\n openText: {\n type: String,\n default: '$vuetify.open',\n },\n eager: Boolean,\n hideNoData: Boolean,\n hideSelected: Boolean,\n listProps: {\n type: Object as PropType<VList['$props']>,\n },\n menu: Boolean,\n menuIcon: {\n type: IconValue,\n default: '$dropdown',\n },\n menuProps: {\n type: Object as PropType<VMenu['$props']>,\n },\n multiple: Boolean,\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n openOnClear: Boolean,\n itemColor: String,\n\n ...makeItemsProps({ itemChildren: false }),\n}, 'Select')\n\nexport const makeVSelectProps = propsFactory({\n ...makeSelectProps(),\n ...omit(makeVTextFieldProps({\n modelValue: null,\n role: 'combobox',\n }), ['validationValue', 'dirty', 'appendInnerIcon']),\n ...makeTransitionProps({ transition: { component: VDialogTransition as Component } }),\n}, 'VSelect')\n\ntype ItemType<T> = T extends readonly (infer U)[] ? U : never\n\nexport const VSelect = genericComponent<new <\n T extends readonly any[],\n Item = ItemType<T>,\n ReturnObject extends boolean = false,\n Multiple extends boolean = false,\n V extends Value<Item, ReturnObject, Multiple> = Value<Item, ReturnObject, Multiple>\n>(\n props: {\n items?: T\n itemTitle?: SelectItemKey<ItemType<T>>\n itemValue?: SelectItemKey<ItemType<T>>\n itemProps?: SelectItemKey<ItemType<T>>\n returnObject?: ReturnObject\n multiple?: Multiple\n modelValue?: V | null\n 'onUpdate:modelValue'?: (value: V) => void\n },\n slots: Omit<VInputSlots & VFieldSlots, 'default'> & {\n item: { item: ListItem<Item>, index: number, props: Record<string, unknown> }\n chip: { item: ListItem<Item>, index: number, props: Record<string, unknown> }\n selection: { item: ListItem<Item>, index: number }\n 'prepend-item': never\n 'append-item': never\n 'no-data': never\n }\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelect',\n\n props: makeVSelectProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:menu': (ue: boolean) => true,\n },\n\n setup (props, { slots }) {\n const { t } = useLocale()\n const vTextFieldRef = ref()\n const vMenuRef = ref<VMenu>()\n const vVirtualScrollRef = ref<VVirtualScroll>()\n const _menu = useProxiedModel(props, 'menu')\n const menu = computed({\n get: () => _menu.value,\n set: v => {\n if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return\n _menu.value = v\n },\n })\n const { items, transformIn, transformOut } = useItems(props)\n const model = useProxiedModel(\n props,\n 'modelValue',\n [],\n v => transformIn(v === null ? [null] : wrapInArray(v)),\n v => {\n const transformed = transformOut(v)\n return props.multiple ? transformed : (transformed[0] ?? null)\n }\n )\n const counterValue = computed(() => {\n return typeof props.counterValue === 'function' ? props.counterValue(model.value)\n : typeof props.counterValue === 'number' ? props.counterValue\n : model.value.length\n })\n const form = useForm(props)\n const selectedValues = computed(() => model.value.map(selection => selection.value))\n const isFocused = shallowRef(false)\n const label = computed(() => menu.value ? props.closeText : props.openText)\n\n let keyboardLookupPrefix = ''\n let keyboardLookupLastTime: number\n\n const displayItems = computed(() => {\n if (props.hideSelected) {\n return items.value.filter(item => !model.value.some(s => props.valueComparator(s, item)))\n }\n return items.value\n })\n\n const menuDisabled = computed(() => (\n (props.hideNoData && !displayItems.value.length) ||\n form.isReadonly.value || form.isDisabled.value\n ))\n\n const computedMenuProps = computed(() => {\n return {\n ...props.menuProps,\n activatorProps: {\n ...(props.menuProps?.activatorProps || {}),\n 'aria-haspopup': 'listbox', // Set aria-haspopup to 'listbox'\n },\n }\n })\n\n const listRef = ref<VList>()\n const listEvents = useScrolling(listRef, vTextFieldRef)\n function onClear (e: MouseEvent) {\n if (props.openOnClear) {\n menu.value = true\n }\n }\n function onMousedownControl () {\n if (menuDisabled.value) return\n\n menu.value = !menu.value\n }\n function onListKeydown (e: KeyboardEvent) {\n if (checkPrintable(e)) {\n onKeydown(e)\n }\n }\n function onKeydown (e: KeyboardEvent) {\n if (!e.key || form.isReadonly.value) return\n\n if (['Enter', ' ', 'ArrowDown', 'ArrowUp', 'Home', 'End'].includes(e.key)) {\n e.preventDefault()\n }\n\n if (['Enter', 'ArrowDown', ' '].includes(e.key)) {\n menu.value = true\n }\n\n if (['Escape', 'Tab'].includes(e.key)) {\n menu.value = false\n }\n\n if (e.key === 'Home') {\n listRef.value?.focus('first')\n } else if (e.key === 'End') {\n listRef.value?.focus('last')\n }\n\n // html select hotkeys\n const KEYBOARD_LOOKUP_THRESHOLD = 1000 // milliseconds\n\n if (props.multiple || !checkPrintable(e)) return\n\n const now = performance.now()\n if (now - keyboardLookupLastTime > KEYBOARD_LOOKUP_THRESHOLD) {\n keyboardLookupPrefix = ''\n }\n keyboardLookupPrefix += e.key.toLowerCase()\n keyboardLookupLastTime = now\n\n const item = items.value.find(item => item.title.toLowerCase().startsWith(keyboardLookupPrefix))\n if (item !== undefined) {\n model.value = [item]\n const index = displayItems.value.indexOf(item)\n IN_BROWSER && window.requestAnimationFrame(() => {\n index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index)\n })\n }\n }\n\n /** @param set - null means toggle */\n function select (item: ListItem, set: boolean | null = true) {\n if (item.props.disabled) return\n\n if (props.multiple) {\n const index = model.value.findIndex(selection => props.valueComparator(selection.value, item.value))\n const add = set == null ? !~index : set\n\n if (~index) {\n const value = add ? [...model.value, item] : [...model.value]\n value.splice(index, 1)\n model.value = value\n } else if (add) {\n model.value = [...model.value, item]\n }\n } else {\n const add = set !== false\n model.value = add ? [item] : []\n\n nextTick(() => {\n menu.value = false\n })\n }\n }\n function onBlur (e: FocusEvent) {\n if (!listRef.value?.$el.contains(e.relatedTarget as HTMLElement)) {\n menu.value = false\n }\n }\n function onAfterEnter () {\n if (props.eager) {\n vVirtualScrollRef.value?.calculateVisibleItems()\n }\n }\n function onAfterLeave () {\n if (isFocused.value) {\n vTextFieldRef.value?.focus()\n }\n }\n function onFocusin (e: FocusEvent) {\n isFocused.value = true\n }\n function onModelUpdate (v: any) {\n if (v == null) model.value = []\n else if (matchesSelector(vTextFieldRef.value, ':autofill') || matchesSelector(vTextFieldRef.value, ':-webkit-autofill')) {\n const item = items.value.find(item => item.title === v)\n if (item) {\n select(item)\n }\n } else if (vTextFieldRef.value) {\n vTextFieldRef.value.value = ''\n }\n }\n\n watch(menu, () => {\n if (!props.hideSelected && menu.value && model.value.length) {\n const index = displayItems.value.findIndex(\n item => model.value.some(s => props.valueComparator(s.value, item.value))\n )\n IN_BROWSER && window.requestAnimationFrame(() => {\n index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index)\n })\n }\n })\n\n watch(() => props.items, (newVal, oldVal) => {\n if (menu.value) return\n\n if (isFocused.value && !oldVal.length && newVal.length) {\n menu.value = true\n }\n })\n\n useRender(() => {\n const hasChips = !!(props.chips || slots.chip)\n const hasList = !!(\n (!props.hideNoData || displayItems.value.length) ||\n slots['prepend-item'] ||\n slots['append-item'] ||\n slots['no-data']\n )\n const isDirty = model.value.length > 0\n const textFieldProps = VTextField.filterProps(props)\n\n const placeholder = isDirty || (\n !isFocused.value &&\n props.label &&\n !props.persistentPlaceholder\n ) ? undefined : props.placeholder\n\n return (\n <VTextField\n ref={ vTextFieldRef }\n { ...textFieldProps }\n modelValue={ model.value.map(v => v.props.value).join(', ') }\n onUpdate:modelValue={ onModelUpdate }\n v-model:focused={ isFocused.value }\n validationValue={ model.externalValue }\n counterValue={ counterValue.value }\n dirty={ isDirty }\n class={[\n 'v-select',\n {\n 'v-select--active-menu': menu.value,\n 'v-select--chips': !!props.chips,\n [`v-select--${props.multiple ? 'multiple' : 'single'}`]: true,\n 'v-select--selected': model.value.length,\n 'v-select--selection-slot': !!slots.selection,\n },\n props.class,\n ]}\n style={ props.style }\n inputmode=\"none\"\n placeholder={ placeholder }\n onClick:clear={ onClear }\n onMousedown:control={ onMousedownControl }\n onBlur={ onBlur }\n onKeydown={ onKeydown }\n aria-label={ t(label.value) }\n title={ t(label.value) }\n >\n {{\n ...slots,\n default: () => (\n <>\n <VMenu\n ref={ vMenuRef }\n v-model={ menu.value }\n activator=\"parent\"\n contentClass=\"v-select__content\"\n disabled={ menuDisabled.value }\n eager={ props.eager }\n maxHeight={ 310 }\n openOnClick={ false }\n closeOnContentClick={ false }\n transition={ props.transition }\n onAfterEnter={ onAfterEnter }\n onAfterLeave={ onAfterLeave }\n { ...computedMenuProps.value }\n >\n { hasList && (\n <VList\n ref={ listRef }\n selected={ selectedValues.value }\n selectStrategy={ props.multiple ? 'independent' : 'single-independent' }\n onMousedown={ (e: MouseEvent) => e.preventDefault() }\n onKeydown={ onListKeydown }\n onFocusin={ onFocusin }\n tabindex=\"-1\"\n aria-live=\"polite\"\n color={ props.itemColor ?? props.color }\n { ...listEvents }\n { ...props.listProps }\n >\n { slots['prepend-item']?.() }\n\n { !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? (\n <VListItem title={ t(props.noDataText) } />\n ))}\n\n <VVirtualScroll ref={ vVirtualScrollRef } renderless items={ displayItems.value }>\n { ({ item, index, itemRef }) => {\n const itemProps = mergeProps(item.props, {\n ref: itemRef,\n key: index,\n onClick: () => select(item, null),\n })\n\n return slots.item?.({\n item,\n index,\n props: itemProps,\n }) ?? (\n <VListItem { ...itemProps } role=\"option\">\n {{\n prepend: ({ isSelected }) => (\n <>\n { props.multiple && !props.hideSelected ? (\n <VCheckboxBtn\n key={ item.value }\n modelValue={ isSelected }\n ripple={ false }\n tabindex=\"-1\"\n />\n ) : undefined }\n\n { item.props.prependAvatar && (\n <VAvatar image={ item.props.prependAvatar } />\n )}\n\n { item.props.prependIcon && (\n <VIcon icon={ item.props.prependIcon } />\n )}\n </>\n ),\n }}\n </VListItem>\n )\n }}\n </VVirtualScroll>\n\n { slots['append-item']?.() }\n </VList>\n )}\n </VMenu>\n\n { model.value.map((item, index) => {\n function onChipClose (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n\n select(item, false)\n }\n\n const slotProps = {\n 'onClick:close': onChipClose,\n onKeydown (e: KeyboardEvent) {\n if (e.key !== 'Enter' && e.key !== ' ') return\n\n e.preventDefault()\n e.stopPropagation()\n\n onChipClose(e)\n },\n onMousedown (e: MouseEvent) {\n e.preventDefault()\n e.stopPropagation()\n },\n modelValue: true,\n 'onUpdate:modelValue': undefined,\n }\n\n const hasSlot = hasChips ? !!slots.chip : !!slots.selection\n const slotContent = hasSlot\n ? ensureValidVNode(\n hasChips\n ? slots.chip!({ item, index, props: slotProps })\n : slots.selection!({ item, index })\n )\n : undefined\n\n if (hasSlot && !slotContent) return undefined\n\n return (\n <div key={ item.value } class=\"v-select__selection\">\n { hasChips ? (\n !slots.chip ? (\n <VChip\n key=\"chip\"\n closable={ props.closableChips }\n size=\"small\"\n text={ item.title }\n disabled={ item.props.disabled }\n { ...slotProps }\n />\n ) : (\n <VDefaultsProvider\n key=\"chip-defaults\"\n defaults={{\n VChip: {\n closable: props.closableChips,\n size: 'small',\n text: item.title,\n },\n }}\n >\n { slotContent }\n </VDefaultsProvider>\n )\n ) : (\n slotContent ?? (\n <span class=\"v-select__selection-text\">\n { item.title }\n { props.multiple && (index < model.value.length - 1) && (\n <span class=\"v-select__selection-comma\">,</span>\n )}\n </span>\n )\n )}\n </div>\n )\n })}\n </>\n ),\n 'append-inner': (...args) => (\n <>\n { slots['append-inner']?.(...args) }\n { props.menuIcon ? (\n <VIcon\n class=\"v-select__menu-icon\"\n icon={ props.menuIcon }\n />\n ) : undefined }\n </>\n ),\n }}\n </VTextField>\n )\n })\n\n return forwardRefs({\n isFocused,\n menu,\n select,\n }, vTextFieldRef)\n },\n})\n\nexport type VSelect = InstanceType<typeof VSelect>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,iBAAiB;AAAA,SACjBC,OAAO;AAAA,SACPC,YAAY;AAAA,SACZC,KAAK;AAAA,SACLC,iBAAiB;AAAA,SACjBC,KAAK;AAAA,SACLC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAAA,SACLC,mBAAmB,EAAEC,UAAU;AAAA,SAC/BC,cAAc,uCAEvB;AAAA,SACSC,YAAY;AAAA,SACZC,OAAO;AAAA,SACPC,WAAW;AAAA,SACXC,SAAS;AAAA,SACTC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,SAAS;AAAA,SACTC,eAAe;AAAA,SACfC,mBAAmB,4CAE5B;AACA,SAASC,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAE1EC,cAAc,EACd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AC,CAAC;IAEF,OAAOjH,WAAW,CAAC;MACjBgF,SAAS;MACT5C,IAAI;MACJmF;IACF,CAAC,EAAE3D,aAAa,CAAC;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"VSelect.mjs","names":["VDialogTransition","VAvatar","VCheckboxBtn","VChip","VDefaultsProvider","VIcon","VList","VListItem","VMenu","makeVTextFieldProps","VTextField","VVirtualScroll","useScrolling","useForm","forwardRefs","IconValue","makeItemsProps","useItems","useLocale","useProxiedModel","makeTransitionProps","computed","mergeProps","nextTick","ref","shallowRef","watch","checkPrintable","ensureValidVNode","genericComponent","IN_BROWSER","matchesSelector","omit","propsFactory","useRender","wrapInArray","makeSelectProps","chips","Boolean","closableChips","closeText","type","String","default","openText","eager","hideNoData","hideSelected","listProps","Object","menu","menuIcon","menuProps","multiple","noDataText","openOnClear","itemColor","itemChildren","makeVSelectProps","modelValue","role","transition","component","VSelect","name","props","emits","focused","value","ue","setup","_ref","slots","t","vTextFieldRef","vMenuRef","vVirtualScrollRef","_menu","get","set","v","ΨopenChildren","size","items","transformIn","transformOut","model","transformed","counterValue","length","form","selectedValues","map","selection","isFocused","label","keyboardLookupPrefix","keyboardLookupLastTime","displayItems","filter","item","some","s","valueComparator","menuDisabled","isReadonly","isDisabled","computedMenuProps","activatorProps","listRef","listEvents","onClear","e","onMousedownControl","onListKeydown","onKeydown","key","includes","preventDefault","focus","KEYBOARD_LOOKUP_THRESHOLD","now","performance","toLowerCase","find","title","startsWith","undefined","index","indexOf","window","requestAnimationFrame","scrollToIndex","select","arguments","disabled","findIndex","add","splice","onBlur","$el","contains","relatedTarget","onAfterEnter","calculateVisibleItems","onAfterLeave","onFocusin","onModelUpdate","newVal","oldVal","hasChips","chip","hasList","isDirty","textFieldProps","filterProps","placeholder","persistentPlaceholder","_createVNode","_mergeProps","join","$event","externalValue","class","style","_Fragment","color","_ref2","itemRef","itemProps","onClick","prepend","_ref3","isSelected","prependAvatar","prependIcon","onChipClose","stopPropagation","slotProps","onMousedown","hasSlot","slotContent","closable","text","_createTextVNode","append-inner","_len","args","Array","_key"],"sources":["../../../src/components/VSelect/VSelect.tsx"],"sourcesContent":["// Styles\nimport './VSelect.sass'\n\n// Components\nimport { VDialogTransition } from '@/components/transitions'\nimport { VAvatar } from '@/components/VAvatar'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\nimport { VChip } from '@/components/VChip'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { VIcon } from '@/components/VIcon'\nimport { VList, VListItem } from '@/components/VList'\nimport { VMenu } from '@/components/VMenu'\nimport { makeVTextFieldProps, VTextField } from '@/components/VTextField/VTextField'\nimport { VVirtualScroll } from '@/components/VVirtualScroll'\n\n// Composables\nimport { useScrolling } from './useScrolling'\nimport { useForm } from '@/composables/form'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { IconValue } from '@/composables/icons'\nimport { makeItemsProps, useItems } from '@/composables/list-items'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeTransitionProps } from '@/composables/transition'\n\n// Utilities\nimport { computed, mergeProps, nextTick, ref, shallowRef, watch } from 'vue'\nimport {\n checkPrintable,\n ensureValidVNode,\n genericComponent,\n IN_BROWSER,\n matchesSelector,\n omit,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { Component, PropType } from 'vue'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps, SelectItemKey } from '@/util'\n\ntype Primitive = string | number | boolean | symbol\n\ntype Val <T, ReturnObject extends boolean> = [T] extends [Primitive]\n ? T\n : (ReturnObject extends true ? T : any)\n\ntype Value <T, ReturnObject extends boolean, Multiple extends boolean> =\n Multiple extends true\n ? readonly Val<T, ReturnObject>[]\n : Val<T, ReturnObject> | null\n\nexport const makeSelectProps = propsFactory({\n chips: Boolean,\n closableChips: Boolean,\n closeText: {\n type: String,\n default: '$vuetify.close',\n },\n openText: {\n type: String,\n default: '$vuetify.open',\n },\n eager: Boolean,\n hideNoData: Boolean,\n hideSelected: Boolean,\n listProps: {\n type: Object as PropType<VList['$props']>,\n },\n menu: Boolean,\n menuIcon: {\n type: IconValue,\n default: '$dropdown',\n },\n menuProps: {\n type: Object as PropType<VMenu['$props']>,\n },\n multiple: Boolean,\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n openOnClear: Boolean,\n itemColor: String,\n\n ...makeItemsProps({ itemChildren: false }),\n}, 'Select')\n\nexport const makeVSelectProps = propsFactory({\n ...makeSelectProps(),\n ...omit(makeVTextFieldProps({\n modelValue: null,\n role: 'combobox',\n }), ['validationValue', 'dirty', 'appendInnerIcon']),\n ...makeTransitionProps({ transition: { component: VDialogTransition as Component } }),\n}, 'VSelect')\n\ntype ItemType<T> = T extends readonly (infer U)[] ? U : never\n\nexport const VSelect = genericComponent<new <\n T extends readonly any[],\n Item = ItemType<T>,\n ReturnObject extends boolean = false,\n Multiple extends boolean = false,\n V extends Value<Item, ReturnObject, Multiple> = Value<Item, ReturnObject, Multiple>\n>(\n props: {\n items?: T\n itemTitle?: SelectItemKey<ItemType<T>>\n itemValue?: SelectItemKey<ItemType<T>>\n itemProps?: SelectItemKey<ItemType<T>>\n returnObject?: ReturnObject\n multiple?: Multiple\n modelValue?: V | null\n 'onUpdate:modelValue'?: (value: V) => void\n },\n slots: Omit<VInputSlots & VFieldSlots, 'default'> & {\n item: { item: ListItem<Item>, index: number, props: Record<string, unknown> }\n chip: { item: ListItem<Item>, index: number, props: Record<string, unknown> }\n selection: { item: ListItem<Item>, index: number }\n 'prepend-item': never\n 'append-item': never\n 'no-data': never\n }\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelect',\n\n props: makeVSelectProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:menu': (ue: boolean) => true,\n },\n\n setup (props, { slots }) {\n const { t } = useLocale()\n const vTextFieldRef = ref()\n const vMenuRef = ref<VMenu>()\n const vVirtualScrollRef = ref<VVirtualScroll>()\n const _menu = useProxiedModel(props, 'menu')\n const menu = computed({\n get: () => _menu.value,\n set: v => {\n if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return\n _menu.value = v\n },\n })\n const { items, transformIn, transformOut } = useItems(props)\n const model = useProxiedModel(\n props,\n 'modelValue',\n [],\n v => transformIn(v === null ? [null] : wrapInArray(v)),\n v => {\n const transformed = transformOut(v)\n return props.multiple ? transformed : (transformed[0] ?? null)\n }\n )\n const counterValue = computed(() => {\n return typeof props.counterValue === 'function' ? props.counterValue(model.value)\n : typeof props.counterValue === 'number' ? props.counterValue\n : model.value.length\n })\n const form = useForm(props)\n const selectedValues = computed(() => model.value.map(selection => selection.value))\n const isFocused = shallowRef(false)\n const label = computed(() => menu.value ? props.closeText : props.openText)\n\n let keyboardLookupPrefix = ''\n let keyboardLookupLastTime: number\n\n const displayItems = computed(() => {\n if (props.hideSelected) {\n return items.value.filter(item => !model.value.some(s => props.valueComparator(s, item)))\n }\n return items.value\n })\n\n const menuDisabled = computed(() => (\n (props.hideNoData && !displayItems.value.length) ||\n form.isReadonly.value || form.isDisabled.value\n ))\n\n const computedMenuProps = computed(() => {\n return {\n ...props.menuProps,\n activatorProps: {\n ...(props.menuProps?.activatorProps || {}),\n 'aria-haspopup': 'listbox', // Set aria-haspopup to 'listbox'\n },\n }\n })\n\n const listRef = ref<VList>()\n const listEvents = useScrolling(listRef, vTextFieldRef)\n function onClear (e: MouseEvent) {\n if (props.openOnClear) {\n menu.value = true\n }\n }\n function onMousedownControl () {\n if (menuDisabled.value) return\n\n menu.value = !menu.value\n }\n function onListKeydown (e: KeyboardEvent) {\n if (checkPrintable(e)) {\n onKeydown(e)\n }\n }\n function onKeydown (e: KeyboardEvent) {\n if (!e.key || form.isReadonly.value) return\n\n if (['Enter', ' ', 'ArrowDown', 'ArrowUp', 'Home', 'End'].includes(e.key)) {\n e.preventDefault()\n }\n\n if (['Enter', 'ArrowDown', ' '].includes(e.key)) {\n menu.value = true\n }\n\n if (['Escape', 'Tab'].includes(e.key)) {\n menu.value = false\n }\n\n if (e.key === 'Home') {\n listRef.value?.focus('first')\n } else if (e.key === 'End') {\n listRef.value?.focus('last')\n }\n\n // html select hotkeys\n const KEYBOARD_LOOKUP_THRESHOLD = 1000 // milliseconds\n\n if (props.multiple || !checkPrintable(e)) return\n\n const now = performance.now()\n if (now - keyboardLookupLastTime > KEYBOARD_LOOKUP_THRESHOLD) {\n keyboardLookupPrefix = ''\n }\n keyboardLookupPrefix += e.key.toLowerCase()\n keyboardLookupLastTime = now\n\n const item = items.value.find(item => item.title.toLowerCase().startsWith(keyboardLookupPrefix))\n if (item !== undefined) {\n model.value = [item]\n const index = displayItems.value.indexOf(item)\n IN_BROWSER && window.requestAnimationFrame(() => {\n index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index)\n })\n }\n }\n\n /** @param set - null means toggle */\n function select (item: ListItem, set: boolean | null = true) {\n if (item.props.disabled) return\n\n if (props.multiple) {\n const index = model.value.findIndex(selection => props.valueComparator(selection.value, item.value))\n const add = set == null ? !~index : set\n\n if (~index) {\n const value = add ? [...model.value, item] : [...model.value]\n value.splice(index, 1)\n model.value = value\n } else if (add) {\n model.value = [...model.value, item]\n }\n } else {\n const add = set !== false\n model.value = add ? [item] : []\n\n nextTick(() => {\n menu.value = false\n })\n }\n }\n function onBlur (e: FocusEvent) {\n if (!listRef.value?.$el.contains(e.relatedTarget as HTMLElement)) {\n menu.value = false\n }\n }\n function onAfterEnter () {\n if (props.eager) {\n vVirtualScrollRef.value?.calculateVisibleItems()\n }\n }\n function onAfterLeave () {\n if (isFocused.value) {\n vTextFieldRef.value?.focus()\n }\n }\n function onFocusin (e: FocusEvent) {\n isFocused.value = true\n }\n function onModelUpdate (v: any) {\n if (v == null) model.value = []\n else if (matchesSelector(vTextFieldRef.value, ':autofill') || matchesSelector(vTextFieldRef.value, ':-webkit-autofill')) {\n const item = items.value.find(item => item.title === v)\n if (item) {\n select(item)\n }\n } else if (vTextFieldRef.value) {\n vTextFieldRef.value.value = ''\n }\n }\n\n watch(menu, () => {\n if (!props.hideSelected && menu.value && model.value.length) {\n const index = displayItems.value.findIndex(\n item => model.value.some(s => props.valueComparator(s.value, item.value))\n )\n IN_BROWSER && window.requestAnimationFrame(() => {\n index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index)\n })\n }\n })\n\n watch(() => props.items, (newVal, oldVal) => {\n if (menu.value) return\n\n if (isFocused.value && !oldVal.length && newVal.length) {\n menu.value = true\n }\n })\n\n useRender(() => {\n const hasChips = !!(props.chips || slots.chip)\n const hasList = !!(\n (!props.hideNoData || displayItems.value.length) ||\n slots['prepend-item'] ||\n slots['append-item'] ||\n slots['no-data']\n )\n const isDirty = model.value.length > 0\n const textFieldProps = VTextField.filterProps(props)\n\n const placeholder = isDirty || (\n !isFocused.value &&\n props.label &&\n !props.persistentPlaceholder\n ) ? undefined : props.placeholder\n\n return (\n <VTextField\n ref={ vTextFieldRef }\n { ...textFieldProps }\n modelValue={ model.value.map(v => v.props.value).join(', ') }\n onUpdate:modelValue={ onModelUpdate }\n v-model:focused={ isFocused.value }\n validationValue={ model.externalValue }\n counterValue={ counterValue.value }\n dirty={ isDirty }\n class={[\n 'v-select',\n {\n 'v-select--active-menu': menu.value,\n 'v-select--chips': !!props.chips,\n [`v-select--${props.multiple ? 'multiple' : 'single'}`]: true,\n 'v-select--selected': model.value.length,\n 'v-select--selection-slot': !!slots.selection,\n },\n props.class,\n ]}\n style={ props.style }\n inputmode=\"none\"\n placeholder={ placeholder }\n onClick:clear={ onClear }\n onMousedown:control={ onMousedownControl }\n onBlur={ onBlur }\n onKeydown={ onKeydown }\n aria-label={ t(label.value) }\n title={ t(label.value) }\n >\n {{\n ...slots,\n default: () => (\n <>\n <VMenu\n ref={ vMenuRef }\n v-model={ menu.value }\n activator=\"parent\"\n contentClass=\"v-select__content\"\n disabled={ menuDisabled.value }\n eager={ props.eager }\n maxHeight={ 310 }\n openOnClick={ false }\n closeOnContentClick={ false }\n transition={ props.transition }\n onAfterEnter={ onAfterEnter }\n onAfterLeave={ onAfterLeave }\n { ...computedMenuProps.value }\n >\n { hasList && (\n <VList\n ref={ listRef }\n selected={ selectedValues.value }\n selectStrategy={ props.multiple ? 'independent' : 'single-independent' }\n onMousedown={ (e: MouseEvent) => e.preventDefault() }\n onKeydown={ onListKeydown }\n onFocusin={ onFocusin }\n tabindex=\"-1\"\n aria-live=\"polite\"\n color={ props.itemColor ?? props.color }\n { ...listEvents }\n { ...props.listProps }\n >\n { slots['prepend-item']?.() }\n\n { !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? (\n <VListItem key=\"no-data\" title={ t(props.noDataText) } />\n ))}\n\n <VVirtualScroll ref={ vVirtualScrollRef } renderless items={ displayItems.value }>\n { ({ item, index, itemRef }) => {\n const itemProps = mergeProps(item.props, {\n ref: itemRef,\n key: item.value,\n onClick: () => select(item, null),\n })\n\n return slots.item?.({\n item,\n index,\n props: itemProps,\n }) ?? (\n <VListItem { ...itemProps } role=\"option\">\n {{\n prepend: ({ isSelected }) => (\n <>\n { props.multiple && !props.hideSelected ? (\n <VCheckboxBtn\n key={ item.value }\n modelValue={ isSelected }\n ripple={ false }\n tabindex=\"-1\"\n />\n ) : undefined }\n\n { item.props.prependAvatar && (\n <VAvatar image={ item.props.prependAvatar } />\n )}\n\n { item.props.prependIcon && (\n <VIcon icon={ item.props.prependIcon } />\n )}\n </>\n ),\n }}\n </VListItem>\n )\n }}\n </VVirtualScroll>\n\n { slots['append-item']?.() }\n </VList>\n )}\n </VMenu>\n\n { model.value.map((item, index) => {\n function onChipClose (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n\n select(item, false)\n }\n\n const slotProps = {\n 'onClick:close': onChipClose,\n onKeydown (e: KeyboardEvent) {\n if (e.key !== 'Enter' && e.key !== ' ') return\n\n e.preventDefault()\n e.stopPropagation()\n\n onChipClose(e)\n },\n onMousedown (e: MouseEvent) {\n e.preventDefault()\n e.stopPropagation()\n },\n modelValue: true,\n 'onUpdate:modelValue': undefined,\n }\n\n const hasSlot = hasChips ? !!slots.chip : !!slots.selection\n const slotContent = hasSlot\n ? ensureValidVNode(\n hasChips\n ? slots.chip!({ item, index, props: slotProps })\n : slots.selection!({ item, index })\n )\n : undefined\n\n if (hasSlot && !slotContent) return undefined\n\n return (\n <div key={ item.value } class=\"v-select__selection\">\n { hasChips ? (\n !slots.chip ? (\n <VChip\n key=\"chip\"\n closable={ props.closableChips }\n size=\"small\"\n text={ item.title }\n disabled={ item.props.disabled }\n { ...slotProps }\n />\n ) : (\n <VDefaultsProvider\n key=\"chip-defaults\"\n defaults={{\n VChip: {\n closable: props.closableChips,\n size: 'small',\n text: item.title,\n },\n }}\n >\n { slotContent }\n </VDefaultsProvider>\n )\n ) : (\n slotContent ?? (\n <span class=\"v-select__selection-text\">\n { item.title }\n { props.multiple && (index < model.value.length - 1) && (\n <span class=\"v-select__selection-comma\">,</span>\n )}\n </span>\n )\n )}\n </div>\n )\n })}\n </>\n ),\n 'append-inner': (...args) => (\n <>\n { slots['append-inner']?.(...args) }\n { props.menuIcon ? (\n <VIcon\n class=\"v-select__menu-icon\"\n icon={ props.menuIcon }\n />\n ) : undefined }\n </>\n ),\n }}\n </VTextField>\n )\n })\n\n return forwardRefs({\n isFocused,\n menu,\n select,\n }, vTextFieldRef)\n },\n})\n\nexport type VSelect = InstanceType<typeof VSelect>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,iBAAiB;AAAA,SACjBC,OAAO;AAAA,SACPC,YAAY;AAAA,SACZC,KAAK;AAAA,SACLC,iBAAiB;AAAA,SACjBC,KAAK;AAAA,SACLC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAAA,SACLC,mBAAmB,EAAEC,UAAU;AAAA,SAC/BC,cAAc,uCAEvB;AAAA,SACSC,YAAY;AAAA,SACZC,OA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,IAAI,CAAAE,IAAA,IAAAvD,SAAA,CAAAuD,IAAA;UAAA;UAAA,OAAA/B,YAAA,CAAAO,SAAA,SAElB7F,KAAK,CAAC,cAAc,CAAC,GAAG,GAAGmH,IAAI,CAAC,EAChC1H,KAAK,CAACd,QAAQ,GAAA2G,YAAA,CAAAzJ,KAAA;YAAA;YAAA,QAGL4D,KAAK,CAACd;UAAQ,WAErB4E,SAAS;QAAA;MAEhB;IAIT,CAAC,CAAC;IAEF,OAAOjH,WAAW,CAAC;MACjBgF,SAAS;MACT5C,IAAI;MACJmF;IACF,CAAC,EAAE3D,aAAa,CAAC;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -67,7 +67,7 @@ export const VVirtualScroll = genericComponent()({
|
|
67
67
|
});
|
68
68
|
useRender(() => {
|
69
69
|
const children = computedItems.value.map(item => _createVNode(VVirtualScrollItem, {
|
70
|
-
"key": item.
|
70
|
+
"key": item.key,
|
71
71
|
"renderless": props.renderless,
|
72
72
|
"onUpdate:height": height => handleItemResize(item.index, height)
|
73
73
|
}, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VVirtualScroll.mjs","names":["VVirtualScrollItem","makeComponentProps","makeDimensionProps","useDimension","useToggleScope","makeVirtualProps","useVirtual","onMounted","onScopeDispose","toRef","convertToUnit","genericComponent","getCurrentInstance","getScrollParent","propsFactory","useRender","makeVVirtualScrollProps","items","type","Array","default","renderless","Boolean","VVirtualScroll","name","props","setup","_ref","slots","vm","dimensionStyles","calculateVisibleItems","containerRef","markerRef","handleScroll","handleScrollend","handleItemResize","scrollToIndex","paddingTop","paddingBottom","computedItems","handleListeners","add","arguments","length","undefined","method","value","document","documentElement","passive","vnode","el","children","map","item","_createVNode","
|
1
|
+
{"version":3,"file":"VVirtualScroll.mjs","names":["VVirtualScrollItem","makeComponentProps","makeDimensionProps","useDimension","useToggleScope","makeVirtualProps","useVirtual","onMounted","onScopeDispose","toRef","convertToUnit","genericComponent","getCurrentInstance","getScrollParent","propsFactory","useRender","makeVVirtualScrollProps","items","type","Array","default","renderless","Boolean","VVirtualScroll","name","props","setup","_ref","slots","vm","dimensionStyles","calculateVisibleItems","containerRef","markerRef","handleScroll","handleScrollend","handleItemResize","scrollToIndex","paddingTop","paddingBottom","computedItems","handleListeners","add","arguments","length","undefined","method","value","document","documentElement","passive","vnode","el","children","map","item","_createVNode","key","height","index","slotProps","raw","_Fragment","class","style"],"sources":["../../../src/components/VVirtualScroll/VVirtualScroll.tsx"],"sourcesContent":["// Styles\nimport './VVirtualScroll.sass'\n\n// Components\nimport { VVirtualScrollItem } from './VVirtualScrollItem'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { useToggleScope } from '@/composables/toggleScope'\nimport { makeVirtualProps, useVirtual } from '@/composables/virtual'\n\n// Utilities\nimport { onMounted, onScopeDispose, toRef } from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getCurrentInstance,\n getScrollParent,\n propsFactory,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { GenericProps } from '@/util'\n\nexport interface VVirtualScrollSlot<T> {\n item: T\n index: number\n}\n\nexport const makeVVirtualScrollProps = propsFactory({\n items: {\n type: Array as PropType<readonly unknown[]>,\n default: () => ([]),\n },\n renderless: Boolean,\n\n ...makeVirtualProps(),\n ...makeComponentProps(),\n ...makeDimensionProps(),\n}, 'VVirtualScroll')\n\nexport const VVirtualScroll = genericComponent<new <T, Renderless extends boolean = false>(\n props: {\n items?: readonly T[]\n renderless?: Renderless\n },\n slots: {\n default: VVirtualScrollSlot<T> & (Renderless extends true ? {\n itemRef: Ref<HTMLElement | undefined>\n } : {})\n }\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VVirtualScroll',\n\n props: makeVVirtualScrollProps(),\n\n setup (props, { slots }) {\n const vm = getCurrentInstance('VVirtualScroll')\n const { dimensionStyles } = useDimension(props)\n const {\n calculateVisibleItems,\n containerRef,\n markerRef,\n handleScroll,\n handleScrollend,\n handleItemResize,\n scrollToIndex,\n paddingTop,\n paddingBottom,\n computedItems,\n } = useVirtual(props, toRef(props, 'items'))\n\n useToggleScope(() => props.renderless, () => {\n function handleListeners (add = false) {\n const method = add ? 'addEventListener' : 'removeEventListener'\n\n if (containerRef.value === document.documentElement) {\n document[method]('scroll', handleScroll, { passive: true })\n document[method]('scrollend', handleScrollend)\n } else {\n containerRef.value?.[method]('scroll', handleScroll, { passive: true })\n containerRef.value?.[method]('scrollend', handleScrollend)\n }\n }\n\n onMounted(() => {\n containerRef.value = getScrollParent(vm.vnode.el as HTMLElement, true)\n handleListeners(true)\n })\n onScopeDispose(handleListeners)\n })\n\n useRender(() => {\n const children = computedItems.value.map(item => (\n <VVirtualScrollItem\n key={ item.key }\n renderless={ props.renderless }\n onUpdate:height={ height => handleItemResize(item.index, height) }\n >\n { slotProps => slots.default?.({ item: item.raw, index: item.index, ...slotProps }) }\n </VVirtualScrollItem>\n ))\n\n return props.renderless ? (\n <>\n <div ref={ markerRef } class=\"v-virtual-scroll__spacer\" style={{ paddingTop: convertToUnit(paddingTop.value) }} />\n { children }\n <div class=\"v-virtual-scroll__spacer\" style={{ paddingBottom: convertToUnit(paddingBottom.value) }} />\n </>\n ) : (\n <div\n ref={ containerRef }\n class={[\n 'v-virtual-scroll',\n props.class,\n ]}\n onScrollPassive={ handleScroll }\n onScrollend={ handleScrollend }\n style={[\n dimensionStyles.value,\n props.style,\n ]}\n >\n <div\n ref={ markerRef }\n class=\"v-virtual-scroll__container\"\n style={{\n paddingTop: convertToUnit(paddingTop.value),\n paddingBottom: convertToUnit(paddingBottom.value),\n }}\n >\n { children }\n </div>\n </div>\n )\n })\n\n return {\n calculateVisibleItems,\n scrollToIndex,\n }\n },\n})\n\nexport type VVirtualScroll = InstanceType<typeof VVirtualScroll>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB,oCAE3B;AAAA,SACSC,kBAAkB;AA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,GAAGC;QAAU,CAAC;MAAC,EAEtF,CAAC;MAEF,OAAOnC,KAAK,CAACJ,UAAU,GAAAmC,YAAA,CAAAM,SAAA,SAAAN,YAAA;QAAA,OAERvB,SAAS;QAAA;QAAA,SAA2C;UAAEK,UAAU,EAAE5B,aAAa,CAAC4B,UAAU,CAACS,KAAK;QAAE;MAAC,UAC5GM,QAAQ,EAAAG,YAAA;QAAA;QAAA,SACmC;UAAEjB,aAAa,EAAE7B,aAAa,CAAC6B,aAAa,CAACQ,KAAK;QAAE;MAAC,aAAAS,YAAA;QAAA,OAI5FxB,YAAY;QAAA,SACX,CACL,kBAAkB,EAClBP,KAAK,CAACsC,KAAK,CACZ;QAAA,mBACiB7B,YAAY;QAAA,eAChBC,eAAe;QAAA,SACtB,CACLL,eAAe,CAACiB,KAAK,EACrBtB,KAAK,CAACuC,KAAK;MACZ,IAAAR,YAAA;QAAA,OAGOvB,SAAS;QAAA;QAAA,SAER;UACLK,UAAU,EAAE5B,aAAa,CAAC4B,UAAU,CAACS,KAAK,CAAC;UAC3CR,aAAa,EAAE7B,aAAa,CAAC6B,aAAa,CAACQ,KAAK;QAClD;MAAC,IAECM,QAAQ,IAGf;IACH,CAAC,CAAC;IAEF,OAAO;MACLtB,qBAAqB;MACrBM;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// Composables
|
2
2
|
import { useProxiedModel } from "../proxiedModel.mjs"; // Utilities
|
3
|
-
import { computed, inject, onBeforeUnmount, provide, ref, shallowRef, toRaw, toRef } from 'vue';
|
3
|
+
import { computed, inject, onBeforeMount, onBeforeUnmount, provide, ref, shallowRef, toRaw, toRef } from 'vue';
|
4
4
|
import { independentActiveStrategy, independentSingleActiveStrategy, leafActiveStrategy, leafSingleActiveStrategy } from "./activeStrategies.mjs";
|
5
5
|
import { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from "./openStrategies.mjs";
|
6
6
|
import { classicSelectStrategy, independentSelectStrategy, independentSingleSelectStrategy, leafSelectStrategy, leafSingleSelectStrategy } from "./selectStrategies.mjs";
|
@@ -237,7 +237,9 @@ export const useNestedItem = (id, isGroup) => {
|
|
237
237
|
isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),
|
238
238
|
isGroupActivator: parent.isGroupActivator
|
239
239
|
};
|
240
|
-
|
240
|
+
onBeforeMount(() => {
|
241
|
+
!parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup);
|
242
|
+
});
|
241
243
|
onBeforeUnmount(() => {
|
242
244
|
!parent.isGroupActivator && parent.root.unregister(computedId.value);
|
243
245
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nested.mjs","names":["useProxiedModel","computed","inject","onBeforeUnmount","provide","ref","shallowRef","toRaw","toRef","independentActiveStrategy","independentSingleActiveStrategy","leafActiveStrategy","leafSingleActiveStrategy","listOpenStrategy","multipleOpenStrategy","singleOpenStrategy","classicSelectStrategy","independentSelectStrategy","independentSingleSelectStrategy","leafSelectStrategy","leafSingleSelectStrategy","consoleError","getCurrentInstance","getUid","propsFactory","VNestedSymbol","Symbol","for","emptyNested","id","root","register","unregister","parents","Map","children","open","openOnSelect","activate","select","activatable","selectable","opened","Set","activated","selected","selectedValues","getPath","makeNestedProps","Boolean","activeStrategy","String","Function","Object","selectStrategy","openStrategy","mandatory","useNested","props","isUnmounted","v","values","value","in","out","path","parent","unshift","get","vm","nodeIds","nested","arr","key","entries","push","parentId","isGroup","has","map","join","newPath","concat","add","set","delete","list","filter","child","event","emit","newOpened","newSelected","newActivated","useNestedItem","uidSymbol","computedId","undefined","item","e","isOpen","isActivated","isSelected","isIndeterminate","isLeaf","isGroupActivator","useNestedGroupActivator"],"sources":["../../../src/composables/nested/nested.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, inject, onBeforeUnmount, provide, ref, shallowRef, toRaw, toRef } from 'vue'\nimport {\n independentActiveStrategy,\n independentSingleActiveStrategy,\n leafActiveStrategy,\n leafSingleActiveStrategy,\n} from './activeStrategies'\nimport { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from './openStrategies'\nimport {\n classicSelectStrategy,\n independentSelectStrategy,\n independentSingleSelectStrategy,\n leafSelectStrategy,\n leafSingleSelectStrategy,\n} from './selectStrategies'\nimport { consoleError, getCurrentInstance, getUid, propsFactory } from '@/util'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { ActiveStrategy } from './activeStrategies'\nimport type { OpenStrategy } from './openStrategies'\nimport type { SelectStrategy } from './selectStrategies'\nimport type { EventProp } from '@/util'\n\nexport type ActiveStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | ActiveStrategy\n | ((mandatory: boolean) => ActiveStrategy)\nexport type SelectStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | 'classic'\n | SelectStrategy\n | ((mandatory: boolean) => SelectStrategy)\nexport type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy\n\nexport interface NestedProps {\n activatable: boolean\n selectable: boolean\n activeStrategy: ActiveStrategyProp | undefined\n selectStrategy: SelectStrategyProp | undefined\n openStrategy: OpenStrategyProp | undefined\n activated: any\n selected: any\n opened: any\n mandatory: boolean\n 'onUpdate:activated': EventProp<[any]> | undefined\n 'onUpdate:selected': EventProp<[any]> | undefined\n 'onUpdate:opened': EventProp<[any]> | undefined\n}\n\ntype NestedProvide = {\n id: Ref<unknown>\n isGroupActivator?: boolean\n root: {\n children: Ref<Map<unknown, unknown[]>>\n parents: Ref<Map<unknown, unknown>>\n activatable: Ref<boolean>\n selectable: Ref<boolean>\n opened: Ref<Set<unknown>>\n activated: Ref<Set<unknown>>\n selected: Ref<Map<unknown, 'on' | 'off' | 'indeterminate'>>\n selectedValues: Ref<unknown[]>\n register: (id: unknown, parentId: unknown, isGroup?: boolean) => void\n unregister: (id: unknown) => void\n open: (id: unknown, value: boolean, event?: Event) => void\n activate: (id: unknown, value: boolean, event?: Event) => void\n select: (id: unknown, value: boolean, event?: Event) => void\n openOnSelect: (id: unknown, value: boolean, event?: Event) => void\n getPath: (id: unknown) => unknown[]\n }\n}\n\nexport const VNestedSymbol: InjectionKey<NestedProvide> = Symbol.for('vuetify:nested')\n\nexport const emptyNested: NestedProvide = {\n id: shallowRef(),\n root: {\n register: () => null,\n unregister: () => null,\n parents: ref(new Map()),\n children: ref(new Map()),\n open: () => null,\n openOnSelect: () => null,\n activate: () => null,\n select: () => null,\n activatable: ref(false),\n selectable: ref(false),\n opened: ref(new Set()),\n activated: ref(new Set()),\n selected: ref(new Map()),\n selectedValues: ref([]),\n getPath: () => [],\n },\n}\n\nexport const makeNestedProps = propsFactory({\n activatable: Boolean,\n selectable: Boolean,\n activeStrategy: [String, Function, Object] as PropType<ActiveStrategyProp>,\n selectStrategy: [String, Function, Object] as PropType<SelectStrategyProp>,\n openStrategy: [String, Object] as PropType<OpenStrategyProp>,\n opened: null,\n activated: null,\n selected: null,\n mandatory: Boolean,\n}, 'nested')\n\nexport const useNested = (props: NestedProps) => {\n let isUnmounted = false\n const children = ref(new Map<unknown, unknown[]>())\n const parents = ref(new Map<unknown, unknown>())\n\n const opened = useProxiedModel(props, 'opened', props.opened, v => new Set(v), v => [...v.values()])\n\n const activeStrategy = computed(() => {\n if (typeof props.activeStrategy === 'object') return props.activeStrategy\n if (typeof props.activeStrategy === 'function') return props.activeStrategy(props.mandatory)\n\n switch (props.activeStrategy) {\n case 'leaf': return leafActiveStrategy(props.mandatory)\n case 'single-leaf': return leafSingleActiveStrategy(props.mandatory)\n case 'independent': return independentActiveStrategy(props.mandatory)\n case 'single-independent':\n default: return independentSingleActiveStrategy(props.mandatory)\n }\n })\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') return props.selectStrategy\n if (typeof props.selectStrategy === 'function') return props.selectStrategy(props.mandatory)\n\n switch (props.selectStrategy) {\n case 'single-leaf': return leafSingleSelectStrategy(props.mandatory)\n case 'leaf': return leafSelectStrategy(props.mandatory)\n case 'independent': return independentSelectStrategy(props.mandatory)\n case 'single-independent': return independentSingleSelectStrategy(props.mandatory)\n case 'classic':\n default: return classicSelectStrategy(props.mandatory)\n }\n })\n\n const openStrategy = computed(() => {\n if (typeof props.openStrategy === 'object') return props.openStrategy\n\n switch (props.openStrategy) {\n case 'list': return listOpenStrategy\n case 'single': return singleOpenStrategy\n case 'multiple':\n default: return multipleOpenStrategy\n }\n })\n\n const activated = useProxiedModel(\n props,\n 'activated',\n props.activated,\n v => activeStrategy.value.in(v, children.value, parents.value),\n v => activeStrategy.value.out(v, children.value, parents.value),\n )\n const selected = useProxiedModel(\n props,\n 'selected',\n props.selected,\n v => selectStrategy.value.in(v, children.value, parents.value),\n v => selectStrategy.value.out(v, children.value, parents.value),\n )\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n\n while (parent != null) {\n path.unshift(parent)\n parent = parents.value.get(parent)\n }\n\n return path\n }\n\n const vm = getCurrentInstance('nested')\n\n const nodeIds = new Set<unknown>()\n\n const nested: NestedProvide = {\n id: shallowRef(),\n root: {\n opened,\n activatable: toRef(props, 'activatable'),\n selectable: toRef(props, 'selectable'),\n activated,\n selected,\n selectedValues: computed(() => {\n const arr = []\n\n for (const [key, value] of selected.value.entries()) {\n if (value === 'on') arr.push(key)\n }\n\n return arr\n }),\n register: (id, parentId, isGroup) => {\n if (nodeIds.has(id)) {\n const path = getPath(id).map(String).join(' -> ')\n const newPath = getPath(parentId).concat(id).map(String).join(' -> ')\n consoleError(`Multiple nodes with the same ID\\n\\t${path}\\n\\t${newPath}`)\n return\n } else {\n nodeIds.add(id)\n }\n\n parentId && id !== parentId && parents.value.set(id, parentId)\n\n isGroup && children.value.set(id, [])\n\n if (parentId != null) {\n children.value.set(parentId, [...children.value.get(parentId) || [], id])\n }\n },\n unregister: id => {\n if (isUnmounted) return\n\n nodeIds.delete(id)\n children.value.delete(id)\n const parent = parents.value.get(id)\n if (parent) {\n const list = children.value.get(parent) ?? []\n children.value.set(parent, list.filter(child => child !== id))\n }\n parents.value.delete(id)\n },\n open: (id, value, event) => {\n vm.emit('click:open', { id, value, path: getPath(id), event })\n\n const newOpened = openStrategy.value.open({\n id,\n value,\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newOpened && (opened.value = newOpened)\n },\n openOnSelect: (id, value, event) => {\n const newOpened = openStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newOpened && (opened.value = newOpened)\n },\n select: (id, value, event) => {\n vm.emit('click:select', { id, value, path: getPath(id), event })\n\n const newSelected = selectStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newSelected && (selected.value = newSelected)\n\n nested.root.openOnSelect(id, value, event)\n },\n activate: (id, value, event) => {\n if (!props.activatable) {\n return nested.root.select(id, true, event)\n }\n\n vm.emit('click:activate', { id, value, path: getPath(id), event })\n\n const newActivated = activeStrategy.value.activate({\n id,\n value,\n activated: new Set(activated.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newActivated && (activated.value = newActivated)\n },\n children,\n parents,\n getPath,\n },\n }\n\n provide(VNestedSymbol, nested)\n\n return nested.root\n}\n\nexport const useNestedItem = (id: Ref<unknown>, isGroup: boolean) => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n const uidSymbol = Symbol(getUid())\n const computedId = computed(() => id.value !== undefined ? id.value : uidSymbol)\n\n const item = {\n ...parent,\n id: computedId,\n open: (open: boolean, e: Event) => parent.root.open(computedId.value, open, e),\n openOnSelect: (open: boolean, e?: Event) => parent.root.openOnSelect(computedId.value, open, e),\n isOpen: computed(() => parent.root.opened.value.has(computedId.value)),\n parent: computed(() => parent.root.parents.value.get(computedId.value)),\n activate: (activated: boolean, e?: Event) => parent.root.activate(computedId.value, activated, e),\n isActivated: computed(() => parent.root.activated.value.has(toRaw(computedId.value))),\n select: (selected: boolean, e?: Event) => parent.root.select(computedId.value, selected, e),\n isSelected: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === 'on'),\n isIndeterminate: computed(() => parent.root.selected.value.get(computedId.value) === 'indeterminate'),\n isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),\n isGroupActivator: parent.isGroupActivator,\n }\n\n !parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup)\n\n onBeforeUnmount(() => {\n !parent.isGroupActivator && parent.root.unregister(computedId.value)\n })\n\n isGroup && provide(VNestedSymbol, item)\n\n return item\n}\n\nexport const useNestedGroupActivator = () => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n provide(VNestedSymbol, { ...parent, isGroupActivator: true })\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,+BAExB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAE7FC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC,gBAAgB,EAAEC,oBAAoB,EAAEC,kBAAkB;AAAA,SAEjEC,qBAAqB,EACrBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC,YAAY,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,YAAY,gCAE/D;AA6DA,OAAO,MAAMC,aAA0C,GAAGC,MAAM,CAACC,GAAG,CAAC,gBAAgB,CAAC;AAEtF,OAAO,MAAMC,WAA0B,GAAG;EACxCC,EAAE,EAAEvB,UAAU,CAAC,CAAC;EAChBwB,IAAI,EAAE;IACJC,QAAQ,EAAEA,CAAA,KAAM,IAAI;IACpBC,UAAU,EAAEA,CAAA,KAAM,IAAI;IACtBC,O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C+D,MAAM,CAACuC,gBAAgB,IAAIvC,MAAM,CAACpC,IAAI,CAACE,UAAU,CAACgE,UAAU,CAAClC,KAAK,CAAC;EACtE,CAAC,CAAC;EAEFe,OAAO,IAAIzE,OAAO,CAACqB,aAAa,EAAEyE,IAAI,CAAC;EAEvC,OAAOA,IAAI;AACb,CAAC;AAED,OAAO,MAAMQ,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMxC,MAAM,GAAGhE,MAAM,CAACuB,aAAa,EAAEG,WAAW,CAAC;EAEjDxB,OAAO,CAACqB,aAAa,EAAE;IAAE,GAAGyC,MAAM;IAAEuC,gBAAgB,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"nested.mjs","names":["useProxiedModel","computed","inject","onBeforeMount","onBeforeUnmount","provide","ref","shallowRef","toRaw","toRef","independentActiveStrategy","independentSingleActiveStrategy","leafActiveStrategy","leafSingleActiveStrategy","listOpenStrategy","multipleOpenStrategy","singleOpenStrategy","classicSelectStrategy","independentSelectStrategy","independentSingleSelectStrategy","leafSelectStrategy","leafSingleSelectStrategy","consoleError","getCurrentInstance","getUid","propsFactory","VNestedSymbol","Symbol","for","emptyNested","id","root","register","unregister","parents","Map","children","open","openOnSelect","activate","select","activatable","selectable","opened","Set","activated","selected","selectedValues","getPath","makeNestedProps","Boolean","activeStrategy","String","Function","Object","selectStrategy","openStrategy","mandatory","useNested","props","isUnmounted","v","values","value","in","out","path","parent","unshift","get","vm","nodeIds","nested","arr","key","entries","push","parentId","isGroup","has","map","join","newPath","concat","add","set","delete","list","filter","child","event","emit","newOpened","newSelected","newActivated","useNestedItem","uidSymbol","computedId","undefined","item","e","isOpen","isActivated","isSelected","isIndeterminate","isLeaf","isGroupActivator","useNestedGroupActivator"],"sources":["../../../src/composables/nested/nested.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport {\n computed,\n inject,\n onBeforeMount,\n onBeforeUnmount,\n provide,\n ref,\n shallowRef,\n toRaw,\n toRef,\n} from 'vue'\nimport {\n independentActiveStrategy,\n independentSingleActiveStrategy,\n leafActiveStrategy,\n leafSingleActiveStrategy,\n} from './activeStrategies'\nimport { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from './openStrategies'\nimport {\n classicSelectStrategy,\n independentSelectStrategy,\n independentSingleSelectStrategy,\n leafSelectStrategy,\n leafSingleSelectStrategy,\n} from './selectStrategies'\nimport { consoleError, getCurrentInstance, getUid, propsFactory } from '@/util'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { ActiveStrategy } from './activeStrategies'\nimport type { OpenStrategy } from './openStrategies'\nimport type { SelectStrategy } from './selectStrategies'\nimport type { EventProp } from '@/util'\n\nexport type ActiveStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | ActiveStrategy\n | ((mandatory: boolean) => ActiveStrategy)\nexport type SelectStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | 'classic'\n | SelectStrategy\n | ((mandatory: boolean) => SelectStrategy)\nexport type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy\n\nexport interface NestedProps {\n activatable: boolean\n selectable: boolean\n activeStrategy: ActiveStrategyProp | undefined\n selectStrategy: SelectStrategyProp | undefined\n openStrategy: OpenStrategyProp | undefined\n activated: any\n selected: any\n opened: any\n mandatory: boolean\n 'onUpdate:activated': EventProp<[any]> | undefined\n 'onUpdate:selected': EventProp<[any]> | undefined\n 'onUpdate:opened': EventProp<[any]> | undefined\n}\n\ntype NestedProvide = {\n id: Ref<unknown>\n isGroupActivator?: boolean\n root: {\n children: Ref<Map<unknown, unknown[]>>\n parents: Ref<Map<unknown, unknown>>\n activatable: Ref<boolean>\n selectable: Ref<boolean>\n opened: Ref<Set<unknown>>\n activated: Ref<Set<unknown>>\n selected: Ref<Map<unknown, 'on' | 'off' | 'indeterminate'>>\n selectedValues: Ref<unknown[]>\n register: (id: unknown, parentId: unknown, isGroup?: boolean) => void\n unregister: (id: unknown) => void\n open: (id: unknown, value: boolean, event?: Event) => void\n activate: (id: unknown, value: boolean, event?: Event) => void\n select: (id: unknown, value: boolean, event?: Event) => void\n openOnSelect: (id: unknown, value: boolean, event?: Event) => void\n getPath: (id: unknown) => unknown[]\n }\n}\n\nexport const VNestedSymbol: InjectionKey<NestedProvide> = Symbol.for('vuetify:nested')\n\nexport const emptyNested: NestedProvide = {\n id: shallowRef(),\n root: {\n register: () => null,\n unregister: () => null,\n parents: ref(new Map()),\n children: ref(new Map()),\n open: () => null,\n openOnSelect: () => null,\n activate: () => null,\n select: () => null,\n activatable: ref(false),\n selectable: ref(false),\n opened: ref(new Set()),\n activated: ref(new Set()),\n selected: ref(new Map()),\n selectedValues: ref([]),\n getPath: () => [],\n },\n}\n\nexport const makeNestedProps = propsFactory({\n activatable: Boolean,\n selectable: Boolean,\n activeStrategy: [String, Function, Object] as PropType<ActiveStrategyProp>,\n selectStrategy: [String, Function, Object] as PropType<SelectStrategyProp>,\n openStrategy: [String, Object] as PropType<OpenStrategyProp>,\n opened: null,\n activated: null,\n selected: null,\n mandatory: Boolean,\n}, 'nested')\n\nexport const useNested = (props: NestedProps) => {\n let isUnmounted = false\n const children = ref(new Map<unknown, unknown[]>())\n const parents = ref(new Map<unknown, unknown>())\n\n const opened = useProxiedModel(props, 'opened', props.opened, v => new Set(v), v => [...v.values()])\n\n const activeStrategy = computed(() => {\n if (typeof props.activeStrategy === 'object') return props.activeStrategy\n if (typeof props.activeStrategy === 'function') return props.activeStrategy(props.mandatory)\n\n switch (props.activeStrategy) {\n case 'leaf': return leafActiveStrategy(props.mandatory)\n case 'single-leaf': return leafSingleActiveStrategy(props.mandatory)\n case 'independent': return independentActiveStrategy(props.mandatory)\n case 'single-independent':\n default: return independentSingleActiveStrategy(props.mandatory)\n }\n })\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') return props.selectStrategy\n if (typeof props.selectStrategy === 'function') return props.selectStrategy(props.mandatory)\n\n switch (props.selectStrategy) {\n case 'single-leaf': return leafSingleSelectStrategy(props.mandatory)\n case 'leaf': return leafSelectStrategy(props.mandatory)\n case 'independent': return independentSelectStrategy(props.mandatory)\n case 'single-independent': return independentSingleSelectStrategy(props.mandatory)\n case 'classic':\n default: return classicSelectStrategy(props.mandatory)\n }\n })\n\n const openStrategy = computed(() => {\n if (typeof props.openStrategy === 'object') return props.openStrategy\n\n switch (props.openStrategy) {\n case 'list': return listOpenStrategy\n case 'single': return singleOpenStrategy\n case 'multiple':\n default: return multipleOpenStrategy\n }\n })\n\n const activated = useProxiedModel(\n props,\n 'activated',\n props.activated,\n v => activeStrategy.value.in(v, children.value, parents.value),\n v => activeStrategy.value.out(v, children.value, parents.value),\n )\n const selected = useProxiedModel(\n props,\n 'selected',\n props.selected,\n v => selectStrategy.value.in(v, children.value, parents.value),\n v => selectStrategy.value.out(v, children.value, parents.value),\n )\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n\n while (parent != null) {\n path.unshift(parent)\n parent = parents.value.get(parent)\n }\n\n return path\n }\n\n const vm = getCurrentInstance('nested')\n\n const nodeIds = new Set<unknown>()\n\n const nested: NestedProvide = {\n id: shallowRef(),\n root: {\n opened,\n activatable: toRef(props, 'activatable'),\n selectable: toRef(props, 'selectable'),\n activated,\n selected,\n selectedValues: computed(() => {\n const arr = []\n\n for (const [key, value] of selected.value.entries()) {\n if (value === 'on') arr.push(key)\n }\n\n return arr\n }),\n register: (id, parentId, isGroup) => {\n if (nodeIds.has(id)) {\n const path = getPath(id).map(String).join(' -> ')\n const newPath = getPath(parentId).concat(id).map(String).join(' -> ')\n consoleError(`Multiple nodes with the same ID\\n\\t${path}\\n\\t${newPath}`)\n return\n } else {\n nodeIds.add(id)\n }\n\n parentId && id !== parentId && parents.value.set(id, parentId)\n\n isGroup && children.value.set(id, [])\n\n if (parentId != null) {\n children.value.set(parentId, [...children.value.get(parentId) || [], id])\n }\n },\n unregister: id => {\n if (isUnmounted) return\n\n nodeIds.delete(id)\n children.value.delete(id)\n const parent = parents.value.get(id)\n if (parent) {\n const list = children.value.get(parent) ?? []\n children.value.set(parent, list.filter(child => child !== id))\n }\n parents.value.delete(id)\n },\n open: (id, value, event) => {\n vm.emit('click:open', { id, value, path: getPath(id), event })\n\n const newOpened = openStrategy.value.open({\n id,\n value,\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newOpened && (opened.value = newOpened)\n },\n openOnSelect: (id, value, event) => {\n const newOpened = openStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newOpened && (opened.value = newOpened)\n },\n select: (id, value, event) => {\n vm.emit('click:select', { id, value, path: getPath(id), event })\n\n const newSelected = selectStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newSelected && (selected.value = newSelected)\n\n nested.root.openOnSelect(id, value, event)\n },\n activate: (id, value, event) => {\n if (!props.activatable) {\n return nested.root.select(id, true, event)\n }\n\n vm.emit('click:activate', { id, value, path: getPath(id), event })\n\n const newActivated = activeStrategy.value.activate({\n id,\n value,\n activated: new Set(activated.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newActivated && (activated.value = newActivated)\n },\n children,\n parents,\n getPath,\n },\n }\n\n provide(VNestedSymbol, nested)\n\n return nested.root\n}\n\nexport const useNestedItem = (id: Ref<unknown>, isGroup: boolean) => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n const uidSymbol = Symbol(getUid())\n const computedId = computed(() => id.value !== undefined ? id.value : uidSymbol)\n\n const item = {\n ...parent,\n id: computedId,\n open: (open: boolean, e: Event) => parent.root.open(computedId.value, open, e),\n openOnSelect: (open: boolean, e?: Event) => parent.root.openOnSelect(computedId.value, open, e),\n isOpen: computed(() => parent.root.opened.value.has(computedId.value)),\n parent: computed(() => parent.root.parents.value.get(computedId.value)),\n activate: (activated: boolean, e?: Event) => parent.root.activate(computedId.value, activated, e),\n isActivated: computed(() => parent.root.activated.value.has(toRaw(computedId.value))),\n select: (selected: boolean, e?: Event) => parent.root.select(computedId.value, selected, e),\n isSelected: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === 'on'),\n isIndeterminate: computed(() => parent.root.selected.value.get(computedId.value) === 'indeterminate'),\n isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),\n isGroupActivator: parent.isGroupActivator,\n }\n\n onBeforeMount(() => {\n !parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup)\n })\n\n onBeforeUnmount(() => {\n !parent.isGroupActivator && parent.root.unregister(computedId.value)\n })\n\n isGroup && provide(VNestedSymbol, item)\n\n return item\n}\n\nexport const useNestedGroupActivator = () => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n provide(VNestedSymbol, { ...parent, isGroupActivator: true })\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,+BAExB;AACA,SACEC,QAAQ,EACRC,MAAM,EACNC,aAAa,EACbC,eAAe,EACfC,OAAO,EACPC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,KAAK;AAAA,SAEVC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC,gBAAgB,EAAEC,oBAAoB,EAAEC,kBAAkB;AAAA,SAEjEC,qBAAqB,EACrBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC,YAAY,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,YAAY,gCAE/D;AA6DA,OAAO,MAAMC,aAA0C,GAAGC,MAAM,CAACC,GAAG,CAAC,gBAAgB,CAAC;AAEtF,OAAO,MAAMC,WAA0B,GAAG;EACxCC,EAAE,EAAEvB,UAAU,CAAC,CAAC;EAChBwB,IA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ACiE,UAAU,CAAClC,KAAK,EAAEI,MAAM,CAACrC,EAAE,CAACiC,KAAK,EAAEe,OAAO,CAAC;EAC9F,CAAC,CAAC;EAEF1E,eAAe,CAAC,MAAM;IACpB,CAAC+D,MAAM,CAACuC,gBAAgB,IAAIvC,MAAM,CAACpC,IAAI,CAACE,UAAU,CAACgE,UAAU,CAAClC,KAAK,CAAC;EACtE,CAAC,CAAC;EAEFe,OAAO,IAAIzE,OAAO,CAACqB,aAAa,EAAEyE,IAAI,CAAC;EAEvC,OAAOA,IAAI;AACb,CAAC;AAED,OAAO,MAAMQ,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMxC,MAAM,GAAGjE,MAAM,CAACwB,aAAa,EAAEG,WAAW,CAAC;EAEjDxB,OAAO,CAACqB,aAAa,EAAE;IAAE,GAAGyC,MAAM;IAAEuC,gBAAgB,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC","ignoreList":[]}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { useDisplay } from "./display.mjs";
|
3
3
|
import { useResizeObserver } from "./resizeObserver.mjs"; // Utilities
|
4
4
|
import { computed, nextTick, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue';
|
5
|
-
import { clamp, debounce, IN_BROWSER, propsFactory } from "../util/index.mjs"; // Types
|
5
|
+
import { clamp, debounce, IN_BROWSER, isObject, propsFactory } from "../util/index.mjs"; // Types
|
6
6
|
const UP = -1;
|
7
7
|
const DOWN = 1;
|
8
8
|
|
@@ -193,7 +193,8 @@ export function useVirtual(props, items) {
|
|
193
193
|
const computedItems = computed(() => {
|
194
194
|
return items.value.slice(first.value, last.value).map((item, index) => ({
|
195
195
|
raw: item,
|
196
|
-
index: index + first.value
|
196
|
+
index: index + first.value,
|
197
|
+
key: isObject(item) && 'value' in item ? item.value : index + first.value
|
197
198
|
}));
|
198
199
|
});
|
199
200
|
watch(items, () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"virtual.mjs","names":["useDisplay","useResizeObserver","computed","nextTick","onScopeDispose","ref","shallowRef","watch","watchEffect","clamp","debounce","IN_BROWSER","propsFactory","UP","DOWN","BUFFER_PX","makeVirtualProps","itemHeight","type","Number","String","default","height","useVirtual","props","items","display","value","parseFloat","first","last","Math","ceil","parseInt","paddingTop","paddingBottom","containerRef","markerRef","markerOffset","resizeRef","contentRect","viewportHeight","document","documentElement","hasInitialRender","sizes","Array","from","length","offsets","updateTime","targetScrollIndex","getSize","index","updateOffsets","start","performance","now","i","max","unwatch","v","offsetTop","immediate","calculateVisibleItems","window","requestAnimationFrame","scrollToIndex","clear","handleItemResize","prevHeight","prevMinHeight","min","calculateOffset","calculateIndex","scrollTop","binaryClosest","lastScrollTop","scrollVelocity","lastScrollTime","val","oldVal","scrollTimeout","handleScroll","scrollTime","scrollDeltaT","sign","clearTimeout","setTimeout","handleScrollend","raf","cancelAnimationFrame","_calculateVisibleItems","direction","startPx","endPx","end","topOverflow","bottomOverflow","bufferOverflow","offset","computedItems","slice","map","item","raw","deep","arr","high","low","mid","target"],"sources":["../../src/composables/virtual.ts"],"sourcesContent":["// Composables\nimport { useDisplay } from '@/composables/display'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { computed, nextTick, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue'\nimport { clamp, debounce, IN_BROWSER, propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nconst UP = -1\nconst DOWN = 1\n\n/** Determines how large each batch of items should be */\nconst BUFFER_PX = 100\n\ntype VirtualProps = {\n itemHeight?: number | string\n height?: number | string\n}\n\nexport const makeVirtualProps = propsFactory({\n itemHeight: {\n type: [Number, String],\n default: null,\n },\n height: [Number, String],\n}, 'virtual')\n\nexport function useVirtual <T> (props: VirtualProps, items: Ref<readonly T[]>) {\n const display = useDisplay()\n\n const itemHeight = shallowRef(0)\n watchEffect(() => {\n itemHeight.value = parseFloat(props.itemHeight || 0)\n })\n\n const first = shallowRef(0)\n const last = shallowRef(Math.ceil(\n // Assume 16px items filling the entire screen height if\n // not provided. This is probably incorrect but it minimises\n // the chance of ending up with empty space at the bottom.\n // The default value is set here to avoid poisoning getSize()\n (parseInt(props.height!) || display.height.value) / (itemHeight.value || 16)\n ) || 1)\n const paddingTop = shallowRef(0)\n const paddingBottom = shallowRef(0)\n\n /** The scrollable element */\n const containerRef = ref<HTMLElement>()\n /** An element marking the top of the scrollable area,\n * used to add an offset if there's padding or other elements above the virtual list */\n const markerRef = ref<HTMLElement>()\n /** markerRef's offsetTop, lazily evaluated */\n let markerOffset = 0\n\n const { resizeRef, contentRect } = useResizeObserver()\n watchEffect(() => {\n resizeRef.value = containerRef.value\n })\n const viewportHeight = computed(() => {\n return containerRef.value === document.documentElement\n ? display.height.value\n : contentRect.value?.height || parseInt(props.height!) || 0\n })\n /** All static elements have been rendered and we have an assumed item height */\n const hasInitialRender = computed(() => {\n return !!(containerRef.value && markerRef.value && viewportHeight.value && itemHeight.value)\n })\n\n let sizes = Array.from<number | null>({ length: items.value.length })\n let offsets = Array.from<number>({ length: items.value.length })\n const updateTime = shallowRef(0)\n let targetScrollIndex = -1\n\n function getSize (index: number) {\n return sizes[index] || itemHeight.value\n }\n\n const updateOffsets = debounce(() => {\n const start = performance.now()\n offsets[0] = 0\n const length = items.value.length\n for (let i = 1; i <= length - 1; i++) {\n offsets[i] = (offsets[i - 1] || 0) + getSize(i - 1)\n }\n updateTime.value = Math.max(updateTime.value, performance.now() - start)\n }, updateTime)\n\n const unwatch = watch(hasInitialRender, v => {\n if (!v) return\n // First render is complete, update offsets and visible\n // items in case our assumed item height was incorrect\n\n unwatch()\n markerOffset = markerRef.value!.offsetTop\n updateOffsets.immediate()\n calculateVisibleItems()\n\n if (!~targetScrollIndex) return\n\n nextTick(() => {\n IN_BROWSER && window.requestAnimationFrame(() => {\n scrollToIndex(targetScrollIndex)\n targetScrollIndex = -1\n })\n })\n })\n\n onScopeDispose(() => {\n updateOffsets.clear()\n })\n\n function handleItemResize (index: number, height: number) {\n const prevHeight = sizes[index]\n const prevMinHeight = itemHeight.value\n\n itemHeight.value = prevMinHeight ? Math.min(itemHeight.value, height) : height\n\n if (prevHeight !== height || prevMinHeight !== itemHeight.value) {\n sizes[index] = height\n updateOffsets()\n }\n }\n\n function calculateOffset (index: number) {\n index = clamp(index, 0, items.value.length - 1)\n return offsets[index] || 0\n }\n\n function calculateIndex (scrollTop: number) {\n return binaryClosest(offsets, scrollTop)\n }\n\n let lastScrollTop = 0\n let scrollVelocity = 0\n let lastScrollTime = 0\n\n watch(viewportHeight, (val, oldVal) => {\n if (oldVal) {\n calculateVisibleItems()\n if (val < oldVal) {\n requestAnimationFrame(() => {\n scrollVelocity = 0\n calculateVisibleItems()\n })\n }\n }\n })\n\n let scrollTimeout = -1\n function handleScroll () {\n if (!containerRef.value || !markerRef.value) return\n\n const scrollTop = containerRef.value.scrollTop\n const scrollTime = performance.now()\n const scrollDeltaT = scrollTime - lastScrollTime\n\n if (scrollDeltaT > 500) {\n scrollVelocity = Math.sign(scrollTop - lastScrollTop)\n\n // Not super important, only update at the\n // start of a scroll sequence to avoid reflows\n markerOffset = markerRef.value.offsetTop\n } else {\n scrollVelocity = scrollTop - lastScrollTop\n }\n\n lastScrollTop = scrollTop\n lastScrollTime = scrollTime\n\n window.clearTimeout(scrollTimeout)\n scrollTimeout = window.setTimeout(handleScrollend, 500)\n\n calculateVisibleItems()\n }\n function handleScrollend () {\n if (!containerRef.value || !markerRef.value) return\n\n scrollVelocity = 0\n lastScrollTime = 0\n\n window.clearTimeout(scrollTimeout)\n calculateVisibleItems()\n }\n\n let raf = -1\n function calculateVisibleItems () {\n cancelAnimationFrame(raf)\n raf = requestAnimationFrame(_calculateVisibleItems)\n }\n function _calculateVisibleItems () {\n if (!containerRef.value || !viewportHeight.value) return\n const scrollTop = lastScrollTop - markerOffset\n const direction = Math.sign(scrollVelocity)\n\n const startPx = Math.max(0, scrollTop - BUFFER_PX)\n const start = clamp(calculateIndex(startPx), 0, items.value.length)\n\n const endPx = scrollTop + viewportHeight.value + BUFFER_PX\n const end = clamp(calculateIndex(endPx) + 1, start + 1, items.value.length)\n\n if (\n // Only update the side we're scrolling towards,\n // the other side will be updated incidentally\n (direction !== UP || start < first.value) &&\n (direction !== DOWN || end > last.value)\n ) {\n const topOverflow = calculateOffset(first.value) - calculateOffset(start)\n const bottomOverflow = calculateOffset(end) - calculateOffset(last.value)\n const bufferOverflow = Math.max(topOverflow, bottomOverflow)\n\n if (bufferOverflow > BUFFER_PX) {\n first.value = start\n last.value = end\n } else {\n // Only update the side that's reached its limit if there's still buffer left\n if (start <= 0) first.value = start\n if (end >= items.value.length) last.value = end\n }\n }\n\n paddingTop.value = calculateOffset(first.value)\n paddingBottom.value = calculateOffset(items.value.length) - calculateOffset(last.value)\n }\n\n function scrollToIndex (index: number) {\n const offset = calculateOffset(index)\n if (!containerRef.value || (index && !offset)) {\n targetScrollIndex = index\n } else {\n containerRef.value.scrollTop = offset\n }\n }\n\n const computedItems = computed(() => {\n return items.value.slice(first.value, last.value).map((item, index) => ({\n raw: item,\n index: index + first.value,\n }))\n })\n\n watch(items, () => {\n sizes = Array.from({ length: items.value.length })\n offsets = Array.from({ length: items.value.length })\n updateOffsets.immediate()\n calculateVisibleItems()\n }, { deep: true })\n\n return {\n calculateVisibleItems,\n containerRef,\n markerRef,\n computedItems,\n paddingTop,\n paddingBottom,\n scrollToIndex,\n handleScroll,\n handleScrollend,\n handleItemResize,\n }\n}\n\n// https://gist.github.com/robertleeplummerjr/1cc657191d34ecd0a324\nfunction binaryClosest (arr: ArrayLike<number>, val: number) {\n let high = arr.length - 1\n let low = 0\n let mid = 0\n let item = null\n let target = -1\n\n if (arr[high]! < val) {\n return high\n }\n\n while (low <= high) {\n mid = (low + high) >> 1\n item = arr[mid]!\n\n if (item > val) {\n high = mid - 1\n } else if (item < val) {\n target = mid\n low = mid + 1\n } else if (item === val) {\n return mid\n } else {\n return low\n }\n }\n\n return target\n}\n"],"mappings":"AAAA;AAA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O;IACL1C,qBAAqB;IACrB5B,YAAY;IACZC,SAAS;IACTgE,aAAa;IACbnE,UAAU;IACVC,aAAa;IACbgC,aAAa;IACbgB,YAAY;IACZM,eAAe;IACfpB;EACF,CAAC;AACH;;AAEA;AACA,SAASO,aAAaA,CAAE+B,GAAsB,EAAE3B,GAAW,EAAE;EAC3D,IAAI4B,IAAI,GAAGD,GAAG,CAAC3D,MAAM,GAAG,CAAC;EACzB,IAAI6D,GAAG,GAAG,CAAC;EACX,IAAIC,GAAG,GAAG,CAAC;EACX,IAAIN,IAAI,GAAG,IAAI;EACf,IAAIO,MAAM,GAAG,CAAC,CAAC;EAEf,IAAIJ,GAAG,CAACC,IAAI,CAAC,GAAI5B,GAAG,EAAE;IACpB,OAAO4B,IAAI;EACb;EAEA,OAAOC,GAAG,IAAID,IAAI,EAAE;IAClBE,GAAG,GAAID,GAAG,GAAGD,IAAI,IAAK,CAAC;IACvBJ,IAAI,GAAGG,GAAG,CAACG,GAAG,CAAE;IAEhB,IAAIN,IAAI,GAAGxB,GAAG,EAAE;MACd4B,IAAI,GAAGE,GAAG,GAAG,CAAC;IAChB,CAAC,MAAM,IAAIN,IAAI,GAAGxB,GAAG,EAAE;MACrB+B,MAAM,GAAGD,GAAG;MACZD,GAAG,GAAGC,GAAG,GAAG,CAAC;IACf,CAAC,MAAM,IAAIN,IAAI,KAAKxB,GAAG,EAAE;MACvB,OAAO8B,GAAG;IACZ,CAAC,MAAM;MACL,OAAOD,GAAG;IACZ;EACF;EAEA,OAAOE,MAAM;AACf","ignoreList":[]}
|
1
|
+
{"version":3,"file":"virtual.mjs","names":["useDisplay","useResizeObserver","computed","nextTick","onScopeDispose","ref","shallowRef","watch","watchEffect","clamp","debounce","IN_BROWSER","isObject","propsFactory","UP","DOWN","BUFFER_PX","makeVirtualProps","itemHeight","type","Number","String","default","height","useVirtual","props","items","display","value","parseFloat","first","last","Math","ceil","parseInt","paddingTop","paddingBottom","containerRef","markerRef","markerOffset","resizeRef","contentRect","viewportHeight","document","documentElement","hasInitialRender","sizes","Array","from","length","offsets","updateTime","targetScrollIndex","getSize","index","updateOffsets","start","performance","now","i","max","unwatch","v","offsetTop","immediate","calculateVisibleItems","window","requestAnimationFrame","scrollToIndex","clear","handleItemResize","prevHeight","prevMinHeight","min","calculateOffset","calculateIndex","scrollTop","binaryClosest","lastScrollTop","scrollVelocity","lastScrollTime","val","oldVal","scrollTimeout","handleScroll","scrollTime","scrollDeltaT","sign","clearTimeout","setTimeout","handleScrollend","raf","cancelAnimationFrame","_calculateVisibleItems","direction","startPx","endPx","end","topOverflow","bottomOverflow","bufferOverflow","offset","computedItems","slice","map","item","raw","key","deep","arr","high","low","mid","target"],"sources":["../../src/composables/virtual.ts"],"sourcesContent":["// Composables\nimport { useDisplay } from '@/composables/display'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { computed, nextTick, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue'\nimport { clamp, debounce, IN_BROWSER, isObject, propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nconst UP = -1\nconst DOWN = 1\n\n/** Determines how large each batch of items should be */\nconst BUFFER_PX = 100\n\ntype VirtualProps = {\n itemHeight?: number | string\n height?: number | string\n}\n\nexport const makeVirtualProps = propsFactory({\n itemHeight: {\n type: [Number, String],\n default: null,\n },\n height: [Number, String],\n}, 'virtual')\n\nexport function useVirtual <T> (props: VirtualProps, items: Ref<readonly T[]>) {\n const display = useDisplay()\n\n const itemHeight = shallowRef(0)\n watchEffect(() => {\n itemHeight.value = parseFloat(props.itemHeight || 0)\n })\n\n const first = shallowRef(0)\n const last = shallowRef(Math.ceil(\n // Assume 16px items filling the entire screen height if\n // not provided. This is probably incorrect but it minimises\n // the chance of ending up with empty space at the bottom.\n // The default value is set here to avoid poisoning getSize()\n (parseInt(props.height!) || display.height.value) / (itemHeight.value || 16)\n ) || 1)\n const paddingTop = shallowRef(0)\n const paddingBottom = shallowRef(0)\n\n /** The scrollable element */\n const containerRef = ref<HTMLElement>()\n /** An element marking the top of the scrollable area,\n * used to add an offset if there's padding or other elements above the virtual list */\n const markerRef = ref<HTMLElement>()\n /** markerRef's offsetTop, lazily evaluated */\n let markerOffset = 0\n\n const { resizeRef, contentRect } = useResizeObserver()\n watchEffect(() => {\n resizeRef.value = containerRef.value\n })\n const viewportHeight = computed(() => {\n return containerRef.value === document.documentElement\n ? display.height.value\n : contentRect.value?.height || parseInt(props.height!) || 0\n })\n /** All static elements have been rendered and we have an assumed item height */\n const hasInitialRender = computed(() => {\n return !!(containerRef.value && markerRef.value && viewportHeight.value && itemHeight.value)\n })\n\n let sizes = Array.from<number | null>({ length: items.value.length })\n let offsets = Array.from<number>({ length: items.value.length })\n const updateTime = shallowRef(0)\n let targetScrollIndex = -1\n\n function getSize (index: number) {\n return sizes[index] || itemHeight.value\n }\n\n const updateOffsets = debounce(() => {\n const start = performance.now()\n offsets[0] = 0\n const length = items.value.length\n for (let i = 1; i <= length - 1; i++) {\n offsets[i] = (offsets[i - 1] || 0) + getSize(i - 1)\n }\n updateTime.value = Math.max(updateTime.value, performance.now() - start)\n }, updateTime)\n\n const unwatch = watch(hasInitialRender, v => {\n if (!v) return\n // First render is complete, update offsets and visible\n // items in case our assumed item height was incorrect\n\n unwatch()\n markerOffset = markerRef.value!.offsetTop\n updateOffsets.immediate()\n calculateVisibleItems()\n\n if (!~targetScrollIndex) return\n\n nextTick(() => {\n IN_BROWSER && window.requestAnimationFrame(() => {\n scrollToIndex(targetScrollIndex)\n targetScrollIndex = -1\n })\n })\n })\n\n onScopeDispose(() => {\n updateOffsets.clear()\n })\n\n function handleItemResize (index: number, height: number) {\n const prevHeight = sizes[index]\n const prevMinHeight = itemHeight.value\n\n itemHeight.value = prevMinHeight ? Math.min(itemHeight.value, height) : height\n\n if (prevHeight !== height || prevMinHeight !== itemHeight.value) {\n sizes[index] = height\n updateOffsets()\n }\n }\n\n function calculateOffset (index: number) {\n index = clamp(index, 0, items.value.length - 1)\n return offsets[index] || 0\n }\n\n function calculateIndex (scrollTop: number) {\n return binaryClosest(offsets, scrollTop)\n }\n\n let lastScrollTop = 0\n let scrollVelocity = 0\n let lastScrollTime = 0\n\n watch(viewportHeight, (val, oldVal) => {\n if (oldVal) {\n calculateVisibleItems()\n if (val < oldVal) {\n requestAnimationFrame(() => {\n scrollVelocity = 0\n calculateVisibleItems()\n })\n }\n }\n })\n\n let scrollTimeout = -1\n function handleScroll () {\n if (!containerRef.value || !markerRef.value) return\n\n const scrollTop = containerRef.value.scrollTop\n const scrollTime = performance.now()\n const scrollDeltaT = scrollTime - lastScrollTime\n\n if (scrollDeltaT > 500) {\n scrollVelocity = Math.sign(scrollTop - lastScrollTop)\n\n // Not super important, only update at the\n // start of a scroll sequence to avoid reflows\n markerOffset = markerRef.value.offsetTop\n } else {\n scrollVelocity = scrollTop - lastScrollTop\n }\n\n lastScrollTop = scrollTop\n lastScrollTime = scrollTime\n\n window.clearTimeout(scrollTimeout)\n scrollTimeout = window.setTimeout(handleScrollend, 500)\n\n calculateVisibleItems()\n }\n function handleScrollend () {\n if (!containerRef.value || !markerRef.value) return\n\n scrollVelocity = 0\n lastScrollTime = 0\n\n window.clearTimeout(scrollTimeout)\n calculateVisibleItems()\n }\n\n let raf = -1\n function calculateVisibleItems () {\n cancelAnimationFrame(raf)\n raf = requestAnimationFrame(_calculateVisibleItems)\n }\n function _calculateVisibleItems () {\n if (!containerRef.value || !viewportHeight.value) return\n const scrollTop = lastScrollTop - markerOffset\n const direction = Math.sign(scrollVelocity)\n\n const startPx = Math.max(0, scrollTop - BUFFER_PX)\n const start = clamp(calculateIndex(startPx), 0, items.value.length)\n\n const endPx = scrollTop + viewportHeight.value + BUFFER_PX\n const end = clamp(calculateIndex(endPx) + 1, start + 1, items.value.length)\n\n if (\n // Only update the side we're scrolling towards,\n // the other side will be updated incidentally\n (direction !== UP || start < first.value) &&\n (direction !== DOWN || end > last.value)\n ) {\n const topOverflow = calculateOffset(first.value) - calculateOffset(start)\n const bottomOverflow = calculateOffset(end) - calculateOffset(last.value)\n const bufferOverflow = Math.max(topOverflow, bottomOverflow)\n\n if (bufferOverflow > BUFFER_PX) {\n first.value = start\n last.value = end\n } else {\n // Only update the side that's reached its limit if there's still buffer left\n if (start <= 0) first.value = start\n if (end >= items.value.length) last.value = end\n }\n }\n\n paddingTop.value = calculateOffset(first.value)\n paddingBottom.value = calculateOffset(items.value.length) - calculateOffset(last.value)\n }\n\n function scrollToIndex (index: number) {\n const offset = calculateOffset(index)\n if (!containerRef.value || (index && !offset)) {\n targetScrollIndex = index\n } else {\n containerRef.value.scrollTop = offset\n }\n }\n\n const computedItems = computed(() => {\n return items.value.slice(first.value, last.value).map((item, index) => ({\n raw: item,\n index: index + first.value,\n key: (isObject(item) && 'value' in item) ? item.value : index + first.value,\n }))\n })\n\n watch(items, () => {\n sizes = Array.from({ length: items.value.length })\n offsets = Array.from({ length: items.value.length })\n updateOffsets.immediate()\n calculateVisibleItems()\n }, { deep: true })\n\n return {\n calculateVisibleItems,\n containerRef,\n markerRef,\n computedItems,\n paddingTop,\n paddingBottom,\n scrollToIndex,\n handleScroll,\n handleScrollend,\n handleItemResize,\n }\n}\n\n// https://gist.github.com/robertleeplummerjr/1cc657191d34ecd0a324\nfunction binaryClosest (arr: ArrayLike<number>, val: number) {\n let high = arr.length - 1\n let low = 0\n let mid = 0\n let item = null\n let target = -1\n\n if (arr[high]! < val) {\n return high\n }\n\n while (low <= high) {\n mid = (low + high) >> 1\n item = arr[mid]!\n\n if (item > val) {\n high = mid - 1\n } else if (item < val) {\n target = mid\n low = mid + 1\n } else if (item === val) {\n return mid\n } else {\n return low\n }\n }\n\n return target\n}\n"],"mappings":"AAAA;AAAA,SACSA,UAAU;AAAA,SACVC,iBAAiB,gCAE1B;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;AAAA,SACpFC,KAAK,EAAE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B;IACrB5B,YAAY;IACZC,SAAS;IACTgE,aAAa;IACbnE,UAAU;IACVC,aAAa;IACbgC,aAAa;IACbgB,YAAY;IACZM,eAAe;IACfpB;EACF,CAAC;AACH;;AAEA;AACA,SAASO,aAAaA,CAAEgC,GAAsB,EAAE5B,GAAW,EAAE;EAC3D,IAAI6B,IAAI,GAAGD,GAAG,CAAC5D,MAAM,GAAG,CAAC;EACzB,IAAI8D,GAAG,GAAG,CAAC;EACX,IAAIC,GAAG,GAAG,CAAC;EACX,IAAIP,IAAI,GAAG,IAAI;EACf,IAAIQ,MAAM,GAAG,CAAC,CAAC;EAEf,IAAIJ,GAAG,CAACC,IAAI,CAAC,GAAI7B,GAAG,EAAE;IACpB,OAAO6B,IAAI;EACb;EAEA,OAAOC,GAAG,IAAID,IAAI,EAAE;IAClBE,GAAG,GAAID,GAAG,GAAGD,IAAI,IAAK,CAAC;IACvBL,IAAI,GAAGI,GAAG,CAACG,GAAG,CAAE;IAEhB,IAAIP,IAAI,GAAGxB,GAAG,EAAE;MACd6B,IAAI,GAAGE,GAAG,GAAG,CAAC;IAChB,CAAC,MAAM,IAAIP,IAAI,GAAGxB,GAAG,EAAE;MACrBgC,MAAM,GAAGD,GAAG;MACZD,GAAG,GAAGC,GAAG,GAAG,CAAC;IACf,CAAC,MAAM,IAAIP,IAAI,KAAKxB,GAAG,EAAE;MACvB,OAAO+B,GAAG;IACZ,CAAC,MAAM;MACL,OAAOD,GAAG;IACZ;EACF;EAEA,OAAOE,MAAM;AACf","ignoreList":[]}
|
package/lib/entry-bundler.mjs
CHANGED
@@ -16,7 +16,7 @@ export const createVuetify = function () {
|
|
16
16
|
...options
|
17
17
|
});
|
18
18
|
};
|
19
|
-
export const version = "3.7.5-master.2024-12-
|
19
|
+
export const version = "3.7.5-master.2024-12-16";
|
20
20
|
createVuetify.version = version;
|
21
21
|
export { blueprints, components, directives };
|
22
22
|
export * from "./composables/index.mjs";
|
package/lib/framework.mjs
CHANGED