@vunset/vue 0.0.0-stage → 1.0.0-rc.2
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/LICENSE +21 -0
- package/README.md +85 -2
- package/dist/chart.d.ts +11 -0
- package/dist/chart.js +11 -0
- package/dist/components/accordion/AccordionHeader.js +5 -0
- package/dist/components/accordion/AccordionHeader.vue.d.ts +23 -0
- package/dist/components/accordion/AccordionHeader.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/accordion/AccordionItem.js +5 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +28 -0
- package/dist/components/accordion/AccordionItem.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/accordion/AccordionRoot.js +5 -0
- package/dist/components/accordion/AccordionRoot.vue.d.ts +48 -0
- package/dist/components/accordion/AccordionRoot.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/components/accordion/use-accordion.d.ts +43 -0
- package/dist/components/accordion/use-accordion.js +126 -0
- package/dist/components/alert/AlertDescription.js +5 -0
- package/dist/components/alert/AlertDescription.vue.d.ts +19 -0
- package/dist/components/alert/AlertDescription.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/alert/AlertRoot.js +5 -0
- package/dist/components/alert/AlertRoot.vue.d.ts +24 -0
- package/dist/components/alert/AlertRoot.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/alert/AlertTitle.js +5 -0
- package/dist/components/alert/AlertTitle.vue.d.ts +19 -0
- package/dist/components/alert/AlertTitle.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/appear/Appear.js +5 -0
- package/dist/components/appear/Appear.vue.d.ts +46 -0
- package/dist/components/appear/Appear.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/async-state/AsyncState.js +5 -0
- package/dist/components/async-state/AsyncState.vue.d.ts +60 -0
- package/dist/components/async-state/AsyncState.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/components/badge/Badge.js +5 -0
- package/dist/components/badge/Badge.vue.d.ts +19 -0
- package/dist/components/badge/Badge.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/components/button/Button.js +5 -0
- package/dist/components/button/Button.vue.d.ts +28 -0
- package/dist/components/button/Button.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/components/button/use-button.d.ts +20 -0
- package/dist/components/button/use-button.js +47 -0
- package/dist/components/calendar/CalendarDay.js +5 -0
- package/dist/components/calendar/CalendarDay.vue.d.ts +33 -0
- package/dist/components/calendar/CalendarDay.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/calendar/CalendarGrid.js +5 -0
- package/dist/components/calendar/CalendarGrid.vue.d.ts +33 -0
- package/dist/components/calendar/CalendarGrid.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/calendar/CalendarMonth.js +5 -0
- package/dist/components/calendar/CalendarMonth.vue.d.ts +28 -0
- package/dist/components/calendar/CalendarMonth.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/calendar/CalendarNext.js +5 -0
- package/dist/components/calendar/CalendarNext.vue.d.ts +23 -0
- package/dist/components/calendar/CalendarNext.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/calendar/CalendarPreset.js +5 -0
- package/dist/components/calendar/CalendarPreset.vue.d.ts +39 -0
- package/dist/components/calendar/CalendarPreset.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/calendar/CalendarPresets.js +5 -0
- package/dist/components/calendar/CalendarPresets.vue.d.ts +26 -0
- package/dist/components/calendar/CalendarPresets.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/calendar/CalendarPrev.js +5 -0
- package/dist/components/calendar/CalendarPrev.vue.d.ts +23 -0
- package/dist/components/calendar/CalendarPrev.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/calendar/CalendarRoot.js +5 -0
- package/dist/components/calendar/CalendarRoot.vue.d.ts +94 -0
- package/dist/components/calendar/CalendarRoot.vue_vue_type_script_setup_true_lang.js +115 -0
- package/dist/components/calendar/CalendarRow.js +5 -0
- package/dist/components/calendar/CalendarRow.vue.d.ts +25 -0
- package/dist/components/calendar/CalendarRow.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/calendar/CalendarViewTrigger.js +5 -0
- package/dist/components/calendar/CalendarViewTrigger.vue.d.ts +25 -0
- package/dist/components/calendar/CalendarViewTrigger.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/calendar/CalendarWeek.js +5 -0
- package/dist/components/calendar/CalendarWeek.vue.d.ts +29 -0
- package/dist/components/calendar/CalendarWeek.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/calendar/CalendarWeekDay.js +5 -0
- package/dist/components/calendar/CalendarWeekDay.vue.d.ts +44 -0
- package/dist/components/calendar/CalendarWeekDay.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/calendar/CalendarYear.js +5 -0
- package/dist/components/calendar/CalendarYear.vue.d.ts +27 -0
- package/dist/components/calendar/CalendarYear.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/calendar/use-calendar.d.ts +267 -0
- package/dist/components/calendar/use-calendar.js +657 -0
- package/dist/components/chart/ChartArea.js +5 -0
- package/dist/components/chart/ChartArea.vue.d.ts +23 -0
- package/dist/components/chart/ChartArea.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/chart/ChartAxis.js +5 -0
- package/dist/components/chart/ChartAxis.vue.d.ts +18 -0
- package/dist/components/chart/ChartAxis.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/chart/ChartBar.js +5 -0
- package/dist/components/chart/ChartBar.vue.d.ts +25 -0
- package/dist/components/chart/ChartBar.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/chart/ChartCrosshair.js +5 -0
- package/dist/components/chart/ChartCrosshair.vue.d.ts +3 -0
- package/dist/components/chart/ChartCrosshair.vue_vue_type_script_setup_true_lang.js +15 -0
- package/dist/components/chart/ChartDonut.js +5 -0
- package/dist/components/chart/ChartDonut.vue.d.ts +66 -0
- package/dist/components/chart/ChartDonut.vue_vue_type_script_setup_true_lang.js +156 -0
- package/dist/components/chart/ChartFrame.js +5 -0
- package/dist/components/chart/ChartFrame.vue.d.ts +66 -0
- package/dist/components/chart/ChartFrame.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/chart/ChartGrid.js +5 -0
- package/dist/components/chart/ChartGrid.vue.d.ts +11 -0
- package/dist/components/chart/ChartGrid.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/components/chart/ChartLegend.js +5 -0
- package/dist/components/chart/ChartLegend.vue.d.ts +46 -0
- package/dist/components/chart/ChartLegend.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/chart/ChartLine.js +5 -0
- package/dist/components/chart/ChartLine.vue.d.ts +23 -0
- package/dist/components/chart/ChartLine.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/chart/ChartRoot.js +5 -0
- package/dist/components/chart/ChartRoot.vue.d.ts +115 -0
- package/dist/components/chart/ChartRoot.vue_vue_type_script_setup_true_lang.js +394 -0
- package/dist/components/chart/ChartTooltip.js +5 -0
- package/dist/components/chart/ChartTooltip.vue.d.ts +14 -0
- package/dist/components/chart/ChartTooltip.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/chart/chart-curve.d.ts +9 -0
- package/dist/components/chart/chart-curve.js +57 -0
- package/dist/components/chart/chart-scales.d.ts +34 -0
- package/dist/components/chart/chart-scales.js +41 -0
- package/dist/components/chart/use-chart-series.d.ts +49 -0
- package/dist/components/chart/use-chart-series.js +53 -0
- package/dist/components/checkbox/CheckboxGroup.js +5 -0
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +128 -0
- package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/components/checkbox/CheckboxIndicator.js +5 -0
- package/dist/components/checkbox/CheckboxIndicator.vue.d.ts +29 -0
- package/dist/components/checkbox/CheckboxIndicator.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/checkbox/CheckboxRoot.js +5 -0
- package/dist/components/checkbox/CheckboxRoot.vue.d.ts +93 -0
- package/dist/components/checkbox/CheckboxRoot.vue_vue_type_script_setup_true_lang.js +158 -0
- package/dist/components/collapsible/CollapsiblePanel.js +5 -0
- package/dist/components/collapsible/CollapsiblePanel.vue.d.ts +26 -0
- package/dist/components/collapsible/CollapsiblePanel.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/collapsible/CollapsibleRoot.js +5 -0
- package/dist/components/collapsible/CollapsibleRoot.vue.d.ts +41 -0
- package/dist/components/collapsible/CollapsibleRoot.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/collapsible/CollapsibleTrigger.js +5 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +23 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/combobox/ComboboxChip.js +5 -0
- package/dist/components/combobox/ComboboxChip.vue.d.ts +29 -0
- package/dist/components/combobox/ComboboxChip.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/combobox/ComboboxChipRemove.js +5 -0
- package/dist/components/combobox/ComboboxChipRemove.vue.d.ts +23 -0
- package/dist/components/combobox/ComboboxChipRemove.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/combobox/ComboboxChips.js +5 -0
- package/dist/components/combobox/ComboboxChips.vue.d.ts +35 -0
- package/dist/components/combobox/ComboboxChips.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/combobox/ComboboxInput.js +5 -0
- package/dist/components/combobox/ComboboxInput.vue.d.ts +9 -0
- package/dist/components/combobox/ComboboxInput.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/combobox/ComboboxRoot.js +5 -0
- package/dist/components/combobox/ComboboxRoot.vue.d.ts +115 -0
- package/dist/components/combobox/ComboboxRoot.vue_vue_type_script_setup_true_lang.js +133 -0
- package/dist/components/combobox/ComboboxTrigger.js +5 -0
- package/dist/components/combobox/ComboboxTrigger.vue.d.ts +35 -0
- package/dist/components/combobox/ComboboxTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/context-menu/ContextMenuRoot.js +5 -0
- package/dist/components/context-menu/ContextMenuRoot.vue.d.ts +57 -0
- package/dist/components/context-menu/ContextMenuRoot.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/context-menu/ContextMenuTrigger.js +5 -0
- package/dist/components/context-menu/ContextMenuTrigger.vue.d.ts +26 -0
- package/dist/components/context-menu/ContextMenuTrigger.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/copy/Copy.js +5 -0
- package/dist/components/copy/Copy.vue.d.ts +57 -0
- package/dist/components/copy/Copy.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/data-table/DataTable.js +5 -0
- package/dist/components/data-table/DataTable.vue.d.ts +194 -0
- package/dist/components/data-table/DataTable.vue_vue_type_script_setup_true_lang.js +683 -0
- package/dist/components/datepicker/DatepickerClear.js +5 -0
- package/dist/components/datepicker/DatepickerClear.vue.d.ts +34 -0
- package/dist/components/datepicker/DatepickerClear.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/datepicker/DatepickerRoot.js +5 -0
- package/dist/components/datepicker/DatepickerRoot.vue.d.ts +191 -0
- package/dist/components/datepicker/DatepickerRoot.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/components/datepicker/DatepickerTrigger.js +5 -0
- package/dist/components/datepicker/DatepickerTrigger.vue.d.ts +34 -0
- package/dist/components/datepicker/DatepickerTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/datepicker/DatepickerValue.js +5 -0
- package/dist/components/datepicker/DatepickerValue.vue.d.ts +29 -0
- package/dist/components/datepicker/DatepickerValue.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/deferred/Deferred.js +5 -0
- package/dist/components/deferred/Deferred.vue.d.ts +23 -0
- package/dist/components/deferred/Deferred.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/dialog/DialogBackdrop.js +5 -0
- package/dist/components/dialog/DialogBackdrop.vue.d.ts +25 -0
- package/dist/components/dialog/DialogBackdrop.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/dialog/DialogClose.js +5 -0
- package/dist/components/dialog/DialogClose.vue.d.ts +26 -0
- package/dist/components/dialog/DialogClose.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/dialog/DialogDescription.js +5 -0
- package/dist/components/dialog/DialogDescription.vue.d.ts +23 -0
- package/dist/components/dialog/DialogDescription.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/dialog/DialogRoot.js +5 -0
- package/dist/components/dialog/DialogRoot.vue.d.ts +46 -0
- package/dist/components/dialog/DialogRoot.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/components/dialog/DialogTitle.js +5 -0
- package/dist/components/dialog/DialogTitle.vue.d.ts +23 -0
- package/dist/components/dialog/DialogTitle.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/dialog/DialogTrigger.js +5 -0
- package/dist/components/dialog/DialogTrigger.vue.d.ts +25 -0
- package/dist/components/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/drag/DragHandle.js +5 -0
- package/dist/components/drag/DragHandle.vue.d.ts +19 -0
- package/dist/components/drag/DragHandle.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/components/drag/DragItem.js +5 -0
- package/dist/components/drag/DragItem.vue.d.ts +23 -0
- package/dist/components/drag/DragItem.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/drag/DragRoot.js +5 -0
- package/dist/components/drag/DragRoot.vue.d.ts +90 -0
- package/dist/components/drag/DragRoot.vue_vue_type_script_setup_true_lang.js +329 -0
- package/dist/components/drawer/DrawerHandle.js +5 -0
- package/dist/components/drawer/DrawerHandle.vue.d.ts +23 -0
- package/dist/components/drawer/DrawerHandle.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/drawer/DrawerRoot.js +5 -0
- package/dist/components/drawer/DrawerRoot.vue.d.ts +55 -0
- package/dist/components/drawer/DrawerRoot.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/drawer/use-drawer.d.ts +50 -0
- package/dist/components/drawer/use-drawer.js +170 -0
- package/dist/components/field/FieldDescription.js +5 -0
- package/dist/components/field/FieldDescription.vue.d.ts +28 -0
- package/dist/components/field/FieldDescription.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/field/FieldError.js +5 -0
- package/dist/components/field/FieldError.vue.d.ts +30 -0
- package/dist/components/field/FieldError.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/field/FieldGroup.js +5 -0
- package/dist/components/field/FieldGroup.vue.d.ts +28 -0
- package/dist/components/field/FieldGroup.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/field/FieldLabel.js +5 -0
- package/dist/components/field/FieldLabel.vue.d.ts +28 -0
- package/dist/components/field/FieldLabel.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/field/FieldRoot.js +5 -0
- package/dist/components/field/FieldRoot.vue.d.ts +47 -0
- package/dist/components/field/FieldRoot.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/floating/FloatingClose.js +5 -0
- package/dist/components/floating/FloatingClose.vue.d.ts +23 -0
- package/dist/components/floating/FloatingClose.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/floating/FloatingHeader.js +5 -0
- package/dist/components/floating/FloatingHeader.vue.d.ts +23 -0
- package/dist/components/floating/FloatingHeader.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/floating/FloatingResizer.js +5 -0
- package/dist/components/floating/FloatingResizer.vue.d.ts +25 -0
- package/dist/components/floating/FloatingResizer.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/floating/FloatingRoot.js +5 -0
- package/dist/components/floating/FloatingRoot.vue.d.ts +152 -0
- package/dist/components/floating/FloatingRoot.vue_vue_type_script_setup_true_lang.js +440 -0
- package/dist/components/floating/FloatingTitle.js +5 -0
- package/dist/components/floating/FloatingTitle.vue.d.ts +23 -0
- package/dist/components/floating/FloatingTitle.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/group/Group.js +5 -0
- package/dist/components/group/Group.vue.d.ts +60 -0
- package/dist/components/group/Group.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/icon/Icon.js +5 -0
- package/dist/components/icon/Icon.vue.d.ts +11 -0
- package/dist/components/icon/Icon.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/components/input/Input.js +5 -0
- package/dist/components/input/Input.vue.d.ts +53 -0
- package/dist/components/input/Input.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/listbox/ListboxClear.js +5 -0
- package/dist/components/listbox/ListboxClear.vue.d.ts +35 -0
- package/dist/components/listbox/ListboxClear.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/listbox/ListboxEmpty.js +5 -0
- package/dist/components/listbox/ListboxEmpty.vue.d.ts +35 -0
- package/dist/components/listbox/ListboxEmpty.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/listbox/ListboxIndicator.js +5 -0
- package/dist/components/listbox/ListboxIndicator.vue.d.ts +35 -0
- package/dist/components/listbox/ListboxIndicator.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/listbox/ListboxItem.js +5 -0
- package/dist/components/listbox/ListboxItem.vue.d.ts +22 -0
- package/dist/components/listbox/ListboxItem.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/listbox/ListboxList.js +5 -0
- package/dist/components/listbox/ListboxList.vue.d.ts +37 -0
- package/dist/components/listbox/ListboxList.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/components/listbox/ListboxPresets.js +5 -0
- package/dist/components/listbox/ListboxPresets.vue.d.ts +59 -0
- package/dist/components/listbox/ListboxPresets.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/listbox/ListboxScrollIndicator.js +5 -0
- package/dist/components/listbox/ListboxScrollIndicator.vue.d.ts +38 -0
- package/dist/components/listbox/ListboxScrollIndicator.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/menu/MenuArrow.js +5 -0
- package/dist/components/menu/MenuArrow.vue.d.ts +23 -0
- package/dist/components/menu/MenuArrow.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/menu/MenuCheckboxItem.js +5 -0
- package/dist/components/menu/MenuCheckboxItem.vue.d.ts +49 -0
- package/dist/components/menu/MenuCheckboxItem.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/menu/MenuGroup.js +5 -0
- package/dist/components/menu/MenuGroup.vue.d.ts +19 -0
- package/dist/components/menu/MenuGroup.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/menu/MenuGroupLabel.js +5 -0
- package/dist/components/menu/MenuGroupLabel.vue.d.ts +19 -0
- package/dist/components/menu/MenuGroupLabel.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/menu/MenuItem.js +5 -0
- package/dist/components/menu/MenuItem.vue.d.ts +29 -0
- package/dist/components/menu/MenuItem.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/components/menu/MenuItemIndicator.js +5 -0
- package/dist/components/menu/MenuItemIndicator.vue.d.ts +28 -0
- package/dist/components/menu/MenuItemIndicator.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/menu/MenuRadioGroup.js +5 -0
- package/dist/components/menu/MenuRadioGroup.vue.d.ts +42 -0
- package/dist/components/menu/MenuRadioGroup.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/menu/MenuRadioItem.js +5 -0
- package/dist/components/menu/MenuRadioItem.vue.d.ts +35 -0
- package/dist/components/menu/MenuRadioItem.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/menu/MenuRoot.js +5 -0
- package/dist/components/menu/MenuRoot.vue.d.ts +69 -0
- package/dist/components/menu/MenuRoot.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/menu/MenuTrigger.js +5 -0
- package/dist/components/menu/MenuTrigger.vue.d.ts +25 -0
- package/dist/components/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/menu/MenubarLink.js +5 -0
- package/dist/components/menu/MenubarLink.vue.d.ts +22 -0
- package/dist/components/menu/MenubarLink.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/menu/MenubarRoot.js +5 -0
- package/dist/components/menu/MenubarRoot.vue.d.ts +28 -0
- package/dist/components/menu/MenubarRoot.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/meter/MeterIndicator.js +5 -0
- package/dist/components/meter/MeterIndicator.vue.d.ts +22 -0
- package/dist/components/meter/MeterIndicator.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/meter/MeterLabel.js +5 -0
- package/dist/components/meter/MeterLabel.vue.d.ts +22 -0
- package/dist/components/meter/MeterLabel.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/meter/MeterRoot.js +5 -0
- package/dist/components/meter/MeterRoot.vue.d.ts +33 -0
- package/dist/components/meter/MeterRoot.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/meter/MeterTrack.js +5 -0
- package/dist/components/meter/MeterTrack.vue.d.ts +22 -0
- package/dist/components/meter/MeterTrack.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/meter/MeterValue.js +5 -0
- package/dist/components/meter/MeterValue.vue.d.ts +23 -0
- package/dist/components/meter/MeterValue.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/pagination/PaginationEllipsis.js +5 -0
- package/dist/components/pagination/PaginationEllipsis.vue.d.ts +23 -0
- package/dist/components/pagination/PaginationEllipsis.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/pagination/PaginationItem.js +5 -0
- package/dist/components/pagination/PaginationItem.vue.d.ts +48 -0
- package/dist/components/pagination/PaginationItem.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/pagination/PaginationNext.js +5 -0
- package/dist/components/pagination/PaginationNext.vue.d.ts +21 -0
- package/dist/components/pagination/PaginationNext.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/pagination/PaginationPrev.js +5 -0
- package/dist/components/pagination/PaginationPrev.vue.d.ts +21 -0
- package/dist/components/pagination/PaginationPrev.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/pagination/PaginationRoot.js +5 -0
- package/dist/components/pagination/PaginationRoot.vue.d.ts +146 -0
- package/dist/components/pagination/PaginationRoot.vue_vue_type_script_setup_true_lang.js +253 -0
- package/dist/components/popover/PopoverArrow.js +5 -0
- package/dist/components/popover/PopoverArrow.vue.d.ts +23 -0
- package/dist/components/popover/PopoverArrow.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/popover/PopoverClose.js +5 -0
- package/dist/components/popover/PopoverClose.vue.d.ts +23 -0
- package/dist/components/popover/PopoverClose.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/popover/PopoverDescription.js +5 -0
- package/dist/components/popover/PopoverDescription.vue.d.ts +23 -0
- package/dist/components/popover/PopoverDescription.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/popover/PopoverRoot.js +5 -0
- package/dist/components/popover/PopoverRoot.vue.d.ts +75 -0
- package/dist/components/popover/PopoverRoot.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/components/popover/PopoverTitle.js +5 -0
- package/dist/components/popover/PopoverTitle.vue.d.ts +23 -0
- package/dist/components/popover/PopoverTitle.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/popover/PopoverTrigger.js +5 -0
- package/dist/components/popover/PopoverTrigger.vue.d.ts +24 -0
- package/dist/components/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/popover/use-popover.d.ts +60 -0
- package/dist/components/popover/use-popover.js +160 -0
- package/dist/components/progress/ProgressIndicator.js +5 -0
- package/dist/components/progress/ProgressIndicator.vue.d.ts +22 -0
- package/dist/components/progress/ProgressIndicator.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/progress/ProgressLabel.js +5 -0
- package/dist/components/progress/ProgressLabel.vue.d.ts +22 -0
- package/dist/components/progress/ProgressLabel.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/progress/ProgressRoot.js +5 -0
- package/dist/components/progress/ProgressRoot.vue.d.ts +33 -0
- package/dist/components/progress/ProgressRoot.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/progress/ProgressTrack.js +5 -0
- package/dist/components/progress/ProgressTrack.vue.d.ts +22 -0
- package/dist/components/progress/ProgressTrack.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/progress/ProgressValue.js +5 -0
- package/dist/components/progress/ProgressValue.vue.d.ts +23 -0
- package/dist/components/progress/ProgressValue.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/radio/RadioGroup.js +5 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +53 -0
- package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/radio/RadioIndicator.js +5 -0
- package/dist/components/radio/RadioIndicator.vue.d.ts +28 -0
- package/dist/components/radio/RadioIndicator.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/radio/RadioRoot.js +5 -0
- package/dist/components/radio/RadioRoot.vue.d.ts +33 -0
- package/dist/components/radio/RadioRoot.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/radio/use-radio-group.d.ts +87 -0
- package/dist/components/radio/use-radio-group.js +175 -0
- package/dist/components/range/RangeControl.js +5 -0
- package/dist/components/range/RangeControl.vue.d.ts +30 -0
- package/dist/components/range/RangeControl.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/range/RangeIndicator.js +5 -0
- package/dist/components/range/RangeIndicator.vue.d.ts +30 -0
- package/dist/components/range/RangeIndicator.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/range/RangeLabel.js +5 -0
- package/dist/components/range/RangeLabel.vue.d.ts +30 -0
- package/dist/components/range/RangeLabel.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/range/RangeRoot.js +5 -0
- package/dist/components/range/RangeRoot.vue.d.ts +85 -0
- package/dist/components/range/RangeRoot.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/components/range/RangeThumb.js +5 -0
- package/dist/components/range/RangeThumb.vue.d.ts +42 -0
- package/dist/components/range/RangeThumb.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/range/RangeTrack.js +5 -0
- package/dist/components/range/RangeTrack.vue.d.ts +30 -0
- package/dist/components/range/RangeTrack.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/range/RangeValue.js +5 -0
- package/dist/components/range/RangeValue.vue.d.ts +25 -0
- package/dist/components/range/RangeValue.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/range/range-math.d.ts +31 -0
- package/dist/components/range/range-math.js +82 -0
- package/dist/components/range/use-range.d.ts +189 -0
- package/dist/components/range/use-range.js +542 -0
- package/dist/components/scroll-area/ScrollArea.js +5 -0
- package/dist/components/scroll-area/ScrollArea.vue.d.ts +94 -0
- package/dist/components/scroll-area/ScrollArea.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/select/SelectRoot.js +5 -0
- package/dist/components/select/SelectRoot.vue.d.ts +116 -0
- package/dist/components/select/SelectRoot.vue_vue_type_script_setup_true_lang.js +133 -0
- package/dist/components/select/SelectSearch.js +5 -0
- package/dist/components/select/SelectSearch.vue.d.ts +9 -0
- package/dist/components/select/SelectSearch.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/select/SelectTrigger.js +5 -0
- package/dist/components/select/SelectTrigger.vue.d.ts +35 -0
- package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/select/SelectValue.js +5 -0
- package/dist/components/select/SelectValue.vue.d.ts +52 -0
- package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/surface/Addon.js +5 -0
- package/dist/components/surface/Addon.vue.d.ts +21 -0
- package/dist/components/surface/Addon.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/surface/Popup.js +5 -0
- package/dist/components/surface/Popup.vue.d.ts +19 -0
- package/dist/components/surface/Popup.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/surface/Portal.js +5 -0
- package/dist/components/surface/Portal.vue.d.ts +22 -0
- package/dist/components/surface/Portal.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/surface/Positioner.js +5 -0
- package/dist/components/surface/Positioner.vue.d.ts +19 -0
- package/dist/components/surface/Positioner.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/surface/Separator.js +5 -0
- package/dist/components/surface/Separator.vue.d.ts +11 -0
- package/dist/components/surface/Separator.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/switch/SwitchRoot.js +5 -0
- package/dist/components/switch/SwitchRoot.vue.d.ts +93 -0
- package/dist/components/switch/SwitchRoot.vue_vue_type_script_setup_true_lang.js +131 -0
- package/dist/components/switch/SwitchThumb.js +5 -0
- package/dist/components/switch/SwitchThumb.vue.d.ts +25 -0
- package/dist/components/switch/SwitchThumb.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/table/TableBody.js +5 -0
- package/dist/components/table/TableBody.vue.d.ts +13 -0
- package/dist/components/table/TableBody.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/table/TableCaption.js +5 -0
- package/dist/components/table/TableCaption.vue.d.ts +13 -0
- package/dist/components/table/TableCaption.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/table/TableCell.js +5 -0
- package/dist/components/table/TableCell.vue.d.ts +21 -0
- package/dist/components/table/TableCell.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/table/TableFooter.js +5 -0
- package/dist/components/table/TableFooter.vue.d.ts +13 -0
- package/dist/components/table/TableFooter.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/table/TableHeadCell.js +5 -0
- package/dist/components/table/TableHeadCell.vue.d.ts +25 -0
- package/dist/components/table/TableHeadCell.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/components/table/TableHeader.js +5 -0
- package/dist/components/table/TableHeader.vue.d.ts +13 -0
- package/dist/components/table/TableHeader.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/table/TableRoot.js +5 -0
- package/dist/components/table/TableRoot.vue.d.ts +48 -0
- package/dist/components/table/TableRoot.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/table/TableRow.js +5 -0
- package/dist/components/table/TableRow.vue.d.ts +21 -0
- package/dist/components/table/TableRow.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/tabs/TabsIndicator.js +5 -0
- package/dist/components/tabs/TabsIndicator.vue.d.ts +23 -0
- package/dist/components/tabs/TabsIndicator.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/tabs/TabsList.js +5 -0
- package/dist/components/tabs/TabsList.vue.d.ts +22 -0
- package/dist/components/tabs/TabsList.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/tabs/TabsPanel.js +5 -0
- package/dist/components/tabs/TabsPanel.vue.d.ts +30 -0
- package/dist/components/tabs/TabsPanel.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/tabs/TabsRoot.js +5 -0
- package/dist/components/tabs/TabsRoot.vue.d.ts +44 -0
- package/dist/components/tabs/TabsRoot.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/tabs/TabsTab.js +5 -0
- package/dist/components/tabs/TabsTab.vue.d.ts +31 -0
- package/dist/components/tabs/TabsTab.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/tabs/use-tabs.d.ts +107 -0
- package/dist/components/tabs/use-tabs.js +305 -0
- package/dist/components/textarea/Textarea.js +5 -0
- package/dist/components/textarea/Textarea.vue.d.ts +48 -0
- package/dist/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js +102 -0
- package/dist/components/timepicker/TimepickerClear.js +5 -0
- package/dist/components/timepicker/TimepickerClear.vue.d.ts +27 -0
- package/dist/components/timepicker/TimepickerClear.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/timepicker/TimepickerColumn.js +5 -0
- package/dist/components/timepicker/TimepickerColumn.vue.d.ts +35 -0
- package/dist/components/timepicker/TimepickerColumn.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/components/timepicker/TimepickerInput.js +5 -0
- package/dist/components/timepicker/TimepickerInput.vue.d.ts +20 -0
- package/dist/components/timepicker/TimepickerInput.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/timepicker/TimepickerRoot.js +5 -0
- package/dist/components/timepicker/TimepickerRoot.vue.d.ts +82 -0
- package/dist/components/timepicker/TimepickerRoot.vue_vue_type_script_setup_true_lang.js +109 -0
- package/dist/components/timepicker/TimepickerSegment.js +5 -0
- package/dist/components/timepicker/TimepickerSegment.vue.d.ts +33 -0
- package/dist/components/timepicker/TimepickerSegment.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/timepicker/TimepickerTrigger.js +5 -0
- package/dist/components/timepicker/TimepickerTrigger.vue.d.ts +27 -0
- package/dist/components/timepicker/TimepickerTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/timepicker/use-timepicker.d.ts +111 -0
- package/dist/components/timepicker/use-timepicker.js +545 -0
- package/dist/components/toast/ToastAction.js +5 -0
- package/dist/components/toast/ToastAction.vue.d.ts +20 -0
- package/dist/components/toast/ToastAction.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/toast/ToastClose.js +5 -0
- package/dist/components/toast/ToastClose.vue.d.ts +20 -0
- package/dist/components/toast/ToastClose.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/toast/ToastDescription.js +5 -0
- package/dist/components/toast/ToastDescription.vue.d.ts +20 -0
- package/dist/components/toast/ToastDescription.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/toast/ToastProgress.js +5 -0
- package/dist/components/toast/ToastProgress.vue.d.ts +30 -0
- package/dist/components/toast/ToastProgress.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/toast/ToastRoot.js +5 -0
- package/dist/components/toast/ToastRoot.vue.d.ts +21 -0
- package/dist/components/toast/ToastRoot.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/toast/ToastTitle.js +5 -0
- package/dist/components/toast/ToastTitle.vue.d.ts +20 -0
- package/dist/components/toast/ToastTitle.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/toast/ToastViewport.js +5 -0
- package/dist/components/toast/ToastViewport.vue.d.ts +47 -0
- package/dist/components/toast/ToastViewport.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/components/toggle/Toggle.js +5 -0
- package/dist/components/toggle/Toggle.vue.d.ts +41 -0
- package/dist/components/toggle/Toggle.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/toggle/ToggleGroup.js +5 -0
- package/dist/components/toggle/ToggleGroup.vue.d.ts +64 -0
- package/dist/components/toggle/ToggleGroup.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/toggle/use-toggle.d.ts +122 -0
- package/dist/components/toggle/use-toggle.js +218 -0
- package/dist/components/tooltip/TooltipArrow.js +5 -0
- package/dist/components/tooltip/TooltipArrow.vue.d.ts +23 -0
- package/dist/components/tooltip/TooltipArrow.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/tooltip/TooltipGroup.js +5 -0
- package/dist/components/tooltip/TooltipGroup.vue.d.ts +21 -0
- package/dist/components/tooltip/TooltipGroup.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/tooltip/TooltipRoot.js +5 -0
- package/dist/components/tooltip/TooltipRoot.vue.d.ts +60 -0
- package/dist/components/tooltip/TooltipRoot.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/components/tooltip/TooltipTrigger.js +5 -0
- package/dist/components/tooltip/TooltipTrigger.vue.d.ts +24 -0
- package/dist/components/tooltip/TooltipTrigger.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/tooltip/tooltip-group.d.ts +41 -0
- package/dist/components/tooltip/tooltip-group.js +51 -0
- package/dist/components/tooltip/use-tooltip.d.ts +60 -0
- package/dist/components/tooltip/use-tooltip.js +169 -0
- package/dist/composables/use-click-outside.d.ts +16 -0
- package/dist/composables/use-click-outside.js +34 -0
- package/dist/composables/use-clipboard.d.ts +17 -0
- package/dist/composables/use-clipboard.js +45 -0
- package/dist/composables/use-download.d.ts +7 -0
- package/dist/composables/use-download.js +27 -0
- package/dist/composables/use-local-storage.d.ts +11 -0
- package/dist/composables/use-local-storage.js +34 -0
- package/dist/composables/use-theme.d.ts +44 -0
- package/dist/composables/use-theme.js +95 -0
- package/dist/composables/use-toast.d.ts +127 -0
- package/dist/composables/use-toast.js +330 -0
- package/dist/composables/use-validate.d.ts +21 -0
- package/dist/composables/use-validate.js +31 -0
- package/dist/composables/use-virtual-list.d.ts +34 -0
- package/dist/composables/use-virtual-list.js +144 -0
- package/dist/data-table.d.ts +1 -0
- package/dist/data-table.js +3 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +191 -0
- package/dist/shared/align-item-with-trigger.d.ts +84 -0
- package/dist/shared/align-item-with-trigger.js +109 -0
- package/dist/shared/animations.d.ts +6 -0
- package/dist/shared/animations.js +35 -0
- package/dist/shared/context.d.ts +7 -0
- package/dist/shared/context.js +25 -0
- package/dist/shared/data-attrs.d.ts +11 -0
- package/dist/shared/data-attrs.js +14 -0
- package/dist/shared/dismiss-stack.d.ts +14 -0
- package/dist/shared/dismiss-stack.js +52 -0
- package/dist/shared/dispatch-click-with-modifiers.d.ts +9 -0
- package/dist/shared/dispatch-click-with-modifiers.js +22 -0
- package/dist/shared/element-of.d.ts +7 -0
- package/dist/shared/element-of.js +14 -0
- package/dist/shared/focus.d.ts +6 -0
- package/dist/shared/focus.js +35 -0
- package/dist/shared/icons.d.ts +38 -0
- package/dist/shared/icons.js +86 -0
- package/dist/shared/input-filter.d.ts +40 -0
- package/dist/shared/input-filter.js +66 -0
- package/dist/shared/input-modality.d.ts +3 -0
- package/dist/shared/input-modality.js +26 -0
- package/dist/shared/labeling.d.ts +12 -0
- package/dist/shared/labeling.js +29 -0
- package/dist/shared/link.d.ts +12 -0
- package/dist/shared/link.js +19 -0
- package/dist/shared/merge-props.d.ts +18 -0
- package/dist/shared/merge-props.js +67 -0
- package/dist/shared/model-modifiers.d.ts +11 -0
- package/dist/shared/model-modifiers.js +9 -0
- package/dist/shared/part.d.ts +16 -0
- package/dist/shared/part.js +42 -0
- package/dist/shared/popup-state-attrs.d.ts +46 -0
- package/dist/shared/popup-state-attrs.js +23 -0
- package/dist/shared/recycle.d.ts +4 -0
- package/dist/shared/recycle.js +14 -0
- package/dist/shared/route-query.d.ts +23 -0
- package/dist/shared/route-query.js +20 -0
- package/dist/shared/surface.d.ts +27 -0
- package/dist/shared/surface.js +5 -0
- package/dist/shared/swipe-dismiss.d.ts +25 -0
- package/dist/shared/swipe-dismiss.js +37 -0
- package/dist/shared/toast-store.d.ts +98 -0
- package/dist/shared/toast-store.js +220 -0
- package/dist/shared/use-collapsible.d.ts +42 -0
- package/dist/shared/use-collapsible.js +104 -0
- package/dist/shared/use-controlled.d.ts +24 -0
- package/dist/shared/use-controlled.js +39 -0
- package/dist/shared/use-dialog.d.ts +58 -0
- package/dist/shared/use-dialog.js +175 -0
- package/dist/shared/use-dismiss.d.ts +17 -0
- package/dist/shared/use-dismiss.js +24 -0
- package/dist/shared/use-exit-animation.d.ts +12 -0
- package/dist/shared/use-exit-animation.js +15 -0
- package/dist/shared/use-field.d.ts +119 -0
- package/dist/shared/use-field.js +218 -0
- package/dist/shared/use-focus-trap.d.ts +19 -0
- package/dist/shared/use-focus-trap.js +62 -0
- package/dist/shared/use-gauge.d.ts +69 -0
- package/dist/shared/use-gauge.js +99 -0
- package/dist/shared/use-inert-background.d.ts +3 -0
- package/dist/shared/use-inert-background.js +37 -0
- package/dist/shared/use-input.d.ts +64 -0
- package/dist/shared/use-input.js +143 -0
- package/dist/shared/use-listbox.d.ts +276 -0
- package/dist/shared/use-listbox.js +1076 -0
- package/dist/shared/use-menu.d.ts +106 -0
- package/dist/shared/use-menu.js +329 -0
- package/dist/shared/use-menubar.d.ts +39 -0
- package/dist/shared/use-menubar.js +94 -0
- package/dist/shared/use-part-props.d.ts +8 -0
- package/dist/shared/use-part-props.js +15 -0
- package/dist/shared/use-positioning.d.ts +48 -0
- package/dist/shared/use-positioning.js +106 -0
- package/dist/shared/use-roving-focus.d.ts +43 -0
- package/dist/shared/use-roving-focus.js +106 -0
- package/dist/shared/use-roving-items.d.ts +47 -0
- package/dist/shared/use-roving-items.js +64 -0
- package/dist/shared/use-scroll-lock.d.ts +3 -0
- package/dist/shared/use-scroll-lock.js +71 -0
- package/dist/shared/use-toggle-indicator.d.ts +25 -0
- package/dist/shared/use-toggle-indicator.js +37 -0
- package/dist/shared/use-toggle-input.d.ts +68 -0
- package/dist/shared/use-toggle-input.js +106 -0
- package/dist/shared/use-transition-status.d.ts +27 -0
- package/dist/shared/use-transition-status.js +70 -0
- package/dist/shared/use-typeahead.d.ts +19 -0
- package/dist/shared/use-typeahead.js +45 -0
- package/dist/shared/visually-hidden.d.ts +6 -0
- package/dist/shared/visually-hidden.js +18 -0
- package/package.json +66 -4
|
@@ -0,0 +1,1076 @@
|
|
|
1
|
+
import { dataAttrs } from "./data-attrs.js";
|
|
2
|
+
import { useControlled } from "./use-controlled.js";
|
|
3
|
+
import { createContext } from "./context.js";
|
|
4
|
+
import { anchoredStateAttrs } from "./popup-state-attrs.js";
|
|
5
|
+
import { useTransitionStatus } from "./use-transition-status.js";
|
|
6
|
+
import { useExitAnimation } from "./use-exit-animation.js";
|
|
7
|
+
import { useFieldValue, useOptionalFieldContext } from "./use-field.js";
|
|
8
|
+
import { provideSurface } from "./surface.js";
|
|
9
|
+
import { usePositioning } from "./use-positioning.js";
|
|
10
|
+
import { useDismiss } from "./use-dismiss.js";
|
|
11
|
+
import { scrollIntoViewWithin } from "./focus.js";
|
|
12
|
+
import { useScrollLock } from "./use-scroll-lock.js";
|
|
13
|
+
import { useTypeahead } from "./use-typeahead.js";
|
|
14
|
+
import { useVirtualList } from "../composables/use-virtual-list.js";
|
|
15
|
+
import { measureItemAlignment } from "./align-item-with-trigger.js";
|
|
16
|
+
import { computed, nextTick, onScopeDispose, reactive, ref, toValue, useId, watch } from "vue";
|
|
17
|
+
//#region src/shared/use-listbox.ts
|
|
18
|
+
function isListboxGroup(item) {
|
|
19
|
+
return typeof item === "object" && Array.isArray(item.options);
|
|
20
|
+
}
|
|
21
|
+
function gatherLoose(items, label) {
|
|
22
|
+
const isGroup = (item) => "presets" in item;
|
|
23
|
+
const first = items.findIndex((item) => !isGroup(item));
|
|
24
|
+
if (!label || first === -1) return items;
|
|
25
|
+
const groups = items.filter(isGroup);
|
|
26
|
+
const loose = items.filter((item) => !isGroup(item));
|
|
27
|
+
return [
|
|
28
|
+
...groups.slice(0, first),
|
|
29
|
+
{
|
|
30
|
+
label,
|
|
31
|
+
presets: loose
|
|
32
|
+
},
|
|
33
|
+
...groups.slice(first)
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
var isResolvedGroup = (item) => Array.isArray(item.options);
|
|
37
|
+
/** Drops repeats by string, keeping the first: `1` and `'1'` are one value. */
|
|
38
|
+
var uniqueValues = (values) => {
|
|
39
|
+
const seen = /* @__PURE__ */ new Set();
|
|
40
|
+
return values.filter((entry) => !seen.has(String(entry)) && Boolean(seen.add(String(entry))));
|
|
41
|
+
};
|
|
42
|
+
function useListbox(options = {}) {
|
|
43
|
+
const field = useOptionalFieldContext();
|
|
44
|
+
const generatedId = useId();
|
|
45
|
+
const baseId = useId();
|
|
46
|
+
const listboxId = `${baseId}-listbox`;
|
|
47
|
+
const triggerEl = ref(null);
|
|
48
|
+
const searchEl = ref(null);
|
|
49
|
+
const listboxEl = ref(null);
|
|
50
|
+
const surfaceEl = ref(null);
|
|
51
|
+
const positionerEl = ref(null);
|
|
52
|
+
const valueEl = ref(null);
|
|
53
|
+
const query = ref("");
|
|
54
|
+
const typed = ref(false);
|
|
55
|
+
const multiple = () => toValue(options.multiple) ?? false;
|
|
56
|
+
const mode = () => toValue(options.mode) ?? "select";
|
|
57
|
+
const combobox = () => mode() === "combobox";
|
|
58
|
+
const searchable = () => combobox() || (toValue(options.searchable) ?? false);
|
|
59
|
+
const readOnly = () => (toValue(options.readOnly) ?? false) || (field?.state.value.readOnly ?? false);
|
|
60
|
+
const required = () => (toValue(options.required) ?? false) || (field?.state.value.required ?? false);
|
|
61
|
+
const loop = () => toValue(options.loop) ?? true;
|
|
62
|
+
const valueKey = () => toValue(options.valueKey) ?? "value";
|
|
63
|
+
const labelKey = () => toValue(options.labelKey) ?? "label";
|
|
64
|
+
const disabled = () => (toValue(options.disabled) ?? false) || (field?.state.value.disabled ?? false);
|
|
65
|
+
const maxHeight = () => {
|
|
66
|
+
const value = toValue(options.maxHeight);
|
|
67
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
68
|
+
};
|
|
69
|
+
const invalid = () => (toValue(options.invalid) ?? false) || (field?.state.value.invalid ?? false);
|
|
70
|
+
const closeOnSelect = () => toValue(options.closeOnSelect) ?? !multiple();
|
|
71
|
+
const value = useControlled({
|
|
72
|
+
value: () => toValue(options.value),
|
|
73
|
+
defaultValue: () => toValue(options.defaultValue) ?? (multiple() ? [] : null),
|
|
74
|
+
prop: "modelValue",
|
|
75
|
+
empty: () => multiple() ? [] : null,
|
|
76
|
+
onChange: options.onChange,
|
|
77
|
+
name: "useListbox",
|
|
78
|
+
label: "value"
|
|
79
|
+
});
|
|
80
|
+
useFieldValue(field, () => value.value);
|
|
81
|
+
const open = useControlled({
|
|
82
|
+
value: () => toValue(options.open),
|
|
83
|
+
defaultValue: () => false,
|
|
84
|
+
onChange: options.onOpenChange,
|
|
85
|
+
prop: "open",
|
|
86
|
+
empty: false,
|
|
87
|
+
name: "useListbox",
|
|
88
|
+
label: "open"
|
|
89
|
+
});
|
|
90
|
+
function close() {
|
|
91
|
+
open.value = false;
|
|
92
|
+
}
|
|
93
|
+
const { mounted, transitionStatus, setMounted } = useTransitionStatus(() => open.value);
|
|
94
|
+
const alignFellBack = ref(false);
|
|
95
|
+
const alignPlaced = ref(false);
|
|
96
|
+
const alignStyle = ref(null);
|
|
97
|
+
const alignRequested = () => (toValue(options.alignWithTrigger) ?? false) && !searchable() && !toValue(options.virtual);
|
|
98
|
+
const alignActive = computed(() => alignRequested() && !alignFellBack.value);
|
|
99
|
+
const positioning = usePositioning({
|
|
100
|
+
...options,
|
|
101
|
+
side: () => toValue(options.side) ?? "bottom",
|
|
102
|
+
align: () => toValue(options.align) ?? "start",
|
|
103
|
+
sideOffset: () => toValue(options.sideOffset) ?? 4,
|
|
104
|
+
fallbackAxis: () => toValue(options.fallbackAxis) ?? false,
|
|
105
|
+
enabled: () => mounted.value && !alignActive.value
|
|
106
|
+
});
|
|
107
|
+
const placed = computed(() => alignActive.value ? alignPlaced.value : positioning.isPositioned.value);
|
|
108
|
+
useScrollLock(() => mounted.value && alignActive.value);
|
|
109
|
+
useExitAnimation({
|
|
110
|
+
open: () => open.value,
|
|
111
|
+
mounted,
|
|
112
|
+
setMounted,
|
|
113
|
+
element: surfaceEl
|
|
114
|
+
});
|
|
115
|
+
useDismiss({
|
|
116
|
+
enabled: () => open.value,
|
|
117
|
+
elements: () => [positioning.popupRef.value, triggerEl.value],
|
|
118
|
+
onDismiss: close
|
|
119
|
+
});
|
|
120
|
+
const valueOf = (option) => option[valueKey()];
|
|
121
|
+
const labelOf = (option) => {
|
|
122
|
+
const label = option[labelKey()];
|
|
123
|
+
return label == null ? String(valueOf(option)) : String(label);
|
|
124
|
+
};
|
|
125
|
+
/** A bare value becomes an option keyed by `valueKey`, so `valueKey` still rules. */
|
|
126
|
+
const toOption = (item) => typeof item === "object" ? item : { [valueKey()]: item };
|
|
127
|
+
const resolvedOptions = computed(() => (toValue(options.options) ?? []).map((item) => {
|
|
128
|
+
if (!isListboxGroup(item)) return toOption(item);
|
|
129
|
+
return item.options.every((option) => typeof option === "object") ? item : {
|
|
130
|
+
...item,
|
|
131
|
+
options: item.options.map(toOption)
|
|
132
|
+
};
|
|
133
|
+
}));
|
|
134
|
+
const selectedValues = computed(() => {
|
|
135
|
+
const current = value.value;
|
|
136
|
+
if (Array.isArray(current)) return current;
|
|
137
|
+
return current == null || current === "" ? [] : [current];
|
|
138
|
+
});
|
|
139
|
+
const selectedKeys = computed(() => new Set(selectedValues.value.map(String)));
|
|
140
|
+
const pinned = ref(/* @__PURE__ */ new Set());
|
|
141
|
+
watch(() => open.value, (isOpen) => {
|
|
142
|
+
if (isOpen) pinned.value = toValue(options.order) === "selected-first" ? new Set(selectedKeys.value) : /* @__PURE__ */ new Set();
|
|
143
|
+
}, {
|
|
144
|
+
immediate: true,
|
|
145
|
+
flush: "sync"
|
|
146
|
+
});
|
|
147
|
+
const activeQuery = computed(() => typed.value ? query.value : "");
|
|
148
|
+
const normalizedQuery = computed(() => activeQuery.value.trim().toLowerCase());
|
|
149
|
+
function matches(option) {
|
|
150
|
+
if (options.filter) return options.filter(option, activeQuery.value);
|
|
151
|
+
if (!normalizedQuery.value) return true;
|
|
152
|
+
return labelOf(option).toLowerCase().includes(normalizedQuery.value);
|
|
153
|
+
}
|
|
154
|
+
const sections = computed(() => {
|
|
155
|
+
const result = [];
|
|
156
|
+
let index = 0;
|
|
157
|
+
let loose = null;
|
|
158
|
+
const render = (option, groupDisabled) => {
|
|
159
|
+
const optionValue = valueOf(option);
|
|
160
|
+
const rendered = {
|
|
161
|
+
option,
|
|
162
|
+
value: optionValue,
|
|
163
|
+
label: labelOf(option),
|
|
164
|
+
disabled: Boolean(option.disabled) || groupDisabled,
|
|
165
|
+
selected: selectedKeys.value.has(String(optionValue)),
|
|
166
|
+
index,
|
|
167
|
+
id: `${baseId}-o${index}`
|
|
168
|
+
};
|
|
169
|
+
index += 1;
|
|
170
|
+
return rendered;
|
|
171
|
+
};
|
|
172
|
+
const runs = [];
|
|
173
|
+
let run = null;
|
|
174
|
+
for (const item of resolvedOptions.value) {
|
|
175
|
+
if (isResolvedGroup(item)) {
|
|
176
|
+
const kept = item.options.filter(matches);
|
|
177
|
+
if (kept.length > 0) runs.push({
|
|
178
|
+
label: item.label,
|
|
179
|
+
disabled: Boolean(item.disabled),
|
|
180
|
+
items: kept
|
|
181
|
+
});
|
|
182
|
+
run = null;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (!matches(item)) continue;
|
|
186
|
+
if (!run) {
|
|
187
|
+
run = {
|
|
188
|
+
disabled: false,
|
|
189
|
+
items: []
|
|
190
|
+
};
|
|
191
|
+
runs.push(run);
|
|
192
|
+
}
|
|
193
|
+
run.items.push(item);
|
|
194
|
+
}
|
|
195
|
+
for (const { label, disabled: groupDisabled, items } of runs) {
|
|
196
|
+
const rendered = (pinned.value.size ? [...items.filter((item) => pinned.value.has(String(valueOf(item)))), ...items.filter((item) => !pinned.value.has(String(valueOf(item))))] : items).map((option) => render(option, groupDisabled));
|
|
197
|
+
if (label === void 0) {
|
|
198
|
+
loose = { options: rendered };
|
|
199
|
+
result.push(loose);
|
|
200
|
+
} else result.push({
|
|
201
|
+
label,
|
|
202
|
+
labelId: `${baseId}-g${result.length}`,
|
|
203
|
+
options: rendered
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (createCandidate.value !== null) {
|
|
207
|
+
const coined = { [valueKey()]: createCandidate.value };
|
|
208
|
+
result.push({
|
|
209
|
+
create: true,
|
|
210
|
+
options: [{
|
|
211
|
+
option: coined,
|
|
212
|
+
value: createCandidate.value,
|
|
213
|
+
label: createCandidate.value,
|
|
214
|
+
disabled: false,
|
|
215
|
+
selected: false,
|
|
216
|
+
create: true,
|
|
217
|
+
index,
|
|
218
|
+
id: `${baseId}-o${index}`
|
|
219
|
+
}]
|
|
220
|
+
});
|
|
221
|
+
index += 1;
|
|
222
|
+
}
|
|
223
|
+
return result;
|
|
224
|
+
});
|
|
225
|
+
const flatOptions = computed(() => sections.value.flatMap((section) => section.options));
|
|
226
|
+
const optionIndex = computed(() => {
|
|
227
|
+
const all = /* @__PURE__ */ new Map();
|
|
228
|
+
for (const item of resolvedOptions.value) {
|
|
229
|
+
const list = isResolvedGroup(item) ? item.options : [item];
|
|
230
|
+
for (const option of list) all.set(String(valueOf(option)), option);
|
|
231
|
+
}
|
|
232
|
+
return all;
|
|
233
|
+
});
|
|
234
|
+
const selectedOptions = computed(() => {
|
|
235
|
+
return selectedValues.value.map((selected, position) => {
|
|
236
|
+
const option = optionIndex.value.get(String(selected)) ?? { [valueKey()]: selected };
|
|
237
|
+
return {
|
|
238
|
+
option,
|
|
239
|
+
value: selected,
|
|
240
|
+
label: labelOf(option),
|
|
241
|
+
disabled: Boolean(option.disabled),
|
|
242
|
+
selected: true,
|
|
243
|
+
index: position,
|
|
244
|
+
id: `${baseId}-s${position}`
|
|
245
|
+
};
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
const createCandidate = computed(() => {
|
|
249
|
+
const rule = toValue(options.creatable) ?? false;
|
|
250
|
+
if (rule === false) return null;
|
|
251
|
+
const raw = activeQuery.value.trim();
|
|
252
|
+
if (!raw) return null;
|
|
253
|
+
if (typeof rule === "function" && !rule(raw)) return null;
|
|
254
|
+
const lowered = raw.toLowerCase();
|
|
255
|
+
for (const option of optionIndex.value.values()) if (String(valueOf(option)).toLowerCase() === lowered || labelOf(option).toLowerCase() === lowered) return null;
|
|
256
|
+
if (selectedValues.value.some((entry) => String(entry).toLowerCase() === lowered)) return null;
|
|
257
|
+
return raw;
|
|
258
|
+
});
|
|
259
|
+
const flatten = computed(() => toValue(options.flatten));
|
|
260
|
+
const visibleOptions = computed(() => {
|
|
261
|
+
const limit = flatten.value;
|
|
262
|
+
if (limit === void 0 || limit < 0) return selectedOptions.value;
|
|
263
|
+
return selectedOptions.value.slice(0, limit);
|
|
264
|
+
});
|
|
265
|
+
const hiddenCount = computed(() => selectedOptions.value.length - visibleOptions.value.length);
|
|
266
|
+
const collapsed = computed(() => hiddenCount.value > 0);
|
|
267
|
+
const summary = computed(() => {
|
|
268
|
+
const named = visibleOptions.value.map((option) => option.label).join(", ");
|
|
269
|
+
if (hiddenCount.value === 0) return named;
|
|
270
|
+
if (!named) return `${hiddenCount.value} selected`;
|
|
271
|
+
return `${named} and ${hiddenCount.value} more`;
|
|
272
|
+
});
|
|
273
|
+
const clearable = () => toValue(options.clearable) ?? true;
|
|
274
|
+
const showClear = computed(() => clearable() && !disabled() && !readOnly() && selectedValues.value.length > 0);
|
|
275
|
+
const grouped = computed(() => sections.value.some((section) => section.label));
|
|
276
|
+
const isVirtual = computed(() => (toValue(options.virtual) ?? false) && !grouped.value);
|
|
277
|
+
const rowHeight = ref(32);
|
|
278
|
+
const windowing = useVirtualList({
|
|
279
|
+
items: flatOptions,
|
|
280
|
+
itemHeight: rowHeight,
|
|
281
|
+
enabled: () => isVirtual.value && listboxEl.value !== null,
|
|
282
|
+
scroller: listboxEl,
|
|
283
|
+
overscan: 10
|
|
284
|
+
});
|
|
285
|
+
const virtualRows = computed(() => isVirtual.value ? {
|
|
286
|
+
options: windowing.visible.value,
|
|
287
|
+
before: windowing.before.value,
|
|
288
|
+
after: windowing.after.value
|
|
289
|
+
} : null);
|
|
290
|
+
watch(listboxEl, (list) => {
|
|
291
|
+
const option = isVirtual.value ? list?.querySelector("[role=\"option\"]") : null;
|
|
292
|
+
if (!option) return;
|
|
293
|
+
const style = getComputedStyle(option);
|
|
294
|
+
const px = (value) => parseFloat(value) || 0;
|
|
295
|
+
const box = style.boxSizing === "border-box" ? 0 : px(style.paddingTop) + px(style.paddingBottom) + px(style.borderTopWidth) + px(style.borderBottomWidth);
|
|
296
|
+
const height = px(style.height) + box;
|
|
297
|
+
if (height > 0) rowHeight.value = height;
|
|
298
|
+
else if (option.offsetHeight) rowHeight.value = option.offsetHeight;
|
|
299
|
+
}, { flush: "post" });
|
|
300
|
+
const activeId = ref(void 0);
|
|
301
|
+
const activeIndex = ref(-1);
|
|
302
|
+
const enabledIndices = computed(() => flatOptions.value.filter((option) => !option.disabled).map((option) => option.index));
|
|
303
|
+
/**
|
|
304
|
+
* `center` is for opening on the selection; the keyboard scrolls only as far as it must.
|
|
305
|
+
* Our windowing's rows share one height, so it scrolls by the row's place; otherwise to the
|
|
306
|
+
* option as it is rendered. One an app's virtualizer left out is the app's to reach, from
|
|
307
|
+
* `activeIndex`.
|
|
308
|
+
*/
|
|
309
|
+
function activateAt(index, scroll = true) {
|
|
310
|
+
activeIndex.value = index;
|
|
311
|
+
activeId.value = flatOptions.value[index]?.id;
|
|
312
|
+
const list = listboxEl.value;
|
|
313
|
+
if (!scroll || index < 0 || !list) return;
|
|
314
|
+
if (!isVirtual.value) {
|
|
315
|
+
const element = activeId.value ? list.querySelector(`[id="${activeId.value}"]`) : null;
|
|
316
|
+
if (element) scrollIntoViewWithin(element, list);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const inset = parseFloat(getComputedStyle(list).paddingTop) || 0;
|
|
320
|
+
const top = inset + index * rowHeight.value;
|
|
321
|
+
if (scroll === "center") list.scrollTop = top + rowHeight.value / 2 - list.clientHeight / 2;
|
|
322
|
+
else if (top < list.scrollTop + inset) list.scrollTop = top - inset;
|
|
323
|
+
else if (top + rowHeight.value > list.scrollTop + list.clientHeight - inset) list.scrollTop = top + rowHeight.value - list.clientHeight + inset;
|
|
324
|
+
}
|
|
325
|
+
function navigate(event) {
|
|
326
|
+
const list = enabledIndices.value;
|
|
327
|
+
const position = list.indexOf(activeIndex.value);
|
|
328
|
+
const last = list.length - 1;
|
|
329
|
+
let next;
|
|
330
|
+
if (event.key === "ArrowDown") next = position + 1;
|
|
331
|
+
else if (event.key === "ArrowUp") next = position < 0 ? last : position - 1;
|
|
332
|
+
else if (event.key === "Home") next = 0;
|
|
333
|
+
else if (event.key === "End") next = last;
|
|
334
|
+
else return false;
|
|
335
|
+
event.preventDefault();
|
|
336
|
+
if (list.length === 0) return true;
|
|
337
|
+
if (next > last) next = loop() ? 0 : last;
|
|
338
|
+
if (next < 0) next = loop() ? last : 0;
|
|
339
|
+
activateAt(list[next]);
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
342
|
+
const typeahead = useTypeahead({
|
|
343
|
+
items: () => flatOptions.value.filter((option) => !option.disabled),
|
|
344
|
+
getText: (option) => option.label,
|
|
345
|
+
getActive: () => flatOptions.value[activeIndex.value] ?? null,
|
|
346
|
+
onMatch: (option) => activateAt(option.index)
|
|
347
|
+
});
|
|
348
|
+
function activateInitial(edge) {
|
|
349
|
+
const selected = flatOptions.value.find((option) => option.selected && !option.disabled);
|
|
350
|
+
if (selected) {
|
|
351
|
+
activateAt(selected.index, "center");
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
const list = enabledIndices.value;
|
|
355
|
+
activateAt(list[edge === "last" ? list.length - 1 : 0] ?? -1);
|
|
356
|
+
}
|
|
357
|
+
function selectActive() {
|
|
358
|
+
commit(flatOptions.value[activeIndex.value]);
|
|
359
|
+
}
|
|
360
|
+
function commit(option) {
|
|
361
|
+
if (!option || option.disabled) return;
|
|
362
|
+
if (option.create) options.onCreate?.(String(option.value));
|
|
363
|
+
toggle(option.value);
|
|
364
|
+
if (combobox()) resetInput();
|
|
365
|
+
}
|
|
366
|
+
function resetInput() {
|
|
367
|
+
typed.value = false;
|
|
368
|
+
query.value = combobox() && !multiple() ? selectedOptions.value[0]?.label ?? "" : "";
|
|
369
|
+
}
|
|
370
|
+
function toggle(next) {
|
|
371
|
+
if (disabled() || readOnly()) return;
|
|
372
|
+
if (multiple()) {
|
|
373
|
+
const current = selectedValues.value;
|
|
374
|
+
value.value = selectedKeys.value.has(String(next)) ? current.filter((entry) => String(entry) !== String(next)) : [...current, next];
|
|
375
|
+
} else value.value = next;
|
|
376
|
+
if (closeOnSelect()) close();
|
|
377
|
+
}
|
|
378
|
+
function deselect(target) {
|
|
379
|
+
if (disabled() || readOnly()) return;
|
|
380
|
+
value.value = multiple() ? selectedValues.value.filter((entry) => String(entry) !== String(target)) : null;
|
|
381
|
+
}
|
|
382
|
+
function clear() {
|
|
383
|
+
if (disabled() || readOnly()) return;
|
|
384
|
+
value.value = multiple() ? [] : null;
|
|
385
|
+
resetInput();
|
|
386
|
+
}
|
|
387
|
+
const presetsOpen = reactive(/* @__PURE__ */ new Map());
|
|
388
|
+
const presetSections = computed(() => {
|
|
389
|
+
if (!multiple()) return [];
|
|
390
|
+
const search = normalizedQuery.value;
|
|
391
|
+
const hit = (text) => !search || text.toLowerCase().includes(search);
|
|
392
|
+
const render = (preset) => ({
|
|
393
|
+
preset,
|
|
394
|
+
label: preset.label,
|
|
395
|
+
active: preset.values.length > 0 && preset.values.every((entry) => selectedKeys.value.has(String(entry))),
|
|
396
|
+
disabled: Boolean(preset.disabled)
|
|
397
|
+
});
|
|
398
|
+
const result = [];
|
|
399
|
+
let loose = null;
|
|
400
|
+
for (const item of gatherLoose(toValue(options.presets) ?? [], toValue(options.presetsLabel))) if ("presets" in item) {
|
|
401
|
+
const kept = item.presets.filter((preset) => hit(preset.label) || hit(item.label));
|
|
402
|
+
if (kept.length) result.push({
|
|
403
|
+
label: item.label,
|
|
404
|
+
labelId: `${baseId}-p${result.length}`,
|
|
405
|
+
open: Boolean(search) || (presetsOpen.get(item.label) ?? !item.collapsed),
|
|
406
|
+
presets: kept.map(render)
|
|
407
|
+
});
|
|
408
|
+
loose = null;
|
|
409
|
+
} else if (hit(item.label)) {
|
|
410
|
+
if (!loose) result.push(loose = {
|
|
411
|
+
open: true,
|
|
412
|
+
presets: []
|
|
413
|
+
});
|
|
414
|
+
loose.presets.push(render(item));
|
|
415
|
+
}
|
|
416
|
+
return result;
|
|
417
|
+
});
|
|
418
|
+
function applyPreset({ preset, active, disabled: off }, replace) {
|
|
419
|
+
if (disabled() || readOnly() || off) return;
|
|
420
|
+
const current = selectedValues.value;
|
|
421
|
+
const presetKeys = new Set(preset.values.map(String));
|
|
422
|
+
value.value = replace ? uniqueValues(preset.values) : active ? current.filter((entry) => !presetKeys.has(String(entry))) : uniqueValues([...current, ...preset.values]);
|
|
423
|
+
}
|
|
424
|
+
const keepFocus = (event) => event.preventDefault();
|
|
425
|
+
const presetsProps = computed(() => ({
|
|
426
|
+
...hooks.value,
|
|
427
|
+
"data-part": "presets"
|
|
428
|
+
}));
|
|
429
|
+
const getPresetItemProps = (preset) => ({
|
|
430
|
+
"data-part": "preset-item",
|
|
431
|
+
"data-active": preset.active ? "" : void 0,
|
|
432
|
+
"data-disabled": preset.disabled ? "" : void 0
|
|
433
|
+
});
|
|
434
|
+
function getPresetProps(preset) {
|
|
435
|
+
return {
|
|
436
|
+
"data-part": "preset",
|
|
437
|
+
type: "button",
|
|
438
|
+
"aria-pressed": preset.active,
|
|
439
|
+
"data-active": preset.active ? "" : void 0,
|
|
440
|
+
"data-disabled": preset.disabled ? "" : void 0,
|
|
441
|
+
disabled: preset.disabled || void 0,
|
|
442
|
+
onMousedown: keepFocus,
|
|
443
|
+
onClick: () => applyPreset(preset, false)
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
function getPresetReplaceProps(preset) {
|
|
447
|
+
return {
|
|
448
|
+
"data-part": "preset-replace",
|
|
449
|
+
type: "button",
|
|
450
|
+
"aria-label": `Replace with ${preset.label}`,
|
|
451
|
+
disabled: preset.disabled || void 0,
|
|
452
|
+
onMousedown: keepFocus,
|
|
453
|
+
onClick: () => applyPreset(preset, true)
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
const getPresetGroupProps = (section) => section.label ? {
|
|
457
|
+
"data-part": "preset-group",
|
|
458
|
+
role: "group",
|
|
459
|
+
"aria-labelledby": section.labelId,
|
|
460
|
+
...openAttrs(section.open)
|
|
461
|
+
} : { "data-part": "preset-group" };
|
|
462
|
+
const getPresetGroupLabelProps = (section) => ({
|
|
463
|
+
"data-part": "preset-group-label",
|
|
464
|
+
id: section.labelId
|
|
465
|
+
});
|
|
466
|
+
const openAttrs = (open) => ({
|
|
467
|
+
"data-open": open ? "" : void 0,
|
|
468
|
+
"data-closed": open ? void 0 : ""
|
|
469
|
+
});
|
|
470
|
+
const getPresetGroupTriggerProps = (section) => ({
|
|
471
|
+
"data-part": "preset-group-trigger",
|
|
472
|
+
type: "button",
|
|
473
|
+
"aria-expanded": section.open,
|
|
474
|
+
"aria-controls": `${section.labelId}-panel`,
|
|
475
|
+
...openAttrs(section.open),
|
|
476
|
+
disabled: Boolean(normalizedQuery.value) || void 0,
|
|
477
|
+
onMousedown: keepFocus,
|
|
478
|
+
onClick: () => section.label && presetsOpen.set(section.label, !section.open)
|
|
479
|
+
});
|
|
480
|
+
const getPresetGroupPanelProps = (section) => section.label ? {
|
|
481
|
+
"data-part": "preset-group-panel",
|
|
482
|
+
id: `${section.labelId}-panel`,
|
|
483
|
+
inert: !section.open || void 0
|
|
484
|
+
} : { "data-part": "preset-group-panel" };
|
|
485
|
+
function focusTarget() {
|
|
486
|
+
return combobox() ? searchEl.value ?? triggerEl.value : triggerEl.value;
|
|
487
|
+
}
|
|
488
|
+
function openMenu(edge = "first") {
|
|
489
|
+
if (disabled() || readOnly()) return;
|
|
490
|
+
open.value = true;
|
|
491
|
+
pendingEdge = edge;
|
|
492
|
+
}
|
|
493
|
+
let pendingEdge = "first";
|
|
494
|
+
function onOpenKeydown(event) {
|
|
495
|
+
if (navigate(event)) return;
|
|
496
|
+
if (event.key === "Enter") {
|
|
497
|
+
event.preventDefault();
|
|
498
|
+
selectActive();
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (event.key === "Tab") {
|
|
502
|
+
close();
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if (searchable()) {
|
|
506
|
+
if (event.key === "Backspace" && query.value === "" && multiple()) {
|
|
507
|
+
const last = selectedValues.value.at(-1);
|
|
508
|
+
if (last !== void 0) deselect(last);
|
|
509
|
+
}
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (event.key === " ") {
|
|
513
|
+
event.preventDefault();
|
|
514
|
+
selectActive();
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
typeahead.onKeydown(event);
|
|
518
|
+
}
|
|
519
|
+
function onInputKeydown(event) {
|
|
520
|
+
if (disabled() || readOnly()) return;
|
|
521
|
+
if (!open.value) {
|
|
522
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
523
|
+
event.preventDefault();
|
|
524
|
+
openMenu(event.key === "ArrowUp" ? "last" : "first");
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
if (event.key === "Backspace" && query.value === "" && multiple()) {
|
|
528
|
+
const last = selectedValues.value.at(-1);
|
|
529
|
+
if (last !== void 0) deselect(last);
|
|
530
|
+
}
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
onOpenKeydown(event);
|
|
534
|
+
}
|
|
535
|
+
function onTriggerKeydown(event) {
|
|
536
|
+
if (disabled() || readOnly()) return;
|
|
537
|
+
if (!open.value) {
|
|
538
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
539
|
+
event.preventDefault();
|
|
540
|
+
openMenu(event.key === "ArrowUp" ? "last" : "first");
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
544
|
+
event.preventDefault();
|
|
545
|
+
openMenu("first");
|
|
546
|
+
}
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
onOpenKeydown(event);
|
|
550
|
+
}
|
|
551
|
+
function placeOverTrigger() {
|
|
552
|
+
const trigger = triggerEl.value;
|
|
553
|
+
const positioner = positionerEl.value;
|
|
554
|
+
const popup = surfaceEl.value;
|
|
555
|
+
const list = listboxEl.value;
|
|
556
|
+
if (!trigger || !positioner || !popup || !list) return;
|
|
557
|
+
const item = list.querySelector("[role=\"option\"][data-selected]") ?? list.querySelector("[role=\"option\"]");
|
|
558
|
+
const placement = item ? measureItemAlignment({
|
|
559
|
+
trigger,
|
|
560
|
+
positioner,
|
|
561
|
+
popup,
|
|
562
|
+
list,
|
|
563
|
+
item,
|
|
564
|
+
value: valueEl.value,
|
|
565
|
+
maxHeight: maxHeight()
|
|
566
|
+
}) : null;
|
|
567
|
+
if (!placement) {
|
|
568
|
+
list.style.removeProperty("max-height");
|
|
569
|
+
popup.style.removeProperty("--listbox-transform-origin");
|
|
570
|
+
alignPlaced.value = false;
|
|
571
|
+
alignFellBack.value = true;
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
alignStyle.value = {
|
|
575
|
+
left: `${placement.left}px`,
|
|
576
|
+
top: `${placement.top}px`
|
|
577
|
+
};
|
|
578
|
+
list.style.maxHeight = `${placement.listMaxHeight}px`;
|
|
579
|
+
list.scrollTop = placement.scrollTop;
|
|
580
|
+
popup.style.setProperty("--listbox-transform-origin", `50% ${placement.originRatio}%`);
|
|
581
|
+
alignPlaced.value = true;
|
|
582
|
+
}
|
|
583
|
+
watch(mounted, (isMounted) => {
|
|
584
|
+
if (!isMounted) alignFellBack.value = false;
|
|
585
|
+
}, { flush: "post" });
|
|
586
|
+
watch(() => mounted.value && alignActive.value, async (on) => {
|
|
587
|
+
if (!on) {
|
|
588
|
+
alignPlaced.value = false;
|
|
589
|
+
alignStyle.value = null;
|
|
590
|
+
listboxEl.value?.style.removeProperty("max-height");
|
|
591
|
+
surfaceEl.value?.style.removeProperty("--listbox-transform-origin");
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
await nextTick();
|
|
595
|
+
placeOverTrigger();
|
|
596
|
+
}, { flush: "post" });
|
|
597
|
+
watch(() => mounted.value && placed.value, async (ready) => {
|
|
598
|
+
if (!ready) return;
|
|
599
|
+
await nextTick();
|
|
600
|
+
if (searchable()) searchEl.value?.focus({ preventScroll: true });
|
|
601
|
+
activateInitial(pendingEdge);
|
|
602
|
+
pendingEdge = "first";
|
|
603
|
+
}, { flush: "post" });
|
|
604
|
+
watch(() => open.value, (isOpen) => {
|
|
605
|
+
if (isOpen) return;
|
|
606
|
+
const active = document.activeElement;
|
|
607
|
+
const hadFocus = !active || active === document.body || Boolean(positioning.popupRef.value?.contains(active));
|
|
608
|
+
resetInput();
|
|
609
|
+
activeId.value = void 0;
|
|
610
|
+
activeIndex.value = -1;
|
|
611
|
+
if (hadFocus) focusTarget()?.focus({ preventScroll: true });
|
|
612
|
+
}, { flush: "post" });
|
|
613
|
+
watch(() => mounted.value && alignActive.value, (on) => {
|
|
614
|
+
if (typeof window === "undefined") return;
|
|
615
|
+
if (on) window.addEventListener("resize", placeOverTrigger);
|
|
616
|
+
else window.removeEventListener("resize", placeOverTrigger);
|
|
617
|
+
}, { flush: "post" });
|
|
618
|
+
onScopeDispose(() => {
|
|
619
|
+
if (typeof window !== "undefined") window.removeEventListener("resize", placeOverTrigger);
|
|
620
|
+
});
|
|
621
|
+
watch(() => normalizedQuery.value, async () => {
|
|
622
|
+
if (!open.value) return;
|
|
623
|
+
await nextTick();
|
|
624
|
+
activateAt(enabledIndices.value[0] ?? -1);
|
|
625
|
+
}, { flush: "post" });
|
|
626
|
+
watch(() => selectedValues.value.length > 0, (filled) => field?.setFilled(filled), { immediate: true });
|
|
627
|
+
watch(() => combobox() && !multiple() ? selectedOptions.value[0]?.label ?? "" : null, (label) => {
|
|
628
|
+
if (label === null || open.value) return;
|
|
629
|
+
typed.value = false;
|
|
630
|
+
query.value = label;
|
|
631
|
+
}, { immediate: true });
|
|
632
|
+
const canScrollUp = ref(false);
|
|
633
|
+
const canScrollDown = ref(false);
|
|
634
|
+
const SCROLL_EDGE_TOLERANCE = 1;
|
|
635
|
+
function measureScrollEdges() {
|
|
636
|
+
const list = listboxEl.value;
|
|
637
|
+
if (!list) {
|
|
638
|
+
canScrollUp.value = false;
|
|
639
|
+
canScrollDown.value = false;
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
const max = list.scrollHeight - list.clientHeight;
|
|
643
|
+
canScrollUp.value = list.scrollTop > SCROLL_EDGE_TOLERANCE;
|
|
644
|
+
canScrollDown.value = list.scrollTop < max - SCROLL_EDGE_TOLERANCE;
|
|
645
|
+
}
|
|
646
|
+
const SCROLL_ARROW_SPEED = 420;
|
|
647
|
+
let scrollFrame = 0;
|
|
648
|
+
function stopArrowScroll() {
|
|
649
|
+
if (scrollFrame) {
|
|
650
|
+
cancelAnimationFrame(scrollFrame);
|
|
651
|
+
scrollFrame = 0;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
function startArrowScroll(direction) {
|
|
655
|
+
stopArrowScroll();
|
|
656
|
+
let last = null;
|
|
657
|
+
const step = (now) => {
|
|
658
|
+
const list = listboxEl.value;
|
|
659
|
+
if (!list) {
|
|
660
|
+
scrollFrame = 0;
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
const elapsed = last === null ? 0 : Math.min(Math.max(now - last, 0), 64);
|
|
664
|
+
last = now;
|
|
665
|
+
if (elapsed > 0) {
|
|
666
|
+
const before = list.scrollTop;
|
|
667
|
+
list.scrollTop = before + elapsed / 1e3 * SCROLL_ARROW_SPEED * (direction === "up" ? -1 : 1);
|
|
668
|
+
measureScrollEdges();
|
|
669
|
+
if (list.scrollTop === before) {
|
|
670
|
+
scrollFrame = 0;
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
scrollFrame = requestAnimationFrame(step);
|
|
675
|
+
};
|
|
676
|
+
scrollFrame = requestAnimationFrame(step);
|
|
677
|
+
}
|
|
678
|
+
watch(() => [
|
|
679
|
+
mounted.value,
|
|
680
|
+
placed.value,
|
|
681
|
+
sections.value
|
|
682
|
+
], async ([isMounted]) => {
|
|
683
|
+
if (!isMounted) stopArrowScroll();
|
|
684
|
+
await nextTick();
|
|
685
|
+
measureScrollEdges();
|
|
686
|
+
}, { flush: "post" });
|
|
687
|
+
onScopeDispose(stopArrowScroll);
|
|
688
|
+
const state = computed(() => ({
|
|
689
|
+
mode: mode(),
|
|
690
|
+
open: open.value,
|
|
691
|
+
disabled: disabled(),
|
|
692
|
+
readOnly: readOnly(),
|
|
693
|
+
required: required(),
|
|
694
|
+
invalid: invalid(),
|
|
695
|
+
multiple: multiple(),
|
|
696
|
+
searchable: searchable(),
|
|
697
|
+
creating: createCandidate.value !== null,
|
|
698
|
+
filled: selectedValues.value.length > 0,
|
|
699
|
+
empty: flatOptions.value.length === 0,
|
|
700
|
+
alignedToItem: alignActive.value && alignPlaced.value,
|
|
701
|
+
side: positioning.renderedSide.value,
|
|
702
|
+
align: positioning.renderedAlign.value,
|
|
703
|
+
transitionStatus: transitionStatus.value
|
|
704
|
+
}));
|
|
705
|
+
const hooks = computed(() => dataAttrs(state.value, {
|
|
706
|
+
...anchoredStateAttrs,
|
|
707
|
+
alignedToItem: (on) => on ? { "data-aligned-to-item": "" } : null
|
|
708
|
+
}));
|
|
709
|
+
const described = computed(() => {
|
|
710
|
+
if (!field) return {};
|
|
711
|
+
return {
|
|
712
|
+
"aria-labelledby": field.labelledBy.value,
|
|
713
|
+
"aria-describedby": field.describedBy.value
|
|
714
|
+
};
|
|
715
|
+
});
|
|
716
|
+
const triggerId = computed(() => toValue(options.id) ?? field?.controlId.value ?? generatedId);
|
|
717
|
+
const rootProps = computed(() => ({
|
|
718
|
+
...hooks.value,
|
|
719
|
+
"data-part": "root"
|
|
720
|
+
}));
|
|
721
|
+
function setTrigger(el) {
|
|
722
|
+
triggerEl.value = el ?? null;
|
|
723
|
+
positioning.anchorRef.value = el ?? null;
|
|
724
|
+
}
|
|
725
|
+
const comboboxTriggerProps = computed(() => ({
|
|
726
|
+
...hooks.value,
|
|
727
|
+
"data-part": "trigger",
|
|
728
|
+
ref: setTrigger,
|
|
729
|
+
onPointerdown(event) {
|
|
730
|
+
if (disabled() || readOnly()) return;
|
|
731
|
+
if (event.target?.closest("input, button, [role=\"button\"]")) return;
|
|
732
|
+
event.preventDefault();
|
|
733
|
+
searchEl.value?.focus({ preventScroll: true });
|
|
734
|
+
if (!open.value) openMenu("first");
|
|
735
|
+
}
|
|
736
|
+
}));
|
|
737
|
+
const selectTriggerProps = computed(() => ({
|
|
738
|
+
...hooks.value,
|
|
739
|
+
...described.value,
|
|
740
|
+
"data-part": "trigger",
|
|
741
|
+
id: triggerId.value,
|
|
742
|
+
tabindex: disabled() ? void 0 : 0,
|
|
743
|
+
"aria-haspopup": "listbox",
|
|
744
|
+
"aria-expanded": open.value,
|
|
745
|
+
"aria-controls": mounted.value ? listboxId : void 0,
|
|
746
|
+
"aria-disabled": disabled() || void 0,
|
|
747
|
+
"aria-required": required() || void 0,
|
|
748
|
+
"aria-invalid": invalid() || void 0,
|
|
749
|
+
...searchable() ? { role: "button" } : {
|
|
750
|
+
role: "combobox",
|
|
751
|
+
"aria-readonly": readOnly() || void 0,
|
|
752
|
+
"aria-activedescendant": open.value ? activeId.value : void 0
|
|
753
|
+
},
|
|
754
|
+
ref: setTrigger,
|
|
755
|
+
onClick() {
|
|
756
|
+
if (disabled() || readOnly()) return;
|
|
757
|
+
open.value = !open.value;
|
|
758
|
+
},
|
|
759
|
+
onKeydown: onTriggerKeydown,
|
|
760
|
+
onFocus() {
|
|
761
|
+
field?.setFocused(true);
|
|
762
|
+
},
|
|
763
|
+
onBlur() {
|
|
764
|
+
field?.setFocused(false);
|
|
765
|
+
field?.setTouched(true);
|
|
766
|
+
}
|
|
767
|
+
}));
|
|
768
|
+
const triggerProps = computed(() => combobox() ? comboboxTriggerProps.value : selectTriggerProps.value);
|
|
769
|
+
const clearProps = computed(() => ({
|
|
770
|
+
...hooks.value,
|
|
771
|
+
"data-part": "clear",
|
|
772
|
+
type: "button",
|
|
773
|
+
tabindex: -1,
|
|
774
|
+
"aria-label": "Clear selection",
|
|
775
|
+
onClick(event) {
|
|
776
|
+
event.stopPropagation();
|
|
777
|
+
clear();
|
|
778
|
+
focusTarget()?.focus({ preventScroll: true });
|
|
779
|
+
}
|
|
780
|
+
}));
|
|
781
|
+
const triggerWidth = ref(0);
|
|
782
|
+
function measureTrigger() {
|
|
783
|
+
if (triggerEl.value) triggerWidth.value = triggerEl.value.offsetWidth;
|
|
784
|
+
}
|
|
785
|
+
watch(mounted, (isMounted) => {
|
|
786
|
+
if (!isMounted) {
|
|
787
|
+
observer?.disconnect();
|
|
788
|
+
observer = null;
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
measureTrigger();
|
|
792
|
+
if (typeof ResizeObserver !== "undefined" && triggerEl.value) {
|
|
793
|
+
observer = new ResizeObserver(measureTrigger);
|
|
794
|
+
observer.observe(triggerEl.value);
|
|
795
|
+
}
|
|
796
|
+
}, { flush: "post" });
|
|
797
|
+
let observer = null;
|
|
798
|
+
function setPositioner(el) {
|
|
799
|
+
const node = el ?? null;
|
|
800
|
+
positionerEl.value = node;
|
|
801
|
+
positioning.popupRef.value = node;
|
|
802
|
+
}
|
|
803
|
+
const positionerProps = computed(() => {
|
|
804
|
+
if (alignActive.value) return {
|
|
805
|
+
style: {
|
|
806
|
+
position: "fixed",
|
|
807
|
+
zIndex: 50,
|
|
808
|
+
"--listbox-trigger-width": `${triggerWidth.value}px`,
|
|
809
|
+
...alignStyle.value ?? {},
|
|
810
|
+
visibility: alignPlaced.value ? void 0 : "hidden"
|
|
811
|
+
},
|
|
812
|
+
"data-part": "positioner",
|
|
813
|
+
"data-side": "none",
|
|
814
|
+
"data-align": "item",
|
|
815
|
+
ref: setPositioner
|
|
816
|
+
};
|
|
817
|
+
const base = positioning.positionerProps.value;
|
|
818
|
+
return {
|
|
819
|
+
...base,
|
|
820
|
+
"data-part": "positioner",
|
|
821
|
+
style: {
|
|
822
|
+
...base.style,
|
|
823
|
+
"--listbox-trigger-width": `${triggerWidth.value}px`
|
|
824
|
+
},
|
|
825
|
+
ref: setPositioner
|
|
826
|
+
};
|
|
827
|
+
});
|
|
828
|
+
const valueProps = computed(() => ({
|
|
829
|
+
...hooks.value,
|
|
830
|
+
"data-part": "value",
|
|
831
|
+
ref: (el) => {
|
|
832
|
+
valueEl.value = el ?? null;
|
|
833
|
+
}
|
|
834
|
+
}));
|
|
835
|
+
const indicatorProps = computed(() => ({
|
|
836
|
+
...hooks.value,
|
|
837
|
+
"data-part": "indicator",
|
|
838
|
+
"aria-hidden": "true"
|
|
839
|
+
}));
|
|
840
|
+
const emptyProps = computed(() => ({
|
|
841
|
+
...hooks.value,
|
|
842
|
+
"data-part": "empty"
|
|
843
|
+
}));
|
|
844
|
+
const popupProps = computed(() => ({
|
|
845
|
+
...hooks.value,
|
|
846
|
+
"data-part": "popup",
|
|
847
|
+
ref: (el) => {
|
|
848
|
+
surfaceEl.value = el ?? null;
|
|
849
|
+
}
|
|
850
|
+
}));
|
|
851
|
+
function onQueryInput(event) {
|
|
852
|
+
query.value = event.target.value;
|
|
853
|
+
typed.value = true;
|
|
854
|
+
}
|
|
855
|
+
const textInputProps = computed(() => ({
|
|
856
|
+
...hooks.value,
|
|
857
|
+
type: "text",
|
|
858
|
+
role: "combobox",
|
|
859
|
+
autocomplete: "off",
|
|
860
|
+
autocorrect: "off",
|
|
861
|
+
spellcheck: false,
|
|
862
|
+
"aria-controls": listboxId,
|
|
863
|
+
"aria-autocomplete": "list",
|
|
864
|
+
"aria-activedescendant": activeId.value,
|
|
865
|
+
value: query.value,
|
|
866
|
+
ref: (el) => {
|
|
867
|
+
searchEl.value = el ?? null;
|
|
868
|
+
},
|
|
869
|
+
onInput: onQueryInput
|
|
870
|
+
}));
|
|
871
|
+
const searchProps = computed(() => ({
|
|
872
|
+
...textInputProps.value,
|
|
873
|
+
"data-part": "search",
|
|
874
|
+
"aria-expanded": true,
|
|
875
|
+
onKeydown: onOpenKeydown
|
|
876
|
+
}));
|
|
877
|
+
const inputProps = computed(() => ({
|
|
878
|
+
...textInputProps.value,
|
|
879
|
+
...described.value,
|
|
880
|
+
"data-part": "input",
|
|
881
|
+
id: triggerId.value,
|
|
882
|
+
disabled: disabled() || void 0,
|
|
883
|
+
readonly: readOnly() || void 0,
|
|
884
|
+
"aria-expanded": open.value,
|
|
885
|
+
"aria-controls": mounted.value ? listboxId : void 0,
|
|
886
|
+
"aria-activedescendant": open.value ? activeId.value : void 0,
|
|
887
|
+
"aria-required": required() || void 0,
|
|
888
|
+
"aria-invalid": invalid() || void 0,
|
|
889
|
+
onInput(event) {
|
|
890
|
+
onQueryInput(event);
|
|
891
|
+
if (!open.value) openMenu("first");
|
|
892
|
+
},
|
|
893
|
+
onKeydown: onInputKeydown,
|
|
894
|
+
onClick() {
|
|
895
|
+
if (!open.value) openMenu("first");
|
|
896
|
+
},
|
|
897
|
+
onFocus() {
|
|
898
|
+
field?.setFocused(true);
|
|
899
|
+
},
|
|
900
|
+
onBlur() {
|
|
901
|
+
field?.setFocused(false);
|
|
902
|
+
field?.setTouched(true);
|
|
903
|
+
}
|
|
904
|
+
}));
|
|
905
|
+
const chipsProps = computed(() => ({
|
|
906
|
+
...hooks.value,
|
|
907
|
+
"data-part": "chips"
|
|
908
|
+
}));
|
|
909
|
+
function getScrollProps(direction) {
|
|
910
|
+
return {
|
|
911
|
+
...hooks.value,
|
|
912
|
+
"data-part": "scroll",
|
|
913
|
+
"data-direction": direction,
|
|
914
|
+
"aria-hidden": "true",
|
|
915
|
+
onPointerenter(event) {
|
|
916
|
+
if (event.pointerType === "touch") return;
|
|
917
|
+
startArrowScroll(direction);
|
|
918
|
+
},
|
|
919
|
+
onPointerleave: stopArrowScroll,
|
|
920
|
+
onMousedown(event) {
|
|
921
|
+
event.preventDefault();
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function getChipProps(option) {
|
|
926
|
+
return {
|
|
927
|
+
"data-part": "chip",
|
|
928
|
+
"data-value": String(option.value)
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
function getChipRemoveProps(option) {
|
|
932
|
+
return {
|
|
933
|
+
"data-part": "chip-remove",
|
|
934
|
+
type: "button",
|
|
935
|
+
tabindex: -1,
|
|
936
|
+
"aria-label": `Remove ${option.label}`,
|
|
937
|
+
onClick(event) {
|
|
938
|
+
event.stopPropagation();
|
|
939
|
+
deselect(option.value);
|
|
940
|
+
focusTarget()?.focus({ preventScroll: true });
|
|
941
|
+
},
|
|
942
|
+
onMousedown(event) {
|
|
943
|
+
event.preventDefault();
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
const listboxProps = computed(() => ({
|
|
948
|
+
...hooks.value,
|
|
949
|
+
"data-part": "listbox",
|
|
950
|
+
id: listboxId,
|
|
951
|
+
role: "listbox",
|
|
952
|
+
"aria-multiselectable": multiple() || void 0,
|
|
953
|
+
...searchable() ? {} : { "aria-labelledby": triggerId.value },
|
|
954
|
+
style: maxHeight() ? {
|
|
955
|
+
maxHeight: maxHeight(),
|
|
956
|
+
overflowY: "auto"
|
|
957
|
+
} : void 0,
|
|
958
|
+
onScroll: measureScrollEdges,
|
|
959
|
+
ref: (el) => {
|
|
960
|
+
listboxEl.value = el ?? null;
|
|
961
|
+
}
|
|
962
|
+
}));
|
|
963
|
+
function getOptionProps(option) {
|
|
964
|
+
return {
|
|
965
|
+
"data-part": "option",
|
|
966
|
+
id: option.id,
|
|
967
|
+
role: "option",
|
|
968
|
+
"data-index": option.index,
|
|
969
|
+
"aria-selected": option.selected,
|
|
970
|
+
"aria-disabled": option.disabled || void 0,
|
|
971
|
+
"data-selected": option.selected ? "" : void 0,
|
|
972
|
+
"data-disabled": option.disabled ? "" : void 0,
|
|
973
|
+
"data-active": activeId.value === option.id ? "" : void 0,
|
|
974
|
+
"data-create": option.create ? "" : void 0,
|
|
975
|
+
"aria-setsize": grouped.value ? void 0 : flatOptions.value.length,
|
|
976
|
+
"aria-posinset": grouped.value ? void 0 : option.index + 1,
|
|
977
|
+
onClick() {
|
|
978
|
+
commit(option);
|
|
979
|
+
},
|
|
980
|
+
onPointermove(event) {
|
|
981
|
+
if (event.movementX === 0 && event.movementY === 0) return;
|
|
982
|
+
if (option.disabled) return;
|
|
983
|
+
activateAt(option.index, false);
|
|
984
|
+
},
|
|
985
|
+
onMousedown(event) {
|
|
986
|
+
event.preventDefault();
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
function getGroupProps(section) {
|
|
991
|
+
return section.label ? {
|
|
992
|
+
"data-part": "group",
|
|
993
|
+
role: "group",
|
|
994
|
+
"aria-labelledby": section.labelId
|
|
995
|
+
} : {
|
|
996
|
+
"data-part": "group",
|
|
997
|
+
role: "none",
|
|
998
|
+
"data-create": section.create ? "" : void 0
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function getGroupLabelProps(section) {
|
|
1002
|
+
return {
|
|
1003
|
+
"data-part": "group-label",
|
|
1004
|
+
id: section.labelId,
|
|
1005
|
+
role: "presentation"
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
const hiddenInputs = computed(() => {
|
|
1009
|
+
const name = toValue(options.name) ?? field?.name();
|
|
1010
|
+
if (!name) return [];
|
|
1011
|
+
return selectedValues.value.map((entry) => ({
|
|
1012
|
+
name,
|
|
1013
|
+
value: entry
|
|
1014
|
+
}));
|
|
1015
|
+
});
|
|
1016
|
+
provideSurface({
|
|
1017
|
+
present: mounted,
|
|
1018
|
+
state,
|
|
1019
|
+
popupProps,
|
|
1020
|
+
positionerProps
|
|
1021
|
+
});
|
|
1022
|
+
return {
|
|
1023
|
+
value,
|
|
1024
|
+
open,
|
|
1025
|
+
query,
|
|
1026
|
+
state,
|
|
1027
|
+
present: mounted,
|
|
1028
|
+
sections,
|
|
1029
|
+
flatOptions,
|
|
1030
|
+
activeIndex,
|
|
1031
|
+
virtualRows,
|
|
1032
|
+
selectedOptions,
|
|
1033
|
+
visibleOptions,
|
|
1034
|
+
hiddenCount,
|
|
1035
|
+
summary,
|
|
1036
|
+
collapsed,
|
|
1037
|
+
showClear,
|
|
1038
|
+
canScroll: (direction) => direction === "up" ? canScrollUp.value : canScrollDown.value,
|
|
1039
|
+
rootProps,
|
|
1040
|
+
triggerProps,
|
|
1041
|
+
clearProps,
|
|
1042
|
+
positionerProps,
|
|
1043
|
+
popupProps,
|
|
1044
|
+
searchProps,
|
|
1045
|
+
inputProps,
|
|
1046
|
+
chipsProps,
|
|
1047
|
+
presetSections,
|
|
1048
|
+
presetsProps,
|
|
1049
|
+
getPresetItemProps,
|
|
1050
|
+
getPresetProps,
|
|
1051
|
+
getPresetReplaceProps,
|
|
1052
|
+
getPresetGroupProps,
|
|
1053
|
+
getPresetGroupLabelProps,
|
|
1054
|
+
getPresetGroupTriggerProps,
|
|
1055
|
+
getPresetGroupPanelProps,
|
|
1056
|
+
getScrollProps,
|
|
1057
|
+
valueProps,
|
|
1058
|
+
indicatorProps,
|
|
1059
|
+
emptyProps,
|
|
1060
|
+
stateAttrs: hooks,
|
|
1061
|
+
listboxProps,
|
|
1062
|
+
getOptionProps,
|
|
1063
|
+
getGroupProps,
|
|
1064
|
+
getGroupLabelProps,
|
|
1065
|
+
getChipProps,
|
|
1066
|
+
getChipRemoveProps,
|
|
1067
|
+
hiddenInputs,
|
|
1068
|
+
deselect,
|
|
1069
|
+
clear,
|
|
1070
|
+
toggle,
|
|
1071
|
+
close
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
var { provideContext: provideListboxContext, useContext: useListboxContext } = createContext("Listbox");
|
|
1075
|
+
//#endregion
|
|
1076
|
+
export { isListboxGroup, provideListboxContext, useListbox, useListboxContext };
|