@zat-design/sisyphus-react 4.5.0 → 4.5.2
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/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProDrawerForm/components/ProDrawer/index.js +58 -86
- package/es/ProDrawerForm/components/ProModal/index.js +44 -20
- package/es/ProDrawerForm/hooks/useConfirmClose.js +70 -0
- package/es/ProDrawerForm/index.js +7 -11
- package/es/ProDrawerForm/utils/index.js +36 -0
- package/es/ProEditTable/components/RcTable/BaseTable.js +10 -0
- package/es/ProEditTable/components/Summary/index.js +3 -2
- package/es/ProEditTable/utils/tools.js +1 -1
- package/es/ProEnum/index.js +6 -3
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +7 -6
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +4 -3
- package/es/ProForm/components/combination/ProModalSelect/index.js +7 -2
- package/es/ProForm/components/combination/ProModalSelect/utils/mergeSelectedRows.js +26 -0
- package/es/ProForm/components/render/RenderFields.js +3 -1
- package/es/ProForm/hooks/useWatch.js +8 -10
- package/es/ProLayout/components/ProHeader/index.js +28 -15
- package/es/ProSelect/index.js +77 -178
- package/es/ProSelect/utils/index.js +174 -0
- package/es/ProTree/components/ProTreeSelect/index.js +41 -14
- package/es/ProTree/components/ProTreeSelect/style/index.less +13 -4
- package/es/ProTree/style/index.less +20 -9
- package/es/ProTree/utils.js +26 -0
- package/es/ProTreeModal/style/index.less +1 -1
- package/es/ProUpload/components/DragRender.js +2 -1
- package/es/ProUpload/index.js +1 -1
- package/es/ProViewer/propsType.js +3 -1
- package/es/index.js +10 -0
- package/package.json +7 -13
- package/es/FormsProvider/index.d.ts +0 -18
- package/es/ProAction/components/CheckModalContent/index.d.ts +0 -8
- package/es/ProAction/index.d.ts +0 -7
- package/es/ProAction/propsType.d.ts +0 -45
- package/es/ProConfigProvider/index.d.ts +0 -9
- package/es/ProConfigProvider/propsType.d.ts +0 -78
- package/es/ProDownload/index.d.ts +0 -6
- package/es/ProDownload/propsType.d.ts +0 -71
- package/es/ProDownload/utils.d.ts +0 -60
- package/es/ProDrawerForm/components/ProDrawer/index.d.ts +0 -7
- package/es/ProDrawerForm/components/ProModal/index.d.ts +0 -7
- package/es/ProDrawerForm/components/index.d.ts +0 -2
- package/es/ProDrawerForm/index.d.ts +0 -6
- package/es/ProDrawerForm/propsType.d.ts +0 -100
- package/es/ProDrawerForm/utils/index.d.ts +0 -6
- package/es/ProEditLabel/components/RenderProForm.d.ts +0 -4
- package/es/ProEditLabel/index.d.ts +0 -4
- package/es/ProEditLabel/propsType.d.ts +0 -163
- package/es/ProEditLabel/utils/index.d.ts +0 -7
- package/es/ProEditTable/components/ActionButton/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +0 -6
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +0 -7
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +0 -4
- package/es/ProEditTable/components/RenderField/index.d.ts +0 -3
- package/es/ProEditTable/components/RenderField/propsType.d.ts +0 -30
- package/es/ProEditTable/components/RenderField/tools.d.ts +0 -22
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +0 -2
- package/es/ProEditTable/components/Summary/index.d.ts +0 -12
- package/es/ProEditTable/components/Validator/index.d.ts +0 -19
- package/es/ProEditTable/components/index.d.ts +0 -5
- package/es/ProEditTable/index.d.ts +0 -4
- package/es/ProEditTable/propsType.d.ts +0 -437
- package/es/ProEditTable/utils/config.d.ts +0 -25
- package/es/ProEditTable/utils/diffOriginal.d.ts +0 -22
- package/es/ProEditTable/utils/getDefaultProps.d.ts +0 -1
- package/es/ProEditTable/utils/index.d.ts +0 -23
- package/es/ProEditTable/utils/tools.d.ts +0 -128
- package/es/ProEditTable/utils/transform.d.ts +0 -13
- package/es/ProEditTable/utils/useEditTableError.d.ts +0 -7
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +0 -16
- package/es/ProEditTable/utils/validateAll.d.ts +0 -89
- package/es/ProEnum/components/Group.d.ts +0 -10
- package/es/ProEnum/components/Tag.d.ts +0 -7
- package/es/ProEnum/hooks/useEnum.d.ts +0 -29
- package/es/ProEnum/hooks/useEnumRequest.d.ts +0 -4
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +0 -14
- package/es/ProEnum/index.d.ts +0 -10
- package/es/ProEnum/propsType.d.ts +0 -310
- package/es/ProEnum/utils/eventCenter.d.ts +0 -1
- package/es/ProEnum/utils/frequentEnum.d.ts +0 -39
- package/es/ProEnum/utils/getEnum.d.ts +0 -47
- package/es/ProEnum/utils/getEnumLabel.d.ts +0 -2
- package/es/ProEnum/utils/index.d.ts +0 -84
- package/es/ProForm/components/Container.d.ts +0 -9
- package/es/ProForm/components/FormFooter/index.d.ts +0 -5
- package/es/ProForm/components/FormFooter/propsType.d.ts +0 -22
- package/es/ProForm/components/base/Checkbox/index.d.ts +0 -14
- package/es/ProForm/components/base/DatePicker/index.d.ts +0 -11
- package/es/ProForm/components/base/Input/index.d.ts +0 -3
- package/es/ProForm/components/base/Input/propsType.d.ts +0 -21
- package/es/ProForm/components/base/InputNumber/index.d.ts +0 -11
- package/es/ProForm/components/base/Radio/index.d.ts +0 -15
- package/es/ProForm/components/base/RangePicker/index.d.ts +0 -19
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +0 -15
- package/es/ProForm/components/base/Select/index.d.ts +0 -11
- package/es/ProForm/components/base/Switch/index.d.ts +0 -10
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +0 -10
- package/es/ProForm/components/base/TextArea/index.d.ts +0 -11
- package/es/ProForm/components/base/TimePicker/index.d.ts +0 -13
- package/es/ProForm/components/combination/Container/index.d.ts +0 -4
- package/es/ProForm/components/combination/Container/propsType.d.ts +0 -13
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +0 -24
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +0 -23
- package/es/ProForm/components/combination/FormList/components/Empty.d.ts +0 -13
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +0 -20
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +0 -12
- package/es/ProForm/components/combination/FormList/index.d.ts +0 -4
- package/es/ProForm/components/combination/FormList/propsType.d.ts +0 -69
- package/es/ProForm/components/combination/FormList/utils.d.ts +0 -18
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +0 -9
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +0 -28
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +0 -10
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -34
- package/es/ProForm/components/combination/Group/index.d.ts +0 -9
- package/es/ProForm/components/combination/Group/propsType.d.ts +0 -99
- package/es/ProForm/components/combination/Group/utils/index.d.ts +0 -154
- package/es/ProForm/components/combination/ProCascader/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +0 -48
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +0 -14
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +0 -33
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +0 -106
- package/es/ProForm/components/combination/ProModalSelect/utils/index.d.ts +0 -1
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -85
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +0 -23
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +0 -9
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -33
- package/es/ProForm/components/index.d.ts +0 -29
- package/es/ProForm/components/render/ChangedWrapper.d.ts +0 -17
- package/es/ProForm/components/render/ConfirmWrapper.d.ts +0 -10
- package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +0 -30
- package/es/ProForm/components/render/Render.d.ts +0 -4
- package/es/ProForm/components/render/RenderFields.d.ts +0 -26
- package/es/ProForm/components/render/propsType.d.ts +0 -279
- package/es/ProForm/hooks/useControlled.d.ts +0 -1
- package/es/ProForm/hooks/useDeepCompareMemo.d.ts +0 -2
- package/es/ProForm/hooks/useFieldProps.d.ts +0 -4
- package/es/ProForm/hooks/useForm.d.ts +0 -8
- package/es/ProForm/hooks/useRules.d.ts +0 -16
- package/es/ProForm/hooks/useShouldUpdate.d.ts +0 -31
- package/es/ProForm/hooks/useWatch.d.ts +0 -22
- package/es/ProForm/index.d.ts +0 -6
- package/es/ProForm/propsType.d.ts +0 -143
- package/es/ProForm/utils/buildFormItemProps.d.ts +0 -25
- package/es/ProForm/utils/diffOriginal.d.ts +0 -10
- package/es/ProForm/utils/getDefaultProps.d.ts +0 -1
- package/es/ProForm/utils/index.d.ts +0 -109
- package/es/ProForm/utils/processDependencies.d.ts +0 -29
- package/es/ProForm/utils/reactiveValues.d.ts +0 -34
- package/es/ProForm/utils/rulesCreator.d.ts +0 -7
- package/es/ProForm/utils/transformNames.d.ts +0 -10
- package/es/ProForm/utils/transformValue.d.ts +0 -6
- package/es/ProForm/utils/valueType.d.ts +0 -70
- package/es/ProIcon/config/index.d.ts +0 -19
- package/es/ProIcon/index.d.ts +0 -4
- package/es/ProIcon/propsTypes.d.ts +0 -175
- package/es/ProIcon/utils/index.d.ts +0 -6
- package/es/ProLayout/components/Layout/Header/index.d.ts +0 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +0 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +0 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +0 -15
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +0 -3
- package/es/ProLayout/components/Layout/Menu/index.d.ts +0 -4
- package/es/ProLayout/components/Layout/Notice/index.d.ts +0 -4
- package/es/ProLayout/components/Layout/index.d.ts +0 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +0 -98
- package/es/ProLayout/components/ProCollapse/index.d.ts +0 -3
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +0 -27
- package/es/ProLayout/components/ProFooter/index.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +0 -206
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +0 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/components/index.d.ts +0 -2
- package/es/ProLayout/components/ProHeader/index.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/utils/index.d.ts +0 -5
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +0 -7
- package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +0 -26
- package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +0 -6
- package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +0 -10
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +0 -6
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.d.ts +0 -25
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +0 -18
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +0 -31
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +0 -5
- package/es/ProLayout/components/TabsManager/index.d.ts +0 -7
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +0 -89
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +0 -47
- package/es/ProLayout/components/index.d.ts +0 -3
- package/es/ProLayout/index.d.ts +0 -20
- package/es/ProLayout/propTypes.d.ts +0 -533
- package/es/ProLayout/utils/index.d.ts +0 -43
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +0 -4
- package/es/ProSelect/index.d.ts +0 -5
- package/es/ProSelect/propsType.d.ts +0 -160
- package/es/ProSelect/utils/index.d.ts +0 -4
- package/es/ProStep/components/Anchor/index.d.ts +0 -4
- package/es/ProStep/components/Item/index.d.ts +0 -3
- package/es/ProStep/components/LazyLoad/index.d.ts +0 -19
- package/es/ProStep/components/Listener/index.d.ts +0 -4
- package/es/ProStep/components/Step/index.d.ts +0 -5
- package/es/ProStep/index.d.ts +0 -11
- package/es/ProStep/propsType.d.ts +0 -224
- package/es/ProStep/utils/index.d.ts +0 -22
- package/es/ProStepTab/index.d.ts +0 -22
- package/es/ProStepTab/propsType.d.ts +0 -114
- package/es/ProTable/components/EditableCell/EditIcon.d.ts +0 -6
- package/es/ProTable/components/EditableCell/index.d.ts +0 -4
- package/es/ProTable/components/EditableCell/propsType.d.ts +0 -24
- package/es/ProTable/components/FormatColumn/index.d.ts +0 -22
- package/es/ProTable/components/FormatColumn/propsType.d.ts +0 -29
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -3
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +0 -18
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +0 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +0 -61
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -3
- package/es/ProTable/components/RcTable/index.d.ts +0 -4
- package/es/ProTable/components/RenderColumn/index.d.ts +0 -22
- package/es/ProTable/components/RenderEmptyText/index.d.ts +0 -3
- package/es/ProTable/components/RenderFooter/index.d.ts +0 -2
- package/es/ProTable/components/RenderSummary/index.d.ts +0 -3
- package/es/ProTable/components/RenderTableHeader/index.d.ts +0 -2
- package/es/ProTable/components/RenderTabs/index.d.ts +0 -4
- package/es/ProTable/components/TableResizable/index.d.ts +0 -13
- package/es/ProTable/components/TooltipTitle/index.d.ts +0 -11
- package/es/ProTable/components/index.d.ts +0 -31
- package/es/ProTable/hooks/useAntdTable.d.ts +0 -7
- package/es/ProTable/index.d.ts +0 -17
- package/es/ProTable/propsType.d.ts +0 -792
- package/es/ProTable/utils/columnStorage.d.ts +0 -35
- package/es/ProTable/utils/index.d.ts +0 -52
- package/es/ProTabs/components/Card/index.d.ts +0 -3
- package/es/ProTabs/components/index.d.ts +0 -1
- package/es/ProTabs/index.d.ts +0 -4
- package/es/ProTabs/propType.d.ts +0 -94
- package/es/ProThemeTools/component/ProTools/index.d.ts +0 -3
- package/es/ProThemeTools/component/index.d.ts +0 -1
- package/es/ProThemeTools/context/ThemeContext.d.ts +0 -43
- package/es/ProThemeTools/index.d.ts +0 -9
- package/es/ProThemeTools/propsType.d.ts +0 -170
- package/es/ProThemeTools/utils/index.d.ts +0 -51
- package/es/ProTooltip/index.d.ts +0 -3
- package/es/ProTooltip/propsType.d.ts +0 -57
- package/es/ProTree/components/AdaptiveTooltip.d.ts +0 -4
- package/es/ProTree/components/CloseIcon.d.ts +0 -2
- package/es/ProTree/components/List.d.ts +0 -17
- package/es/ProTree/components/ProTree.d.ts +0 -3
- package/es/ProTree/components/ProTreeSelect/index.d.ts +0 -5
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -439
- package/es/ProTree/components/SearchTitle.d.ts +0 -11
- package/es/ProTree/components/Tree.d.ts +0 -27
- package/es/ProTree/components/index.d.ts +0 -4
- package/es/ProTree/index.d.ts +0 -3
- package/es/ProTree/propsType.d.ts +0 -812
- package/es/ProTree/utils.d.ts +0 -52
- package/es/ProTreeModal/components/Cascader.d.ts +0 -14
- package/es/ProTreeModal/components/CloseIcon.d.ts +0 -2
- package/es/ProTreeModal/components/List.d.ts +0 -21
- package/es/ProTreeModal/components/SearchTitle.d.ts +0 -7
- package/es/ProTreeModal/components/SortableItem.d.ts +0 -12
- package/es/ProTreeModal/components/Tree.d.ts +0 -25
- package/es/ProTreeModal/components/Trigger.d.ts +0 -21
- package/es/ProTreeModal/components/index.d.ts +0 -6
- package/es/ProTreeModal/index.d.ts +0 -4
- package/es/ProTreeModal/propsType.d.ts +0 -298
- package/es/ProTreeModal/utils.d.ts +0 -39
- package/es/ProUpload/components/ButtonRender.d.ts +0 -20
- package/es/ProUpload/components/DragRender.d.ts +0 -21
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +0 -2
- package/es/ProUpload/components/Example.d.ts +0 -10
- package/es/ProUpload/components/FileItem.d.ts +0 -33
- package/es/ProUpload/components/ImageRender.d.ts +0 -19
- package/es/ProUpload/index.d.ts +0 -4
- package/es/ProUpload/propsType.d.ts +0 -264
- package/es/ProUpload/uitls.d.ts +0 -3
- package/es/ProUtils/utils/index.d.ts +0 -6
- package/es/ProViewer/index.d.ts +0 -4
- package/es/ProViewer/propsType.d.ts +0 -35
- package/es/ProWaterMark/index.d.ts +0 -4
- package/es/ProWaterMark/propsType.d.ts +0 -6
- package/es/hooks/useDraggableRow.d.ts +0 -34
- package/es/index.d.ts +0 -47
- package/es/locale/en_US.d.ts +0 -176
- package/es/locale/index.d.ts +0 -15
- package/es/locale/zh_CN.d.ts +0 -176
- package/es/tokens.d.ts +0 -83
- package/es/utils/index.d.ts +0 -20
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import type { ColProps, FormInstance, FormItemProps, ModalFuncProps } from 'antd';
|
|
2
|
-
import type { NamePath } from 'antd/es/form/interface';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { validate, regExp } from '@zat-design/utils';
|
|
5
|
-
import type { RuleObject } from 'antd/es/form';
|
|
6
|
-
import type { Props as InputProps } from '../base/Input/propsType';
|
|
7
|
-
import type { Props as InputNumberProps } from '../base/InputNumber';
|
|
8
|
-
import type { Props as RadioProps } from '../base/Radio';
|
|
9
|
-
import type { Props as CheckboxProps } from '../base/Checkbox';
|
|
10
|
-
import type { Props as DatePickerProps } from '../base/DatePicker';
|
|
11
|
-
import type { Props as RangePickerProps } from '../base/RangePicker';
|
|
12
|
-
import type { TypeWithRef as FormListType } from '../combination/FormList/propsType';
|
|
13
|
-
import type { Props as SelectProps } from '../base/Select';
|
|
14
|
-
import type { Props as TimePickerProps } from '../base/TimePicker';
|
|
15
|
-
import type { Props as SwitchProps } from '../base/Switch';
|
|
16
|
-
import type { Props as SwitchCheckboxProps } from '../base/SwitchCheckbox';
|
|
17
|
-
import type { Props as TextAreaProps } from '../base/TextArea';
|
|
18
|
-
import type { ProCascaderType } from '../combination/ProCascader/propsType';
|
|
19
|
-
import type { ProModalSelectType } from '../combination/ProModalSelect/propsType';
|
|
20
|
-
import type { ProNumberRangeType } from '../combination/ProNumberRange/propsType';
|
|
21
|
-
import type { ProLimitType } from '../combination/ProTimeLimit';
|
|
22
|
-
import type { ProRangeLimitType } from '../combination/ProRangeLimit/propsType';
|
|
23
|
-
import type { CheckboxPropsMapType, ProEnumType, PropProSelectsMapType, PropRadioPropsMapType } from '../../../ProEnum/propsType';
|
|
24
|
-
import type { PropSelectType as ProSelectProps } from '../../../ProSelect/propsType';
|
|
25
|
-
import type { ProEditTableType } from '../../../ProEditTable/propsType';
|
|
26
|
-
import type { ProTreeModalType } from '../../../ProTreeModal/propsType';
|
|
27
|
-
import type { ProUploadType } from '../../../ProUpload/propsType';
|
|
28
|
-
import type { ProTreeType } from '../../../ProTree/propsType';
|
|
29
|
-
import type { GroupType as GroupCopyProps } from '../combination/Group/propsType';
|
|
30
|
-
import type { ProCollapseType } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
|
31
|
-
import type { DistributiveOmit } from '../../propsType';
|
|
32
|
-
import type { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
33
|
-
import { NamePathsDependencyType } from '../../utils/processDependencies';
|
|
34
|
-
type ValidateKey = keyof typeof validate;
|
|
35
|
-
type RegExpKey = keyof typeof regExp;
|
|
36
|
-
export interface ProRule extends Omit<RuleObject, 'type'> {
|
|
37
|
-
type?: ValidateKey | RegExpKey;
|
|
38
|
-
message?: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* percent 百分比 permillage 千分比 amount 金额
|
|
42
|
-
*/
|
|
43
|
-
export type ViewType = 'percent' | 'permillage' | 'amount' | 'thousandth';
|
|
44
|
-
export type PartialOf<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
45
|
-
interface ControlProps {
|
|
46
|
-
value?: unknown;
|
|
47
|
-
onChange?: (...args: any[]) => void;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* 扩展函数的参数
|
|
51
|
-
*/
|
|
52
|
-
export type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
53
|
-
form: FormInstance<Values>;
|
|
54
|
-
index?: number;
|
|
55
|
-
namePath?: NamePath;
|
|
56
|
-
[key: string]: any;
|
|
57
|
-
}) => R;
|
|
58
|
-
type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T, 'onChange' | 'value' | 'role'> & {
|
|
59
|
-
value?: T['value'];
|
|
60
|
-
onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], form: FormInstance<Values>) => void;
|
|
61
|
-
onFieldChange?: FunctionArgs<Values>;
|
|
62
|
-
dataSource?: any[];
|
|
63
|
-
/** ProForm disable时,是否完全受控 */
|
|
64
|
-
disabledStrictly?: boolean;
|
|
65
|
-
};
|
|
66
|
-
type ProEnumFormType<Values> = TransformToFormField<ProEnumType, Values> | TransformToFormField<ProEnumType & PropProSelectsMapType, Values> | TransformToFormField<ProEnumType & PropRadioPropsMapType, Values> | TransformToFormField<ProEnumType & CheckboxPropsMapType, Values>;
|
|
67
|
-
type ProEnumTableType<Values> = TransformToTableField<ProEnumType, Values> | TransformToTableField<ProEnumType & PropProSelectsMapType, Values> | TransformToTableField<ProEnumType & PropRadioPropsMapType, Values> | TransformToTableField<ProEnumType & CheckboxPropsMapType, Values>;
|
|
68
|
-
type ProEnumFieldType<Values, TT> = TT extends 'ProForm' ? ProEnumFormType<Values> | ReactiveFunction<Values, ProEnumFormType<Values>> : ProEnumTableType<Values> | ((text: any, values: Values, index: number) => ProEnumTableType<Values>);
|
|
69
|
-
type TransformToTableField<T extends ControlProps, Values> = Omit<T, 'onChange' | 'value' | 'onBlur' | 'role'> & {
|
|
70
|
-
value?: T['value'];
|
|
71
|
-
onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], record: any, index: number, form: FormInstance<Values>) => void;
|
|
72
|
-
onFieldChange?: FunctionArgs<Values>;
|
|
73
|
-
onBlur?: FunctionArgs<Values>;
|
|
74
|
-
};
|
|
75
|
-
export type ReactiveFunction<Values, R> = (values: Values, { form, index, namePath, }: {
|
|
76
|
-
form: FormInstance<Values>;
|
|
77
|
-
index?: number;
|
|
78
|
-
namePath?: NamePath;
|
|
79
|
-
[key: string]: any;
|
|
80
|
-
}) => R;
|
|
81
|
-
type FieldType<T extends ControlProps, Values, TT> = TT extends 'ProForm' ? TransformToFormField<T, Values> | ReactiveFunction<Values, TransformToFormField<T, Values>> : TransformToTableField<T, Values> | ((text: any, values: Values, index: number) => TransformToTableField<T, Values>);
|
|
82
|
-
/**
|
|
83
|
-
* 值转换
|
|
84
|
-
*/
|
|
85
|
-
export type ProFormValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime' | 'switch' | 'desensitization';
|
|
86
|
-
export type ColumnTypeMap<Values = any, T = 'ProForm'> = {
|
|
87
|
-
type?: 'Input';
|
|
88
|
-
fieldProps?: FieldType<InputProps, Values, T>;
|
|
89
|
-
} | {
|
|
90
|
-
type?: 'InputNumber';
|
|
91
|
-
fieldProps?: FieldType<InputNumberProps, Values, T>;
|
|
92
|
-
} | {
|
|
93
|
-
type?: 'Radio';
|
|
94
|
-
fieldProps?: FieldType<RadioProps, Values, T>;
|
|
95
|
-
} | {
|
|
96
|
-
type?: 'Checkbox';
|
|
97
|
-
fieldProps?: FieldType<CheckboxProps, Values, T>;
|
|
98
|
-
} | {
|
|
99
|
-
type?: 'DatePicker';
|
|
100
|
-
fieldProps?: FieldType<DatePickerProps, Values, T>;
|
|
101
|
-
} | {
|
|
102
|
-
type?: 'RangePicker';
|
|
103
|
-
fieldProps?: FieldType<RangePickerProps, Values, T>;
|
|
104
|
-
} | {
|
|
105
|
-
type?: 'FormList';
|
|
106
|
-
fieldProps?: FieldType<Omit<FormListType, 'fields' | 'operation' | 'meta'>, Values, T>;
|
|
107
|
-
} | {
|
|
108
|
-
type?: 'Select';
|
|
109
|
-
fieldProps?: FieldType<SelectProps, Values, T>;
|
|
110
|
-
} | {
|
|
111
|
-
type?: 'TimePicker';
|
|
112
|
-
fieldProps?: FieldType<TimePickerProps, Values, T>;
|
|
113
|
-
} | {
|
|
114
|
-
type?: 'Switch';
|
|
115
|
-
fieldProps?: FieldType<SwitchProps, Values, T>;
|
|
116
|
-
} | {
|
|
117
|
-
type?: 'SwitchCheckbox';
|
|
118
|
-
fieldProps?: FieldType<SwitchCheckboxProps, Values, T>;
|
|
119
|
-
} | {
|
|
120
|
-
type?: 'TextArea';
|
|
121
|
-
fieldProps?: FieldType<TextAreaProps, Values, T>;
|
|
122
|
-
} | {
|
|
123
|
-
type?: 'ProCascader';
|
|
124
|
-
fieldProps?: FieldType<ProCascaderType, Values, T>;
|
|
125
|
-
} | {
|
|
126
|
-
type?: 'ProModalSelect';
|
|
127
|
-
fieldProps?: FieldType<ProModalSelectType, Values, T>;
|
|
128
|
-
} | {
|
|
129
|
-
type?: 'ProNumberRange';
|
|
130
|
-
fieldProps?: FieldType<ProNumberRangeType, Values, T>;
|
|
131
|
-
} | {
|
|
132
|
-
type?: 'ProRangeLimit';
|
|
133
|
-
fieldProps?: FieldType<ProRangeLimitType, Values, T>;
|
|
134
|
-
} | {
|
|
135
|
-
type?: 'ProTimeLimit';
|
|
136
|
-
fieldProps?: FieldType<ProLimitType, Values, T>;
|
|
137
|
-
} | {
|
|
138
|
-
type?: 'ProEnum';
|
|
139
|
-
fieldProps?: ProEnumFieldType<Values, T>;
|
|
140
|
-
} | {
|
|
141
|
-
type?: 'ProSelect';
|
|
142
|
-
fieldProps?: FieldType<ProSelectProps, Values, T>;
|
|
143
|
-
} | {
|
|
144
|
-
type?: 'ProEditTable';
|
|
145
|
-
fieldProps?: FieldType<ProEditTableType, Values, T>;
|
|
146
|
-
} | {
|
|
147
|
-
type?: 'ProTreeModal';
|
|
148
|
-
fieldProps?: FieldType<ProTreeModalType, Values, T>;
|
|
149
|
-
} | {
|
|
150
|
-
type?: 'ProUpload';
|
|
151
|
-
fieldProps?: FieldType<ProUploadType, Values, T>;
|
|
152
|
-
} | {
|
|
153
|
-
type?: 'ProTree';
|
|
154
|
-
fieldProps?: FieldType<ProTreeType, Values, T>;
|
|
155
|
-
} | {
|
|
156
|
-
type?: 'Group';
|
|
157
|
-
fieldProps?: GroupCopyProps | ReactiveFunction<Values, GroupCopyProps>;
|
|
158
|
-
} | {
|
|
159
|
-
type?: 'ProCollapse';
|
|
160
|
-
fieldProps?: ProCollapseType | ReactiveFunction<Values, ProCollapseType>;
|
|
161
|
-
} | {
|
|
162
|
-
type?: 'Container';
|
|
163
|
-
fieldProps?: any;
|
|
164
|
-
};
|
|
165
|
-
export interface ProFormColumn<Values = any> extends Omit<FormItemProps<Values>, 'rules' | 'required'> {
|
|
166
|
-
component?: React.ReactNode | ReactiveFunction<Values, React.ReactNode>;
|
|
167
|
-
names?: NamePath[];
|
|
168
|
-
show?: boolean | ReactiveFunction<Values, boolean>;
|
|
169
|
-
valueType?: ProFormValueType;
|
|
170
|
-
switchValue?: [any, any];
|
|
171
|
-
isView?: boolean;
|
|
172
|
-
viewRender?: (value: any, record: Values, { form, index, namePath, }: {
|
|
173
|
-
form: FormInstance<Values>;
|
|
174
|
-
index?: number | undefined;
|
|
175
|
-
[key: string]: any;
|
|
176
|
-
}) => React.ReactElement<any, any> | string | undefined | null;
|
|
177
|
-
viewType?: ViewType;
|
|
178
|
-
colProps?: ColProps;
|
|
179
|
-
/** 列宽占比 */
|
|
180
|
-
span?: number;
|
|
181
|
-
/** 依赖刷新字段列表 */
|
|
182
|
-
dependNames?: NamePath[];
|
|
183
|
-
/**
|
|
184
|
-
* @description 表单props属性
|
|
185
|
-
* @deprecated 将于下个版本 4.0.0 被弃用, 请使用fieldProps进行替换
|
|
186
|
-
* @default -
|
|
187
|
-
*/
|
|
188
|
-
labelWidth?: string | number;
|
|
189
|
-
disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
190
|
-
trim?: boolean;
|
|
191
|
-
upperCase?: boolean;
|
|
192
|
-
hiddenNames?: string[] | any[];
|
|
193
|
-
rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
|
|
194
|
-
onDiff?: DiffOriginalParams['onDiff'];
|
|
195
|
-
required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
196
|
-
labelRequired?: boolean;
|
|
197
|
-
toISOString?: boolean;
|
|
198
|
-
toCSTString?: boolean;
|
|
199
|
-
clearNotShow?: boolean;
|
|
200
|
-
index?: number;
|
|
201
|
-
namePath?: NamePath;
|
|
202
|
-
listName?: NamePath;
|
|
203
|
-
/** 表单前缀信息 */
|
|
204
|
-
before?: string | React.ReactNode;
|
|
205
|
-
/** 表单后缀信息 */
|
|
206
|
-
after?: string | React.ReactNode;
|
|
207
|
-
/** 表单上方辅助信息 */
|
|
208
|
-
above?: string | React.ReactNode;
|
|
209
|
-
/** 表单下方辅助信息 */
|
|
210
|
-
extra?: string | React.ReactNode;
|
|
211
|
-
/** 是否固定字段, 不隐藏 */
|
|
212
|
-
fixed?: boolean;
|
|
213
|
-
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void | Promise<boolean | ModalFuncProps | void>>;
|
|
214
|
-
/** 防抖模式 */
|
|
215
|
-
debounceWait?: number;
|
|
216
|
-
/** 脱敏数据位置下标 */
|
|
217
|
-
desensitization?: [number, number] | ReactiveFunction<Values, [number, number]>;
|
|
218
|
-
}
|
|
219
|
-
export interface ProFormColumnWithExtendedDeps<Values = any> extends Omit<ProFormColumn<Values>, 'dependencies'> {
|
|
220
|
-
/** 表单项依赖关系,扩展支持namesPaths类型 */
|
|
221
|
-
dependencies?: NamePath[] | (NamePath | NamePathsDependencyType)[];
|
|
222
|
-
}
|
|
223
|
-
export type ProFormColumnType<T = any> = ProFormColumnWithExtendedDeps<T> & ColumnTypeMap<T, 'ProForm'>;
|
|
224
|
-
/**
|
|
225
|
-
* 表单渲染类型
|
|
226
|
-
*/
|
|
227
|
-
export interface RenderType<Values = any> {
|
|
228
|
-
component: any;
|
|
229
|
-
formItemProps: FormItemProps<Values> & {
|
|
230
|
-
labelWidth?: string | number;
|
|
231
|
-
disabled?: boolean;
|
|
232
|
-
hiddenNames?: string[];
|
|
233
|
-
trim?: boolean;
|
|
234
|
-
upperCase?: boolean;
|
|
235
|
-
rules?: ProRule[];
|
|
236
|
-
labelRequired?: boolean;
|
|
237
|
-
tooltip?: any;
|
|
238
|
-
isView?: boolean;
|
|
239
|
-
disabledStrictly?: boolean;
|
|
240
|
-
/** 表单前缀信息 */
|
|
241
|
-
before?: string | React.ReactNode;
|
|
242
|
-
/** 表单后缀信息 */
|
|
243
|
-
after?: string | React.ReactNode;
|
|
244
|
-
/** 表单上方辅助信息 */
|
|
245
|
-
above?: string | React.ReactNode;
|
|
246
|
-
/** 表单下方辅助信息 */
|
|
247
|
-
extra?: string | React.ReactNode;
|
|
248
|
-
parentNames?: string;
|
|
249
|
-
names?: NamePath[];
|
|
250
|
-
};
|
|
251
|
-
componentProps: {
|
|
252
|
-
disabledStrictly?: boolean;
|
|
253
|
-
[name: string]: any;
|
|
254
|
-
};
|
|
255
|
-
/** 列宽占比 */
|
|
256
|
-
span?: number;
|
|
257
|
-
show?: boolean | ((values: Values, { form, index, namePath, }: {
|
|
258
|
-
form: FormInstance<Values>;
|
|
259
|
-
index?: number;
|
|
260
|
-
namePath?: NamePath;
|
|
261
|
-
[key: string]: any;
|
|
262
|
-
}) => boolean);
|
|
263
|
-
fieldProps?: ReactiveFunction<Values, React.ReactNode>;
|
|
264
|
-
isSelect: boolean;
|
|
265
|
-
requiredOnView?: boolean;
|
|
266
|
-
confirm?: ProFormColumnType['confirm'];
|
|
267
|
-
[name: string]: any;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* 兼容旧命名导出
|
|
271
|
-
*/
|
|
272
|
-
export type ProEnumFormProps<Values> = ProEnumFormType<Values>;
|
|
273
|
-
export type ProEnumTableProps<Values> = ProEnumTableType<Values>;
|
|
274
|
-
export type ProEnumFieldProps<Values, TT> = ProEnumFieldType<Values, TT>;
|
|
275
|
-
export type FieldProps<T extends ControlProps, Values, TT> = FieldType<T, Values, TT>;
|
|
276
|
-
export type ColumnPropsMap<Values = any, T = 'ProForm'> = ColumnTypeMap<Values, T>;
|
|
277
|
-
export type ProColumnProps<Values = any> = ProFormColumnType<Values>;
|
|
278
|
-
export type RenderProps<Values = any> = RenderType<Values>;
|
|
279
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useControlled: (props: any) => any[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ModifiedFormInstanceType } from '../propsType';
|
|
2
|
-
export interface FormInstanceOption {
|
|
3
|
-
scrollToError?: boolean;
|
|
4
|
-
optimize?: boolean;
|
|
5
|
-
formKey?: string;
|
|
6
|
-
source?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const useForm: <T>(originForm?: ModifiedFormInstanceType<T> | FormInstanceOption, options?: FormInstanceOption) => [ModifiedFormInstanceType<T>];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { InternalNamePath } from 'antd/lib/form/interface';
|
|
2
|
-
import type { ProRule } from '../components/render/propsType';
|
|
3
|
-
interface Props {
|
|
4
|
-
rules?: ProRule[];
|
|
5
|
-
required?: boolean;
|
|
6
|
-
isSelect: boolean;
|
|
7
|
-
label?: string;
|
|
8
|
-
names?: InternalNamePath[];
|
|
9
|
-
labelRequired?: boolean;
|
|
10
|
-
type?: string;
|
|
11
|
-
}
|
|
12
|
-
declare const useRules: (props: Props) => {
|
|
13
|
-
rules: ProRule[];
|
|
14
|
-
required?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export default useRules;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { FormInstance, FormItemProps } from 'antd';
|
|
2
|
-
import type { ProFormColumnType, ProRule } from '../components/render/propsType';
|
|
3
|
-
interface Result<Values> {
|
|
4
|
-
shouldUpdate?: FormItemProps<Values>['shouldUpdate'];
|
|
5
|
-
show?: boolean;
|
|
6
|
-
disabled?: boolean | boolean[];
|
|
7
|
-
rules?: ProRule[];
|
|
8
|
-
required?: boolean;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
interface UseShouldUpdateProps<Values> {
|
|
12
|
-
show?: ProFormColumnType['show'];
|
|
13
|
-
formItemProps?: FormItemProps<Values> & {
|
|
14
|
-
clearNotShow?: boolean;
|
|
15
|
-
names?: any[];
|
|
16
|
-
index?: number;
|
|
17
|
-
namePath?: any;
|
|
18
|
-
dependNames?: any[];
|
|
19
|
-
parentNames?: any;
|
|
20
|
-
};
|
|
21
|
-
form?: FormInstance<Values>;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
rules?: ProRule[];
|
|
24
|
-
required?: boolean;
|
|
25
|
-
type: string;
|
|
26
|
-
shouldUpdateDebounce?: number;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
}
|
|
29
|
-
type HookShouldUpdate<Values = any> = (props: UseShouldUpdateProps<Values>) => Result<Values>;
|
|
30
|
-
declare const useShouldUpdate: HookShouldUpdate;
|
|
31
|
-
export default useShouldUpdate;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FormInstance } from 'antd/es/form/Form';
|
|
2
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
3
|
-
/**
|
|
4
|
-
* selector 函数:接收所有表单值,返回派生值
|
|
5
|
-
* 与 antd 5.12.0+ Form.useWatch selector 行为一致
|
|
6
|
-
*/
|
|
7
|
-
export type WatchSelector<T = any> = (values: any) => T;
|
|
8
|
-
/**
|
|
9
|
-
* ProForm的useWatch hook,用于监听表单字段变化
|
|
10
|
-
* 支持三种依赖形式:
|
|
11
|
-
* 1. 字符串路径:useWatch('fieldName', form)
|
|
12
|
-
* 2. 路径数组:useWatch(['a', 'b'], form) 或 useWatch([['a', 'b'], 'c'], form)
|
|
13
|
-
* 3. selector 函数:useWatch((values) => values.a + values.b, form)
|
|
14
|
-
*
|
|
15
|
-
* @param dependencies 监听的字段路径或 selector 函数
|
|
16
|
-
* @param form 表单实例
|
|
17
|
-
* @param wait 防抖等待时间
|
|
18
|
-
* @returns 表单值或 selector 返回的派生值
|
|
19
|
-
*/
|
|
20
|
-
declare function useWatch<T = any>(selector: WatchSelector<T>, form?: FormInstance, wait?: number): T;
|
|
21
|
-
declare function useWatch(dependencies: string | NamePath[], form?: FormInstance, wait?: number): Record<string, any>;
|
|
22
|
-
export default useWatch;
|
package/es/ProForm/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormProviderProps } from 'antd/es/form/context';
|
|
3
|
-
import type { ProFormInstanceType } from './propsType';
|
|
4
|
-
declare const ProFormForward: ProFormInstanceType<any>;
|
|
5
|
-
export declare const ProFormProvider: React.FC<FormProviderProps>;
|
|
6
|
-
export default ProFormForward;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ButtonProps, ColProps, RowProps } from 'antd';
|
|
3
|
-
import { FormProps, FormInstance } from 'antd/es/form/Form';
|
|
4
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
-
import type { StoreValue, Store, ValuedNotifyInfo } from '@rc-component/form/es/interface';
|
|
6
|
-
import type { ShouldUpdate } from '@rc-component/form/es/Field';
|
|
7
|
-
import type { ProFormColumnType, ViewType } from './components/render/propsType';
|
|
8
|
-
import type { ProFormComponentType } from './components';
|
|
9
|
-
export type ModifiedFormInstanceType<T> = FormInstance<T> & {
|
|
10
|
-
isModified?: boolean;
|
|
11
|
-
/** 默认清空设置值的报错状态 */
|
|
12
|
-
setFieldValue: (name: NamePath, value: any, info?: ValuedNotifyInfo) => void;
|
|
13
|
-
formKey?: string;
|
|
14
|
-
_init?: boolean;
|
|
15
|
-
__INTERNAL_CONFIG__?: {
|
|
16
|
-
fields?: any[];
|
|
17
|
-
stopOnFirstError?: boolean;
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export interface ButtonType extends ButtonProps {
|
|
22
|
-
children?: any;
|
|
23
|
-
}
|
|
24
|
-
export interface FooterButtonType {
|
|
25
|
-
okButtonProps?: ButtonType;
|
|
26
|
-
cancelButtonProps?: ButtonType;
|
|
27
|
-
}
|
|
28
|
-
export interface ProFormItemChildType {
|
|
29
|
-
value?: any;
|
|
30
|
-
onChange?: () => void;
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}
|
|
33
|
-
export type ModeEnum = 'search' | 'drawer';
|
|
34
|
-
type FooterType = ReactNode | {
|
|
35
|
-
okButtonProps: ButtonType;
|
|
36
|
-
cancelButtonProps: ButtonType;
|
|
37
|
-
} | boolean;
|
|
38
|
-
export declare const otherKeys: string[];
|
|
39
|
-
export interface ProFormOtherType {
|
|
40
|
-
isView?: boolean;
|
|
41
|
-
viewEmpty?: React.ReactNode;
|
|
42
|
-
label?: React.ReactNode;
|
|
43
|
-
valueType?: string;
|
|
44
|
-
viewType?: ViewType;
|
|
45
|
-
name?: NamePath;
|
|
46
|
-
names?: NamePath[];
|
|
47
|
-
form?: FormInstance;
|
|
48
|
-
type?: ProFormComponentType;
|
|
49
|
-
hiddenNames?: string[] | any[];
|
|
50
|
-
colProps: ColProps;
|
|
51
|
-
disabled: boolean;
|
|
52
|
-
show?: boolean | (() => boolean);
|
|
53
|
-
required?: boolean | boolean[] | (() => boolean | boolean[]);
|
|
54
|
-
mode?: string;
|
|
55
|
-
namePath?: any[] | string | number;
|
|
56
|
-
listName?: any[] | string | number;
|
|
57
|
-
globalControl?: boolean;
|
|
58
|
-
formDisabled?: boolean;
|
|
59
|
-
isDiffChange?: boolean;
|
|
60
|
-
diffConfig?: DiffConfigType;
|
|
61
|
-
shouldUpdateDebounce?: number;
|
|
62
|
-
/** 灵活模式 Group 相关属性,独立管理灵活模式配置 */
|
|
63
|
-
flexibleGroupProps?: {
|
|
64
|
-
className?: string;
|
|
65
|
-
style?: React.CSSProperties;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
export interface DiffConfigType<Values = any> {
|
|
69
|
-
/** 比对原始数据源 */
|
|
70
|
-
originalValues: Values;
|
|
71
|
-
/** 是否显示对比值气泡 */
|
|
72
|
-
toolTip?: boolean;
|
|
73
|
-
/** 变更提示颜色 */
|
|
74
|
-
changeTipColor?: string;
|
|
75
|
-
/** 新增提示颜色 */
|
|
76
|
-
addTipColor?: string;
|
|
77
|
-
/** 是否跟随父组件滚动 */
|
|
78
|
-
scrollFollowParent?: string;
|
|
79
|
-
}
|
|
80
|
-
export interface ProFormType<Values = any> extends FormProps<Values> {
|
|
81
|
-
disabled?: boolean;
|
|
82
|
-
/** 全局控制优先 */
|
|
83
|
-
globalControl?: boolean;
|
|
84
|
-
mode?: ModeEnum;
|
|
85
|
-
/**
|
|
86
|
-
* 如果有formKey,则会在全局中查找或创建表单实例
|
|
87
|
-
* 可以不需要手动传入form实例 且formKey的优先级高于form
|
|
88
|
-
*/
|
|
89
|
-
formKey?: string;
|
|
90
|
-
/** 是否查看 */
|
|
91
|
-
isView?: boolean;
|
|
92
|
-
span?: number;
|
|
93
|
-
columns?: ProFormColumnType<Values>[];
|
|
94
|
-
rowProps?: RowProps;
|
|
95
|
-
footer?: FooterType;
|
|
96
|
-
expand?: boolean | number;
|
|
97
|
-
expandOpen?: boolean;
|
|
98
|
-
expandOpenChange?: (open: boolean) => void;
|
|
99
|
-
onOk?: () => void;
|
|
100
|
-
okText?: string;
|
|
101
|
-
onCancel?: () => void;
|
|
102
|
-
cancelText?: string;
|
|
103
|
-
viewEmpty?: React.ReactNode | string;
|
|
104
|
-
confirmLoading?: boolean;
|
|
105
|
-
labelWidth?: string | number;
|
|
106
|
-
/** 是否回车提交 */
|
|
107
|
-
submitOnEnter?: boolean;
|
|
108
|
-
clearNotShow?: boolean;
|
|
109
|
-
requiredOnView?: boolean;
|
|
110
|
-
formId?: string;
|
|
111
|
-
required?: boolean | boolean[];
|
|
112
|
-
/** 表单比对配置 */
|
|
113
|
-
diffConfig?: DiffConfigType;
|
|
114
|
-
scrollToError?: boolean;
|
|
115
|
-
/** 性能模式,谨慎使用,默认不开启
|
|
116
|
-
* 1. 开启不过滤names的中间态值
|
|
117
|
-
*/
|
|
118
|
-
optimize?: boolean;
|
|
119
|
-
/** 是否在遇到第一个错误时停止验证 */
|
|
120
|
-
stopOnFirstError?: boolean;
|
|
121
|
-
/** shouldUpdate防抖延迟时间,默认500ms,设置为0则不防抖 */
|
|
122
|
-
shouldUpdateDebounce?: number;
|
|
123
|
-
/** label 对齐方式 */
|
|
124
|
-
labelAlign?: 'left' | 'right';
|
|
125
|
-
}
|
|
126
|
-
export interface TransformType<T = any> {
|
|
127
|
-
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
|
128
|
-
getValueProps?: (value: StoreValue) => Record<string, unknown>;
|
|
129
|
-
shouldUpdate?: ShouldUpdate<T>;
|
|
130
|
-
}
|
|
131
|
-
export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
132
|
-
/**
|
|
133
|
-
* ProForm 组件接口类型
|
|
134
|
-
* 用于定义 ProForm 组件及其静态方法的类型
|
|
135
|
-
* 注意:此接口的具体实现方法类型在组件文件中定义,这里只提供基础结构
|
|
136
|
-
*/
|
|
137
|
-
export interface ProFormInstanceType<T = any> extends React.ForwardRefExoticComponent<ProFormType<T> & React.RefAttributes<FormInstance<T>>> {
|
|
138
|
-
useForm: any;
|
|
139
|
-
useWatch: any;
|
|
140
|
-
useFormInstances: any;
|
|
141
|
-
[key: string]: any;
|
|
142
|
-
}
|
|
143
|
-
export type { ProFormColumnType } from './components/render/propsType';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { FormItemProps } from 'antd';
|
|
2
|
-
interface BuildFormItemPropsParams {
|
|
3
|
-
baseFormItemProps: any;
|
|
4
|
-
otherProps: any;
|
|
5
|
-
form: any;
|
|
6
|
-
namesStr: any;
|
|
7
|
-
internalRule: any;
|
|
8
|
-
resolvedRequired: any;
|
|
9
|
-
rules: any;
|
|
10
|
-
labelRequired: any;
|
|
11
|
-
requiredOnView?: boolean;
|
|
12
|
-
type: string;
|
|
13
|
-
trim?: boolean;
|
|
14
|
-
upperCase?: boolean;
|
|
15
|
-
proConfig: any;
|
|
16
|
-
validateFirst: any;
|
|
17
|
-
lastDisabled: any;
|
|
18
|
-
labelWidth?: string | number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 将列配置整理为最终透传给 Form.Item 的 props(纯函数)
|
|
22
|
-
* 聚合 valueType transform / transformNames / 校验规则 / disabled 优先级 / omit
|
|
23
|
-
*/
|
|
24
|
-
export declare const buildFormItemProps: (params: BuildFormItemPropsParams) => FormItemProps & Record<string, any>;
|
|
25
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FormInstance } from 'antd';
|
|
2
|
-
export interface DiffOriginalParams {
|
|
3
|
-
originalValue: any;
|
|
4
|
-
value: any;
|
|
5
|
-
form: FormInstance;
|
|
6
|
-
type?: string;
|
|
7
|
-
onDiff?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
|
|
8
|
-
}
|
|
9
|
-
export type DiffType = 'same' | 'add' | 'changed';
|
|
10
|
-
export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDefaultProps: (props: any) => any;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { ColProps, FormProps, FormInstance } from 'antd';
|
|
2
|
-
import { InternalNamePath, NamePath } from 'antd/es/form/interface';
|
|
3
|
-
interface transProps {
|
|
4
|
-
formProps: FormProps;
|
|
5
|
-
colProps: ColProps;
|
|
6
|
-
[name: string]: any;
|
|
7
|
-
}
|
|
8
|
-
interface AnyObject {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
export declare const getLayout: (params: any) => transProps;
|
|
12
|
-
export declare const isSelect: (props: any) => any;
|
|
13
|
-
/**
|
|
14
|
-
* Input TextArea 移除前后空格
|
|
15
|
-
* @param type 组件类型
|
|
16
|
-
* @param trim 是否移除前后空格
|
|
17
|
-
* @returns {}
|
|
18
|
-
*/
|
|
19
|
-
export declare const isTrim: (type: string, trim: boolean, configData: any) => any;
|
|
20
|
-
/**
|
|
21
|
-
* Input TextArea 小写自动转大写
|
|
22
|
-
* @param type 组件类型
|
|
23
|
-
* @param upperCase 是否小写转大写
|
|
24
|
-
* @returns {}
|
|
25
|
-
*/
|
|
26
|
-
export declare const isUpperCase: (type: string, upperCase: boolean) => any;
|
|
27
|
-
export declare const diffField: (prevValues: any, curValues: any, names: NamePath[]) => boolean;
|
|
28
|
-
export declare const splitNameStr: (name: string) => string[][];
|
|
29
|
-
export declare const filterInternalFields: (values: any, optimize?: boolean) => any;
|
|
30
|
-
export declare const getAllNamePath: (object: Record<string, any>, currentPath?: InternalNamePath) => InternalNamePath[];
|
|
31
|
-
export declare const isNullValue: (value: any) => boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 判断数组中是否包含空值 一个为空则为true
|
|
34
|
-
* @param arr 值
|
|
35
|
-
* @returns boole
|
|
36
|
-
*/
|
|
37
|
-
export declare const isNotFullArray: (arr: any, length: any, required: any) => boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 判断数组中值是否都为空 全部为空则为true
|
|
40
|
-
* @param arr 值
|
|
41
|
-
* @returns boole
|
|
42
|
-
*/
|
|
43
|
-
export declare const isNullArray: (arr: any) => boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 判断数组中值是否全部为空 如果值不是数组返回false
|
|
46
|
-
* @param arr 值
|
|
47
|
-
* @returns boole
|
|
48
|
-
*/
|
|
49
|
-
export declare const isEmptyArray: (arr: any) => boolean;
|
|
50
|
-
export declare function toArray<T>(value?: T | T[] | null): T[];
|
|
51
|
-
/**
|
|
52
|
-
* 初始化值names值合并
|
|
53
|
-
* @param obj AnyObject
|
|
54
|
-
* @returns AnyObject
|
|
55
|
-
*/
|
|
56
|
-
export declare function initialValuesToNames(values: AnyObject, columns: AnyObject): AnyObject;
|
|
57
|
-
/**
|
|
58
|
-
* 获取数组含数字的新数组
|
|
59
|
-
* @returns ['group-7x19no', 0, 'abc'] =>['group-7x19no', 0]
|
|
60
|
-
*/
|
|
61
|
-
export declare function getArrayBeforeNumber(arr: (string | number)[]): (string | number)[];
|
|
62
|
-
/**
|
|
63
|
-
* 查询数据中是否包含rowKey
|
|
64
|
-
*/
|
|
65
|
-
export declare const hasRowKey: (obj: any) => boolean;
|
|
66
|
-
/**
|
|
67
|
-
* 获取小数点后的位数
|
|
68
|
-
* @param num 数字
|
|
69
|
-
* @returns 位数
|
|
70
|
-
*/
|
|
71
|
-
export declare const getDecimalDigits: (num: number) => number;
|
|
72
|
-
/**
|
|
73
|
-
* 获取树状结构option
|
|
74
|
-
* @param treeData 树数据源
|
|
75
|
-
* @param value 选中值
|
|
76
|
-
* @returns {}
|
|
77
|
-
*/
|
|
78
|
-
export declare const findOptionByValue: (treeData: any[], value: string | number, fieldNames: {
|
|
79
|
-
[key: string]: any;
|
|
80
|
-
label?: string;
|
|
81
|
-
value?: string;
|
|
82
|
-
children?: string;
|
|
83
|
-
}) => any;
|
|
84
|
-
/** 解析namePath */
|
|
85
|
-
export declare const parseNamePath: (input: string) => any;
|
|
86
|
-
/**
|
|
87
|
-
* 获取表单所有字段路径的简化函数
|
|
88
|
-
* @param form 表单实例
|
|
89
|
-
* @returns 所有字段路径数组
|
|
90
|
-
*/
|
|
91
|
-
export declare const getFormFieldPaths: (form: FormInstance) => any[];
|
|
92
|
-
export declare function findNamesKeyInArray(arr: string[], key: string): string | null;
|
|
93
|
-
type DataItem = (string | number)[];
|
|
94
|
-
/**
|
|
95
|
-
* 根据特定规则合并两个数据源 (TypeScript 版本)
|
|
96
|
-
* @param data1 第一个数据源
|
|
97
|
-
* @param data2 第二个数据源
|
|
98
|
-
* @returns 合并后的结果数组
|
|
99
|
-
*/
|
|
100
|
-
export declare const mergeNames: (data1: DataItem[], data2: DataItem[]) => DataItem[];
|
|
101
|
-
/**
|
|
102
|
-
* 是否 formlist或者pro-edit-table 场景
|
|
103
|
-
* 使用正则表达式判断一个由逗号分隔的字符串中,是否包含一个纯数字的片段。
|
|
104
|
-
* @param {string} str - 输入的字符串。
|
|
105
|
-
* @returns {boolean} - 如果匹配成功,返回 true;否则返回 false。
|
|
106
|
-
*/
|
|
107
|
-
export declare const isListForm: (str: string) => boolean;
|
|
108
|
-
export * from './buildFormItemProps';
|
|
109
|
-
export * from './reactiveValues';
|