@unicom-cloud/ui 0.8.43 → 0.8.45
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/Affix.js +54 -51
- package/Alert.js +46 -43
- package/Anchor.js +5 -4
- package/AutoComplete.js +60 -55
- package/Avatar.js +10 -155
- package/BackTop.js +41 -38
- package/Badge.js +63 -93
- package/Breadcrumb.js +63 -118
- package/Button.js +105 -109
- package/Calendar.js +139 -536
- package/Card.js +65 -101
- package/Carousel.js +169 -270
- package/Cascader.js +9 -8
- package/Checkbox.js +4 -3
- package/Collapse.js +4 -3
- package/ColorPicker.js +95 -546
- package/Comment.js +14 -12
- package/ConfigProvider.js +6 -5
- package/Copy.js +33 -31
- package/DatePicker.js +35 -1993
- package/Descriptions.js +30 -28
- package/Divider.js +8 -6
- package/Draggable.js +28 -85
- package/Drawer.js +5 -4
- package/Dropdown.js +107 -167
- package/Empty.js +28 -8
- package/Form.js +30 -1418
- package/Grid.js +13 -248
- package/Icon.js +19 -45
- package/IconHover.js +39 -6
- package/Image.js +3 -3
- package/Input.js +4 -4
- package/InputNumber.js +213 -17
- package/InputTag.js +5 -4
- package/Layout.js +35 -48
- package/Link.js +16 -14
- package/List.js +191 -228
- package/Loading.js +18 -17
- package/Mentions.js +99 -115
- package/Menu.js +8 -7
- package/Message.js +147 -10
- package/Modal.js +5 -4
- package/Notice.js +196 -13
- package/Notification.js +136 -11
- package/NotificationBase.js +5 -4
- package/OverflowEllipsis.js +48 -71
- package/PageHeader.js +52 -52
- package/Pagination.js +12 -11
- package/Picker.js +6 -4
- package/Popconfirm.js +47 -44
- package/Popover.js +25 -23
- package/Portal.js +12 -32
- package/Progress.js +65 -328
- package/Radio.js +6 -5
- package/Rate.js +48 -45
- package/ResizeBox.js +127 -505
- package/Result.js +60 -1417
- package/Select.js +9 -8
- package/SelectView.js +49 -328
- package/Skeleton.js +41 -78
- package/Slider.js +228 -702
- package/Space.js +53 -57
- package/Spin.js +57 -72
- package/Statistic.js +84 -153
- package/Steps.js +64 -123
- package/SuspenseFallbackTest.js +4 -3
- package/Switch.js +41 -38
- package/Table.js +20 -1999
- package/Tabs.js +9 -8
- package/Tag.js +24 -21
- package/TimePicker.js +19 -272
- package/Timeline.js +4 -3
- package/Tooltip.js +79 -72
- package/Transfer.js +138 -402
- package/Tree.js +5 -4
- package/TreeSelect.js +8 -7
- package/Trigger.js +407 -571
- package/Typography.js +11 -721
- package/Upload.js +9 -8
- package/VerificationCode.js +6 -5
- package/Version.js +1 -1
- package/VirtualList.js +4 -3
- package/Watermark.js +3 -2
- package/anchor/Anchor.js +193 -0
- package/anchor/Link.js +54 -0
- package/anchor/context.js +14 -0
- package/anchor/util.js +41 -0
- package/avatar/Avatar.js +85 -0
- package/avatar/Group.js +84 -0
- package/avatar/context.js +5 -0
- package/badge/Count.js +35 -0
- package/breadcrumb/Item.js +67 -0
- package/button/Group.js +15 -0
- package/calendar/Month.js +142 -0
- package/calendar/WeekList.js +24 -0
- package/calendar/Year.js +75 -0
- package/calendar/header/Panel.js +57 -0
- package/calendar/header/index.js +118 -0
- package/calendar/hook/useCellClassName.js +41 -0
- package/card/Grid.js +27 -0
- package/card/Meta.js +32 -0
- package/carousel/Arrow.js +57 -0
- package/carousel/Indicator.js +68 -0
- package/cascader/Cascader.js +300 -0
- package/cascader/base/node.js +142 -0
- package/cascader/base/store.js +93 -0
- package/cascader/hook/useRefCurrent.js +12 -0
- package/cascader/panel/List.js +275 -0
- package/cascader/panel/Option.js +35 -0
- package/cascader/panel/Search.js +171 -0
- package/cascader/util.js +66 -0
- package/checkbox/Checkbox.js +111 -0
- package/checkbox/Group.js +97 -0
- package/checkbox/useCheckbox.js +45 -0
- package/collapse/Collapse.js +90 -0
- package/collapse/Item.js +165 -0
- package/color-picker/ControlBar.js +64 -0
- package/color-picker/InputAlpha.js +24 -0
- package/color-picker/InputHex.js +59 -0
- package/color-picker/InputRgb.js +66 -0
- package/color-picker/Palette.js +36 -0
- package/color-picker/Panel.js +165 -0
- package/color-picker/colors.js +37 -0
- package/color-picker/hooks/useColorPicker.js +63 -0
- package/color-picker/hooks/useControlBlock.js +40 -0
- package/config-provider/ConfigProvider.js +94 -0
- package/config-provider/context.js +24 -0
- package/date-picker/Picker.js +399 -0
- package/date-picker/PickerRange.js +568 -0
- package/date-picker/context.js +5 -0
- package/date-picker/hook/useCellClassName.js +58 -0
- package/date-picker/panel/Body.js +78 -0
- package/date-picker/panel/Footer.js +71 -0
- package/date-picker/panel/Header.js +74 -0
- package/date-picker/panel/Shortcut.js +45 -0
- package/date-picker/panel/WeekList.js +19 -0
- package/date-picker/panel/date/index.js +194 -0
- package/date-picker/panel/month/index.js +113 -0
- package/date-picker/panel/quarter/index.js +93 -0
- package/date-picker/panel/range/index.js +251 -0
- package/date-picker/panel/week/index.js +35 -0
- package/date-picker/panel/year/index.js +74 -0
- package/date-picker/util.js +69 -0
- package/draggable/Item.js +66 -0
- package/drawer/Drawer.js +226 -0
- package/dropdown/Button.js +91 -0
- package/form/Control.js +264 -0
- package/form/Form.js +156 -0
- package/form/FormItem.js +241 -0
- package/form/FormLabel.js +54 -0
- package/form/FormList.js +96 -0
- package/form/FormProvider.js +48 -0
- package/form/IconSymbol.js +20 -0
- package/form/context.js +43 -0
- package/form/hook/useContext.js +32 -0
- package/form/hook/useState.js +31 -0
- package/form/hook/useWatch.js +36 -0
- package/form/interface.js +11 -0
- package/form/promisify.js +23 -0
- package/form/store.js +354 -0
- package/form/useForm.js +53 -0
- package/form/util.js +72 -0
- package/grid/Col.js +87 -0
- package/grid/Row.js +88 -0
- package/grid/context.js +9 -0
- package/grid/grid-item.js +77 -0
- package/grid/grid.js +104 -0
- package/grid/hook/useResponsiveState.js +38 -0
- package/grid/util.js +51 -0
- package/{chunk/I4RV9SKZ.js → hooks/factory/createHTMLMediaHook.js} +35 -43
- package/hooks/index.js +246 -4
- package/{chunk/BdYAMaw9.js → hooks/misc/hookState.js} +1 -1
- package/hooks/misc/parseTimeRanges.js +12 -0
- package/{chunk/TXCrI0jN.js → hooks/misc/util.js} +6 -6
- package/hooks/use-watermark/utils.js +8 -0
- package/hooks/use-watermark.js +71 -76
- package/hooks/useAudio.js +3 -3
- package/hooks/useBeforeUnload.js +2 -2
- package/hooks/useClickAway.js +10 -10
- package/hooks/useCounter.js +1 -1
- package/hooks/useCreation.js +2 -4
- package/hooks/useDrop.js +12 -12
- package/hooks/useDropArea.js +5 -5
- package/hooks/useEvent.js +6 -6
- package/hooks/useEventListener.js +2 -4
- package/hooks/useFavicon.js +1 -2
- package/hooks/useFullscreen.js +11 -13
- package/hooks/useGetSet.js +5 -5
- package/hooks/useHash.js +6 -6
- package/hooks/useHover.js +6 -6
- package/hooks/useHoverDirty.js +7 -7
- package/hooks/useIdle.js +17 -17
- package/hooks/useIsomorphicLayoutEffect2.js +3 -3
- package/hooks/useKey.js +5 -5
- package/hooks/useList.js +1 -1
- package/hooks/useLocalStorage.js +2 -3
- package/hooks/useLocation.js +1 -1
- package/hooks/useLockBodyScroll.js +13 -14
- package/hooks/useLongPress.js +7 -7
- package/hooks/useMeasure.js +3 -3
- package/hooks/useMedia.js +4 -4
- package/hooks/useMediaDevices.js +10 -10
- package/hooks/useMotion.js +11 -11
- package/hooks/useMouse.js +9 -9
- package/hooks/useMouseWheel.js +7 -7
- package/hooks/useNetworkState.js +7 -7
- package/hooks/useOrientation.js +10 -11
- package/hooks/useOverrideRef.js +14 -0
- package/hooks/usePageLeave.js +4 -4
- package/hooks/usePermission.js +9 -9
- package/hooks/usePersistCallback.js +15 -0
- package/hooks/useScroll.js +6 -6
- package/hooks/useScrolling.js +7 -7
- package/hooks/useSearchParam.js +5 -5
- package/hooks/useSessionStorage.js +9 -9
- package/hooks/useSize.js +1 -1
- package/hooks/useSlider.js +6 -6
- package/hooks/useStartTyping.js +4 -4
- package/hooks/useStateList.js +4 -5
- package/hooks/useStateWithHistory.js +1 -1
- package/hooks/useTimeout.js +1 -2
- package/hooks/useVibrate.js +5 -5
- package/hooks/useVideo.js +3 -3
- package/hooks/useWindowScroll.js +13 -13
- package/hooks/useWindowSize.js +6 -6
- package/icon/addFromIconFontCn.js +33 -0
- package/image/Image.js +189 -0
- package/image/ImageFooter.js +45 -0
- package/image/ImagePreview.js +473 -0
- package/image/ImagePreviewArrow.js +40 -0
- package/image/ImagePreviewGroup.js +125 -0
- package/image/ImagePreviewToolbar.js +98 -0
- package/image/TriggerForToolbar.js +10 -0
- package/image/previewGroupContext.js +17 -0
- package/image/util/getFixTranslate.js +7 -0
- package/image/util/getScale.js +72 -0
- package/image/util/hook/useImageStatus.js +16 -0
- package/image/util/hook/useShowFooter.js +7 -0
- package/index.js +440 -395
- package/input/Group.js +20 -0
- package/input/Input.js +185 -0
- package/input/InputElement.js +233 -0
- package/input/Number.js +4 -0
- package/input/Password.js +72 -0
- package/input/Search.js +80 -0
- package/input/Tag.js +7 -0
- package/input/Textarea.js +168 -0
- package/input/autoSizeTextAreaHeight.js +65 -0
- package/input/useComposition.js +39 -0
- package/input-number/decimal.js +154 -0
- package/input-number/useSelectionRange.js +26 -0
- package/input-number/util.js +57 -0
- package/input-tag/InputTag.js +381 -0
- package/layout/Content.js +15 -0
- package/layout/Footer.js +15 -0
- package/layout/Header.js +15 -0
- package/{chunk/B9asjXwm.js → layout/Sider.js} +23 -22
- package/list/Item.js +46 -0
- package/list/Meta.js +21 -0
- package/loading/style/index.module.less.js +4 -0
- package/locale/de-DE.js +1 -1
- package/mentions/util.js +26 -0
- package/menu/Indent.js +17 -0
- package/menu/Item.js +125 -0
- package/menu/ItemGroup.js +39 -0
- package/menu/Menu.js +181 -0
- package/menu/OverflowWrap.js +85 -0
- package/menu/context.js +5 -0
- package/menu/sub-menu/Inline.js +111 -0
- package/menu/sub-menu/Pop.js +126 -0
- package/menu/sub-menu/index.js +17 -0
- package/menu/util.js +80 -0
- package/message/useMessage.js +53 -0
- package/modal/Confirm.js +98 -0
- package/modal/Modal.js +419 -0
- package/modal/config.js +25 -0
- package/modal/use-modal/Hook.js +55 -0
- package/modal/use-modal/index.js +68 -0
- package/notification/useNotification.js +55 -0
- package/overflow-ellipsis/OverflowItem.js +34 -0
- package/package.json +27 -1
- package/pagination/PageItem.js +121 -0
- package/pagination/PageJumper.js +64 -0
- package/pagination/PageOption.js +55 -0
- package/pagination/Pagination.js +245 -0
- package/picker/Input.js +124 -0
- package/picker/InputRange.js +155 -0
- package/portal/Portal.js +25 -0
- package/progress/CircleProgress.js +117 -0
- package/progress/LineProgess.js +103 -0
- package/progress/StepProgress.js +74 -0
- package/radio/Group.js +91 -0
- package/radio/Radio.js +90 -0
- package/resize-box/ResizeTrigger.js +78 -0
- package/resize-box/Split.js +132 -0
- package/resize-box/SplitGroup.js +204 -0
- package/result/403.js +695 -0
- package/result/404.js +513 -0
- package/result/500.js +166 -0
- package/select/OptGroup.js +20 -0
- package/select/Option.js +97 -0
- package/select/Select.js +544 -0
- package/select/util.js +140 -0
- package/select-view/Core.js +309 -0
- package/skeleton/Image.js +24 -0
- package/skeleton/Text.js +27 -0
- package/slider/Button.js +159 -0
- package/slider/Dot.js +43 -0
- package/slider/Input.js +75 -0
- package/slider/Mark.js +28 -0
- package/slider/Tick.js +44 -0
- package/slider/hook/useInterval.js +73 -0
- package/slider/hook/useLegalValue.js +70 -0
- package/slider/util.js +63 -0
- package/space/toArray.js +11 -0
- package/spin/DotLoading.js +26 -0
- package/statistic/Countdown.js +57 -0
- package/statistic/util.js +33 -0
- package/steps/Step.js +68 -0
- package/style.css +1 -1
- package/table/ColGroup.js +59 -0
- package/table/Table.js +634 -0
- package/table/constant.js +5 -0
- package/table/hook/useColumns.js +141 -0
- package/table/hook/useComponent.js +64 -0
- package/table/hook/useExpand.js +36 -0
- package/table/hook/useRowSelection.js +92 -0
- package/table/hook/useSorter.js +54 -0
- package/table/hook/useStickyClassNames.js +30 -0
- package/table/hook/useStickyOffsets.js +30 -0
- package/table/summary/Cell.js +10 -0
- package/table/summary/Row.js +26 -0
- package/table/summary/context.js +5 -0
- package/table/summary/index.js +10 -0
- package/table/tbody/Td.js +160 -0
- package/table/tbody/Tr.js +168 -0
- package/table/tbody/index.js +156 -0
- package/table/tfoot/index.js +16 -0
- package/table/thead/Column.js +250 -0
- package/table/thead/index.js +131 -0
- package/table/util.js +121 -0
- package/tabs/Tab.js +170 -0
- package/tabs/TabContent.js +54 -0
- package/tabs/TabPane.js +26 -0
- package/tabs/hook/useDomSize.js +17 -0
- package/tabs/hook/useHeaderScroll.js +64 -0
- package/tabs/tab-header/DropdownIcon.js +71 -0
- package/tabs/tab-header/TabInk.js +65 -0
- package/tabs/tab-header/TabNavIcon.js +65 -0
- package/tabs/tab-header/TabTitle.js +78 -0
- package/tabs/tab-header/index.js +335 -0
- package/tabs/util.js +22 -0
- package/time-picker/Picker.js +221 -0
- package/time-picker/RangePicker.js +56 -0
- package/time-picker/TimeColumn.js +65 -0
- package/time-picker/TimePicker.js +242 -0
- package/time-picker/context.js +5 -0
- package/time-picker/util.js +43 -0
- package/timeline/Item.js +94 -0
- package/timeline/Timeline.js +80 -0
- package/transfer/Item.js +107 -0
- package/transfer/List.js +192 -0
- package/tree/Animation.js +104 -0
- package/tree/Context.js +5 -0
- package/tree/Node.js +215 -0
- package/tree/NodeList.js +84 -0
- package/tree/Tree.js +549 -0
- package/tree/util.js +76 -0
- package/tree-select/List.js +127 -0
- package/tree-select/Select.js +260 -0
- package/tree-select/hook/useKeyCache.js +56 -0
- package/tree-select/hook/useStateValue.js +98 -0
- package/tree-select/hook/useTreeData.js +13 -0
- package/tree-select/interface.js +13 -0
- package/tree-select/util.js +9 -0
- package/trigger/Portal.js +14 -0
- package/trigger/getPopupStyle.js +190 -0
- package/types/badge/Count.d.ts +2 -1
- package/types/badge/index.d.ts +2 -2
- package/types/button/index.d.ts +2 -2
- package/types/carousel/index.d.ts +1 -1
- package/types/color-picker/colors.d.ts +1 -1
- package/types/color-picker/style/index.d.ts +1 -1
- package/types/drawer/Drawer.d.ts +1 -1
- package/types/dropdown/interface.d.ts +1 -0
- package/types/grid/index.d.ts +1 -0
- package/types/hooks/index.d.ts +122 -0
- package/types/hooks/use-verification-code/interface.d.ts +1 -1
- package/types/hooks/useAsync.d.ts +1 -1
- package/types/hooks/useDropArea.d.ts +1 -0
- package/types/hooks/useOverrideRef.d.ts +5 -0
- package/types/hooks/usePersistCallback.d.ts +1 -0
- package/types/hooks/useUpsert.d.ts +1 -1
- package/types/icon-hover/index.d.ts +5 -3
- package/types/index.d.ts +4 -120
- package/types/input-tag/InputTag.d.ts +1 -1
- package/types/input-tag/interface.d.ts +1 -1
- package/types/link/interface.d.ts +1 -1
- package/types/list/index.d.ts +1 -1
- package/types/modal/interface.d.ts +1 -0
- package/types/notice/index.d.ts +3 -0
- package/types/notification/index.d.ts +1 -1
- package/types/page-header/index.d.ts +1 -1
- package/types/select/Select.d.ts +1 -1
- package/types/select-view/Core.d.ts +3 -2
- package/types/select-view/index.d.ts +1 -0
- package/types/statistic/index.d.ts +1 -1
- package/types/switch/index.d.ts +1 -1
- package/types/switch/interface.d.ts +1 -1
- package/types/table/interface.d.ts +2 -1
- package/types/tooltip/index.d.ts +1 -1
- package/types/trigger/index.d.ts +12 -8
- package/types/trigger/interface.d.ts +1 -0
- package/types/typography/Base.d.ts +8 -7
- package/types/typography/EditContent.d.ts +3 -2
- package/types/typography/Paragraph.d.ts +2 -5
- package/types/typography/Text.d.ts +1 -5
- package/types/typography/Title.d.ts +2 -5
- package/types/upload/TriggerNode.d.ts +5 -3
- package/types/upload/list/PictureItem.d.ts +3 -3
- package/types/upload/list/TextItem.d.ts +3 -3
- package/types/utils/CSSTransition.d.ts +2 -0
- package/types/utils/constant.d.ts +1 -1
- package/types/utils/is.d.ts +4 -0
- package/types/utils/reactDOM.d.ts +3 -1
- package/types/utils/warning.d.ts +1 -1
- package/types/version/index.d.ts +1 -1
- package/typography/Base.js +184 -0
- package/typography/EditContent.js +49 -0
- package/typography/Ellipsis.js +293 -0
- package/typography/Operations.js +78 -0
- package/typography/Paragraph.js +26 -0
- package/typography/Text.js +11 -0
- package/typography/Title.js +12 -0
- package/typography/Typography.js +15 -0
- package/typography/useCssEllipsis.js +37 -0
- package/typography/useEllipsis.js +150 -0
- package/upload/TriggerNode.js +118 -0
- package/upload/Upload.js +205 -0
- package/upload/Uploader.js +205 -0
- package/upload/interface.js +9 -0
- package/upload/list/PictureItem.js +91 -0
- package/upload/list/TextItem.js +99 -0
- package/upload/list/UploadProgress.js +97 -0
- package/upload/list/index.js +120 -0
- package/upload/request.js +51 -0
- package/upload/util.js +61 -0
- package/utils/CSSTransition.js +27 -0
- package/utils/contextHolder.js +29 -4
- package/utils/getHighlightText.js +1 -2
- package/utils/is.js +81 -68
- package/utils/reactDOM.js +33 -22
- package/utils/style.js +1 -2
- package/utils/warning.js +7 -3
- package/verification-code/VerificationCode.js +83 -0
- package/virtual-list/Filler.js +31 -0
- package/virtual-list/VirtualList.js +378 -0
- package/virtual-list/util/algorithm.js +32 -0
- package/virtual-list/util/item.js +99 -0
- package/{chunk/BCEX3Acw.js → watermark/Watermark.js} +13 -11
- package/chunk/B1P8u7kB.js +0 -798
- package/chunk/B2ufZjjd.js +0 -1000
- package/chunk/B7QOJqps.js +0 -162
- package/chunk/BBz3S3zo.js +0 -966
- package/chunk/BGzBxiWE.js +0 -517
- package/chunk/BNRfcEHj.js +0 -984
- package/chunk/BSs6uXmc.js +0 -946
- package/chunk/BTjUAV8T.js +0 -277
- package/chunk/BYQeEcKe.js +0 -375
- package/chunk/Ba4UXIST.js +0 -605
- package/chunk/BfaXVcik.js +0 -271
- package/chunk/Bs11tCU6.js +0 -240
- package/chunk/C7FC7dzS.js +0 -516
- package/chunk/CLzbve11.js +0 -694
- package/chunk/CN4zXU4b.js +0 -877
- package/chunk/CYTPZUHD.js +0 -769
- package/chunk/CcCo_dK0.js +0 -335
- package/chunk/CoCXcpQd.js +0 -261
- package/chunk/D4yH4UKK.js +0 -80
- package/chunk/DiSLYN2-.js +0 -167
- package/chunk/Dr0iXIXO.js +0 -736
- package/chunk/G3-2uJao.js +0 -229
- package/chunk/RnTpOC5-.js +0 -1
- package/chunk/Z-mtdHUQ.js +0 -226
- package/chunk/ZISxNnaR.js +0 -165
- package/chunk/aPJXnDSb.js +0 -450
- package/chunk/i605JRmI.js +0 -232
- package/chunk/l0sNRNKZ.js +0 -1
- package/types/form/FormItemTip.d.ts +0 -8
- /package/{chunk/C6Kfwj0f.js → loading/style/index.less.js} +0 -0
- /package/{chunk/DP2rzg_V.js → suspense-fallback-test/style/index.less.js} +0 -0
- /package/types/{Popover → popover}/index.d.ts +0 -0
- /package/types/{Popover → popover}/interface.d.ts +0 -0
- /package/types/{Popover → popover}/style/index.d.ts +0 -0
- /package/{chunk/K6Dvbx-E.js → virtual-list/style/index.less.js} +0 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import { jsx as w, jsxs as lt, Fragment as ft } from "react/jsx-runtime";
|
|
2
|
+
import lo from "@unicom-cloud/icons/IconUiCalendar";
|
|
3
|
+
import fo from "@unicom-cloud/icons/IconUiCalendarClock";
|
|
4
|
+
import { isDayjs as mt } from "dayjs";
|
|
5
|
+
import f from "lodash/isArray";
|
|
6
|
+
import mo from "lodash/isPlainObject";
|
|
7
|
+
import po from "lodash/isUndefined";
|
|
8
|
+
import ho, { useContext as go, useRef as A, useState as v, useEffect as te } from "react";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import "../config-provider/ConfigProvider.js";
|
|
11
|
+
import vo from "../hooks/useMergeProps.js";
|
|
12
|
+
import pt from "../hooks/usePrevious.js";
|
|
13
|
+
import dt from "../hooks/useUpdateEffect.js";
|
|
14
|
+
import So from "../picker/InputRange.js";
|
|
15
|
+
import Po from "../Trigger.js";
|
|
16
|
+
import wo from "@unicom-cloud/utils/class-name";
|
|
17
|
+
import { getDayjsValue as V, getNow as I, toTimezone as ht, toLocal as He, methods as C, isDayjsArrayChange as Vo, getSortedDayjsArray as Le, isValidTimeString as Do, getValueWithTime as oe } from "../utils/dayjs.js";
|
|
18
|
+
import { pickDataAttributes as bo } from "../utils/pick.js";
|
|
19
|
+
import yo from "./context.js";
|
|
20
|
+
import xo from "./panel/Footer.js";
|
|
21
|
+
import Io from "./panel/Shortcut.js";
|
|
22
|
+
import Co from "./panel/range/index.js";
|
|
23
|
+
import { getDefaultWeekStart as To, getAvailableDayjsLength as gt, getFormatByIndex as H, getLocaleDayjsValue as Ne } from "./util.js";
|
|
24
|
+
import { ConfigContext as Yo } from "../config-provider/context.js";
|
|
25
|
+
function ko(ne) {
|
|
26
|
+
const { format: j, showTime: S, mode: re } = ne;
|
|
27
|
+
let d;
|
|
28
|
+
switch (re) {
|
|
29
|
+
case "date":
|
|
30
|
+
d = S ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
31
|
+
break;
|
|
32
|
+
case "month":
|
|
33
|
+
d = "YYYY-MM";
|
|
34
|
+
break;
|
|
35
|
+
case "year":
|
|
36
|
+
d = "YYYY";
|
|
37
|
+
break;
|
|
38
|
+
case "week":
|
|
39
|
+
d = "YYYY-wo";
|
|
40
|
+
break;
|
|
41
|
+
case "quarter":
|
|
42
|
+
d = "YYYY-[Q]Q";
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
d = "YYYY-MM-DD";
|
|
46
|
+
}
|
|
47
|
+
return j && (d = j), d;
|
|
48
|
+
}
|
|
49
|
+
const vt = {
|
|
50
|
+
allowClear: !0,
|
|
51
|
+
unmountOnExit: !0,
|
|
52
|
+
position: "bl",
|
|
53
|
+
editable: !0,
|
|
54
|
+
mode: "date"
|
|
55
|
+
}, Ho = { bottom: 4 }, St = (ne) => {
|
|
56
|
+
var ct, ut;
|
|
57
|
+
const {
|
|
58
|
+
getPrefixCls: j,
|
|
59
|
+
locale: S,
|
|
60
|
+
size: re,
|
|
61
|
+
componentConfig: d,
|
|
62
|
+
rtl: Re
|
|
63
|
+
} = go(Yo);
|
|
64
|
+
Re && (vt.position = "br");
|
|
65
|
+
const l = vo(
|
|
66
|
+
ne,
|
|
67
|
+
vt,
|
|
68
|
+
d == null ? void 0 : d.DatePicker
|
|
69
|
+
), {
|
|
70
|
+
allowClear: Pt,
|
|
71
|
+
className: Ae,
|
|
72
|
+
style: je,
|
|
73
|
+
placeholder: Ee,
|
|
74
|
+
getPopupContainer: wt,
|
|
75
|
+
disabled: h,
|
|
76
|
+
position: Vt,
|
|
77
|
+
error: Dt,
|
|
78
|
+
status: bt,
|
|
79
|
+
unmountOnExit: yt,
|
|
80
|
+
editable: xt,
|
|
81
|
+
triggerProps: It,
|
|
82
|
+
shortcuts: U,
|
|
83
|
+
onSelect: ae,
|
|
84
|
+
onVisibleChange: se,
|
|
85
|
+
value: Ct,
|
|
86
|
+
onChange: ie,
|
|
87
|
+
icons: W,
|
|
88
|
+
disabledDate: Fe,
|
|
89
|
+
disabledTime: Tt,
|
|
90
|
+
mode: r,
|
|
91
|
+
showTime: p,
|
|
92
|
+
onSelectShortcut: ce,
|
|
93
|
+
extra: Oe,
|
|
94
|
+
shortcutsPlacementLeft: E,
|
|
95
|
+
onOk: ue,
|
|
96
|
+
defaultPickerValue: Yt,
|
|
97
|
+
pickerValue: kt,
|
|
98
|
+
panelRender: ze,
|
|
99
|
+
onPickerValueChange: le,
|
|
100
|
+
triggerElement: q,
|
|
101
|
+
clearRangeOnReselect: Ht,
|
|
102
|
+
separator: Lt,
|
|
103
|
+
utcOffset: a,
|
|
104
|
+
timezone: s,
|
|
105
|
+
inputProps: Nt
|
|
106
|
+
} = l, F = j("picker-range"), Rt = po(l.dayStartOfWeek) ? To(S.dayjsLocale) : l.dayStartOfWeek, fe = A(null), Me = A(null), Be = A(null), me = A(null), pe = A(null), i = ko(l);
|
|
107
|
+
function At() {
|
|
108
|
+
if (f(h)) {
|
|
109
|
+
if (h[0] && !h[1])
|
|
110
|
+
return 1;
|
|
111
|
+
if (h[1] && !h[0])
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const T = At(), P = typeof T == "number", jt = P ? 1 ^ T : void 0, [m, de] = v(
|
|
116
|
+
P ? T : 0
|
|
117
|
+
);
|
|
118
|
+
te(() => {
|
|
119
|
+
P && de(T);
|
|
120
|
+
}, [h]);
|
|
121
|
+
const _ = 1 ^ m, [Q, Y] = v(), [$e, K] = v(), [he, ge] = v(Mt()), [D, L] = v(), [Et, O] = v(), [Ue, ve] = v(), [Ft, Ot] = v(l.popupVisible), [Se, Pe] = v([r, r]), [we, We] = v(!1), b = "popupVisible" in l ? l.popupVisible : Ft, k = V(
|
|
122
|
+
Ct,
|
|
123
|
+
i,
|
|
124
|
+
a,
|
|
125
|
+
s
|
|
126
|
+
), y = "value" in l ? k : he, c = Ue || D || y || [], g = gt(D || y), z = A(!0), Ve = I(), qe = ht(Ve, a, s);
|
|
127
|
+
function zt() {
|
|
128
|
+
const e = [], t = mo(p) && p.defaultValue ? V(p.defaultValue, p.format || "HH:mm:ss") : [];
|
|
129
|
+
return e[0] = c[0] || t[0] || qe, e[1] = c[1] || t[1] || qe, e;
|
|
130
|
+
}
|
|
131
|
+
const G = zt(), _e = P ? (e) => T === 0 ? e.isAfter(c[1], r) : e.isBefore(c[0], r) : void 0, De = q !== void 0, be = De || Ht;
|
|
132
|
+
function Mt() {
|
|
133
|
+
let e;
|
|
134
|
+
if (l.value ? e = V(l.value, i, a, s) : e = V(l.defaultValue, i, a, s), P && (!e || e && !e[_])) {
|
|
135
|
+
const t = [];
|
|
136
|
+
return t[_] = I(a, s), t;
|
|
137
|
+
}
|
|
138
|
+
return e;
|
|
139
|
+
}
|
|
140
|
+
const ye = y || V(Yt, i) || [Ve, Ve], [Qe, J] = v(
|
|
141
|
+
N(ye)
|
|
142
|
+
), X = N(
|
|
143
|
+
V(kt, i, a, s)
|
|
144
|
+
) || Qe, xe = pt(a), Ie = pt(s);
|
|
145
|
+
dt(() => {
|
|
146
|
+
if (f(he) && (xe !== a || s !== Ie)) {
|
|
147
|
+
const t = he.map(
|
|
148
|
+
(o) => He(o, xe, Ie)
|
|
149
|
+
).map(
|
|
150
|
+
(o) => ht(o, a, s)
|
|
151
|
+
);
|
|
152
|
+
ge(t);
|
|
153
|
+
}
|
|
154
|
+
}, [a, xe, s, Ie]), dt(() => {
|
|
155
|
+
J(N(ye));
|
|
156
|
+
}, [r]), te(() => {
|
|
157
|
+
Pe([r, r]);
|
|
158
|
+
}, [r]), te(() => {
|
|
159
|
+
if (K(void 0), Y(void 0), b) {
|
|
160
|
+
const e = N(ye);
|
|
161
|
+
We(!1), Pe([r, r]), J(e), Ce(e), L(y), E && (Be.current.style.maxHeight = `${Me.current.clientHeight}px`);
|
|
162
|
+
} else
|
|
163
|
+
L(void 0), O(void 0), ve(void 0), Ut();
|
|
164
|
+
z.current = b;
|
|
165
|
+
}, [b]);
|
|
166
|
+
const Bt = (ct = k == null ? void 0 : k[0]) == null ? void 0 : ct.format(H(i, 0)), $t = (ut = k == null ? void 0 : k[1]) == null ? void 0 : ut.format(H(i, 1));
|
|
167
|
+
te(() => {
|
|
168
|
+
L(void 0), O(void 0);
|
|
169
|
+
}, [Bt, $t]);
|
|
170
|
+
function M(e, t = m) {
|
|
171
|
+
const o = N(e, t);
|
|
172
|
+
J(o), Ce(o);
|
|
173
|
+
}
|
|
174
|
+
function Ce(e) {
|
|
175
|
+
Ke([e[0], Qe[0]], r) || le == null || le(
|
|
176
|
+
f(e) ? e.map((t, o) => t && t.format(H(i, o))) : void 0,
|
|
177
|
+
e
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
function N(e, t = m) {
|
|
181
|
+
const o = t === 0 || Ke(e, r);
|
|
182
|
+
if (f(e) && e.length < 2)
|
|
183
|
+
return Z(
|
|
184
|
+
e[0] || I(a, s),
|
|
185
|
+
r,
|
|
186
|
+
"prev"
|
|
187
|
+
);
|
|
188
|
+
if (f(e) && e.length === 2)
|
|
189
|
+
return e[t] ? Z(
|
|
190
|
+
e[t],
|
|
191
|
+
r,
|
|
192
|
+
o ? "prev" : "next"
|
|
193
|
+
) : Z(
|
|
194
|
+
e[t === 0 ? 1 : 0] || I(a, s),
|
|
195
|
+
r,
|
|
196
|
+
o && !e[t === 0 ? 1 : 0] ? "prev" : "next"
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
function Ke(e, t) {
|
|
200
|
+
if (e && e.length === 2 && nt(e))
|
|
201
|
+
return (t === "date" || t === "week") && e[0].isSame(e[1], "month") || (t === "month" || t === "quarter") && e[0].isSame(e[1], "year") || t === "year" && Math.floor(e[0].year() / 10) === Math.floor(e[1].year() / 10);
|
|
202
|
+
}
|
|
203
|
+
function Z(e = I(a, s), t = r, o = "prev") {
|
|
204
|
+
const n = o === "prev";
|
|
205
|
+
switch (t) {
|
|
206
|
+
case "date":
|
|
207
|
+
case "week":
|
|
208
|
+
return n ? [e, C.add(e, 1, "month")] : [C.subtract(e, 1, "month"), e];
|
|
209
|
+
case "month":
|
|
210
|
+
case "quarter":
|
|
211
|
+
return n ? [e, C.add(e, 1, "year")] : [C.subtract(e, 1, "year"), e];
|
|
212
|
+
case "year":
|
|
213
|
+
return n ? [e, C.add(e, 10, "year")] : [C.subtract(e, 10, "year"), e];
|
|
214
|
+
default:
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function Te(e) {
|
|
219
|
+
var t, o;
|
|
220
|
+
(o = (t = fe.current) == null ? void 0 : t.focus) == null || o.call(t, P ? T : e);
|
|
221
|
+
}
|
|
222
|
+
function Ut() {
|
|
223
|
+
var e, t;
|
|
224
|
+
(t = (e = fe.current) == null ? void 0 : e.blur) == null || t.call(e);
|
|
225
|
+
}
|
|
226
|
+
function Wt(e) {
|
|
227
|
+
e ? (setTimeout(() => Te()), B(e)) : B(!1);
|
|
228
|
+
}
|
|
229
|
+
function B(e) {
|
|
230
|
+
se == null || se(e), Ot(e);
|
|
231
|
+
}
|
|
232
|
+
function qt(e) {
|
|
233
|
+
var o;
|
|
234
|
+
e.stopPropagation();
|
|
235
|
+
let t = [...c];
|
|
236
|
+
P ? t[T] = void 0 : t = void 0, ge(t), L(t), Ze(t), (o = l.onClear) == null || o.call(l);
|
|
237
|
+
}
|
|
238
|
+
function Ge(e, t) {
|
|
239
|
+
if (de(e), c && c.length && !t) {
|
|
240
|
+
const o = N(c, e);
|
|
241
|
+
J(o), Ce(o);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function Je(e) {
|
|
245
|
+
const t = typeof _e == "function" ? _e(e) : !1;
|
|
246
|
+
return (typeof Fe == "function" ? Fe(e) : !1) || t;
|
|
247
|
+
}
|
|
248
|
+
function Xe(e) {
|
|
249
|
+
return Do(e, i, m) && !Je(V(e, i));
|
|
250
|
+
}
|
|
251
|
+
function _t(e) {
|
|
252
|
+
const t = [...c || []], o = e.target.value;
|
|
253
|
+
Y(o), b || B(!0), Xe(o) && (t[m] = V(o, i), L(t), M(t), Y(void 0));
|
|
254
|
+
}
|
|
255
|
+
function Qt() {
|
|
256
|
+
Q && Y(void 0);
|
|
257
|
+
}
|
|
258
|
+
function Ze(e) {
|
|
259
|
+
if (Vo(y, e)) {
|
|
260
|
+
const t = f(e) ? e.map(
|
|
261
|
+
(o) => Ne(
|
|
262
|
+
He(o, a, s),
|
|
263
|
+
S.dayjsLocale
|
|
264
|
+
)
|
|
265
|
+
) : void 0;
|
|
266
|
+
ie == null || ie(
|
|
267
|
+
f(t) ? t.map((o, n) => o && o.format(H(i, n))) : void 0,
|
|
268
|
+
t
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function Kt() {
|
|
273
|
+
f(D) && D.length ? Q && !Xe(Q) ? Y(void 0) : g !== 2 ? ee() : g === 2 && R(D) : b && B(!1);
|
|
274
|
+
}
|
|
275
|
+
function R(e, t) {
|
|
276
|
+
const o = e || c;
|
|
277
|
+
if (!o || !o[0] || !o[1])
|
|
278
|
+
return;
|
|
279
|
+
const n = Le(o);
|
|
280
|
+
ge(n), Ze(n), q !== null && !t && B(!1);
|
|
281
|
+
}
|
|
282
|
+
function Gt() {
|
|
283
|
+
R();
|
|
284
|
+
const e = c.map(
|
|
285
|
+
(t) => Ne(t, S.dayjsLocale)
|
|
286
|
+
);
|
|
287
|
+
ue == null || ue(
|
|
288
|
+
e.map(
|
|
289
|
+
(t, o) => t && t.format(H(i, o))
|
|
290
|
+
),
|
|
291
|
+
e
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
function et() {
|
|
295
|
+
switch (r) {
|
|
296
|
+
case "date":
|
|
297
|
+
case "week":
|
|
298
|
+
return "date";
|
|
299
|
+
case "month":
|
|
300
|
+
return "month";
|
|
301
|
+
case "year":
|
|
302
|
+
return "year";
|
|
303
|
+
default:
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function tt(e) {
|
|
308
|
+
if (g !== 2)
|
|
309
|
+
return !1;
|
|
310
|
+
const t = D || y;
|
|
311
|
+
return !!(m === 0 && e.isAfter(t[1], et()) || m === 1 && e.isBefore(t[0], et()));
|
|
312
|
+
}
|
|
313
|
+
function Jt(e, t) {
|
|
314
|
+
const o = tt(t) && z.current, n = be && g === 2 && !P ? [] : [...c], u = De ? g === 0 || g === 2 ? 0 : 1 : m, $ = p ? oe(t, G[u]) : t;
|
|
315
|
+
o ? (n[u] = $, n[1 ^ u] = void 0) : n[u] = $;
|
|
316
|
+
const Ye = Le(n);
|
|
317
|
+
ot(Ye), Y(void 0), K(void 0);
|
|
318
|
+
const ke = gt(n);
|
|
319
|
+
be ? g === 0 || g === 2 && !P ? De ? de(1) : ee(!0) : p || R(n) : ke <= 1 ? ee(!0) : g === 2 && z.current && !P ? (z.current = !1, ee(!0), !p && !o && R(n, !0)) : (z.current = !1, !p && !o && R(n));
|
|
320
|
+
}
|
|
321
|
+
function Xt(e, t, o) {
|
|
322
|
+
const n = f(c) ? [...c] : [], u = oe(
|
|
323
|
+
n[e] || I(a, s),
|
|
324
|
+
o
|
|
325
|
+
);
|
|
326
|
+
n[e] = u, ot(n);
|
|
327
|
+
}
|
|
328
|
+
function ot(e) {
|
|
329
|
+
L(e), O(void 0);
|
|
330
|
+
const o = Le(e).map(
|
|
331
|
+
(n) => Ne(He(n, a, s), S.dayjsLocale)
|
|
332
|
+
);
|
|
333
|
+
ae == null || ae(
|
|
334
|
+
o.map((n, u) => n && n.format(H(i, u))),
|
|
335
|
+
o,
|
|
336
|
+
{ type: m === 1 ? "end" : "start" }
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
function ee(e) {
|
|
340
|
+
Ge(_, e), setTimeout(() => Te(_));
|
|
341
|
+
}
|
|
342
|
+
function Zt(e, t) {
|
|
343
|
+
const o = [...c || []];
|
|
344
|
+
if (!t && (be ? g === 1 : g !== 0) && !tt(e) && (o[m] = oe(
|
|
345
|
+
e,
|
|
346
|
+
G[m]
|
|
347
|
+
), O(o), Y(void 0)), !t) {
|
|
348
|
+
const u = p ? oe(e, G[m]) : e;
|
|
349
|
+
K(
|
|
350
|
+
u.locale(S.dayjsLocale).format(H(i, m))
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function eo() {
|
|
355
|
+
O(void 0), K(void 0);
|
|
356
|
+
}
|
|
357
|
+
function nt(e) {
|
|
358
|
+
return e && f(e) && e.length === 2 && mt(e[0]) && mt(e[1]);
|
|
359
|
+
}
|
|
360
|
+
function rt(e) {
|
|
361
|
+
const t = typeof e.value == "function" && e.value();
|
|
362
|
+
return nt(t);
|
|
363
|
+
}
|
|
364
|
+
function at() {
|
|
365
|
+
clearTimeout(me.current), clearTimeout(pe.current), me.current = null, pe.current = null;
|
|
366
|
+
}
|
|
367
|
+
function to(e) {
|
|
368
|
+
at(), me.current = setTimeout(() => {
|
|
369
|
+
if (rt(e)) {
|
|
370
|
+
const t = V(
|
|
371
|
+
e.value(),
|
|
372
|
+
i,
|
|
373
|
+
a,
|
|
374
|
+
s
|
|
375
|
+
);
|
|
376
|
+
ve(t), M(t);
|
|
377
|
+
}
|
|
378
|
+
}, 50);
|
|
379
|
+
}
|
|
380
|
+
function oo() {
|
|
381
|
+
at(), pe.current = setTimeout(() => {
|
|
382
|
+
ve(void 0), M(
|
|
383
|
+
D || y || [
|
|
384
|
+
I(a, s),
|
|
385
|
+
I(a, s)
|
|
386
|
+
]
|
|
387
|
+
);
|
|
388
|
+
}, 50);
|
|
389
|
+
}
|
|
390
|
+
function no(e) {
|
|
391
|
+
if (ce == null || ce(e), rt(e)) {
|
|
392
|
+
const t = V(
|
|
393
|
+
e.value(),
|
|
394
|
+
i,
|
|
395
|
+
a,
|
|
396
|
+
s
|
|
397
|
+
);
|
|
398
|
+
R(t);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function x(e, t, o = 1) {
|
|
402
|
+
const n = e === "prev" ? 0 : 1;
|
|
403
|
+
let u = [...X];
|
|
404
|
+
e === "prev" && (u[n] = C.subtract(
|
|
405
|
+
X[n],
|
|
406
|
+
o,
|
|
407
|
+
t
|
|
408
|
+
)), e === "next" && (u[n] = C.add(
|
|
409
|
+
X[n],
|
|
410
|
+
o,
|
|
411
|
+
t
|
|
412
|
+
)), u = Z(
|
|
413
|
+
u[n],
|
|
414
|
+
r,
|
|
415
|
+
e
|
|
416
|
+
), M(u);
|
|
417
|
+
}
|
|
418
|
+
function st(e = r) {
|
|
419
|
+
if (e === "date" || e === "week")
|
|
420
|
+
return {
|
|
421
|
+
onPrev: () => x("prev", "month"),
|
|
422
|
+
onNext: () => x("next", "month"),
|
|
423
|
+
onSuperPrev: () => x("prev", "year"),
|
|
424
|
+
onSuperNext: () => x("next", "year")
|
|
425
|
+
};
|
|
426
|
+
if (e === "month" || e === "quarter")
|
|
427
|
+
return {
|
|
428
|
+
onSuperPrev: () => x("prev", "year"),
|
|
429
|
+
onSuperNext: () => x("next", "year")
|
|
430
|
+
};
|
|
431
|
+
if (e === "year")
|
|
432
|
+
return {
|
|
433
|
+
onSuperPrev: () => x("prev", "year", 10),
|
|
434
|
+
onSuperNext: () => x("next", "year", 10)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function ro() {
|
|
438
|
+
We(!we);
|
|
439
|
+
}
|
|
440
|
+
function it(e) {
|
|
441
|
+
const t = wo(
|
|
442
|
+
`${F}-container`,
|
|
443
|
+
{
|
|
444
|
+
[`${F}-panel-only`]: e,
|
|
445
|
+
[`${F}-container-shortcuts-placement-left`]: f(U) && E,
|
|
446
|
+
[`${F}-container-rtl`]: Re
|
|
447
|
+
},
|
|
448
|
+
e ? Ae : ""
|
|
449
|
+
), o = {
|
|
450
|
+
prefixCls: j("picker"),
|
|
451
|
+
showTime: p,
|
|
452
|
+
shortcuts: U,
|
|
453
|
+
onMouseEnterShortcut: to,
|
|
454
|
+
onMouseLeaveShortcut: oo,
|
|
455
|
+
onSelectShortcut: no
|
|
456
|
+
}, n = p && Se[0] === "date" && Se[1] === "date" || Oe || f(U) && U.length && !E, u = /* @__PURE__ */ lt(ft, { children: [
|
|
457
|
+
/* @__PURE__ */ w(
|
|
458
|
+
Co,
|
|
459
|
+
{
|
|
460
|
+
...l,
|
|
461
|
+
...st(),
|
|
462
|
+
getHeaderOperations: st,
|
|
463
|
+
setRangePageShowDates: M,
|
|
464
|
+
pageShowDates: X,
|
|
465
|
+
value: c,
|
|
466
|
+
format: i,
|
|
467
|
+
onSelectPanel: Jt,
|
|
468
|
+
onMouseEnterCell: Zt,
|
|
469
|
+
onMouseLeaveCell: eo,
|
|
470
|
+
disabledDate: (ke) => Je(ke),
|
|
471
|
+
disabledTime: Tt,
|
|
472
|
+
mode: r,
|
|
473
|
+
localeName: S.dayjsLocale,
|
|
474
|
+
showTime: p,
|
|
475
|
+
timeValues: Ue || G,
|
|
476
|
+
onTimePickerSelect: Xt,
|
|
477
|
+
popupVisible: b,
|
|
478
|
+
disabledTimePickerIndex: jt,
|
|
479
|
+
isTimePanel: we,
|
|
480
|
+
valueShowHover: Et,
|
|
481
|
+
panelModes: Se,
|
|
482
|
+
setPanelModes: Pe
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
!!n && /* @__PURE__ */ w(
|
|
486
|
+
xo,
|
|
487
|
+
{
|
|
488
|
+
...o,
|
|
489
|
+
DATEPICKER_LOCALE: S.DatePicker,
|
|
490
|
+
disabled: !(f(c) && c[0] && c[1]),
|
|
491
|
+
onClickConfirmBtn: Gt,
|
|
492
|
+
extra: Oe,
|
|
493
|
+
shortcutsPlacementLeft: E,
|
|
494
|
+
onClickSelectTimeBtn: ro,
|
|
495
|
+
isTimePanel: we
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
] }), $ = E ? /* @__PURE__ */ lt(ft, { children: [
|
|
499
|
+
/* @__PURE__ */ w(Io, { ref: Be, ...o }),
|
|
500
|
+
/* @__PURE__ */ w("div", { ref: Me, className: `${F}-panel-wrapper`, children: u })
|
|
501
|
+
] }) : u, Ye = typeof ze == "function" ? ze($) : $;
|
|
502
|
+
return /* @__PURE__ */ w(
|
|
503
|
+
"div",
|
|
504
|
+
{
|
|
505
|
+
className: t,
|
|
506
|
+
onClick: () => Te(),
|
|
507
|
+
style: e ? je : {},
|
|
508
|
+
children: Ye
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
const ao = l.size || re, so = f(Ee) ? Ee : S.DatePicker.placeholders[r], io = W && W.inputSuffix === null ? null : W && W.inputSuffix || (p ? /* @__PURE__ */ w(fo, {}) : /* @__PURE__ */ w(lo, {})), co = {
|
|
513
|
+
style: je,
|
|
514
|
+
className: Ae,
|
|
515
|
+
popupVisible: b,
|
|
516
|
+
format: i,
|
|
517
|
+
disabled: h,
|
|
518
|
+
error: Dt,
|
|
519
|
+
status: bt,
|
|
520
|
+
size: ao,
|
|
521
|
+
onPressEnter: Kt,
|
|
522
|
+
onClear: qt,
|
|
523
|
+
suffixIcon: io,
|
|
524
|
+
editable: xt,
|
|
525
|
+
allowClear: Pt,
|
|
526
|
+
prefix: l.prefix
|
|
527
|
+
}, uo = f(h) ? h[0] && h[1] : h;
|
|
528
|
+
return /* @__PURE__ */ w(yo.Provider, { value: { utcOffset: a, timezone: s, weekStart: Rt }, children: q === null ? it(!0) : /* @__PURE__ */ w(
|
|
529
|
+
Po,
|
|
530
|
+
{
|
|
531
|
+
popup: it,
|
|
532
|
+
trigger: "click",
|
|
533
|
+
clickToClose: !1,
|
|
534
|
+
position: Vt,
|
|
535
|
+
disabled: uo,
|
|
536
|
+
popupAlign: Ho,
|
|
537
|
+
getPopupContainer: wt,
|
|
538
|
+
onVisibleChange: Wt,
|
|
539
|
+
popupVisible: b,
|
|
540
|
+
classNames: "slideDynamicOrigin",
|
|
541
|
+
unmountOnExit: yt,
|
|
542
|
+
...It,
|
|
543
|
+
children: q || /* @__PURE__ */ w(
|
|
544
|
+
So,
|
|
545
|
+
{
|
|
546
|
+
...bo(l),
|
|
547
|
+
...co,
|
|
548
|
+
inputProps: Nt,
|
|
549
|
+
ref: fe,
|
|
550
|
+
placeholder: so,
|
|
551
|
+
value: D || y,
|
|
552
|
+
onChange: _t,
|
|
553
|
+
inputValue: $e || Q,
|
|
554
|
+
changeFocusedInputIndex: Ge,
|
|
555
|
+
focusedInputIndex: m,
|
|
556
|
+
isPlaceholder: !!$e,
|
|
557
|
+
separator: Lt,
|
|
558
|
+
onBlur: Qt
|
|
559
|
+
}
|
|
560
|
+
)
|
|
561
|
+
}
|
|
562
|
+
) });
|
|
563
|
+
};
|
|
564
|
+
St.displayName = "RangePicker";
|
|
565
|
+
const on = ho.memo(St);
|
|
566
|
+
export {
|
|
567
|
+
on as default
|
|
568
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import K from "lodash/isArray";
|
|
2
|
+
import { getAvailableDayjsLength as L } from "../util.js";
|
|
3
|
+
import M from "@unicom-cloud/utils/class-name";
|
|
4
|
+
import { getSortedDayjsArray as q, getNow as V } from "../../utils/dayjs.js";
|
|
5
|
+
function l(c, e) {
|
|
6
|
+
if (c && K(c))
|
|
7
|
+
return c[e];
|
|
8
|
+
}
|
|
9
|
+
function Y(c) {
|
|
10
|
+
const {
|
|
11
|
+
prefixCls: e,
|
|
12
|
+
value: p,
|
|
13
|
+
rangeValues: d,
|
|
14
|
+
valueShowHover: v,
|
|
15
|
+
isSameTime: f,
|
|
16
|
+
mode: R,
|
|
17
|
+
hideNotInViewDates: T
|
|
18
|
+
} = c, y = L(d), P = L(v), H = y !== 2 && P === 2 ? q(v) : d, N = y === 2 ? q(v) : [];
|
|
19
|
+
function a(m, n, o) {
|
|
20
|
+
if (n && o)
|
|
21
|
+
return f(m, n) || f(m, o) || m.isBetween(n, o, null);
|
|
22
|
+
}
|
|
23
|
+
return function(n, o, h, $) {
|
|
24
|
+
const r = l(H, 0), t = l(H, 1), s = l(N, 0), i = l(N, 1), u = !n.isPrev && !n.isNext, F = p && f(n.time, p);
|
|
25
|
+
let S = f(n.time, V(h, $));
|
|
26
|
+
const w = R !== "week" ? u : !0;
|
|
27
|
+
R === "week" && (S = V(h, $).isSame(n.time, "date")), R === "quarter" && (S = V(h, $).isSame(n.time, "quarter"));
|
|
28
|
+
function g(B) {
|
|
29
|
+
return w && !o && B && f(n.time, B);
|
|
30
|
+
}
|
|
31
|
+
const A = g(r), C = g(t), G = g(
|
|
32
|
+
l(d, 0)
|
|
33
|
+
), J = g(
|
|
34
|
+
l(d, 1)
|
|
35
|
+
), k = g(s), x = g(i);
|
|
36
|
+
let E = !1;
|
|
37
|
+
A ? E = s && r && s.isBefore(r) && a(r, s, i) : C && (E = i && t && i.isAfter(t) && a(t, s, i));
|
|
38
|
+
let I = !1;
|
|
39
|
+
return k ? I = s && r && r.isBefore(s) && a(s, r, t) : x && (I = i && t && t.isAfter(i) && a(i, r, t)), M(`${e}-cell`, {
|
|
40
|
+
[`${e}-cell-disabled`]: o,
|
|
41
|
+
[`${e}-cell-hidden`]: T && !u,
|
|
42
|
+
[`${e}-cell-in-view`]: u,
|
|
43
|
+
[`${e}-cell-today`]: S && u,
|
|
44
|
+
[`${e}-cell-selected`]: F || G || J,
|
|
45
|
+
[`${e}-cell-range-start`]: A,
|
|
46
|
+
[`${e}-cell-range-end`]: C,
|
|
47
|
+
[`${e}-cell-in-range`]: w && !o && a(n.time, r, t),
|
|
48
|
+
[`${e}-cell-hover-range-start`]: k,
|
|
49
|
+
[`${e}-cell-hover-range-end`]: x,
|
|
50
|
+
[`${e}-cell-hover-in-range`]: w && !o && a(n.time, s, i),
|
|
51
|
+
[`${e}-cell-range-edge-in-hover-range`]: E,
|
|
52
|
+
[`${e}-cell-hover-range-edge-in-range`]: I
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
Y as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as O, Fragment as R, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import A, { useContext as E } from "react";
|
|
3
|
+
import S from "../context.js";
|
|
4
|
+
import W from "../hook/useCellClassName.js";
|
|
5
|
+
import { isDisabledDate as g } from "../util.js";
|
|
6
|
+
import c from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import j from "./WeekList.js";
|
|
8
|
+
function T(n) {
|
|
9
|
+
const {
|
|
10
|
+
prefixCls: t,
|
|
11
|
+
isWeek: d,
|
|
12
|
+
disabledDate: f,
|
|
13
|
+
onSelectDate: u,
|
|
14
|
+
dateRender: o,
|
|
15
|
+
onMouseEnterCell: r,
|
|
16
|
+
onMouseLeaveCell: s,
|
|
17
|
+
CALENDAR_LOCALE: N,
|
|
18
|
+
rows: k,
|
|
19
|
+
showWeekList: h,
|
|
20
|
+
isSameTime: v,
|
|
21
|
+
format: w,
|
|
22
|
+
mode: p
|
|
23
|
+
} = n, { utcOffset: $, timezone: C, weekStart: x } = E(S), D = W({
|
|
24
|
+
...n,
|
|
25
|
+
isSameTime: v
|
|
26
|
+
});
|
|
27
|
+
function L(m) {
|
|
28
|
+
return m.map((e, l) => {
|
|
29
|
+
if (e.time) {
|
|
30
|
+
const i = g(e.time, f, p), b = () => !i && u(e.time.format(w), e.time);
|
|
31
|
+
return /* @__PURE__ */ a(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: D(e, i, $, C),
|
|
35
|
+
onMouseEnter: () => r == null ? void 0 : r(e.time, i),
|
|
36
|
+
onMouseLeave: () => s == null ? void 0 : s(e.time, i),
|
|
37
|
+
onClick: b,
|
|
38
|
+
children: o ? A.cloneElement(o(e.time)) : /* @__PURE__ */ a("div", { className: `${t}-date`, children: /* @__PURE__ */ a("div", { className: `${t}-date-value`, children: e.name }) })
|
|
39
|
+
},
|
|
40
|
+
l
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if ("weekOfYear" in e)
|
|
44
|
+
return /* @__PURE__ */ a(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: c(`${t}-cell`, `${t}-cell-week`),
|
|
48
|
+
children: /* @__PURE__ */ a("div", { className: `${t}-date`, children: /* @__PURE__ */ a("div", { className: `${t}-date-value`, children: e.weekOfYear }) })
|
|
49
|
+
},
|
|
50
|
+
l
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return /* @__PURE__ */ O(R, { children: [
|
|
55
|
+
h && /* @__PURE__ */ a(
|
|
56
|
+
j,
|
|
57
|
+
{
|
|
58
|
+
prefixCls: t,
|
|
59
|
+
weekStart: x,
|
|
60
|
+
isWeek: d,
|
|
61
|
+
CALENDAR_LOCALE: N
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ a("div", { className: `${t}-body`, children: k.map((m, e) => /* @__PURE__ */ a(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: c(`${t}-row`, {
|
|
68
|
+
[`${t}-row-week`]: d
|
|
69
|
+
}),
|
|
70
|
+
children: L(m)
|
|
71
|
+
},
|
|
72
|
+
e
|
|
73
|
+
)) })
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
T as default
|
|
78
|
+
};
|