@choice-ui/react 1.4.3 → 1.4.5
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/alert-dialog/dist/index.d.ts +20 -41
- package/dist/components/alert-dialog/dist/index.js +497 -0
- package/dist/components/alert-dialog/src/alert-dialog.js +1 -1
- package/dist/components/alert-dialog/src/hooks/use-alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog/src/index.d.ts +4 -5
- package/dist/components/alert-dialog/src/types.d.ts +11 -11
- package/dist/components/avatar/dist/index.js +4 -4
- package/dist/components/avatar/src/avatar.js +4 -4
- package/dist/components/badge/src/badge.js +2 -2
- package/dist/components/badge/src/index.d.ts +2 -1
- package/dist/components/button/dist/index.js +4 -4
- package/dist/components/button/src/button.js +4 -4
- package/dist/components/calendar/dist/index.d.ts +296 -296
- package/dist/components/calendar/dist/index.js +57 -56
- package/dist/components/calendar/src/date-range-input/date-range-input.d.ts +5 -5
- package/dist/components/calendar/src/time-calendar/time-calendar.d.ts +3 -3
- package/dist/components/calendar/src/time-calendar/time-calendar.js +2 -2
- package/dist/components/calendar/src/time-input/time-input.d.ts +9 -9
- package/dist/components/calendar/src/time-input/time-input.js +4 -4
- package/dist/components/calendar/src/types.d.ts +165 -165
- package/dist/components/calendar/src/utils/constants.js +32 -31
- package/dist/components/calendar/src/utils/date-comparisons.d.ts +34 -34
- package/dist/components/calendar/src/utils/locale.d.ts +12 -12
- package/dist/components/calendar/src/utils/month.d.ts +3 -3
- package/dist/components/calendar/src/utils/month.js +1 -1
- package/dist/components/calendar/src/utils/parsers/month-names.js +3 -3
- package/dist/components/calendar/src/utils/parsers/numeric-utils.d.ts +20 -20
- package/dist/components/calendar/src/utils/parsers/numeric-utils.js +8 -8
- package/dist/components/calendar/src/utils/parsers/parsers.d.ts +17 -17
- package/dist/components/calendar/src/utils/parsers/parsers.js +2 -2
- package/dist/components/calendar/src/utils/parsers/prediction.d.ts +7 -7
- package/dist/components/calendar/src/utils/parsers/relative-dates.js +6 -6
- package/dist/components/calendar/src/utils/quarter.d.ts +13 -13
- package/dist/components/calendar/src/utils/quarter.js +6 -6
- package/dist/components/calendar/src/utils/time.d.ts +8 -8
- package/dist/components/calendar/src/utils/year.d.ts +3 -3
- package/dist/components/calendar/src/utils/year.js +3 -3
- package/dist/components/checkbox/dist/index.d.ts +1 -12
- package/dist/components/checkbox/dist/index.js +9 -9
- package/dist/components/checkbox/src/checkbox-label.js +2 -2
- package/dist/components/checkbox/src/checkbox.js +6 -5
- package/dist/components/checkbox/src/context.js +1 -1
- package/dist/components/checkbox/src/index.d.ts +0 -3
- package/dist/components/chip/dist/index.js +6 -6
- package/dist/components/chip/src/chip.js +6 -6
- package/dist/components/chip/src/index.d.ts +2 -1
- package/dist/components/chips-input/dist/index.js +270 -0
- package/dist/components/chips-input/src/index.d.ts +2 -1
- package/dist/components/code-block/dist/index.d.ts +14 -32
- package/dist/components/code-block/dist/index.js +211 -147
- package/dist/components/code-block/src/code-block.d.ts +8 -1
- package/dist/components/code-block/src/code-block.js +14 -3
- package/dist/components/code-block/src/components/code-block-code.js +31 -5
- package/dist/components/code-block/src/components/code-block-header.js +45 -10
- package/dist/components/code-block/src/index.d.ts +3 -9
- package/dist/components/combobox/dist/index.d.ts +21 -2
- package/dist/components/combobox/dist/index.js +16 -13
- package/dist/components/combobox/src/combobox-trigger.d.ts +1 -1
- package/dist/components/combobox/src/combobox-trigger.js +7 -4
- package/dist/components/combobox/src/combobox.d.ts +20 -1
- package/dist/components/combobox/src/combobox.js +10 -10
- package/dist/components/command/dist/index.d.ts +65 -4
- package/dist/components/command/src/command.js +6 -5
- package/dist/components/command/src/components/command-divider.d.ts +4 -1
- package/dist/components/command/src/components/command-group.d.ts +16 -1
- package/dist/components/command/src/components/command-group.js +56 -54
- package/dist/components/command/src/components/command-input.js +3 -3
- package/dist/components/command/src/components/command-item.d.ts +1 -1
- package/dist/components/command/src/components/command-item.js +117 -115
- package/dist/components/command/src/components/command-loading.d.ts +8 -0
- package/dist/components/command/src/components/command-loading.js +1 -1
- package/dist/components/command/src/context/create-command-context.js +1 -1
- package/dist/components/command/src/hooks/use-schedule-layout-effect.d.ts +1 -1
- package/dist/components/command/src/hooks/use-value.js +2 -2
- package/dist/components/command/src/index.d.ts +16 -8
- package/dist/components/command/src/tv.d.ts +30 -0
- package/dist/components/command/src/tv.js +10 -0
- package/dist/components/command/src/types.d.ts +8 -0
- package/dist/components/command/src/utils/constants.d.ts +1 -1
- package/dist/components/command/src/utils/constants.js +1 -1
- package/dist/components/command/src/utils/helpers.d.ts +0 -1
- package/dist/components/command/src/utils/helpers.js +1 -3
- package/dist/components/command/src/utils/index.d.ts +1 -0
- package/dist/components/comments/src/comment-input/components/comment-input-mention-popover.js +4 -2
- package/dist/components/comments/src/comments.js +1 -1
- package/dist/components/context-input/dist/index.d.ts +15 -340
- package/dist/components/context-input/src/components/mention-menu.d.ts +5 -4
- package/dist/components/context-input/src/components/mention-menu.js +19 -4
- package/dist/components/context-input/src/components/mention.d.ts +2 -2
- package/dist/components/context-input/src/components/slate-editor.js +4 -2
- package/dist/components/context-input/src/context-input.js +31 -16
- package/dist/components/context-input/src/extensions/with-mentions.d.ts +1 -1
- package/dist/components/context-input/src/extensions/with-mentions.js +10 -9
- package/dist/components/context-input/src/hooks/use-context-input.js +87 -46
- package/dist/components/context-input/src/hooks/use-mentions.d.ts +11 -10
- package/dist/components/context-input/src/hooks/use-mentions.js +147 -128
- package/dist/components/context-input/src/index.d.ts +2 -5
- package/dist/components/context-input/src/types.d.ts +12 -12
- package/dist/components/context-input/src/utils/mention-spacing.d.ts +16 -16
- package/dist/components/context-input/src/utils/mention-spacing.js +1 -27
- package/dist/components/context-input/src/utils/slate-converters.d.ts +6 -6
- package/dist/components/context-input/src/utils/slate-converters.js +3 -69
- package/dist/components/context-input/src/utils/text-extraction.js +7 -1
- package/dist/components/context-menu/src/context-menu.js +10 -4
- package/dist/components/dialog/dist/index.js +1 -2
- package/dist/components/dialog/src/dialog.js +0 -1
- package/dist/components/dialog/src/hooks/use-floating-dialog.js +1 -1
- package/dist/components/dialog/src/index.d.ts +3 -2
- package/dist/components/dropdown/dist/index.d.ts +1 -2
- package/dist/components/dropdown/dist/index.js +23 -8
- package/dist/components/dropdown/src/dropdown.d.ts +1 -2
- package/dist/components/dropdown/src/dropdown.js +23 -8
- package/dist/components/emoji-picker/dist/index.d.ts +33 -1
- package/dist/components/emoji-picker/dist/index.js +3 -1
- package/dist/components/emoji-picker/src/emoji-picker.d.ts +1 -1
- package/dist/components/emoji-picker/src/emoji-picker.js +3 -1
- package/dist/components/emoji-picker/src/index.d.ts +3 -1
- package/dist/components/form/dist/index.d.ts +93 -98
- package/dist/components/form/src/adapters/base-adapter.d.ts +3 -3
- package/dist/components/form/src/adapters/checkbox-adapter.d.ts +1 -1
- package/dist/components/form/src/adapters/chips-input-adapter.d.ts +9 -0
- package/dist/components/form/src/adapters/chips-input-adapter.js +38 -0
- package/dist/components/form/src/adapters/index.d.ts +8 -7
- package/dist/components/form/src/adapters/input-adapter.d.ts +1 -1
- package/dist/components/form/src/adapters/multi-select-adapter.d.ts +1 -1
- package/dist/components/form/src/adapters/numeric-input-adapter.d.ts +1 -1
- package/dist/components/form/src/adapters/raido-group-adapter.d.ts +1 -7
- package/dist/components/form/src/adapters/range-adapter.d.ts +1 -7
- package/dist/components/form/src/adapters/segmented-adapter.d.ts +1 -7
- package/dist/components/form/src/adapters/select-adapter.d.ts +1 -1
- package/dist/components/form/src/adapters/switch-adapter.d.ts +1 -1
- package/dist/components/form/src/adapters/textarea-adapter.d.ts +1 -1
- package/dist/components/form/src/index.d.ts +18 -16
- package/dist/components/form/src/index.js +16 -13
- package/dist/components/form/src/types.d.ts +58 -51
- package/dist/components/hint/dist/index.d.ts +10 -54
- package/dist/components/hint/src/components/info-content.d.ts +3 -5
- package/dist/components/hint/src/components/info-content.js +14 -6
- package/dist/components/hint/src/components/info-trigger.d.ts +2 -3
- package/dist/components/hint/src/components/info-trigger.js +4 -2
- package/dist/components/hint/src/context/hint-context.d.ts +2 -0
- package/dist/components/hint/src/context/hint-context.js +1 -1
- package/dist/components/hint/src/hint.d.ts +7 -7
- package/dist/components/hint/src/hint.js +24 -29
- package/dist/components/hint/src/hooks/use-hint.d.ts +4 -2
- package/dist/components/hint/src/hooks/use-hint.js +12 -4
- package/dist/components/hint/src/index.d.ts +3 -3
- package/dist/components/hint/src/tv.d.ts +33 -0
- package/dist/components/hint/src/tv.js +11 -0
- package/dist/components/icon-button/dist/index.js +2 -2
- package/dist/components/icon-button/src/icon-button.js +2 -2
- package/dist/components/index.d.ts +3 -0
- package/dist/components/input/dist/index.js +4 -4
- package/dist/components/input/src/input.js +3 -3
- package/dist/components/input/src/tv.js +1 -1
- package/dist/components/kbd/dist/index.js +4 -4
- package/dist/components/kbd/src/kbd.js +4 -4
- package/dist/components/label/dist/index.js +3 -3
- package/dist/components/label/src/tv.js +3 -3
- package/dist/components/link-button/dist/index.js +3 -3
- package/dist/components/link-button/src/link-button.js +3 -3
- package/dist/components/list/src/components/list-content.js +2 -2
- package/dist/components/list/src/components/list-divider.js +3 -3
- package/dist/components/list/src/components/list-item.js +5 -5
- package/dist/components/list/src/components/list-label.js +2 -2
- package/dist/components/list/src/components/list-sub-trigger.js +4 -4
- package/dist/components/list/src/list.js +2 -2
- package/dist/components/md-input/dist/index.d.ts +8 -104
- package/dist/components/md-input/src/components/extensions/md-input-mention.d.ts +6 -4
- package/dist/components/md-input/src/components/extensions/md-input-mention.js +23 -6
- package/dist/components/md-input/src/components/md-input-container.js +1 -0
- package/dist/components/md-input/src/components/md-input-editor.js +4 -1
- package/dist/components/md-input/src/components/md-input-footer.js +5 -1
- package/dist/components/md-input/src/components/toolbar/default-actions.d.ts +2 -2
- package/dist/components/md-input/src/components/toolbar/toolbar-button.d.ts +1 -0
- package/dist/components/md-input/src/components/toolbar/toolbar-button.js +1 -7
- package/dist/components/md-input/src/components/toolbar/toolbar.d.ts +2 -2
- package/dist/components/md-input/src/hooks/use-markdown-mentions.d.ts +5 -4
- package/dist/components/md-input/src/hooks/use-markdown-mentions.js +31 -4
- package/dist/components/md-input/src/index.d.ts +1 -4
- package/dist/components/md-input/src/md-input.js +18 -14
- package/dist/components/md-input/src/tv.d.ts +3 -0
- package/dist/components/md-input/src/tv.js +2 -1
- package/dist/components/md-input/src/types.d.ts +18 -16
- package/dist/components/md-render/dist/index.d.ts +1 -4
- package/dist/components/md-render/dist/index.js +8 -9
- package/dist/components/md-render/src/components/markdown-components.js +3 -3
- package/dist/components/md-render/src/index.d.ts +0 -1
- package/dist/components/md-render/src/md-render.js +5 -4
- package/dist/components/md-render/src/tv.js +1 -1
- package/dist/components/menubar/dist/index.d.ts +50 -0
- package/dist/components/menubar/src/components/index.d.ts +3 -0
- package/dist/components/menubar/src/components/menubar-divider.d.ts +8 -0
- package/dist/components/menubar/src/components/menubar-divider.js +24 -0
- package/dist/components/menubar/src/components/menubar-item.d.ts +8 -0
- package/dist/components/menubar/src/components/menubar-item.js +195 -0
- package/dist/components/menubar/src/components/menubar-trigger.d.ts +8 -0
- package/dist/components/menubar/src/components/menubar-trigger.js +45 -0
- package/dist/components/menubar/src/context/index.d.ts +1 -0
- package/dist/components/menubar/src/context/menubar-context.d.ts +34 -0
- package/dist/components/menubar/src/context/menubar-context.js +13 -0
- package/dist/components/menubar/src/index.d.ts +3 -0
- package/dist/components/menubar/src/menubar.d.ts +22 -0
- package/dist/components/menubar/src/menubar.js +177 -0
- package/dist/components/menubar/src/tv.d.ts +108 -0
- package/dist/components/menubar/src/tv.js +72 -0
- package/dist/components/menubar/tsup.config.d.ts +2 -0
- package/dist/components/menus/dist/index.d.ts +144 -143
- package/dist/components/menus/dist/index.js +50 -49
- package/dist/components/menus/src/components/menu-button.js +2 -2
- package/dist/components/menus/src/components/menu-checkbox.d.ts +1 -2
- package/dist/components/menus/src/components/menu-checkbox.js +2 -2
- package/dist/components/menus/src/components/menu-divider.js +3 -3
- package/dist/components/menus/src/components/menu-item.js +5 -5
- package/dist/components/menus/src/components/menu-label.js +2 -2
- package/dist/components/menus/src/components/menu-scroll-arrow.d.ts +2 -2
- package/dist/components/menus/src/components/menu-scroll-arrow.js +13 -3
- package/dist/components/menus/src/components/menu-search.js +3 -3
- package/dist/components/menus/src/components/menu-trigger.js +4 -4
- package/dist/components/menus/src/context/menu-context-item.d.ts +6 -6
- package/dist/components/menus/src/context/menu-context-item.js +2 -2
- package/dist/components/menus/src/context/menu-context-sub-trigger.js +4 -19
- package/dist/components/menus/src/context/menu-context.d.ts +2 -2
- package/dist/components/menus/src/hooks/use-menu-base-refs.d.ts +12 -12
- package/dist/components/menus/src/hooks/use-menu-children.d.ts +16 -16
- package/dist/components/menus/src/hooks/use-menu-floating.d.ts +22 -22
- package/dist/components/menus/src/hooks/use-menu-refs.d.ts +8 -8
- package/dist/components/menus/src/hooks/use-menu-refs.js +2 -2
- package/dist/components/menus/src/hooks/use-menu-scroll-height.d.ts +11 -11
- package/dist/components/menus/src/hooks/use-menu-scroll.d.ts +18 -18
- package/dist/components/menus/src/hooks/use-menu-selection.d.ts +21 -21
- package/dist/components/menus/src/hooks/use-menu-state.d.ts +11 -11
- package/dist/components/menus/src/hooks/use-menu-state.js +4 -4
- package/dist/components/menus/src/hooks/use-menu-touch.d.ts +11 -11
- package/dist/components/menus/src/hooks/use-menu-tree.d.ts +15 -15
- package/dist/components/menus/src/index.d.ts +5 -0
- package/dist/components/menus/src/menus.js +2 -2
- package/dist/components/menus/src/tv.d.ts +15 -0
- package/dist/components/menus/src/tv.js +8 -2
- package/dist/components/modal/dist/index.d.ts +3 -1
- package/dist/components/modal/dist/index.js +18 -11
- package/dist/components/modal/src/components/modal-content.js +2 -2
- package/dist/components/modal/src/components/modal-footer.js +2 -2
- package/dist/components/modal/src/components/modal-header.d.ts +3 -1
- package/dist/components/modal/src/components/modal-header.js +12 -5
- package/dist/components/modal/src/modal.js +2 -2
- package/dist/components/multi-select/dist/index.js +13 -11
- package/dist/components/multi-select/src/components/multi-select-trigger.js +8 -8
- package/dist/components/multi-select/src/multi-select.js +5 -3
- package/dist/components/numeric-input/dist/index.d.ts +10 -117
- package/dist/components/numeric-input/dist/index.js +18 -24
- package/dist/components/numeric-input/src/components/numeric-input-element.js +2 -2
- package/dist/components/numeric-input/src/components/numeric-input-menu-trigger.d.ts +1 -1
- package/dist/components/numeric-input/src/components/numeric-input-menu-trigger.js +2 -2
- package/dist/components/numeric-input/src/components/numeric-input-variable.d.ts +1 -2
- package/dist/components/numeric-input/src/components/numeric-input-variable.js +3 -3
- package/dist/components/numeric-input/src/hooks/use-input-interactions.d.ts +3 -3
- package/dist/components/numeric-input/src/hooks/use-numeric-input.d.ts +3 -3
- package/dist/components/numeric-input/src/hooks/use-numeric-value-processing.d.ts +3 -3
- package/dist/components/numeric-input/src/hooks/use-step-calculation.d.ts +6 -6
- package/dist/components/numeric-input/src/index.d.ts +5 -4
- package/dist/components/numeric-input/src/numeric-input.js +9 -9
- package/dist/components/numeric-input/src/utils/error-handler.d.ts +8 -8
- package/dist/components/numeric-input/src/utils/expression-evaluator.d.ts +11 -11
- package/dist/components/numeric-input/src/utils/input-parser.d.ts +8 -8
- package/dist/components/numeric-input/src/utils/numeric-value-processor.d.ts +6 -6
- package/dist/components/numeric-input/src/utils/pattern-parser.d.ts +7 -7
- package/dist/components/numeric-input/src/utils/value-comparator.d.ts +16 -16
- package/dist/components/numeric-input/src/utils/value-processor.d.ts +14 -14
- package/dist/components/pagination/src/components/pagination-items-per-page.js +1 -1
- package/dist/components/pagination/src/components/pagination-navigation.js +5 -5
- package/dist/components/pagination/src/components/pagination-root.js +3 -3
- package/dist/components/pagination/src/components/pagination-spinner.js +20 -19
- package/dist/components/pagination/src/context/index.d.ts +1 -0
- package/dist/components/popover/dist/index.d.ts +2 -4
- package/dist/components/popover/dist/index.js +25 -33
- package/dist/components/popover/src/components/popover-header.js +1 -1
- package/dist/components/popover/src/hooks/use-drag.d.ts +3 -3
- package/dist/components/popover/src/hooks/use-floating-popover.d.ts +0 -2
- package/dist/components/popover/src/hooks/use-floating-popover.js +16 -13
- package/dist/components/popover/src/index.d.ts +2 -1
- package/dist/components/popover/src/popover.d.ts +1 -2
- package/dist/components/popover/src/popover.js +11 -21
- package/dist/components/progress/src/index.d.ts +4 -2
- package/dist/components/radio/dist/index.d.ts +1 -17
- package/dist/components/radio/dist/index.js +7 -10
- package/dist/components/radio/src/context.js +1 -1
- package/dist/components/radio/src/index.d.ts +0 -4
- package/dist/components/radio/src/radio-label.js +2 -2
- package/dist/components/radio/src/radio.js +4 -4
- package/dist/components/range/dist/index.js +16 -16
- package/dist/components/range/src/index.d.ts +4 -2
- package/dist/components/range/src/range-tuple.js +10 -10
- package/dist/components/range/src/range.js +6 -6
- package/dist/components/rich-input/dist/index.d.ts +12 -366
- package/dist/components/rich-input/src/components/rich-input-editable-component.d.ts +2 -2
- package/dist/components/rich-input/src/components/rich-input-viewport.d.ts +2 -2
- package/dist/components/rich-input/src/hooks/use-editor-config.d.ts +1 -1
- package/dist/components/rich-input/src/hooks/use-editor-effects.js +3 -0
- package/dist/components/rich-input/src/hooks/use-floating-ui.js +1 -1
- package/dist/components/rich-input/src/hooks/use-keyboard-shortcuts.d.ts +9 -9
- package/dist/components/rich-input/src/hooks/use-rich-input.d.ts +2 -2
- package/dist/components/rich-input/src/hooks/use-rich-input.js +40 -17
- package/dist/components/rich-input/src/hooks/use-selection-events.js +1 -2
- package/dist/components/rich-input/src/index.d.ts +3 -5
- package/dist/components/rich-input/src/rich-input-base.js +1 -1
- package/dist/components/rich-input/src/utils/custom-options.js +1 -1
- package/dist/components/rich-input/src/utils/editor-utils.js +1 -1
- package/dist/components/rich-input/src/utils/markdown-to-slate.d.ts +2 -2
- package/dist/components/rich-input/src/utils/slate-to-markdown.d.ts +1 -1
- package/dist/components/rich-input/src/utils/slate-to-markdown.js +9 -0
- package/dist/components/scroll-area/dist/index.d.ts +19 -19
- package/dist/components/scroll-area/dist/index.js +24 -24
- package/dist/components/scroll-area/src/components/scroll-area-corner.js +2 -2
- package/dist/components/scroll-area/src/components/scroll-area-root.js +3 -3
- package/dist/components/scroll-area/src/components/scroll-area-scrollbar.js +2 -2
- package/dist/components/scroll-area/src/components/scroll-area-thumb.js +2 -2
- package/dist/components/scroll-area/src/hooks/use-scroll-performance-monitor.d.ts +6 -6
- package/dist/components/scroll-area/src/hooks/use-scroll-performance-monitor.js +3 -3
- package/dist/components/scroll-area/src/hooks/use-scroll-state-and-visibility.d.ts +1 -1
- package/dist/components/scroll-area/src/hooks/use-scroll-state-and-visibility.js +3 -3
- package/dist/components/scroll-area/src/hooks/use-scrollbar.d.ts +2 -2
- package/dist/components/scroll-area/src/hooks/use-thumb.d.ts +2 -2
- package/dist/components/scroll-area/src/tv.d.ts +18 -18
- package/dist/components/scroll-area/src/tv.js +12 -12
- package/dist/components/scroll-area/src/types.d.ts +8 -8
- package/dist/components/scroll-area/src/utils/index.d.ts +3 -3
- package/dist/components/search-input/dist/index.js +3 -3
- package/dist/components/search-input/src/index.d.ts +2 -1
- package/dist/components/search-input/src/search-input.js +3 -3
- package/dist/components/segmented/dist/index.js +5 -5
- package/dist/components/segmented/src/segmented-item.js +3 -3
- package/dist/components/segmented/src/segmented.js +2 -2
- package/dist/components/select/dist/index.js +4 -4
- package/dist/components/select/src/select.js +4 -4
- package/dist/components/separator/dist/index.d.ts +26 -0
- package/dist/components/separator/src/index.d.ts +2 -0
- package/dist/components/separator/src/separator.d.ts +22 -0
- package/dist/components/separator/src/separator.js +33 -0
- package/dist/components/separator/src/tv.d.ts +76 -0
- package/dist/components/separator/src/tv.js +25 -0
- package/dist/components/separator/tsup.config.d.ts +2 -0
- package/dist/components/skeleton/dist/index.d.ts +1 -28
- package/dist/components/skeleton/src/context/skeleton-context.js +1 -1
- package/dist/components/skeleton/src/hooks/use-skeleton.d.ts +1 -2
- package/dist/components/skeleton/src/hooks/use-skeleton.js +1 -1
- package/dist/components/skeleton/src/index.d.ts +1 -3
- package/dist/components/skeleton/src/skeleton.d.ts +0 -13
- package/dist/components/skeleton/src/skeleton.js +4 -6
- package/dist/components/skeleton/src/tv.d.ts +18 -12
- package/dist/components/skeleton/src/tv.js +10 -6
- package/dist/components/slot/dist/index.d.ts +10 -10
- package/dist/components/slot/dist/index.js +4 -2
- package/dist/components/slot/src/slot.d.ts +12 -12
- package/dist/components/slot/src/slot.js +6 -3
- package/dist/components/stackflow/src/context.js +1 -1
- package/dist/components/stackflow/src/index.d.ts +2 -1
- package/dist/components/switch/dist/index.d.ts +2 -2
- package/dist/components/switch/dist/index.js +6 -7
- package/dist/components/switch/src/index.d.ts +2 -1
- package/dist/components/switch/src/switch.js +6 -6
- package/dist/components/table/dist/index.d.ts +679 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/src/components/column-resizer.d.ts +8 -0
- package/dist/components/table/src/components/column-resizer.js +58 -0
- package/dist/components/table/src/components/drag-guide.d.ts +6 -0
- package/dist/components/table/src/components/drag-guide.js +64 -0
- package/dist/components/table/src/components/index.d.ts +12 -0
- package/dist/components/table/src/components/resize-guide.d.ts +5 -0
- package/dist/components/table/src/components/resize-guide.js +25 -0
- package/dist/components/table/src/components/table-body.d.ts +6 -0
- package/dist/components/table/src/components/table-body.js +335 -0
- package/dist/components/table/src/components/table-cell.d.ts +6 -0
- package/dist/components/table/src/components/table-cell.js +89 -0
- package/dist/components/table/src/components/table-column.d.ts +5 -0
- package/dist/components/table/src/components/table-column.js +269 -0
- package/dist/components/table/src/components/table-empty.d.ts +8 -0
- package/dist/components/table/src/components/table-empty.js +10 -0
- package/dist/components/table/src/components/table-footer.d.ts +7 -0
- package/dist/components/table/src/components/table-footer.js +15 -0
- package/dist/components/table/src/components/table-header.d.ts +3 -0
- package/dist/components/table/src/components/table-header.js +88 -0
- package/dist/components/table/src/components/table-root.d.ts +3 -0
- package/dist/components/table/src/components/table-root.js +317 -0
- package/dist/components/table/src/components/table-row.d.ts +23 -0
- package/dist/components/table/src/components/table-row.js +166 -0
- package/dist/components/table/src/components/table-value.d.ts +6 -0
- package/dist/components/table/src/components/table-value.js +8 -0
- package/dist/components/table/src/context.d.ts +121 -0
- package/dist/components/table/src/context.js +63 -0
- package/dist/components/table/src/hooks/index.d.ts +4 -0
- package/dist/components/table/src/hooks/use-column-order.d.ts +26 -0
- package/dist/components/table/src/hooks/use-column-order.js +95 -0
- package/dist/components/table/src/hooks/use-column-resize.d.ts +17 -0
- package/dist/components/table/src/hooks/use-column-resize.js +75 -0
- package/dist/components/table/src/hooks/use-consecutive-selection-style.d.ts +12 -0
- package/dist/components/table/src/hooks/use-consecutive-selection-style.js +28 -0
- package/dist/components/table/src/hooks/use-table.d.ts +35 -0
- package/dist/components/table/src/hooks/use-table.js +245 -0
- package/dist/components/table/src/index.d.ts +4 -0
- package/dist/components/table/src/table.d.ts +88 -0
- package/dist/components/table/src/table.js +24 -0
- package/dist/components/table/src/tv.d.ts +176 -0
- package/dist/components/table/src/tv.js +97 -0
- package/dist/components/table/src/types.d.ts +292 -0
- package/dist/components/table/tsup.config.d.ts +2 -0
- package/dist/components/tabs/dist/index.js +4 -3
- package/dist/components/tabs/src/tabs.d.ts +2 -2
- package/dist/components/tabs/src/tabs.js +5 -4
- package/dist/components/text-field/dist/index.d.ts +1 -1
- package/dist/components/text-field/dist/index.js +10 -10
- package/dist/components/text-field/src/components/field-addon.d.ts +1 -2
- package/dist/components/text-field/src/index.d.ts +3 -1
- package/dist/components/text-field/src/text-field.js +10 -10
- package/dist/components/textarea/dist/index.d.ts +33 -5
- package/dist/components/textarea/dist/index.js +32 -7
- package/dist/components/textarea/src/components/autosize/index.d.ts +6 -1
- package/dist/components/textarea/src/components/autosize/index.js +31 -6
- package/dist/components/textarea/src/textarea.js +1 -1
- package/dist/components/textarea/src/types.d.ts +33 -5
- package/dist/components/toggle-button/dist/index.d.ts +26 -2
- package/dist/components/toggle-button/src/context.d.ts +11 -0
- package/dist/components/toggle-button/src/context.js +13 -0
- package/dist/components/toggle-button/src/index.d.ts +2 -0
- package/dist/components/toggle-button/src/toggle-button.js +4 -4
- package/dist/components/toggle-button/src/toggle-group.d.ts +26 -0
- package/dist/components/toggle-button/src/toggle-group.js +156 -0
- package/dist/components/toggle-button/src/tv.d.ts +67 -3
- package/dist/components/toggle-button/src/tv.js +45 -14
- package/dist/components/tooltip/dist/index.d.ts +10 -43
- package/dist/components/tooltip/dist/index.js +35 -33
- package/dist/components/tooltip/src/components/tooltip-arrow.js +1 -1
- package/dist/components/tooltip/src/components/tooltip-content.js +5 -4
- package/dist/components/tooltip/src/context/index.d.ts +1 -0
- package/dist/components/tooltip/src/hooks/use-tooltip.js +3 -3
- package/dist/components/tooltip/src/index.d.ts +2 -4
- package/dist/components/tooltip/src/tooltip.d.ts +7 -1
- package/dist/components/tooltip/src/tooltip.js +6 -1
- package/dist/components/tooltip/src/tv.js +1 -1
- package/dist/components/virtualized-grid/dist/index.d.ts +2 -2
- package/dist/components/virtualized-grid/src/use-item-pool.js +14 -26
- package/dist/components/virtualized-grid/src/use-virtualized-grid.d.ts +1 -1
- package/dist/components/virtualized-grid/src/use-virtualized-grid.js +14 -8
- package/dist/components/virtualized-grid/src/utility.d.ts +1 -1
- package/dist/components/virtualized-grid/src/utility.js +37 -31
- package/dist/components/virtualized-grid/src/virtualized-grid.js +27 -17
- package/dist/context/choice-ui-provider.d.ts +35 -0
- package/dist/context/choice-ui-provider.js +14 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +50 -195
- package/package.json +1 -1
- package/dist/components/code-block/src/index.js +0 -15
- package/dist/components/rich-input/src/hooks/use-mouse-events.js +0 -113
- package/dist/components/rich-input/src/hooks/use-validation.js +0 -80
- package/dist/components/rich-input/src/utils/markdown-to-slate.js +0 -219
- /package/dist/components/command/src/{command-score.d.ts → utils/command-score.d.ts} +0 -0
- /package/dist/components/command/src/{command-score.js → utils/command-score.js} +0 -0
- /package/dist/components/pagination/src/{components → context}/pagination-context.d.ts +0 -0
- /package/dist/components/pagination/src/{components → context}/pagination-context.js +0 -0
|
@@ -8,25 +8,25 @@ import * as React$1 from 'react';
|
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Date format string
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Supports all date-fns format strings, common format examples:
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* - yyyy: 2025 (4
|
|
17
|
-
* - yy: 25 (2
|
|
15
|
+
* **Year**:
|
|
16
|
+
* - yyyy: 2025 (4-digit year)
|
|
17
|
+
* - yy: 25 (2-digit year)
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* - MMMM: December (
|
|
21
|
-
* - MMM: Dec (
|
|
22
|
-
* - MM: 12 (2
|
|
23
|
-
* - M: 12 (1-2
|
|
19
|
+
* **Month**:
|
|
20
|
+
* - MMMM: December (full month name)
|
|
21
|
+
* - MMM: Dec (abbreviated month name)
|
|
22
|
+
* - MM: 12 (2-digit month)
|
|
23
|
+
* - M: 12 (1-2 digit month)
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
* - dd: 31 (2
|
|
27
|
-
* - d: 31 (1-2
|
|
25
|
+
* **Date**:
|
|
26
|
+
* - dd: 31 (2-digit date)
|
|
27
|
+
* - d: 31 (1-2 digit date)
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* **Common combinations**:
|
|
30
30
|
* - "yyyy-MM-dd" → 2025-12-31
|
|
31
31
|
* - "yy-MM-dd" → 25-12-31
|
|
32
32
|
* - "yyyy年MM月dd日" → 2025年12月31日
|
|
@@ -40,112 +40,112 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
40
40
|
*/
|
|
41
41
|
type DateDataFormat = string;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Time format string
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* Supports all date-fns time format strings, common format examples:
|
|
46
46
|
*
|
|
47
|
-
* **24
|
|
48
|
-
* - "HH:mm" → 09:30, 14:45 (2
|
|
49
|
-
* - "H:mm" → 9:30, 14:45 (1-2
|
|
50
|
-
* - "HH:mm:ss" → 09:30:15 (
|
|
51
|
-
* - "HHmm" → 0930, 1445 (
|
|
47
|
+
* **24-hour format**:
|
|
48
|
+
* - "HH:mm" → 09:30, 14:45 (2-digit hour)
|
|
49
|
+
* - "H:mm" → 9:30, 14:45 (1-2 digit hour)
|
|
50
|
+
* - "HH:mm:ss" → 09:30:15 (with seconds)
|
|
51
|
+
* - "HHmm" → 0930, 1445 (compact format)
|
|
52
52
|
*
|
|
53
|
-
* **12
|
|
53
|
+
* **12-hour format**:
|
|
54
54
|
* - "h:mm a" → 9:30 AM, 2:45 PM
|
|
55
|
-
* - "hh:mm a" → 09:30 AM, 02:45 PM (2
|
|
56
|
-
* - "h:mm aa" → 9:30 A.M., 2:45 P.M. (
|
|
57
|
-
* - "h:mm:ss a" → 9:30:15 AM (
|
|
55
|
+
* - "hh:mm a" → 09:30 AM, 02:45 PM (2-digit hour)
|
|
56
|
+
* - "h:mm aa" → 9:30 A.M., 2:45 P.M. (full AM/PM)
|
|
57
|
+
* - "h:mm:ss a" → 9:30:15 AM (with seconds)
|
|
58
58
|
*
|
|
59
59
|
* @see https://date-fns.org/v2.29.3/docs/format
|
|
60
60
|
*/
|
|
61
61
|
type TimeDataFormat = string;
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* Time object (hour and minute)
|
|
65
65
|
*/
|
|
66
66
|
interface Time {
|
|
67
67
|
hour: number;
|
|
68
68
|
minute: number;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Time layout mode
|
|
72
72
|
*/
|
|
73
73
|
type TimeLayout = "single" | "dual";
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Time input parsing result
|
|
76
76
|
*/
|
|
77
77
|
interface TimeInputValue {
|
|
78
|
-
/**
|
|
78
|
+
/** Parsing error message */
|
|
79
79
|
error: string | null;
|
|
80
|
-
/**
|
|
80
|
+
/** Formatted display value */
|
|
81
81
|
formatted: string;
|
|
82
|
-
/**
|
|
82
|
+
/** Original input value */
|
|
83
83
|
input: string;
|
|
84
|
-
/**
|
|
84
|
+
/** Whether it is a valid time */
|
|
85
85
|
isValid: boolean;
|
|
86
|
-
/**
|
|
86
|
+
/** Parsed time Date object */
|
|
87
87
|
time: Date | null;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* Time parsing options
|
|
91
91
|
*/
|
|
92
92
|
interface TimeParserOptions {
|
|
93
|
-
/**
|
|
93
|
+
/** Time format */
|
|
94
94
|
format: TimeDataFormat;
|
|
95
|
-
/**
|
|
95
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
96
96
|
locale?: Locale | string;
|
|
97
|
-
/**
|
|
97
|
+
/** Strict mode */
|
|
98
98
|
strict?: boolean;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Time component base properties
|
|
102
102
|
*/
|
|
103
103
|
interface BaseTimeProps {
|
|
104
|
-
/**
|
|
104
|
+
/** Default value */
|
|
105
105
|
defaultValue?: Date | null;
|
|
106
|
-
/**
|
|
106
|
+
/** Whether it is disabled */
|
|
107
107
|
disabled?: boolean;
|
|
108
|
-
/**
|
|
108
|
+
/** Time format, supports all date-fns format strings */
|
|
109
109
|
format?: TimeDataFormat;
|
|
110
|
-
/**
|
|
110
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
111
111
|
locale?: Locale | string;
|
|
112
|
-
/**
|
|
112
|
+
/** Maximum time */
|
|
113
113
|
maxTime?: Date;
|
|
114
|
-
/**
|
|
114
|
+
/** Minimum time */
|
|
115
115
|
minTime?: Date;
|
|
116
|
-
/**
|
|
116
|
+
/** Time change callback */
|
|
117
117
|
onChange?: (time: Date | null) => void;
|
|
118
|
-
/**
|
|
118
|
+
/** Whether it is read-only (disable selection but do not change style) */
|
|
119
119
|
readOnly?: boolean;
|
|
120
|
-
/**
|
|
120
|
+
/** Currently selected time */
|
|
121
121
|
value?: Date | null;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
124
|
+
* Time step related properties
|
|
125
125
|
*/
|
|
126
126
|
interface StepProps {
|
|
127
|
-
/** Meta/Ctrl +
|
|
127
|
+
/** Meta/Ctrl + key step (minutes), default 60 minutes */
|
|
128
128
|
metaStep?: number;
|
|
129
|
-
/** Shift +
|
|
129
|
+
/** Shift + key step (minutes), default 15 minutes */
|
|
130
130
|
shiftStep?: number;
|
|
131
|
-
/**
|
|
131
|
+
/** Base step (minutes), default 1 minute */
|
|
132
132
|
step?: number;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Time interaction properties
|
|
136
136
|
*/
|
|
137
137
|
interface TimeInteractionProps {
|
|
138
|
-
/**
|
|
138
|
+
/** Whether to enable parsing cache */
|
|
139
139
|
enableCache?: boolean;
|
|
140
|
-
/**
|
|
140
|
+
/** Whether to enable keyboard navigation (default enabled) */
|
|
141
141
|
enableKeyboardNavigation?: boolean;
|
|
142
|
-
/**
|
|
142
|
+
/** Whether to enable performance analysis */
|
|
143
143
|
enableProfiling?: boolean;
|
|
144
|
-
/**
|
|
144
|
+
/** Callback when Enter key is pressed */
|
|
145
145
|
onEnterKeyDown?: () => void;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
148
|
+
* Time option item
|
|
149
149
|
*/
|
|
150
150
|
interface TimeOptionItem {
|
|
151
151
|
disabled?: boolean;
|
|
@@ -153,78 +153,78 @@ interface TimeOptionItem {
|
|
|
153
153
|
value: Time;
|
|
154
154
|
}
|
|
155
155
|
interface SmartInputOptions {
|
|
156
|
-
/**
|
|
156
|
+
/** Debounce delay (milliseconds) */
|
|
157
157
|
debounceMs?: number;
|
|
158
|
-
/**
|
|
158
|
+
/** Whether to enable auto complete */
|
|
159
159
|
enableAutoComplete?: boolean;
|
|
160
|
-
/**
|
|
160
|
+
/** Whether to enable keyboard navigation */
|
|
161
161
|
enableKeyboardNavigation?: boolean;
|
|
162
|
-
/**
|
|
162
|
+
/** Whether to enable real-time validation */
|
|
163
163
|
enableLiveValidation?: boolean;
|
|
164
|
-
/**
|
|
164
|
+
/** Whether to show parse preview */
|
|
165
165
|
showParsePreview?: boolean;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* Date range object
|
|
169
169
|
*/
|
|
170
170
|
interface DateRange {
|
|
171
171
|
end: Date;
|
|
172
172
|
start: Date;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
|
-
*
|
|
175
|
+
* Date of the week starts
|
|
176
176
|
*/
|
|
177
177
|
type WeekStartsOn = Day;
|
|
178
178
|
/**
|
|
179
|
-
*
|
|
179
|
+
* Date comparison mode
|
|
180
180
|
*/
|
|
181
181
|
type DateComparisonMode$1 = "exact-time" | "date-only";
|
|
182
182
|
/**
|
|
183
|
-
*
|
|
183
|
+
* Calendar selection value type
|
|
184
184
|
*/
|
|
185
185
|
type CalendarValue = Date | Date[] | DateRange | null;
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
187
|
+
* Selection mode
|
|
188
188
|
*/
|
|
189
189
|
type SelectionMode = "single" | "multiple" | "range";
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
191
|
+
* Date input parsing result
|
|
192
192
|
*/
|
|
193
193
|
interface DateInputValue {
|
|
194
|
-
/**
|
|
194
|
+
/** Parsed date object */
|
|
195
195
|
date: Date | null;
|
|
196
|
-
/**
|
|
196
|
+
/** Parsing error message */
|
|
197
197
|
error: string | null;
|
|
198
|
-
/**
|
|
198
|
+
/** Formatted display value */
|
|
199
199
|
formatted: string;
|
|
200
|
-
/**
|
|
200
|
+
/** Original input value */
|
|
201
201
|
input: string;
|
|
202
|
-
/**
|
|
202
|
+
/** Whether it is a valid date */
|
|
203
203
|
isValid: boolean;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* Date parsing options
|
|
207
207
|
*/
|
|
208
208
|
interface DateParserOptions {
|
|
209
|
-
/**
|
|
209
|
+
/** Whether to enable natural language parsing */
|
|
210
210
|
enableNaturalLanguage?: boolean;
|
|
211
|
-
/**
|
|
211
|
+
/** Whether to enable relative date parsing */
|
|
212
212
|
enableRelativeDate?: boolean;
|
|
213
|
-
/**
|
|
213
|
+
/** Whether to enable smart correction */
|
|
214
214
|
enableSmartCorrection?: boolean;
|
|
215
|
-
/**
|
|
215
|
+
/** Date format */
|
|
216
216
|
format: DateDataFormat;
|
|
217
|
-
/**
|
|
217
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
218
218
|
locale?: Locale | string;
|
|
219
|
-
/**
|
|
219
|
+
/** Maximum date */
|
|
220
220
|
maxDate?: Date;
|
|
221
|
-
/**
|
|
221
|
+
/** Minimum date */
|
|
222
222
|
minDate?: Date;
|
|
223
|
-
/**
|
|
223
|
+
/** Strict mode (not allowed invalid date) */
|
|
224
224
|
strict?: boolean;
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
|
-
*
|
|
227
|
+
* Natural language keyword mapping
|
|
228
228
|
*/
|
|
229
229
|
interface NaturalLanguageMap {
|
|
230
230
|
afternoon: string[];
|
|
@@ -246,7 +246,7 @@ interface NaturalLanguageMap {
|
|
|
246
246
|
yesterday: string[];
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* Relative date pattern
|
|
250
250
|
*/
|
|
251
251
|
interface RelativeDatePattern {
|
|
252
252
|
multiplier: number;
|
|
@@ -254,100 +254,100 @@ interface RelativeDatePattern {
|
|
|
254
254
|
type: "day" | "week" | "month" | "year";
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
|
-
*
|
|
257
|
+
* Date component base properties
|
|
258
258
|
*/
|
|
259
259
|
interface BaseDateProps {
|
|
260
|
-
/**
|
|
260
|
+
/** Default value */
|
|
261
261
|
defaultValue?: Date | null;
|
|
262
|
-
/**
|
|
262
|
+
/** Whether it is disabled */
|
|
263
263
|
disabled?: boolean;
|
|
264
|
-
/**
|
|
264
|
+
/** Date format, supports all date-fns format strings */
|
|
265
265
|
format?: DateDataFormat;
|
|
266
|
-
/**
|
|
266
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
267
267
|
locale?: Locale | string;
|
|
268
|
-
/**
|
|
268
|
+
/** Maximum date */
|
|
269
269
|
maxDate?: Date;
|
|
270
|
-
/**
|
|
270
|
+
/** Minimum date */
|
|
271
271
|
minDate?: Date;
|
|
272
|
-
/**
|
|
272
|
+
/** Date change callback */
|
|
273
273
|
onChange?: (date: Date | null) => void;
|
|
274
|
-
/**
|
|
274
|
+
/** Currently selected date */
|
|
275
275
|
value?: Date | null;
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
|
-
*
|
|
278
|
+
* Date interaction properties
|
|
279
279
|
*/
|
|
280
280
|
interface DateInteractionProps {
|
|
281
|
-
/**
|
|
281
|
+
/** Whether to enable parsing cache */
|
|
282
282
|
enableCache?: boolean;
|
|
283
|
-
/**
|
|
283
|
+
/** Whether to enable keyboard navigation (default enabled) */
|
|
284
284
|
enableKeyboardNavigation?: boolean;
|
|
285
|
-
/**
|
|
285
|
+
/** Whether to enable prediction */
|
|
286
286
|
enablePrediction?: boolean;
|
|
287
|
-
/**
|
|
287
|
+
/** Whether to enable performance analysis */
|
|
288
288
|
enableProfiling?: boolean;
|
|
289
|
-
/**
|
|
289
|
+
/** Callback when Enter key is pressed */
|
|
290
290
|
onEnterKeyDown?: () => void;
|
|
291
291
|
}
|
|
292
292
|
/**
|
|
293
|
-
*
|
|
293
|
+
* Month calendar component base properties
|
|
294
294
|
*/
|
|
295
295
|
interface BaseCalendarProps {
|
|
296
296
|
children?: React.ReactNode;
|
|
297
|
-
/**
|
|
297
|
+
/** Custom class name */
|
|
298
298
|
className?: string;
|
|
299
|
-
/**
|
|
299
|
+
/** Currently displayed month */
|
|
300
300
|
currentMonth?: Date;
|
|
301
|
-
/**
|
|
301
|
+
/** Date comparison mode */
|
|
302
302
|
dateComparisonMode?: DateComparisonMode$1;
|
|
303
|
-
/**
|
|
303
|
+
/** Non-controlled mode default value */
|
|
304
304
|
defaultValue?: CalendarValue;
|
|
305
|
-
/**
|
|
305
|
+
/** Disabled dates array */
|
|
306
306
|
disabledDates?: Date[];
|
|
307
|
-
/**
|
|
307
|
+
/** Whether to fix 6 rows display (42 days), default true to ensure height consistency */
|
|
308
308
|
fixedGrid?: boolean;
|
|
309
|
-
/**
|
|
309
|
+
/** Dates to highlight */
|
|
310
310
|
highlightDates?: Date[];
|
|
311
|
-
/**
|
|
311
|
+
/** Whether to highlight today */
|
|
312
312
|
highlightToday?: boolean;
|
|
313
|
-
/**
|
|
313
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
314
314
|
locale?: Locale | string;
|
|
315
|
-
/**
|
|
315
|
+
/** Maximum可选日期 */
|
|
316
316
|
maxDate?: Date;
|
|
317
|
-
/**
|
|
317
|
+
/** Minimum可选日期 */
|
|
318
318
|
minDate?: Date;
|
|
319
|
-
/**
|
|
319
|
+
/** Value change callback */
|
|
320
320
|
onChange?: (value: CalendarValue) => void;
|
|
321
|
-
/**
|
|
321
|
+
/** Month change callback */
|
|
322
322
|
onMonthChange?: (month: Date) => void;
|
|
323
|
-
/**
|
|
323
|
+
/** Whether it is read-only (disable selection but do not change style) */
|
|
324
324
|
readOnly?: boolean;
|
|
325
|
-
/**
|
|
325
|
+
/** Selection mode, if not specified, will be automatically inferred based on value type */
|
|
326
326
|
selectionMode?: SelectionMode;
|
|
327
|
-
/**
|
|
327
|
+
/** Whether to show dates of non-current months */
|
|
328
328
|
showOutsideDays?: boolean;
|
|
329
|
-
/**
|
|
329
|
+
/** Whether to show week numbers, default false */
|
|
330
330
|
showWeekNumbers?: boolean;
|
|
331
|
-
/**
|
|
331
|
+
/** Time zone */
|
|
332
332
|
timeZone?: string;
|
|
333
|
-
/**
|
|
333
|
+
/** Controlled mode value */
|
|
334
334
|
value?: CalendarValue;
|
|
335
|
-
/**
|
|
335
|
+
/** Week starts on (0=Sunday, 1=Monday) */
|
|
336
336
|
weekStartsOn?: WeekStartsOn;
|
|
337
|
-
/**
|
|
337
|
+
/** Custom weekday names */
|
|
338
338
|
weekdayNames?: string[];
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
|
-
*
|
|
341
|
+
* Month calendar layout related properties
|
|
342
342
|
*/
|
|
343
343
|
interface CalendarLayoutProps {
|
|
344
|
-
/**
|
|
344
|
+
/** Direction */
|
|
345
345
|
direction?: "horizontal" | "vertical";
|
|
346
|
-
/**
|
|
346
|
+
/** Variant style */
|
|
347
347
|
variant?: "default" | "dark";
|
|
348
348
|
}
|
|
349
349
|
/**
|
|
350
|
-
*
|
|
350
|
+
* Calendar state interface
|
|
351
351
|
*/
|
|
352
352
|
interface CalendarState {
|
|
353
353
|
isSingleDay: boolean;
|
|
@@ -359,7 +359,7 @@ interface CalendarState {
|
|
|
359
359
|
} | null;
|
|
360
360
|
}
|
|
361
361
|
/**
|
|
362
|
-
*
|
|
362
|
+
* Quarter object
|
|
363
363
|
*/
|
|
364
364
|
interface Quarter {
|
|
365
365
|
label: string;
|
|
@@ -368,7 +368,7 @@ interface Quarter {
|
|
|
368
368
|
year: number;
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
|
-
*
|
|
371
|
+
* Quarter item state
|
|
372
372
|
*/
|
|
373
373
|
interface QuarterItem {
|
|
374
374
|
isCurrent: boolean;
|
|
@@ -378,7 +378,7 @@ interface QuarterItem {
|
|
|
378
378
|
quarter: Quarter;
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
|
-
*
|
|
381
|
+
* Year item state
|
|
382
382
|
*/
|
|
383
383
|
interface YearItem {
|
|
384
384
|
isCurrent: boolean;
|
|
@@ -388,96 +388,96 @@ interface YearItem {
|
|
|
388
388
|
year: Date;
|
|
389
389
|
}
|
|
390
390
|
/**
|
|
391
|
-
*
|
|
391
|
+
* Quarter component base properties
|
|
392
392
|
*/
|
|
393
393
|
interface BaseQuarterProps {
|
|
394
394
|
children?: React.ReactNode;
|
|
395
|
-
/**
|
|
395
|
+
/** Currently displayed year */
|
|
396
396
|
currentYear?: number;
|
|
397
|
-
/**
|
|
397
|
+
/** Default value */
|
|
398
398
|
defaultValue?: Quarter;
|
|
399
|
-
/**
|
|
399
|
+
/** Whether it is disabled */
|
|
400
400
|
disabled?: boolean;
|
|
401
|
-
/**
|
|
401
|
+
/** Disabled quarters array */
|
|
402
402
|
disabledQuarters?: Array<{
|
|
403
403
|
quarter: number;
|
|
404
404
|
year: number;
|
|
405
405
|
}>;
|
|
406
|
-
/**
|
|
406
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
407
407
|
locale?: Locale | string;
|
|
408
|
-
/**
|
|
408
|
+
/** Maximum selectable year */
|
|
409
409
|
maxYear?: number;
|
|
410
|
-
/**
|
|
410
|
+
/** Minimum selectable year */
|
|
411
411
|
minYear?: number;
|
|
412
|
-
/**
|
|
412
|
+
/** Quarter change callback */
|
|
413
413
|
onChange?: (quarter: Quarter | null) => void;
|
|
414
|
-
/**
|
|
414
|
+
/** Whether it is read-only (disable selection but do not change style) */
|
|
415
415
|
readOnly?: boolean;
|
|
416
|
-
/**
|
|
416
|
+
/** Displayed year */
|
|
417
417
|
startYear?: number;
|
|
418
|
-
/**
|
|
418
|
+
/** Currently selected quarter */
|
|
419
419
|
value?: Quarter | null;
|
|
420
420
|
}
|
|
421
421
|
/**
|
|
422
|
-
*
|
|
422
|
+
* Quarter navigation related properties
|
|
423
423
|
*/
|
|
424
424
|
interface QuarterNavigationProps {
|
|
425
|
-
/**
|
|
425
|
+
/** Year range navigation callback */
|
|
426
426
|
onNavigate?: (direction: "prev" | "next", newYear: number) => void;
|
|
427
427
|
}
|
|
428
428
|
/**
|
|
429
|
-
*
|
|
429
|
+
* Quarter layout related properties
|
|
430
430
|
*/
|
|
431
431
|
interface QuarterLayoutProps {
|
|
432
|
-
/**
|
|
432
|
+
/** Custom class name */
|
|
433
433
|
className?: string;
|
|
434
|
-
/**
|
|
434
|
+
/** Variant style */
|
|
435
435
|
variant?: "default" | "dark";
|
|
436
436
|
}
|
|
437
437
|
/**
|
|
438
|
-
*
|
|
438
|
+
* Year component base properties
|
|
439
439
|
*/
|
|
440
440
|
interface BaseYearProps {
|
|
441
441
|
children?: React.ReactNode;
|
|
442
|
-
/**
|
|
442
|
+
/** Currently displayed year (for highlighting) */
|
|
443
443
|
currentYear?: Date;
|
|
444
|
-
/**
|
|
444
|
+
/** Default value */
|
|
445
445
|
defaultValue?: Date;
|
|
446
|
-
/**
|
|
446
|
+
/** Whether it is disabled */
|
|
447
447
|
disabled?: boolean;
|
|
448
|
-
/**
|
|
448
|
+
/** Disabled years array */
|
|
449
449
|
disabledYears?: Date[];
|
|
450
|
-
/**
|
|
450
|
+
/** Language environment - supports Locale object or string (e.g., "zh-CN", "en-US") */
|
|
451
451
|
locale?: Locale | string;
|
|
452
|
-
/**
|
|
452
|
+
/** Maximum selectable year */
|
|
453
453
|
maxYear?: Date;
|
|
454
|
-
/**
|
|
454
|
+
/** Minimum selectable year */
|
|
455
455
|
minYear?: Date;
|
|
456
|
-
/**
|
|
456
|
+
/** Year change callback */
|
|
457
457
|
onChange?: (year: Date | null) => void;
|
|
458
|
-
/**
|
|
458
|
+
/** Whether it is read-only (disable selection but do not change style) */
|
|
459
459
|
readOnly?: boolean;
|
|
460
|
-
/**
|
|
460
|
+
/** Displayed year range start year, default current year - 10 */
|
|
461
461
|
startYear?: Date;
|
|
462
|
-
/**
|
|
462
|
+
/** Currently selected year */
|
|
463
463
|
value?: Date | null;
|
|
464
|
-
/**
|
|
464
|
+
/** Displayed year count, default 12 */
|
|
465
465
|
yearCount?: number;
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
468
|
-
*
|
|
468
|
+
* Year navigation related properties
|
|
469
469
|
*/
|
|
470
470
|
interface YearNavigationProps {
|
|
471
|
-
/**
|
|
471
|
+
/** Year range navigation callback */
|
|
472
472
|
onNavigate?: (direction: "prev" | "next", newStartYear: Date) => void;
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
|
-
*
|
|
475
|
+
* Year layout related properties
|
|
476
476
|
*/
|
|
477
477
|
interface YearLayoutProps {
|
|
478
|
-
/**
|
|
478
|
+
/** Custom class name */
|
|
479
479
|
className?: string;
|
|
480
|
-
/**
|
|
480
|
+
/** Variant style */
|
|
481
481
|
variant?: "default" | "dark";
|
|
482
482
|
}
|
|
483
483
|
|
|
@@ -553,11 +553,11 @@ interface DateRangeInputProps extends Omit<TextFieldProps, "value" | "onChange"
|
|
|
553
553
|
onStartChange?: (date: Date | null) => void;
|
|
554
554
|
onStartFocus?: () => void;
|
|
555
555
|
/**
|
|
556
|
-
*
|
|
557
|
-
* @default 1 -
|
|
558
|
-
* @example 0.5 -
|
|
559
|
-
* @example 0.1 -
|
|
560
|
-
* @example 0.25 -
|
|
556
|
+
* Range length display precision, control the minimum unit of range calculation
|
|
557
|
+
* @default 1 - Minimum unit is 1 day
|
|
558
|
+
* @example 0.5 - Minimum unit is 0.5 days (half a day)
|
|
559
|
+
* @example 0.1 - Minimum unit is 0.1 days (2.4 hours)
|
|
560
|
+
* @example 0.25 - Minimum unit is 0.25 days (6 hours)
|
|
561
561
|
*/
|
|
562
562
|
rangePrecision?: number;
|
|
563
563
|
startDisabled?: boolean;
|
|
@@ -569,11 +569,11 @@ declare const DateRangeInput: (props: DateRangeInputProps) => react_jsx_runtime.
|
|
|
569
569
|
|
|
570
570
|
interface TimeCalendarProps extends BaseTimeProps, StepProps {
|
|
571
571
|
children?: React__default.ReactNode;
|
|
572
|
-
/**
|
|
572
|
+
/** Custom class name */
|
|
573
573
|
className?: string;
|
|
574
|
-
/**
|
|
574
|
+
/** Hour step, default 1 hour */
|
|
575
575
|
hourStep?: number;
|
|
576
|
-
/**
|
|
576
|
+
/** Minute step, default 15 minutes */
|
|
577
577
|
minuteStep?: number;
|
|
578
578
|
}
|
|
579
579
|
declare const TimeCalendar: React__default.NamedExoticComponent<TimeCalendarProps>;
|
|
@@ -583,16 +583,16 @@ interface TimeInputProps extends Omit<TextFieldProps, "value" | "onChange" | "fo
|
|
|
583
583
|
suffixElement?: React__default.ReactNode;
|
|
584
584
|
}
|
|
585
585
|
/**
|
|
586
|
-
*
|
|
586
|
+
* Advanced time input component
|
|
587
587
|
*
|
|
588
|
-
*
|
|
589
|
-
* - 🎯
|
|
590
|
-
* - ⌨️
|
|
591
|
-
* - 🔄
|
|
592
|
-
* - 🚀
|
|
593
|
-
* - 🛡️
|
|
594
|
-
* - 🌍
|
|
595
|
-
* - 📱
|
|
588
|
+
* Features:
|
|
589
|
+
* - 🎯 Intelligent time parsing: support multiple formats and natural language
|
|
590
|
+
* - ⌨️ Keyboard navigation: up key decreases, down key increases (符合列表导航逻辑)
|
|
591
|
+
* - 🔄 Race protection: smartly detect data flow direction, avoid loop updates
|
|
592
|
+
* - 🚀 Performance optimization: use useEventCallback and caching mechanism
|
|
593
|
+
* - 🛡️ Type safety: complete TypeScript support
|
|
594
|
+
* - 🌍 Internationalization support: configurable language region
|
|
595
|
+
* - 📱 Drag interaction: support dragging adjustment through prefix icon
|
|
596
596
|
*/
|
|
597
597
|
declare const TimeInput: React__default.ForwardRefExoticComponent<Omit<TimeInputProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
598
598
|
|
|
@@ -641,29 +641,29 @@ declare function generateCalendarDays(currentMonth: Date, weekStartsOn?: number,
|
|
|
641
641
|
declare function formatMonthTitle(date: Date, locale?: Locale | string): string;
|
|
642
642
|
declare function calculateWeekNumbers(calendarDays: Date[], locale?: Locale | string): number[];
|
|
643
643
|
/**
|
|
644
|
-
*
|
|
644
|
+
* Infer selection mode based on value type
|
|
645
645
|
*/
|
|
646
646
|
declare function inferSelectionMode(value: CalendarValue): SelectionMode;
|
|
647
647
|
/**
|
|
648
|
-
*
|
|
648
|
+
* Infer month from CalendarValue
|
|
649
649
|
*/
|
|
650
650
|
declare function inferMonthFromValue(value: CalendarValue): Date | null;
|
|
651
651
|
/**
|
|
652
|
-
*
|
|
652
|
+
* Compare two CalendarValue for equality (supports time zone aware and comparison precision)
|
|
653
653
|
*/
|
|
654
654
|
declare function isCalendarValueEqual(a: CalendarValue, b: CalendarValue, timeZone?: string, dateComparisonMode?: "exact-time" | "date-only"): boolean;
|
|
655
655
|
|
|
656
656
|
declare const LOCALE_MAP: Record<string, Locale>;
|
|
657
657
|
/**
|
|
658
|
-
* 🔧
|
|
658
|
+
* 🔧 Safe locale parsing function
|
|
659
659
|
*
|
|
660
|
-
*
|
|
661
|
-
* - Locale
|
|
662
|
-
* -
|
|
663
|
-
* -
|
|
660
|
+
* Supports the following input formats:
|
|
661
|
+
* - Locale object: return directly
|
|
662
|
+
* - String: automatically map to the corresponding Locale object
|
|
663
|
+
* - Invalid value: return Chinese locale (zhCN)
|
|
664
664
|
*
|
|
665
|
-
* @param locale -
|
|
666
|
-
* @returns
|
|
665
|
+
* @param locale - Can be a Locale object or string
|
|
666
|
+
* @returns Parsed Locale object
|
|
667
667
|
*
|
|
668
668
|
* @example
|
|
669
669
|
* ```ts
|
|
@@ -675,83 +675,83 @@ declare const LOCALE_MAP: Record<string, Locale>;
|
|
|
675
675
|
*/
|
|
676
676
|
declare function resolveLocale(locale: Locale | string | undefined | null): Locale;
|
|
677
677
|
/**
|
|
678
|
-
* 🔍
|
|
679
|
-
* @returns
|
|
678
|
+
* 🔍 Get all supported locale list
|
|
679
|
+
* @returns Supported locale string array
|
|
680
680
|
*/
|
|
681
681
|
declare function getSupportedLocales(): string[];
|
|
682
682
|
/**
|
|
683
|
-
* 🎯
|
|
684
|
-
* @param locale - Locale
|
|
685
|
-
* @returns
|
|
683
|
+
* 🎯 Check if it is a Chinese locale
|
|
684
|
+
* @param locale - Locale object or string
|
|
685
|
+
* @returns Whether it is a Chinese locale
|
|
686
686
|
*/
|
|
687
687
|
declare function isChineseLocale(locale: Locale | string | undefined | null): boolean;
|
|
688
688
|
|
|
689
689
|
/**
|
|
690
|
-
*
|
|
691
|
-
* - 'exact-time':
|
|
692
|
-
* - 'date-only':
|
|
690
|
+
* Date comparison precision mode
|
|
691
|
+
* - 'exact-time': Exact time comparison (includes hours, minutes, seconds, milliseconds)
|
|
692
|
+
* - 'date-only': Date only comparison (ignores time part, compares year, month, day)
|
|
693
693
|
*/
|
|
694
694
|
type DateComparisonMode = "exact-time" | "date-only";
|
|
695
695
|
/**
|
|
696
|
-
*
|
|
696
|
+
* Time zone aware date parts
|
|
697
697
|
*/
|
|
698
698
|
interface DateParts {
|
|
699
|
-
/**
|
|
699
|
+
/** Day (1-31) */
|
|
700
700
|
day: number;
|
|
701
|
-
/**
|
|
701
|
+
/** Month (0-11) */
|
|
702
702
|
month: number;
|
|
703
|
-
/**
|
|
703
|
+
/** Weekday (0-6, 0 is Sunday) */
|
|
704
704
|
weekday: number;
|
|
705
|
-
/**
|
|
705
|
+
/** Year */
|
|
706
706
|
year: number;
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
709
|
-
*
|
|
709
|
+
* Create time zone context options (for date-fns 4.0+)
|
|
710
710
|
*/
|
|
711
711
|
declare function createTimeZoneContext(timeZone?: string): {
|
|
712
712
|
in: (value: Date | number | string) => TZDate;
|
|
713
713
|
} | undefined;
|
|
714
714
|
/**
|
|
715
|
-
*
|
|
715
|
+
* Time zone aware date comparison (only compares date part)
|
|
716
716
|
*
|
|
717
|
-
* @param date1
|
|
718
|
-
* @param date2
|
|
719
|
-
* @param timeZone
|
|
720
|
-
* @returns
|
|
717
|
+
* @param date1 First date
|
|
718
|
+
* @param date2 Second date
|
|
719
|
+
* @param timeZone Time zone (optional, default uses local timezone)
|
|
720
|
+
* @returns Whether they are the same day
|
|
721
721
|
*
|
|
722
722
|
* @example
|
|
723
723
|
* ```typescript
|
|
724
724
|
* const date1 = new Date('2025-01-15T23:30:00Z') // UTC
|
|
725
|
-
* const date2 = new Date('2025-01-16T08:30:00+09:00') // JST (
|
|
725
|
+
* const date2 = new Date('2025-01-16T08:30:00+09:00') // JST (same day)
|
|
726
726
|
* isSameDayInTimeZone(date1, date2, 'Asia/Tokyo') // true
|
|
727
727
|
* ```
|
|
728
728
|
*/
|
|
729
729
|
declare function isSameDayInTimeZone(date1: Date, date2: Date, timeZone?: string): boolean;
|
|
730
730
|
/**
|
|
731
|
-
*
|
|
731
|
+
* Time zone aware month comparison
|
|
732
732
|
*/
|
|
733
733
|
declare function isSameMonthInTimeZone(date1: Date, date2: Date, timeZone?: string): boolean;
|
|
734
734
|
/**
|
|
735
|
-
*
|
|
735
|
+
* Time zone aware year comparison
|
|
736
736
|
*/
|
|
737
737
|
declare function isSameYearInTimeZone(date1: Date, date2: Date, timeZone?: string): boolean;
|
|
738
738
|
/**
|
|
739
|
-
*
|
|
739
|
+
* Time zone aware week comparison
|
|
740
740
|
*/
|
|
741
741
|
declare function isSameWeekInTimeZone(date1: Date, date2: Date, timeZone?: string): boolean;
|
|
742
742
|
/**
|
|
743
|
-
*
|
|
743
|
+
* Time zone aware today check
|
|
744
744
|
*/
|
|
745
745
|
declare function isTodayInTimeZone(date: Date, timeZone?: string): boolean;
|
|
746
746
|
/**
|
|
747
|
-
*
|
|
747
|
+
* Check if date is within specified range (supports time zone and comparison mode)
|
|
748
748
|
*
|
|
749
|
-
* @param date
|
|
750
|
-
* @param rangeStart
|
|
751
|
-
* @param rangeEnd
|
|
752
|
-
* @param timeZone
|
|
753
|
-
* @param mode
|
|
754
|
-
* @returns
|
|
749
|
+
* @param date Date to check
|
|
750
|
+
* @param rangeStart Range start date
|
|
751
|
+
* @param rangeEnd Range end date
|
|
752
|
+
* @param timeZone Time zone (optional)
|
|
753
|
+
* @param mode Comparison mode (default is date-only)
|
|
754
|
+
* @returns Whether it is within the range
|
|
755
755
|
*
|
|
756
756
|
* @example
|
|
757
757
|
* ```typescript
|
|
@@ -764,16 +764,16 @@ declare function isTodayInTimeZone(date: Date, timeZone?: string): boolean;
|
|
|
764
764
|
*/
|
|
765
765
|
declare function isWithinRange(date: Date, rangeStart: Date, rangeEnd: Date, timeZone?: string, mode?: DateComparisonMode): boolean;
|
|
766
766
|
/**
|
|
767
|
-
*
|
|
767
|
+
* Get time zone aware detailed date parts
|
|
768
768
|
*/
|
|
769
769
|
declare function getDateParts(date: Date, timeZone?: string): DateParts;
|
|
770
770
|
/**
|
|
771
|
-
*
|
|
771
|
+
* Get the unique key of the date (for Map/Set etc. data structures)
|
|
772
772
|
*
|
|
773
|
-
* @param date
|
|
774
|
-
* @param timeZone
|
|
775
|
-
* @param includeTime
|
|
776
|
-
* @returns
|
|
773
|
+
* @param date Date object
|
|
774
|
+
* @param timeZone Time zone (optional)
|
|
775
|
+
* @param includeTime Whether to include time part (default is false)
|
|
776
|
+
* @returns Formatted date key
|
|
777
777
|
*
|
|
778
778
|
* @example
|
|
779
779
|
* ```typescript
|
|
@@ -783,11 +783,11 @@ declare function getDateParts(date: Date, timeZone?: string): DateParts;
|
|
|
783
783
|
*/
|
|
784
784
|
declare function getDateKey(date: Date, timeZone?: string, includeTime?: boolean): string;
|
|
785
785
|
/**
|
|
786
|
-
*
|
|
786
|
+
* Batch compare date arrays for equality (time zone aware)
|
|
787
787
|
*/
|
|
788
788
|
declare function areDatesEqual(dates1: Date[], dates2: Date[], timeZone?: string, mode?: DateComparisonMode): boolean;
|
|
789
789
|
/**
|
|
790
|
-
*
|
|
790
|
+
* Clear time zone date cache (for testing or memory management)
|
|
791
791
|
*/
|
|
792
792
|
declare function clearTimeZoneCache(): void;
|
|
793
793
|
|
|
@@ -823,33 +823,33 @@ declare function detectDateFormat(input: string): DateDataFormat;
|
|
|
823
823
|
type ParseResult = Date | null;
|
|
824
824
|
type DetailedParseResult = DateInputValue;
|
|
825
825
|
interface ParseOptions {
|
|
826
|
-
/**
|
|
826
|
+
/** Whether to return detailed information */
|
|
827
827
|
detailed?: boolean;
|
|
828
|
-
/**
|
|
828
|
+
/** Whether to enable natural language parsing */
|
|
829
829
|
enableNaturalLanguage?: boolean;
|
|
830
|
-
/**
|
|
830
|
+
/** Whether to enable relative date parsing */
|
|
831
831
|
enableRelativeDate?: boolean;
|
|
832
|
-
/**
|
|
832
|
+
/** Whether to enable smart correction */
|
|
833
833
|
enableSmartCorrection?: boolean;
|
|
834
|
-
/**
|
|
834
|
+
/** Target format */
|
|
835
835
|
format?: DateDataFormat;
|
|
836
|
-
/**
|
|
836
|
+
/** Language environment */
|
|
837
837
|
locale?: Locale;
|
|
838
|
-
/**
|
|
838
|
+
/** Whether to strict mode */
|
|
839
839
|
strict?: boolean;
|
|
840
840
|
}
|
|
841
841
|
/**
|
|
842
|
-
*
|
|
842
|
+
* Unified date parser - merged the original tryRelaxedParsing and smartParseDate
|
|
843
843
|
*
|
|
844
|
-
*
|
|
845
|
-
* 1.
|
|
846
|
-
* 2.
|
|
847
|
-
* 3.
|
|
848
|
-
* 4.
|
|
849
|
-
* 5.
|
|
850
|
-
* 6.
|
|
851
|
-
* 7.
|
|
852
|
-
* 8.
|
|
844
|
+
* Parsing strategy sorted by priority (corrected to correct priority):
|
|
845
|
+
* 1. Standard format parsing - strictly parse according to the specified format
|
|
846
|
+
* 2. Intelligent numeric parsing (core function) - intelligent guess of pure numeric input [most important]
|
|
847
|
+
* 3. Shortcut parsing - today, tomorrow, yesterday, etc.
|
|
848
|
+
* 4. Extended relative date parsing - "3 days ago", "next week", etc.
|
|
849
|
+
* 5. Natural language parsing - "today", "tomorrow", "next Wednesday", etc.
|
|
850
|
+
* 6. Relative date parsing - "+3d", "-1w", etc. short format
|
|
851
|
+
* 7. English date parsing - "Jan 15, 2024", "March 3rd", etc.
|
|
852
|
+
* 8. Common format attempt - try other commonly used date formats
|
|
853
853
|
*/
|
|
854
854
|
declare function parseDate(input: string, options: ParseOptions & {
|
|
855
855
|
detailed: true;
|
|
@@ -869,139 +869,139 @@ declare const tryRelaxedParsing: (input: string, format: DateDataFormat, locale?
|
|
|
869
869
|
declare const smartParseDate: (input: string, options: DateParserOptions) => DateInputValue;
|
|
870
870
|
|
|
871
871
|
interface PredictionResult {
|
|
872
|
-
/**
|
|
872
|
+
/** Confidence (0-1) */
|
|
873
873
|
confidence: number;
|
|
874
|
-
/**
|
|
874
|
+
/** Description */
|
|
875
875
|
description: string;
|
|
876
|
-
/**
|
|
876
|
+
/** Predicted date string */
|
|
877
877
|
prediction: string;
|
|
878
|
-
/**
|
|
878
|
+
/** Prediction type */
|
|
879
879
|
type: "numeric" | "shortcut" | "relative" | "parsed";
|
|
880
880
|
}
|
|
881
881
|
/**
|
|
882
|
-
*
|
|
883
|
-
*
|
|
882
|
+
* Enhanced intelligent prediction function
|
|
883
|
+
* Directly use parseDate function, ensure prediction result is 100% consistent with actual formatting
|
|
884
884
|
*/
|
|
885
885
|
declare function getEnhancedPrediction(input: string, targetFormat?: DateDataFormat): PredictionResult | null;
|
|
886
886
|
|
|
887
887
|
/**
|
|
888
|
-
*
|
|
889
|
-
*
|
|
888
|
+
* Unified numeric parsing tool functions
|
|
889
|
+
* Used to eliminate duplicate code in parsers
|
|
890
890
|
*/
|
|
891
|
-
/**
|
|
891
|
+
/** Extract pure numeric string */
|
|
892
892
|
declare function extractDigits(input: string): string;
|
|
893
|
-
/**
|
|
893
|
+
/** Numeric segment extractor */
|
|
894
894
|
declare class DigitExtractor {
|
|
895
895
|
private digits;
|
|
896
896
|
constructor(digits: string);
|
|
897
|
-
/**
|
|
897
|
+
/** Extract number at specified position */
|
|
898
898
|
extract(start: number, length: number): number;
|
|
899
|
-
/**
|
|
899
|
+
/** Extract year (first 2 digits) */
|
|
900
900
|
getYear2(): number;
|
|
901
|
-
/**
|
|
901
|
+
/** Extract year (first 4 digits) */
|
|
902
902
|
getYear4(): number;
|
|
903
|
-
/**
|
|
903
|
+
/** Extract month (first 2 digits) */
|
|
904
904
|
getMonth(): number;
|
|
905
|
-
/**
|
|
905
|
+
/** Extract date (3-4th digits) */
|
|
906
906
|
getDay(): number;
|
|
907
|
-
/**
|
|
907
|
+
/** Extract each part of 6 digits (YYMMDD format) */
|
|
908
908
|
getYYMMDD(): {
|
|
909
909
|
day: number;
|
|
910
910
|
month: number;
|
|
911
911
|
year: number;
|
|
912
912
|
};
|
|
913
|
-
/**
|
|
913
|
+
/** Extract each part of 8 digits (YYYYMMDD format) */
|
|
914
914
|
getYYYYMMDD(): {
|
|
915
915
|
day: number;
|
|
916
916
|
month: number;
|
|
917
917
|
year: number;
|
|
918
918
|
};
|
|
919
|
-
/**
|
|
919
|
+
/** Extract each part of 3 digits */
|
|
920
920
|
get3DigitParts(): {
|
|
921
921
|
first: number;
|
|
922
922
|
lastTwo: number;
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
-
/**
|
|
925
|
+
/** Year conversion tool */
|
|
926
926
|
declare function convertTwoDigitYear(year: number): number;
|
|
927
|
-
/**
|
|
927
|
+
/** Check if it is a valid month and day combination */
|
|
928
928
|
declare function isValidMonthDay(month: number, day: number): boolean;
|
|
929
|
-
/**
|
|
929
|
+
/** Check if 3 digits can be interpreted as month and day */
|
|
930
930
|
declare function canBeMonthDay(firstDigit: number, lastTwoDigits: number): boolean;
|
|
931
|
-
/**
|
|
931
|
+
/** Check if it is a reasonable year */
|
|
932
932
|
declare function isReasonableYear(year: number): boolean;
|
|
933
|
-
/**
|
|
933
|
+
/** Numeric parsing result */
|
|
934
934
|
interface NumericParseResult {
|
|
935
935
|
day: number;
|
|
936
936
|
formatted: string;
|
|
937
937
|
month: number;
|
|
938
938
|
year: number;
|
|
939
939
|
}
|
|
940
|
-
/**
|
|
940
|
+
/** General 6-digit parser (YYMMDD) */
|
|
941
941
|
declare function parseYYMMDD(digits: string, targetFormat: string): NumericParseResult | null;
|
|
942
|
-
/**
|
|
942
|
+
/** General 8-digit parser (YYYYMMDD) */
|
|
943
943
|
declare function parseYYYYMMDD(digits: string, targetFormat: string): NumericParseResult | null;
|
|
944
|
-
/**
|
|
944
|
+
/** Intelligent 3-digit parser */
|
|
945
945
|
declare function parse3Digits(digits: string, currentYear: number, targetFormat: string): NumericParseResult | null;
|
|
946
946
|
|
|
947
947
|
declare const yearUtils: {
|
|
948
948
|
extractYear(input: Date | number | undefined): number | undefined;
|
|
949
|
-
/**
|
|
949
|
+
/** Create year start date */
|
|
950
950
|
createYearDate(year: number): Date;
|
|
951
|
-
/**
|
|
951
|
+
/** Get current year */
|
|
952
952
|
getCurrentYear(): number;
|
|
953
|
-
/**
|
|
953
|
+
/** Validate if year is in valid range */
|
|
954
954
|
isYearInRange(year: number, minYear?: number, maxYear?: number): boolean;
|
|
955
955
|
};
|
|
956
956
|
|
|
957
957
|
declare const quarterUtils: {
|
|
958
|
-
/**
|
|
958
|
+
/** Safely extract year number from various inputs */
|
|
959
959
|
extractYear(input: Date | number | undefined): number | undefined;
|
|
960
|
-
/**
|
|
960
|
+
/** Get current year */
|
|
961
961
|
getCurrentYear(): number;
|
|
962
|
-
/**
|
|
962
|
+
/** Get current quarter number (1-4) */
|
|
963
963
|
getCurrentQuarterNumber(): Quarter$1;
|
|
964
|
-
/**
|
|
964
|
+
/** Validate if year is in valid range */
|
|
965
965
|
isYearInRange(year: number, minYear?: number, maxYear?: number): boolean;
|
|
966
|
-
/**
|
|
966
|
+
/** Create quarter start date */
|
|
967
967
|
createQuarterStartDate(quarter: number, year: number): Date;
|
|
968
|
-
/**
|
|
968
|
+
/** Create quarter end date */
|
|
969
969
|
createQuarterEndDate(quarter: number, year: number): Date;
|
|
970
970
|
};
|
|
971
|
-
/**
|
|
971
|
+
/** Get quarter month names */
|
|
972
972
|
declare function getQuarterMonths(quarter: number, locale?: Locale | string): string[];
|
|
973
|
-
/**
|
|
973
|
+
/** Create quarter object */
|
|
974
974
|
declare function createQuarter(quarter: Quarter$1, year: number, locale?: Locale | string): Quarter;
|
|
975
|
-
/**
|
|
975
|
+
/** Get current quarter */
|
|
976
976
|
declare function getCurrentQuarter(year?: number, locale?: Locale | string): Quarter;
|
|
977
|
-
/**
|
|
977
|
+
/** Get all quarters of a year */
|
|
978
978
|
declare function getYearQuarters(year: number, locale?: Locale | string): Quarter[];
|
|
979
|
-
/**
|
|
979
|
+
/** Check if two quarters are equal */
|
|
980
980
|
declare function isQuarterEqual(quarter1: Quarter, quarter2: Quarter): boolean;
|
|
981
|
-
/**
|
|
981
|
+
/** Format quarter display */
|
|
982
982
|
declare function formatQuarter(quarter: Quarter): string;
|
|
983
|
-
/**
|
|
983
|
+
/** Get quarter date range */
|
|
984
984
|
declare function getQuarterDateRange(quarter: Quarter): {
|
|
985
985
|
end: Date;
|
|
986
986
|
start: Date;
|
|
987
987
|
};
|
|
988
988
|
|
|
989
989
|
/**
|
|
990
|
-
*
|
|
990
|
+
* Convert Date object to time string (HH:mm)
|
|
991
991
|
* @param date - Date 对象
|
|
992
|
-
* @returns
|
|
992
|
+
* @returns Time string, format is "HH:mm", if date is null then return null
|
|
993
993
|
*/
|
|
994
994
|
declare function dateToTimeString(date: Date | null): string | null;
|
|
995
995
|
/**
|
|
996
|
-
*
|
|
997
|
-
* @param timeStr -
|
|
998
|
-
* @returns Date
|
|
996
|
+
* Convert time string to Date object (today's date + specified time)
|
|
997
|
+
* @param timeStr - Time string, format is "HH:mm"
|
|
998
|
+
* @returns Date object, contains today's date and specified time
|
|
999
999
|
*/
|
|
1000
1000
|
declare function timeStringToDate(timeStr: string): Date;
|
|
1001
1001
|
/**
|
|
1002
|
-
*
|
|
1003
|
-
* @param value - Date
|
|
1004
|
-
* @returns
|
|
1002
|
+
* Normalize any Date value to time string format
|
|
1003
|
+
* @param value - Date object or null
|
|
1004
|
+
* @returns Normalized time string (HH:mm) or null
|
|
1005
1005
|
*/
|
|
1006
1006
|
declare function normalizeTimeValue(value: Date | null | undefined): string | null;
|
|
1007
1007
|
declare function smartParseTimeValue(input: string, options: TimeParserOptions): TimeInputValue;
|