@zat-design/sisyphus-react 4.5.5 → 4.5.6-beta.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/FormsProvider/index.d.ts +18 -0
- package/es/ProAction/components/CheckModalContent/index.d.ts +8 -0
- package/es/ProAction/index.d.ts +7 -0
- package/es/ProAction/propsType.d.ts +45 -0
- package/es/ProConfigProvider/index.d.ts +9 -0
- package/es/ProConfigProvider/propsType.d.ts +82 -0
- package/es/ProDownload/index.d.ts +6 -0
- package/es/ProDownload/propsType.d.ts +71 -0
- package/es/ProDownload/utils.d.ts +60 -0
- package/es/ProDrawerForm/components/ProDrawer/index.d.ts +7 -0
- package/es/ProDrawerForm/components/ProModal/index.d.ts +7 -0
- package/es/ProDrawerForm/components/index.d.ts +2 -0
- package/es/ProDrawerForm/hooks/useConfirmClose.d.ts +24 -0
- package/es/ProDrawerForm/index.d.ts +6 -0
- package/es/ProDrawerForm/propsType.d.ts +111 -0
- package/es/ProDrawerForm/utils/index.d.ts +25 -0
- package/es/ProEditLabel/components/RenderProForm.d.ts +4 -0
- package/es/ProEditLabel/index.d.ts +4 -0
- package/es/ProEditLabel/propsType.d.ts +163 -0
- package/es/ProEditLabel/utils/index.d.ts +7 -0
- package/es/ProEditTable/components/ActionButton/index.d.ts +2 -0
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +5 -0
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +7 -0
- package/es/ProEditTable/components/RcTable/index.d.ts +4 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +4 -0
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -0
- package/es/ProEditTable/components/RenderField/propsType.d.ts +30 -0
- package/es/ProEditTable/components/RenderField/tools.d.ts +22 -0
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +2 -0
- package/es/ProEditTable/components/Summary/index.d.ts +12 -0
- package/es/ProEditTable/components/Validator/index.d.ts +18 -0
- package/es/ProEditTable/components/index.d.ts +5 -0
- package/es/ProEditTable/index.d.ts +4 -0
- package/es/ProEditTable/propsType.d.ts +437 -0
- package/es/ProEditTable/utils/config.d.ts +25 -0
- package/es/ProEditTable/utils/diffOriginal.d.ts +22 -0
- package/es/ProEditTable/utils/getDefaultProps.d.ts +1 -0
- package/es/ProEditTable/utils/index.d.ts +23 -0
- package/es/ProEditTable/utils/tools.d.ts +133 -0
- package/es/ProEditTable/utils/transform.d.ts +13 -0
- package/es/ProEditTable/utils/useEditTableError.d.ts +7 -0
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +16 -0
- package/es/ProEditTable/utils/validateAll.d.ts +89 -0
- package/es/ProEnum/components/Group.d.ts +10 -0
- package/es/ProEnum/components/Tag.d.ts +7 -0
- package/es/ProEnum/hooks/useEnum.d.ts +29 -0
- package/es/ProEnum/hooks/useEnumRequest.d.ts +4 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/index.d.ts +10 -0
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/propsType.d.ts +320 -0
- package/es/ProEnum/utils/eventCenter.d.ts +1 -0
- package/es/ProEnum/utils/frequentEnum.d.ts +39 -0
- package/es/ProEnum/utils/getEnum.d.ts +47 -0
- package/es/ProEnum/utils/getEnumLabel.d.ts +2 -0
- package/es/ProEnum/utils/index.d.ts +98 -0
- package/es/ProForm/components/Container.d.ts +9 -0
- package/es/ProForm/components/FormFooter/index.d.ts +5 -0
- package/es/ProForm/components/FormFooter/propsType.d.ts +21 -0
- package/es/ProForm/components/base/Checkbox/index.d.ts +14 -0
- package/es/ProForm/components/base/DatePicker/index.d.ts +11 -0
- package/es/ProForm/components/base/Input/index.d.ts +3 -0
- package/es/ProForm/components/base/Input/propsType.d.ts +21 -0
- package/es/ProForm/components/base/InputNumber/index.d.ts +11 -0
- package/es/ProForm/components/base/Radio/index.d.ts +15 -0
- package/es/ProForm/components/base/RangePicker/index.d.ts +19 -0
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +15 -0
- package/es/ProForm/components/base/Select/index.d.ts +11 -0
- package/es/ProForm/components/base/Switch/index.d.ts +10 -0
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +10 -0
- package/es/ProForm/components/base/TextArea/index.d.ts +11 -0
- package/es/ProForm/components/base/TimePicker/index.d.ts +13 -0
- package/es/ProForm/components/combination/Container/index.d.ts +4 -0
- package/es/ProForm/components/combination/Container/propsType.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +24 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +23 -0
- package/es/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +20 -0
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +12 -0
- package/es/ProForm/components/combination/FormList/index.d.ts +4 -0
- package/es/ProForm/components/combination/FormList/propsType.d.ts +69 -0
- package/es/ProForm/components/combination/FormList/utils.d.ts +18 -0
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +9 -0
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +28 -0
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +34 -0
- package/es/ProForm/components/combination/Group/index.d.ts +9 -0
- package/es/ProForm/components/combination/Group/propsType.d.ts +99 -0
- package/es/ProForm/components/combination/Group/utils/index.d.ts +153 -0
- package/es/ProForm/components/combination/ProCascader/index.d.ts +3 -0
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +48 -0
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +33 -0
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +4 -0
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +106 -0
- package/es/ProForm/components/combination/ProModalSelect/utils/index.d.ts +15 -0
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -0
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +85 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +4 -0
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +8 -0
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +33 -0
- package/es/ProForm/components/index.d.ts +29 -0
- package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
- package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
- package/es/ProForm/components/render/Render.d.ts +4 -0
- package/es/ProForm/components/render/RenderFields.d.ts +26 -0
- package/es/ProForm/components/render/propsType.d.ts +279 -0
- package/es/ProForm/hooks/useControlled.d.ts +1 -0
- package/es/ProForm/hooks/useDeepCompareMemo.d.ts +2 -0
- package/es/ProForm/hooks/useFieldProps.d.ts +4 -0
- package/es/ProForm/hooks/useForm.d.ts +8 -0
- package/es/ProForm/hooks/useRules.d.ts +16 -0
- package/es/ProForm/hooks/useShouldUpdate.d.ts +31 -0
- package/es/ProForm/hooks/useWatch.d.ts +22 -0
- package/es/ProForm/index.d.ts +6 -0
- package/es/ProForm/propsType.d.ts +143 -0
- package/es/ProForm/utils/buildFormItemProps.d.ts +25 -0
- package/es/ProForm/utils/diffOriginal.d.ts +10 -0
- package/es/ProForm/utils/getDefaultProps.d.ts +1 -0
- package/es/ProForm/utils/index.d.ts +109 -0
- package/es/ProForm/utils/processDependencies.d.ts +29 -0
- package/es/ProForm/utils/reactiveValues.d.ts +33 -0
- package/es/ProForm/utils/rulesCreator.d.ts +7 -0
- package/es/ProForm/utils/transformNames.d.ts +10 -0
- package/es/ProForm/utils/transformValue.d.ts +6 -0
- package/es/ProForm/utils/valueType.d.ts +70 -0
- package/es/ProIcon/config/index.d.ts +19 -0
- package/es/ProIcon/index.d.ts +4 -0
- package/es/ProIcon/propsTypes.d.ts +175 -0
- package/es/ProIcon/utils/index.d.ts +6 -0
- package/es/ProLayout/components/Layout/Header/index.d.ts +4 -0
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +3 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +3 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +15 -0
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +3 -0
- package/es/ProLayout/components/Layout/Menu/index.d.ts +4 -0
- package/es/ProLayout/components/Layout/Notice/index.d.ts +4 -0
- package/es/ProLayout/components/Layout/index.d.ts +3 -0
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +98 -0
- package/es/ProLayout/components/ProCollapse/index.d.ts +3 -0
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +27 -0
- package/es/ProLayout/components/ProFooter/index.d.ts +3 -0
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +206 -0
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +4 -0
- package/es/ProLayout/components/ProHeader/components/Describe/index.d.ts +26 -0
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +106 -0
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +9 -0
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +4 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +2 -0
- package/es/ProLayout/components/ProHeader/index.d.ts +4 -0
- package/es/ProLayout/components/ProHeader/index.js +54 -118
- package/es/ProLayout/components/ProHeader/utils/index.d.ts +20 -0
- package/es/ProLayout/components/ProHeader/utils/index.js +23 -1
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
- package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +5 -0
- package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +10 -0
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.d.ts +25 -0
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
- package/es/ProLayout/components/TabsManager/index.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/index.js +87 -3
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +89 -0
- package/es/ProLayout/components/TabsManager/style/index.less +6 -3
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +47 -0
- package/es/ProLayout/components/index.d.ts +3 -0
- package/es/ProLayout/index.d.ts +19 -0
- package/es/ProLayout/index.js +28 -10
- package/es/ProLayout/propTypes.d.ts +550 -0
- package/es/ProLayout/style/index.less +32 -0
- package/es/ProLayout/utils/index.d.ts +43 -0
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProSelect/index.d.ts +5 -0
- package/es/ProSelect/propsType.d.ts +162 -0
- package/es/ProSelect/utils/index.d.ts +86 -0
- package/es/ProStep/components/Anchor/index.d.ts +4 -0
- package/es/ProStep/components/Item/index.d.ts +4 -0
- package/es/ProStep/components/LazyLoad/index.d.ts +19 -0
- package/es/ProStep/components/Listener/index.d.ts +4 -0
- package/es/ProStep/components/Step/index.d.ts +5 -0
- package/es/ProStep/index.d.ts +11 -0
- package/es/ProStep/propsType.d.ts +224 -0
- package/es/ProStep/utils/index.d.ts +22 -0
- package/es/ProStepTab/index.d.ts +22 -0
- package/es/ProStepTab/propsType.d.ts +114 -0
- package/es/ProTable/components/EditableCell/EditIcon.d.ts +6 -0
- package/es/ProTable/components/EditableCell/index.d.ts +4 -0
- package/es/ProTable/components/EditableCell/propsType.d.ts +24 -0
- package/es/ProTable/components/FormatColumn/index.d.ts +22 -0
- package/es/ProTable/components/FormatColumn/propsType.d.ts +29 -0
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +2 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +18 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +8 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +61 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +2 -0
- package/es/ProTable/components/RcTable/index.d.ts +4 -0
- package/es/ProTable/components/RenderColumn/index.d.ts +22 -0
- package/es/ProTable/components/RenderEmptyText/index.d.ts +3 -0
- package/es/ProTable/components/RenderFooter/index.d.ts +2 -0
- package/es/ProTable/components/RenderSummary/index.d.ts +3 -0
- package/es/ProTable/components/RenderTableHeader/index.d.ts +2 -0
- package/es/ProTable/components/RenderTabs/index.d.ts +3 -0
- package/es/ProTable/components/TableResizable/index.d.ts +13 -0
- package/es/ProTable/components/TooltipTitle/index.d.ts +11 -0
- package/es/ProTable/components/index.d.ts +31 -0
- package/es/ProTable/hooks/useAntdTable.d.ts +7 -0
- package/es/ProTable/index.d.ts +17 -0
- package/es/ProTable/propsType.d.ts +805 -0
- package/es/ProTable/utils/columnStorage.d.ts +35 -0
- package/es/ProTable/utils/index.d.ts +52 -0
- package/es/ProTabs/components/Card/index.d.ts +3 -0
- package/es/ProTabs/components/index.d.ts +1 -0
- package/es/ProTabs/index.d.ts +4 -0
- package/es/ProTabs/propType.d.ts +94 -0
- package/es/ProThemeTools/component/ProTools/index.d.ts +3 -0
- package/es/ProThemeTools/component/index.d.ts +1 -0
- package/es/ProThemeTools/context/ThemeContext.d.ts +43 -0
- package/es/ProThemeTools/index.d.ts +9 -0
- package/es/ProThemeTools/propsType.d.ts +170 -0
- package/es/ProThemeTools/utils/index.d.ts +51 -0
- package/es/ProTooltip/index.d.ts +3 -0
- package/es/ProTooltip/propsType.d.ts +57 -0
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/CloseIcon.d.ts +2 -0
- package/es/ProTree/components/List.d.ts +17 -0
- package/es/ProTree/components/ProTree.d.ts +3 -0
- package/es/ProTree/components/ProTreeSelect/index.d.ts +5 -0
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +445 -0
- package/es/ProTree/components/SearchTitle.d.ts +10 -0
- package/es/ProTree/components/Tree.d.ts +27 -0
- package/es/ProTree/components/index.d.ts +4 -0
- package/es/ProTree/index.d.ts +3 -0
- package/es/ProTree/propsType.d.ts +818 -0
- package/es/ProTree/utils.d.ts +62 -0
- package/es/ProTreeModal/components/Cascader.d.ts +14 -0
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -0
- package/es/ProTreeModal/components/List.d.ts +21 -0
- package/es/ProTreeModal/components/SearchTitle.d.ts +6 -0
- package/es/ProTreeModal/components/SortableItem.d.ts +12 -0
- package/es/ProTreeModal/components/Tree.d.ts +25 -0
- package/es/ProTreeModal/components/Trigger.d.ts +21 -0
- package/es/ProTreeModal/components/index.d.ts +6 -0
- package/es/ProTreeModal/index.d.ts +4 -0
- package/es/ProTreeModal/propsType.d.ts +298 -0
- package/es/ProTreeModal/utils.d.ts +39 -0
- package/es/ProUpload/components/ButtonRender.d.ts +20 -0
- package/es/ProUpload/components/DragRender.d.ts +21 -0
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -0
- package/es/ProUpload/components/Example.d.ts +10 -0
- package/es/ProUpload/components/FileItem.d.ts +33 -0
- package/es/ProUpload/components/ImageRender.d.ts +19 -0
- package/es/ProUpload/index.d.ts +4 -0
- package/es/ProUpload/propsType.d.ts +264 -0
- package/es/ProUpload/uitls.d.ts +3 -0
- package/es/ProUtils/utils/index.d.ts +6 -0
- package/es/ProViewer/index.d.ts +4 -0
- package/es/ProViewer/propsType.d.ts +37 -0
- package/es/ProWaterMark/index.d.ts +4 -0
- package/es/ProWaterMark/propsType.d.ts +6 -0
- package/es/hooks/useDraggableRow.d.ts +34 -0
- package/es/index.d.ts +57 -0
- package/es/index.js +0 -2
- package/es/locale/en_US.d.ts +176 -0
- package/es/locale/index.d.ts +15 -0
- package/es/locale/zh_CN.d.ts +176 -0
- package/es/tokens.d.ts +83 -0
- package/es/utils/index.d.ts +24 -0
- package/package.json +12 -2
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import React, { Key } from 'react';
|
|
2
|
+
import { FormInstance } from 'antd/es/form';
|
|
3
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
4
|
+
/**
|
|
5
|
+
* 生成随机字符串
|
|
6
|
+
* @returns 随机字符串
|
|
7
|
+
*/
|
|
8
|
+
export declare const getRandom: () => string;
|
|
9
|
+
/**
|
|
10
|
+
* 构建 AntD Table 的 rowKey 函数,支持字符串/函数两种形式,
|
|
11
|
+
* 当用户指定字段值无效时(新增行尚未填写业务 key),自动降级到内部 record.rowKey。
|
|
12
|
+
* @param rowKey 用户传入的 rowKey prop
|
|
13
|
+
* @returns AntD Table 可用的 rowKey 字符串或函数
|
|
14
|
+
*/
|
|
15
|
+
export declare const buildTableRowKey: (rowKey?: string | number | symbol | ((record: any) => any)) => ((record: any) => string);
|
|
16
|
+
/**
|
|
17
|
+
* 表格行数据的浅比较:仅比较第一层字段引用/值,避免虚拟滚动时整行深比较开销。
|
|
18
|
+
* 行对象在本组件场景通常为扁平标量字段;同引用时由调用方另行处理。
|
|
19
|
+
*/
|
|
20
|
+
export declare const isRecordShallowEqual: (a: Record<string, any> | null | undefined, b: Record<string, any> | null | undefined) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 深层次对比两个对象且取出来差异值
|
|
23
|
+
* @param object 比较对象
|
|
24
|
+
* @param base 基准对象
|
|
25
|
+
* @returns 差异对象
|
|
26
|
+
*/
|
|
27
|
+
export declare const difference: <T extends Record<string, any>, U extends Record<string, any>>(object: T, base: U) => Record<string, any>;
|
|
28
|
+
/**
|
|
29
|
+
* 数组字段循环校验,解决validateFields无法批量校验的问题
|
|
30
|
+
* @param validateKeys 校验键数组
|
|
31
|
+
* @param form 表单实例
|
|
32
|
+
* @param rowName 行名称路径
|
|
33
|
+
* @returns 校验结果Promise
|
|
34
|
+
*/
|
|
35
|
+
export declare const customValidate: (validateKeys: string[], form: FormInstance, rowName: NamePath) => Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* 拆解数组names
|
|
38
|
+
* @param names 名称数组
|
|
39
|
+
* @returns 拆解后的字符串
|
|
40
|
+
*/
|
|
41
|
+
export declare const splitNames: (names: any[]) => string;
|
|
42
|
+
/**
|
|
43
|
+
* 把行内变更的子键映射回「所属列的字段标识」,并去重。
|
|
44
|
+
* - names 组合列:任一子键命中 → 该列合并名(splitNames(names)),与 Form.Item 注册名/dataIndex 对齐
|
|
45
|
+
* - 普通列:原键本身
|
|
46
|
+
*
|
|
47
|
+
* 用于行数据被联动改写(兄弟列 onFieldChange 回填)后,按真实字段名重校验与清理常驻报错,
|
|
48
|
+
* 修复 group 列旧报错不清的问题。
|
|
49
|
+
*/
|
|
50
|
+
export declare const resolveChangedFields: (changedKeys: string[], columns?: any[]) => string[];
|
|
51
|
+
/**
|
|
52
|
+
* 把联动回填后的子键,重新组合并写回 names 组合列的合并字段(store)。
|
|
53
|
+
*
|
|
54
|
+
* 背景:names 组合列真正被校验的是合并字段(splitNames(names),如 certType-certNo),
|
|
55
|
+
* 其值仅在渲染期由 getValueProps 从子键组合后写回 store。联动回填(兄弟列 onFieldChange)
|
|
56
|
+
* 只直接写入子键,不经过该字段的 normalize/渲染,导致合并字段 store 值未更新 →
|
|
57
|
+
* 按合并名校验时读到旧空值、红字不清。这里按当前行子键即时组合并写回,确保 validateFields 读到最新值。
|
|
58
|
+
*/
|
|
59
|
+
export declare const syncGroupCombinedValues: (form: FormInstance, rowPath: (string | number)[], changedKeys: string[], columns?: any[]) => void;
|
|
60
|
+
/**
|
|
61
|
+
* 获取中间formItem的name
|
|
62
|
+
* @param name 名称路径
|
|
63
|
+
* @param virtualKey 虚拟键
|
|
64
|
+
* @returns 完整名称路径数组
|
|
65
|
+
*/
|
|
66
|
+
export declare const getNamePath: (name: NamePath, virtualKey?: string) => (string | number)[];
|
|
67
|
+
/**
|
|
68
|
+
* 删除操作
|
|
69
|
+
* @param params 删除参数
|
|
70
|
+
*/
|
|
71
|
+
export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys, }: {
|
|
72
|
+
name: NamePath;
|
|
73
|
+
form: FormInstance;
|
|
74
|
+
virtualKey?: string;
|
|
75
|
+
selectedRowKeys: Key[];
|
|
76
|
+
}) => void;
|
|
77
|
+
/**
|
|
78
|
+
* 获取最终的disabled, 两种模式【子级优先,全局优先】
|
|
79
|
+
* 全局优先:globalControl为true时,全局控制
|
|
80
|
+
* 子级优先:globalControl为false时,子级控制
|
|
81
|
+
* @param params 禁用参数
|
|
82
|
+
* @returns 是否禁用
|
|
83
|
+
*/
|
|
84
|
+
export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: {
|
|
85
|
+
globalControl: boolean;
|
|
86
|
+
formDisabled?: boolean | ((record: any) => boolean);
|
|
87
|
+
column: any;
|
|
88
|
+
tabledDisabled?: boolean;
|
|
89
|
+
columnFieldProps?: any;
|
|
90
|
+
params: any[];
|
|
91
|
+
rowDisabled?: any;
|
|
92
|
+
}) => boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 表格自动滚动到报错位置
|
|
95
|
+
*/
|
|
96
|
+
export declare const handleScrollToError: () => void;
|
|
97
|
+
/**
|
|
98
|
+
* 把「首个报错列的 cellKey」映射成它在表头 th 中的可见列索引。
|
|
99
|
+
* 列序 = [选择列?(hasSelection 时占位 1), ...用户列];names 列的 cellKey 用 splitNames 结果。
|
|
100
|
+
* @returns 表头 th 下标;未命中返回 -1
|
|
101
|
+
*/
|
|
102
|
+
export declare const resolveErrorColumnIndex: (columns: any[], cellKey: string, hasSelection: boolean) => number;
|
|
103
|
+
/**
|
|
104
|
+
* 虚拟表格:横向滚动定位到「首个报错列」。
|
|
105
|
+
*
|
|
106
|
+
* 背景:rc-table 虚拟表格对「列」也做了虚拟化(BodyGrid 仅渲染横向视口内的列),
|
|
107
|
+
* 保存校验失败时报错列可能根本未渲染进 body DOM,无法用单元格测量定位(旧实现据此失效)。
|
|
108
|
+
* 而表头(thead)不被列虚拟化——渲染全部列且为真实测量宽度,故改以表头为列宽来源:
|
|
109
|
+
* 累加报错列之前各列宽、减去 fixed-left 列宽(固定列悬浮,不占滚动偏移)得目标 scrollLeft。
|
|
110
|
+
*
|
|
111
|
+
* 注意:ref.nativeElement 仅为 body 滚动容器,表头在其外层 table-container 内,需向上查找。
|
|
112
|
+
*/
|
|
113
|
+
export declare const scrollVirtualToErrorColumn: (tableRef: React.MutableRefObject<any>, columns: any[], cellKey?: string | null) => void;
|
|
114
|
+
/**
|
|
115
|
+
* 深copy一个对象,并过滤掉其中的React节点
|
|
116
|
+
* @param value 需要深拷贝的对象
|
|
117
|
+
* @returns 深拷贝后的对象,其中的React节点会被保留
|
|
118
|
+
*/
|
|
119
|
+
export declare function cloneDeepFilterNode<T>(value: T): T;
|
|
120
|
+
/**
|
|
121
|
+
* 分页校验
|
|
122
|
+
*/
|
|
123
|
+
export declare const onPageCheck: ({ form, name, value, columns, setState, page, pagination, isView, disabled, }: {
|
|
124
|
+
form: any;
|
|
125
|
+
name: any;
|
|
126
|
+
value: any;
|
|
127
|
+
columns: any;
|
|
128
|
+
setState: any;
|
|
129
|
+
page: any;
|
|
130
|
+
pagination: any;
|
|
131
|
+
isView: any;
|
|
132
|
+
disabled: any;
|
|
133
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DatePickerProps } from 'antd';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
RangePicker: () => import("@zat-design/utils/dist/esm/transforms/propTypes").Transform<any>;
|
|
4
|
+
DatePicker: (fieldProps?: {
|
|
5
|
+
format?: string;
|
|
6
|
+
picker?: DatePickerProps["picker"];
|
|
7
|
+
}) => {
|
|
8
|
+
normalize: (value: any, prevValue?: any, allValues?: any) => any;
|
|
9
|
+
getValueProps?: (value: import("rc-field-form/es/interface").StoreValue) => Record<string, unknown>;
|
|
10
|
+
shouldUpdate?: import("rc-field-form/es/Field").ShouldUpdate<any>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface UseEditTableErrorProps {
|
|
2
|
+
containerNode: HTMLElement | null;
|
|
3
|
+
className: string;
|
|
4
|
+
isEnabled: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const useEditTableError: ({ containerNode, className, isEnabled, }: UseEditTableErrorProps) => [number];
|
|
7
|
+
export default useEditTableError;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface UseShouldUpdateForTableProps {
|
|
2
|
+
rowParams: any[];
|
|
3
|
+
column: any;
|
|
4
|
+
shouldUpdateDebounce: number;
|
|
5
|
+
}
|
|
6
|
+
interface Result {
|
|
7
|
+
isEditable: any;
|
|
8
|
+
required: any;
|
|
9
|
+
rules: any;
|
|
10
|
+
fieldProps: any;
|
|
11
|
+
desensitization: any;
|
|
12
|
+
valueType: any;
|
|
13
|
+
component: any;
|
|
14
|
+
}
|
|
15
|
+
declare const useShouldUpdateForTable: (props: UseShouldUpdateForTableProps) => Result;
|
|
16
|
+
export default useShouldUpdateForTable;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { FormInstance } from 'antd';
|
|
2
|
+
import type { NamePath } from 'antd/es/form/interface';
|
|
3
|
+
/**
|
|
4
|
+
* 单元格规则装配 + 全量数据真实校验(脱离 DOM)。
|
|
5
|
+
*
|
|
6
|
+
* 背景:antd6 虚拟表格滚动时视口外的行会被卸载,其 Form.Item 字段未注册,
|
|
7
|
+
* form.validateFields 无法覆盖;本模块用 form store 里的全量数据 + 真实规则
|
|
8
|
+
* 逐行逐列离屏校验,解决「统一校验」缺口,并产出可常驻的真实报错文案。
|
|
9
|
+
*/
|
|
10
|
+
interface BuildCellRulesParams {
|
|
11
|
+
column: any;
|
|
12
|
+
rowData: any;
|
|
13
|
+
index: number;
|
|
14
|
+
form: FormInstance;
|
|
15
|
+
name: (string | number)[];
|
|
16
|
+
config: any;
|
|
17
|
+
}
|
|
18
|
+
interface BuiltCellRule {
|
|
19
|
+
/** 单元格 Form.Item 的 namePath(用于定位/messageVariables) */
|
|
20
|
+
namePath: (string | number)[];
|
|
21
|
+
/** 列在行内的稳定标识(与 transformColumns 的 dataIndex/key 一致),用于错误存储归集 */
|
|
22
|
+
cellKey: string;
|
|
23
|
+
/** 待校验值(names 列为组合数组) */
|
|
24
|
+
value: any;
|
|
25
|
+
/** 真实规则集合 */
|
|
26
|
+
rules: any[];
|
|
27
|
+
/** 字段 label,供 ${label} 文案插值 */
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 为单行单列装配真实校验规则与取值。
|
|
32
|
+
* 当该单元格处于查看/禁用态、或无任何规则时返回 null(跳过校验)。
|
|
33
|
+
*/
|
|
34
|
+
export declare const buildCellRules: ({ column, rowData, index, form, name, config, }: BuildCellRulesParams) => BuiltCellRule | null;
|
|
35
|
+
interface ValidateAllParams {
|
|
36
|
+
form: FormInstance;
|
|
37
|
+
name: NamePath;
|
|
38
|
+
columns: any[];
|
|
39
|
+
config: any;
|
|
40
|
+
}
|
|
41
|
+
export interface ValidateAllResult {
|
|
42
|
+
hasError: boolean;
|
|
43
|
+
/** rowKey -> { cellKey -> 错误文案数组 } */
|
|
44
|
+
errorMap: Record<string, Record<string, string[]>>;
|
|
45
|
+
/** 首个错误单元格的 namePath(用于滚动定位),无错误为 null */
|
|
46
|
+
firstErrorPath: (string | number)[] | null;
|
|
47
|
+
/** 首个错误行的 rowKey(用于横向滚动时定位错误行 DOM),无错误为 null */
|
|
48
|
+
firstErrorRowKey: string | null;
|
|
49
|
+
/** 首个错误列的 cellKey(names 列为 splitNames,普通列为列名),用于横向滚动定位列,无错误为 null */
|
|
50
|
+
firstErrorColumnKey: string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 对 form store 中 name 路径下的全量数组数据,逐行逐列用真实规则校验(脱离 DOM)。
|
|
54
|
+
*/
|
|
55
|
+
export declare const validateAllRows: ({ form, name, columns, config, }: ValidateAllParams) => Promise<ValidateAllResult>;
|
|
56
|
+
/**
|
|
57
|
+
* 外部错误存储:以 rowKey + cellKey 为键持久化真实报错文案。
|
|
58
|
+
* 它是「报错常驻」的真实来源——脱离 antd Field 实体生命周期,
|
|
59
|
+
* 行卸载后仍保留,重新挂载时回填显示。
|
|
60
|
+
*/
|
|
61
|
+
export interface ErrorStore {
|
|
62
|
+
/** 读取某单元格错误文案 */
|
|
63
|
+
get(rowKey: string | number, cellKey: string): string[] | undefined;
|
|
64
|
+
/** 读取整行错误 */
|
|
65
|
+
getRow(rowKey: string | number): Record<string, string[]> | undefined;
|
|
66
|
+
/** 全量替换(来自一次完整校验) */
|
|
67
|
+
setAll(errorMap: Record<string, Record<string, string[]>>): void;
|
|
68
|
+
/** 清理某单元格(用户修正后调用),整行清空时移除该行 */
|
|
69
|
+
clearCell(rowKey: string | number, cellKey: string): void;
|
|
70
|
+
/** 清空所有 */
|
|
71
|
+
clearAll(): void;
|
|
72
|
+
/** 是否为空 */
|
|
73
|
+
isEmpty(): boolean;
|
|
74
|
+
}
|
|
75
|
+
export declare const createErrorStore: () => ErrorStore;
|
|
76
|
+
interface RunUnifiedParams extends ValidateAllParams {
|
|
77
|
+
errorStore: ErrorStore;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 统一校验入口:对全量数据跑真实规则,写入 errorStore,返回是否有错与首个错误行索引。
|
|
81
|
+
* 供隐藏聚合校验字段在 form.validateFields() 时调用,从而覆盖视口外未挂载的行。
|
|
82
|
+
*/
|
|
83
|
+
export declare const runUnifiedValidation: ({ form, name, columns, config, errorStore, }: RunUnifiedParams) => Promise<{
|
|
84
|
+
hasError: boolean;
|
|
85
|
+
firstErrorIndex: number | null;
|
|
86
|
+
firstErrorRowKey: string | null;
|
|
87
|
+
firstErrorColumnKey: string | null;
|
|
88
|
+
}>;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProEnumType } from '../propsType';
|
|
2
|
+
interface Props extends Pick<ProEnumType, 'id' | 'value' | 'onChange' | 'dataSource'> {
|
|
3
|
+
fieldValue: string;
|
|
4
|
+
fieldLabel: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
allowClear?: boolean;
|
|
7
|
+
button?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Group: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Group;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProEnumType } from '../propsType';
|
|
2
|
+
interface Props extends Pick<ProEnumType, 'id' | 'value' | 'onChange' | 'dataSource'> {
|
|
3
|
+
fieldValue: string;
|
|
4
|
+
fieldLabel: string;
|
|
5
|
+
}
|
|
6
|
+
declare const ProEnumTag: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ProEnumTag;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DataOptionType } from '../propsType';
|
|
2
|
+
/**
|
|
3
|
+
* input code output [DataOption[],getEnumLabel]
|
|
4
|
+
* @param code
|
|
5
|
+
* const [options,fn] = useEnum("code")
|
|
6
|
+
*/
|
|
7
|
+
declare function useEnum(code: string): [DataOptionType[], (val: string, showCodeName?: boolean) => string];
|
|
8
|
+
/**
|
|
9
|
+
* input codes output { code1:DataOption[],code2:DataOption[] }
|
|
10
|
+
* @param codes
|
|
11
|
+
* const dicsMap = useEnum(["code1","code2"])
|
|
12
|
+
*/
|
|
13
|
+
declare function useEnum(codes: string[]): Record<string, DataOptionType[]>;
|
|
14
|
+
/**
|
|
15
|
+
* input code、value output label
|
|
16
|
+
* @param code
|
|
17
|
+
* @param value
|
|
18
|
+
* @param compose 展示 value-label
|
|
19
|
+
*/
|
|
20
|
+
declare function useEnum(code: string, value?: string, compose?: boolean): [string, DataOptionType];
|
|
21
|
+
/**
|
|
22
|
+
* input code、values array output [labels array, options array]
|
|
23
|
+
* @param code
|
|
24
|
+
* @param values 值数组
|
|
25
|
+
* @param compose 展示 value-label
|
|
26
|
+
* @returns [标签数组, 选项数组]
|
|
27
|
+
*/
|
|
28
|
+
declare function useEnum(code: string, values: (string | number)[], compose?: boolean): [string[], DataOptionType[]];
|
|
29
|
+
export default useEnum;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FrequentEnumConfig } from '../propsType';
|
|
2
|
+
type StorageType = 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
3
|
+
interface UseFrequentEnumRequestProps {
|
|
4
|
+
frequentEnums?: FrequentEnumConfig;
|
|
5
|
+
fieldNames: any;
|
|
6
|
+
clear: boolean;
|
|
7
|
+
storage: StorageType;
|
|
8
|
+
cacheKey: string;
|
|
9
|
+
dispatch: any;
|
|
10
|
+
dics: any;
|
|
11
|
+
dataSource: any;
|
|
12
|
+
}
|
|
13
|
+
declare const useFrequentEnumRequest: (props: UseFrequentEnumRequestProps, dispatch: any) => import("ahooks/lib/useRequest/src/types").Result<any, any>;
|
|
14
|
+
export default useFrequentEnumRequest;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import useEnum from './hooks/useEnum';
|
|
2
|
+
import getEnum from './utils/getEnum';
|
|
3
|
+
import type { ProEnumType } from './propsType';
|
|
4
|
+
declare const ProEnum: {
|
|
5
|
+
(props: ProEnumType): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
useEnum: typeof useEnum;
|
|
8
|
+
getEnum: typeof getEnum;
|
|
9
|
+
};
|
|
10
|
+
export default ProEnum;
|
package/es/ProEnum/index.js
CHANGED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { RadioProps, CheckboxProps, SegmentedProps } from 'antd';
|
|
3
|
+
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
|
4
|
+
import type { ProFormOtherType } from '../ProForm/propsType';
|
|
5
|
+
import type { PropSelectType } from '../ProSelect/propsType';
|
|
6
|
+
/**
|
|
7
|
+
* @description 数据选项类型
|
|
8
|
+
*/
|
|
9
|
+
export interface DataOptionType {
|
|
10
|
+
/**
|
|
11
|
+
* @description 展示标签
|
|
12
|
+
* @default -
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @description 选项值
|
|
17
|
+
* @default -
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
/**
|
|
21
|
+
* @description 是否禁用
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @description 允许扩展字段
|
|
27
|
+
*/
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @description 频繁变动的枚举配置
|
|
32
|
+
*/
|
|
33
|
+
export interface FrequentEnumConfig {
|
|
34
|
+
/**
|
|
35
|
+
* @description 需要替换的缓存枚举code列表
|
|
36
|
+
*/
|
|
37
|
+
enums: string[];
|
|
38
|
+
/**
|
|
39
|
+
* @description 请求服务函数
|
|
40
|
+
*/
|
|
41
|
+
service: Service<any, any>;
|
|
42
|
+
/**
|
|
43
|
+
* @description 请求选项配置
|
|
44
|
+
*/
|
|
45
|
+
options?: Options<any, any>;
|
|
46
|
+
/**
|
|
47
|
+
* @description 对频繁枚举返回数据进行格式化(独立于全局transformResponse)
|
|
48
|
+
* @param data 后台返回的数据
|
|
49
|
+
* @returns 格式化后的枚举数据
|
|
50
|
+
* @default -
|
|
51
|
+
*/
|
|
52
|
+
transformResponse?: (data: any) => Record<string, DataOptionType[]> | Promise<Record<string, DataOptionType[]>>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @description ProEnum配置类型
|
|
56
|
+
*/
|
|
57
|
+
export interface ProEnumConfigType {
|
|
58
|
+
/**
|
|
59
|
+
* @description 是否枚举主入口
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
main?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* @description 是否使用主入口枚举
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
share?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @description 是否开启调试 log
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
debugger?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @description 是否对数据进行清洗
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
clear?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @description 字段别名
|
|
80
|
+
* @default { label: 'label', value: 'value', children: 'children' }
|
|
81
|
+
*/
|
|
82
|
+
fieldNames?: {
|
|
83
|
+
label?: string;
|
|
84
|
+
value?: string;
|
|
85
|
+
children?: string;
|
|
86
|
+
[key: string]: string | undefined;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @description 缓存的key、默认 zat-design-pro-component-cacheKey
|
|
90
|
+
* @default "zat-design-pro-component-cacheKey"
|
|
91
|
+
*/
|
|
92
|
+
cacheKey: string;
|
|
93
|
+
/**
|
|
94
|
+
* @description 刷新请求、设置后每次进入都会重新请求
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
requestRefresh: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @description 存储位置、不设置、默认读取 globalConfig 里面的
|
|
100
|
+
* @default "localStorage"
|
|
101
|
+
*/
|
|
102
|
+
storage: 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
103
|
+
/**
|
|
104
|
+
* @description 默认静态枚举数据
|
|
105
|
+
* @default {}
|
|
106
|
+
*/
|
|
107
|
+
dataSource: Record<string, DataOptionType[]>;
|
|
108
|
+
/**
|
|
109
|
+
* @description 对后台返回数据进行格式化
|
|
110
|
+
* @param data 后台返回的数据
|
|
111
|
+
* @returns 格式化后的枚举数据
|
|
112
|
+
* @default -
|
|
113
|
+
*/
|
|
114
|
+
transformResponse?: (data: {
|
|
115
|
+
data: Record<string, DataOptionType[]>;
|
|
116
|
+
}) => Record<string, DataOptionType[]> | Promise<Record<string, DataOptionType[]>>;
|
|
117
|
+
/**
|
|
118
|
+
* @description 批量请求枚举接口
|
|
119
|
+
* @default -
|
|
120
|
+
*/
|
|
121
|
+
useRequest?: {
|
|
122
|
+
/**
|
|
123
|
+
* @description 请求服务函数
|
|
124
|
+
*/
|
|
125
|
+
service: Service<any, any>;
|
|
126
|
+
/**
|
|
127
|
+
* @description 请求选项配置
|
|
128
|
+
*/
|
|
129
|
+
options?: Options<any, any> & {
|
|
130
|
+
/**
|
|
131
|
+
* @description 指定请求的枚举码
|
|
132
|
+
*/
|
|
133
|
+
codes?: string[];
|
|
134
|
+
/**
|
|
135
|
+
* @description 忽略的枚举码
|
|
136
|
+
*/
|
|
137
|
+
ignoreCodes?: string[];
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* @description 频繁变动的枚举配置
|
|
142
|
+
* @default -
|
|
143
|
+
*/
|
|
144
|
+
frequentEnums?: FrequentEnumConfig;
|
|
145
|
+
/**
|
|
146
|
+
* @description 字典数据
|
|
147
|
+
* @default {}
|
|
148
|
+
*/
|
|
149
|
+
dics: Record<string, DataOptionType[]>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* @description 枚举组件类型枚举
|
|
153
|
+
*/
|
|
154
|
+
type EnumComponentType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag' | 'Group' | 'Segmented';
|
|
155
|
+
/**
|
|
156
|
+
* @description ProEnum基础属性类型
|
|
157
|
+
*/
|
|
158
|
+
export interface ProEnumBaseType {
|
|
159
|
+
/**
|
|
160
|
+
* @description 组件展示类型、默认 ProSelect
|
|
161
|
+
* @default "ProSelect"
|
|
162
|
+
*/
|
|
163
|
+
type?: EnumComponentType;
|
|
164
|
+
/**
|
|
165
|
+
* @description 用于自定义组件
|
|
166
|
+
* @default -
|
|
167
|
+
*/
|
|
168
|
+
component?: ReactNode;
|
|
169
|
+
/**
|
|
170
|
+
* @description 用于提交 code
|
|
171
|
+
* @default -
|
|
172
|
+
*/
|
|
173
|
+
code?: string | string[];
|
|
174
|
+
/**
|
|
175
|
+
* @description 字段别名
|
|
176
|
+
* @default -
|
|
177
|
+
*/
|
|
178
|
+
fieldNames?: Record<string, string>;
|
|
179
|
+
/**
|
|
180
|
+
* @description 是否查看模式
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
isView?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* @description 数据源
|
|
186
|
+
* @default -
|
|
187
|
+
*/
|
|
188
|
+
dataSource?: DataOptionType[];
|
|
189
|
+
/**
|
|
190
|
+
* @description 当前值
|
|
191
|
+
* @default -
|
|
192
|
+
*/
|
|
193
|
+
value: any;
|
|
194
|
+
/**
|
|
195
|
+
* @description 值变化回调
|
|
196
|
+
* @default -
|
|
197
|
+
*/
|
|
198
|
+
onChange?: (value: any) => void;
|
|
199
|
+
/**
|
|
200
|
+
* @description 远程请求接口
|
|
201
|
+
* @default -
|
|
202
|
+
*/
|
|
203
|
+
useRequest?: {
|
|
204
|
+
/**
|
|
205
|
+
* @description 请求服务函数
|
|
206
|
+
*/
|
|
207
|
+
service: Service<any, any>;
|
|
208
|
+
/**
|
|
209
|
+
* @description 请求选项
|
|
210
|
+
*/
|
|
211
|
+
options?: Options<any, any>;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* @description 对后台返回数据进行格式化
|
|
215
|
+
* @param data 后台返回的数据
|
|
216
|
+
* @returns 格式化后的选项数据
|
|
217
|
+
* @default -
|
|
218
|
+
*/
|
|
219
|
+
transformResponse?: (data: any) => DataOptionType[];
|
|
220
|
+
/**
|
|
221
|
+
* @description 是否合并数据
|
|
222
|
+
* @default false
|
|
223
|
+
*/
|
|
224
|
+
merge?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* @description 查看模式下为空展示
|
|
227
|
+
* @default "-"
|
|
228
|
+
*/
|
|
229
|
+
viewEmpty?: React.ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* @description 自定义选项渲染
|
|
232
|
+
* @default -
|
|
233
|
+
*/
|
|
234
|
+
optionRender?: any;
|
|
235
|
+
/**
|
|
236
|
+
* @description 显示 code-value 形式
|
|
237
|
+
* @default false
|
|
238
|
+
*/
|
|
239
|
+
showCodeName?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* @description 支持 {label:xx, value: xx} 形式
|
|
242
|
+
* @default false
|
|
243
|
+
*/
|
|
244
|
+
labelInValue?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* @description 其他表单属性
|
|
247
|
+
* @default -
|
|
248
|
+
*/
|
|
249
|
+
otherProps?: ProFormOtherType;
|
|
250
|
+
/**
|
|
251
|
+
* @description 是否允许清除
|
|
252
|
+
* @default false
|
|
253
|
+
*/
|
|
254
|
+
allowClear?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* @description 组件ID
|
|
257
|
+
* @default -
|
|
258
|
+
*/
|
|
259
|
+
id?: string;
|
|
260
|
+
/**
|
|
261
|
+
* @description 默认值
|
|
262
|
+
* @default -
|
|
263
|
+
*/
|
|
264
|
+
defaultValue?: any;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* @description ProSelect类型映射
|
|
268
|
+
*/
|
|
269
|
+
export type PropProSelectsMapType = {
|
|
270
|
+
/**
|
|
271
|
+
* @description 类型为ProSelect
|
|
272
|
+
* @default "ProSelect"
|
|
273
|
+
*/
|
|
274
|
+
type?: 'ProSelect';
|
|
275
|
+
} & PropSelectType;
|
|
276
|
+
/**
|
|
277
|
+
* @description Radio类型映射
|
|
278
|
+
*/
|
|
279
|
+
export type PropRadioPropsMapType = {
|
|
280
|
+
/**
|
|
281
|
+
* @description 类型为Radio
|
|
282
|
+
* @default "Radio"
|
|
283
|
+
*/
|
|
284
|
+
type?: 'Radio';
|
|
285
|
+
} & RadioProps;
|
|
286
|
+
/**
|
|
287
|
+
* @description Checkbox类型映射
|
|
288
|
+
*/
|
|
289
|
+
export type CheckboxPropsMapType = {
|
|
290
|
+
/**
|
|
291
|
+
* @description 类型为Checkbox
|
|
292
|
+
* @default "Checkbox"
|
|
293
|
+
*/
|
|
294
|
+
type?: 'Checkbox';
|
|
295
|
+
} & CheckboxProps;
|
|
296
|
+
/**
|
|
297
|
+
* @description Tag类型映射
|
|
298
|
+
*/
|
|
299
|
+
export interface TagPropsMapType {
|
|
300
|
+
/**
|
|
301
|
+
* @description 类型为Tag或Group
|
|
302
|
+
* @default -
|
|
303
|
+
*/
|
|
304
|
+
type?: 'Tag' | 'Group';
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @description Segmented类型映射
|
|
308
|
+
*/
|
|
309
|
+
export type SegmentedPropsMapType = {
|
|
310
|
+
/**
|
|
311
|
+
* @description 类型为Segmented
|
|
312
|
+
* @default "Segmented"
|
|
313
|
+
*/
|
|
314
|
+
type?: 'Segmented';
|
|
315
|
+
} & Omit<SegmentedProps, 'options'>;
|
|
316
|
+
/**
|
|
317
|
+
* @description ProEnum组件属性类型
|
|
318
|
+
*/
|
|
319
|
+
export type ProEnumType = Omit<ProEnumBaseType, 'type'> & (PropProSelectsMapType | PropRadioPropsMapType | CheckboxPropsMapType | TagPropsMapType | SegmentedPropsMapType);
|
|
320
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|