@unicom-cloud/ui 0.8.44 → 0.8.46
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 -250
- 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 -722
- 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 -398
- 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/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 +1 -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 +168 -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/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 +2 -120
- package/types/input-tag/InputTag.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/{chunk/K6Dvbx-E.js → virtual-list/style/index.less.js} +0 -0
package/ResizeBox.js
CHANGED
|
@@ -1,436 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function Mt(r) {
|
|
23
|
-
const {
|
|
24
|
-
className: ot,
|
|
25
|
-
direction: g,
|
|
26
|
-
icon: Z,
|
|
27
|
-
onMouseDown: q,
|
|
28
|
-
onResize: x,
|
|
29
|
-
children: J,
|
|
30
|
-
collapsible: N = {},
|
|
31
|
-
resizable: W = !0,
|
|
32
|
-
renderChildren: b,
|
|
33
|
-
...K
|
|
34
|
-
} = r, { getPrefixCls: rt, rtl: z } = ft(mt), d = rt("resizebox-trigger"), H = g === "horizontal", M = z && !H, T = E(
|
|
35
|
-
d,
|
|
36
|
-
`${d}-${H ? "horizontal" : "vertical"}`,
|
|
37
|
-
{ [`${d}-not-resizable`]: !W },
|
|
38
|
-
{ [`${d}-rtl`]: z },
|
|
39
|
-
ot
|
|
40
|
-
), f = M ? [/* @__PURE__ */ m(bt, {}, "prev"), /* @__PURE__ */ m(It, {}, "next")] : [/* @__PURE__ */ m(It, {}, "prev"), /* @__PURE__ */ m(bt, {}, "next")], S = st(N.prev) ? {
|
|
41
|
-
...N.prev,
|
|
42
|
-
icon: N.prev.icon || (H ? /* @__PURE__ */ m(Ft, {}) : f[0])
|
|
43
|
-
} : {}, P = st(N.next) ? {
|
|
44
|
-
...N.next,
|
|
45
|
-
icon: N.next.icon || (H ? /* @__PURE__ */ m(Yt, {}) : f[1])
|
|
46
|
-
} : {}, Q = () => S.icon && !S.collapsed || P.collapsed ? /* @__PURE__ */ m(
|
|
47
|
-
"span",
|
|
48
|
-
{
|
|
49
|
-
className: E(`${d}-icon`, E(`${d}-prev`)),
|
|
50
|
-
onClick: S.onClick,
|
|
51
|
-
children: S.icon
|
|
52
|
-
}
|
|
53
|
-
) : /* @__PURE__ */ m("span", { className: E(`${d}-icon-empty`) }), U = () => P.icon && !P.collapsed || S.collapsed ? /* @__PURE__ */ m(
|
|
54
|
-
"span",
|
|
55
|
-
{
|
|
56
|
-
className: E(`${d}-icon`, E(`${d}-next`)),
|
|
57
|
-
onClick: P.onClick,
|
|
58
|
-
children: P.icon
|
|
59
|
-
}
|
|
60
|
-
) : /* @__PURE__ */ m("span", { className: E(`${d}-icon-empty`) }), tt = () => W ? /* @__PURE__ */ m("span", { className: `${d}-icon`, children: Z || (H ? /* @__PURE__ */ m(kt, {}) : /* @__PURE__ */ m(Ut, {})) }) : /* @__PURE__ */ m("span", { className: E(`${d}-icon-empty`) }), h = Q(), O = tt(), l = U(), w = () => /* @__PURE__ */ ut("div", { className: `${d}-icon-wrapper`, children: [
|
|
61
|
-
h,
|
|
62
|
-
O,
|
|
63
|
-
l
|
|
64
|
-
] });
|
|
65
|
-
if (!W)
|
|
66
|
-
return /* @__PURE__ */ m("div", { className: T, children: wt(b) ? b(h, O, l) : J || w() });
|
|
67
|
-
const I = k(null);
|
|
68
|
-
return lt(() => {
|
|
69
|
-
let i;
|
|
70
|
-
return I.current && (i = new ResizeObserver(x), i.observe(I.current)), () => {
|
|
71
|
-
var A, V;
|
|
72
|
-
I.current && ((A = i == null ? void 0 : i.unobserve) == null || A.call(i, I.current)), (V = i == null ? void 0 : i.disconnect) == null || V.call(i), i = null;
|
|
73
|
-
};
|
|
74
|
-
}, [I.current]), /* @__PURE__ */ m(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
ref: I,
|
|
78
|
-
...zt(K, ["style"]),
|
|
79
|
-
className: T,
|
|
80
|
-
onMouseDown: q,
|
|
81
|
-
children: wt(b) ? b(h, O, l) : J || w()
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
const dt = "horizontal", Pt = "vertical";
|
|
86
|
-
function Lt(r, ot) {
|
|
87
|
-
const {
|
|
88
|
-
style: g,
|
|
89
|
-
className: Z,
|
|
90
|
-
component: q = "div",
|
|
91
|
-
direction: x = "horizontal",
|
|
92
|
-
icon: J,
|
|
93
|
-
size: N = 0.5,
|
|
94
|
-
min: W,
|
|
95
|
-
max: b,
|
|
96
|
-
panes: K,
|
|
97
|
-
disabled: rt,
|
|
98
|
-
trigger: z
|
|
99
|
-
} = r, { getPrefixCls: d, rtl: H } = ft(mt), M = d("resizebox-split"), T = x.includes(dt), f = x.includes("reverse"), S = T && H, P = !T, Q = E(
|
|
100
|
-
M,
|
|
101
|
-
`${M}-${T ? dt : Pt}`,
|
|
102
|
-
{ [`${M}-rtl`]: H },
|
|
103
|
-
Z
|
|
104
|
-
), [U, tt] = K, h = typeof N == "string", [O, l] = ct(parseFloat(N)), [w, I] = ct(0), i = k({
|
|
105
|
-
startX: 0,
|
|
106
|
-
startY: 0,
|
|
107
|
-
startWidth: 0,
|
|
108
|
-
startHeight: 0,
|
|
109
|
-
startOffset: 0,
|
|
110
|
-
moving: !1
|
|
111
|
-
}), A = k(), V = k([]);
|
|
112
|
-
Nt(ot, () => A.current, []);
|
|
113
|
-
function _(t, e) {
|
|
114
|
-
return parseFloat(t) / parseFloat(e);
|
|
115
|
-
}
|
|
116
|
-
function B(t, e, n, o) {
|
|
117
|
-
const s = typeof W == "string" ? _(parseFloat(W), t) : W || 0, a = typeof b == "string" ? _(parseFloat(b), t) : b || 1;
|
|
118
|
-
let u = f ? -1 : 1;
|
|
119
|
-
u *= S ? -1 : 1;
|
|
120
|
-
let X = h ? e + (o - n) * u : _(
|
|
121
|
-
t * e + (o - n) * u,
|
|
122
|
-
t
|
|
123
|
-
);
|
|
124
|
-
const nt = h ? s * t : s, Y = h ? a * t : a;
|
|
125
|
-
return X = Math.max(X, nt), X = Math.min(X, Y), X;
|
|
126
|
-
}
|
|
127
|
-
function L(t) {
|
|
128
|
-
var e, n, o;
|
|
129
|
-
(e = r.onMovingStart) == null || e.call(r), i.current.moving = !0, i.current.startX = t.pageX, i.current.startY = t.pageY, i.current.startWidth = (n = A.current) == null ? void 0 : n.offsetWidth, i.current.startHeight = (o = A.current) == null ? void 0 : o.offsetHeight, i.current.startOffset = O, $(window, "mousemove", G), $(window, "touchmove", G), $(window, "mouseup", j), $(window, "touchend", j), $(window, "contextmenu", j), document.body.style.cursor = P ? "row-resize" : "col-resize";
|
|
130
|
-
}
|
|
131
|
-
function G(t) {
|
|
132
|
-
var e;
|
|
133
|
-
if (i.current.moving) {
|
|
134
|
-
const n = T ? B(
|
|
135
|
-
i.current.startWidth,
|
|
136
|
-
i.current.startOffset,
|
|
137
|
-
i.current.startX,
|
|
138
|
-
t.pageX
|
|
139
|
-
) : B(
|
|
140
|
-
i.current.startHeight,
|
|
141
|
-
i.current.startOffset,
|
|
142
|
-
i.current.startY,
|
|
143
|
-
t.pageY
|
|
144
|
-
);
|
|
145
|
-
l(n), (e = r.onMoving) == null || e.call(r, t, h ? `${n}px` : n);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function j() {
|
|
149
|
-
var t;
|
|
150
|
-
i.current.moving = !1, y(window, "mousemove", G), y(window, "touchmove", G), y(window, "mouseup", j), y(window, "touchend", j), y(window, "contextmenu", j), document.body.style.cursor = "default", (t = r.onMovingEnd) == null || t.call(r);
|
|
151
|
-
}
|
|
152
|
-
function it(t) {
|
|
153
|
-
const { contentRect: e } = t[0], n = e[P ? "height" : "width"];
|
|
154
|
-
I(n);
|
|
155
|
-
}
|
|
156
|
-
function c() {
|
|
157
|
-
const t = h ? "px" : "%";
|
|
158
|
-
return O ? `calc(${h ? O : O * 100}${t} - ${w / 2}px)` : `0${t}`;
|
|
159
|
-
}
|
|
160
|
-
lt(() => {
|
|
161
|
-
var t;
|
|
162
|
-
(t = r.onPaneResize) == null || t.call(r, V.current);
|
|
163
|
-
}, [O, w]), Vt(() => {
|
|
164
|
-
const t = parseFloat(N);
|
|
165
|
-
O !== t && l(t);
|
|
166
|
-
}, [N]);
|
|
167
|
-
const v = q, p = /* @__PURE__ */ m(
|
|
168
|
-
"div",
|
|
169
|
-
{
|
|
170
|
-
className: E(`${M}-pane`, "first-pane"),
|
|
171
|
-
style: { flexBasis: c() },
|
|
172
|
-
ref: (t) => {
|
|
173
|
-
V.current[0] = t;
|
|
174
|
-
},
|
|
175
|
-
children: U
|
|
176
|
-
}
|
|
177
|
-
), R = /* @__PURE__ */ m(
|
|
178
|
-
"div",
|
|
179
|
-
{
|
|
180
|
-
className: E(`${M}-pane`, "second-pane"),
|
|
181
|
-
ref: (t) => {
|
|
182
|
-
V.current[1] = t;
|
|
183
|
-
},
|
|
184
|
-
children: tt
|
|
185
|
-
}
|
|
186
|
-
), D = f ? [R, p] : [p, R];
|
|
187
|
-
return /* @__PURE__ */ ut(v, { style: g, className: Q, ref: A, children: [
|
|
188
|
-
D[0],
|
|
189
|
-
!rt && /* @__PURE__ */ m(
|
|
190
|
-
Mt,
|
|
191
|
-
{
|
|
192
|
-
className: `${M}-trigger`,
|
|
193
|
-
direction: P ? dt : Pt,
|
|
194
|
-
icon: J,
|
|
195
|
-
onMouseDown: L,
|
|
196
|
-
onResize: it,
|
|
197
|
-
children: z
|
|
198
|
-
}
|
|
199
|
-
),
|
|
200
|
-
D[1]
|
|
201
|
-
] });
|
|
202
|
-
}
|
|
203
|
-
const Et = Ct(Lt);
|
|
204
|
-
Et.displayName = "ResizeBoxSplit";
|
|
205
|
-
const ht = "horizontal", Dt = "vertical";
|
|
206
|
-
function Gt(r, ot) {
|
|
207
|
-
const {
|
|
208
|
-
panes: g,
|
|
209
|
-
style: Z,
|
|
210
|
-
className: q,
|
|
211
|
-
component: x = "div",
|
|
212
|
-
direction: J = "horizontal",
|
|
213
|
-
icon: N,
|
|
214
|
-
...W
|
|
215
|
-
} = r, { getPrefixCls: b, rtl: K } = ft(mt), rt = 1 / g.length, z = k(), d = k(
|
|
216
|
-
new Array(g.length).fill({
|
|
217
|
-
moving: !1,
|
|
218
|
-
startOffset: 0,
|
|
219
|
-
startPosition: 0
|
|
220
|
-
})
|
|
221
|
-
), H = k([]), M = k(0), T = k([]), [f, S] = ct(
|
|
222
|
-
new Array(g.length).fill(rt)
|
|
223
|
-
), [P, Q] = ct(!1), [U, tt] = ct(
|
|
224
|
-
new Array(g.length).fill(0)
|
|
225
|
-
), [h, O] = ct(
|
|
226
|
-
new Array(Math.max(g.length - 1, 0)).fill({ prev: !1, next: !1 })
|
|
227
|
-
), l = b("resizebox-split-group"), w = J === ht, I = w && K, i = !w, A = E(
|
|
228
|
-
l,
|
|
229
|
-
`${l}-${w ? ht : Dt}`,
|
|
230
|
-
{ [`${l}-moving`]: P },
|
|
231
|
-
{ [`${l}-rtl`]: K },
|
|
232
|
-
q
|
|
233
|
-
), V = x, _ = () => {
|
|
234
|
-
let t = [];
|
|
235
|
-
g.forEach((s) => {
|
|
236
|
-
const { size: a } = s;
|
|
237
|
-
St(a) ? t.push(void 0) : t.push(L(a));
|
|
238
|
-
});
|
|
239
|
-
const e = t.filter((s) => !s), o = (1 - t.reduce((s, a) => (s || 0) + (a || 0), 0)) / e.length;
|
|
240
|
-
return t = t.map((s) => St(s) ? o : s), t;
|
|
241
|
-
}, B = (t) => {
|
|
242
|
-
const e = U[t - 1] || 0, n = U[t];
|
|
243
|
-
return `calc(${f[t] * 100}% - ${(e + n) / 2}px)`;
|
|
244
|
-
};
|
|
245
|
-
function L(t) {
|
|
246
|
-
const e = w ? z.current.offsetWidth : z.current.offsetHeight;
|
|
247
|
-
if (!t || vt(t) && t < 0)
|
|
248
|
-
return 0;
|
|
249
|
-
const n = _t(t) ? parseFloat(t) / e : t;
|
|
250
|
-
return Math.min(n, 1);
|
|
251
|
-
}
|
|
252
|
-
const G = (t) => {
|
|
253
|
-
const e = Math.min(t + 1, g.length - 1), n = f[t] + f[e], o = L(g[t].min) || 0;
|
|
254
|
-
let s = L(g[t].max) || n;
|
|
255
|
-
const a = L(g[e].min) || 0;
|
|
256
|
-
let u = L(g[e].max) || n;
|
|
257
|
-
return s = Math.min(n - a, s), u = Math.min(n - o, u), {
|
|
258
|
-
currentMin: o,
|
|
259
|
-
currentMax: s,
|
|
260
|
-
nextMin: a,
|
|
261
|
-
nextMax: u
|
|
262
|
-
};
|
|
263
|
-
}, j = (t, e, n) => {
|
|
264
|
-
const o = M.current, s = o + 1, a = [...f], u = I ? -1 : 1, et = f[o], X = f[s], nt = et + X, { currentMin: Y, currentMax: C } = G(o);
|
|
265
|
-
let F = t + L(`${(n - e) * u}px`);
|
|
266
|
-
return F = Math.max(Y, F), F = Math.min(C, F), a[o] = F, a[s] = nt - F, a;
|
|
267
|
-
};
|
|
268
|
-
function it(t, e) {
|
|
269
|
-
const { contentRect: n } = t[0], o = n[i ? "height" : "width"], s = [...U];
|
|
270
|
-
s[e] = o, tt(s);
|
|
271
|
-
}
|
|
272
|
-
const c = (t) => {
|
|
273
|
-
let e = g[t].collapsible;
|
|
274
|
-
st(e) || (e = e ? { prev: !0, next: !0 } : {});
|
|
275
|
-
const { prev: n, next: o } = e;
|
|
276
|
-
if (!n && !o)
|
|
277
|
-
return {};
|
|
278
|
-
if (!h[t])
|
|
279
|
-
return {};
|
|
280
|
-
const s = !!n || !n && h[t].next, a = !!o || !o && h[t].prev;
|
|
281
|
-
return { hasPrev: s, hasNext: a };
|
|
282
|
-
};
|
|
283
|
-
function v(t, e) {
|
|
284
|
-
var o;
|
|
285
|
-
(o = r.onMovingStart) == null || o.call(r, e), M.current = e;
|
|
286
|
-
const n = d.current[e];
|
|
287
|
-
n.moving = !0, n.startOffset = f[e], n.startPosition = w ? t.pageX : t.pageY, Q(!0), $(window, "mousemove", p), $(window, "touchmove", p), $(window, "mouseup", R), $(window, "touchend", R), $(window, "contextmenu", R), document.body.style.cursor = i ? "row-resize" : "col-resize";
|
|
288
|
-
}
|
|
289
|
-
function p(t) {
|
|
290
|
-
var s;
|
|
291
|
-
const e = M.current, n = d.current[e], o = w ? z.current.offsetWidth : z.current.offsetHeight;
|
|
292
|
-
if (n.moving) {
|
|
293
|
-
const a = j(
|
|
294
|
-
n.startOffset,
|
|
295
|
-
n.startPosition,
|
|
296
|
-
w ? t.pageX : t.pageY
|
|
297
|
-
);
|
|
298
|
-
S(a), T.current = a, (s = r == null ? void 0 : r.onMoving) == null || s.call(
|
|
299
|
-
r,
|
|
300
|
-
t,
|
|
301
|
-
a.map((u) => `${u * o}px`),
|
|
302
|
-
e
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
function R() {
|
|
307
|
-
var e;
|
|
308
|
-
const t = M.current;
|
|
309
|
-
d.current[t].moving = !1, Q(!1), y(window, "mousemove", p), y(window, "touchmove", p), y(window, "mouseup", R), y(window, "touchend", R), y(window, "contextmenu", R), document.body.style.cursor = "default", (e = r.onMovingEnd) == null || e.call(r, t);
|
|
310
|
-
}
|
|
311
|
-
function D(t, e, n, o) {
|
|
312
|
-
var $t, yt;
|
|
313
|
-
const s = e + 1, a = [...f], u = f[e], et = f[s], X = u + et, nt = w ? z.current.offsetWidth : z.current.offsetHeight, { currentMin: Y, nextMin: C } = G(e);
|
|
314
|
-
let F = T.current[e], at = T.current[s], gt = h[e][n];
|
|
315
|
-
n === "prev" ? (et !== C || at === C) && (F = Y, at = X - Y, gt = !0) : (u !== Y || F === Y) && (F = X - C, at = C, gt = !0), a[e] = F, a[s] = at, ($t = r == null ? void 0 : r.onMoving) == null || $t.call(
|
|
316
|
-
r,
|
|
317
|
-
t,
|
|
318
|
-
a.map((Xt) => `${Xt * nt}px`),
|
|
319
|
-
e
|
|
320
|
-
), (yt = r.onMovingEnd) == null || yt.call(r, e), S(a), wt(o) && o(t, e, n, gt);
|
|
321
|
-
}
|
|
322
|
-
return lt(() => {
|
|
323
|
-
const t = _();
|
|
324
|
-
S(t), T.current = t;
|
|
325
|
-
}, [JSON.stringify(g.map((t) => t.size))]), Nt(ot, () => z.current, []), lt(() => {
|
|
326
|
-
const t = [];
|
|
327
|
-
f.forEach((e, n) => {
|
|
328
|
-
const o = { prev: !1, next: !1 }, s = n + 1, { currentMin: a, nextMin: u } = G(n);
|
|
329
|
-
e === a ? o.prev = !0 : f[s] === u && (o.next = !0), t.push(o);
|
|
330
|
-
}), O(t);
|
|
331
|
-
}, [f]), /* @__PURE__ */ m(
|
|
332
|
-
V,
|
|
333
|
-
{
|
|
334
|
-
...zt(W, [
|
|
335
|
-
"onMovingStart",
|
|
336
|
-
"onPaneResize",
|
|
337
|
-
"onMoving",
|
|
338
|
-
"onMovingEnd"
|
|
339
|
-
]),
|
|
340
|
-
style: Z,
|
|
341
|
-
className: A,
|
|
342
|
-
ref: z,
|
|
343
|
-
children: g.map((t, e) => {
|
|
344
|
-
const {
|
|
345
|
-
content: n,
|
|
346
|
-
disabled: o,
|
|
347
|
-
trigger: s,
|
|
348
|
-
resizable: a = !0,
|
|
349
|
-
collapsible: u = {}
|
|
350
|
-
} = t, { hasPrev: et, hasNext: X } = c(e), nt = st(u) && st(u.prev) ? u.prev : {}, Y = st(u) && st(u.next) ? u.next : {};
|
|
351
|
-
return /* @__PURE__ */ ut(Wt.Fragment, { children: [
|
|
352
|
-
/* @__PURE__ */ m(
|
|
353
|
-
"div",
|
|
354
|
-
{
|
|
355
|
-
className: `${l}-pane`,
|
|
356
|
-
style: { flexBasis: B(e) },
|
|
357
|
-
ref: (C) => H.current[e] = C,
|
|
358
|
-
children: n
|
|
359
|
-
}
|
|
360
|
-
),
|
|
361
|
-
!o && e !== g.length - 1 && /* @__PURE__ */ m(
|
|
362
|
-
Mt,
|
|
363
|
-
{
|
|
364
|
-
className: `${l}-trigger`,
|
|
365
|
-
direction: i ? ht : Dt,
|
|
366
|
-
icon: N,
|
|
367
|
-
onResize: (C) => it(C, e),
|
|
368
|
-
onMouseDown: (C) => v(C, e),
|
|
369
|
-
collapsible: {
|
|
370
|
-
prev: et ? {
|
|
371
|
-
onClick: (C) => D(C, e, "prev", nt.onClick),
|
|
372
|
-
icon: nt.icon,
|
|
373
|
-
collapsed: h[e].prev
|
|
374
|
-
} : void 0,
|
|
375
|
-
next: X ? {
|
|
376
|
-
onClick: (C) => D(C, e, "next", Y.onClick),
|
|
377
|
-
icon: Y.icon,
|
|
378
|
-
collapsed: h[e].next
|
|
379
|
-
} : void 0
|
|
380
|
-
},
|
|
381
|
-
resizable: a,
|
|
382
|
-
renderChildren: s
|
|
383
|
-
}
|
|
384
|
-
)
|
|
385
|
-
] }, e);
|
|
386
|
-
})
|
|
387
|
-
}
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
|
-
const Ht = Ct(Gt);
|
|
391
|
-
Ht.displayName = "ResizeBoxSplitGroup";
|
|
392
|
-
const At = "left", pt = "right", xt = "top", Rt = "bottom", jt = [
|
|
393
|
-
At,
|
|
394
|
-
pt,
|
|
395
|
-
xt,
|
|
396
|
-
Rt
|
|
397
|
-
], Zt = {
|
|
1
|
+
import { jsxs as ot, jsx as rt } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import E from "lodash/isNumber";
|
|
5
|
+
import { forwardRef as nt, useContext as st, useState as it, useRef as B, useImperativeHandle as ct } from "react";
|
|
6
|
+
import "./config-provider/ConfigProvider.js";
|
|
7
|
+
import at from "./hooks/useMergeProps.js";
|
|
8
|
+
import W from "./hooks/useMergeValue.js";
|
|
9
|
+
import ut from "@unicom-cloud/utils/class-name";
|
|
10
|
+
import { on as g, off as l } from "./utils/dom.js";
|
|
11
|
+
import mt from "./utils/omit.js";
|
|
12
|
+
import dt from "./resize-box/ResizeTrigger.js";
|
|
13
|
+
import gt from "./resize-box/Split.js";
|
|
14
|
+
import lt from "./resize-box/SplitGroup.js";
|
|
15
|
+
import { ConfigContext as ft } from "./config-provider/context.js";
|
|
16
|
+
const $ = "left", b = "right", z = "top", y = "bottom", pt = [
|
|
17
|
+
$,
|
|
18
|
+
b,
|
|
19
|
+
z,
|
|
20
|
+
y
|
|
21
|
+
], ht = {
|
|
398
22
|
component: "div",
|
|
399
23
|
directions: ["right"],
|
|
400
24
|
resizeIcons: {},
|
|
401
25
|
resizeTriggers: {}
|
|
402
|
-
},
|
|
403
|
-
switch (
|
|
26
|
+
}, wt = (f) => {
|
|
27
|
+
switch (f) {
|
|
404
28
|
case "left":
|
|
405
29
|
return "right";
|
|
406
30
|
case "right":
|
|
407
31
|
return "left";
|
|
408
32
|
default:
|
|
409
|
-
return
|
|
33
|
+
return f;
|
|
410
34
|
}
|
|
411
35
|
};
|
|
412
|
-
function
|
|
413
|
-
const { getPrefixCls:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
36
|
+
function vt(f, X) {
|
|
37
|
+
const { getPrefixCls: Y, componentConfig: w, rtl: T } = st(ft), r = at(
|
|
38
|
+
f,
|
|
39
|
+
ht,
|
|
40
|
+
w == null ? void 0 : w.ResizeBox
|
|
417
41
|
), {
|
|
418
|
-
style:
|
|
419
|
-
className:
|
|
420
|
-
component:
|
|
421
|
-
directions:
|
|
422
|
-
resizeIcons:
|
|
423
|
-
children:
|
|
424
|
-
resizeTriggers:
|
|
425
|
-
width:
|
|
426
|
-
height:
|
|
427
|
-
...
|
|
428
|
-
} =
|
|
42
|
+
style: P,
|
|
43
|
+
className: k,
|
|
44
|
+
component: _,
|
|
45
|
+
directions: C,
|
|
46
|
+
resizeIcons: A,
|
|
47
|
+
children: G,
|
|
48
|
+
resizeTriggers: j,
|
|
49
|
+
width: F,
|
|
50
|
+
height: q,
|
|
51
|
+
...K
|
|
52
|
+
} = r, L = T ? C.map((t) => wt(t)) : C, v = Y("resizebox"), U = ut(v, { [`${v}-rtl`]: T }, k), [V, J] = it({}), [I, N] = W(void 0, { value: F }), [H, M] = W(void 0, { value: q }), o = B({
|
|
429
53
|
startX: 0,
|
|
430
54
|
startY: 0,
|
|
431
55
|
startWidth: 0,
|
|
432
56
|
startHeight: 0,
|
|
433
|
-
direction:
|
|
57
|
+
direction: b,
|
|
434
58
|
moving: !1,
|
|
435
59
|
padding: {
|
|
436
60
|
top: 0,
|
|
@@ -438,122 +62,120 @@ function Jt(r, ot) {
|
|
|
438
62
|
left: 0,
|
|
439
63
|
right: 0
|
|
440
64
|
}
|
|
441
|
-
}),
|
|
442
|
-
|
|
443
|
-
function
|
|
444
|
-
return [
|
|
445
|
-
}
|
|
446
|
-
function
|
|
447
|
-
if (
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
document.body.setAttribute(v, document.body.style.cursor), document.body.style.cursor = c;
|
|
65
|
+
}), p = B();
|
|
66
|
+
ct(X, () => p.current, []);
|
|
67
|
+
function R(t) {
|
|
68
|
+
return [z, y].indexOf(t) > -1;
|
|
69
|
+
}
|
|
70
|
+
function O(t, e) {
|
|
71
|
+
if (t === 0) return 0;
|
|
72
|
+
const n = t - e;
|
|
73
|
+
return n <= 0 ? 0 : n;
|
|
74
|
+
}
|
|
75
|
+
function D(t) {
|
|
76
|
+
const e = "data-pqb-origin-cursor";
|
|
77
|
+
if (t)
|
|
78
|
+
document.body.setAttribute(e, document.body.style.cursor), document.body.style.cursor = t;
|
|
456
79
|
else {
|
|
457
|
-
const
|
|
458
|
-
document.body.style.cursor =
|
|
80
|
+
const n = document.body.getAttribute(e);
|
|
81
|
+
document.body.style.cursor = n || "", document.body.removeAttribute(e);
|
|
459
82
|
}
|
|
460
83
|
}
|
|
461
|
-
function
|
|
462
|
-
var
|
|
463
|
-
(
|
|
464
|
-
const { top:
|
|
465
|
-
|
|
466
|
-
(
|
|
467
|
-
|
|
468
|
-
),
|
|
469
|
-
(
|
|
470
|
-
|
|
471
|
-
),
|
|
472
|
-
|
|
84
|
+
function Q(t, e) {
|
|
85
|
+
var i, m, d;
|
|
86
|
+
(i = r.onMovingStart) == null || i.call(r), o.current.moving = !0, o.current.startX = e.pageX, o.current.startY = e.pageY, o.current.direction = t;
|
|
87
|
+
const { top: n, left: c, right: a, bottom: s } = o.current.padding;
|
|
88
|
+
o.current.startWidth = O(
|
|
89
|
+
(m = p.current) == null ? void 0 : m.clientWidth,
|
|
90
|
+
c + a
|
|
91
|
+
), o.current.startHeight = O(
|
|
92
|
+
(d = p.current) == null ? void 0 : d.clientHeight,
|
|
93
|
+
n + s
|
|
94
|
+
), g(window, "mousemove", h), g(window, "touchmove", h), g(window, "mouseup", u), g(window, "touchend", u), g(window, "contextmenu", u), D(
|
|
95
|
+
R(t) ? "row-resize" : "col-resize"
|
|
473
96
|
);
|
|
474
97
|
}
|
|
475
|
-
function
|
|
476
|
-
var
|
|
477
|
-
if (!
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
t = R - n, tt(t);
|
|
98
|
+
function h(t) {
|
|
99
|
+
var S;
|
|
100
|
+
if (!o.current.moving) return !1;
|
|
101
|
+
const { startX: e, startY: n, startWidth: c, startHeight: a } = o.current;
|
|
102
|
+
let s = c, i = a;
|
|
103
|
+
const m = t.pageX - e, d = t.pageY - n;
|
|
104
|
+
switch (o.current.direction) {
|
|
105
|
+
case $:
|
|
106
|
+
s = c - m, N(s);
|
|
485
107
|
break;
|
|
486
|
-
case
|
|
487
|
-
|
|
108
|
+
case b:
|
|
109
|
+
s = c + m, N(s);
|
|
488
110
|
break;
|
|
489
|
-
case
|
|
490
|
-
|
|
111
|
+
case z:
|
|
112
|
+
i = a - d, M(i);
|
|
491
113
|
break;
|
|
492
|
-
case
|
|
493
|
-
|
|
114
|
+
case y:
|
|
115
|
+
i = a + d, M(i);
|
|
494
116
|
break;
|
|
495
117
|
}
|
|
496
|
-
(
|
|
497
|
-
width:
|
|
498
|
-
height:
|
|
118
|
+
(S = r.onMoving) == null || S.call(r, t, {
|
|
119
|
+
width: s,
|
|
120
|
+
height: i
|
|
499
121
|
});
|
|
500
122
|
}
|
|
501
|
-
function
|
|
502
|
-
var
|
|
503
|
-
|
|
123
|
+
function u() {
|
|
124
|
+
var t;
|
|
125
|
+
o.current.moving = !1, Z(), D(), (t = r.onMovingEnd) == null || t.call(r);
|
|
504
126
|
}
|
|
505
|
-
function
|
|
506
|
-
|
|
127
|
+
function Z() {
|
|
128
|
+
l(window, "mousemove", h), l(window, "touchmove", h), l(window, "mouseup", u), l(window, "touchend", u), l(window, "contextmenu", u);
|
|
507
129
|
}
|
|
508
|
-
function
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
...
|
|
512
|
-
[`padding${
|
|
130
|
+
function tt(t, e) {
|
|
131
|
+
const n = R(t), { contentRect: c } = e[0], a = `${t.slice(0, 1).toUpperCase()}${t.slice(1)}`, s = c[n ? "height" : "width"];
|
|
132
|
+
o.current.padding[t] = s, J((i) => ({
|
|
133
|
+
...i,
|
|
134
|
+
[`padding${a}`]: s
|
|
513
135
|
}));
|
|
514
136
|
}
|
|
515
|
-
const
|
|
516
|
-
...
|
|
517
|
-
...
|
|
518
|
-
...
|
|
519
|
-
...
|
|
137
|
+
const et = {
|
|
138
|
+
...V,
|
|
139
|
+
...P || {},
|
|
140
|
+
...E(I) ? { width: I } : {},
|
|
141
|
+
...E(H) ? { height: H } : {}
|
|
520
142
|
};
|
|
521
|
-
return /* @__PURE__ */
|
|
522
|
-
|
|
143
|
+
return /* @__PURE__ */ ot(
|
|
144
|
+
_,
|
|
523
145
|
{
|
|
524
|
-
...
|
|
525
|
-
style:
|
|
526
|
-
className:
|
|
527
|
-
ref:
|
|
146
|
+
...mt(K, ["onMovingStart", "onMoving", "onMovingEnd"]),
|
|
147
|
+
style: et,
|
|
148
|
+
className: U,
|
|
149
|
+
ref: p,
|
|
528
150
|
children: [
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
if (
|
|
532
|
-
return /* @__PURE__ */
|
|
533
|
-
|
|
151
|
+
G,
|
|
152
|
+
L.map((t) => {
|
|
153
|
+
if (pt.indexOf(t) !== -1)
|
|
154
|
+
return /* @__PURE__ */ rt(
|
|
155
|
+
dt,
|
|
534
156
|
{
|
|
535
|
-
className: `${
|
|
536
|
-
direction:
|
|
537
|
-
icon:
|
|
538
|
-
onMouseDown: (
|
|
539
|
-
|
|
157
|
+
className: `${v}-direction-${t}`,
|
|
158
|
+
direction: R(t) ? "horizontal" : "vertical",
|
|
159
|
+
icon: A[t],
|
|
160
|
+
onMouseDown: (e) => {
|
|
161
|
+
Q(t, e);
|
|
540
162
|
},
|
|
541
|
-
onResize: (
|
|
542
|
-
|
|
163
|
+
onResize: (e) => {
|
|
164
|
+
tt(t, e);
|
|
543
165
|
},
|
|
544
|
-
children:
|
|
166
|
+
children: j[t]
|
|
545
167
|
},
|
|
546
|
-
|
|
168
|
+
t
|
|
547
169
|
);
|
|
548
170
|
})
|
|
549
171
|
]
|
|
550
172
|
}
|
|
551
173
|
);
|
|
552
174
|
}
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
175
|
+
const Rt = nt(vt), x = Rt;
|
|
176
|
+
x.Split = gt;
|
|
177
|
+
x.SplitGroup = lt;
|
|
178
|
+
x.displayName = "ResizeBox";
|
|
557
179
|
export {
|
|
558
|
-
|
|
180
|
+
x as default
|
|
559
181
|
};
|