@youcan/celeste 0.6.102 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/celeste.css +1460 -1458
- package/dist/cjs/chunks/BubbleSelect.cjs +332 -0
- package/dist/cjs/chunks/CollapsibleRoot.cjs +90 -0
- package/dist/cjs/chunks/Collection.cjs +79 -0
- package/dist/cjs/chunks/ComboboxContent.cjs +442 -0
- package/dist/cjs/chunks/ComboboxGroup.cjs +90 -0
- package/dist/cjs/chunks/ComboboxInput.cjs +266 -0
- package/dist/cjs/chunks/ComboboxItem.cjs +195 -0
- package/dist/cjs/chunks/ComboboxLabel.cjs +47 -0
- package/dist/cjs/chunks/ComboboxRoot.cjs +695 -0
- package/dist/cjs/chunks/ComboboxSeparator.cjs +35 -0
- package/dist/cjs/chunks/ConfigProvider.cjs +11 -0
- package/dist/cjs/chunks/DialogClose.cjs +41 -0
- package/dist/cjs/chunks/DialogDescription.cjs +38 -0
- package/dist/cjs/chunks/DialogPortal.cjs +521 -0
- package/dist/cjs/chunks/DialogRoot.cjs +81 -0
- package/dist/cjs/chunks/DialogTitle.cjs +38 -0
- package/dist/cjs/chunks/DialogTrigger.cjs +57 -0
- package/dist/cjs/chunks/DismissableLayer.cjs +292 -0
- package/dist/cjs/chunks/DropdownMenuPortal.cjs +73 -0
- package/dist/cjs/chunks/DropdownMenuRoot.cjs +87 -0
- package/dist/cjs/chunks/FocusScope.cjs +368 -0
- package/dist/cjs/chunks/Label.cjs +42 -0
- package/dist/cjs/chunks/MenuAnchor.cjs +37 -0
- package/dist/cjs/chunks/MenuContentImpl.cjs +371 -0
- package/dist/cjs/chunks/MenuGroup.cjs +44 -0
- package/dist/cjs/chunks/MenuItemImpl.cjs +100 -0
- package/dist/cjs/chunks/MenuRoot.cjs +108 -0
- package/dist/cjs/chunks/MenuSub.cjs +68 -0
- package/dist/cjs/chunks/PaginationRoot.cjs +101 -0
- package/dist/cjs/chunks/PinInputRoot.cjs +153 -0
- package/dist/cjs/chunks/PopoverRoot.cjs +73 -0
- package/dist/cjs/chunks/PopperAnchor.cjs +48 -0
- package/dist/cjs/chunks/PopperArrow.cjs +152 -0
- package/dist/cjs/chunks/PopperContent.cjs +2134 -0
- package/dist/cjs/chunks/PopperRoot.cjs +32 -0
- package/dist/cjs/chunks/Presence.cjs +194 -0
- package/dist/cjs/chunks/Primitive.cjs +80 -0
- package/dist/cjs/chunks/ProgressIndicator.cjs +161 -0
- package/dist/cjs/chunks/RadioGroupRoot.cjs +143 -0
- package/dist/cjs/chunks/RovingFocusGroup.cjs +146 -0
- package/dist/cjs/chunks/RovingFocusItem.cjs +114 -0
- package/dist/cjs/chunks/SelectGroup.cjs +44 -0
- package/dist/cjs/chunks/SelectItemAlignedPosition.cjs +593 -0
- package/dist/cjs/chunks/TabsRoot.cjs +114 -0
- package/dist/cjs/chunks/Teleport.cjs +51 -0
- package/dist/cjs/chunks/ToggleGroupRoot.cjs +188 -0
- package/dist/cjs/chunks/TooltipProvider.cjs +87 -0
- package/dist/cjs/chunks/TooltipRoot.cjs +145 -0
- package/dist/cjs/chunks/VisuallyHidden.cjs +65 -0
- package/dist/cjs/chunks/VisuallyHiddenInput.cjs +146 -0
- package/dist/cjs/chunks/alert.cjs +2 -2
- package/dist/cjs/chunks/alpha-slider.cjs +1 -1
- package/dist/cjs/chunks/badge.cjs +2 -2
- package/dist/cjs/chunks/button.cjs +4 -3
- package/dist/cjs/chunks/checkbox-card.cjs +10 -8
- package/dist/cjs/chunks/checkbox-label.cjs +11 -9
- package/dist/cjs/chunks/checkbox.cjs +234 -9
- package/dist/cjs/chunks/chunk.cjs +50 -0
- package/dist/cjs/chunks/clamp.cjs +75 -0
- package/dist/cjs/chunks/collapsible-content.cjs +105 -2
- package/dist/cjs/chunks/collapsible-trigger.cjs +51 -2
- package/dist/cjs/chunks/collapsible.cjs +6 -3
- package/dist/cjs/chunks/color-area.cjs +4 -4
- package/dist/cjs/chunks/color-picker.cjs +14 -13
- package/dist/cjs/chunks/color-swatch.cjs +3 -3
- package/dist/cjs/chunks/combobox-anchor.cjs +45 -3
- package/dist/cjs/chunks/combobox-empty.cjs +31 -3
- package/dist/cjs/chunks/combobox-group.cjs +6 -4
- package/dist/cjs/chunks/combobox-input.cjs +7 -5
- package/dist/cjs/chunks/combobox-item.cjs +8 -6
- package/dist/cjs/chunks/combobox-list.cjs +105 -7
- package/dist/cjs/chunks/combobox-root.cjs +22 -18
- package/dist/cjs/chunks/combobox-separator.cjs +4 -3
- package/dist/cjs/chunks/combobox-trigger.cjs +64 -4
- package/dist/cjs/chunks/combobox.cjs +38 -30
- package/dist/cjs/chunks/compact-button.cjs +4 -3
- package/dist/cjs/chunks/components.cjs +47 -47
- package/dist/cjs/chunks/content-divider.cjs +87 -2
- package/dist/cjs/chunks/core.cjs +3 -3
- package/dist/cjs/chunks/counter-input.cjs +884 -8
- package/dist/cjs/chunks/createContext.cjs +38 -0
- package/dist/cjs/chunks/digit-input-group.cjs +6 -4
- package/dist/cjs/chunks/digit-input-slot.cjs +243 -4
- package/dist/cjs/chunks/digit-input.cjs +8 -6
- package/dist/cjs/chunks/dist.cjs +524 -12084
- package/dist/cjs/chunks/dropdown-menu-content.cjs +542 -5
- package/dist/cjs/chunks/dropdown-menu-group.cjs +30 -3
- package/dist/cjs/chunks/dropdown-menu-item.cjs +125 -4
- package/dist/cjs/chunks/dropdown-menu-label.cjs +59 -4
- package/dist/cjs/chunks/dropdown-menu-separator.cjs +57 -3
- package/dist/cjs/chunks/dropdown-menu-sub-content.cjs +295 -5
- package/dist/cjs/chunks/dropdown-menu-sub-trigger.cjs +192 -4
- package/dist/cjs/chunks/dropdown-menu-sub.cjs +39 -2
- package/dist/cjs/chunks/dropdown-menu-trigger.cjs +91 -4
- package/dist/cjs/chunks/dropdown-menu.cjs +6 -4
- package/dist/cjs/chunks/extra-settings.cjs +5 -5
- package/dist/cjs/chunks/fancy-button.cjs +4 -3
- package/dist/cjs/chunks/file-upload-area.cjs +2 -2
- package/dist/cjs/chunks/getActiveElement.cjs +14 -0
- package/dist/cjs/chunks/handleAndDispatchCustomEvent.cjs +18 -0
- package/dist/cjs/chunks/hint-text.cjs +2 -2
- package/dist/cjs/chunks/hue-slider.cjs +1 -1
- package/dist/cjs/chunks/isValueEqualOrExist.cjs +24 -0
- package/dist/cjs/chunks/{label.cjs → label2.cjs} +6 -4
- package/dist/cjs/chunks/link-bubble.cjs +7 -7
- package/dist/cjs/chunks/link-button.cjs +4 -3
- package/dist/cjs/chunks/menus.cjs +53 -52
- package/dist/cjs/chunks/modal-body.cjs +1 -1
- package/dist/cjs/chunks/modal-close.cjs +3 -2
- package/dist/cjs/chunks/modal-content.cjs +8 -7
- package/dist/cjs/chunks/modal-footer.cjs +1 -1
- package/dist/cjs/chunks/modal-header.cjs +8 -5
- package/dist/cjs/chunks/modal-trigger.cjs +3 -2
- package/dist/cjs/chunks/modal.cjs +7 -4
- package/dist/cjs/chunks/nullish.cjs +11 -0
- package/dist/cjs/chunks/ohash.D__AXeF1.cjs +114 -0
- package/dist/cjs/chunks/pagination-content.cjs +86 -3
- package/dist/cjs/chunks/pagination-ellipsis.cjs +30 -3
- package/dist/cjs/chunks/pagination-first.cjs +39 -3
- package/dist/cjs/chunks/pagination-item.cjs +51 -2
- package/dist/cjs/chunks/pagination-last.cjs +39 -3
- package/dist/cjs/chunks/pagination-next.cjs +39 -3
- package/dist/cjs/chunks/pagination-previous.cjs +39 -3
- package/dist/cjs/chunks/pagination.cjs +6 -4
- package/dist/cjs/chunks/popover-content.cjs +704 -7
- package/dist/cjs/chunks/popover-trigger.cjs +62 -3
- package/dist/cjs/chunks/popover.cjs +5 -3
- package/dist/cjs/chunks/progress-bar.cjs +7 -5
- package/dist/cjs/chunks/progress-circle.cjs +7 -5
- package/dist/cjs/chunks/radio-group-card.cjs +10 -8
- package/dist/cjs/chunks/radio-group-item.cjs +304 -6
- package/dist/cjs/chunks/radio-group-label.cjs +11 -9
- package/dist/cjs/chunks/radio-group.cjs +7 -5
- package/dist/cjs/chunks/rich-editor.cjs +162 -162
- package/dist/cjs/chunks/scroll-area.cjs +142 -6
- package/dist/cjs/chunks/scroll-bar.cjs +895 -4
- package/dist/cjs/chunks/segmented-control-item.cjs +163 -3
- package/dist/cjs/chunks/segmented-control.cjs +8 -4
- package/dist/cjs/chunks/select-content.cjs +320 -6
- package/dist/cjs/chunks/select-group.cjs +3 -2
- package/dist/cjs/chunks/select-icon.cjs +1 -1
- package/dist/cjs/chunks/select-item.cjs +227 -5
- package/dist/cjs/chunks/select-label.cjs +35 -3
- package/dist/cjs/chunks/select-separator.cjs +28 -3
- package/dist/cjs/chunks/select-trigger.cjs +165 -4
- package/dist/cjs/chunks/select-value.cjs +65 -3
- package/dist/cjs/chunks/select.cjs +9 -4
- package/dist/cjs/chunks/sheet-close.cjs +4 -3
- package/dist/cjs/chunks/sheet-content.cjs +9 -7
- package/dist/cjs/chunks/sheet-description.cjs +4 -3
- package/dist/cjs/chunks/sheet-footer.cjs +2 -2
- package/dist/cjs/chunks/sheet-header.cjs +2 -2
- package/dist/cjs/chunks/sheet-title.cjs +4 -3
- package/dist/cjs/chunks/sheet-trigger.cjs +3 -2
- package/dist/cjs/chunks/sheet.cjs +7 -4
- package/dist/cjs/chunks/sidebar-content.cjs +1 -1
- package/dist/cjs/chunks/sidebar-element.cjs +3 -2
- package/dist/cjs/chunks/sidebar-footer.cjs +1 -1
- package/dist/cjs/chunks/sidebar-group-content.cjs +1 -1
- package/dist/cjs/chunks/sidebar-group-label.cjs +3 -2
- package/dist/cjs/chunks/sidebar-group.cjs +1 -1
- package/dist/cjs/chunks/sidebar-header.cjs +1 -1
- package/dist/cjs/chunks/sidebar-menu-action.cjs +3 -2
- package/dist/cjs/chunks/sidebar-menu-badge.cjs +1 -1
- package/dist/cjs/chunks/sidebar-menu-button.cjs +3 -2
- package/dist/cjs/chunks/sidebar-menu-item.cjs +1 -1
- package/dist/cjs/chunks/sidebar-menu-sub-button.cjs +3 -2
- package/dist/cjs/chunks/sidebar-menu-sub-item.cjs +1 -1
- package/dist/cjs/chunks/sidebar-menu-sub.cjs +1 -1
- package/dist/cjs/chunks/sidebar-menu.cjs +1 -1
- package/dist/cjs/chunks/sidebar-provider.cjs +1 -1
- package/dist/cjs/chunks/sidebar-trigger.cjs +1 -1
- package/dist/cjs/chunks/sidebar.cjs +1 -1
- package/dist/cjs/chunks/slider.cjs +751 -7
- package/dist/cjs/chunks/social-button.cjs +4 -3
- package/dist/cjs/chunks/sonner-alert.cjs +2 -2
- package/dist/cjs/chunks/sonner.cjs +1 -1
- package/dist/cjs/chunks/status-badge.cjs +2 -2
- package/dist/cjs/chunks/switch.cjs +192 -9
- package/dist/cjs/chunks/tab-menu-content.cjs +82 -3
- package/dist/cjs/chunks/tab-menu-item.cjs +89 -4
- package/dist/cjs/chunks/tab-menu-list.cjs +61 -3
- package/dist/cjs/chunks/tab-menu.cjs +7 -4
- package/dist/cjs/chunks/table-body.cjs +2 -2
- package/dist/cjs/chunks/table-caption.cjs +2 -2
- package/dist/cjs/chunks/table-cell.cjs +2 -2
- package/dist/cjs/chunks/table-footer.cjs +2 -2
- package/dist/cjs/chunks/table-head.cjs +2 -2
- package/dist/cjs/chunks/table-header.cjs +1 -1
- package/dist/cjs/chunks/table-row.cjs +2 -2
- package/dist/cjs/chunks/table.cjs +2 -2
- package/dist/cjs/chunks/table2.cjs +2 -2
- package/dist/cjs/chunks/tag.cjs +4 -3
- package/dist/cjs/chunks/text-input-affix.cjs +1 -1
- package/dist/cjs/chunks/text-input-button.cjs +12 -6
- package/dist/cjs/chunks/text-input.cjs +9 -8
- package/dist/cjs/chunks/textarea.cjs +2 -2
- package/dist/cjs/chunks/tooltip-content.cjs +589 -7
- package/dist/cjs/chunks/tooltip-provider.cjs +5 -3
- package/dist/cjs/chunks/tooltip-root.cjs +5 -3
- package/dist/cjs/chunks/tooltip-trigger.cjs +109 -3
- package/dist/cjs/chunks/tooltip.cjs +8 -5
- package/dist/cjs/chunks/use-color-model.cjs +1 -1
- package/dist/cjs/chunks/useArrowNavigation.cjs +65 -0
- package/dist/cjs/chunks/useComposing.cjs +27 -0
- package/dist/cjs/chunks/useDirection.cjs +20 -0
- package/dist/cjs/chunks/useEmitAsProps.cjs +34 -0
- package/dist/cjs/chunks/useFocusGuards.cjs +40 -0
- package/dist/cjs/chunks/useFormControl.cjs +14 -0
- package/dist/cjs/chunks/useForwardExpose.cjs +64 -0
- package/dist/cjs/chunks/useForwardProps.cjs +40 -0
- package/dist/cjs/chunks/useForwardPropsEmits.cjs +20 -0
- package/dist/cjs/chunks/useForwardScopeId.cjs +31 -0
- package/dist/cjs/chunks/useHideOthers.cjs +138 -0
- package/dist/cjs/chunks/useId.cjs +30 -0
- package/dist/cjs/chunks/useKbd.cjs +46 -0
- package/dist/cjs/chunks/useNonce.cjs +15 -0
- package/dist/cjs/chunks/usePrimitiveElement.cjs +18 -0
- package/dist/cjs/chunks/useSize.cjs +55 -0
- package/dist/cjs/chunks/useTypeahead.cjs +69 -0
- package/dist/cjs/chunks/utils.cjs +117 -0
- package/dist/cjs/chunks/utils2.cjs +73 -0
- package/dist/cjs/chunks/utils3.cjs +20 -0
- package/dist/cjs/command-group.cjs +6 -4
- package/dist/cjs/command-input.cjs +9 -6
- package/dist/cjs/command-item.cjs +6 -3
- package/dist/cjs/command-list.cjs +14 -7
- package/dist/cjs/command-root.cjs +20 -16
- package/dist/cjs/command-separator.cjs +4 -3
- package/dist/cjs/config.cjs +2 -2
- package/dist/cjs/index.cjs +47 -47
- package/dist/cjs/label.cjs +1 -1
- package/dist/cjs/use-delegated-props.cjs +1 -1
- package/dist/cjs/use-sidebar.cjs +2 -2
- package/dist/cjs/use-user-select.cjs +1 -1
- package/dist/components/alert/alert.d.ts +17 -14
- package/dist/components/badge/badge.d.ts +2 -2
- package/dist/components/badge/status-badge.d.ts +2 -2
- package/dist/components/button/button.d.ts +11 -8
- package/dist/components/button/compact-button.d.ts +4 -4
- package/dist/components/button/fancy-button.d.ts +11 -8
- package/dist/components/button/link-button.d.ts +11 -8
- package/dist/components/button/social-button.d.ts +2 -2
- package/dist/components/checkbox/checkbox-card.d.ts +1 -1
- package/dist/components/checkbox/checkbox-label.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +3 -3
- package/dist/components/collapsible/collapsible-content.d.ts +7 -4
- package/dist/components/collapsible/collapsible-trigger.d.ts +7 -4
- package/dist/components/collapsible/collapsible.d.ts +12 -9
- package/dist/components/color-picker/alpha-slider.d.ts +2 -2
- package/dist/components/color-picker/color-area.d.ts +1 -1
- package/dist/components/color-picker/color-picker.d.ts +11 -8
- package/dist/components/color-picker/color-swatch.d.ts +2 -2
- package/dist/components/color-picker/composable/use-color-model.d.ts +1 -1
- package/dist/components/combobox/combobox-anchor.d.ts +1 -1
- package/dist/components/combobox/combobox-empty.d.ts +1 -1
- package/dist/components/combobox/combobox-group.d.ts +1 -1
- package/dist/components/combobox/combobox-input.d.ts +1 -1
- package/dist/components/combobox/combobox-item.d.ts +13 -10
- package/dist/components/combobox/combobox-list.d.ts +8 -8
- package/dist/components/combobox/combobox-root.d.ts +11 -7
- package/dist/components/combobox/combobox-separator.d.ts +1 -1
- package/dist/components/combobox/combobox-trigger.d.ts +9 -6
- package/dist/components/combobox/combobox.d.ts +26 -19
- package/dist/components/content-divider/content-divider.d.ts +3 -3
- package/dist/components/counter-input/counter-input.d.ts +2 -2
- package/dist/components/digit-input/digit-input-group.d.ts +1 -1
- package/dist/components/digit-input/digit-input-slot.d.ts +1 -1
- package/dist/components/digit-input/digit-input.d.ts +25 -24
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +7 -7
- package/dist/components/dropdown-menu/dropdown-menu-group.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +7 -7
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/file-upload/file-upload-area.d.ts +8 -7
- package/dist/components/hint-text/hint-text.d.ts +2 -2
- package/dist/components/label/label.d.ts +1 -1
- package/dist/components/modal/modal-close.d.ts +1 -1
- package/dist/components/modal/modal-content.d.ts +7 -7
- package/dist/components/modal/modal-trigger.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/pagination/pagination-content.d.ts +14 -11
- package/dist/components/pagination/pagination-ellipsis.d.ts +7 -4
- package/dist/components/pagination/pagination-first.d.ts +7 -4
- package/dist/components/pagination/pagination-item.d.ts +7 -4
- package/dist/components/pagination/pagination-last.d.ts +7 -4
- package/dist/components/pagination/pagination-next.d.ts +7 -4
- package/dist/components/pagination/pagination-previous.d.ts +7 -4
- package/dist/components/pagination/pagination.d.ts +24 -21
- package/dist/components/popover/popover-content.d.ts +22 -19
- package/dist/components/popover/popover-trigger.d.ts +1 -1
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/progress/progress-bar.d.ts +1 -1
- package/dist/components/progress/progress-circle.d.ts +1 -1
- package/dist/components/radio-group/radio-group-card.d.ts +1 -1
- package/dist/components/radio-group/radio-group-item.d.ts +1 -1
- package/dist/components/radio-group/radio-group-label.d.ts +1 -1
- package/dist/components/radio-group/radio-group.d.ts +3 -3
- package/dist/components/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/scroll-bar.d.ts +1 -1
- package/dist/components/segmented-control/segmented-control-item.d.ts +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts +3 -3
- package/dist/components/select/select-content.d.ts +3 -3
- package/dist/components/select/select-group.d.ts +1 -1
- package/dist/components/select/select-item.d.ts +1 -1
- package/dist/components/select/select-label.d.ts +1 -1
- package/dist/components/select/select-separator.d.ts +1 -1
- package/dist/components/select/select-trigger.d.ts +1 -1
- package/dist/components/select/select-value.d.ts +1 -1
- package/dist/components/select/select.d.ts +3 -3
- package/dist/components/sheet/sheet-close.d.ts +7 -4
- package/dist/components/sheet/sheet-content.d.ts +16 -13
- package/dist/components/sheet/sheet-description.d.ts +7 -4
- package/dist/components/sheet/sheet-footer.d.ts +6 -3
- package/dist/components/sheet/sheet-header.d.ts +6 -3
- package/dist/components/sheet/sheet-title.d.ts +7 -4
- package/dist/components/sheet/sheet-trigger.d.ts +7 -4
- package/dist/components/sheet/sheet.d.ts +1 -1
- package/dist/components/sidebar/sidebar-element.d.ts +9 -6
- package/dist/components/sidebar/sidebar-footer.d.ts +6 -3
- package/dist/components/sidebar/sidebar-group-label.d.ts +1 -1
- package/dist/components/sidebar/sidebar-header.d.ts +6 -3
- package/dist/components/sidebar/sidebar-menu-action.d.ts +9 -6
- package/dist/components/sidebar/sidebar-menu-badge.d.ts +2 -2
- package/dist/components/sidebar/sidebar-menu-button.d.ts +2 -2
- package/dist/components/sidebar/sidebar-menu-sub-button.d.ts +11 -8
- package/dist/components/sidebar/sidebar-separator.d.ts +1 -1
- package/dist/components/sidebar/sidebar.d.ts +11 -8
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/sonner/sonner.d.ts +1 -1
- package/dist/components/switch/switch.d.ts +3 -3
- package/dist/components/tab-menu/tab-menu-content.d.ts +1 -1
- package/dist/components/tab-menu/tab-menu-item.d.ts +1 -1
- package/dist/components/tab-menu/tab-menu-list.d.ts +1 -1
- package/dist/components/tab-menu/tab-menu.d.ts +3 -3
- package/dist/components/table/table-body.d.ts +6 -3
- package/dist/components/table/table-caption.d.ts +6 -3
- package/dist/components/table/table-cell.d.ts +8 -5
- package/dist/components/table/table-empty.d.ts +8 -5
- package/dist/components/table/table-footer.d.ts +6 -3
- package/dist/components/table/table-head.d.ts +8 -5
- package/dist/components/table/table-header.d.ts +6 -3
- package/dist/components/table/table-row.d.ts +8 -5
- package/dist/components/table/table.d.ts +6 -3
- package/dist/components/tag/tag.d.ts +11 -8
- package/dist/components/text-input/text-input-button.d.ts +1 -1
- package/dist/components/text-input/text-input.d.ts +24 -20
- package/dist/components/textarea/textarea.d.ts +9 -8
- package/dist/components/tooltip/tooltip-content.d.ts +10 -7
- package/dist/components/tooltip/tooltip-provider.d.ts +9 -6
- package/dist/components/tooltip/tooltip-root.d.ts +10 -7
- package/dist/components/tooltip/tooltip-trigger.d.ts +7 -4
- package/dist/components/tooltip/tooltip.d.ts +10 -7
- package/dist/es/chunks/BubbleSelect.js +290 -0
- package/dist/es/chunks/CollapsibleRoot.js +78 -0
- package/dist/es/chunks/Collection.js +73 -0
- package/dist/es/chunks/ComboboxContent.js +436 -0
- package/dist/es/chunks/ComboboxGroup.js +78 -0
- package/dist/es/chunks/ComboboxInput.js +260 -0
- package/dist/es/chunks/ComboboxItem.js +189 -0
- package/dist/es/chunks/ComboboxLabel.js +41 -0
- package/dist/es/chunks/ComboboxRoot.js +671 -0
- package/dist/es/chunks/ComboboxSeparator.js +29 -0
- package/dist/es/chunks/ConfigProvider.js +6 -0
- package/dist/es/chunks/DialogClose.js +35 -0
- package/dist/es/chunks/DialogDescription.js +32 -0
- package/dist/es/chunks/DialogPortal.js +503 -0
- package/dist/es/chunks/DialogRoot.js +69 -0
- package/dist/es/chunks/DialogTitle.js +32 -0
- package/dist/es/chunks/DialogTrigger.js +51 -0
- package/dist/es/chunks/DismissableLayer.js +280 -0
- package/dist/es/chunks/DropdownMenuPortal.js +67 -0
- package/dist/es/chunks/DropdownMenuRoot.js +75 -0
- package/dist/es/chunks/FocusScope.js +356 -0
- package/dist/es/chunks/Label.js +36 -0
- package/dist/es/chunks/MenuAnchor.js +31 -0
- package/dist/es/chunks/MenuContentImpl.js +359 -0
- package/dist/es/chunks/MenuGroup.js +32 -0
- package/dist/es/chunks/MenuItemImpl.js +94 -0
- package/dist/es/chunks/MenuRoot.js +84 -0
- package/dist/es/chunks/MenuSub.js +56 -0
- package/dist/es/chunks/PaginationRoot.js +89 -0
- package/dist/es/chunks/PinInputRoot.js +141 -0
- package/dist/es/chunks/PopoverRoot.js +61 -0
- package/dist/es/chunks/PopperAnchor.js +42 -0
- package/dist/es/chunks/PopperArrow.js +146 -0
- package/dist/es/chunks/PopperContent.js +2089 -0
- package/dist/es/chunks/PopperRoot.js +20 -0
- package/dist/es/chunks/Presence.js +182 -0
- package/dist/es/chunks/Primitive.js +62 -0
- package/dist/es/chunks/ProgressIndicator.js +149 -0
- package/dist/es/chunks/RadioGroupRoot.js +131 -0
- package/dist/es/chunks/RovingFocusGroup.js +134 -0
- package/dist/es/chunks/RovingFocusItem.js +108 -0
- package/dist/es/chunks/SelectGroup.js +32 -0
- package/dist/es/chunks/SelectItemAlignedPosition.js +563 -0
- package/dist/es/chunks/TabsRoot.js +102 -0
- package/dist/es/chunks/Teleport.js +45 -0
- package/dist/es/chunks/ToggleGroupRoot.js +176 -0
- package/dist/es/chunks/TooltipProvider.js +75 -0
- package/dist/es/chunks/TooltipRoot.js +127 -0
- package/dist/es/chunks/VisuallyHidden.js +59 -0
- package/dist/es/chunks/VisuallyHiddenInput.js +140 -0
- package/dist/es/chunks/alert.js +1 -1
- package/dist/es/chunks/badge.js +1 -1
- package/dist/es/chunks/button.js +3 -3
- package/dist/es/chunks/checkbox-card.js +9 -8
- package/dist/es/chunks/checkbox-label.js +10 -9
- package/dist/es/chunks/checkbox.js +234 -10
- package/dist/es/chunks/clamp.js +64 -0
- package/dist/es/chunks/collapsible-content.js +105 -3
- package/dist/es/chunks/collapsible-trigger.js +50 -2
- package/dist/es/chunks/collapsible.js +5 -3
- package/dist/es/chunks/color-area.js +3 -3
- package/dist/es/chunks/color-picker.js +13 -13
- package/dist/es/chunks/color-swatch.js +2 -2
- package/dist/es/chunks/combobox-anchor.js +45 -4
- package/dist/es/chunks/combobox-empty.js +30 -4
- package/dist/es/chunks/combobox-group.js +5 -4
- package/dist/es/chunks/combobox-input.js +6 -5
- package/dist/es/chunks/combobox-item.js +7 -6
- package/dist/es/chunks/combobox-list.js +104 -8
- package/dist/es/chunks/combobox-root.js +21 -18
- package/dist/es/chunks/combobox-separator.js +3 -3
- package/dist/es/chunks/combobox-trigger.js +63 -5
- package/dist/es/chunks/combobox.js +38 -31
- package/dist/es/chunks/compact-button.js +3 -3
- package/dist/es/chunks/components.js +46 -46
- package/dist/es/chunks/content-divider.js +87 -3
- package/dist/es/chunks/core.js +2 -2
- package/dist/es/chunks/counter-input.js +884 -9
- package/dist/es/chunks/createContext.js +32 -0
- package/dist/es/chunks/digit-input-group.js +5 -4
- package/dist/es/chunks/digit-input-slot.js +242 -5
- package/dist/es/chunks/digit-input.js +7 -6
- package/dist/es/chunks/dist.js +486 -11478
- package/dist/es/chunks/dropdown-menu-content.js +541 -6
- package/dist/es/chunks/dropdown-menu-group.js +29 -4
- package/dist/es/chunks/dropdown-menu-item.js +125 -5
- package/dist/es/chunks/dropdown-menu-label.js +58 -5
- package/dist/es/chunks/dropdown-menu-separator.js +56 -4
- package/dist/es/chunks/dropdown-menu-sub-content.js +294 -6
- package/dist/es/chunks/dropdown-menu-sub-trigger.js +192 -5
- package/dist/es/chunks/dropdown-menu-sub.js +40 -4
- package/dist/es/chunks/dropdown-menu-trigger.js +90 -5
- package/dist/es/chunks/dropdown-menu.js +5 -4
- package/dist/es/chunks/extra-settings.js +4 -4
- package/dist/es/chunks/fancy-button.js +3 -3
- package/dist/es/chunks/file-upload-area.js +1 -1
- package/dist/es/chunks/getActiveElement.js +9 -0
- package/dist/es/chunks/handleAndDispatchCustomEvent.js +13 -0
- package/dist/es/chunks/hint-text.js +1 -1
- package/dist/es/chunks/isValueEqualOrExist.js +19 -0
- package/dist/es/chunks/{label.js → label2.js} +5 -4
- package/dist/es/chunks/link-bubble.js +6 -6
- package/dist/es/chunks/link-button.js +3 -3
- package/dist/es/chunks/menus.js +2 -2
- package/dist/es/chunks/modal-close.js +2 -2
- package/dist/es/chunks/modal-content.js +7 -7
- package/dist/es/chunks/modal-header.js +7 -5
- package/dist/es/chunks/modal-trigger.js +2 -2
- package/dist/es/chunks/modal.js +6 -4
- package/dist/es/chunks/nullish.js +6 -0
- package/dist/es/chunks/ohash.D__AXeF1.js +109 -0
- package/dist/es/chunks/pagination-content.js +85 -4
- package/dist/es/chunks/pagination-ellipsis.js +29 -4
- package/dist/es/chunks/pagination-first.js +39 -4
- package/dist/es/chunks/pagination-item.js +51 -3
- package/dist/es/chunks/pagination-last.js +39 -4
- package/dist/es/chunks/pagination-next.js +39 -4
- package/dist/es/chunks/pagination-previous.js +39 -4
- package/dist/es/chunks/pagination.js +5 -4
- package/dist/es/chunks/popover-content.js +704 -8
- package/dist/es/chunks/popover-trigger.js +61 -4
- package/dist/es/chunks/popover.js +4 -3
- package/dist/es/chunks/progress-bar.js +6 -5
- package/dist/es/chunks/progress-circle.js +6 -5
- package/dist/es/chunks/radio-group-card.js +9 -8
- package/dist/es/chunks/radio-group-item.js +304 -7
- package/dist/es/chunks/radio-group-label.js +10 -9
- package/dist/es/chunks/radio-group.js +6 -5
- package/dist/es/chunks/rich-editor.js +5 -5
- package/dist/es/chunks/scroll-area.js +141 -7
- package/dist/es/chunks/scroll-bar.js +883 -6
- package/dist/es/chunks/segmented-control-item.js +162 -4
- package/dist/es/chunks/segmented-control.js +7 -4
- package/dist/es/chunks/select-content.js +319 -7
- package/dist/es/chunks/select-group.js +2 -2
- package/dist/es/chunks/select-item.js +226 -6
- package/dist/es/chunks/select-label.js +33 -3
- package/dist/es/chunks/select-separator.js +27 -4
- package/dist/es/chunks/select-trigger.js +164 -5
- package/dist/es/chunks/select-value.js +64 -4
- package/dist/es/chunks/select.js +8 -4
- package/dist/es/chunks/sheet-close.js +3 -3
- package/dist/es/chunks/sheet-content.js +8 -7
- package/dist/es/chunks/sheet-description.js +3 -3
- package/dist/es/chunks/sheet-footer.js +1 -1
- package/dist/es/chunks/sheet-header.js +1 -1
- package/dist/es/chunks/sheet-title.js +3 -3
- package/dist/es/chunks/sheet-trigger.js +2 -2
- package/dist/es/chunks/sheet.js +6 -4
- package/dist/es/chunks/sidebar-element.js +2 -2
- package/dist/es/chunks/sidebar-group-label.js +2 -2
- package/dist/es/chunks/sidebar-menu-action.js +2 -2
- package/dist/es/chunks/sidebar-menu-button.js +2 -2
- package/dist/es/chunks/sidebar-menu-sub-button.js +2 -2
- package/dist/es/chunks/slider.js +751 -8
- package/dist/es/chunks/social-button.js +3 -3
- package/dist/es/chunks/sonner-alert.js +1 -1
- package/dist/es/chunks/status-badge.js +1 -1
- package/dist/es/chunks/switch.js +192 -10
- package/dist/es/chunks/tab-menu-content.js +81 -4
- package/dist/es/chunks/tab-menu-item.js +89 -5
- package/dist/es/chunks/tab-menu-list.js +60 -4
- package/dist/es/chunks/tab-menu.js +6 -4
- package/dist/es/chunks/table-body.js +1 -1
- package/dist/es/chunks/table-caption.js +1 -1
- package/dist/es/chunks/table-cell.js +1 -1
- package/dist/es/chunks/table-footer.js +1 -1
- package/dist/es/chunks/table-head.js +1 -1
- package/dist/es/chunks/table-row.js +1 -1
- package/dist/es/chunks/table.js +1 -1
- package/dist/es/chunks/table2.js +1 -1
- package/dist/es/chunks/tag.js +3 -3
- package/dist/es/chunks/text-input-button.js +11 -5
- package/dist/es/chunks/text-input.js +8 -8
- package/dist/es/chunks/textarea.js +1 -1
- package/dist/es/chunks/tooltip-content.js +589 -8
- package/dist/es/chunks/tooltip-provider.js +4 -3
- package/dist/es/chunks/tooltip-root.js +4 -3
- package/dist/es/chunks/tooltip-trigger.js +109 -4
- package/dist/es/chunks/tooltip.js +7 -5
- package/dist/es/chunks/useArrowNavigation.js +60 -0
- package/dist/es/chunks/useComposing.js +21 -0
- package/dist/es/chunks/useDirection.js +14 -0
- package/dist/es/chunks/useEmitAsProps.js +28 -0
- package/dist/es/chunks/useFocusGuards.js +34 -0
- package/dist/es/chunks/useFormControl.js +8 -0
- package/dist/es/chunks/useForwardExpose.js +58 -0
- package/dist/es/chunks/useForwardProps.js +34 -0
- package/dist/es/chunks/useForwardPropsEmits.js +14 -0
- package/dist/es/chunks/useForwardScopeId.js +25 -0
- package/dist/es/chunks/useHideOthers.js +132 -0
- package/dist/es/chunks/useId.js +23 -0
- package/dist/es/chunks/useKbd.js +41 -0
- package/dist/es/chunks/useNonce.js +9 -0
- package/dist/es/chunks/usePrimitiveElement.js +12 -0
- package/dist/es/chunks/useSize.js +49 -0
- package/dist/es/chunks/useTypeahead.js +64 -0
- package/dist/es/chunks/utils.js +58 -0
- package/dist/es/chunks/utils2.js +44 -0
- package/dist/es/chunks/utils3.js +9 -0
- package/dist/es/command-group.js +5 -4
- package/dist/es/command-input.js +8 -6
- package/dist/es/command-item.js +5 -3
- package/dist/es/command-list.js +13 -7
- package/dist/es/command-root.js +19 -16
- package/dist/es/command-separator.js +3 -3
- package/dist/es/config.js +1 -1
- package/dist/es/index.js +46 -46
- package/dist/es/label.js +1 -1
- package/dist/es/use-sidebar.js +2 -2
- package/dist/utils/sonner.d.ts +1 -1
- package/package.json +11 -11
- package/src/components/alert/alert.vue +8 -10
- package/src/components/badge/badge.vue +7 -9
- package/src/components/badge/status-badge.vue +10 -11
- package/src/components/button/button.vue +9 -10
- package/src/components/button/compact-button.vue +8 -9
- package/src/components/button/fancy-button.vue +10 -11
- package/src/components/button/link-button.vue +8 -9
- package/src/components/button/social-button.vue +5 -7
- package/src/components/checkbox/checkbox-card.vue +2 -2
- package/src/components/checkbox/checkbox-label.vue +2 -1
- package/src/components/checkbox/checkbox.vue +2 -2
- package/src/components/checkbox/stories/checkbox.stories.ts +4 -5
- package/src/components/collapsible/collapsible-content.vue +4 -6
- package/src/components/collapsible/collapsible-trigger.vue +4 -6
- package/src/components/collapsible/collapsible.vue +4 -6
- package/src/components/color-picker/alpha-slider.vue +8 -10
- package/src/components/color-picker/color-area.vue +8 -10
- package/src/components/color-picker/color-picker.vue +43 -43
- package/src/components/color-picker/color-swatch.vue +11 -13
- package/src/components/color-picker/composable/use-color-model.ts +2 -1
- package/src/components/color-picker/composable/use-user-select.ts +2 -1
- package/src/components/combobox/combobox-anchor.vue +4 -3
- package/src/components/combobox/combobox-empty.vue +4 -3
- package/src/components/combobox/combobox-group.vue +5 -4
- package/src/components/combobox/combobox-input.vue +6 -3
- package/src/components/combobox/combobox-item.vue +19 -20
- package/src/components/combobox/combobox-list.vue +7 -6
- package/src/components/combobox/combobox-root.vue +2 -1
- package/src/components/combobox/combobox-separator.vue +4 -3
- package/src/components/combobox/combobox-trigger.vue +25 -23
- package/src/components/combobox/combobox.vue +38 -32
- package/src/components/command/command-group.vue +4 -3
- package/src/components/command/command-input.vue +4 -2
- package/src/components/command/command-item.vue +4 -3
- package/src/components/command/command-list.vue +5 -6
- package/src/components/command/command-root.vue +4 -3
- package/src/components/command/command-separator.vue +4 -3
- package/src/components/content-divider/content-divider.vue +7 -9
- package/src/components/counter-input/counter-input.vue +2 -1
- package/src/components/digit-input/digit-input-group.vue +2 -1
- package/src/components/digit-input/digit-input-slot.vue +2 -1
- package/src/components/digit-input/digit-input.vue +8 -5
- package/src/components/digit-input/stories/digit-input.stories.ts +13 -3
- package/src/components/dropdown-menu/dropdown-menu-content.vue +4 -4
- package/src/components/dropdown-menu/dropdown-menu-group.vue +2 -1
- package/src/components/dropdown-menu/dropdown-menu-item.vue +2 -1
- package/src/components/dropdown-menu/dropdown-menu-label.vue +2 -1
- package/src/components/dropdown-menu/dropdown-menu-separator.vue +3 -2
- package/src/components/dropdown-menu/dropdown-menu-sub-content.vue +4 -4
- package/src/components/dropdown-menu/dropdown-menu-sub-trigger.vue +3 -2
- package/src/components/dropdown-menu/dropdown-menu-sub.vue +3 -3
- package/src/components/dropdown-menu/dropdown-menu-trigger.vue +2 -1
- package/src/components/dropdown-menu/dropdown-menu.vue +2 -2
- package/src/components/file-upload/file-upload-area.vue +26 -27
- package/src/components/file-upload/stories/file-upload-area.stories.ts +2 -1
- package/src/components/hint-text/hint-text.vue +4 -6
- package/src/components/label/label.vue +2 -1
- package/src/components/modal/modal-close.vue +2 -1
- package/src/components/modal/modal-content.vue +2 -2
- package/src/components/modal/modal-header.vue +1 -1
- package/src/components/modal/modal-trigger.vue +2 -2
- package/src/components/modal/modal.vue +2 -2
- package/src/components/pagination/pagination-content.vue +6 -7
- package/src/components/pagination/pagination-ellipsis.vue +6 -7
- package/src/components/pagination/pagination-first.vue +6 -7
- package/src/components/pagination/pagination-item.vue +6 -7
- package/src/components/pagination/pagination-last.vue +6 -7
- package/src/components/pagination/pagination-next.vue +6 -7
- package/src/components/pagination/pagination-previous.vue +7 -8
- package/src/components/pagination/pagination.vue +7 -8
- package/src/components/popover/popover-content.vue +19 -20
- package/src/components/popover/popover-trigger.vue +2 -1
- package/src/components/popover/popover.vue +2 -2
- package/src/components/popover/stories/popover.stories.ts +1 -1
- package/src/components/progress/progress-bar.vue +5 -3
- package/src/components/progress/progress-circle.vue +3 -2
- package/src/components/radio-group/radio-group-card.vue +2 -2
- package/src/components/radio-group/radio-group-item.vue +2 -1
- package/src/components/radio-group/radio-group-label.vue +2 -1
- package/src/components/radio-group/radio-group.vue +2 -1
- package/src/components/rich-editor/config.ts +1 -1
- package/src/components/rich-editor/extra-settings.vue +1 -1
- package/src/components/rich-editor/link-bubble.vue +1 -1
- package/src/components/rich-editor/rich-editor.vue +3 -2
- package/src/components/scroll-area/scroll-area.vue +3 -2
- package/src/components/scroll-area/scroll-bar.vue +2 -1
- package/src/components/segmented-control/segmented-control-item.vue +2 -1
- package/src/components/segmented-control/segmented-control.vue +2 -1
- package/src/components/select/select-content.vue +4 -3
- package/src/components/select/select-group.vue +2 -1
- package/src/components/select/select-item.vue +2 -1
- package/src/components/select/select-label.vue +2 -1
- package/src/components/select/select-separator.vue +2 -1
- package/src/components/select/select-trigger.vue +2 -1
- package/src/components/select/select-value.vue +2 -1
- package/src/components/select/select.vue +2 -1
- package/src/components/sheet/sheet-close.vue +4 -6
- package/src/components/sheet/sheet-content.vue +7 -9
- package/src/components/sheet/sheet-description.vue +6 -8
- package/src/components/sheet/sheet-footer.vue +2 -4
- package/src/components/sheet/sheet-header.vue +2 -4
- package/src/components/sheet/sheet-title.vue +6 -8
- package/src/components/sheet/sheet-trigger.vue +4 -6
- package/src/components/sheet/sheet.vue +2 -2
- package/src/components/sidebar/sidebar-element.vue +6 -8
- package/src/components/sidebar/sidebar-footer.vue +2 -4
- package/src/components/sidebar/sidebar-group-label.vue +2 -2
- package/src/components/sidebar/sidebar-header.vue +2 -4
- package/src/components/sidebar/sidebar-menu-action.vue +6 -8
- package/src/components/sidebar/sidebar-menu-badge.vue +6 -8
- package/src/components/sidebar/sidebar-menu-button.vue +2 -2
- package/src/components/sidebar/sidebar-menu-sub-button.vue +8 -10
- package/src/components/sidebar/sidebar-separator.vue +2 -4
- package/src/components/sidebar/sidebar.vue +6 -8
- package/src/components/slider/slider.vue +2 -1
- package/src/components/sonner/sonner-alert.vue +2 -1
- package/src/components/sonner/sonner.vue +4 -5
- package/src/components/switch/stories/switch.stories.ts +3 -3
- package/src/components/switch/switch.vue +2 -1
- package/src/components/tab-menu/tab-menu-content.vue +2 -1
- package/src/components/tab-menu/tab-menu-item.vue +2 -1
- package/src/components/tab-menu/tab-menu-list.vue +2 -1
- package/src/components/tab-menu/tab-menu.vue +2 -2
- package/src/components/table/table-body.vue +2 -4
- package/src/components/table/table-caption.vue +2 -4
- package/src/components/table/table-cell.vue +5 -7
- package/src/components/table/table-empty.vue +5 -7
- package/src/components/table/table-footer.vue +2 -4
- package/src/components/table/table-head.vue +5 -7
- package/src/components/table/table-header.vue +2 -4
- package/src/components/table/table-row.vue +5 -7
- package/src/components/table/table.vue +2 -4
- package/src/components/tag/tag.vue +10 -11
- package/src/components/text-input/text-input-button.vue +3 -2
- package/src/components/text-input/text-input.vue +9 -10
- package/src/components/textarea/textarea.vue +8 -10
- package/src/components/tooltip/tooltip-content.vue +14 -15
- package/src/components/tooltip/tooltip-provider.vue +4 -5
- package/src/components/tooltip/tooltip-root.vue +4 -5
- package/src/components/tooltip/tooltip-trigger.vue +4 -5
- package/src/components/tooltip/tooltip.vue +12 -14
- package/src/composables/use-delegated-props.ts +2 -1
- package/src/composables/use-sidebar.ts +1 -1
- package/src/utils/sonner.ts +2 -1
|
@@ -1,8 +1,878 @@
|
|
|
1
|
-
import { Gt as wy, I as Se, _t as gy, c as Cy, dt as by } from "./dist.js";
|
|
2
1
|
import { t as clsx } from "./clsx.js";
|
|
2
|
+
import { n as snapValueToStep, t as clamp } from "./clamp.js";
|
|
3
|
+
import { t as createContext } from "./createContext.js";
|
|
4
|
+
import { t as getActiveElement } from "./getActiveElement.js";
|
|
5
|
+
import { t as isNullish } from "./nullish.js";
|
|
6
|
+
import { c as createEventHook, d as isClient, i as useEventListener, p as reactiveComputed, r as unrefElement, s as useVModel } from "./dist.js";
|
|
7
|
+
import { t as Primitive } from "./Primitive.js";
|
|
8
|
+
import { t as injectConfigProviderContext } from "./ConfigProvider.js";
|
|
9
|
+
import { t as useComposing } from "./useComposing.js";
|
|
10
|
+
import { t as useFormControl } from "./useFormControl.js";
|
|
11
|
+
import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
|
|
12
|
+
import { t as useKbd } from "./useKbd.js";
|
|
13
|
+
import { t as usePrimitiveElement } from "./usePrimitiveElement.js";
|
|
14
|
+
import { t as VisuallyHiddenInput_default } from "./VisuallyHiddenInput.js";
|
|
3
15
|
import { t as compact_button_default } from "./compact-button.js";
|
|
4
16
|
import { useDelegatedProps } from "../use-delegated-props.js";
|
|
5
|
-
import { createBlock, createVNode, defineComponent, mergeProps, openBlock, unref, withCtx } from "vue";
|
|
17
|
+
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, onMounted, openBlock, ref, renderSlot, toRefs, unref, watch, withCtx, withModifiers } from "vue";
|
|
18
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useLocale.js
|
|
19
|
+
/**
|
|
20
|
+
* The `useLocale` function provides a way to access the current locale in your application.
|
|
21
|
+
* @param {Ref<string | undefined>} [locale] - An optional ref containing the locale.
|
|
22
|
+
* @returns A computed ref holding the resolved locale.
|
|
23
|
+
*/
|
|
24
|
+
function useLocale(locale) {
|
|
25
|
+
const context = injectConfigProviderContext({ locale: ref("en") });
|
|
26
|
+
return computed(() => locale?.value || context.locale?.value || "en");
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../../node_modules/.pnpm/@internationalized+number@3.6.0/node_modules/@internationalized/number/dist/NumberFormatter.mjs
|
|
30
|
+
var $488c6ddbf4ef74c2$var$formatterCache = /* @__PURE__ */ new Map();
|
|
31
|
+
var $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
|
|
32
|
+
try {
|
|
33
|
+
$488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", { signDisplay: "exceptZero" }).resolvedOptions().signDisplay === "exceptZero";
|
|
34
|
+
} catch {}
|
|
35
|
+
var $488c6ddbf4ef74c2$var$supportsUnit = false;
|
|
36
|
+
try {
|
|
37
|
+
$488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
|
|
38
|
+
style: "unit",
|
|
39
|
+
unit: "degree"
|
|
40
|
+
}).resolvedOptions().style === "unit";
|
|
41
|
+
} catch {}
|
|
42
|
+
var $488c6ddbf4ef74c2$var$UNITS = { degree: { narrow: {
|
|
43
|
+
default: "°",
|
|
44
|
+
"ja-JP": " 度",
|
|
45
|
+
"zh-TW": "度",
|
|
46
|
+
"sl-SI": " °"
|
|
47
|
+
} } };
|
|
48
|
+
var $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 = class {
|
|
49
|
+
/** Formats a number value as a string, according to the locale and options provided to the constructor. */ format(value) {
|
|
50
|
+
let res = "";
|
|
51
|
+
if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
|
|
52
|
+
else res = this.numberFormatter.format(value);
|
|
53
|
+
if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
54
|
+
var _UNITS_unit;
|
|
55
|
+
let { unit, unitDisplay = "short", locale } = this.resolvedOptions();
|
|
56
|
+
if (!unit) return res;
|
|
57
|
+
let values = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
|
|
58
|
+
res += values[locale] || values.default;
|
|
59
|
+
}
|
|
60
|
+
return res;
|
|
61
|
+
}
|
|
62
|
+
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {
|
|
63
|
+
return this.numberFormatter.formatToParts(value);
|
|
64
|
+
}
|
|
65
|
+
/** Formats a number range as a string. */ formatRange(start, end) {
|
|
66
|
+
if (typeof this.numberFormatter.formatRange === "function") return this.numberFormatter.formatRange(start, end);
|
|
67
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
68
|
+
return `${this.format(start)} \u{2013} ${this.format(end)}`;
|
|
69
|
+
}
|
|
70
|
+
/** Formats a number range as an array of parts. */ formatRangeToParts(start, end) {
|
|
71
|
+
if (typeof this.numberFormatter.formatRangeToParts === "function") return this.numberFormatter.formatRangeToParts(start, end);
|
|
72
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
73
|
+
let startParts = this.numberFormatter.formatToParts(start);
|
|
74
|
+
let endParts = this.numberFormatter.formatToParts(end);
|
|
75
|
+
return [
|
|
76
|
+
...startParts.map((p) => ({
|
|
77
|
+
...p,
|
|
78
|
+
source: "startRange"
|
|
79
|
+
})),
|
|
80
|
+
{
|
|
81
|
+
type: "literal",
|
|
82
|
+
value: " – ",
|
|
83
|
+
source: "shared"
|
|
84
|
+
},
|
|
85
|
+
...endParts.map((p) => ({
|
|
86
|
+
...p,
|
|
87
|
+
source: "endRange"
|
|
88
|
+
}))
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
/** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
|
|
92
|
+
let options = this.numberFormatter.resolvedOptions();
|
|
93
|
+
if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) options = {
|
|
94
|
+
...options,
|
|
95
|
+
signDisplay: this.options.signDisplay
|
|
96
|
+
};
|
|
97
|
+
if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit") options = {
|
|
98
|
+
...options,
|
|
99
|
+
style: "unit",
|
|
100
|
+
unit: this.options.unit,
|
|
101
|
+
unitDisplay: this.options.unitDisplay
|
|
102
|
+
};
|
|
103
|
+
return options;
|
|
104
|
+
}
|
|
105
|
+
constructor(locale, options = {}) {
|
|
106
|
+
this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options);
|
|
107
|
+
this.options = options;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options = {}) {
|
|
111
|
+
let { numberingSystem } = options;
|
|
112
|
+
if (numberingSystem && locale.includes("-nu-")) {
|
|
113
|
+
if (!locale.includes("-u-")) locale += "-u-";
|
|
114
|
+
locale += `-nu-${numberingSystem}`;
|
|
115
|
+
}
|
|
116
|
+
if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
117
|
+
var _UNITS_unit;
|
|
118
|
+
let { unit, unitDisplay = "short" } = options;
|
|
119
|
+
if (!unit) throw new Error("unit option must be provided with style: \"unit\"");
|
|
120
|
+
if (!((_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay])) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
|
|
121
|
+
options = {
|
|
122
|
+
...options,
|
|
123
|
+
style: "decimal"
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
127
|
+
if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey)) return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
|
|
128
|
+
let numberFormatter = new Intl.NumberFormat(locale, options);
|
|
129
|
+
$488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter);
|
|
130
|
+
return numberFormatter;
|
|
131
|
+
}
|
|
132
|
+
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
|
|
133
|
+
if (signDisplay === "auto") return numberFormat.format(num);
|
|
134
|
+
else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
|
|
135
|
+
else {
|
|
136
|
+
let needsPositiveSign = false;
|
|
137
|
+
if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
|
|
138
|
+
else if (signDisplay === "exceptZero") if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
|
|
139
|
+
else needsPositiveSign = num > 0;
|
|
140
|
+
if (needsPositiveSign) {
|
|
141
|
+
let negative = numberFormat.format(-num);
|
|
142
|
+
let noSign = numberFormat.format(num);
|
|
143
|
+
let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
|
|
144
|
+
if ([...minus].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
|
|
145
|
+
return negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
|
|
146
|
+
} else return numberFormat.format(num);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region ../../node_modules/.pnpm/@internationalized+number@3.6.0/node_modules/@internationalized/number/dist/NumberParser.mjs
|
|
151
|
+
var $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = /* @__PURE__ */ new RegExp("^.*\\(.*\\).*$");
|
|
152
|
+
var $6c7bd7858deea686$var$NUMBERING_SYSTEMS = [
|
|
153
|
+
"latn",
|
|
154
|
+
"arab",
|
|
155
|
+
"hanidec",
|
|
156
|
+
"deva",
|
|
157
|
+
"beng"
|
|
158
|
+
];
|
|
159
|
+
var $6c7bd7858deea686$export$cd11ab140839f11d = class {
|
|
160
|
+
/**
|
|
161
|
+
* Parses the given string to a number. Returns NaN if a valid number could not be parsed.
|
|
162
|
+
*/ parse(value) {
|
|
163
|
+
return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).parse(value);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Returns whether the given string could potentially be a valid number. This should be used to
|
|
167
|
+
* validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
|
|
168
|
+
* of the minus/plus sign characters can be checked.
|
|
169
|
+
*/ isValidPartialNumber(value, minValue, maxValue) {
|
|
170
|
+
return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns a numbering system for which the given string is valid in the current locale.
|
|
174
|
+
* If no numbering system could be detected, the default numbering system for the current
|
|
175
|
+
* locale is returned.
|
|
176
|
+
*/ getNumberingSystem(value) {
|
|
177
|
+
return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;
|
|
178
|
+
}
|
|
179
|
+
constructor(locale, options = {}) {
|
|
180
|
+
this.locale = locale;
|
|
181
|
+
this.options = options;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
var $6c7bd7858deea686$var$numberParserCache = /* @__PURE__ */ new Map();
|
|
185
|
+
function $6c7bd7858deea686$var$getNumberParserImpl(locale, options, value) {
|
|
186
|
+
let defaultParser = $6c7bd7858deea686$var$getCachedNumberParser(locale, options);
|
|
187
|
+
if (!locale.includes("-nu-") && !defaultParser.isValidPartialNumber(value)) {
|
|
188
|
+
for (let numberingSystem of $6c7bd7858deea686$var$NUMBERING_SYSTEMS) if (numberingSystem !== defaultParser.options.numberingSystem) {
|
|
189
|
+
let parser = $6c7bd7858deea686$var$getCachedNumberParser(locale + (locale.includes("-u-") ? "-nu-" : "-u-nu-") + numberingSystem, options);
|
|
190
|
+
if (parser.isValidPartialNumber(value)) return parser;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return defaultParser;
|
|
194
|
+
}
|
|
195
|
+
function $6c7bd7858deea686$var$getCachedNumberParser(locale, options) {
|
|
196
|
+
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
197
|
+
let parser = $6c7bd7858deea686$var$numberParserCache.get(cacheKey);
|
|
198
|
+
if (!parser) {
|
|
199
|
+
parser = new $6c7bd7858deea686$var$NumberParserImpl(locale, options);
|
|
200
|
+
$6c7bd7858deea686$var$numberParserCache.set(cacheKey, parser);
|
|
201
|
+
}
|
|
202
|
+
return parser;
|
|
203
|
+
}
|
|
204
|
+
var $6c7bd7858deea686$var$NumberParserImpl = class {
|
|
205
|
+
parse(value) {
|
|
206
|
+
let fullySanitizedValue = this.sanitize(value);
|
|
207
|
+
if (this.symbols.group) fullySanitizedValue = $6c7bd7858deea686$var$replaceAll(fullySanitizedValue, this.symbols.group, "");
|
|
208
|
+
if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, ".");
|
|
209
|
+
if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, "-");
|
|
210
|
+
fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);
|
|
211
|
+
if (this.options.style === "percent") {
|
|
212
|
+
let isNegative = fullySanitizedValue.indexOf("-");
|
|
213
|
+
fullySanitizedValue = fullySanitizedValue.replace("-", "");
|
|
214
|
+
let index = fullySanitizedValue.indexOf(".");
|
|
215
|
+
if (index === -1) index = fullySanitizedValue.length;
|
|
216
|
+
fullySanitizedValue = fullySanitizedValue.replace(".", "");
|
|
217
|
+
if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;
|
|
218
|
+
else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;
|
|
219
|
+
else if (index - 2 === -2) fullySanitizedValue = "0.00";
|
|
220
|
+
else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;
|
|
221
|
+
if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;
|
|
222
|
+
}
|
|
223
|
+
let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;
|
|
224
|
+
if (isNaN(newValue)) return NaN;
|
|
225
|
+
if (this.options.style === "percent") {
|
|
226
|
+
var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
|
|
227
|
+
let options = {
|
|
228
|
+
...this.options,
|
|
229
|
+
style: "decimal",
|
|
230
|
+
minimumFractionDigits: Math.min(((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) + 2, 20),
|
|
231
|
+
maximumFractionDigits: Math.min(((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) + 2, 20)
|
|
232
|
+
};
|
|
233
|
+
return new $6c7bd7858deea686$export$cd11ab140839f11d(this.locale, options).parse(new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(this.locale, options).format(newValue));
|
|
234
|
+
}
|
|
235
|
+
if (this.options.currencySign === "accounting" && $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;
|
|
236
|
+
return newValue;
|
|
237
|
+
}
|
|
238
|
+
sanitize(value) {
|
|
239
|
+
value = value.replace(this.symbols.literals, "");
|
|
240
|
+
if (this.symbols.minusSign) value = value.replace("-", this.symbols.minusSign);
|
|
241
|
+
if (this.options.numberingSystem === "arab") {
|
|
242
|
+
if (this.symbols.decimal) {
|
|
243
|
+
value = value.replace(",", this.symbols.decimal);
|
|
244
|
+
value = value.replace(String.fromCharCode(1548), this.symbols.decimal);
|
|
245
|
+
}
|
|
246
|
+
if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, ".", this.symbols.group);
|
|
247
|
+
}
|
|
248
|
+
if (this.options.locale === "fr-FR") value = $6c7bd7858deea686$var$replaceAll(value, ".", String.fromCharCode(8239));
|
|
249
|
+
return value;
|
|
250
|
+
}
|
|
251
|
+
isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {
|
|
252
|
+
value = this.sanitize(value);
|
|
253
|
+
if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);
|
|
254
|
+
else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);
|
|
255
|
+
if (this.symbols.group && value.startsWith(this.symbols.group)) return false;
|
|
256
|
+
if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;
|
|
257
|
+
if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, this.symbols.group, "");
|
|
258
|
+
value = value.replace(this.symbols.numeral, "");
|
|
259
|
+
if (this.symbols.decimal) value = value.replace(this.symbols.decimal, "");
|
|
260
|
+
return value.length === 0;
|
|
261
|
+
}
|
|
262
|
+
constructor(locale, options = {}) {
|
|
263
|
+
this.locale = locale;
|
|
264
|
+
this.formatter = new Intl.NumberFormat(locale, options);
|
|
265
|
+
this.options = this.formatter.resolvedOptions();
|
|
266
|
+
this.symbols = $6c7bd7858deea686$var$getSymbols(locale, this.formatter, this.options, options);
|
|
267
|
+
var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
|
|
268
|
+
if (this.options.style === "percent" && (((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) > 18 || ((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) > 18)) console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
var $6c7bd7858deea686$var$nonLiteralParts = new Set([
|
|
272
|
+
"decimal",
|
|
273
|
+
"fraction",
|
|
274
|
+
"integer",
|
|
275
|
+
"minusSign",
|
|
276
|
+
"plusSign",
|
|
277
|
+
"group"
|
|
278
|
+
]);
|
|
279
|
+
var $6c7bd7858deea686$var$pluralNumbers = [
|
|
280
|
+
0,
|
|
281
|
+
4,
|
|
282
|
+
2,
|
|
283
|
+
1,
|
|
284
|
+
11,
|
|
285
|
+
20,
|
|
286
|
+
3,
|
|
287
|
+
7,
|
|
288
|
+
100,
|
|
289
|
+
21,
|
|
290
|
+
.1,
|
|
291
|
+
1.1
|
|
292
|
+
];
|
|
293
|
+
function $6c7bd7858deea686$var$getSymbols(locale, formatter, intlOptions, originalOptions) {
|
|
294
|
+
var _allParts_find, _posAllParts_find, _decimalParts_find, _allParts_find1;
|
|
295
|
+
let symbolFormatter = new Intl.NumberFormat(locale, {
|
|
296
|
+
...intlOptions,
|
|
297
|
+
minimumSignificantDigits: 1,
|
|
298
|
+
maximumSignificantDigits: 21,
|
|
299
|
+
roundingIncrement: 1,
|
|
300
|
+
roundingPriority: "auto",
|
|
301
|
+
roundingMode: "halfExpand"
|
|
302
|
+
});
|
|
303
|
+
let allParts = symbolFormatter.formatToParts(-10000.111);
|
|
304
|
+
let posAllParts = symbolFormatter.formatToParts(10000.111);
|
|
305
|
+
let pluralParts = $6c7bd7858deea686$var$pluralNumbers.map((n) => symbolFormatter.formatToParts(n));
|
|
306
|
+
var _allParts_find_value;
|
|
307
|
+
let minusSign = (_allParts_find_value = (_allParts_find = allParts.find((p) => p.type === "minusSign")) === null || _allParts_find === void 0 ? void 0 : _allParts_find.value) !== null && _allParts_find_value !== void 0 ? _allParts_find_value : "-";
|
|
308
|
+
let plusSign = (_posAllParts_find = posAllParts.find((p) => p.type === "plusSign")) === null || _posAllParts_find === void 0 ? void 0 : _posAllParts_find.value;
|
|
309
|
+
if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "exceptZero" || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "always")) plusSign = "+";
|
|
310
|
+
let decimal = (_decimalParts_find = new Intl.NumberFormat(locale, {
|
|
311
|
+
...intlOptions,
|
|
312
|
+
minimumFractionDigits: 2,
|
|
313
|
+
maximumFractionDigits: 2
|
|
314
|
+
}).formatToParts(.001).find((p) => p.type === "decimal")) === null || _decimalParts_find === void 0 ? void 0 : _decimalParts_find.value;
|
|
315
|
+
let group = (_allParts_find1 = allParts.find((p) => p.type === "group")) === null || _allParts_find1 === void 0 ? void 0 : _allParts_find1.value;
|
|
316
|
+
let allPartsLiterals = allParts.filter((p) => !$6c7bd7858deea686$var$nonLiteralParts.has(p.type)).map((p) => $6c7bd7858deea686$var$escapeRegex(p.value));
|
|
317
|
+
let pluralPartsLiterals = pluralParts.flatMap((p) => p.filter((p) => !$6c7bd7858deea686$var$nonLiteralParts.has(p.type)).map((p) => $6c7bd7858deea686$var$escapeRegex(p.value)));
|
|
318
|
+
let sortedLiterals = [...new Set([...allPartsLiterals, ...pluralPartsLiterals])].sort((a, b) => b.length - a.length);
|
|
319
|
+
let literals = sortedLiterals.length === 0 ? /* @__PURE__ */ new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${sortedLiterals.join("|")}|[\\p{White_Space}]`, "gu");
|
|
320
|
+
let numerals = [...new Intl.NumberFormat(intlOptions.locale, { useGrouping: false }).format(9876543210)].reverse();
|
|
321
|
+
let indexes = new Map(numerals.map((d, i) => [d, i]));
|
|
322
|
+
let numeral = new RegExp(`[${numerals.join("")}]`, "g");
|
|
323
|
+
let index = (d) => String(indexes.get(d));
|
|
324
|
+
return {
|
|
325
|
+
minusSign,
|
|
326
|
+
plusSign,
|
|
327
|
+
decimal,
|
|
328
|
+
group,
|
|
329
|
+
literals,
|
|
330
|
+
numeral,
|
|
331
|
+
index
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function $6c7bd7858deea686$var$replaceAll(str, find, replace) {
|
|
335
|
+
if (str.replaceAll) return str.replaceAll(find, replace);
|
|
336
|
+
return str.split(find).join(replace);
|
|
337
|
+
}
|
|
338
|
+
function $6c7bd7858deea686$var$escapeRegex(string) {
|
|
339
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
340
|
+
}
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@5.9.3_/node_modules/reka-ui/dist/NumberField/utils.js
|
|
343
|
+
function usePressedHold(options) {
|
|
344
|
+
const { disabled } = options;
|
|
345
|
+
const timeout = ref();
|
|
346
|
+
const triggerHook = createEventHook();
|
|
347
|
+
const resetTimeout = () => window.clearTimeout(timeout.value);
|
|
348
|
+
const onIncrementPressStart = (delay) => {
|
|
349
|
+
resetTimeout();
|
|
350
|
+
if (disabled.value) return;
|
|
351
|
+
triggerHook.trigger();
|
|
352
|
+
timeout.value = window.setTimeout(() => {
|
|
353
|
+
onIncrementPressStart(60);
|
|
354
|
+
}, delay);
|
|
355
|
+
};
|
|
356
|
+
const handlePressStart = () => {
|
|
357
|
+
onIncrementPressStart(400);
|
|
358
|
+
};
|
|
359
|
+
const handlePressEnd = () => {
|
|
360
|
+
resetTimeout();
|
|
361
|
+
};
|
|
362
|
+
const isPressed = ref(false);
|
|
363
|
+
const target = computed(() => unrefElement(options.target));
|
|
364
|
+
const onPressStart = (event) => {
|
|
365
|
+
if (event.button !== 0 || isPressed.value) return;
|
|
366
|
+
event.preventDefault();
|
|
367
|
+
isPressed.value = true;
|
|
368
|
+
handlePressStart();
|
|
369
|
+
};
|
|
370
|
+
const onPressRelease = () => {
|
|
371
|
+
isPressed.value = false;
|
|
372
|
+
handlePressEnd();
|
|
373
|
+
};
|
|
374
|
+
if (isClient) {
|
|
375
|
+
useEventListener(target || window, "pointerdown", onPressStart);
|
|
376
|
+
useEventListener(window, "pointerup", onPressRelease);
|
|
377
|
+
useEventListener(window, "pointercancel", onPressRelease);
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
isPressed,
|
|
381
|
+
onTrigger: triggerHook.on
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function useNumberFormatter(locale, options = ref({})) {
|
|
385
|
+
return reactiveComputed(() => new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(locale.value, options.value));
|
|
386
|
+
}
|
|
387
|
+
function useNumberParser(locale, options = ref({})) {
|
|
388
|
+
return reactiveComputed(() => new $6c7bd7858deea686$export$cd11ab140839f11d(locale.value, options.value));
|
|
389
|
+
}
|
|
390
|
+
function handleDecimalOperation(operator, value1, value2) {
|
|
391
|
+
let result = operator === "+" ? value1 + value2 : value1 - value2;
|
|
392
|
+
if (value1 % 1 !== 0 || value2 % 1 !== 0) {
|
|
393
|
+
const value1Decimal = value1.toString().split(".");
|
|
394
|
+
const value2Decimal = value2.toString().split(".");
|
|
395
|
+
const value1DecimalLength = value1Decimal[1] && value1Decimal[1].length || 0;
|
|
396
|
+
const value2DecimalLength = value2Decimal[1] && value2Decimal[1].length || 0;
|
|
397
|
+
const multiplier = 10 ** Math.max(value1DecimalLength, value2DecimalLength);
|
|
398
|
+
value1 = Math.round(value1 * multiplier);
|
|
399
|
+
value2 = Math.round(value2 * multiplier);
|
|
400
|
+
result = operator === "+" ? value1 + value2 : value1 - value2;
|
|
401
|
+
result /= multiplier;
|
|
402
|
+
}
|
|
403
|
+
return result;
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@5.9.3_/node_modules/reka-ui/dist/NumberField/NumberFieldRoot.js
|
|
407
|
+
var [injectNumberFieldRootContext, provideNumberFieldRootContext] = /* @__PURE__ */ createContext("NumberFieldRoot");
|
|
408
|
+
var NumberFieldRoot_default = /* @__PURE__ */ defineComponent({
|
|
409
|
+
inheritAttrs: false,
|
|
410
|
+
__name: "NumberFieldRoot",
|
|
411
|
+
props: {
|
|
412
|
+
defaultValue: {
|
|
413
|
+
type: Number,
|
|
414
|
+
required: false,
|
|
415
|
+
default: void 0
|
|
416
|
+
},
|
|
417
|
+
modelValue: {
|
|
418
|
+
type: [Number, null],
|
|
419
|
+
required: false
|
|
420
|
+
},
|
|
421
|
+
min: {
|
|
422
|
+
type: Number,
|
|
423
|
+
required: false
|
|
424
|
+
},
|
|
425
|
+
max: {
|
|
426
|
+
type: Number,
|
|
427
|
+
required: false
|
|
428
|
+
},
|
|
429
|
+
step: {
|
|
430
|
+
type: Number,
|
|
431
|
+
required: false,
|
|
432
|
+
default: 1
|
|
433
|
+
},
|
|
434
|
+
stepSnapping: {
|
|
435
|
+
type: Boolean,
|
|
436
|
+
required: false,
|
|
437
|
+
default: true
|
|
438
|
+
},
|
|
439
|
+
focusOnChange: {
|
|
440
|
+
type: Boolean,
|
|
441
|
+
required: false,
|
|
442
|
+
default: true
|
|
443
|
+
},
|
|
444
|
+
formatOptions: {
|
|
445
|
+
type: null,
|
|
446
|
+
required: false
|
|
447
|
+
},
|
|
448
|
+
locale: {
|
|
449
|
+
type: String,
|
|
450
|
+
required: false
|
|
451
|
+
},
|
|
452
|
+
disabled: {
|
|
453
|
+
type: Boolean,
|
|
454
|
+
required: false
|
|
455
|
+
},
|
|
456
|
+
readonly: {
|
|
457
|
+
type: Boolean,
|
|
458
|
+
required: false
|
|
459
|
+
},
|
|
460
|
+
disableWheelChange: {
|
|
461
|
+
type: Boolean,
|
|
462
|
+
required: false
|
|
463
|
+
},
|
|
464
|
+
invertWheelChange: {
|
|
465
|
+
type: Boolean,
|
|
466
|
+
required: false
|
|
467
|
+
},
|
|
468
|
+
id: {
|
|
469
|
+
type: String,
|
|
470
|
+
required: false
|
|
471
|
+
},
|
|
472
|
+
asChild: {
|
|
473
|
+
type: Boolean,
|
|
474
|
+
required: false
|
|
475
|
+
},
|
|
476
|
+
as: {
|
|
477
|
+
type: null,
|
|
478
|
+
required: false,
|
|
479
|
+
default: "div"
|
|
480
|
+
},
|
|
481
|
+
name: {
|
|
482
|
+
type: String,
|
|
483
|
+
required: false
|
|
484
|
+
},
|
|
485
|
+
required: {
|
|
486
|
+
type: Boolean,
|
|
487
|
+
required: false
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
emits: ["update:modelValue"],
|
|
491
|
+
setup(__props, { emit: __emit }) {
|
|
492
|
+
const props = __props;
|
|
493
|
+
const emits = __emit;
|
|
494
|
+
const { disabled, readonly, disableWheelChange, invertWheelChange, min, max, step, stepSnapping, formatOptions, id, locale: propLocale } = toRefs(props);
|
|
495
|
+
const modelValue = useVModel(props, "modelValue", emits, {
|
|
496
|
+
defaultValue: props.defaultValue,
|
|
497
|
+
passive: props.modelValue === void 0
|
|
498
|
+
});
|
|
499
|
+
const { primitiveElement, currentElement } = usePrimitiveElement();
|
|
500
|
+
const locale = useLocale(propLocale);
|
|
501
|
+
const isFormControl = useFormControl(currentElement);
|
|
502
|
+
const inputEl = ref();
|
|
503
|
+
const isDecreaseDisabled = computed(() => {
|
|
504
|
+
if (isNullish(modelValue.value) || isNaN(modelValue.value)) return false;
|
|
505
|
+
return getNextValue("decrease", modelValue.value) >= modelValue.value;
|
|
506
|
+
});
|
|
507
|
+
const isIncreaseDisabled = computed(() => {
|
|
508
|
+
if (isNullish(modelValue.value) || isNaN(modelValue.value)) return false;
|
|
509
|
+
return getNextValue("increase", modelValue.value) <= modelValue.value;
|
|
510
|
+
});
|
|
511
|
+
function getNextValue(type, from, multiplier = 1) {
|
|
512
|
+
const stepValue = step.value ?? 1;
|
|
513
|
+
const operator = type === "increase" ? "+" : "-";
|
|
514
|
+
let nextValue;
|
|
515
|
+
if (stepSnapping.value && !isNaN(stepValue)) {
|
|
516
|
+
const snapped = snapValueToStep(from, min.value, max.value, stepValue);
|
|
517
|
+
if (snapped === from) nextValue = handleDecimalOperation(operator, from, stepValue * multiplier);
|
|
518
|
+
else {
|
|
519
|
+
const aligned = type === "increase" ? snapped > from ? snapped : handleDecimalOperation("+", snapped, stepValue) : snapped < from ? snapped : handleDecimalOperation("-", snapped, stepValue);
|
|
520
|
+
nextValue = multiplier > 1 ? handleDecimalOperation(operator, aligned, stepValue * (multiplier - 1)) : aligned;
|
|
521
|
+
}
|
|
522
|
+
} else nextValue = handleDecimalOperation(operator, from, stepValue * multiplier);
|
|
523
|
+
return clampInputValue(nextValue);
|
|
524
|
+
}
|
|
525
|
+
function handleChangingValue(type, multiplier = 1) {
|
|
526
|
+
if (props.focusOnChange) inputEl.value?.focus();
|
|
527
|
+
if (props.disabled || props.readonly) return;
|
|
528
|
+
const currentInputValue = numberParser.parse(inputEl.value?.value ?? "");
|
|
529
|
+
if (isNaN(currentInputValue)) {
|
|
530
|
+
modelValue.value = clampInputValue(min.value ?? 0);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
modelValue.value = getNextValue(type, currentInputValue, multiplier);
|
|
534
|
+
}
|
|
535
|
+
function handleIncrease(multiplier = 1) {
|
|
536
|
+
handleChangingValue("increase", multiplier);
|
|
537
|
+
}
|
|
538
|
+
function handleDecrease(multiplier = 1) {
|
|
539
|
+
handleChangingValue("decrease", multiplier);
|
|
540
|
+
}
|
|
541
|
+
function handleMinMaxValue(type) {
|
|
542
|
+
if (type === "min" && min.value !== void 0) modelValue.value = clampInputValue(min.value);
|
|
543
|
+
else if (type === "max" && max.value !== void 0) modelValue.value = clampInputValue(max.value);
|
|
544
|
+
}
|
|
545
|
+
const numberFormatter = useNumberFormatter(locale, formatOptions);
|
|
546
|
+
const numberParser = useNumberParser(locale, formatOptions);
|
|
547
|
+
const inputMode = computed(() => {
|
|
548
|
+
return numberFormatter.resolvedOptions().maximumFractionDigits > 0 ? "decimal" : "numeric";
|
|
549
|
+
});
|
|
550
|
+
const textValueFormatter = useNumberFormatter(locale, formatOptions);
|
|
551
|
+
const textValue = computed(() => isNullish(modelValue.value) || isNaN(modelValue.value) ? "" : textValueFormatter.format(modelValue.value));
|
|
552
|
+
function validate(val) {
|
|
553
|
+
return numberParser.isValidPartialNumber(val, min.value, max.value);
|
|
554
|
+
}
|
|
555
|
+
function setInputValue(val) {
|
|
556
|
+
if (inputEl.value) inputEl.value.value = val;
|
|
557
|
+
}
|
|
558
|
+
function clampInputValue(val) {
|
|
559
|
+
let clampedValue;
|
|
560
|
+
if (step.value === void 0 || isNaN(step.value) || !stepSnapping.value) clampedValue = clamp(val, min.value, max.value);
|
|
561
|
+
else clampedValue = snapValueToStep(val, min.value, max.value, step.value);
|
|
562
|
+
clampedValue = numberParser.parse(numberFormatter.format(clampedValue));
|
|
563
|
+
return clampedValue;
|
|
564
|
+
}
|
|
565
|
+
function applyInputValue(val) {
|
|
566
|
+
const parsedValue = numberParser.parse(val);
|
|
567
|
+
modelValue.value = isNaN(parsedValue) ? void 0 : clampInputValue(parsedValue);
|
|
568
|
+
if (!val.length) return setInputValue(val);
|
|
569
|
+
if (isNaN(parsedValue)) return setInputValue(textValue.value);
|
|
570
|
+
return setInputValue(textValue.value);
|
|
571
|
+
}
|
|
572
|
+
provideNumberFieldRootContext({
|
|
573
|
+
modelValue,
|
|
574
|
+
handleDecrease,
|
|
575
|
+
handleIncrease,
|
|
576
|
+
handleMinMaxValue,
|
|
577
|
+
inputMode,
|
|
578
|
+
inputEl,
|
|
579
|
+
onInputElement: (el) => inputEl.value = el,
|
|
580
|
+
textValue,
|
|
581
|
+
readonly,
|
|
582
|
+
validate,
|
|
583
|
+
applyInputValue,
|
|
584
|
+
disabled,
|
|
585
|
+
disableWheelChange,
|
|
586
|
+
invertWheelChange,
|
|
587
|
+
max,
|
|
588
|
+
min,
|
|
589
|
+
isDecreaseDisabled,
|
|
590
|
+
isIncreaseDisabled,
|
|
591
|
+
id
|
|
592
|
+
});
|
|
593
|
+
return (_ctx, _cache) => {
|
|
594
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(_ctx.$attrs, {
|
|
595
|
+
ref_key: "primitiveElement",
|
|
596
|
+
ref: primitiveElement,
|
|
597
|
+
role: "group",
|
|
598
|
+
as: _ctx.as,
|
|
599
|
+
"as-child": _ctx.asChild,
|
|
600
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
601
|
+
"data-readonly": unref(readonly) ? "" : void 0
|
|
602
|
+
}), {
|
|
603
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
|
|
604
|
+
modelValue: unref(modelValue),
|
|
605
|
+
textValue: textValue.value,
|
|
606
|
+
readonly: unref(readonly)
|
|
607
|
+
}), unref(isFormControl) && _ctx.name ? (openBlock(), createBlock(unref(VisuallyHiddenInput_default), {
|
|
608
|
+
key: 0,
|
|
609
|
+
type: "text",
|
|
610
|
+
value: unref(modelValue),
|
|
611
|
+
name: _ctx.name,
|
|
612
|
+
disabled: unref(disabled),
|
|
613
|
+
readonly: unref(readonly),
|
|
614
|
+
required: _ctx.required
|
|
615
|
+
}, null, 8, [
|
|
616
|
+
"value",
|
|
617
|
+
"name",
|
|
618
|
+
"disabled",
|
|
619
|
+
"readonly",
|
|
620
|
+
"required"
|
|
621
|
+
])) : createCommentVNode("v-if", true)]),
|
|
622
|
+
_: 3
|
|
623
|
+
}, 16, [
|
|
624
|
+
"as",
|
|
625
|
+
"as-child",
|
|
626
|
+
"data-disabled",
|
|
627
|
+
"data-readonly"
|
|
628
|
+
]);
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@5.9.3_/node_modules/reka-ui/dist/NumberField/NumberFieldDecrement.js
|
|
634
|
+
var NumberFieldDecrement_default = /* @__PURE__ */ defineComponent({
|
|
635
|
+
__name: "NumberFieldDecrement",
|
|
636
|
+
props: {
|
|
637
|
+
disabled: {
|
|
638
|
+
type: Boolean,
|
|
639
|
+
required: false
|
|
640
|
+
},
|
|
641
|
+
asChild: {
|
|
642
|
+
type: Boolean,
|
|
643
|
+
required: false
|
|
644
|
+
},
|
|
645
|
+
as: {
|
|
646
|
+
type: null,
|
|
647
|
+
required: false,
|
|
648
|
+
default: "button"
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
setup(__props) {
|
|
652
|
+
const props = __props;
|
|
653
|
+
const rootContext = injectNumberFieldRootContext();
|
|
654
|
+
const isDisabled = computed(() => rootContext.disabled?.value || rootContext.readonly.value || props.disabled || rootContext.isDecreaseDisabled.value);
|
|
655
|
+
const { primitiveElement, currentElement } = usePrimitiveElement();
|
|
656
|
+
const { isPressed, onTrigger } = usePressedHold({
|
|
657
|
+
target: currentElement,
|
|
658
|
+
disabled: isDisabled
|
|
659
|
+
});
|
|
660
|
+
onTrigger(() => {
|
|
661
|
+
rootContext.handleDecrease();
|
|
662
|
+
});
|
|
663
|
+
return (_ctx, _cache) => {
|
|
664
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
|
|
665
|
+
ref_key: "primitiveElement",
|
|
666
|
+
ref: primitiveElement,
|
|
667
|
+
tabindex: "-1",
|
|
668
|
+
"aria-label": "Decrease",
|
|
669
|
+
type: _ctx.as === "button" ? "button" : void 0,
|
|
670
|
+
style: { userSelect: unref(isPressed) ? "none" : void 0 },
|
|
671
|
+
disabled: isDisabled.value ? "" : void 0,
|
|
672
|
+
"data-disabled": isDisabled.value ? "" : void 0,
|
|
673
|
+
"data-pressed": unref(isPressed) ? "true" : void 0,
|
|
674
|
+
onContextmenu: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
|
|
675
|
+
}), {
|
|
676
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
677
|
+
_: 3
|
|
678
|
+
}, 16, [
|
|
679
|
+
"type",
|
|
680
|
+
"style",
|
|
681
|
+
"disabled",
|
|
682
|
+
"data-disabled",
|
|
683
|
+
"data-pressed"
|
|
684
|
+
]);
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@5.9.3_/node_modules/reka-ui/dist/NumberField/NumberFieldIncrement.js
|
|
690
|
+
var NumberFieldIncrement_default = /* @__PURE__ */ defineComponent({
|
|
691
|
+
__name: "NumberFieldIncrement",
|
|
692
|
+
props: {
|
|
693
|
+
disabled: {
|
|
694
|
+
type: Boolean,
|
|
695
|
+
required: false
|
|
696
|
+
},
|
|
697
|
+
asChild: {
|
|
698
|
+
type: Boolean,
|
|
699
|
+
required: false
|
|
700
|
+
},
|
|
701
|
+
as: {
|
|
702
|
+
type: null,
|
|
703
|
+
required: false,
|
|
704
|
+
default: "button"
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
setup(__props) {
|
|
708
|
+
const props = __props;
|
|
709
|
+
const rootContext = injectNumberFieldRootContext();
|
|
710
|
+
const isDisabled = computed(() => rootContext.disabled?.value || rootContext.readonly.value || props.disabled || rootContext.isIncreaseDisabled.value);
|
|
711
|
+
const { primitiveElement, currentElement } = usePrimitiveElement();
|
|
712
|
+
const { isPressed, onTrigger } = usePressedHold({
|
|
713
|
+
target: currentElement,
|
|
714
|
+
disabled: isDisabled
|
|
715
|
+
});
|
|
716
|
+
onTrigger(() => {
|
|
717
|
+
rootContext.handleIncrease();
|
|
718
|
+
});
|
|
719
|
+
return (_ctx, _cache) => {
|
|
720
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
|
|
721
|
+
ref_key: "primitiveElement",
|
|
722
|
+
ref: primitiveElement,
|
|
723
|
+
tabindex: "-1",
|
|
724
|
+
"aria-label": "Increase",
|
|
725
|
+
type: _ctx.as === "button" ? "button" : void 0,
|
|
726
|
+
style: { userSelect: unref(isPressed) ? "none" : void 0 },
|
|
727
|
+
disabled: isDisabled.value ? "" : void 0,
|
|
728
|
+
"data-disabled": isDisabled.value ? "" : void 0,
|
|
729
|
+
"data-pressed": unref(isPressed) ? "true" : void 0,
|
|
730
|
+
onContextmenu: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
|
|
731
|
+
}), {
|
|
732
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
733
|
+
_: 3
|
|
734
|
+
}, 16, [
|
|
735
|
+
"type",
|
|
736
|
+
"style",
|
|
737
|
+
"disabled",
|
|
738
|
+
"data-disabled",
|
|
739
|
+
"data-pressed"
|
|
740
|
+
]);
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@5.9.3_/node_modules/reka-ui/dist/NumberField/NumberFieldInput.js
|
|
746
|
+
var NumberFieldInput_default = /* @__PURE__ */ defineComponent({
|
|
747
|
+
__name: "NumberFieldInput",
|
|
748
|
+
props: {
|
|
749
|
+
asChild: {
|
|
750
|
+
type: Boolean,
|
|
751
|
+
required: false
|
|
752
|
+
},
|
|
753
|
+
as: {
|
|
754
|
+
type: null,
|
|
755
|
+
required: false,
|
|
756
|
+
default: "input"
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
setup(__props) {
|
|
760
|
+
const props = __props;
|
|
761
|
+
const { primitiveElement, currentElement } = usePrimitiveElement();
|
|
762
|
+
const rootContext = injectNumberFieldRootContext();
|
|
763
|
+
const kbd = useKbd();
|
|
764
|
+
const { isComposing, handleCompositionStart, handleCompositionEnd } = useComposing();
|
|
765
|
+
function handleKeydown(event) {
|
|
766
|
+
if (isComposing.value || event.isComposing) return;
|
|
767
|
+
switch (event.key) {
|
|
768
|
+
case kbd.ARROW_UP:
|
|
769
|
+
event.preventDefault();
|
|
770
|
+
rootContext.handleIncrease();
|
|
771
|
+
break;
|
|
772
|
+
case kbd.ARROW_DOWN:
|
|
773
|
+
event.preventDefault();
|
|
774
|
+
rootContext.handleDecrease();
|
|
775
|
+
break;
|
|
776
|
+
case kbd.PAGE_UP:
|
|
777
|
+
event.preventDefault();
|
|
778
|
+
rootContext.handleIncrease(10);
|
|
779
|
+
break;
|
|
780
|
+
case kbd.PAGE_DOWN:
|
|
781
|
+
event.preventDefault();
|
|
782
|
+
rootContext.handleDecrease(10);
|
|
783
|
+
break;
|
|
784
|
+
case kbd.HOME:
|
|
785
|
+
event.preventDefault();
|
|
786
|
+
rootContext.handleMinMaxValue("min");
|
|
787
|
+
break;
|
|
788
|
+
case kbd.END:
|
|
789
|
+
event.preventDefault();
|
|
790
|
+
rootContext.handleMinMaxValue("max");
|
|
791
|
+
break;
|
|
792
|
+
case kbd.ENTER:
|
|
793
|
+
rootContext.applyInputValue(event.target?.value);
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
function handleWheelEvent(event) {
|
|
798
|
+
if (rootContext.disableWheelChange.value) return;
|
|
799
|
+
if (event.target !== getActiveElement()) return;
|
|
800
|
+
if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) return;
|
|
801
|
+
event.preventDefault();
|
|
802
|
+
if (event.deltaY > 0) rootContext.invertWheelChange.value ? rootContext.handleDecrease() : rootContext.handleIncrease();
|
|
803
|
+
else if (event.deltaY < 0) rootContext.invertWheelChange.value ? rootContext.handleIncrease() : rootContext.handleDecrease();
|
|
804
|
+
}
|
|
805
|
+
onMounted(() => {
|
|
806
|
+
rootContext.onInputElement(currentElement.value);
|
|
807
|
+
});
|
|
808
|
+
const inputValue = ref(rootContext.textValue.value);
|
|
809
|
+
watch(() => rootContext.textValue.value, () => {
|
|
810
|
+
inputValue.value = rootContext.textValue.value;
|
|
811
|
+
}, {
|
|
812
|
+
immediate: true,
|
|
813
|
+
deep: true
|
|
814
|
+
});
|
|
815
|
+
function handleChange() {
|
|
816
|
+
requestAnimationFrame(() => {
|
|
817
|
+
inputValue.value = rootContext.textValue.value;
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
return (_ctx, _cache) => {
|
|
821
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
|
|
822
|
+
id: unref(rootContext).id.value,
|
|
823
|
+
ref_key: "primitiveElement",
|
|
824
|
+
ref: primitiveElement,
|
|
825
|
+
value: inputValue.value,
|
|
826
|
+
role: "spinbutton",
|
|
827
|
+
type: "text",
|
|
828
|
+
tabindex: "0",
|
|
829
|
+
inputmode: unref(rootContext).inputMode.value,
|
|
830
|
+
disabled: unref(rootContext).disabled.value ? "" : void 0,
|
|
831
|
+
"data-disabled": unref(rootContext).disabled.value ? "" : void 0,
|
|
832
|
+
readonly: unref(rootContext).readonly.value ? "" : void 0,
|
|
833
|
+
"data-readonly": unref(rootContext).readonly.value ? "" : void 0,
|
|
834
|
+
autocomplete: "off",
|
|
835
|
+
autocorrect: "off",
|
|
836
|
+
spellcheck: "false",
|
|
837
|
+
"aria-roledescription": "Number field",
|
|
838
|
+
"aria-valuenow": unref(rootContext).modelValue.value,
|
|
839
|
+
"aria-valuemin": unref(rootContext).min.value,
|
|
840
|
+
"aria-valuemax": unref(rootContext).max.value,
|
|
841
|
+
onKeydown: handleKeydown,
|
|
842
|
+
onWheel: handleWheelEvent,
|
|
843
|
+
onBeforeinput: _cache[0] || (_cache[0] = (event) => {
|
|
844
|
+
if (event.isComposing) return;
|
|
845
|
+
const target = event.target;
|
|
846
|
+
let nextValue = target.value.slice(0, target.selectionStart ?? void 0) + (event.data ?? "") + target.value.slice(target.selectionEnd ?? void 0);
|
|
847
|
+
if (!unref(rootContext).validate(nextValue)) event.preventDefault();
|
|
848
|
+
}),
|
|
849
|
+
onInput: _cache[1] || (_cache[1] = (event) => {
|
|
850
|
+
inputValue.value = event.target.value;
|
|
851
|
+
}),
|
|
852
|
+
onChange: handleChange,
|
|
853
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => unref(rootContext).applyInputValue($event.target?.value)),
|
|
854
|
+
onCompositionstart: unref(handleCompositionStart),
|
|
855
|
+
onCompositionend: unref(handleCompositionEnd)
|
|
856
|
+
}), {
|
|
857
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
858
|
+
_: 3
|
|
859
|
+
}, 16, [
|
|
860
|
+
"id",
|
|
861
|
+
"value",
|
|
862
|
+
"inputmode",
|
|
863
|
+
"disabled",
|
|
864
|
+
"data-disabled",
|
|
865
|
+
"readonly",
|
|
866
|
+
"data-readonly",
|
|
867
|
+
"aria-valuenow",
|
|
868
|
+
"aria-valuemin",
|
|
869
|
+
"aria-valuemax",
|
|
870
|
+
"onCompositionstart",
|
|
871
|
+
"onCompositionend"
|
|
872
|
+
]);
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
});
|
|
6
876
|
//#endregion
|
|
7
877
|
//#region src/components/counter-input/counter-input.vue
|
|
8
878
|
var counter_input_default = /* @__PURE__ */ defineComponent({
|
|
@@ -13,14 +883,19 @@ var counter_input_default = /* @__PURE__ */ defineComponent({
|
|
|
13
883
|
min: {},
|
|
14
884
|
max: {},
|
|
15
885
|
step: {},
|
|
886
|
+
stepSnapping: { type: Boolean },
|
|
887
|
+
focusOnChange: { type: Boolean },
|
|
16
888
|
formatOptions: {},
|
|
17
889
|
locale: {},
|
|
18
890
|
disabled: { type: Boolean },
|
|
19
|
-
|
|
20
|
-
|
|
891
|
+
readonly: { type: Boolean },
|
|
892
|
+
disableWheelChange: { type: Boolean },
|
|
893
|
+
invertWheelChange: { type: Boolean },
|
|
21
894
|
id: {},
|
|
22
895
|
asChild: { type: Boolean },
|
|
23
896
|
as: {},
|
|
897
|
+
name: {},
|
|
898
|
+
required: { type: Boolean },
|
|
24
899
|
class: {},
|
|
25
900
|
size: { default: "md" },
|
|
26
901
|
hasError: {
|
|
@@ -32,14 +907,14 @@ var counter_input_default = /* @__PURE__ */ defineComponent({
|
|
|
32
907
|
setup(__props, { emit: __emit }) {
|
|
33
908
|
const props = __props;
|
|
34
909
|
const emits = __emit;
|
|
35
|
-
const forwarded =
|
|
910
|
+
const forwarded = useForwardPropsEmits(useDelegatedProps(props, "class"), emits);
|
|
36
911
|
return (_ctx, _cache) => {
|
|
37
|
-
return openBlock(), createBlock(unref(
|
|
912
|
+
return openBlock(), createBlock(unref(NumberFieldRoot_default), mergeProps(unref(forwarded), {
|
|
38
913
|
"has-error": _ctx.hasError,
|
|
39
914
|
class: unref(clsx)("celeste-counter-input-wrapper", props.class)
|
|
40
915
|
}), {
|
|
41
916
|
default: withCtx(() => [
|
|
42
|
-
createVNode(unref(
|
|
917
|
+
createVNode(unref(NumberFieldDecrement_default), {
|
|
43
918
|
"as-child": "",
|
|
44
919
|
class: "celeste-counter-input-decrement"
|
|
45
920
|
}, {
|
|
@@ -49,8 +924,8 @@ var counter_input_default = /* @__PURE__ */ defineComponent({
|
|
|
49
924
|
})]),
|
|
50
925
|
_: 1
|
|
51
926
|
}),
|
|
52
|
-
createVNode(unref(
|
|
53
|
-
createVNode(unref(
|
|
927
|
+
createVNode(unref(NumberFieldInput_default), { class: "celeste-counter-input" }),
|
|
928
|
+
createVNode(unref(NumberFieldIncrement_default), {
|
|
54
929
|
"as-child": "",
|
|
55
930
|
class: "celeste-counter-input-increment"
|
|
56
931
|
}, {
|