@soybeanjs/headless 0.15.5 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/autocomplete/autocomplete-compact.js +1 -1
- package/dist/components/autocomplete/autocomplete-input.js +1 -1
- package/dist/components/autocomplete/autocomplete-input.vue.d.ts +2 -2
- package/dist/components/autocomplete/autocomplete-root.js +1 -1
- package/dist/components/autocomplete/autocomplete-root.vue.d.ts +12 -2
- package/dist/components/autocomplete/context.d.ts +2 -2
- package/dist/components/autocomplete/context.js +1 -1
- package/dist/components/autocomplete/index.d.ts +17 -13
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/autocomplete/types.d.ts +18 -32
- package/dist/components/calendar/calendar-cell-trigger.js +1 -0
- package/dist/components/calendar/calendar-cell-trigger.vue.d.ts +28 -0
- package/dist/components/calendar/calendar-cell.js +1 -0
- package/dist/components/{autocomplete/autocomplete-anchor.vue.d.ts → calendar/calendar-cell.vue.d.ts} +3 -3
- package/dist/components/calendar/calendar-compact.js +1 -0
- package/dist/components/calendar/calendar-compact.vue.d.ts +23 -0
- package/dist/components/calendar/calendar-grid-body.js +1 -0
- package/dist/components/{combobox/combobox-item-indicator.vue.d.ts → calendar/calendar-grid-body.vue.d.ts} +3 -3
- package/dist/components/calendar/calendar-grid-head.js +1 -0
- package/dist/components/calendar/calendar-grid-head.vue.d.ts +21 -0
- package/dist/components/calendar/calendar-grid-row.js +1 -0
- package/dist/components/calendar/calendar-grid-row.vue.d.ts +21 -0
- package/dist/components/calendar/calendar-grid.js +1 -0
- package/dist/components/calendar/calendar-grid.vue.d.ts +21 -0
- package/dist/components/calendar/calendar-head-cell.js +1 -0
- package/dist/components/calendar/calendar-head-cell.vue.d.ts +21 -0
- package/dist/components/calendar/calendar-header.js +1 -0
- package/dist/components/calendar/calendar-header.vue.d.ts +21 -0
- package/dist/components/calendar/calendar-heading.js +1 -0
- package/dist/components/calendar/calendar-heading.vue.d.ts +22 -0
- package/dist/components/calendar/calendar-next.js +1 -0
- package/dist/components/calendar/calendar-next.vue.d.ts +24 -0
- package/dist/components/calendar/calendar-prev.js +1 -0
- package/dist/components/calendar/calendar-prev.vue.d.ts +24 -0
- package/dist/components/calendar/calendar-root.js +1 -0
- package/dist/components/calendar/calendar-root.vue.d.ts +25 -0
- package/dist/components/calendar/context.d.ts +9 -0
- package/dist/components/calendar/context.js +1 -0
- package/dist/components/calendar/index.d.ts +16 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/calendar/types.d.ts +165 -0
- package/dist/components/calendar/use-calendar.d.ts +45 -0
- package/dist/components/calendar/use-calendar.js +1 -0
- package/dist/components/card/card-compact.js +1 -0
- package/dist/components/card/card-compact.vue.d.ts +19 -0
- package/dist/components/card/card-root.vue.d.ts +1 -1
- package/dist/components/card/index.d.ts +10 -9
- package/dist/components/card/index.js +1 -1
- package/dist/components/card/types.d.ts +22 -1
- package/dist/components/carousel/carousel-root.vue.d.ts +39 -2
- package/dist/components/carousel/index.d.ts +4 -2
- package/dist/components/carousel/types.d.ts +8 -8
- package/dist/components/checkbox/checkbox-group-root.js +1 -1
- package/dist/components/checkbox/checkbox-root.js +1 -1
- package/dist/components/collapsible/collapsible-root.vue.d.ts +1 -1
- package/dist/components/color-area/color-area-root.vue.d.ts +3 -3
- package/dist/components/color-field/color-field-root.vue.d.ts +1 -1
- package/dist/components/color-picker/color-picker-root.vue.d.ts +3 -3
- package/dist/components/color-slider/color-slider-root.vue.d.ts +3 -3
- package/dist/components/color-swatch-picker/color-swatch-picker-root.vue.d.ts +2 -2
- package/dist/components/combobox/combobox-arrow.js +1 -1
- package/dist/components/combobox/combobox-arrow.vue.d.ts +2 -2
- package/dist/components/combobox/combobox-compact.js +1 -1
- package/dist/components/combobox/combobox-compact.vue.d.ts +2 -2
- package/dist/components/combobox/combobox-content-impl.js +1 -1
- package/dist/components/combobox/combobox-group.vue.d.ts +2 -2
- package/dist/components/combobox/combobox-input.js +1 -1
- package/dist/components/combobox/combobox-item.js +1 -1
- package/dist/components/combobox/combobox-root.js +1 -1
- package/dist/components/combobox/combobox-trigger.js +1 -1
- package/dist/components/combobox/combobox-virtualizer.js +1 -1
- package/dist/components/combobox/context.js +1 -1
- package/dist/components/combobox/index.d.ts +12 -10
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/types.d.ts +10 -20
- package/dist/components/command/command-compact.js +1 -1
- package/dist/components/command/command-compact.vue.d.ts +2 -2
- package/dist/components/command/types.d.ts +1 -1
- package/dist/components/context-menu/context-menu-checkbox-compact.js +1 -1
- package/dist/components/context-menu/context-menu-checkbox-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-compact.js +1 -1
- package/dist/components/context-menu/context-menu-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-radio-compact.js +1 -1
- package/dist/components/context-menu/context-menu-radio-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-wrapper-compact.js +1 -1
- package/dist/components/context-menu/context-menu-wrapper-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/index.d.ts +2 -2
- package/dist/components/context-menu/index.js +1 -1
- package/dist/components/date-field/context.d.ts +9 -0
- package/dist/components/date-field/context.js +1 -0
- package/dist/components/date-field/date-field-compact.js +1 -0
- package/dist/components/date-field/date-field-compact.vue.d.ts +15 -0
- package/dist/components/date-field/date-field-input.js +1 -0
- package/dist/components/date-field/date-field-input.vue.d.ts +21 -0
- package/dist/components/date-field/date-field-root.js +1 -0
- package/dist/components/date-field/date-field-root.vue.d.ts +42 -0
- package/dist/components/date-field/index.d.ts +6 -0
- package/dist/components/date-field/index.js +1 -0
- package/dist/components/date-field/types.d.ts +67 -0
- package/dist/components/date-picker/context.d.ts +9 -0
- package/dist/components/date-picker/context.js +1 -0
- package/dist/components/date-picker/date-picker-popup.js +1 -0
- package/dist/components/date-picker/date-picker-popup.vue.d.ts +21 -0
- package/dist/components/date-picker/date-picker-root.js +1 -0
- package/dist/components/date-picker/date-picker-root.vue.d.ts +43 -0
- package/dist/components/date-picker/date-picker-trigger.js +1 -0
- package/dist/components/date-picker/date-picker-trigger.vue.d.ts +21 -0
- package/dist/components/date-picker/index.d.ts +6 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-picker/types.d.ts +64 -0
- package/dist/components/date-range-field/context.d.ts +9 -0
- package/dist/components/date-range-field/context.js +1 -0
- package/dist/components/date-range-field/date-range-field-compact.js +1 -0
- package/dist/components/date-range-field/date-range-field-compact.vue.d.ts +29 -0
- package/dist/components/date-range-field/date-range-field-input.js +1 -0
- package/dist/components/date-range-field/date-range-field-input.vue.d.ts +22 -0
- package/dist/components/date-range-field/date-range-field-root.js +1 -0
- package/dist/components/date-range-field/date-range-field-root.vue.d.ts +55 -0
- package/dist/components/date-range-field/index.d.ts +6 -0
- package/dist/components/date-range-field/index.js +1 -0
- package/dist/components/date-range-field/types.d.ts +88 -0
- package/dist/components/date-range-picker/context.d.ts +9 -0
- package/dist/components/date-range-picker/context.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-compact.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-compact.vue.d.ts +31 -0
- package/dist/components/date-range-picker/date-range-picker-popup.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-popup.vue.d.ts +21 -0
- package/dist/components/date-range-picker/date-range-picker-root.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-root.vue.d.ts +50 -0
- package/dist/components/date-range-picker/date-range-picker-trigger.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-trigger.vue.d.ts +21 -0
- package/dist/components/date-range-picker/index.d.ts +7 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-range-picker/types.d.ts +93 -0
- package/dist/components/dialog/dialog-compact.vue.d.ts +3 -3
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-radio-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-radio-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-root.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/index.d.ts +2 -2
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/editable/editable-compact.js +1 -0
- package/dist/components/editable/editable-compact.vue.d.ts +23 -0
- package/dist/components/editable/editable-root.vue.d.ts +1 -1
- package/dist/components/editable/index.d.ts +8 -7
- package/dist/components/editable/index.js +1 -1
- package/dist/components/editable/types.d.ts +28 -2
- package/dist/components/hover-card/hover-card-compact.js +1 -0
- package/dist/components/hover-card/hover-card-compact.vue.d.ts +30 -0
- package/dist/components/hover-card/hover-card-positioner.js +1 -1
- package/dist/components/hover-card/hover-card-positioner.vue.d.ts +1 -0
- package/dist/components/hover-card/hover-card-root.vue.d.ts +1 -1
- package/dist/components/hover-card/index.d.ts +8 -7
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/hover-card/types.d.ts +15 -1
- package/dist/components/input/input-root.js +1 -1
- package/dist/components/input-otp/input-otp-compact.vue.d.ts +2 -2
- package/dist/components/input-otp/input-otp-root.vue.d.ts +2 -2
- package/dist/components/layout/layout-classic-compact.vue.d.ts +1 -1
- package/dist/components/layout/layout-compact.vue.d.ts +1 -1
- package/dist/components/layout/layout-root.vue.d.ts +2 -2
- package/dist/components/link/link.vue.d.ts +1 -1
- package/dist/components/listbox/index.js +1 -1
- package/dist/components/listbox/listbox-root.js +1 -1
- package/dist/components/listbox/listbox-root.vue.d.ts +2 -2
- package/dist/components/menu/hooks.js +1 -1
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/menu-checkbox-options-compact.js +1 -1
- package/dist/components/menu/menu-option-compact.js +1 -1
- package/dist/components/menu/menu-option-compact.vue.d.ts +2 -2
- package/dist/components/menu/menu-options-compact.js +1 -1
- package/dist/components/menu/menu-options-compact.vue.d.ts +2 -2
- package/dist/components/menu/menu-radio-options-compact.js +1 -1
- package/dist/components/menu/types.d.ts +1 -1
- package/dist/components/menubar/index.js +1 -1
- package/dist/components/menubar/menubar-compact.js +1 -1
- package/dist/components/menubar/menubar-compact.vue.d.ts +2 -2
- package/dist/components/month-picker/context.d.ts +9 -0
- package/dist/components/month-picker/context.js +1 -0
- package/dist/components/month-picker/index.d.ts +6 -0
- package/dist/components/month-picker/index.js +1 -0
- package/dist/components/month-picker/month-picker-popup.js +1 -0
- package/dist/components/month-picker/month-picker-popup.vue.d.ts +36 -0
- package/dist/components/month-picker/month-picker-root.js +1 -0
- package/dist/components/month-picker/month-picker-root.vue.d.ts +39 -0
- package/dist/components/month-picker/month-picker-trigger.js +1 -0
- package/dist/components/{autocomplete/autocomplete-trigger.vue.d.ts → month-picker/month-picker-trigger.vue.d.ts} +3 -3
- package/dist/components/month-picker/types.d.ts +61 -0
- package/dist/components/month-range-picker/context.d.ts +9 -0
- package/dist/components/month-range-picker/context.js +1 -0
- package/dist/components/month-range-picker/index.d.ts +6 -0
- package/dist/components/month-range-picker/index.js +1 -0
- package/dist/components/month-range-picker/month-range-picker-popup.js +1 -0
- package/dist/components/month-range-picker/month-range-picker-popup.vue.d.ts +39 -0
- package/dist/components/month-range-picker/month-range-picker-root.js +1 -0
- package/dist/components/month-range-picker/month-range-picker-root.vue.d.ts +43 -0
- package/dist/components/month-range-picker/month-range-picker-trigger.js +1 -0
- package/dist/components/month-range-picker/month-range-picker-trigger.vue.d.ts +21 -0
- package/dist/components/month-range-picker/types.d.ts +69 -0
- package/dist/components/navigation-menu/index.d.ts +12 -11
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-compact.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-compact.vue.d.ts +34 -0
- package/dist/components/navigation-menu/navigation-menu-root.vue.d.ts +1 -1
- package/dist/components/navigation-menu/types.d.ts +66 -2
- package/dist/components/pagination/index.d.ts +11 -10
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/pagination-compact.js +1 -0
- package/dist/components/pagination/pagination-compact.vue.d.ts +23 -0
- package/dist/components/pagination/types.d.ts +21 -1
- package/dist/components/popover/index.d.ts +8 -7
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover-compact.js +1 -0
- package/dist/components/popover/popover-compact.vue.d.ts +36 -0
- package/dist/components/popover/popover-root.vue.d.ts +1 -1
- package/dist/components/popover/types.d.ts +19 -2
- package/dist/components/popper/index.js +1 -1
- package/dist/components/popper/popper-anchor.js +1 -1
- package/dist/components/popper/popper-positioner.vue.d.ts +2 -2
- package/dist/components/popper/types.d.ts +1 -1
- package/dist/components/range-calendar/context.d.ts +9 -0
- package/dist/components/range-calendar/context.js +1 -0
- package/dist/components/range-calendar/index.d.ts +16 -0
- package/dist/components/range-calendar/index.js +1 -0
- package/dist/components/range-calendar/range-calendar-cell-trigger.js +1 -0
- package/dist/components/range-calendar/range-calendar-cell-trigger.vue.d.ts +33 -0
- package/dist/components/range-calendar/range-calendar-cell.js +1 -0
- package/dist/components/range-calendar/range-calendar-cell.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-compact.js +1 -0
- package/dist/components/range-calendar/range-calendar-compact.vue.d.ts +25 -0
- package/dist/components/range-calendar/range-calendar-grid-body.js +1 -0
- package/dist/components/range-calendar/range-calendar-grid-body.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-grid-head.js +1 -0
- package/dist/components/range-calendar/range-calendar-grid-head.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-grid-row.js +1 -0
- package/dist/components/range-calendar/range-calendar-grid-row.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-grid.js +1 -0
- package/dist/components/range-calendar/range-calendar-grid.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-head-cell.js +1 -0
- package/dist/components/range-calendar/range-calendar-head-cell.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-header.js +1 -0
- package/dist/components/range-calendar/range-calendar-header.vue.d.ts +21 -0
- package/dist/components/range-calendar/range-calendar-heading.js +1 -0
- package/dist/components/range-calendar/range-calendar-heading.vue.d.ts +22 -0
- package/dist/components/range-calendar/range-calendar-next.js +1 -0
- package/dist/components/range-calendar/range-calendar-next.vue.d.ts +24 -0
- package/dist/components/range-calendar/range-calendar-prev.js +1 -0
- package/dist/components/range-calendar/range-calendar-prev.vue.d.ts +24 -0
- package/dist/components/range-calendar/range-calendar-root.js +1 -0
- package/dist/components/range-calendar/range-calendar-root.vue.d.ts +55 -0
- package/dist/components/range-calendar/types.d.ts +158 -0
- package/dist/components/range-calendar/use-range-calendar.js +1 -0
- package/dist/components/roving-focus/roving-focus-group.vue.d.ts +1 -1
- package/dist/components/slider/slider-root.vue.d.ts +1 -1
- package/dist/components/splitter/splitter-group.vue.d.ts +1 -1
- package/dist/components/splitter/splitter-panel.vue.d.ts +2 -2
- package/dist/components/stepper/index.d.ts +10 -9
- package/dist/components/stepper/index.js +1 -1
- package/dist/components/stepper/stepper-compact.js +1 -0
- package/dist/components/stepper/stepper-compact.vue.d.ts +19 -0
- package/dist/components/stepper/stepper-root.vue.d.ts +1 -1
- package/dist/components/stepper/types.d.ts +40 -2
- package/dist/components/table/table-compact.vue.d.ts +2 -2
- package/dist/components/tabs/tabs-root.vue.d.ts +1 -1
- package/dist/components/tags-input/tags-input-root.vue.d.ts +2 -2
- package/dist/components/time-field/context.d.ts +9 -0
- package/dist/components/time-field/context.js +1 -0
- package/dist/components/time-field/index.d.ts +5 -0
- package/dist/components/time-field/index.js +1 -0
- package/dist/components/time-field/time-field-input.js +1 -0
- package/dist/components/time-field/time-field-input.vue.d.ts +21 -0
- package/dist/components/time-field/time-field-root.js +1 -0
- package/dist/components/time-field/time-field-root.vue.d.ts +43 -0
- package/dist/components/time-field/types.d.ts +63 -0
- package/dist/components/time-picker/context.d.ts +9 -0
- package/dist/components/time-picker/context.js +1 -0
- package/dist/components/time-picker/index.d.ts +6 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/time-picker/time-picker-popup.js +1 -0
- package/dist/components/time-picker/time-picker-popup.vue.d.ts +27 -0
- package/dist/components/time-picker/time-picker-root.js +1 -0
- package/dist/components/time-picker/time-picker-root.vue.d.ts +45 -0
- package/dist/components/time-picker/time-picker-trigger.js +1 -0
- package/dist/components/time-picker/time-picker-trigger.vue.d.ts +21 -0
- package/dist/components/time-picker/types.d.ts +68 -0
- package/dist/components/time-range-field/context.d.ts +9 -0
- package/dist/components/time-range-field/context.js +1 -0
- package/dist/components/time-range-field/index.d.ts +6 -0
- package/dist/components/time-range-field/index.js +1 -0
- package/dist/components/time-range-field/time-range-field-compact.js +1 -0
- package/dist/components/time-range-field/time-range-field-compact.vue.d.ts +29 -0
- package/dist/components/time-range-field/time-range-field-input.js +1 -0
- package/dist/components/time-range-field/time-range-field-input.vue.d.ts +22 -0
- package/dist/components/time-range-field/time-range-field-root.js +1 -0
- package/dist/components/time-range-field/time-range-field-root.vue.d.ts +53 -0
- package/dist/components/time-range-field/types.d.ts +88 -0
- package/dist/components/time-range-picker/context.d.ts +9 -0
- package/dist/components/time-range-picker/context.js +1 -0
- package/dist/components/time-range-picker/index.d.ts +7 -0
- package/dist/components/time-range-picker/index.js +1 -0
- package/dist/components/time-range-picker/time-range-picker-compact.js +1 -0
- package/dist/components/time-range-picker/time-range-picker-compact.vue.d.ts +31 -0
- package/dist/components/time-range-picker/time-range-picker-popup.js +1 -0
- package/dist/components/time-range-picker/time-range-picker-popup.vue.d.ts +30 -0
- package/dist/components/time-range-picker/time-range-picker-root.js +1 -0
- package/dist/components/time-range-picker/time-range-picker-root.vue.d.ts +50 -0
- package/dist/components/time-range-picker/time-range-picker-trigger.js +1 -0
- package/dist/components/time-range-picker/time-range-picker-trigger.vue.d.ts +21 -0
- package/dist/components/time-range-picker/types.d.ts +103 -0
- package/dist/components/toast/shared.js +1 -1
- package/dist/components/toast/toaster.vue.d.ts +2 -2
- package/dist/components/toggle/toggle.vue.d.ts +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip-popup.js +1 -1
- package/dist/components/tooltip/tooltip-root.vue.d.ts +1 -1
- package/dist/components/year-picker/context.d.ts +9 -0
- package/dist/components/year-picker/context.js +1 -0
- package/dist/components/year-picker/index.d.ts +6 -0
- package/dist/components/year-picker/index.js +1 -0
- package/dist/components/year-picker/types.d.ts +63 -0
- package/dist/components/year-picker/year-picker-popup.js +1 -0
- package/dist/components/year-picker/year-picker-popup.vue.d.ts +36 -0
- package/dist/components/year-picker/year-picker-root.js +1 -0
- package/dist/components/year-picker/year-picker-root.vue.d.ts +39 -0
- package/dist/components/year-picker/year-picker-trigger.js +1 -0
- package/dist/components/year-picker/year-picker-trigger.vue.d.ts +21 -0
- package/dist/components/year-range-picker/context.d.ts +9 -0
- package/dist/components/year-range-picker/context.js +1 -0
- package/dist/components/year-range-picker/index.d.ts +6 -0
- package/dist/components/year-range-picker/index.js +1 -0
- package/dist/components/year-range-picker/types.d.ts +71 -0
- package/dist/components/year-range-picker/year-range-picker-popup.js +1 -0
- package/dist/components/year-range-picker/year-range-picker-popup.vue.d.ts +39 -0
- package/dist/components/year-range-picker/year-range-picker-root.js +1 -0
- package/dist/components/year-range-picker/year-range-picker-root.vue.d.ts +43 -0
- package/dist/components/year-range-picker/year-range-picker-trigger.js +1 -0
- package/dist/components/year-range-picker/year-range-picker-trigger.vue.d.ts +21 -0
- package/dist/composables/use-hide-others.d.ts +2 -1
- package/dist/composables/use-hide-others.js +1 -1
- package/dist/constants/components.d.ts +14 -0
- package/dist/constants/components.js +1 -1
- package/dist/date/comparators.d.ts +24 -14
- package/dist/date/comparators.js +1 -1
- package/dist/date/formatter.d.ts +27 -0
- package/dist/date/formatter.js +1 -0
- package/dist/date/index.d.ts +10 -4
- package/dist/date/index.js +1 -1
- package/dist/date/parser.d.ts +34 -0
- package/dist/date/parser.js +1 -0
- package/dist/date/parts.d.ts +15 -0
- package/dist/date/parts.js +1 -0
- package/dist/date/placeholders.d.ts +23 -0
- package/dist/date/placeholders.js +1 -0
- package/dist/date/segment.d.ts +7 -0
- package/dist/date/segment.js +1 -0
- package/dist/date/types.d.ts +34 -21
- package/dist/date/use-date-field.d.ts +50 -0
- package/dist/date/use-date-field.js +1 -0
- package/dist/date/utils.d.ts +15 -1
- package/dist/date/utils.js +1 -1
- package/dist/index.d.ts +419 -335
- package/dist/index.js +1 -1
- package/dist/namespaced/index.d.ts +871 -717
- package/dist/namespaced/index.js +1 -1
- package/dist/node_modules/.pnpm/@soybeanjs_utils@0.1.1/node_modules/@soybeanjs/utils/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Alignment.d.ts +4 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Animations.d.ts +11 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Axis.d.ts +16 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Counter.d.ts +9 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragHandler.d.ts +13 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragTracker.d.ts +4 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EmblaCarousel.d.ts +31 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Engine.d.ts +67 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventHandler.d.ts +29 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventStore.d.ts +10 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Limit.d.ts +13 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/NodeRects.d.ts +11 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Options.d.ts +43 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/OptionsHandler.d.ts +11 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/PercentOfView.d.ts +6 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Plugins.d.ts +20 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ResizeHandler.d.ts +11 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBody.d.ts +14 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBounds.d.ts +8 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollContain.d.ts +4 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollLooper.d.ts +6 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollProgress.d.ts +6 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTarget.d.ts +12 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTo.d.ts +7 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideFocus.d.ts +10 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideLooper.d.ts +19 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideRegistry.d.ts +6 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesHandler.d.ts +11 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesInView.d.ts +9 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesToScroll.d.ts +7 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Translate.d.ts +8 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Vector1d.d.ts +9 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/utils.d.ts +4 -0
- package/dist/shared/index.d.ts +2 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/time-picker.d.ts +30 -0
- package/dist/shared/time-picker.js +1 -0
- package/package.json +8 -8
- package/dist/components/autocomplete/autocomplete-anchor.js +0 -1
- package/dist/components/autocomplete/autocomplete-content.js +0 -1
- package/dist/components/autocomplete/autocomplete-content.vue.d.ts +0 -24
- package/dist/components/autocomplete/autocomplete-group-label.js +0 -1
- package/dist/components/autocomplete/autocomplete-group-label.vue.d.ts +0 -18
- package/dist/components/autocomplete/autocomplete-group.js +0 -1
- package/dist/components/autocomplete/autocomplete-group.vue.d.ts +0 -18
- package/dist/components/autocomplete/autocomplete-item-indicator.js +0 -1
- package/dist/components/autocomplete/autocomplete-item-indicator.vue.d.ts +0 -18
- package/dist/components/autocomplete/autocomplete-item.js +0 -1
- package/dist/components/autocomplete/autocomplete-item.vue.d.ts +0 -26
- package/dist/components/autocomplete/autocomplete-separator.js +0 -1
- package/dist/components/autocomplete/autocomplete-separator.vue.d.ts +0 -18
- package/dist/components/autocomplete/autocomplete-trigger.js +0 -1
- package/dist/components/autocomplete/autocomplete-viewport.js +0 -1
- package/dist/components/autocomplete/autocomplete-viewport.vue.d.ts +0 -18
- package/dist/components/combobox/combobox-anchor.js +0 -1
- package/dist/components/combobox/combobox-anchor.vue.d.ts +0 -18
- package/dist/components/combobox/combobox-group-label.js +0 -1
- package/dist/components/combobox/combobox-group-label.vue.d.ts +0 -18
- package/dist/components/combobox/combobox-item-indicator.js +0 -1
- package/dist/node_modules/.pnpm/@soybeanjs_utils@0.1.0/node_modules/@soybeanjs/utils/dist/index.js +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Direction, UiClass } from "../../types/common.js";
|
|
2
|
+
import { FormFieldCommonProps } from "../../types/component.js";
|
|
3
|
+
import { PropsToContext } from "../../types/vue.js";
|
|
4
|
+
import { PrimitiveProps } from "../primitive/types.js";
|
|
5
|
+
import { DateRange, Grid } from "../../date/types.js";
|
|
6
|
+
import { Formatter } from "../../date/formatter.js";
|
|
7
|
+
import { ComputedRef, HTMLAttributes, ShallowRef } from "vue";
|
|
8
|
+
import { DateValue } from "@internationalized/date";
|
|
9
|
+
|
|
10
|
+
//#region src/components/year-range-picker/types.d.ts
|
|
11
|
+
interface YearRangePickerRootProps extends PrimitiveProps, FormFieldCommonProps, /** @vue-ignore */Omit<HTMLAttributes, 'placeholder'> {
|
|
12
|
+
defaultValue?: DateRange;
|
|
13
|
+
defaultPlaceholder?: DateValue;
|
|
14
|
+
placeholder?: DateValue;
|
|
15
|
+
modelValue?: DateRange;
|
|
16
|
+
minValue?: DateValue;
|
|
17
|
+
maxValue?: DateValue;
|
|
18
|
+
locale?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
readonly?: boolean;
|
|
21
|
+
id?: string;
|
|
22
|
+
dir?: Direction;
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
open?: boolean;
|
|
25
|
+
modal?: boolean;
|
|
26
|
+
}
|
|
27
|
+
type YearRangePickerRootEmits = {
|
|
28
|
+
'update:modelValue': [range: DateRange];
|
|
29
|
+
'update:placeholder': [date: DateValue];
|
|
30
|
+
'update:startValue': [date: DateValue | undefined];
|
|
31
|
+
'update:endValue': [date: DateValue | undefined];
|
|
32
|
+
'update:open': [open: boolean];
|
|
33
|
+
};
|
|
34
|
+
interface YearRangePickerTriggerProps extends PrimitiveProps, /** @vue-ignore */HTMLAttributes {}
|
|
35
|
+
interface YearRangePickerPopupProps extends PrimitiveProps, /** @vue-ignore */HTMLAttributes {}
|
|
36
|
+
interface YearRangePickerRootContext extends PropsToContext<YearRangePickerRootProps, 'disabled' | 'readonly'> {
|
|
37
|
+
locale: ComputedRef<string>;
|
|
38
|
+
dir: ComputedRef<Direction>;
|
|
39
|
+
modelValue: ShallowRef<DateRange>;
|
|
40
|
+
placeholder: ShallowRef<DateValue>;
|
|
41
|
+
isInvalid: ComputedRef<boolean>;
|
|
42
|
+
formatter: Formatter;
|
|
43
|
+
open: ShallowRef<boolean | undefined>;
|
|
44
|
+
popupId: string;
|
|
45
|
+
displayValue: ComputedRef<string>;
|
|
46
|
+
headingValue: ComputedRef<string>;
|
|
47
|
+
focusedYear: ShallowRef<DateValue>;
|
|
48
|
+
hoveredYear: ShallowRef<DateValue | undefined>;
|
|
49
|
+
yearGrid: ComputedRef<Grid<DateValue>>;
|
|
50
|
+
minValue: ComputedRef<DateValue | undefined>;
|
|
51
|
+
maxValue: ComputedRef<DateValue | undefined>;
|
|
52
|
+
hasSelectedRange: ComputedRef<boolean>;
|
|
53
|
+
onRangeChange: (date: DateValue) => void;
|
|
54
|
+
onPlaceholderChange: (date: DateValue) => void;
|
|
55
|
+
isYearDisabled: (date: DateValue) => boolean;
|
|
56
|
+
isYearSelected: (date: DateValue) => boolean;
|
|
57
|
+
isYearHighlighted: (date: DateValue) => boolean;
|
|
58
|
+
isRangeStart: (date: DateValue) => boolean;
|
|
59
|
+
isRangeEnd: (date: DateValue) => boolean;
|
|
60
|
+
setOpen: (value: boolean) => void;
|
|
61
|
+
setFocusedYear: (date: DateValue) => void;
|
|
62
|
+
setHoveredYear: (date: DateValue | undefined) => void;
|
|
63
|
+
prevPage: () => void;
|
|
64
|
+
nextPage: () => void;
|
|
65
|
+
isPrevButtonDisabled: () => boolean;
|
|
66
|
+
isNextButtonDisabled: () => boolean;
|
|
67
|
+
}
|
|
68
|
+
type YearRangePickerUiSlot = 'root' | 'trigger' | 'popup' | 'header' | 'heading' | 'prev' | 'next' | 'grid' | 'cellTrigger';
|
|
69
|
+
type YearRangePickerUi = UiClass<YearRangePickerUiSlot>;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { YearRangePickerPopupProps, YearRangePickerRootContext, YearRangePickerRootEmits, YearRangePickerRootProps, YearRangePickerTriggerProps, YearRangePickerUi, YearRangePickerUiSlot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{Primitive as t}from"../primitive/primitive.js";import"../primitive/index.js";import{useYearRangePickerRootContext as n,useYearRangePickerUi as r}from"./context.js";import{Fragment as i,createBlock as ee,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,defineComponent as l,nextTick as u,normalizeClass as d,openBlock as f,renderList as p,renderSlot as m,toDisplayString as h,unref as g,useId as te,watch as ne,withCtx as re}from"vue";const ie=[`data-disabled`,`disabled`],_=[`id`],v=[`data-disabled`,`disabled`],y=[`aria-label`,`aria-pressed`,`data-disabled`,`data-focused`,`data-highlighted`,`data-range-end`,`data-range-start`,`data-selected`,`data-year-value`,`disabled`,`tabindex`,`onClick`,`onFocus`,`onKeydown`,`onMouseenter`],b=l({name:`YearRangePickerPopup`,__name:`year-range-picker-popup`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(l){let b=r(`popup`),ae=r(`header`),oe=r(`heading`),x=r(`prev`),S=r(`next`),C=r(`grid`),w=r(`cellTrigger`),{dir:T,focusedYear:E,formatter:D,headingValue:O,isNextButtonDisabled:k,isPrevButtonDisabled:A,isRangeEnd:j,isRangeStart:M,isYearDisabled:N,isYearHighlighted:P,isYearSelected:F,modelValue:I,nextPage:L,onRangeChange:R,open:z,popupId:B,prevPage:V,setFocusedYear:H,setHoveredYear:U,yearGrid:W}=n(`YearRangePickerPopup`),[G,K]=e(),q=te(),J=W,se=e=>{(G.value?.querySelector(`[data-year-value='${e.toString()}']`))?.focus()},Y=(e,t)=>{let n=e;for(;n>=0&&n<J.value.cells.length;){let e=J.value.cells[n];if(!N(e))return H(e),u(()=>{se(e)}),!0;n+=t}return!1},X=e=>{let t=J.value.cells.findIndex(t=>t.year===e.year),n=t===-1?0:t;Y(n,1)||Y(n,-1)},ce=(e,t)=>{if(t>0){if(k())return;L()}else{if(A())return;V()}u(()=>{Y(e,t)})},Z=(e,t)=>{let n=e+t,r=t>=0?1:-1;if(n>=0&&n<J.value.cells.length){Y(n,r);return}ce(n<0?J.value.cells.length+n:n-J.value.cells.length,r)},Q=()=>{A()||(V(),u(()=>{X(E.value)}))},$=()=>{k()||(L(),u(()=>{X(E.value)}))},le=e=>{H(e)},ue=e=>{I.value.start&&!I.value.end&&!N(e)&&U(e)},de=e=>{N(e)||R(e)},fe=(e,t,n)=>{if(N(e))return;let r=T.value===`rtl`?-1:1;switch(n.key){case`ArrowRight`:n.preventDefault(),Z(t,r);break;case`ArrowLeft`:n.preventDefault(),Z(t,-r);break;case`ArrowDown`:n.preventDefault(),Z(t,4);break;case`ArrowUp`:n.preventDefault(),Z(t,-4);break;case`Home`:n.preventDefault(),Y(t-t%4,1);break;case`End`:n.preventDefault(),Y(t+(3-t%4),-1);break;case`PageUp`:n.preventDefault(),Q();break;case`PageDown`:n.preventDefault(),$();break;case`Enter`:case` `:n.preventDefault(),R(e);break;default:break}};return ne(()=>z.value,e=>{e&&u(()=>{X(E.value)})}),(e,n)=>g(z)?(f(),ee(g(t),{key:0,id:g(B),ref:g(K),as:l.as,"as-child":l.asChild,"aria-labelledby":g(q),class:d(g(b)),"data-slot":`popup`,role:`dialog`,onMouseleave:n[0]||(n[0]=e=>g(U)(void 0))},{default:re(()=>[s(`div`,{class:d(g(ae)),"data-slot":`header`},[s(`button`,{"aria-label":`Previous years`,class:d(g(x)),"data-disabled":g(A)()?``:void 0,"data-slot":`prev`,disabled:g(A)(),type:`button`,onClick:Q},[m(e.$slots,`prev`,{disabled:g(A)()},()=>[n[1]||(n[1]=c(`Prev`,-1))])],10,ie),s(`div`,{id:g(q),class:d(g(oe)),"data-slot":`heading`},[m(e.$slots,`heading`,{headingValue:g(O)},()=>[c(h(g(O)),1)])],10,_),s(`button`,{"aria-label":`Next years`,class:d(g(S)),"data-disabled":g(k)()?``:void 0,"data-slot":`next`,disabled:g(k)(),type:`button`,onClick:$},[m(e.$slots,`next`,{disabled:g(k)()},()=>[n[2]||(n[2]=c(`Next`,-1))])],10,v)],2),s(`div`,{class:d(g(C)),"data-slot":`grid`},[(f(!0),o(i,null,p(g(J).cells,(t,n)=>(f(),o(`button`,{key:t.toString(),"aria-label":g(D).fullYear(new Date(t.year,0,1)),"aria-pressed":g(F)(t)?!0:void 0,class:d(g(w)),"data-disabled":g(N)(t)?``:void 0,"data-focused":t.year===g(E).year?``:void 0,"data-highlighted":g(P)(t)?``:void 0,"data-range-end":g(j)(t)?``:void 0,"data-range-start":g(M)(t)?``:void 0,"data-selected":g(F)(t)?``:void 0,"data-slot":`cell-trigger`,"data-year-value":t.toString(),disabled:g(N)(t),tabindex:t.year===g(E).year&&!g(N)(t)?0:-1,type:`button`,onClick:e=>de(t),onFocus:e=>le(t),onKeydown:e=>fe(t,n,e),onMouseenter:e=>ue(t)},[m(e.$slots,`year`,{date:t,disabled:g(N)(t),focused:t.year===g(E).year,highlighted:g(P)(t),label:String(t.year),rangeEnd:g(j)(t),rangeStart:g(M)(t),selected:g(F)(t)},()=>[c(h(t.year),1)])],42,y))),128))],2)]),_:3},8,[`id`,`as`,`as-child`,`aria-labelledby`,`class`])):a(`v-if`,!0)}});export{b as default};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AsTag } from "../primitive/types.js";
|
|
2
|
+
import { YearRangePickerPopupProps } from "./types.js";
|
|
3
|
+
import * as _$vue from "vue";
|
|
4
|
+
import { DateValue } from "@internationalized/date";
|
|
5
|
+
|
|
6
|
+
//#region src/components/year-range-picker/year-range-picker-popup.vue.d.ts
|
|
7
|
+
type __VLS_Slots = {
|
|
8
|
+
heading?: (props: {
|
|
9
|
+
headingValue: string;
|
|
10
|
+
}) => any;
|
|
11
|
+
prev?: (props: {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}) => any;
|
|
14
|
+
next?: (props: {
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
}) => any;
|
|
17
|
+
year?: (props: {
|
|
18
|
+
date: DateValue;
|
|
19
|
+
label: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
focused: boolean;
|
|
22
|
+
highlighted: boolean;
|
|
23
|
+
rangeEnd: boolean;
|
|
24
|
+
rangeStart: boolean;
|
|
25
|
+
selected: boolean;
|
|
26
|
+
}) => any;
|
|
27
|
+
};
|
|
28
|
+
declare const __VLS_base: _$vue.DefineComponent<YearRangePickerPopupProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<YearRangePickerPopupProps> & Readonly<{}>, {
|
|
29
|
+
as: AsTag | _$vue.Component;
|
|
30
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { _default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNullish as e}from"../../shared/guard.js";import{getDefaultDate as t,isYearBetweenInclusive as n,toDate as r}from"../../date/comparators.js";import{createYearGrid as i}from"../../date/calendar.js";import{useDateFormatter as a}from"../../date/formatter.js";import"../../date/index.js";import"../../shared/index.js";import{useControllableState as o}from"../../composables/use-controllable-state.js";import"../../composables/index.js";import{useDirection as s,useLocale as c}from"../config-provider/context.js";import{Primitive as l}from"../primitive/primitive.js";import"../primitive/index.js";import{provideYearRangePickerRootContext as u,useYearRangePickerUi as d}from"./context.js";import{computed as f,createBlock as p,defineComponent as m,normalizeClass as h,openBlock as g,renderSlot as _,shallowRef as v,unref as y,useId as b,watch as x,withCtx as S}from"vue";const C=m({name:`YearRangePickerRoot`,__name:`year-range-picker-root`,props:{defaultValue:{default:void 0},defaultPlaceholder:{default:void 0},placeholder:{default:void 0},modelValue:{},minValue:{},maxValue:{},locale:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},id:{},dir:{},defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},modal:{type:Boolean,default:!1},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:placeholder`,`update:startValue`,`update:endValue`,`update:open`],setup(m,{emit:C}){let w=m,T=C,E=d(`root`),D=b(),O=c(()=>w.locale),k=s(()=>w.dir),A=a(O.value),j=e=>e.set({month:1,day:1}),M=o(()=>w.modelValue,e=>{T(`update:modelValue`,e),T(`update:startValue`,e.start),T(`update:endValue`,e.end)},w.defaultValue?{start:w.defaultValue.start?j(w.defaultValue.start):void 0,end:w.defaultValue.end?j(w.defaultValue.end):void 0}:{}),N=j(t({defaultPlaceholder:w.placeholder,defaultValue:M.value.start,locale:w.locale})),P=o(()=>w.placeholder,e=>T(`update:placeholder`,e),w.defaultPlaceholder?j(w.defaultPlaceholder):N.copy()),F=o(()=>w.open,e=>T(`update:open`,e??!1),w.defaultOpen),I=v(j(M.value.end??M.value.start??P.value)),L=v(),R=f(()=>i({dateObj:P.value,yearsPerPage:12,decadeAligned:!0})),z=f(()=>w.minValue?j(w.minValue):void 0),B=f(()=>w.maxValue?j(w.maxValue):void 0),V=(e,t)=>e.year<=t.year?{start:e.copy(),end:t.copy()}:{start:t.copy(),end:e.copy()},H=e=>!!(w.disabled||z.value&&e.year<z.value.year||B.value&&e.year>B.value.year),U=e=>M.value.start?e.year===M.value.start.year:!1,W=e=>M.value.end?e.year===M.value.end.year:!1,G=e=>{let{start:t,end:r}=M.value;return!t&&!r?!1:t&&!r?e.year===t.year:t&&r?n(e,t,r):!1},K=e=>{let{start:t,end:r}=M.value;if(!t||r||!L.value)return!1;let i=V(t,L.value);return n(e,i.start,i.end)},q=f(()=>{let{start:e,end:t}=M.value;return!!(e&&H(e)||t&&H(t)||e&&t&&t.year<e.year)}),J=f(()=>{let{start:e,end:t}=M.value;return e&&t?`${A.fullYear(r(e))} – ${A.fullYear(r(t))}`:e?`${A.fullYear(r(e))} – ...`:``}),Y=f(()=>{let e=R.value.cells[0],t=R.value.cells.at(-1);return!e||!t?``:`${e.year} - ${t.year}`}),X=f(()=>!e(M.value.start)&&!e(M.value.end)),Z=e=>{let t=j(e);P.value=t.copy(),I.value=t.copy()};return x(O,e=>{A.getLocale()!==e&&A.setLocale(e)}),x(()=>M.value.start,e=>{e&&P.value.year!==e.year&&(P.value=e.copy())}),x(M,e=>{I.value=(e.end??e.start??P.value).copy()},{deep:!0}),u({locale:O,dir:k,modelValue:M,placeholder:P,isInvalid:q,formatter:A,open:F,popupId:D,displayValue:J,headingValue:Y,focusedYear:I,hoveredYear:L,yearGrid:R,minValue:z,maxValue:B,hasSelectedRange:X,onRangeChange:e=>{let t=j(e);if(w.readonly||H(t))return;let{start:n,end:r}=M.value;if(!n||r){M.value={start:t.copy(),end:void 0},I.value=t.copy(),L.value=void 0,Z(t);return}let i=V(n,t);M.value=i,I.value=t.copy(),L.value=void 0,Z(i.start),F.value=!1},onPlaceholderChange:Z,isYearDisabled:H,isYearSelected:G,isYearHighlighted:K,isRangeStart:U,isRangeEnd:W,setOpen(e){F.value=e},setFocusedYear:e=>{I.value=j(e).copy()},setHoveredYear:e=>{L.value=e?j(e).copy():void 0},prevPage:()=>{Z(P.value.subtract({years:12}))},nextPage:()=>{Z(P.value.add({years:12}))},isPrevButtonDisabled:()=>w.disabled?!0:z.value?R.value.cells[0].subtract({years:1}).year<z.value.year:!1,isNextButtonDisabled:()=>{if(w.disabled)return!0;if(!B.value)return!1;let e=R.value.cells.at(-1)?.add({years:1});return!e||e.year>B.value.year},disabled:f(()=>w.disabled),readonly:f(()=>w.readonly)}),(e,t)=>(g(),p(y(l),{as:m.as,"as-child":m.asChild,class:h(y(E)),"data-disabled":m.disabled?``:void 0,"data-invalid":q.value?``:void 0,"data-readonly":m.readonly?``:void 0,dir:y(k),"data-slot":`root`},{default:S(()=>[_(e.$slots,`default`,{displayValue:J.value,modelValue:y(M),open:!!y(F)})]),_:3},8,[`as`,`as-child`,`class`,`data-disabled`,`data-invalid`,`data-readonly`,`dir`]))}});export{C as default};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DateRange, DateValue } from "../../date/types.js";
|
|
2
|
+
import { YearRangePickerRootProps } from "./types.js";
|
|
3
|
+
import * as _$vue from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/components/year-range-picker/year-range-picker-root.vue.d.ts
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
default?: (props: {
|
|
8
|
+
displayValue: string;
|
|
9
|
+
modelValue: DateRange;
|
|
10
|
+
open: boolean;
|
|
11
|
+
}) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: _$vue.DefineComponent<YearRangePickerRootProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (range: DateRange) => any;
|
|
15
|
+
"update:placeholder": (date: DateValue) => any;
|
|
16
|
+
"update:open": (open: boolean) => any;
|
|
17
|
+
"update:startValue": (date: DateValue | undefined) => any;
|
|
18
|
+
"update:endValue": (date: DateValue | undefined) => any;
|
|
19
|
+
}, string, _$vue.PublicProps, Readonly<YearRangePickerRootProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((range: DateRange) => any) | undefined;
|
|
21
|
+
"onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
|
|
22
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
23
|
+
"onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
|
|
24
|
+
"onUpdate:endValue"?: ((date: DateValue | undefined) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
placeholder: DateValue;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
defaultValue: DateRange;
|
|
29
|
+
defaultPlaceholder: DateValue;
|
|
30
|
+
readonly: boolean;
|
|
31
|
+
open: boolean;
|
|
32
|
+
defaultOpen: boolean;
|
|
33
|
+
modal: boolean;
|
|
34
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { _default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import{useYearRangePickerRootContext as t,useYearRangePickerUi as n}from"./context.js";import{createBlock as r,defineComponent as i,normalizeClass as a,openBlock as o,renderSlot as s,unref as c,withCtx as l}from"vue";const u=i({name:`YearRangePickerTrigger`,__name:`year-range-picker-trigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(i){let u=n(`trigger`),{disabled:d,readonly:f,open:p,setOpen:m,popupId:h}=t(`YearRangePickerTrigger`),g=()=>{d.value||f.value||m(!p.value)};return(t,n)=>(o(),r(c(e),{as:i.as,"as-child":i.asChild,"aria-controls":c(h),"aria-disabled":c(d)?!0:void 0,"aria-expanded":!!c(p),class:a(c(u)),"data-disabled":c(d)?``:void 0,"data-state":c(p)?`open`:`closed`,"data-slot":`trigger`,type:`button`,onClick:g},{default:l(()=>[s(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-controls`,`aria-disabled`,`aria-expanded`,`class`,`data-disabled`,`data-state`]))}});export{u as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AsTag } from "../primitive/types.js";
|
|
2
|
+
import { YearRangePickerTriggerProps } from "./types.js";
|
|
3
|
+
import * as _$vue from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/components/year-range-picker/year-range-picker-trigger.vue.d.ts
|
|
6
|
+
declare var __VLS_10: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_10) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: _$vue.DefineComponent<YearRangePickerTriggerProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<YearRangePickerTriggerProps> & Readonly<{}>, {
|
|
11
|
+
as: AsTag | _$vue.Component;
|
|
12
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { _default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MaybeArray } from "../types/common.js";
|
|
1
2
|
import { MaybeRefOrGetter } from "vue";
|
|
2
3
|
|
|
3
4
|
//#region src/composables/use-hide-others.d.ts
|
|
@@ -9,6 +10,6 @@ import { MaybeRefOrGetter } from "vue";
|
|
|
9
10
|
* @param target - reference to the element that you want to hide other elements when it is clicked or focused.
|
|
10
11
|
* @param enabled - whether to enable the hide others functionality (supports reactive values)
|
|
11
12
|
*/
|
|
12
|
-
declare function useHideOthers(target: MaybeRefOrGetter<HTMLElement | undefined
|
|
13
|
+
declare function useHideOthers(target: MaybeRefOrGetter<MaybeArray<HTMLElement | null | undefined>>, enabled?: MaybeRefOrGetter<boolean | undefined>): void;
|
|
13
14
|
//#endregion
|
|
14
15
|
export { useHideOthers };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isClient as e}from"../shared/env.js";import"../shared/index.js";import{onWatcherCleanup as
|
|
1
|
+
import{isClient as e}from"../shared/env.js";import"../shared/index.js";import{i as t}from"../node_modules/.pnpm/@soybeanjs_utils@0.1.1/node_modules/@soybeanjs/utils/dist/index.js";import{onWatcherCleanup as n,toValue as r,watchPostEffect as i}from"vue";import{hideOthers as a}from"aria-hidden";function o(o,s=!0){i(()=>{if(!e)return;let i=r(o),c=t(Array.isArray(i)?i:[i]);if(c.length===0||c.some(e=>e.closest(`[popover]:not(:popover-open)`))||!r(s)||import.meta.env.MODE===`test`)return;let l=a(c);n(()=>{l()})})}export{o as useHideOthers};
|
|
@@ -13,6 +13,7 @@ declare const components: {
|
|
|
13
13
|
bottomSheet: string[];
|
|
14
14
|
breadcrumb: string[];
|
|
15
15
|
button: string[];
|
|
16
|
+
calendar: string[];
|
|
16
17
|
card: string[];
|
|
17
18
|
carousel: string[];
|
|
18
19
|
checkbox: string[];
|
|
@@ -28,6 +29,10 @@ declare const components: {
|
|
|
28
29
|
command: string[];
|
|
29
30
|
configProvider: string[];
|
|
30
31
|
contextMenu: string[];
|
|
32
|
+
dateField: string[];
|
|
33
|
+
datePicker: string[];
|
|
34
|
+
dateRangeField: string[];
|
|
35
|
+
dateRangePicker: string[];
|
|
31
36
|
dialog: string[];
|
|
32
37
|
dropdownMenu: string[];
|
|
33
38
|
editable: string[];
|
|
@@ -45,6 +50,8 @@ declare const components: {
|
|
|
45
50
|
link: string[];
|
|
46
51
|
menu: string[];
|
|
47
52
|
menubar: string[];
|
|
53
|
+
monthPicker: string[];
|
|
54
|
+
monthRangePicker: string[];
|
|
48
55
|
navigationMenu: string[];
|
|
49
56
|
pageTabs: string[];
|
|
50
57
|
pagination: string[];
|
|
@@ -54,6 +61,7 @@ declare const components: {
|
|
|
54
61
|
primitive: string[];
|
|
55
62
|
progress: string[];
|
|
56
63
|
radioGroup: string[];
|
|
64
|
+
rangeCalendar: string[];
|
|
57
65
|
rovingFocus: string[];
|
|
58
66
|
scrollArea: string[];
|
|
59
67
|
segment: string[];
|
|
@@ -70,6 +78,10 @@ declare const components: {
|
|
|
70
78
|
tag: string[];
|
|
71
79
|
tagsInput: string[];
|
|
72
80
|
textarea: string[];
|
|
81
|
+
timeField: string[];
|
|
82
|
+
timePicker: string[];
|
|
83
|
+
timeRangeField: string[];
|
|
84
|
+
timeRangePicker: string[];
|
|
73
85
|
toast: string[];
|
|
74
86
|
toolbar: string[];
|
|
75
87
|
toggle: string[];
|
|
@@ -79,6 +91,8 @@ declare const components: {
|
|
|
79
91
|
treeMenu: string[];
|
|
80
92
|
virtualizer: string[];
|
|
81
93
|
visuallyHidden: string[];
|
|
94
|
+
yearPicker: string[];
|
|
95
|
+
yearRangePicker: string[];
|
|
82
96
|
};
|
|
83
97
|
//#endregion
|
|
84
98
|
export { components };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={accordion:[`AccordionCompact`,`AccordionRoot`,`AccordionItem`,`AccordionHeader`,`AccordionTrigger`,`AccordionContent`,`AccordionDescription`],affix:[`AffixCompact`,`AffixRoot`,`AffixPlaceholder`,`AffixContent`],alert:[`AlertCompact`,`AlertRoot`,`AlertContent`,`AlertTitle`,`AlertDescription`,`AlertClose`],anchor:[`AnchorCompact`,`AnchorLink`,`AnchorRoot`],arrow:[`Arrow`],aspectRatio:[`AspectRatio`],avatar:[`AvatarRoot`,`AvatarImage`,`AvatarFallback`],backtop:[`Backtop`],autocomplete:[`AutocompleteRoot`,`AutocompleteCompact`,`AutocompleteAnchor`,`AutocompleteInput`,`AutocompleteTrigger`,`AutocompletePortal`,`AutocompleteContent`,`AutocompleteViewport`,`AutocompleteGroup`,`AutocompleteGroupLabel`,`AutocompleteItem`,`AutocompleteItemIndicator`,`AutocompleteSeparator`],badge:[`BadgeRoot`,`BadgeContent`],bottomSheet:[`BottomSheetCompact`,`BottomSheetRoot`,`BottomSheetRootNested`,`BottomSheetOverlay`,`BottomSheetPortal`,`BottomSheetPopup`,`BottomSheetTrigger`,`BottomSheetHeader`,`BottomSheetContent`,`BottomSheetFooter`,`BottomSheetTitle`,`BottomSheetDescription`,`BottomSheetClose`,`BottomSheetCancel`,`BottomSheetConfirm`,`BottomSheetHandle`],breadcrumb:[`BreadcrumbRoot`,`BreadcrumbCompact`,`BreadcrumbList`,`BreadcrumbItem`,`BreadcrumbLink`,`BreadcrumbPage`,`BreadcrumbSeparator`,`BreadcrumbEllipsis`],button:[`Button`],card:[`CardRoot`,`CardHeader`,`CardTitle`,`CardTitleRoot`,`CardDescription`,`CardContent`,`CardFooter`,`CardCollapsibleTrigger`],carousel:[`CarouselContent`,`CarouselItem`,`CarouselNext`,`CarouselPrevious`,`CarouselRoot`],checkbox:[`CheckboxCompact`,`CheckboxCardCompact`,`CheckboxGroupCompact`,`CheckboxCardGroupCompact`,`CheckboxGroupRoot`,`CheckboxRoot`,`CheckboxControl`,`CheckboxIndicator`,`CheckboxLabel`],clipboard:[`Clipboard`],collapsible:[`CollapsibleRoot`,`CollapsibleContent`,`CollapsibleTrigger`],combobox:[`ComboboxRoot`,`ComboboxCompact`,`ComboboxAnchor`,`ComboboxTrigger`,`ComboboxCancel`,`ComboboxPortal`,`ComboboxContent`,`ComboboxArrow`,`ComboboxViewport`,`ComboboxInput`,`ComboboxGroup`,`ComboboxGroupLabel`,`ComboboxItem`,`ComboboxItemIndicator`,`ComboboxEmpty`,`ComboboxSeparator`,`ComboboxVirtualizer`],colorArea:[`ColorAreaRoot`,`ColorAreaArea`,`ColorAreaThumb`],colorField:[`ColorFieldRoot`,`ColorFieldInput`],colorPicker:[`ColorPickerRoot`],colorSlider:[`ColorSliderRoot`,`ColorSliderTrack`,`ColorSliderThumb`],colorSwatch:[`ColorSwatch`],colorSwatchPicker:[`ColorSwatchPickerRoot`,`ColorSwatchPickerItem`,`ColorSwatchPickerItemIndicator`,`ColorSwatchPickerItemSwatch`],command:[`CommandCompact`],configProvider:[`ConfigProvider`],contextMenu:[`ContextMenuRoot`,`ContextMenuTrigger`,`ContextMenuPortal`,`ContextMenuContent`,`ContextMenuAnchor`,`ContextMenuArrow`,`ContextMenuGroup`,`ContextMenuGroupLabel`,`ContextMenuItem`,`ContextMenuItemIndicator`,`ContextMenuCheckboxItem`,`ContextMenuRadioItem`,`ContextMenuSub`,`ContextMenuSubTrigger`,`ContextMenuSubContent`,`ContextMenuSeparator`,`ContextMenuCheckboxGroup`,`ContextMenuRadioGroup`,`ContextMenuCompact`,`ContextMenuCheckboxCompact`,`ContextMenuRadioCompact`,`ContextMenuWrapperCompact`],dialog:[`DialogCompact`,`DialogProvider`,`DialogRoot`,`DialogTrigger`,`DialogPortal`,`DialogOverlay`,`DialogPopup`,`DialogHeader`,`DialogContent`,`DialogTitle`,`DialogDescription`,`DialogFooter`,`DialogClose`,`DialogCancel`,`DialogConfirm`],dropdownMenu:[`DropdownMenuRoot`,`DropdownMenuTrigger`,`DropdownMenuPortal`,`DropdownMenuContent`,`DropdownMenuAnchor`,`DropdownMenuArrow`,`DropdownMenuGroup`,`DropdownMenuGroupLabel`,`DropdownMenuItem`,`DropdownMenuItemIndicator`,`DropdownMenuCheckboxItem`,`DropdownMenuRadioItem`,`DropdownMenuSub`,`DropdownMenuSubTrigger`,`DropdownMenuSubContent`,`DropdownMenuSeparator`,`DropdownMenuCheckboxGroup`,`DropdownMenuRadioGroup`,`DropdownMenuCompact`,`DropdownMenuCheckboxCompact`,`DropdownMenuRadioCompact`,`DropdownMenuWrapperCompact`],editable:[`EditableArea`,`EditableCancelTrigger`,`EditableEditTrigger`,`EditableInput`,`EditablePreview`,`EditableRoot`,`EditableSubmitTrigger`],empty:[`EmptyRoot`,`EmptyHeader`,`EmptyMedia`,`EmptyContent`,`EmptyTitle`,`EmptyDescription`],form:[`FormField`,`FormLabel`,`FormControl`,`FormDescription`,`FormError`],hoverCard:[`HoverCardRoot`,`HoverCardTrigger`,`HoverCardPortal`,`HoverCardPositioner`,`HoverCardPopup`,`HoverCardArrow`],input:[`InputRoot`,`InputControl`],inputNumber:[`InputNumberRoot`,`InputNumberControl`,`InputNumberIncrement`,`InputNumberDecrement`],inputOtp:[`InputOtpCompact`,`InputOtpInput`,`InputOtpPositioner`,`InputOtpRoot`],kbd:[`Kbd`],label:[`Label`],layout:[`LayoutCompact`,`LayoutClassicCompact`,`LayoutRoot`,`LayoutSidebar`,`LayoutRail`,`LayoutMain`,`LayoutHeader`,`LayoutTab`,`LayoutContent`,`LayoutFooter`,`LayoutMobile`,`LayoutTrigger`],list:[`ListRoot`,`ListItem`,`ListTitle`,`ListDescription`,`ListContent`],listbox:[`ListboxRoot`,`ListboxContent`,`ListboxGroup`,`ListboxGroupLabel`,`ListboxItem`,`ListboxItemIndicator`,`ListboxFilter`,`ListboxVirtualizer`],link:[`Link`],menu:[`MenuRoot`,`MenuPortal`,`MenuContent`,`MenuAnchor`,`MenuArrow`,`MenuGroup`,`MenuGroupLabel`,`MenuItem`,`MenuItemIndicator`,`MenuCheckboxItem`,`MenuRadioItem`,`MenuSub`,`MenuSubTrigger`,`MenuSubContent`,`MenuSeparator`,`MenuCheckboxGroup`,`MenuRadioGroup`,`MenuOptionCompact`,`MenuOptionsCompact`,`MenuCheckboxOptionsCompact`,`MenuRadioOptionsCompact`],menubar:[`MenubarRoot`,`MenubarMenu`,`MenubarTrigger`,`MenubarPortal`,`MenubarContent`,`MenubarArrow`,`MenubarGroup`,`MenubarGroupLabel`,`MenubarItem`,`MenubarItemIndicator`,`MenubarCheckboxItem`,`MenubarRadioItem`,`MenubarSub`,`MenubarSubTrigger`,`MenubarSubContent`,`MenubarSeparator`,`MenubarCheckboxGroup`,`MenubarRadioGroup`,`MenubarCompact`],navigationMenu:[`NavigationMenuRoot`,`NavigationMenuList`,`NavigationMenuItem`,`NavigationMenuTrigger`,`NavigationMenuContent`,`NavigationMenuLink`,`NavigationMenuSubList`,`NavigationMenuViewport`,`NavigationMenuIndicator`],pageTabs:[`PageTabsRoot`,`PageTabsItem`,`PageTabsClose`,`PageTabsPin`],pagination:[`PaginationRoot`,`PaginationList`,`PaginationListItem`,`PaginationFirst`,`PaginationPrev`,`PaginationNext`,`PaginationLast`,`PaginationEllipsis`],popover:[`PopoverRoot`,`PopoverTrigger`,`PopoverAnchor`,`PopoverPortal`,`PopoverPositioner`,`PopoverPopup`,`PopoverArrow`,`PopoverClose`],popper:[`PopperRoot`,`PopperAnchor`,`PopperPositioner`,`PopperPopup`,`PopperArrow`],portal:[`Portal`],primitive:[`Primitive`],progress:[`ProgressProvider`,`ProgressRoot`,`ProgressIndicator`,`ProgressCircle`],radioGroup:[`RadioGroupRoot`,`RadioGroupCompact`,`RadioGroupItem`,`RadioGroupControl`,`RadioGroupIndicator`,`RadioGroupLabel`],rovingFocus:[`RovingFocusGroup`,`RovingFocusItem`],scrollArea:[`ScrollAreaRoot`,`ScrollAreaViewport`,`ScrollAreaScrollbar`,`ScrollAreaThumb`,`ScrollAreaCorner`],segment:[`SegmentRoot`,`SegmentList`,`SegmentTrigger`,`SegmentIndicator`,`SegmentCompact`],select:[`SelectRoot`,`SelectCompact`,`SelectTrigger`,`SelectPortal`,`SelectContent`,`SelectViewport`,`SelectGroup`,`SelectGroupLabel`,`SelectItem`,`SelectItemIndicator`,`SelectItemText`,`SelectValue`,`SelectTriggerIcon`,`SelectScrollUpButton`,`SelectScrollDownButton`,`SelectSeparator`,`SelectArrow`],separator:[`SeparatorRoot`,`SeparatorLabel`],skeleton:[`Skeleton`],splitter:[`SplitterGroup`,`SplitterPanel`,`SplitterResizeHandle`],slider:[`SliderRoot`,`SliderTrack`,`SliderRange`,`SliderThumb`],slot:[`Slot`],stepper:[`StepperRoot`,`StepperItem`,`StepperTrigger`,`StepperIndicator`,`StepperSeparator`,`StepperTitle`,`StepperDescription`],switch:[`SwitchRoot`,`SwitchControl`,`SwitchThumb`],table:[`TableCompact`,`TableRoot`,`TableScroll`,`TableContent`,`TableHeader`,`TableBody`,`TableFooter`,`TableRow`,`TableHead`,`TableCell`],tabs:[`TabsRoot`,`TabsList`,`TabsTrigger`,`TabsContent`,`TabsIndicator`,`TabsCompact`],tag:[`Tag`],tagsInput:[`TagsInputRoot`,`TagsInputInput`,`TagsInputItem`,`TagsInputItemText`,`TagsInputItemDelete`,`TagsInputClear`],textarea:[`TextareaRoot`,`TextareaControl`,`TextareaCounter`],toast:[`Toaster`,`ToastProvider`],toolbar:[`ToolbarRoot`,`ToolbarButton`,`ToolbarLink`,`ToolbarSeparator`,`ToolbarToggleGroup`,`ToolbarToggleItem`],toggle:[`Toggle`],toggleGroup:[`ToggleGroupRoot`,`ToggleGroupItem`],tooltip:[`TooltipRoot`,`TooltipTrigger`,`TooltipPortal`,`TooltipPositioner`,`TooltipPopup`,`TooltipArrow`],tree:[`TreeRoot`,`TreeItem`,`TreeVirtualizerRoot`,`TreeVirtualizerItem`],treeMenu:[`TreeMenuRoot`,`TreeMenuGroupRoot`,`TreeMenuGroup`,`TreeMenuGroupLabel`,`TreeMenuItem`,`TreeMenuButton`,`TreeMenuCollapsible`,`TreeMenuSub`],virtualizer:[`VirtualizerRoot`,`VirtualizerContent`,`VirtualizerItem`],visuallyHidden:[`VisuallyHidden`,`VisuallyHiddenInput`]};export{e as components};
|
|
1
|
+
const e={accordion:[`AccordionCompact`,`AccordionRoot`,`AccordionItem`,`AccordionHeader`,`AccordionTrigger`,`AccordionContent`,`AccordionDescription`],affix:[`AffixCompact`,`AffixRoot`,`AffixPlaceholder`,`AffixContent`],alert:[`AlertCompact`,`AlertRoot`,`AlertContent`,`AlertTitle`,`AlertDescription`,`AlertClose`],anchor:[`AnchorCompact`,`AnchorLink`,`AnchorRoot`],arrow:[`Arrow`],aspectRatio:[`AspectRatio`],avatar:[`AvatarRoot`,`AvatarImage`,`AvatarFallback`],backtop:[`Backtop`],autocomplete:[`AutocompleteRoot`,`AutocompleteCompact`,`AutocompleteAnchor`,`AutocompleteInput`,`AutocompleteTrigger`,`AutocompletePortal`,`AutocompleteContent`,`AutocompleteViewport`,`AutocompleteGroup`,`AutocompleteGroupLabel`,`AutocompleteItem`,`AutocompleteItemIndicator`,`AutocompleteSeparator`],badge:[`BadgeRoot`,`BadgeContent`],bottomSheet:[`BottomSheetCompact`,`BottomSheetRoot`,`BottomSheetRootNested`,`BottomSheetOverlay`,`BottomSheetPortal`,`BottomSheetPopup`,`BottomSheetTrigger`,`BottomSheetHeader`,`BottomSheetContent`,`BottomSheetFooter`,`BottomSheetTitle`,`BottomSheetDescription`,`BottomSheetClose`,`BottomSheetCancel`,`BottomSheetConfirm`,`BottomSheetHandle`],breadcrumb:[`BreadcrumbRoot`,`BreadcrumbCompact`,`BreadcrumbList`,`BreadcrumbItem`,`BreadcrumbLink`,`BreadcrumbPage`,`BreadcrumbSeparator`,`BreadcrumbEllipsis`],button:[`Button`],calendar:[`CalendarCompact`,`CalendarRoot`,`CalendarHeader`,`CalendarHeading`,`CalendarPrev`,`CalendarNext`,`CalendarGrid`,`CalendarGridHead`,`CalendarGridBody`,`CalendarGridRow`,`CalendarHeadCell`,`CalendarCell`,`CalendarCellTrigger`],card:[`CardCompact`,`CardRoot`,`CardHeader`,`CardTitle`,`CardTitleRoot`,`CardDescription`,`CardContent`,`CardFooter`,`CardCollapsibleTrigger`],carousel:[`CarouselRoot`,`CarouselContent`,`CarouselItem`,`CarouselPrevious`,`CarouselNext`],checkbox:[`CheckboxCompact`,`CheckboxCardCompact`,`CheckboxGroupCompact`,`CheckboxCardGroupCompact`,`CheckboxGroupRoot`,`CheckboxRoot`,`CheckboxControl`,`CheckboxIndicator`,`CheckboxLabel`],clipboard:[`Clipboard`],collapsible:[`CollapsibleRoot`,`CollapsibleContent`,`CollapsibleTrigger`],combobox:[`ComboboxRoot`,`ComboboxCompact`,`ComboboxAnchor`,`ComboboxTrigger`,`ComboboxCancel`,`ComboboxPortal`,`ComboboxContent`,`ComboboxArrow`,`ComboboxViewport`,`ComboboxInput`,`ComboboxGroup`,`ComboboxGroupLabel`,`ComboboxItem`,`ComboboxItemIndicator`,`ComboboxEmpty`,`ComboboxSeparator`,`ComboboxVirtualizer`],colorArea:[`ColorAreaRoot`,`ColorAreaArea`,`ColorAreaThumb`],colorField:[`ColorFieldRoot`,`ColorFieldInput`],colorPicker:[`ColorPickerRoot`],colorSlider:[`ColorSliderRoot`,`ColorSliderTrack`,`ColorSliderThumb`],colorSwatch:[`ColorSwatch`],colorSwatchPicker:[`ColorSwatchPickerRoot`,`ColorSwatchPickerItem`,`ColorSwatchPickerItemIndicator`,`ColorSwatchPickerItemSwatch`],command:[`CommandCompact`],configProvider:[`ConfigProvider`],contextMenu:[`ContextMenuRoot`,`ContextMenuTrigger`,`ContextMenuPortal`,`ContextMenuContent`,`ContextMenuAnchor`,`ContextMenuArrow`,`ContextMenuGroup`,`ContextMenuGroupLabel`,`ContextMenuItem`,`ContextMenuItemIndicator`,`ContextMenuCheckboxItem`,`ContextMenuRadioItem`,`ContextMenuSub`,`ContextMenuSubTrigger`,`ContextMenuSubContent`,`ContextMenuSeparator`,`ContextMenuCheckboxGroup`,`ContextMenuRadioGroup`,`ContextMenuCompact`,`ContextMenuCheckboxCompact`,`ContextMenuRadioCompact`,`ContextMenuWrapperCompact`],dateField:[`DateFieldRoot`,`DateFieldInput`],datePicker:[`DatePickerRoot`,`DatePickerTrigger`,`DatePickerPopup`],dateRangeField:[`DateRangeFieldCompact`,`DateRangeFieldRoot`,`DateRangeFieldInput`],dateRangePicker:[`DateRangePickerCompact`,`DateRangePickerRoot`,`DateRangePickerTrigger`,`DateRangePickerPopup`],dialog:[`DialogCompact`,`DialogProvider`,`DialogRoot`,`DialogTrigger`,`DialogPortal`,`DialogOverlay`,`DialogPopup`,`DialogHeader`,`DialogContent`,`DialogTitle`,`DialogDescription`,`DialogFooter`,`DialogClose`,`DialogCancel`,`DialogConfirm`],dropdownMenu:[`DropdownMenuRoot`,`DropdownMenuTrigger`,`DropdownMenuPortal`,`DropdownMenuContent`,`DropdownMenuAnchor`,`DropdownMenuArrow`,`DropdownMenuGroup`,`DropdownMenuGroupLabel`,`DropdownMenuItem`,`DropdownMenuItemIndicator`,`DropdownMenuCheckboxItem`,`DropdownMenuRadioItem`,`DropdownMenuSub`,`DropdownMenuSubTrigger`,`DropdownMenuSubContent`,`DropdownMenuSeparator`,`DropdownMenuCheckboxGroup`,`DropdownMenuRadioGroup`,`DropdownMenuCompact`,`DropdownMenuCheckboxCompact`,`DropdownMenuRadioCompact`,`DropdownMenuWrapperCompact`],editable:[`EditableCompact`,`EditableArea`,`EditableCancelTrigger`,`EditableEditTrigger`,`EditableInput`,`EditablePreview`,`EditableRoot`,`EditableSubmitTrigger`],empty:[`EmptyRoot`,`EmptyHeader`,`EmptyMedia`,`EmptyContent`,`EmptyTitle`,`EmptyDescription`],form:[`FormField`,`FormLabel`,`FormControl`,`FormDescription`,`FormError`],hoverCard:[`HoverCardCompact`,`HoverCardRoot`,`HoverCardTrigger`,`HoverCardPortal`,`HoverCardPositioner`,`HoverCardPopup`,`HoverCardArrow`],input:[`InputRoot`,`InputControl`],inputNumber:[`InputNumberRoot`,`InputNumberControl`,`InputNumberIncrement`,`InputNumberDecrement`],inputOtp:[`InputOtpCompact`,`InputOtpInput`,`InputOtpPositioner`,`InputOtpRoot`],kbd:[`Kbd`],label:[`Label`],layout:[`LayoutCompact`,`LayoutClassicCompact`,`LayoutRoot`,`LayoutSidebar`,`LayoutRail`,`LayoutMain`,`LayoutHeader`,`LayoutTab`,`LayoutContent`,`LayoutFooter`,`LayoutMobile`,`LayoutTrigger`],list:[`ListRoot`,`ListItem`,`ListTitle`,`ListDescription`,`ListContent`],listbox:[`ListboxRoot`,`ListboxContent`,`ListboxGroup`,`ListboxGroupLabel`,`ListboxItem`,`ListboxItemIndicator`,`ListboxFilter`,`ListboxVirtualizer`],link:[`Link`],menu:[`MenuRoot`,`MenuPortal`,`MenuContent`,`MenuAnchor`,`MenuArrow`,`MenuGroup`,`MenuGroupLabel`,`MenuItem`,`MenuItemIndicator`,`MenuCheckboxItem`,`MenuRadioItem`,`MenuSub`,`MenuSubTrigger`,`MenuSubContent`,`MenuSeparator`,`MenuCheckboxGroup`,`MenuRadioGroup`,`MenuOptionCompact`,`MenuOptionsCompact`,`MenuCheckboxOptionsCompact`,`MenuRadioOptionsCompact`],menubar:[`MenubarRoot`,`MenubarMenu`,`MenubarTrigger`,`MenubarPortal`,`MenubarContent`,`MenubarArrow`,`MenubarGroup`,`MenubarGroupLabel`,`MenubarItem`,`MenubarItemIndicator`,`MenubarCheckboxItem`,`MenubarRadioItem`,`MenubarSub`,`MenubarSubTrigger`,`MenubarSubContent`,`MenubarSeparator`,`MenubarCheckboxGroup`,`MenubarRadioGroup`,`MenubarCompact`],monthPicker:[`MonthPickerRoot`,`MonthPickerTrigger`,`MonthPickerPopup`],monthRangePicker:[`MonthRangePickerRoot`,`MonthRangePickerTrigger`,`MonthRangePickerPopup`],navigationMenu:[`NavigationMenuCompact`,`NavigationMenuRoot`,`NavigationMenuList`,`NavigationMenuItem`,`NavigationMenuTrigger`,`NavigationMenuContent`,`NavigationMenuLink`,`NavigationMenuSubList`,`NavigationMenuViewport`,`NavigationMenuIndicator`],pageTabs:[`PageTabsRoot`,`PageTabsItem`,`PageTabsClose`,`PageTabsPin`],pagination:[`PaginationCompact`,`PaginationRoot`,`PaginationList`,`PaginationListItem`,`PaginationFirst`,`PaginationPrev`,`PaginationNext`,`PaginationLast`,`PaginationEllipsis`],popover:[`PopoverCompact`,`PopoverRoot`,`PopoverTrigger`,`PopoverAnchor`,`PopoverPortal`,`PopoverPositioner`,`PopoverPopup`,`PopoverArrow`,`PopoverClose`],popper:[`PopperRoot`,`PopperAnchor`,`PopperPositioner`,`PopperPopup`,`PopperArrow`],portal:[`Portal`],primitive:[`Primitive`],progress:[`ProgressProvider`,`ProgressRoot`,`ProgressIndicator`,`ProgressCircle`],radioGroup:[`RadioGroupRoot`,`RadioGroupCompact`,`RadioGroupItem`,`RadioGroupControl`,`RadioGroupIndicator`,`RadioGroupLabel`],rangeCalendar:[`RangeCalendarCompact`,`RangeCalendarRoot`,`RangeCalendarHeader`,`RangeCalendarHeading`,`RangeCalendarPrev`,`RangeCalendarNext`,`RangeCalendarGrid`,`RangeCalendarGridHead`,`RangeCalendarGridBody`,`RangeCalendarGridRow`,`RangeCalendarHeadCell`,`RangeCalendarCell`,`RangeCalendarCellTrigger`],rovingFocus:[`RovingFocusGroup`,`RovingFocusItem`],scrollArea:[`ScrollAreaRoot`,`ScrollAreaViewport`,`ScrollAreaScrollbar`,`ScrollAreaThumb`,`ScrollAreaCorner`],segment:[`SegmentRoot`,`SegmentList`,`SegmentTrigger`,`SegmentIndicator`,`SegmentCompact`],select:[`SelectRoot`,`SelectCompact`,`SelectTrigger`,`SelectPortal`,`SelectContent`,`SelectViewport`,`SelectGroup`,`SelectGroupLabel`,`SelectItem`,`SelectItemIndicator`,`SelectItemText`,`SelectValue`,`SelectTriggerIcon`,`SelectScrollUpButton`,`SelectScrollDownButton`,`SelectSeparator`,`SelectArrow`],separator:[`SeparatorRoot`,`SeparatorLabel`],skeleton:[`Skeleton`],splitter:[`SplitterGroup`,`SplitterPanel`,`SplitterResizeHandle`],slider:[`SliderRoot`,`SliderTrack`,`SliderRange`,`SliderThumb`],slot:[`Slot`],stepper:[`StepperCompact`,`StepperRoot`,`StepperItem`,`StepperTrigger`,`StepperIndicator`,`StepperSeparator`,`StepperTitle`,`StepperDescription`],switch:[`SwitchRoot`,`SwitchControl`,`SwitchThumb`],table:[`TableCompact`,`TableRoot`,`TableScroll`,`TableContent`,`TableHeader`,`TableBody`,`TableFooter`,`TableRow`,`TableHead`,`TableCell`],tabs:[`TabsRoot`,`TabsList`,`TabsTrigger`,`TabsContent`,`TabsIndicator`,`TabsCompact`],tag:[`Tag`],tagsInput:[`TagsInputRoot`,`TagsInputInput`,`TagsInputItem`,`TagsInputItemText`,`TagsInputItemDelete`,`TagsInputClear`],textarea:[`TextareaRoot`,`TextareaControl`,`TextareaCounter`],timeField:[`TimeFieldRoot`,`TimeFieldInput`],timePicker:[`TimePickerRoot`,`TimePickerTrigger`,`TimePickerPopup`],timeRangeField:[`TimeRangeFieldCompact`,`TimeRangeFieldRoot`,`TimeRangeFieldInput`],timeRangePicker:[`TimeRangePickerCompact`,`TimeRangePickerRoot`,`TimeRangePickerTrigger`,`TimeRangePickerPopup`],toast:[`Toaster`,`ToastProvider`],toolbar:[`ToolbarRoot`,`ToolbarButton`,`ToolbarLink`,`ToolbarSeparator`,`ToolbarToggleGroup`,`ToolbarToggleItem`],toggle:[`Toggle`],toggleGroup:[`ToggleGroupRoot`,`ToggleGroupItem`],tooltip:[`TooltipRoot`,`TooltipTrigger`,`TooltipPortal`,`TooltipPositioner`,`TooltipPopup`,`TooltipArrow`],tree:[`TreeRoot`,`TreeItem`,`TreeVirtualizerRoot`,`TreeVirtualizerItem`],treeMenu:[`TreeMenuRoot`,`TreeMenuGroupRoot`,`TreeMenuGroup`,`TreeMenuGroupLabel`,`TreeMenuItem`,`TreeMenuButton`,`TreeMenuCollapsible`,`TreeMenuSub`],virtualizer:[`VirtualizerRoot`,`VirtualizerContent`,`VirtualizerItem`],visuallyHidden:[`VisuallyHidden`,`VisuallyHiddenInput`],yearPicker:[`YearPickerRoot`,`YearPickerTrigger`,`YearPickerPopup`],yearRangePicker:[`YearRangePickerRoot`,`YearRangePickerTrigger`,`YearRangePickerPopup`]};export{e as components};
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { Matcher } from "./types.js";
|
|
2
|
-
import { CalendarDateTime, DateValue, ZonedDateTime } from "@internationalized/date";
|
|
1
|
+
import { Granularity, Matcher } from "./types.js";
|
|
2
|
+
import { CalendarDateTime, DateValue, Time, ZonedDateTime } from "@internationalized/date";
|
|
3
3
|
|
|
4
4
|
//#region src/date/comparators.d.ts
|
|
5
|
+
type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
|
5
6
|
declare function parseStringToDateValue(dateStr: string, referenceValue: DateValue): DateValue;
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
declare function
|
|
9
|
-
declare function
|
|
7
|
+
declare function isTime(dateValue: DateValue | TimeValue): dateValue is Time;
|
|
8
|
+
declare function toDate(dateValue: DateValue | TimeValue, tz?: string): Date;
|
|
9
|
+
declare function isCalendarDateTime(dateValue: DateValue | TimeValue): dateValue is CalendarDateTime;
|
|
10
|
+
declare function isZonedDateTime(dateValue: DateValue | TimeValue): dateValue is ZonedDateTime;
|
|
11
|
+
declare function hasTime(dateValue: DateValue | TimeValue): dateValue is CalendarDateTime | ZonedDateTime | Time;
|
|
10
12
|
declare function getDaysInMonth(date: Date | DateValue): number;
|
|
11
|
-
declare function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
declare function getDefaultDate(props: {
|
|
14
|
+
defaultValue?: DateValue | DateValue[];
|
|
15
|
+
defaultPlaceholder?: DateValue;
|
|
16
|
+
granularity?: Granularity;
|
|
17
|
+
locale?: string;
|
|
18
|
+
}): DateValue;
|
|
19
|
+
declare function getDefaultTime(props: {
|
|
20
|
+
defaultValue?: TimeValue;
|
|
21
|
+
defaultPlaceholder?: TimeValue;
|
|
22
|
+
}): TimeValue;
|
|
23
|
+
declare function isBefore(dateToCompare: DateValue | TimeValue, referenceDate: DateValue | TimeValue): boolean;
|
|
24
|
+
declare function isAfter(dateToCompare: DateValue | TimeValue, referenceDate: DateValue | TimeValue): boolean;
|
|
25
|
+
declare function isBeforeOrSame(dateToCompare: DateValue | TimeValue, referenceDate: DateValue | TimeValue): boolean;
|
|
26
|
+
declare function isAfterOrSame(dateToCompare: DateValue | TimeValue, referenceDate: DateValue | TimeValue): boolean;
|
|
27
|
+
declare function isEqualValue(a: DateValue | TimeValue, b: DateValue | TimeValue): boolean;
|
|
15
28
|
declare function isBetweenInclusive(date: DateValue, start: DateValue, end: DateValue): boolean;
|
|
16
29
|
declare function isBetween(date: DateValue, start: DateValue, end: DateValue): boolean;
|
|
17
30
|
declare function getLastFirstDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
|
|
@@ -23,8 +36,5 @@ declare function compareYearMonth(a: DateValue, b: DateValue): number;
|
|
|
23
36
|
declare function isMonthBetweenInclusive(date: DateValue, start: DateValue, end: DateValue): boolean;
|
|
24
37
|
declare function isYearBetweenInclusive(date: DateValue, start: DateValue, end: DateValue): boolean;
|
|
25
38
|
declare function getMonthsBetween(start: DateValue, end: DateValue): number;
|
|
26
|
-
declare function getYearsBetween(start: DateValue, end: DateValue): number;
|
|
27
|
-
declare function areAllMonthsBetweenValid(start: DateValue, end: DateValue, isUnavailable: Matcher | undefined, isDisabled: Matcher | undefined): boolean;
|
|
28
|
-
declare function areAllYearsBetweenValid(start: DateValue, end: DateValue, isUnavailable: Matcher | undefined, isDisabled: Matcher | undefined): boolean;
|
|
29
39
|
//#endregion
|
|
30
|
-
export { areAllDaysBetweenValid,
|
|
40
|
+
export { TimeValue, areAllDaysBetweenValid, compareYearMonth, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMonthsBetween, getNextLastDayOfWeek, hasTime, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqualValue, isMonthBetweenInclusive, isSameYear, isSameYearMonth, isTime, isYearBetweenInclusive, isZonedDateTime, parseStringToDateValue, toDate };
|
package/dist/date/comparators.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{CalendarDate as e,CalendarDateTime as t,DateFormatter as n,Time as r,ZonedDateTime as i,createCalendar as a,getDayOfWeek as o,getLocalTimeZone as s,parseDate as c,parseDateTime as l,parseZonedDateTime as u,toCalendar as d}from"@internationalized/date";function f(e,t){let n;return n=g(t)?u(e):h(t)?l(e):c(e),n.calendar===t.calendar?n:d(n,t.calendar)}function p(e){return e instanceof r}function m(e,t=s()){if(p(e)){let t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.hour,e.minute,e.second,e.millisecond)}return g(e)?e.toDate():e.toDate(t)}function h(e){return e instanceof t}function g(e){return e instanceof i}function _(e){return p(e)||h(e)||g(e)}function v(e){if(e instanceof Date){let t=e.getFullYear(),n=e.getMonth()+1;return new Date(t,n,0).getDate()}return e.set({day:100}).day}function y(r){let{defaultValue:i,defaultPlaceholder:o,granularity:s=`day`,locale:c=`en`}=r;if(Array.isArray(i)&&i.length)return i.at(-1).copy();if(i&&!Array.isArray(i))return i.copy();if(o)return o.copy();let l=new Date,u=a(new n(c).resolvedOptions().calendar);return[`hour`,`minute`,`second`].includes(s)?d(new t(l.getFullYear(),l.getMonth()+1,l.getDate(),0,0,0),u):d(new e(l.getFullYear(),l.getMonth()+1,l.getDate()),u)}function b(e){return e.defaultValue?e.defaultValue.copy():e.defaultPlaceholder?e.defaultPlaceholder.copy():new r(0,0,0)}function x(e,t){return p(e)&&p(t),e.compare(t)<0}function S(e,t){return p(e)&&p(t),e.compare(t)>0}function C(e,t){return p(e)&&p(t),e.compare(t)<=0}function w(e,t){return p(e)&&p(t),e.compare(t)>=0}function T(e,t){return e.toString()===t.toString()}function E(e,t,n){return w(e,t)&&C(e,n)}function D(e,t,n){return S(e,t)&&x(e,n)}function O(e,t,n){let r=o(e,n,`sun`);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function k(e,t,n){let r=o(e,n,`sun`),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}function A(e,t){return e.year===t.year&&e.month===t.month}function j(e,t){return e.year===t.year}function M(e,t,n,r,i){if(n===void 0&&r===void 0&&i===void 0)return!0;let a=e.add({days:1}),o=e=>(r?.(e)||n?.(e))&&!i?.(e);for(;a.compare(t)<0;){if(o(a))return!1;a=a.add({days:1})}return!0}function N(e,t){return e.year===t.year?e.month-t.month:e.year-t.year}function P(e,t,n){return N(e,t)>=0&&N(e,n)<=0}function F(e,t,n){return e.year>=t.year&&e.year<=n.year}function I(e,t){return(t.year-e.year)*12+(t.month-e.month)+1}export{M as areAllDaysBetweenValid,N as compareYearMonth,v as getDaysInMonth,y as getDefaultDate,b as getDefaultTime,O as getLastFirstDayOfWeek,I as getMonthsBetween,k as getNextLastDayOfWeek,_ as hasTime,S as isAfter,w as isAfterOrSame,x as isBefore,C as isBeforeOrSame,D as isBetween,E as isBetweenInclusive,h as isCalendarDateTime,T as isEqualValue,P as isMonthBetweenInclusive,j as isSameYear,A as isSameYearMonth,p as isTime,F as isYearBetweenInclusive,g as isZonedDateTime,f as parseStringToDateValue,m as toDate};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TimeValue } from "./comparators.js";
|
|
2
|
+
import { DateValue } from "@internationalized/date";
|
|
3
|
+
|
|
4
|
+
//#region src/date/formatter.d.ts
|
|
5
|
+
interface DateFormatterOptions extends Intl.DateTimeFormatOptions {
|
|
6
|
+
calendar?: string;
|
|
7
|
+
}
|
|
8
|
+
interface Formatter {
|
|
9
|
+
getLocale: () => string;
|
|
10
|
+
setLocale: (newLocale: string) => void;
|
|
11
|
+
custom: (date: Date, options: DateFormatterOptions) => string;
|
|
12
|
+
selectedDate: (date: DateValue | TimeValue, includeTime?: boolean) => string;
|
|
13
|
+
dayOfWeek: (date: Date, length?: DateFormatterOptions['weekday']) => string;
|
|
14
|
+
fullMonthAndYear: (date: Date, options?: DateFormatterOptions) => string;
|
|
15
|
+
fullMonth: (date: Date, options?: DateFormatterOptions) => string;
|
|
16
|
+
fullYear: (date: Date, options?: DateFormatterOptions) => string;
|
|
17
|
+
dayPeriod: (date: Date) => string;
|
|
18
|
+
part: (dateObj: DateValue | TimeValue, type: Intl.DateTimeFormatPartTypes, options?: DateFormatterOptions) => string;
|
|
19
|
+
toParts: (date: DateValue | TimeValue, options?: DateFormatterOptions) => Intl.DateTimeFormatPart[];
|
|
20
|
+
getMonths: () => {
|
|
21
|
+
label: string;
|
|
22
|
+
value: number;
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
25
|
+
declare function useDateFormatter(initialLocale: string, opts?: DateFormatterOptions): Formatter;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { DateFormatterOptions, Formatter, useDateFormatter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasTime as e,isZonedDateTime as t,toDate as n}from"./comparators.js";import{ref as r}from"vue";import{DateFormatter as i,getLocalTimeZone as a,today as o}from"@internationalized/date";function s(s,c={}){let l=r(s);function u(){return l.value}function d(e){l.value=e}function f(e,t){return new i(l.value,{...c,...t}).format(e)}function p(t,r=!0){return e(t)&&r?f(n(t),{dateStyle:`long`,timeStyle:`long`}):f(n(t),{dateStyle:`long`})}function m(e,t={}){return new i(l.value,{...c,month:`long`,year:`numeric`,...t}).format(e)}function h(e,t={}){return new i(l.value,{...c,month:`long`,...t}).format(e)}function g(){let e=o(a());return[1,2,3,4,5,6,7,8,9,10,11,12].map(t=>({label:h(n(e.set({month:t}))),value:t}))}function _(e,t={}){return new i(l.value,{...c,year:`numeric`,...t}).format(e)}function v(e,r){return t(e)?new i(l.value,{...c,...r,timeZone:e.timeZone}).formatToParts(n(e)):new i(l.value,{...c,...r}).formatToParts(n(e))}function y(e,t=`narrow`){return new i(l.value,{...c,weekday:t}).format(e)}function b(e){let t=new i(l.value,{...c,hour:`numeric`,minute:`numeric`}).formatToParts(e).find(e=>e.type===`dayPeriod`)?.value;return t===`PM`||t===`pm`||t===`p.m.`?`PM`:`AM`}let x={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function S(e,t,n={}){return v(e,{...x,...n}).find(e=>e.type===t)?.value??``}return{setLocale:d,getLocale:u,fullMonth:h,fullYear:_,fullMonthAndYear:m,toParts:v,custom:f,part:S,dayPeriod:b,selectedDate:p,dayOfWeek:y,getMonths:g}}export{s as useDateFormatter};
|
package/dist/date/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TimeValue, areAllDaysBetweenValid, compareYearMonth, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMonthsBetween, getNextLastDayOfWeek, hasTime, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqualValue, isMonthBetweenInclusive, isSameYear, isSameYearMonth, isTime, isYearBetweenInclusive, isZonedDateTime, parseStringToDateValue, toDate } from "./comparators.js";
|
|
2
|
+
import { ALL_EXCEPT_LITERAL_PARTS, ALL_SEGMENT_PARTS, DATE_SEGMENT_PARTS, EDITABLE_SEGMENT_PARTS, NON_EDITABLE_SEGMENT_PARTS, TIME_SEGMENT_PARTS, isAnySegmentPart, isDateSegmentPart, isSegmentPart, isTimeSegmentPart } from "./parts.js";
|
|
3
|
+
import { AnyExceptLiteral, DateAndTimeSegmentObj, DateInputType, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DateValue, DayOfWeek, DayPeriod, EditableSegmentPart, Granularity, Grid, HourCycle, Matcher, NonEditableSegmentPart, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeInputType, TimeMatcher, TimeRange, TimeSegmentObj, TimeSegmentPart } from "./types.js";
|
|
2
4
|
import { CreateMonthProps, CreateSelectProps, DEFAULT_DATE_LOCALE, WeekDayFormat, WeekStartsOn, createDateRange, createDecade, createMonth, createMonthGrid, createMonths, createYear, createYearGrid, createYearRange, endOfDecade, getDaysBetween, getWeekNumber, getWeekStartsOn, startOfDecade } from "./calendar.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
5
|
+
import { DateFormatterOptions, Formatter, useDateFormatter } from "./formatter.js";
|
|
6
|
+
import { createContent, initializeSegmentValues, syncSegmentValues, syncTimeSegmentValues } from "./parser.js";
|
|
7
|
+
import { SupportedLocale, getPlaceholder } from "./placeholders.js";
|
|
8
|
+
import { getSegmentElements, isAcceptableSegmentKey, isNumberString, isSegmentNavigationKey } from "./segment.js";
|
|
9
|
+
import { UseDateFieldProps, useDateField } from "./use-date-field.js";
|
|
10
|
+
import { chunk, getInputType, getOptsByGranularity, getTimeInputType, handleCalendarInitialFocus, normalizeDateStep, normalizeHour12, normalizeHourCycle, normalizeInputValue, normalizeTimeInputValue } from "./utils.js";
|
|
11
|
+
export { ALL_EXCEPT_LITERAL_PARTS, ALL_SEGMENT_PARTS, AnyExceptLiteral, CreateMonthProps, CreateSelectProps, DATE_SEGMENT_PARTS, DEFAULT_DATE_LOCALE, DateAndTimeSegmentObj, DateFormatterOptions, DateInputType, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DateValue, DayOfWeek, DayPeriod, EDITABLE_SEGMENT_PARTS, EditableSegmentPart, Formatter, Granularity, Grid, HourCycle, Matcher, NON_EDITABLE_SEGMENT_PARTS, NonEditableSegmentPart, SegmentContentObj, SegmentPart, SegmentValueObj, SupportedLocale, TIME_SEGMENT_PARTS, TimeGranularity, TimeInputType, TimeMatcher, TimeRange, TimeSegmentObj, TimeSegmentPart, TimeValue, UseDateFieldProps, WeekDayFormat, WeekStartsOn, areAllDaysBetweenValid, chunk, compareYearMonth, createContent, createDateRange, createDecade, createMonth, createMonthGrid, createMonths, createYear, createYearGrid, createYearRange, endOfDecade, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getInputType, getLastFirstDayOfWeek, getMonthsBetween, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getTimeInputType, getWeekNumber, getWeekStartsOn, handleCalendarInitialFocus, hasTime, initializeSegmentValues, isAcceptableSegmentKey, isAfter, isAfterOrSame, isAnySegmentPart, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isDateSegmentPart, isEqualValue, isMonthBetweenInclusive, isNumberString, isSameYear, isSameYearMonth, isSegmentNavigationKey, isSegmentPart, isTime, isTimeSegmentPart, isYearBetweenInclusive, isZonedDateTime, normalizeDateStep, normalizeHour12, normalizeHourCycle, normalizeInputValue, normalizeTimeInputValue, parseStringToDateValue, startOfDecade, syncSegmentValues, syncTimeSegmentValues, toDate, useDateField, useDateFormatter };
|
package/dist/date/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{areAllDaysBetweenValid as e,
|
|
1
|
+
import{areAllDaysBetweenValid as e,compareYearMonth as t,getDaysInMonth as n,getDefaultDate as r,getDefaultTime as i,getLastFirstDayOfWeek as a,getMonthsBetween as o,getNextLastDayOfWeek as s,hasTime as c,isAfter as l,isAfterOrSame as u,isBefore as d,isBeforeOrSame as f,isBetween as p,isBetweenInclusive as m,isCalendarDateTime as h,isEqualValue as g,isMonthBetweenInclusive as _,isSameYear as v,isSameYearMonth as y,isTime as b,isYearBetweenInclusive as x,isZonedDateTime as S,parseStringToDateValue as C,toDate as w}from"./comparators.js";import{chunk as T,getInputType as E,getOptsByGranularity as D,getTimeInputType as O,handleCalendarInitialFocus as k,normalizeDateStep as A,normalizeHour12 as j,normalizeHourCycle as M,normalizeInputValue as N,normalizeTimeInputValue as P}from"./utils.js";import{DEFAULT_DATE_LOCALE as F,createDateRange as I,createDecade as L,createMonth as R,createMonthGrid as z,createMonths as B,createYear as V,createYearGrid as H,createYearRange as U,endOfDecade as W,getDaysBetween as G,getWeekNumber as K,getWeekStartsOn as q,startOfDecade as J}from"./calendar.js";import{useDateFormatter as Y}from"./formatter.js";import{ALL_EXCEPT_LITERAL_PARTS as X,ALL_SEGMENT_PARTS as Z,DATE_SEGMENT_PARTS as Q,EDITABLE_SEGMENT_PARTS as $,NON_EDITABLE_SEGMENT_PARTS as ee,TIME_SEGMENT_PARTS as te,isAnySegmentPart as ne,isDateSegmentPart as re,isSegmentPart as ie,isTimeSegmentPart as ae}from"./parts.js";import{getPlaceholder as oe}from"./placeholders.js";import{createContent as se,initializeSegmentValues as ce,syncSegmentValues as le,syncTimeSegmentValues as ue}from"./parser.js";import{getSegmentElements as de,isAcceptableSegmentKey as fe,isNumberString as pe,isSegmentNavigationKey as me}from"./segment.js";import{useDateField as he}from"./use-date-field.js";export{X as ALL_EXCEPT_LITERAL_PARTS,Z as ALL_SEGMENT_PARTS,Q as DATE_SEGMENT_PARTS,F as DEFAULT_DATE_LOCALE,$ as EDITABLE_SEGMENT_PARTS,ee as NON_EDITABLE_SEGMENT_PARTS,te as TIME_SEGMENT_PARTS,e as areAllDaysBetweenValid,T as chunk,t as compareYearMonth,se as createContent,I as createDateRange,L as createDecade,R as createMonth,z as createMonthGrid,B as createMonths,V as createYear,H as createYearGrid,U as createYearRange,W as endOfDecade,G as getDaysBetween,n as getDaysInMonth,r as getDefaultDate,i as getDefaultTime,E as getInputType,a as getLastFirstDayOfWeek,o as getMonthsBetween,s as getNextLastDayOfWeek,D as getOptsByGranularity,oe as getPlaceholder,de as getSegmentElements,O as getTimeInputType,K as getWeekNumber,q as getWeekStartsOn,k as handleCalendarInitialFocus,c as hasTime,ce as initializeSegmentValues,fe as isAcceptableSegmentKey,l as isAfter,u as isAfterOrSame,ne as isAnySegmentPart,d as isBefore,f as isBeforeOrSame,p as isBetween,m as isBetweenInclusive,h as isCalendarDateTime,re as isDateSegmentPart,g as isEqualValue,_ as isMonthBetweenInclusive,pe as isNumberString,v as isSameYear,y as isSameYearMonth,me as isSegmentNavigationKey,ie as isSegmentPart,b as isTime,ae as isTimeSegmentPart,x as isYearBetweenInclusive,S as isZonedDateTime,A as normalizeDateStep,j as normalizeHour12,M as normalizeHourCycle,N as normalizeInputValue,P as normalizeTimeInputValue,C as parseStringToDateValue,J as startOfDecade,le as syncSegmentValues,ue as syncTimeSegmentValues,w as toDate,he as useDateField,Y as useDateFormatter};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TimeValue } from "./comparators.js";
|
|
2
|
+
import { DateValue, Granularity, HourCycle, SegmentContentObj, SegmentPart, SegmentValueObj } from "./types.js";
|
|
3
|
+
import { Formatter } from "./formatter.js";
|
|
4
|
+
import { Ref } from "vue";
|
|
5
|
+
|
|
6
|
+
//#region src/date/parser.d.ts
|
|
7
|
+
type CreateContentProps = {
|
|
8
|
+
granularity: Granularity;
|
|
9
|
+
dateRef: DateValue | TimeValue;
|
|
10
|
+
formatter: Formatter;
|
|
11
|
+
hideTimeZone: boolean;
|
|
12
|
+
hourCycle: HourCycle;
|
|
13
|
+
segmentValues: SegmentValueObj;
|
|
14
|
+
locale: Ref<string>;
|
|
15
|
+
isTimeValue?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare function syncTimeSegmentValues(props: {
|
|
18
|
+
value: DateValue | TimeValue;
|
|
19
|
+
formatter: Formatter;
|
|
20
|
+
}): SegmentValueObj;
|
|
21
|
+
declare function syncSegmentValues(props: {
|
|
22
|
+
value: DateValue;
|
|
23
|
+
formatter: Formatter;
|
|
24
|
+
}): SegmentValueObj;
|
|
25
|
+
declare function initializeSegmentValues(granularity: Granularity): SegmentValueObj;
|
|
26
|
+
declare function createContent(props: CreateContentProps): {
|
|
27
|
+
obj: SegmentContentObj;
|
|
28
|
+
arr: {
|
|
29
|
+
part: SegmentPart;
|
|
30
|
+
value: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { createContent, initializeSegmentValues, syncSegmentValues, syncTimeSegmentValues };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isTime as e,isZonedDateTime as t,toDate as n}from"./comparators.js";import{getOptsByGranularity as r,normalizeHourCycle as i}from"./utils.js";import{DATE_SEGMENT_PARTS as a,EDITABLE_SEGMENT_PARTS as o,TIME_SEGMENT_PARTS as s,isDateSegmentPart as c,isSegmentPart as l}from"./parts.js";import{getPlaceholder as u}from"./placeholders.js";function d(e){return Object.fromEntries(s.map(t=>t===`dayPeriod`?[t,e.formatter.dayPeriod(n(e.value))]:[t,e.value[t]]))}function f(e){let t=a.map(t=>[t,e.value[t]]);return`hour`in e.value?{...Object.fromEntries(t),...d(e)}:Object.fromEntries(t)}function p(e){let t=[`hour`,`minute`,`second`],n=o.map(e=>e===`dayPeriod`?[e,`AM`]:[e,null]).filter(([n])=>e===`minute`&&n===`second`||e===`hour`&&(n===`second`||n===`minute`)?!1:e===`day`?!t.includes(n)&&n!==`dayPeriod`:!0);return Object.fromEntries(n)}function m(e){let t=e.segmentValues,n=n=>{if(`hour`in e.segmentValues){let r=t[n];return r===null?u(n,``,e.locale.value):n===`day`?e.formatter.part(e.dateRef.set({[n]:r,month:`month`in e.segmentValues?e.segmentValues.month??1:1}),n,{hourCycle:i(e.hourCycle)}):e.formatter.part(e.dateRef.set({[n]:r}),n,{hourCycle:i(e.hourCycle)})}if(c(n)){let r=t[n];return r===null?u(n,``,e.locale.value):n===`day`?e.formatter.part(e.dateRef.set({[n]:r,month:e.segmentValues.month??1}),n):e.formatter.part(e.dateRef.set({[n]:r}),n)}return``};return Object.keys(e.segmentValues).reduce((t,r)=>l(r)?`hour`in e.segmentValues&&r===`dayPeriod`?(t[r]=e.segmentValues[r]??u(r,`AM`,e.locale.value),t):(t[r]=h(r,n),t):t,{})}function h(e,t){return t(e)}function g(n){let i=m(n);return{obj:i,arr:n.formatter.toParts(n.dateRef,r(n.granularity,n.hourCycle,n.isTimeValue)).map(e=>e.type===`literal`||e.type===`timeZoneName`||e.type===null||!l(e.type)?{part:e.type,value:e.value}:{part:e.type,value:i[e.type]}).filter(r=>!(r.part===null||r.value===null||r.part===`timeZoneName`&&(e(n.dateRef)||!t(n.dateRef))||r.part===`timeZoneName`&&n.hideTimeZone))}}export{g as createContent,p as initializeSegmentValues,f as syncSegmentValues,d as syncTimeSegmentValues};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DateSegmentPart, EditableSegmentPart, SegmentPart, TimeSegmentPart } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/date/parts.d.ts
|
|
4
|
+
declare const DATE_SEGMENT_PARTS: readonly ["day", "month", "year"];
|
|
5
|
+
declare const TIME_SEGMENT_PARTS: readonly ["hour", "minute", "second", "dayPeriod"];
|
|
6
|
+
declare const NON_EDITABLE_SEGMENT_PARTS: readonly ["literal", "timeZoneName"];
|
|
7
|
+
declare const EDITABLE_SEGMENT_PARTS: readonly ["day", "month", "year", "hour", "minute", "second", "dayPeriod"];
|
|
8
|
+
declare const ALL_SEGMENT_PARTS: readonly ["day", "month", "year", "hour", "minute", "second", "dayPeriod", "literal", "timeZoneName"];
|
|
9
|
+
declare const ALL_EXCEPT_LITERAL_PARTS: ("day" | "hour" | "minute" | "second" | "month" | "year" | "dayPeriod" | "timeZoneName")[];
|
|
10
|
+
declare function isDateSegmentPart(part: unknown): part is DateSegmentPart;
|
|
11
|
+
declare function isTimeSegmentPart(part: unknown): part is TimeSegmentPart;
|
|
12
|
+
declare function isSegmentPart(part: string): part is EditableSegmentPart;
|
|
13
|
+
declare function isAnySegmentPart(part: unknown): part is SegmentPart;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ALL_EXCEPT_LITERAL_PARTS, ALL_SEGMENT_PARTS, DATE_SEGMENT_PARTS, EDITABLE_SEGMENT_PARTS, NON_EDITABLE_SEGMENT_PARTS, TIME_SEGMENT_PARTS, isAnySegmentPart, isDateSegmentPart, isSegmentPart, isTimeSegmentPart };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[`day`,`month`,`year`],t=[`hour`,`minute`,`second`,`dayPeriod`],n=[`literal`,`timeZoneName`],r=[...e,...t],i=[...r,...n],a=i.filter(e=>e!==`literal`);function o(t){return e.includes(t)}function s(e){return t.includes(e)}function c(e){return r.includes(e)}function l(e){return i.includes(e)}export{a as ALL_EXCEPT_LITERAL_PARTS,i as ALL_SEGMENT_PARTS,e as DATE_SEGMENT_PARTS,r as EDITABLE_SEGMENT_PARTS,n as NON_EDITABLE_SEGMENT_PARTS,t as TIME_SEGMENT_PARTS,l as isAnySegmentPart,o as isDateSegmentPart,c as isSegmentPart,s as isTimeSegmentPart};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/date/placeholders.d.ts
|
|
2
|
+
declare const placeholders: {
|
|
3
|
+
readonly en: {
|
|
4
|
+
readonly year: "yyyy";
|
|
5
|
+
readonly month: "mm";
|
|
6
|
+
readonly day: "dd";
|
|
7
|
+
};
|
|
8
|
+
readonly 'zh-CN': {
|
|
9
|
+
readonly year: "年";
|
|
10
|
+
readonly month: "月";
|
|
11
|
+
readonly day: "日";
|
|
12
|
+
};
|
|
13
|
+
readonly 'zh-TW': {
|
|
14
|
+
readonly year: "年";
|
|
15
|
+
readonly month: "月";
|
|
16
|
+
readonly day: "日";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type PlaceholderField = 'year' | 'month' | 'day';
|
|
20
|
+
type SupportedLocale = keyof typeof placeholders;
|
|
21
|
+
declare function getPlaceholder(field: PlaceholderField | 'era' | 'hour' | 'minute' | 'second' | 'dayPeriod', value: string, locale: string): string;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SupportedLocale, getPlaceholder };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={en:{year:`yyyy`,month:`mm`,day:`dd`},"zh-CN":{year:`年`,month:`月`,day:`日`},"zh-TW":{year:`年`,month:`月`,day:`日`}};function t(t){if(t in e)return t;let n=t.split(`-`)[0];return n in e?n:`en`}function n(n,r,i){return n===`year`||n===`month`||n===`day`?e[t(i)][n]:n===`era`||n===`dayPeriod`?r:`––`}export{n as getPlaceholder};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/date/segment.d.ts
|
|
2
|
+
declare function isSegmentNavigationKey(key: string): key is "ArrowLeft" | "ArrowRight";
|
|
3
|
+
declare function isNumberString(value: string): boolean;
|
|
4
|
+
declare function isAcceptableSegmentKey(key: string): boolean;
|
|
5
|
+
declare function getSegmentElements(parentElement: HTMLElement): Element[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { getSegmentElements, isAcceptableSegmentKey, isNumberString, isSegmentNavigationKey };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e===`ArrowRight`||e===`ArrowLeft`}function t(e){return!Number.isNaN(Number.parseInt(e))}function n(e){return[`Enter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Backspace`,` `,`a`,`A`,`p`,`P`].includes(e)||t(e)}function r(e){return Array.from(e.querySelectorAll(`[data-soybean-date-field-segment]`)).filter(e=>e.getAttribute(`data-soybean-date-field-segment`)!==`literal`)}export{r as getSegmentElements,n as isAcceptableSegmentKey,t as isNumberString,e as isSegmentNavigationKey};
|