@zat-design/sisyphus-react 3.11.14-beta.8 → 3.11.14-beta.9

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 (140) hide show
  1. package/es/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
  2. package/es/ProDrawerForm/components/ProModal/index.d.ts +2 -2
  3. package/es/ProDrawerForm/index.d.ts +1 -2
  4. package/es/ProDrawerForm/propsType.d.ts +38 -27
  5. package/es/ProDrawerForm/utils/index.d.ts +2 -2
  6. package/es/ProEditLabel/propsType.d.ts +2 -2
  7. package/es/ProEditTable/components/Summary/index.d.ts +2 -2
  8. package/es/ProEditTable/index.d.ts +2 -2
  9. package/es/ProEditTable/propsType.d.ts +232 -93
  10. package/es/ProEnum/propsType.d.ts +2 -2
  11. package/es/ProForm/components/FormFooter/index.d.ts +2 -2
  12. package/es/ProForm/components/FormFooter/propsType.d.ts +8 -3
  13. package/es/ProForm/components/base/Checkbox/index.d.ts +2 -2
  14. package/es/ProForm/components/base/Input/index.d.ts +2 -2
  15. package/es/ProForm/components/base/Input/propsType.d.ts +8 -4
  16. package/es/ProForm/components/base/InputNumber/index.d.ts +2 -2
  17. package/es/ProForm/components/base/Radio/index.d.ts +2 -2
  18. package/es/ProForm/components/base/RangePicker/index.d.ts +2 -2
  19. package/es/ProForm/components/base/Select/index.d.ts +2 -2
  20. package/es/ProForm/components/base/Switch/index.d.ts +2 -2
  21. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
  22. package/es/ProForm/components/base/TextArea/index.d.ts +2 -2
  23. package/es/ProForm/components/base/TimePicker/index.d.ts +2 -2
  24. package/es/ProForm/components/combination/Container/index.d.ts +2 -2
  25. package/es/ProForm/components/combination/Container/propsType.d.ts +9 -5
  26. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
  27. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
  28. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
  29. package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
  30. package/es/ProForm/components/combination/FormList/index.d.ts +2 -2
  31. package/es/ProForm/components/combination/FormList/propsType.d.ts +18 -10
  32. package/es/ProForm/components/combination/Group/index.d.ts +2 -2
  33. package/es/ProForm/components/combination/Group/propsType.d.ts +10 -5
  34. package/es/ProForm/components/combination/Group/utils.d.ts +4 -4
  35. package/es/ProForm/components/combination/ProCascader/index.d.ts +2 -1
  36. package/es/ProForm/components/combination/ProCascader/propsType.d.ts +6 -2
  37. package/es/ProForm/components/combination/ProCombination/index.d.ts +3 -3
  38. package/es/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
  39. package/es/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
  40. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +60 -8
  41. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
  42. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +14 -8
  43. package/es/ProForm/components/render/ChangedWrapper.d.ts +2 -2
  44. package/es/ProForm/components/render/Render.d.ts +2 -2
  45. package/es/ProForm/components/render/RenderFields.d.ts +4 -4
  46. package/es/ProForm/components/render/propsType.d.ts +54 -43
  47. package/es/ProForm/index.d.ts +2 -2
  48. package/es/ProForm/propsType.d.ts +22 -15
  49. package/es/ProForm/utils/transformValue.d.ts +2 -2
  50. package/es/ProForm/utils/useFieldProps.d.ts +3 -3
  51. package/es/ProForm/utils/useShouldUpdate.d.ts +3 -3
  52. package/es/ProSelect/propsType.d.ts +2 -2
  53. package/es/ProStep/components/Item/index.d.ts +2 -2
  54. package/es/ProStep/components/Step/index.d.ts +2 -2
  55. package/es/ProStep/index.d.ts +2 -2
  56. package/es/ProStep/index.js +12 -1
  57. package/es/ProStep/propsType.d.ts +60 -12
  58. package/es/ProStep/utils/index.d.ts +2 -2
  59. package/es/ProTable/components/FormatColumn/index.d.ts +2 -2
  60. package/es/ProTable/hooks/useAntdTable.d.ts +2 -2
  61. package/es/ProTable/index.d.ts +2 -2
  62. package/es/ProTable/propsType.d.ts +590 -39
  63. package/es/ProTooltip/index.d.ts +2 -2
  64. package/es/ProTooltip/propsType.d.ts +52 -9
  65. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -2
  66. package/es/ProTree/components/SearchTitle.d.ts +2 -2
  67. package/es/ProTree/propsType.d.ts +3 -3
  68. package/es/ProTreeModal/propsType.d.ts +2 -2
  69. package/es/ProUpload/propsType.d.ts +3 -3
  70. package/lib/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
  71. package/lib/ProDrawerForm/components/ProModal/index.d.ts +2 -2
  72. package/lib/ProDrawerForm/index.d.ts +1 -2
  73. package/lib/ProDrawerForm/propsType.d.ts +38 -27
  74. package/lib/ProDrawerForm/utils/index.d.ts +2 -2
  75. package/lib/ProEditLabel/propsType.d.ts +2 -2
  76. package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
  77. package/lib/ProEditTable/index.d.ts +2 -2
  78. package/lib/ProEditTable/propsType.d.ts +232 -93
  79. package/lib/ProEnum/propsType.d.ts +2 -2
  80. package/lib/ProForm/components/FormFooter/index.d.ts +2 -2
  81. package/lib/ProForm/components/FormFooter/propsType.d.ts +8 -3
  82. package/lib/ProForm/components/base/Checkbox/index.d.ts +2 -2
  83. package/lib/ProForm/components/base/Input/index.d.ts +2 -2
  84. package/lib/ProForm/components/base/Input/propsType.d.ts +8 -4
  85. package/lib/ProForm/components/base/InputNumber/index.d.ts +2 -2
  86. package/lib/ProForm/components/base/Radio/index.d.ts +2 -2
  87. package/lib/ProForm/components/base/RangePicker/index.d.ts +2 -2
  88. package/lib/ProForm/components/base/Select/index.d.ts +2 -2
  89. package/lib/ProForm/components/base/Switch/index.d.ts +2 -2
  90. package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
  91. package/lib/ProForm/components/base/TextArea/index.d.ts +2 -2
  92. package/lib/ProForm/components/base/TimePicker/index.d.ts +2 -2
  93. package/lib/ProForm/components/combination/Container/index.d.ts +2 -2
  94. package/lib/ProForm/components/combination/Container/propsType.d.ts +9 -5
  95. package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
  96. package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
  97. package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
  98. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
  99. package/lib/ProForm/components/combination/FormList/index.d.ts +2 -2
  100. package/lib/ProForm/components/combination/FormList/propsType.d.ts +18 -10
  101. package/lib/ProForm/components/combination/Group/index.d.ts +2 -2
  102. package/lib/ProForm/components/combination/Group/propsType.d.ts +10 -5
  103. package/lib/ProForm/components/combination/Group/utils.d.ts +4 -4
  104. package/lib/ProForm/components/combination/ProCascader/index.d.ts +2 -1
  105. package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +6 -2
  106. package/lib/ProForm/components/combination/ProCombination/index.d.ts +3 -3
  107. package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
  108. package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
  109. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +60 -8
  110. package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
  111. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +14 -8
  112. package/lib/ProForm/components/render/ChangedWrapper.d.ts +2 -2
  113. package/lib/ProForm/components/render/Render.d.ts +2 -2
  114. package/lib/ProForm/components/render/RenderFields.d.ts +4 -4
  115. package/lib/ProForm/components/render/propsType.d.ts +54 -43
  116. package/lib/ProForm/index.d.ts +2 -2
  117. package/lib/ProForm/propsType.d.ts +22 -15
  118. package/lib/ProForm/utils/transformValue.d.ts +2 -2
  119. package/lib/ProForm/utils/useFieldProps.d.ts +3 -3
  120. package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -3
  121. package/lib/ProSelect/propsType.d.ts +2 -2
  122. package/lib/ProStep/components/Item/index.d.ts +2 -2
  123. package/lib/ProStep/components/Step/index.d.ts +2 -2
  124. package/lib/ProStep/index.d.ts +2 -2
  125. package/lib/ProStep/index.js +12 -1
  126. package/lib/ProStep/propsType.d.ts +60 -12
  127. package/lib/ProStep/utils/index.d.ts +2 -2
  128. package/lib/ProTable/components/FormatColumn/index.d.ts +2 -2
  129. package/lib/ProTable/hooks/useAntdTable.d.ts +2 -2
  130. package/lib/ProTable/index.d.ts +2 -2
  131. package/lib/ProTable/propsType.d.ts +590 -39
  132. package/lib/ProTooltip/index.d.ts +2 -2
  133. package/lib/ProTooltip/propsType.d.ts +52 -9
  134. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -2
  135. package/lib/ProTree/components/SearchTitle.d.ts +2 -2
  136. package/lib/ProTree/propsType.d.ts +3 -3
  137. package/lib/ProTreeModal/propsType.d.ts +2 -2
  138. package/lib/ProUpload/propsType.d.ts +3 -3
  139. package/package.json +1 -1
  140. package/.vscode/extensions.json +0 -5
@@ -7,9 +7,16 @@ 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
9
  import type { FunctionArgs, ProRule } from '../ProForm/propsType';
10
- import { ProFormValueType, ColumnPropsMap } from '../ProForm/components/render/propsType';
10
+ import { ProFormValueType, ColumnTypeMap } from '../ProForm/components/render/propsType';
11
11
  import { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
12
+ /**
13
+ * 操作类型定义
14
+ */
12
15
  export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDelete' | 'custom';
16
+ /**
17
+ * 操作按钮展示控制函数类型
18
+ * @template T 记录类型
19
+ */
13
20
  export type ShowFunction<T> = (record?: T, options?: {
14
21
  index: number;
15
22
  form: FormInstance;
@@ -18,264 +25,396 @@ export type ShowFunction<T> = (record?: T, options?: {
18
25
  tableLength: number;
19
26
  selectedRows: T[];
20
27
  }) => Promise<any> | boolean | void;
28
+ /**
29
+ * 选项属性接口
30
+ */
21
31
  export interface OptionsProps {
32
+ /** 索引 */
22
33
  index: number;
34
+ /** 表单实例 */
23
35
  form: FormInstance;
36
+ /** 名称路径 */
24
37
  namePath: NamePath;
38
+ /** 名称 */
25
39
  name: NamePath;
26
40
  }
41
+ /**
42
+ * 选项属性类型(基于接口)
43
+ */
44
+ export type OptionsType = OptionsProps;
45
+ /**
46
+ * 汇总列属性
47
+ */
27
48
  export interface SummaryColumnProps {
49
+ /** 列唯一标识 */
28
50
  key: string;
51
+ /** 列索引 */
29
52
  index: number;
53
+ /** 列标题 */
30
54
  title?: string;
55
+ /** 跨列数 */
31
56
  colSpan?: number;
57
+ /** 值类型 */
32
58
  valueType?: string;
59
+ /** 精度 */
33
60
  precision?: number;
61
+ /** 前缀 */
34
62
  prefix?: ReactNode | string;
35
63
  }
64
+ /**
65
+ * 汇总列属性类型(基于接口)
66
+ */
67
+ export type SummaryColumnType = SummaryColumnProps;
68
+ /**
69
+ * 基础操作按钮属性
70
+ * @template T 记录类型
71
+ */
36
72
  export interface BaseActionProps<T = any> {
37
73
  /**
38
- * @description 按钮类型
39
- * @default -
74
+ * 按钮类型
40
75
  */
41
76
  type?: ActionType;
42
77
  /**
43
- * @description 按钮名称
44
- * @default -
78
+ * 按钮名称
45
79
  */
46
80
  label?: string | ReactNode;
47
81
  /**
48
- * @description 是否显示按钮
49
- * @default true
82
+ * 是否显示按钮
83
+ * @default true
50
84
  */
51
85
  show?: boolean | ShowFunction<T>;
52
86
  /**
53
- * @description 是否持久化(一直显示)操作按钮
54
- * @default true
55
- */
87
+ * 是否持久化(一直显示)操作按钮
88
+ * @default true
89
+ */
56
90
  persistence?: boolean;
57
91
  /**
58
- * @description 是否禁止操作
59
- * @default true
92
+ * 是否禁止操作
93
+ * @default true
60
94
  */
61
95
  disabled?: boolean | ShowFunction<T>;
62
96
  /**
63
- * @description 添加是否自定义打开弹框
64
- * @default false
97
+ * 添加是否自定义打开弹框
98
+ * @default false
65
99
  */
66
100
  isSelectModal?: boolean;
67
101
  /**
68
- * @description 删除是否开启二次确认
69
- * @default true
102
+ * 删除是否开启二次确认
103
+ * @default true
70
104
  */
71
105
  needConfirm?: boolean;
72
106
  /**
73
- * @description 按钮是否禁止操作
74
- * @default -
107
+ * 按钮是否禁止操作
75
108
  */
76
109
  isEditable?: boolean;
77
110
  /**
78
- * @description 按钮前置校验事件
79
- * @default -
111
+ * 按钮前置校验事件
80
112
  */
81
113
  onClick?: (record?: any, index?: number) => any;
82
114
  /**
83
- * @description 按钮前置校验事件
84
- * @default -
115
+ * 按钮前置校验事件
85
116
  */
86
117
  onHandle?: (record?: any, index?: number) => any;
87
118
  /**
88
- * @description 支持antd的Button属性
89
- * @default -
119
+ * 支持antd的Button属性
90
120
  */
91
121
  buttonProps?: Omit<ButtonProps, 'type' | 'onClick'>;
92
122
  }
123
+ /**
124
+ * 基础操作按钮类型(基于接口)
125
+ * @template T 记录类型
126
+ */
127
+ export type BaseActionType<T = any> = BaseActionProps<T>;
128
+ /**
129
+ * 规则函数类型
130
+ * @template T 记录类型
131
+ */
93
132
  export type RulesFn<T> = (text?: any, record?: T, options?: OptionsProps) => ProRule[] | void;
133
+ /**
134
+ * 必填函数类型
135
+ * @template T 记录类型
136
+ */
94
137
  export type RequiredFn<T> = (text?: any, record?: T, options?: OptionsProps) => boolean | void;
138
+ /**
139
+ * 视图渲染函数类型
140
+ * @template T 记录类型
141
+ */
95
142
  export type viewRenderFn<T> = (text?: any, record?: T, options?: OptionsProps) => string | number | ReactNode | void;
143
+ /**
144
+ * 表格列属性接口
145
+ * @template Values 值类型
146
+ * @template T 记录类型
147
+ */
96
148
  export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemProps<Values>, 'rules' | 'required'>, ColumnType<Values> {
149
+ /** 是否必填 */
97
150
  required?: boolean | RequiredFn<T>;
151
+ /** 标签是否必填 */
98
152
  labelRequired?: boolean;
153
+ /** 字段名 */
99
154
  name?: NamePath;
155
+ /** 多字段名 */
100
156
  names?: NamePath[];
157
+ /** 是否可编辑 */
101
158
  isEditable?: boolean | RequiredFn<T>;
159
+ /** 值类型 */
102
160
  valueType?: ProFormValueType | ((text?: any, record?: any, options?: OptionsProps) => ProFormValueType);
161
+ /** 提示信息 */
103
162
  tooltip?: string | ({
104
163
  icon?: string | ReactNode;
105
164
  } & TooltipProps);
165
+ /** 组件 */
106
166
  component?: string | number | ReactNode | viewRenderFn<T>;
167
+ /** 视图渲染 */
107
168
  viewRender?: string | number | ReactNode | viewRenderFn<T>;
169
+ /** 隐藏的字段名 */
108
170
  hiddenNames?: NamePath[] | NamePath[][];
171
+ /** 校验规则 */
109
172
  rules?: ProRule[] | RulesFn<T>;
173
+ /** 确认操作 */
110
174
  confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
175
+ /** 依赖项 */
111
176
  dependencies?: NamePath[];
177
+ /** 差异处理 */
112
178
  onDiff?: DiffOriginalParams['onDiff'];
113
179
  [key: string]: any;
114
180
  }
115
- export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
181
+ /**
182
+ * 表格列属性类型(基于接口)
183
+ * @template Values 值类型
184
+ * @template T 记录类型
185
+ */
186
+ export type ProColumnsType<Values = any, T = any> = ProColumnsProps<Values, T>;
187
+ /**
188
+ * 可编辑表格列属性
189
+ * @template K 键类型
190
+ */
191
+ export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnTypeMap<K, 'ProEditTable'>;
192
+ /**
193
+ * 可编辑表格列属性类型(基于类型)
194
+ * @template K 键类型
195
+ */
196
+ export type ProEditTableColumnsType<K = any> = ProEditTableColumnsProps<K>;
197
+ /**
198
+ * 状态接口
199
+ */
116
200
  export interface State {
201
+ /** 单元格名称路径 */
117
202
  cellNamePath: NamePath[];
203
+ /** 表格内部强制刷新开关 */
118
204
  forceUpdate: {};
205
+ /** 正在编辑行的row-key集合 */
119
206
  editingKeys: string[];
207
+ /** 当前选中行的row-key集合 */
120
208
  selectedRowKeys: Key[];
209
+ /** 当前选中行数据集合 */
121
210
  selectedRows: any[];
211
+ /** 虚拟键 */
122
212
  virtualKey: string;
213
+ /** 分页信息 */
123
214
  page: {
124
215
  pageNum: number;
125
216
  pageSize: number;
126
217
  };
127
218
  }
219
+ /**
220
+ * 状态类型(基于接口)
221
+ */
222
+ export type StateType = State;
223
+ /**
224
+ * 可编辑表格引用属性
225
+ */
128
226
  export interface ProEditTableRefProps {
129
- getInternalState: () => State;
227
+ /** 获取内部状态 */
228
+ getInternalState: () => StateType;
130
229
  }
230
+ /**
231
+ * 可编辑表格引用属性类型(基于接口)
232
+ */
233
+ export type ProEditTableRefType = ProEditTableRefProps;
234
+ /**
235
+ * 可编辑表格模式类型
236
+ */
237
+ export type ProEditTableMode = 'single' | 'multiple' | 'cell';
238
+ export type ProEditTableModeType = ProEditTableMode;
239
+ /**
240
+ * 表格插入类型
241
+ */
242
+ export type InsertType = 'before' | 'after';
243
+ /**
244
+ * 操作按钮方向
245
+ */
246
+ export type ActionDirection = 'vertical' | 'horizontal';
247
+ export type ActionDirectionType = ActionDirection;
248
+ /**
249
+ * 汇总信息配置
250
+ * @template T 记录类型
251
+ */
252
+ export type SummaryConfig<T> = {
253
+ columns: SummaryColumnType[];
254
+ total?: boolean;
255
+ fixed?: boolean | 'top' | 'bottom';
256
+ } | TableProps<T>['summary'];
257
+ export type SummaryConfigType<T = any> = SummaryConfig<T>;
258
+ /**
259
+ * 可编辑表格属性接口
260
+ * @template T 记录类型
261
+ */
131
262
  export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChange' | 'summary'> {
132
263
  /**
133
- * @description 可编辑表格的 form 实例,使用 Form.useForm 生成后使用
134
- * @default -
264
+ * 可编辑表格的 form 实例,使用 Form.useForm 生成后使用
135
265
  */
136
266
  form?: FormInstance;
137
267
  /**
138
- * @description 原始数据源,设置后可以对比更新后的数值
139
- * @default -
268
+ * 原始数据源,设置后可以对比更新后的数值
140
269
  */
141
270
  originalValues?: any;
142
271
  /**
143
- * @description 原始数据源,是否tooltip显示
144
- * @default -
272
+ * 可编辑表格的模式
273
+ * @default multiple
145
274
  */
146
- mode?: 'single' | 'multiple' | 'cell';
275
+ mode?: ProEditTableModeType;
147
276
  /**
148
- * @description 可编辑表格的类型,单行编辑或者多行编辑
149
- * @deprecated 将于下个版本 4.0.0 被弃用
150
- * @default multiple
277
+ * 可编辑表格的类型,单行编辑或者多行编辑
278
+ * @deprecated 将于下个版本 4.0.0 被弃用
279
+ * @default multiple
151
280
  */
152
- type?: 'single' | 'multiple' | 'cell';
281
+ type?: ProEditTableModeType;
153
282
  /**
154
- * @description 必填对齐方式, 默认右对齐
155
- * @default right
283
+ * 必填对齐方式, 默认右对齐
284
+ * @default right
156
285
  */
157
286
  requiredAlign?: 'left' | 'right';
158
287
  /**
159
- * @description 同 dataSource,传入一个数组,是 table 渲染的元数据
160
- * @default undefined
288
+ * 同 dataSource,传入一个数组,是 table 渲染的元数据
289
+ * @default undefined
161
290
  */
162
291
  value?: T[];
163
292
  /**
164
- * @description dataSource 修改时触发,删除和修改都会触发,如果设置了 value,ProEditTable 会成为一个受控组件
165
- * @default -
293
+ * dataSource 修改时触发,删除和修改都会触发,如果设置了 value,ProEditTable 会成为一个受控组件
166
294
  */
167
295
  onChange?: (list: T[]) => void;
168
296
  /**
169
- * @description 表格列的配置描述,扩展了FormItemProps属性
170
- * @default []
297
+ * 表格列的配置描述,扩展了FormItemProps属性
298
+ * @default []
171
299
  */
172
300
  columns: ProEditTableColumnsProps[];
173
301
  /**
174
- * @description 是否禁止编辑
175
- * @default false
302
+ * 是否禁止编辑
303
+ * @default false
176
304
  */
177
305
  disabled?: boolean;
178
306
  /**
179
- * @description 是否开启斑马纹
180
- * @default true
307
+ * 是否开启斑马纹
308
+ * @default true
181
309
  */
182
310
  stripe?: boolean;
183
311
  /**
184
- * @description 可编辑表格新增时数据插入方式,头部插入或者尾部插入
185
- * @default after
312
+ * 可编辑表格新增时数据插入方式,头部插入或者尾部插入
313
+ * @default after
186
314
  */
187
- insertType?: 'before' | 'after';
315
+ insertType?: InsertType;
188
316
  /**
189
- * @description 字段名,支持数组
190
- * @default -
317
+ * 字段名,支持数组
191
318
  */
192
319
  name?: string | number | (string | number)[];
193
320
  /**
194
- * @description 是否可拖拽排序
195
- * @default -
321
+ * 是否可拖拽排序
196
322
  */
197
323
  draggable?: boolean;
198
324
  /**
199
- * @description 是否开启虚拟列表(scroll,x,y必须为固定值)
200
- * @default -
201
- */
325
+ * 是否开启虚拟列表(scroll,x,y必须为固定值)
326
+ */
202
327
  virtual?: boolean;
203
328
  /**
204
- * @description 空列表状态时,自定义添加按钮
205
- * @default 点击添加
329
+ * 空列表状态时,自定义添加按钮
330
+ * @default 点击添加
206
331
  */
207
332
  emptyBtnText?: string;
208
333
  /**
209
- * @description 只能编辑一行的的提示
210
- * @default 请先保存数据
334
+ * 只能编辑一行的的提示
335
+ * @default 请先保存数据
211
336
  */
212
337
  onlyOneLineMsg?: string;
213
338
  /**
214
- * @description 单行删除时弹出的确认框提示消息
215
- * @default 您确定要删除该行数据吗?
339
+ * 单行删除时弹出的确认框提示消息
340
+ * @default 您确定要删除该行数据吗?
216
341
  */
217
342
  deletePoConfirmMsg?: string;
218
343
  /**
219
- * @description 多行删除时弹出的确认框提示消息
220
- * @default 您确定要删除选中的数据吗?
344
+ * 多行删除时弹出的确认框提示消息
345
+ * @default 您确定要删除选中的数据吗?
221
346
  */
222
347
  mulDeletePoConfirmMsg?: string;
223
348
  /**
224
- * @description 自定义编辑模式的操作栏 单行编辑默认为编辑、删除、保存、取消;多行编辑为删除
225
- * @default -
349
+ * 自定义编辑模式的操作栏宽度
226
350
  */
227
351
  actionWidth?: ColumnType<T>['width'];
228
352
  /**
229
- * @description 自定义编辑模式的操作栏 单行编辑默认为编辑、删除、保存、取消;多行编辑为删除
230
- * @default -
353
+ * 自定义编辑模式的操作栏 单行编辑默认为编辑、删除、保存、取消;多行编辑为删除
231
354
  */
232
- actionProps?: BaseActionProps<T>[] | boolean;
355
+ actionProps?: BaseActionType<T>[] | boolean;
233
356
  /**
234
- * @description 自定义 table footer 左侧渲染, 配置后toolbarProps会失效
235
- * @default -
357
+ * 自定义 table footer 左侧渲染, 配置后toolbarProps会失效
236
358
  */
237
359
  footerRender?: ReactNode;
238
360
  /**
239
- * @description 自定义底部操作栏 默认为添加、删除(批量)
240
- * @default -
361
+ * 自定义底部操作栏 默认为添加、删除(批量)
241
362
  */
242
- toolbarProps?: BaseActionProps<T>[] | boolean;
363
+ toolbarProps?: BaseActionType<T>[] | boolean;
243
364
  /**
244
- * @description 自定义底部操作栏跟随页面滚动
245
- * @default -
365
+ * 自定义底部操作栏跟随页面滚动
246
366
  */
247
367
  toolbarSticky?: boolean | Omit<AffixProps, 'children'>;
248
368
  /**
249
- * @description 最大可添加数量
250
- * @default -
369
+ * 最大可添加数量
251
370
  */
252
371
  max?: number;
253
372
  /**
254
- * @description formItem的props
255
- * @default -
373
+ * formItem的props
256
374
  */
257
375
  otherProps?: any;
258
376
  /**
259
- * @description 底部合计配置
260
- * @default -
377
+ * 底部合计配置
261
378
  */
262
- summary?: {
263
- columns: SummaryColumnProps[];
264
- total?: boolean;
265
- fixed?: boolean | 'top' | 'bottom';
266
- } | TableProps<T>['summary'];
379
+ summary?: SummaryConfigType<T>;
267
380
  /**
268
- * @description 底部合计配置
269
- * @default -
381
+ * 自定义头部渲染
270
382
  */
271
383
  headerRender?: ReactNode;
384
+ /**
385
+ * 行是否禁用
386
+ */
272
387
  rowDisabled?: (record?: T) => string | boolean;
388
+ /**
389
+ * 行是否可拖拽
390
+ */
273
391
  rowDraggable?: (record?: T) => string | boolean;
392
+ /**
393
+ * 拖拽事件处理
394
+ */
274
395
  onDrag?: (event: DragEndEvent, dataSource: T[]) => T[];
396
+ /**
397
+ * 引用对象
398
+ */
275
399
  ref?: any;
276
- actionDirection?: 'vertical' | 'horizontal';
400
+ /**
401
+ * 操作按钮方向
402
+ */
403
+ actionDirection?: ActionDirectionType;
404
+ /**
405
+ * 校验触发方式
406
+ */
277
407
  validateTrigger?: string | string[];
408
+ /**
409
+ * 差异配置
410
+ */
278
411
  diffConfig?: {
412
+ /** 是否跟随父元素滚动 */
279
413
  scrollFollowParent?: boolean;
280
414
  };
281
415
  }
416
+ /**
417
+ * 可编辑表格属性类型(基于接口)
418
+ * @template T 记录类型
419
+ */
420
+ export type ProEditTableType<T = any> = ProEditTableProps<T>;
@@ -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 { ProFormOtherProps } from '../index';
4
+ import { ProFormOtherType } from '../index';
5
5
  import { PropSelectProps } from '../ProSelect/propsType';
6
6
  /**
7
7
  * @description 数据选项类型
@@ -212,7 +212,7 @@ export interface ProEnumBaseType {
212
212
  * @description 其他表单属性
213
213
  * @default -
214
214
  */
215
- otherProps?: ProFormOtherProps;
215
+ otherProps?: ProFormOtherType;
216
216
  /**
217
217
  * @description 是否允许清除
218
218
  * @default false
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FooterRenderProps } from './propsType';
2
+ import { FooterRenderType } from './propsType';
3
3
  export declare const PRO_FORM_CACHE = "PRO_FORM_CACHE";
4
- declare const FormFooter: React.FC<FooterRenderProps>;
4
+ declare const FormFooter: React.FC<FooterRenderType>;
5
5
  export default FormFooter;
@@ -2,18 +2,23 @@ import { ButtonProps, ColProps, FormInstance } from 'antd';
2
2
  export interface ButtonItem extends ButtonProps {
3
3
  children?: any;
4
4
  }
5
- export interface FooterButtonProps {
5
+ export interface FooterButtonType {
6
6
  okButtonProps?: ButtonItem;
7
7
  cancelButtonProps?: ButtonItem;
8
8
  }
9
- export interface FooterRenderProps {
9
+ export interface FooterRenderType {
10
10
  okText?: string;
11
11
  cancelText?: string;
12
12
  onOk?: () => void;
13
13
  onCancel?: () => void;
14
14
  footerColProps?: ColProps;
15
- footer?: FooterButtonProps;
15
+ footer?: FooterButtonType;
16
16
  confirmLoading?: boolean;
17
17
  formId?: string;
18
18
  form: FormInstance;
19
19
  }
20
+ /**
21
+ * 兼容旧命名导出
22
+ */
23
+ export type FooterButtonProps = FooterButtonType;
24
+ export type FooterRenderProps = FooterRenderType;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { CheckboxGroupProps } from 'antd/es/checkbox';
3
- import { ProFormOtherProps } from '../../../propsType';
3
+ import { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<CheckboxGroupProps, 'options'> {
5
5
  dataSource: any[];
6
6
  fieldNames?: {
7
7
  label: string;
8
8
  value: string;
9
9
  };
10
- otherProps?: ProFormOtherProps;
10
+ otherProps?: ProFormOtherType;
11
11
  isView?: boolean;
12
12
  }
13
13
  declare const Checkbox: React.FC<Props>;
@@ -1,3 +1,3 @@
1
- import { IProps } from './propsType';
2
- declare const Input: (props: IProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { Props } from './propsType';
2
+ declare const Input: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Input;
@@ -1,7 +1,7 @@
1
1
  import { InputProps } from 'antd';
2
2
  import { FormInstance } from 'antd/es/form/Form';
3
- import { ProFormOtherProps } from '../../../propsType';
4
- export interface ProFieldProps<T = any> {
3
+ import { ProFormOtherType } from '../../../propsType';
4
+ export interface ProFieldType<T = any> {
5
5
  from?: FormInstance<T>;
6
6
  label?: string;
7
7
  name?: string;
@@ -9,9 +9,13 @@ export interface ProFieldProps<T = any> {
9
9
  fieldName?: string;
10
10
  placeholder?: string;
11
11
  }
12
- export interface IProps extends InputProps, ProFieldProps {
13
- otherProps?: ProFormOtherProps;
12
+ export interface Props extends InputProps, ProFieldType {
13
+ otherProps?: ProFormOtherType;
14
14
  isView?: boolean;
15
15
  /** 脱敏数据位置下标 */
16
16
  desensitization?: [number, number];
17
17
  }
18
+ /**
19
+ * 兼容旧命名导出
20
+ */
21
+ export type ProFieldProps<T = any> = ProFieldType<T>;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { InputNumberProps } from 'antd';
3
- import { ProFormOtherProps } from '../../../propsType';
3
+ import { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<InputNumberProps, 'onBlur'> {
5
- otherProps?: ProFormOtherProps;
5
+ otherProps?: ProFormOtherType;
6
6
  range?: string;
7
7
  onBlur?: (value?: number, record?: any, object?: any) => void;
8
8
  isView?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { RadioChangeEvent, RadioProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProFormOtherProps } from '../../../propsType';
3
+ import { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<RadioProps, 'options' | 'onChange'> {
5
5
  dataSource: any[];
6
6
  onChange: (value: any, e: RadioChangeEvent) => void;
@@ -8,7 +8,7 @@ export interface Props extends Omit<RadioProps, 'options' | 'onChange'> {
8
8
  label: string;
9
9
  value: string;
10
10
  };
11
- otherProps?: ProFormOtherProps;
11
+ otherProps?: ProFormOtherType;
12
12
  isView?: boolean;
13
13
  }
14
14
  declare const Radio: React.FC<Props>;
@@ -1,9 +1,9 @@
1
1
  import type { RangePickerProps } from 'antd/es/date-picker';
2
2
  import React from 'react';
3
- import { ProFormOtherProps } from '../../../propsType';
3
+ import { ProFormOtherType } from '../../../propsType';
4
4
  import { Props as RangeProps } from './useDateRange';
5
5
  export type Props = {
6
- otherProps?: ProFormOtherProps;
6
+ otherProps?: ProFormOtherType;
7
7
  separator?: any;
8
8
  showTime?: any;
9
9
  isView?: boolean;
@@ -1,10 +1,10 @@
1
1
  import { SelectProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProFormOtherProps } from '../../../propsType';
3
+ import { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends SelectProps {
5
5
  dataSource?: any[];
6
6
  scrollFollowParent?: boolean;
7
- otherProps?: ProFormOtherProps;
7
+ otherProps?: ProFormOtherType;
8
8
  isView?: boolean;
9
9
  }
10
10
  declare const Select: React.FC<Props>;
@@ -1,9 +1,9 @@
1
1
  import { SwitchProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProFormOtherProps } from '../../../propsType';
3
+ import { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<SwitchProps, 'value'> {
5
5
  value: any;
6
- otherProps?: ProFormOtherProps;
6
+ otherProps?: ProFormOtherType;
7
7
  isView?: boolean;
8
8
  }
9
9
  declare const Switch: React.FC<Props>;