@unicom-cloud/ui 0.8.41
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 +124 -0
- package/Alert.js +112 -0
- package/Anchor.js +6 -0
- package/AutoComplete.js +155 -0
- package/Avatar.js +157 -0
- package/BackTop.js +85 -0
- package/Badge.js +178 -0
- package/Breadcrumb.js +144 -0
- package/Button.js +141 -0
- package/Calendar.js +577 -0
- package/Card.js +139 -0
- package/Carousel.js +382 -0
- package/Cascader.js +10 -0
- package/Checkbox.js +5 -0
- package/Collapse.js +5 -0
- package/ColorPicker.js +588 -0
- package/Comment.js +74 -0
- package/ConfigProvider.js +8 -0
- package/Copy.js +65 -0
- package/DatePicker.js +2006 -0
- package/Descriptions.js +179 -0
- package/Divider.js +41 -0
- package/Draggable.js +92 -0
- package/Drawer.js +6 -0
- package/Dropdown.js +186 -0
- package/Empty.js +10 -0
- package/Form.js +1420 -0
- package/Grid.js +250 -0
- package/Icon.js +57 -0
- package/IconHover.js +8 -0
- package/Image.js +6 -0
- package/Input.js +7 -0
- package/InputNumber.js +19 -0
- package/InputTag.js +6 -0
- package/Layout.js +57 -0
- package/Link.js +63 -0
- package/List.js +320 -0
- package/Loading.js +62 -0
- package/Mentions.js +172 -0
- package/Menu.js +9 -0
- package/Message.js +12 -0
- package/Modal.js +6 -0
- package/Notice.js +15 -0
- package/Notification.js +13 -0
- package/NotificationBase.js +54 -0
- package/OverflowEllipsis.js +99 -0
- package/PageHeader.js +121 -0
- package/Pagination.js +13 -0
- package/Picker.js +6 -0
- package/Popconfirm.js +134 -0
- package/Popover.js +81 -0
- package/Portal.js +35 -0
- package/Progress.js +367 -0
- package/Radio.js +7 -0
- package/Rate.js +129 -0
- package/ResizeBox.js +559 -0
- package/Result.js +1437 -0
- package/Select.js +10 -0
- package/SelectView.js +347 -0
- package/Skeleton.js +97 -0
- package/Slider.js +784 -0
- package/Space.js +93 -0
- package/SpeechSynthesis.js +53 -0
- package/Spin.js +97 -0
- package/Statistic.js +192 -0
- package/Steps.js +149 -0
- package/SuspenseFallbackTest.js +11 -0
- package/Switch.js +116 -0
- package/Table.js +2001 -0
- package/Tabs.js +10 -0
- package/Tag.js +108 -0
- package/TimePicker.js +278 -0
- package/Timeline.js +5 -0
- package/Tooltip.js +127 -0
- package/Transfer.js +461 -0
- package/Tree.js +6 -0
- package/TreeSelect.js +9 -0
- package/Trigger.js +858 -0
- package/Typography.js +723 -0
- package/Upload.js +10 -0
- package/VerificationCode.js +7 -0
- package/Version.js +5 -0
- package/VirtualList.js +5 -0
- package/Watermark.js +4 -0
- package/chunk/B-h-HjBo.js +1000 -0
- package/chunk/BGGDhLVD.js +966 -0
- package/chunk/BGzBxiWE.js +517 -0
- package/chunk/BTvIp2Ol.js +229 -0
- package/chunk/BVC51EZ7.js +232 -0
- package/chunk/BdWYJb9B.js +769 -0
- package/chunk/BdYAMaw9.js +6 -0
- package/chunk/Bl5t8Z6F.js +946 -0
- package/chunk/C6Kfwj0f.js +1 -0
- package/chunk/CA-kzjHQ.js +66 -0
- package/chunk/CEMQTMlX.js +798 -0
- package/chunk/CICfjLap.js +605 -0
- package/chunk/CUK6MU72.js +694 -0
- package/chunk/Cpp8T23i.js +271 -0
- package/chunk/CuIVS4do.js +277 -0
- package/chunk/CwIyJM0N.js +261 -0
- package/chunk/CwewmGEF.js +516 -0
- package/chunk/DF-4xm4m.js +375 -0
- package/chunk/DP2rzg_V.js +1 -0
- package/chunk/DQ_eXwj8.js +877 -0
- package/chunk/DYwvc9zo.js +165 -0
- package/chunk/Da4Rq2D4.js +226 -0
- package/chunk/Dc_89PVN.js +736 -0
- package/chunk/DdK6eiNS.js +240 -0
- package/chunk/DhodcKwW.js +167 -0
- package/chunk/GfGTdWbJ.js +162 -0
- package/chunk/I4RV9SKZ.js +135 -0
- package/chunk/K6Dvbx-E.js +1 -0
- package/chunk/Kt5-772l.js +450 -0
- package/chunk/RnTpOC5-.js +1 -0
- package/chunk/TXCrI0jN.js +20 -0
- package/chunk/cRoKuTbN.js +129 -0
- package/chunk/ehTyphn0.js +335 -0
- package/chunk/kAbgUN-k.js +80 -0
- package/chunk/l0sNRNKZ.js +1 -0
- package/chunk/vpaTr5dz.js +984 -0
- package/hooks/index.js +6 -0
- package/hooks/use-verification-code.js +72 -0
- package/hooks/use-watermark.js +175 -0
- package/hooks/useAsync.js +13 -0
- package/hooks/useAsyncFn.js +15 -0
- package/hooks/useAsyncRetry.js +17 -0
- package/hooks/useAudio.js +5 -0
- package/hooks/useBeforeUnload.js +18 -0
- package/hooks/useBoolean.js +4 -0
- package/hooks/useClickAway.js +22 -0
- package/hooks/useComputedState.js +11 -0
- package/hooks/useCopyToClipboard.js +51 -0
- package/hooks/useCounter.js +45 -0
- package/hooks/useCreate.js +8 -0
- package/hooks/useCreation.js +19 -0
- package/hooks/useCustomCompareEffect.js +15 -0
- package/hooks/useDebounce.js +9 -0
- package/hooks/useDefault.js +10 -0
- package/hooks/useDrop.js +44 -0
- package/hooks/useDropArea.js +45 -0
- package/hooks/useEffectOnce.js +7 -0
- package/hooks/useEffectState.js +9 -0
- package/hooks/useEnsuredForwardedRef.js +17 -0
- package/hooks/useError.js +13 -0
- package/hooks/useEvent.js +13 -0
- package/hooks/useEventListener.js +41 -0
- package/hooks/useFavicon.js +17 -0
- package/hooks/useFirstMountState.js +8 -0
- package/hooks/useForceUpdate.js +8 -0
- package/hooks/useFullscreen.js +40 -0
- package/hooks/useGeolocation.js +38 -0
- package/hooks/useGetSet.js +18 -0
- package/hooks/useGetSetState.js +12 -0
- package/hooks/useHash.js +26 -0
- package/hooks/useHover.js +16 -0
- package/hooks/useHoverDirty.js +17 -0
- package/hooks/useId.js +11 -0
- package/hooks/useIdle.js +34 -0
- package/hooks/useInView.js +31 -0
- package/hooks/useIntersection.js +19 -0
- package/hooks/useIntersectionObserver.js +23 -0
- package/hooks/useInterval.js +19 -0
- package/hooks/useIsFirstRender.js +10 -0
- package/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/hooks/useIsomorphicLayoutEffect2.js +6 -0
- package/hooks/useKey.js +16 -0
- package/hooks/useKeyPress.js +13 -0
- package/hooks/useKeyPressEvent.js +11 -0
- package/hooks/useKeyboardEvent.js +17 -0
- package/hooks/useLatest.js +8 -0
- package/hooks/useLifecycles.js +9 -0
- package/hooks/useList.js +67 -0
- package/hooks/useLocalStorage.js +41 -0
- package/hooks/useLocation.js +51 -0
- package/hooks/useLockBodyScroll.js +56 -0
- package/hooks/useLogger.js +10 -0
- package/hooks/useLongPress.js +24 -0
- package/hooks/useMap.js +31 -0
- package/hooks/useMeasure.js +34 -0
- package/hooks/useMeasureDirty.js +24 -0
- package/hooks/useMedia.js +19 -0
- package/hooks/useMediaDevices.js +26 -0
- package/hooks/useMediatedState.js +14 -0
- package/hooks/useMergeProps.js +19 -0
- package/hooks/useMergeValue.js +18 -0
- package/hooks/useMethods.js +14 -0
- package/hooks/useMotion.js +56 -0
- package/hooks/useMount.js +9 -0
- package/hooks/useMountedState.js +10 -0
- package/hooks/useMouse.js +44 -0
- package/hooks/useMouseHovered.js +9 -0
- package/hooks/useMouseWheel.js +14 -0
- package/hooks/useMultiStateValidator.js +19 -0
- package/hooks/useNetworkState.js +31 -0
- package/hooks/useNumber.js +4 -0
- package/hooks/useObservable.js +12 -0
- package/hooks/useOrientation.js +31 -0
- package/hooks/useOverflowHidden.js +26 -0
- package/hooks/usePageLeave.js +19 -0
- package/hooks/usePermission.js +19 -0
- package/hooks/usePinchZoom.js +40 -0
- package/hooks/usePrevious.js +10 -0
- package/hooks/usePreviousDistinct.js +10 -0
- package/hooks/usePromise.js +19 -0
- package/hooks/useQueue.js +25 -0
- package/hooks/useRaf.js +24 -0
- package/hooks/useRafLoop.js +24 -0
- package/hooks/useRafState.js +15 -0
- package/hooks/useReactive.js +21 -0
- package/hooks/useRefs.js +10 -0
- package/hooks/useRendersCount.js +7 -0
- package/hooks/useScroll.js +27 -0
- package/hooks/useScrolling.js +23 -0
- package/hooks/useSearchParam.js +18 -0
- package/hooks/useSessionStorage.js +28 -0
- package/hooks/useSet.js +15 -0
- package/hooks/useSetState.js +16 -0
- package/hooks/useSize.js +58 -0
- package/hooks/useSlider.js +48 -0
- package/hooks/useSpeech.js +45 -0
- package/hooks/useStartTyping.js +30 -0
- package/hooks/useStateCallback.js +16 -0
- package/hooks/useStateList.js +38 -0
- package/hooks/useStateValidator.js +17 -0
- package/hooks/useStateWithHistory.js +46 -0
- package/hooks/useStateWithPromise.js +25 -0
- package/hooks/useSyncState.js +14 -0
- package/hooks/useThrottle.js +21 -0
- package/hooks/useThrottleFn.js +21 -0
- package/hooks/useTimeout.js +18 -0
- package/hooks/useTimeoutFn.js +16 -0
- package/hooks/useTitle.js +18 -0
- package/hooks/useToggle.js +5 -0
- package/hooks/useTween.js +11 -0
- package/hooks/useUnmount.js +9 -0
- package/hooks/useUnmountPromise.js +20 -0
- package/hooks/useUpdate.js +10 -0
- package/hooks/useUpdateEffect.js +12 -0
- package/hooks/useUpdateTimeout.js +9 -0
- package/hooks/useUpsert.js +16 -0
- package/hooks/useVibrate.js +21 -0
- package/hooks/useVideo.js +5 -0
- package/hooks/useWatch.js +11 -0
- package/hooks/useWindowScroll.js +29 -0
- package/hooks/useWindowSize.js +25 -0
- package/index.js +397 -0
- package/locale/ar-EG.js +167 -0
- package/locale/de-DE.js +167 -0
- package/locale/default.js +4 -0
- package/locale/en-US.js +174 -0
- package/locale/es-ES.js +167 -0
- package/locale/fr-FR.js +167 -0
- package/locale/id-ID.js +167 -0
- package/locale/interface.js +1 -0
- package/locale/it-IT.js +167 -0
- package/locale/ja-JP.js +220 -0
- package/locale/ko-KR.js +167 -0
- package/locale/ms-MY.js +167 -0
- package/locale/pt-BR.js +167 -0
- package/locale/pt-PT.js +167 -0
- package/locale/ru-RU.js +167 -0
- package/locale/th-TH.js +167 -0
- package/locale/tr-TR.js +169 -0
- package/locale/vi-VN.js +167 -0
- package/locale/zh-CN.js +221 -0
- package/locale/zh-HK.js +221 -0
- package/locale/zh-TW.js +220 -0
- package/package.json +25 -0
- package/style.css +1 -0
- package/types/Popover/index.d.ts +7 -0
- package/types/Popover/interface.d.ts +8 -0
- package/types/Popover/style/index.d.ts +3 -0
- package/types/affix/index.d.ts +9 -0
- package/types/affix/interface.d.ts +12 -0
- package/types/affix/style/index.d.ts +2 -0
- package/types/alert/index.d.ts +5 -0
- package/types/alert/interface.d.ts +17 -0
- package/types/alert/style/index.d.ts +2 -0
- package/types/anchor/Anchor.d.ts +9 -0
- package/types/anchor/Link.d.ts +6 -0
- package/types/anchor/context.d.ts +11 -0
- package/types/anchor/index.d.ts +4 -0
- package/types/anchor/interface.d.ts +24 -0
- package/types/anchor/style/index.d.ts +3 -0
- package/types/anchor/util.d.ts +4 -0
- package/types/auto-complete/index.d.ts +11 -0
- package/types/auto-complete/interface.d.ts +36 -0
- package/types/auto-complete/style/index.d.ts +4 -0
- package/types/avatar/Avatar.d.ts +6 -0
- package/types/avatar/Group.d.ts +6 -0
- package/types/avatar/context.d.ts +3 -0
- package/types/avatar/index.d.ts +9 -0
- package/types/avatar/interface.d.ts +24 -0
- package/types/avatar/style/index.d.ts +3 -0
- package/types/back-top/index.d.ts +8 -0
- package/types/back-top/interface.d.ts +11 -0
- package/types/back-top/style/index.d.ts +2 -0
- package/types/badge/Count.d.ts +7 -0
- package/types/badge/index.d.ts +7 -0
- package/types/badge/interface.d.ts +17 -0
- package/types/badge/style/index.d.ts +2 -0
- package/types/breadcrumb/Item.d.ts +8 -0
- package/types/breadcrumb/index.d.ts +9 -0
- package/types/breadcrumb/interface.d.ts +31 -0
- package/types/breadcrumb/style/index.d.ts +3 -0
- package/types/button/Group.d.ts +5 -0
- package/types/button/index.d.ts +16 -0
- package/types/button/interface.d.ts +37 -0
- package/types/button/style/index.d.ts +2 -0
- package/types/calendar/Month.d.ts +15 -0
- package/types/calendar/WeekList.d.ts +10 -0
- package/types/calendar/Year.d.ts +13 -0
- package/types/calendar/header/Panel.d.ts +2 -0
- package/types/calendar/header/index.d.ts +2 -0
- package/types/calendar/hook/useCellClassName.d.ts +1 -0
- package/types/calendar/index.d.ts +8 -0
- package/types/calendar/interface.d.ts +41 -0
- package/types/calendar/style/index.d.ts +4 -0
- package/types/card/Grid.d.ts +5 -0
- package/types/card/Meta.d.ts +5 -0
- package/types/card/index.d.ts +11 -0
- package/types/card/interface.d.ts +32 -0
- package/types/card/style/index.d.ts +3 -0
- package/types/carousel/Arrow.d.ts +4 -0
- package/types/carousel/Indicator.d.ts +4 -0
- package/types/carousel/index.d.ts +6 -0
- package/types/carousel/interface.d.ts +52 -0
- package/types/carousel/style/index.d.ts +2 -0
- package/types/cascader/Cascader.d.ts +17 -0
- package/types/cascader/base/node.d.ts +48 -0
- package/types/cascader/base/store.d.ts +26 -0
- package/types/cascader/hook/useRefCurrent.d.ts +3 -0
- package/types/cascader/index.d.ts +5 -0
- package/types/cascader/interface.d.ts +105 -0
- package/types/cascader/panel/List.d.ts +4 -0
- package/types/cascader/panel/Option.d.ts +23 -0
- package/types/cascader/panel/Search.d.ts +28 -0
- package/types/cascader/style/index.d.ts +6 -0
- package/types/cascader/util.d.ts +23 -0
- package/types/checkbox/Checkbox.d.ts +14 -0
- package/types/checkbox/Group.d.ts +17 -0
- package/types/checkbox/index.d.ts +5 -0
- package/types/checkbox/interface.d.ts +36 -0
- package/types/checkbox/style/index.d.ts +2 -0
- package/types/checkbox/useCheckbox.d.ts +13 -0
- package/types/collapse/Collapse.d.ts +14 -0
- package/types/collapse/Item.d.ts +7 -0
- package/types/collapse/index.d.ts +4 -0
- package/types/collapse/interface.d.ts +27 -0
- package/types/collapse/style/index.d.ts +2 -0
- package/types/color-picker/ControlBar.d.ts +11 -0
- package/types/color-picker/InputAlpha.d.ts +7 -0
- package/types/color-picker/InputHex.d.ts +11 -0
- package/types/color-picker/InputRgb.d.ts +10 -0
- package/types/color-picker/Palette.d.ts +7 -0
- package/types/color-picker/Panel.d.ts +20 -0
- package/types/color-picker/colors.d.ts +2 -0
- package/types/color-picker/hooks/useColorPicker.d.ts +37 -0
- package/types/color-picker/hooks/useControlBlock.d.ts +11 -0
- package/types/color-picker/index.d.ts +6 -0
- package/types/color-picker/interface.d.ts +49 -0
- package/types/color-picker/style/index.d.ts +4 -0
- package/types/comment/index.d.ts +7 -0
- package/types/comment/interface.d.ts +14 -0
- package/types/comment/style/index.d.ts +2 -0
- package/types/config-provider/ConfigProvider.d.ts +10 -0
- package/types/config-provider/context.d.ts +3 -0
- package/types/config-provider/index.d.ts +5 -0
- package/types/config-provider/interface.d.ts +168 -0
- package/types/config-provider/style/index.d.ts +1 -0
- package/types/copy/index.d.ts +8 -0
- package/types/copy/interface.d.ts +9 -0
- package/types/copy/style/index.d.ts +3 -0
- package/types/date-picker/Picker.d.ts +18 -0
- package/types/date-picker/PickerRange.d.ts +7 -0
- package/types/date-picker/context.d.ts +7 -0
- package/types/date-picker/hook/useCellClassName.d.ts +1 -0
- package/types/date-picker/index.d.ts +5 -0
- package/types/date-picker/interface.d.ts +159 -0
- package/types/date-picker/panel/Body.d.ts +30 -0
- package/types/date-picker/panel/Footer.d.ts +1 -0
- package/types/date-picker/panel/Header.d.ts +20 -0
- package/types/date-picker/panel/Shortcut.d.ts +3 -0
- package/types/date-picker/panel/WeekList.d.ts +8 -0
- package/types/date-picker/panel/date/index.d.ts +24 -0
- package/types/date-picker/panel/month/index.d.ts +17 -0
- package/types/date-picker/panel/quarter/index.d.ts +17 -0
- package/types/date-picker/panel/range/index.d.ts +28 -0
- package/types/date-picker/panel/week/index.d.ts +16 -0
- package/types/date-picker/panel/year/index.d.ts +16 -0
- package/types/date-picker/style/index.d.ts +7 -0
- package/types/date-picker/util.d.ts +9 -0
- package/types/descriptions/index.d.ts +8 -0
- package/types/descriptions/interface.d.ts +29 -0
- package/types/descriptions/style/index.d.ts +2 -0
- package/types/divider/index.d.ts +6 -0
- package/types/divider/interface.d.ts +8 -0
- package/types/divider/style/index.d.ts +2 -0
- package/types/draggable/Item.d.ts +3 -0
- package/types/draggable/index.d.ts +4 -0
- package/types/draggable/interface.d.ts +22 -0
- package/types/draggable/style/index.d.ts +2 -0
- package/types/drawer/Drawer.d.ts +5 -0
- package/types/drawer/index.d.ts +4 -0
- package/types/drawer/interface.d.ts +36 -0
- package/types/drawer/style/index.d.ts +3 -0
- package/types/dropdown/Button.d.ts +4 -0
- package/types/dropdown/index.d.ts +9 -0
- package/types/dropdown/interface.d.ts +28 -0
- package/types/dropdown/style/index.d.ts +4 -0
- package/types/empty/index.d.ts +6 -0
- package/types/empty/interface.d.ts +8 -0
- package/types/empty/style/index.d.ts +2 -0
- package/types/form/Control.d.ts +55 -0
- package/types/form/Form.d.ts +6 -0
- package/types/form/FormItem.d.ts +7 -0
- package/types/form/FormItemTip.d.ts +8 -0
- package/types/form/FormLabel.d.ts +9 -0
- package/types/form/FormList.d.ts +6 -0
- package/types/form/FormProvider.d.ts +4 -0
- package/types/form/IconSymbol.d.ts +3 -0
- package/types/form/context.d.ts +15 -0
- package/types/form/hook/useContext.d.ts +7 -0
- package/types/form/hook/useState.d.ts +3 -0
- package/types/form/hook/useWatch.d.ts +3 -0
- package/types/form/index.d.ts +26 -0
- package/types/form/interface.d.ts +228 -0
- package/types/form/promisify.d.ts +2 -0
- package/types/form/store.d.ts +89 -0
- package/types/form/style/index.d.ts +3 -0
- package/types/form/useForm.d.ts +3 -0
- package/types/form/util.d.ts +14 -0
- package/types/grid/Col.d.ts +4 -0
- package/types/grid/Row.d.ts +4 -0
- package/types/grid/context.d.ts +19 -0
- package/types/grid/grid-item.d.ts +7 -0
- package/types/grid/grid.d.ts +5 -0
- package/types/grid/hook/useResponsiveState.d.ts +2 -0
- package/types/grid/index.d.ts +11 -0
- package/types/grid/interface.d.ts +76 -0
- package/types/grid/style/index.d.ts +2 -0
- package/types/grid/util.d.ts +11 -0
- package/types/hooks/component/UseKey.d.ts +2 -0
- package/types/hooks/factory/createBreakpoint.d.ts +4 -0
- package/types/hooks/factory/createGlobalState.d.ts +7 -0
- package/types/hooks/factory/createHTMLMediaHook.d.ts +33 -0
- package/types/hooks/factory/createMemo.d.ts +2 -0
- package/types/hooks/factory/createReducer.d.ts +8 -0
- package/types/hooks/factory/createReducerContext.d.ts +5 -0
- package/types/hooks/factory/createRenderProp.d.ts +1 -0
- package/types/hooks/factory/createRouter.d.ts +7 -0
- package/types/hooks/factory/createStateContext.d.ts +5 -0
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/misc/hookState.d.ts +8 -0
- package/types/hooks/misc/parseTimeRanges.d.ts +4 -0
- package/types/hooks/misc/types.d.ts +2 -0
- package/types/hooks/misc/util.d.ts +5 -0
- package/types/hooks/use-verification-code/index.d.ts +2 -0
- package/types/hooks/use-verification-code/interface.d.ts +22 -0
- package/types/hooks/use-watermark/index.d.ts +2 -0
- package/types/hooks/use-watermark/interface.d.ts +22 -0
- package/types/hooks/use-watermark/utils.d.ts +1 -0
- package/types/hooks/useAsync.d.ts +20 -0
- package/types/hooks/useAsyncFn.d.ts +23 -0
- package/types/hooks/useAsyncRetry.d.ts +27 -0
- package/types/hooks/useAudio.d.ts +11 -0
- package/types/hooks/useBeforeUnload.d.ts +2 -0
- package/types/hooks/useBoolean.d.ts +2 -0
- package/types/hooks/useClickAway.d.ts +3 -0
- package/types/hooks/useComputedState.d.ts +4 -0
- package/types/hooks/useCopyToClipboard.d.ts +10 -0
- package/types/hooks/useCounter.d.ts +9 -0
- package/types/hooks/useCreate.d.ts +1 -0
- package/types/hooks/useCreation.d.ts +2 -0
- package/types/hooks/useCustomCompareEffect.d.ts +4 -0
- package/types/hooks/useDebounce.d.ts +3 -0
- package/types/hooks/useDefault.d.ts +2 -0
- package/types/hooks/useDrop.d.ts +17 -0
- package/types/hooks/useDropArea.d.ts +17 -0
- package/types/hooks/useEffectOnce.d.ts +3 -0
- package/types/hooks/useEffectState.d.ts +2 -0
- package/types/hooks/useEnsuredForwardedRef.d.ts +3 -0
- package/types/hooks/useError.d.ts +2 -0
- package/types/hooks/useEvent.d.ts +13 -0
- package/types/hooks/useEventListener.d.ts +2 -0
- package/types/hooks/useFavicon.d.ts +2 -0
- package/types/hooks/useFirstMountState.d.ts +1 -0
- package/types/hooks/useForceUpdate.d.ts +2 -0
- package/types/hooks/useFullscreen.d.ts +10 -0
- package/types/hooks/useGeolocation.d.ts +21 -0
- package/types/hooks/useGetSet.d.ts +3 -0
- package/types/hooks/useGetSetState.d.ts +2 -0
- package/types/hooks/useHash.d.ts +2 -0
- package/types/hooks/useHover.d.ts +4 -0
- package/types/hooks/useHoverDirty.d.ts +3 -0
- package/types/hooks/useId.d.ts +1 -0
- package/types/hooks/useIdle.d.ts +2 -0
- package/types/hooks/useInView.d.ts +11 -0
- package/types/hooks/useIntersection.d.ts +3 -0
- package/types/hooks/useIntersectionObserver.d.ts +7 -0
- package/types/hooks/useInterval.d.ts +2 -0
- package/types/hooks/useIsFirstRender.d.ts +1 -0
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/types/hooks/useIsomorphicLayoutEffect2.d.ts +3 -0
- package/types/hooks/useKey.d.ts +12 -0
- package/types/hooks/useKeyPress.d.ts +3 -0
- package/types/hooks/useKeyPressEvent.d.ts +3 -0
- package/types/hooks/useKeyboardEvent.d.ts +14 -0
- package/types/hooks/useLatest.d.ts +4 -0
- package/types/hooks/useLifecycles.d.ts +2 -0
- package/types/hooks/useList.d.ts +18 -0
- package/types/hooks/useLocalStorage.d.ts +10 -0
- package/types/hooks/useLocation.d.ts +16 -0
- package/types/hooks/useLockBodyScroll.d.ts +8 -0
- package/types/hooks/useLogger.d.ts +2 -0
- package/types/hooks/useLongPress.d.ts +12 -0
- package/types/hooks/useMap.d.ts +11 -0
- package/types/hooks/useMeasure.d.ts +9 -0
- package/types/hooks/useMeasureDirty.d.ts +11 -0
- package/types/hooks/useMedia.d.ts +2 -0
- package/types/hooks/useMediaDevices.d.ts +2 -0
- package/types/hooks/useMediatedState.d.ts +9 -0
- package/types/hooks/useMergeProps.d.ts +4 -0
- package/types/hooks/useMergeValue.d.ts +5 -0
- package/types/hooks/useMethods.d.ts +8 -0
- package/types/hooks/useMotion.d.ts +20 -0
- package/types/hooks/useMount.d.ts +2 -0
- package/types/hooks/useMountedState.d.ts +1 -0
- package/types/hooks/useMouse.d.ts +13 -0
- package/types/hooks/useMouseHovered.d.ts +8 -0
- package/types/hooks/useMouseWheel.d.ts +2 -0
- package/types/hooks/useMultiStateValidator.d.ts +9 -0
- package/types/hooks/useNetworkState.d.ts +22 -0
- package/types/hooks/useNumber.d.ts +2 -0
- package/types/hooks/useObservable.d.ts +8 -0
- package/types/hooks/useOrientation.d.ts +6 -0
- package/types/hooks/useOverflowHidden.d.ts +5 -0
- package/types/hooks/usePageLeave.d.ts +2 -0
- package/types/hooks/usePermission.d.ts +16 -0
- package/types/hooks/usePinchZoom.d.ts +18 -0
- package/types/hooks/usePrevious.d.ts +2 -0
- package/types/hooks/usePreviousDistinct.d.ts +2 -0
- package/types/hooks/usePromise.d.ts +3 -0
- package/types/hooks/useQueue.d.ts +9 -0
- package/types/hooks/useRaf.d.ts +2 -0
- package/types/hooks/useRafLoop.d.ts +2 -0
- package/types/hooks/useRafState.d.ts +3 -0
- package/types/hooks/useReactive.d.ts +2 -0
- package/types/hooks/useRefs.d.ts +1 -0
- package/types/hooks/useRendersCount.d.ts +1 -0
- package/types/hooks/useScroll.d.ts +7 -0
- package/types/hooks/useScrolling.d.ts +3 -0
- package/types/hooks/useSearchParam.d.ts +3 -0
- package/types/hooks/useSessionStorage.d.ts +2 -0
- package/types/hooks/useSet.d.ts +11 -0
- package/types/hooks/useSetState.d.ts +2 -0
- package/types/hooks/useSize.d.ts +8 -0
- package/types/hooks/useSlider.d.ts +15 -0
- package/types/hooks/useSpeech.d.ts +16 -0
- package/types/hooks/useStartTyping.d.ts +2 -0
- package/types/hooks/useStateCallback.d.ts +5 -0
- package/types/hooks/useStateList.d.ts +9 -0
- package/types/hooks/useStateValidator.d.ts +8 -0
- package/types/hooks/useStateWithHistory.d.ts +18 -0
- package/types/hooks/useStateWithPromise.d.ts +2 -0
- package/types/hooks/useSyncState.d.ts +3 -0
- package/types/hooks/useThrottle.d.ts +2 -0
- package/types/hooks/useThrottleFn.d.ts +2 -0
- package/types/hooks/useTimeout.d.ts +2 -0
- package/types/hooks/useTimeoutFn.d.ts +2 -0
- package/types/hooks/useTitle.d.ts +6 -0
- package/types/hooks/useToggle.d.ts +2 -0
- package/types/hooks/useTween.d.ts +3 -0
- package/types/hooks/useUnmount.d.ts +2 -0
- package/types/hooks/useUnmountPromise.d.ts +3 -0
- package/types/hooks/useUpdate.d.ts +2 -0
- package/types/hooks/useUpdateEffect.d.ts +3 -0
- package/types/hooks/useUpdateTimeout.d.ts +2 -0
- package/types/hooks/useUpsert.d.ts +6 -0
- package/types/hooks/useVibrate.d.ts +4 -0
- package/types/hooks/useVideo.d.ts +11 -0
- package/types/hooks/useWatch.d.ts +2 -0
- package/types/hooks/useWindowScroll.d.ts +6 -0
- package/types/hooks/useWindowSize.d.ts +5 -0
- package/types/icon/addFromIconFontCn.d.ts +9 -0
- package/types/icon/index.d.ts +18 -0
- package/types/icon/style/index.d.ts +0 -0
- package/types/icon-hover/index.d.ts +11 -0
- package/types/icon-hover/style/index.d.ts +2 -0
- package/types/image/Image.d.ts +11 -0
- package/types/image/ImageFooter.d.ts +13 -0
- package/types/image/ImagePreview.d.ts +6 -0
- package/types/image/ImagePreviewArrow.d.ts +9 -0
- package/types/image/ImagePreviewGroup.d.ts +10 -0
- package/types/image/ImagePreviewToolbar.d.ts +14 -0
- package/types/image/TriggerForToolbar.d.ts +10 -0
- package/types/image/index.d.ts +4 -0
- package/types/image/interface.d.ts +58 -0
- package/types/image/previewGroupContext.d.ts +24 -0
- package/types/image/style/index.d.ts +2 -0
- package/types/image/util/getFixTranslate.d.ts +1 -0
- package/types/image/util/getScale.d.ts +13 -0
- package/types/image/util/hook/useImageStatus.d.ts +11 -0
- package/types/image/util/hook/useShowFooter.d.ts +8 -0
- package/types/index.d.ts +197 -0
- package/types/input/Group.d.ts +7 -0
- package/types/input/Input.d.ts +23 -0
- package/types/input/InputElement.d.ts +4 -0
- package/types/input/Number.d.ts +2 -0
- package/types/input/Password.d.ts +5 -0
- package/types/input/Search.d.ts +5 -0
- package/types/input/Tag.d.ts +2 -0
- package/types/input/Textarea.d.ts +9 -0
- package/types/input/autoSizeTextAreaHeight.d.ts +5 -0
- package/types/input/index.d.ts +8 -0
- package/types/input/interface.d.ts +93 -0
- package/types/input/style/index.d.ts +3 -0
- package/types/input/useComposition.d.ts +17 -0
- package/types/input-number/decimal.d.ts +16 -0
- package/types/input-number/index.d.ts +7 -0
- package/types/input-number/interface.d.ts +37 -0
- package/types/input-number/style/index.d.ts +3 -0
- package/types/input-number/useSelectionRange.d.ts +4 -0
- package/types/input-number/util.d.ts +13 -0
- package/types/input-tag/InputTag.d.ts +9 -0
- package/types/input-tag/index.d.ts +4 -0
- package/types/input-tag/interface.d.ts +60 -0
- package/types/input-tag/style/index.d.ts +3 -0
- package/types/layout/Content.d.ts +3 -0
- package/types/layout/Footer.d.ts +3 -0
- package/types/layout/Header.d.ts +3 -0
- package/types/layout/Sider.d.ts +10 -0
- package/types/layout/index.d.ts +18 -0
- package/types/layout/interface.d.ts +39 -0
- package/types/layout/style/index.d.ts +4 -0
- package/types/link/index.d.ts +7 -0
- package/types/link/interface.d.ts +9 -0
- package/types/link/style/index.d.ts +2 -0
- package/types/list/Item.d.ts +7 -0
- package/types/list/Meta.d.ts +4 -0
- package/types/list/index.d.ts +13 -0
- package/types/list/interface.d.ts +57 -0
- package/types/list/style/index.d.ts +6 -0
- package/types/loading/index.d.ts +3 -0
- package/types/loading/style/index.d.ts +2 -0
- package/types/locale/ar-EG.d.ts +228 -0
- package/types/locale/de-DE.d.ts +228 -0
- package/types/locale/default.d.ts +2 -0
- package/types/locale/en-US.d.ts +279 -0
- package/types/locale/es-ES.d.ts +228 -0
- package/types/locale/fr-FR.d.ts +228 -0
- package/types/locale/id-ID.d.ts +228 -0
- package/types/locale/interface.d.ts +39 -0
- package/types/locale/it-IT.d.ts +228 -0
- package/types/locale/ja-JP.d.ts +281 -0
- package/types/locale/ko-KR.d.ts +228 -0
- package/types/locale/ms-MY.d.ts +228 -0
- package/types/locale/pt-BR.d.ts +228 -0
- package/types/locale/pt-PT.d.ts +228 -0
- package/types/locale/ru-RU.d.ts +228 -0
- package/types/locale/th-TH.d.ts +228 -0
- package/types/locale/tr-TR.d.ts +274 -0
- package/types/locale/vi-VN.d.ts +228 -0
- package/types/locale/zh-CN.d.ts +281 -0
- package/types/locale/zh-HK.d.ts +281 -0
- package/types/locale/zh-TW.d.ts +281 -0
- package/types/mentions/index.d.ts +6 -0
- package/types/mentions/interface.d.ts +26 -0
- package/types/mentions/style/index.d.ts +2 -0
- package/types/mentions/util.d.ts +9 -0
- package/types/menu/Indent.d.ts +5 -0
- package/types/menu/Item.d.ts +5 -0
- package/types/menu/ItemGroup.d.ts +5 -0
- package/types/menu/Menu.d.ts +12 -0
- package/types/menu/OverflowWrap.d.ts +9 -0
- package/types/menu/context.d.ts +15 -0
- package/types/menu/index.d.ts +4 -0
- package/types/menu/interface.d.ts +77 -0
- package/types/menu/style/index.d.ts +4 -0
- package/types/menu/sub-menu/Inline.d.ts +5 -0
- package/types/menu/sub-menu/Pop.d.ts +5 -0
- package/types/menu/sub-menu/index.d.ts +5 -0
- package/types/menu/util.d.ts +16 -0
- package/types/message/index.d.ts +33 -0
- package/types/message/interface.d.ts +30 -0
- package/types/message/style/index.d.ts +2 -0
- package/types/message/useMessage.d.ts +6 -0
- package/types/modal/Confirm.d.ts +14 -0
- package/types/modal/Modal.d.ts +19 -0
- package/types/modal/config.d.ts +10 -0
- package/types/modal/index.d.ts +4 -0
- package/types/modal/interface.d.ts +55 -0
- package/types/modal/style/index.d.ts +3 -0
- package/types/modal/use-modal/Hook.d.ts +7 -0
- package/types/modal/use-modal/index.d.ts +4 -0
- package/types/notice/index.d.ts +48 -0
- package/types/notice/style/index.d.ts +2 -0
- package/types/notification/index.d.ts +29 -0
- package/types/notification/interface.d.ts +26 -0
- package/types/notification/style/index.d.ts +2 -0
- package/types/notification/useNotification.d.ts +6 -0
- package/types/notification-base/index.d.ts +16 -0
- package/types/notification-base/style/index.d.ts +2 -0
- package/types/overflow-ellipsis/OverflowItem.d.ts +10 -0
- package/types/overflow-ellipsis/index.d.ts +11 -0
- package/types/page-header/index.d.ts +8 -0
- package/types/page-header/interface.d.ts +14 -0
- package/types/page-header/style/index.d.ts +3 -0
- package/types/pagination/PageItem.d.ts +52 -0
- package/types/pagination/PageJumper.d.ts +13 -0
- package/types/pagination/PageOption.d.ts +15 -0
- package/types/pagination/Pagination.d.ts +11 -0
- package/types/pagination/index.d.ts +4 -0
- package/types/pagination/interface.d.ts +34 -0
- package/types/pagination/style/index.d.ts +4 -0
- package/types/picker/Input.d.ts +31 -0
- package/types/picker/InputRange.d.ts +35 -0
- package/types/picker/index.d.ts +4 -0
- package/types/picker/style/index.d.ts +2 -0
- package/types/popconfirm/index.d.ts +7 -0
- package/types/popconfirm/interface.d.ts +28 -0
- package/types/popconfirm/style/index.d.ts +5 -0
- package/types/portal/Portal.d.ts +7 -0
- package/types/portal/index.d.ts +10 -0
- package/types/progress/CircleProgress.d.ts +8 -0
- package/types/progress/LineProgess.d.ts +2 -0
- package/types/progress/StepProgress.d.ts +2 -0
- package/types/progress/index.d.ts +5 -0
- package/types/progress/interface.d.ts +22 -0
- package/types/progress/style/index.d.ts +3 -0
- package/types/radio/Group.d.ts +10 -0
- package/types/radio/Radio.d.ts +11 -0
- package/types/radio/index.d.ts +6 -0
- package/types/radio/interface.d.ts +39 -0
- package/types/radio/style/index.d.ts +2 -0
- package/types/rate/index.d.ts +6 -0
- package/types/rate/interface.d.ts +17 -0
- package/types/rate/style/index.d.ts +3 -0
- package/types/resize-box/ResizeTrigger.d.ts +24 -0
- package/types/resize-box/Split.d.ts +4 -0
- package/types/resize-box/SplitGroup.d.ts +4 -0
- package/types/resize-box/index.d.ts +13 -0
- package/types/resize-box/interface.d.ts +73 -0
- package/types/resize-box/style/index.d.ts +2 -0
- package/types/result/403.d.ts +1 -0
- package/types/result/404.d.ts +1 -0
- package/types/result/500.d.ts +1 -0
- package/types/result/index.d.ts +7 -0
- package/types/result/interface.d.ts +11 -0
- package/types/result/style/index.d.ts +2 -0
- package/types/select/OptGroup.d.ts +6 -0
- package/types/select/Option.d.ts +6 -0
- package/types/select/Select.d.ts +10 -0
- package/types/select/index.d.ts +4 -0
- package/types/select/interface.d.ts +102 -0
- package/types/select/style/index.d.ts +6 -0
- package/types/select/util.d.ts +26 -0
- package/types/select-view/Core.d.ts +12 -0
- package/types/select-view/index.d.ts +12 -0
- package/types/select-view/interface.d.ts +60 -0
- package/types/select-view/style/index.d.ts +2 -0
- package/types/skeleton/Image.d.ts +2 -0
- package/types/skeleton/Text.d.ts +2 -0
- package/types/skeleton/index.d.ts +8 -0
- package/types/skeleton/interface.d.ts +24 -0
- package/types/skeleton/style/index.d.ts +2 -0
- package/types/slider/Button.d.ts +21 -0
- package/types/slider/Dot.d.ts +17 -0
- package/types/slider/Input.d.ts +15 -0
- package/types/slider/Mark.d.ts +16 -0
- package/types/slider/Tick.d.ts +14 -0
- package/types/slider/hook/useInterval.d.ts +24 -0
- package/types/slider/hook/useLegalValue.d.ts +15 -0
- package/types/slider/index.d.ts +6 -0
- package/types/slider/interface.d.ts +32 -0
- package/types/slider/style/index.d.ts +5 -0
- package/types/slider/util.d.ts +11 -0
- package/types/space/index.d.ts +5 -0
- package/types/space/interface.d.ts +12 -0
- package/types/space/style/index.d.ts +2 -0
- package/types/space/toArray.d.ts +1 -0
- package/types/speech-synthesis/index.d.ts +1 -0
- package/types/spin/DotLoading.d.ts +5 -0
- package/types/spin/index.d.ts +6 -0
- package/types/spin/interface.d.ts +14 -0
- package/types/spin/style/index.d.ts +2 -0
- package/types/statistic/Countdown.d.ts +4 -0
- package/types/statistic/index.d.ts +8 -0
- package/types/statistic/interface.d.ts +33 -0
- package/types/statistic/style/index.d.ts +3 -0
- package/types/statistic/util.d.ts +1 -0
- package/types/steps/Step.d.ts +4 -0
- package/types/steps/index.d.ts +9 -0
- package/types/steps/interface.d.ts +42 -0
- package/types/steps/style/index.d.ts +2 -0
- package/types/suspense-fallback-test/index.d.ts +3 -0
- package/types/suspense-fallback-test/style/index.d.ts +2 -0
- package/types/switch/index.d.ts +11 -0
- package/types/switch/interface.d.ts +17 -0
- package/types/switch/style/index.d.ts +2 -0
- package/types/table/ColGroup.d.ts +13 -0
- package/types/table/Table.d.ts +10 -0
- package/types/table/constant.d.ts +2 -0
- package/types/table/hook/useColumns.d.ts +3 -0
- package/types/table/hook/useComponent.d.ts +30 -0
- package/types/table/hook/useExpand.d.ts +3 -0
- package/types/table/hook/useRowSelection.d.ts +12 -0
- package/types/table/hook/useSorter.d.ts +7 -0
- package/types/table/hook/useStickyClassNames.d.ts +3 -0
- package/types/table/hook/useStickyOffsets.d.ts +3 -0
- package/types/table/index.d.ts +9 -0
- package/types/table/interface.d.ts +295 -0
- package/types/table/style/index.d.ts +11 -0
- package/types/table/summary/Cell.d.ts +12 -0
- package/types/table/summary/Row.d.ts +7 -0
- package/types/table/summary/context.d.ts +9 -0
- package/types/table/summary/index.d.ts +8 -0
- package/types/table/tbody/Td.d.ts +25 -0
- package/types/table/tbody/Tr.d.ts +16 -0
- package/types/table/tbody/index.d.ts +3 -0
- package/types/table/tfoot/index.d.ts +3 -0
- package/types/table/thead/Column.d.ts +3 -0
- package/types/table/thead/index.d.ts +3 -0
- package/types/table/util.d.ts +17 -0
- package/types/tabs/Tab.d.ts +18 -0
- package/types/tabs/TabContent.d.ts +9 -0
- package/types/tabs/TabPane.d.ts +8 -0
- package/types/tabs/hook/useDomSize.d.ts +11 -0
- package/types/tabs/hook/useHeaderScroll.d.ts +9 -0
- package/types/tabs/index.d.ts +4 -0
- package/types/tabs/interface.d.ts +66 -0
- package/types/tabs/style/index.d.ts +3 -0
- package/types/tabs/tab-header/DropdownIcon.d.ts +1 -0
- package/types/tabs/tab-header/TabInk.d.ts +11 -0
- package/types/tabs/tab-header/TabNavIcon.d.ts +17 -0
- package/types/tabs/tab-header/TabTitle.d.ts +17 -0
- package/types/tabs/tab-header/index.d.ts +4 -0
- package/types/tabs/util.d.ts +12 -0
- package/types/tag/index.d.ts +5 -0
- package/types/tag/interface.d.ts +19 -0
- package/types/tag/style/index.d.ts +2 -0
- package/types/time-picker/Picker.d.ts +15 -0
- package/types/time-picker/RangePicker.d.ts +12 -0
- package/types/time-picker/TimeColumn.d.ts +17 -0
- package/types/time-picker/TimePicker.d.ts +24 -0
- package/types/time-picker/context.d.ts +6 -0
- package/types/time-picker/index.d.ts +5 -0
- package/types/time-picker/interface.d.ts +62 -0
- package/types/time-picker/style/index.d.ts +5 -0
- package/types/time-picker/util.d.ts +7 -0
- package/types/timeline/Item.d.ts +7 -0
- package/types/timeline/Timeline.d.ts +10 -0
- package/types/timeline/index.d.ts +4 -0
- package/types/timeline/interface.d.ts +26 -0
- package/types/timeline/style/index.d.ts +2 -0
- package/types/tooltip/index.d.ts +10 -0
- package/types/tooltip/interface.d.ts +23 -0
- package/types/tooltip/style/index.d.ts +3 -0
- package/types/transfer/Item.d.ts +3 -0
- package/types/transfer/List.d.ts +5 -0
- package/types/transfer/index.d.ts +6 -0
- package/types/transfer/interface.d.ts +91 -0
- package/types/transfer/style/index.d.ts +6 -0
- package/types/tree/Animation.d.ts +4 -0
- package/types/tree/Context.d.ts +28 -0
- package/types/tree/Node.d.ts +12 -0
- package/types/tree/NodeList.d.ts +2 -0
- package/types/tree/Tree.d.ts +73 -0
- package/types/tree/index.d.ts +8 -0
- package/types/tree/interface.d.ts +152 -0
- package/types/tree/style/index.d.ts +3 -0
- package/types/tree/util.d.ts +13 -0
- package/types/tree-select/List.d.ts +11 -0
- package/types/tree-select/Select.d.ts +12 -0
- package/types/tree-select/hook/useKeyCache.d.ts +6 -0
- package/types/tree-select/hook/useStateValue.d.ts +22 -0
- package/types/tree-select/hook/useTreeData.d.ts +3 -0
- package/types/tree-select/index.d.ts +4 -0
- package/types/tree-select/interface.d.ts +79 -0
- package/types/tree-select/style/index.d.ts +5 -0
- package/types/tree-select/util.d.ts +1 -0
- package/types/trigger/Portal.d.ts +7 -0
- package/types/trigger/getPopupStyle.d.ts +20 -0
- package/types/trigger/index.d.ts +125 -0
- package/types/trigger/interface.d.ts +71 -0
- package/types/trigger/style/index.d.ts +2 -0
- package/types/typography/Base.d.ts +7 -0
- package/types/typography/EditContent.d.ts +2 -0
- package/types/typography/Ellipsis.d.ts +6 -0
- package/types/typography/Operations.d.ts +3 -0
- package/types/typography/Paragraph.d.ts +6 -0
- package/types/typography/Text.d.ts +6 -0
- package/types/typography/Title.d.ts +6 -0
- package/types/typography/Typography.d.ts +3 -0
- package/types/typography/index.d.ts +12 -0
- package/types/typography/interface.d.ts +97 -0
- package/types/typography/style/index.d.ts +5 -0
- package/types/typography/useCssEllipsis.d.ts +6 -0
- package/types/typography/useEllipsis.d.ts +21 -0
- package/types/upload/TriggerNode.d.ts +4 -0
- package/types/upload/Upload.d.ts +12 -0
- package/types/upload/Uploader.d.ts +15 -0
- package/types/upload/index.d.ts +4 -0
- package/types/upload/interface.d.ts +126 -0
- package/types/upload/list/PictureItem.d.ts +8 -0
- package/types/upload/list/TextItem.d.ts +8 -0
- package/types/upload/list/UploadProgress.d.ts +14 -0
- package/types/upload/list/index.d.ts +6 -0
- package/types/upload/request.d.ts +3 -0
- package/types/upload/style/index.d.ts +6 -0
- package/types/upload/util.d.ts +4 -0
- package/types/utils/className.d.ts +2 -0
- package/types/utils/constant.d.ts +3 -0
- package/types/utils/contextHolder.d.ts +9 -0
- package/types/utils/dayjs.d.ts +21 -0
- package/types/utils/dom.d.ts +6 -0
- package/types/utils/fillNBSP.d.ts +1 -0
- package/types/utils/getHighlightText.d.ts +5 -0
- package/types/utils/getHotkeyHandler.d.ts +8 -0
- package/types/utils/getStringLength.d.ts +1 -0
- package/types/utils/include.d.ts +1 -0
- package/types/utils/is.d.ts +23 -0
- package/types/utils/keyCode.d.ts +45 -0
- package/types/utils/mergeProp.d.ts +1 -0
- package/types/utils/mergedToString.d.ts +1 -0
- package/types/utils/omit.d.ts +1 -0
- package/types/utils/pad.d.ts +2 -0
- package/types/utils/pick.d.ts +4 -0
- package/types/utils/raf.d.ts +3 -0
- package/types/utils/reactDOM.d.ts +5 -0
- package/types/utils/responsiveObserve.d.ts +15 -0
- package/types/utils/scrollIntoView.d.ts +2 -0
- package/types/utils/style.d.ts +3 -0
- package/types/utils/throttleByRaf.d.ts +4 -0
- package/types/utils/throttleByRafV2.d.ts +4 -0
- package/types/utils/type.d.ts +4 -0
- package/types/utils/warning.d.ts +1 -0
- package/types/verification-code/VerificationCode.d.ts +7 -0
- package/types/verification-code/index.d.ts +5 -0
- package/types/verification-code/interface.d.ts +25 -0
- package/types/verification-code/style/index.d.ts +3 -0
- package/types/version/index.d.ts +2 -0
- package/types/virtual-list/Filler.d.ts +10 -0
- package/types/virtual-list/VirtualList.d.ts +39 -0
- package/types/virtual-list/index.d.ts +4 -0
- package/types/virtual-list/style/index.d.ts +2 -0
- package/types/virtual-list/util/algorithm.d.ts +6 -0
- package/types/virtual-list/util/item.d.ts +44 -0
- package/types/watermark/Watermark.d.ts +4 -0
- package/types/watermark/index.d.ts +5 -0
- package/types/watermark/interface.d.ts +21 -0
- package/types/watermark/style/index.d.ts +1 -0
- package/utils/className.js +5 -0
- package/utils/constant.js +23 -0
- package/utils/contextHolder.js +6 -0
- package/utils/dayjs.js +174 -0
- package/utils/dom.js +47 -0
- package/utils/fillNBSP.js +6 -0
- package/utils/getHighlightText.js +41 -0
- package/utils/getHotkeyHandler.js +27 -0
- package/utils/getStringLength.js +9 -0
- package/utils/include.js +9 -0
- package/utils/is.js +94 -0
- package/utils/keyCode.js +48 -0
- package/utils/mergeProp.js +11 -0
- package/utils/mergedToString.js +14 -0
- package/utils/omit.js +11 -0
- package/utils/pad.js +18 -0
- package/utils/pick.js +17 -0
- package/utils/raf.js +19 -0
- package/utils/reactDOM.js +36 -0
- package/utils/responsiveObserve.js +65 -0
- package/utils/scrollIntoView.js +22 -0
- package/utils/style.js +39 -0
- package/utils/throttleByRaf.js +15 -0
- package/utils/throttleByRafV2.js +16 -0
- package/utils/type.js +1 -0
- package/utils/warning.js +6 -0
package/Form.js
ADDED
|
@@ -0,0 +1,1420 @@
|
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var Ze = (s, e, t) => e in s ? Xe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var u = (s, e, t) => (Ze(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import "./chunk/DP2rzg_V.js";
|
|
5
|
+
import "./chunk/DhodcKwW.js";
|
|
6
|
+
import { jsx as f, jsxs as B, Fragment as Re } from "react/jsx-runtime";
|
|
7
|
+
import Ye from "@unicom-cloud/scroll-into-view-if-needed";
|
|
8
|
+
import M from "lodash/isPlainObject";
|
|
9
|
+
import Pe from "lodash/merge";
|
|
10
|
+
import A, { createContext as oe, useRef as U, forwardRef as pe, useContext as L, useEffect as se, useImperativeHandle as Ke, Component as et, isValidElement as me, useState as le, useMemo as we, cloneElement as Ee, createElement as tt, useCallback as Y } from "react";
|
|
11
|
+
import { a as Se, b as rt } from "./chunk/Dc_89PVN.js";
|
|
12
|
+
import st from "./hooks/useCreate.js";
|
|
13
|
+
import it from "./hooks/useMergeProps.js";
|
|
14
|
+
import j from "@unicom-cloud/utils/class-name";
|
|
15
|
+
import xe from "./utils/omit.js";
|
|
16
|
+
import { NOOP as b } from "./utils/constant.js";
|
|
17
|
+
import W from "lodash/get";
|
|
18
|
+
import Me from "lodash/has";
|
|
19
|
+
import E from "lodash/isArray";
|
|
20
|
+
import O from "lodash/isFunction";
|
|
21
|
+
import nt from "lodash/omit";
|
|
22
|
+
import _e from "lodash/setWith";
|
|
23
|
+
import { isExist as Te } from "./utils/is.js";
|
|
24
|
+
import { Schema as lt } from "@unicom-cloud/utils/validate";
|
|
25
|
+
import Le from "lodash/cloneDeepWith";
|
|
26
|
+
import Ue from "lodash/set";
|
|
27
|
+
import ot from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
28
|
+
import at from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
29
|
+
import ct from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
30
|
+
import ut from "@unicom-cloud/icons/IconUiLoading";
|
|
31
|
+
import dt from "lodash/isBoolean";
|
|
32
|
+
import Fe from "lodash/isEqualWith";
|
|
33
|
+
import ht from "lodash/isNil";
|
|
34
|
+
import ee from "./utils/warning.js";
|
|
35
|
+
import gt from "lodash/isObject";
|
|
36
|
+
import K from "lodash/isUndefined";
|
|
37
|
+
import De from "./Grid.js";
|
|
38
|
+
import { CSSTransition as mt } from "@unicom-cloud/react-transition-group";
|
|
39
|
+
import Ft from "@unicom-cloud/icons/IconUiQuestionCircleFill";
|
|
40
|
+
import ft from "./Tooltip.js";
|
|
41
|
+
import pt from "./hooks/useForceUpdate.js";
|
|
42
|
+
import St from "lodash/isString";
|
|
43
|
+
const H = oe({
|
|
44
|
+
layout: "horizontal",
|
|
45
|
+
labelCol: { span: 5, offset: 0 },
|
|
46
|
+
labelAlign: "right",
|
|
47
|
+
wrapperCol: { span: 19, offset: 0 },
|
|
48
|
+
requiredSymbol: !0,
|
|
49
|
+
getFormElementId: () => "pqb-",
|
|
50
|
+
store: {
|
|
51
|
+
clearFields: b,
|
|
52
|
+
getFieldsValue: b,
|
|
53
|
+
getFieldValue: b,
|
|
54
|
+
getFieldError: b,
|
|
55
|
+
getFieldsError: b,
|
|
56
|
+
getTouchedFields: b,
|
|
57
|
+
getFields: b,
|
|
58
|
+
getInitialValues: b,
|
|
59
|
+
setInitialValues: b,
|
|
60
|
+
setInitialValue: b,
|
|
61
|
+
setFieldValue: b,
|
|
62
|
+
setFieldsValue: b,
|
|
63
|
+
setFields: b,
|
|
64
|
+
resetFields: b,
|
|
65
|
+
submit: b,
|
|
66
|
+
validate: b,
|
|
67
|
+
getFieldsState: b,
|
|
68
|
+
scrollToField: b,
|
|
69
|
+
getInnerMethods: () => ({
|
|
70
|
+
registerField: b,
|
|
71
|
+
innerGetStore: b,
|
|
72
|
+
registerStateWatcher: b,
|
|
73
|
+
registerWatcher: b,
|
|
74
|
+
innerGetStoreStatus: b
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}), fe = oe({}), Oe = oe({}), je = oe({}), he = {
|
|
78
|
+
error: "error",
|
|
79
|
+
success: "success",
|
|
80
|
+
warning: "warning",
|
|
81
|
+
validating: "validating"
|
|
82
|
+
};
|
|
83
|
+
var D = /* @__PURE__ */ ((s) => (s.init = "init", s.error = "error", s.success = "success", s.submitting = "submitting", s))(D || {});
|
|
84
|
+
class Vt extends Error {
|
|
85
|
+
constructor(t) {
|
|
86
|
+
super("form validate error, get errors by error.errors");
|
|
87
|
+
u(this, "errors", {});
|
|
88
|
+
this.errors = t;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function bt(s) {
|
|
92
|
+
return Object.defineProperty(
|
|
93
|
+
(...e) => typeof e[e.length - 1] == "function" ? s.apply(this, e) : new Promise((t, r) => (e[e.length] = (i, l) => {
|
|
94
|
+
if (i)
|
|
95
|
+
return r(new Vt(i));
|
|
96
|
+
t(l);
|
|
97
|
+
}, e.length++, s.apply(this, e))),
|
|
98
|
+
"name",
|
|
99
|
+
{ value: s.name }
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function Z(s) {
|
|
103
|
+
return Le(s, (e) => {
|
|
104
|
+
if (!M(e) && !E(e))
|
|
105
|
+
return e;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const vt = (s, e) => Le(s, (t) => {
|
|
109
|
+
if (O(t))
|
|
110
|
+
return (r) => t(r, e);
|
|
111
|
+
});
|
|
112
|
+
function P(s, e, t) {
|
|
113
|
+
return Ue(s, e, Z(t)), s;
|
|
114
|
+
}
|
|
115
|
+
function $e(s, e = "") {
|
|
116
|
+
const t = /* @__PURE__ */ new Set(), r = (i, l = "") => i ? t.has(i) ? [] : (t.add(i), Object.keys(i).map((n) => (M(i[n]) || E(i[n])) && Object.keys(i[n]).length && !A.isValidElement(i[n]) ? r(i[n], `${l + n}.`) : l + n).flat()) : [];
|
|
117
|
+
return r(s, e);
|
|
118
|
+
}
|
|
119
|
+
function Ge(s) {
|
|
120
|
+
var e;
|
|
121
|
+
return ((e = s == null ? void 0 : s.constructor) == null ? void 0 : e.name) === "SyntheticEvent" || (s == null ? void 0 : s.nativeEvent) instanceof Event;
|
|
122
|
+
}
|
|
123
|
+
async function ke(s, e, t, r) {
|
|
124
|
+
const i = [...t || []];
|
|
125
|
+
let l = 0;
|
|
126
|
+
return new Promise(async (n) => {
|
|
127
|
+
const o = [], c = async (h) => {
|
|
128
|
+
const a = () => l < i.length - 1 ? (l++, c(i[l])) : n({ error: null, warning: o });
|
|
129
|
+
if (!h)
|
|
130
|
+
return a();
|
|
131
|
+
const d = { ...h };
|
|
132
|
+
!d.type && !d.validator && (d.type = "string"), new lt({ [s]: [d] }, {
|
|
133
|
+
ignoreEmptyString: !0,
|
|
134
|
+
validateMessages: r
|
|
135
|
+
}).validate({ [s]: e }, (F) => {
|
|
136
|
+
if (F)
|
|
137
|
+
if (h.validateLevel === "warning")
|
|
138
|
+
o.push(F[s].message);
|
|
139
|
+
else
|
|
140
|
+
return n({
|
|
141
|
+
error: F,
|
|
142
|
+
warning: o
|
|
143
|
+
});
|
|
144
|
+
return a();
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
c(i[l]);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function ne(s, e) {
|
|
151
|
+
const t = _e({}, s, void 0, Object);
|
|
152
|
+
return e.some((r) => Me(t, r));
|
|
153
|
+
}
|
|
154
|
+
const Ve = "_input";
|
|
155
|
+
class yt {
|
|
156
|
+
constructor() {
|
|
157
|
+
// 表示的 Form 的提交状态而非单个字段的提交状态。
|
|
158
|
+
// 只有在触发表单 reset(原生 reset,而非当前的 resetFields) 时,才会回到 init 状态(目前没有支持 form.reset,所以没有这块逻辑)
|
|
159
|
+
u(this, "submitStatus", D.init);
|
|
160
|
+
u(this, "registerFields", []);
|
|
161
|
+
// 所有 form item value 的变动,都会通知这里注册到的 watcher
|
|
162
|
+
u(this, "registerWatchers", []);
|
|
163
|
+
// 所有 form item 内部 errors, validating, touched 状态的变化,都会通知这里注册到的 watcher
|
|
164
|
+
// TODO: 合并 registerWatchers
|
|
165
|
+
u(this, "registerStateWatchers", []);
|
|
166
|
+
// 所有 form 整体 的变动,都会通知这里注册到的 watcher
|
|
167
|
+
u(this, "registerFormWatchers", []);
|
|
168
|
+
// 和formControl 的 touched属性不一样。 只要被改过的字段,这里就会存储。并且不会跟随formControl被卸载而清除。
|
|
169
|
+
// reset 的时候清除
|
|
170
|
+
u(this, "touchedFields", {});
|
|
171
|
+
u(this, "store", {});
|
|
172
|
+
u(this, "initialValues", {});
|
|
173
|
+
u(this, "callbacks", {});
|
|
174
|
+
// 告知 form 状态改变,进行状态收集
|
|
175
|
+
u(this, "innerCollectFormState", () => {
|
|
176
|
+
this.notifyStateWatchers();
|
|
177
|
+
});
|
|
178
|
+
u(this, "innerSetCallbacks", (e) => {
|
|
179
|
+
this.callbacks = e;
|
|
180
|
+
});
|
|
181
|
+
u(this, "registerFormWatcher", (e) => (this.registerFormWatchers.push(e), () => {
|
|
182
|
+
this.registerFormWatchers = this.registerFormWatchers.filter(
|
|
183
|
+
(t) => t !== e
|
|
184
|
+
);
|
|
185
|
+
}));
|
|
186
|
+
u(this, "registerStateWatcher", (e) => (this.registerStateWatchers.push(e), () => {
|
|
187
|
+
this.registerStateWatchers = this.registerStateWatchers.filter(
|
|
188
|
+
(t) => t !== e
|
|
189
|
+
);
|
|
190
|
+
}));
|
|
191
|
+
u(this, "registerWatcher", (e) => (this.registerWatchers.push(e), () => {
|
|
192
|
+
this.registerWatchers = this.registerWatchers.filter((t) => t !== e);
|
|
193
|
+
}));
|
|
194
|
+
// 收集所有control字段,并在组件卸载时移除
|
|
195
|
+
u(this, "registerField", (e) => (this.registerFields.push(e), this.notifyWatchers(), () => {
|
|
196
|
+
this.registerFields = this.registerFields.filter((t) => t !== e), this.notifyWatchers();
|
|
197
|
+
}));
|
|
198
|
+
// hasField为true时,只返回传入field属性的control实例
|
|
199
|
+
// isFormList 目前只在校验时需要包含
|
|
200
|
+
// TODO formlist 实现缺陷,待优化
|
|
201
|
+
u(this, "getRegisteredFields", (e, t) => e ? this.registerFields.filter(
|
|
202
|
+
(r) => {
|
|
203
|
+
var i;
|
|
204
|
+
return r.hasFieldProps() && ((t == null ? void 0 : t.containFormList) || !((i = r.props) != null && i.isFormList));
|
|
205
|
+
}
|
|
206
|
+
) : this.registerFields);
|
|
207
|
+
// 获取props.field === field 的control组件。
|
|
208
|
+
u(this, "getRegisteredField", (e) => this.registerFields.filter((t) => t.props.field === e)[0]);
|
|
209
|
+
// 通知所有的FormItem进行更新。
|
|
210
|
+
// setFieldValue: 外部调用setFieldsValue (setFieldValue等)方法触发更新
|
|
211
|
+
// innerSetValue: 控件例如Input,通过onChange事件触发的更新
|
|
212
|
+
// reset:重置
|
|
213
|
+
u(this, "notify", (e, t) => {
|
|
214
|
+
(e === "setFieldValue" || e === "innerSetValue" && !t.ignore) && this._pushTouchField(
|
|
215
|
+
t.changeValues ? $e(t.changeValues) : this._getIterativelyKeysByField(t.field)
|
|
216
|
+
), this.registerFields.forEach((r) => {
|
|
217
|
+
var i;
|
|
218
|
+
(i = r == null ? void 0 : r.onStoreChange) == null || i.call(r, e, {
|
|
219
|
+
...t,
|
|
220
|
+
current: this.store
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
u(this, "innerSetInitialValues", (e) => {
|
|
225
|
+
e && (this.initialValues = Pe(this.initialValues, Z(e)), Object.keys(e).forEach((t) => {
|
|
226
|
+
P(this.store, t, e[t]);
|
|
227
|
+
}));
|
|
228
|
+
});
|
|
229
|
+
u(this, "innerSetInitialValue", (e, t) => {
|
|
230
|
+
e && (this.initialValues[e] = t, this._inTouchFields(e) || P(this.store, e, W(this.initialValues, e)));
|
|
231
|
+
});
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
* 内部使用,更新value,会同时触发onChange 和 onValuesChange
|
|
235
|
+
* @options.isFormList 强制更新field对应的组件包括其子组件,form
|
|
236
|
+
*/
|
|
237
|
+
u(this, "innerSetFieldValue", (e, t, r) => {
|
|
238
|
+
if (!e)
|
|
239
|
+
return;
|
|
240
|
+
const i = this.getFields();
|
|
241
|
+
P(this.store, e, t), this.triggerValuesChange({
|
|
242
|
+
[e]: t
|
|
243
|
+
}), this.triggerTouchChange({ [e]: t }), this.notify("innerSetValue", {
|
|
244
|
+
prev: i,
|
|
245
|
+
field: e,
|
|
246
|
+
...r,
|
|
247
|
+
changeValues: { [e]: t }
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
// 内部使用
|
|
251
|
+
u(this, "innerGetStore", () => this.store);
|
|
252
|
+
// 目前返回提交状态,后续统一维护 errors,warnings 后,这里可进行拓展
|
|
253
|
+
u(this, "innerGetStoreStatus", () => ({
|
|
254
|
+
submitStatus: this.submitStatus
|
|
255
|
+
}));
|
|
256
|
+
// 内部使用,返回原始对象,注入到组件的 value 都从这里获取值,cloneDeep 后的值每次引用地址是不同的
|
|
257
|
+
u(this, "innerGetFieldValue", (e) => W(this.store, e));
|
|
258
|
+
// 获取所有被操作过的字段
|
|
259
|
+
u(this, "getTouchedFields", () => this.getRegisteredFields(!0).filter((e) => e.isTouched()).map((e) => e.props.field));
|
|
260
|
+
// 外部调用设置表单字段值
|
|
261
|
+
u(this, "setFieldValue", (e, t) => {
|
|
262
|
+
e && this.setFields({
|
|
263
|
+
[e]: { value: t }
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
// 外部调用,设置多个表单控件的值
|
|
267
|
+
u(this, "setFieldsValue", (e) => {
|
|
268
|
+
if (M(e)) {
|
|
269
|
+
const t = Object.keys(e), r = {};
|
|
270
|
+
t.forEach((i) => {
|
|
271
|
+
r[i] = {
|
|
272
|
+
value: e[i]
|
|
273
|
+
};
|
|
274
|
+
}), this.setFields(r);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
// 外部调用,设置多个表单控件的值,以及 error,touch 信息。
|
|
278
|
+
u(this, "setFields", (e) => {
|
|
279
|
+
const t = Object.keys(e), r = {};
|
|
280
|
+
t.forEach((i) => {
|
|
281
|
+
const l = e[i], n = this.getFields();
|
|
282
|
+
if (l) {
|
|
283
|
+
const o = {};
|
|
284
|
+
"error" in l && (o.errors = l.error), "warning" in l && (o.warnings = l.warning), "touched" in l && (o.touched = l.touched), "value" in l && (P(this.store, i, l.value), r[i] = l.value), this.notify("setFieldValue", {
|
|
285
|
+
data: o,
|
|
286
|
+
prev: n,
|
|
287
|
+
field: i,
|
|
288
|
+
changeValues: { [i]: l.value }
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}), this.triggerValuesChange(r);
|
|
292
|
+
});
|
|
293
|
+
u(this, "getFieldValue", (e) => Z(W(this.store, e)));
|
|
294
|
+
// 获取单个字段的错误信息。
|
|
295
|
+
u(this, "getFieldError", (e) => {
|
|
296
|
+
const t = this.getRegisteredField(e);
|
|
297
|
+
return t ? t.getErrors() : null;
|
|
298
|
+
});
|
|
299
|
+
// 获取传入字段/全部的错误信息
|
|
300
|
+
u(this, "getFieldsError", (e) => {
|
|
301
|
+
const t = {};
|
|
302
|
+
return E(e) ? e.map((r) => {
|
|
303
|
+
const i = this.getFieldError(r);
|
|
304
|
+
i && (t[r] = i);
|
|
305
|
+
}) : this.getRegisteredFields(!0, { containFormList: !0 }).forEach(
|
|
306
|
+
(r) => {
|
|
307
|
+
r.getErrors() && (t[r.props.field] = r.getErrors());
|
|
308
|
+
}
|
|
309
|
+
), t;
|
|
310
|
+
});
|
|
311
|
+
u(this, "getFields", () => Z(this.store));
|
|
312
|
+
u(this, "getFieldsValue", (e) => {
|
|
313
|
+
const t = {};
|
|
314
|
+
return E(e) ? (e.forEach((r) => {
|
|
315
|
+
P(t, r, this.getFieldValue(r));
|
|
316
|
+
}), t) : (this.getRegisteredFields(!0).forEach(({ props: { field: r } }) => {
|
|
317
|
+
const i = W(this.store, r);
|
|
318
|
+
P(t, r, i);
|
|
319
|
+
}), t);
|
|
320
|
+
});
|
|
321
|
+
u(this, "getInitialValues", () => this.initialValues);
|
|
322
|
+
u(this, "setInitialValues", (e) => {
|
|
323
|
+
this.innerSetInitialValues(e), this.setFieldsValue(e);
|
|
324
|
+
});
|
|
325
|
+
u(this, "setInitialValue", (e, t) => {
|
|
326
|
+
this.innerSetInitialValue(e, t), this.setFieldValue(e, t);
|
|
327
|
+
});
|
|
328
|
+
u(this, "resetFields", (e) => {
|
|
329
|
+
const t = this.getFields(), r = Te(e) && !E(e) ? [e] : e;
|
|
330
|
+
let i = {};
|
|
331
|
+
if (r && E(r))
|
|
332
|
+
r.forEach((n) => {
|
|
333
|
+
P(
|
|
334
|
+
this.store,
|
|
335
|
+
n,
|
|
336
|
+
this.initialValues[n]
|
|
337
|
+
), i[n] = W(this.store, n);
|
|
338
|
+
}), this.triggerValuesChange(i), this.notify("reset", { prev: t, field: r }), this._popTouchField(r);
|
|
339
|
+
else {
|
|
340
|
+
const n = {};
|
|
341
|
+
i = this.getFields(), Object.keys(this.initialValues).forEach((o) => {
|
|
342
|
+
P(n, o, this.initialValues[o]);
|
|
343
|
+
}), this.store = n, this.getRegisteredFields(!0).forEach((o) => {
|
|
344
|
+
const c = o.props.field;
|
|
345
|
+
P(i, c, W(this.store, c));
|
|
346
|
+
}), this.triggerValuesChange(i), this._popTouchField(), this.notify("reset", {
|
|
347
|
+
prev: t,
|
|
348
|
+
field: Object.keys(i)
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
const { onReset: l } = this.callbacks;
|
|
352
|
+
l == null || l(i);
|
|
353
|
+
});
|
|
354
|
+
u(this, "validate", bt(
|
|
355
|
+
(e, t, r) => {
|
|
356
|
+
const i = this.getRegisteredFields(!0, {
|
|
357
|
+
containFormList: !0
|
|
358
|
+
}), l = E(e) && e.length ? i.filter(
|
|
359
|
+
(a) => e.indexOf(a.props.field) > -1
|
|
360
|
+
) : i, n = M(e) ? e : M(t) ? t : {}, o = O(e) ? e : O(t) ? t : r || (() => {
|
|
361
|
+
}), c = l.map(
|
|
362
|
+
(a) => n != null && n.validateOnly ? a.validateFieldOnly() : a.validateField()
|
|
363
|
+
), h = (a) => {
|
|
364
|
+
if (!(n != null && n.validateOnly)) {
|
|
365
|
+
const { onValidateFail: d } = this.callbacks;
|
|
366
|
+
d == null || d(a);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
Promise.all(c).then((a) => {
|
|
370
|
+
let d = {};
|
|
371
|
+
const m = {};
|
|
372
|
+
a.map((V) => {
|
|
373
|
+
var S;
|
|
374
|
+
V.error && (d = { ...d, ...V.error });
|
|
375
|
+
const g = this.getRegisteredField(V.field);
|
|
376
|
+
(S = g == null ? void 0 : g.props) != null && S.isFormList || P(m, V.field, V.value);
|
|
377
|
+
});
|
|
378
|
+
let F;
|
|
379
|
+
return Object.keys(d).length ? (h == null || h(d), F = o == null ? void 0 : o(d, Z(m))) : F = o == null ? void 0 : o(null, Z(m)), F;
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
));
|
|
383
|
+
u(this, "toggleSubmitStatus", (e) => {
|
|
384
|
+
this.submitStatus = e, this.innerCollectFormState(), this.notifyFormWatcher();
|
|
385
|
+
});
|
|
386
|
+
u(this, "submit", () => (this.toggleSubmitStatus(D.submitting), this.validate((e, t) => {
|
|
387
|
+
let r;
|
|
388
|
+
const { onSubmit: i, onSubmitFailed: l } = this.callbacks;
|
|
389
|
+
!e && i && (r = i(t)), e && l && (r = l(e)), r && r.then ? r.then((n) => (this.toggleSubmitStatus(D.success), n)).catch((n) => (this.toggleSubmitStatus(D.error), Promise.reject(n))) : this.toggleSubmitStatus(
|
|
390
|
+
e ? D.error : D.success
|
|
391
|
+
);
|
|
392
|
+
})));
|
|
393
|
+
u(this, "getFieldsState", (e) => {
|
|
394
|
+
const t = {}, r = (i) => {
|
|
395
|
+
if (!i)
|
|
396
|
+
return null;
|
|
397
|
+
const l = i.getErrors();
|
|
398
|
+
return {
|
|
399
|
+
errors: l ? [l] : [],
|
|
400
|
+
warnings: i.getWarnings(),
|
|
401
|
+
validateStatus: i.getValidateStatus(),
|
|
402
|
+
isSubmitting: this.submitStatus === D.submitting,
|
|
403
|
+
isTouched: i.isTouched(),
|
|
404
|
+
value: this.getFieldValue(i.props.field)
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
return E(e) ? (e.forEach((i) => {
|
|
408
|
+
t[i] = r(this.getRegisteredField(i));
|
|
409
|
+
}), t) : (this.getRegisteredFields(!0).forEach((i) => {
|
|
410
|
+
t[i.props.field] = r(i);
|
|
411
|
+
}), t);
|
|
412
|
+
});
|
|
413
|
+
u(this, "clearFields", (e) => {
|
|
414
|
+
const t = this.getFields(), r = Te(e) && !E(e) ? [e] : e;
|
|
415
|
+
if (r && E(r)) {
|
|
416
|
+
const i = {};
|
|
417
|
+
r.forEach((l) => {
|
|
418
|
+
P(this.store, l, void 0), i[l] = W(this.store, l);
|
|
419
|
+
}), this.triggerValuesChange(i), this.notify("setFieldValue", {
|
|
420
|
+
prev: t,
|
|
421
|
+
field: r,
|
|
422
|
+
data: {
|
|
423
|
+
errors: null,
|
|
424
|
+
warnings: null
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
} else {
|
|
428
|
+
const i = {};
|
|
429
|
+
this.store = {}, this.getRegisteredFields(!0).forEach((l) => {
|
|
430
|
+
const n = l.props.field;
|
|
431
|
+
P(i, n, void 0);
|
|
432
|
+
}), this.triggerValuesChange(i), this.notify("setFieldValue", {
|
|
433
|
+
prev: t,
|
|
434
|
+
field: Object.keys(i),
|
|
435
|
+
data: {
|
|
436
|
+
errors: null,
|
|
437
|
+
warnings: null
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
notifyWatchers() {
|
|
444
|
+
this.registerWatchers.forEach((e) => {
|
|
445
|
+
e();
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
// 注册监听全局状态的 watcher
|
|
449
|
+
notifyFormWatcher() {
|
|
450
|
+
this.registerFormWatchers.forEach((e) => {
|
|
451
|
+
e();
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
notifyStateWatchers() {
|
|
455
|
+
this.registerStateWatchers.forEach((e) => {
|
|
456
|
+
e();
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
triggerValuesChange(e) {
|
|
460
|
+
if (e && Object.keys(e).length) {
|
|
461
|
+
const { onValuesChange: t } = this.callbacks;
|
|
462
|
+
t == null || t(e, this.getFields());
|
|
463
|
+
}
|
|
464
|
+
this.notifyWatchers();
|
|
465
|
+
}
|
|
466
|
+
triggerTouchChange(e) {
|
|
467
|
+
if (e && Object.keys(e).length) {
|
|
468
|
+
const { onChange: t } = this.callbacks;
|
|
469
|
+
t == null || t(e, this.getFields());
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
_getIterativelyKeysByField(e) {
|
|
473
|
+
if (!e)
|
|
474
|
+
return [];
|
|
475
|
+
const r = [].concat(e).map((i) => $e(P({}, i, void 0))).reduce((i, l) => i.concat(l), []);
|
|
476
|
+
return [e, ...r];
|
|
477
|
+
}
|
|
478
|
+
_inTouchFields(e) {
|
|
479
|
+
return this._getIterativelyKeysByField(e).some((r) => Me(this.touchedFields, r));
|
|
480
|
+
}
|
|
481
|
+
_popTouchField(e) {
|
|
482
|
+
e === void 0 && (this.touchedFields = {});
|
|
483
|
+
const t = this._getIterativelyKeysByField(e);
|
|
484
|
+
this.touchedFields = nt(this.touchedFields, t);
|
|
485
|
+
}
|
|
486
|
+
_pushTouchField(e) {
|
|
487
|
+
[].concat(e).forEach((t) => {
|
|
488
|
+
_e(this.touchedFields, t, void 0, Object);
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function Ct() {
|
|
493
|
+
const s = new yt();
|
|
494
|
+
return {
|
|
495
|
+
getFieldsValue: s.getFieldsValue,
|
|
496
|
+
getFieldValue: s.getFieldValue,
|
|
497
|
+
getFieldError: s.getFieldError,
|
|
498
|
+
getFieldsError: s.getFieldsError,
|
|
499
|
+
getTouchedFields: s.getTouchedFields,
|
|
500
|
+
getFields: s.getFields,
|
|
501
|
+
getInitialValues: s.getInitialValues,
|
|
502
|
+
setInitialValues: s.setInitialValues,
|
|
503
|
+
setInitialValue: s.setInitialValue,
|
|
504
|
+
setFieldValue: s.setFieldValue,
|
|
505
|
+
setFieldsValue: s.setFieldsValue,
|
|
506
|
+
setFields: s.setFields,
|
|
507
|
+
resetFields: s.resetFields,
|
|
508
|
+
clearFields: s.clearFields,
|
|
509
|
+
submit: s.submit,
|
|
510
|
+
validate: s.validate,
|
|
511
|
+
scrollToField: () => {
|
|
512
|
+
},
|
|
513
|
+
getFieldsState: s.getFieldsState,
|
|
514
|
+
getInnerMethods: (e) => {
|
|
515
|
+
const t = {};
|
|
516
|
+
return e && [
|
|
517
|
+
"registerField",
|
|
518
|
+
"registerWatcher",
|
|
519
|
+
"registerStateWatcher",
|
|
520
|
+
"registerFormWatcher",
|
|
521
|
+
"innerSetInitialValues",
|
|
522
|
+
"innerSetInitialValue",
|
|
523
|
+
"innerSetCallbacks",
|
|
524
|
+
"innerSetFieldValue",
|
|
525
|
+
"innerGetStore",
|
|
526
|
+
"innerGetStoreStatus",
|
|
527
|
+
"innerGetFieldValue",
|
|
528
|
+
"innerCollectFormState"
|
|
529
|
+
].map((r) => {
|
|
530
|
+
t[r] = s[r];
|
|
531
|
+
}), t;
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
function qe(s) {
|
|
536
|
+
const e = U(s);
|
|
537
|
+
return e.current || (s ? e.current = s : e.current = Ct()), [e.current];
|
|
538
|
+
}
|
|
539
|
+
function ge(s, e) {
|
|
540
|
+
const t = e.replace(/[[.]/g, "_").replace(/\]/g, "");
|
|
541
|
+
return s ? `${s}-${t}` : `${t}`;
|
|
542
|
+
}
|
|
543
|
+
const It = {
|
|
544
|
+
layout: "horizontal",
|
|
545
|
+
labelCol: { span: 5, offset: 0 },
|
|
546
|
+
labelAlign: "right",
|
|
547
|
+
wrapperCol: { span: 19, offset: 0 },
|
|
548
|
+
requiredSymbol: !0,
|
|
549
|
+
wrapper: "form",
|
|
550
|
+
validateTrigger: "onChange"
|
|
551
|
+
}, wt = (s, e) => {
|
|
552
|
+
var te, J;
|
|
553
|
+
const t = L(Se), r = L(Oe), i = U(null), [l] = qe(
|
|
554
|
+
s.form
|
|
555
|
+
), n = it(
|
|
556
|
+
s,
|
|
557
|
+
It,
|
|
558
|
+
(te = t.componentConfig) == null ? void 0 : te.Form
|
|
559
|
+
), {
|
|
560
|
+
layout: o,
|
|
561
|
+
labelCol: c,
|
|
562
|
+
wrapperCol: h,
|
|
563
|
+
wrapper: a,
|
|
564
|
+
id: d,
|
|
565
|
+
requiredSymbol: m,
|
|
566
|
+
labelAlign: F,
|
|
567
|
+
disabled: V,
|
|
568
|
+
colon: g,
|
|
569
|
+
className: S,
|
|
570
|
+
validateTrigger: v,
|
|
571
|
+
prefixCls: I,
|
|
572
|
+
validateMessages: w,
|
|
573
|
+
...T
|
|
574
|
+
} = n, N = I || t.getPrefixCls("form"), ce = t.rtl, z = "size" in n ? n.size : t.size, ie = l.getInnerMethods(!0);
|
|
575
|
+
st(() => {
|
|
576
|
+
ie.innerSetInitialValues(n.initialValues);
|
|
577
|
+
}), se(() => {
|
|
578
|
+
let p;
|
|
579
|
+
return r.register && (p = r.register(n.id, l)), p;
|
|
580
|
+
}, [n.id, l]), Ke(e, () => l), l.scrollToField = (p, x) => {
|
|
581
|
+
const $ = i.current, k = n.id;
|
|
582
|
+
if (!$)
|
|
583
|
+
return;
|
|
584
|
+
let Q = $.querySelector(
|
|
585
|
+
`#${ge(k, p)}`
|
|
586
|
+
);
|
|
587
|
+
Q || (Q = $.querySelector(
|
|
588
|
+
`#${ge(k, p)}${Ve}`
|
|
589
|
+
)), Q && Ye(Q, {
|
|
590
|
+
behavior: "smooth",
|
|
591
|
+
block: "nearest",
|
|
592
|
+
scrollMode: "if-needed",
|
|
593
|
+
...x
|
|
594
|
+
});
|
|
595
|
+
}, ie.innerSetCallbacks({
|
|
596
|
+
onValuesChange: (p, x) => {
|
|
597
|
+
var $, k;
|
|
598
|
+
($ = n.onValuesChange) == null || $.call(n, p, x), (k = r.onFormValuesChange) == null || k.call(r, n.id, p);
|
|
599
|
+
},
|
|
600
|
+
onChange: n.onChange,
|
|
601
|
+
onValidateFail: (p) => {
|
|
602
|
+
if (n.scrollToFirstError) {
|
|
603
|
+
const x = M(n.scrollToFirstError) ? n.scrollToFirstError : {};
|
|
604
|
+
l.scrollToField(
|
|
605
|
+
Object.keys(p)[0],
|
|
606
|
+
x
|
|
607
|
+
);
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
onSubmitFailed: n.onSubmitFailed,
|
|
611
|
+
onSubmit: (p) => {
|
|
612
|
+
var $, k;
|
|
613
|
+
const x = ($ = n.onSubmit) == null ? void 0 : $.call(n, p);
|
|
614
|
+
return (k = r.onFormSubmit) == null || k.call(r, n.id, p), x;
|
|
615
|
+
},
|
|
616
|
+
onReset: (p) => {
|
|
617
|
+
var $, k;
|
|
618
|
+
const x = ($ = n.onReset) == null ? void 0 : $.call(n, p);
|
|
619
|
+
return (k = r == null ? void 0 : r.onFormReset) == null || k.call(r, n.id, p), x;
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
const ue = {
|
|
623
|
+
requiredSymbol: m,
|
|
624
|
+
labelAlign: F,
|
|
625
|
+
disabled: V,
|
|
626
|
+
colon: g,
|
|
627
|
+
labelCol: c,
|
|
628
|
+
wrapperCol: h,
|
|
629
|
+
layout: o,
|
|
630
|
+
store: l,
|
|
631
|
+
prefixCls: N,
|
|
632
|
+
validateTrigger: v,
|
|
633
|
+
validateMessages: Pe(
|
|
634
|
+
{},
|
|
635
|
+
(J = t.locale.Form) == null ? void 0 : J.validateMessages,
|
|
636
|
+
w
|
|
637
|
+
),
|
|
638
|
+
getFormElementId: (p) => ge(d, p)
|
|
639
|
+
};
|
|
640
|
+
return /* @__PURE__ */ f(rt, { ...t, size: z, children: /* @__PURE__ */ f(H.Provider, { value: ue, children: /* @__PURE__ */ f(
|
|
641
|
+
a,
|
|
642
|
+
{
|
|
643
|
+
ref: i,
|
|
644
|
+
...xe(T, [
|
|
645
|
+
"form",
|
|
646
|
+
"size",
|
|
647
|
+
"initialValues",
|
|
648
|
+
"onValuesChange",
|
|
649
|
+
"onChange",
|
|
650
|
+
"wrapperProps",
|
|
651
|
+
"scrollToFirstError",
|
|
652
|
+
"onSubmit",
|
|
653
|
+
"onSubmitFailed",
|
|
654
|
+
"onReset"
|
|
655
|
+
]),
|
|
656
|
+
...n.wrapperProps,
|
|
657
|
+
className: j(
|
|
658
|
+
N,
|
|
659
|
+
`${N}-${o}`,
|
|
660
|
+
`${N}-size-${z}`,
|
|
661
|
+
{ [`${N}-rtl`]: ce },
|
|
662
|
+
S
|
|
663
|
+
),
|
|
664
|
+
style: n.style,
|
|
665
|
+
onSubmit: (p) => {
|
|
666
|
+
p.preventDefault(), p.stopPropagation(), l.submit();
|
|
667
|
+
},
|
|
668
|
+
onReset: (p) => {
|
|
669
|
+
p.preventDefault(), p.stopPropagation(), l.resetFields();
|
|
670
|
+
},
|
|
671
|
+
id: d,
|
|
672
|
+
children: n.children
|
|
673
|
+
}
|
|
674
|
+
) }) });
|
|
675
|
+
}, ze = pe(wt);
|
|
676
|
+
ze.displayName = "Form";
|
|
677
|
+
class G extends et {
|
|
678
|
+
constructor(t, r) {
|
|
679
|
+
var i, l;
|
|
680
|
+
super(t);
|
|
681
|
+
u(this, "context");
|
|
682
|
+
// 校验信息
|
|
683
|
+
u(this, "errors", null);
|
|
684
|
+
// 校验 warning 信息
|
|
685
|
+
u(this, "warnings", null);
|
|
686
|
+
// undefined => validating => success / error => (validating or undefined)
|
|
687
|
+
u(this, "validateStatus");
|
|
688
|
+
// 是否被用户操作过
|
|
689
|
+
u(this, "touched");
|
|
690
|
+
u(this, "isDestroyed", !1);
|
|
691
|
+
// 保存 props.children 或函数类型 props.children() 的返回值
|
|
692
|
+
u(this, "childrenElement", null);
|
|
693
|
+
u(this, "removeRegisterField");
|
|
694
|
+
// 触发 store 进行状态收集
|
|
695
|
+
// TODO: error, validateStatus ,touched 状态和 UI 组件解耦,统一维护在 store 内部
|
|
696
|
+
u(this, "triggerStateCollect", () => {
|
|
697
|
+
const { innerCollectFormState: t } = this.context.store.getInnerMethods(!0);
|
|
698
|
+
t();
|
|
699
|
+
});
|
|
700
|
+
// 切换校验状态
|
|
701
|
+
u(this, "toggleValidateStatus", (t) => {
|
|
702
|
+
this.validateStatus = t, this.triggerStateCollect();
|
|
703
|
+
});
|
|
704
|
+
// 切换 touch 状态
|
|
705
|
+
u(this, "toggleTouched", (t) => {
|
|
706
|
+
this.touched = dt(t) ? t : !this.touched, this.triggerStateCollect();
|
|
707
|
+
});
|
|
708
|
+
u(this, "setWarnings", (t) => {
|
|
709
|
+
this.warnings = t, this.triggerStateCollect();
|
|
710
|
+
});
|
|
711
|
+
u(this, "setErrors", (t) => {
|
|
712
|
+
this.errors = t, this.triggerStateCollect();
|
|
713
|
+
});
|
|
714
|
+
u(this, "getErrors", () => this.errors);
|
|
715
|
+
u(this, "getWarnings", () => this.warnings || []);
|
|
716
|
+
u(this, "isTouched", () => this.touched);
|
|
717
|
+
u(this, "getValidateStatus", () => this.props.validateStatus ? this.props.validateStatus : this.validateStatus);
|
|
718
|
+
u(this, "hasFieldProps", () => !!this.props.field);
|
|
719
|
+
u(this, "clearFormItemError", (t = this.props.field) => {
|
|
720
|
+
const { updateFormItem: r } = this.context;
|
|
721
|
+
r == null || r(t, { errors: null, warnings: null });
|
|
722
|
+
});
|
|
723
|
+
u(this, "updateFormItem", () => {
|
|
724
|
+
if (this.isDestroyed)
|
|
725
|
+
return;
|
|
726
|
+
this.forceUpdate();
|
|
727
|
+
const { updateFormItem: t } = this.context;
|
|
728
|
+
t == null || t(this.props.field, {
|
|
729
|
+
errors: this.errors,
|
|
730
|
+
warnings: this.warnings
|
|
731
|
+
});
|
|
732
|
+
});
|
|
733
|
+
u(this, "getFieldValue", () => {
|
|
734
|
+
const t = this.props.field, r = this.context.store;
|
|
735
|
+
return t ? r.getInnerMethods(!0).innerGetFieldValue(t) : void 0;
|
|
736
|
+
});
|
|
737
|
+
u(this, "onStoreChange", (t, r) => {
|
|
738
|
+
const i = E(r.field) ? r.field : [r.field], { field: l, shouldUpdate: n, dependencies: o } = this.props, c = (h) => {
|
|
739
|
+
if (o && n && ee(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), o)
|
|
740
|
+
(E(o) || o.some(
|
|
741
|
+
(a) => ne(a, i)
|
|
742
|
+
)) && this.isTouched() && this.validateField();
|
|
743
|
+
else if (n) {
|
|
744
|
+
let a = !1;
|
|
745
|
+
O(n) ? a = n(r.prev, r.current, {
|
|
746
|
+
field: r.field,
|
|
747
|
+
...h
|
|
748
|
+
}) : a = !Fe(r.prev, r.current), a && this.updateFormItem();
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
switch (t) {
|
|
752
|
+
case "reset":
|
|
753
|
+
this.toggleTouched(!1), this.toggleValidateStatus(void 0), this.setErrors(null), this.setWarnings(null), o || n ? c() : this.updateFormItem();
|
|
754
|
+
break;
|
|
755
|
+
case "innerSetValue":
|
|
756
|
+
if (ne(l, i)) {
|
|
757
|
+
this.toggleTouched(!0), this.updateFormItem();
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
c({
|
|
761
|
+
isInner: !0,
|
|
762
|
+
isFormList: r.isFormList
|
|
763
|
+
});
|
|
764
|
+
break;
|
|
765
|
+
case "setFieldValue":
|
|
766
|
+
if (ne(l, i)) {
|
|
767
|
+
this.toggleTouched(!0), r.data && "touched" in r.data && this.toggleTouched(r.data.touched), r.data && "warnings" in r.data && this.setWarnings(
|
|
768
|
+
ht(r.data.warnings) ? [] : [].concat(r.data.warnings)
|
|
769
|
+
), r.data && "errors" in r.data ? this.setErrors(r.data.errors) : Fe(W(r.prev, l), W(r.current, l)) || this.setErrors(null), this.updateFormItem();
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
c();
|
|
773
|
+
break;
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
u(this, "innerSetFieldValue", (t, r) => {
|
|
777
|
+
var o, c;
|
|
778
|
+
if (!t)
|
|
779
|
+
return;
|
|
780
|
+
const { store: i } = this.context;
|
|
781
|
+
i.getInnerMethods(!0).innerSetFieldValue(t, r);
|
|
782
|
+
const n = {};
|
|
783
|
+
Ue(n, t, r), (c = (o = this.props) == null ? void 0 : o.onValuesChange) == null || c.call(o, n, {
|
|
784
|
+
...i.getFieldsValue()
|
|
785
|
+
});
|
|
786
|
+
});
|
|
787
|
+
// 仅仅校验下值,不做任何状态变更
|
|
788
|
+
u(this, "validateFieldOnly", () => {
|
|
789
|
+
const { validateMessages: t } = this.context, { field: r, rules: i } = this.props, l = this.getFieldValue();
|
|
790
|
+
return ke(r, l, i, t).then(
|
|
791
|
+
({ error: n, warning: o }) => Promise.resolve({ error: n, value: l, warning: o, field: r })
|
|
792
|
+
);
|
|
793
|
+
});
|
|
794
|
+
/**
|
|
795
|
+
*
|
|
796
|
+
* @param triggerType the value of validateTrigger.
|
|
797
|
+
* @returns
|
|
798
|
+
*/
|
|
799
|
+
u(this, "validateField", (t) => {
|
|
800
|
+
const { validateTrigger: r, validateMessages: i } = this.context, { field: l, rules: n, validateTrigger: o } = this.props, c = this.getFieldValue(), h = () => {
|
|
801
|
+
var m;
|
|
802
|
+
const d = this.errors || ((m = this.warnings) == null ? void 0 : m.length);
|
|
803
|
+
this.toggleValidateStatus("validating"), this.setErrors(null), this.setWarnings(null), d && this.updateFormItem();
|
|
804
|
+
}, a = t ? (n || []).filter((d) => [].concat(
|
|
805
|
+
d.validateTrigger || o || r
|
|
806
|
+
).indexOf(t) > -1) : n;
|
|
807
|
+
return a && a.length && l ? (h(), ke(l, c, a, i).then(
|
|
808
|
+
({ error: d, warning: m }) => {
|
|
809
|
+
var F;
|
|
810
|
+
return this.setErrors(d ? d[l] : null), this.setWarnings(m || null), this.toggleValidateStatus(
|
|
811
|
+
this.errors ? "error" : (F = this.warnings) != null && F.length ? "warning" : "success"
|
|
812
|
+
), this.updateFormItem(), Promise.resolve({ error: d, value: c, field: l });
|
|
813
|
+
}
|
|
814
|
+
)) : (h(), Promise.resolve({ error: null, value: c, field: l }));
|
|
815
|
+
});
|
|
816
|
+
// 每次 render 都会作为 onChange 传递给 children,需要保证引用地址不变
|
|
817
|
+
// 所以 handleTrigger 需要声明在类上,并且直接作为 children.props.onChange
|
|
818
|
+
u(this, "handleTrigger", (t, ...r) => {
|
|
819
|
+
const i = this.childrenElement || this.props.children, { store: l } = this.context, { field: n, trigger: o, normalize: c, getValueFromEvent: h } = this.props, a = O(h) ? h(t, ...r) : t;
|
|
820
|
+
let d = a;
|
|
821
|
+
if (Ge(a)) {
|
|
822
|
+
ee(
|
|
823
|
+
!0,
|
|
824
|
+
"changed value missed, please check whether extra elements is outta input/select controled by Form.Item"
|
|
825
|
+
), a.stopPropagation();
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
typeof c == "function" && (d = c(a, l.getFieldValue(n), {
|
|
829
|
+
...l.getFieldsValue()
|
|
830
|
+
})), this.toggleTouched(!0), this.innerSetFieldValue(n, d), this.validateField(o), me(i) && i.props && i.props[o] && (this.props.isFormList || i.props[o](d, ...r));
|
|
831
|
+
});
|
|
832
|
+
u(this, "getChild", () => {
|
|
833
|
+
const { children: t } = this.props, { store: r } = this.context;
|
|
834
|
+
let i = t;
|
|
835
|
+
return O(t) && (i = t(
|
|
836
|
+
r.getFields(),
|
|
837
|
+
{
|
|
838
|
+
...r
|
|
839
|
+
},
|
|
840
|
+
this.props.isFormList && {
|
|
841
|
+
value: this.getFieldValue(),
|
|
842
|
+
onChange: this.handleTrigger
|
|
843
|
+
}
|
|
844
|
+
)), this.childrenElement = i, i;
|
|
845
|
+
});
|
|
846
|
+
"initialValue" in t && this.hasFieldProps() && ((l = (i = r == null ? void 0 : r.store) == null ? void 0 : i.setInitialValue) == null || l.call(i, t.field, t.initialValue));
|
|
847
|
+
}
|
|
848
|
+
componentDidMount() {
|
|
849
|
+
const { store: t } = this.context ?? {};
|
|
850
|
+
if (t) {
|
|
851
|
+
const r = t.getInnerMethods(!0);
|
|
852
|
+
this.removeRegisterField = r.registerField(this);
|
|
853
|
+
}
|
|
854
|
+
this.isDestroyed = !1;
|
|
855
|
+
}
|
|
856
|
+
componentDidUpdate(t) {
|
|
857
|
+
(t.field !== this.props.field && this.props._key && t._key === this.props._key || /* 以下条件判断潘启宝添加于 2023年10月23日 星期一 13时10分43秒 CST */
|
|
858
|
+
this.props.disabled !== t.disabled && this.props.disabled || this.props.rules !== t.rules && !this.props.rules) && (this.updateFormItem(), this.clearFormItemError(t.field));
|
|
859
|
+
}
|
|
860
|
+
componentWillUnmount() {
|
|
861
|
+
var t;
|
|
862
|
+
(t = this.removeRegisterField) == null || t.call(this), this.removeRegisterField = null, this.clearFormItemError(), this.isDestroyed = !0;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* 收集rules里的validateTrigger字段
|
|
866
|
+
*/
|
|
867
|
+
getValidateTrigger() {
|
|
868
|
+
const t = this.props.validateTrigger || this.context.validateTrigger || "onChange", r = this.props.rules || [];
|
|
869
|
+
let i = [];
|
|
870
|
+
return r.map((l) => {
|
|
871
|
+
i = i.concat(l.validateTrigger || t);
|
|
872
|
+
}), Array.from(new Set(i));
|
|
873
|
+
}
|
|
874
|
+
renderControl(t, r) {
|
|
875
|
+
var g;
|
|
876
|
+
const {
|
|
877
|
+
field: i,
|
|
878
|
+
trigger: l = "onChange",
|
|
879
|
+
triggerPropName: n = "value",
|
|
880
|
+
validateStatus: o,
|
|
881
|
+
formatter: c
|
|
882
|
+
} = this.props, { store: h, disabled: a } = this.context, d = "disabled" in this.props ? this.props.disabled : a, m = A.Children.only(t), F = {
|
|
883
|
+
// used by label
|
|
884
|
+
id: j(((g = m.props) == null ? void 0 : g.id) || { [`${r}${Ve}`]: r })
|
|
885
|
+
};
|
|
886
|
+
this.getValidateTrigger().forEach((S) => {
|
|
887
|
+
F[S] = (v) => {
|
|
888
|
+
var I, w;
|
|
889
|
+
this.validateField(S), (w = (I = m.props) == null ? void 0 : I[S]) == null || w.call(I, v);
|
|
890
|
+
};
|
|
891
|
+
}), F[l] = this.handleTrigger, d !== void 0 && !("disabled" in m.props) && (F.disabled = d);
|
|
892
|
+
let V = W(h.getInnerMethods(!0).innerGetStore(), i);
|
|
893
|
+
return O(c) && (V = c(V)), F[n] = V, !o && this.errors && (F.error = !0), A.cloneElement(m, F);
|
|
894
|
+
}
|
|
895
|
+
render() {
|
|
896
|
+
const { noStyle: t, field: r, isFormList: i, hasFeedback: l } = this.props, n = this.getValidateStatus(), { prefixCls: o, getFormElementId: c } = this.context;
|
|
897
|
+
let h = this.getChild();
|
|
898
|
+
const a = this.hasFieldProps() ? c == null ? void 0 : c(r) : void 0;
|
|
899
|
+
return this.hasFieldProps() && !i && A.Children.count(h) === 1 && (h = this.renderControl(h, a)), t ? h : /* @__PURE__ */ f("div", { className: `${o}-item-control-wrapper`, children: /* @__PURE__ */ f("div", { className: `${o}-item-control`, id: a, children: /* @__PURE__ */ B("div", { className: `${o}-item-control-children`, children: [
|
|
900
|
+
h,
|
|
901
|
+
n && l && /* @__PURE__ */ B(
|
|
902
|
+
"div",
|
|
903
|
+
{
|
|
904
|
+
className: `${o}-item-feedback ${o}-item-feedback-${n}`,
|
|
905
|
+
children: [
|
|
906
|
+
n === "warning" && /* @__PURE__ */ f(ct, {}),
|
|
907
|
+
n === "success" && /* @__PURE__ */ f(ot, {}),
|
|
908
|
+
n === "error" && /* @__PURE__ */ f(at, {}),
|
|
909
|
+
n === "validating" && /* @__PURE__ */ f(ut, {})
|
|
910
|
+
]
|
|
911
|
+
}
|
|
912
|
+
)
|
|
913
|
+
] }) }) });
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
u(G, "defaultProps", {
|
|
917
|
+
trigger: "onChange",
|
|
918
|
+
triggerPropName: "value"
|
|
919
|
+
}), u(G, "isFormControl", !0), u(G, "contextType", fe);
|
|
920
|
+
const Et = ({
|
|
921
|
+
prefixCls: s,
|
|
922
|
+
help: e,
|
|
923
|
+
errors: t = [],
|
|
924
|
+
warnings: r = []
|
|
925
|
+
}) => {
|
|
926
|
+
const i = L(H), { getPrefixCls: l } = L(Se), n = s || i.prefixCls || l("form"), o = t == null ? void 0 : t.map((d, m) => {
|
|
927
|
+
if (d)
|
|
928
|
+
return /* @__PURE__ */ f("div", { role: "alert", children: d.message }, m);
|
|
929
|
+
}), c = [];
|
|
930
|
+
r == null || r.map((d, m) => {
|
|
931
|
+
c.push(
|
|
932
|
+
/* @__PURE__ */ f(
|
|
933
|
+
"div",
|
|
934
|
+
{
|
|
935
|
+
role: "alert",
|
|
936
|
+
className: `${n}-message-help-warning`,
|
|
937
|
+
children: d
|
|
938
|
+
},
|
|
939
|
+
m
|
|
940
|
+
)
|
|
941
|
+
);
|
|
942
|
+
});
|
|
943
|
+
const h = !K(e) || !!c.length, a = h || !!o.length;
|
|
944
|
+
return a && /* @__PURE__ */ f(
|
|
945
|
+
mt,
|
|
946
|
+
{
|
|
947
|
+
in: a,
|
|
948
|
+
appear: !0,
|
|
949
|
+
classNames: "formblink",
|
|
950
|
+
timeout: 300,
|
|
951
|
+
unmountOnExit: !0,
|
|
952
|
+
children: /* @__PURE__ */ f(
|
|
953
|
+
"div",
|
|
954
|
+
{
|
|
955
|
+
className: j(`${n}-message`, {
|
|
956
|
+
[`${n}-message-help`]: h
|
|
957
|
+
}),
|
|
958
|
+
children: K(e) ? /* @__PURE__ */ B(Re, { children: [
|
|
959
|
+
o.length > 0 && o,
|
|
960
|
+
c.length > 0 && c
|
|
961
|
+
] }) : e
|
|
962
|
+
}
|
|
963
|
+
)
|
|
964
|
+
}
|
|
965
|
+
);
|
|
966
|
+
};
|
|
967
|
+
function Tt(s) {
|
|
968
|
+
return /* @__PURE__ */ f(
|
|
969
|
+
"svg",
|
|
970
|
+
{
|
|
971
|
+
width: "1em",
|
|
972
|
+
height: "1em",
|
|
973
|
+
"aria-hidden": !0,
|
|
974
|
+
focusable: !1,
|
|
975
|
+
fill: "currentColor",
|
|
976
|
+
stroke: "none",
|
|
977
|
+
viewBox: "0 0 48 48",
|
|
978
|
+
...s,
|
|
979
|
+
children: /* @__PURE__ */ f("path", { d: "M30.841,46.115l5.864,-2.824l-6.841,-14.205l15.371,3.508l1.449,-6.345l-15.372,-3.509l12.327,-9.83l-4.058,-5.088l-12.327,9.83l0,-15.767l-6.508,0l-0,15.767l-12.327,-9.83l-4.058,5.088l12.327,9.83l-15.372,3.509l1.449,6.345l15.371,-3.508l-6.841,14.205l5.864,2.824l6.841,-14.206l6.841,14.206Z" })
|
|
980
|
+
}
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
const $t = ({
|
|
984
|
+
htmlFor: s,
|
|
985
|
+
showColon: e,
|
|
986
|
+
label: t,
|
|
987
|
+
requiredSymbol: r,
|
|
988
|
+
required: i,
|
|
989
|
+
rules: l,
|
|
990
|
+
prefix: n,
|
|
991
|
+
tooltip: o
|
|
992
|
+
}) => {
|
|
993
|
+
const c = E(l) && l.some((m) => m && m.required), h = M(r) ? r.position : "end", a = (i || c) && !!r && /* @__PURE__ */ f("strong", { className: `${n}-form-item-symbol`, children: /* @__PURE__ */ f(Tt, {}) }), d = () => {
|
|
994
|
+
if (!o)
|
|
995
|
+
return null;
|
|
996
|
+
const m = `${n}-form-item-tooltip`;
|
|
997
|
+
let F = {}, V = /* @__PURE__ */ f(Ft, { className: m });
|
|
998
|
+
if (!M(o) || me(o))
|
|
999
|
+
F = {
|
|
1000
|
+
content: o
|
|
1001
|
+
};
|
|
1002
|
+
else {
|
|
1003
|
+
const { icon: g, ...S } = o;
|
|
1004
|
+
F = S, g && (V = me(g) ? A.cloneElement(g, {
|
|
1005
|
+
className: j(
|
|
1006
|
+
m,
|
|
1007
|
+
g.props.className
|
|
1008
|
+
)
|
|
1009
|
+
}) : g);
|
|
1010
|
+
}
|
|
1011
|
+
return /* @__PURE__ */ f(ft, { ...F, children: V });
|
|
1012
|
+
};
|
|
1013
|
+
return t ? /* @__PURE__ */ B("label", { htmlFor: s && `${s}${Ve}`, children: [
|
|
1014
|
+
h !== "end" && a,
|
|
1015
|
+
" ",
|
|
1016
|
+
t,
|
|
1017
|
+
d(),
|
|
1018
|
+
h === "end" && /* @__PURE__ */ B(Re, { children: [
|
|
1019
|
+
" ",
|
|
1020
|
+
a
|
|
1021
|
+
] }),
|
|
1022
|
+
e ? e === !0 ? ":" : e : ""
|
|
1023
|
+
] }) : null;
|
|
1024
|
+
}, kt = De.Row, We = De.Col, Wt = (s, e) => {
|
|
1025
|
+
var ve, ye, Ce;
|
|
1026
|
+
const { getPrefixCls: t, prefixCls: r } = L(Se), i = L(fe), l = L(je), [n, o] = le(null), [c, h] = le(null), a = L(H), d = a.prefixCls || t("form"), m = s.layout || a.layout, F = s.labelAlign || a.labelAlign, V = U(!1), g = "disabled" in s ? s.disabled : a.disabled, S = (R, C = {}) => {
|
|
1027
|
+
if (V.current)
|
|
1028
|
+
return;
|
|
1029
|
+
const { errors: re, warnings: X } = C || {};
|
|
1030
|
+
o((_) => {
|
|
1031
|
+
const y = { ..._ || {} };
|
|
1032
|
+
return re ? y[R] = re : delete y[R], y;
|
|
1033
|
+
}), h((_) => {
|
|
1034
|
+
const y = { ..._ || {} };
|
|
1035
|
+
return X && X.length ? y[R] = X : delete y[R], y;
|
|
1036
|
+
});
|
|
1037
|
+
}, v = gt(s.noStyle) && s.noStyle.showErrorTip && i.updateFormItem ? i.updateFormItem : S;
|
|
1038
|
+
se(() => (V.current = !1, () => {
|
|
1039
|
+
V.current = !0, o(null), h(null);
|
|
1040
|
+
}), []);
|
|
1041
|
+
const I = {
|
|
1042
|
+
...a,
|
|
1043
|
+
validateMessages: a.validateMessages && vt(a.validateMessages, {
|
|
1044
|
+
label: s.label
|
|
1045
|
+
}),
|
|
1046
|
+
prefixCls: d,
|
|
1047
|
+
updateFormItem: v,
|
|
1048
|
+
disabled: "disabled" in s ? s.disabled : a.disabled
|
|
1049
|
+
}, { label: w, extra: T, className: N, style: ce, validateStatus: z, hidden: ie, ...ue } = s, be = j(`${d}-label-item`, {
|
|
1050
|
+
[`${d}-label-item-left`]: F === "left"
|
|
1051
|
+
}), te = n ? Object.values(n) : [], J = c ? Object.values(c).reduce((R, C) => R.concat(C), []) : [], p = we(() => {
|
|
1052
|
+
if (z)
|
|
1053
|
+
return z;
|
|
1054
|
+
if (te.length)
|
|
1055
|
+
return he.error;
|
|
1056
|
+
if (J.length)
|
|
1057
|
+
return he.warning;
|
|
1058
|
+
}, [n, c, z]), x = we(() => !K(s.help) || J.length > 0, [s.help, c]), $ = j(
|
|
1059
|
+
`${d}-item`,
|
|
1060
|
+
{
|
|
1061
|
+
[`${d}-item-error`]: x || !z && p === he.error,
|
|
1062
|
+
[`${d}-item-status-${p}`]: p,
|
|
1063
|
+
[`${d}-item-has-help`]: x,
|
|
1064
|
+
[`${d}-item-hidden`]: ie,
|
|
1065
|
+
[`${d}-item-has-feedback`]: p && s.hasFeedback
|
|
1066
|
+
},
|
|
1067
|
+
`${d}-layout-${m}`,
|
|
1068
|
+
N
|
|
1069
|
+
), k = () => {
|
|
1070
|
+
var re, X;
|
|
1071
|
+
const { field: R, children: C } = s;
|
|
1072
|
+
if (O(C))
|
|
1073
|
+
return /* @__PURE__ */ f(
|
|
1074
|
+
G,
|
|
1075
|
+
{
|
|
1076
|
+
disabled: g,
|
|
1077
|
+
...s,
|
|
1078
|
+
...R ? { key: R, _key: R } : {},
|
|
1079
|
+
children: (..._) => C(
|
|
1080
|
+
..._
|
|
1081
|
+
)
|
|
1082
|
+
}
|
|
1083
|
+
);
|
|
1084
|
+
if (E(C)) {
|
|
1085
|
+
const _ = A.Children.map(C, (y, He) => {
|
|
1086
|
+
const Ie = M(y) && y.key || He, Je = M(y) && "disabled" in y.props, Qe = !K(g) && !Je ? { key: Ie, disabled: g } : { key: Ie };
|
|
1087
|
+
return M(y) ? Ee(y, Qe) : y;
|
|
1088
|
+
});
|
|
1089
|
+
return /* @__PURE__ */ f(G, { ...s, field: void 0, children: _ });
|
|
1090
|
+
}
|
|
1091
|
+
if (A.Children.count(C) == 1) {
|
|
1092
|
+
if (R) {
|
|
1093
|
+
const _ = ((re = l == null ? void 0 : l.getItemKey) == null ? void 0 : re.call(l, R)) || R;
|
|
1094
|
+
return /* @__PURE__ */ tt(G, { disabled: g, ...s, key: _, _key: _ }, C);
|
|
1095
|
+
}
|
|
1096
|
+
if (M(C)) {
|
|
1097
|
+
if ((X = C.type) != null && X.isFormControl)
|
|
1098
|
+
return C;
|
|
1099
|
+
const y = !("disabled" in C.props) && !K(g) ? { disabled: g } : null;
|
|
1100
|
+
return /* @__PURE__ */ f(G, { ...s, field: void 0, children: y ? Ee(C, y) : C });
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
return C;
|
|
1104
|
+
}, Q = fe, de = {
|
|
1105
|
+
...a
|
|
1106
|
+
};
|
|
1107
|
+
return s.noStyle || (de.wrapperCol = void 0, de.labelCol = void 0), /* @__PURE__ */ f(H.Provider, { value: de, children: /* @__PURE__ */ f(Q.Provider, { value: I, children: s.noStyle ? k() : /* @__PURE__ */ B(
|
|
1108
|
+
kt,
|
|
1109
|
+
{
|
|
1110
|
+
ref: e,
|
|
1111
|
+
...xe(ue, [
|
|
1112
|
+
"tooltip",
|
|
1113
|
+
"children",
|
|
1114
|
+
"prefixCls",
|
|
1115
|
+
"store",
|
|
1116
|
+
"initialValue",
|
|
1117
|
+
"field",
|
|
1118
|
+
"labelCol",
|
|
1119
|
+
"wrapperCol",
|
|
1120
|
+
"colon",
|
|
1121
|
+
"disabled",
|
|
1122
|
+
"rules",
|
|
1123
|
+
"trigger",
|
|
1124
|
+
"triggerPropName",
|
|
1125
|
+
"validateTrigger",
|
|
1126
|
+
"noStyle",
|
|
1127
|
+
"required",
|
|
1128
|
+
"hasFeedback",
|
|
1129
|
+
"help",
|
|
1130
|
+
"normalize",
|
|
1131
|
+
"formatter",
|
|
1132
|
+
"getValueFromEvent",
|
|
1133
|
+
"shouldUpdate",
|
|
1134
|
+
"field",
|
|
1135
|
+
"isInner",
|
|
1136
|
+
"labelAlign",
|
|
1137
|
+
"layout",
|
|
1138
|
+
"requiredSymbol",
|
|
1139
|
+
"isFormList"
|
|
1140
|
+
]),
|
|
1141
|
+
className: $,
|
|
1142
|
+
div: m !== "horizontal",
|
|
1143
|
+
style: ce,
|
|
1144
|
+
children: [
|
|
1145
|
+
w ? /* @__PURE__ */ f(
|
|
1146
|
+
We,
|
|
1147
|
+
{
|
|
1148
|
+
...s.labelCol || a.labelCol,
|
|
1149
|
+
className: j(
|
|
1150
|
+
be,
|
|
1151
|
+
(ve = s.labelCol) == null ? void 0 : ve.className,
|
|
1152
|
+
(ye = a.labelCol) == null ? void 0 : ye.className,
|
|
1153
|
+
{
|
|
1154
|
+
[`${d}-label-item-flex`]: !s.labelCol && !a.labelCol
|
|
1155
|
+
}
|
|
1156
|
+
),
|
|
1157
|
+
children: /* @__PURE__ */ f(
|
|
1158
|
+
$t,
|
|
1159
|
+
{
|
|
1160
|
+
tooltip: s.tooltip,
|
|
1161
|
+
htmlFor: s.field && ((Ce = a == null ? void 0 : a.getFormElementId) == null ? void 0 : Ce.call(a, s.field)),
|
|
1162
|
+
label: w,
|
|
1163
|
+
prefix: r,
|
|
1164
|
+
requiredSymbol: "requiredSymbol" in s ? s.requiredSymbol : a.requiredSymbol,
|
|
1165
|
+
required: s.required,
|
|
1166
|
+
rules: s.rules,
|
|
1167
|
+
showColon: "colon" in s ? s.colon : a.colon
|
|
1168
|
+
}
|
|
1169
|
+
)
|
|
1170
|
+
}
|
|
1171
|
+
) : null,
|
|
1172
|
+
/* @__PURE__ */ B(
|
|
1173
|
+
We,
|
|
1174
|
+
{
|
|
1175
|
+
className: j(`${d}-item-wrapper`, {
|
|
1176
|
+
[`${d}-item-wrapper-flex`]: !s.wrapperCol && !a.wrapperCol
|
|
1177
|
+
}),
|
|
1178
|
+
...s.wrapperCol || a.wrapperCol,
|
|
1179
|
+
children: [
|
|
1180
|
+
k(),
|
|
1181
|
+
/* @__PURE__ */ f(
|
|
1182
|
+
Et,
|
|
1183
|
+
{
|
|
1184
|
+
prefixCls: d,
|
|
1185
|
+
help: s.help,
|
|
1186
|
+
errors: te,
|
|
1187
|
+
warnings: J
|
|
1188
|
+
}
|
|
1189
|
+
),
|
|
1190
|
+
T && /* @__PURE__ */ f("div", { className: `${d}-extra`, children: T })
|
|
1191
|
+
]
|
|
1192
|
+
}
|
|
1193
|
+
)
|
|
1194
|
+
]
|
|
1195
|
+
}
|
|
1196
|
+
) }) });
|
|
1197
|
+
}, ae = pe(Wt);
|
|
1198
|
+
ae.defaultProps = {
|
|
1199
|
+
trigger: "onChange",
|
|
1200
|
+
triggerPropName: "value"
|
|
1201
|
+
};
|
|
1202
|
+
ae.displayName = "FormItem";
|
|
1203
|
+
const Ne = (s, e) => !K(s) && s >= 0 && s < e.length, Ae = (s) => {
|
|
1204
|
+
const { field: e, children: t, initialValue: r } = s, i = U({
|
|
1205
|
+
id: 0,
|
|
1206
|
+
keys: []
|
|
1207
|
+
}), l = "initialValue" in s ? { initialValue: r } : {}, n = i.current.keys;
|
|
1208
|
+
return /* @__PURE__ */ f(
|
|
1209
|
+
je.Provider,
|
|
1210
|
+
{
|
|
1211
|
+
value: {
|
|
1212
|
+
getItemKey: (o) => {
|
|
1213
|
+
const c = o == null ? void 0 : o.replace(/\[|\]/g, ".").split("."), h = c.indexOf(e), a = c[h + 1];
|
|
1214
|
+
return `${e}_${n.indexOf(a)}_${c.slice(h + 2).join("_")}`;
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
children: /* @__PURE__ */ f(
|
|
1218
|
+
ae,
|
|
1219
|
+
{
|
|
1220
|
+
field: e,
|
|
1221
|
+
...l,
|
|
1222
|
+
isFormList: !0,
|
|
1223
|
+
rules: s.rules,
|
|
1224
|
+
wrapperCol: { span: 24 },
|
|
1225
|
+
noStyle: "noStyle" in s ? s.noStyle : !s.rules,
|
|
1226
|
+
shouldUpdate: (o, c, h) => {
|
|
1227
|
+
var a, d;
|
|
1228
|
+
return !!(h && !h.isInner && ne(h.field, [e]) && ((a = W(o, e)) == null ? void 0 : a.length) !== ((d = W(c, e)) == null ? void 0 : d.length));
|
|
1229
|
+
},
|
|
1230
|
+
children: (o, c, { value: h, onChange: a }) => {
|
|
1231
|
+
const d = h || [], m = function(g, S) {
|
|
1232
|
+
var N;
|
|
1233
|
+
if (Ge(g)) {
|
|
1234
|
+
ee(
|
|
1235
|
+
!0,
|
|
1236
|
+
"Form.List: The event object cannot be used as a parameter of the add method"
|
|
1237
|
+
);
|
|
1238
|
+
return;
|
|
1239
|
+
}
|
|
1240
|
+
const v = ((N = c.getInnerMethods(!0)) == null ? void 0 : N.innerGetFieldValue(e)) || [], I = i.current.id;
|
|
1241
|
+
i.current.id += 1;
|
|
1242
|
+
const w = v || [];
|
|
1243
|
+
let T = w;
|
|
1244
|
+
S !== void 0 && S >= 0 && S <= w.length ? (n.splice(S, 0, I), T = [
|
|
1245
|
+
...w.slice(0, S),
|
|
1246
|
+
g,
|
|
1247
|
+
...w.slice(S)
|
|
1248
|
+
]) : (n.push(I), T = [...w, g]), a(T, {
|
|
1249
|
+
isFormList: !0,
|
|
1250
|
+
ignore: g === void 0
|
|
1251
|
+
});
|
|
1252
|
+
}, F = function(g) {
|
|
1253
|
+
var I;
|
|
1254
|
+
const v = (((I = c.getInnerMethods(!0)) == null ? void 0 : I.innerGetFieldValue(e)) || []).filter((w, T) => T !== g);
|
|
1255
|
+
n.splice(g, 1), a([...v], { isFormList: !0 });
|
|
1256
|
+
}, V = function(g, S) {
|
|
1257
|
+
var N;
|
|
1258
|
+
const v = ((N = c.getInnerMethods(!0)) == null ? void 0 : N.innerGetFieldValue(e)) || [];
|
|
1259
|
+
if (g === S || !Ne(g, v) || !Ne(S, v))
|
|
1260
|
+
return;
|
|
1261
|
+
const I = n[g];
|
|
1262
|
+
n.splice(g, 1), n.splice(S, 0, I);
|
|
1263
|
+
const w = v[g], T = [...v];
|
|
1264
|
+
T.splice(g, 1), T.splice(S, 0, w), a(T, { isFormList: !0 });
|
|
1265
|
+
};
|
|
1266
|
+
return O(t) && t(
|
|
1267
|
+
d.map((g, S) => {
|
|
1268
|
+
let v = n[S];
|
|
1269
|
+
return v === void 0 && (v = i.current.id, n.push(v), i.current.id += 1), {
|
|
1270
|
+
field: `${e}[${S}]`,
|
|
1271
|
+
key: v
|
|
1272
|
+
};
|
|
1273
|
+
}),
|
|
1274
|
+
{
|
|
1275
|
+
add: m,
|
|
1276
|
+
remove: F,
|
|
1277
|
+
move: V
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
}
|
|
1284
|
+
);
|
|
1285
|
+
};
|
|
1286
|
+
Ae.displayName = "FormList";
|
|
1287
|
+
const Nt = (s, e) => {
|
|
1288
|
+
const t = U({}), r = Y((o, c) => (o && (t.current[o] = c), () => {
|
|
1289
|
+
delete t.current[o];
|
|
1290
|
+
}), []), i = Y(
|
|
1291
|
+
(o, c) => {
|
|
1292
|
+
var h;
|
|
1293
|
+
(h = s.onFormSubmit) == null || h.call(s, o, c, {
|
|
1294
|
+
forms: t.current
|
|
1295
|
+
});
|
|
1296
|
+
},
|
|
1297
|
+
[s.onFormSubmit]
|
|
1298
|
+
), l = Y(
|
|
1299
|
+
(o, c) => {
|
|
1300
|
+
var h;
|
|
1301
|
+
(h = s.onFormReset) == null || h.call(s, o, c, {
|
|
1302
|
+
forms: t.current
|
|
1303
|
+
});
|
|
1304
|
+
},
|
|
1305
|
+
[s.onFormReset]
|
|
1306
|
+
), n = Y(
|
|
1307
|
+
(o, c) => {
|
|
1308
|
+
var h;
|
|
1309
|
+
(h = s.onFormValuesChange) == null || h.call(s, o, c, {
|
|
1310
|
+
forms: t.current
|
|
1311
|
+
});
|
|
1312
|
+
},
|
|
1313
|
+
[s.onFormValuesChange]
|
|
1314
|
+
);
|
|
1315
|
+
return /* @__PURE__ */ f(
|
|
1316
|
+
Oe.Provider,
|
|
1317
|
+
{
|
|
1318
|
+
value: {
|
|
1319
|
+
onFormValuesChange: n,
|
|
1320
|
+
onFormSubmit: i,
|
|
1321
|
+
onFormReset: l,
|
|
1322
|
+
register: r
|
|
1323
|
+
},
|
|
1324
|
+
children: s.children
|
|
1325
|
+
}
|
|
1326
|
+
);
|
|
1327
|
+
}, Be = pe(Nt);
|
|
1328
|
+
Be.displayName = "FormProvider";
|
|
1329
|
+
const Rt = () => {
|
|
1330
|
+
const s = L(H), e = s.store, t = U(!1), r = pt(), i = Y(() => {
|
|
1331
|
+
var o, c, h;
|
|
1332
|
+
const { submitStatus: l } = ((h = (c = (o = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : o.call(e, !0)) == null ? void 0 : c.innerGetStoreStatus) == null ? void 0 : h.call(c)) ?? {}, n = l === D.submitting;
|
|
1333
|
+
n !== t.current && (t.current = n, r());
|
|
1334
|
+
}, []);
|
|
1335
|
+
return se(() => {
|
|
1336
|
+
var c;
|
|
1337
|
+
if (!e) {
|
|
1338
|
+
ee(!0, "formInstance is not available");
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
const { registerFormWatcher: l } = ((c = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : c.call(e, !0)) ?? {}, n = () => i();
|
|
1342
|
+
n();
|
|
1343
|
+
const o = (l == null ? void 0 : l(n)) ?? {};
|
|
1344
|
+
return () => {
|
|
1345
|
+
o == null || o();
|
|
1346
|
+
};
|
|
1347
|
+
}, []), {
|
|
1348
|
+
form: e,
|
|
1349
|
+
disabled: s.disabled,
|
|
1350
|
+
isSubmitting: t.current
|
|
1351
|
+
};
|
|
1352
|
+
}, Pt = (s, e) => {
|
|
1353
|
+
const t = L(H), r = e || t.store, i = U(s);
|
|
1354
|
+
i.current = s;
|
|
1355
|
+
const l = Y(() => {
|
|
1356
|
+
const h = i.current, a = r.getFieldsState([h]);
|
|
1357
|
+
return a == null ? void 0 : a[h];
|
|
1358
|
+
}, []), [n, o] = le(l), c = U(n);
|
|
1359
|
+
return se(() => {
|
|
1360
|
+
var m;
|
|
1361
|
+
if (!r) {
|
|
1362
|
+
ee(!0, "formInstance is not available");
|
|
1363
|
+
return;
|
|
1364
|
+
}
|
|
1365
|
+
const { registerStateWatcher: h } = ((m = r == null ? void 0 : r.getInnerMethods) == null ? void 0 : m.call(r, !0)) ?? {}, a = () => {
|
|
1366
|
+
const F = l();
|
|
1367
|
+
Fe(c.current, F) || (o(F), c.current = F);
|
|
1368
|
+
};
|
|
1369
|
+
a();
|
|
1370
|
+
const d = h == null ? void 0 : h(a);
|
|
1371
|
+
return () => {
|
|
1372
|
+
d == null || d();
|
|
1373
|
+
};
|
|
1374
|
+
}, []), n;
|
|
1375
|
+
}, xt = (s, e) => {
|
|
1376
|
+
const t = L(H), r = e || t.store, [i, l] = le(() => {
|
|
1377
|
+
const c = r == null ? void 0 : r.getFieldsValue([].concat(s));
|
|
1378
|
+
return St(s) ? W(c, s) : c;
|
|
1379
|
+
}), n = U(s);
|
|
1380
|
+
n.current = s;
|
|
1381
|
+
const o = U(JSON.stringify(i));
|
|
1382
|
+
return se(() => {
|
|
1383
|
+
var d;
|
|
1384
|
+
if (!r) {
|
|
1385
|
+
ee(!0, "formInstance is not available");
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
const { registerWatcher: c } = ((d = r == null ? void 0 : r.getInnerMethods) == null ? void 0 : d.call(r, !0)) ?? {}, h = () => {
|
|
1389
|
+
const m = n.current, F = r.getFieldsValue([].concat(m));
|
|
1390
|
+
let V = F;
|
|
1391
|
+
E(m) || (V = W(F, m));
|
|
1392
|
+
const g = JSON.stringify(V);
|
|
1393
|
+
o.current !== g && (l(V), o.current = g);
|
|
1394
|
+
};
|
|
1395
|
+
h();
|
|
1396
|
+
const a = c == null ? void 0 : c(h);
|
|
1397
|
+
return () => {
|
|
1398
|
+
a == null || a();
|
|
1399
|
+
};
|
|
1400
|
+
}, []), i;
|
|
1401
|
+
}, q = ze;
|
|
1402
|
+
q.Provider = Be;
|
|
1403
|
+
q.Item = ae;
|
|
1404
|
+
q.List = Ae;
|
|
1405
|
+
q.Control = G;
|
|
1406
|
+
q.useForm = qe;
|
|
1407
|
+
q.useFormContext = Rt;
|
|
1408
|
+
q.useWatch = xt;
|
|
1409
|
+
q.useFormState = Pt;
|
|
1410
|
+
export {
|
|
1411
|
+
G as FormControl,
|
|
1412
|
+
ae as FormItem,
|
|
1413
|
+
Ae as FormList,
|
|
1414
|
+
Be as FormProvider,
|
|
1415
|
+
q as default,
|
|
1416
|
+
qe as useForm,
|
|
1417
|
+
Rt as useFormContext,
|
|
1418
|
+
Pt as useFormState,
|
|
1419
|
+
xt as useWatch
|
|
1420
|
+
};
|