@sewadah/selaras 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +131 -0
- package/dist/module.d.mts +22 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +127 -0
- package/dist/runtime/components/Accordion.d.vue.ts +59 -0
- package/dist/runtime/components/Accordion.vue +65 -0
- package/dist/runtime/components/Accordion.vue.d.ts +59 -0
- package/dist/runtime/components/Alert.d.vue.ts +39 -0
- package/dist/runtime/components/Alert.vue +64 -0
- package/dist/runtime/components/Alert.vue.d.ts +39 -0
- package/dist/runtime/components/AlertDialog.d.vue.ts +66 -0
- package/dist/runtime/components/AlertDialog.vue +116 -0
- package/dist/runtime/components/AlertDialog.vue.d.ts +66 -0
- package/dist/runtime/components/App.d.vue.ts +32 -0
- package/dist/runtime/components/App.vue +26 -0
- package/dist/runtime/components/App.vue.d.ts +32 -0
- package/dist/runtime/components/Autocomplete.d.vue.ts +61 -0
- package/dist/runtime/components/Autocomplete.vue +41 -0
- package/dist/runtime/components/Autocomplete.vue.d.ts +61 -0
- package/dist/runtime/components/Avatar.d.vue.ts +46 -0
- package/dist/runtime/components/Avatar.vue +64 -0
- package/dist/runtime/components/Avatar.vue.d.ts +46 -0
- package/dist/runtime/components/AvatarGroup.d.vue.ts +14 -0
- package/dist/runtime/components/AvatarGroup.vue +41 -0
- package/dist/runtime/components/AvatarGroup.vue.d.ts +14 -0
- package/dist/runtime/components/Badge.d.vue.ts +37 -0
- package/dist/runtime/components/Badge.vue +47 -0
- package/dist/runtime/components/Badge.vue.d.ts +37 -0
- package/dist/runtime/components/Breadcrumb.d.vue.ts +37 -0
- package/dist/runtime/components/Breadcrumb.vue +109 -0
- package/dist/runtime/components/Breadcrumb.vue.d.ts +37 -0
- package/dist/runtime/components/Button.d.vue.ts +45 -0
- package/dist/runtime/components/Button.vue +67 -0
- package/dist/runtime/components/Button.vue.d.ts +45 -0
- package/dist/runtime/components/ButtonGroup.d.vue.ts +22 -0
- package/dist/runtime/components/ButtonGroup.vue +21 -0
- package/dist/runtime/components/ButtonGroup.vue.d.ts +22 -0
- package/dist/runtime/components/Callout.d.vue.ts +27 -0
- package/dist/runtime/components/Callout.vue +47 -0
- package/dist/runtime/components/Callout.vue.d.ts +27 -0
- package/dist/runtime/components/Card.d.vue.ts +25 -0
- package/dist/runtime/components/Card.vue +30 -0
- package/dist/runtime/components/Card.vue.d.ts +25 -0
- package/dist/runtime/components/CardGroup.d.vue.ts +23 -0
- package/dist/runtime/components/CardGroup.vue +19 -0
- package/dist/runtime/components/CardGroup.vue.d.ts +23 -0
- package/dist/runtime/components/Checkbox.d.vue.ts +45 -0
- package/dist/runtime/components/Checkbox.vue +76 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +45 -0
- package/dist/runtime/components/Chip.d.vue.ts +50 -0
- package/dist/runtime/components/Chip.vue +75 -0
- package/dist/runtime/components/Chip.vue.d.ts +50 -0
- package/dist/runtime/components/CodeButton.d.vue.ts +21 -0
- package/dist/runtime/components/CodeButton.vue +33 -0
- package/dist/runtime/components/CodeButton.vue.d.ts +21 -0
- package/dist/runtime/components/CodeGroup.d.vue.ts +3 -0
- package/dist/runtime/components/CodeGroup.vue +46 -0
- package/dist/runtime/components/CodeGroup.vue.d.ts +3 -0
- package/dist/runtime/components/CodeTree.d.vue.ts +17 -0
- package/dist/runtime/components/CodeTree.vue +56 -0
- package/dist/runtime/components/CodeTree.vue.d.ts +17 -0
- package/dist/runtime/components/Collapsible.d.vue.ts +44 -0
- package/dist/runtime/components/Collapsible.vue +52 -0
- package/dist/runtime/components/Collapsible.vue.d.ts +44 -0
- package/dist/runtime/components/ColorModeToggle.d.vue.ts +3 -0
- package/dist/runtime/components/ColorModeToggle.vue +24 -0
- package/dist/runtime/components/ColorModeToggle.vue.d.ts +3 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +30 -0
- package/dist/runtime/components/ColorPicker.vue +112 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +30 -0
- package/dist/runtime/components/Column.d.ts +72 -0
- package/dist/runtime/components/Column.js +34 -0
- package/dist/runtime/components/ColumnGroup.d.ts +33 -0
- package/dist/runtime/components/ColumnGroup.js +17 -0
- package/dist/runtime/components/CommandPalette.d.vue.ts +41 -0
- package/dist/runtime/components/CommandPalette.vue +208 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +41 -0
- package/dist/runtime/components/Container.d.vue.ts +22 -0
- package/dist/runtime/components/Container.vue +21 -0
- package/dist/runtime/components/Container.vue.d.ts +22 -0
- package/dist/runtime/components/ContentNavigation.d.vue.ts +31 -0
- package/dist/runtime/components/ContentNavigation.vue +64 -0
- package/dist/runtime/components/ContentNavigation.vue.d.ts +31 -0
- package/dist/runtime/components/ContentSurround.d.vue.ts +16 -0
- package/dist/runtime/components/ContentSurround.vue +46 -0
- package/dist/runtime/components/ContentSurround.vue.d.ts +16 -0
- package/dist/runtime/components/ContentToc.d.vue.ts +35 -0
- package/dist/runtime/components/ContentToc.vue +265 -0
- package/dist/runtime/components/ContentToc.vue.d.ts +35 -0
- package/dist/runtime/components/ContextMenu.d.vue.ts +33 -0
- package/dist/runtime/components/ContextMenu.vue +49 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +33 -0
- package/dist/runtime/components/DashboardGroup.d.vue.ts +24 -0
- package/dist/runtime/components/DashboardGroup.vue +52 -0
- package/dist/runtime/components/DashboardGroup.vue.d.ts +24 -0
- package/dist/runtime/components/DashboardNavbar.d.vue.ts +23 -0
- package/dist/runtime/components/DashboardNavbar.vue +33 -0
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +23 -0
- package/dist/runtime/components/DashboardPanel.d.vue.ts +22 -0
- package/dist/runtime/components/DashboardPanel.vue +26 -0
- package/dist/runtime/components/DashboardPanel.vue.d.ts +22 -0
- package/dist/runtime/components/DashboardResizeHandle.d.vue.ts +8 -0
- package/dist/runtime/components/DashboardResizeHandle.vue +19 -0
- package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +8 -0
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +40 -0
- package/dist/runtime/components/DashboardSidebar.vue +117 -0
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +40 -0
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +21 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue +42 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +21 -0
- package/dist/runtime/components/DatePicker.d.vue.ts +165 -0
- package/dist/runtime/components/DatePicker.vue +796 -0
- package/dist/runtime/components/DatePicker.vue.d.ts +165 -0
- package/dist/runtime/components/Drawer.d.vue.ts +74 -0
- package/dist/runtime/components/Drawer.vue +157 -0
- package/dist/runtime/components/Drawer.vue.d.ts +74 -0
- package/dist/runtime/components/DrawerRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/DrawerRenderer.vue +30 -0
- package/dist/runtime/components/DrawerRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/Dropdown.d.vue.ts +35 -0
- package/dist/runtime/components/Dropdown.vue +51 -0
- package/dist/runtime/components/Dropdown.vue.d.ts +35 -0
- package/dist/runtime/components/FileTree.d.vue.ts +28 -0
- package/dist/runtime/components/FileTree.vue +68 -0
- package/dist/runtime/components/FileTree.vue.d.ts +28 -0
- package/dist/runtime/components/FileUpload.d.vue.ts +68 -0
- package/dist/runtime/components/FileUpload.vue +226 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +68 -0
- package/dist/runtime/components/FormField.d.vue.ts +37 -0
- package/dist/runtime/components/FormField.vue +72 -0
- package/dist/runtime/components/FormField.vue.d.ts +37 -0
- package/dist/runtime/components/Header.d.vue.ts +20 -0
- package/dist/runtime/components/Header.vue +23 -0
- package/dist/runtime/components/Header.vue.d.ts +20 -0
- package/dist/runtime/components/Icon.d.vue.ts +14 -0
- package/dist/runtime/components/Icon.vue +18 -0
- package/dist/runtime/components/Icon.vue.d.ts +14 -0
- package/dist/runtime/components/Input.d.vue.ts +41 -0
- package/dist/runtime/components/Input.vue +86 -0
- package/dist/runtime/components/Input.vue.d.ts +41 -0
- package/dist/runtime/components/InputGroup.d.vue.ts +22 -0
- package/dist/runtime/components/InputGroup.vue +21 -0
- package/dist/runtime/components/InputGroup.vue.d.ts +22 -0
- package/dist/runtime/components/InputNumber.d.vue.ts +37 -0
- package/dist/runtime/components/InputNumber.vue +173 -0
- package/dist/runtime/components/InputNumber.vue.d.ts +37 -0
- package/dist/runtime/components/Kbd.d.vue.ts +24 -0
- package/dist/runtime/components/Kbd.vue +42 -0
- package/dist/runtime/components/Kbd.vue.d.ts +24 -0
- package/dist/runtime/components/Modal.d.vue.ts +72 -0
- package/dist/runtime/components/Modal.vue +178 -0
- package/dist/runtime/components/Modal.vue.d.ts +72 -0
- package/dist/runtime/components/ModalRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/ModalRenderer.vue +25 -0
- package/dist/runtime/components/ModalRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/NavigationMenu.d.vue.ts +108 -0
- package/dist/runtime/components/NavigationMenu.vue +166 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +108 -0
- package/dist/runtime/components/NavigationMenuAccordionItem.d.vue.ts +23 -0
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +106 -0
- package/dist/runtime/components/NavigationMenuAccordionItem.vue.d.ts +23 -0
- package/dist/runtime/components/NavigationMenuFlyoutList.d.vue.ts +19 -0
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +44 -0
- package/dist/runtime/components/NavigationMenuFlyoutList.vue.d.ts +19 -0
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.d.vue.ts +49 -0
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue +116 -0
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue.d.ts +49 -0
- package/dist/runtime/components/PageAside.d.vue.ts +20 -0
- package/dist/runtime/components/PageAside.vue +26 -0
- package/dist/runtime/components/PageAside.vue.d.ts +20 -0
- package/dist/runtime/components/PageHeader.d.vue.ts +24 -0
- package/dist/runtime/components/PageHeader.vue +30 -0
- package/dist/runtime/components/PageHeader.vue.d.ts +24 -0
- package/dist/runtime/components/Pagination.d.vue.ts +42 -0
- package/dist/runtime/components/Pagination.vue +113 -0
- package/dist/runtime/components/Pagination.vue.d.ts +42 -0
- package/dist/runtime/components/PinInput.d.vue.ts +40 -0
- package/dist/runtime/components/PinInput.vue +66 -0
- package/dist/runtime/components/PinInput.vue.d.ts +40 -0
- package/dist/runtime/components/Popover.d.vue.ts +52 -0
- package/dist/runtime/components/Popover.vue +77 -0
- package/dist/runtime/components/Popover.vue.d.ts +52 -0
- package/dist/runtime/components/Progress.d.vue.ts +32 -0
- package/dist/runtime/components/Progress.vue +76 -0
- package/dist/runtime/components/Progress.vue.d.ts +32 -0
- package/dist/runtime/components/ProseH1.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH1.vue +21 -0
- package/dist/runtime/components/ProseH1.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH2.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH2.vue +21 -0
- package/dist/runtime/components/ProseH2.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH3.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH3.vue +21 -0
- package/dist/runtime/components/ProseH3.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH4.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH4.vue +21 -0
- package/dist/runtime/components/ProseH4.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH5.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH5.vue +21 -0
- package/dist/runtime/components/ProseH5.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH6.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH6.vue +21 -0
- package/dist/runtime/components/ProseH6.vue.d.ts +18 -0
- package/dist/runtime/components/ProsePre.d.vue.ts +20 -0
- package/dist/runtime/components/ProsePre.vue +50 -0
- package/dist/runtime/components/ProsePre.vue.d.ts +20 -0
- package/dist/runtime/components/RadioGroup.d.vue.ts +50 -0
- package/dist/runtime/components/RadioGroup.vue +82 -0
- package/dist/runtime/components/RadioGroup.vue.d.ts +50 -0
- package/dist/runtime/components/Rating.d.vue.ts +36 -0
- package/dist/runtime/components/Rating.vue +83 -0
- package/dist/runtime/components/Rating.vue.d.ts +36 -0
- package/dist/runtime/components/ReadMore.d.vue.ts +20 -0
- package/dist/runtime/components/ReadMore.vue +59 -0
- package/dist/runtime/components/ReadMore.vue.d.ts +20 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +19 -0
- package/dist/runtime/components/ScrollArea.vue +37 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +19 -0
- package/dist/runtime/components/Select.d.vue.ts +60 -0
- package/dist/runtime/components/Select.vue +40 -0
- package/dist/runtime/components/Select.vue.d.ts +60 -0
- package/dist/runtime/components/Separator.d.vue.ts +27 -0
- package/dist/runtime/components/Separator.vue +36 -0
- package/dist/runtime/components/Separator.vue.d.ts +27 -0
- package/dist/runtime/components/Skeleton.d.vue.ts +13 -0
- package/dist/runtime/components/Skeleton.vue +17 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +13 -0
- package/dist/runtime/components/Slideover.d.vue.ts +65 -0
- package/dist/runtime/components/Slideover.vue +140 -0
- package/dist/runtime/components/Slideover.vue.d.ts +65 -0
- package/dist/runtime/components/SlideoverRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/SlideoverRenderer.vue +27 -0
- package/dist/runtime/components/SlideoverRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/Slider.d.vue.ts +60 -0
- package/dist/runtime/components/Slider.vue +186 -0
- package/dist/runtime/components/Slider.vue.d.ts +60 -0
- package/dist/runtime/components/Splitter.d.vue.ts +41 -0
- package/dist/runtime/components/Splitter.vue +31 -0
- package/dist/runtime/components/Splitter.vue.d.ts +41 -0
- package/dist/runtime/components/SplitterPanel.d.vue.ts +55 -0
- package/dist/runtime/components/SplitterPanel.vue +52 -0
- package/dist/runtime/components/SplitterPanel.vue.d.ts +55 -0
- package/dist/runtime/components/SplitterResizeHandle.d.vue.ts +14 -0
- package/dist/runtime/components/SplitterResizeHandle.vue +22 -0
- package/dist/runtime/components/SplitterResizeHandle.vue.d.ts +14 -0
- package/dist/runtime/components/Stepper.d.vue.ts +57 -0
- package/dist/runtime/components/Stepper.vue +101 -0
- package/dist/runtime/components/Stepper.vue.d.ts +57 -0
- package/dist/runtime/components/Switch.d.vue.ts +49 -0
- package/dist/runtime/components/Switch.vue +73 -0
- package/dist/runtime/components/Switch.vue.d.ts +49 -0
- package/dist/runtime/components/Table.d.vue.ts +83 -0
- package/dist/runtime/components/Table.vue +339 -0
- package/dist/runtime/components/Table.vue.d.ts +83 -0
- package/dist/runtime/components/Tabs.d.vue.ts +43 -0
- package/dist/runtime/components/Tabs.vue +60 -0
- package/dist/runtime/components/Tabs.vue.d.ts +43 -0
- package/dist/runtime/components/Textarea.d.vue.ts +45 -0
- package/dist/runtime/components/Textarea.vue +110 -0
- package/dist/runtime/components/Textarea.vue.d.ts +45 -0
- package/dist/runtime/components/Theme.d.vue.ts +19 -0
- package/dist/runtime/components/Theme.vue +18 -0
- package/dist/runtime/components/Theme.vue.d.ts +19 -0
- package/dist/runtime/components/Toast.d.vue.ts +8 -0
- package/dist/runtime/components/Toast.vue +58 -0
- package/dist/runtime/components/Toast.vue.d.ts +8 -0
- package/dist/runtime/components/Toggle.d.vue.ts +38 -0
- package/dist/runtime/components/Toggle.vue +44 -0
- package/dist/runtime/components/Toggle.vue.d.ts +38 -0
- package/dist/runtime/components/ToggleGroup.d.vue.ts +48 -0
- package/dist/runtime/components/ToggleGroup.vue +61 -0
- package/dist/runtime/components/ToggleGroup.vue.d.ts +48 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +28 -0
- package/dist/runtime/components/Tooltip.vue +40 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +28 -0
- package/dist/runtime/components/Tree.d.vue.ts +64 -0
- package/dist/runtime/components/Tree.vue +139 -0
- package/dist/runtime/components/Tree.vue.d.ts +64 -0
- package/dist/runtime/composables/use-combobox-select.d.ts +45 -0
- package/dist/runtime/composables/use-combobox-select.js +80 -0
- package/dist/runtime/composables/use-command-palette.d.ts +8 -0
- package/dist/runtime/composables/use-command-palette.js +14 -0
- package/dist/runtime/composables/use-drawer.d.ts +42 -0
- package/dist/runtime/composables/use-drawer.js +44 -0
- package/dist/runtime/composables/use-form-field.d.ts +10 -0
- package/dist/runtime/composables/use-form-field.js +8 -0
- package/dist/runtime/composables/use-icons.d.ts +10 -0
- package/dist/runtime/composables/use-icons.js +7 -0
- package/dist/runtime/composables/use-locale.d.ts +12 -0
- package/dist/runtime/composables/use-locale.js +6 -0
- package/dist/runtime/composables/use-media-query.d.ts +11 -0
- package/dist/runtime/composables/use-media-query.js +15 -0
- package/dist/runtime/composables/use-messages.d.ts +12 -0
- package/dist/runtime/composables/use-messages.js +7 -0
- package/dist/runtime/composables/use-modal.d.ts +32 -0
- package/dist/runtime/composables/use-modal.js +39 -0
- package/dist/runtime/composables/use-ripple.d.ts +15 -0
- package/dist/runtime/composables/use-ripple.js +6 -0
- package/dist/runtime/composables/use-slideover.d.ts +36 -0
- package/dist/runtime/composables/use-slideover.js +41 -0
- package/dist/runtime/composables/use-table.d.ts +63 -0
- package/dist/runtime/composables/use-table.js +142 -0
- package/dist/runtime/composables/use-toast.d.ts +15 -0
- package/dist/runtime/composables/use-toast.js +16 -0
- package/dist/runtime/directives/index.d.ts +1 -0
- package/dist/runtime/directives/index.js +1 -0
- package/dist/runtime/directives/ripple.d.ts +16 -0
- package/dist/runtime/directives/ripple.js +80 -0
- package/dist/runtime/internal/ColorPickerBody.d.vue.ts +26 -0
- package/dist/runtime/internal/ColorPickerBody.vue +111 -0
- package/dist/runtime/internal/ColorPickerBody.vue.d.ts +26 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +122 -0
- package/dist/runtime/internal/ComboboxSelectBase.vue +590 -0
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +122 -0
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +71 -0
- package/dist/runtime/internal/ComboboxSelectBody.vue +146 -0
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +71 -0
- package/dist/runtime/internal/DatePickerCalendarBody.d.vue.ts +71 -0
- package/dist/runtime/internal/DatePickerCalendarBody.vue +215 -0
- package/dist/runtime/internal/DatePickerCalendarBody.vue.d.ts +71 -0
- package/dist/runtime/internal/DatePickerRangeCalendarBody.d.vue.ts +37 -0
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +96 -0
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue.d.ts +37 -0
- package/dist/runtime/internal/DatePickerTimeBody.d.vue.ts +33 -0
- package/dist/runtime/internal/DatePickerTimeBody.vue +53 -0
- package/dist/runtime/internal/DatePickerTimeBody.vue.d.ts +33 -0
- package/dist/runtime/internal/TimeStepper.d.vue.ts +28 -0
- package/dist/runtime/internal/TimeStepper.vue +99 -0
- package/dist/runtime/internal/TimeStepper.vue.d.ts +28 -0
- package/dist/runtime/prose.css +1 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/theme/accordion.d.ts +131 -0
- package/dist/runtime/theme/accordion.js +60 -0
- package/dist/runtime/theme/alert-dialog.d.ts +50 -0
- package/dist/runtime/theme/alert-dialog.js +30 -0
- package/dist/runtime/theme/alert.d.ts +62 -0
- package/dist/runtime/theme/alert.js +52 -0
- package/dist/runtime/theme/avatar-group.d.ts +59 -0
- package/dist/runtime/theme/avatar-group.js +18 -0
- package/dist/runtime/theme/avatar.d.ts +206 -0
- package/dist/runtime/theme/avatar.js +67 -0
- package/dist/runtime/theme/badge.d.ts +140 -0
- package/dist/runtime/theme/badge.js +90 -0
- package/dist/runtime/theme/breadcrumb.d.ts +86 -0
- package/dist/runtime/theme/breadcrumb.js +22 -0
- package/dist/runtime/theme/button-group.d.ts +53 -0
- package/dist/runtime/theme/button-group.js +21 -0
- package/dist/runtime/theme/button.d.ts +155 -0
- package/dist/runtime/theme/button.js +99 -0
- package/dist/runtime/theme/callout.d.ts +74 -0
- package/dist/runtime/theme/callout.js +23 -0
- package/dist/runtime/theme/card-group.d.ts +44 -0
- package/dist/runtime/theme/card-group.js +19 -0
- package/dist/runtime/theme/card.d.ts +62 -0
- package/dist/runtime/theme/card.js +23 -0
- package/dist/runtime/theme/checkbox.d.ts +218 -0
- package/dist/runtime/theme/checkbox.js +113 -0
- package/dist/runtime/theme/chip.d.ts +155 -0
- package/dist/runtime/theme/chip.js +86 -0
- package/dist/runtime/theme/code-button.d.ts +32 -0
- package/dist/runtime/theme/code-button.js +7 -0
- package/dist/runtime/theme/code-tree.d.ts +50 -0
- package/dist/runtime/theme/code-tree.js +13 -0
- package/dist/runtime/theme/collapsible.d.ts +95 -0
- package/dist/runtime/theme/collapsible.js +46 -0
- package/dist/runtime/theme/color-picker.d.ts +152 -0
- package/dist/runtime/theme/color-picker.js +83 -0
- package/dist/runtime/theme/command-palette.d.ts +110 -0
- package/dist/runtime/theme/command-palette.js +23 -0
- package/dist/runtime/theme/container.d.ts +62 -0
- package/dist/runtime/theme/container.js +18 -0
- package/dist/runtime/theme/content-navigation.d.ts +47 -0
- package/dist/runtime/theme/content-navigation.js +38 -0
- package/dist/runtime/theme/content-surround.d.ts +53 -0
- package/dist/runtime/theme/content-surround.js +22 -0
- package/dist/runtime/theme/content-toc.d.ts +56 -0
- package/dist/runtime/theme/content-toc.js +41 -0
- package/dist/runtime/theme/context-menu.d.ts +38 -0
- package/dist/runtime/theme/context-menu.js +21 -0
- package/dist/runtime/theme/dashboard-group.d.ts +26 -0
- package/dist/runtime/theme/dashboard-group.js +9 -0
- package/dist/runtime/theme/dashboard-navbar.d.ts +44 -0
- package/dist/runtime/theme/dashboard-navbar.js +9 -0
- package/dist/runtime/theme/dashboard-panel.d.ts +26 -0
- package/dist/runtime/theme/dashboard-panel.js +6 -0
- package/dist/runtime/theme/dashboard-resize-handle.d.ts +26 -0
- package/dist/runtime/theme/dashboard-resize-handle.js +17 -0
- package/dist/runtime/theme/dashboard-sidebar.d.ts +50 -0
- package/dist/runtime/theme/dashboard-sidebar.js +40 -0
- package/dist/runtime/theme/date-picker.d.ts +119 -0
- package/dist/runtime/theme/date-picker.js +75 -0
- package/dist/runtime/theme/drawer.d.ts +95 -0
- package/dist/runtime/theme/drawer.js +57 -0
- package/dist/runtime/theme/dropdown.d.ts +41 -0
- package/dist/runtime/theme/dropdown.js +21 -0
- package/dist/runtime/theme/file-tree.d.ts +56 -0
- package/dist/runtime/theme/file-tree.js +33 -0
- package/dist/runtime/theme/file-upload.d.ts +233 -0
- package/dist/runtime/theme/file-upload.js +63 -0
- package/dist/runtime/theme/form-field.d.ts +95 -0
- package/dist/runtime/theme/form-field.js +37 -0
- package/dist/runtime/theme/header.d.ts +38 -0
- package/dist/runtime/theme/header.js +8 -0
- package/dist/runtime/theme/icon.d.ts +80 -0
- package/dist/runtime/theme/icon.js +26 -0
- package/dist/runtime/theme/input-group.d.ts +95 -0
- package/dist/runtime/theme/input-group.js +39 -0
- package/dist/runtime/theme/input-number.d.ts +164 -0
- package/dist/runtime/theme/input-number.js +76 -0
- package/dist/runtime/theme/input.d.ts +185 -0
- package/dist/runtime/theme/input.js +72 -0
- package/dist/runtime/theme/kbd.d.ts +44 -0
- package/dist/runtime/theme/kbd.js +16 -0
- package/dist/runtime/theme/modal.d.ts +74 -0
- package/dist/runtime/theme/modal.js +58 -0
- package/dist/runtime/theme/navigation-menu.d.ts +224 -0
- package/dist/runtime/theme/navigation-menu.js +232 -0
- package/dist/runtime/theme/page-aside.d.ts +44 -0
- package/dist/runtime/theme/page-aside.js +17 -0
- package/dist/runtime/theme/page-header.d.ts +38 -0
- package/dist/runtime/theme/page-header.js +8 -0
- package/dist/runtime/theme/pagination.d.ts +68 -0
- package/dist/runtime/theme/pagination.js +21 -0
- package/dist/runtime/theme/pin-input.d.ts +131 -0
- package/dist/runtime/theme/pin-input.js +40 -0
- package/dist/runtime/theme/popover.d.ts +32 -0
- package/dist/runtime/theme/popover.js +7 -0
- package/dist/runtime/theme/progress.d.ts +185 -0
- package/dist/runtime/theme/progress.js +54 -0
- package/dist/runtime/theme/prose.d.ts +92 -0
- package/dist/runtime/theme/prose.js +17 -0
- package/dist/runtime/theme/radio-group.d.ts +239 -0
- package/dist/runtime/theme/radio-group.js +134 -0
- package/dist/runtime/theme/rating.d.ts +167 -0
- package/dist/runtime/theme/rating.js +77 -0
- package/dist/runtime/theme/read-more.d.ts +38 -0
- package/dist/runtime/theme/read-more.js +21 -0
- package/dist/runtime/theme/scroll-area.d.ts +50 -0
- package/dist/runtime/theme/scroll-area.js +10 -0
- package/dist/runtime/theme/select.d.ts +176 -0
- package/dist/runtime/theme/select.js +74 -0
- package/dist/runtime/theme/separator.d.ts +158 -0
- package/dist/runtime/theme/separator.js +63 -0
- package/dist/runtime/theme/skeleton.d.ts +35 -0
- package/dist/runtime/theme/skeleton.js +27 -0
- package/dist/runtime/theme/slideover.d.ts +107 -0
- package/dist/runtime/theme/slideover.js +62 -0
- package/dist/runtime/theme/slider.d.ts +227 -0
- package/dist/runtime/theme/slider.js +73 -0
- package/dist/runtime/theme/splitter-panel.d.ts +26 -0
- package/dist/runtime/theme/splitter-panel.js +9 -0
- package/dist/runtime/theme/splitter-resize-handle.d.ts +44 -0
- package/dist/runtime/theme/splitter-resize-handle.js +18 -0
- package/dist/runtime/theme/splitter.d.ts +35 -0
- package/dist/runtime/theme/splitter.js +15 -0
- package/dist/runtime/theme/stepper.d.ts +221 -0
- package/dist/runtime/theme/stepper.js +106 -0
- package/dist/runtime/theme/switch.d.ts +206 -0
- package/dist/runtime/theme/switch.js +84 -0
- package/dist/runtime/theme/table.d.ts +176 -0
- package/dist/runtime/theme/table.js +59 -0
- package/dist/runtime/theme/tabs.d.ts +59 -0
- package/dist/runtime/theme/tabs.js +44 -0
- package/dist/runtime/theme/textarea.d.ts +212 -0
- package/dist/runtime/theme/textarea.js +56 -0
- package/dist/runtime/theme/toast.d.ts +80 -0
- package/dist/runtime/theme/toast.js +31 -0
- package/dist/runtime/theme/toggle-group.d.ts +110 -0
- package/dist/runtime/theme/toggle-group.js +48 -0
- package/dist/runtime/theme/toggle.d.ts +92 -0
- package/dist/runtime/theme/toggle.js +48 -0
- package/dist/runtime/theme/tooltip.d.ts +44 -0
- package/dist/runtime/theme/tooltip.js +14 -0
- package/dist/runtime/theme/tree.d.ts +80 -0
- package/dist/runtime/theme/tree.js +32 -0
- package/dist/runtime/theme.css +1 -0
- package/dist/runtime/types/app-config.d.ts +15 -0
- package/dist/runtime/types/index.d.ts +82 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/utils/format-bytes.d.ts +2 -0
- package/dist/runtime/utils/format-bytes.js +9 -0
- package/dist/runtime/utils/fuzzy-match.d.ts +12 -0
- package/dist/runtime/utils/fuzzy-match.js +21 -0
- package/dist/runtime/utils/icons.d.ts +38 -0
- package/dist/runtime/utils/icons.js +51 -0
- package/dist/runtime/utils/injection-keys.d.ts +69 -0
- package/dist/runtime/utils/injection-keys.js +3 -0
- package/dist/runtime/utils/messages.d.ts +70 -0
- package/dist/runtime/utils/messages.js +68 -0
- package/dist/runtime/utils/navigation-menu.d.ts +32 -0
- package/dist/runtime/utils/navigation-menu.js +5 -0
- package/dist/runtime/utils/table-columns.d.ts +30 -0
- package/dist/runtime/utils/table-columns.js +89 -0
- package/dist/runtime/utils/table-export.d.ts +12 -0
- package/dist/runtime/utils/table-export.js +29 -0
- package/dist/runtime/utils/ui.d.ts +124 -0
- package/dist/runtime/utils/ui.js +74 -0
- package/dist/types.d.mts +3 -0
- package/package.json +99 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { DateFormatter, endOfMonth, endOfYear, getLocalTimeZone, startOfMonth, startOfYear, Time, toCalendarDateTime, today } from "@internationalized/date";
|
|
3
|
+
import {
|
|
4
|
+
DatePickerAnchor,
|
|
5
|
+
DatePickerArrow,
|
|
6
|
+
DatePickerContent,
|
|
7
|
+
DatePickerField,
|
|
8
|
+
DatePickerInput,
|
|
9
|
+
DatePickerRoot,
|
|
10
|
+
DatePickerTrigger,
|
|
11
|
+
DateRangePickerAnchor,
|
|
12
|
+
DateRangePickerArrow,
|
|
13
|
+
DateRangePickerContent,
|
|
14
|
+
DateRangePickerField,
|
|
15
|
+
DateRangePickerInput,
|
|
16
|
+
DateRangePickerRoot,
|
|
17
|
+
DateRangePickerTrigger,
|
|
18
|
+
PopoverAnchor,
|
|
19
|
+
PopoverArrow,
|
|
20
|
+
PopoverContent,
|
|
21
|
+
PopoverPortal,
|
|
22
|
+
PopoverRoot,
|
|
23
|
+
PopoverTrigger,
|
|
24
|
+
TimeFieldInput,
|
|
25
|
+
TimeFieldRoot
|
|
26
|
+
} from "reka-ui";
|
|
27
|
+
import { computed, ref, shallowRef, useId, watch } from "vue";
|
|
28
|
+
import { useFormField } from "../composables/use-form-field";
|
|
29
|
+
import { useIcons } from "../composables/use-icons";
|
|
30
|
+
import { useLocale } from "../composables/use-locale";
|
|
31
|
+
import { useIsMobile } from "../composables/use-media-query";
|
|
32
|
+
import { useMessages } from "../composables/use-messages";
|
|
33
|
+
import DatePickerCalendarBody from "../internal/DatePickerCalendarBody.vue";
|
|
34
|
+
import DatePickerRangeCalendarBody from "../internal/DatePickerRangeCalendarBody.vue";
|
|
35
|
+
import DatePickerTimeBody from "../internal/DatePickerTimeBody.vue";
|
|
36
|
+
import { datePickerTheme } from "../theme/date-picker";
|
|
37
|
+
import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
38
|
+
import Button from "./Button.vue";
|
|
39
|
+
import Icon from "./Icon.vue";
|
|
40
|
+
import Modal from "./Modal.vue";
|
|
41
|
+
defineOptions({ inheritAttrs: false });
|
|
42
|
+
const props = defineProps({
|
|
43
|
+
id: { type: String, required: false },
|
|
44
|
+
name: { type: String, required: false },
|
|
45
|
+
modelValue: { type: Object, required: false },
|
|
46
|
+
range: { type: Boolean, required: false },
|
|
47
|
+
timeOnly: { type: Boolean, required: false },
|
|
48
|
+
minValue: { type: Object, required: false },
|
|
49
|
+
maxValue: { type: Object, required: false },
|
|
50
|
+
isDateUnavailable: { type: Function, required: false },
|
|
51
|
+
isDateDisabled: { type: Function, required: false },
|
|
52
|
+
isDateHighlightable: { type: Function, required: false },
|
|
53
|
+
locale: { type: String, required: false },
|
|
54
|
+
numberOfMonths: { type: Number, required: false },
|
|
55
|
+
pagedNavigation: { type: Boolean, required: false },
|
|
56
|
+
weekStartsOn: { type: Number, required: false },
|
|
57
|
+
weekdayFormat: { type: String, required: false },
|
|
58
|
+
fixedWeeks: { type: Boolean, required: false },
|
|
59
|
+
closeOnSelect: { type: Boolean, required: false, default: true },
|
|
60
|
+
triggerMode: { type: String, required: false, default: "field" },
|
|
61
|
+
view: { type: String, required: false },
|
|
62
|
+
granularity: { type: String, required: false, default: "day" },
|
|
63
|
+
minuteStep: { type: Number, required: false, default: 1 },
|
|
64
|
+
hourCycle: { type: Number, required: false },
|
|
65
|
+
format: { type: null, required: false },
|
|
66
|
+
allowNonContiguousRanges: { type: Boolean, required: false },
|
|
67
|
+
fixedDate: { type: String, required: false },
|
|
68
|
+
maximumDays: { type: Number, required: false },
|
|
69
|
+
disabled: { type: Boolean, required: false },
|
|
70
|
+
readonly: { type: Boolean, required: false },
|
|
71
|
+
preventDeselect: { type: Boolean, required: false },
|
|
72
|
+
isMonthDisabled: { type: Function, required: false },
|
|
73
|
+
isYearDisabled: { type: Function, required: false },
|
|
74
|
+
invalid: { type: Boolean, required: false },
|
|
75
|
+
clearable: { type: Boolean, required: false },
|
|
76
|
+
color: { type: null, required: false, default: "neutral" },
|
|
77
|
+
activeColor: { type: null, required: false, default: "primary" },
|
|
78
|
+
size: { type: null, required: false },
|
|
79
|
+
arrow: { type: Boolean, required: false, default: false },
|
|
80
|
+
mobileModal: { type: Boolean, required: false },
|
|
81
|
+
ui: { type: Object, required: false }
|
|
82
|
+
});
|
|
83
|
+
const emit = defineEmits(["update:modelValue", "update:view"]);
|
|
84
|
+
const field = useFormField();
|
|
85
|
+
const datePickerId = computed(() => props.id ?? field?.id);
|
|
86
|
+
const hourInputId = useId();
|
|
87
|
+
const minuteInputId = useId();
|
|
88
|
+
const datePickerInvalid = computed(() => props.invalid || (field?.invalid.value ?? false));
|
|
89
|
+
const describedBy = computed(() => field?.describedBy.value);
|
|
90
|
+
const effectiveSize = computed(() => props.size ?? field?.size ?? "md");
|
|
91
|
+
const iconButtonSize = computed(() => ({ sm: "sm", md: "sm", lg: "md" })[effectiveSize.value]);
|
|
92
|
+
const effectiveNumberOfMonths = computed(() => props.numberOfMonths ?? (props.range ? 2 : 1));
|
|
93
|
+
const singleModelValue = computed(() => props.range ? void 0 : props.modelValue);
|
|
94
|
+
const rangeModelValue = computed(() => props.range ? props.modelValue : void 0);
|
|
95
|
+
const hasValue = computed(() => props.range ? !!props.modelValue?.start : !!props.modelValue);
|
|
96
|
+
function clear() {
|
|
97
|
+
emit("update:modelValue", props.range ? { start: void 0, end: void 0 } : void 0);
|
|
98
|
+
}
|
|
99
|
+
const defaultView = computed(() => {
|
|
100
|
+
if (props.granularity === "month" || props.granularity === "year")
|
|
101
|
+
return props.granularity;
|
|
102
|
+
return "date";
|
|
103
|
+
});
|
|
104
|
+
const internalView = ref(props.view ?? defaultView.value);
|
|
105
|
+
watch(() => props.view, (value) => {
|
|
106
|
+
if (value !== void 0)
|
|
107
|
+
internalView.value = value;
|
|
108
|
+
});
|
|
109
|
+
function setView(value) {
|
|
110
|
+
internalView.value = value;
|
|
111
|
+
emit("update:view", value);
|
|
112
|
+
}
|
|
113
|
+
function drillUp() {
|
|
114
|
+
if (internalView.value === "date")
|
|
115
|
+
setView("month");
|
|
116
|
+
else if (internalView.value === "month")
|
|
117
|
+
setView("year");
|
|
118
|
+
}
|
|
119
|
+
const isTimeGranularity = computed(() => props.granularity === "hour" || props.granularity === "minute");
|
|
120
|
+
function ensureTimeCapable(value) {
|
|
121
|
+
return "hour" in value ? value : toCalendarDateTime(value);
|
|
122
|
+
}
|
|
123
|
+
function normalizeForGranularity(value) {
|
|
124
|
+
if (!value)
|
|
125
|
+
return value;
|
|
126
|
+
if (props.granularity === "year")
|
|
127
|
+
return value.set({ month: 1, day: 1 });
|
|
128
|
+
if (props.granularity === "month")
|
|
129
|
+
return value.set({ day: 1 });
|
|
130
|
+
if (isTimeGranularity.value) {
|
|
131
|
+
const timeCapable = ensureTimeCapable(value);
|
|
132
|
+
return timeCapable.set(props.granularity === "hour" ? { minute: 0, second: 0, millisecond: 0 } : { second: 0, millisecond: 0 });
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
136
|
+
const placeholder = shallowRef((() => {
|
|
137
|
+
const seed = singleModelValue.value ?? today(getLocalTimeZone());
|
|
138
|
+
return isTimeGranularity.value ? ensureTimeCapable(seed) : seed;
|
|
139
|
+
})());
|
|
140
|
+
const isOpen = ref(false);
|
|
141
|
+
watch(isOpen, (open) => {
|
|
142
|
+
if (!open)
|
|
143
|
+
setView(defaultView.value);
|
|
144
|
+
});
|
|
145
|
+
const isRangeOpen = ref(false);
|
|
146
|
+
const isMobile = useIsMobile();
|
|
147
|
+
const showMobileModal = computed(() => props.mobileModal && isMobile.value);
|
|
148
|
+
const mobileModalUi = { content: "rounded-[var(--ui-radius-md)]" };
|
|
149
|
+
const effectiveLocale = computed(() => props.locale ?? useLocale().value);
|
|
150
|
+
const monthFormatter = computed(() => new DateFormatter(effectiveLocale.value, { month: "short" }));
|
|
151
|
+
const monthGridItems = computed(() => Array.from({ length: 12 }, (_, i) => {
|
|
152
|
+
const value = placeholder.value.set({ month: i + 1, day: 1 });
|
|
153
|
+
return { value, label: monthFormatter.value.format(value.toDate(getLocalTimeZone())) };
|
|
154
|
+
}));
|
|
155
|
+
const yearWindowStart = computed(() => Math.floor(placeholder.value.year / 12) * 12);
|
|
156
|
+
const yearGridItems = computed(() => Array.from({ length: 12 }, (_, i) => ({
|
|
157
|
+
value: yearWindowStart.value + i,
|
|
158
|
+
label: String(yearWindowStart.value + i)
|
|
159
|
+
})));
|
|
160
|
+
const decadeHeadingText = computed(() => `${yearWindowStart.value} \u2013 ${yearWindowStart.value + 11}`);
|
|
161
|
+
function isMonthDisabledByRange(date) {
|
|
162
|
+
if (!props.minValue && !props.maxValue)
|
|
163
|
+
return false;
|
|
164
|
+
if (props.maxValue && startOfMonth(date).compare(props.maxValue) > 0)
|
|
165
|
+
return true;
|
|
166
|
+
if (props.minValue && endOfMonth(date).compare(props.minValue) < 0)
|
|
167
|
+
return true;
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
function isYearDisabledByRange(year) {
|
|
171
|
+
if (!props.minValue && !props.maxValue)
|
|
172
|
+
return false;
|
|
173
|
+
const value = placeholder.value.set({ year });
|
|
174
|
+
if (props.maxValue && startOfYear(value).compare(props.maxValue) > 0)
|
|
175
|
+
return true;
|
|
176
|
+
if (props.minValue && endOfYear(value).compare(props.minValue) < 0)
|
|
177
|
+
return true;
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
function isMonthDisabled(date) {
|
|
181
|
+
return isMonthDisabledByRange(date) || (props.isMonthDisabled?.(date) ?? false);
|
|
182
|
+
}
|
|
183
|
+
function isYearDisabled(year) {
|
|
184
|
+
return isYearDisabledByRange(year) || (props.isYearDisabled?.(year) ?? false);
|
|
185
|
+
}
|
|
186
|
+
function selectMonth(date) {
|
|
187
|
+
placeholder.value = date;
|
|
188
|
+
if (props.granularity === "month") {
|
|
189
|
+
emit("update:modelValue", normalizeForGranularity(date));
|
|
190
|
+
if (props.closeOnSelect)
|
|
191
|
+
isOpen.value = false;
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
setView("date");
|
|
195
|
+
}
|
|
196
|
+
function selectYear(year) {
|
|
197
|
+
const value = placeholder.value.set({ year });
|
|
198
|
+
placeholder.value = value;
|
|
199
|
+
if (props.granularity === "year") {
|
|
200
|
+
emit("update:modelValue", normalizeForGranularity(value));
|
|
201
|
+
if (props.closeOnSelect)
|
|
202
|
+
isOpen.value = false;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
setView("month");
|
|
206
|
+
}
|
|
207
|
+
function goToPreviousYear() {
|
|
208
|
+
placeholder.value = placeholder.value.subtract({ years: 1 });
|
|
209
|
+
}
|
|
210
|
+
function goToNextYear() {
|
|
211
|
+
placeholder.value = placeholder.value.add({ years: 1 });
|
|
212
|
+
}
|
|
213
|
+
function goToPreviousDecade() {
|
|
214
|
+
placeholder.value = placeholder.value.subtract({ years: 12 });
|
|
215
|
+
}
|
|
216
|
+
function goToNextDecade() {
|
|
217
|
+
placeholder.value = placeholder.value.add({ years: 12 });
|
|
218
|
+
}
|
|
219
|
+
const placeholderHour = computed(() => "hour" in placeholder.value ? placeholder.value.hour : 0);
|
|
220
|
+
const placeholderMinute = computed(() => "minute" in placeholder.value ? placeholder.value.minute : 0);
|
|
221
|
+
function setHour(hour24) {
|
|
222
|
+
const value = ensureTimeCapable(placeholder.value).set({ hour: hour24 });
|
|
223
|
+
placeholder.value = value;
|
|
224
|
+
emit("update:modelValue", normalizeForGranularity(value));
|
|
225
|
+
}
|
|
226
|
+
function setMinute(minute) {
|
|
227
|
+
const value = ensureTimeCapable(placeholder.value).set({ minute });
|
|
228
|
+
placeholder.value = value;
|
|
229
|
+
emit("update:modelValue", normalizeForGranularity(value));
|
|
230
|
+
}
|
|
231
|
+
const timeOnlyGranularity = computed(() => props.granularity === "hour" ? "hour" : "minute");
|
|
232
|
+
const timeOnlyValue = computed(() => props.timeOnly ? props.modelValue : void 0);
|
|
233
|
+
const timePlaceholder = shallowRef(timeOnlyValue.value ?? (() => {
|
|
234
|
+
const now = /* @__PURE__ */ new Date();
|
|
235
|
+
return new Time(now.getHours(), now.getMinutes());
|
|
236
|
+
})());
|
|
237
|
+
const timeIsOpen = ref(false);
|
|
238
|
+
function normalizeTimeOnly(value) {
|
|
239
|
+
return timeOnlyGranularity.value === "hour" ? value.set({ minute: 0, second: 0, millisecond: 0 }) : value.set({ second: 0, millisecond: 0 });
|
|
240
|
+
}
|
|
241
|
+
function setTimeOnlyHour(hour24) {
|
|
242
|
+
const value = timePlaceholder.value.set({ hour: hour24 });
|
|
243
|
+
timePlaceholder.value = value;
|
|
244
|
+
emit("update:modelValue", normalizeTimeOnly(value));
|
|
245
|
+
}
|
|
246
|
+
function setTimeOnlyMinute(minute) {
|
|
247
|
+
const value = timePlaceholder.value.set({ minute });
|
|
248
|
+
timePlaceholder.value = value;
|
|
249
|
+
emit("update:modelValue", normalizeTimeOnly(value));
|
|
250
|
+
}
|
|
251
|
+
const timeOnlyFormatter = computed(() => new DateFormatter(effectiveLocale.value, props.format ?? (timeOnlyGranularity.value === "hour" ? { hour: "numeric" } : { timeStyle: "short" })));
|
|
252
|
+
const formattedTimeValue = computed(() => {
|
|
253
|
+
if (!timeOnlyValue.value)
|
|
254
|
+
return "";
|
|
255
|
+
const asDateTime = toCalendarDateTime(today(getLocalTimeZone()), timeOnlyValue.value);
|
|
256
|
+
return timeOnlyFormatter.value.format(asDateTime.toDate(getLocalTimeZone()));
|
|
257
|
+
});
|
|
258
|
+
function visibleSegments(segments) {
|
|
259
|
+
if (props.granularity === "day" || isTimeGranularity.value)
|
|
260
|
+
return segments;
|
|
261
|
+
const keptParts = props.granularity === "year" ? ["year"] : ["month", "year"];
|
|
262
|
+
const result = [];
|
|
263
|
+
for (const segment of segments) {
|
|
264
|
+
if (segment.part === "literal") {
|
|
265
|
+
if (result.length && result[result.length - 1].part !== "literal")
|
|
266
|
+
result.push(segment);
|
|
267
|
+
} else if (keptParts.includes(segment.part)) {
|
|
268
|
+
result.push(segment);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
while (result.length && result[result.length - 1].part === "literal")
|
|
272
|
+
result.pop();
|
|
273
|
+
return result;
|
|
274
|
+
}
|
|
275
|
+
const defaultFormat = computed(() => {
|
|
276
|
+
if (props.granularity === "year")
|
|
277
|
+
return { year: "numeric" };
|
|
278
|
+
if (props.granularity === "month")
|
|
279
|
+
return { month: "long", year: "numeric" };
|
|
280
|
+
if (props.granularity === "hour")
|
|
281
|
+
return { dateStyle: "medium", hour: "numeric" };
|
|
282
|
+
if (props.granularity === "minute")
|
|
283
|
+
return { dateStyle: "medium", timeStyle: "short" };
|
|
284
|
+
return { dateStyle: "medium" };
|
|
285
|
+
});
|
|
286
|
+
const dateFormatter = computed(() => new DateFormatter(effectiveLocale.value, props.format ?? defaultFormat.value));
|
|
287
|
+
const formattedValue = computed(() => {
|
|
288
|
+
if (props.range) {
|
|
289
|
+
const range = props.modelValue;
|
|
290
|
+
if (!range?.start)
|
|
291
|
+
return "";
|
|
292
|
+
const startDate = range.start.toDate(getLocalTimeZone());
|
|
293
|
+
return range.end ? dateFormatter.value.formatRange(startDate, range.end.toDate(getLocalTimeZone())) : dateFormatter.value.format(startDate);
|
|
294
|
+
}
|
|
295
|
+
const value = props.modelValue;
|
|
296
|
+
return value ? dateFormatter.value.format(value.toDate(getLocalTimeZone())) : "";
|
|
297
|
+
});
|
|
298
|
+
const icons = useIcons();
|
|
299
|
+
const messages = useMessages();
|
|
300
|
+
const theme = useComponentTheme("datePicker", datePickerTheme);
|
|
301
|
+
const ui = computed(() => theme.value({ size: effectiveSize.value, invalid: datePickerInvalid.value, range: props.range }));
|
|
302
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
303
|
+
const fieldProps = computed(() => resolveSlot(ui.value.field, props.ui?.field));
|
|
304
|
+
const segmentProps = computed(() => resolveSlot(ui.value.segment, props.ui?.segment));
|
|
305
|
+
const separatorProps = computed(() => resolveSlot(ui.value.separator, props.ui?.separator));
|
|
306
|
+
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
307
|
+
const arrowProps = computed(() => resolveSlot(ui.value.arrow, props.ui?.arrow));
|
|
308
|
+
const headerProps = computed(() => resolveSlot(ui.value.header, props.ui?.header));
|
|
309
|
+
const headingProps = computed(() => resolveSlot(ui.value.heading, props.ui?.heading));
|
|
310
|
+
const gridsProps = computed(() => resolveSlot(ui.value.grids, props.ui?.grids));
|
|
311
|
+
const gridProps = computed(() => resolveSlot(ui.value.grid, props.ui?.grid));
|
|
312
|
+
const gridHeadProps = computed(() => resolveSlot(ui.value.gridHead, props.ui?.gridHead));
|
|
313
|
+
const headCellProps = computed(() => resolveSlot(ui.value.headCell, props.ui?.headCell));
|
|
314
|
+
const cellProps = computed(() => resolveSlot(ui.value.cell, props.ui?.cell));
|
|
315
|
+
const viewGridProps = computed(() => resolveSlot(ui.value.viewGrid, props.ui?.viewGrid));
|
|
316
|
+
const timeSectionProps = computed(() => resolveSlot(ui.value.timeSection, props.ui?.timeSection));
|
|
317
|
+
const mobileContentProps = computed(() => resolveSlot(ui.value.mobileContent, props.ui?.mobileContent));
|
|
318
|
+
const rangeBodyProps = computed(() => ({
|
|
319
|
+
color: props.color,
|
|
320
|
+
activeColor: props.activeColor,
|
|
321
|
+
headerProps: headerProps.value,
|
|
322
|
+
headingProps: headingProps.value,
|
|
323
|
+
gridsProps: gridsProps.value,
|
|
324
|
+
gridProps: gridProps.value,
|
|
325
|
+
gridHeadProps: gridHeadProps.value,
|
|
326
|
+
headCellProps: headCellProps.value,
|
|
327
|
+
cellProps: cellProps.value
|
|
328
|
+
}));
|
|
329
|
+
const calendarBodyProps = computed(() => ({
|
|
330
|
+
internalView: internalView.value,
|
|
331
|
+
color: props.color,
|
|
332
|
+
activeColor: props.activeColor,
|
|
333
|
+
placeholder: placeholder.value,
|
|
334
|
+
monthGridItems: monthGridItems.value,
|
|
335
|
+
yearGridItems: yearGridItems.value,
|
|
336
|
+
decadeHeadingText: decadeHeadingText.value,
|
|
337
|
+
isMonthDisabled,
|
|
338
|
+
isYearDisabled,
|
|
339
|
+
selectMonth,
|
|
340
|
+
selectYear,
|
|
341
|
+
drillUp,
|
|
342
|
+
goToPreviousYear,
|
|
343
|
+
goToNextYear,
|
|
344
|
+
goToPreviousDecade,
|
|
345
|
+
goToNextDecade,
|
|
346
|
+
isTimeGranularity: isTimeGranularity.value,
|
|
347
|
+
granularity: props.granularity,
|
|
348
|
+
placeholderHour: placeholderHour.value,
|
|
349
|
+
placeholderMinute: placeholderMinute.value,
|
|
350
|
+
hourCycle: props.hourCycle,
|
|
351
|
+
minuteStep: props.minuteStep,
|
|
352
|
+
locale: effectiveLocale.value,
|
|
353
|
+
hourInputId,
|
|
354
|
+
minuteInputId,
|
|
355
|
+
setHour,
|
|
356
|
+
setMinute,
|
|
357
|
+
closeOnSelect: props.closeOnSelect,
|
|
358
|
+
close: () => {
|
|
359
|
+
isOpen.value = false;
|
|
360
|
+
},
|
|
361
|
+
headerProps: headerProps.value,
|
|
362
|
+
headingProps: headingProps.value,
|
|
363
|
+
gridsProps: gridsProps.value,
|
|
364
|
+
gridProps: gridProps.value,
|
|
365
|
+
gridHeadProps: gridHeadProps.value,
|
|
366
|
+
headCellProps: headCellProps.value,
|
|
367
|
+
cellProps: cellProps.value,
|
|
368
|
+
viewGridProps: viewGridProps.value,
|
|
369
|
+
timeSectionProps: timeSectionProps.value
|
|
370
|
+
}));
|
|
371
|
+
const timeBodyProps = computed(() => ({
|
|
372
|
+
hour: timePlaceholder.value.hour,
|
|
373
|
+
minute: timePlaceholder.value.minute,
|
|
374
|
+
granularity: timeOnlyGranularity.value,
|
|
375
|
+
hourCycle: props.hourCycle,
|
|
376
|
+
minuteStep: props.minuteStep,
|
|
377
|
+
locale: effectiveLocale.value,
|
|
378
|
+
hourInputId,
|
|
379
|
+
minuteInputId,
|
|
380
|
+
setHour: setTimeOnlyHour,
|
|
381
|
+
setMinute: setTimeOnlyMinute,
|
|
382
|
+
closeOnSelect: props.closeOnSelect,
|
|
383
|
+
activeColor: props.activeColor,
|
|
384
|
+
close: () => {
|
|
385
|
+
timeIsOpen.value = false;
|
|
386
|
+
},
|
|
387
|
+
timeSectionProps: timeSectionProps.value
|
|
388
|
+
}));
|
|
389
|
+
const buttonTriggerUi = computed(() => ({
|
|
390
|
+
base: [
|
|
391
|
+
"w-full justify-start rounded-[var(--ui-radius-md)] bg-[var(--ui-bg)] text-[var(--ui-text)] ring-1 ring-inset ring-[var(--ui-border)] hover:ring-[var(--ui-border-hover)] hover:bg-[var(--ui-bg-elevated)]",
|
|
392
|
+
datePickerInvalid.value ? "ring-[var(--ui-danger)] hover:ring-[var(--ui-danger)]" : void 0,
|
|
393
|
+
// Room for the clear button, which sits absolutely positioned on top of
|
|
394
|
+
// this same end edge - without it, a long formatted date can run under it.
|
|
395
|
+
props.clearable && hasValue.value ? "pe-8" : void 0
|
|
396
|
+
].filter(Boolean).join(" "),
|
|
397
|
+
// base is justify-start (text left-aligned, not centered) so the button
|
|
398
|
+
// reads naturally for a short date string - without its own auto margin,
|
|
399
|
+
// the trailing icon would just sit right after that short text instead of
|
|
400
|
+
// pinned to the button's own far edge, the same "select control" look the
|
|
401
|
+
// field-mode trigger group also needs (see the ms-auto wrapper above).
|
|
402
|
+
trailingIcon: "ms-auto"
|
|
403
|
+
}));
|
|
404
|
+
</script>
|
|
405
|
+
|
|
406
|
+
<template>
|
|
407
|
+
<DateRangePickerRoot
|
|
408
|
+
v-if="range"
|
|
409
|
+
:id="datePickerId"
|
|
410
|
+
v-model:open="isRangeOpen"
|
|
411
|
+
:name="name ?? field?.name"
|
|
412
|
+
:model-value="rangeModelValue"
|
|
413
|
+
:min-value="minValue"
|
|
414
|
+
:max-value="maxValue"
|
|
415
|
+
:is-date-unavailable="isDateUnavailable"
|
|
416
|
+
:is-date-disabled="isDateDisabled"
|
|
417
|
+
:is-date-highlightable="isDateHighlightable"
|
|
418
|
+
:locale="effectiveLocale"
|
|
419
|
+
:number-of-months="effectiveNumberOfMonths"
|
|
420
|
+
:paged-navigation="pagedNavigation"
|
|
421
|
+
:week-starts-on="weekStartsOn"
|
|
422
|
+
:weekday-format="weekdayFormat"
|
|
423
|
+
:fixed-weeks="fixedWeeks"
|
|
424
|
+
:close-on-select="closeOnSelect"
|
|
425
|
+
:allow-non-contiguous-ranges="allowNonContiguousRanges"
|
|
426
|
+
:fixed-date="fixedDate"
|
|
427
|
+
:maximum-days="maximumDays"
|
|
428
|
+
:disabled="disabled"
|
|
429
|
+
:readonly="readonly"
|
|
430
|
+
:prevent-deselect="preventDeselect"
|
|
431
|
+
v-bind="rootProps"
|
|
432
|
+
@update:model-value="(value) => emit('update:modelValue', value)"
|
|
433
|
+
>
|
|
434
|
+
<DateRangePickerAnchor as-child>
|
|
435
|
+
<div v-if="triggerMode === 'field'" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps">
|
|
436
|
+
<DateRangePickerField v-slot="{ segments }">
|
|
437
|
+
<template v-for="segment in segments.start" :key="`start-${segment.part}`">
|
|
438
|
+
<DateRangePickerInput as="span" type="start" :part="segment.part" v-bind="segmentProps">
|
|
439
|
+
{{ segment.value }}
|
|
440
|
+
</DateRangePickerInput>
|
|
441
|
+
</template>
|
|
442
|
+
<span v-bind="separatorProps">–</span>
|
|
443
|
+
<template v-for="segment in segments.end" :key="`end-${segment.part}`">
|
|
444
|
+
<DateRangePickerInput as="span" type="end" :part="segment.part" v-bind="segmentProps">
|
|
445
|
+
{{ segment.value }}
|
|
446
|
+
</DateRangePickerInput>
|
|
447
|
+
</template>
|
|
448
|
+
</DateRangePickerField>
|
|
449
|
+
<div :class="applyClassPrefix('ms-auto flex shrink-0 items-center gap-1')">
|
|
450
|
+
<Button
|
|
451
|
+
v-if="clearable && hasValue"
|
|
452
|
+
variant="text"
|
|
453
|
+
:color="color"
|
|
454
|
+
:size="iconButtonSize"
|
|
455
|
+
:aria-label="messages.clear"
|
|
456
|
+
@click="clear"
|
|
457
|
+
>
|
|
458
|
+
<template #icon="{ class: iconClass }">
|
|
459
|
+
<slot name="clear-icon">
|
|
460
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
461
|
+
</slot>
|
|
462
|
+
</template>
|
|
463
|
+
</Button>
|
|
464
|
+
<DateRangePickerTrigger as-child>
|
|
465
|
+
<Button variant="text" :color="color" :size="iconButtonSize" :aria-label="messages.dateRangePicker">
|
|
466
|
+
<template #icon="{ class: iconClass }">
|
|
467
|
+
<slot name="trigger-icon">
|
|
468
|
+
<Icon :name="icons.calendar" :class="iconClass" />
|
|
469
|
+
</slot>
|
|
470
|
+
</template>
|
|
471
|
+
</Button>
|
|
472
|
+
</DateRangePickerTrigger>
|
|
473
|
+
</div>
|
|
474
|
+
</div>
|
|
475
|
+
|
|
476
|
+
<div v-else :class="applyClassPrefix('relative inline-block w-full')">
|
|
477
|
+
<DateRangePickerTrigger as-child>
|
|
478
|
+
<Button
|
|
479
|
+
variant="text"
|
|
480
|
+
:color="color"
|
|
481
|
+
:size="effectiveSize"
|
|
482
|
+
:aria-invalid="datePickerInvalid || void 0"
|
|
483
|
+
:aria-describedby="describedBy"
|
|
484
|
+
:ui="buttonTriggerUi"
|
|
485
|
+
>
|
|
486
|
+
{{ hasValue ? formattedValue : messages.pickDate }}
|
|
487
|
+
<template v-if="!(clearable && hasValue)" #trailing-icon="{ class: iconClass }">
|
|
488
|
+
<slot name="trigger-icon">
|
|
489
|
+
<Icon :name="icons.calendar" :class="iconClass" />
|
|
490
|
+
</slot>
|
|
491
|
+
</template>
|
|
492
|
+
</Button>
|
|
493
|
+
</DateRangePickerTrigger>
|
|
494
|
+
<Button
|
|
495
|
+
v-if="clearable && hasValue"
|
|
496
|
+
variant="text"
|
|
497
|
+
:color="color"
|
|
498
|
+
:size="iconButtonSize"
|
|
499
|
+
:aria-label="messages.clear"
|
|
500
|
+
:class="applyClassPrefix('absolute end-1 top-1/2 -translate-y-1/2')"
|
|
501
|
+
@click.stop="clear"
|
|
502
|
+
>
|
|
503
|
+
<template #icon="{ class: iconClass }">
|
|
504
|
+
<slot name="clear-icon">
|
|
505
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
506
|
+
</slot>
|
|
507
|
+
</template>
|
|
508
|
+
</Button>
|
|
509
|
+
</div>
|
|
510
|
+
</DateRangePickerAnchor>
|
|
511
|
+
|
|
512
|
+
<DateRangePickerContent v-if="!showMobileModal" :side-offset="6" align="start" v-bind="contentProps">
|
|
513
|
+
<DatePickerRangeCalendarBody v-bind="rangeBodyProps">
|
|
514
|
+
<template #day="scope">
|
|
515
|
+
<slot name="day" v-bind="scope" />
|
|
516
|
+
</template>
|
|
517
|
+
<template #footer>
|
|
518
|
+
<slot name="footer" />
|
|
519
|
+
</template>
|
|
520
|
+
</DatePickerRangeCalendarBody>
|
|
521
|
+
<DateRangePickerArrow v-if="arrow" v-bind="arrowProps" />
|
|
522
|
+
</DateRangePickerContent>
|
|
523
|
+
<!--
|
|
524
|
+
Below 768px, the exact same DatePickerRangeCalendarBody - the same
|
|
525
|
+
Root-injected grid/selection state, unchanged - inside a centered
|
|
526
|
+
Modal instead of the small anchored popover above. See
|
|
527
|
+
ComboboxSelectBase.vue's own mobileModal branch for why there's no
|
|
528
|
+
extra portal here and why `title`/`description` are passed
|
|
529
|
+
explicitly.
|
|
530
|
+
-->
|
|
531
|
+
<Modal
|
|
532
|
+
v-else :open="isRangeOpen" :title="messages.dateRangePicker" :description="messages.dateRangePickerDescription"
|
|
533
|
+
:ui="mobileModalUi" @update:open="isRangeOpen = $event"
|
|
534
|
+
>
|
|
535
|
+
<template #content>
|
|
536
|
+
<div v-bind="mobileContentProps">
|
|
537
|
+
<DatePickerRangeCalendarBody v-bind="rangeBodyProps">
|
|
538
|
+
<template #day="scope">
|
|
539
|
+
<slot name="day" v-bind="scope" />
|
|
540
|
+
</template>
|
|
541
|
+
<template #footer>
|
|
542
|
+
<slot name="footer" />
|
|
543
|
+
</template>
|
|
544
|
+
</DatePickerRangeCalendarBody>
|
|
545
|
+
</div>
|
|
546
|
+
</template>
|
|
547
|
+
</Modal>
|
|
548
|
+
</DateRangePickerRoot>
|
|
549
|
+
|
|
550
|
+
<PopoverRoot v-else-if="timeOnly" v-model:open="timeIsOpen">
|
|
551
|
+
<PopoverAnchor as-child>
|
|
552
|
+
<div v-if="triggerMode === 'field'" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps">
|
|
553
|
+
<TimeFieldRoot
|
|
554
|
+
:id="datePickerId"
|
|
555
|
+
v-slot="{ segments }"
|
|
556
|
+
v-model:placeholder="timePlaceholder"
|
|
557
|
+
:model-value="timeOnlyValue"
|
|
558
|
+
:name="name ?? field?.name"
|
|
559
|
+
:locale="effectiveLocale"
|
|
560
|
+
:hour-cycle="hourCycle"
|
|
561
|
+
:granularity="timeOnlyGranularity"
|
|
562
|
+
:disabled="disabled"
|
|
563
|
+
:readonly="readonly"
|
|
564
|
+
@update:model-value="(value) => emit('update:modelValue', value ? normalizeTimeOnly(value) : void 0)"
|
|
565
|
+
>
|
|
566
|
+
<template v-for="segment in segments" :key="segment.part">
|
|
567
|
+
<TimeFieldInput as="span" :part="segment.part" v-bind="segmentProps">
|
|
568
|
+
{{ segment.value }}
|
|
569
|
+
</TimeFieldInput>
|
|
570
|
+
</template>
|
|
571
|
+
</TimeFieldRoot>
|
|
572
|
+
<div :class="applyClassPrefix('ms-auto flex shrink-0 items-center gap-1')">
|
|
573
|
+
<Button
|
|
574
|
+
v-if="clearable && hasValue"
|
|
575
|
+
variant="text"
|
|
576
|
+
:color="color"
|
|
577
|
+
:size="iconButtonSize"
|
|
578
|
+
:aria-label="messages.clear"
|
|
579
|
+
@click="clear"
|
|
580
|
+
>
|
|
581
|
+
<template #icon="{ class: iconClass }">
|
|
582
|
+
<slot name="clear-icon">
|
|
583
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
584
|
+
</slot>
|
|
585
|
+
</template>
|
|
586
|
+
</Button>
|
|
587
|
+
<PopoverTrigger as-child>
|
|
588
|
+
<Button variant="text" :color="color" :size="iconButtonSize" :aria-label="messages.timePicker">
|
|
589
|
+
<template #icon="{ class: iconClass }">
|
|
590
|
+
<slot name="trigger-icon">
|
|
591
|
+
<Icon :name="icons.clock" :class="iconClass" />
|
|
592
|
+
</slot>
|
|
593
|
+
</template>
|
|
594
|
+
</Button>
|
|
595
|
+
</PopoverTrigger>
|
|
596
|
+
</div>
|
|
597
|
+
</div>
|
|
598
|
+
|
|
599
|
+
<div v-else :class="applyClassPrefix('relative inline-block w-full')">
|
|
600
|
+
<PopoverTrigger as-child>
|
|
601
|
+
<Button
|
|
602
|
+
variant="text"
|
|
603
|
+
:color="color"
|
|
604
|
+
:size="effectiveSize"
|
|
605
|
+
:aria-invalid="datePickerInvalid || void 0"
|
|
606
|
+
:aria-describedby="describedBy"
|
|
607
|
+
:ui="buttonTriggerUi"
|
|
608
|
+
>
|
|
609
|
+
{{ hasValue ? formattedTimeValue : messages.pickTime }}
|
|
610
|
+
<template v-if="!(clearable && hasValue)" #trailing-icon="{ class: iconClass }">
|
|
611
|
+
<slot name="trigger-icon">
|
|
612
|
+
<Icon :name="icons.clock" :class="iconClass" />
|
|
613
|
+
</slot>
|
|
614
|
+
</template>
|
|
615
|
+
</Button>
|
|
616
|
+
</PopoverTrigger>
|
|
617
|
+
<Button
|
|
618
|
+
v-if="clearable && hasValue"
|
|
619
|
+
variant="text"
|
|
620
|
+
:color="color"
|
|
621
|
+
:size="iconButtonSize"
|
|
622
|
+
:aria-label="messages.clear"
|
|
623
|
+
:class="applyClassPrefix('absolute end-1 top-1/2 -translate-y-1/2')"
|
|
624
|
+
@click.stop="clear"
|
|
625
|
+
>
|
|
626
|
+
<template #icon="{ class: iconClass }">
|
|
627
|
+
<slot name="clear-icon">
|
|
628
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
629
|
+
</slot>
|
|
630
|
+
</template>
|
|
631
|
+
</Button>
|
|
632
|
+
</div>
|
|
633
|
+
</PopoverAnchor>
|
|
634
|
+
|
|
635
|
+
<PopoverPortal v-if="!showMobileModal">
|
|
636
|
+
<PopoverContent :side-offset="6" align="start" v-bind="contentProps">
|
|
637
|
+
<DatePickerTimeBody v-bind="timeBodyProps">
|
|
638
|
+
<template #footer>
|
|
639
|
+
<slot name="footer" />
|
|
640
|
+
</template>
|
|
641
|
+
</DatePickerTimeBody>
|
|
642
|
+
<PopoverArrow v-if="arrow" v-bind="arrowProps" />
|
|
643
|
+
</PopoverContent>
|
|
644
|
+
</PopoverPortal>
|
|
645
|
+
<!-- Below 768px - see the range branch's own identical note above. -->
|
|
646
|
+
<Modal
|
|
647
|
+
v-else :open="timeIsOpen" :title="messages.timePicker" :description="messages.timePickerDescription"
|
|
648
|
+
:ui="mobileModalUi" @update:open="timeIsOpen = $event"
|
|
649
|
+
>
|
|
650
|
+
<template #content>
|
|
651
|
+
<div v-bind="mobileContentProps">
|
|
652
|
+
<DatePickerTimeBody v-bind="timeBodyProps">
|
|
653
|
+
<template #footer>
|
|
654
|
+
<slot name="footer" />
|
|
655
|
+
</template>
|
|
656
|
+
</DatePickerTimeBody>
|
|
657
|
+
</div>
|
|
658
|
+
</template>
|
|
659
|
+
</Modal>
|
|
660
|
+
</PopoverRoot>
|
|
661
|
+
|
|
662
|
+
<DatePickerRoot
|
|
663
|
+
v-else
|
|
664
|
+
:id="datePickerId"
|
|
665
|
+
v-model:placeholder="placeholder"
|
|
666
|
+
v-model:open="isOpen"
|
|
667
|
+
:name="name ?? field?.name"
|
|
668
|
+
:model-value="singleModelValue"
|
|
669
|
+
:min-value="minValue"
|
|
670
|
+
:max-value="maxValue"
|
|
671
|
+
:is-date-unavailable="isDateUnavailable"
|
|
672
|
+
:is-date-disabled="isDateDisabled"
|
|
673
|
+
:locale="effectiveLocale"
|
|
674
|
+
:hour-cycle="hourCycle"
|
|
675
|
+
:number-of-months="effectiveNumberOfMonths"
|
|
676
|
+
:paged-navigation="pagedNavigation"
|
|
677
|
+
:week-starts-on="weekStartsOn"
|
|
678
|
+
:weekday-format="weekdayFormat"
|
|
679
|
+
:fixed-weeks="fixedWeeks"
|
|
680
|
+
:close-on-select="isTimeGranularity ? false : closeOnSelect"
|
|
681
|
+
:disabled="disabled"
|
|
682
|
+
:readonly="readonly"
|
|
683
|
+
:prevent-deselect="preventDeselect"
|
|
684
|
+
v-bind="rootProps"
|
|
685
|
+
@update:model-value="(value) => emit('update:modelValue', normalizeForGranularity(value))"
|
|
686
|
+
>
|
|
687
|
+
<DatePickerAnchor as-child>
|
|
688
|
+
<div v-if="triggerMode === 'field'" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps">
|
|
689
|
+
<DatePickerField v-slot="{ segments }">
|
|
690
|
+
<template v-for="(segment, index) in visibleSegments(segments)" :key="`${segment.part}-${index}`">
|
|
691
|
+
<DatePickerInput as="span" :part="segment.part" v-bind="segmentProps">
|
|
692
|
+
{{ segment.value }}
|
|
693
|
+
</DatePickerInput>
|
|
694
|
+
</template>
|
|
695
|
+
</DatePickerField>
|
|
696
|
+
<div :class="applyClassPrefix('ms-auto flex shrink-0 items-center gap-1')">
|
|
697
|
+
<Button
|
|
698
|
+
v-if="clearable && hasValue"
|
|
699
|
+
variant="text"
|
|
700
|
+
:color="color"
|
|
701
|
+
:size="iconButtonSize"
|
|
702
|
+
:aria-label="messages.clear"
|
|
703
|
+
@click="clear"
|
|
704
|
+
>
|
|
705
|
+
<template #icon="{ class: iconClass }">
|
|
706
|
+
<slot name="clear-icon">
|
|
707
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
708
|
+
</slot>
|
|
709
|
+
</template>
|
|
710
|
+
</Button>
|
|
711
|
+
<DatePickerTrigger as-child>
|
|
712
|
+
<Button variant="text" :color="color" :size="iconButtonSize" :aria-label="messages.datePicker">
|
|
713
|
+
<template #icon="{ class: iconClass }">
|
|
714
|
+
<slot name="trigger-icon">
|
|
715
|
+
<Icon :name="icons.calendar" :class="iconClass" />
|
|
716
|
+
</slot>
|
|
717
|
+
</template>
|
|
718
|
+
</Button>
|
|
719
|
+
</DatePickerTrigger>
|
|
720
|
+
</div>
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
<div v-else :class="applyClassPrefix('relative inline-block w-full')">
|
|
724
|
+
<DatePickerTrigger as-child>
|
|
725
|
+
<Button
|
|
726
|
+
variant="text"
|
|
727
|
+
:color="color"
|
|
728
|
+
:size="effectiveSize"
|
|
729
|
+
:aria-invalid="datePickerInvalid || void 0"
|
|
730
|
+
:aria-describedby="describedBy"
|
|
731
|
+
:ui="buttonTriggerUi"
|
|
732
|
+
>
|
|
733
|
+
{{ hasValue ? formattedValue : messages.pickDate }}
|
|
734
|
+
<template v-if="!(clearable && hasValue)" #trailing-icon="{ class: iconClass }">
|
|
735
|
+
<slot name="trigger-icon">
|
|
736
|
+
<Icon :name="icons.calendar" :class="iconClass" />
|
|
737
|
+
</slot>
|
|
738
|
+
</template>
|
|
739
|
+
</Button>
|
|
740
|
+
</DatePickerTrigger>
|
|
741
|
+
<Button
|
|
742
|
+
v-if="clearable && hasValue"
|
|
743
|
+
variant="text"
|
|
744
|
+
:color="color"
|
|
745
|
+
:size="iconButtonSize"
|
|
746
|
+
:aria-label="messages.clear"
|
|
747
|
+
:class="applyClassPrefix('absolute end-1 top-1/2 -translate-y-1/2')"
|
|
748
|
+
@click.stop="clear"
|
|
749
|
+
>
|
|
750
|
+
<template #icon="{ class: iconClass }">
|
|
751
|
+
<slot name="clear-icon">
|
|
752
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
753
|
+
</slot>
|
|
754
|
+
</template>
|
|
755
|
+
</Button>
|
|
756
|
+
</div>
|
|
757
|
+
</DatePickerAnchor>
|
|
758
|
+
|
|
759
|
+
<!-- align="start" (the default everywhere else) puts the trigger's own
|
|
760
|
+
center outside the calendar grid's bounds here, since the grid is
|
|
761
|
+
noticeably wider than the compact field/button trigger - Reka's own
|
|
762
|
+
Floating UI arrow middleware refuses to render an arrow it can't
|
|
763
|
+
center without clipping, so it silently hides instead. Centering the
|
|
764
|
+
panel on the trigger only when `arrow` is on sidesteps that without
|
|
765
|
+
changing the default (start-aligned) layout everyone already sees. -->
|
|
766
|
+
<DatePickerContent v-if="!showMobileModal" :side-offset="6" :align="arrow ? 'center' : 'start'" v-bind="contentProps">
|
|
767
|
+
<DatePickerCalendarBody v-bind="calendarBodyProps">
|
|
768
|
+
<template #day="scope">
|
|
769
|
+
<slot name="day" v-bind="scope" />
|
|
770
|
+
</template>
|
|
771
|
+
<template #footer>
|
|
772
|
+
<slot name="footer" />
|
|
773
|
+
</template>
|
|
774
|
+
</DatePickerCalendarBody>
|
|
775
|
+
<DatePickerArrow v-if="arrow" v-bind="arrowProps" />
|
|
776
|
+
</DatePickerContent>
|
|
777
|
+
<!-- Below 768px - see the range branch's own identical note above. -->
|
|
778
|
+
<Modal
|
|
779
|
+
v-else :open="isOpen" :title="messages.datePicker" :description="messages.datePickerDescription"
|
|
780
|
+
:ui="mobileModalUi" @update:open="isOpen = $event"
|
|
781
|
+
>
|
|
782
|
+
<template #content>
|
|
783
|
+
<div v-bind="mobileContentProps">
|
|
784
|
+
<DatePickerCalendarBody v-bind="calendarBodyProps">
|
|
785
|
+
<template #day="scope">
|
|
786
|
+
<slot name="day" v-bind="scope" />
|
|
787
|
+
</template>
|
|
788
|
+
<template #footer>
|
|
789
|
+
<slot name="footer" />
|
|
790
|
+
</template>
|
|
791
|
+
</DatePickerCalendarBody>
|
|
792
|
+
</div>
|
|
793
|
+
</template>
|
|
794
|
+
</Modal>
|
|
795
|
+
</DatePickerRoot>
|
|
796
|
+
</template>
|