@unicom-cloud/ui 0.8.158 → 0.8.160
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/.virtual/_rolldown/runtime.js +1 -1
- package/.vite/manifest.json +1244 -845
- package/affix/Affix.js +35 -34
- package/affix/index.d.ts +3 -1
- package/affix/index.js +6 -5
- package/alert/Alert.js +35 -34
- package/alert/index.d.ts +3 -1
- package/alert/index.js +6 -5
- package/anchor/Anchor.js +41 -40
- package/anchor/Link.js +19 -18
- package/anchor/context.js +1 -1
- package/anchor/index.d.ts +1 -0
- package/anchor/index.js +11 -7
- package/anchor/utils.js +1 -1
- package/app/App.js +13 -12
- package/app/context.js +1 -1
- package/app/index.js +11 -7
- package/app/interface.d.ts +6 -6
- package/app/useApp.js +1 -1
- package/auto-complete/AutoComplete.js +55 -54
- package/auto-complete/index.d.ts +1 -0
- package/auto-complete/index.js +11 -9
- package/avatar/Avatar.js +24 -23
- package/avatar/Group.js +22 -21
- package/avatar/context.js +1 -1
- package/avatar/index.d.ts +1 -0
- package/avatar/index.js +11 -7
- package/back-top/BackTop.js +25 -24
- package/back-top/index.d.ts +3 -1
- package/back-top/index.js +6 -5
- package/badge/Badge.js +31 -30
- package/badge/Count.js +5 -5
- package/badge/index.d.ts +1 -0
- package/badge/index.js +11 -7
- package/badge/utils.js +1 -1
- package/border-beam/BorderBeam.d.ts +4 -0
- package/border-beam/BorderBeam.js +27 -0
- package/border-beam/index.d.ts +6 -0
- package/border-beam/index.js +13 -0
- package/border-beam/interface.d.ts +6 -0
- package/breadcrumb/Breadcrumb.js +29 -28
- package/breadcrumb/Item.js +16 -15
- package/breadcrumb/context.js +1 -1
- package/breadcrumb/index.d.ts +1 -0
- package/breadcrumb/index.js +11 -7
- package/button/Button.js +24 -23
- package/button/Group.js +12 -11
- package/button/Toggle.d.ts +3 -0
- package/button/Toggle.js +29 -0
- package/button/index.d.ts +4 -1
- package/button/index.js +11 -7
- package/button/interface.d.ts +6 -0
- package/calendar/Calendar.js +27 -26
- package/calendar/Month.js +1 -1
- package/calendar/WeekList.js +1 -1
- package/calendar/Year.js +1 -1
- package/calendar/header/Panel.js +1 -1
- package/calendar/header/index.js +1 -1
- package/calendar/hook/useCellClassName.js +1 -1
- package/calendar/index.d.ts +1 -0
- package/calendar/index.js +11 -9
- package/card/Card.js +28 -27
- package/card/Grid.js +12 -11
- package/card/Meta.js +17 -16
- package/card/index.d.ts +1 -0
- package/card/index.js +11 -9
- package/carousel/Arrow.js +1 -1
- package/carousel/Carousel.js +28 -27
- package/carousel/Indicator.js +1 -1
- package/carousel/index.d.ts +3 -1
- package/carousel/index.js +6 -5
- package/cascader/Cascader.js +130 -130
- package/cascader/base/node.js +1 -1
- package/cascader/base/store.js +1 -1
- package/cascader/hook/useRefCurrent.js +1 -1
- package/cascader/index.d.ts +3 -1
- package/cascader/index.js +6 -5
- package/cascader/panel/List.js +1 -1
- package/cascader/panel/Option.js +1 -1
- package/cascader/panel/Search.d.ts +1 -1
- package/cascader/panel/Search.js +62 -58
- package/cascader/utils.js +1 -1
- package/checkbox/Checkbox.js +30 -29
- package/checkbox/Group.js +20 -19
- package/checkbox/GroupBlock.js +26 -25
- package/checkbox/context.js +1 -1
- package/checkbox/index.d.ts +1 -0
- package/checkbox/index.js +14 -12
- package/checkbox/useCheckbox.js +1 -1
- package/collapse/Collapse.js +37 -36
- package/collapse/Item.js +29 -28
- package/collapse/context.js +4 -5
- package/collapse/index.d.ts +1 -0
- package/collapse/index.js +11 -7
- package/collapse/utils.js +1 -1
- package/color-picker/ColorPicker.js +35 -34
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Mode.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +100 -104
- package/color-picker/colors.js +1 -1
- package/color-picker/hooks/useColorPicker.d.ts +1 -1
- package/color-picker/hooks/useColorPicker.js +1 -1
- package/color-picker/hooks/useControlBlock.js +1 -1
- package/color-picker/index.js +19 -17
- package/color-picker/interface.js +1 -1
- package/color-picker/utils.d.ts +1 -1
- package/color-picker/utils.js +1 -1
- package/comment/Comment.js +27 -26
- package/comment/index.d.ts +3 -1
- package/comment/index.js +6 -5
- package/config-provider/ConfigProvider.js +26 -25
- package/config-provider/context.js +1 -1
- package/config-provider/index.d.ts +1 -0
- package/config-provider/index.js +10 -6
- package/config-provider/initUI.js +1 -1
- package/config-provider/interface.d.ts +2 -0
- package/config-provider/useConfigProvider.d.ts +0 -3
- package/config-provider/useConfigProvider.js +1 -2
- package/config-provider/utils.js +1 -1
- package/constant/index.js +1 -1
- package/copy/Copy.js +25 -24
- package/copy/index.d.ts +3 -1
- package/copy/index.js +6 -5
- package/countdown/Countdown.js +26 -25
- package/countdown/index.d.ts +3 -1
- package/countdown/index.js +6 -5
- package/countdown/utils.js +1 -1
- package/date-picker/DatePicker.d.ts +1 -1
- package/date-picker/DatePicker.js +29 -27
- package/date-picker/DatePickerRange.js +247 -246
- package/date-picker/Picker.js +184 -184
- package/date-picker/context.js +1 -1
- package/date-picker/hook/useCellClassName.js +1 -1
- package/date-picker/index.d.ts +1 -0
- package/date-picker/index.js +15 -13
- package/date-picker/interface.d.ts +2 -2
- package/date-picker/panel/Body.js +1 -1
- package/date-picker/panel/Footer.js +1 -1
- package/date-picker/panel/Header.js +1 -1
- package/date-picker/panel/Shortcut.js +1 -1
- package/date-picker/panel/WeekList.js +1 -1
- package/date-picker/panel/date/index.js +1 -1
- package/date-picker/panel/month/index.js +1 -1
- package/date-picker/panel/quarter/index.js +1 -1
- package/date-picker/panel/range/index.js +1 -1
- package/date-picker/panel/week/index.js +1 -1
- package/date-picker/panel/year/index.js +1 -1
- package/date-picker/utils.js +1 -1
- package/descriptions/Descriptions.js +37 -36
- package/descriptions/index.d.ts +3 -1
- package/descriptions/index.js +6 -5
- package/details/Details.js +33 -32
- package/details/index.d.ts +3 -1
- package/details/index.js +6 -5
- package/development/Development.js +1 -1
- package/development/index.d.ts +3 -1
- package/development/index.js +6 -5
- package/divider/Divider.js +19 -18
- package/divider/index.d.ts +1 -0
- package/divider/index.js +9 -5
- package/draggable/Draggable.js +1 -1
- package/draggable/Item.js +1 -1
- package/draggable/index.d.ts +1 -0
- package/draggable/index.js +10 -6
- package/draw/Draw.js +18 -17
- package/draw/constant.js +1 -1
- package/draw/index.d.ts +1 -0
- package/draw/index.js +9 -5
- package/drawer/Drawer.js +157 -157
- package/drawer/index.d.ts +3 -1
- package/drawer/index.js +6 -5
- package/drawer/interface.d.ts +5 -0
- package/dropdown/Button.js +21 -20
- package/dropdown/Dropdown.js +30 -29
- package/dropdown/index.d.ts +1 -0
- package/dropdown/index.js +10 -6
- package/empty/Empty.js +14 -13
- package/empty/index.d.ts +3 -1
- package/empty/index.js +6 -5
- package/flex/Flex.js +19 -18
- package/flex/index.d.ts +1 -0
- package/flex/index.js +9 -5
- package/form/Control.d.ts +2 -2
- package/form/Control.js +26 -26
- package/form/Form.js +84 -80
- package/form/FormControl.js +94 -95
- package/form/FormItem.js +70 -67
- package/form/FormItemLabel.js +1 -1
- package/form/FormItemTip.js +19 -18
- package/form/FormLabelSymbol.js +1 -1
- package/form/FormList.js +36 -35
- package/form/FormProvider.js +1 -1
- package/form/constant.js +1 -1
- package/form/context.js +1 -1
- package/form/hook/useForm.d.ts +2 -2
- package/form/hook/useForm.js +3 -4
- package/form/hook/useFormContext.js +1 -1
- package/form/hook/useFormState.js +1 -1
- package/form/hook/useWatch.js +1 -1
- package/form/index.d.ts +27 -13
- package/form/index.js +36 -34
- package/form/interface.js +1 -1
- package/form/promisify.js +1 -1
- package/form/store.js +1 -1
- package/form/utils.js +1 -1
- package/global-provider/GlobalProvider.js +13 -12
- package/global-provider/context.js +2 -2
- package/global-provider/index.d.ts +1 -0
- package/global-provider/index.js +10 -8
- package/grid/Grid.js +20 -19
- package/grid/Item.js +16 -15
- package/grid/context.js +1 -1
- package/grid/index.d.ts +2 -0
- package/grid/index.js +15 -13
- package/grid/utils.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/use-breakpoint/index.js +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +1 -1
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-props/index.js +1 -1
- package/hooks/use-move/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +1 -1
- package/hooks/use-responsive-state/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-verification-code/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-watermark/index.js +1 -1
- package/hooks/use-watermark/utils.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/useUnmountOnExit.d.ts +1 -1
- package/hooks/useUnmountOnExit.js +12 -8
- package/icon/Icon.js +16 -17
- package/icon/addIconFromCdn.js +1 -1
- package/icon/index.js +12 -10
- package/icon-hover/IconHover.js +15 -13
- package/icon-hover/index.d.ts +3 -1
- package/icon-hover/index.js +6 -5
- package/icon-hover/interface.d.ts +2 -2
- package/icons/file/File.js +13 -12
- package/icons/file/index.js +1 -1
- package/icons.js +1 -1
- package/image/Image.js +19 -18
- package/image/ImageFooter.js +1 -1
- package/image/ImagePreview.js +241 -233
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +62 -61
- package/image/ImagePreviewToolbar.js +1 -1
- package/image/TriggerForToolbar.js +2 -2
- package/image/context.js +1 -1
- package/image/index.d.ts +1 -0
- package/image/index.js +12 -10
- package/image/utils/getFixTranslate.js +1 -1
- package/image/utils/getScale.js +1 -1
- package/image/utils/hook/useImageStatus.js +1 -1
- package/image/utils/hook/useShowFooter.js +1 -1
- package/index.d.ts +6 -2
- package/index.js +973 -955
- package/input/Button.js +20 -19
- package/input/Group.js +12 -11
- package/input/Input.js +34 -33
- package/input/InputComponent.js +98 -97
- package/input/Password.js +23 -22
- package/input/Search.js +24 -23
- package/input/Textarea.js +67 -66
- package/input/autoSizeTextareaHeight.js +1 -1
- package/input/index.d.ts +7 -2
- package/input/index.js +24 -22
- package/input/useComposition.js +1 -1
- package/input/utils.js +1 -1
- package/input-number/InputNumber.js +52 -51
- package/input-number/decimal.js +1 -1
- package/input-number/index.d.ts +3 -1
- package/input-number/index.js +6 -5
- package/input-number/useSelectionRange.js +1 -1
- package/input-number/utils.js +1 -1
- package/input-tag/InputTag.js +130 -129
- package/input-tag/constant.js +1 -1
- package/input-tag/hook/useComputeAutoWidthDelay.js +1 -1
- package/input-tag/index.d.ts +3 -1
- package/input-tag/index.js +6 -5
- package/layout/Content.js +12 -11
- package/layout/Footer.js +12 -11
- package/layout/Header.js +12 -11
- package/layout/Layout.js +17 -16
- package/layout/Sider.js +25 -24
- package/layout/context.js +1 -1
- package/layout/index.d.ts +1 -0
- package/layout/index.js +17 -15
- package/link/Link.js +19 -18
- package/link/index.d.ts +3 -1
- package/link/index.js +6 -5
- package/liquid-fill/LiquidFill.d.ts +2 -2
- package/liquid-fill/LiquidFill.js +51 -47
- package/liquid-fill/index.d.ts +3 -1
- package/liquid-fill/index.js +6 -5
- package/list/Item.js +22 -21
- package/list/List.d.ts +2 -2
- package/list/List.js +85 -84
- package/list/Meta.js +16 -15
- package/list/index.js +10 -6
- package/loading/Loading.js +32 -32
- package/loading/index.d.ts +3 -1
- package/loading/index.js +6 -5
- package/locale/ar-EG.js +1 -1
- package/locale/de-DE.js +1 -1
- package/locale/default.js +1 -1
- package/locale/en-US.js +1 -1
- package/locale/es-ES.js +1 -1
- package/locale/fr-FR.js +1 -1
- package/locale/id-ID.js +1 -1
- package/locale/it-IT.js +1 -1
- package/locale/ja-JP.js +1 -1
- package/locale/ko-KR.js +1 -1
- package/locale/ms-MY.js +1 -1
- package/locale/pt-BR.js +1 -1
- package/locale/pt-PT.js +1 -1
- package/locale/ru-RU.js +1 -1
- package/locale/th-TH.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/locale/vi-VN.js +1 -1
- package/locale/zh-CN.js +1 -1
- package/locale/zh-HK.js +1 -1
- package/locale/zh-TW.js +1 -1
- package/marquee/Marquee.js +1 -1
- package/marquee/index.d.ts +3 -1
- package/marquee/index.js +6 -5
- package/mask/Mask.js +30 -25
- package/mask/constant.js +1 -1
- package/mask/index.d.ts +3 -1
- package/mask/index.js +6 -5
- package/mask/interface.d.ts +3 -0
- package/masonry/Masonry.js +35 -34
- package/masonry/MasonryItem.js +12 -11
- package/masonry/hooks/useDelay.js +1 -1
- package/masonry/hooks/useGutter.js +1 -1
- package/masonry/hooks/usePositions.js +1 -1
- package/masonry/hooks/useRefs.js +1 -1
- package/masonry/index.d.ts +1 -0
- package/masonry/index.js +10 -6
- package/mentions/Mentions.js +9 -8
- package/mentions/index.d.ts +3 -1
- package/mentions/index.js +6 -5
- package/mentions/utils.js +1 -1
- package/menu/Indent.js +1 -1
- package/menu/Item.js +25 -24
- package/menu/ItemGroup.js +17 -16
- package/menu/Menu.js +69 -68
- package/menu/OverflowWrap.js +43 -41
- package/menu/context.d.ts +1 -1
- package/menu/context.js +1 -1
- package/menu/index.d.ts +13 -1
- package/menu/index.js +15 -14
- package/menu/sub-menu/Inline.js +1 -1
- package/menu/sub-menu/Pop.js +2 -2
- package/menu/sub-menu/index.js +17 -16
- package/menu/utils.js +45 -44
- package/message/Message.d.ts +3 -19
- package/message/Message.js +115 -94
- package/message/constants.d.ts +7 -0
- package/message/constants.js +11 -0
- package/message/index.d.ts +9 -0
- package/message/index.js +10 -6
- package/message/interface.d.ts +18 -56
- package/message/useMessage.d.ts +2 -3
- package/message/useMessage.js +44 -44
- package/modal/Confirm.js +60 -59
- package/modal/Modal.js +205 -207
- package/modal/config.js +1 -1
- package/modal/index.d.ts +3 -1
- package/modal/index.js +7 -6
- package/modal/interface.d.ts +10 -1
- package/modal/use-modal/Hook.js +1 -1
- package/modal/use-modal/index.js +1 -1
- package/notice/Notice.d.ts +1 -1
- package/notice/Notice.js +84 -102
- package/notice/constants.d.ts +1 -0
- package/notice/constants.js +6 -0
- package/notice/index.d.ts +7 -2
- package/notice/index.js +10 -5
- package/notice/interface.d.ts +69 -11
- package/notice/utils.d.ts +1 -0
- package/notice/utils.js +9 -0
- package/notice/withNotice.d.ts +3 -0
- package/notice/withNotice.js +83 -0
- package/notification/Notification.d.ts +6 -9
- package/notification/Notification.js +116 -87
- package/notification/constants.d.ts +1 -0
- package/notification/constants.js +5 -4
- package/notification/index.js +7 -6
- package/notification/interface.d.ts +6 -81
- package/notification/useNotification.d.ts +2 -3
- package/notification/useNotification.js +43 -35
- package/notification/utils.d.ts +4 -11
- package/notification/utils.js +1 -1
- package/overflow-ellipsis/OverflowEllipsis.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.d.ts +3 -1
- package/overflow-ellipsis/index.js +7 -6
- package/package.json +1 -1
- package/page-header/PageHeader.js +36 -35
- package/page-header/index.d.ts +3 -1
- package/page-header/index.js +6 -5
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +1 -1
- package/pagination/Pagination.js +63 -62
- package/pagination/index.d.ts +3 -1
- package/pagination/index.js +7 -6
- package/pagination/interface.js +1 -1
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/picker/index.d.ts +1 -0
- package/picker/index.js +10 -6
- package/popconfirm/Popconfirm.js +23 -22
- package/popconfirm/index.d.ts +3 -1
- package/popconfirm/index.js +6 -5
- package/popover/Popover.js +18 -17
- package/popover/index.d.ts +3 -1
- package/popover/index.js +6 -5
- package/portal/Portal.d.ts +1 -1
- package/portal/Portal.js +30 -17
- package/portal/index.d.ts +3 -1
- package/portal/index.js +6 -5
- package/portal/interface.d.ts +1 -0
- package/progress/CircleProgress.js +1 -1
- package/progress/LineProgess.js +1 -1
- package/progress/Progress.js +24 -23
- package/progress/StepProgress.js +1 -1
- package/progress/index.d.ts +3 -0
- package/progress/index.js +15 -13
- package/qr-code/QRCode.js +17 -16
- package/qr-code/index.d.ts +1 -0
- package/qr-code/index.js +10 -6
- package/qr-code/src/index.js +1 -1
- package/qr-code/src/qrcodegen.js +1 -1
- package/radio/Group.js +18 -17
- package/radio/GroupBlock.js +29 -28
- package/radio/Radio.js +26 -25
- package/radio/context.js +1 -1
- package/radio/index.d.ts +1 -0
- package/radio/index.js +13 -11
- package/rate/Rate.js +46 -45
- package/rate/index.d.ts +3 -1
- package/rate/index.js +6 -5
- package/resize-box/ResizeBox.js +32 -31
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +27 -26
- package/resize-box/SplitGroup.js +70 -69
- package/resize-box/index.d.ts +1 -0
- package/resize-box/index.js +11 -9
- package/result/403.js +1 -1
- package/result/404.js +1 -1
- package/result/500.js +1 -1
- package/result/Result.js +39 -38
- package/result/index.d.ts +3 -1
- package/result/index.js +6 -5
- package/rich-text/RichText.js +46 -45
- package/rich-text/Toolbar.js +119 -118
- package/rich-text/constant.js +1 -1
- package/rich-text/index.d.ts +1 -0
- package/rich-text/index.js +27 -25
- package/rich-text/lib/blots/block.js +1 -1
- package/rich-text/lib/blots/break.js +1 -1
- package/rich-text/lib/blots/container.js +1 -1
- package/rich-text/lib/blots/cursor.js +1 -1
- package/rich-text/lib/blots/embed.js +1 -1
- package/rich-text/lib/blots/inline.js +1 -1
- package/rich-text/lib/blots/scroll.js +1 -1
- package/rich-text/lib/blots/text.js +1 -1
- package/rich-text/lib/core/composition.js +1 -1
- package/rich-text/lib/core/editor.js +1 -1
- package/rich-text/lib/core/emitter.js +1 -1
- package/rich-text/lib/core/logger.js +1 -1
- package/rich-text/lib/core/module.js +1 -1
- package/rich-text/lib/core/rich.js +1 -1
- package/rich-text/lib/core/selection.js +1 -1
- package/rich-text/lib/core/theme.js +1 -1
- package/rich-text/lib/core/utils/createRegistryWithFormats.js +1 -1
- package/rich-text/lib/core/utils/scrollRectIntoView.js +1 -1
- package/rich-text/lib/delta/AttributeMap.js +1 -1
- package/rich-text/lib/delta/Op.js +1 -1
- package/rich-text/lib/delta/OpIterator.js +1 -1
- package/rich-text/lib/delta/index.js +1 -1
- package/rich-text/lib/diff/index.js +1 -1
- package/rich-text/lib/formats/align.js +1 -1
- package/rich-text/lib/formats/background.js +1 -1
- package/rich-text/lib/formats/blockquote.js +1 -1
- package/rich-text/lib/formats/bold.js +1 -1
- package/rich-text/lib/formats/code.js +1 -1
- package/rich-text/lib/formats/color.js +1 -1
- package/rich-text/lib/formats/direction.js +1 -1
- package/rich-text/lib/formats/emoji.js +1 -1
- package/rich-text/lib/formats/font.js +1 -1
- package/rich-text/lib/formats/formula.js +1 -1
- package/rich-text/lib/formats/header.js +1 -1
- package/rich-text/lib/formats/hr.js +1 -1
- package/rich-text/lib/formats/image.js +1 -1
- package/rich-text/lib/formats/indent.js +1 -1
- package/rich-text/lib/formats/italic.js +1 -1
- package/rich-text/lib/formats/lineHeight.js +1 -1
- package/rich-text/lib/formats/link.js +1 -1
- package/rich-text/lib/formats/list.js +1 -1
- package/rich-text/lib/formats/script.js +1 -1
- package/rich-text/lib/formats/size.js +1 -1
- package/rich-text/lib/formats/strike.js +1 -1
- package/rich-text/lib/formats/table.js +1 -1
- package/rich-text/lib/formats/underline.js +1 -1
- package/rich-text/lib/formats/video.js +1 -1
- package/rich-text/lib/index.js +1 -1
- package/rich-text/lib/modules/clipboard.js +1 -1
- package/rich-text/lib/modules/history.js +1 -1
- package/rich-text/lib/modules/image-resize/index.js +1 -1
- package/rich-text/lib/modules/image-resize/modules/Base.js +1 -1
- package/rich-text/lib/modules/image-resize/modules/DisplaySize.js +1 -1
- package/rich-text/lib/modules/image-resize/modules/Resize.js +1 -1
- package/rich-text/lib/modules/image-resize/options.js +1 -1
- package/rich-text/lib/modules/input.js +1 -1
- package/rich-text/lib/modules/keyboard.js +1 -1
- package/rich-text/lib/modules/normalizeExternalHTML/index.js +1 -1
- package/rich-text/lib/modules/normalizeExternalHTML/normalizers/googleDocs.js +1 -1
- package/rich-text/lib/modules/normalizeExternalHTML/normalizers/msWord.js +1 -1
- package/rich-text/lib/modules/table.js +1 -1
- package/rich-text/lib/modules/toolbar.js +1 -1
- package/rich-text/lib/modules/uiNode.js +1 -1
- package/rich-text/lib/modules/uploader.js +1 -1
- package/rich-text/lib/parchment/attributor/attributor.js +1 -1
- package/rich-text/lib/parchment/attributor/class.js +1 -1
- package/rich-text/lib/parchment/attributor/store.js +1 -1
- package/rich-text/lib/parchment/attributor/style.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/container.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/leaf.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/parent.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/shadow.js +1 -1
- package/rich-text/lib/parchment/blot/block.js +1 -1
- package/rich-text/lib/parchment/blot/embed.js +1 -1
- package/rich-text/lib/parchment/blot/inline.js +1 -1
- package/rich-text/lib/parchment/blot/scroll.js +1 -1
- package/rich-text/lib/parchment/blot/text.js +1 -1
- package/rich-text/lib/parchment/collection/linked-list.js +1 -1
- package/rich-text/lib/parchment/error.js +1 -1
- package/rich-text/lib/parchment/index.js +1 -1
- package/rich-text/lib/parchment/registry.js +1 -1
- package/rich-text/lib/parchment/scope.js +2 -2
- package/row-col/Col-.js +18 -17
- package/row-col/Col.js +18 -17
- package/row-col/Row.js +17 -16
- package/row-col/context.js +1 -1
- package/row-col/index.d.ts +1 -0
- package/row-col/index.js +12 -10
- package/segmented/Segmented.js +54 -53
- package/segmented/index.d.ts +3 -1
- package/segmented/index.js +6 -5
- package/select/Option.js +1 -1
- package/select/OptionGroup.js +1 -1
- package/select/Select.js +234 -231
- package/select/index.d.ts +1 -0
- package/select/index.js +11 -9
- package/select/utils.js +1 -1
- package/select-view/Core.js +176 -178
- package/select-view/SelectView.js +18 -17
- package/select-view/index.d.ts +3 -1
- package/select-view/index.js +6 -5
- package/select-view/interface.d.ts +1 -0
- package/skeleton/Image.js +1 -1
- package/skeleton/Skeleton.js +22 -21
- package/skeleton/Text.js +1 -1
- package/skeleton/index.d.ts +1 -0
- package/skeleton/index.js +11 -9
- package/slider/Button.js +2 -2
- package/slider/Dot.js +1 -1
- package/slider/Input.js +1 -1
- package/slider/Mark.js +1 -1
- package/slider/Slider.js +163 -162
- package/slider/Tick.js +1 -1
- package/slider/hook/useInterval.js +1 -1
- package/slider/hook/useLegalValue.js +1 -1
- package/slider/index.js +17 -15
- package/slider/utils.js +1 -1
- package/space/Space.js +19 -18
- package/space/index.d.ts +1 -0
- package/space/index.js +9 -5
- package/speech-synthesis/SpeechSynthesis.js +1 -1
- package/speech-synthesis/index.d.ts +3 -1
- package/speech-synthesis/index.js +6 -5
- package/spin/DotLoading.js +1 -1
- package/spin/Spin.js +68 -65
- package/spin/index.d.ts +1 -0
- package/spin/index.js +10 -6
- package/spin/interface.d.ts +1 -1
- package/splitter/Panel.js +11 -10
- package/splitter/SplitBar.js +1 -1
- package/splitter/Splitter.js +29 -28
- package/splitter/hooks/useItems.js +1 -1
- package/splitter/hooks/useResizable.js +1 -1
- package/splitter/hooks/useResize.js +1 -1
- package/splitter/hooks/useSizes.js +1 -1
- package/splitter/index.d.ts +1 -0
- package/splitter/index.js +10 -6
- package/statistic/Statistic.js +33 -32
- package/statistic/index.d.ts +4 -1
- package/statistic/index.js +10 -6
- package/statistic/interface.js +1 -1
- package/steps/Step.js +18 -17
- package/steps/Steps.js +39 -38
- package/steps/index.d.ts +1 -0
- package/steps/index.js +10 -8
- package/style/global.less +4 -0
- package/style.css +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +1 -1
- package/suspense-fallback-test/index.d.ts +5 -1
- package/suspense-fallback-test/index.js +6 -5
- package/switch/Switch.js +26 -25
- package/switch/index.d.ts +1 -0
- package/switch/index.js +9 -5
- package/table/ColGroup.js +1 -1
- package/table/Table.js +274 -273
- package/table/constant.js +1 -1
- package/table/context.js +1 -1
- package/table/hook/useColumns.js +1 -1
- package/table/hook/useComponent.js +1 -1
- package/table/hook/useExpand.js +1 -1
- package/table/hook/useRowSelection.js +1 -1
- package/table/hook/useSorter.js +1 -1
- package/table/hook/useStickyClassNames.js +1 -1
- package/table/hook/useStickyOffsets.js +1 -1
- package/table/hook/useThResizable.js +1 -1
- package/table/index.js +39 -37
- package/table/summary/Cell.js +1 -1
- package/table/summary/Row.js +1 -1
- package/table/summary/context.js +1 -1
- package/table/summary/index.js +1 -1
- package/table/tbody/DataRecordRenderer.js +1 -1
- package/table/tbody/Td.js +1 -1
- package/table/tbody/Tr.d.ts +2 -2
- package/table/tbody/Tr.js +1 -1
- package/table/tbody/index.js +1 -1
- package/table/tfoot/index.js +1 -1
- package/table/th-resizable/index.js +1 -1
- package/table/thead/Column.js +1 -1
- package/table/thead/index.js +1 -1
- package/table/utils.js +1 -1
- package/tabs/TabContent.js +1 -1
- package/tabs/TabPane.js +15 -14
- package/tabs/Tabs.js +37 -36
- package/tabs/context.js +1 -1
- package/tabs/hook/useDomSize.js +1 -1
- package/tabs/hook/useHeaderScroll.js +1 -1
- package/tabs/index.d.ts +1 -0
- package/tabs/index.js +14 -12
- package/tabs/tab-header/DropdownIcon.js +1 -1
- package/tabs/tab-header/TabInk.js +1 -1
- package/tabs/tab-header/TabNavIcon.js +1 -1
- package/tabs/tab-header/TabTitle.js +1 -1
- package/tabs/tab-header/index.js +61 -60
- package/tabs/utils.js +1 -1
- package/tag/Tag.js +18 -17
- package/tag/index.d.ts +3 -1
- package/tag/index.js +7 -6
- package/tag/utils.js +1 -1
- package/time-picker/Picker.js +50 -50
- package/time-picker/TimeColumn.js +1 -1
- package/time-picker/TimePicker.d.ts +6 -1
- package/time-picker/TimePicker.js +24 -22
- package/time-picker/TimePickerRange.d.ts +6 -1
- package/time-picker/TimePickerRange.js +15 -13
- package/time-picker/context.js +1 -1
- package/time-picker/index.js +11 -23
- package/time-picker/interface.d.ts +2 -2
- package/time-picker/utils.js +1 -1
- package/time-picker/withTimePicker.d.ts +6 -0
- package/time-picker/withTimePicker.js +18 -0
- package/timeline/Item.js +23 -22
- package/timeline/Timeline.js +25 -24
- package/timeline/index.d.ts +1 -0
- package/timeline/index.js +10 -6
- package/timer/Timer.js +14 -13
- package/timer/index.d.ts +3 -1
- package/timer/index.js +6 -5
- package/toast/Toast.d.ts +5 -0
- package/toast/Toast.js +7 -0
- package/toast/index.d.ts +10 -0
- package/toast/index.js +12 -0
- package/toast/interface.d.ts +6 -0
- package/tooltip/Tooltip.js +63 -64
- package/tooltip/index.d.ts +3 -1
- package/tooltip/index.js +6 -5
- package/tour/Tour.js +139 -117
- package/tour/index.d.ts +3 -1
- package/tour/index.js +6 -5
- package/transfer/Item.js +1 -1
- package/transfer/List.js +1 -1
- package/transfer/Transfer.js +25 -24
- package/transfer/index.d.ts +3 -1
- package/transfer/index.js +6 -5
- package/transition/index.js +1 -1
- package/tree/Animation.js +1 -1
- package/tree/Node.js +71 -69
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +178 -177
- package/tree/context.js +2 -2
- package/tree/index.js +18 -16
- package/tree/utils.js +1 -1
- package/tree-select/List.js +1 -1
- package/tree-select/TreeSelect.js +54 -53
- package/tree-select/hook/useKeyCache.js +1 -1
- package/tree-select/hook/useStateValue.js +1 -1
- package/tree-select/hook/useTreeData.js +5 -5
- package/tree-select/index.d.ts +1 -0
- package/tree-select/index.js +12 -10
- package/tree-select/utils.js +1 -1
- package/trigger/Trigger.js +236 -237
- package/trigger/getPopupStyle.js +60 -58
- package/trigger/index.d.ts +3 -1
- package/trigger/index.js +7 -6
- package/trigger/utils.d.ts +3 -1
- package/trigger/utils.js +15 -9
- package/typography/Base.js +1 -1
- package/typography/EditContent.js +1 -1
- package/typography/Ellipsis.js +1 -1
- package/typography/Operations.js +1 -1
- package/typography/Paragraph.js +14 -13
- package/typography/Text.js +12 -11
- package/typography/Title.js +12 -11
- package/typography/Typography.js +12 -11
- package/typography/index.d.ts +1 -0
- package/typography/index.js +23 -21
- package/typography/useCssEllipsis.js +1 -1
- package/typography/useEllipsis.js +82 -82
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +60 -59
- package/upload/Uploader.js +1 -1
- package/upload/constant.js +1 -1
- package/upload/index.d.ts +1 -0
- package/upload/index.js +15 -13
- package/upload/list/PictureItem.js +1 -1
- package/upload/list/TextItem.js +1 -1
- package/upload/list/UploadProgress.js +1 -1
- package/upload/list/index.js +31 -30
- package/upload/list/utils.js +1 -1
- package/upload/request.js +1 -1
- package/upload/utils.js +1 -1
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/constant.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.d.ts +1 -0
- package/utils/dom.js +3 -1
- package/utils/emitter.js +1 -1
- package/utils/file.d.ts +1 -0
- package/utils/file.js +4 -0
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.js +1 -1
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.d.ts +3 -1
- package/utils/index.js +317 -307
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +2 -1
- package/utils/is.js +118 -112
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/math.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.d.ts +1181 -11
- package/utils/names.js +1079 -1029
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +1 -1
- package/utils/responsiveObserve.js +2 -2
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/setCreateRoot.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/throttleByRaf.js +1 -1
- package/utils/throttleByRaf2.js +1 -1
- package/utils/tinycolor.d.ts +2 -0
- package/utils/tinycolor.js +6 -0
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tween.js +1 -1
- package/utils/uuid.js +1 -1
- package/utils/validate.js +1 -1
- package/utils/warning.js +1 -1
- package/verification-code/VerificationCode.js +20 -19
- package/verification-code/index.d.ts +1 -0
- package/verification-code/index.js +9 -5
- package/version/index.d.ts +1 -1
- package/version/index.js +8 -8
- package/virtual-list/Filler.js +8 -3
- package/virtual-list/VirtualList.js +164 -157
- package/virtual-list/constant.js +1 -1
- package/virtual-list/hook/useCacheChildrenNodes.js +1 -1
- package/virtual-list/hook/useComputeVirtualItemHeight.js +1 -1
- package/virtual-list/index.js +10 -6
- package/virtual-list/utils/algorithm.js +1 -1
- package/virtual-list/utils/item.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/watermark/index.d.ts +1 -0
- package/watermark/index.js +9 -5
- package/notification/withNotification.d.ts +0 -3
- package/notification/withNotification.js +0 -47
package/form/FormControl.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-18 15:17:02 星期一 */
|
|
2
2
|
import { isArray as e, isBoolean as t, isEqualWith as n, isExist as r, isFunction as i, isNil as a, isUndefined as o } from "../utils/is.js";
|
|
3
3
|
import s from "../hooks/use-force-update/index.js";
|
|
4
4
|
import c from "../utils/className.js";
|
|
5
|
-
import l from "../
|
|
6
|
-
import u from "../
|
|
7
|
-
import
|
|
5
|
+
import { FORM_CONTROL_COMPONENT_INFO as l } from "../utils/names.js";
|
|
6
|
+
import u from "../hooks/use-merge-props/index.js";
|
|
7
|
+
import d from "../config-provider/context.js";
|
|
8
|
+
import f from "../hooks/use-create/index.js";
|
|
9
|
+
import { FormContext as p, FormItemContext as ee, FormListContext as te } from "./context.js";
|
|
8
10
|
import "../config-provider/index.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { cloneDeep as ne, isFieldMatch as h, isSyntheticEvent as re, schemaValidate as g } from "./utils.js";
|
|
11
|
+
import m from "../utils/warning.js";
|
|
12
|
+
import h from "../hooks/use-update-effect/index.js";
|
|
13
|
+
import { cloneDeep as ne, isFieldMatch as g, isSyntheticEvent as re, schemaValidate as _ } from "./utils.js";
|
|
13
14
|
import ie from "../hooks/use-update-layout-effect/index.js";
|
|
14
|
-
import
|
|
15
|
-
import { jsx as S, jsxs as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
15
|
+
import v, { cloneElement as ae, forwardRef as y, useContext as b, useEffect as x, useImperativeHandle as oe, useRef as se } from "react";
|
|
16
|
+
import { jsx as S, jsxs as ce } from "react/jsx-runtime";
|
|
17
|
+
import le from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
18
|
+
import ue from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
19
|
+
import de from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
20
|
+
import fe from "@unicom-cloud/icons/IconUiLoading";
|
|
21
|
+
import pe from "lodash/castArray";
|
|
22
|
+
import C from "lodash/get";
|
|
23
|
+
import me from "lodash/set";
|
|
23
24
|
//#region components/pc/form/FormControl.tsx
|
|
24
|
-
var
|
|
25
|
+
var w = {
|
|
25
26
|
trigger: "onChange",
|
|
26
27
|
triggerPropName: "value"
|
|
27
28
|
};
|
|
28
|
-
function
|
|
29
|
-
let { prefixCls:
|
|
30
|
-
|
|
31
|
-
let D =
|
|
29
|
+
function he(l, y) {
|
|
30
|
+
let { prefixCls: he, getPrefixCls: T } = b(d), E = b(p);
|
|
31
|
+
b(te);
|
|
32
|
+
let D = b(ee), O = u(l, w, { readOnly: D?.readOnly ?? E?.readOnly }), { noStyle: ge, field: _e, isFormList: ve, hasFeedback: ye, readOnly: be, initialValue: xe, shouldUpdate: Se, dependencies: Ce, rules: we, validateTrigger: Te, onValuesChange: Ee } = O, De = "initialValue" in O, Oe = s(), k = se(null), A = se({
|
|
32
33
|
errors: null,
|
|
33
34
|
warnings: null,
|
|
34
35
|
validateStatus: void 0,
|
|
@@ -36,8 +37,8 @@ function pe(v, pe) {
|
|
|
36
37
|
isDestroyed: !1,
|
|
37
38
|
_: {}
|
|
38
39
|
}), j = D.store || E.store;
|
|
39
|
-
|
|
40
|
-
if (De &&
|
|
40
|
+
f(() => {
|
|
41
|
+
if (De && K()) {
|
|
41
42
|
let { field: e, initialValue: t } = O;
|
|
42
43
|
(j?.getInnerMethods?.())?.innerSetInitialValue?.(e, t);
|
|
43
44
|
}
|
|
@@ -46,21 +47,21 @@ function pe(v, pe) {
|
|
|
46
47
|
props: O,
|
|
47
48
|
getErrors: L,
|
|
48
49
|
getWarnings: z,
|
|
49
|
-
isTouched:
|
|
50
|
-
getValidateStatus:
|
|
51
|
-
existField:
|
|
52
|
-
innerSetFieldValue:
|
|
50
|
+
isTouched: W,
|
|
51
|
+
getValidateStatus: G,
|
|
52
|
+
existField: K,
|
|
53
|
+
innerSetFieldValue: q,
|
|
53
54
|
validateFieldOnly: Ae,
|
|
54
|
-
validateField:
|
|
55
|
+
validateField: J,
|
|
55
56
|
getValidateTrigger: je,
|
|
56
|
-
handleTrigger:
|
|
57
|
-
renderControl:
|
|
57
|
+
handleTrigger: Y,
|
|
58
|
+
renderControl: Me,
|
|
58
59
|
onStoreChange: ke,
|
|
59
60
|
getRootElement() {
|
|
60
61
|
return k.current;
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
oe(
|
|
64
|
+
oe(y, () => ({ ...M }));
|
|
64
65
|
function N() {
|
|
65
66
|
let { innerCollectFormState: e } = j.getInnerMethods();
|
|
66
67
|
e();
|
|
@@ -83,56 +84,54 @@ function pe(v, pe) {
|
|
|
83
84
|
function z() {
|
|
84
85
|
return A.current.warnings || [];
|
|
85
86
|
}
|
|
86
|
-
function B(e = O.field) {
|
|
87
|
-
let { updateFormItem:
|
|
88
|
-
i(
|
|
89
|
-
errors:
|
|
90
|
-
warnings:
|
|
87
|
+
function B(e = O.field, t = null, n = null) {
|
|
88
|
+
let { updateFormItem: r } = D;
|
|
89
|
+
i(r) && r(e, {
|
|
90
|
+
errors: t,
|
|
91
|
+
warnings: n
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
|
-
function V() {
|
|
94
|
-
|
|
95
|
-
let { field: e } = O, { updateFormItem: t } = D;
|
|
96
|
-
i(t) && t(e, {
|
|
97
|
-
errors: L(),
|
|
98
|
-
warnings: z()
|
|
99
|
-
}), Oe();
|
|
94
|
+
function V(e = O.field) {
|
|
95
|
+
B(e, null, null);
|
|
100
96
|
}
|
|
101
|
-
function H() {
|
|
97
|
+
function H(e = O.field) {
|
|
98
|
+
A.current.isDestroyed || (B(e, L(), z()), Oe());
|
|
99
|
+
}
|
|
100
|
+
function U() {
|
|
102
101
|
let { field: e } = O;
|
|
103
102
|
return e ? j.getInnerMethods().innerGetFieldValue(e) : void 0;
|
|
104
103
|
}
|
|
105
|
-
function
|
|
104
|
+
function W() {
|
|
106
105
|
return A.current.touched;
|
|
107
106
|
}
|
|
108
|
-
function
|
|
107
|
+
function G() {
|
|
109
108
|
let { validateStatus: e } = O;
|
|
110
109
|
return e || A.current.validateStatus;
|
|
111
110
|
}
|
|
112
|
-
function
|
|
111
|
+
function K() {
|
|
113
112
|
let { field: e } = O;
|
|
114
113
|
return !!r(e);
|
|
115
114
|
}
|
|
116
115
|
function ke(t, r) {
|
|
117
|
-
let o =
|
|
116
|
+
let o = pe(r.field), { field: s, shouldUpdate: c, dependencies: l } = O;
|
|
118
117
|
A.current._.notifyType = t, A.current._.storeChangeInfo = ne(r);
|
|
119
118
|
let u = (t) => {
|
|
120
|
-
if (l && c &&
|
|
119
|
+
if (l && c && m(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), l) e(l) && l.some((e) => g(e, o)) && W() && J();
|
|
121
120
|
else if (c) {
|
|
122
121
|
let e = !1;
|
|
123
122
|
e = i(c) ? c(r.prev, r.current, {
|
|
124
123
|
field: r.field,
|
|
125
124
|
...t
|
|
126
|
-
}) : !n(r.prev, r.current), e &&
|
|
125
|
+
}) : !n(r.prev, r.current), e && H();
|
|
127
126
|
}
|
|
128
127
|
};
|
|
129
128
|
switch (t) {
|
|
130
129
|
case "reset":
|
|
131
|
-
F(!1), P(void 0), I(null), R(null), l || c ? u() :
|
|
130
|
+
F(!1), P(void 0), I(null), R(null), l || c ? u() : H();
|
|
132
131
|
break;
|
|
133
132
|
case "innerSetValue":
|
|
134
|
-
if (
|
|
135
|
-
F(!0),
|
|
133
|
+
if (g(s, o)) {
|
|
134
|
+
F(!0), H();
|
|
136
135
|
return;
|
|
137
136
|
}
|
|
138
137
|
u({
|
|
@@ -141,8 +140,8 @@ function pe(v, pe) {
|
|
|
141
140
|
});
|
|
142
141
|
break;
|
|
143
142
|
case "setFieldValue":
|
|
144
|
-
if (
|
|
145
|
-
F(!0), r.data && "touched" in r.data && F(r.data.touched), r.data && "warnings" in r.data && R(a(r.data.warnings) ? [] : [].concat(r.data.warnings)), r.data && "errors" in r.data ? I(r.data.errors) : n(
|
|
143
|
+
if (g(s, o)) {
|
|
144
|
+
F(!0), r.data && "touched" in r.data && F(r.data.touched), r.data && "warnings" in r.data && R(a(r.data.warnings) ? [] : [].concat(r.data.warnings)), r.data && "errors" in r.data ? I(r.data.errors) : n(C(r.prev, s), C(r.current, s)) || I(null), H();
|
|
146
145
|
return;
|
|
147
146
|
}
|
|
148
147
|
u();
|
|
@@ -150,28 +149,28 @@ function pe(v, pe) {
|
|
|
150
149
|
default: break;
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
|
-
function
|
|
152
|
+
function q(e, t) {
|
|
154
153
|
let { onValuesChange: n } = O;
|
|
155
154
|
if (!e) return;
|
|
156
155
|
j.getInnerMethods().innerSetFieldValue(e, t);
|
|
157
156
|
let r = {};
|
|
158
|
-
|
|
157
|
+
me(r, e, t), n?.(r, { ...j.getFieldsValue() });
|
|
159
158
|
}
|
|
160
159
|
function Ae() {
|
|
161
|
-
let { validateMessages: e, schemaOptions: t } = D, { field: n, rules: r } = O, i =
|
|
162
|
-
return
|
|
160
|
+
let { validateMessages: e, schemaOptions: t } = D, { field: n, rules: r } = O, i = U();
|
|
161
|
+
return _(n, i, r, e, t).then(({ error: e, warning: t }) => Promise.resolve({
|
|
163
162
|
error: e,
|
|
164
163
|
value: i,
|
|
165
164
|
warning: t,
|
|
166
165
|
field: n
|
|
167
166
|
}));
|
|
168
167
|
}
|
|
169
|
-
function
|
|
170
|
-
let { validateTrigger: t, validateMessages: n, schemaOptions: r } = D, { field: i, rules: a, validateTrigger: o } = O, s =
|
|
168
|
+
function J(e) {
|
|
169
|
+
let { validateTrigger: t, validateMessages: n, schemaOptions: r } = D, { field: i, rules: a, validateTrigger: o } = O, s = U(), c = () => {
|
|
171
170
|
let e = L() || z()?.length;
|
|
172
|
-
P("validating"), I(null), R(null), e &&
|
|
171
|
+
P("validating"), I(null), R(null), e && H();
|
|
173
172
|
}, l = e ? (a || []).filter((n) => [].concat(n.validateTrigger || o || t).includes(e)) : a;
|
|
174
|
-
return l?.length && i ? (c(),
|
|
173
|
+
return l?.length && i ? (c(), _(i, s, l, n, r).then(({ error: e, warning: t }) => (I(e ? e[i] : null), R(t || null), P(L() ? "error" : z()?.length ? "warning" : "success"), H(), Promise.resolve({
|
|
175
174
|
error: e,
|
|
176
175
|
value: s,
|
|
177
176
|
field: i
|
|
@@ -182,79 +181,79 @@ function pe(v, pe) {
|
|
|
182
181
|
});
|
|
183
182
|
}
|
|
184
183
|
function je() {
|
|
185
|
-
let { rules: e = [], validateTrigger: t } = O, n = t || D.validateTrigger || E.validateTrigger ||
|
|
184
|
+
let { rules: e = [], validateTrigger: t } = O, n = t || D.validateTrigger || E.validateTrigger || w.trigger, r = [];
|
|
186
185
|
return e.forEach((e, t, i) => {
|
|
187
186
|
r = r.concat(e.validateTrigger || n);
|
|
188
187
|
}), Array.from(new Set(r));
|
|
189
188
|
}
|
|
190
|
-
function
|
|
191
|
-
let { field: n, trigger: r =
|
|
189
|
+
function Y(e, ...t) {
|
|
190
|
+
let { field: n, trigger: r = w.trigger, triggerPropName: a = w.triggerPropName, normalize: o, getValueFromEvent: s, isFormList: c } = O, l = Ne(), u = i(s) ? s(e, ...t) : e, d = u;
|
|
192
191
|
if (re(u)) {
|
|
193
|
-
|
|
192
|
+
m(!0, "changed value missed, please check whether extra elements is outta input/select controled by Form.Item"), u.stopPropagation();
|
|
194
193
|
return;
|
|
195
194
|
}
|
|
196
|
-
i(o) && (d = o(u, j.getFieldValue(n), { ...j.getFieldsValue() }, ...t)), F(!0),
|
|
195
|
+
i(o) && (d = o(u, j.getFieldValue(n), { ...j.getFieldsValue() }, ...t)), F(!0), q(n, d), J(r), v.isValidElement(l) && i(l.props?.[r]) && (c || l.props[r](d, ...t));
|
|
197
196
|
}
|
|
198
|
-
function
|
|
199
|
-
let { disabled: n } = D, { field: r, trigger: a =
|
|
200
|
-
e =
|
|
197
|
+
function Me(e, t) {
|
|
198
|
+
let { disabled: n } = D, { field: r, trigger: a = w.trigger, triggerPropName: s = w.triggerPropName, validateStatus: l, formatter: u, disabled: d = n } = O;
|
|
199
|
+
e = v.Children.only(e);
|
|
201
200
|
let f = { id: c(e.props?.id || { [`${t}_input`]: t }) };
|
|
202
201
|
je().forEach((t) => {
|
|
203
202
|
f[t] = (n) => {
|
|
204
|
-
|
|
203
|
+
J(t), e.props?.[t]?.(n);
|
|
205
204
|
};
|
|
206
|
-
}), f[a] =
|
|
207
|
-
let p =
|
|
205
|
+
}), f[a] = Y, !o(d) && !("disabled" in e.props) && (f.disabled = d);
|
|
206
|
+
let p = C(j.getInnerMethods().innerGetStore(), r);
|
|
208
207
|
return i(u) && (p = u(p)), e.type?.___PQB_RICH_TEXT___ ? f[s] = A.current._.firstValue ||= p : f[s] = p, !l && L() && (f.error = !0), ae(e, f);
|
|
209
208
|
}
|
|
210
|
-
function
|
|
209
|
+
function Ne() {
|
|
211
210
|
let { children: e, field: t, isFormList: n } = O;
|
|
212
211
|
return i(e) ? e(j.getFields(), { ...j }, n && {
|
|
213
|
-
value:
|
|
214
|
-
onChange:
|
|
212
|
+
value: U(),
|
|
213
|
+
onChange: Y
|
|
215
214
|
}, A.current._.storeChangeInfo, A.current._.notifyType) : e;
|
|
216
215
|
}
|
|
217
|
-
|
|
216
|
+
h(() => {}, []), ie(() => {}, []), h(() => {
|
|
218
217
|
let { field: e, rules: t, disabled: n } = O;
|
|
219
|
-
return e && (n || !t ?
|
|
220
|
-
|
|
218
|
+
return e && (n || !t ? V(e) : H()), () => {
|
|
219
|
+
V(e);
|
|
221
220
|
};
|
|
222
221
|
}, [
|
|
223
222
|
O.field,
|
|
224
223
|
O.disabled,
|
|
225
224
|
O.rules
|
|
226
|
-
]),
|
|
225
|
+
]), x(() => {
|
|
227
226
|
let e = j.getInnerMethods().registerField(M);
|
|
228
227
|
return () => {
|
|
229
|
-
i(e) && e()
|
|
228
|
+
i(e) && e();
|
|
230
229
|
};
|
|
231
|
-
}, [O.field]),
|
|
230
|
+
}, [O.field]), x(() => (A.current.isDestroyed = !1, () => {
|
|
232
231
|
A.current.isDestroyed = !0, A.current._ = {};
|
|
233
232
|
}), []);
|
|
234
|
-
let X =
|
|
235
|
-
return
|
|
233
|
+
let X = G(), { prefixCls: Z, getFormElementId: Pe } = D, Q = Ne(), $ = K() ? Pe?.(_e) : void 0;
|
|
234
|
+
return K() && !ve && v.Children.count(Q) === 1 && (Q = Me(Q, $)), ge ? Q : /* @__PURE__ */ S("div", {
|
|
236
235
|
ref: k,
|
|
237
236
|
className: `${Z}-control-wrapper`,
|
|
238
237
|
children: /* @__PURE__ */ S("div", {
|
|
239
238
|
className: `${Z}-control`,
|
|
240
239
|
id: $,
|
|
241
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ ce("div", {
|
|
242
241
|
className: `${Z}-control-children`,
|
|
243
|
-
children: [Q, X && ye && /* @__PURE__ */
|
|
242
|
+
children: [Q, X && ye && /* @__PURE__ */ ce("div", {
|
|
244
243
|
className: c(`${Z}-feedback`, `${Z}-feedback-${X}`),
|
|
245
244
|
children: [
|
|
246
|
-
X === "warning" && /* @__PURE__ */ S(
|
|
247
|
-
X === "success" && /* @__PURE__ */ S(
|
|
248
|
-
X === "error" && /* @__PURE__ */ S(
|
|
249
|
-
X === "validating" && /* @__PURE__ */ S(
|
|
245
|
+
X === "warning" && /* @__PURE__ */ S(de, {}),
|
|
246
|
+
X === "success" && /* @__PURE__ */ S(le, {}),
|
|
247
|
+
X === "error" && /* @__PURE__ */ S(ue, {}),
|
|
248
|
+
X === "validating" && /* @__PURE__ */ S(fe, {})
|
|
250
249
|
]
|
|
251
250
|
})]
|
|
252
251
|
})
|
|
253
252
|
})
|
|
254
253
|
});
|
|
255
254
|
}
|
|
256
|
-
var
|
|
257
|
-
|
|
255
|
+
var T = Object.assign(y(he), { isFormControl: !0 });
|
|
256
|
+
T.displayName = l.displayName;
|
|
258
257
|
//#endregion
|
|
259
|
-
export {
|
|
258
|
+
export { T as default };
|
|
260
259
|
/* 独立思考,明辨是非 */
|
package/form/FormItem.js
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import { isArray as e, isFunction as t, isObject as n, isPlainObject as r,
|
|
3
|
-
import
|
|
1
|
+
/* 潘启宝 2026-05-18 15:17:02 星期一 */
|
|
2
|
+
import { isArray as e, isFunction as t, isObject as n, isPlainObject as r, isTrue as i, isUndefined as a } from "../utils/is.js";
|
|
3
|
+
import o from "../utils/className.js";
|
|
4
|
+
import { FORM_ITEM_COMPONENT_INFO as s } from "../utils/names.js";
|
|
4
5
|
import ee from "../hooks/use-merge-props/index.js";
|
|
5
6
|
import te from "../config-provider/context.js";
|
|
6
|
-
import { FormContext as
|
|
7
|
-
import
|
|
7
|
+
import { FormContext as c, FormItemContext as l, FormListContext as ne } from "./context.js";
|
|
8
|
+
import u from "../utils/omit.js";
|
|
8
9
|
import "../config-provider/index.js";
|
|
9
10
|
import { PREFIX_FORM_ITEM as re } from "./constant.js";
|
|
10
|
-
import { VALIDATE_STATUS as
|
|
11
|
+
import { VALIDATE_STATUS as d } from "./interface.js";
|
|
11
12
|
import { formatValidateMsg as ie } from "./utils.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
13
|
+
import f from "./FormControl.js";
|
|
14
|
+
import p from "../row-col/Col.js";
|
|
14
15
|
import ae from "../row-col/index.js";
|
|
15
16
|
import oe from "./FormItemLabel.js";
|
|
16
17
|
import se from "./FormItemTip.js";
|
|
17
|
-
import
|
|
18
|
-
import { jsx as
|
|
18
|
+
import m, { cloneElement as h, createElement as g, forwardRef as _, useContext as v, useEffect as ce, useMemo as le, useRef as ue, useState as y } from "react";
|
|
19
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
19
20
|
//#region components/pc/form/FormItem.tsx
|
|
20
21
|
var de = {
|
|
21
22
|
trigger: "onChange",
|
|
22
23
|
triggerPropName: "value"
|
|
23
|
-
};
|
|
24
|
-
function
|
|
25
|
-
let { prefixCls:
|
|
26
|
-
hidden:
|
|
24
|
+
}, fe = [{ required: !0 }];
|
|
25
|
+
function pe(s, _) {
|
|
26
|
+
let { prefixCls: pe, getPrefixCls: S } = v(te), C = v(c), me = v(ne), w = v(l), T = ee(s, de, {
|
|
27
|
+
hidden: me?.hidden,
|
|
27
28
|
readOnly: w?.readOnly ?? C?.readOnly
|
|
28
|
-
})
|
|
29
|
+
});
|
|
30
|
+
i(T.required) && (T.rules ??= fe);
|
|
31
|
+
let { noStyle: E, readOnly: D } = T, { label: O, extra: k, className: he, style: ge, validateStatus: A, hidden: _e, tooltip: ve, colon: ye, rules: j, required: M, requiredSymbol: N, ...P } = T, be = "requiredSymbol" in T ? N : w?.requiredSymbol ?? C?.requiredSymbol, xe = "colon" in T ? ye : w?.colon || C?.colon, F = "label" in T && !!O;
|
|
29
32
|
function I() {
|
|
30
33
|
return "disabled" in T ? T.disabled : w?.disabled ?? C?.disabled;
|
|
31
34
|
}
|
|
32
|
-
let [L, R] =
|
|
35
|
+
let [L, R] = y(null), [z, B] = y(null), V = ue(!1), H = C?.prefixCls || S?.("form"), U = w?.prefixCls || S?.(re), W = T.layout || w?.layout || C?.layout, Se = T.labelAlign || w?.labelAlign || C?.labelAlign, G = T.rowProps || w?.rowProps || C?.rowProps, K = T.labelCol || C?.labelCol, q = T.wrapperCol || C?.wrapperCol, Ce = !K, we = !q, Te = W === "horizontal", Ee = Se === "left", De = (e, t = {}) => {
|
|
33
36
|
if (V.current) return;
|
|
34
37
|
let { errors: n, warnings: r } = t || {};
|
|
35
38
|
R((t) => {
|
|
@@ -48,68 +51,68 @@ function b(h, b) {
|
|
|
48
51
|
...T,
|
|
49
52
|
validateMessages: ie(C?.validateMessages, { label: T.label }),
|
|
50
53
|
prefixCls: U,
|
|
51
|
-
updateFormItem: n(E) && E.showErrorTip && w?.updateFormItem ? w.updateFormItem :
|
|
54
|
+
updateFormItem: n(E) && E.showErrorTip && w?.updateFormItem ? w.updateFormItem : De,
|
|
52
55
|
disabled: I(),
|
|
53
56
|
readOnly: D
|
|
54
57
|
}, Y = L ? Object.values(L) : [], X = z ? Object.values(z).reduce((e, t) => e.concat(t), []) : [], Z = le(() => {
|
|
55
58
|
if (A) return A;
|
|
56
|
-
if (Y.length) return
|
|
57
|
-
if (X.length) return
|
|
59
|
+
if (Y.length) return d.error;
|
|
60
|
+
if (X.length) return d.warning;
|
|
58
61
|
}, [
|
|
59
62
|
L,
|
|
60
63
|
z,
|
|
61
64
|
A
|
|
62
|
-
]), Q = !
|
|
63
|
-
function
|
|
64
|
-
let { field: n, children:
|
|
65
|
-
if (t(
|
|
66
|
-
let { key: e, ...t } = T
|
|
67
|
-
return /* @__PURE__ */
|
|
65
|
+
]), Q = !a(T.help) || X.length > 0;
|
|
66
|
+
function Oe() {
|
|
67
|
+
let { field: n, children: i } = T;
|
|
68
|
+
if (t(i)) {
|
|
69
|
+
let { key: e, ...t } = T;
|
|
70
|
+
return /* @__PURE__ */ g(f, {
|
|
68
71
|
disabled: I(),
|
|
69
72
|
...t,
|
|
70
73
|
key: n || e
|
|
71
|
-
}, (...e) =>
|
|
74
|
+
}, (...e) => i(...e));
|
|
72
75
|
}
|
|
73
|
-
if (e(
|
|
74
|
-
let e =
|
|
76
|
+
if (e(i)) {
|
|
77
|
+
let e = m.Children.map(i, (e, t) => {
|
|
75
78
|
if (r(e)) {
|
|
76
|
-
let n = e.key || t, r = "disabled" in e.props,
|
|
77
|
-
return
|
|
79
|
+
let n = e.key || t, r = "disabled" in e.props, i = { key: n };
|
|
80
|
+
return a(I()) || r || (i.disabled = I()), h(e, i);
|
|
78
81
|
}
|
|
79
82
|
return e;
|
|
80
83
|
});
|
|
81
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ b(f, {
|
|
82
85
|
...T,
|
|
83
86
|
field: void 0,
|
|
84
87
|
children: e
|
|
85
88
|
}, n);
|
|
86
89
|
}
|
|
87
|
-
if (
|
|
90
|
+
if (m.Children.count(i) == 1) {
|
|
88
91
|
if (n) {
|
|
89
92
|
let e = n;
|
|
90
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ g(f, {
|
|
91
94
|
disabled: I(),
|
|
92
95
|
...T,
|
|
93
96
|
key: e
|
|
94
|
-
},
|
|
97
|
+
}, i);
|
|
95
98
|
}
|
|
96
|
-
if (r(
|
|
97
|
-
if (
|
|
98
|
-
let e = !("disabled" in
|
|
99
|
-
return /* @__PURE__ */
|
|
99
|
+
if (r(i)) {
|
|
100
|
+
if (i.type?.isFormControl) return i;
|
|
101
|
+
let e = !("disabled" in i.props) && a(I()) ? null : { disabled: I() };
|
|
102
|
+
return /* @__PURE__ */ b(f, {
|
|
100
103
|
...T,
|
|
101
104
|
field: void 0,
|
|
102
|
-
children: e ?
|
|
105
|
+
children: e ? h(i, e) : i
|
|
103
106
|
}, n);
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
return
|
|
109
|
+
return i;
|
|
107
110
|
}
|
|
108
|
-
let $ =
|
|
109
|
-
return E || ($ = /* @__PURE__ */
|
|
110
|
-
ref:
|
|
111
|
+
let $ = Oe();
|
|
112
|
+
return E || ($ = /* @__PURE__ */ x(ae, {
|
|
113
|
+
ref: _,
|
|
111
114
|
...G,
|
|
112
|
-
...
|
|
115
|
+
...u(P, [
|
|
113
116
|
"children",
|
|
114
117
|
"prefixCls",
|
|
115
118
|
"store",
|
|
@@ -136,58 +139,58 @@ function b(h, b) {
|
|
|
136
139
|
]),
|
|
137
140
|
style: {
|
|
138
141
|
...G?.style,
|
|
139
|
-
...
|
|
142
|
+
...ge
|
|
140
143
|
},
|
|
141
|
-
className:
|
|
142
|
-
[`${U}-error`]: Q || !A && Z ===
|
|
144
|
+
className: o(U, {
|
|
145
|
+
[`${U}-error`]: Q || !A && Z === d.error,
|
|
143
146
|
[`${U}-status-${Z}`]: Z,
|
|
144
147
|
[`${U}-has-help`]: Q,
|
|
145
|
-
[`${U}-hidden`]:
|
|
148
|
+
[`${U}-hidden`]: _e,
|
|
146
149
|
[`${U}-has-feedback`]: Z && T.hasFeedback
|
|
147
|
-
}, `${U}-${W}`, `${U}-layout-${W}`, O ? `${U}-has-label` : `${U}-no-label`, G?.className,
|
|
148
|
-
div: !
|
|
149
|
-
children: [F && /* @__PURE__ */
|
|
150
|
-
className:
|
|
150
|
+
}, `${U}-${W}`, `${U}-layout-${W}`, O ? `${U}-has-label` : `${U}-no-label`, G?.className, he),
|
|
151
|
+
div: !Te,
|
|
152
|
+
children: [F && /* @__PURE__ */ b(p, {
|
|
153
|
+
className: o(`${H}-label-item`, `${U}-label`, T.labelCol?.className, C?.labelCol?.className, Ee && `${U}-label-left`, Ce && `${U}-label-flex`),
|
|
151
154
|
...K ?? { flex: 0 },
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
-
className:
|
|
154
|
-
tooltip:
|
|
155
|
+
children: /* @__PURE__ */ b(oe, {
|
|
156
|
+
className: o(`${U}-label-label`),
|
|
157
|
+
tooltip: ve,
|
|
155
158
|
htmlFor: T.field && C?.getFormElementId?.(T.field),
|
|
156
159
|
label: O,
|
|
157
160
|
prefix: U,
|
|
158
|
-
requiredSymbol:
|
|
161
|
+
requiredSymbol: be,
|
|
159
162
|
required: M,
|
|
160
163
|
rules: j,
|
|
161
|
-
showColon:
|
|
164
|
+
showColon: xe,
|
|
162
165
|
readOnly: D
|
|
163
166
|
})
|
|
164
|
-
}), /* @__PURE__ */
|
|
165
|
-
className:
|
|
167
|
+
}), /* @__PURE__ */ x(p, {
|
|
168
|
+
className: o(`${U}-wrapper`, { [`${U}-wrapper-flex`]: we }, F ? `${U}-wrapper-has-label` : `${U}-wrapper-no-label`),
|
|
166
169
|
...q || { flex: 1 },
|
|
167
170
|
children: [
|
|
168
171
|
$,
|
|
169
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ b(se, {
|
|
170
173
|
prefixCls: H,
|
|
171
174
|
help: T.help,
|
|
172
175
|
errors: Y,
|
|
173
176
|
warnings: X
|
|
174
177
|
}),
|
|
175
|
-
k && /* @__PURE__ */
|
|
178
|
+
k && /* @__PURE__ */ b("div", {
|
|
176
179
|
className: `${H}-extra`,
|
|
177
180
|
children: k
|
|
178
181
|
})
|
|
179
182
|
]
|
|
180
183
|
})]
|
|
181
|
-
})), $ = /* @__PURE__ */
|
|
182
|
-
value: E ? C :
|
|
183
|
-
children: /* @__PURE__ */
|
|
184
|
+
})), $ = /* @__PURE__ */ b(c.Provider, {
|
|
185
|
+
value: E ? C : u(C, ["labelCol", "wrapperCol"]),
|
|
186
|
+
children: /* @__PURE__ */ b(l.Provider, {
|
|
184
187
|
value: J,
|
|
185
188
|
children: $
|
|
186
189
|
})
|
|
187
190
|
}), $;
|
|
188
191
|
}
|
|
189
|
-
var
|
|
190
|
-
|
|
192
|
+
var S = _(pe);
|
|
193
|
+
S.displayName = s.displayName;
|
|
191
194
|
//#endregion
|
|
192
|
-
export {
|
|
195
|
+
export { S as default };
|
|
193
196
|
/* 独立思考,明辨是非 */
|
package/form/FormItemLabel.js
CHANGED
package/form/FormItemTip.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-18 15:17:02 星期一 */
|
|
2
2
|
import { isUndefined as e } from "../utils/is.js";
|
|
3
3
|
import t from "../utils/className.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { FORM_ITEM_TIP_COMPONENT_INFO as n } from "../utils/names.js";
|
|
5
|
+
import { TransitionCSS as r } from "../transition/index.js";
|
|
6
|
+
import { forwardRef as i, useImperativeHandle as a, useRef as o } from "react";
|
|
7
|
+
import { UI_COMMON_PREFIX as s } from "@unicom-cloud/utils/constant/ui";
|
|
8
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
9
|
//#region components/pc/form/FormItemTip.tsx
|
|
9
|
-
function
|
|
10
|
-
let { prefixCls: d, help: f, errors: p, warnings: m } =
|
|
11
|
-
if (e) return /* @__PURE__ */
|
|
10
|
+
function d(n, i) {
|
|
11
|
+
let { prefixCls: d, help: f, errors: p, warnings: m } = n, h = p.map((e, t) => {
|
|
12
|
+
if (e) return /* @__PURE__ */ l("div", {
|
|
12
13
|
role: "alert",
|
|
13
14
|
children: e.message
|
|
14
15
|
}, t);
|
|
15
|
-
}), g = m.map((e, t, n) => /* @__PURE__ */
|
|
16
|
+
}), g = m.map((e, t, n) => /* @__PURE__ */ l("div", {
|
|
16
17
|
role: "alert",
|
|
17
18
|
className: `${d}-message-help-warning`,
|
|
18
19
|
children: e
|
|
19
|
-
}, t)), _ = !e(f) || !!g.length, v = !!(_ || h.length), y =
|
|
20
|
-
return i
|
|
20
|
+
}, t)), _ = !e(f) || !!g.length, v = !!(_ || h.length), y = o(null);
|
|
21
|
+
return a(i, () => ({ getRootElement() {
|
|
21
22
|
return y.current;
|
|
22
|
-
} })), v && /* @__PURE__ */
|
|
23
|
+
} })), v && /* @__PURE__ */ l(r, {
|
|
23
24
|
in: v,
|
|
24
25
|
appear: !0,
|
|
25
|
-
classNames: `${
|
|
26
|
+
classNames: `${s}-animation-blink`,
|
|
26
27
|
duration: 300,
|
|
27
28
|
unmountOnExit: !0,
|
|
28
29
|
refElement: y,
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ l("div", {
|
|
30
31
|
ref: y,
|
|
31
32
|
className: t(`${d}-message`, { [`${d}-message-help`]: _ }),
|
|
32
|
-
children: e(f) ? /* @__PURE__ */
|
|
33
|
+
children: e(f) ? /* @__PURE__ */ u(c, { children: [h.length > 0 && h, g.length > 0 && g] }) : f
|
|
33
34
|
})
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
-
|
|
37
|
+
var f = i(d);
|
|
38
|
+
f.displayName = n.displayName;
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { f as default };
|
|
40
41
|
/* 独立思考,明辨是非 */
|
package/form/FormLabelSymbol.js
CHANGED