@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.
- package/es/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
- package/es/ProDrawerForm/components/ProModal/index.d.ts +2 -2
- package/es/ProDrawerForm/index.d.ts +1 -2
- package/es/ProDrawerForm/propsType.d.ts +38 -27
- package/es/ProDrawerForm/utils/index.d.ts +2 -2
- package/es/ProEditLabel/propsType.d.ts +2 -2
- package/es/ProEditTable/components/Summary/index.d.ts +2 -2
- package/es/ProEditTable/index.d.ts +2 -2
- package/es/ProEditTable/propsType.d.ts +232 -93
- package/es/ProEnum/propsType.d.ts +2 -2
- package/es/ProForm/components/FormFooter/index.d.ts +2 -2
- package/es/ProForm/components/FormFooter/propsType.d.ts +8 -3
- package/es/ProForm/components/base/Checkbox/index.d.ts +2 -2
- package/es/ProForm/components/base/Input/index.d.ts +2 -2
- package/es/ProForm/components/base/Input/propsType.d.ts +8 -4
- package/es/ProForm/components/base/InputNumber/index.d.ts +2 -2
- package/es/ProForm/components/base/Radio/index.d.ts +2 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +2 -2
- package/es/ProForm/components/base/Select/index.d.ts +2 -2
- package/es/ProForm/components/base/Switch/index.d.ts +2 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
- package/es/ProForm/components/base/TextArea/index.d.ts +2 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +2 -2
- package/es/ProForm/components/combination/Container/index.d.ts +2 -2
- package/es/ProForm/components/combination/Container/propsType.d.ts +9 -5
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
- package/es/ProForm/components/combination/FormList/index.d.ts +2 -2
- package/es/ProForm/components/combination/FormList/propsType.d.ts +18 -10
- package/es/ProForm/components/combination/Group/index.d.ts +2 -2
- package/es/ProForm/components/combination/Group/propsType.d.ts +10 -5
- package/es/ProForm/components/combination/Group/utils.d.ts +4 -4
- package/es/ProForm/components/combination/ProCascader/index.d.ts +2 -1
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +6 -2
- package/es/ProForm/components/combination/ProCombination/index.d.ts +3 -3
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +60 -8
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +14 -8
- package/es/ProForm/components/render/ChangedWrapper.d.ts +2 -2
- package/es/ProForm/components/render/Render.d.ts +2 -2
- package/es/ProForm/components/render/RenderFields.d.ts +4 -4
- package/es/ProForm/components/render/propsType.d.ts +54 -43
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/propsType.d.ts +22 -15
- package/es/ProForm/utils/transformValue.d.ts +2 -2
- package/es/ProForm/utils/useFieldProps.d.ts +3 -3
- package/es/ProForm/utils/useShouldUpdate.d.ts +3 -3
- package/es/ProSelect/propsType.d.ts +2 -2
- package/es/ProStep/components/Item/index.d.ts +2 -2
- package/es/ProStep/components/Step/index.d.ts +2 -2
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +12 -1
- package/es/ProStep/propsType.d.ts +60 -12
- package/es/ProStep/utils/index.d.ts +2 -2
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -2
- package/es/ProTable/hooks/useAntdTable.d.ts +2 -2
- package/es/ProTable/index.d.ts +2 -2
- package/es/ProTable/propsType.d.ts +590 -39
- package/es/ProTooltip/index.d.ts +2 -2
- package/es/ProTooltip/propsType.d.ts +52 -9
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/propsType.d.ts +3 -3
- package/es/ProTreeModal/propsType.d.ts +2 -2
- package/es/ProUpload/propsType.d.ts +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
- package/lib/ProDrawerForm/components/ProModal/index.d.ts +2 -2
- package/lib/ProDrawerForm/index.d.ts +1 -2
- package/lib/ProDrawerForm/propsType.d.ts +38 -27
- package/lib/ProDrawerForm/utils/index.d.ts +2 -2
- package/lib/ProEditLabel/propsType.d.ts +2 -2
- package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
- package/lib/ProEditTable/index.d.ts +2 -2
- package/lib/ProEditTable/propsType.d.ts +232 -93
- package/lib/ProEnum/propsType.d.ts +2 -2
- package/lib/ProForm/components/FormFooter/index.d.ts +2 -2
- package/lib/ProForm/components/FormFooter/propsType.d.ts +8 -3
- package/lib/ProForm/components/base/Checkbox/index.d.ts +2 -2
- package/lib/ProForm/components/base/Input/index.d.ts +2 -2
- package/lib/ProForm/components/base/Input/propsType.d.ts +8 -4
- package/lib/ProForm/components/base/InputNumber/index.d.ts +2 -2
- package/lib/ProForm/components/base/Radio/index.d.ts +2 -2
- package/lib/ProForm/components/base/RangePicker/index.d.ts +2 -2
- package/lib/ProForm/components/base/Select/index.d.ts +2 -2
- package/lib/ProForm/components/base/Switch/index.d.ts +2 -2
- package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
- package/lib/ProForm/components/base/TextArea/index.d.ts +2 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Container/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Container/propsType.d.ts +9 -5
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
- package/lib/ProForm/components/combination/FormList/index.d.ts +2 -2
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +18 -10
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Group/propsType.d.ts +10 -5
- package/lib/ProForm/components/combination/Group/utils.d.ts +4 -4
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +2 -1
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +6 -2
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +3 -3
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +60 -8
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +14 -8
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +2 -2
- package/lib/ProForm/components/render/Render.d.ts +2 -2
- package/lib/ProForm/components/render/RenderFields.d.ts +4 -4
- package/lib/ProForm/components/render/propsType.d.ts +54 -43
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/propsType.d.ts +22 -15
- package/lib/ProForm/utils/transformValue.d.ts +2 -2
- package/lib/ProForm/utils/useFieldProps.d.ts +3 -3
- package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -3
- package/lib/ProSelect/propsType.d.ts +2 -2
- package/lib/ProStep/components/Item/index.d.ts +2 -2
- package/lib/ProStep/components/Step/index.d.ts +2 -2
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +12 -1
- package/lib/ProStep/propsType.d.ts +60 -12
- package/lib/ProStep/utils/index.d.ts +2 -2
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -2
- package/lib/ProTable/hooks/useAntdTable.d.ts +2 -2
- package/lib/ProTable/index.d.ts +2 -2
- package/lib/ProTable/propsType.d.ts +590 -39
- package/lib/ProTooltip/index.d.ts +2 -2
- package/lib/ProTooltip/propsType.d.ts +52 -9
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/propsType.d.ts +3 -3
- package/lib/ProTreeModal/propsType.d.ts +2 -2
- package/lib/ProUpload/propsType.d.ts +3 -3
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -4,33 +4,33 @@ import React from 'react';
|
|
4
4
|
import { validate, regExp } from '@zat-design/utils';
|
5
5
|
import { RuleObject } from 'antd/es/form';
|
6
6
|
import * as componentMap from '../index';
|
7
|
-
import {
|
7
|
+
import { Props as InputProps } from '../base/Input/propsType';
|
8
8
|
import { Props as InputNumberProps } from '../base/InputNumber';
|
9
9
|
import { Props as RadioProps } from '../base/Radio';
|
10
10
|
import { Props as CheckboxProps } from '../base/Checkbox';
|
11
11
|
import { Props as DatePickerProps } from '../base/DatePicker';
|
12
12
|
import { Props as RangePickerProps } from '../base/RangePicker';
|
13
|
-
import {
|
13
|
+
import { TypeWithRef as FormListType } from '../combination/FormList/propsType';
|
14
14
|
import { Props as SelectProps } from '../base/Select';
|
15
15
|
import { Props as TimePickerProps } from '../base/TimePicker';
|
16
16
|
import { Props as SwitchProps } from '../base/Switch';
|
17
17
|
import { Props as SwitchCheckboxProps } from '../base/SwitchCheckbox';
|
18
18
|
import { Props as TextAreaProps } from '../base/TextArea';
|
19
|
-
import {
|
20
|
-
import {
|
21
|
-
import {
|
19
|
+
import { ProCascaderType } from '../combination/ProCascader/propsType';
|
20
|
+
import { ProCombinationType } from '../combination/ProCombination/propsType';
|
21
|
+
import { ProModalSelectType } from '../combination/ProModalSelect/propsType';
|
22
22
|
import { ProNumberRangeProps } from '../combination/ProNumberRange/propsType';
|
23
23
|
import { ProLimitProps } from '../combination/ProTimeLimit';
|
24
24
|
import { Props as ProRangeLimitProps } from '../combination/ProRangeLimit';
|
25
25
|
import { CheckboxPropsMap, ProEnum, PropProSelectsMap, PropRadioPropsMap } from '../../../ProEnum/propsType';
|
26
26
|
import { PropSelectProps as ProSelectProps } from '../../../ProSelect/propsType';
|
27
|
-
import {
|
27
|
+
import { ProEditTableType } from '../../../ProEditTable/propsType';
|
28
28
|
import { ProTreeModalProps } from '../../../ProTreeModal/propsType';
|
29
|
-
import {
|
29
|
+
import { ProUploadType } from '../../../ProUpload/propsType';
|
30
30
|
import { ProTreeProps } from '../../../ProTree/propsType';
|
31
|
-
import {
|
31
|
+
import { GroupType as GroupCopyProps } from '../combination/Group/propsType';
|
32
32
|
import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
33
|
-
import { DistributiveOmit,
|
33
|
+
import { DistributiveOmit, DiffConfigType } from '../../propsType';
|
34
34
|
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
35
35
|
export type ComponentMap = keyof typeof componentMap;
|
36
36
|
type ValidateKey = keyof typeof validate;
|
@@ -66,9 +66,9 @@ type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T,
|
|
66
66
|
/** ProForm disable时,是否完全受控 */
|
67
67
|
disabledStrictly?: boolean;
|
68
68
|
};
|
69
|
-
type
|
70
|
-
type
|
71
|
-
type
|
69
|
+
type ProEnumFormType<Values> = TransformToFormField<ProEnum, Values> | TransformToFormField<ProEnum & PropProSelectsMap, Values> | TransformToFormField<ProEnum & PropRadioPropsMap, Values> | TransformToFormField<ProEnum & CheckboxPropsMap, Values>;
|
70
|
+
type ProEnumTableType<Values> = TransformToTableField<ProEnum, Values> | TransformToTableField<ProEnum & PropProSelectsMap, Values> | TransformToTableField<ProEnum & PropRadioPropsMap, Values> | TransformToTableField<ProEnum & CheckboxPropsMap, Values>;
|
71
|
+
type ProEnumFieldType<Values, TT> = TT extends 'ProForm' ? ProEnumFormType<Values> | ReactiveFunction<Values, ProEnumFormType<Values>> : ProEnumTableType<Values> | ((text: any, values: Values, index: number) => ProEnumTableType<Values>);
|
72
72
|
type TransformToTableField<T extends ControlProps, Values> = Omit<T, 'onChange' | 'value' | 'onBlur'> & {
|
73
73
|
value?: T['value'];
|
74
74
|
onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], record: any, index: number, form: FormInstance<Values>) => void;
|
@@ -81,83 +81,83 @@ export type ReactiveFunction<Values, R> = (values: Values, { form, index, namePa
|
|
81
81
|
namePath?: NamePath;
|
82
82
|
[key: string]: any;
|
83
83
|
}) => R;
|
84
|
-
type
|
84
|
+
type FieldType<T extends ControlProps, Values, TT> = TT extends 'ProForm' ? TransformToFormField<T, Values> | ReactiveFunction<Values, TransformToFormField<T, Values>> : TransformToTableField<T, Values> | ((text: any, values: Values, index: number) => TransformToTableField<T, Values>);
|
85
85
|
/**
|
86
86
|
* 值转换
|
87
87
|
*/
|
88
88
|
export type ProFormValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime' | 'switch' | 'desensitization';
|
89
|
-
export type
|
89
|
+
export type ColumnTypeMap<Values = any, T = 'ProForm'> = {
|
90
90
|
type?: 'Input';
|
91
|
-
fieldProps?:
|
91
|
+
fieldProps?: FieldType<InputProps, Values, T>;
|
92
92
|
} | {
|
93
93
|
type?: 'InputNumber';
|
94
|
-
fieldProps?:
|
94
|
+
fieldProps?: FieldType<InputNumberProps, Values, T>;
|
95
95
|
} | {
|
96
96
|
type?: 'Radio';
|
97
|
-
fieldProps?:
|
97
|
+
fieldProps?: FieldType<RadioProps, Values, T>;
|
98
98
|
} | {
|
99
99
|
type?: 'Checkbox';
|
100
|
-
fieldProps?:
|
100
|
+
fieldProps?: FieldType<CheckboxProps, Values, T>;
|
101
101
|
} | {
|
102
102
|
type?: 'DatePicker';
|
103
|
-
fieldProps?:
|
103
|
+
fieldProps?: FieldType<DatePickerProps, Values, T>;
|
104
104
|
} | {
|
105
105
|
type?: 'RangePicker';
|
106
|
-
fieldProps?:
|
106
|
+
fieldProps?: FieldType<RangePickerProps, Values, T>;
|
107
107
|
} | {
|
108
108
|
type?: 'FormList';
|
109
|
-
fieldProps?:
|
109
|
+
fieldProps?: FieldType<Omit<FormListType, 'fields' | 'operation' | 'meta'>, Values, T>;
|
110
110
|
} | {
|
111
111
|
type?: 'Select';
|
112
|
-
fieldProps?:
|
112
|
+
fieldProps?: FieldType<SelectProps, Values, T>;
|
113
113
|
} | {
|
114
114
|
type?: 'TimePicker';
|
115
|
-
fieldProps?:
|
115
|
+
fieldProps?: FieldType<TimePickerProps, Values, T>;
|
116
116
|
} | {
|
117
117
|
type?: 'Switch';
|
118
|
-
fieldProps?:
|
118
|
+
fieldProps?: FieldType<SwitchProps, Values, T>;
|
119
119
|
} | {
|
120
120
|
type?: 'SwitchCheckbox';
|
121
|
-
fieldProps?:
|
121
|
+
fieldProps?: FieldType<SwitchCheckboxProps, Values, T>;
|
122
122
|
} | {
|
123
123
|
type?: 'TextArea';
|
124
|
-
fieldProps?:
|
124
|
+
fieldProps?: FieldType<TextAreaProps, Values, T>;
|
125
125
|
} | {
|
126
126
|
type?: 'ProCascader';
|
127
|
-
fieldProps?:
|
127
|
+
fieldProps?: FieldType<ProCascaderType, Values, T>;
|
128
128
|
} | {
|
129
129
|
type?: 'ProCombination';
|
130
|
-
fieldProps?:
|
130
|
+
fieldProps?: FieldType<ProCombinationType, Values, T>;
|
131
131
|
} | {
|
132
132
|
type?: 'ProModalSelect';
|
133
|
-
fieldProps?:
|
133
|
+
fieldProps?: FieldType<ProModalSelectType, Values, T>;
|
134
134
|
} | {
|
135
135
|
type?: 'ProNumberRange';
|
136
|
-
fieldProps?:
|
136
|
+
fieldProps?: FieldType<ProNumberRangeProps, Values, T>;
|
137
137
|
} | {
|
138
138
|
type?: 'ProRangeLimit';
|
139
|
-
fieldProps?:
|
139
|
+
fieldProps?: FieldType<ProRangeLimitProps, Values, T>;
|
140
140
|
} | {
|
141
141
|
type?: 'ProTimeLimit';
|
142
|
-
fieldProps?:
|
142
|
+
fieldProps?: FieldType<ProLimitProps, Values, T>;
|
143
143
|
} | {
|
144
144
|
type?: 'ProEnum';
|
145
|
-
fieldProps?:
|
145
|
+
fieldProps?: ProEnumFieldType<Values, T>;
|
146
146
|
} | {
|
147
147
|
type?: 'ProSelect';
|
148
|
-
fieldProps?:
|
148
|
+
fieldProps?: FieldType<ProSelectProps, Values, T>;
|
149
149
|
} | {
|
150
150
|
type?: 'ProEditTable';
|
151
|
-
fieldProps?:
|
151
|
+
fieldProps?: FieldType<ProEditTableType, Values, T>;
|
152
152
|
} | {
|
153
153
|
type?: 'ProTreeModal';
|
154
|
-
fieldProps?:
|
154
|
+
fieldProps?: FieldType<ProTreeModalProps, Values, T>;
|
155
155
|
} | {
|
156
156
|
type?: 'ProUpload';
|
157
|
-
fieldProps?:
|
157
|
+
fieldProps?: FieldType<ProUploadType, Values, T>;
|
158
158
|
} | {
|
159
159
|
type?: 'ProTree';
|
160
|
-
fieldProps?:
|
160
|
+
fieldProps?: FieldType<ProTreeProps, Values, T>;
|
161
161
|
} | {
|
162
162
|
type?: 'Group';
|
163
163
|
fieldProps?: GroupCopyProps | ReactiveFunction<Values, GroupCopyProps>;
|
@@ -168,7 +168,7 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
168
168
|
type?: 'Container';
|
169
169
|
fieldProps?: any;
|
170
170
|
};
|
171
|
-
export interface
|
171
|
+
export interface ProFormColumnType<Values = any> extends Omit<FormItemProps<Values>, 'rules' | 'required'> {
|
172
172
|
component?: React.ReactNode | ReactiveFunction<Values, React.ReactNode>;
|
173
173
|
names?: NamePath[];
|
174
174
|
show?: boolean | ReactiveFunction<Values, boolean>;
|
@@ -233,11 +233,11 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
233
233
|
/** 脱敏数据位置下标 */
|
234
234
|
desensitization?: [number, number] | ReactiveFunction<Values, [number, number]>;
|
235
235
|
}
|
236
|
-
export type
|
236
|
+
export type ProColumnType<T = any> = ProFormColumnType<T> & ColumnTypeMap<T, 'ProForm'>;
|
237
237
|
/**
|
238
238
|
* 表单渲染类型
|
239
239
|
*/
|
240
|
-
export interface
|
240
|
+
export interface RenderType<Values = any> {
|
241
241
|
formDisabled?: boolean;
|
242
242
|
component: any;
|
243
243
|
formItemProps: FormItemProps<Values> & {
|
@@ -278,10 +278,21 @@ export interface RenderProps<Values = any> {
|
|
278
278
|
form: FormInstance<Values>;
|
279
279
|
fieldProps?: ReactiveFunction<Values, React.ReactNode>;
|
280
280
|
isSelect: boolean;
|
281
|
-
diffConfig:
|
281
|
+
diffConfig: DiffConfigType;
|
282
282
|
requiredOnView?: boolean;
|
283
|
-
confirm?:
|
283
|
+
confirm?: ProFormColumnType['confirm'];
|
284
284
|
globalControl?: boolean;
|
285
285
|
[name: string]: any;
|
286
286
|
}
|
287
|
+
/**
|
288
|
+
* 兼容旧命名导出
|
289
|
+
*/
|
290
|
+
export type ProEnumFormProps<Values> = ProEnumFormType<Values>;
|
291
|
+
export type ProEnumTableProps<Values> = ProEnumTableType<Values>;
|
292
|
+
export type ProEnumFieldProps<Values, TT> = ProEnumFieldType<Values, TT>;
|
293
|
+
export type FieldProps<T extends ControlProps, Values, TT> = FieldType<T, Values, TT>;
|
294
|
+
export type ColumnPropsMap<Values = any, T = 'ProForm'> = ColumnTypeMap<Values, T>;
|
295
|
+
export type ProFormColumnProps<Values = any> = ProFormColumnType<Values>;
|
296
|
+
export type ProColumnProps<T = any> = ProColumnType<T>;
|
297
|
+
export type RenderProps<Values = any> = RenderType<Values>;
|
287
298
|
export {};
|
package/lib/ProForm/index.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FormInstance } from 'antd';
|
2
2
|
import React, { ForwardRefRenderFunction } from 'react';
|
3
3
|
import { FormProviderProps } from 'antd/es/form/context';
|
4
|
-
import {
|
4
|
+
import { ProFormType } from './propsType';
|
5
5
|
import { useForm } from './utils/useForm';
|
6
6
|
import useWatch from './utils/useWatch';
|
7
|
-
interface IProForm<T = any> extends ForwardRefRenderFunction<FormInstance<T>,
|
7
|
+
interface IProForm<T = any> extends ForwardRefRenderFunction<FormInstance<T>, ProFormType<T>> {
|
8
8
|
useForm: typeof useForm;
|
9
9
|
useWatch: typeof useWatch;
|
10
10
|
[key: string]: any;
|
@@ -4,27 +4,27 @@ 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 { ComponentMap,
|
7
|
+
import { ComponentMap, ProColumnType, ViewType } from './components/render/propsType';
|
8
8
|
export * from './components/render/propsType';
|
9
|
-
export interface
|
9
|
+
export interface ButtonType extends ButtonProps {
|
10
10
|
children?: any;
|
11
11
|
}
|
12
|
-
export interface
|
13
|
-
okButtonProps?:
|
14
|
-
cancelButtonProps?:
|
12
|
+
export interface FooterButtonType {
|
13
|
+
okButtonProps?: ButtonType;
|
14
|
+
cancelButtonProps?: ButtonType;
|
15
15
|
}
|
16
|
-
export interface
|
16
|
+
export interface ProFormItemChildType {
|
17
17
|
value?: any;
|
18
18
|
onChange?: () => void;
|
19
19
|
[key: string]: any;
|
20
20
|
}
|
21
21
|
export type ModeEnum = 'search' | 'drawer';
|
22
22
|
type FooterType = ReactNode | {
|
23
|
-
okButtonProps:
|
24
|
-
cancelButtonProps:
|
23
|
+
okButtonProps: ButtonType;
|
24
|
+
cancelButtonProps: ButtonType;
|
25
25
|
} | boolean;
|
26
26
|
export declare const otherKeys: string[];
|
27
|
-
export interface
|
27
|
+
export interface ProFormOtherType {
|
28
28
|
isView?: boolean;
|
29
29
|
viewEmpty?: React.ReactNode;
|
30
30
|
label?: React.ReactNode;
|
@@ -45,10 +45,10 @@ export interface ProFormOtherProps {
|
|
45
45
|
globalControl?: boolean;
|
46
46
|
formDisabled?: boolean;
|
47
47
|
isDiffChange?: boolean;
|
48
|
-
diffConfig?:
|
48
|
+
diffConfig?: DiffConfigType;
|
49
49
|
desensitizationKey?: string;
|
50
50
|
}
|
51
|
-
export interface
|
51
|
+
export interface DiffConfigType<Values = any> {
|
52
52
|
/** 比对原始数据源 */
|
53
53
|
originalValues: Values;
|
54
54
|
/** 是否显示对比值气泡 */
|
@@ -60,7 +60,7 @@ export interface DiffConfigProps<Values = any> {
|
|
60
60
|
/** 是否跟随父组件滚动 */
|
61
61
|
scrollFollowParent?: string;
|
62
62
|
}
|
63
|
-
export interface
|
63
|
+
export interface ProFormType<Values = any> extends FormProps<Values> {
|
64
64
|
disabled?: boolean;
|
65
65
|
/** 全局控制优先 */
|
66
66
|
globalControl?: boolean;
|
@@ -69,7 +69,7 @@ export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
69
69
|
/** 是否查看 */
|
70
70
|
isView?: boolean;
|
71
71
|
span?: number;
|
72
|
-
columns?:
|
72
|
+
columns?: ProColumnType<Values>[];
|
73
73
|
rowProps?: RowProps;
|
74
74
|
footer?: FooterType;
|
75
75
|
expand?: boolean | number;
|
@@ -89,7 +89,7 @@ export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
89
89
|
formId?: string;
|
90
90
|
required?: boolean | boolean[];
|
91
91
|
/** 表单比对配置 */
|
92
|
-
diffConfig?:
|
92
|
+
diffConfig?: DiffConfigType;
|
93
93
|
scrollToError?: boolean;
|
94
94
|
/** 性能模式,谨慎使用,默认不开启
|
95
95
|
* 1. 开启不过滤names的中间态值
|
@@ -98,9 +98,16 @@ export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
98
98
|
/** 全局脱敏开关的key、默认 zat-design-pro-component-desensitization */
|
99
99
|
desensitizationKey?: string;
|
100
100
|
}
|
101
|
-
export interface
|
101
|
+
export interface TransformType<T = any> {
|
102
102
|
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
103
103
|
getValueProps?: (value: StoreValue) => Record<string, unknown>;
|
104
104
|
shouldUpdate?: ShouldUpdate<T>;
|
105
105
|
}
|
106
106
|
export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
107
|
+
/**
|
108
|
+
* 兼容旧命名导出
|
109
|
+
*/
|
110
|
+
export type FooterButtonProps = FooterButtonType;
|
111
|
+
export type ProFormOtherProps = ProFormOtherType;
|
112
|
+
export type DiffConfigProps = DiffConfigType;
|
113
|
+
export type Transform = TransformType;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FormInstance, FormItemProps } from 'antd';
|
2
2
|
import { NamePath } from 'antd/es/form/interface';
|
3
3
|
import { StoreValue, Store } from 'rc-field-form/es/interface.d';
|
4
|
-
import {
|
5
|
-
export declare const transformValue: (names: NamePath[], form: FormInstance, fieldName: NamePath, normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue, getValueProps?: FormItemProps['getValueProps']) =>
|
4
|
+
import { TransformType } from '../propsType';
|
5
|
+
export declare const transformValue: (names: NamePath[], form: FormInstance, fieldName: NamePath, normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue, getValueProps?: FormItemProps['getValueProps']) => TransformType;
|
6
6
|
export default transformValue;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
export declare const FieldProvider: React.Provider<
|
4
|
-
export declare const useFieldProps: () =>
|
2
|
+
import { ProFormOtherType } from '../propsType';
|
3
|
+
export declare const FieldProvider: React.Provider<ProFormOtherType>;
|
4
|
+
export declare const useFieldProps: () => ProFormOtherType;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { FormInstance, FormItemProps } from 'antd';
|
2
|
-
import {
|
2
|
+
import { ProColumnType, ProRule } from '../components/render/propsType';
|
3
3
|
interface Result<Values> {
|
4
4
|
shouldUpdate?: FormItemProps<Values>['shouldUpdate'];
|
5
5
|
show?: boolean;
|
@@ -9,8 +9,8 @@ interface Result<Values> {
|
|
9
9
|
[key: string]: any;
|
10
10
|
}
|
11
11
|
interface UseShouldUpdateProps<Values> {
|
12
|
-
show?:
|
13
|
-
formItemProps?:
|
12
|
+
show?: ProColumnType['show'];
|
13
|
+
formItemProps?: ProColumnType['formItemProps'] & {
|
14
14
|
clearNotShow?: boolean;
|
15
15
|
names?: any[];
|
16
16
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
import type { SelectProps } from 'antd';
|
3
3
|
import { Service, Options, Result } from 'ahooks/lib/useRequest/src/types';
|
4
|
-
import {
|
4
|
+
import { ProFormOtherType } from '../ProForm/propsType';
|
5
5
|
/**
|
6
6
|
* @description 数据选项类型
|
7
7
|
*/
|
@@ -69,7 +69,7 @@ export interface PropSelectType extends Omit<SelectProps, 'onSearch'> {
|
|
69
69
|
* @description 集成表单 form 的属性
|
70
70
|
* @default -
|
71
71
|
*/
|
72
|
-
otherProps?:
|
72
|
+
otherProps?: ProFormOtherType;
|
73
73
|
/**
|
74
74
|
* @description 下拉框滚动是否跟随父级
|
75
75
|
* @default false
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
declare const ProStepItem: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, ...restProps }:
|
1
|
+
import { ProStepItemType } from '../../propsType';
|
2
|
+
declare const ProStepItem: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, ...restProps }: ProStepItemType) => import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default ProStepItem;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export declare const Step: ({ fixedTop, dataSource, activeKey, errorCollection, style, targetOffset, scrollToError, }: ProStepPropsType & {
|
1
|
+
import { ProStepType } from '../../propsType';
|
2
|
+
export declare const Step: ({ fixedTop, dataSource, activeKey, errorCollection, style, targetOffset, scrollToError, }: import("../../propsType").ProStepPropsType & {
|
3
3
|
errorCollection: object;
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
5
5
|
export default Step;
|
package/lib/ProStep/index.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { ProStepType } from './propsType';
|
3
3
|
import './style/index.less';
|
4
4
|
export declare const ProStepContext: import("react").Context<any>;
|
5
5
|
export declare const useStep: () => any;
|
6
6
|
declare const ProStep: {
|
7
|
-
({ children, ...resetProps }:
|
7
|
+
({ children, ...resetProps }: ProStepType): import("react/jsx-runtime").JSX.Element;
|
8
8
|
useStep: () => any;
|
9
9
|
Item: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, ...restProps }: import("./propsType").ProStepItemPropsType) => import("react/jsx-runtime").JSX.Element;
|
10
10
|
Listener: ({ children, delayTime, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
package/lib/ProStep/index.js
CHANGED
@@ -140,6 +140,16 @@ var ProStep = function ProStep(_ref) {
|
|
140
140
|
record.subEvent = subEvent;
|
141
141
|
registerMap.current[id] = record;
|
142
142
|
};
|
143
|
+
// 取消注册
|
144
|
+
var unNotify = function unNotify(keys) {
|
145
|
+
if (typeof keys === 'string') {
|
146
|
+
delete registerMap.current[keys];
|
147
|
+
} else if (Array.isArray(keys)) {
|
148
|
+
keys.forEach(function (key) {
|
149
|
+
delete registerMap.current[key];
|
150
|
+
});
|
151
|
+
}
|
152
|
+
};
|
143
153
|
var handleScrollError = function handleScrollError(data) {
|
144
154
|
var errorModuleKeys = Object.keys(data).reverse();
|
145
155
|
if (errorModuleKeys === null || errorModuleKeys === void 0 ? void 0 : errorModuleKeys.length) {
|
@@ -244,7 +254,8 @@ var ProStep = function ProStep(_ref) {
|
|
244
254
|
notify: notify,
|
245
255
|
triggerTo: triggerTo,
|
246
256
|
handleScroll: _utils.handleScroll,
|
247
|
-
lazyLoad: lazyLoad
|
257
|
+
lazyLoad: lazyLoad,
|
258
|
+
unNotify: unNotify
|
248
259
|
},
|
249
260
|
children: (0, _jsxRuntime.jsxs)("div", {
|
250
261
|
className: "pro-step-wrapper",
|
@@ -1,42 +1,90 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
2
2
|
import { LazyLoadProps } from 'react-lazyload';
|
3
|
+
/**
|
4
|
+
* 步骤项基础类型定义
|
5
|
+
* @interface ItemType
|
6
|
+
*/
|
3
7
|
export interface ItemType {
|
8
|
+
/** 步骤名称 */
|
4
9
|
name: string;
|
10
|
+
/** 步骤唯一标识码 */
|
5
11
|
code: string;
|
12
|
+
/** 步骤排序值,越小越靠前 */
|
6
13
|
order?: number;
|
7
14
|
}
|
15
|
+
/**
|
16
|
+
* 已加载地图项属性类型
|
17
|
+
* @interface LoadedMapPropsType
|
18
|
+
*/
|
8
19
|
export interface LoadedMapPropsType {
|
20
|
+
/** 唯一标识符 */
|
9
21
|
id: string;
|
22
|
+
/** 排序值 */
|
10
23
|
order: number;
|
24
|
+
/** 标题文本 */
|
11
25
|
title: string;
|
26
|
+
/** 是否已加载 */
|
12
27
|
loaded: boolean;
|
13
28
|
}
|
29
|
+
/**
|
30
|
+
* @type LoadedMapType
|
31
|
+
*/
|
32
|
+
export type LoadedMapType = LoadedMapPropsType;
|
33
|
+
/**
|
34
|
+
* ProStep 组件属性类型
|
35
|
+
* @interface ProStepPropsType
|
36
|
+
*/
|
14
37
|
export interface ProStepPropsType {
|
15
|
-
/**
|
38
|
+
/** 步骤条配置项 */
|
16
39
|
dataSource?: ItemType[];
|
17
|
-
/**
|
40
|
+
/** 距离顶部的偏移量(单位:像素) */
|
18
41
|
fixedTop: number;
|
19
|
-
/**
|
42
|
+
/** 当前激活的步骤标识 */
|
20
43
|
activeKey?: string;
|
21
|
-
/**
|
44
|
+
/** 子组件内容 */
|
22
45
|
children?: ReactNode;
|
23
|
-
/**
|
24
|
-
style?:
|
25
|
-
/**
|
46
|
+
/** 组件自定义样式 */
|
47
|
+
style?: CSSProperties;
|
48
|
+
/** 滚动偏移量(单位:像素) */
|
26
49
|
targetOffset?: number;
|
27
|
-
/**
|
50
|
+
/** 是否使用折叠标题 */
|
28
51
|
collapse?: boolean;
|
29
|
-
/**
|
52
|
+
/** 是否自动滚动到第一个报错的步骤 */
|
30
53
|
scrollToError?: boolean;
|
31
|
-
/**
|
54
|
+
/**
|
55
|
+
* 模块可视区域懒加载
|
56
|
+
* @description 为true时使用默认配置,或传入自定义懒加载配置
|
57
|
+
*/
|
32
58
|
lazyLoad?: boolean | LazyLoadProps;
|
33
59
|
}
|
60
|
+
/**
|
61
|
+
* ProStep 组件基础类型
|
62
|
+
* @type ProStepType
|
63
|
+
*/
|
64
|
+
export type ProStepType = ProStepPropsType;
|
65
|
+
/**
|
66
|
+
* ProStep 子项组件属性类型
|
67
|
+
* @interface ProStepItemPropsType
|
68
|
+
*/
|
34
69
|
export interface ProStepItemPropsType {
|
70
|
+
/** 唯一标识符 */
|
35
71
|
id: string;
|
72
|
+
/** 步骤标题 */
|
36
73
|
title?: string;
|
74
|
+
/** 是否使用折叠模式 */
|
37
75
|
collapse?: boolean;
|
76
|
+
/** 排序值,越小越靠前 */
|
38
77
|
order?: number;
|
39
|
-
/**
|
78
|
+
/**
|
79
|
+
* 模块可视区域懒加载
|
80
|
+
* @description 为true时使用默认配置,或传入自定义懒加载配置
|
81
|
+
*/
|
40
82
|
lazyLoad?: boolean | LazyLoadProps;
|
83
|
+
/** 允许其他任意属性 */
|
41
84
|
[key: string]: any;
|
42
85
|
}
|
86
|
+
/**
|
87
|
+
* ProStep 子项组件基础类型
|
88
|
+
* @type ProStepItemType
|
89
|
+
*/
|
90
|
+
export type ProStepItemType = ProStepItemPropsType;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
1
|
+
import type { LoadedMapType } from '../propsType';
|
2
2
|
export declare const handleScroll: (id: any, options: any) => void;
|
3
3
|
/** 获取加载模块数据信息 */
|
4
|
-
export declare const getLoadedMap: (registerMap: any) =>
|
4
|
+
export declare const getLoadedMap: (registerMap: any) => LoadedMapType[];
|
5
5
|
export default handleScroll;
|
@@ -2,9 +2,9 @@
|
|
2
2
|
* 调整点:
|
3
3
|
*/
|
4
4
|
import React from 'react';
|
5
|
-
import {
|
5
|
+
import { ProTableColumnType } from '../../propsType';
|
6
6
|
export declare const formatColumn: ({ column, originalObj, rowKey, wrapToolTipProps, scroll, onUpdateMinWidth, isInNewRow, diffConfig, }: {
|
7
|
-
column:
|
7
|
+
column: ProTableColumnType;
|
8
8
|
originalObj: any;
|
9
9
|
rowKey: any;
|
10
10
|
wrapToolTipProps?: any;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Key } from 'react';
|
2
2
|
import { useRequest } from 'ahooks';
|
3
|
-
import {
|
4
|
-
declare function useAntdTable<I, R extends Record<string, any>, S extends
|
3
|
+
import { ProTableRequestOptionsType, ProTableServiceType } from '../propsType';
|
4
|
+
declare function useAntdTable<I, R extends Record<string, any>, S extends ProTableServiceType<I, R>>(service: S, options?: ProTableRequestOptionsType<I, R>, useRequestOptions?: Parameters<typeof useRequest>[1]): {
|
5
5
|
data: R[];
|
6
6
|
params: any;
|
7
7
|
rowSelection: {
|
package/lib/ProTable/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { ProTableType } from './propsType';
|
3
3
|
import useAntdTable from './hooks/useAntdTable';
|
4
4
|
export declare const TableContext: import("react").Context<{}>;
|
5
5
|
export declare const defaultPage: {
|
@@ -7,7 +7,7 @@ export declare const defaultPage: {
|
|
7
7
|
pageSize: number;
|
8
8
|
};
|
9
9
|
declare const ProTable: {
|
10
|
-
(props:
|
10
|
+
(props: ProTableType): import("react/jsx-runtime").JSX.Element;
|
11
11
|
defaultProps: {
|
12
12
|
quickConfig: boolean;
|
13
13
|
stripe: boolean;
|