@lobehub/ui 6.15.1 → 6.15.3
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/es/A/index.d.mts +1 -2
- package/es/Accordion/Accordion.d.mts +1 -2
- package/es/Accordion/atoms.d.mts +1 -2
- package/es/Accordion/style.d.mts +1 -2
- package/es/Accordion/type.d.mts +1 -2
- package/es/ActionIcon/ActionIcon.d.mts +1 -2
- package/es/ActionIcon/style.d.mts +1 -2
- package/es/ActionIcon/type.d.mts +1 -2
- package/es/ActionIconGroup/ActionIconGroup.d.mts +1 -2
- package/es/ActionIconGroup/type.d.mts +1 -2
- package/es/AgentAvatar/AgentAvatar.d.mts +1 -2
- package/es/AgentAvatar/type.d.mts +1 -2
- package/es/AgentAvatar/utils.d.mts +1 -2
- package/es/Alert/Alert.d.mts +1 -2
- package/es/Alert/style.d.mts +1 -2
- package/es/Alert/type.d.mts +1 -2
- package/es/Anchor/Anchor.d.mts +1 -2
- package/es/Anchor/type.d.mts +1 -2
- package/es/AutoComplete/AutoComplete.d.mts +1 -2
- package/es/AutoComplete/style.d.mts +1 -2
- package/es/AutoComplete/type.d.mts +1 -2
- package/es/Avatar/AvatarGroup/index.d.mts +1 -2
- package/es/Avatar/index.d.mts +1 -2
- package/es/Avatar/type.d.mts +1 -2
- package/es/Badge/Badge.d.mts +1 -2
- package/es/Badge/type.d.mts +1 -2
- package/es/Block/Block.d.mts +1 -2
- package/es/Block/type.d.mts +1 -2
- package/es/Breadcrumb/Breadcrumb.d.mts +1 -2
- package/es/Breadcrumb/type.d.mts +1 -2
- package/es/Burger/Burger.d.mts +1 -2
- package/es/Burger/type.d.mts +1 -2
- package/es/Button/Button.d.mts +1 -2
- package/es/Button/SplitButton.d.mts +1 -2
- package/es/Button/style.d.mts +1 -2
- package/es/Button/type.d.mts +1 -2
- package/es/Carousel/Carousel.d.mts +1 -2
- package/es/Carousel/type.d.mts +1 -2
- package/es/Checkbox/Checkbox.d.mts +1 -2
- package/es/Checkbox/Checkbox.mjs +6 -6
- package/es/Checkbox/Checkbox.mjs.map +1 -1
- package/es/Checkbox/CheckboxGroup.d.mts +1 -2
- package/es/Checkbox/CheckboxGroup.mjs +5 -5
- package/es/Checkbox/CheckboxGroup.mjs.map +1 -1
- package/es/Checkbox/style.d.mts +1 -2
- package/es/Checkbox/type.d.mts +1 -2
- package/es/CodeDiff/CodeDiff.d.mts +1 -2
- package/es/CodeDiff/PatchDiff.d.mts +1 -2
- package/es/CodeDiff/PatchDiff.mjs +5 -5
- package/es/CodeDiff/PatchDiff.mjs.map +1 -1
- package/es/CodeDiff/type.d.mts +1 -2
- package/es/CodeEditor/CodeEditor.d.mts +1 -2
- package/es/CodeEditor/type.d.mts +1 -2
- package/es/Collapsible/Collapsible.d.mts +1 -2
- package/es/Collapsible/Collapsible.mjs +5 -5
- package/es/Collapsible/Collapsible.mjs.map +1 -1
- package/es/Collapsible/type.d.mts +1 -2
- package/es/ColorPicker/ColorPicker.d.mts +1 -2
- package/es/ColorPicker/type.d.mts +1 -2
- package/es/ColorSwatches/ColorSwatches.d.mts +1 -2
- package/es/ColorSwatches/type.d.mts +1 -2
- package/es/ConfigProvider/AppElementContext.d.mts +1 -2
- package/es/ConfigProvider/index.d.mts +1 -2
- package/es/ContextMenu/ContextMenuHost.d.mts +1 -2
- package/es/ContextMenu/ContextMenuTrigger.d.mts +1 -2
- package/es/ContextMenu/renderItems.d.mts +1 -1
- package/es/ContextMenu/store.d.mts +1 -2
- package/es/ContextMenu/type.d.mts +1 -2
- package/es/CopyButton/CopyButton.d.mts +1 -2
- package/es/CopyButton/type.d.mts +1 -2
- package/es/DatePicker/DatePicker.d.mts +1 -2
- package/es/DatePicker/DateRangePicker.d.mts +1 -2
- package/es/DatePicker/DayjsDatePicker.d.mts +1 -2
- package/es/DatePicker/DayjsDateRangePicker.d.mts +1 -2
- package/es/DatePicker/core/PickerInput/Popup/Footer.mjs +2 -2
- package/es/DatePicker/core/PickerInput/Popup/Footer.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Popup/PopupPanel.mjs +4 -4
- package/es/DatePicker/core/PickerInput/Popup/PopupPanel.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Popup/index.mjs +14 -14
- package/es/DatePicker/core/PickerInput/Popup/index.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/RangePicker.d.mts +3 -4
- package/es/DatePicker/core/PickerInput/RangePicker.mjs +11 -11
- package/es/DatePicker/core/PickerInput/RangePicker.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/ClearIcon.mjs +2 -2
- package/es/DatePicker/core/PickerInput/Selector/ClearIcon.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/Icon.mjs +2 -2
- package/es/DatePicker/core/PickerInput/Selector/Icon.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/Input.mjs +15 -15
- package/es/DatePicker/core/PickerInput/Selector/Input.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/RangeSelector.d.mts +1 -2
- package/es/DatePicker/core/PickerInput/Selector/RangeSelector.mjs +11 -11
- package/es/DatePicker/core/PickerInput/Selector/RangeSelector.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/HoverSelector.mjs +2 -2
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/HoverSelector.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/index.mjs +6 -6
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/index.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/hooks/useInputProps.mjs +4 -4
- package/es/DatePicker/core/PickerInput/Selector/hooks/useInputProps.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/Selector/hooks/useRootProps.mjs +2 -2
- package/es/DatePicker/core/PickerInput/Selector/hooks/useRootProps.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/SinglePicker.d.mts +6 -7
- package/es/DatePicker/core/PickerInput/SinglePicker.mjs +8 -8
- package/es/DatePicker/core/PickerInput/SinglePicker.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/context.mjs +2 -2
- package/es/DatePicker/core/PickerInput/context.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useCellRender.mjs +3 -3
- package/es/DatePicker/core/PickerInput/hooks/useCellRender.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useFieldFormat.mjs +2 -2
- package/es/DatePicker/core/PickerInput/hooks/useFieldFormat.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useFieldsInvalidate.mjs +3 -3
- package/es/DatePicker/core/PickerInput/hooks/useFieldsInvalidate.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useFilledProps.mjs +5 -5
- package/es/DatePicker/core/PickerInput/hooks/useFilledProps.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useFocusEvents.mjs +2 -2
- package/es/DatePicker/core/PickerInput/hooks/useFocusEvents.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useFocusLock.mjs +2 -2
- package/es/DatePicker/core/PickerInput/hooks/useFocusLock.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useHoverStore.mjs +3 -3
- package/es/DatePicker/core/PickerInput/hooks/useHoverStore.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useLockEffect.mjs +2 -2
- package/es/DatePicker/core/PickerInput/hooks/useLockEffect.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/usePickerRef.mjs +3 -3
- package/es/DatePicker/core/PickerInput/hooks/usePickerRef.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/usePresets.mjs +2 -2
- package/es/DatePicker/core/PickerInput/hooks/usePresets.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useRangePickerValue.mjs +4 -4
- package/es/DatePicker/core/PickerInput/hooks/useRangePickerValue.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useRangeValue.mjs +3 -3
- package/es/DatePicker/core/PickerInput/hooks/useRangeValue.mjs.map +1 -1
- package/es/DatePicker/core/PickerInput/hooks/useRangeValueChange.mjs +5 -5
- package/es/DatePicker/core/PickerInput/hooks/useRangeValueChange.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/PanelBody.mjs +2 -2
- package/es/DatePicker/core/PickerPanel/PanelBody.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/PanelHeader.mjs +6 -6
- package/es/DatePicker/core/PickerPanel/PanelHeader.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/ClockDial.mjs +3 -3
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/ClockDial.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/index.mjs +2 -2
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/index.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/TimeColumn.mjs +3 -3
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/TimeColumn.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/index.mjs +2 -2
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/index.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useScrollTo.mjs +5 -5
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useScrollTo.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useTimeState.mjs +7 -7
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useTimeState.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/context.mjs +6 -6
- package/es/DatePicker/core/PickerPanel/context.mjs.map +1 -1
- package/es/DatePicker/core/PickerPanel/index.mjs +12 -12
- package/es/DatePicker/core/PickerPanel/index.mjs.map +1 -1
- package/es/DatePicker/core/generate/index.d.mts +1 -2
- package/es/DatePicker/core/hooks/react.mjs +8 -8
- package/es/DatePicker/core/hooks/react.mjs.map +1 -1
- package/es/DatePicker/core/hooks/useSyncState.mjs +3 -3
- package/es/DatePicker/core/hooks/useSyncState.mjs.map +1 -1
- package/es/DatePicker/core/hooks/useTimeInfo.mjs +6 -6
- package/es/DatePicker/core/hooks/useTimeInfo.mjs.map +1 -1
- package/es/DatePicker/core/index.d.mts +28 -0
- package/es/DatePicker/core/interface.d.mts +1 -2
- package/es/DatePicker/generatePicker.d.mts +1 -2
- package/es/DatePicker/locale.d.mts +1 -2
- package/es/DatePicker/type.d.mts +1 -2
- package/es/Descriptions/Descriptions.d.mts +1 -2
- package/es/Descriptions/type.d.mts +1 -2
- package/es/Divider/Divider.d.mts +1 -2
- package/es/Divider/type.d.mts +1 -2
- package/es/DownloadButton/DownloadButton.d.mts +1 -2
- package/es/DownloadButton/type.d.mts +1 -2
- package/es/DraggablePanel/DraggablePanel.d.mts +1 -2
- package/es/DraggablePanel/atoms.d.mts +1 -2
- package/es/DraggablePanel/context.d.mts +1 -2
- package/es/DraggablePanel/core/axes.d.mts +1 -2
- package/es/DraggablePanel/core/controller.d.mts +1 -2
- package/es/DraggablePanel/type.d.mts +1 -2
- package/es/DraggableSideNav/DraggableSideNav.d.mts +1 -2
- package/es/DraggableSideNav/type.d.mts +1 -2
- package/es/Drawer/Drawer.d.mts +1 -2
- package/es/Drawer/atoms.d.mts +1 -2
- package/es/Drawer/constants.d.mts +1 -2
- package/es/Drawer/type.d.mts +1 -2
- package/es/DropdownMenu/DropdownMenu.d.mts +1 -2
- package/es/DropdownMenu/atoms.d.mts +1 -2
- package/es/DropdownMenu/renderItems.d.mts +1 -2
- package/es/DropdownMenu/style.d.mts +1 -2
- package/es/DropdownMenu/type.d.mts +1 -2
- package/es/EditableText/ControlInput.d.mts +1 -2
- package/es/EditableText/EditableText.d.mts +1 -2
- package/es/EditableText/type.d.mts +1 -2
- package/es/EditorSlashMenu/EditorSlashMenu.d.mts +1 -2
- package/es/EditorSlashMenu/atoms.d.mts +1 -2
- package/es/EditorSlashMenu/atoms.mjs +1 -0
- package/es/EditorSlashMenu/atoms.mjs.map +1 -1
- package/es/EditorSlashMenu/type.d.mts +1 -2
- package/es/EmojiPicker/EmojiPicker.d.mts +1 -2
- package/es/EmojiPicker/type.d.mts +1 -2
- package/es/Empty/Empty.d.mts +1 -2
- package/es/Empty/type.d.mts +1 -2
- package/es/FileTypeIcon/FileTypeIcon.d.mts +1 -2
- package/es/FileTypeIcon/type.d.mts +1 -2
- package/es/Flex/Center.d.mts +1 -2
- package/es/Flex/FlexBasic.d.mts +1 -2
- package/es/Flex/type.d.mts +1 -2
- package/es/FloatingPanel/FloatingPanel.d.mts +1 -2
- package/es/FloatingPanel/type.d.mts +1 -2
- package/es/FloatingSheet/FloatingSheet.d.mts +1 -2
- package/es/FloatingSheet/type.d.mts +1 -2
- package/es/FluentEmoji/FluentEmoji.d.mts +1 -2
- package/es/FluentEmoji/type.d.mts +1 -2
- package/es/FluentEmoji/utils.d.mts +1 -2
- package/es/FocusScope/FocusScope.d.mts +1 -2
- package/es/FocusScope/store.d.mts +1 -2
- package/es/FocusScope/style.d.mts +1 -2
- package/es/FocusScope/useScopeArrowNav.d.mts +1 -2
- package/es/FocusScope/useScopeSwitcher.d.mts +1 -2
- package/es/FontLoader/index.d.mts +1 -2
- package/es/FontLoader/index.mjs +2 -2
- package/es/FontLoader/index.mjs.map +1 -1
- package/es/Form/Form.mjs +5 -5
- package/es/Form/Form.mjs.map +1 -1
- package/es/Form/components/FormDivider.d.mts +1 -2
- package/es/Form/components/FormField.d.mts +1 -2
- package/es/Form/components/FormFlatGroup.d.mts +1 -2
- package/es/Form/components/FormFooter.d.mts +1 -2
- package/es/Form/components/FormGroup.d.mts +1 -2
- package/es/Form/components/FormSubmitFooter.d.mts +1 -2
- package/es/Form/components/FormTitle.d.mts +1 -2
- package/es/Form/context.d.mts +1 -2
- package/es/Form/index.d.mts +1 -2
- package/es/Form/type.d.mts +1 -2
- package/es/FormKit/Field.d.mts +1 -2
- package/es/FormKit/List.d.mts +1 -2
- package/es/FormKit/SubmitFooter.d.mts +1 -2
- package/es/FormKit/context.d.mts +1 -2
- package/es/FormKit/engine/types.d.mts +1 -2
- package/es/FormKit/index.d.mts +1 -2
- package/es/FormKit/schema.d.mts +1 -2
- package/es/FormKit/type.d.mts +1 -2
- package/es/FormKit/useForm.d.mts +1 -2
- package/es/FormKit/useWatch.d.mts +1 -2
- package/es/Freeze/Freeze.d.mts +1 -2
- package/es/Freeze/type.d.mts +1 -2
- package/es/GlobalFocusRing/index.d.mts +1 -2
- package/es/Grid/Grid.d.mts +1 -2
- package/es/Grid/type.d.mts +1 -2
- package/es/GroupAvatar/GroupAvatar.d.mts +1 -2
- package/es/GroupAvatar/type.d.mts +1 -2
- package/es/GuideCard/GuideCard.d.mts +1 -2
- package/es/GuideCard/type.d.mts +1 -2
- package/es/Header/Header.d.mts +1 -2
- package/es/Header/type.d.mts +1 -2
- package/es/Highlighter/Highlighter.d.mts +1 -2
- package/es/Highlighter/SyntaxHighlighter/index.d.mts +1 -2
- package/es/Highlighter/const.d.mts +1 -2
- package/es/Highlighter/theme/lobe-highlights-theme.d.mts +1 -2
- package/es/Highlighter/theme/lobe-theme.d.mts +1 -2
- package/es/Highlighter/type.d.mts +1 -2
- package/es/Hotkey/Hotkey.d.mts +1 -2
- package/es/Hotkey/const.d.mts +1 -2
- package/es/Hotkey/type.d.mts +1 -2
- package/es/Hotkey/utils.d.mts +1 -2
- package/es/HotkeyInput/HotkeyInput.d.mts +1 -2
- package/es/HotkeyInput/type.d.mts +1 -2
- package/es/HtmlPreview/HtmlPreview.d.mts +1 -2
- package/es/HtmlPreview/Iframe.d.mts +1 -2
- package/es/HtmlPreview/const.d.mts +1 -2
- package/es/HtmlPreview/injectAutoHeightScript.d.mts +1 -2
- package/es/HtmlPreview/type.d.mts +1 -2
- package/es/Icon/Icon.d.mts +1 -2
- package/es/Icon/components/IconProvider.d.mts +1 -2
- package/es/Icon/type.d.mts +1 -2
- package/es/Image/PreviewGroup.d.mts +1 -2
- package/es/Image/index.d.mts +1 -2
- package/es/Image/type.d.mts +1 -2
- package/es/Image/useImagePreview.d.mts +1 -2
- package/es/Image/viewer/geometry.d.mts +1 -2
- package/es/Image/viewer/registry.d.mts +1 -1
- package/es/ImageSelect/ImageSelect.d.mts +1 -2
- package/es/ImageSelect/type.d.mts +1 -2
- package/es/Input/Input.d.mts +1 -2
- package/es/Input/Input.mjs +5 -5
- package/es/Input/Input.mjs.map +1 -1
- package/es/Input/InputNumber.d.mts +1 -2
- package/es/Input/InputOTP.d.mts +1 -2
- package/es/Input/InputPassword.d.mts +1 -2
- package/es/Input/TextArea.d.mts +1 -2
- package/es/Input/style.d.mts +1 -2
- package/es/Input/type.d.mts +1 -2
- package/es/Layout/components/LayoutFooter.d.mts +1 -2
- package/es/Layout/components/LayoutHeader.d.mts +1 -2
- package/es/Layout/components/LayoutMain.d.mts +1 -2
- package/es/Layout/components/LayoutSidebar.d.mts +1 -2
- package/es/Layout/components/LayoutSidebarInner.d.mts +1 -2
- package/es/Layout/components/LayoutToc.d.mts +1 -2
- package/es/Layout/index.d.mts +1 -2
- package/es/Layout/type.d.mts +1 -2
- package/es/List/List.d.mts +1 -2
- package/es/List/ListRow.d.mts +1 -1
- package/es/List/type.d.mts +1 -2
- package/es/Markdown/Markdown.d.mts +1 -2
- package/es/Markdown/Typography.d.mts +1 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +1 -2
- package/es/Markdown/plugins/rehypeCustomFootnotes.d.mts +1 -2
- package/es/Markdown/plugins/rehypeKatexDir.d.mts +1 -2
- package/es/Markdown/plugins/remarkBr.d.mts +1 -2
- package/es/Markdown/plugins/remarkColor.d.mts +1 -2
- package/es/Markdown/plugins/remarkCustomFootnotes.d.mts +1 -2
- package/es/Markdown/plugins/remarkGfmPlus.d.mts +1 -2
- package/es/Markdown/plugins/remarkVideo.d.mts +1 -2
- package/es/Markdown/type.d.mts +1 -2
- package/es/MaskShadow/MaskShadow.d.mts +1 -2
- package/es/MaskShadow/type.d.mts +1 -2
- package/es/MaterialFileTypeIcon/MaterialFileTypeIcon.d.mts +1 -2
- package/es/MaterialFileTypeIcon/icon-map.json.d.mts +1 -2
- package/es/MaterialFileTypeIcon/{icon-map.mjs → icon-map.json.mjs} +1 -1
- package/es/MaterialFileTypeIcon/icon-map.json.mjs.map +1 -0
- package/es/MaterialFileTypeIcon/type.d.mts +1 -2
- package/es/MaterialFileTypeIcon/utils.mjs +1 -1
- package/es/Mermaid/Mermaid.d.mts +1 -2
- package/es/Mermaid/SyntaxMermaid/index.d.mts +1 -2
- package/es/Mermaid/const.d.mts +1 -2
- package/es/Mermaid/index.d.mts +1 -2
- package/es/Mermaid/themes.d.mts +2 -3
- package/es/Mermaid/type.d.mts +1 -2
- package/es/Meta/Meta.d.mts +1 -2
- package/es/Modal/Modal.d.mts +1 -2
- package/es/Modal/atoms.d.mts +1 -2
- package/es/Modal/constants.d.mts +1 -2
- package/es/Modal/context.d.mts +1 -2
- package/es/Modal/imperative.d.mts +1 -2
- package/es/Modal/type.d.mts +1 -2
- package/es/MotionProvider/index.d.mts +1 -2
- package/es/Pagination/Pagination.d.mts +1 -2
- package/es/Pagination/type.d.mts +1 -2
- package/es/Popover/ArrowIcon.d.mts +1 -2
- package/es/Popover/Popover.d.mts +1 -2
- package/es/Popover/PopoverGroup.d.mts +1 -2
- package/es/Popover/PopoverPortal.d.mts +1 -2
- package/es/Popover/atoms.d.mts +1 -2
- package/es/Popover/context.d.mts +1 -2
- package/es/Popover/groupContext.d.mts +1 -2
- package/es/Popover/type.d.mts +10 -12
- package/es/ProTable/ProTable.d.mts +1 -2
- package/es/ProTable/locale.d.mts +1 -2
- package/es/ProTable/type.d.mts +1 -2
- package/es/Progress/Progress.d.mts +1 -2
- package/es/Progress/type.d.mts +1 -2
- package/es/ProgressiveBlur/ProgressiveBlur.d.mts +1 -2
- package/es/ProgressiveBlur/type.d.mts +1 -2
- package/es/QRCode/QRCode.d.mts +1 -2
- package/es/QRCode/type.d.mts +1 -2
- package/es/Radio/Radio.d.mts +1 -2
- package/es/Radio/Radio.mjs +6 -6
- package/es/Radio/Radio.mjs.map +1 -1
- package/es/Radio/RadioGroup.d.mts +1 -2
- package/es/Radio/RadioGroup.mjs +5 -5
- package/es/Radio/RadioGroup.mjs.map +1 -1
- package/es/Radio/style.d.mts +1 -2
- package/es/Radio/type.d.mts +1 -2
- package/es/Rate/Rate.d.mts +1 -2
- package/es/Rate/type.d.mts +1 -2
- package/es/Result/Result.d.mts +1 -2
- package/es/Result/type.d.mts +1 -2
- package/es/ScrollArea/ScrollArea.d.mts +1 -2
- package/es/ScrollArea/atoms.d.mts +1 -2
- package/es/ScrollArea/type.d.mts +1 -2
- package/es/ScrollShadow/ScrollShadow.d.mts +1 -2
- package/es/ScrollShadow/type.d.mts +1 -2
- package/es/SearchBar/SearchBar.d.mts +1 -2
- package/es/SearchBar/type.d.mts +1 -2
- package/es/Segmented/Segmented.d.mts +1 -2
- package/es/Segmented/atoms.d.mts +1 -2
- package/es/Segmented/type.d.mts +3 -4
- package/es/Select/Select.d.mts +1 -2
- package/es/Select/Select.mjs +9 -9
- package/es/Select/Select.mjs.map +1 -1
- package/es/Select/atoms.d.mts +1 -2
- package/es/Select/type.d.mts +1 -2
- package/es/SideNav/SideNav.d.mts +1 -2
- package/es/SideNav/type.d.mts +1 -2
- package/es/Skeleton/SkeletonAvatar.d.mts +1 -2
- package/es/Skeleton/SkeletonText.d.mts +1 -2
- package/es/Skeleton/index.d.mts +1 -2
- package/es/Skeleton/type.d.mts +1 -2
- package/es/Slider/Slider.d.mts +1 -2
- package/es/Slider/Slider.mjs +7 -7
- package/es/Slider/Slider.mjs.map +1 -1
- package/es/Slider/SliderWithInput.d.mts +1 -2
- package/es/Slider/style.d.mts +1 -2
- package/es/Slider/type.d.mts +1 -2
- package/es/Snippet/Snippet.d.mts +1 -2
- package/es/Snippet/type.d.mts +1 -2
- package/es/SortableList/SortableList.d.mts +1 -2
- package/es/SortableList/components/DragHandle.d.mts +1 -2
- package/es/SortableList/components/SortableItem.d.mts +1 -2
- package/es/SortableList/type.d.mts +1 -2
- package/es/Spin/Spin.d.mts +1 -2
- package/es/Spin/type.d.mts +1 -2
- package/es/Statistic/Statistic.d.mts +1 -2
- package/es/Statistic/formatValue.d.mts +1 -2
- package/es/Statistic/type.d.mts +1 -2
- package/es/Steps/Steps.d.mts +1 -2
- package/es/Steps/type.d.mts +1 -2
- package/es/Switch/Switch.d.mts +1 -2
- package/es/Switch/atoms.d.mts +1 -2
- package/es/Switch/style.d.mts +1 -2
- package/es/Switch/type.d.mts +1 -2
- package/es/Table/Column.d.mts +1 -2
- package/es/Table/ColumnGroup.d.mts +1 -2
- package/es/Table/Table.d.mts +1 -2
- package/es/Table/atoms/cells.d.mts +1 -2
- package/es/Table/atoms/layout.d.mts +1 -2
- package/es/Table/engine/types.d.mts +1 -1
- package/es/Table/internal.d.mts +1 -1
- package/es/Table/pipeline/columnUtils.d.mts +1 -2
- package/es/Table/pipeline/selectionUtils.d.mts +2 -3
- package/es/Table/render/Summary.d.mts +2 -3
- package/es/Table/store/createTableStore.d.mts +1 -1
- package/es/Table/type.d.mts +1 -2
- package/es/Tabs/Tabs.d.mts +1 -2
- package/es/Tabs/atoms.d.mts +1 -2
- package/es/Tabs/style.d.mts +1 -2
- package/es/Tabs/type.d.mts +1 -2
- package/es/Tag/Tag.d.mts +1 -2
- package/es/Tag/type.d.mts +1 -2
- package/es/Tag/utils.d.mts +1 -2
- package/es/Text/Text.d.mts +1 -2
- package/es/Text/style.d.mts +1 -2
- package/es/Text/type.d.mts +1 -2
- package/es/Toast/imperative.d.mts +1 -2
- package/es/Toast/type.d.mts +1 -2
- package/es/Toc/Toc.d.mts +1 -2
- package/es/Toc/toFlatTocItems.d.mts +1 -2
- package/es/Toc/tocPath.d.mts +1 -2
- package/es/Toc/type.d.mts +1 -2
- package/es/ToggleGroup/ToggleGroup.d.mts +1 -2
- package/es/ToggleGroup/atoms.d.mts +1 -2
- package/es/ToggleGroup/style.d.mts +1 -2
- package/es/ToggleGroup/type.d.mts +1 -2
- package/es/Tooltip/Tooltip.d.mts +1 -2
- package/es/Tooltip/TooltipGroup.d.mts +1 -2
- package/es/Tooltip/type.d.mts +8 -10
- package/es/Tree/Tree.d.mts +1 -2
- package/es/Tree/style.d.mts +1 -2
- package/es/Tree/type.d.mts +1 -2
- package/es/Tree/utils.d.mts +1 -2
- package/es/Upload/Upload.d.mts +1 -2
- package/es/Upload/Upload.mjs +5 -5
- package/es/Upload/Upload.mjs.map +1 -1
- package/es/Upload/UploadDragger.d.mts +1 -2
- package/es/Upload/type.d.mts +1 -2
- package/es/Video/index.d.mts +1 -2
- package/es/Video/parts/Caption.d.mts +1 -2
- package/es/Video/parts/CenterPlay.d.mts +1 -2
- package/es/Video/parts/Controls.d.mts +1 -2
- package/es/Video/parts/Frame.d.mts +1 -2
- package/es/Video/parts/LoadError.d.mts +1 -2
- package/es/Video/parts/Root.d.mts +1 -2
- package/es/Video/parts/SectionList.d.mts +1 -2
- package/es/Video/parts/Timeline.d.mts +1 -2
- package/es/Video/type.d.mts +1 -2
- package/es/Video/useVideo.d.mts +1 -2
- package/es/_virtual/_rolldown/runtime.mjs +4 -4
- package/es/awesome/AgentSkillCard/AgentSkillCard.d.mts +1 -2
- package/es/awesome/AgentSkillCard/agents.d.mts +1 -2
- package/es/awesome/AgentSkillCard/type.d.mts +1 -2
- package/es/awesome/AuroraBackground/AuroraBackground.d.mts +1 -2
- package/es/awesome/AuroraBackground/type.d.mts +1 -2
- package/es/awesome/BentoGrid/BentoCard.d.mts +1 -2
- package/es/awesome/BentoGrid/BentoGrid.d.mts +1 -2
- package/es/awesome/BentoGrid/type.d.mts +1 -2
- package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +1 -2
- package/es/awesome/BottomGradientButton/type.d.mts +1 -2
- package/es/awesome/CodeShowcase/CodeShowcase.d.mts +1 -2
- package/es/awesome/CodeShowcase/type.d.mts +1 -2
- package/es/awesome/FeatureGrid/FeatureGrid.d.mts +1 -2
- package/es/awesome/FeatureGrid/type.d.mts +1 -2
- package/es/awesome/Features/Features.d.mts +1 -2
- package/es/awesome/Features/type.d.mts +1 -2
- package/es/awesome/FluidGradient/FluidGradient.d.mts +1 -2
- package/es/awesome/FluidGradient/type.d.mts +1 -2
- package/es/awesome/Giscus/Giscus.d.mts +1 -2
- package/es/awesome/Giscus/type.d.mts +1 -2
- package/es/awesome/GradientButton/GradientButton.d.mts +1 -2
- package/es/awesome/GradientButton/type.d.mts +1 -2
- package/es/awesome/Grainient/Grainient.d.mts +1 -2
- package/es/awesome/Grainient/type.d.mts +1 -2
- package/es/awesome/GridBackground/GridBackground.d.mts +1 -2
- package/es/awesome/GridBackground/GridShowcase.d.mts +1 -2
- package/es/awesome/GridBackground/type.d.mts +1 -2
- package/es/awesome/Hero/Hero.d.mts +1 -2
- package/es/awesome/Hero/type.d.mts +1 -2
- package/es/awesome/InstallBanner/InstallBanner.d.mts +1 -2
- package/es/awesome/InstallBanner/type.d.mts +1 -2
- package/es/awesome/LandingHero/LandingHero.d.mts +1 -2
- package/es/awesome/LandingHero/type.d.mts +1 -2
- package/es/awesome/LandingSection/LandingSection.d.mts +1 -2
- package/es/awesome/LandingSection/type.d.mts +1 -2
- package/es/awesome/LogoMarquee/LogoMarquee.d.mts +1 -2
- package/es/awesome/LogoMarquee/type.d.mts +1 -2
- package/es/awesome/Spotlight/Spotlight.d.mts +1 -2
- package/es/awesome/Spotlight/type.d.mts +1 -2
- package/es/awesome/SpotlightCard/SpotlightCard.d.mts +1 -2
- package/es/awesome/SpotlightCard/type.d.mts +1 -2
- package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +1 -2
- package/es/awesome/TypewriterEffect/type.d.mts +1 -2
- package/es/awesome/landingActions.d.mts +1 -2
- package/es/awesome/landingLink.d.mts +1 -2
- package/es/awesome/landingTokens.d.mts +1 -2
- package/es/brand/BrandLoading/index.d.mts +1 -2
- package/es/brand/LobeChat/index.d.mts +1 -2
- package/es/brand/LobeChatText/index.d.mts +1 -2
- package/es/brand/LobeHub/index.d.mts +1 -2
- package/es/brand/LobeHubText/index.d.mts +1 -2
- package/es/brand/Logo3d/index.d.mts +1 -2
- package/es/brand/LogoFlat/index.d.mts +1 -2
- package/es/chat/BackBottom/BackBottom.d.mts +1 -2
- package/es/chat/BackBottom/type.d.mts +1 -2
- package/es/chat/ChatHeader/ChatHeaderTitle.d.mts +1 -2
- package/es/chat/ChatHeader/index.d.mts +1 -2
- package/es/chat/ChatHeader/type.d.mts +1 -2
- package/es/chat/ChatInputArea/components/ChatInputActionBar.d.mts +1 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +1 -2
- package/es/chat/ChatInputArea/components/ChatSendButton.d.mts +1 -2
- package/es/chat/ChatInputArea/index.d.mts +1 -2
- package/es/chat/ChatInputArea/type.d.mts +1 -2
- package/es/chat/ChatItem/ChatItem.d.mts +1 -2
- package/es/chat/ChatItem/type.d.mts +1 -2
- package/es/chat/ChatList/ChatList.d.mts +1 -2
- package/es/chat/ChatList/components/ChatActionsBar.d.mts +1 -2
- package/es/chat/ChatList/type.d.mts +1 -2
- package/es/chat/EditableMessage/EditableMessage.d.mts +1 -2
- package/es/chat/EditableMessage/type.d.mts +1 -2
- package/es/chat/EditableMessageList/EditableMessageList.d.mts +1 -2
- package/es/chat/EditableMessageList/type.d.mts +1 -2
- package/es/chat/LoadingDots/LoadingDots.d.mts +1 -2
- package/es/chat/LoadingDots/type.d.mts +1 -2
- package/es/chat/MessageInput/MessageInput.d.mts +1 -2
- package/es/chat/MessageInput/type.d.mts +1 -2
- package/es/chat/MessageModal/MessageModal.d.mts +1 -2
- package/es/chat/MessageModal/type.d.mts +1 -2
- package/es/chat/TokenTag/TokenTag.d.mts +1 -2
- package/es/chat/TokenTag/type.d.mts +1 -2
- package/es/chat/types/chatMessage.d.mts +1 -2
- package/es/chat/types/error.d.mts +1 -2
- package/es/chat/types/llm.d.mts +1 -2
- package/es/chat/types/meta.d.mts +1 -2
- package/es/color/ColorScales/index.d.mts +1 -2
- package/es/color/CssVar/index.d.mts +1 -2
- package/es/color/colors/blue.d.mts +1 -2
- package/es/color/colors/cyan.d.mts +1 -2
- package/es/color/colors/geekblue.d.mts +1 -2
- package/es/color/colors/gold.d.mts +1 -2
- package/es/color/colors/gray.d.mts +1 -2
- package/es/color/colors/green.d.mts +1 -2
- package/es/color/colors/index.d.mts +1 -2
- package/es/color/colors/lime.d.mts +1 -2
- package/es/color/colors/magenta.d.mts +1 -2
- package/es/color/colors/orange.d.mts +1 -2
- package/es/color/colors/primary.d.mts +1 -2
- package/es/color/colors/purple.d.mts +1 -2
- package/es/color/colors/red.d.mts +1 -2
- package/es/color/colors/volcano.d.mts +1 -2
- package/es/color/colors/yellow.d.mts +1 -2
- package/es/color/neutrals/index.d.mts +1 -2
- package/es/color/neutrals/mauve.d.mts +1 -2
- package/es/color/neutrals/olive.d.mts +1 -2
- package/es/color/neutrals/sage.d.mts +1 -2
- package/es/color/neutrals/sand.d.mts +1 -2
- package/es/color/neutrals/slate.d.mts +1 -2
- package/es/color/status/index.d.mts +1 -2
- package/es/color/types.d.mts +1 -2
- package/es/css/dashboard/ConsoleShell.css +8 -0
- package/es/dashboard/AuthLayout/Aside.d.mts +1 -2
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +1 -2
- package/es/dashboard/AuthLayout/type.d.mts +1 -2
- package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +1 -2
- package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +1 -2
- package/es/dashboard/AuthTools/type.d.mts +1 -2
- package/es/dashboard/Breadcrumb/Breadcrumb.d.mts +1 -2
- package/es/dashboard/Breadcrumb/type.d.mts +1 -2
- package/es/dashboard/ChartGrid/ChartGrid.d.mts +1 -2
- package/es/dashboard/ChartGrid/type.d.mts +1 -2
- package/es/dashboard/ConsoleNav/ConsoleNav.d.mts +1 -2
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs +15 -4
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/Skeleton.d.mts +1 -2
- package/es/dashboard/ConsoleNav/active.d.mts +1 -2
- package/es/dashboard/ConsoleNav/style.mjs +4 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/type.d.mts +1 -2
- package/es/dashboard/ConsoleShell/ConsoleBrand.d.mts +1 -2
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs +6 -2
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -2
- package/es/dashboard/ConsoleShell/context.d.mts +1 -2
- package/es/dashboard/ConsoleShell/stable.mjs +5 -1
- package/es/dashboard/ConsoleShell/stable.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +8 -1
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/type.d.mts +1 -2
- package/es/dashboard/FilterSidebar/FilterSidebar.d.mts +1 -2
- package/es/dashboard/FilterSidebar/context.d.mts +2 -3
- package/es/dashboard/FilterSidebar/type.d.mts +1 -2
- package/es/dashboard/FilterStrip/FilterStrip.d.mts +1 -2
- package/es/dashboard/FilterStrip/type.d.mts +1 -2
- package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +1 -2
- package/es/dashboard/LabelWithKey/type.d.mts +1 -2
- package/es/dashboard/MetricStrip/MetricStrip.d.mts +1 -2
- package/es/dashboard/MetricStrip/type.d.mts +1 -2
- package/es/dashboard/PageHeader/PageHeader.d.mts +1 -2
- package/es/dashboard/PageHeader/type.d.mts +1 -2
- package/es/dashboard/PageSkeleton/PageSkeleton.d.mts +1 -2
- package/es/dashboard/PageSkeleton/type.d.mts +1 -2
- package/es/dashboard/PageTabs/PageTabs.d.mts +1 -2
- package/es/dashboard/PageTabs/type.d.mts +1 -2
- package/es/dashboard/PageToolbar/PageToolbar.d.mts +1 -2
- package/es/dashboard/PageToolbar/type.d.mts +1 -2
- package/es/dashboard/PanelSurface/PanelSurface.d.mts +1 -2
- package/es/dashboard/PanelSurface/type.d.mts +1 -2
- package/es/dashboard/RouteProgress/RouteProgress.d.mts +1 -2
- package/es/dashboard/RouteProgress/type.d.mts +1 -2
- package/es/dashboard/Section/Section.d.mts +1 -2
- package/es/dashboard/Section/type.d.mts +1 -2
- package/es/dashboard/StatCard/StatCard.d.mts +1 -2
- package/es/dashboard/StatCard/type.d.mts +1 -2
- package/es/dashboard/Surface/Surface.d.mts +1 -2
- package/es/dashboard/Surface/link.d.mts +1 -2
- package/es/dashboard/Surface/style.d.mts +1 -2
- package/es/dashboard/Surface/type.d.mts +1 -2
- package/es/dashboard/TableIconActions/TableIconActions.d.mts +1 -2
- package/es/dashboard/TableIconActions/type.d.mts +1 -2
- package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +1 -2
- package/es/dashboard/TitleWithTips/type.d.mts +1 -2
- package/es/dashboard/hooks.mjs +12 -3
- package/es/dashboard/hooks.mjs.map +1 -1
- package/es/eslint/index.d.mts +1 -2
- package/es/global.css +2 -2
- package/es/hooks/useMarkdown/utils.d.mts +1 -2
- package/es/hooks/useScroll.d.mts +1 -2
- package/es/i18n/context.d.mts +1 -2
- package/es/i18n/resources/en/burger.d.mts +1 -2
- package/es/i18n/resources/en/chat.d.mts +1 -2
- package/es/i18n/resources/en/colorPicker.d.mts +1 -2
- package/es/i18n/resources/en/common.d.mts +1 -2
- package/es/i18n/resources/en/datePicker.d.mts +1 -2
- package/es/i18n/resources/en/editableMessage.d.mts +1 -2
- package/es/i18n/resources/en/emojiPicker.d.mts +1 -2
- package/es/i18n/resources/en/form.d.mts +1 -2
- package/es/i18n/resources/en/hotkey.d.mts +1 -2
- package/es/i18n/resources/en/image.d.mts +1 -2
- package/es/i18n/resources/en/index.d.mts +1 -2
- package/es/i18n/resources/en/messageModal.d.mts +1 -2
- package/es/i18n/resources/en/qrCode.d.mts +1 -2
- package/es/i18n/resources/en/sideNav.d.mts +1 -2
- package/es/i18n/resources/en/table.d.mts +1 -2
- package/es/i18n/resources/en/toc.d.mts +1 -2
- package/es/i18n/resources/en/video.d.mts +1 -2
- package/es/i18n/resources/zhCn/burger.d.mts +1 -2
- package/es/i18n/resources/zhCn/chat.d.mts +1 -2
- package/es/i18n/resources/zhCn/colorPicker.d.mts +1 -2
- package/es/i18n/resources/zhCn/common.d.mts +1 -2
- package/es/i18n/resources/zhCn/datePicker.d.mts +1 -2
- package/es/i18n/resources/zhCn/editableMessage.d.mts +1 -2
- package/es/i18n/resources/zhCn/emojiPicker.d.mts +1 -2
- package/es/i18n/resources/zhCn/form.d.mts +1 -2
- package/es/i18n/resources/zhCn/hotkey.d.mts +1 -2
- package/es/i18n/resources/zhCn/image.d.mts +1 -2
- package/es/i18n/resources/zhCn/index.d.mts +1 -2
- package/es/i18n/resources/zhCn/messageModal.d.mts +1 -2
- package/es/i18n/resources/zhCn/qrCode.d.mts +1 -2
- package/es/i18n/resources/zhCn/sideNav.d.mts +1 -2
- package/es/i18n/resources/zhCn/table.d.mts +1 -2
- package/es/i18n/resources/zhCn/toc.d.mts +1 -2
- package/es/i18n/resources/zhCn/video.d.mts +1 -2
- package/es/i18n/types.d.mts +1 -2
- package/es/i18n/useTranslation.d.mts +1 -2
- package/es/icons/Auth0/components/Avatar.d.mts +1 -2
- package/es/icons/Auth0/components/Mono.d.mts +1 -2
- package/es/icons/Auth0/index.d.mts +1 -2
- package/es/icons/Authelia/components/Avatar.d.mts +1 -2
- package/es/icons/Authelia/components/Color.d.mts +1 -2
- package/es/icons/Authelia/components/Mono.d.mts +1 -2
- package/es/icons/Authelia/index.d.mts +1 -2
- package/es/icons/Authentik/components/Avatar.d.mts +1 -2
- package/es/icons/Authentik/components/Color.d.mts +1 -2
- package/es/icons/Authentik/components/Mono.d.mts +1 -2
- package/es/icons/Authentik/index.d.mts +1 -2
- package/es/icons/Casdoor/components/Avatar.d.mts +1 -2
- package/es/icons/Casdoor/components/Color.d.mts +1 -2
- package/es/icons/Casdoor/components/Mono.d.mts +1 -2
- package/es/icons/Casdoor/index.d.mts +1 -2
- package/es/icons/Clerk/components/Avatar.d.mts +1 -2
- package/es/icons/Clerk/components/Color.d.mts +1 -2
- package/es/icons/Clerk/components/Mono.d.mts +1 -2
- package/es/icons/Clerk/index.d.mts +1 -2
- package/es/icons/DingTalk/components/Avatar.d.mts +1 -2
- package/es/icons/DingTalk/components/Color.d.mts +1 -2
- package/es/icons/DingTalk/components/Mono.d.mts +1 -2
- package/es/icons/DingTalk/index.d.mts +1 -2
- package/es/icons/Discord/components/Avatar.d.mts +1 -2
- package/es/icons/Discord/components/Color.d.mts +1 -2
- package/es/icons/Discord/components/Mono.d.mts +1 -2
- package/es/icons/Discord/index.d.mts +1 -2
- package/es/icons/GoogleChat/components/Avatar.d.mts +1 -2
- package/es/icons/GoogleChat/components/Color.d.mts +1 -2
- package/es/icons/GoogleChat/components/Mono.d.mts +1 -2
- package/es/icons/GoogleChat/index.d.mts +1 -2
- package/es/icons/IMessage/components/Avatar.d.mts +1 -2
- package/es/icons/IMessage/components/Color.d.mts +1 -2
- package/es/icons/IMessage/components/Mono.d.mts +1 -2
- package/es/icons/IMessage/index.d.mts +1 -2
- package/es/icons/Lark/components/Avatar.d.mts +1 -2
- package/es/icons/Lark/components/Color.d.mts +1 -2
- package/es/icons/Lark/components/Mono.d.mts +1 -2
- package/es/icons/Lark/index.d.mts +1 -2
- package/es/icons/Line/components/Avatar.d.mts +1 -2
- package/es/icons/Line/components/Color.d.mts +1 -2
- package/es/icons/Line/components/Mono.d.mts +1 -2
- package/es/icons/Line/index.d.mts +1 -2
- package/es/icons/Logto/components/Avatar.d.mts +1 -2
- package/es/icons/Logto/components/Color.d.mts +1 -2
- package/es/icons/Logto/components/Mono.d.mts +1 -2
- package/es/icons/Logto/index.d.mts +1 -2
- package/es/icons/MicrosoftEntra/components/Avatar.d.mts +1 -2
- package/es/icons/MicrosoftEntra/components/Color.d.mts +1 -2
- package/es/icons/MicrosoftEntra/components/Mono.d.mts +1 -2
- package/es/icons/MicrosoftEntra/index.d.mts +1 -2
- package/es/icons/MicrosoftTeams/components/Avatar.d.mts +1 -2
- package/es/icons/MicrosoftTeams/components/Color.d.mts +1 -2
- package/es/icons/MicrosoftTeams/components/Mono.d.mts +1 -2
- package/es/icons/MicrosoftTeams/index.d.mts +1 -2
- package/es/icons/NextAuth/components/Avatar.d.mts +1 -2
- package/es/icons/NextAuth/components/Color.d.mts +1 -2
- package/es/icons/NextAuth/components/Mono.d.mts +1 -2
- package/es/icons/NextAuth/index.d.mts +1 -2
- package/es/icons/QQ/components/Avatar.d.mts +1 -2
- package/es/icons/QQ/components/Color.d.mts +1 -2
- package/es/icons/QQ/components/Mono.d.mts +1 -2
- package/es/icons/QQ/index.d.mts +1 -2
- package/es/icons/Slack/components/Avatar.d.mts +1 -2
- package/es/icons/Slack/components/Color.d.mts +1 -2
- package/es/icons/Slack/components/Mono.d.mts +1 -2
- package/es/icons/Slack/index.d.mts +1 -2
- package/es/icons/Telegram/components/Avatar.d.mts +1 -2
- package/es/icons/Telegram/components/Color.d.mts +1 -2
- package/es/icons/Telegram/components/Mono.d.mts +1 -2
- package/es/icons/Telegram/index.d.mts +1 -2
- package/es/icons/WeChat/components/Avatar.d.mts +1 -2
- package/es/icons/WeChat/components/Color.d.mts +1 -2
- package/es/icons/WeChat/components/Mono.d.mts +1 -2
- package/es/icons/WeChat/index.d.mts +1 -2
- package/es/icons/WhatsApp/components/Avatar.d.mts +1 -2
- package/es/icons/WhatsApp/components/Color.d.mts +1 -2
- package/es/icons/WhatsApp/components/Mono.d.mts +1 -2
- package/es/icons/WhatsApp/index.d.mts +1 -2
- package/es/icons/Zitadel/components/Avatar.d.mts +1 -2
- package/es/icons/Zitadel/components/Color.d.mts +1 -2
- package/es/icons/Zitadel/components/Mono.d.mts +1 -2
- package/es/icons/Zitadel/index.d.mts +1 -2
- package/es/icons/lucideExtra/AndroidIcon.d.mts +1 -2
- package/es/icons/lucideExtra/AppleIcon.d.mts +1 -2
- package/es/icons/lucideExtra/AppstoreIcon.d.mts +1 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +1 -2
- package/es/icons/lucideExtra/BrainOffIcon.d.mts +1 -2
- package/es/icons/lucideExtra/ChromeIcon.d.mts +1 -2
- package/es/icons/lucideExtra/CodepenIcon.d.mts +1 -2
- package/es/icons/lucideExtra/CodesandboxIcon.d.mts +1 -2
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +1 -2
- package/es/icons/lucideExtra/DiscordIcon.d.mts +1 -2
- package/es/icons/lucideExtra/FacebookIcon.d.mts +1 -2
- package/es/icons/lucideExtra/FigmaIcon.d.mts +1 -2
- package/es/icons/lucideExtra/FramerIcon.d.mts +1 -2
- package/es/icons/lucideExtra/GithubIcon.d.mts +1 -2
- package/es/icons/lucideExtra/GitlabIcon.d.mts +1 -2
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +1 -2
- package/es/icons/lucideExtra/GooglePlayIcon.d.mts +1 -2
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +1 -2
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +1 -2
- package/es/icons/lucideExtra/InstagramIcon.d.mts +1 -2
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +1 -2
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +1 -2
- package/es/icons/lucideExtra/LinkedinIcon.d.mts +1 -2
- package/es/icons/lucideExtra/McpIcon.d.mts +1 -2
- package/es/icons/lucideExtra/NotionIcon.d.mts +1 -2
- package/es/icons/lucideExtra/PocketIcon.d.mts +1 -2
- package/es/icons/lucideExtra/ProviderIcon.d.mts +1 -2
- package/es/icons/lucideExtra/RailSymbolIcon.d.mts +1 -2
- package/es/icons/lucideExtra/RedditIcon.d.mts +1 -2
- package/es/icons/lucideExtra/RightClickIcon.d.mts +1 -2
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +1 -2
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +1 -2
- package/es/icons/lucideExtra/SkillsIcon.d.mts +1 -2
- package/es/icons/lucideExtra/SlackIcon.d.mts +1 -2
- package/es/icons/lucideExtra/ThinkIcon.d.mts +1 -2
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +1 -2
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +1 -2
- package/es/internal/controlSize.d.mts +1 -2
- package/es/internal/floating/collisionPadding.d.mts +1 -2
- package/es/internal/menu/baseItem.d.mts +1 -2
- package/es/internal/menu/checkboxItem.d.mts +1 -2
- package/es/internal/menu/itemInterface.d.mts +1 -2
- package/es/internal/menu/renderUtils.d.mts +1 -2
- package/es/internal/menu/switchItem.d.mts +1 -2
- package/es/internal/menu/type.d.mts +1 -2
- package/es/internal/virtual/MenuVirtualList.d.mts +1 -1
- package/es/internal/virtual/VirtualScrollArea.d.mts +1 -1
- package/es/internal/virtual/type.d.mts +1 -2
- package/es/internal/virtual/useMenuVirtualList.d.mts +1 -1
- package/es/mdx/Callout/index.d.mts +1 -2
- package/es/mdx/Cards/Card.d.mts +1 -2
- package/es/mdx/Cards/index.d.mts +1 -2
- package/es/mdx/FileTree/File.d.mts +1 -2
- package/es/mdx/FileTree/File.mjs +3 -3
- package/es/mdx/FileTree/File.mjs.map +1 -1
- package/es/mdx/FileTree/Folder.d.mts +1 -2
- package/es/mdx/FileTree/Folder.mjs +3 -3
- package/es/mdx/FileTree/Folder.mjs.map +1 -1
- package/es/mdx/FileTree/index.d.mts +1 -2
- package/es/mdx/Mdx/index.d.mts +1 -2
- package/es/mdx/Steps/index.d.mts +1 -2
- package/es/mdx/Tabs/Tab.d.mts +1 -2
- package/es/mdx/Tabs/index.d.mts +1 -2
- package/es/mdx/mdxComponents/CodeBlock.d.mts +1 -2
- package/es/mdx/mdxComponents/Image.d.mts +1 -2
- package/es/mdx/mdxComponents/Link.d.mts +1 -2
- package/es/mdx/mdxComponents/Pre.d.mts +1 -2
- package/es/mdx/mdxComponents/Video.d.mts +1 -2
- package/es/mdx/mdxComponents/index.d.mts +1 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +1 -2
- package/es/mobile/ChatHeader/index.d.mts +1 -2
- package/es/mobile/ChatHeader/type.d.mts +1 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +1 -2
- package/es/mobile/ChatInputArea/index.d.mts +1 -2
- package/es/mobile/ChatInputArea/type.d.mts +1 -2
- package/es/mobile/SafeArea/SafeArea.d.mts +1 -2
- package/es/mobile/SafeArea/type.d.mts +1 -2
- package/es/mobile/TabBar/TabBar.d.mts +1 -2
- package/es/mobile/TabBar/type.d.mts +1 -2
- package/es/node_modules/.pnpm/@eslint_core@1.2.1/node_modules/@eslint/core/dist/esm/types.d.mts +4 -2
- package/es/node_modules/.pnpm/@eslint_plugin-kit@0.7.3/node_modules/@eslint/plugin-kit/dist/cjs/index.d.mts +1 -2
- package/es/node_modules/.pnpm/@eslint_plugin-kit@0.7.3/node_modules/@eslint/plugin-kit/dist/cjs/types.d.mts +5 -2
- package/es/node_modules/.pnpm/@types_estree@1.0.10/node_modules/@types/estree/index.d.mts +1 -2
- package/es/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.mts +1 -2
- package/es/node_modules/.pnpm/@types_mdx@2.0.14/node_modules/@types/mdx/types.d.mts +1 -2
- package/es/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.mts +1 -2
- package/es/node_modules/.pnpm/eslint@10.14.0_jiti@2.7.0_supports-color@10.2.2/node_modules/eslint/lib/types/index.d.mts +5 -2
- package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs +2 -2
- package/es/spline/LogoThree/LogoSpline.d.mts +1 -2
- package/es/spline/LogoThree/index.d.mts +1 -2
- package/es/spline/Spline/Spine.d.mts +2 -3
- package/es/spline/Spline/type.d.mts +1 -2
- package/es/storybook/StoryBook/index.d.mts +1 -2
- package/es/style.css +8 -0
- package/es/styles/classNames.d.mts +1 -2
- package/es/styles/createGlobalStyle.d.mts +1 -2
- package/es/styles/css.d.mts +1 -2
- package/es/styles/customTheme.d.mts +1 -2
- package/es/styles/stylex/props.d.mts +1 -1
- package/es/styles/theme/createLobeToken.d.mts +1 -2
- package/es/styles/theme/customNeutral.d.mts +1 -2
- package/es/styles/theme/customPalette.d.mts +1 -2
- package/es/styles/theme/customPrimary.d.mts +1 -2
- package/es/styles/theme/customStylishStatic.d.mts +1 -2
- package/es/styles/theme/generateColorPalette.d.mts +1 -2
- package/es/styles/theme/scope.d.mts +1 -2
- package/es/styles/theme/themeCss.d.mts +1 -2
- package/es/styles/theme/themeCss.mjs +2 -2
- package/es/styles/theme/themeCss.mjs.map +1 -1
- package/es/styles/theme/token/font.d.mts +1 -2
- package/es/styles/theme/token/neutralText.d.mts +1 -2
- package/es/types/citation.d.mts +1 -2
- package/es/types/customStylish.d.mts +1 -2
- package/es/types/customToken.d.mts +1 -2
- package/es/types/index.d.mts +1 -2
- package/es/types/trigger.d.mts +1 -2
- package/es/utils/copyToClipboard.d.mts +1 -2
- package/es/utils/dom.d.mts +1 -2
- package/es/utils/genCdnUrl.d.mts +1 -2
- package/es/utils/parseTrigger.d.mts +1 -2
- package/es/utils/placement.d.mts +1 -2
- package/es/utils/smoothCorners.d.mts +2 -3
- package/package.json +1 -1
- package/es/MaterialFileTypeIcon/icon-map.mjs.map +0 -1
|
@@ -20,14 +20,14 @@ import useShowNow from "./hooks/useShowNow.mjs";
|
|
|
20
20
|
import Popup from "./Popup/index.mjs";
|
|
21
21
|
import HoverSelector from "./Selector/SingleSelector/HoverSelector.mjs";
|
|
22
22
|
import { clsx } from "clsx";
|
|
23
|
-
import * as React
|
|
23
|
+
import * as React from "react";
|
|
24
24
|
import { jsx } from "react/jsx-runtime";
|
|
25
25
|
// src/DatePicker/core/PickerInput/SinglePicker.tsx
|
|
26
26
|
function Picker(props, ref) {
|
|
27
27
|
const [filledProps, internalPicker, complexPicker, formatList, maskFormat, isInvalidateDate] = useFilledProps(props);
|
|
28
28
|
const { prefixCls, rootClassName, styles: propStyles, classNames: propClassNames, previewValue, order, defaultValue, value, needConfirm, onChange, onClear, onKeyDown, disabled, disabledDate, minDate, maxDate, defaultOpen, open, onOpenChange, locale, generateConfig, picker, showNow, showToday, showTime, mode, onPanelChange, onCalendarChange, onOk, multiple, defaultPickerValue, pickerValue, onPickerValueChange, inputReadOnly, suffixIcon, removeIcon, tagRender, onFocus, onBlur, presets, components, cellRender, dateRender, monthCellRender, onClick } = filledProps;
|
|
29
29
|
const selectorRef = usePickerRef(ref);
|
|
30
|
-
const popupRef = React
|
|
30
|
+
const popupRef = React.useRef(null);
|
|
31
31
|
function pickerParam(values) {
|
|
32
32
|
if (values === null) return null;
|
|
33
33
|
return multiple ? values : values[0];
|
|
@@ -87,7 +87,7 @@ function Picker(props, ref) {
|
|
|
87
87
|
if (!firstMount && !mergedOpen) triggerSingleValueChange(0, "popupClose");
|
|
88
88
|
}, [mergedOpen]);
|
|
89
89
|
const [submitInvalidates, onSelectorInvalid] = useFieldsInvalidate(calendarValue, isInvalidateDate);
|
|
90
|
-
const submitInvalidate = React
|
|
90
|
+
const submitInvalidate = React.useMemo(() => submitInvalidates.some((invalidated) => invalidated), [submitInvalidates]);
|
|
91
91
|
const onInternalPickerValueChange = (dates, info) => {
|
|
92
92
|
if (onPickerValueChange) {
|
|
93
93
|
const cleanInfo = {
|
|
@@ -126,11 +126,11 @@ function Picker(props, ref) {
|
|
|
126
126
|
onClear?.();
|
|
127
127
|
};
|
|
128
128
|
const hoverStore = useHoverStore();
|
|
129
|
-
const panelHoverValues = React
|
|
129
|
+
const panelHoverValues = React.useMemo(() => {
|
|
130
130
|
const values = calendarValue.filter((date) => date);
|
|
131
131
|
return multiple ? values : values.slice(0, 1);
|
|
132
132
|
}, [calendarValue, multiple]);
|
|
133
|
-
React
|
|
133
|
+
React.useEffect(() => {
|
|
134
134
|
if (!mergedOpen) hoverStore.set(null, null);
|
|
135
135
|
}, [mergedOpen, hoverStore]);
|
|
136
136
|
const onSetHover = (date, source) => {
|
|
@@ -164,7 +164,7 @@ function Picker(props, ref) {
|
|
|
164
164
|
triggerOpen(false);
|
|
165
165
|
};
|
|
166
166
|
const onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender);
|
|
167
|
-
const panelProps = React
|
|
167
|
+
const panelProps = React.useMemo(() => {
|
|
168
168
|
const domProps = pickAttrs(filledProps);
|
|
169
169
|
return {
|
|
170
170
|
...omit(filledProps, [
|
|
@@ -236,7 +236,7 @@ function Picker(props, ref) {
|
|
|
236
236
|
}
|
|
237
237
|
onKeyDown?.(event, preventDefault);
|
|
238
238
|
};
|
|
239
|
-
const context = React
|
|
239
|
+
const context = React.useMemo(() => ({
|
|
240
240
|
prefixCls,
|
|
241
241
|
locale,
|
|
242
242
|
generateConfig,
|
|
@@ -310,7 +310,7 @@ function Picker(props, ref) {
|
|
|
310
310
|
})
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
const RefPicker = React
|
|
313
|
+
const RefPicker = React.forwardRef(Picker);
|
|
314
314
|
if (process.env.NODE_ENV !== "production") RefPicker.displayName = "RefPicker";
|
|
315
315
|
export { RefPicker as default };
|
|
316
316
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SinglePicker.mjs","names":["React"],"sources":["../../../../src/DatePicker/core/PickerInput/SinglePicker.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { useControlledState, useEvent, useLayoutEffect } from '../hooks/react';\nimport useSemantic from '../hooks/useSemantic';\nimport useToggleDates from '../hooks/useToggleDates';\nimport type {\n BaseInfo,\n InternalMode,\n PanelMode,\n PickerRef,\n SelectorProps,\n SharedHTMLAttrs,\n SharedPickerProps,\n SharedTimeProps,\n ValueDate,\n} from '../interface';\nimport PickerPopup from '../PickerPopup';\nimport { omit, pickAttrs } from '../utils/common';\nimport { toArray } from '../utils/miscUtil';\nimport PickerContext from './context';\nimport useCellRender from './hooks/useCellRender';\nimport useFieldsInvalidate from './hooks/useFieldsInvalidate';\nimport useFilledProps from './hooks/useFilledProps';\nimport useFocusEvents, { isTargetInContainers } from './hooks/useFocusEvents';\nimport useHoverStore, { type HoverSource } from './hooks/useHoverStore';\nimport useOpen from './hooks/useOpen';\nimport usePickerRef from './hooks/usePickerRef';\nimport usePresets from './hooks/usePresets';\nimport useRangePickerValue from './hooks/useRangePickerValue';\nimport useRangeValue, { useInnerValue } from './hooks/useRangeValue';\nimport useRangeValueChange, { type RangeValueChangeSource } from './hooks/useRangeValueChange';\nimport useShowNow from './hooks/useShowNow';\nimport Popup from './Popup';\nimport HoverSelector from './Selector/SingleSelector/HoverSelector';\n\n// TODO: isInvalidateDate with showTime.disabledTime should not provide `range` prop\n\nexport interface CustomTagProps<DateType extends object = any> {\n closable: boolean;\n disabled: boolean;\n label: React.ReactNode;\n onClose: (event?: React.MouseEvent<HTMLElement>) => void;\n value: DateType;\n}\n\nexport interface BasePickerProps<\n DateType extends object = any,\n> extends SharedPickerProps<DateType> {\n // Picker Value\n /**\n * Config the popup panel date.\n * Every time active the input to open popup will reset with `defaultPickerValue`.\n *\n * Note: `defaultPickerValue` priority is higher than `value` for the first open.\n */\n defaultPickerValue?: DateType | null;\n\n defaultValue?: DateType | DateType[];\n // Control\n disabled?: boolean;\n // Structure\n id?: string;\n /** Only works when `multiple` is in use */\n maxTagCount?: number | 'responsive';\n\n // Mode\n mode?: PanelMode;\n /** Not support `time` or `datetime` picker */\n multiple?: boolean;\n onCalendarChange?: (\n date: DateType | DateType[],\n dateString: string | string[],\n info: BaseInfo,\n ) => void;\n onChange?: (date: DateType | DateType[], dateString: string | string[]) => void;\n /** */\n onOk?: (value?: DateType | DateType[]) => void;\n\n onPanelChange?: (values: DateType, modes: PanelMode) => void;\n\n /**\n * Each popup panel `pickerValue` change will trigger the callback.\n * @param date The changed picker value\n * @param info.source `panel` from the panel click. `reset` from popup open or field typing.\n */\n onPickerValueChange?: (\n date: DateType,\n info: {\n source: 'reset' | 'panel';\n mode: PanelMode;\n },\n ) => void;\n /**\n * Config each start & end field popup panel date.\n * When config `pickerValue`, you must also provide `onPickerValueChange` to handle changes.\n */\n pickerValue?: DateType | null;\n // Placeholder\n placeholder?: string;\n\n // Preset\n presets?: ValueDate<DateType>[];\n\n removeIcon?: React.ReactNode;\n\n /** Only works when `multiple` is in use */\n tagRender?: (props: CustomTagProps<DateType>) => React.ReactNode;\n // Value\n value?: DateType | DateType[] | null;\n}\n\nexport interface PickerProps<DateType extends object = any>\n extends BasePickerProps<DateType>, Omit<SharedTimeProps<DateType>, 'format' | 'defaultValue'> {}\n\n/** Internal usage. For cross function get same aligned props */\nexport type ReplacedPickerProps<DateType extends object = any> = {\n value?: DateType[];\n defaultValue?: DateType[];\n pickerValue?: DateType[];\n defaultPickerValue?: DateType[];\n onChange?: (date: DateType | DateType[], dateString: string | string[]) => void;\n onCalendarChange?: (\n date: DateType | DateType[],\n dateString: string | string[],\n info: BaseInfo,\n ) => void;\n};\n\nfunction Picker<DateType extends object = any>(\n props: PickerProps<DateType>,\n ref: React.Ref<PickerRef>,\n) {\n // ========================= Prop =========================\n const [filledProps, internalPicker, complexPicker, formatList, maskFormat, isInvalidateDate] =\n useFilledProps(props);\n\n const {\n // Style\n prefixCls,\n rootClassName,\n styles: propStyles,\n classNames: propClassNames,\n\n previewValue,\n\n // Value\n order,\n defaultValue,\n value,\n needConfirm,\n onChange,\n onClear,\n onKeyDown,\n\n // Disabled\n disabled,\n disabledDate,\n minDate,\n maxDate,\n\n // Open\n defaultOpen,\n open,\n onOpenChange,\n\n // Picker\n locale,\n generateConfig,\n picker,\n showNow,\n showToday,\n showTime,\n\n // Mode\n mode,\n onPanelChange,\n onCalendarChange,\n onOk,\n multiple,\n\n // Picker Value\n defaultPickerValue,\n pickerValue,\n onPickerValueChange,\n\n // Format\n inputReadOnly,\n\n suffixIcon,\n removeIcon,\n tagRender,\n\n // Focus\n onFocus,\n onBlur,\n\n // Presets\n presets,\n\n // Render\n components,\n cellRender,\n dateRender,\n monthCellRender,\n\n // Native\n onClick,\n } = filledProps as Omit<typeof filledProps, keyof ReplacedPickerProps<DateType>> &\n ReplacedPickerProps<DateType>;\n\n // ========================= Refs =========================\n const selectorRef = usePickerRef(ref);\n const popupRef = React.useRef<HTMLDivElement>(null);\n\n // ========================= Util =========================\n function pickerParam<T>(values: T[] | null) {\n if (values === null) {\n return null;\n }\n\n return multiple ? values : values[0];\n }\n\n const toggleDates = useToggleDates(generateConfig, locale, internalPicker);\n\n // ======================= Semantic =======================\n const [mergedClassNames, mergedStyles] = useSemantic(propClassNames, propStyles);\n\n // ========================= Open =========================\n const [mergedOpen, triggerOpen] = useOpen(open, defaultOpen, [disabled], onOpenChange);\n\n // ======================= Calendar =======================\n const onInternalCalendarChange = (dates: DateType[], dateStrings: string[], info: BaseInfo) => {\n if (onCalendarChange) {\n const filteredInfo = {\n ...info,\n };\n delete filteredInfo.range;\n onCalendarChange(pickerParam(dates)!, pickerParam(dateStrings)!, filteredInfo);\n }\n };\n\n const onInternalOk = (dates: DateType[]) => {\n onOk?.(pickerParam(dates)!);\n };\n\n // ======================== Values ========================\n const [mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, triggerOk] =\n useInnerValue(\n generateConfig,\n locale,\n formatList,\n false,\n order,\n defaultValue,\n value,\n onInternalCalendarChange,\n onInternalOk,\n );\n\n const calendarValue = getCalendarValue();\n\n // ======================== Focus =========================\n const isInternalPickerElement = useEvent((element: EventTarget | null) =>\n isTargetInContainers(element, [selectorRef.current!.nativeElement, popupRef.current]),\n );\n\n const [focused, onFieldFocus, onFieldBlur] = useFocusEvents(\n isInternalPickerElement,\n (_index, event) => {\n onFocus?.(event, {});\n },\n (_index, event) => {\n onBlur?.(event, {});\n },\n () => {\n triggerOpen(false);\n },\n );\n\n // ========================= Mode =========================\n const [mergedMode, setMode] = useControlledState(picker, mode);\n\n /** Extends from `mergedMode` to patch `datetime` mode */\n const internalMode: InternalMode = mergedMode === 'date' && showTime ? 'datetime' : mergedMode;\n\n // ======================= Show Now =======================\n const mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday);\n\n // ======================== Value =========================\n const onInternalChange =\n onChange &&\n ((dates: DateType[] | null, dateStrings: string[] | null) => {\n onChange(pickerParam(dates)!, pickerParam(dateStrings)!);\n });\n\n const [\n ,\n /** Trigger `onChange` directly without check `disabledDate` */\n triggerSubmitChange,\n /** Reset uncommitted values */\n resetValue,\n ] = useRangeValue(\n {\n ...filledProps,\n onChange: onInternalChange,\n },\n mergedValue,\n setInnerValue,\n getCalendarValue,\n triggerCalendarChange,\n [], //disabled,\n formatList,\n isInvalidateDate,\n );\n\n // Treat the complete SinglePicker value list as one field value. This keeps\n // multiple dates inside field `0` instead of exposing them as extra fields.\n // 将 SinglePicker 的整组值视为一个 field value;multiple 日期仍属于\n // field `0` 内部,不会被当成额外的 field。\n const getFieldCalendarValue = useEvent(() => {\n const values = getCalendarValue();\n return [values.length ? values : null];\n });\n\n const triggerFieldCalendarChange = useEvent((_index: number, nextValues: DateType[]) => {\n triggerCalendarChange(nextValues);\n });\n\n const flushFieldSubmit = useEvent((_index: number, needTriggerChange: boolean) => {\n if (needTriggerChange) {\n triggerSubmitChange(getCalendarValue());\n triggerOpen(false, { force: true });\n }\n });\n\n const resetFieldValue = useEvent(() => {\n resetValue();\n });\n\n const [, activeIndex, , , triggerSingleValueChange, resetSingleValueChange] = useRangeValueChange<\n DateType[]\n >(\n 1,\n needConfirm,\n [false],\n getFieldCalendarValue,\n triggerFieldCalendarChange,\n flushFieldSubmit,\n resetFieldValue,\n );\n\n // Finalize the current interaction only after the popup is actually closed.\n // 仅在 popup 实际关闭后,统一收口当前交互。\n useLayoutEffect(\n (firstMount) => {\n if (!firstMount && !mergedOpen) {\n triggerSingleValueChange(0, 'popupClose');\n }\n },\n [mergedOpen],\n );\n\n // ======================= Validate =======================\n const [submitInvalidates, onSelectorInvalid] = useFieldsInvalidate(\n calendarValue,\n isInvalidateDate,\n );\n\n const submitInvalidate = React.useMemo(\n () => submitInvalidates.some((invalidated) => invalidated),\n [submitInvalidates],\n );\n\n // ===================== Picker Value =====================\n // Proxy to single pickerValue\n const onInternalPickerValueChange = (\n dates: DateType[],\n info: BaseInfo & { source: 'reset' | 'panel'; mode: [PanelMode, PanelMode] },\n ) => {\n if (onPickerValueChange) {\n const cleanInfo = { ...info, mode: info.mode[0] };\n delete cleanInfo.range;\n onPickerValueChange(dates[0], cleanInfo);\n }\n };\n\n const [currentPickerValue, setCurrentPickerValue] = useRangePickerValue(\n generateConfig,\n locale,\n calendarValue,\n [mergedMode],\n mergedOpen,\n false,\n activeIndex,\n internalPicker,\n false, // multiplePanel,\n defaultPickerValue,\n pickerValue,\n toArray(showTime?.defaultOpenValue),\n onInternalPickerValueChange,\n minDate,\n maxDate,\n );\n\n // >>> Mode need wait for `pickerValue`\n const triggerModeChange = useEvent(\n (nextPickerValue: DateType | null, nextMode: PanelMode, triggerEvent?: boolean) => {\n setMode(nextMode);\n\n // Compatible with `onPanelChange`\n if (onPanelChange && triggerEvent !== false) {\n const lastPickerValue: DateType = nextPickerValue || calendarValue.at(-1)!;\n onPanelChange(lastPickerValue, nextMode);\n }\n },\n );\n\n // ======================== Submit ========================\n /**\n * Submit the complete value list stored in SinglePicker field `0`.\n * 提交 SinglePicker field `0` 内保存的整组值。\n */\n const triggerConfirm = (source: RangeValueChangeSource = 'confirm') => {\n triggerSingleValueChange(0, source);\n };\n\n // ======================== Click =========================\n const onSelectorClick: React.MouseEventHandler<HTMLDivElement> = (event) => {\n if (!disabled && !selectorRef.current!.nativeElement.contains(document.activeElement)) {\n // Click to focus the enabled input\n selectorRef.current!.focus();\n }\n\n triggerOpen(true);\n\n onClick?.(event);\n };\n\n const onSelectorClear = () => {\n resetSingleValueChange();\n triggerSubmitChange(null);\n triggerOpen(false, { force: true });\n selectorRef.current!.focus();\n onClear?.();\n };\n\n // ======================== Hover =========================\n // The hovered date lives outside React state: only the selector's preview reads it, so a\n // cell hover must not re-render the popup and every panel cell.\n const hoverStore = useHoverStore<DateType>();\n\n const panelHoverValues = React.useMemo(() => {\n const values = calendarValue.filter((date) => date);\n return multiple ? values : values.slice(0, 1);\n }, [calendarValue, multiple]);\n\n React.useEffect(() => {\n if (!mergedOpen) {\n hoverStore.set(null, null);\n }\n }, [mergedOpen, hoverStore]);\n\n const onSetHover = (date: DateType | null, source: HoverSource) => {\n if (previewValue !== 'hover') {\n return;\n }\n hoverStore.set(date, date ? source : null);\n };\n\n // ========================================================\n // == Panels ==\n // ========================================================\n // ======================= Presets ========================\n const presetList = usePresets(presets);\n\n const onPresetHover = (nextValue: DateType | null) => {\n onSetHover(nextValue, 'preset');\n };\n\n // TODO: handle this\n const onPresetSubmit = (nextValue: DateType) => {\n const nextCalendarValues = multiple ? toggleDates(getCalendarValue(), nextValue) : [nextValue];\n const passed = triggerSubmitChange(nextCalendarValues);\n\n if (passed && !multiple) {\n triggerOpen(false, { force: true });\n }\n };\n\n const onNow = (now: DateType) => {\n onPresetSubmit(now);\n };\n\n // ======================== Panel =========================\n const onPanelHover = (date: DateType | null) => {\n onSetHover(date, 'cell');\n };\n\n // >>> Focus\n const onPanelFocus: React.FocusEventHandler<HTMLElement> = (event) => {\n triggerOpen(true);\n onFieldFocus(0, 'panel', event);\n };\n\n // >>> Calendar\n const onPanelSelect = (date: DateType) => {\n // Not change values if multiple and current panel is to match with picker\n if (multiple && internalMode !== picker) {\n return;\n }\n\n const nextValues = multiple ? toggleDates(getCalendarValue(), date) : [date];\n const panelFinished = !complexPicker && internalPicker === internalMode;\n\n triggerSingleValueChange(0, panelFinished ? 'panel-final' : 'panel-intermediate', nextValues);\n };\n\n // >>> Close\n const onPopupClose = () => {\n // Close popup\n triggerOpen(false);\n };\n\n // >>> cellRender\n const onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender);\n\n // >>> invalid\n\n const panelProps = React.useMemo(() => {\n const domProps = pickAttrs(filledProps);\n const restProps = omit(filledProps, [\n ...(Object.keys(domProps) as (keyof SharedHTMLAttrs)[]),\n 'onChange',\n 'onCalendarChange',\n 'onClear',\n 'style',\n 'className',\n 'onPanelChange',\n 'classNames',\n 'styles',\n ]);\n return {\n ...restProps,\n multiple: filledProps.multiple,\n };\n }, [filledProps]);\n\n // >>> Render\n const panel = (\n <Popup<any>\n containerRef={popupRef}\n // MISC\n {...panelProps}\n classNames={mergedClassNames}\n isInvalid={isInvalidateDate}\n mode={mergedMode}\n showNow={mergedShowNow}\n styles={mergedStyles}\n value={calendarValue}\n onChange={null}\n onFocus={onPanelFocus}\n onPresetHover={onPresetHover}\n onPresetSubmit={onPresetSubmit}\n onSubmit={() => triggerConfirm('confirm')}\n defaultOpenValue={showTime?.defaultOpenValue}\n // Focus\n internalMode={internalMode}\n showTime={showTime}\n // Disabled\n disabledDate={disabledDate}\n onBlur={(event) => onFieldBlur(0, 'panel', event)}\n // Mode\n picker={picker}\n onHover={onPanelHover}\n // Submit\n needConfirm={needConfirm}\n onNow={onNow}\n // Render\n cellRender={onInternalCellRender}\n onOk={triggerOk}\n // Preset\n presets={presetList}\n onPanelChange={triggerModeChange}\n // Value\n format={maskFormat}\n // Styles\n onPickerValueChange={setCurrentPickerValue}\n // Hover\n hoverValue={panelHoverValues}\n onSelect={onPanelSelect}\n // PickerValue\n pickerValue={currentPickerValue}\n />\n );\n\n // ========================================================\n // == Selector ==\n // ========================================================\n\n // ======================== Change ========================\n const onSelectorChange = (date: DateType[], source: 'input' | 'remove' = 'input') => {\n triggerSingleValueChange(0, source, date);\n };\n\n const onSelectorInputChange = () => {\n triggerSingleValueChange(0, 'input');\n };\n\n // ======================= Selector =======================\n const onSelectorFocus: SelectorProps['onFocus'] = (event) => {\n triggerSingleValueChange(0, 'field-switch');\n\n triggerOpen(true, {\n inherit: true,\n });\n\n onFieldFocus(0, 'input', event);\n };\n\n const onSelectorBlur: SelectorProps['onBlur'] = (event) => {\n onFieldBlur(0, 'input', event);\n };\n\n const onSelectorKeyDown: SelectorProps['onKeyDown'] = (event, preventDefault) => {\n if (event.key === 'Tab') {\n triggerConfirm('keyboard-submit-weak');\n } else if (event.key === 'Escape') {\n triggerSingleValueChange(0, 'esc');\n triggerOpen(false);\n }\n\n onKeyDown?.(event, preventDefault);\n };\n\n // ======================= Context ========================\n const context = React.useMemo(\n () => ({\n prefixCls,\n locale,\n generateConfig,\n button: components.button,\n input: components.input,\n classNames: mergedClassNames,\n styles: mergedStyles,\n }),\n [\n prefixCls,\n locale,\n generateConfig,\n components.button,\n components.input,\n mergedClassNames,\n mergedStyles,\n ],\n );\n\n // ======================== Effect ========================\n // >>> Mode\n // Reset for every active\n useLayoutEffect(() => {\n if (mergedOpen && activeIndex !== undefined) {\n // Legacy compatible. This effect update should not trigger `onPanelChange`\n triggerModeChange(null, picker, false);\n }\n }, [mergedOpen, activeIndex, picker]);\n\n // ======================== Render ========================\n return (\n <PickerContext value={context}>\n <PickerPopup\n direction={filledProps.direction}\n getAnchor={() => selectorRef.current?.nativeElement}\n getPopupContainer={filledProps.getPopupContainer}\n inline={filledProps.inlinePopup}\n placement={filledProps.placement}\n popupElement={panel}\n popupStyle={mergedStyles.popup.root}\n onClose={onPopupClose}\n popupClassName={clsx(rootClassName, mergedClassNames.popup.root)}\n // Visible\n visible={mergedOpen}\n >\n <HoverSelector\n // Shared\n {...filledProps}\n // Ref\n calendarValue={calendarValue}\n focused={focused}\n hoverStore={hoverStore}\n maskFormat={maskFormat}\n open={mergedOpen}\n removeIcon={removeIcon}\n tagRender={tagRender}\n onBlur={onSelectorBlur}\n onChange={onSelectorChange}\n onFocus={onSelectorFocus}\n onInputChange={onSelectorInputChange}\n onKeyDown={onSelectorKeyDown}\n onSubmit={() => triggerConfirm('keyboard-submit')}\n onInvalid={(invalid) => {\n // Only `single` mode support type date.\n // `multiple` mode can not typing.\n onSelectorInvalid(invalid, 0);\n }}\n inputReadOnly={inputReadOnly}\n // Disabled\n disabled={disabled}\n internalPicker={internalPicker}\n // Format\n format={formatList}\n // Open\n ref={selectorRef}\n // Style\n className={clsx(filledProps.className, rootClassName, mergedClassNames.root)}\n style={{ ...mergedStyles.root, ...filledProps.style }}\n // Icon\n suffixIcon={suffixIcon}\n onClear={onSelectorClear}\n // Invalid\n invalid={submitInvalidate}\n onOpenChange={triggerOpen}\n // Click\n onClick={onSelectorClick}\n />\n </PickerPopup>\n </PickerContext>\n );\n}\n\nconst RefPicker = React.forwardRef(Picker) as <DateType extends object = any>(\n props: PickerProps<DateType> & React.RefAttributes<PickerRef>,\n) => React.ReactElement;\n\nif (process.env.NODE_ENV !== 'production') {\n (RefPicker as any).displayName = 'RefPicker';\n}\n\nexport default RefPicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiIA,SAAS,OACP,OACA,KACA;CAEA,MAAM,CAAC,aAAa,gBAAgB,eAAe,YAAY,YAAY,oBACzE,eAAe,KAAK;CAEtB,MAAM,EAEJ,WACA,eACA,QAAQ,YACR,YAAY,gBAEZ,cAGA,OACA,cACA,OACA,aACA,UACA,SACA,WAGA,UACA,cACA,SACA,SAGA,aACA,MACA,cAGA,QACA,gBACA,QACA,SACA,WACA,UAGA,MACA,eACA,kBACA,MACA,UAGA,oBACA,aACA,qBAGA,eAEA,YACA,YACA,WAGA,SACA,QAGA,SAGA,YACA,YACA,YACA,iBAGA,YACE;CAIJ,MAAM,cAAc,aAAa,GAAG;CACpC,MAAM,WAAWA,QAAM,OAAuB,IAAI;CAGlD,SAAS,YAAe,QAAoB;EAC1C,IAAI,WAAW,MACb,OAAO;EAGT,OAAO,WAAW,SAAS,OAAO;CACpC;CAEA,MAAM,cAAc,eAAe,gBAAgB,QAAQ,cAAc;CAGzE,MAAM,CAAC,kBAAkB,gBAAgB,YAAY,gBAAgB,UAAU;CAG/E,MAAM,CAAC,YAAY,eAAe,QAAQ,MAAM,aAAa,CAAC,QAAQ,GAAG,YAAY;CAGrF,MAAM,4B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inglePicker.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { useControlledState, useEvent, useLayoutEffect } from '../hooks/react';\nimport useSemantic from '../hooks/useSemantic';\nimport useToggleDates from '../hooks/useToggleDates';\nimport type {\n BaseInfo,\n InternalMode,\n PanelMode,\n PickerRef,\n SelectorProps,\n SharedHTMLAttrs,\n SharedPickerProps,\n SharedTimeProps,\n ValueDate,\n} from '../interface';\nimport PickerPopup from '../PickerPopup';\nimport { omit, pickAttrs } from '../utils/common';\nimport { toArray } from '../utils/miscUtil';\nimport PickerContext from './context';\nimport useCellRender from './hooks/useCellRender';\nimport useFieldsInvalidate from './hooks/useFieldsInvalidate';\nimport useFilledProps from './hooks/useFilledProps';\nimport useFocusEvents, { isTargetInContainers } from './hooks/useFocusEvents';\nimport useHoverStore, { type HoverSource } from './hooks/useHoverStore';\nimport useOpen from './hooks/useOpen';\nimport usePickerRef from './hooks/usePickerRef';\nimport usePresets from './hooks/usePresets';\nimport useRangePickerValue from './hooks/useRangePickerValue';\nimport useRangeValue, { useInnerValue } from './hooks/useRangeValue';\nimport useRangeValueChange, { type RangeValueChangeSource } from './hooks/useRangeValueChange';\nimport useShowNow from './hooks/useShowNow';\nimport Popup from './Popup';\nimport HoverSelector from './Selector/SingleSelector/HoverSelector';\n\n// TODO: isInvalidateDate with showTime.disabledTime should not provide `range` prop\n\nexport interface CustomTagProps<DateType extends object = any> {\n closable: boolean;\n disabled: boolean;\n label: React.ReactNode;\n onClose: (event?: React.MouseEvent<HTMLElement>) => void;\n value: DateType;\n}\n\nexport interface BasePickerProps<\n DateType extends object = any,\n> extends SharedPickerProps<DateType> {\n // Picker Value\n /**\n * Config the popup panel date.\n * Every time active the input to open popup will reset with `defaultPickerValue`.\n *\n * Note: `defaultPickerValue` priority is higher than `value` for the first open.\n */\n defaultPickerValue?: DateType | null;\n\n defaultValue?: DateType | DateType[];\n // Control\n disabled?: boolean;\n // Structure\n id?: string;\n /** Only works when `multiple` is in use */\n maxTagCount?: number | 'responsive';\n\n // Mode\n mode?: PanelMode;\n /** Not support `time` or `datetime` picker */\n multiple?: boolean;\n onCalendarChange?: (\n date: DateType | DateType[],\n dateString: string | string[],\n info: BaseInfo,\n ) => void;\n onChange?: (date: DateType | DateType[], dateString: string | string[]) => void;\n /** */\n onOk?: (value?: DateType | DateType[]) => void;\n\n onPanelChange?: (values: DateType, modes: PanelMode) => void;\n\n /**\n * Each popup panel `pickerValue` change will trigger the callback.\n * @param date The changed picker value\n * @param info.source `panel` from the panel click. `reset` from popup open or field typing.\n */\n onPickerValueChange?: (\n date: DateType,\n info: {\n source: 'reset' | 'panel';\n mode: PanelMode;\n },\n ) => void;\n /**\n * Config each start & end field popup panel date.\n * When config `pickerValue`, you must also provide `onPickerValueChange` to handle changes.\n */\n pickerValue?: DateType | null;\n // Placeholder\n placeholder?: string;\n\n // Preset\n presets?: ValueDate<DateType>[];\n\n removeIcon?: React.ReactNode;\n\n /** Only works when `multiple` is in use */\n tagRender?: (props: CustomTagProps<DateType>) => React.ReactNode;\n // Value\n value?: DateType | DateType[] | null;\n}\n\nexport interface PickerProps<DateType extends object = any>\n extends BasePickerProps<DateType>, Omit<SharedTimeProps<DateType>, 'format' | 'defaultValue'> {}\n\n/** Internal usage. For cross function get same aligned props */\nexport type ReplacedPickerProps<DateType extends object = any> = {\n value?: DateType[];\n defaultValue?: DateType[];\n pickerValue?: DateType[];\n defaultPickerValue?: DateType[];\n onChange?: (date: DateType | DateType[], dateString: string | string[]) => void;\n onCalendarChange?: (\n date: DateType | DateType[],\n dateString: string | string[],\n info: BaseInfo,\n ) => void;\n};\n\nfunction Picker<DateType extends object = any>(\n props: PickerProps<DateType>,\n ref: React.Ref<PickerRef>,\n) {\n // ========================= Prop =========================\n const [filledProps, internalPicker, complexPicker, formatList, maskFormat, isInvalidateDate] =\n useFilledProps(props);\n\n const {\n // Style\n prefixCls,\n rootClassName,\n styles: propStyles,\n classNames: propClassNames,\n\n previewValue,\n\n // Value\n order,\n defaultValue,\n value,\n needConfirm,\n onChange,\n onClear,\n onKeyDown,\n\n // Disabled\n disabled,\n disabledDate,\n minDate,\n maxDate,\n\n // Open\n defaultOpen,\n open,\n onOpenChange,\n\n // Picker\n locale,\n generateConfig,\n picker,\n showNow,\n showToday,\n showTime,\n\n // Mode\n mode,\n onPanelChange,\n onCalendarChange,\n onOk,\n multiple,\n\n // Picker Value\n defaultPickerValue,\n pickerValue,\n onPickerValueChange,\n\n // Format\n inputReadOnly,\n\n suffixIcon,\n removeIcon,\n tagRender,\n\n // Focus\n onFocus,\n onBlur,\n\n // Presets\n presets,\n\n // Render\n components,\n cellRender,\n dateRender,\n monthCellRender,\n\n // Native\n onClick,\n } = filledProps as Omit<typeof filledProps, keyof ReplacedPickerProps<DateType>> &\n ReplacedPickerProps<DateType>;\n\n // ========================= Refs =========================\n const selectorRef = usePickerRef(ref);\n const popupRef = React.useRef<HTMLDivElement>(null);\n\n // ========================= Util =========================\n function pickerParam<T>(values: T[] | null) {\n if (values === null) {\n return null;\n }\n\n return multiple ? values : values[0];\n }\n\n const toggleDates = useToggleDates(generateConfig, locale, internalPicker);\n\n // ======================= Semantic =======================\n const [mergedClassNames, mergedStyles] = useSemantic(propClassNames, propStyles);\n\n // ========================= Open =========================\n const [mergedOpen, triggerOpen] = useOpen(open, defaultOpen, [disabled], onOpenChange);\n\n // ======================= Calendar =======================\n const onInternalCalendarChange = (dates: DateType[], dateStrings: string[], info: BaseInfo) => {\n if (onCalendarChange) {\n const filteredInfo = {\n ...info,\n };\n delete filteredInfo.range;\n onCalendarChange(pickerParam(dates)!, pickerParam(dateStrings)!, filteredInfo);\n }\n };\n\n const onInternalOk = (dates: DateType[]) => {\n onOk?.(pickerParam(dates)!);\n };\n\n // ======================== Values ========================\n const [mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, triggerOk] =\n useInnerValue(\n generateConfig,\n locale,\n formatList,\n false,\n order,\n defaultValue,\n value,\n onInternalCalendarChange,\n onInternalOk,\n );\n\n const calendarValue = getCalendarValue();\n\n // ======================== Focus =========================\n const isInternalPickerElement = useEvent((element: EventTarget | null) =>\n isTargetInContainers(element, [selectorRef.current!.nativeElement, popupRef.current]),\n );\n\n const [focused, onFieldFocus, onFieldBlur] = useFocusEvents(\n isInternalPickerElement,\n (_index, event) => {\n onFocus?.(event, {});\n },\n (_index, event) => {\n onBlur?.(event, {});\n },\n () => {\n triggerOpen(false);\n },\n );\n\n // ========================= Mode =========================\n const [mergedMode, setMode] = useControlledState(picker, mode);\n\n /** Extends from `mergedMode` to patch `datetime` mode */\n const internalMode: InternalMode = mergedMode === 'date' && showTime ? 'datetime' : mergedMode;\n\n // ======================= Show Now =======================\n const mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday);\n\n // ======================== Value =========================\n const onInternalChange =\n onChange &&\n ((dates: DateType[] | null, dateStrings: string[] | null) => {\n onChange(pickerParam(dates)!, pickerParam(dateStrings)!);\n });\n\n const [\n ,\n /** Trigger `onChange` directly without check `disabledDate` */\n triggerSubmitChange,\n /** Reset uncommitted values */\n resetValue,\n ] = useRangeValue(\n {\n ...filledProps,\n onChange: onInternalChange,\n },\n mergedValue,\n setInnerValue,\n getCalendarValue,\n triggerCalendarChange,\n [], //disabled,\n formatList,\n isInvalidateDate,\n );\n\n // Treat the complete SinglePicker value list as one field value. This keeps\n // multiple dates inside field `0` instead of exposing them as extra fields.\n // 将 SinglePicker 的整组值视为一个 field value;multiple 日期仍属于\n // field `0` 内部,不会被当成额外的 field。\n const getFieldCalendarValue = useEvent(() => {\n const values = getCalendarValue();\n return [values.length ? values : null];\n });\n\n const triggerFieldCalendarChange = useEvent((_index: number, nextValues: DateType[]) => {\n triggerCalendarChange(nextValues);\n });\n\n const flushFieldSubmit = useEvent((_index: number, needTriggerChange: boolean) => {\n if (needTriggerChange) {\n triggerSubmitChange(getCalendarValue());\n triggerOpen(false, { force: true });\n }\n });\n\n const resetFieldValue = useEvent(() => {\n resetValue();\n });\n\n const [, activeIndex, , , triggerSingleValueChange, resetSingleValueChange] = useRangeValueChange<\n DateType[]\n >(\n 1,\n needConfirm,\n [false],\n getFieldCalendarValue,\n triggerFieldCalendarChange,\n flushFieldSubmit,\n resetFieldValue,\n );\n\n // Finalize the current interaction only after the popup is actually closed.\n // 仅在 popup 实际关闭后,统一收口当前交互。\n useLayoutEffect(\n (firstMount) => {\n if (!firstMount && !mergedOpen) {\n triggerSingleValueChange(0, 'popupClose');\n }\n },\n [mergedOpen],\n );\n\n // ======================= Validate =======================\n const [submitInvalidates, onSelectorInvalid] = useFieldsInvalidate(\n calendarValue,\n isInvalidateDate,\n );\n\n const submitInvalidate = React.useMemo(\n () => submitInvalidates.some((invalidated) => invalidated),\n [submitInvalidates],\n );\n\n // ===================== Picker Value =====================\n // Proxy to single pickerValue\n const onInternalPickerValueChange = (\n dates: DateType[],\n info: BaseInfo & { source: 'reset' | 'panel'; mode: [PanelMode, PanelMode] },\n ) => {\n if (onPickerValueChange) {\n const cleanInfo = { ...info, mode: info.mode[0] };\n delete cleanInfo.range;\n onPickerValueChange(dates[0], cleanInfo);\n }\n };\n\n const [currentPickerValue, setCurrentPickerValue] = useRangePickerValue(\n generateConfig,\n locale,\n calendarValue,\n [mergedMode],\n mergedOpen,\n false,\n activeIndex,\n internalPicker,\n false, // multiplePanel,\n defaultPickerValue,\n pickerValue,\n toArray(showTime?.defaultOpenValue),\n onInternalPickerValueChange,\n minDate,\n maxDate,\n );\n\n // >>> Mode need wait for `pickerValue`\n const triggerModeChange = useEvent(\n (nextPickerValue: DateType | null, nextMode: PanelMode, triggerEvent?: boolean) => {\n setMode(nextMode);\n\n // Compatible with `onPanelChange`\n if (onPanelChange && triggerEvent !== false) {\n const lastPickerValue: DateType = nextPickerValue || calendarValue.at(-1)!;\n onPanelChange(lastPickerValue, nextMode);\n }\n },\n );\n\n // ======================== Submit ========================\n /**\n * Submit the complete value list stored in SinglePicker field `0`.\n * 提交 SinglePicker field `0` 内保存的整组值。\n */\n const triggerConfirm = (source: RangeValueChangeSource = 'confirm') => {\n triggerSingleValueChange(0, source);\n };\n\n // ======================== Click =========================\n const onSelectorClick: React.MouseEventHandler<HTMLDivElement> = (event) => {\n if (!disabled && !selectorRef.current!.nativeElement.contains(document.activeElement)) {\n // Click to focus the enabled input\n selectorRef.current!.focus();\n }\n\n triggerOpen(true);\n\n onClick?.(event);\n };\n\n const onSelectorClear = () => {\n resetSingleValueChange();\n triggerSubmitChange(null);\n triggerOpen(false, { force: true });\n selectorRef.current!.focus();\n onClear?.();\n };\n\n // ======================== Hover =========================\n // The hovered date lives outside React state: only the selector's preview reads it, so a\n // cell hover must not re-render the popup and every panel cell.\n const hoverStore = useHoverStore<DateType>();\n\n const panelHoverValues = React.useMemo(() => {\n const values = calendarValue.filter((date) => date);\n return multiple ? values : values.slice(0, 1);\n }, [calendarValue, multiple]);\n\n React.useEffect(() => {\n if (!mergedOpen) {\n hoverStore.set(null, null);\n }\n }, [mergedOpen, hoverStore]);\n\n const onSetHover = (date: DateType | null, source: HoverSource) => {\n if (previewValue !== 'hover') {\n return;\n }\n hoverStore.set(date, date ? source : null);\n };\n\n // ========================================================\n // == Panels ==\n // ========================================================\n // ======================= Presets ========================\n const presetList = usePresets(presets);\n\n const onPresetHover = (nextValue: DateType | null) => {\n onSetHover(nextValue, 'preset');\n };\n\n // TODO: handle this\n const onPresetSubmit = (nextValue: DateType) => {\n const nextCalendarValues = multiple ? toggleDates(getCalendarValue(), nextValue) : [nextValue];\n const passed = triggerSubmitChange(nextCalendarValues);\n\n if (passed && !multiple) {\n triggerOpen(false, { force: true });\n }\n };\n\n const onNow = (now: DateType) => {\n onPresetSubmit(now);\n };\n\n // ======================== Panel =========================\n const onPanelHover = (date: DateType | null) => {\n onSetHover(date, 'cell');\n };\n\n // >>> Focus\n const onPanelFocus: React.FocusEventHandler<HTMLElement> = (event) => {\n triggerOpen(true);\n onFieldFocus(0, 'panel', event);\n };\n\n // >>> Calendar\n const onPanelSelect = (date: DateType) => {\n // Not change values if multiple and current panel is to match with picker\n if (multiple && internalMode !== picker) {\n return;\n }\n\n const nextValues = multiple ? toggleDates(getCalendarValue(), date) : [date];\n const panelFinished = !complexPicker && internalPicker === internalMode;\n\n triggerSingleValueChange(0, panelFinished ? 'panel-final' : 'panel-intermediate', nextValues);\n };\n\n // >>> Close\n const onPopupClose = () => {\n // Close popup\n triggerOpen(false);\n };\n\n // >>> cellRender\n const onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender);\n\n // >>> invalid\n\n const panelProps = React.useMemo(() => {\n const domProps = pickAttrs(filledProps);\n const restProps = omit(filledProps, [\n ...(Object.keys(domProps) as (keyof SharedHTMLAttrs)[]),\n 'onChange',\n 'onCalendarChange',\n 'onClear',\n 'style',\n 'className',\n 'onPanelChange',\n 'classNames',\n 'styles',\n ]);\n return {\n ...restProps,\n multiple: filledProps.multiple,\n };\n }, [filledProps]);\n\n // >>> Render\n const panel = (\n <Popup<any>\n containerRef={popupRef}\n // MISC\n {...panelProps}\n classNames={mergedClassNames}\n isInvalid={isInvalidateDate}\n mode={mergedMode}\n showNow={mergedShowNow}\n styles={mergedStyles}\n value={calendarValue}\n onChange={null}\n onFocus={onPanelFocus}\n onPresetHover={onPresetHover}\n onPresetSubmit={onPresetSubmit}\n onSubmit={() => triggerConfirm('confirm')}\n defaultOpenValue={showTime?.defaultOpenValue}\n // Focus\n internalMode={internalMode}\n showTime={showTime}\n // Disabled\n disabledDate={disabledDate}\n onBlur={(event) => onFieldBlur(0, 'panel', event)}\n // Mode\n picker={picker}\n onHover={onPanelHover}\n // Submit\n needConfirm={needConfirm}\n onNow={onNow}\n // Render\n cellRender={onInternalCellRender}\n onOk={triggerOk}\n // Preset\n presets={presetList}\n onPanelChange={triggerModeChange}\n // Value\n format={maskFormat}\n // Styles\n onPickerValueChange={setCurrentPickerValue}\n // Hover\n hoverValue={panelHoverValues}\n onSelect={onPanelSelect}\n // PickerValue\n pickerValue={currentPickerValue}\n />\n );\n\n // ========================================================\n // == Selector ==\n // ========================================================\n\n // ======================== Change ========================\n const onSelectorChange = (date: DateType[], source: 'input' | 'remove' = 'input') => {\n triggerSingleValueChange(0, source, date);\n };\n\n const onSelectorInputChange = () => {\n triggerSingleValueChange(0, 'input');\n };\n\n // ======================= Selector =======================\n const onSelectorFocus: SelectorProps['onFocus'] = (event) => {\n triggerSingleValueChange(0, 'field-switch');\n\n triggerOpen(true, {\n inherit: true,\n });\n\n onFieldFocus(0, 'input', event);\n };\n\n const onSelectorBlur: SelectorProps['onBlur'] = (event) => {\n onFieldBlur(0, 'input', event);\n };\n\n const onSelectorKeyDown: SelectorProps['onKeyDown'] = (event, preventDefault) => {\n if (event.key === 'Tab') {\n triggerConfirm('keyboard-submit-weak');\n } else if (event.key === 'Escape') {\n triggerSingleValueChange(0, 'esc');\n triggerOpen(false);\n }\n\n onKeyDown?.(event, preventDefault);\n };\n\n // ======================= Context ========================\n const context = React.useMemo(\n () => ({\n prefixCls,\n locale,\n generateConfig,\n button: components.button,\n input: components.input,\n classNames: mergedClassNames,\n styles: mergedStyles,\n }),\n [\n prefixCls,\n locale,\n generateConfig,\n components.button,\n components.input,\n mergedClassNames,\n mergedStyles,\n ],\n );\n\n // ======================== Effect ========================\n // >>> Mode\n // Reset for every active\n useLayoutEffect(() => {\n if (mergedOpen && activeIndex !== undefined) {\n // Legacy compatible. This effect update should not trigger `onPanelChange`\n triggerModeChange(null, picker, false);\n }\n }, [mergedOpen, activeIndex, picker]);\n\n // ======================== Render ========================\n return (\n <PickerContext value={context}>\n <PickerPopup\n direction={filledProps.direction}\n getAnchor={() => selectorRef.current?.nativeElement}\n getPopupContainer={filledProps.getPopupContainer}\n inline={filledProps.inlinePopup}\n placement={filledProps.placement}\n popupElement={panel}\n popupStyle={mergedStyles.popup.root}\n onClose={onPopupClose}\n popupClassName={clsx(rootClassName, mergedClassNames.popup.root)}\n // Visible\n visible={mergedOpen}\n >\n <HoverSelector\n // Shared\n {...filledProps}\n // Ref\n calendarValue={calendarValue}\n focused={focused}\n hoverStore={hoverStore}\n maskFormat={maskFormat}\n open={mergedOpen}\n removeIcon={removeIcon}\n tagRender={tagRender}\n onBlur={onSelectorBlur}\n onChange={onSelectorChange}\n onFocus={onSelectorFocus}\n onInputChange={onSelectorInputChange}\n onKeyDown={onSelectorKeyDown}\n onSubmit={() => triggerConfirm('keyboard-submit')}\n onInvalid={(invalid) => {\n // Only `single` mode support type date.\n // `multiple` mode can not typing.\n onSelectorInvalid(invalid, 0);\n }}\n inputReadOnly={inputReadOnly}\n // Disabled\n disabled={disabled}\n internalPicker={internalPicker}\n // Format\n format={formatList}\n // Open\n ref={selectorRef}\n // Style\n className={clsx(filledProps.className, rootClassName, mergedClassNames.root)}\n style={{ ...mergedStyles.root, ...filledProps.style }}\n // Icon\n suffixIcon={suffixIcon}\n onClear={onSelectorClear}\n // Invalid\n invalid={submitInvalidate}\n onOpenChange={triggerOpen}\n // Click\n onClick={onSelectorClick}\n />\n </PickerPopup>\n </PickerContext>\n );\n}\n\nconst RefPicker = React.forwardRef(Picker) as <DateType extends object = any>(\n props: PickerProps<DateType> & React.RefAttributes<PickerRef>,\n) => React.ReactElement;\n\nif (process.env.NODE_ENV !== 'production') {\n (RefPicker as any).displayName = 'RefPicker';\n}\n\nexport default RefPicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiIA,SAAS,OACP,OACA,KACA;CAEA,MAAM,CAAC,aAAa,gBAAgB,eAAe,YAAY,YAAY,oBACzE,eAAe,KAAK;CAEtB,MAAM,EAEJ,WACA,eACA,QAAQ,YACR,YAAY,gBAEZ,cAGA,OACA,cACA,OACA,aACA,UACA,SACA,WAGA,UACA,cACA,SACA,SAGA,aACA,MACA,cAGA,QACA,gBACA,QACA,SACA,WACA,UAGA,MACA,eACA,kBACA,MACA,UAGA,oBACA,aACA,qBAGA,eAEA,YACA,YACA,WAGA,SACA,QAGA,SAGA,YACA,YACA,YACA,iBAGA,YACE;CAIJ,MAAM,cAAc,aAAa,GAAG;CACpC,MAAM,WAAW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O;KAAE,GAAG,aAAa;KAAM,GAAG,YAAY;IAAM;IAExC;IACZ,SAAS;IAET,SAAS;IACT,cAAc;IAEd,SAAS;GACV,CAAA;EACU,CAAA;CACA,CAAA;AAEnB;AAEA,MAAM,YAAY,MAAM,WAAW,MAAM;AAIzC,IAAI,QAAQ,IAAI,aAAa,cAC3B,UAAmB,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
// src/DatePicker/core/PickerInput/context.tsx
|
|
3
|
-
const PickerContext = React
|
|
3
|
+
const PickerContext = React.createContext(null);
|
|
4
4
|
export { PickerContext as default };
|
|
5
5
|
|
|
6
6
|
//# sourceMappingURL=context.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../../src/DatePicker/core/PickerInput/context.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { GenerateConfig } from '../generate';\nimport type { FilledClassNames, FilledStyles } from '../hooks/useSemantic';\nimport type { Components, Locale } from '../interface';\n\nexport interface PickerContextProps<DateType = any> {\n /** Customize button component */\n button?: Components['button'];\n classNames: FilledClassNames;\n generateConfig: GenerateConfig<DateType>;\n input?: Components['input'];\n locale: Locale;\n prefixCls: string;\n styles: FilledStyles;\n}\n\nconst PickerContext = React.createContext<PickerContextProps>(null!);\n\nexport default PickerContext;\n"],"mappings":";;AAiBA,MAAM,gBAAgB,MAAM,cAAkC,IAAK"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { warning } from "../../utils/common.mjs";
|
|
2
|
-
import * as React
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
// src/DatePicker/core/PickerInput/hooks/useCellRender.ts
|
|
4
4
|
function useCellRender(cellRender, dateRender, monthCellRender, range) {
|
|
5
5
|
if (process.env.NODE_ENV !== "production") {
|
|
6
6
|
warning(!dateRender, `'dateRender' is deprecated. Please use 'cellRender' instead.`);
|
|
7
7
|
warning(!monthCellRender, `'monthCellRender' is deprecated. Please use 'cellRender' instead.`);
|
|
8
8
|
}
|
|
9
|
-
const mergedCellRender = React
|
|
9
|
+
const mergedCellRender = React.useMemo(() => {
|
|
10
10
|
if (cellRender) return cellRender;
|
|
11
11
|
return (current, info) => {
|
|
12
12
|
const date = current;
|
|
@@ -19,7 +19,7 @@ function useCellRender(cellRender, dateRender, monthCellRender, range) {
|
|
|
19
19
|
monthCellRender,
|
|
20
20
|
dateRender
|
|
21
21
|
]);
|
|
22
|
-
return React
|
|
22
|
+
return React.useCallback((date, info) => mergedCellRender(date, {
|
|
23
23
|
...info,
|
|
24
24
|
range
|
|
25
25
|
}), [mergedCellRender, range]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCellRender.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useCellRender.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useCellRender.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { CellRender, CellRenderInfo, SharedPickerProps } from '../../interface';\nimport { warning } from '../../utils/common';\n\nexport default function useCellRender<DateType extends object = any>(\n cellRender: SharedPickerProps<DateType>['cellRender'],\n dateRender?: SharedPickerProps<DateType>['dateRender'],\n monthCellRender?: SharedPickerProps<DateType>['monthCellRender'],\n range?: CellRenderInfo<DateType>['range'],\n) {\n // ========================= Warn =========================\n if (process.env.NODE_ENV !== 'production') {\n warning(!dateRender, `'dateRender' is deprecated. Please use 'cellRender' instead.`);\n warning(!monthCellRender, `'monthCellRender' is deprecated. Please use 'cellRender' instead.`);\n }\n\n // ======================== Render ========================\n // Merged render\n const mergedCellRender = React.useMemo(() => {\n if (cellRender) {\n return cellRender;\n }\n\n return (current: DateType | number | string, info: CellRenderInfo<DateType>) => {\n const date = current as DateType;\n\n if (dateRender && info.type === 'date') {\n return dateRender(date, info.today);\n }\n if (monthCellRender && info.type === 'month') {\n return monthCellRender(date, info.locale!);\n }\n return info.originNode;\n };\n }, [cellRender, monthCellRender, dateRender]);\n\n // Cell render\n const onInternalCellRender: CellRender<DateType> = React.useCallback(\n (date, info) => mergedCellRender(date, { ...info, range }),\n [mergedCellRender, range],\n );\n\n return onInternalCellRender;\n}\n"],"mappings":";;;AAKA,SAAwB,cACtB,YACA,YACA,iBACA,OACA;CAEA,IAAI,QAAQ,IAAI,aAAa,cAAc;EACzC,QAAQ,CAAC,YAAY,8DAA8D;EACnF,QAAQ,CAAC,iBAAiB,mEAAmE;CAC/F;CAIA,MAAM,mBAAmB,MAAM,cAAc;EAC3C,IAAI,YACF,OAAO;EAGT,QAAQ,SAAqC,SAAmC;GAC9E,MAAM,OAAO;GAEb,IAAI,cAAc,KAAK,SAAS,QAC9B,OAAO,WAAW,MAAM,KAAK,KAAK;GAEpC,IAAI,mBAAmB,KAAK,SAAS,SACnC,OAAO,gBAAgB,MAAM,KAAK,MAAO;GAE3C,OAAO,KAAK;EACd;CACF,GAAG;EAAC;EAAY;EAAiB;CAAU,CAAC;CAQ5C,OALmD,MAAM,aACtD,MAAM,SAAS,iBAAiB,MAAM;EAAE,GAAG;EAAM;CAAM,CAAC,GACzD,CAAC,kBAAkB,KAAK,CAGA;AAC5B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getRowFormat, toArray } from "../../utils/miscUtil.mjs";
|
|
2
|
-
import * as React
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
// src/DatePicker/core/PickerInput/hooks/useFieldFormat.ts
|
|
4
4
|
function useFieldFormat(picker, locale, format) {
|
|
5
|
-
return React
|
|
5
|
+
return React.useMemo(() => {
|
|
6
6
|
const rawFormat = getRowFormat(picker, locale, format);
|
|
7
7
|
const formatList = toArray(rawFormat);
|
|
8
8
|
const firstFormat = formatList[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldFormat.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useFieldFormat.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useFieldFormat.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { FormatType, InternalMode, Locale, SharedPickerProps } from '../../interface';\nimport { getRowFormat, toArray } from '../../utils/miscUtil';\n\nexport function useFieldFormat<DateType = any>(\n picker: InternalMode,\n locale: Locale,\n format?: SharedPickerProps['format'],\n): [formatList: FormatType<DateType>[], maskFormat?: string | null] {\n return React.useMemo(() => {\n const rawFormat = getRowFormat(picker, locale, format);\n\n const formatList = toArray(rawFormat);\n\n const firstFormat = formatList[0];\n const maskFormat =\n typeof firstFormat === 'object' && firstFormat.type === 'mask' ? firstFormat.format : null;\n\n return [\n // Format list\n formatList.map((config) =>\n typeof config === 'string' || typeof config === 'function' ? config : config.format,\n ),\n // Mask Format\n maskFormat,\n ];\n }, [picker, locale, format]);\n}\n"],"mappings":";;;AAKA,SAAgB,eACd,QACA,QACA,QACkE;CAClE,OAAO,MAAM,cAAc;EACzB,MAAM,YAAY,aAAa,QAAQ,QAAQ,MAAM;EAErD,MAAM,aAAa,QAAQ,SAAS;EAEpC,MAAM,cAAc,WAAW;EAC/B,MAAM,aACJ,OAAO,gBAAgB,YAAY,YAAY,SAAS,SAAS,YAAY,SAAS;EAExF,OAAO,CAEL,WAAW,KAAK,WACd,OAAO,WAAW,YAAY,OAAO,WAAW,aAAa,SAAS,OAAO,MAC/E,GAEA,UACF;CACF,GAAG;EAAC;EAAQ;EAAQ;CAAM,CAAC;AAC7B"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { fillIndex } from "../../utils/miscUtil.mjs";
|
|
2
|
-
import * as React
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
// src/DatePicker/core/PickerInput/hooks/useFieldsInvalidate.ts
|
|
4
4
|
/**
|
|
5
5
|
* Used to control each fields invalidate status
|
|
6
6
|
*/
|
|
7
7
|
function useFieldsInvalidate(calendarValue, isInvalidateDate, allowEmpty = []) {
|
|
8
|
-
const [fieldsInvalidates, setFieldsInvalidates] = React
|
|
8
|
+
const [fieldsInvalidates, setFieldsInvalidates] = React.useState([false, false]);
|
|
9
9
|
const onSelectorInvalid = (invalid, index) => {
|
|
10
10
|
setFieldsInvalidates((ori) => fillIndex(ori, index, invalid));
|
|
11
11
|
};
|
|
12
|
-
return [React
|
|
12
|
+
return [React.useMemo(() => {
|
|
13
13
|
return fieldsInvalidates.map((invalid, index) => {
|
|
14
14
|
if (invalid) return true;
|
|
15
15
|
const current = calendarValue[index];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldsInvalidate.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useFieldsInvalidate.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useFieldsInvalidate.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { NullableDateType } from '../../interface';\nimport { fillIndex } from '../../utils/miscUtil';\nimport type useInvalidate from './useInvalidate';\n\n/**\n * Used to control each fields invalidate status\n */\nexport default function useFieldsInvalidate<\n DateType extends object,\n ValueType extends NullableDateType<DateType>[],\n>(\n calendarValue: ValueType,\n isInvalidateDate: ReturnType<typeof useInvalidate<DateType>>,\n allowEmpty: boolean[] = [],\n) {\n const [fieldsInvalidates, setFieldsInvalidates] = React.useState<[boolean, boolean]>([\n false,\n false,\n ]);\n\n const onSelectorInvalid = (invalid: boolean, index?: number) => {\n setFieldsInvalidates((ori) => fillIndex(ori, index!, invalid));\n };\n\n /**\n * For the Selector Input to mark as `aria-disabled`\n */\n const submitInvalidates = React.useMemo(() => {\n return fieldsInvalidates.map((invalid, index) => {\n // If typing invalidate\n if (invalid) {\n return true;\n }\n\n const current = calendarValue[index];\n\n // Not check if all empty\n if (!current) {\n return false;\n }\n\n // Not allow empty\n if (!allowEmpty[index] && !current) {\n return true;\n }\n\n // Invalidate\n if (current && isInvalidateDate(current, { activeIndex: index })) {\n return true;\n }\n\n return false;\n }) as [boolean, boolean];\n }, [calendarValue, fieldsInvalidates, isInvalidateDate, allowEmpty]);\n\n return [submitInvalidates, onSelectorInvalid] as const;\n}\n"],"mappings":";;;;;;AASA,SAAwB,oBAItB,eACA,kBACA,aAAwB,CAAC,GACzB;CACA,MAAM,CAAC,mBAAmB,wBAAwB,MAAM,SAA6B,CACnF,OACA,KACF,CAAC;CAED,MAAM,qBAAqB,SAAkB,UAAmB;EAC9D,sBAAsB,QAAQ,UAAU,KAAK,OAAQ,OAAO,CAAC;CAC/D;CAiCA,OAAO,CA5BmB,MAAM,cAAc;EAC5C,OAAO,kBAAkB,KAAK,SAAS,UAAU;GAE/C,IAAI,SACF,OAAO;GAGT,MAAM,UAAU,cAAc;GAG9B,IAAI,CAAC,SACH,OAAO;GAIT,IAAI,CAAC,WAAW,UAAU,CAAC,SACzB,OAAO;GAIT,IAAI,WAAW,iBAAiB,SAAS,EAAE,aAAa,MAAM,CAAC,GAC7D,OAAO;GAGT,OAAO;EACT,CAAC;CACH,GAAG;EAAC;EAAe;EAAmB;EAAkB;CAAU,CAE1C,GAAG,iBAAiB;AAC9C"}
|
|
@@ -7,10 +7,10 @@ import useDisabledBoundary from "./useDisabledBoundary.mjs";
|
|
|
7
7
|
import { useFieldFormat } from "./useFieldFormat.mjs";
|
|
8
8
|
import useInputReadOnly from "./useInputReadOnly.mjs";
|
|
9
9
|
import useInvalidate from "./useInvalidate.mjs";
|
|
10
|
-
import * as React
|
|
10
|
+
import * as React from "react";
|
|
11
11
|
// src/DatePicker/core/PickerInput/hooks/useFilledProps.ts
|
|
12
12
|
function useList(value, fillMode = false) {
|
|
13
|
-
return React
|
|
13
|
+
return React.useMemo(() => {
|
|
14
14
|
const list = value ? toArray(value) : value;
|
|
15
15
|
if (fillMode && list) list[1] = list[1] || list[0];
|
|
16
16
|
return list;
|
|
@@ -36,7 +36,7 @@ function useFilledProps(props, updater) {
|
|
|
36
36
|
const mergedNeedConfirm = needConfirm ?? multipleInteractivePicker;
|
|
37
37
|
const [timeProps, localeTimeProps, showTimeFormat, propFormat] = getTimeProps(props);
|
|
38
38
|
const mergedLocale = useLocale(locale, localeTimeProps);
|
|
39
|
-
const mergedShowTime = React
|
|
39
|
+
const mergedShowTime = React.useMemo(() => fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale), [
|
|
40
40
|
internalPicker,
|
|
41
41
|
showTimeFormat,
|
|
42
42
|
propFormat,
|
|
@@ -48,7 +48,7 @@ function useFilledProps(props, updater) {
|
|
|
48
48
|
"disabledMinutes",
|
|
49
49
|
"disabledSeconds"
|
|
50
50
|
].some((key) => props[key])) warning(false, `'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.`);
|
|
51
|
-
const filledProps = React
|
|
51
|
+
const filledProps = React.useMemo(() => ({
|
|
52
52
|
...props,
|
|
53
53
|
previewValue,
|
|
54
54
|
prefixCls,
|
|
@@ -74,7 +74,7 @@ function useFilledProps(props, updater) {
|
|
|
74
74
|
const disabledBoundaryDate = useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate);
|
|
75
75
|
const isInvalidateDate = useInvalidate(generateConfig, picker, disabledBoundaryDate, mergedShowTime);
|
|
76
76
|
return [
|
|
77
|
-
React
|
|
77
|
+
React.useMemo(() => ({
|
|
78
78
|
...filledProps,
|
|
79
79
|
needConfirm: mergedNeedConfirm,
|
|
80
80
|
inputReadOnly: mergedInputReadOnly,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFilledProps.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useFilledProps.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useFilledProps.ts"],"sourcesContent":["import * as React from 'react';\n\nimport useLocale from '../../hooks/useLocale';\nimport { fillShowTimeConfig, getTimeProps } from '../../hooks/useTimeConfig';\nimport type {\n Components,\n DisabledDate,\n FormatType,\n InternalMode,\n PickerMode,\n} from '../../interface';\nimport { warning } from '../../utils/common';\nimport { toArray } from '../../utils/miscUtil';\nimport type { RangePickerProps } from '../RangePicker';\nimport { fillClearIcon } from '../Selector/hooks/useClearIcon';\nimport useDisabledBoundary from './useDisabledBoundary';\nimport { useFieldFormat } from './useFieldFormat';\nimport useInputReadOnly from './useInputReadOnly';\nimport useInvalidate from './useInvalidate';\n\ntype UseInvalidate<DateType extends object = any> = typeof useInvalidate<DateType>;\n\ntype PickedProps<DateType extends object = any> = Pick<\n RangePickerProps<DateType>,\n | 'generateConfig'\n | 'locale'\n | 'picker'\n | 'prefixCls'\n | 'styles'\n | 'classNames'\n | 'order'\n | 'components'\n | 'inputRender'\n | 'clearIcon'\n | 'allowClear'\n | 'needConfirm'\n | 'format'\n | 'inputReadOnly'\n | 'disabledDate'\n | 'minDate'\n | 'maxDate'\n | 'defaultOpenValue'\n | 'previewValue'\n> & {\n multiple?: boolean;\n // RangePicker showTime definition is different with Picker\n showTime?: any;\n value?: any;\n defaultValue?: any;\n pickerValue?: any;\n defaultPickerValue?: any;\n};\n\ntype ExcludeBooleanType<T> = T extends boolean ? never : T;\n\ntype GetGeneric<T> = T extends PickedProps<infer U> ? U : never;\n\ntype ToArrayType<T, DateType> = T extends any[] ? T : DateType[];\n\ntype ToArrayValueType<T, DateType> = ToArrayType<NonNullable<T>, DateType>;\n\nfunction useList<T>(value: T | T[], fillMode = false) {\n const values = React.useMemo(() => {\n const list = value ? toArray(value) : (value as null | undefined);\n\n if (fillMode && list) {\n list[1] = list[1] || list[0];\n }\n\n return list;\n }, [value, fillMode]);\n return values;\n}\n\n/**\n * Align the outer props with unique typed and fill undefined props.\n * This is shared with both RangePicker and Picker. This will do:\n * - Convert `value` & `defaultValue` to array\n * - handle the legacy props fill like `clearIcon` + `allowClear` = `clearIcon`\n */\nexport default function useFilledProps<\n InProps extends PickedProps,\n DateType extends GetGeneric<InProps>,\n UpdaterProps extends object,\n>(\n props: InProps,\n updater?: () => UpdaterProps,\n): [\n filledProps: Omit<\n InProps,\n | keyof UpdaterProps\n | 'showTime'\n | 'value'\n | 'defaultValue'\n | 'pickerValue'\n | 'defaultPickerValue'\n > &\n UpdaterProps & {\n picker: PickerMode;\n prefixCls: string;\n order: boolean;\n needConfirm: boolean;\n disabledDate: DisabledDate<DateType>;\n components: Components<DateType>;\n showTime?: ExcludeBooleanType<InProps['showTime']>;\n value?: ToArrayValueType<InProps['value'], DateType>;\n defaultValue?: ToArrayValueType<InProps['value'], DateType>;\n pickerValue?: ToArrayValueType<InProps['pickerValue'], DateType>;\n defaultPickerValue?: ToArrayValueType<InProps['defaultPickerValue'], DateType>;\n },\n internalPicker: InternalMode,\n complexPicker: boolean,\n formatList: FormatType<DateType>[],\n maskFormat: string | null | undefined,\n isInvalidateDate: ReturnType<UseInvalidate<DateType>>,\n] {\n const {\n generateConfig,\n locale,\n picker = 'date',\n prefixCls = 'rc-picker',\n previewValue = 'hover',\n styles = {},\n classNames = {},\n order = true,\n components = {},\n inputRender,\n allowClear,\n clearIcon,\n needConfirm,\n multiple,\n format,\n inputReadOnly,\n disabledDate,\n minDate,\n maxDate,\n showTime,\n\n value,\n defaultValue,\n pickerValue,\n defaultPickerValue,\n } = props;\n\n const values = useList(value);\n const defaultValues = useList(defaultValue);\n const pickerValues = useList(pickerValue);\n const defaultPickerValues = useList(defaultPickerValue);\n\n // ======================== Picker ========================\n /** Almost same as `picker`, but add `datetime` for `date` with `showTime` */\n const internalPicker: InternalMode = picker === 'date' && showTime ? 'datetime' : picker;\n\n /** The picker is `datetime` or `time` */\n const multipleInteractivePicker = internalPicker === 'time' || internalPicker === 'datetime';\n const complexPicker = multipleInteractivePicker || !!multiple;\n const mergedNeedConfirm = needConfirm ?? multipleInteractivePicker;\n\n // ========================== Time ==========================\n // Auto `format` need to check `showTime.showXXX` first.\n // And then merge the `locale` into `mergedShowTime`.\n const [timeProps, localeTimeProps, showTimeFormat, propFormat] = getTimeProps(props);\n\n // ======================= Locales ========================\n const mergedLocale = useLocale(locale, localeTimeProps);\n\n const mergedShowTime = React.useMemo(\n () => fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale),\n [internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale],\n );\n\n // ======================= Warning ========================\n if (\n process.env.NODE_ENV !== 'production' &&\n picker === 'time' &&\n ['disabledHours', 'disabledMinutes', 'disabledSeconds'].some((key) => (props as any)[key])\n ) {\n warning(\n false,\n `'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.`,\n );\n }\n\n // ======================== Props =========================\n const filledProps = React.useMemo(\n () => ({\n ...props,\n previewValue,\n prefixCls,\n locale: mergedLocale,\n picker,\n styles,\n classNames,\n order,\n components: { input: inputRender, ...components },\n clearIcon: fillClearIcon(prefixCls, allowClear, clearIcon),\n showTime: mergedShowTime,\n value: values,\n defaultValue: defaultValues,\n pickerValue: pickerValues,\n defaultPickerValue: defaultPickerValues,\n ...(updater?.() as UpdaterProps),\n }),\n [props],\n );\n\n // ======================== Format ========================\n const [formatList, maskFormat] = useFieldFormat<DateType>(internalPicker, mergedLocale, format);\n\n // ======================= ReadOnly =======================\n const mergedInputReadOnly = useInputReadOnly(formatList, inputReadOnly, multiple);\n\n // ======================= Boundary =======================\n const disabledBoundaryDate = useDisabledBoundary(\n generateConfig,\n locale,\n disabledDate,\n minDate,\n maxDate,\n );\n\n // ====================== Invalidate ======================\n const isInvalidateDate = useInvalidate(\n generateConfig,\n picker,\n disabledBoundaryDate,\n mergedShowTime,\n );\n\n // ======================== Merged ========================\n const mergedProps = React.useMemo(\n () => ({\n ...filledProps,\n needConfirm: mergedNeedConfirm,\n inputReadOnly: mergedInputReadOnly,\n disabledDate: disabledBoundaryDate,\n }),\n [filledProps, mergedNeedConfirm, mergedInputReadOnly, disabledBoundaryDate],\n );\n\n return [mergedProps, internalPicker, complexPicker, formatList, maskFormat, isInvalidateDate];\n}\n"],"mappings":";;;;;;;;;;;AA6DA,SAAS,QAAW,OAAgB,WAAW,OAAO;CAUpD,OATe,MAAM,cAAc;EACjC,MAAM,OAAO,QAAQ,QAAQ,KAAK,IAAK;EAEvC,IAAI,Y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,CAAC,KAAK,CACR;CAGA,MAAM,CAAC,YAAY,cAAc,eAAyB,gBAAgB,cAAc,MAAM;CAG9F,MAAM,sBAAsB,iBAAiB,YAAY,eAAe,QAAQ;CAGhF,MAAM,uBAAuB,oBAC3B,gBACA,QACA,cACA,SACA,OACF;CAGA,MAAM,mBAAmB,cACvB,gBACA,QACA,sBACA,cACF;CAaA,OAAO;EAVa,MAAM,eACjB;GACL,GAAG;GACH,aAAa;GACb,eAAe;GACf,cAAc;EAChB,IACA;GAAC;GAAa;GAAmB;GAAqB;EAAoB,CAG1D;EAAG;EAAgB;EAAe;EAAY;EAAY;CAAgB;AAC9F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEvent } from "../../hooks/react.mjs";
|
|
2
|
-
import * as React
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
// src/DatePicker/core/PickerInput/hooks/useFocusEvents.ts
|
|
4
4
|
/** Check whether the target belongs to any container. / 判断目标是否属于任意一个容器。 */
|
|
5
5
|
function isTargetInContainers(target, containers) {
|
|
@@ -16,7 +16,7 @@ function isTargetInContainers(target, containers) {
|
|
|
16
16
|
* 获得焦点的控件变为禁用时,跳过 Picker 的整体失焦逻辑。
|
|
17
17
|
*/
|
|
18
18
|
function useFocusEvents(isInternalElement, onFocus, onBlur, onConfirmedBlur) {
|
|
19
|
-
const [focusedIndex, setFocusedIndex] = React
|
|
19
|
+
const [focusedIndex, setFocusedIndex] = React.useState(null);
|
|
20
20
|
const onFieldFocus = useEvent((index, _source, event) => {
|
|
21
21
|
setFocusedIndex(index);
|
|
22
22
|
onFocus?.(index, event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusEvents.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useFocusEvents.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useFocusEvents.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useEvent } from '../../hooks/react';\n\n// ============================= Types =============================\n/** Focus event source. / 焦点事件来源。 */\nexport type FocusSource = 'input' | 'panel';\n\n/** React focus event used by Picker elements. / Picker 元素使用的 React 焦点事件。 */\nexport type PickerFocusEvent = React.FocusEvent<HTMLElement>;\n\n/** Focus event handler. / 聚焦事件处理函数。 */\nexport type FieldFocusHandler = (\n index: number,\n source: FocusSource,\n event: PickerFocusEvent,\n) => void;\n\n/** Blur event handler. / 失焦事件处理函数。 */\nexport type FieldBlurHandler = (\n index: number,\n source: FocusSource,\n event: PickerFocusEvent,\n) => void;\n\n/** Check whether an element belongs to the current focus scope. / 检查元素是否属于当前焦点范围。 */\nexport type IsInternalElement = (element: EventTarget | null) => boolean;\n\n/** Notify a Picker focus or blur event. / 通知 Picker 的聚焦或失焦事件。 */\nexport type FocusEventHandler = (index: number, event: PickerFocusEvent) => void;\n\nexport type UseFocusEventsReturn = [\n focused: boolean,\n onFieldFocus: FieldFocusHandler,\n onFieldBlur: FieldBlurHandler,\n];\n\n// ============================= Utils =============================\n/** Check whether the target belongs to any container. / 判断目标是否属于任意一个容器。 */\nexport function isTargetInContainers(\n target: EventTarget | null,\n containers: readonly (Element | null | undefined)[],\n) {\n return containers.some(\n (container) => !!container && (container === target || container.contains(target as Node)),\n );\n}\n\n/**\n * Handle field focus and blur events.\n * 处理 field 的聚焦与失焦事件。\n *\n * Always forward the actual element focus events. Only the internal Picker\n * blur is skipped when `relatedTarget` still belongs to the Picker or the\n * focused panel control becomes disabled.\n * 始终转发元素实际发生的焦点事件。当 `relatedTarget` 仍属于 Picker,或面板中\n * 获得焦点的控件变为禁用时,跳过 Picker 的整体失焦逻辑。\n */\nexport default function useFocusEvents(\n isInternalElement: IsInternalElement,\n onFocus?: FocusEventHandler,\n onBlur?: FocusEventHandler,\n onConfirmedBlur?: FocusEventHandler,\n): UseFocusEventsReturn {\n // Keep the actual focused field so every field focus causes a render. This\n // gives `useFocusLock` a commit in which it can correct an invalid switch.\n // 记录实际获得焦点的 field,使每次 field focus 都会触发渲染;\n // `useFocusLock` 因此可以在 commit 后纠正不允许的切换。\n const [focusedIndex, setFocusedIndex] = React.useState<number | null>(null);\n\n const onFieldFocus = useEvent((index: number, _source: FocusSource, event: PickerFocusEvent) => {\n setFocusedIndex(index);\n onFocus?.(index, event);\n });\n\n const onFieldBlur = useEvent((index: number, source: FocusSource, event: PickerFocusEvent) => {\n const isDisabledTarget = source === 'panel' && event.target.hasAttribute('disabled');\n\n if (isDisabledTarget) {\n event.currentTarget.focus({ preventScroll: true });\n } else if (!isInternalElement(event.relatedTarget)) {\n setFocusedIndex(null);\n onConfirmedBlur?.(index, event);\n }\n\n onBlur?.(index, event);\n });\n\n return [focusedIndex !== null, onFieldFocus, onFieldBlur];\n}\n"],"mappings":";;;;AAuCA,SAAgB,qBACd,QACA,YACA;CACA,OAAO,WAAW,MACf,cAAc,CAAC,CAAC,cAAc,cAAc,UAAU,UAAU,SAAS,MAAc,EAC1F;AACF;;;;;;;;;;;AAYA,SAAwB,eACtB,mBACA,SACA,QACA,iBACsB;CAKtB,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAwB,IAAI;CAE1E,MAAM,eAAe,UAAU,OAAe,SAAsB,UAA4B;EAC9F,gBAAgB,KAAK;EACrB,UAAU,OAAO,KAAK;CACxB,CAAC;CAED,MAAM,cAAc,UAAU,OAAe,QAAqB,UAA4B;EAG5F,IAFyB,WAAW,WAAW,MAAM,OAAO,aAAa,UAAU,GAGjF,MAAM,cAAc,MAAM,EAAE,eAAe,KAAK,CAAC;OAC5C,IAAI,CAAC,kBAAkB,MAAM,aAAa,GAAG;GAClD,gBAAgB,IAAI;GACpB,kBAAkB,OAAO,KAAK;EAChC;EAEA,SAAS,OAAO,KAAK;CACvB,CAAC;CAED,OAAO;EAAC,iBAAiB;EAAM;EAAc;CAAW;AAC1D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEvent, useLayoutEffect as useLayoutEffect$1 } from "../../hooks/react.mjs";
|
|
2
2
|
import { isTargetInContainers } from "./useFocusEvents.mjs";
|
|
3
|
-
import * as React
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
// src/DatePicker/core/PickerInput/hooks/useFocusLock.ts
|
|
5
5
|
/**
|
|
6
6
|
* Keep focus on the specified input field while focus moves inside the Picker.
|
|
@@ -10,7 +10,7 @@ function useFocusLock(index, forceFocus, selectorRef, popupRef, triggerOpen) {
|
|
|
10
10
|
const openPicker = useEvent(() => {
|
|
11
11
|
triggerOpen(true);
|
|
12
12
|
});
|
|
13
|
-
React
|
|
13
|
+
React.useEffect(() => {
|
|
14
14
|
if (index !== null && forceFocus) {
|
|
15
15
|
openPicker();
|
|
16
16
|
selectorRef.current?.focus(index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusLock.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useFocusLock.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useEvent, useLayoutEffect } from '../../hooks/react';\nimport { isTargetInContainers } from './useFocusEvents';\n\ninterface FocusLockSelectorRef {\n endInput: HTMLElement;\n focus: (index?: number) => void;\n startInput: HTMLElement;\n}\n\n/**\n * Keep focus on the specified input field while focus moves inside the Picker.\n * 当焦点在 Picker 内移动时,将其锁定在指定的输入框上。\n */\nexport default function useFocusLock(\n index: number | null,\n forceFocus: boolean,\n selectorRef: React.RefObject<FocusLockSelectorRef | null>,\n popupRef: React.RefObject<HTMLElement | null>,\n triggerOpen: (open: boolean) => void,\n) {\n const openPicker = useEvent(() => {\n triggerOpen(true);\n });\n\n // Only a strong transition actively opens the Picker and moves DOM focus.\n // Weak transitions keep the expected index without stealing external focus.\n // 仅强切换会主动打开 Picker 并移动 DOM 焦点;弱切换只保留预期 index,\n // 不抢占外部元素的焦点。\n React.useEffect(() => {\n if (index !== null && forceFocus) {\n openPicker();\n selectorRef.current?.focus(index);\n }\n }, [index, forceFocus, openPicker]);\n\n // DOM focus may change while `index` stays the same, so check after every commit.\n // DOM 焦点变化时 `index` 可能保持不变,因此每次 commit 后都需要检查。\n useLayoutEffect(() => {\n if (index === null) {\n return;\n }\n\n const inputFields = [selectorRef.current?.startInput, selectorRef.current?.endInput];\n const inputRoot = inputFields[index]?.getRootNode() as Document | ShadowRoot | undefined;\n\n // `document.activeElement` stops at the shadow host. Read from the input's\n // own root first so focus locking can identify the actual field.\n // `document.activeElement` 在 Shadow DOM 中只会返回 host。优先读取 input\n // 所属 root,才能识别实际聚焦的 field。\n const activeElement = inputRoot?.activeElement ?? document.activeElement;\n\n if (isTargetInContainers(activeElement, [popupRef.current])) {\n return;\n }\n\n const focusInOtherField = inputFields.some(\n (field, fieldIndex) => fieldIndex !== index && isTargetInContainers(activeElement, [field]),\n );\n\n if (focusInOtherField) {\n inputFields[index]?.focus();\n }\n });\n}\n"],"mappings":";;;;;;;;AAeA,SAAwB,aACtB,OACA,YACA,aACA,UACA,aACA;CACA,MAAM,aAAa,eAAe;EAChC,YAAY,IAAI;CAClB,CAAC;CAMD,
|
|
1
|
+
{"version":3,"file":"useFocusLock.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useFocusLock.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useEvent, useLayoutEffect } from '../../hooks/react';\nimport { isTargetInContainers } from './useFocusEvents';\n\ninterface FocusLockSelectorRef {\n endInput: HTMLElement;\n focus: (index?: number) => void;\n startInput: HTMLElement;\n}\n\n/**\n * Keep focus on the specified input field while focus moves inside the Picker.\n * 当焦点在 Picker 内移动时,将其锁定在指定的输入框上。\n */\nexport default function useFocusLock(\n index: number | null,\n forceFocus: boolean,\n selectorRef: React.RefObject<FocusLockSelectorRef | null>,\n popupRef: React.RefObject<HTMLElement | null>,\n triggerOpen: (open: boolean) => void,\n) {\n const openPicker = useEvent(() => {\n triggerOpen(true);\n });\n\n // Only a strong transition actively opens the Picker and moves DOM focus.\n // Weak transitions keep the expected index without stealing external focus.\n // 仅强切换会主动打开 Picker 并移动 DOM 焦点;弱切换只保留预期 index,\n // 不抢占外部元素的焦点。\n React.useEffect(() => {\n if (index !== null && forceFocus) {\n openPicker();\n selectorRef.current?.focus(index);\n }\n }, [index, forceFocus, openPicker]);\n\n // DOM focus may change while `index` stays the same, so check after every commit.\n // DOM 焦点变化时 `index` 可能保持不变,因此每次 commit 后都需要检查。\n useLayoutEffect(() => {\n if (index === null) {\n return;\n }\n\n const inputFields = [selectorRef.current?.startInput, selectorRef.current?.endInput];\n const inputRoot = inputFields[index]?.getRootNode() as Document | ShadowRoot | undefined;\n\n // `document.activeElement` stops at the shadow host. Read from the input's\n // own root first so focus locking can identify the actual field.\n // `document.activeElement` 在 Shadow DOM 中只会返回 host。优先读取 input\n // 所属 root,才能识别实际聚焦的 field。\n const activeElement = inputRoot?.activeElement ?? document.activeElement;\n\n if (isTargetInContainers(activeElement, [popupRef.current])) {\n return;\n }\n\n const focusInOtherField = inputFields.some(\n (field, fieldIndex) => fieldIndex !== index && isTargetInContainers(activeElement, [field]),\n );\n\n if (focusInOtherField) {\n inputFields[index]?.focus();\n }\n });\n}\n"],"mappings":";;;;;;;;AAeA,SAAwB,aACtB,OACA,YACA,aACA,UACA,aACA;CACA,MAAM,aAAa,eAAe;EAChC,YAAY,IAAI;CAClB,CAAC;CAMD,MAAM,gBAAgB;EACpB,IAAI,UAAU,QAAQ,YAAY;GAChC,WAAW;GACX,YAAY,SAAS,MAAM,KAAK;EAClC;CACF,GAAG;EAAC;EAAO;EAAY;CAAU,CAAC;CAIlC,wBAAsB;EACpB,IAAI,UAAU,MACZ;EAGF,MAAM,cAAc,CAAC,YAAY,SAAS,YAAY,YAAY,SAAS,QAAQ;EAOnF,MAAM,iBANY,YAAY,MAAM,EAAE,YAAY,EAAA,EAMjB,iBAAiB,SAAS;EAE3D,IAAI,qBAAqB,eAAe,CAAC,SAAS,OAAO,CAAC,GACxD;EAOF,IAJ0B,YAAY,MACnC,OAAO,eAAe,eAAe,SAAS,qBAAqB,eAAe,CAAC,KAAK,CAAC,CAGxE,GAClB,YAAY,MAAM,EAAE,MAAM;CAE9B,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
// src/DatePicker/core/PickerInput/hooks/useHoverStore.ts
|
|
3
3
|
const createHoverStore = () => {
|
|
4
4
|
let snapshot = {
|
|
@@ -25,10 +25,10 @@ const createHoverStore = () => {
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
function useHoverStore() {
|
|
28
|
-
const [store] = React
|
|
28
|
+
const [store] = React.useState(createHoverStore);
|
|
29
29
|
return store;
|
|
30
30
|
}
|
|
31
|
-
const useHoverSnapshot = (store) => React
|
|
31
|
+
const useHoverSnapshot = (store) => React.useSyncExternalStore(store.subscribe, store.get, store.get);
|
|
32
32
|
export { useHoverStore as default, useHoverSnapshot };
|
|
33
33
|
|
|
34
34
|
//# sourceMappingURL=useHoverStore.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverStore.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useHoverStore.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useHoverStore.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type HoverSource = 'cell' | 'preset';\n\nexport interface HoverSnapshot<DateType> {\n source: HoverSource | null;\n value: DateType | null;\n}\n\nexport interface HoverStore<DateType> {\n get: () => HoverSnapshot<DateType>;\n set: (value: DateType | null, source: HoverSource | null) => void;\n subscribe: (listener: () => void) => () => void;\n}\n\nconst createHoverStore = <DateType>(): HoverStore<DateType> => {\n let snapshot: HoverSnapshot<DateType> = { source: null, value: null };\n const listeners = new Set<() => void>();\n return {\n get: () => snapshot,\n set: (value, source) => {\n if (snapshot.value === value && snapshot.source === source) return;\n snapshot = { source, value };\n for (const listener of listeners) listener();\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n};\n\nexport default function useHoverStore<DateType>() {\n const [store] = React.useState(createHoverStore<DateType>);\n return store;\n}\n\nexport const useHoverSnapshot = <DateType>(store: HoverStore<DateType>) =>\n React.useSyncExternalStore(store.subscribe, store.get, store.get);\n"],"mappings":";;AAeA,MAAM,yBAAyD;CAC7D,IAAI,WAAoC;EAAE,QAAQ;EAAM,OAAO;CAAK;CACpE,MAAM,4BAAY,IAAI,IAAgB;CACtC,OAAO;EACL,WAAW;EACX,MAAM,OAAO,WAAW;GACtB,IAAI,SAAS,UAAU,SAAS,SAAS,WAAW,QAAQ;GAC5D,WAAW;IAAE;IAAQ;GAAM;GAC3B,KAAK,MAAM,YAAY,WAAW,SAAS;EAC7C;EACA,YAAY,aAAa;GACvB,UAAU,IAAI,QAAQ;GACtB,aAAa;IACX,UAAU,OAAO,QAAQ;GAC3B;EACF;CACF;AACF;AAEA,SAAwB,gBAA0B;CAChD,MAAM,CAAC,SAAS,MAAM,SAAS,gBAA0B;CACzD,OAAO;AACT;AAEA,MAAa,oBAA8B,UACzC,MAAM,qBAAqB,MAAM,WAAW,MAAM,KAAK,MAAM,GAAG"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useLayoutUpdateEffect } from "../../hooks/react.mjs";
|
|
2
2
|
import { raf } from "../../utils/common.mjs";
|
|
3
|
-
import * as React
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
// src/DatePicker/core/PickerInput/hooks/useLockEffect.ts
|
|
5
5
|
/**
|
|
6
6
|
* Trigger `callback` immediately when `condition` is `true`.
|
|
7
7
|
* But trigger `callback` in next frame when `condition` is `false`.
|
|
8
8
|
*/
|
|
9
9
|
function useLockEffect(condition, callback, delayFrames = 1) {
|
|
10
|
-
const callbackRef = React
|
|
10
|
+
const callbackRef = React.useRef(callback);
|
|
11
11
|
callbackRef.current = callback;
|
|
12
12
|
useLayoutUpdateEffect(() => {
|
|
13
13
|
if (condition) callbackRef.current(condition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLockEffect.mjs","names":[
|
|
1
|
+
{"version":3,"file":"useLockEffect.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/useLockEffect.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useLayoutUpdateEffect } from '../../hooks/react';\nimport { raf } from '../../utils/common';\n\n/**\n * Trigger `callback` immediately when `condition` is `true`.\n * But trigger `callback` in next frame when `condition` is `false`.\n */\nexport default function useLockEffect(\n condition: boolean | undefined,\n callback: (next: boolean | undefined) => void,\n delayFrames = 1,\n) {\n const callbackRef = React.useRef(callback);\n callbackRef.current = callback;\n\n useLayoutUpdateEffect(() => {\n if (condition) {\n callbackRef.current(condition);\n } else {\n const id = raf(() => {\n callbackRef.current(condition);\n }, delayFrames);\n\n return () => {\n raf.cancel(id);\n };\n }\n }, [condition]);\n}\n"],"mappings":";;;;;;;;AASA,SAAwB,cACtB,WACA,UACA,cAAc,GACd;CACA,MAAM,cAAc,MAAM,OAAO,QAAQ;CACzC,YAAY,UAAU;CAEtB,4BAA4B;EAC1B,IAAI,WACF,YAAY,QAAQ,SAAS;OACxB;GACL,MAAM,KAAK,UAAU;IACnB,YAAY,QAAQ,SAAS;GAC/B,GAAG,WAAW;GAEd,aAAa;IACX,IAAI,OAAO,EAAE;GACf;EACF;CACF,GAAG,CAAC,SAAS,CAAC;AAChB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
// src/DatePicker/core/PickerInput/hooks/usePickerRef.ts
|
|
3
3
|
function usePickerRef(ref) {
|
|
4
|
-
const selectorRef = React
|
|
5
|
-
React
|
|
4
|
+
const selectorRef = React.useRef(null);
|
|
5
|
+
React.useImperativeHandle(ref, () => ({
|
|
6
6
|
nativeElement: selectorRef.current?.nativeElement,
|
|
7
7
|
focus: (options) => {
|
|
8
8
|
selectorRef.current?.focus(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePickerRef.mjs","names":[
|
|
1
|
+
{"version":3,"file":"usePickerRef.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/usePickerRef.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { PickerRef } from '../../interface';\n\ntype PickerRefType<OptionType> = Omit<PickerRef, 'focus'> & {\n focus: (options?: OptionType) => void;\n};\n\nexport default function usePickerRef<\n OptionType,\n SelectorRefType extends PickerRefType<OptionType> = PickerRefType<OptionType>,\n>(ref: React.Ref<PickerRefType<OptionType>>) {\n const selectorRef = React.useRef<SelectorRefType>(null);\n\n React.useImperativeHandle(ref, () => ({\n nativeElement: selectorRef.current?.nativeElement as HTMLDivElement,\n focus: (options) => {\n selectorRef.current?.focus(options);\n },\n blur: () => {\n selectorRef.current?.blur();\n },\n }));\n\n return selectorRef;\n}\n"],"mappings":";;AAQA,SAAwB,aAGtB,KAA2C;CAC3C,MAAM,cAAc,MAAM,OAAwB,IAAI;CAEtD,MAAM,oBAAoB,YAAY;EACpC,eAAe,YAAY,SAAS;EACpC,QAAQ,YAAY;GAClB,YAAY,SAAS,MAAM,OAAO;EACpC;EACA,YAAY;GACV,YAAY,SAAS,KAAK;EAC5B;CACF,EAAE;CAEF,OAAO;AACT"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { warning } from "../../utils/common.mjs";
|
|
2
|
-
import * as React
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
// src/DatePicker/core/PickerInput/hooks/usePresets.ts
|
|
4
4
|
function usePresets(presets, legacyRanges) {
|
|
5
|
-
return React
|
|
5
|
+
return React.useMemo(() => {
|
|
6
6
|
if (presets) return presets;
|
|
7
7
|
if (legacyRanges) {
|
|
8
8
|
warning(false, "`ranges` is deprecated. Please use `presets` instead.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePresets.mjs","names":[
|
|
1
|
+
{"version":3,"file":"usePresets.mjs","names":[],"sources":["../../../../../src/DatePicker/core/PickerInput/hooks/usePresets.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { ValueDate } from '../../interface';\nimport { warning } from '../../utils/common';\n\nexport default function usePresets<DateType = any>(\n presets?: ValueDate<DateType>[],\n legacyRanges?: Record<string, DateType | (() => DateType)>,\n): ValueDate<DateType>[] {\n return React.useMemo(() => {\n if (presets) {\n return presets;\n }\n\n if (legacyRanges) {\n warning(false, '`ranges` is deprecated. Please use `presets` instead.');\n\n return Object.entries(legacyRanges).map(([label, value]) => ({ label, value }));\n }\n\n return [];\n }, [presets, legacyRanges]);\n}\n"],"mappings":";;;AAKA,SAAwB,WACtB,SACA,cACuB;CACvB,OAAO,MAAM,cAAc;EACzB,IAAI,SACF,OAAO;EAGT,IAAI,cAAc;GAChB,QAAQ,OAAO,uDAAuD;GAEtE,OAAO,OAAO,QAAQ,YAAY,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY;IAAE;IAAO;GAAM,EAAE;EAChF;EAEA,OAAO,CAAC;CACV,GAAG,CAAC,SAAS,YAAY,CAAC;AAC5B"}
|