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