@vielzeug/refine 2.1.3 → 2.2.4
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/accordion.cjs +1 -1
- package/dist/accordion.cjs.map +1 -1
- package/dist/accordion.js +2 -2
- package/dist/accordion.js.map +1 -1
- package/dist/carousel.cjs +25 -24
- package/dist/carousel.cjs.map +1 -1
- package/dist/carousel.js +125 -135
- package/dist/carousel.js.map +1 -1
- package/dist/combobox.cjs +14 -14
- package/dist/combobox.cjs.map +1 -1
- package/dist/combobox.js +88 -98
- package/dist/combobox.js.map +1 -1
- package/dist/content/carousel/carousel.d.ts.map +1 -1
- package/dist/content/list/_list-item-reveal.cjs +1 -1
- package/dist/content/list/_list-item-reveal.cjs.map +1 -1
- package/dist/content/list/_list-item-reveal.d.ts +3 -3
- package/dist/content/list/_list-item-reveal.d.ts.map +1 -1
- package/dist/content/list/_list-item-reveal.js +22 -22
- package/dist/content/list/_list-item-reveal.js.map +1 -1
- package/dist/content/list/list-item.d.ts.map +1 -1
- package/dist/core/focus.cjs +1 -1
- package/dist/core/focus.cjs.map +1 -1
- package/dist/core/focus.d.ts.map +1 -1
- package/dist/core/focus.js +21 -20
- package/dist/core/focus.js.map +1 -1
- package/dist/core/index.d.ts +2 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/nav.cjs +1 -1
- package/dist/core/nav.cjs.map +1 -1
- package/dist/core/nav.d.ts +3 -62
- package/dist/core/nav.d.ts.map +1 -1
- package/dist/core/nav.js +41 -124
- package/dist/core/nav.js.map +1 -1
- package/dist/core/option-list.cjs +1 -1
- package/dist/core/option-list.cjs.map +1 -1
- package/dist/core/option-list.d.ts +5 -5
- package/dist/core/option-list.d.ts.map +1 -1
- package/dist/core/option-list.js +14 -13
- package/dist/core/option-list.js.map +1 -1
- package/dist/core/overlay.cjs +1 -1
- package/dist/core/overlay.cjs.map +1 -1
- package/dist/core/overlay.d.ts +0 -8
- package/dist/core/overlay.d.ts.map +1 -1
- package/dist/core/overlay.js +1 -3
- package/dist/core/overlay.js.map +1 -1
- package/dist/custom-elements.json +5636 -5683
- package/dist/drawer.cjs +6 -6
- package/dist/drawer.cjs.map +1 -1
- package/dist/drawer.js +65 -75
- package/dist/drawer.js.map +1 -1
- package/dist/feedback/skeleton/skeleton.css.cjs +1 -1
- package/dist/feedback/skeleton/skeleton.css.cjs.map +1 -1
- package/dist/feedback/skeleton/skeleton.css.js +1 -1
- package/dist/feedback/skeleton/skeleton.css.js.map +1 -1
- package/dist/feedback/skeleton/skeleton.d.ts.map +1 -1
- package/dist/feedback/toast/toast.d.ts.map +1 -1
- package/dist/grid.cjs +2 -2
- package/dist/grid.cjs.map +1 -1
- package/dist/grid.js +42 -41
- package/dist/grid.js.map +1 -1
- package/dist/input.cjs.map +1 -1
- package/dist/input.js.map +1 -1
- package/dist/inputs/input/input.css.cjs +1 -1
- package/dist/inputs/input/input.css.cjs.map +1 -1
- package/dist/inputs/input/input.css.js +1 -1
- package/dist/inputs/input/input.css.js.map +1 -1
- package/dist/inputs/input/input.d.ts +2 -0
- package/dist/inputs/input/input.d.ts.map +1 -1
- package/dist/inputs/select/select.d.ts +2 -2
- package/dist/inputs/select/select.d.ts.map +1 -1
- package/dist/layout/grid/grid.d.ts.map +1 -1
- package/dist/layout/navbar/navbar.d.ts.map +1 -1
- package/dist/layout/sidebar/sidebar.d.ts.map +1 -1
- package/dist/list-item.cjs +2 -6
- package/dist/list-item.cjs.map +1 -1
- package/dist/list-item.js +40 -39
- package/dist/list-item.js.map +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.cjs.map +1 -1
- package/dist/list.js +2 -2
- package/dist/list.js.map +1 -1
- package/dist/marquee.cjs +1 -1
- package/dist/marquee.cjs.map +1 -1
- package/dist/marquee.js +3 -1
- package/dist/marquee.js.map +1 -1
- package/dist/menu.cjs +5 -5
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.js +59 -59
- package/dist/menu.js.map +1 -1
- package/dist/navbar.cjs +9 -9
- package/dist/navbar.cjs.map +1 -1
- package/dist/navbar.js +124 -116
- package/dist/navbar.js.map +1 -1
- package/dist/otp-input.cjs +1 -1
- package/dist/otp-input.cjs.map +1 -1
- package/dist/otp-input.js +2 -2
- package/dist/otp-input.js.map +1 -1
- package/dist/overlay/drawer/drawer.d.ts.map +1 -1
- package/dist/overlay/menu/menu.d.ts.map +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.cjs.map +1 -1
- package/dist/radio-group.js +2 -3
- package/dist/radio-group.js.map +1 -1
- package/dist/radio.cjs +1 -1
- package/dist/radio.cjs.map +1 -1
- package/dist/radio.js +12 -11
- package/dist/radio.js.map +1 -1
- package/dist/rating.cjs +1 -1
- package/dist/rating.cjs.map +1 -1
- package/dist/rating.js +1 -1
- package/dist/rating.js.map +1 -1
- package/dist/refine.cjs +188 -195
- package/dist/refine.cjs.map +1 -1
- package/dist/refine.iife.js +212 -219
- package/dist/refine.iife.js.map +1 -1
- package/dist/refine.js +392 -399
- package/dist/refine.js.map +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.cjs.map +1 -1
- package/dist/select.js +1 -0
- package/dist/select.js.map +1 -1
- package/dist/sidebar.cjs +16 -16
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.js +106 -91
- package/dist/sidebar.js.map +1 -1
- package/dist/skeleton.cjs +3 -3
- package/dist/skeleton.cjs.map +1 -1
- package/dist/skeleton.js +8 -7
- package/dist/skeleton.js.map +1 -1
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.cjs.map +1 -1
- package/dist/stepper.js +3 -3
- package/dist/stepper.js.map +1 -1
- package/dist/styles/fouc.css +22 -0
- package/dist/styles/preflight.css +2 -10
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.cjs.map +1 -1
- package/dist/tabs.js +4 -5
- package/dist/tabs.js.map +1 -1
- package/dist/toast.cjs +13 -17
- package/dist/toast.cjs.map +1 -1
- package/dist/toast.js +86 -85
- package/dist/toast.js.map +1 -1
- package/package.json +18 -11
- package/dist/core/swipe.cjs +0 -2
- package/dist/core/swipe.cjs.map +0 -1
- package/dist/core/swipe.d.ts +0 -40
- package/dist/core/swipe.d.ts.map +0 -1
- package/dist/core/swipe.js +0 -63
- package/dist/core/swipe.js.map +0 -1
- package/dist/core/typeahead.cjs +0 -2
- package/dist/core/typeahead.cjs.map +0 -1
- package/dist/core/typeahead.d.ts +0 -53
- package/dist/core/typeahead.d.ts.map +0 -1
- package/dist/core/typeahead.js +0 -23
- package/dist/core/typeahead.js.map +0 -1
package/dist/combobox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":[],"sources":["../src/inputs/combobox/combobox.ts"],"sourcesContent":["import {\n bind,\n define,\n getHost,\n html,\n onCleanup,\n onElement,\n prop,\n ref,\n useEmit,\n useField,\n watchEffect,\n} from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport {\n createChoiceField,\n createInteraction,\n createListboxDropdown,\n type DropdownCloseReason,\n lifecycleSignal,\n type OverlayOpenReason,\n} from '../../core';\nimport { colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin } from '../../styles';\nimport type { AddEventListeners, ComponentSize, RoundedSize, ThemeColor } from '../../types';\nimport { dispatchNativeFieldEvent } from '../shared/native-field-event';\nimport type { ComboboxOptionInput, ComboboxOptionItem, OreComboboxEvents, OreComboboxProps } from './combobox.types';\nimport { filterOptions, getCreatableLabel, makeCreatableValue, parseSlottedOptions } from './combobox-options';\nimport '../../feedback/chip/chip';\nimport '../input/input';\nimport componentStyles from './combobox.css?inline';\n\nexport type { OreComboboxEvents, OreComboboxProps } from './combobox.types';\n\n/**\n * A searchable select field with multiple selection, custom option creation, and large-list support.\n *\n * @element ore-combobox\n *\n * @attr {string} value - Selected value(s). Use comma-separated for multiple.\n * @attr {boolean} multiple - Enable multiple selection\n * @attr {boolean} creatable - Allow users to create custom options from search query\n * @attr {boolean} no-filter - Disable client-side filtering (useful for server-side search)\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} required - Require a non-blank selection for native form validation\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n *\n * @fires input - Emitted when the selection changes.\n * @fires change - Emitted when the selection changes.\n * @fires open-change - Emitted when the dropdown state changes. detail: { open, reason }\n * @fires {CustomEvent} search - Emitted when user types. detail: { query: string }\n *\n * @slot - Slotted combobox options and option groups\n * @cssprop --combobox-dropdown-bg - Dropdown panel background color\n * @cssprop --combobox-dropdown-border-color - Dropdown panel border color\n * @cssprop --combobox-option-hover-bg - Option background on hover\n * @cssprop --combobox-option-focus-bg - Option background when keyboard-focused\n * @cssprop --combobox-option-selected-bg - Option background when selected\n * @cssprop --combobox-option-selected-focus-bg - Option background when selected and focused\n * @cssprop --input-bg - Field background (passed through to ore-input)\n * @cssprop --input-border-color - Field border color (passed through to ore-input)\n *\n * @part wrapper - Root wrapper around the entire field\n * @part label - Label element shown inside or outside the field\n * @part field - Field container that holds the trigger input and clear button\n * @part input - Search input used to filter and select options\n * @part clear-btn - Button that clears the current selection/query\n * @part dropdown - Popup list container for options\n * @part helper-text - Helper text displayed below the field\n * @example\n * ```html\n * <ore-combobox label=\"Country\" name=\"country\">\n * <ore-combobox-option value=\"us\">United States</ore-combobox-option>\n * <ore-combobox-option value=\"gb\">United Kingdom</ore-combobox-option>\n * <ore-combobox-option value=\"de\" disabled>Germany</ore-combobox-option>\n * </ore-combobox>\n * ```\n */\nexport const COMBOBOX_TAG = 'ore-combobox' as const;\ndefine<OreComboboxProps>(COMBOBOX_TAG, {\n formAssociated: true,\n props: {\n autoclose: prop.bool(false),\n color: prop.string<ThemeColor>(),\n creatable: prop.bool(false),\n disabled: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n multiple: prop.bool(false),\n name: prop.string(),\n 'no-filter': prop.bool(false),\n options: prop.data<ComboboxOptionInput[]>(),\n placeholder: prop.string('Select...'),\n required: prop.bool(false),\n rounded: prop.string<RoundedSize>(),\n size: prop.string<ComponentSize>(),\n success: prop.bool(false),\n value: prop.string(),\n variant: prop.string<'flat' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreComboboxEvents>();\n const watch = watchEffect;\n\n const query = signal('');\n\n // Element refs needed by the listbox dropdown.\n let inputEl: HTMLInputElement | null = null;\n let fieldEl: HTMLElement | null = null; // set to the ore-input host once it mounts\n let dropdownEl: HTMLElement | null = null;\n let listboxEl: HTMLElement | null = null;\n\n // Ref to the ore-input host; resolved when the template renders.\n const bitInputRef = ref<HTMLElement>();\n\n const abortSignal = lifecycleSignal(onCleanup);\n const choice = createChoiceField({\n disabled: props.disabled,\n error: props.error,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n multiple: props.multiple,\n prefix: 'combobox',\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n // filteredOptions signal declared before optionList so the getItems getter\n // captures the live signal reference rather than needing a factory indirection.\n const filteredOptions = signal<ComboboxOptionItem[]>([]);\n\n const optionList = createListboxDropdown<ComboboxOptionItem>({\n getBoundary: () => el,\n getFocusedOptionElement: () => dropdownEl?.querySelector<HTMLElement>('[data-focused]') ?? null,\n getItems: () => filteredOptions.value,\n getOptionId: (index) => `${choice.fieldId}-opt-${index}`,\n getPanel: () => dropdownEl,\n getReference: () => fieldEl,\n getTrigger: () => inputEl,\n isDisabled: () => choice.disabled.value,\n onClose: (reason) => {\n emit('open-change', { open: false, reason });\n\n if (!abortSignal.aborted) restoreQueryFromSelection();\n\n choice.triggerValidation('blur');\n },\n onOpen: (reason) => emit('open-change', { open: true, reason }),\n restoreFocus: false,\n signal: abortSignal,\n });\n\n const { disabled: isDisabled, fieldId: comboId, selectedValues, triggerValidation } = choice;\n\n choice.attachFormField(\n useField<string>({\n disabled: choice.disabled,\n onReset: choice.reset,\n toFormValue: (v) => v,\n validationMessage: choice.validationMessage,\n validity: choice.validity,\n value: choice.formValue,\n }),\n );\n\n const { focusedIndex, isOpen, scrollFocusedIntoView, updatePosition } = optionList;\n // ── State ────────────────────────────────────────────────────────────────\n const isMultiple = () => Boolean(props.multiple.value);\n const isCreatable = () => Boolean(props.creatable.value);\n const isNoFilter = () => Boolean(props['no-filter'].value);\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n size: props.size,\n variant: props.variant,\n },\n });\n\n let lastQueryBeforeClear: string | null = null;\n let isRestoringQuery = false;\n\n const selectedValue = computed(() => selectedValues.value[0] ?? '');\n\n // Expose a native-like, string-valued `.value` property on the host.\n Object.defineProperty(el, 'value', {\n configurable: true,\n get: () => choice.formValue.value,\n set: (val: unknown) => {\n const v = val as string | string[] | null | undefined;\n\n if (Array.isArray(v)) {\n choice.setValues(v.map((entry) => String(entry ?? '')));\n\n return;\n }\n\n if (v == null || v === '') {\n choice.clear();\n\n return;\n }\n\n choice.setValues(isMultiple() ? String(v).split(',') : [String(v)]);\n },\n });\n\n const hasValue = () => selectedValues.value.length > 0;\n\n function focusLiveInput() {\n inputEl?.focus();\n }\n\n // ── Options ──────────────────────────────────────────────────────────────\n const slottedOptions = signal<ComboboxOptionItem[]>([]);\n const createdOptions = signal<ComboboxOptionItem[]>([]);\n const isLoading = () => Boolean(props.loading.value);\n\n function normalizeOption(option: ComboboxOptionInput): ComboboxOptionItem {\n return {\n disabled: Boolean(option.disabled),\n iconEl: option.iconEl ?? null,\n label: option.label ?? option.value,\n value: option.value,\n };\n }\n\n // Merged options: explicit prop value overrides slotted options.\n const allOptions = computed<ComboboxOptionItem[]>(() => {\n const optionsProp = props.options.value;\n const base = Array.isArray(optionsProp) ? optionsProp.map(normalizeOption) : slottedOptions.value;\n\n if (createdOptions.value.length === 0) return base;\n\n return [...base, ...createdOptions.value];\n });\n\n const selectionController = {\n clear: () => {\n choice.clear();\n },\n remove: (key: string) => {\n choice.removeValue(key);\n },\n select: (key: string) => {\n choice.selectValue(key);\n },\n toggle: (key: string) => {\n choice.toggleValue(key);\n },\n };\n\n function readOptions(elements: Element[] = Array.from(el.children)) {\n slottedOptions.value = parseSlottedOptions(elements);\n\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n query.value = match?.label ?? selectedValue.value;\n }\n }\n\n // Initialize from light DOM immediately; onMounted/observer keep this in sync afterwards.\n readOptions();\n\n watch(() => {\n const nextOptions = filterOptions(allOptions.value, query.value, isNoFilter());\n\n filteredOptions.value = isMultiple()\n ? nextOptions.filter((option) => !selectedValues.value.includes(option.value))\n : nextOptions;\n });\n\n // \"Create\" option shown when creatable + query doesn't match any existing option\n const creatableLabel = computed(() => {\n return getCreatableLabel(query.value, isCreatable(), filteredOptions.value);\n });\n const inputPlaceholder = () =>\n isMultiple() && selectedValues.value.length > 0 ? '' : props.placeholder.value || '';\n\n function emitChange() {\n dispatchNativeFieldEvent(el, 'input');\n dispatchNativeFieldEvent(el, 'change');\n }\n\n function removeChip(event: Event): void {\n event.stopPropagation();\n\n const value = (event as CustomEvent<{ value?: string }>).detail?.value;\n\n if (value === undefined) return;\n\n selectionController.remove(value);\n emitChange();\n triggerValidation('change');\n }\n\n function restoreQueryFromSelection() {\n // Keep input text and selected value in sync whenever the popup closes.\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n isRestoringQuery = true;\n query.value = match?.label ?? '';\n Promise.resolve().then(() => {\n isRestoringQuery = false;\n });\n\n return;\n }\n\n query.value = '';\n }\n\n watch(() => {\n if (isOpen.value && !isMultiple() && selectedValue.value && focusedIndex.value === -1 && query.value === '') {\n const selectedIndex = filteredOptions.value.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n });\n\n // ── Open / Close ─────────────────────────────────────────────────────────\n function openPopup(clearFilter = true, reason: OverlayOpenReason = 'programmatic') {\n if (clearFilter) {\n lastQueryBeforeClear = query.value;\n query.value = '';\n }\n\n // Pre-compute focused index BEFORE opening so the first render has it set\n if (!isMultiple() && selectedValue.value) {\n const freshOptions = filterOptions(allOptions.value, '', isNoFilter());\n const selectedIndex = freshOptions.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n\n optionList.open(reason);\n\n if (!isMultiple() && selectedValue.value && focusedIndex.value >= 0) {\n requestAnimationFrame(() => {\n scrollFocusedIntoView();\n });\n }\n }\n\n function closePopup(reason: DropdownCloseReason = 'programmatic') {\n optionList.close(reason);\n }\n\n const fieldPress = createInteraction({\n disabled: isDisabled,\n onPress: () => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n },\n });\n\n const enterPress = createInteraction({\n disabled: isDisabled,\n keys: ['Enter'],\n onPress: (originalEvent: Event) => {\n const opts = filteredOptions.value;\n\n if (isOpen.value && focusedIndex.value >= 0 && focusedIndex.value < opts.length) {\n selectOption(opts[focusedIndex.value], originalEvent);\n } else if (isOpen.value && focusedIndex.value === -1 && creatableLabel.value) {\n // Focused on the \"create\" item\n createOption(query.value, originalEvent);\n } else if (!isOpen.value) {\n openPopup(true, 'keyboard');\n }\n },\n });\n\n // ── Selection ────────────────────────────────────────────────────────────\n function selectOption(opt: ComboboxOptionItem, _originalEvent?: Event) {\n if (opt.disabled) return;\n\n if (isMultiple()) {\n selectionController.toggle(opt.value);\n query.value = '';\n emitChange();\n triggerValidation('change');\n\n if (props.autoclose.value) {\n closePopup();\n }\n\n // Keep dropdown open in multiple mode (unless autoclose is true)\n focusLiveInput();\n requestAnimationFrame(() => focusLiveInput());\n } else {\n selectionController.select(opt.value);\n query.value = opt.label;\n emitChange();\n triggerValidation('change');\n closePopup();\n focusLiveInput();\n }\n }\n function resolveOptionFromElement(optionEl: HTMLElement): ComboboxOptionItem | null {\n const indexAttr = optionEl.getAttribute('data-option-index');\n const index = indexAttr ? Number(indexAttr) : -1;\n\n if (Number.isInteger(index) && index >= 0 && index < filteredOptions.value.length) {\n return filteredOptions.value[index] ?? null;\n }\n\n const valueAttr = optionEl.getAttribute('data-option-value');\n\n if (valueAttr) {\n const byValue = filteredOptions.value.find((option) => option.value === valueAttr);\n\n if (byValue) return byValue;\n }\n\n const labelText = optionEl.querySelector('span')?.textContent?.trim() ?? optionEl.textContent?.trim() ?? '';\n\n if (!labelText) return null;\n\n return filteredOptions.value.find((option) => option.label === labelText || option.value === labelText) ?? null;\n }\n function clearValue(e: Event) {\n e.stopPropagation();\n selectionController.clear();\n query.value = '';\n emitChange();\n triggerValidation('change');\n focusLiveInput();\n }\n function handleInput(e: InputEvent) {\n const target = e.target as HTMLInputElement;\n const newValue = target.value;\n\n // Skip all input processing if we're in the middle of restoring the query\n // This prevents the clearing logic from firing during close/restore\n if (isRestoringQuery) {\n return;\n }\n\n if (newValue === query.value) return;\n\n query.value = newValue;\n\n if (!isMultiple()) {\n const currentItem = selectedValues.value[0];\n const currentLabel = currentItem\n ? (allOptions.value.find((o) => o.value === currentItem)?.label ?? currentItem)\n : '';\n\n // Preserve the current selection while typing. Selection should only\n // change when a new option is committed or when the user explicitly clears.\n const isJustOpening = newValue === '' && lastQueryBeforeClear === currentLabel;\n\n if (isJustOpening) {\n lastQueryBeforeClear = null;\n }\n }\n\n optionList.navigate('first');\n\n if (!isOpen.value) openPopup(false, 'keyboard');\n\n emit('search', { query: target.value });\n }\n function handleFocus() {\n // Intentionally no-op: open only on explicit click or keyboard.\n // Opening on every focus surprises users tabbing through a form.\n }\n\n // ── Keyboard Navigation ──────────────────────────────────────────────────\n function handleKeydown(e: KeyboardEvent) {\n if (isDisabled.value) return;\n\n if (optionList.handleKeydown(e)) return;\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n optionList.navigate('first');\n } else {\n optionList.navigate('next');\n }\n\n break;\n case 'ArrowUp':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n } else {\n optionList.navigate('prev');\n }\n\n break;\n case 'Backspace':\n // In multiple mode, remove the last chip when the input is empty\n if (isMultiple() && !query.value && selectedValues.value.length > 0) {\n choice.removeValue(selectedValues.value[selectedValues.value.length - 1] ?? '');\n emitChange();\n triggerValidation('change');\n }\n\n break;\n case 'Enter':\n enterPress.handleKeydown(e);\n\n break;\n case 'Tab':\n closePopup('programmatic');\n break;\n default:\n break;\n }\n }\n\n // ── Create option ────────────────────────────────────────────────────────\n function createOption(rawQuery: string, originalEvent?: Event) {\n const actualLabel = rawQuery.trim();\n\n if (!actualLabel) return;\n\n const value = makeCreatableValue(actualLabel);\n const newOpt: ComboboxOptionItem = { disabled: false, iconEl: null, label: actualLabel, value };\n\n createdOptions.value = [...createdOptions.value, newOpt];\n selectOption(newOpt, originalEvent);\n }\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n const observeLightDomOptions = (): (() => void) => {\n const observer = new MutationObserver(() => {\n readOptions();\n });\n\n observer.observe(el, {\n attributeFilter: ['disabled', 'label', 'value'],\n attributes: true,\n childList: true,\n subtree: true,\n });\n\n return () => observer.disconnect();\n };\n\n const stopObserving = observeLightDomOptions();\n\n const handleShadowOptionPointerMove = (event: PointerEvent): void => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option || option.disabled) return;\n\n const focusedIdx = filteredOptions.value.findIndex((candidate) => candidate.value === option.value);\n\n if (focusedIdx >= 0) {\n optionList.set(focusedIdx);\n }\n };\n const shadowRoot = el.shadowRoot;\n\n if (shadowRoot) {\n shadowRoot.addEventListener('pointermove', handleShadowOptionPointerMove as EventListener);\n }\n\n const createListboxListeners = (listEl: HTMLElement): (() => void) => {\n const handleActivate = (event: Event) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const createRow = target.closest<HTMLElement>('.no-results-create');\n\n if (createRow) {\n event.preventDefault();\n event.stopPropagation();\n createOption(query.value, event);\n\n return;\n }\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option) return;\n\n selectOption(option, event);\n };\n\n const handlePointerMove = (event: PointerEvent) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option) return;\n\n const focusedIdx = filteredOptions.value.findIndex((candidate) => candidate.value === option.value);\n\n if (focusedIdx >= 0) {\n optionList.set(focusedIdx);\n }\n };\n\n listEl.addEventListener('click', handleActivate);\n listEl.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n listEl.removeEventListener('click', handleActivate);\n listEl.removeEventListener('pointermove', handlePointerMove);\n };\n };\n\n let stopListboxListeners: (() => void) | null = null;\n let listboxListenersTarget: HTMLElement | null = null;\n\n const setListboxElement = (el: HTMLElement | null): void => {\n listboxEl = el;\n\n if (listboxListenersTarget === el) return;\n\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n\n if (!el) return;\n\n stopListboxListeners = createListboxListeners(el);\n listboxListenersTarget = el;\n };\n\n const ensureListboxListeners = (): void => {\n if (!listboxEl) return;\n\n if (listboxListenersTarget === listboxEl && stopListboxListeners) return;\n\n stopListboxListeners?.();\n stopListboxListeners = createListboxListeners(listboxEl);\n listboxListenersTarget = listboxEl;\n };\n\n watch(() => {\n ensureListboxListeners();\n\n if (isOpen.value) {\n if (dropdownEl && 'showPopover' in dropdownEl && !dropdownEl.matches(':popover-open')) dropdownEl.showPopover();\n\n updatePosition();\n } else {\n if (dropdownEl && 'hidePopover' in dropdownEl && dropdownEl.matches(':popover-open')) dropdownEl.hidePopover();\n }\n });\n\n // Once ore-input is in the DOM, grab its inner <input> from its shadow root\n // and attach all combobox-specific ARIA + event handlers imperatively.\n // MUST be registered before the ARIA effects below so inputEl is set first\n // when bitInputRef fires (effects run in registration order).\n onElement(bitInputRef, (bitInputEl) => {\n fieldEl = bitInputEl;\n\n const rawInput = bitInputEl.shadowRoot?.querySelector<HTMLInputElement>('input') ?? null;\n\n if (!rawInput) return;\n\n inputEl = rawInput;\n\n rawInput.setAttribute('role', 'combobox');\n rawInput.setAttribute('autocomplete', 'off');\n rawInput.setAttribute('aria-autocomplete', 'list');\n rawInput.setAttribute('aria-haspopup', 'listbox');\n rawInput.setAttribute('spellcheck', 'false');\n rawInput.setAttribute('aria-controls', `${comboId}-listbox`);\n\n const handleInputClick = (): void => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n };\n\n rawInput.addEventListener('input', handleInput as EventListener);\n rawInput.addEventListener('keydown', handleKeydown as EventListener);\n rawInput.addEventListener('focus', handleFocus);\n rawInput.addEventListener('click', handleInputClick);\n\n return () => {\n inputEl = null;\n fieldEl = null;\n rawInput.removeEventListener('input', handleInput as EventListener);\n rawInput.removeEventListener('keydown', handleKeydown as EventListener);\n rawInput.removeEventListener('focus', handleFocus);\n rawInput.removeEventListener('click', handleInputClick);\n };\n });\n\n // Reactively sync combobox-specific ARIA attrs that ore-input doesn't manage.\n // Uses bitInputRef (a signal) as the gate so the effect re-runs when the\n // inner input mounts — inputEl is a plain variable and would not trigger re-runs.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n el.setAttribute('aria-expanded', String(isOpen.value));\n\n if (isDisabled.value) {\n el.setAttribute('aria-disabled', 'true');\n } else {\n el.removeAttribute('aria-disabled');\n }\n\n if (props.error.value) {\n el.setAttribute('aria-invalid', 'true');\n el.setAttribute('aria-errormessage', `${comboId}-error`);\n } else {\n el.removeAttribute('aria-invalid');\n el.removeAttribute('aria-errormessage');\n }\n });\n\n // Reactively sync the query signal into the raw input value.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n if (el.value !== query.value) el.value = query.value;\n });\n\n onCleanup(() => {\n shadowRoot?.removeEventListener('pointermove', handleShadowOptionPointerMove as EventListener);\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n stopObserving();\n });\n\n const inputColor = () => props.color?.value ?? undefined;\n const inputSize = () => props.size?.value ?? undefined;\n const inputVariant = () => props.variant?.value ?? undefined;\n const inputRounded = () => props.rounded?.value ?? undefined;\n const inputFullwidth = () => (props.fullwidth.value ? true : undefined);\n\n return html`\n <slot></slot>\n <ore-input\n class=\"trigger\"\n ref=${bitInputRef}\n label=\"${() => props.label.value ?? ''}\"\n placeholder=\"${inputPlaceholder}\"\n label-placement=\"${() => props['label-placement'].value ?? 'inset'}\"\n color=\"${inputColor}\"\n size=\"${inputSize}\"\n variant=\"${inputVariant}\"\n rounded=\"${inputRounded}\"\n helper=\"${() => props.helper.value ?? ''}\"\n error=\"${() => props.error.value ?? ''}\"\n ?disabled=\"${isDisabled}\"\n ?required=\"${() => false}\"\n ?fullwidth=\"${inputFullwidth}\"\n ?success=\"${() => props.success.value}\"\n name=\"${() => props.name.value ?? ''}\"\n @click=\"${(e: MouseEvent) => {\n fieldPress.handleClick(e);\n }}\"\n part=\"wrapper\">\n <div slot=\"prefix\" class=\"chips-row\">\n <!-- Keep chip list diffing isolated so input node identity stays stable. -->\n <span class=\"chips-list\">\n ${() =>\n (isMultiple() ? selectedValues.value : []).map(\n (value) => html`\n <ore-chip\n value=${value}\n label=${allOptions.value.find((option) => option.value === value)?.label ?? value}\n mode=\"removable\"\n variant=\"flat\"\n size=\"sm\"\n color=\"${props.color}\"\n @remove=${removeChip}>\n ${allOptions.value.find((option) => option.value === value)?.label ?? value}\n </ore-chip>\n `,\n )}\n </span>\n </div>\n <span slot=\"suffix\" class=\"combobox-suffix\" aria-hidden=\"true\">\n <button\n class=\"clear-btn\"\n part=\"clear-btn\"\n type=\"button\"\n aria-label=\"Clear\"\n tabindex=\"-1\"\n ?hidden=${() => !hasValue()}\n @click=\"${clearValue}\">\n <ore-icon name=\"x\" size=\"12\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </button>\n <span class=\"combobox-suffix-end\">\n <span class=\"loader\"></span>\n <span class=\"chevron\">\n <ore-icon name=\"chevron-down\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </span>\n </span>\n </ore-input>\n <span\n class=\"sr-only\"\n id=\"${() => `${comboId}-error`}\"\n role=\"alert\"\n aria-live=\"assertive\"\n ?hidden=\"${() => !props.error.value}\">\n ${() => props.error.value ?? ''}\n </span>\n <div\n class=\"dropdown\"\n part=\"dropdown\"\n id=\"${() => `${comboId}-dropdown`}\"\n popover=\"manual\"\n ?data-open=${() => isOpen.value}\n ref=${(el: HTMLElement | null) => {\n dropdownEl = el;\n }}>\n <div\n role=\"listbox\"\n id=\"${() => `${comboId}-listbox`}\"\n style=\"${() =>\n isOpen.value && filteredOptions.value.length > 0 ? `height:${filteredOptions.value.length * 36}px;` : ''}\"\n aria-label=\"${() => props.label.value || props.placeholder.value || 'Options'}\"\n ref=${(el: HTMLElement | null) => {\n setListboxElement(el);\n }}>\n ${() => {\n if (!isOpen.value) return '';\n\n if (isLoading()) {\n return html`\n <div class=\"dropdown-loading\">Loading...</div>\n `;\n }\n\n if (filteredOptions.value.length === 0) {\n if (creatableLabel.value) {\n return html`\n <button type=\"button\" class=\"no-results-create\" ?data-focused=${() => focusedIndex.value === -1}>\n ${creatableLabel.value}\n </button>\n `;\n }\n\n return html`\n <div class=\"no-results\" role=\"presentation\">No results found</div>\n `;\n }\n\n return filteredOptions.value.map((option, index) => {\n return html`\n <div\n class=\"option\"\n role=\"option\"\n id=\"${`${comboId}-opt-${index}`}\"\n data-option-index=\"${index}\"\n data-option-value=\"${option.value}\"\n aria-selected=\"${() =>\n String(\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value,\n )}\"\n aria-disabled=\"${String(option.disabled)}\"\n style=\"${`position:absolute;top:0;left:0;right:0;transform:translateY(${index * 36}px);`}\"\n ?data-focused=${() => focusedIndex.value === index}\n ?data-selected=${() =>\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value}\n ?data-disabled=${option.disabled}>\n <span>${option.label}</span>\n <span class=\"option-check\" aria-hidden=\"true\">\n <ore-icon name=\"check\" size=\"14\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </span>\n </div>\n `;\n });\n }}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin, componentStyles],\n}) as unknown as AddEventListeners<OreComboboxEvents>;\n"],"mappings":";;;;;;;;;;;;;AA6EA,IAAa,IAAe;AAC5B,EAAyB,GAAc;CACrC,gBAAgB;CAChB,OAAO;EACL,WAAW,EAAK,KAAK,EAAK;EAC1B,OAAO,EAAK,OAAmB;EAC/B,WAAW,EAAK,KAAK,EAAK;EAC1B,UAAU,EAAK,KAAK,EAAK;EACzB,OAAO,EAAK,OAAO;EACnB,WAAW,EAAK,KAAK,EAAK;EAC1B,QAAQ,EAAK,OAAO;EACpB,OAAO,EAAK,OAAO;EACnB,mBAAmB,EAAK,MAAM,CAAC,SAAS,SAAS,GAAY,OAAO;EACpE,SAAS,EAAK,KAAK,EAAK;EACxB,UAAU,EAAK,KAAK,EAAK;EACzB,MAAM,EAAK,OAAO;EAClB,aAAa,EAAK,KAAK,EAAK;EAC5B,SAAS,EAAK,KAA4B;EAC1C,aAAa,EAAK,OAAO,WAAW;EACpC,UAAU,EAAK,KAAK,EAAK;EACzB,SAAS,EAAK,OAAoB;EAClC,MAAM,EAAK,OAAsB;EACjC,SAAS,EAAK,KAAK,EAAK;EACxB,OAAO,EAAK,OAAO;EACnB,SAAS,EAAK,OAA4D;CAC5E;CACA,MAAM,GAAO;EACX,IAAM,IAAK,GAAQ,GACb,IAAO,GAA2B,GAClC,IAAQ,IAER,IAAQ,EAAO,EAAE,GA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AqB;EAAa;CAAe;AACjG,CAAC"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":[],"sources":["../src/inputs/combobox/combobox.ts"],"sourcesContent":["import {\n bind,\n define,\n getHost,\n html,\n onCleanup,\n onElement,\n prop,\n ref,\n useEmit,\n useField,\n watchEffect,\n} from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport {\n createChoiceField,\n createInteraction,\n createListboxDropdown,\n type DropdownCloseReason,\n lifecycleSignal,\n type OverlayOpenReason,\n} from '../../core';\nimport { colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin } from '../../styles';\nimport type { AddEventListeners, ComponentSize, RoundedSize, ThemeColor } from '../../types';\nimport { dispatchNativeFieldEvent } from '../shared/native-field-event';\nimport type { ComboboxOptionInput, ComboboxOptionItem, OreComboboxEvents, OreComboboxProps } from './combobox.types';\nimport { filterOptions, getCreatableLabel, makeCreatableValue, parseSlottedOptions } from './combobox-options';\nimport '../../feedback/chip/chip';\nimport '../input/input';\nimport componentStyles from './combobox.css?inline';\n\nexport type { OreComboboxEvents, OreComboboxProps } from './combobox.types';\n\n/**\n * A searchable select field with multiple selection, custom option creation, and large-list support.\n *\n * @element ore-combobox\n *\n * @attr {string} value - Selected value(s). Use comma-separated for multiple.\n * @attr {boolean} multiple - Enable multiple selection\n * @attr {boolean} creatable - Allow users to create custom options from search query\n * @attr {boolean} no-filter - Disable client-side filtering (useful for server-side search)\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} required - Require a non-blank selection for native form validation\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n *\n * @fires input - Emitted when the selection changes.\n * @fires change - Emitted when the selection changes.\n * @fires open-change - Emitted when the dropdown state changes. detail: { open, reason }\n * @fires {CustomEvent} search - Emitted when user types. detail: { query: string }\n *\n * @slot - Slotted combobox options and option groups\n * @cssprop --combobox-dropdown-bg - Dropdown panel background color\n * @cssprop --combobox-dropdown-border-color - Dropdown panel border color\n * @cssprop --combobox-option-hover-bg - Option background on hover\n * @cssprop --combobox-option-focus-bg - Option background when keyboard-focused\n * @cssprop --combobox-option-selected-bg - Option background when selected\n * @cssprop --combobox-option-selected-focus-bg - Option background when selected and focused\n * @cssprop --input-bg - Field background (passed through to ore-input)\n * @cssprop --input-border-color - Field border color (passed through to ore-input)\n *\n * @part wrapper - Root wrapper around the entire field\n * @part label - Label element shown inside or outside the field\n * @part field - Field container that holds the trigger input and clear button\n * @part input - Search input used to filter and select options\n * @part clear-btn - Button that clears the current selection/query\n * @part dropdown - Popup list container for options\n * @part helper-text - Helper text displayed below the field\n * @example\n * ```html\n * <ore-combobox label=\"Country\" name=\"country\">\n * <ore-combobox-option value=\"us\">United States</ore-combobox-option>\n * <ore-combobox-option value=\"gb\">United Kingdom</ore-combobox-option>\n * <ore-combobox-option value=\"de\" disabled>Germany</ore-combobox-option>\n * </ore-combobox>\n * ```\n */\nexport const COMBOBOX_TAG = 'ore-combobox' as const;\ndefine<OreComboboxProps>(COMBOBOX_TAG, {\n formAssociated: true,\n props: {\n autoclose: prop.bool(false),\n color: prop.string<ThemeColor>(),\n creatable: prop.bool(false),\n disabled: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n multiple: prop.bool(false),\n name: prop.string(),\n 'no-filter': prop.bool(false),\n options: prop.data<ComboboxOptionInput[]>(),\n placeholder: prop.string('Select...'),\n required: prop.bool(false),\n rounded: prop.string<RoundedSize>(),\n size: prop.string<ComponentSize>(),\n success: prop.bool(false),\n value: prop.string(),\n variant: prop.string<'flat' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreComboboxEvents>();\n const watch = watchEffect;\n\n const query = signal('');\n\n // Element refs needed by the listbox dropdown.\n let inputEl: HTMLInputElement | null = null;\n let fieldEl: HTMLElement | null = null; // set to the ore-input host once it mounts\n let dropdownEl: HTMLElement | null = null;\n let listboxEl: HTMLElement | null = null;\n\n // Ref to the ore-input host; resolved when the template renders.\n const bitInputRef = ref<HTMLElement>();\n\n const abortSignal = lifecycleSignal(onCleanup);\n const choice = createChoiceField({\n disabled: props.disabled,\n error: props.error,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n multiple: props.multiple,\n prefix: 'combobox',\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n // filteredOptions signal declared before optionList so the getItems getter\n // captures the live signal reference rather than needing a factory indirection.\n const filteredOptions = signal<ComboboxOptionItem[]>([]);\n\n const optionList = createListboxDropdown<ComboboxOptionItem>({\n getBoundary: () => el,\n getFocusedOptionElement: () => dropdownEl?.querySelector<HTMLElement>('[data-focused]') ?? null,\n getItems: () => filteredOptions.value,\n getOptionId: (index) => `${choice.fieldId}-opt-${index}`,\n getPanel: () => dropdownEl,\n getReference: () => fieldEl,\n getTrigger: () => inputEl,\n isDisabled: () => choice.disabled.value,\n isItemDisabled: (option) => option.disabled,\n onClose: (reason) => {\n emit('open-change', { open: false, reason });\n\n if (!abortSignal.aborted) restoreQueryFromSelection();\n\n choice.triggerValidation('blur');\n },\n onOpen: (reason) => emit('open-change', { open: true, reason }),\n restoreFocus: false,\n signal: abortSignal,\n });\n\n const { disabled: isDisabled, fieldId: comboId, selectedValues, triggerValidation } = choice;\n\n choice.attachFormField(\n useField<string>({\n disabled: choice.disabled,\n onReset: choice.reset,\n toFormValue: (v) => v,\n validationMessage: choice.validationMessage,\n validity: choice.validity,\n value: choice.formValue,\n }),\n );\n\n const { focusedIndex, isOpen, scrollFocusedIntoView, updatePosition } = optionList;\n // ── State ────────────────────────────────────────────────────────────────\n const isMultiple = () => Boolean(props.multiple.value);\n const isCreatable = () => Boolean(props.creatable.value);\n const isNoFilter = () => Boolean(props['no-filter'].value);\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n size: props.size,\n variant: props.variant,\n },\n });\n\n let lastQueryBeforeClear: string | null = null;\n let isRestoringQuery = false;\n\n const selectedValue = computed(() => selectedValues.value[0] ?? '');\n\n // Expose a native-like, string-valued `.value` property on the host.\n Object.defineProperty(el, 'value', {\n configurable: true,\n get: () => choice.formValue.value,\n set: (val: unknown) => {\n const v = val as string | string[] | null | undefined;\n\n if (Array.isArray(v)) {\n choice.setValues(v.map((entry) => String(entry ?? '')));\n\n return;\n }\n\n if (v == null || v === '') {\n choice.clear();\n\n return;\n }\n\n choice.setValues(isMultiple() ? String(v).split(',') : [String(v)]);\n },\n });\n\n const hasValue = () => selectedValues.value.length > 0;\n\n function focusLiveInput() {\n inputEl?.focus();\n }\n\n // ── Options ──────────────────────────────────────────────────────────────\n const slottedOptions = signal<ComboboxOptionItem[]>([]);\n const createdOptions = signal<ComboboxOptionItem[]>([]);\n const isLoading = () => Boolean(props.loading.value);\n\n function normalizeOption(option: ComboboxOptionInput): ComboboxOptionItem {\n return {\n disabled: Boolean(option.disabled),\n iconEl: option.iconEl ?? null,\n label: option.label ?? option.value,\n value: option.value,\n };\n }\n\n // Merged options: explicit prop value overrides slotted options.\n const allOptions = computed<ComboboxOptionItem[]>(() => {\n const optionsProp = props.options.value;\n const base = Array.isArray(optionsProp) ? optionsProp.map(normalizeOption) : slottedOptions.value;\n\n if (createdOptions.value.length === 0) return base;\n\n return [...base, ...createdOptions.value];\n });\n\n const selectionController = {\n clear: () => {\n choice.clear();\n },\n remove: (key: string) => {\n choice.removeValue(key);\n },\n select: (key: string) => {\n choice.selectValue(key);\n },\n toggle: (key: string) => {\n choice.toggleValue(key);\n },\n };\n\n function readOptions(elements: Element[] = Array.from(el.children)) {\n slottedOptions.value = parseSlottedOptions(elements);\n\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n query.value = match?.label ?? selectedValue.value;\n }\n }\n\n // Initialize from light DOM immediately; onMounted/observer keep this in sync afterwards.\n readOptions();\n\n watch(() => {\n const nextOptions = filterOptions(allOptions.value, query.value, isNoFilter());\n\n filteredOptions.value = isMultiple()\n ? nextOptions.filter((option) => !selectedValues.value.includes(option.value))\n : nextOptions;\n });\n\n // \"Create\" option shown when creatable + query doesn't match any existing option\n const creatableLabel = computed(() => {\n return getCreatableLabel(query.value, isCreatable(), filteredOptions.value);\n });\n const inputPlaceholder = () =>\n isMultiple() && selectedValues.value.length > 0 ? '' : props.placeholder.value || '';\n\n function emitChange() {\n dispatchNativeFieldEvent(el, 'input');\n dispatchNativeFieldEvent(el, 'change');\n }\n\n function removeChip(event: Event): void {\n event.stopPropagation();\n\n const value = (event as CustomEvent<{ value?: string }>).detail?.value;\n\n if (value === undefined) return;\n\n selectionController.remove(value);\n emitChange();\n triggerValidation('change');\n }\n\n function restoreQueryFromSelection() {\n // Keep input text and selected value in sync whenever the popup closes.\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n isRestoringQuery = true;\n query.value = match?.label ?? '';\n Promise.resolve().then(() => {\n isRestoringQuery = false;\n });\n\n return;\n }\n\n query.value = '';\n }\n\n watch(() => {\n if (isOpen.value && !isMultiple() && selectedValue.value && focusedIndex.value === -1 && query.value === '') {\n const selectedIndex = filteredOptions.value.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n });\n\n // ── Open / Close ─────────────────────────────────────────────────────────\n function openPopup(clearFilter = true, reason: OverlayOpenReason = 'programmatic') {\n if (clearFilter) {\n lastQueryBeforeClear = query.value;\n query.value = '';\n }\n\n // Pre-compute focused index BEFORE opening so the first render has it set\n if (!isMultiple() && selectedValue.value) {\n const freshOptions = filterOptions(allOptions.value, '', isNoFilter());\n const selectedIndex = freshOptions.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n\n optionList.open(reason);\n\n if (!isMultiple() && selectedValue.value && focusedIndex.value >= 0) {\n requestAnimationFrame(() => {\n scrollFocusedIntoView();\n });\n }\n }\n\n function closePopup(reason: DropdownCloseReason = 'programmatic') {\n optionList.close(reason);\n }\n\n const fieldPress = createInteraction({\n disabled: isDisabled,\n onPress: () => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n },\n });\n\n const enterPress = createInteraction({\n disabled: isDisabled,\n keys: ['Enter'],\n onPress: (originalEvent: Event) => {\n const opts = filteredOptions.value;\n\n if (isOpen.value && focusedIndex.value >= 0 && focusedIndex.value < opts.length) {\n selectOption(opts[focusedIndex.value], originalEvent);\n } else if (isOpen.value && focusedIndex.value === -1 && creatableLabel.value) {\n // Focused on the \"create\" item\n createOption(query.value, originalEvent);\n } else if (!isOpen.value) {\n openPopup(true, 'keyboard');\n }\n },\n });\n\n // ── Selection ────────────────────────────────────────────────────────────\n function selectOption(opt: ComboboxOptionItem, _originalEvent?: Event) {\n if (opt.disabled) return;\n\n if (isMultiple()) {\n selectionController.toggle(opt.value);\n query.value = '';\n emitChange();\n triggerValidation('change');\n\n if (props.autoclose.value) {\n closePopup();\n }\n\n // Keep dropdown open in multiple mode (unless autoclose is true)\n focusLiveInput();\n requestAnimationFrame(() => focusLiveInput());\n } else {\n selectionController.select(opt.value);\n query.value = opt.label;\n emitChange();\n triggerValidation('change');\n closePopup();\n focusLiveInput();\n }\n }\n function resolveOptionFromElement(optionEl: HTMLElement): ComboboxOptionItem | null {\n const indexAttr = optionEl.getAttribute('data-option-index');\n const index = indexAttr ? Number(indexAttr) : -1;\n\n if (Number.isInteger(index) && index >= 0 && index < filteredOptions.value.length) {\n return filteredOptions.value[index] ?? null;\n }\n\n const valueAttr = optionEl.getAttribute('data-option-value');\n\n if (valueAttr) {\n const byValue = filteredOptions.value.find((option) => option.value === valueAttr);\n\n if (byValue) return byValue;\n }\n\n const labelText = optionEl.querySelector('span')?.textContent?.trim() ?? optionEl.textContent?.trim() ?? '';\n\n if (!labelText) return null;\n\n return filteredOptions.value.find((option) => option.label === labelText || option.value === labelText) ?? null;\n }\n function clearValue(e: Event) {\n e.stopPropagation();\n selectionController.clear();\n query.value = '';\n emitChange();\n triggerValidation('change');\n focusLiveInput();\n }\n function handleInput(e: InputEvent) {\n const target = e.target as HTMLInputElement;\n const newValue = target.value;\n\n // Skip all input processing if we're in the middle of restoring the query\n // This prevents the clearing logic from firing during close/restore\n if (isRestoringQuery) {\n return;\n }\n\n if (newValue === query.value) return;\n\n query.value = newValue;\n\n if (!isMultiple()) {\n const currentItem = selectedValues.value[0];\n const currentLabel = currentItem\n ? (allOptions.value.find((o) => o.value === currentItem)?.label ?? currentItem)\n : '';\n\n // Preserve the current selection while typing. Selection should only\n // change when a new option is committed or when the user explicitly clears.\n const isJustOpening = newValue === '' && lastQueryBeforeClear === currentLabel;\n\n if (isJustOpening) {\n lastQueryBeforeClear = null;\n }\n }\n\n optionList.navigate('first');\n\n if (!isOpen.value) openPopup(false, 'keyboard');\n\n emit('search', { query: target.value });\n }\n function handleFocus() {\n // Intentionally no-op: open only on explicit click or keyboard.\n // Opening on every focus surprises users tabbing through a form.\n }\n\n // ── Keyboard Navigation ──────────────────────────────────────────────────\n function handleKeydown(e: KeyboardEvent) {\n if (isDisabled.value) return;\n\n if (optionList.handleKeydown(e)) return;\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n optionList.navigate('first');\n } else {\n optionList.navigate('next');\n }\n\n break;\n case 'ArrowUp':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n } else {\n optionList.navigate('prev');\n }\n\n break;\n case 'Backspace':\n // In multiple mode, remove the last chip when the input is empty\n if (isMultiple() && !query.value && selectedValues.value.length > 0) {\n choice.removeValue(selectedValues.value[selectedValues.value.length - 1] ?? '');\n emitChange();\n triggerValidation('change');\n }\n\n break;\n case 'Enter':\n enterPress.handleKeydown(e);\n\n break;\n case 'Tab':\n closePopup('programmatic');\n break;\n default:\n break;\n }\n }\n\n // ── Create option ────────────────────────────────────────────────────────\n function createOption(rawQuery: string, originalEvent?: Event) {\n const actualLabel = rawQuery.trim();\n\n if (!actualLabel) return;\n\n const value = makeCreatableValue(actualLabel);\n const newOpt: ComboboxOptionItem = { disabled: false, iconEl: null, label: actualLabel, value };\n\n createdOptions.value = [...createdOptions.value, newOpt];\n selectOption(newOpt, originalEvent);\n }\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n const observeLightDomOptions = (): (() => void) => {\n const observer = new MutationObserver(() => {\n readOptions();\n });\n\n observer.observe(el, {\n attributeFilter: ['disabled', 'label', 'value'],\n attributes: true,\n childList: true,\n subtree: true,\n });\n\n return () => observer.disconnect();\n };\n\n const stopObserving = observeLightDomOptions();\n\n const createListboxListeners = (listEl: HTMLElement): (() => void) => {\n const handleActivate = (event: Event) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const createRow = target.closest<HTMLElement>('.no-results-create');\n\n if (createRow) {\n event.preventDefault();\n event.stopPropagation();\n createOption(query.value, event);\n\n return;\n }\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option || option.disabled) return;\n\n selectOption(option, event);\n };\n\n const handlePointerMove = (event: PointerEvent) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option) return;\n\n const focusedIdx = filteredOptions.value.findIndex((candidate) => candidate.value === option.value);\n\n if (focusedIdx >= 0) {\n optionList.set(focusedIdx);\n }\n };\n\n listEl.addEventListener('click', handleActivate);\n listEl.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n listEl.removeEventListener('click', handleActivate);\n listEl.removeEventListener('pointermove', handlePointerMove);\n };\n };\n\n let stopListboxListeners: (() => void) | null = null;\n let listboxListenersTarget: HTMLElement | null = null;\n\n const setListboxElement = (el: HTMLElement | null): void => {\n listboxEl = el;\n\n if (listboxListenersTarget === el) return;\n\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n\n if (!el) return;\n\n stopListboxListeners = createListboxListeners(el);\n listboxListenersTarget = el;\n };\n\n const ensureListboxListeners = (): void => {\n if (!listboxEl) return;\n\n if (listboxListenersTarget === listboxEl && stopListboxListeners) return;\n\n stopListboxListeners?.();\n stopListboxListeners = createListboxListeners(listboxEl);\n listboxListenersTarget = listboxEl;\n };\n\n watch(() => {\n ensureListboxListeners();\n\n if (isOpen.value) {\n if (dropdownEl && 'showPopover' in dropdownEl && !dropdownEl.matches(':popover-open')) dropdownEl.showPopover();\n\n updatePosition();\n } else {\n if (dropdownEl && 'hidePopover' in dropdownEl && dropdownEl.matches(':popover-open')) dropdownEl.hidePopover();\n }\n });\n\n // Once ore-input is in the DOM, grab its inner <input> from its shadow root\n // and attach all combobox-specific ARIA + event handlers imperatively.\n // MUST be registered before the ARIA effects below so inputEl is set first\n // when bitInputRef fires (effects run in registration order).\n onElement(bitInputRef, (bitInputEl) => {\n fieldEl = bitInputEl;\n\n const rawInput = bitInputEl.shadowRoot?.querySelector<HTMLInputElement>('input') ?? null;\n\n if (!rawInput) return;\n\n inputEl = rawInput;\n\n rawInput.setAttribute('role', 'combobox');\n rawInput.setAttribute('autocomplete', 'off');\n rawInput.setAttribute('aria-autocomplete', 'list');\n rawInput.setAttribute('aria-haspopup', 'listbox');\n rawInput.setAttribute('spellcheck', 'false');\n rawInput.setAttribute('aria-controls', `${comboId}-listbox`);\n\n const handleInputClick = (): void => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n };\n\n rawInput.addEventListener('input', handleInput as EventListener);\n rawInput.addEventListener('keydown', handleKeydown as EventListener);\n rawInput.addEventListener('focus', handleFocus);\n rawInput.addEventListener('click', handleInputClick);\n\n return () => {\n inputEl = null;\n fieldEl = null;\n rawInput.removeEventListener('input', handleInput as EventListener);\n rawInput.removeEventListener('keydown', handleKeydown as EventListener);\n rawInput.removeEventListener('focus', handleFocus);\n rawInput.removeEventListener('click', handleInputClick);\n };\n });\n\n // Reactively sync combobox-specific ARIA attrs that ore-input doesn't manage.\n // Uses bitInputRef (a signal) as the gate so the effect re-runs when the\n // inner input mounts — inputEl is a plain variable and would not trigger re-runs.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n el.setAttribute('aria-expanded', String(isOpen.value));\n\n if (isDisabled.value) {\n el.setAttribute('aria-disabled', 'true');\n } else {\n el.removeAttribute('aria-disabled');\n }\n\n if (props.error.value) {\n el.setAttribute('aria-invalid', 'true');\n el.setAttribute('aria-errormessage', `${comboId}-error`);\n } else {\n el.removeAttribute('aria-invalid');\n el.removeAttribute('aria-errormessage');\n }\n });\n\n // Reactively sync the query signal into the raw input value.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n if (el.value !== query.value) el.value = query.value;\n });\n\n onCleanup(() => {\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n stopObserving();\n });\n\n const inputColor = () => props.color?.value ?? undefined;\n const inputSize = () => props.size?.value ?? undefined;\n const inputVariant = () => props.variant?.value ?? undefined;\n const inputRounded = () => props.rounded?.value ?? undefined;\n const inputFullwidth = () => (props.fullwidth.value ? true : undefined);\n\n return html`\n <slot></slot>\n <ore-input\n class=\"trigger\"\n ref=${bitInputRef}\n label=\"${() => props.label.value ?? ''}\"\n placeholder=\"${inputPlaceholder}\"\n label-placement=\"${() => props['label-placement'].value ?? 'inset'}\"\n color=\"${inputColor}\"\n size=\"${inputSize}\"\n variant=\"${inputVariant}\"\n rounded=\"${inputRounded}\"\n helper=\"${() => props.helper.value ?? ''}\"\n error=\"${() => props.error.value ?? ''}\"\n ?disabled=\"${isDisabled}\"\n ?required=\"${() => false}\"\n ?fullwidth=\"${inputFullwidth}\"\n ?success=\"${() => props.success.value}\"\n name=\"${() => props.name.value ?? ''}\"\n @click=\"${(e: MouseEvent) => {\n fieldPress.handleClick(e);\n }}\"\n part=\"wrapper\">\n <div slot=\"prefix\" class=\"chips-row\">\n <!-- Keep chip list diffing isolated so input node identity stays stable. -->\n <span class=\"chips-list\">\n ${() =>\n (isMultiple() ? selectedValues.value : []).map(\n (value) => html`\n <ore-chip\n value=${value}\n label=${allOptions.value.find((option) => option.value === value)?.label ?? value}\n mode=\"removable\"\n variant=\"flat\"\n size=\"sm\"\n color=\"${props.color}\"\n @remove=${removeChip}>\n ${allOptions.value.find((option) => option.value === value)?.label ?? value}\n </ore-chip>\n `,\n )}\n </span>\n </div>\n <span slot=\"suffix\" class=\"combobox-suffix\" aria-hidden=\"true\">\n <button\n class=\"clear-btn\"\n part=\"clear-btn\"\n type=\"button\"\n aria-label=\"Clear\"\n tabindex=\"-1\"\n ?hidden=${() => !hasValue()}\n @click=\"${clearValue}\">\n <ore-icon name=\"x\" size=\"12\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </button>\n <span class=\"combobox-suffix-end\">\n <span class=\"loader\"></span>\n <span class=\"chevron\">\n <ore-icon name=\"chevron-down\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </span>\n </span>\n </ore-input>\n <span\n class=\"sr-only\"\n id=\"${() => `${comboId}-error`}\"\n role=\"alert\"\n aria-live=\"assertive\"\n ?hidden=\"${() => !props.error.value}\">\n ${() => props.error.value ?? ''}\n </span>\n <div\n class=\"dropdown\"\n part=\"dropdown\"\n id=\"${() => `${comboId}-dropdown`}\"\n popover=\"manual\"\n ?data-open=${() => isOpen.value}\n ref=${(el: HTMLElement | null) => {\n dropdownEl = el;\n }}>\n <div\n role=\"listbox\"\n id=\"${() => `${comboId}-listbox`}\"\n style=\"${() =>\n isOpen.value && filteredOptions.value.length > 0 ? `height:${filteredOptions.value.length * 36}px;` : ''}\"\n aria-label=\"${() => props.label.value || props.placeholder.value || 'Options'}\"\n ref=${(el: HTMLElement | null) => {\n setListboxElement(el);\n }}>\n ${() => {\n if (!isOpen.value) return '';\n\n if (isLoading()) {\n return html`\n <div class=\"dropdown-loading\">Loading...</div>\n `;\n }\n\n if (filteredOptions.value.length === 0) {\n if (creatableLabel.value) {\n return html`\n <button type=\"button\" class=\"no-results-create\" ?data-focused=${() => focusedIndex.value === -1}>\n ${creatableLabel.value}\n </button>\n `;\n }\n\n return html`\n <div class=\"no-results\" role=\"presentation\">No results found</div>\n `;\n }\n\n return filteredOptions.value.map((option, index) => {\n return html`\n <div\n class=\"option\"\n role=\"option\"\n id=\"${`${comboId}-opt-${index}`}\"\n data-option-index=\"${index}\"\n data-option-value=\"${option.value}\"\n aria-selected=\"${() =>\n String(\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value,\n )}\"\n aria-disabled=\"${String(option.disabled)}\"\n style=\"${`position:absolute;top:0;left:0;right:0;transform:translateY(${index * 36}px);`}\"\n ?data-focused=${() => focusedIndex.value === index}\n ?data-selected=${() =>\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value}\n ?data-disabled=${option.disabled}>\n <span>${option.label}</span>\n <span class=\"option-check\" aria-hidden=\"true\">\n <ore-icon name=\"check\" size=\"14\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </span>\n </div>\n `;\n });\n }}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin, componentStyles],\n}) as unknown as AddEventListeners<OreComboboxEvents>;\n"],"mappings":";;;;;;;;;;;;;AA6EA,IAAa,IAAe;AAC5B,EAAyB,GAAc;CACrC,gBAAgB;CAChB,OAAO;EACL,WAAW,EAAK,KAAK,EAAK;EAC1B,OAAO,EAAK,OAAmB;EAC/B,WAAW,EAAK,KAAK,EAAK;EAC1B,UAAU,EAAK,KAAK,EAAK;EACzB,OAAO,EAAK,OAAO;EACnB,WAAW,EAAK,KAAK,EAAK;EAC1B,QAAQ,EAAK,OAAO;EACpB,OAAO,EAAK,OAA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M;;;;;eAM1B,IA9CyB,GA+C1B;;;;CAIV;CACA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EAAC;EAAiB;EAAoB;EAAqB;EAAa;CAAe;AACjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/content/carousel/carousel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/content/carousel/carousel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,yBAAyB,CAAC;AACjC,OAAO,kCAAkC,CAAC;AAG1C,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,UAAU,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2CAA2C;IAC3C,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,6DAA6D;IAC7D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,YAAY,EAAG,cAAuB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let e=require("@vielzeug/gesture");var t=64,n=192,r=.85;function i(i,a,o){let s=e=>e.distance<0?`right`:`left`,c=()=>{i.removeAttribute(`data-dragging`),i.removeAttribute(`data-confirming`),i.style.removeProperty(`--_swipe-x`)},l;return l=(0,e.createPanGesture)(a,{axis:`x`,disabled:()=>o.disabled.value,onEnd:e=>{if(c(),e.reason!==`release`)return;let n=s(e);o.hasActions(n)&&Math.abs(e.distance)>=t&&i.setAttribute(`revealed`,n)},onMove:e=>{let a=s(e);if(!o.hasActions(a))return;let c=Math.abs(e.distance);if(c>=n){l.cancel(),i.removeAttribute(`revealed`),o.onConfirm(a);return}let u=Math.min(c/t,1);i.setAttribute(`data-dragging`,``),i.toggleAttribute(`data-confirming`,c/n>=r),i.style.setProperty(`--_swipe-x`,String((a===`left`?1:-1)*u))},pointerCapture:!1}),l}exports.createRevealState=i;
|
|
2
2
|
//# sourceMappingURL=_list-item-reveal.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-item-reveal.cjs","names":[],"sources":["../../../src/content/list/_list-item-reveal.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"_list-item-reveal.cjs","names":[],"sources":["../../../src/content/list/_list-item-reveal.ts"],"sourcesContent":["import { createPanGesture, type PanGesture, type PanGestureDetail } from '@vielzeug/gesture';\nimport type { Readable } from '@vielzeug/ripple';\nimport type { ListItemRevealSide } from './list-item';\n\n/** Drag distance (px) past which the action panel snaps fully open on release. */\nconst REVEAL_THRESHOLD = 64;\n/** Drag distance (px) past which the swipe auto-confirms the action — \"swiped all the way\". */\nconst CONFIRM_THRESHOLD = REVEAL_THRESHOLD * 3;\n/** Fraction of CONFIRM_THRESHOLD past which `data-confirming` warns the drag is about to fire. */\nconst CONFIRM_WARNING_RATIO = 0.85;\n\nexport type RevealStateOptions = {\n disabled: Readable<boolean>;\n hasActions: (side: ListItemRevealSide) => boolean;\n /** The full-swipe-through gesture fired — emit `confirm` and click the slot's own action. */\n onConfirm: (side: ListItemRevealSide) => void;\n};\n\n/**\n * The swipe-reveal-confirm gesture behind `ore-list-item`'s `actions-left`/`actions-right` slots\n * — isolated here since it's the one genuinely tricky part of the component (three distance\n * thresholds, inline style/attribute choreography during an active drag). Deliberately *not* a\n * shared primitive: `createPanGesture` itself already is one (shared with `ore-toast`),\n * but this two-stage reveal/confirm layer on top of it has exactly one consumer today —\n * generalizing it further would be speculative, not reusable.\n *\n * Only sets/clears the `revealed`/`data-dragging`/`data-confirming` attributes and `--_swipe-x`\n * style — it does not itself emit `reveal`/`conceal`. `ore-list-item` already watches `revealed`\n * for transitions (to cover *both* this gesture and a directly-set attribute uniformly), so this\n * module setting the attribute is enough to drive both that watcher and `list.css`'s\n * `[revealed]` styling.\n */\nexport function createRevealState(el: HTMLElement, target: Element, options: RevealStateOptions): PanGesture {\n const resolveSide = (detail: PanGestureDetail): ListItemRevealSide => (detail.distance < 0 ? 'right' : 'left');\n\n // Inline `--_swipe-x` override during an active drag lets the row (and both action panels,\n // which read the same variable) follow the pointer 1:1 with no transition lag. Clearing it\n // hands control back to the `[revealed]`/`:focus-within` CSS rules in list-item.css, which\n // then animate normally via the CSS `transition`.\n const resetInline = (): void => {\n el.removeAttribute('data-dragging');\n el.removeAttribute('data-confirming');\n el.style.removeProperty('--_swipe-x');\n };\n\n let pan: PanGesture;\n\n pan = createPanGesture(target, {\n axis: 'x',\n disabled: () => options.disabled.value,\n onEnd: (detail) => {\n resetInline();\n\n if (detail.reason !== 'release') return;\n\n const side = resolveSide(detail);\n\n if (options.hasActions(side) && Math.abs(detail.distance) >= REVEAL_THRESHOLD) el.setAttribute('revealed', side);\n },\n onMove: (detail) => {\n const side = resolveSide(detail);\n\n if (!options.hasActions(side)) return;\n\n const distance = Math.abs(detail.distance);\n\n if (distance >= CONFIRM_THRESHOLD) {\n pan.cancel();\n el.removeAttribute('revealed');\n options.onConfirm(side);\n\n return;\n }\n\n const revealProgress = Math.min(distance / REVEAL_THRESHOLD, 1);\n\n el.setAttribute('data-dragging', '');\n el.toggleAttribute('data-confirming', distance / CONFIRM_THRESHOLD >= CONFIRM_WARNING_RATIO);\n el.style.setProperty('--_swipe-x', String((side === 'left' ? 1 : -1) * revealProgress));\n },\n pointerCapture: false,\n });\n\n return pan;\n}\n"],"mappings":"mCAKA,IAAM,EAAmB,GAEnB,EAAoB,IAEpB,EAAwB,IAuB9B,SAAgB,EAAkB,EAAiB,EAAiB,EAAyC,CAC3G,IAAM,EAAe,GAAkD,EAAO,SAAW,EAAI,QAAU,OAMjG,MAA0B,CAC9B,EAAG,gBAAgB,eAAe,EAClC,EAAG,gBAAgB,iBAAiB,EACpC,EAAG,MAAM,eAAe,YAAY,CACtC,EAEI,EAsCJ,MApCA,IAAA,EAAM,EAAA,iBAAA,CAAiB,EAAQ,CAC7B,KAAM,IACN,aAAgB,EAAQ,SAAS,MACjC,MAAQ,GAAW,CAGjB,GAFA,EAAY,EAER,EAAO,SAAW,UAAW,OAEjC,IAAM,EAAO,EAAY,CAAM,EAE3B,EAAQ,WAAW,CAAI,GAAK,KAAK,IAAI,EAAO,QAAQ,GAAK,GAAkB,EAAG,aAAa,WAAY,CAAI,CACjH,EACA,OAAS,GAAW,CAClB,IAAM,EAAO,EAAY,CAAM,EAE/B,GAAI,CAAC,EAAQ,WAAW,CAAI,EAAG,OAE/B,IAAM,EAAW,KAAK,IAAI,EAAO,QAAQ,EAEzC,GAAI,GAAY,EAAmB,CACjC,EAAI,OAAO,EACX,EAAG,gBAAgB,UAAU,EAC7B,EAAQ,UAAU,CAAI,EAEtB,MACF,CAEA,IAAM,EAAiB,KAAK,IAAI,EAAW,EAAkB,CAAC,EAE9D,EAAG,aAAa,gBAAiB,EAAE,EACnC,EAAG,gBAAgB,kBAAmB,EAAW,GAAqB,CAAqB,EAC3F,EAAG,MAAM,YAAY,aAAc,QAAQ,IAAS,OAAS,EAAI,IAAM,CAAc,CAAC,CACxF,EACA,eAAgB,EAClB,CAAC,EAEM,CACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type PanGesture } from '@vielzeug/gesture';
|
|
1
2
|
import type { Readable } from '@vielzeug/ripple';
|
|
2
|
-
import { type SwipeControl } from '../../core';
|
|
3
3
|
import type { ListItemRevealSide } from './list-item';
|
|
4
4
|
export type RevealStateOptions = {
|
|
5
5
|
disabled: Readable<boolean>;
|
|
@@ -11,7 +11,7 @@ export type RevealStateOptions = {
|
|
|
11
11
|
* The swipe-reveal-confirm gesture behind `ore-list-item`'s `actions-left`/`actions-right` slots
|
|
12
12
|
* — isolated here since it's the one genuinely tricky part of the component (three distance
|
|
13
13
|
* thresholds, inline style/attribute choreography during an active drag). Deliberately *not* a
|
|
14
|
-
*
|
|
14
|
+
* shared primitive: `createPanGesture` itself already is one (shared with `ore-toast`),
|
|
15
15
|
* but this two-stage reveal/confirm layer on top of it has exactly one consumer today —
|
|
16
16
|
* generalizing it further would be speculative, not reusable.
|
|
17
17
|
*
|
|
@@ -21,5 +21,5 @@ export type RevealStateOptions = {
|
|
|
21
21
|
* module setting the attribute is enough to drive both that watcher and `list.css`'s
|
|
22
22
|
* `[revealed]` styling.
|
|
23
23
|
*/
|
|
24
|
-
export declare function createRevealState(el: HTMLElement, options: RevealStateOptions):
|
|
24
|
+
export declare function createRevealState(el: HTMLElement, target: Element, options: RevealStateOptions): PanGesture;
|
|
25
25
|
//# sourceMappingURL=_list-item-reveal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-item-reveal.d.ts","sourceRoot":"","sources":["../../../src/content/list/_list-item-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"_list-item-reveal.d.ts","sourceRoot":"","sources":["../../../src/content/list/_list-item-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAyB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAStD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC;IAClD,6FAA6F;IAC7F,SAAS,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,UAAU,CAoD3G"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPanGesture as e } from "@vielzeug/gesture";
|
|
2
2
|
//#region src/content/list/_list-item-reveal.ts
|
|
3
3
|
var t = 64, n = 192, r = .85;
|
|
4
|
-
function i(i, a) {
|
|
5
|
-
let
|
|
4
|
+
function i(i, a, o) {
|
|
5
|
+
let s = (e) => e.distance < 0 ? "right" : "left", c = () => {
|
|
6
6
|
i.removeAttribute("data-dragging"), i.removeAttribute("data-confirming"), i.style.removeProperty("--_swipe-x");
|
|
7
|
-
};
|
|
8
|
-
return e({
|
|
9
|
-
axis:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
s(), a.hasActions(t) && (i.removeAttribute("revealed"), a.onConfirm(t));
|
|
7
|
+
}, l;
|
|
8
|
+
return l = e(a, {
|
|
9
|
+
axis: "x",
|
|
10
|
+
disabled: () => o.disabled.value,
|
|
11
|
+
onEnd: (e) => {
|
|
12
|
+
if (c(), e.reason !== "release") return;
|
|
13
|
+
let n = s(e);
|
|
14
|
+
o.hasActions(n) && Math.abs(e.distance) >= t && i.setAttribute("revealed", n);
|
|
16
15
|
},
|
|
17
16
|
onMove: (e) => {
|
|
18
|
-
let
|
|
19
|
-
if (!
|
|
20
|
-
let
|
|
21
|
-
|
|
17
|
+
let a = s(e);
|
|
18
|
+
if (!o.hasActions(a)) return;
|
|
19
|
+
let c = Math.abs(e.distance);
|
|
20
|
+
if (c >= n) {
|
|
21
|
+
l.cancel(), i.removeAttribute("revealed"), o.onConfirm(a);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let u = Math.min(c / t, 1);
|
|
25
|
+
i.setAttribute("data-dragging", ""), i.toggleAttribute("data-confirming", c / n >= r), i.style.setProperty("--_swipe-x", String((a === "left" ? 1 : -1) * u));
|
|
22
26
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
s(), a.hasActions(n) && Math.abs(e.distance) >= t && i.setAttribute("revealed", n);
|
|
26
|
-
},
|
|
27
|
-
threshold: () => n
|
|
28
|
-
});
|
|
27
|
+
pointerCapture: !1
|
|
28
|
+
}), l;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
export { i as createRevealState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-item-reveal.js","names":[],"sources":["../../../src/content/list/_list-item-reveal.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"_list-item-reveal.js","names":[],"sources":["../../../src/content/list/_list-item-reveal.ts"],"sourcesContent":["import { createPanGesture, type PanGesture, type PanGestureDetail } from '@vielzeug/gesture';\nimport type { Readable } from '@vielzeug/ripple';\nimport type { ListItemRevealSide } from './list-item';\n\n/** Drag distance (px) past which the action panel snaps fully open on release. */\nconst REVEAL_THRESHOLD = 64;\n/** Drag distance (px) past which the swipe auto-confirms the action — \"swiped all the way\". */\nconst CONFIRM_THRESHOLD = REVEAL_THRESHOLD * 3;\n/** Fraction of CONFIRM_THRESHOLD past which `data-confirming` warns the drag is about to fire. */\nconst CONFIRM_WARNING_RATIO = 0.85;\n\nexport type RevealStateOptions = {\n disabled: Readable<boolean>;\n hasActions: (side: ListItemRevealSide) => boolean;\n /** The full-swipe-through gesture fired — emit `confirm` and click the slot's own action. */\n onConfirm: (side: ListItemRevealSide) => void;\n};\n\n/**\n * The swipe-reveal-confirm gesture behind `ore-list-item`'s `actions-left`/`actions-right` slots\n * — isolated here since it's the one genuinely tricky part of the component (three distance\n * thresholds, inline style/attribute choreography during an active drag). Deliberately *not* a\n * shared primitive: `createPanGesture` itself already is one (shared with `ore-toast`),\n * but this two-stage reveal/confirm layer on top of it has exactly one consumer today —\n * generalizing it further would be speculative, not reusable.\n *\n * Only sets/clears the `revealed`/`data-dragging`/`data-confirming` attributes and `--_swipe-x`\n * style — it does not itself emit `reveal`/`conceal`. `ore-list-item` already watches `revealed`\n * for transitions (to cover *both* this gesture and a directly-set attribute uniformly), so this\n * module setting the attribute is enough to drive both that watcher and `list.css`'s\n * `[revealed]` styling.\n */\nexport function createRevealState(el: HTMLElement, target: Element, options: RevealStateOptions): PanGesture {\n const resolveSide = (detail: PanGestureDetail): ListItemRevealSide => (detail.distance < 0 ? 'right' : 'left');\n\n // Inline `--_swipe-x` override during an active drag lets the row (and both action panels,\n // which read the same variable) follow the pointer 1:1 with no transition lag. Clearing it\n // hands control back to the `[revealed]`/`:focus-within` CSS rules in list-item.css, which\n // then animate normally via the CSS `transition`.\n const resetInline = (): void => {\n el.removeAttribute('data-dragging');\n el.removeAttribute('data-confirming');\n el.style.removeProperty('--_swipe-x');\n };\n\n let pan: PanGesture;\n\n pan = createPanGesture(target, {\n axis: 'x',\n disabled: () => options.disabled.value,\n onEnd: (detail) => {\n resetInline();\n\n if (detail.reason !== 'release') return;\n\n const side = resolveSide(detail);\n\n if (options.hasActions(side) && Math.abs(detail.distance) >= REVEAL_THRESHOLD) el.setAttribute('revealed', side);\n },\n onMove: (detail) => {\n const side = resolveSide(detail);\n\n if (!options.hasActions(side)) return;\n\n const distance = Math.abs(detail.distance);\n\n if (distance >= CONFIRM_THRESHOLD) {\n pan.cancel();\n el.removeAttribute('revealed');\n options.onConfirm(side);\n\n return;\n }\n\n const revealProgress = Math.min(distance / REVEAL_THRESHOLD, 1);\n\n el.setAttribute('data-dragging', '');\n el.toggleAttribute('data-confirming', distance / CONFIRM_THRESHOLD >= CONFIRM_WARNING_RATIO);\n el.style.setProperty('--_swipe-x', String((side === 'left' ? 1 : -1) * revealProgress));\n },\n pointerCapture: false,\n });\n\n return pan;\n}\n"],"mappings":";;AAKA,IAAM,IAAmB,IAEnB,IAAoB,KAEpB,IAAwB;AAuB9B,SAAgB,EAAkB,GAAiB,GAAiB,GAAyC;CAC3G,IAAM,KAAe,MAAkD,EAAO,WAAW,IAAI,UAAU,QAMjG,UAA0B;EAG9B,AAFA,EAAG,gBAAgB,eAAe,GAClC,EAAG,gBAAgB,iBAAiB,GACpC,EAAG,MAAM,eAAe,YAAY;CACtC,GAEI;CAsCJ,OApCA,IAAM,EAAiB,GAAQ;EAC7B,MAAM;EACN,gBAAgB,EAAQ,SAAS;EACjC,QAAQ,MAAW;GAGjB,IAFA,EAAY,GAER,EAAO,WAAW,WAAW;GAEjC,IAAM,IAAO,EAAY,CAAM;GAE/B,AAAI,EAAQ,WAAW,CAAI,KAAK,KAAK,IAAI,EAAO,QAAQ,KAAK,KAAkB,EAAG,aAAa,YAAY,CAAI;EACjH;EACA,SAAS,MAAW;GAClB,IAAM,IAAO,EAAY,CAAM;GAE/B,IAAI,CAAC,EAAQ,WAAW,CAAI,GAAG;GAE/B,IAAM,IAAW,KAAK,IAAI,EAAO,QAAQ;GAEzC,IAAI,KAAY,GAAmB;IAGjC,AAFA,EAAI,OAAO,GACX,EAAG,gBAAgB,UAAU,GAC7B,EAAQ,UAAU,CAAI;IAEtB;GACF;GAEA,IAAM,IAAiB,KAAK,IAAI,IAAW,GAAkB,CAAC;GAI9D,AAFA,EAAG,aAAa,iBAAiB,EAAE,GACnC,EAAG,gBAAgB,mBAAmB,IAAW,KAAqB,CAAqB,GAC3F,EAAG,MAAM,YAAY,cAAc,QAAQ,MAAS,SAAS,IAAI,MAAM,CAAc,CAAC;EACxF;EACA,gBAAgB;CAClB,CAAC,GAEM;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../src/content/list/list-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../src/content/list/list-item.ts"],"names":[],"mappings":"AAqBA,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,qFAAqF;IACrF,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;IAC/B;;;OAGG;IACH,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACzD,gDAAgD;IAChD,QAAQ,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IACtD,0DAA0D;IAC1D,MAAM,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACxD,iGAAiG;IACjG,MAAM,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;CACrD,CAAC;AAEF,qCAAqC;AACrC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qGAAqG;IACrG,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,eAAO,MAAM,aAAa,EAAG,eAAwB,CAAC"}
|
package/dist/core/focus.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let e=require("@vielzeug/focus");function t(t){let n=null,r=null,i=!1,a=()=>{r!==null&&(cancelAnimationFrame(r),r=null)},o=()=>{i||(i=!0,a(),n=null)};return t.signal?.addEventListener(`abort`,o,{once:!0}),{applyInitialFocus(){a();let e=t.getInitialFocusSelector();if(e){let n=t.host.shadowRoot??t.host,i=null;try{i=n.querySelector(e)}catch{return}i&&(r=requestAnimationFrame(()=>{r=null,i.focus()}))}},cancelInitialFocus:a,captureReturnFocus(){n=(0,e.captureFocus)()},dispose:o,get disposed(){return i},restoreFocus(){t.getReturnFocus()!==!1&&n?.(),n=null},[Symbol.dispose]:o}}exports.createFocusManager=t;
|
|
2
2
|
//# sourceMappingURL=focus.cjs.map
|
package/dist/core/focus.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.cjs","names":[],"sources":["../../src/core/focus.ts"],"sourcesContent":["// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type FocusManagerOptions = {\n /**\n * Returns the CSS selector for the element that should receive focus on open.\n *\n * **Security note:** this value is passed directly to `querySelector`. It must\n * come from trusted developer-controlled configuration, never from raw user input.\n */\n getInitialFocusSelector: () => string | undefined;\n /**\n * Returns whether focus should be restored to the previously focused element\n * on close. `undefined` or `true` means restore; `false` means skip.\n */\n getReturnFocus: () => boolean | undefined;\n /** Host element used for `querySelector` when resolving the initial focus target. */\n host: HTMLElement;\n /**\n * `AbortSignal` from the component lifecycle. Cancels a pending `applyInitialFocus()`\n * animation frame automatically on abort — prevents a stray `.focus()` call landing on an\n * element that's been disconnected in the meantime (e.g. the dialog closes and unmounts\n * before the deferred focus frame runs).\n */\n signal?: AbortSignal;\n};\n\nexport type FocusManager = {\n [Symbol.dispose](): void;\n /** Move focus to the element matching `getInitialFocusSelector` (deferred one frame). */\n applyInitialFocus: () => void;\n /** Cancel a pending `applyInitialFocus` rAF, if any. */\n cancelInitialFocus: () => void;\n /** Capture the currently focused element so it can be restored later. */\n captureReturnFocus: () => void;\n /** Cancels any pending initial-focus frame and clears captured return-focus state. */\n dispose(): void;\n /** `true` after `dispose()` has been called. */\n readonly disposed: boolean;\n /** Restore focus to the element captured by `captureReturnFocus`. */\n restoreFocus: () => void;\n};\n\n// ── Factory ───────────────────────────────────────────────────────────────────\n\n/**\n * Encapsulates the three-step focus lifecycle used by dialogs and drawers:\n * 1. Capture the element that triggered the open.\n * 2. Move focus inside the overlay (optionally to a specific element).\n * 3. Restore focus when the overlay closes.\n */\nexport function createFocusManager(options: FocusManagerOptions): FocusManager {\n let
|
|
1
|
+
{"version":3,"file":"focus.cjs","names":[],"sources":["../../src/core/focus.ts"],"sourcesContent":["import { captureFocus, type FocusRestorer } from '@vielzeug/focus';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type FocusManagerOptions = {\n /**\n * Returns the CSS selector for the element that should receive focus on open.\n *\n * **Security note:** this value is passed directly to `querySelector`. It must\n * come from trusted developer-controlled configuration, never from raw user input.\n */\n getInitialFocusSelector: () => string | undefined;\n /**\n * Returns whether focus should be restored to the previously focused element\n * on close. `undefined` or `true` means restore; `false` means skip.\n */\n getReturnFocus: () => boolean | undefined;\n /** Host element used for `querySelector` when resolving the initial focus target. */\n host: HTMLElement;\n /**\n * `AbortSignal` from the component lifecycle. Cancels a pending `applyInitialFocus()`\n * animation frame automatically on abort — prevents a stray `.focus()` call landing on an\n * element that's been disconnected in the meantime (e.g. the dialog closes and unmounts\n * before the deferred focus frame runs).\n */\n signal?: AbortSignal;\n};\n\nexport type FocusManager = {\n [Symbol.dispose](): void;\n /** Move focus to the element matching `getInitialFocusSelector` (deferred one frame). */\n applyInitialFocus: () => void;\n /** Cancel a pending `applyInitialFocus` rAF, if any. */\n cancelInitialFocus: () => void;\n /** Capture the currently focused element so it can be restored later. */\n captureReturnFocus: () => void;\n /** Cancels any pending initial-focus frame and clears captured return-focus state. */\n dispose(): void;\n /** `true` after `dispose()` has been called. */\n readonly disposed: boolean;\n /** Restore focus to the element captured by `captureReturnFocus`. */\n restoreFocus: () => void;\n};\n\n// ── Factory ───────────────────────────────────────────────────────────────────\n\n/**\n * Encapsulates the three-step focus lifecycle used by dialogs and drawers:\n * 1. Capture the element that triggered the open.\n * 2. Move focus inside the overlay (optionally to a specific element).\n * 3. Restore focus when the overlay closes.\n */\nexport function createFocusManager(options: FocusManagerOptions): FocusManager {\n let restoreReturnFocus: FocusRestorer | null = null;\n let rafHandle: ReturnType<typeof requestAnimationFrame> | null = null;\n let disposed = false;\n\n const cancelInitialFocus = (): void => {\n if (rafHandle !== null) {\n cancelAnimationFrame(rafHandle);\n rafHandle = null;\n }\n };\n\n const dispose = (): void => {\n if (disposed) return;\n\n disposed = true;\n cancelInitialFocus();\n restoreReturnFocus = null;\n };\n\n options.signal?.addEventListener('abort', dispose, { once: true });\n\n return {\n applyInitialFocus() {\n cancelInitialFocus();\n\n const selector = options.getInitialFocusSelector();\n\n if (selector) {\n // Query the shadow root first (all refine components render into Shadow DOM),\n // falling back to the host's light-DOM tree for non-Shadow contexts.\n const root = options.host.shadowRoot ?? options.host;\n\n let target: HTMLElement | null = null;\n\n try {\n target = root.querySelector<HTMLElement>(selector);\n } catch {\n // Malformed selector (SyntaxError) — skip initial focus rather than throw.\n return;\n }\n\n if (target) {\n rafHandle = requestAnimationFrame(() => {\n rafHandle = null;\n target.focus();\n });\n }\n }\n },\n cancelInitialFocus,\n\n captureReturnFocus() {\n restoreReturnFocus = captureFocus();\n },\n\n dispose,\n\n get disposed() {\n return disposed;\n },\n\n restoreFocus() {\n if (options.getReturnFocus() !== false) restoreReturnFocus?.();\n\n restoreReturnFocus = null;\n },\n\n [Symbol.dispose]: dispose,\n };\n}\n"],"mappings":"iCAoDA,SAAgB,EAAmB,EAA4C,CAC7E,IAAI,EAA2C,KAC3C,EAA6D,KAC7D,EAAW,GAET,MAAiC,CACjC,IAAc,OAChB,qBAAqB,CAAS,EAC9B,EAAY,KAEhB,EAEM,MAAsB,CACtB,IAEJ,EAAW,GACX,EAAmB,EACnB,EAAqB,KACvB,EAIA,OAFA,EAAQ,QAAQ,iBAAiB,QAAS,EAAS,CAAE,KAAM,EAAK,CAAC,EAE1D,CACL,mBAAoB,CAClB,EAAmB,EAEnB,IAAM,EAAW,EAAQ,wBAAwB,EAEjD,GAAI,EAAU,CAGZ,IAAM,EAAO,EAAQ,KAAK,YAAc,EAAQ,KAE5C,EAA6B,KAEjC,GAAI,CACF,EAAS,EAAK,cAA2B,CAAQ,CACnD,MAAQ,CAEN,MACF,CAEI,IACF,EAAY,0BAA4B,CACtC,EAAY,KACZ,EAAO,MAAM,CACf,CAAC,EAEL,CACF,EACA,qBAEA,oBAAqB,CACnB,GAAA,EAAqB,EAAA,aAAA,CAAa,CACpC,EAEA,UAEA,IAAI,UAAW,CACb,OAAO,CACT,EAEA,cAAe,CACT,EAAQ,eAAe,IAAM,IAAO,IAAqB,EAE7D,EAAqB,IACvB,GAEC,OAAO,SAAU,CACpB,CACF"}
|
package/dist/core/focus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../src/core/focus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../src/core/focus.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;OAKG;IACH,uBAAuB,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAClD;;;OAGG;IACH,cAAc,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;IAC1C,qFAAqF;IACrF,IAAI,EAAE,WAAW,CAAC;IAClB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;IACzB,yFAAyF;IACzF,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,wDAAwD;IACxD,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,sFAAsF;IACtF,OAAO,IAAI,IAAI,CAAC;IAChB,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,qEAAqE;IACrE,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAIF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAsE7E"}
|
package/dist/core/focus.js
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
+
import { captureFocus as e } from "@vielzeug/focus";
|
|
1
2
|
//#region src/core/focus.ts
|
|
2
|
-
function
|
|
3
|
-
let
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = null, r = null, i = !1, a = () => {
|
|
5
|
+
r !== null && (cancelAnimationFrame(r), r = null);
|
|
6
|
+
}, o = () => {
|
|
7
|
+
i || (i = !0, a(), n = null);
|
|
7
8
|
};
|
|
8
|
-
return
|
|
9
|
+
return t.signal?.addEventListener("abort", o, { once: !0 }), {
|
|
9
10
|
applyInitialFocus() {
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
let
|
|
11
|
+
a();
|
|
12
|
+
let e = t.getInitialFocusSelector();
|
|
13
|
+
if (e) {
|
|
14
|
+
let n = t.host.shadowRoot ?? t.host, i = null;
|
|
14
15
|
try {
|
|
15
|
-
i =
|
|
16
|
+
i = n.querySelector(e);
|
|
16
17
|
} catch {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
i && (
|
|
20
|
-
|
|
20
|
+
i && (r = requestAnimationFrame(() => {
|
|
21
|
+
r = null, i.focus();
|
|
21
22
|
}));
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
|
-
cancelInitialFocus:
|
|
25
|
+
cancelInitialFocus: a,
|
|
25
26
|
captureReturnFocus() {
|
|
26
|
-
|
|
27
|
+
n = e();
|
|
27
28
|
},
|
|
28
|
-
dispose:
|
|
29
|
+
dispose: o,
|
|
29
30
|
get disposed() {
|
|
30
|
-
return
|
|
31
|
+
return i;
|
|
31
32
|
},
|
|
32
33
|
restoreFocus() {
|
|
33
|
-
|
|
34
|
+
t.getReturnFocus() !== !1 && n?.(), n = null;
|
|
34
35
|
},
|
|
35
|
-
[Symbol.dispose]:
|
|
36
|
+
[Symbol.dispose]: o
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { t as createFocusManager };
|
|
40
41
|
|
|
41
42
|
//# sourceMappingURL=focus.js.map
|
package/dist/core/focus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","names":[],"sources":["../../src/core/focus.ts"],"sourcesContent":["// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type FocusManagerOptions = {\n /**\n * Returns the CSS selector for the element that should receive focus on open.\n *\n * **Security note:** this value is passed directly to `querySelector`. It must\n * come from trusted developer-controlled configuration, never from raw user input.\n */\n getInitialFocusSelector: () => string | undefined;\n /**\n * Returns whether focus should be restored to the previously focused element\n * on close. `undefined` or `true` means restore; `false` means skip.\n */\n getReturnFocus: () => boolean | undefined;\n /** Host element used for `querySelector` when resolving the initial focus target. */\n host: HTMLElement;\n /**\n * `AbortSignal` from the component lifecycle. Cancels a pending `applyInitialFocus()`\n * animation frame automatically on abort — prevents a stray `.focus()` call landing on an\n * element that's been disconnected in the meantime (e.g. the dialog closes and unmounts\n * before the deferred focus frame runs).\n */\n signal?: AbortSignal;\n};\n\nexport type FocusManager = {\n [Symbol.dispose](): void;\n /** Move focus to the element matching `getInitialFocusSelector` (deferred one frame). */\n applyInitialFocus: () => void;\n /** Cancel a pending `applyInitialFocus` rAF, if any. */\n cancelInitialFocus: () => void;\n /** Capture the currently focused element so it can be restored later. */\n captureReturnFocus: () => void;\n /** Cancels any pending initial-focus frame and clears captured return-focus state. */\n dispose(): void;\n /** `true` after `dispose()` has been called. */\n readonly disposed: boolean;\n /** Restore focus to the element captured by `captureReturnFocus`. */\n restoreFocus: () => void;\n};\n\n// ── Factory ───────────────────────────────────────────────────────────────────\n\n/**\n * Encapsulates the three-step focus lifecycle used by dialogs and drawers:\n * 1. Capture the element that triggered the open.\n * 2. Move focus inside the overlay (optionally to a specific element).\n * 3. Restore focus when the overlay closes.\n */\nexport function createFocusManager(options: FocusManagerOptions): FocusManager {\n let
|
|
1
|
+
{"version":3,"file":"focus.js","names":[],"sources":["../../src/core/focus.ts"],"sourcesContent":["import { captureFocus, type FocusRestorer } from '@vielzeug/focus';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type FocusManagerOptions = {\n /**\n * Returns the CSS selector for the element that should receive focus on open.\n *\n * **Security note:** this value is passed directly to `querySelector`. It must\n * come from trusted developer-controlled configuration, never from raw user input.\n */\n getInitialFocusSelector: () => string | undefined;\n /**\n * Returns whether focus should be restored to the previously focused element\n * on close. `undefined` or `true` means restore; `false` means skip.\n */\n getReturnFocus: () => boolean | undefined;\n /** Host element used for `querySelector` when resolving the initial focus target. */\n host: HTMLElement;\n /**\n * `AbortSignal` from the component lifecycle. Cancels a pending `applyInitialFocus()`\n * animation frame automatically on abort — prevents a stray `.focus()` call landing on an\n * element that's been disconnected in the meantime (e.g. the dialog closes and unmounts\n * before the deferred focus frame runs).\n */\n signal?: AbortSignal;\n};\n\nexport type FocusManager = {\n [Symbol.dispose](): void;\n /** Move focus to the element matching `getInitialFocusSelector` (deferred one frame). */\n applyInitialFocus: () => void;\n /** Cancel a pending `applyInitialFocus` rAF, if any. */\n cancelInitialFocus: () => void;\n /** Capture the currently focused element so it can be restored later. */\n captureReturnFocus: () => void;\n /** Cancels any pending initial-focus frame and clears captured return-focus state. */\n dispose(): void;\n /** `true` after `dispose()` has been called. */\n readonly disposed: boolean;\n /** Restore focus to the element captured by `captureReturnFocus`. */\n restoreFocus: () => void;\n};\n\n// ── Factory ───────────────────────────────────────────────────────────────────\n\n/**\n * Encapsulates the three-step focus lifecycle used by dialogs and drawers:\n * 1. Capture the element that triggered the open.\n * 2. Move focus inside the overlay (optionally to a specific element).\n * 3. Restore focus when the overlay closes.\n */\nexport function createFocusManager(options: FocusManagerOptions): FocusManager {\n let restoreReturnFocus: FocusRestorer | null = null;\n let rafHandle: ReturnType<typeof requestAnimationFrame> | null = null;\n let disposed = false;\n\n const cancelInitialFocus = (): void => {\n if (rafHandle !== null) {\n cancelAnimationFrame(rafHandle);\n rafHandle = null;\n }\n };\n\n const dispose = (): void => {\n if (disposed) return;\n\n disposed = true;\n cancelInitialFocus();\n restoreReturnFocus = null;\n };\n\n options.signal?.addEventListener('abort', dispose, { once: true });\n\n return {\n applyInitialFocus() {\n cancelInitialFocus();\n\n const selector = options.getInitialFocusSelector();\n\n if (selector) {\n // Query the shadow root first (all refine components render into Shadow DOM),\n // falling back to the host's light-DOM tree for non-Shadow contexts.\n const root = options.host.shadowRoot ?? options.host;\n\n let target: HTMLElement | null = null;\n\n try {\n target = root.querySelector<HTMLElement>(selector);\n } catch {\n // Malformed selector (SyntaxError) — skip initial focus rather than throw.\n return;\n }\n\n if (target) {\n rafHandle = requestAnimationFrame(() => {\n rafHandle = null;\n target.focus();\n });\n }\n }\n },\n cancelInitialFocus,\n\n captureReturnFocus() {\n restoreReturnFocus = captureFocus();\n },\n\n dispose,\n\n get disposed() {\n return disposed;\n },\n\n restoreFocus() {\n if (options.getReturnFocus() !== false) restoreReturnFocus?.();\n\n restoreReturnFocus = null;\n },\n\n [Symbol.dispose]: dispose,\n };\n}\n"],"mappings":";;AAoDA,SAAgB,EAAmB,GAA4C;CAC7E,IAAI,IAA2C,MAC3C,IAA6D,MAC7D,IAAW,IAET,UAAiC;EACrC,AAAI,MAAc,SAChB,qBAAqB,CAAS,GAC9B,IAAY;CAEhB,GAEM,UAAsB;EACtB,MAEJ,IAAW,IACX,EAAmB,GACnB,IAAqB;CACvB;CAIA,OAFA,EAAQ,QAAQ,iBAAiB,SAAS,GAAS,EAAE,MAAM,GAAK,CAAC,GAE1D;EACL,oBAAoB;GAClB,EAAmB;GAEnB,IAAM,IAAW,EAAQ,wBAAwB;GAEjD,IAAI,GAAU;IAGZ,IAAM,IAAO,EAAQ,KAAK,cAAc,EAAQ,MAE5C,IAA6B;IAEjC,IAAI;KACF,IAAS,EAAK,cAA2B,CAAQ;IACnD,QAAQ;KAEN;IACF;IAEA,AAAI,MACF,IAAY,4BAA4B;KAEtC,AADA,IAAY,MACZ,EAAO,MAAM;IACf,CAAC;GAEL;EACF;EACA;EAEA,qBAAqB;GACnB,IAAqB,EAAa;EACpC;EAEA;EAEA,IAAI,WAAW;GACb,OAAO;EACT;EAEA,eAAe;GAGb,AAFI,EAAQ,eAAe,MAAM,MAAO,IAAqB,GAE7D,IAAqB;EACvB;GAEC,OAAO,UAAU;CACpB;AACF"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -14,14 +14,13 @@ export { createDatePickerControl, type DateCell, type DatePickerControl, type Da
|
|
|
14
14
|
export { type AssistiveStateHandle, type AssistiveStateOptions, type ControlValidationMode, type CounterOptions, type CounterState, counterClassName, createAssistiveState, createDirtyTracker, createErrorHelperState, createField, createLabelState, type DirtyTracker, type ErrorHelperOptions, type ErrorHelperState, type FieldHandle, type FieldOptions, type LabelPlacement, type LabelStateHandle, type LabelStateOptions, type ValidationTrigger, } from './field-base';
|
|
15
15
|
export { createFocusManager, type FocusManager, type FocusManagerOptions } from './focus';
|
|
16
16
|
export { getChoiceLabel, getLightChildrenByTag } from './light-dom';
|
|
17
|
-
export type { ListKeyAction, ListNavigationAction } from './nav';
|
|
17
|
+
export type { ListKeyAction, ListNavigationAction, ListNavigationChange, ListNavigationTypeaheadOptions, } from './nav';
|
|
18
18
|
export { toFiniteNumber, toFiniteNumberOr, toPositiveStep } from './numbers';
|
|
19
19
|
export { lifecycleSignal } from './ore';
|
|
20
|
-
export { createOutsidePointerDismissal, type DialogCloseReason, type DropdownCloseReason, type OutsidePointerDismissalOptions, type OverlayCloseDetail, type OverlayOpenChangeDetail, type OverlayOpenDetail, type OverlayOpenReason,
|
|
20
|
+
export { createOutsidePointerDismissal, type DialogCloseReason, type DropdownCloseReason, type OutsidePointerDismissalOptions, type OverlayCloseDetail, type OverlayOpenChangeDetail, type OverlayOpenDetail, type OverlayOpenReason, } from './overlay';
|
|
21
21
|
export { bindRefCallback, type RefCallback } from './ref-callback';
|
|
22
22
|
export { createSliderControl, type SliderControl, type SliderControlOptions } from './slider';
|
|
23
23
|
export { createSpinnerControl, type SpinnerControl, type SpinnerControlOptions } from './spinner';
|
|
24
|
-
export { createSwipeControl, type SwipeAxis, type SwipeControl, type SwipeControlDetail, type SwipeControlOptions, } from './swipe';
|
|
25
24
|
export { createTextField, type TextFieldDetach, type TextFieldHandle, type TextFieldOptions } from './text-field';
|
|
26
25
|
export { elementDirection } from './direction';
|
|
27
26
|
export { createInteraction, dispatchKeyboardAction, type Interaction, type InteractionOptions, type KeyboardDispatchOptions, type PressTrigger, } from './keyboard';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,QAAQ,EAAE,M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