@zat-design/sisyphus-react 3.11.14-beta.11 → 3.11.14-beta.12

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.
Files changed (145) hide show
  1. package/.vscode/extensions.json +5 -0
  2. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +2 -2
  3. package/coverage/lcov-report/src/.umi/core/history.ts.html +3 -3
  4. package/coverage/lcov-report/src/.umi/core/index.html +8 -8
  5. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +3 -3
  6. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +6 -6
  7. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +2 -2
  8. package/coverage/lcov-report/src/.umi/core/routes.ts.html +3723 -624
  9. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +2 -2
  10. package/coverage/lcov-report/src/.umi/dumi/index.html +2 -2
  11. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +3 -3
  12. package/coverage/lcov-report/src/.umi/index.html +2 -2
  13. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +2 -2
  14. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +2 -2
  15. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +3 -3
  16. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +2 -2
  17. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +2 -2
  18. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +2 -2
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +2 -2
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +2 -2
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +2 -2
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +2 -2
  23. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +2 -2
  24. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +2 -2
  25. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +2 -2
  26. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +5 -5
  27. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +2 -2
  28. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +3 -3
  29. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +2 -2
  30. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +2 -2
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +2 -2
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +2 -2
  33. package/coverage/lcov-report/src/.umi/plugin-model/index.html +2 -2
  34. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +2 -2
  35. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +3 -3
  36. package/coverage/lcov-report/src/.umi/plugin-request/index.html +2 -2
  37. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +6 -6
  38. package/coverage/lcov-report/src/.umi/umi.ts.html +6 -6
  39. package/coverage/src/.umi/core/devScripts.ts.html +241 -0
  40. package/coverage/src/.umi/core/history.ts.html +148 -0
  41. package/coverage/src/.umi/core/index.html +206 -0
  42. package/coverage/src/.umi/core/plugin.ts.html +109 -0
  43. package/coverage/src/.umi/core/pluginRegister.ts.html +160 -0
  44. package/coverage/src/.umi/core/polyfill.ts.html +97 -0
  45. package/coverage/src/.umi/core/routes.ts.html +29149 -0
  46. package/coverage/src/.umi/core/umiExports.ts.html +112 -0
  47. package/coverage/src/.umi/dumi/index.html +116 -0
  48. package/coverage/src/.umi/dumi/layout.tsx.html +109 -0
  49. package/coverage/src/.umi/index.html +116 -0
  50. package/coverage/src/.umi/plugin-antd/index.html +116 -0
  51. package/coverage/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  52. package/coverage/src/.umi/plugin-helmet/exports.ts.html +94 -0
  53. package/coverage/src/.umi/plugin-helmet/index.html +116 -0
  54. package/coverage/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  55. package/coverage/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  56. package/coverage/src/.umi/plugin-initial-state/index.html +146 -0
  57. package/coverage/{lcov-report/src/.umi/dumi/demos → src/.umi/plugin-initial-state/models}/index.html +15 -15
  58. package/coverage/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  59. package/coverage/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  60. package/coverage/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  61. package/coverage/src/.umi/plugin-locale/index.html +161 -0
  62. package/coverage/src/.umi/plugin-locale/locale.tsx.html +268 -0
  63. package/coverage/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  64. package/coverage/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  65. package/coverage/src/.umi/plugin-model/Provider.tsx.html +202 -0
  66. package/coverage/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  67. package/coverage/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  68. package/coverage/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  69. package/coverage/src/.umi/plugin-model/helpers/index.html +146 -0
  70. package/coverage/src/.umi/plugin-model/index.html +146 -0
  71. package/coverage/src/.umi/plugin-model/runtime.tsx.html +121 -0
  72. package/coverage/src/.umi/plugin-model/useModel.tsx.html +298 -0
  73. package/coverage/src/.umi/plugin-request/index.html +116 -0
  74. package/coverage/src/.umi/plugin-request/request.ts.html +919 -0
  75. package/coverage/src/.umi/umi.ts.html +268 -0
  76. package/es/ProEditTable/components/Summary/index.d.ts +2 -2
  77. package/es/ProEditTable/index.js +12 -8
  78. package/es/ProEditTable/propsType.d.ts +39 -41
  79. package/es/ProEditTable/utils/index.d.ts +1 -1
  80. package/es/ProEditTable/utils/index.js +6 -4
  81. package/es/ProEditTable/utils/tools.d.ts +57 -22
  82. package/es/ProEditTable/utils/tools.js +47 -21
  83. package/es/ProEnum/propsType.d.ts +1 -1
  84. package/es/ProForm/components/combination/Group/propsType.d.ts +1 -1
  85. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
  86. package/es/ProForm/components/render/propsType.d.ts +3 -6
  87. package/es/ProForm/propsType.d.ts +5 -3
  88. package/es/ProForm/propsType.js +0 -1
  89. package/es/ProForm/utils/useForm.d.ts +1 -1
  90. package/es/ProForm/utils/useRules.d.ts +1 -1
  91. package/es/ProIcon/propsTypes.d.ts +0 -4
  92. package/es/ProStep/components/Anchor/index.d.ts +2 -1
  93. package/es/ProStep/components/Item/index.d.ts +1 -1
  94. package/es/ProStep/components/Item/index.js +6 -2
  95. package/es/ProStep/components/Listener/index.d.ts +4 -3
  96. package/es/ProStep/components/Listener/index.js +18 -4
  97. package/es/ProStep/index.d.ts +7 -7
  98. package/es/ProStep/index.js +7 -3
  99. package/es/ProStep/propsType.d.ts +145 -5
  100. package/es/ProStep/utils/index.d.ts +16 -3
  101. package/es/ProStep/utils/index.js +11 -2
  102. package/es/ProTable/components/FormatColumn/index.js +2 -4
  103. package/es/ProTable/propsType.d.ts +14 -20
  104. package/es/ProTooltip/propsType.d.ts +0 -3
  105. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -7
  106. package/es/ProTree/propsType.d.ts +0 -11
  107. package/es/ProTreeModal/propsType.d.ts +0 -2
  108. package/es/index.d.ts +15 -11
  109. package/es/index.js +1 -12
  110. package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
  111. package/lib/ProEditTable/index.js +12 -8
  112. package/lib/ProEditTable/propsType.d.ts +39 -41
  113. package/lib/ProEditTable/utils/index.d.ts +1 -1
  114. package/lib/ProEditTable/utils/index.js +6 -4
  115. package/lib/ProEditTable/utils/tools.d.ts +57 -22
  116. package/lib/ProEditTable/utils/tools.js +47 -21
  117. package/lib/ProEnum/propsType.d.ts +1 -1
  118. package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -1
  119. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
  120. package/lib/ProForm/components/render/propsType.d.ts +3 -6
  121. package/lib/ProForm/propsType.d.ts +5 -3
  122. package/lib/ProForm/propsType.js +0 -15
  123. package/lib/ProForm/utils/useForm.d.ts +1 -1
  124. package/lib/ProForm/utils/useRules.d.ts +1 -1
  125. package/lib/ProIcon/propsTypes.d.ts +0 -4
  126. package/lib/ProStep/components/Anchor/index.d.ts +2 -1
  127. package/lib/ProStep/components/Item/index.d.ts +1 -1
  128. package/lib/ProStep/components/Item/index.js +6 -2
  129. package/lib/ProStep/components/Listener/index.d.ts +4 -3
  130. package/lib/ProStep/components/Listener/index.js +18 -4
  131. package/lib/ProStep/index.d.ts +7 -7
  132. package/lib/ProStep/index.js +7 -3
  133. package/lib/ProStep/propsType.d.ts +145 -5
  134. package/lib/ProStep/utils/index.d.ts +16 -3
  135. package/lib/ProStep/utils/index.js +11 -2
  136. package/lib/ProTable/components/FormatColumn/index.js +2 -4
  137. package/lib/ProTable/propsType.d.ts +14 -20
  138. package/lib/ProTooltip/propsType.d.ts +0 -3
  139. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +0 -7
  140. package/lib/ProTree/propsType.d.ts +0 -11
  141. package/lib/ProTreeModal/propsType.d.ts +0 -2
  142. package/lib/index.d.ts +15 -11
  143. package/lib/index.js +7 -131
  144. package/package.json +1 -1
  145. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
@@ -6,8 +6,7 @@ import type { TooltipProps } from 'antd/es/tooltip';
6
6
  import type { NamePath } from 'antd/es/form/interface';
7
7
  import type { ColumnType, TableProps } from 'antd/es/table';
8
8
  import type { FormInstance, FormItemProps } from 'antd/es/form';
9
- import type { FunctionArgs, ProRule } from '../ProForm/propsType';
10
- import type { ProFormValueType, ColumnTypeMap } from '../ProForm/components/render/propsType';
9
+ import type { ProFormValueType, FunctionArgs, ProRule } from '../ProForm/components/render/propsType';
11
10
  import type { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
12
11
  /**
13
12
  * 操作类型定义
@@ -17,14 +16,14 @@ export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDel
17
16
  * 操作按钮展示控制函数类型
18
17
  * @template T 记录类型
19
18
  */
20
- export type ShowFunction<T> = (record?: T, options?: {
19
+ export type ShowFunction<T = any> = (record?: T, options?: {
21
20
  index: number;
22
21
  form: FormInstance;
23
22
  name: NamePath;
24
23
  namePath: NamePath;
25
24
  tableLength: number;
26
25
  selectedRows: T[];
27
- }) => Promise<any> | boolean | void;
26
+ }) => Promise<boolean> | boolean | void;
28
27
  /**
29
28
  * 选项属性接口
30
29
  */
@@ -61,10 +60,6 @@ export interface SummaryColumnProps {
61
60
  /** 前缀 */
62
61
  prefix?: ReactNode | string;
63
62
  }
64
- /**
65
- * 汇总列属性类型(基于接口)
66
- */
67
- export type SummaryColumnType = SummaryColumnProps;
68
63
  /**
69
64
  * 基础操作按钮属性
70
65
  * @template T 记录类型
@@ -110,36 +105,31 @@ export interface BaseActionProps<T = any> {
110
105
  /**
111
106
  * 按钮前置校验事件
112
107
  */
113
- onClick?: (record?: any, index?: number) => any;
108
+ onClick?: (record?: T, index?: number) => any;
114
109
  /**
115
110
  * 按钮前置校验事件
116
111
  */
117
- onHandle?: (record?: any, index?: number) => any;
112
+ onHandle?: (record?: T, index?: number) => any;
118
113
  /**
119
114
  * 支持antd的Button属性
120
115
  */
121
116
  buttonProps?: Omit<ButtonProps, 'type' | 'onClick'>;
122
117
  }
123
- /**
124
- * 基础操作按钮类型(基于接口)
125
- * @template T 记录类型
126
- */
127
- export type BaseActionType<T = any> = BaseActionProps<T>;
128
118
  /**
129
119
  * 规则函数类型
130
120
  * @template T 记录类型
131
121
  */
132
- export type RulesFn<T> = (text?: any, record?: T, options?: OptionsProps) => ProRule[] | void;
122
+ export type RulesFn<T = any> = (text?: any, record?: T, options?: OptionsProps) => ProRule[] | void;
133
123
  /**
134
124
  * 必填函数类型
135
125
  * @template T 记录类型
136
126
  */
137
- export type RequiredFn<T> = (text?: any, record?: T, options?: OptionsProps) => boolean | void;
127
+ export type RequiredFn<T = any> = (text?: any, record?: T, options?: OptionsProps) => boolean | void;
138
128
  /**
139
129
  * 视图渲染函数类型
140
130
  * @template T 记录类型
141
131
  */
142
- export type viewRenderFn<T> = (text?: any, record?: T, options?: OptionsProps) => string | number | ReactNode | void;
132
+ export type viewRenderFn<T = any> = (text?: any, record?: T, options?: OptionsProps) => string | number | ReactNode | void;
143
133
  /**
144
134
  * 表格列属性接口
145
135
  * @template Values 值类型
@@ -157,7 +147,7 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
157
147
  /** 是否可编辑 */
158
148
  isEditable?: boolean | RequiredFn<T>;
159
149
  /** 值类型 */
160
- valueType?: ProFormValueType | ((text?: any, record?: any, options?: OptionsProps) => ProFormValueType);
150
+ valueType?: ProFormValueType | ((text?: any, record?: T, options?: OptionsProps) => ProFormValueType);
161
151
  /** 提示信息 */
162
152
  tooltip?: string | ({
163
153
  icon?: string | ReactNode;
@@ -188,20 +178,15 @@ export type ProColumnsType<Values = any, T = any> = ProColumnsProps<Values, T>;
188
178
  * 可编辑表格列属性
189
179
  * @template K 键类型
190
180
  */
191
- export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnTypeMap<K, 'ProEditTable'>;
192
- /**
193
- * 可编辑表格列属性类型(基于类型)
194
- * @template K 键类型
195
- */
196
- export type ProEditTableColumnsType<K = any> = ProEditTableColumnsProps<K>;
181
+ export type ProEditTableColumnsProps<K = any> = ProColumnsProps<K, 'ProEditTable'>;
197
182
  /**
198
183
  * 状态接口
199
184
  */
200
- export interface State {
185
+ export interface StateProps {
201
186
  /** 单元格名称路径 */
202
187
  cellNamePath: NamePath[];
203
188
  /** 表格内部强制刷新开关 */
204
- forceUpdate: {};
189
+ forceUpdate: Record<string, any>;
205
190
  /** 正在编辑行的row-key集合 */
206
191
  editingKeys: string[];
207
192
  /** 当前选中行的row-key集合 */
@@ -219,13 +204,15 @@ export interface State {
219
204
  /**
220
205
  * 状态类型(基于接口)
221
206
  */
222
- export type StateType = State;
207
+ export type StateType = StateProps;
223
208
  /**
224
209
  * 可编辑表格引用属性
225
210
  */
226
211
  export interface ProEditTableRefProps {
227
212
  /** 获取内部状态 */
228
- getInternalState: () => StateType;
213
+ getInternalState: () => StateProps;
214
+ /** 设置内部状态 */
215
+ setInternalState: (state: Partial<StateProps>) => void;
229
216
  }
230
217
  /**
231
218
  * 可编辑表格引用属性类型(基于接口)
@@ -249,12 +236,11 @@ export type ActionDirectionType = ActionDirection;
249
236
  * 汇总信息配置
250
237
  * @template T 记录类型
251
238
  */
252
- export type SummaryConfig<T> = {
253
- columns: SummaryColumnType[];
239
+ export type SummaryProps<T = any> = {
240
+ columns: ProEditTableSummaryColumnType[];
254
241
  total?: boolean;
255
242
  fixed?: boolean | 'top' | 'bottom';
256
243
  } | TableProps<T>['summary'];
257
- export type SummaryConfigType<T = any> = SummaryConfig<T>;
258
244
  /**
259
245
  * 可编辑表格属性接口
260
246
  * @template T 记录类型
@@ -267,18 +253,18 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
267
253
  /**
268
254
  * 原始数据源,设置后可以对比更新后的数值
269
255
  */
270
- originalValues?: any;
256
+ originalValues?: Record<string, any>;
271
257
  /**
272
258
  * 可编辑表格的模式
273
259
  * @default multiple
274
260
  */
275
- mode?: ProEditTableModeType;
261
+ mode?: ProEditTableMode;
276
262
  /**
277
263
  * 可编辑表格的类型,单行编辑或者多行编辑
278
264
  * @deprecated 将于下个版本 4.0.0 被弃用
279
265
  * @default multiple
280
266
  */
281
- type?: ProEditTableModeType;
267
+ type?: ProEditTableMode;
282
268
  /**
283
269
  * 必填对齐方式, 默认右对齐
284
270
  * @default right
@@ -297,7 +283,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
297
283
  * 表格列的配置描述,扩展了FormItemProps属性
298
284
  * @default []
299
285
  */
300
- columns: ProEditTableColumnsProps[];
286
+ columns: ProEditTableColumnType<T>[];
301
287
  /**
302
288
  * 是否禁止编辑
303
289
  * @default false
@@ -352,7 +338,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
352
338
  /**
353
339
  * 自定义编辑模式的操作栏 单行编辑默认为编辑、删除、保存、取消;多行编辑为删除
354
340
  */
355
- actionProps?: BaseActionType<T>[] | boolean;
341
+ actionProps?: BaseActionProps<T>[] | boolean;
356
342
  /**
357
343
  * 自定义 table footer 左侧渲染, 配置后toolbarProps会失效
358
344
  */
@@ -360,7 +346,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
360
346
  /**
361
347
  * 自定义底部操作栏 默认为添加、删除(批量)
362
348
  */
363
- toolbarProps?: BaseActionType<T>[] | boolean;
349
+ toolbarProps?: BaseActionProps<T>[] | boolean;
364
350
  /**
365
351
  * 自定义底部操作栏跟随页面滚动
366
352
  */
@@ -372,11 +358,11 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
372
358
  /**
373
359
  * formItem的props
374
360
  */
375
- otherProps?: any;
361
+ otherProps?: Record<string, any>;
376
362
  /**
377
363
  * 底部合计配置
378
364
  */
379
- summary?: SummaryConfigType<T>;
365
+ summary?: ProEditTableSummaryConfigType<T>;
380
366
  /**
381
367
  * 自定义头部渲染
382
368
  */
@@ -400,7 +386,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
400
386
  /**
401
387
  * 操作按钮方向
402
388
  */
403
- actionDirection?: ActionDirectionType;
389
+ actionDirection?: ActionDirection;
404
390
  /**
405
391
  * 校验触发方式
406
392
  */
@@ -413,6 +399,18 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
413
399
  scrollFollowParent?: boolean;
414
400
  };
415
401
  }
402
+ /**
403
+ * 基础操作按钮类型(基于接口)
404
+ * @template T 记录类型
405
+ */
406
+ export type ProEditTableActionType<T = any> = BaseActionProps<T>;
407
+ export type ProEditTableSummaryConfigType<T = any> = SummaryProps<T>;
408
+ export type ProEditTableSummaryColumnType = SummaryColumnProps;
409
+ /**
410
+ * 可编辑表格列属性类型(基于类型)
411
+ * @template K 键类型
412
+ */
413
+ export type ProEditTableColumnType<K = any> = ProEditTableColumnsProps<K>;
416
414
  /**
417
415
  * 可编辑表格属性类型(基于接口)
418
416
  * @template T 记录类型
@@ -6,4 +6,4 @@
6
6
  * @param columns 表格配置数据
7
7
  * @param config
8
8
  */
9
- export declare const transformColumns: (columns: any[], config: any) => any;
9
+ export declare const transformColumns: (columns: any[], config: any) => any[];
@@ -262,11 +262,12 @@ var transformColumns = exports.transformColumns = function transformColumns() {
262
262
  var required = (0, _lodash.isBoolean)(item.required) ? item.required : false;
263
263
  if (typeof item.required === 'function') {
264
264
  var namePath = (0, _tools.getNamePath)(name, virtualKey);
265
- var rowData = form.getFieldValue([].concat((0, _toConsumableArray2.default)(namePath), [index])) || {};
265
+ var namePathArray = Array.isArray(namePath) ? namePath : [namePath];
266
+ var rowData = form.getFieldValue([].concat((0, _toConsumableArray2.default)(namePathArray), [index])) || {};
266
267
  required = item.required(rowData[columnName], rowData, {
267
268
  form: form,
268
269
  index: index,
269
- namePath: [].concat((0, _toConsumableArray2.default)(namePath), [index])
270
+ namePath: [].concat((0, _toConsumableArray2.default)(namePathArray), [index])
270
271
  });
271
272
  }
272
273
  // 样式处理
@@ -286,17 +287,18 @@ var transformColumns = exports.transformColumns = function transformColumns() {
286
287
  if (virtualKey && editingKeys.includes(record.rowKey)) {
287
288
  namePath = (0, _tools.getNamePath)(name, virtualKey);
288
289
  }
290
+ var namePathArray = Array.isArray(namePath) ? namePath : [namePath];
289
291
  var columnNamePath = (0, _lodash.isArray)(columnName) ? columnName : [columnName];
290
292
  index = _utils.tools.calc(firstIndex, '+', index);
291
293
  // 设置单元格formItem的namePath
292
- var cellName = columnName ? [].concat((0, _toConsumableArray2.default)(namePath), [index], (0, _toConsumableArray2.default)(columnNamePath)) : [].concat((0, _toConsumableArray2.default)(namePath), [index]);
294
+ var cellName = columnName ? [].concat((0, _toConsumableArray2.default)(namePathArray), [index], (0, _toConsumableArray2.default)(columnNamePath)) : [].concat((0, _toConsumableArray2.default)(namePathArray), [index]);
293
295
  var _text = text;
294
296
  // 当传入组合组件时,name需要重新组合一下,以防names中key与dataIndex重叠
295
297
  if (names === null || names === void 0 ? void 0 : names.length) {
296
298
  var nextDataIndex = (0, _tools.splitNames)(names);
297
299
  item.dataIndex = nextDataIndex;
298
300
  item.key = nextDataIndex;
299
- cellName = [].concat((0, _toConsumableArray2.default)(namePath), [index, nextDataIndex]);
301
+ cellName = [].concat((0, _toConsumableArray2.default)(namePathArray), [index, nextDataIndex]);
300
302
  // 给names返回数组值
301
303
  _text = names.map(function (item) {
302
304
  return record === null || record === void 0 ? void 0 : record[item];
@@ -1,32 +1,67 @@
1
+ import { Key } from 'react';
2
+ import { FormInstance } from 'antd/es/form';
3
+ import { NamePath } from 'antd/es/form/interface';
4
+ /**
5
+ * 生成随机字符串
6
+ * @returns 随机字符串
7
+ */
1
8
  export declare const getRandom: () => string;
2
- export declare const difference: (object: any, base: any) => unknown;
3
- export declare const customValidate: (validateKeys: any, form: any, rowName: any) => any;
9
+ /**
10
+ * 深层次对比两个对象且取出来差异值
11
+ * @param object 比较对象
12
+ * @param base 基准对象
13
+ * @returns 差异对象
14
+ */
15
+ export declare const difference: <T extends Record<string, any>, U extends Record<string, any>>(object: T, base: U) => Record<string, any>;
16
+ /**
17
+ * 数组字段循环校验,解决validateFields无法批量校验的问题
18
+ * @param validateKeys 校验键数组
19
+ * @param form 表单实例
20
+ * @param rowName 行名称路径
21
+ * @returns 校验结果Promise
22
+ */
23
+ export declare const customValidate: (validateKeys: string[], form: FormInstance, rowName: NamePath) => Promise<any>;
4
24
  /**
5
25
  * 拆解数组names
6
- * @param names [][]
7
- * @returns string
26
+ * @param names 名称数组
27
+ * @returns 拆解后的字符串
8
28
  */
9
- export declare const splitNames: (names: any[]) => any;
10
- export declare const getNamePath: (name: any, virtualKey: any) => any[];
11
- export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
12
- name: any;
13
- form: any;
14
- virtualKey: any;
15
- selectedRowKeys: any;
29
+ export declare const splitNames: (names: any[]) => string;
30
+ /**
31
+ * 获取中间formItem的name
32
+ * @param name 名称路径
33
+ * @param virtualKey 虚拟键
34
+ * @returns 完整名称路径数组
35
+ */
36
+ export declare const getNamePath: (name: NamePath, virtualKey?: string) => (string | number)[];
37
+ /**
38
+ * 删除操作
39
+ * @param params 删除参数
40
+ */
41
+ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys, }: {
42
+ name: NamePath;
43
+ form: FormInstance;
44
+ virtualKey?: string;
45
+ selectedRowKeys: Key[];
16
46
  }) => void;
17
- /** 获取最终的disabled, 两张模式【子级优先,全局优先】
47
+ /**
48
+ * 获取最终的disabled, 两张模式【子级优先,全局优先
18
49
  * 全局优先:globalControl为true时,全局控制
19
50
  * 子级优先:globalControl为false时,子级控制
20
- * @param globalControl 全局控制
21
- * @param formDisabled 表单的disabled
22
- * @param column 当前列
23
- * @param tabledDisabled 表格的disabled
24
- * @param columnFieldProps 当前列的fieldProps
25
- * @param params 当前列的参数
26
- * @param rowDisabled 行禁用参数
51
+ * @param params 禁用参数
52
+ * @returns 是否禁用
27
53
  */
28
- export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: any) => any;
29
- /** 表格自动滚动到报错位置
54
+ export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: {
55
+ globalControl: boolean;
56
+ formDisabled?: boolean | ((record: any) => boolean);
57
+ column: any;
58
+ tabledDisabled?: boolean;
59
+ columnFieldProps?: any;
60
+ params: any[];
61
+ rowDisabled?: any;
62
+ }) => boolean;
63
+ /**
64
+ * 表格自动滚动到报错位置
30
65
  */
31
66
  export declare const handleScrollToError: () => void;
32
67
  /**
@@ -34,7 +69,7 @@ export declare const handleScrollToError: () => void;
34
69
  * @param value 需要深拷贝的对象
35
70
  * @returns 深拷贝后的对象,其中的React节点会被保留
36
71
  */
37
- export declare function cloneDeepFilterNode(value: any): any;
72
+ export declare function cloneDeepFilterNode<T>(value: T): T;
38
73
  /**
39
74
  * 分页校验
40
75
  */
@@ -16,32 +16,47 @@ var _lodash = require("lodash");
16
16
  /* eslint-disable no-await-in-loop */
17
17
  /* eslint-disable no-restricted-syntax */
18
18
 
19
+ /**
20
+ * 生成随机字符串
21
+ * @returns 随机字符串
22
+ */
19
23
  var getRandom = exports.getRandom = function getRandom() {
20
24
  return Math.random().toString(36).slice(-6);
21
25
  };
22
- // 深层次对比两个对象且取出来差异值
26
+ /**
27
+ * 深层次对比两个对象且取出来差异值
28
+ * @param object 比较对象
29
+ * @param base 基准对象
30
+ * @returns 差异对象
31
+ */
23
32
  var difference = exports.difference = function difference(object, base) {
24
33
  var _changes = function changes(object, base) {
25
34
  return (0, _lodash.transform)(object, function (result, value, key) {
26
- if (!(0, _lodash.isEqual)(value, base[key])) {
27
- result[key] = (0, _lodash.isObject)(value) && (0, _lodash.isObject)(base[key]) ? _changes(value, base[key]) : value;
35
+ if (!(0, _lodash.isEqual)(value, base === null || base === void 0 ? void 0 : base[key])) {
36
+ result[key] = (0, _lodash.isObject)(value) && (0, _lodash.isObject)(base === null || base === void 0 ? void 0 : base[key]) ? _changes(value, base === null || base === void 0 ? void 0 : base[key]) : value;
28
37
  }
29
38
  });
30
39
  };
31
40
  return _changes(object, base);
32
41
  };
33
- // 数组字段循环校验,解决validateFields无法批量校验的问题
42
+ /**
43
+ * 数组字段循环校验,解决validateFields无法批量校验的问题
44
+ * @param validateKeys 校验键数组
45
+ * @param form 表单实例
46
+ * @param rowName 行名称路径
47
+ * @returns 校验结果Promise
48
+ */
34
49
  var customValidate = exports.customValidate = function customValidate(validateKeys, form, rowName) {
35
50
  var array = [];
36
51
  validateKeys.forEach(function (key) {
37
- array.push(rowName.concat(key));
52
+ array.push([].concat((0, _toConsumableArray2.default)(Array.isArray(rowName) ? rowName : [rowName]), [key]));
38
53
  });
39
54
  return form.validateFields(array);
40
55
  };
41
56
  /**
42
57
  * 拆解数组names
43
- * @param names [][]
44
- * @returns string
58
+ * @param names 名称数组
59
+ * @returns 拆解后的字符串
45
60
  */
46
61
  var splitNames = exports.splitNames = function splitNames(names) {
47
62
  var result;
@@ -58,14 +73,23 @@ var splitNames = exports.splitNames = function splitNames(names) {
58
73
  result = resultArray.join('-');
59
74
  return result;
60
75
  };
61
- // 获取中间formItem的name
76
+ /**
77
+ * 获取中间formItem的name
78
+ * @param name 名称路径
79
+ * @param virtualKey 虚拟键
80
+ * @returns 完整名称路径数组
81
+ */
62
82
  var getNamePath = exports.getNamePath = function getNamePath(name, virtualKey) {
63
83
  var nextName = (0, _lodash.cloneDeep)(Array.isArray(name) ? name : [name]);
64
- var lastValue = nextName[nextName.length - 1];
65
- nextName[nextName.length - 1] = "".concat(lastValue).concat(virtualKey ? "-".concat(virtualKey) : '');
84
+ var lastIndex = nextName.length - 1;
85
+ // 确保最后一个元素是字符串类型
86
+ nextName[lastIndex] = "".concat(nextName[lastIndex]).concat(virtualKey ? "-".concat(virtualKey) : '');
66
87
  return nextName;
67
88
  };
68
- // 删除操作
89
+ /**
90
+ * 删除操作
91
+ * @param params 删除参数
92
+ */
69
93
  var onDelete = exports.onDelete = function onDelete(_ref) {
70
94
  var name = _ref.name,
71
95
  form = _ref.form,
@@ -90,16 +114,12 @@ var onDelete = exports.onDelete = function onDelete(_ref) {
90
114
  }
91
115
  }
92
116
  };
93
- /** 获取最终的disabled, 两张模式【子级优先,全局优先】
117
+ /**
118
+ * 获取最终的disabled, 两张模式【子级优先,全局优先
94
119
  * 全局优先:globalControl为true时,全局控制
95
120
  * 子级优先:globalControl为false时,子级控制
96
- * @param globalControl 全局控制
97
- * @param formDisabled 表单的disabled
98
- * @param column 当前列
99
- * @param tabledDisabled 表格的disabled
100
- * @param columnFieldProps 当前列的fieldProps
101
- * @param params 当前列的参数
102
- * @param rowDisabled 行禁用参数
121
+ * @param params 禁用参数
122
+ * @returns 是否禁用
103
123
  */
104
124
  var getDisabled = exports.getDisabled = function getDisabled(_ref2) {
105
125
  var _ref3, _column$disabled;
@@ -112,7 +132,7 @@ var getDisabled = exports.getDisabled = function getDisabled(_ref2) {
112
132
  rowDisabled = _ref2.rowDisabled;
113
133
  var convertToBoolean = function convertToBoolean(value) {
114
134
  if (Array.isArray(value)) {
115
- return value;
135
+ return Boolean(value.length);
116
136
  }
117
137
  if (value === null || value === undefined || value === '') {
118
138
  return false;
@@ -166,7 +186,8 @@ var getDisabled = exports.getDisabled = function getDisabled(_ref2) {
166
186
  }
167
187
  return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
168
188
  };
169
- /** 表格自动滚动到报错位置
189
+ /**
190
+ * 表格自动滚动到报错位置
170
191
  */
171
192
  var handleScrollToError = exports.handleScrollToError = function handleScrollToError() {
172
193
  setTimeout(function () {
@@ -226,6 +247,11 @@ function cloneDeepFilterNode(value) {
226
247
  }
227
248
  });
228
249
  }
250
+ /**
251
+ * 判断值是否为空
252
+ * @param value 需要判断的值
253
+ * @returns 是否为空
254
+ */
229
255
  var _isNull = function isNull(value) {
230
256
  if (Array.isArray(value) && value.length) {
231
257
  return value.some(function (item) {
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { RadioProps, CheckboxProps } from 'antd';
3
3
  import { Service, Options } from 'ahooks/lib/useRequest/src/types';
4
- import type { ProFormOtherType } from '../index';
4
+ import type { ProFormOtherType } from '../ProForm/propsType';
5
5
  import type { PropSelectProps } from '../ProSelect/propsType';
6
6
  /**
7
7
  * @description 数据选项类型
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { FormItemProps, ModalFuncProps, SpaceProps } from 'antd';
3
3
  import { FormInstance } from 'antd/es/form/Form';
4
4
  import { NamePath } from 'antd/lib/form/interface';
5
- import type { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../../propsType';
5
+ import type { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../render/propsType';
6
6
  export interface SpaceType extends SpaceProps {
7
7
  /**
8
8
  * 是否紧凑合并
@@ -92,10 +92,10 @@ interface ProModalPropsType {
92
92
  /** 模态框选择器属性类型(结合Select和Input属性) */
93
93
  export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalPropsType;
94
94
  /** 配置选项类型 */
95
- export type ConfigOptionType = ConfigOption;
95
+ export type ProModalSelectConfigType = ConfigOption;
96
96
  /** 模态框属性类型 */
97
97
  export type ProModalType = Omit<ProModalPropsType, 'configOption'> & {
98
- configOption: ConfigOptionType;
98
+ configOption: ProModalSelectConfigType;
99
99
  };
100
100
  /** 模态框选择器类型(结合Select和Input属性) */
101
101
  export type ProModalSelectType = SelectProps & InputProps & ProModalType;
@@ -1,9 +1,8 @@
1
- import { ColProps, FormInstance, FormItemProps, ModalFuncProps } from 'antd';
1
+ import type { ColProps, FormInstance, FormItemProps, ModalFuncProps } from 'antd';
2
2
  import type { NamePath } from 'antd/es/form/interface';
3
3
  import React from 'react';
4
4
  import { validate, regExp } from '@zat-design/utils';
5
5
  import type { RuleObject } from 'antd/es/form';
6
- import * as componentMap from '../index';
7
6
  import type { Props as InputProps } from '../base/Input/propsType';
8
7
  import type { Props as InputNumberProps } from '../base/InputNumber';
9
8
  import type { Props as RadioProps } from '../base/Radio';
@@ -32,14 +31,12 @@ import type { GroupType as GroupCopyProps } from '../combination/Group/propsType
32
31
  import type { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
33
32
  import type { DistributiveOmit, DiffConfigType } from '../../propsType';
34
33
  import type { DiffOriginalParams } from '../../utils/diffOriginal';
35
- export type ComponentMap = keyof typeof componentMap;
36
34
  type ValidateKey = keyof typeof validate;
37
35
  type RegExpKey = keyof typeof regExp;
38
- interface ExtendType extends Omit<RuleObject, 'type'> {
36
+ export interface ProRule extends Omit<RuleObject, 'type'> {
39
37
  type?: ValidateKey | RegExpKey;
40
38
  message?: string;
41
39
  }
42
- export type ProRule = ExtendType;
43
40
  /**
44
41
  * percent 百分比 permillage 千分比 amount 金额
45
42
  */
@@ -292,6 +289,6 @@ export type ProEnumTableProps<Values> = ProEnumTableType<Values>;
292
289
  export type ProEnumFieldProps<Values, TT> = ProEnumFieldType<Values, TT>;
293
290
  export type FieldProps<T extends ControlProps, Values, TT> = FieldType<T, Values, TT>;
294
291
  export type ColumnPropsMap<Values = any, T = 'ProForm'> = ColumnTypeMap<Values, T>;
295
- export type ProFormColumnProps<Values = any> = ProFormColumnType<Values>;
292
+ export type ProColumnProps<Values = any> = ProFormColumnType<Values>;
296
293
  export type RenderProps<Values = any> = RenderType<Values>;
297
294
  export {};
@@ -4,8 +4,8 @@ import { NamePath } from 'antd/es/form/interface';
4
4
  import { StoreValue, Store } from 'rc-field-form/es/interface.d';
5
5
  import { ShouldUpdate } from 'rc-field-form/es/Field.d';
6
6
  import React, { ReactNode } from 'react';
7
- import type { ComponentMap, ProFormColumnType, ViewType } from './components/render/propsType';
8
- export * from './components/render/propsType';
7
+ import type { ProFormColumnType, ViewType } from './components/render/propsType';
8
+ import type { ProFormComponentType } from './components/index.d';
9
9
  export interface ButtonType extends ButtonProps {
10
10
  children?: any;
11
11
  }
@@ -33,7 +33,7 @@ export interface ProFormOtherType {
33
33
  name?: NamePath;
34
34
  names?: NamePath[];
35
35
  form?: FormInstance;
36
- type?: ComponentMap;
36
+ type?: ProFormComponentType;
37
37
  hiddenNames?: string[] | any[];
38
38
  colProps: ColProps;
39
39
  disabled: boolean;
@@ -111,3 +111,5 @@ export type FooterButtonProps = FooterButtonType;
111
111
  export type ProFormOtherProps = ProFormOtherType;
112
112
  export type DiffConfigProps = DiffConfigType;
113
113
  export type Transform = TransformType;
114
+ export type { ProFormColumnType } from './components/render/propsType';
115
+ export type { ProColumnProps } from './components/render/propsType';
@@ -3,20 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- otherKeys: true
8
- };
9
6
  exports.otherKeys = void 0;
10
- var _propsType = require("./components/render/propsType");
11
- Object.keys(_propsType).forEach(function (key) {
12
- if (key === "default" || key === "__esModule") return;
13
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
14
- if (key in exports && exports[key] === _propsType[key]) return;
15
- Object.defineProperty(exports, key, {
16
- enumerable: true,
17
- get: function get() {
18
- return _propsType[key];
19
- }
20
- });
21
- });
22
7
  var otherKeys = exports.otherKeys = ['isView', 'viewEmpty', 'label', 'valueType', 'viewType', 'name', 'names', 'form', 'type', 'hiddenNames'];
@@ -13,4 +13,4 @@ export interface FormInstanceOption {
13
13
  optimize?: boolean;
14
14
  formKey?: string;
15
15
  }
16
- export declare const useForm: <T>(originForm?: FormInstanceOption | ModifiedFormInstance<T>, options?: FormInstanceOption) => [ModifiedFormInstance<T>];
16
+ export declare const useForm: <T>(originForm?: ModifiedFormInstance<T> | FormInstanceOption, options?: FormInstanceOption) => [ModifiedFormInstance<T>];
@@ -1,5 +1,5 @@
1
1
  import type { InternalNamePath } from 'antd/lib/form/interface';
2
- import type { ProRule } from '../propsType';
2
+ import type { ProRule } from '../components/render/propsType';
3
3
  interface Props {
4
4
  rules?: ProRule[];
5
5
  required?: boolean;
@@ -172,9 +172,5 @@ export interface ProIconType {
172
172
  */
173
173
  buttonIcon?: boolean;
174
174
  }
175
- export type ModeType = ProIconModeType;
176
175
  export type ProIconProps = ProIconType;
177
- export type iconMap = ProIconMapType;
178
- export type themeMap = ProIconThemeMapType;
179
- export type actionMap = ProIconActionMapType;
180
176
  export {};
@@ -1,2 +1,3 @@
1
- export declare const MenuItem: (props: any) => import("react/jsx-runtime").JSX.Element;
1
+ import { MenuItemProps } from '../../propsType';
2
+ export declare const MenuItem: (props: MenuItemProps) => JSX.Element;
2
3
  export default MenuItem;
@@ -1,3 +1,3 @@
1
1
  import { ProStepItemType } from '../../propsType';
2
- declare const ProStepItem: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, ...restProps }: ProStepItemType) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ProStepItem: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, order, ...restProps }: ProStepItemType) => JSX.Element;
3
3
  export default ProStepItem;