@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/Grid.js
CHANGED
|
@@ -1,252 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import se from "lodash/isFunction";
|
|
12
|
-
import oe from "lodash/isString";
|
|
13
|
-
function T(r) {
|
|
14
|
-
return te(r);
|
|
15
|
-
}
|
|
16
|
-
const y = (r, f, n = !1) => {
|
|
17
|
-
const t = ee(), [l, s] = q({
|
|
18
|
-
xs: !0,
|
|
19
|
-
sm: !0,
|
|
20
|
-
md: !0,
|
|
21
|
-
lg: !0,
|
|
22
|
-
xl: !0,
|
|
23
|
-
xxl: !0,
|
|
24
|
-
xxxl: !0
|
|
25
|
-
});
|
|
26
|
-
return z(() => (t.current = F.subscribe((o) => {
|
|
27
|
-
T(r) && s(o);
|
|
28
|
-
}), () => {
|
|
29
|
-
F.unsubscribe(t.current);
|
|
30
|
-
}), []), N(() => {
|
|
31
|
-
let o = f;
|
|
32
|
-
if (T(r))
|
|
33
|
-
for (let e = 0; e < Q.length; e++) {
|
|
34
|
-
const a = Q[e];
|
|
35
|
-
if ((l[a] || a === "xs" && n) && r[a] !== void 0) {
|
|
36
|
-
o = r[a];
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else
|
|
41
|
-
o = r;
|
|
42
|
-
return o;
|
|
43
|
-
}, [l, r, f, n]);
|
|
44
|
-
};
|
|
45
|
-
function re(r, { span: f, offset: n, suffix: t }) {
|
|
46
|
-
const l = f ?? 1, s = n ?? 0, p = Math.min(s, r);
|
|
47
|
-
return {
|
|
48
|
-
span: Math.min(
|
|
49
|
-
p > 0 ? l + s : l,
|
|
50
|
-
r
|
|
51
|
-
),
|
|
52
|
-
offset: p,
|
|
53
|
-
suffix: t
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function ne({
|
|
57
|
-
cols: r,
|
|
58
|
-
collapsed: f,
|
|
59
|
-
collapsedRows: n,
|
|
60
|
-
itemDataList: t
|
|
61
|
-
}) {
|
|
62
|
-
let l = !1, s = [];
|
|
63
|
-
function p(o) {
|
|
64
|
-
return Math.ceil(o / r) > n;
|
|
65
|
-
}
|
|
66
|
-
if (f) {
|
|
67
|
-
let o = 0;
|
|
68
|
-
for (let e = 0; e < t.length; e++)
|
|
69
|
-
t[e].suffix && (o += t[e].span, s.push(e));
|
|
70
|
-
if (!p(o)) {
|
|
71
|
-
let e = 0;
|
|
72
|
-
for (; e < t.length; ) {
|
|
73
|
-
const a = t[e];
|
|
74
|
-
if (!a.suffix) {
|
|
75
|
-
if (o += a.span, p(o))
|
|
76
|
-
break;
|
|
77
|
-
s.push(e);
|
|
78
|
-
}
|
|
79
|
-
e++;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
l = t.some(
|
|
83
|
-
(e, a) => !e.suffix && !s.includes(a)
|
|
84
|
-
);
|
|
85
|
-
} else
|
|
86
|
-
s = t.map((o, e) => e);
|
|
87
|
-
return {
|
|
88
|
-
overflow: l,
|
|
89
|
-
displayIndexList: s
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
const ie = {
|
|
93
|
-
collapsed: !1,
|
|
94
|
-
collapsedRows: 1,
|
|
95
|
-
cols: 24,
|
|
96
|
-
colGap: 0,
|
|
97
|
-
rowGap: 0
|
|
98
|
-
};
|
|
99
|
-
function ae(r, f) {
|
|
100
|
-
const [n, t] = q(
|
|
101
|
-
/* @__PURE__ */ new Map()
|
|
102
|
-
), { getPrefixCls: l, componentConfig: s, rtl: p } = M(J), o = K(
|
|
103
|
-
r,
|
|
104
|
-
ie,
|
|
105
|
-
s == null ? void 0 : s.Grid
|
|
106
|
-
), {
|
|
107
|
-
children: e,
|
|
108
|
-
className: a,
|
|
109
|
-
style: b,
|
|
110
|
-
cols: x,
|
|
111
|
-
colGap: G,
|
|
112
|
-
rowGap: h,
|
|
113
|
-
collapsed: P,
|
|
114
|
-
collapsedRows: g
|
|
115
|
-
} = o, C = y(x, 24), I = y(G, 0), _ = {
|
|
116
|
-
gap: `${y(h, 0)}px ${I}px`,
|
|
117
|
-
gridTemplateColumns: `repeat(${C}, minmax(0px, 1fr))`
|
|
118
|
-
}, u = l("grid"), S = {
|
|
119
|
-
[`${u}`]: !0,
|
|
120
|
-
[`${u}-rtl`]: p
|
|
121
|
-
}, E = L(S, a), O = (() => {
|
|
122
|
-
const i = [];
|
|
123
|
-
for (const [d, w] of n.entries())
|
|
124
|
-
i[d] = w;
|
|
125
|
-
return i;
|
|
126
|
-
})(), m = ne({
|
|
127
|
-
cols: C,
|
|
128
|
-
collapsed: P,
|
|
129
|
-
collapsedRows: g,
|
|
130
|
-
itemDataList: O
|
|
131
|
-
});
|
|
132
|
-
return /* @__PURE__ */ R(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
ref: f,
|
|
136
|
-
className: E,
|
|
137
|
-
style: {
|
|
138
|
-
..._,
|
|
139
|
-
...b
|
|
140
|
-
},
|
|
141
|
-
children: /* @__PURE__ */ R(
|
|
142
|
-
V.Provider,
|
|
143
|
-
{
|
|
144
|
-
value: {
|
|
145
|
-
collectItemData(i, d) {
|
|
146
|
-
n.set(i, d), t(new Map([...n]));
|
|
147
|
-
},
|
|
148
|
-
removeItemData(i) {
|
|
149
|
-
n.delete(i), t(new Map([...n]));
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
children: /* @__PURE__ */ R(
|
|
153
|
-
A.Provider,
|
|
154
|
-
{
|
|
155
|
-
value: {
|
|
156
|
-
cols: C,
|
|
157
|
-
colGap: I,
|
|
158
|
-
overflow: m.overflow,
|
|
159
|
-
displayIndexList: m.displayIndexList
|
|
160
|
-
},
|
|
161
|
-
children: v.Children.map(e, (i, d) => {
|
|
162
|
-
if (i) {
|
|
163
|
-
const w = {
|
|
164
|
-
index: d,
|
|
165
|
-
...i.props
|
|
166
|
-
};
|
|
167
|
-
return v.cloneElement(i, w);
|
|
168
|
-
}
|
|
169
|
-
return null;
|
|
170
|
-
}).filter(
|
|
171
|
-
(i) => X(i, "type.__PQB_GRID_ITEM__")
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
const U = H(ae);
|
|
181
|
-
U.displayName = "Grid";
|
|
182
|
-
const le = {
|
|
183
|
-
suffix: !1,
|
|
184
|
-
offset: 0,
|
|
185
|
-
span: 1
|
|
186
|
-
};
|
|
187
|
-
function pe(r, f) {
|
|
188
|
-
const { getPrefixCls: n, componentConfig: t, rtl: l } = M(J), s = K(
|
|
189
|
-
r,
|
|
190
|
-
le,
|
|
191
|
-
t == null ? void 0 : t["Grid.GridItem"]
|
|
192
|
-
), {
|
|
193
|
-
children: p,
|
|
194
|
-
className: o,
|
|
195
|
-
style: e,
|
|
196
|
-
offset: a,
|
|
197
|
-
span: b,
|
|
198
|
-
__index__: x
|
|
199
|
-
} = s, G = M(A), { collectItemData: h, removeItemData: P } = M(
|
|
200
|
-
V
|
|
201
|
-
), { colGap: g, cols: C, displayIndexList: I, overflow: D } = G, _ = y(a, 0), u = y(b, 1), S = n("grid-item"), E = I == null ? void 0 : I.includes(x), B = {
|
|
202
|
-
[`${S}`]: !0,
|
|
203
|
-
[`${S}-rtl`]: l
|
|
204
|
-
}, O = L(B, o), m = N(() => re(G.cols, {
|
|
205
|
-
suffix: !!s.suffix,
|
|
206
|
-
span: u,
|
|
207
|
-
offset: _
|
|
208
|
-
}), [G.cols, s.suffix, u, _]);
|
|
209
|
-
z(() => (h(x, m), () => {
|
|
210
|
-
P(x);
|
|
211
|
-
}), [x, m]);
|
|
212
|
-
const i = N(() => {
|
|
213
|
-
const { offset: c, span: $ } = m;
|
|
214
|
-
return c > 0 ? {
|
|
215
|
-
marginLeft: `calc((${`(100% - ${g * ($ - 1)}px) / ${$}`} * ${c}) + ${g * c}px)`
|
|
216
|
-
} : {};
|
|
217
|
-
}, [m, g]), d = N(() => {
|
|
218
|
-
const { suffix: c, span: $ } = m;
|
|
219
|
-
return c ? `${C - $ + 1}` : `span ${$}`;
|
|
220
|
-
}, [m, C]), w = !E || u === 0 ? { display: "none" } : {}, W = {
|
|
221
|
-
gridColumn: `${d} / span ${u}`,
|
|
222
|
-
...i,
|
|
223
|
-
...w
|
|
224
|
-
};
|
|
225
|
-
return /* @__PURE__ */ R(
|
|
226
|
-
"div",
|
|
227
|
-
{
|
|
228
|
-
ref: f,
|
|
229
|
-
className: O,
|
|
230
|
-
style: {
|
|
231
|
-
...W,
|
|
232
|
-
...e
|
|
233
|
-
},
|
|
234
|
-
children: se(p) ? p({ overflow: D }) : v.Children.map(p, (c) => c && G.collapsed && v.isValidElement(c) && !oe(c.type) ? v.cloneElement(c, {
|
|
235
|
-
overflow: D,
|
|
236
|
-
...c.props
|
|
237
|
-
}) : c)
|
|
238
|
-
}
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
const ce = H(pe), k = ce;
|
|
242
|
-
k.displayName = "GridItem";
|
|
243
|
-
k.__PQB_GRID_ITEM__ = !0;
|
|
244
|
-
const j = U;
|
|
245
|
-
j.Col = Y;
|
|
246
|
-
j.Row = Z;
|
|
247
|
-
j.GridItem = k;
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
import m from "./grid/Col.js";
|
|
4
|
+
import r from "./grid/Row.js";
|
|
5
|
+
import t from "./grid/grid.js";
|
|
6
|
+
import p from "./grid/grid-item.js";
|
|
7
|
+
const o = t;
|
|
8
|
+
o.Col = m;
|
|
9
|
+
o.Row = r;
|
|
10
|
+
o.GridItem = p;
|
|
248
11
|
export {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
12
|
+
m as Col,
|
|
13
|
+
r as Row,
|
|
14
|
+
o as default
|
|
252
15
|
};
|
package/Icon.js
CHANGED
|
@@ -1,57 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (!N && typeof r == "string" && r.length && C.indexOf(r) === -1) {
|
|
11
|
-
const e = document.createElement("script");
|
|
12
|
-
e.setAttribute("src", r), e.setAttribute("data-namespace", r), C.push(r), document.body.appendChild(e);
|
|
13
|
-
}
|
|
14
|
-
function f(e, d) {
|
|
15
|
-
const { type: t, children: n, ...m } = e, o = i.useRef();
|
|
16
|
-
i.useImperativeHandle(d, () => o.current);
|
|
17
|
-
let s;
|
|
18
|
-
return t && (s = /* @__PURE__ */ a("use", { xlinkHref: `#${t}` })), n && (s = n), /* @__PURE__ */ a(
|
|
19
|
-
l,
|
|
20
|
-
{
|
|
21
|
-
type: t,
|
|
22
|
-
...m,
|
|
23
|
-
...u,
|
|
24
|
-
ref: (c) => {
|
|
25
|
-
o.current = c;
|
|
26
|
-
},
|
|
27
|
-
children: s
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return f.displayName = "Iconfont", i.forwardRef(f);
|
|
32
|
-
}
|
|
33
|
-
const l = i.forwardRef(function(r, u) {
|
|
34
|
-
return /* @__PURE__ */ a(g, { children: (e) => {
|
|
35
|
-
const { className: d, spin: t, children: n, type: m, ...o } = r, c = {
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { ConfigConsumer as p } from "./config-provider/ConfigProvider.js";
|
|
5
|
+
import u from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import C from "./icon/addFromIconFontCn.js";
|
|
7
|
+
const s = d.forwardRef(function(t, N) {
|
|
8
|
+
return /* @__PURE__ */ e(p, { children: (o) => {
|
|
9
|
+
const { className: c, spin: m, children: a, type: i, ...l } = t, r = {
|
|
36
10
|
...{
|
|
37
11
|
width: "1em",
|
|
38
12
|
height: "1em",
|
|
39
13
|
fill: "currentColor"
|
|
40
14
|
},
|
|
41
|
-
...
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
15
|
+
...l
|
|
16
|
+
}, n = o == null ? void 0 : o.getPrefixCls("icon"), f = u(
|
|
17
|
+
n,
|
|
18
|
+
i,
|
|
45
19
|
{
|
|
46
|
-
[`${
|
|
20
|
+
[`${n}-loading`]: m
|
|
47
21
|
},
|
|
48
|
-
|
|
22
|
+
c
|
|
49
23
|
);
|
|
50
|
-
return
|
|
24
|
+
return r.className = f, /* @__PURE__ */ e("svg", { ...r, children: a });
|
|
51
25
|
} });
|
|
52
26
|
});
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
s.displayName = "Icon";
|
|
28
|
+
s.addFromIconFontCn = C;
|
|
55
29
|
export {
|
|
56
|
-
|
|
30
|
+
s as default
|
|
57
31
|
};
|
package/IconHover.js
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "react";
|
|
5
|
-
import "
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import d, { useContext as p, useRef as u, useImperativeHandle as C } from "react";
|
|
5
|
+
import "./config-provider/ConfigProvider.js";
|
|
6
|
+
import x from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import { ConfigContext as N } from "./config-provider/context.js";
|
|
8
|
+
function $(r, n) {
|
|
9
|
+
const {
|
|
10
|
+
children: i,
|
|
11
|
+
className: a,
|
|
12
|
+
disabled: c,
|
|
13
|
+
prefix: t,
|
|
14
|
+
size: e = "default",
|
|
15
|
+
...m
|
|
16
|
+
} = r, { getPrefixCls: f } = p(N), o = f("icon-hover"), s = u();
|
|
17
|
+
return C(n, () => ({
|
|
18
|
+
getRootDOMNode: () => s.current
|
|
19
|
+
})), /* @__PURE__ */ l(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
ref: s,
|
|
23
|
+
className: x(
|
|
24
|
+
o,
|
|
25
|
+
{
|
|
26
|
+
[`${t}-icon-hover`]: t,
|
|
27
|
+
[`${o}-size-${e}`]: e && e !== "default",
|
|
28
|
+
[`${o}-disabled`]: c
|
|
29
|
+
},
|
|
30
|
+
a
|
|
31
|
+
),
|
|
32
|
+
onClick: r.onClick,
|
|
33
|
+
...m,
|
|
34
|
+
children: i
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const D = d.forwardRef($);
|
|
6
39
|
export {
|
|
7
|
-
|
|
40
|
+
D as default
|
|
8
41
|
};
|
package/Image.js
CHANGED
package/Input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import m from "./input/Input.js";
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
package/InputNumber.js
CHANGED
|
@@ -1,19 +1,215 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "@unicom-cloud/icons/IconUiDown";
|
|
7
|
-
import "@unicom-cloud/icons/IconUiMinus";
|
|
8
|
-
import "@unicom-cloud/icons/IconUiPlus";
|
|
9
|
-
import "@unicom-cloud/icons/IconUiUp";
|
|
10
|
-
import "lodash/isNumber";
|
|
11
|
-
import "react";
|
|
12
|
-
import "./
|
|
13
|
-
import "./hooks/useMergeProps.js";
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "./utils/
|
|
1
|
+
import { jsx as a, jsxs as X, Fragment as xe } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
import Re from "@unicom-cloud/icons/IconUiDown";
|
|
7
|
+
import $e from "@unicom-cloud/icons/IconUiMinus";
|
|
8
|
+
import he from "@unicom-cloud/icons/IconUiPlus";
|
|
9
|
+
import Ce from "@unicom-cloud/icons/IconUiUp";
|
|
10
|
+
import z from "lodash/isNumber";
|
|
11
|
+
import Ee, { useContext as Se, useState as h, useRef as H, useMemo as k, useImperativeHandle as Ve, useCallback as Ae, useEffect as w } from "react";
|
|
12
|
+
import "./config-provider/ConfigProvider.js";
|
|
13
|
+
import Oe from "./hooks/useMergeProps.js";
|
|
14
|
+
import Pe from "./input/Input.js";
|
|
15
|
+
import Z from "@unicom-cloud/utils/class-name";
|
|
16
|
+
import { ArrowDown as Ue, ArrowUp as De } from "./utils/keyCode.js";
|
|
17
|
+
import Me from "./utils/omit.js";
|
|
18
|
+
import { getDecimal as m } from "./input-number/decimal.js";
|
|
19
|
+
import _e from "./input-number/useSelectionRange.js";
|
|
20
|
+
import { ConfigContext as Te } from "./config-provider/context.js";
|
|
21
|
+
const ze = 200, He = 1e3, ke = {
|
|
22
|
+
max: 1 / 0,
|
|
23
|
+
min: -1 / 0,
|
|
24
|
+
step: 1,
|
|
25
|
+
mode: "embed",
|
|
26
|
+
parser: (f) => (f == null ? void 0 : f.replace(/[^\w.-]+/g, "")) || ""
|
|
27
|
+
};
|
|
28
|
+
function we(f, ee) {
|
|
29
|
+
var W;
|
|
30
|
+
const {
|
|
31
|
+
getPrefixCls: te,
|
|
32
|
+
size: se,
|
|
33
|
+
componentConfig: C,
|
|
34
|
+
rtl: re
|
|
35
|
+
} = Se(Te), i = Oe(
|
|
36
|
+
f,
|
|
37
|
+
ke,
|
|
38
|
+
C == null ? void 0 : C.InputNumber
|
|
39
|
+
), {
|
|
40
|
+
className: ne,
|
|
41
|
+
style: oe,
|
|
42
|
+
defaultValue: ie,
|
|
43
|
+
disabled: E,
|
|
44
|
+
error: ae,
|
|
45
|
+
readOnly: d,
|
|
46
|
+
strictMode: ue,
|
|
47
|
+
placeholder: le,
|
|
48
|
+
hideControl: B,
|
|
49
|
+
suffix: L,
|
|
50
|
+
prefix: F,
|
|
51
|
+
icons: n,
|
|
52
|
+
mode: S,
|
|
53
|
+
size: ce,
|
|
54
|
+
step: V,
|
|
55
|
+
precision: G,
|
|
56
|
+
min: c,
|
|
57
|
+
max: N,
|
|
58
|
+
parser: g,
|
|
59
|
+
formatter: A,
|
|
60
|
+
onBlur: O,
|
|
61
|
+
onFocus: P,
|
|
62
|
+
onChange: j,
|
|
63
|
+
onKeyDown: U,
|
|
64
|
+
...pe
|
|
65
|
+
} = i, o = te("input-number"), q = ce || se, y = (() => {
|
|
66
|
+
if (z(G)) {
|
|
67
|
+
const e = `${V}`.split(".")[1], t = e && e.length || 0;
|
|
68
|
+
return Math.max(t, G);
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
})(), [K, me] = h(() => m(
|
|
72
|
+
"value" in i ? i.value : "defaultValue" in i ? ie : void 0
|
|
73
|
+
)), [b, Y] = h(""), [fe, de] = h(!1), [D, M] = h(!1), v = H(null), p = H(null), _ = H(!1), s = k(() => "value" in i ? m(i.value) : K, [i.value, K]), [u, l] = k(() => [m(N), m(c)], [N, c]);
|
|
74
|
+
Ve(ee, () => p.current, []);
|
|
75
|
+
const x = (e, t) => {
|
|
76
|
+
if (me(e), !e.equals(s) && j) {
|
|
77
|
+
const r = e.toString({
|
|
78
|
+
safe: !0,
|
|
79
|
+
precision: y
|
|
80
|
+
});
|
|
81
|
+
j(
|
|
82
|
+
e.isEmpty ? void 0 : ue ? r : e.isNaN ? NaN : Number(r),
|
|
83
|
+
t
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}, R = () => {
|
|
87
|
+
v.current && clearTimeout(v.current), v.current = null;
|
|
88
|
+
}, I = Ae(
|
|
89
|
+
(e) => {
|
|
90
|
+
let t = e;
|
|
91
|
+
return t.less(l) ? t = l : u.less(t) && (t = u), t;
|
|
92
|
+
},
|
|
93
|
+
[l, u]
|
|
94
|
+
);
|
|
95
|
+
w(() => () => R(), []), w(() => {
|
|
96
|
+
_.current = !1;
|
|
97
|
+
}, [i.value]), w(() => {
|
|
98
|
+
const e = s.less(l) || u.less(s);
|
|
99
|
+
e && _.current && x(I(s), "outOfRange"), de(e);
|
|
100
|
+
}, [l, u, s, I]);
|
|
101
|
+
const T = (e, t, r = !1) => {
|
|
102
|
+
if (e.persist(), e.preventDefault(), M(!1), E || d)
|
|
103
|
+
return;
|
|
104
|
+
const ye = s.isInvalid ? m(c === -1 / 0 || c <= 0 && N >= 0 ? 0 : c) : s.add(t === "plus" ? V : -V);
|
|
105
|
+
if (x(
|
|
106
|
+
I(ye),
|
|
107
|
+
t === "plus" ? "increase" : "decrease"
|
|
108
|
+
), p.current && p.current.focus(), r) {
|
|
109
|
+
const be = v.current === null;
|
|
110
|
+
v.current = setTimeout(
|
|
111
|
+
() => e.target.dispatchEvent(e.nativeEvent),
|
|
112
|
+
be ? He : ze
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}, J = k(() => {
|
|
116
|
+
let e;
|
|
117
|
+
return D ? e = g ? `${g(b)}` : b : z(y) ? e = s.toString({ safe: !0, precision: y }) : s.isInvalid ? e = "" : e = s.toString(), A ? A(e, { userTyping: D, input: b }) : e;
|
|
118
|
+
}, [s, b, D, y, g, A]), ge = _e({
|
|
119
|
+
inputElement: (W = p.current) == null ? void 0 : W.dom,
|
|
120
|
+
inputValue: J
|
|
121
|
+
}), ve = {
|
|
122
|
+
onChange: (e, t) => {
|
|
123
|
+
M(!0), e = e.trim().replace(/。/g, ".");
|
|
124
|
+
const r = g ? g(e) : e;
|
|
125
|
+
(z(+r) || r === "-" || !r || r === ".") && (Y(e), x(I(m(r)), "manual"), ge(t));
|
|
126
|
+
},
|
|
127
|
+
onKeyDown: (e) => {
|
|
128
|
+
const t = e.key;
|
|
129
|
+
t === Ue.key ? (e.stopPropagation(), T(e, "minus")) : t === De.key && (e.stopPropagation(), T(e, "plus")), R(), U == null || U(e);
|
|
130
|
+
},
|
|
131
|
+
onFocus: (e) => {
|
|
132
|
+
var t, r;
|
|
133
|
+
_.current = !0, Y((r = (t = p.current) == null ? void 0 : t.dom) == null ? void 0 : r.value), P == null || P(e);
|
|
134
|
+
},
|
|
135
|
+
onBlur: (e) => {
|
|
136
|
+
x(I(s), "outOfRange"), M(!1), O == null || O(e);
|
|
137
|
+
}
|
|
138
|
+
}, Ie = (e) => d ? {} : {
|
|
139
|
+
onMouseDown: (t) => T(t, e, !0)
|
|
140
|
+
}, Q = !B && S === "button", Ne = !B && !d && S === "embed", $ = (e, t) => {
|
|
141
|
+
const r = !E && (s.isInvalid || (e === "plus" ? u.isInvalid || s.less(u) : l.isInvalid || l.less(s)));
|
|
142
|
+
return /* @__PURE__ */ a(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
className: Z(`${o}-step-button`, {
|
|
146
|
+
[`${o}-step-button-disabled`]: !r
|
|
147
|
+
}),
|
|
148
|
+
onMouseLeave: R,
|
|
149
|
+
onMouseUp: R,
|
|
150
|
+
...r ? Ie(e) : {},
|
|
151
|
+
children: t
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
return /* @__PURE__ */ a(
|
|
156
|
+
Pe,
|
|
157
|
+
{
|
|
158
|
+
_ignorePropsFromGlobal: !0,
|
|
159
|
+
role: "spinbutton",
|
|
160
|
+
"aria-valuemax": N,
|
|
161
|
+
"aria-valuemin": c,
|
|
162
|
+
"aria-valuenow": s.isEmpty ? void 0 : s.toNumber(),
|
|
163
|
+
...Me(pe, ["allowClear"]),
|
|
164
|
+
...ve,
|
|
165
|
+
style: oe,
|
|
166
|
+
className: Z(
|
|
167
|
+
o,
|
|
168
|
+
`${o}-mode-${S}`,
|
|
169
|
+
`${o}-size-${q}`,
|
|
170
|
+
{
|
|
171
|
+
[`${o}-rtl`]: re,
|
|
172
|
+
[`${o}-readonly`]: d,
|
|
173
|
+
[`${o}-illegal-value`]: !s.isEmpty && fe
|
|
174
|
+
},
|
|
175
|
+
ne
|
|
176
|
+
),
|
|
177
|
+
ref: p,
|
|
178
|
+
size: q,
|
|
179
|
+
error: ae,
|
|
180
|
+
disabled: E,
|
|
181
|
+
readOnly: d,
|
|
182
|
+
value: J,
|
|
183
|
+
placeholder: le,
|
|
184
|
+
prefix: F && /* @__PURE__ */ a("div", { className: `${o}-prefix`, children: F }),
|
|
185
|
+
suffix: /* @__PURE__ */ X(xe, { children: [
|
|
186
|
+
Ne && /* @__PURE__ */ X("div", { className: `${o}-step-layer`, children: [
|
|
187
|
+
$(
|
|
188
|
+
"plus",
|
|
189
|
+
n && n.up ? n.up : /* @__PURE__ */ a(Ce, {})
|
|
190
|
+
),
|
|
191
|
+
$(
|
|
192
|
+
"minus",
|
|
193
|
+
n && n.down ? n.down : /* @__PURE__ */ a(Re, {})
|
|
194
|
+
)
|
|
195
|
+
] }),
|
|
196
|
+
L && /* @__PURE__ */ a("div", { className: `${o}-suffix`, children: L })
|
|
197
|
+
] }),
|
|
198
|
+
addBefore: Q && $(
|
|
199
|
+
"minus",
|
|
200
|
+
n && n.minus ? n.minus : /* @__PURE__ */ a($e, {})
|
|
201
|
+
),
|
|
202
|
+
addAfter: Q && $(
|
|
203
|
+
"plus",
|
|
204
|
+
n && n.plus ? n.plus : /* @__PURE__ */ a(he, {})
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
const Be = Ee.forwardRef(
|
|
210
|
+
we
|
|
211
|
+
);
|
|
212
|
+
Be.displayName = "InputNumber";
|
|
17
213
|
export {
|
|
18
|
-
|
|
214
|
+
Be as default
|
|
19
215
|
};
|
package/InputTag.js
CHANGED