@unicom-cloud/ui 0.8.67 → 0.8.69
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 +15 -124
- package/Alert.js +13 -110
- package/Anchor.js +2 -2
- package/AutoComplete.js +15 -146
- package/Avatar.js +4 -154
- package/BackTop.js +14 -83
- package/Badge.js +12 -176
- package/Breadcrumb.js +12 -138
- package/Button.js +12 -149
- package/Calendar.js +12 -569
- package/Card.js +10 -136
- package/Carousel.js +13 -380
- package/Cascader.js +2 -2
- package/Checkbox.js +2 -2
- package/Collapse.js +2 -2
- package/ColorPicker.js +14 -582
- package/Comment.js +10 -71
- package/ConfigProvider.js +5 -6
- package/Copy.js +12 -61
- package/DatePicker.js +11 -2043
- package/Descriptions.js +11 -176
- package/Divider.js +7 -38
- package/Draggable.js +7 -90
- package/Drawer.js +2 -2
- package/Dropdown.js +15 -199
- package/Empty.js +2 -2
- package/Form.js +16 -1455
- package/Grid.js +9 -252
- package/Icon.js +7 -55
- package/IconHover.js +1 -1
- package/Image.js +6 -5
- package/Input.js +12 -12
- package/InputNumber.js +7 -5
- package/InputTag.js +2 -2
- package/Layout.js +16 -56
- package/Link.js +9 -60
- package/List.js +18 -312
- package/Loading.js +4 -59
- package/Mentions.js +12 -164
- package/Menu.js +8 -7
- package/Message.js +6 -5
- package/Modal.js +2 -2
- package/Notice.js +5 -6
- package/Notification.js +7 -6
- package/OverflowEllipsis.js +8 -98
- package/PageHeader.js +13 -113
- package/Pagination.js +2 -2
- package/Picker.js +4 -3
- package/Popconfirm.js +13 -128
- package/Popover.js +10 -76
- package/Portal.js +5 -25
- package/Progress.js +11 -363
- package/Radio.js +5 -6
- package/Rate.js +14 -125
- package/ResizeBox.js +16 -558
- package/Result.js +14 -1434
- package/Select.js +5 -4
- package/SelectView.js +9 -425
- package/Skeleton.js +11 -94
- package/Slider.js +21 -776
- package/Space.js +11 -94
- package/SpeechSynthesis.js +48 -64
- package/Spin.js +11 -94
- package/Statistic.js +15 -192
- package/Steps.js +11 -148
- package/SuspenseFallbackTest.js +3 -10
- package/Switch.js +13 -114
- package/Table.js +16 -2097
- package/Tabs.js +6 -6
- package/Tag.js +13 -134
- package/TimePicker.js +7 -274
- package/Timeline.js +4 -4
- package/Tooltip.js +12 -137
- package/Transfer.js +14 -450
- package/Tree.js +3 -2
- package/TreeSelect.js +3 -4
- package/Trigger.js +21 -809
- package/Typography.js +10 -756
- package/Upload.js +4 -4
- package/VerificationCode.js +2 -2
- package/VirtualList.js +2 -2
- package/Watermark.js +2 -2
- package/affix/index.js +126 -0
- package/affix/interface.js +1 -0
- package/alert/index.js +112 -0
- package/alert/interface.js +1 -0
- package/anchor/Anchor.js +198 -0
- package/anchor/Link.js +52 -0
- package/anchor/context.js +14 -0
- package/anchor/index.js +4 -0
- package/anchor/interface.js +1 -0
- package/anchor/util.js +50 -0
- package/auto-complete/index.js +149 -0
- package/auto-complete/interface.js +1 -0
- package/avatar/Avatar.js +83 -0
- package/avatar/Group.js +82 -0
- package/avatar/context.js +5 -0
- package/avatar/index.js +7 -0
- package/avatar/interface.js +1 -0
- package/back-top/index.js +85 -0
- package/back-top/interface.js +1 -0
- package/badge/Count.js +35 -0
- package/badge/index.js +151 -0
- package/badge/interface.js +1 -0
- package/breadcrumb/Item.js +67 -0
- package/breadcrumb/index.js +81 -0
- package/breadcrumb/interface.js +1 -0
- package/button/Group.js +13 -0
- package/button/index.js +146 -0
- package/button/interface.js +1 -0
- package/calendar/Month.js +12 -0
- package/calendar/WeekList.js +24 -0
- package/calendar/Year.js +74 -0
- package/calendar/index.js +320 -0
- package/calendar/interface.js +1 -0
- package/card/Grid.js +25 -0
- package/card/Meta.js +30 -0
- package/card/index.js +99 -0
- package/card/interface.js +1 -0
- package/carousel/Arrow.js +55 -0
- package/carousel/Indicator.js +66 -0
- package/carousel/index.js +278 -0
- package/carousel/interface.js +1 -0
- package/cascader/Cascader.js +26 -0
- package/cascader/index.js +4 -0
- package/cascader/interface.js +1 -0
- package/cascader/util.js +14 -0
- package/checkbox/Checkbox.js +16 -0
- package/checkbox/Group.js +14 -0
- package/checkbox/IconCheck.js +19 -0
- package/checkbox/index.js +4 -0
- package/checkbox/interface.js +1 -0
- package/checkbox/useCheckbox.js +45 -0
- package/chunk/{qFf1w_Jq.js → 5_U1CBIu.js} +2 -2
- package/chunk/B2yFlXke.js +6 -0
- package/chunk/B4JiMp8I.js +764 -0
- package/chunk/B4YRLi8r.js +11 -0
- package/chunk/B5RFT17G.js +15 -0
- package/chunk/{CNmmhbCn.js → B6X4lnd0.js} +32 -32
- package/chunk/B7M-FGia.js +41 -0
- package/chunk/{B7FlazNB.js → BBkdXHrJ.js} +7 -7
- package/chunk/{BHF15Dog.js → BDB0LByj.js} +20 -20
- package/chunk/BFTV6myl.js +19 -0
- package/chunk/BJ1soa2K.js +178 -0
- package/chunk/BKKEev13.js +11 -0
- package/chunk/BKT9BFf4.js +11 -0
- package/chunk/BSCrLtfQ.js +10 -0
- package/chunk/{WpO_DsK4.js → BSaQv6mx.js} +62 -60
- package/chunk/BXAeh0_V.js +16 -0
- package/chunk/Bfq4YEcr.js +23 -0
- package/chunk/Bg3uJGPu.js +10 -0
- package/chunk/{C_gJWGGh.js → Bi4UkwOR.js} +180 -168
- package/chunk/BibHFOCF.js +34 -0
- package/chunk/Biupwn8l.js +24 -0
- package/chunk/{BCftTxEy.js → BjpUSKM3.js} +184 -181
- package/chunk/{Cf5QNhkG.js → Bl7BnD1R.js} +15 -15
- package/chunk/BsY85n3_.js +14 -0
- package/chunk/C48SmsN-.js +38 -0
- package/chunk/C4OrxKE6.js +18 -0
- package/chunk/C98ks5S8.js +473 -0
- package/chunk/CC---6jO.js +110 -0
- package/chunk/{DleQ5HwG.js → CCv-5KFt.js} +58 -58
- package/chunk/CD3AUpzo.js +166 -0
- package/chunk/CIRG541s.js +22 -0
- package/chunk/CKyu68pu.js +312 -0
- package/chunk/CQ_WOOmf.js +8 -0
- package/chunk/{CKNyIitu.js → CVYWxu00.js} +10 -10
- package/chunk/CYhxqVkn.js +9 -0
- package/chunk/CbLaCJmG.js +26 -0
- package/chunk/CdaT1b_F.js +20 -0
- package/chunk/CftuXmo_.js +6 -0
- package/chunk/CgurXnoy.js +569 -0
- package/chunk/{DKr2_PYd.js → Clo26EcR.js} +10 -10
- package/chunk/ClqoGc3r.js +17 -0
- package/chunk/CmZzBtA4.js +16 -0
- package/chunk/CpGBWmuz.js +1461 -0
- package/chunk/CzQObzKd.js +1817 -0
- package/chunk/D-TPB2Do.js +56 -0
- package/chunk/D090jlwP.js +38 -0
- package/chunk/{CJ_o9tZM.js → D0ZWT7db.js} +1 -1
- package/chunk/DH7HTOV_.js +11 -0
- package/chunk/DKHXj8Kf.js +9 -0
- package/chunk/Dh7Osrvr.js +27 -0
- package/chunk/DonYzv30.js +14 -0
- package/chunk/DpoumMDw.js +50 -0
- package/chunk/Duezix3m.js +25 -0
- package/chunk/DxVvggX2.js +11 -0
- package/chunk/DzVH9IBy.js +1413 -0
- package/chunk/SSK90wgo.js +209 -0
- package/chunk/{CSC_V_25.js → URXCKjXr.js} +8 -8
- package/chunk/VSe_Wq1g.js +10 -0
- package/chunk/XTEsYGuF.js +17 -0
- package/chunk/b1e8awfs.js +31 -0
- package/chunk/hEWZQ8Zi.js +16 -0
- package/chunk/k-OUstoD.js +58 -0
- package/chunk/ll867Bf3.js +730 -0
- package/chunk/{CLiqJm_T.js → oopARUrq.js} +2 -2
- package/chunk/tamGhTJp.js +186 -0
- package/chunk/{CANgSlh3.js → uKZyjtff.js} +31 -31
- package/chunk/vmgkWLYf.js +843 -0
- package/chunk/yl4BU7Sd.js +1068 -0
- package/chunk/zmmqLCF4.js +20 -0
- package/collapse/Collapse.js +15 -0
- package/collapse/Item.js +11 -0
- package/collapse/index.js +4 -0
- package/collapse/interface.js +1 -0
- package/color-picker/ControlBar.js +63 -0
- package/color-picker/InputAlpha.js +22 -0
- package/color-picker/InputHex.js +55 -0
- package/color-picker/InputRgb.js +61 -0
- package/color-picker/Mode.js +10 -0
- package/color-picker/Palette.js +34 -0
- package/color-picker/Panel.js +268 -0
- package/color-picker/colors.js +37 -0
- package/color-picker/index.js +270 -0
- package/color-picker/interface.js +4 -0
- package/color-picker/utils.js +89 -0
- package/comment/index.js +73 -0
- package/comment/interface.js +1 -0
- package/config-provider/ConfigProvider.js +15 -0
- package/config-provider/context.js +8 -0
- package/config-provider/index.js +8 -0
- package/config-provider/interface.js +1 -0
- package/copy/index.js +63 -0
- package/copy/interface.js +1 -0
- package/date-picker/Picker.js +410 -0
- package/date-picker/PickerRange.js +24 -0
- package/date-picker/context.js +5 -0
- package/date-picker/index.js +50 -0
- package/date-picker/interface.js +1 -0
- package/date-picker/util.js +76 -0
- package/descriptions/index.js +178 -0
- package/descriptions/interface.js +1 -0
- package/divider/index.js +40 -0
- package/divider/interface.js +1 -0
- package/draggable/Item.js +67 -0
- package/draggable/index.js +32 -0
- package/draggable/interface.js +1 -0
- package/{chunk/CP0odX99.js → drawer/Drawer.js} +71 -71
- package/drawer/index.js +4 -0
- package/drawer/interface.js +1 -0
- package/dropdown/Button.js +11 -0
- package/dropdown/index.js +201 -0
- package/dropdown/interface.js +1 -0
- package/empty/index.js +9 -0
- package/empty/interface.js +1 -0
- package/form/Control.js +265 -0
- package/form/Form.js +160 -0
- package/form/FormItem.js +239 -0
- package/form/FormLabel.js +54 -0
- package/form/FormList.js +100 -0
- package/form/FormProvider.js +48 -0
- package/form/IconSymbol.js +20 -0
- package/form/context.js +43 -0
- package/form/index.js +107 -0
- package/form/interface.js +11 -0
- package/form/promisify.js +32 -0
- package/form/store.js +360 -0
- package/form/useForm.js +53 -0
- package/form/util.js +75 -0
- package/grid/Col.js +85 -0
- package/grid/Row.js +86 -0
- package/grid/context.js +9 -0
- package/grid/grid-item.js +75 -0
- package/grid/grid.js +103 -0
- package/grid/index.js +15 -0
- package/grid/interface.js +1 -0
- package/grid/util.js +51 -0
- package/hooks/index.js +38 -38
- package/hooks/useComputedState.js +2 -2
- package/hooks/useCreate.js +2 -2
- package/hooks/useForceUpdate.js +1 -1
- package/hooks/useId.js +1 -1
- package/hooks/useInView.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useInterval.js +2 -2
- package/hooks/useIsFirstRender.js +1 -1
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useMedia.js +1 -1
- package/hooks/useMergeProps.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useOnlineStatus.js +2 -2
- package/hooks/useOverflowHidden.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/usePersistCallback.js +1 -1
- package/hooks/usePrefersColorSchemeDark.js +1 -1
- package/hooks/usePrevious.js +1 -1
- package/hooks/useRefs.js +1 -1
- package/hooks/useResizeObserver.js +2 -2
- package/hooks/useStateCallback.js +1 -1
- package/hooks/useStateWithPromise.js +1 -1
- package/hooks/useUpdateEffect.js +1 -1
- package/hooks/useVerificationCode.js +10 -10
- package/hooks/useWatch.js +1 -1
- package/hooks/useWatermark.js +25 -25
- package/hooks/useWindowSize.js +1 -1
- package/icon/addFromIconFontCn.js +7 -0
- package/icon/index.js +57 -0
- package/icon-hover/index.js +7 -0
- package/image/Image.js +191 -0
- package/image/ImageFooter.js +8 -0
- package/image/ImagePreview.js +41 -0
- package/image/ImagePreviewArrow.js +46 -0
- package/image/ImagePreviewGroup.js +125 -0
- package/image/ImagePreviewToolbar.js +99 -0
- package/image/TriggerForToolbar.js +10 -0
- package/image/index.js +8 -0
- package/image/interface.js +1 -0
- package/image/previewGroupContext.js +17 -0
- package/index.js +591 -559
- package/input/Group.js +18 -0
- package/input/Input.js +688 -0
- package/input/InputElement.js +235 -0
- package/input/Number.js +4 -0
- package/input/Password.js +13 -0
- package/input/Search.js +14 -0
- package/input/Tag.js +4 -0
- package/input/Textarea.js +16 -0
- package/input/autoSizeTextAreaHeight.js +65 -0
- package/input/index.js +15 -0
- package/input/interface.js +1 -0
- package/input/useComposition.js +39 -0
- package/input-number/decimal.js +154 -0
- package/input-number/index.js +18 -0
- package/input-number/interface.js +1 -0
- package/input-number/useSelectionRange.js +26 -0
- package/input-number/util.js +57 -0
- package/input-tag/InputTag.js +384 -0
- package/input-tag/index.js +4 -0
- package/input-tag/interface.js +1 -0
- package/layout/Content.js +13 -0
- package/layout/Footer.js +13 -0
- package/layout/Header.js +13 -0
- package/{chunk/pZoNQ75H.js → layout/Sider.js} +31 -31
- package/layout/index.js +43 -0
- package/layout/interface.js +1 -0
- package/link/index.js +62 -0
- package/link/interface.js +1 -0
- package/list/Item.js +44 -0
- package/list/Meta.js +19 -0
- package/list/index.js +269 -0
- package/list/interface.js +1 -0
- package/loading/index.js +61 -0
- package/locale/en-US.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/mentions/index.js +146 -0
- package/mentions/interface.js +1 -0
- 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 +26 -0
- package/menu/OverflowWrap.js +10 -0
- package/menu/context.js +5 -0
- package/menu/index.js +11 -0
- package/menu/interface.js +1 -0
- package/menu/util.js +80 -0
- package/message/index.js +14 -0
- package/message/interface.js +1 -0
- package/message/useMessage.js +7 -0
- package/modal/Confirm.js +13 -0
- package/modal/Modal.js +21 -0
- package/modal/config.js +25 -0
- package/modal/index.js +4 -0
- package/modal/interface.js +1 -0
- package/notice/index.js +24 -0
- package/notification/index.js +16 -0
- package/notification/interface.js +1 -0
- package/notification/useNotification.js +6 -0
- package/notification/withNotification.js +49 -0
- package/overflow-ellipsis/OverflowItem.js +35 -0
- package/overflow-ellipsis/index.js +74 -0
- package/package.json +1 -1
- package/page-header/index.js +115 -0
- package/page-header/interface.js +1 -0
- package/pagination/PageItem.js +119 -0
- package/pagination/PageJumper.js +60 -0
- package/pagination/PageOption.js +47 -0
- package/pagination/Pagination.js +245 -0
- package/pagination/index.js +4 -0
- package/pagination/interface.js +1 -0
- package/picker/Input.js +130 -0
- package/picker/InputRange.js +158 -0
- package/picker/index.js +6 -0
- package/popconfirm/index.js +130 -0
- package/popconfirm/interface.js +1 -0
- package/popover/index.js +78 -0
- package/popover/interface.js +1 -0
- package/portal/Portal.js +15 -0
- package/portal/index.js +17 -0
- package/progress/CircleProgress.js +117 -0
- package/progress/LineProgess.js +103 -0
- package/progress/StepProgress.js +74 -0
- package/progress/index.js +99 -0
- package/progress/interface.js +1 -0
- package/radio/Group.js +16 -0
- package/radio/Radio.js +15 -0
- package/radio/index.js +8 -0
- package/radio/interface.js +1 -0
- package/rate/index.js +127 -0
- package/rate/interface.js +1 -0
- package/resize-box/ResizeTrigger.js +78 -0
- package/resize-box/Split.js +130 -0
- package/resize-box/SplitGroup.js +202 -0
- package/resize-box/index.js +182 -0
- package/resize-box/interface.js +1 -0
- package/result/403.js +695 -0
- package/result/404.js +513 -0
- package/result/500.js +166 -0
- package/result/index.js +77 -0
- package/result/interface.js +1 -0
- package/select/OptGroup.js +20 -0
- package/select/Option.js +95 -0
- package/select/Select.js +549 -0
- package/select/index.js +8 -0
- package/select/interface.js +1 -0
- package/select/util.js +141 -0
- package/select-view/Core.js +370 -0
- package/select-view/index.js +67 -0
- package/select-view/interface.js +1 -0
- package/skeleton/Image.js +24 -0
- package/skeleton/Text.js +27 -0
- package/skeleton/index.js +57 -0
- package/skeleton/interface.js +1 -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/index.js +429 -0
- package/slider/interface.js +1 -0
- package/slider/util.js +63 -0
- package/space/index.js +90 -0
- package/space/interface.js +1 -0
- package/space/toArray.js +11 -0
- package/speech-synthesis/index.js +109 -0
- package/spin/DotLoading.js +24 -0
- package/spin/index.js +79 -0
- package/spin/interface.js +1 -0
- package/statistic/Countdown.js +55 -0
- package/statistic/index.js +120 -0
- package/statistic/interface.js +1 -0
- package/statistic/util.js +33 -0
- package/steps/Step.js +68 -0
- package/steps/index.js +89 -0
- package/steps/interface.js +1 -0
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +12 -0
- package/switch/index.js +116 -0
- package/switch/interface.js +1 -0
- package/table/ColGroup.js +59 -0
- package/table/Table.js +24 -0
- package/table/constant.js +42 -0
- package/table/index.js +103 -0
- package/table/interface.js +1 -0
- package/table/util.js +121 -0
- package/tabs/Tab.js +18 -0
- package/tabs/TabContent.js +8 -0
- package/tabs/TabPane.js +24 -0
- package/tabs/index.js +9 -0
- package/tabs/interface.js +1 -0
- package/tabs/util.js +22 -0
- package/tag/index.js +136 -0
- package/tag/interface.js +1 -0
- package/time-picker/Picker.js +219 -0
- package/time-picker/RangePicker.js +56 -0
- package/time-picker/TimeColumn.js +65 -0
- package/time-picker/TimePicker.js +240 -0
- package/time-picker/context.js +5 -0
- package/time-picker/index.js +20 -0
- package/time-picker/interface.js +1 -0
- package/time-picker/util.js +43 -0
- package/timeline/Item.js +92 -0
- package/timeline/Timeline.js +79 -0
- package/timeline/index.js +6 -0
- package/timeline/interface.js +1 -0
- package/tooltip/index.js +140 -0
- package/tooltip/interface.js +1 -0
- package/transfer/Item.js +106 -0
- package/transfer/List.js +186 -0
- package/transfer/index.js +182 -0
- package/transfer/interface.js +1 -0
- package/tree/Animation.js +11 -0
- package/tree/Context.js +5 -0
- package/tree/Node.js +16 -0
- package/tree/NodeList.js +82 -0
- package/tree/Tree.js +580 -0
- package/tree/index.js +6 -0
- package/tree/interface.js +1 -0
- package/tree/util.js +76 -0
- package/tree-select/List.js +124 -0
- package/tree-select/Select.js +395 -0
- package/tree-select/index.js +6 -0
- package/tree-select/interface.js +13 -0
- package/tree-select/util.js +9 -0
- package/trigger/getPopupStyle.js +192 -0
- package/trigger/index.js +626 -0
- package/trigger/interface.js +1 -0
- package/types/color-picker/ControlBar.d.ts +12 -5
- package/types/color-picker/Mode.d.ts +7 -0
- package/types/color-picker/Panel.d.ts +10 -2
- package/types/color-picker/hooks/useColorPicker.d.ts +13 -11
- package/types/color-picker/hooks/useControlBlock.d.ts +10 -3
- package/types/color-picker/index.d.ts +1 -1
- package/types/color-picker/interface.d.ts +19 -7
- package/types/color-picker/utils.d.ts +23 -0
- package/types/form/Control.d.ts +54 -5
- package/types/index.d.ts +2 -3
- package/types/table/hook/useThResizable.d.ts +1 -1
- package/types/version/index.d.ts +4 -4
- package/typography/Base.js +189 -0
- package/typography/EditContent.js +46 -0
- package/typography/Ellipsis.js +124 -0
- package/typography/Operations.js +78 -0
- package/typography/Paragraph.js +24 -0
- package/typography/Text.js +11 -0
- package/typography/Title.js +12 -0
- package/typography/Typography.js +13 -0
- package/typography/index.js +278 -0
- package/typography/interface.js +1 -0
- package/typography/useCssEllipsis.js +37 -0
- package/typography/useEllipsis.js +150 -0
- package/upload/TriggerNode.js +116 -0
- package/upload/Upload.js +627 -0
- package/upload/Uploader.js +206 -0
- package/upload/index.js +8 -0
- package/upload/interface.js +9 -0
- package/upload/request.js +51 -0
- package/upload/request_.js +64 -0
- package/upload/util.js +61 -0
- package/utils/CSSTransition.js +2 -2
- package/utils/constant.js +3 -3
- package/utils/contextHolder.js +1 -1
- package/utils/dayjs.js +11 -11
- package/utils/dom.js +32 -32
- package/utils/fillNBSP.js +2 -2
- package/utils/getHighlightText.js +2 -2
- package/utils/getHotkeyHandler.js +2 -2
- package/utils/getStringLength.js +2 -2
- package/utils/include.js +2 -2
- package/utils/index.js +96 -96
- package/utils/is.js +53 -53
- package/utils/mergeProps.js +2 -2
- package/utils/mergedToString.js +2 -2
- package/utils/omit.js +2 -2
- package/utils/pad.js +12 -12
- package/utils/pick.js +4 -4
- package/utils/reactDOM.js +3 -3
- package/utils/resizeObserverEffect.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoView.js +2 -2
- package/utils/style.js +11 -11
- package/utils/throttleByRaf.js +8 -8
- package/utils/warning.js +5 -5
- package/{chunk/-UuKKT0Z.js → verification-code/VerificationCode.js} +32 -31
- package/verification-code/index.js +4 -0
- package/verification-code/interface.js +1 -0
- package/version/index.js +7 -0
- package/virtual-list/Filler.js +31 -0
- package/virtual-list/VirtualList.js +493 -0
- package/virtual-list/index.js +4 -0
- package/{chunk/CaasmWg_.js → watermark/Watermark.js} +11 -10
- package/watermark/index.js +4 -0
- package/watermark/interface.js +1 -0
- package/Version.js +0 -7
- package/chunk/B5gK1Idp.js +0 -19
- package/chunk/BBvWDeuZ.js +0 -334
- package/chunk/BGny4zSb.js +0 -166
- package/chunk/BJQ5UNa-.js +0 -1585
- package/chunk/BP9sYyk9.js +0 -8
- package/chunk/BUdtVdnv.js +0 -38
- package/chunk/BVQlOzTS.js +0 -11
- package/chunk/B__a_gb_.js +0 -519
- package/chunk/BbEYToV1.js +0 -10
- package/chunk/BbdDQAnm.js +0 -15
- package/chunk/BdUcgWdu.js +0 -11
- package/chunk/BfbXSG70.js +0 -26
- package/chunk/BndfNLK4.js +0 -186
- package/chunk/BoMCZV6K.js +0 -1098
- package/chunk/Br0B6y1T.js +0 -18
- package/chunk/BxUs8_Cr.js +0 -9
- package/chunk/C42LIMP9.js +0 -970
- package/chunk/C4YkFMzC.js +0 -778
- package/chunk/C9Wcraj7.js +0 -162
- package/chunk/CK5m7rLl.js +0 -166
- package/chunk/CPT-OZH2.js +0 -14
- package/chunk/CVSF8p0O.js +0 -698
- package/chunk/C_agcwLN.js +0 -31
- package/chunk/CkNSv2U7.js +0 -56
- package/chunk/Cp2f70gB.js +0 -9
- package/chunk/CpegYjdC.js +0 -16
- package/chunk/CucI3KZr.js +0 -20
- package/chunk/CwoFBTYz.js +0 -11
- package/chunk/D2KPqPhV.js +0 -17
- package/chunk/D7NyvE5f.js +0 -17
- package/chunk/D8oTPQ2H.js +0 -384
- package/chunk/DC1iHEiy.js +0 -912
- package/chunk/DFrfrmfK.js +0 -519
- package/chunk/DGTIZ_0O.js +0 -6
- package/chunk/DJfpiZn_.js +0 -25
- package/chunk/DNUz6zgo.js +0 -11
- package/chunk/DRtM649q.js +0 -11
- package/chunk/DS_mUWn6.js +0 -41
- package/chunk/DU6bs_19.js +0 -10
- package/chunk/DWdbwz22.js +0 -10
- package/chunk/DcveZuqd.js +0 -6
- package/chunk/DdVFknul.js +0 -24
- package/chunk/DgRfikwe.js +0 -16
- package/chunk/DkyR2EfG.js +0 -243
- package/chunk/DnrZEnQ_.js +0 -27
- package/chunk/DsRSHWtX.js +0 -1025
- package/chunk/Dz5BdmXo.js +0 -270
- package/chunk/EANe01DF.js +0 -1030
- package/chunk/GoNx5R4F.js +0 -873
- package/chunk/HDUQku8d.js +0 -20
- package/chunk/HrAP__Hi.js +0 -25
- package/chunk/SLWP34OR.js +0 -229
- package/chunk/VVKtwaGf.js +0 -278
- package/chunk/WPNpLxSI.js +0 -16
- package/chunk/fdU3ang6.js +0 -14
- package/chunk/fkclKOAL.js +0 -830
- package/chunk/flvYlqx3.js +0 -22
- package/chunk/kTDayEpF.js +0 -288
- package/chunk/w-kM1L5W.js +0 -445
- package/types/form/Control-old.d.ts +0 -56
- package/types/style/index.d.ts +0 -1
package/tree/Tree.js
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { jsx as ce } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Oe, useContext as Se, useRef as O, useState as ve, useImperativeHandle as Te, useEffect as F, createElement as Ae } from "react";
|
|
3
|
+
import { G as Ie } from "../chunk/URXCKjXr.js";
|
|
4
|
+
import b from "lodash/get";
|
|
5
|
+
import z from "lodash/has";
|
|
6
|
+
import Me from "lodash/isArray";
|
|
7
|
+
import D from "lodash/isEqualWith";
|
|
8
|
+
import He from "lodash/isFunction";
|
|
9
|
+
import re from "lodash/isUndefined";
|
|
10
|
+
import { a as $e } from "../chunk/ll867Bf3.js";
|
|
11
|
+
import { m as se } from "../chunk/JPPo5nY_.js";
|
|
12
|
+
import { a as We } from "../chunk/ClqoGc3r.js";
|
|
13
|
+
import { TreeContext as Re } from "./Context.js";
|
|
14
|
+
import { N as le } from "../chunk/CKyu68pu.js";
|
|
15
|
+
import je from "./NodeList.js";
|
|
16
|
+
import { getTreeDataFromTreeChildren as Fe, getCheckedKeysByInitKeys as ze, getAllCheckedKeysByCheck as qe } from "./util.js";
|
|
17
|
+
const de = {
|
|
18
|
+
key: "key",
|
|
19
|
+
title: "title",
|
|
20
|
+
children: "children",
|
|
21
|
+
selectable: "selectable",
|
|
22
|
+
disabled: "disabled",
|
|
23
|
+
disableCheckbox: "disableCheckbox",
|
|
24
|
+
checkable: "checkable",
|
|
25
|
+
isLeaf: "isLeaf"
|
|
26
|
+
}, ie = "parent", oe = "all", ae = "child", Be = {
|
|
27
|
+
selectable: !0,
|
|
28
|
+
autoExpandParent: !0,
|
|
29
|
+
checkedStrategy: oe,
|
|
30
|
+
actionOnClick: "select",
|
|
31
|
+
allowDrop: () => !0,
|
|
32
|
+
fieldNames: de,
|
|
33
|
+
animation: !0
|
|
34
|
+
}, Ue = [
|
|
35
|
+
"style",
|
|
36
|
+
"className",
|
|
37
|
+
"height",
|
|
38
|
+
"size",
|
|
39
|
+
"blockNode",
|
|
40
|
+
"autoExpandParent",
|
|
41
|
+
"checkedStrategy",
|
|
42
|
+
"fieldNames",
|
|
43
|
+
"icons",
|
|
44
|
+
"virtualListProps",
|
|
45
|
+
"showLine",
|
|
46
|
+
"selectable",
|
|
47
|
+
"allowDrop",
|
|
48
|
+
"actionOnClick",
|
|
49
|
+
"animation"
|
|
50
|
+
];
|
|
51
|
+
function Ve(s, ye) {
|
|
52
|
+
const w = Se($e), q = O(null), h = O({}), N = O(), v = O(), I = O(), [o, x] = ve(() => {
|
|
53
|
+
const e = M(), c = H(e, w.getPrefixCls("tree")), { checkedKeys: n, halfCheckedKeys: t } = $(
|
|
54
|
+
s.checkedKeys || s.defaultCheckedKeys || []
|
|
55
|
+
);
|
|
56
|
+
return {
|
|
57
|
+
selectedKeys: s.selectedKeys || s.defaultSelectedKeys || [],
|
|
58
|
+
checkedKeys: n,
|
|
59
|
+
halfCheckedKeys: t,
|
|
60
|
+
expandedKeys: U(
|
|
61
|
+
s.expandedKeys || s.defaultExpandedKeys
|
|
62
|
+
),
|
|
63
|
+
loadedKeys: [],
|
|
64
|
+
loadingKeys: [],
|
|
65
|
+
currentExpandKeys: [],
|
|
66
|
+
nodeList: c
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
function g(e) {
|
|
70
|
+
const { componentConfig: c } = w ?? {}, n = e || s, t = (c == null ? void 0 : c.Tree) || {}, l = {};
|
|
71
|
+
return Ue.forEach((r) => {
|
|
72
|
+
re(n[r]) ? re(t[r]) ? l[r] = Be[r] : l[r] = t[r] : l[r] = n[r];
|
|
73
|
+
}), l;
|
|
74
|
+
}
|
|
75
|
+
function fe(e, c) {
|
|
76
|
+
let n = e;
|
|
77
|
+
c && (n = c._key), I.current && I.current.scrollIntoView(
|
|
78
|
+
n,
|
|
79
|
+
c || h.current[n]
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function M() {
|
|
83
|
+
return "treeData" in s ? s.treeData : Fe(s.children);
|
|
84
|
+
}
|
|
85
|
+
function ue(e, c) {
|
|
86
|
+
const n = [
|
|
87
|
+
"fieldNames",
|
|
88
|
+
"selectable",
|
|
89
|
+
"draggable",
|
|
90
|
+
"checkStrictly",
|
|
91
|
+
"showLine",
|
|
92
|
+
"blockNode",
|
|
93
|
+
"checkable",
|
|
94
|
+
"treeData",
|
|
95
|
+
"children"
|
|
96
|
+
];
|
|
97
|
+
return e.treeData !== c.treeData || e.children !== c.children || n.some((t) => D(e[t], c[t]));
|
|
98
|
+
}
|
|
99
|
+
function B(e) {
|
|
100
|
+
const c = g(), { selectable: n } = c, t = {
|
|
101
|
+
...de,
|
|
102
|
+
..."treeData" in s ? c.fieldNames : {}
|
|
103
|
+
}, l = {
|
|
104
|
+
children: b(e, t.children),
|
|
105
|
+
selectable: z(e, t.selectable) ? b(e, t.selectable) : n,
|
|
106
|
+
checkable: z(e, t.checkable) ? b(e, t.checkable) : s.checkable,
|
|
107
|
+
title: b(e, t.title),
|
|
108
|
+
disabled: b(e, t.disabled),
|
|
109
|
+
disableCheckbox: b(e, t.disableCheckbox),
|
|
110
|
+
isLeaf: b(e, t.isLeaf),
|
|
111
|
+
key: b(e, t.key)
|
|
112
|
+
};
|
|
113
|
+
return z(e, t.key) || delete l.key, l;
|
|
114
|
+
}
|
|
115
|
+
function H(e, c) {
|
|
116
|
+
h.current = {};
|
|
117
|
+
const n = c || w.getPrefixCls("tree"), t = [];
|
|
118
|
+
let l = 0;
|
|
119
|
+
const { showLine: r, blockNode: i } = g(), d = (y, a) => {
|
|
120
|
+
const m = y.length;
|
|
121
|
+
return y.map((k, f) => {
|
|
122
|
+
const {
|
|
123
|
+
children: C,
|
|
124
|
+
selectable: u,
|
|
125
|
+
checkable: E,
|
|
126
|
+
key: _ = `${(a == null ? void 0 : a._key) || ""}-${f}`,
|
|
127
|
+
...j
|
|
128
|
+
} = B(k), L = {
|
|
129
|
+
// data 中含有dataRef时,优先级较高
|
|
130
|
+
dataRef: k,
|
|
131
|
+
draggable: s.draggable,
|
|
132
|
+
selectable: u,
|
|
133
|
+
checkable: E,
|
|
134
|
+
showLine: r,
|
|
135
|
+
blockNode: i,
|
|
136
|
+
...k,
|
|
137
|
+
...j,
|
|
138
|
+
key: _,
|
|
139
|
+
children: C,
|
|
140
|
+
_key: _,
|
|
141
|
+
_index: l++,
|
|
142
|
+
parentKey: a ? a._key : void 0,
|
|
143
|
+
pathParentKeys: a && a.pathParentKeys || [],
|
|
144
|
+
_level: a._level || 0,
|
|
145
|
+
// 保存node在sowLine模式下是否显示缩进线。如果父节点是其所在层级的最后一个节点,那么所有的子节点(包括孙子节点等)在父节点所在层级的缩进格都不显示缩进线。
|
|
146
|
+
_lineless: a && a._lineless ? [...a._lineless || [], a._isTail] : []
|
|
147
|
+
};
|
|
148
|
+
return m === f + 1 && (L.className = se(
|
|
149
|
+
`${n}-node-is-tail`,
|
|
150
|
+
L.className
|
|
151
|
+
)), t.push(L), h.current[_] = L, C && C.length && (h.current[_].children = d(C, {
|
|
152
|
+
_key: _,
|
|
153
|
+
_level: L._level + 1,
|
|
154
|
+
_lineless: L._lineless,
|
|
155
|
+
_isTail: m === f + 1,
|
|
156
|
+
pathParentKeys: [...(a == null ? void 0 : a.pathParentKeys) || [], _]
|
|
157
|
+
})), L;
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
return d(e || [], {}), t;
|
|
161
|
+
}
|
|
162
|
+
function U(e) {
|
|
163
|
+
if (!g().autoExpandParent)
|
|
164
|
+
return e || [];
|
|
165
|
+
if (!e)
|
|
166
|
+
return Object.keys(h.current).filter((n) => {
|
|
167
|
+
const t = h.current[n];
|
|
168
|
+
return t.children && t.children.length;
|
|
169
|
+
});
|
|
170
|
+
const c = {};
|
|
171
|
+
return e.forEach((n) => {
|
|
172
|
+
const t = h.current[n];
|
|
173
|
+
t && (c[n] = 1, t.pathParentKeys && t.pathParentKeys.forEach((l) => {
|
|
174
|
+
c[l] = 1;
|
|
175
|
+
}));
|
|
176
|
+
}), Object.keys(c);
|
|
177
|
+
}
|
|
178
|
+
function $(e) {
|
|
179
|
+
if (!s.checkStrictly) {
|
|
180
|
+
const { checkedKeys: c, indeterminateKeys: n } = ze(
|
|
181
|
+
e,
|
|
182
|
+
h.current
|
|
183
|
+
);
|
|
184
|
+
return {
|
|
185
|
+
checkedKeys: c,
|
|
186
|
+
halfCheckedKeys: n
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
checkedKeys: e,
|
|
191
|
+
halfCheckedKeys: s.halfCheckedKeys || []
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function he(e, c) {
|
|
195
|
+
const { onSelect: n } = s, t = { e: c, node: K([e])[0] };
|
|
196
|
+
if (s.multiple) {
|
|
197
|
+
const l = [...o.selectedKeys], r = l.indexOf(e);
|
|
198
|
+
r > -1 ? (l.splice(r, 1), t.selected = !1) : (t.selected = !0, l.push(e)), t.selectedNodes = K(l), "selectedKeys" in s || x((i) => {
|
|
199
|
+
const d = { ...i };
|
|
200
|
+
return d.selectedKeys = l, d;
|
|
201
|
+
}), n == null || n(l, t);
|
|
202
|
+
} else
|
|
203
|
+
t.selected = !0, t.selectedNodes = K([e]), "selectedKeys" in s || x((l) => {
|
|
204
|
+
const r = { ...l };
|
|
205
|
+
return r.selectedKeys = [e], r;
|
|
206
|
+
}), n == null || n([e], t);
|
|
207
|
+
}
|
|
208
|
+
function V(e, c, n) {
|
|
209
|
+
const { checkedStrategy: t } = g(), { onCheck: l, checkStrictly: r } = s, i = { e: n, node: K([c])[0] };
|
|
210
|
+
let d = [...o.checkedKeys || []], y = o.halfCheckedKeys;
|
|
211
|
+
if (r) {
|
|
212
|
+
e ? d = d.concat(c) : d = d.filter((m) => m !== c);
|
|
213
|
+
const a = {};
|
|
214
|
+
"checkedKeys" in s || (a.checkedKeys = d), "halfCheckedKeys" in s || (a.halfCheckedKeys = y), Ie(a) || x((m) => ({ ...m, ...a }));
|
|
215
|
+
} else {
|
|
216
|
+
const { checkedKeys: a, indeterminateKeys: m } = qe(
|
|
217
|
+
c,
|
|
218
|
+
e,
|
|
219
|
+
d,
|
|
220
|
+
h.current,
|
|
221
|
+
y
|
|
222
|
+
);
|
|
223
|
+
d = a, y = m, "checkedKeys" in s ? x((k) => {
|
|
224
|
+
const f = { ...k };
|
|
225
|
+
return f.halfCheckedKeys = y, f;
|
|
226
|
+
}) : x((k) => {
|
|
227
|
+
const f = { ...k };
|
|
228
|
+
return f.checkedKeys = d, f.halfCheckedKeys = y, f;
|
|
229
|
+
}), t === ie ? d = d.filter((k) => {
|
|
230
|
+
const f = h.current[k];
|
|
231
|
+
if (!f || d.indexOf(f.parentKey) === -1)
|
|
232
|
+
return !0;
|
|
233
|
+
}) : t === ae && (d = d.filter((k) => {
|
|
234
|
+
var C, u;
|
|
235
|
+
const f = h.current[k];
|
|
236
|
+
if (!f || !((C = f.children) != null && C.length) || (u = f.children) != null && u.every((E) => d.indexOf(E._key) === -1))
|
|
237
|
+
return !0;
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
l == null || l(d, {
|
|
241
|
+
checkedNodes: K(d),
|
|
242
|
+
checked: e,
|
|
243
|
+
halfCheckedKeys: y,
|
|
244
|
+
halfCheckedNodes: K(y),
|
|
245
|
+
...i
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
function Ke(e) {
|
|
249
|
+
if (He(s.loadMore)) {
|
|
250
|
+
const { loadingKeys: c = [], loadedKeys: n } = o;
|
|
251
|
+
x((t) => {
|
|
252
|
+
const l = { ...t };
|
|
253
|
+
return l.loadingKeys = Array.from(/* @__PURE__ */ new Set([...c, e._key])), l.loadedKeys = n.filter((r) => r !== e._key), l;
|
|
254
|
+
}), A == null || A(K([e._key])[0]).then((t) => {
|
|
255
|
+
x((l) => {
|
|
256
|
+
const r = { ...l };
|
|
257
|
+
return r.loadingKeys = l.loadingKeys.filter((i) => i !== e._key), r.loadedKeys = Array.from(/* @__PURE__ */ new Set([...l.loadedKeys, e._key])), r;
|
|
258
|
+
}), W(!e.expanded, e._key);
|
|
259
|
+
}).catch((t) => {
|
|
260
|
+
x((l) => {
|
|
261
|
+
const r = { ...l };
|
|
262
|
+
return r.loadingKeys = l.loadingKeys.filter((i) => i !== e._key), r;
|
|
263
|
+
}), console.error("[tree]load data error: ", t);
|
|
264
|
+
}).finally(() => {
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function ke(e, c) {
|
|
269
|
+
N.current = K([c._key])[0], v.current = 0;
|
|
270
|
+
const { onDragStart: n } = s;
|
|
271
|
+
n == null || n(e, K([c._key])[0]);
|
|
272
|
+
}
|
|
273
|
+
function xe(e, c) {
|
|
274
|
+
N.current = null, v.current = 0;
|
|
275
|
+
const { onDragEnd: n } = s;
|
|
276
|
+
n == null || n(e, K([c._key])[0]);
|
|
277
|
+
}
|
|
278
|
+
function me(e, c, n) {
|
|
279
|
+
v.current = n;
|
|
280
|
+
const { onDragOver: t } = s;
|
|
281
|
+
t == null || t(e, K([c._key])[0]);
|
|
282
|
+
}
|
|
283
|
+
function ge(e, c) {
|
|
284
|
+
v.current = 0;
|
|
285
|
+
const { onDragLeave: n } = s;
|
|
286
|
+
n == null || n(e, K([c._key])[0]);
|
|
287
|
+
}
|
|
288
|
+
function Ce(e, c) {
|
|
289
|
+
let n = h.current[e.parentKey];
|
|
290
|
+
for (; n; ) {
|
|
291
|
+
const { _key: t, parentKey: l } = n;
|
|
292
|
+
if (t === c.props._key)
|
|
293
|
+
return !0;
|
|
294
|
+
if (l === t)
|
|
295
|
+
return;
|
|
296
|
+
n = h.current[l];
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function G(e, c) {
|
|
300
|
+
if (e === void 0 || c === void 0)
|
|
301
|
+
return !1;
|
|
302
|
+
if (e === c)
|
|
303
|
+
return !0;
|
|
304
|
+
const n = e.key, t = c.key;
|
|
305
|
+
if (n !== void 0 || t !== void 0)
|
|
306
|
+
return n === t;
|
|
307
|
+
const l = e.props._key, r = c.props._key;
|
|
308
|
+
return l === void 0 && r === void 0 ? !1 : l === r;
|
|
309
|
+
}
|
|
310
|
+
function J(e, c, n) {
|
|
311
|
+
if (N.current) {
|
|
312
|
+
const { allowDrop: t } = g(), { onDrop: l } = s, r = K([c._key])[0];
|
|
313
|
+
if (l && !Ce(c, N.current) && !G(N.current, r)) {
|
|
314
|
+
if (t && !t({
|
|
315
|
+
dropNode: r,
|
|
316
|
+
dragNode: N.current,
|
|
317
|
+
dropPosition: n
|
|
318
|
+
}))
|
|
319
|
+
return;
|
|
320
|
+
l({
|
|
321
|
+
dragNode: N.current,
|
|
322
|
+
dropNode: r,
|
|
323
|
+
dropPosition: n,
|
|
324
|
+
e
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function Q(e, c) {
|
|
330
|
+
const { allowDrop: n } = g();
|
|
331
|
+
let t = !0;
|
|
332
|
+
return typeof n == "function" && (t = n({
|
|
333
|
+
dropNode: K([e._key])[0],
|
|
334
|
+
dragNode: N.current,
|
|
335
|
+
dropPosition: c
|
|
336
|
+
})), t;
|
|
337
|
+
}
|
|
338
|
+
function W(e, c) {
|
|
339
|
+
const { currentExpandKeys: n, expandedKeys: t = [] } = o, { animation: l } = g(), { onExpand: r } = s;
|
|
340
|
+
if (n.indexOf(c) > -1)
|
|
341
|
+
return;
|
|
342
|
+
let i = [];
|
|
343
|
+
e ? i = Array.from(/* @__PURE__ */ new Set([...t, c])) : i = t.filter((d) => d !== c), "expandedKeys" in s || x((d) => {
|
|
344
|
+
const y = { ...d };
|
|
345
|
+
return y.expandedKeys = i, y.currentExpandKeys = l ? [...n, c] : [], y;
|
|
346
|
+
}), r == null || r(i, {
|
|
347
|
+
expanded: e,
|
|
348
|
+
node: K([c])[0],
|
|
349
|
+
expandedNodes: K(i)
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function K(e) {
|
|
353
|
+
const { __PqbAdapterMode__: c } = s, n = [];
|
|
354
|
+
return [].concat(e).forEach((l) => {
|
|
355
|
+
const r = h.current[l];
|
|
356
|
+
r && n.push(r);
|
|
357
|
+
}), T(n).map((l) => c ? {
|
|
358
|
+
props: l,
|
|
359
|
+
key: e
|
|
360
|
+
} : /* @__PURE__ */ Ae(le, { ...l, key: l.key }));
|
|
361
|
+
}
|
|
362
|
+
function R(e) {
|
|
363
|
+
return {
|
|
364
|
+
expandedKeysSet: (e == null ? void 0 : e.expandedKeysSet) || new Set((o == null ? void 0 : o.expandedKeys) || []),
|
|
365
|
+
checkedKeysSet: (e == null ? void 0 : e.checkedKeysSet) || new Set((o == null ? void 0 : o.checkedKeys) || []),
|
|
366
|
+
selectedKeysSet: (e == null ? void 0 : e.selectedKeysSet) || new Set((o == null ? void 0 : o.selectedKeys) || []),
|
|
367
|
+
halfCheckedKeysSet: (e == null ? void 0 : e.halfCheckedKeysSet) || new Set((o == null ? void 0 : o.halfCheckedKeys) || [])
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function T(e, c) {
|
|
371
|
+
const { autoExpandParent: n } = g(), { loadMore: t } = s, {
|
|
372
|
+
selectedKeys: l,
|
|
373
|
+
expandedKeys: r,
|
|
374
|
+
checkedKeys: i,
|
|
375
|
+
loadingKeys: d = [],
|
|
376
|
+
loadedKeys: y = []
|
|
377
|
+
} = o, {
|
|
378
|
+
expandedKeysSet: a,
|
|
379
|
+
checkedKeysSet: m,
|
|
380
|
+
selectedKeysSet: k,
|
|
381
|
+
halfCheckedKeysSet: f
|
|
382
|
+
} = R(c), C = (u) => {
|
|
383
|
+
const E = u.children && u.children.length, _ = {
|
|
384
|
+
isLeaf: !E,
|
|
385
|
+
autoExpandParent: E ? n : !1,
|
|
386
|
+
expanded: a ? a.has(u._key) : r.indexOf(u._key) > -1
|
|
387
|
+
};
|
|
388
|
+
if (t) {
|
|
389
|
+
const j = y.indexOf(u._key) > -1;
|
|
390
|
+
_.loaded = j, _.isLeaf = E ? !1 : u.isLeaf;
|
|
391
|
+
}
|
|
392
|
+
return {
|
|
393
|
+
...u,
|
|
394
|
+
..._,
|
|
395
|
+
selected: k.has(u._key),
|
|
396
|
+
indeterminated: f.has(u._key),
|
|
397
|
+
loading: d.indexOf(u._key) > -1,
|
|
398
|
+
checked: m.has(u._key),
|
|
399
|
+
selectedKeys: l,
|
|
400
|
+
checkedKeys: i,
|
|
401
|
+
loadingKeys: d,
|
|
402
|
+
loadedKeys: y,
|
|
403
|
+
expandedKeys: r,
|
|
404
|
+
childrenData: u.children || [],
|
|
405
|
+
children: null
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
return Me(e) ? e.map((u) => C(u)) : C(e);
|
|
409
|
+
}
|
|
410
|
+
function X(e) {
|
|
411
|
+
x((c) => {
|
|
412
|
+
const n = { ...c }, { currentExpandKeys: t } = c;
|
|
413
|
+
return t.indexOf(e) > -1 && (n.currentExpandKeys = t.filter((l) => l !== e)), n;
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
function Y() {
|
|
417
|
+
return o;
|
|
418
|
+
}
|
|
419
|
+
Te(ye, () => ({
|
|
420
|
+
scrollIntoView: fe,
|
|
421
|
+
handleCheck: V,
|
|
422
|
+
getTreeState: Y,
|
|
423
|
+
handleExpandEnd: X,
|
|
424
|
+
getNodeProps: T,
|
|
425
|
+
getDataSet: R,
|
|
426
|
+
getCacheNode: K,
|
|
427
|
+
handleExpand: W,
|
|
428
|
+
handleAllowDrop: Q,
|
|
429
|
+
handleNodeDrop: J,
|
|
430
|
+
isSameNode: G
|
|
431
|
+
})), F(() => {
|
|
432
|
+
const e = q.current, c = g(e), n = g();
|
|
433
|
+
if (e !== s || !D(c, n)) {
|
|
434
|
+
const t = {};
|
|
435
|
+
if (ue(
|
|
436
|
+
{ prevMergedProps: c, ...e },
|
|
437
|
+
{ ...n, ...s }
|
|
438
|
+
)) {
|
|
439
|
+
const r = M(), i = H(r);
|
|
440
|
+
t.treeData = r, t.nodeList = i;
|
|
441
|
+
}
|
|
442
|
+
if (t.treeData || "checkedKeys" in s && !D(e == null ? void 0 : e.checkedKeys, s.checkedKeys)) {
|
|
443
|
+
const r = "checkedKeys" in s ? s.checkedKeys : o.checkedKeys, { halfCheckedKeys: i, checkedKeys: d } = $(
|
|
444
|
+
r || []
|
|
445
|
+
);
|
|
446
|
+
D(d, o.checkedKeys) || (t.checkedKeys = d), D(i, o.halfCheckedKeys) || (t.halfCheckedKeys = i);
|
|
447
|
+
}
|
|
448
|
+
s.checkStrictly && "halfCheckedKeys" in s && !D(e == null ? void 0 : e.halfCheckedKeys, s.halfCheckedKeys) && (t.halfCheckedKeys = s.halfCheckedKeys), "expandedKeys" in s && !D(s.expandedKeys, e == null ? void 0 : e.expandedKeys) && (t.expandedKeys = s.expandedKeys, t.currentExpandKeys = n.animation ? [...t.expandedKeys ?? [], ...o.expandedKeys ?? []].reduce((r, i) => {
|
|
449
|
+
const d = r.indexOf(i);
|
|
450
|
+
return d === -1 ? r.push(i) : r.splice(d, 1), r;
|
|
451
|
+
}, []).filter((r, i, d) => {
|
|
452
|
+
var y;
|
|
453
|
+
if (h.current[r])
|
|
454
|
+
return h.current[r].pathParentKeys.some((m) => d.indexOf(m) > -1) ? !1 : (y = h.current[r].children) == null ? void 0 : y.length;
|
|
455
|
+
}) : []);
|
|
456
|
+
const l = t.currentExpandKeys || o.currentExpandKeys;
|
|
457
|
+
t.treeData && l && (t.currentExpandKeys = l.filter((r) => {
|
|
458
|
+
const i = t.treeData.find((d) => d.key === r);
|
|
459
|
+
return i && i.children && i.children.length;
|
|
460
|
+
})), Object.keys(t).length && x((r) => ({ ...r, ...t }));
|
|
461
|
+
}
|
|
462
|
+
return q.current = s, () => {
|
|
463
|
+
};
|
|
464
|
+
}), F(() => ("selectedKeys" in s && !D(s.selectedKeys, o.selectedKeys) && x((e) => {
|
|
465
|
+
const c = { ...e };
|
|
466
|
+
return c.selectedKeys = s.selectedKeys || [], c;
|
|
467
|
+
}), () => {
|
|
468
|
+
}), [s.selectedKeys, o.selectedKeys]), F(() => {
|
|
469
|
+
const e = M(), c = H(e, w.getPrefixCls("tree")), { checkedKeys: n, halfCheckedKeys: t } = $(
|
|
470
|
+
s.checkedKeys || s.defaultCheckedKeys || []
|
|
471
|
+
);
|
|
472
|
+
return x((l) => {
|
|
473
|
+
let r = { ...l };
|
|
474
|
+
return r = {
|
|
475
|
+
...r,
|
|
476
|
+
selectedKeys: s.selectedKeys || s.defaultSelectedKeys || [],
|
|
477
|
+
checkedKeys: n,
|
|
478
|
+
halfCheckedKeys: t,
|
|
479
|
+
expandedKeys: U(
|
|
480
|
+
s.expandedKeys || s.defaultExpandedKeys
|
|
481
|
+
),
|
|
482
|
+
loadedKeys: [],
|
|
483
|
+
loadingKeys: [],
|
|
484
|
+
currentExpandKeys: [],
|
|
485
|
+
nodeList: c
|
|
486
|
+
}, r;
|
|
487
|
+
}), () => {
|
|
488
|
+
};
|
|
489
|
+
}, []);
|
|
490
|
+
const {
|
|
491
|
+
className: _e,
|
|
492
|
+
showLine: Ne,
|
|
493
|
+
size: Z,
|
|
494
|
+
virtualListProps: p,
|
|
495
|
+
height: ee,
|
|
496
|
+
style: be,
|
|
497
|
+
icons: De,
|
|
498
|
+
actionOnClick: Ee,
|
|
499
|
+
animation: te
|
|
500
|
+
} = g(), { loadMore: A, checkable: Le } = s, ne = p ? {
|
|
501
|
+
threshold: 100,
|
|
502
|
+
...p
|
|
503
|
+
} : ee ? { height: ee, threshold: 100 } : {
|
|
504
|
+
threshold: null
|
|
505
|
+
}, { getPrefixCls: we, rtl: Pe } = w, P = we("tree");
|
|
506
|
+
return /* @__PURE__ */ ce(
|
|
507
|
+
Re.Provider,
|
|
508
|
+
{
|
|
509
|
+
value: {
|
|
510
|
+
icons: De,
|
|
511
|
+
animation: te,
|
|
512
|
+
key2nodeProps: h.current,
|
|
513
|
+
getFieldInfo: B,
|
|
514
|
+
getTreeState: Y,
|
|
515
|
+
getNodeProps: T,
|
|
516
|
+
onExpandEnd: te ? X : () => {
|
|
517
|
+
},
|
|
518
|
+
onSelect: he,
|
|
519
|
+
onCheck: V,
|
|
520
|
+
onNodeDragStart: ke,
|
|
521
|
+
onNodeDragEnd: xe,
|
|
522
|
+
onNodeDragLeave: ge,
|
|
523
|
+
onNodeDragOver: me,
|
|
524
|
+
onNodeDrop: J,
|
|
525
|
+
onExpand: W,
|
|
526
|
+
renderExtra: s.renderExtra,
|
|
527
|
+
renderTitle: s.renderTitle,
|
|
528
|
+
loadMore: A && Ke,
|
|
529
|
+
allowDrop: Q,
|
|
530
|
+
actionOnClick: Ee,
|
|
531
|
+
virtualListProps: ne
|
|
532
|
+
},
|
|
533
|
+
children: /* @__PURE__ */ ce(
|
|
534
|
+
je,
|
|
535
|
+
{
|
|
536
|
+
ref: (e) => {
|
|
537
|
+
I.current = e;
|
|
538
|
+
},
|
|
539
|
+
className: se(
|
|
540
|
+
P,
|
|
541
|
+
{
|
|
542
|
+
[`${P}-checkable`]: Le,
|
|
543
|
+
[`${P}-show-line`]: Ne,
|
|
544
|
+
[`${P}-size-${Z}`]: Z,
|
|
545
|
+
[`${P}-rtl`]: Pe
|
|
546
|
+
},
|
|
547
|
+
_e
|
|
548
|
+
),
|
|
549
|
+
style: be,
|
|
550
|
+
filterNode: s.filterNode,
|
|
551
|
+
virtualListProps: ne,
|
|
552
|
+
expandedKeys: o.expandedKeys,
|
|
553
|
+
currentExpandKeys: o.currentExpandKeys,
|
|
554
|
+
getNodeProps: T,
|
|
555
|
+
getDataSet: R,
|
|
556
|
+
nodeList: o.nodeList,
|
|
557
|
+
onMouseDown: s.onMouseDown,
|
|
558
|
+
ariaProps: {
|
|
559
|
+
role: "tree",
|
|
560
|
+
"aria-multiselectable": s.multiple,
|
|
561
|
+
tabIndex: 0,
|
|
562
|
+
...We(s)
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
)
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
const S = Oe(
|
|
570
|
+
Ve
|
|
571
|
+
);
|
|
572
|
+
S.displayName = "Tree";
|
|
573
|
+
S.SHOW_PARENT = ie;
|
|
574
|
+
S.SHOW_ALL = oe;
|
|
575
|
+
S.SHOW_CHILD = ae;
|
|
576
|
+
S.Node = le;
|
|
577
|
+
export {
|
|
578
|
+
le as TreeNode,
|
|
579
|
+
S as default
|
|
580
|
+
};
|
package/tree/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/tree/util.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import o from "react";
|
|
2
|
+
const C = (t) => {
|
|
3
|
+
const n = (r) => o.Children.map(r, (e) => {
|
|
4
|
+
if (!o.isValidElement(e))
|
|
5
|
+
return;
|
|
6
|
+
const d = e.key;
|
|
7
|
+
return {
|
|
8
|
+
...e.props,
|
|
9
|
+
key: d,
|
|
10
|
+
children: n(e.props.children)
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
return n(t);
|
|
14
|
+
};
|
|
15
|
+
function f(t, n) {
|
|
16
|
+
const r = /* @__PURE__ */ new Set(), e = (d) => {
|
|
17
|
+
d.map((s) => {
|
|
18
|
+
const c = s.key, a = n[c];
|
|
19
|
+
!a || a.disabled || a.disableCheckbox || a.checkable === !1 || (r.add(c), e(a.children || []));
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return t && e(t.children || []), r;
|
|
23
|
+
}
|
|
24
|
+
const u = (t, n, r, e) => {
|
|
25
|
+
[...n[t].pathParentKeys].reverse().some((s) => {
|
|
26
|
+
const c = n[s];
|
|
27
|
+
if (c && !c.disabled && !c.disableCheckbox && c.checkable !== !1) {
|
|
28
|
+
let a = 0, l = 0;
|
|
29
|
+
c.children.some(({ key: i }) => {
|
|
30
|
+
const h = n[i];
|
|
31
|
+
if (!h || h.disabled || h.disableCheckbox || h.checkable === !1)
|
|
32
|
+
return !1;
|
|
33
|
+
if (a++, r.has(i))
|
|
34
|
+
l++;
|
|
35
|
+
else if (e.has(i))
|
|
36
|
+
return l += 0.5, !0;
|
|
37
|
+
}), !l || l === a ? e.delete(s) : e.add(s), l && l === a ? r.add(s) : r.delete(s);
|
|
38
|
+
} else
|
|
39
|
+
return !0;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
function K(t, n) {
|
|
43
|
+
const r = new Set(t || []), e = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
44
|
+
return t.forEach((s) => {
|
|
45
|
+
d.has(s) || f(n[s], n).forEach((a) => {
|
|
46
|
+
d.add(a);
|
|
47
|
+
}), n[s] && !n[s].pathParentKeys.some(
|
|
48
|
+
(c) => r.has(c)
|
|
49
|
+
) && u(s, n, r, e);
|
|
50
|
+
}), {
|
|
51
|
+
checkedKeys: [.../* @__PURE__ */ new Set([...r, ...d])],
|
|
52
|
+
indeterminateKeys: [...e]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function S(t, n, r, e, d) {
|
|
56
|
+
if (!e[t])
|
|
57
|
+
return {
|
|
58
|
+
checkedKeys: r,
|
|
59
|
+
indeterminateKeys: d
|
|
60
|
+
};
|
|
61
|
+
const s = new Set(r), c = new Set(d), a = f(e[t], e), l = s;
|
|
62
|
+
return n ? (l.add(t), c.delete(t), a.forEach((i) => {
|
|
63
|
+
l.add(i);
|
|
64
|
+
})) : (c.delete(t), l.delete(t), a.forEach((i) => {
|
|
65
|
+
l.delete(i);
|
|
66
|
+
})), u(t, e, s, c), {
|
|
67
|
+
checkedKeys: [...l],
|
|
68
|
+
indeterminateKeys: [...c]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
S as getAllCheckedKeysByCheck,
|
|
73
|
+
K as getCheckedKeysByInitKeys,
|
|
74
|
+
f as getChildNodeKeys,
|
|
75
|
+
C as getTreeDataFromTreeChildren
|
|
76
|
+
};
|