@zat-design/sisyphus-react 3.4.7 → 3.4.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +6 -1
- package/dist/less.esm.css +6 -1
- package/es/ProEditTable/components/RenderField/index.js +4 -8
- package/es/ProEditTable/style/index.less +1 -1
- package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/index.js +1 -1
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +2 -3
- package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +2 -2
- package/es/ProForm/components/combination/Group/index.d.ts +8 -2
- package/es/ProForm/components/combination/Group/index.js +57 -77
- package/es/ProForm/components/combination/Group/propsType.d.ts +27 -14
- package/es/ProForm/components/combination/Group/utils.d.ts +60 -7
- package/es/ProForm/components/combination/Group/utils.js +209 -19
- package/es/ProForm/components/combination/ProModalSelect/index.js +35 -29
- package/es/ProForm/components/combination/_Group/index.d.ts +4 -0
- package/es/ProForm/components/combination/_Group/index.js +109 -0
- package/es/ProForm/components/combination/_Group/propsType.d.ts +35 -0
- package/es/ProForm/components/combination/_Group/utils.d.ts +10 -0
- package/es/ProForm/components/combination/_Group/utils.js +46 -0
- package/es/ProForm/components/render/Render.js +10 -8
- package/es/ProForm/components/render/propsType.d.ts +2 -2
- package/es/ProForm/style/index.less +7 -0
- package/es/ProForm/utils/diffOriginal.js +2 -1
- package/es/ProForm/utils/index.d.ts +2 -0
- package/es/ProForm/utils/index.js +22 -1
- package/es/ProForm/utils/transformNames.js +3 -10
- package/es/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
- package/es/ProForm/utils/useDeepCompareMemo.js +14 -0
- package/es/ProForm/utils/useForm.js +23 -13
- package/es/ProForm/utils/useListChanged.js +2 -2
- package/es/ProForm/utils/useRules.js +2 -20
- package/es/global.less +27 -8
- package/es/locale/zh_CN.js +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +4 -8
- package/lib/ProEditTable/style/index.less +1 -1
- package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +2 -3
- package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +2 -2
- package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
- package/lib/ProForm/components/combination/Group/index.js +55 -73
- package/lib/ProForm/components/combination/Group/propsType.d.ts +27 -14
- package/lib/ProForm/components/combination/Group/utils.d.ts +60 -7
- package/lib/ProForm/components/combination/Group/utils.js +210 -20
- package/lib/ProForm/components/combination/ProModalSelect/index.js +35 -29
- package/lib/ProForm/components/combination/_Group/index.d.ts +4 -0
- package/lib/ProForm/components/combination/_Group/index.js +113 -0
- package/lib/ProForm/components/combination/_Group/propsType.d.ts +35 -0
- package/lib/ProForm/components/combination/_Group/utils.d.ts +10 -0
- package/lib/ProForm/components/combination/_Group/utils.js +53 -0
- package/lib/ProForm/components/render/Render.js +9 -7
- package/lib/ProForm/components/render/propsType.d.ts +2 -2
- package/lib/ProForm/style/index.less +7 -0
- package/lib/ProForm/utils/diffOriginal.js +2 -1
- package/lib/ProForm/utils/index.d.ts +2 -0
- package/lib/ProForm/utils/index.js +25 -2
- package/lib/ProForm/utils/transformNames.js +2 -9
- package/lib/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
- package/lib/ProForm/utils/useDeepCompareMemo.js +20 -0
- package/lib/ProForm/utils/useForm.js +22 -12
- package/lib/ProForm/utils/useListChanged.js +1 -1
- package/lib/ProForm/utils/useRules.js +2 -20
- package/lib/global.less +27 -8
- package/lib/locale/zh_CN.js +1 -1
- package/package.json +1 -1
- package/es/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
- package/es/ProForm/components/combination/GroupCopy/index.js +0 -84
- package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
- package/es/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
- package/es/ProForm/components/combination/GroupCopy/utils.js +0 -180
- package/lib/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
- package/lib/ProForm/components/combination/GroupCopy/index.js +0 -91
- package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
- package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
- package/lib/ProForm/components/combination/GroupCopy/utils.js +0 -187
- /package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
- /package/es/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
- /package/lib/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
|
|
3
|
-
import { FormInstance } from 'antd';
|
|
4
|
-
import { GroupColumnProps, SpaceType } from './propsType';
|
|
5
|
-
import { ProFormColumnProps, ReactiveFunction } from '../../render/propsType';
|
|
6
|
-
export type EventArgs = any[];
|
|
7
|
-
/**
|
|
8
|
-
* 插入间隔符
|
|
9
|
-
* @param columns 表单配置数组
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare const insertSeparator: (columns: GroupColumnProps[], space?: SpaceType) => any[];
|
|
13
|
-
/** 带出event的组件默认取值方法 */
|
|
14
|
-
export declare function defaultGetValueFromEvent(valuePropName: string, ...args: EventArgs): any;
|
|
15
|
-
/** 转换names */
|
|
16
|
-
export declare const transformNamesString: (arr: (string | string[])[]) => (string | string[])[];
|
|
17
|
-
interface Params {
|
|
18
|
-
form?: FormInstance;
|
|
19
|
-
index?: number;
|
|
20
|
-
type?: string;
|
|
21
|
-
namePath?: InternalNamePath;
|
|
22
|
-
disabled?: boolean | ReactiveFunction<any, boolean>;
|
|
23
|
-
show?: boolean | ReactiveFunction<any, boolean>;
|
|
24
|
-
component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
|
|
25
|
-
fieldProps?: boolean | ReactiveFunction<any, boolean>;
|
|
26
|
-
name?: NamePath;
|
|
27
|
-
}
|
|
28
|
-
/** 计算响应式参数的值 */
|
|
29
|
-
export declare const getReactiveProps: (params: Params) => {
|
|
30
|
-
disabled: boolean;
|
|
31
|
-
show: boolean;
|
|
32
|
-
component: any;
|
|
33
|
-
fieldProps: boolean;
|
|
34
|
-
};
|
|
35
|
-
type ValueTypeGetterParams = Pick<ProFormColumnProps, 'valueType' | 'switchValue' | 'toISOString'> & {
|
|
36
|
-
type?: any;
|
|
37
|
-
mode?: string;
|
|
38
|
-
};
|
|
39
|
-
/** 获取当前字段的转换函数 */
|
|
40
|
-
export declare const getValueTypeTrans: (params: ValueTypeGetterParams) => any;
|
|
41
|
-
interface ColumnsTransformerParams {
|
|
42
|
-
columns: GroupColumnProps[];
|
|
43
|
-
name?: NamePath;
|
|
44
|
-
names?: NamePath[];
|
|
45
|
-
value?: any[];
|
|
46
|
-
onChange: any;
|
|
47
|
-
namePath?: InternalNamePath;
|
|
48
|
-
form: FormInstance;
|
|
49
|
-
index?: number;
|
|
50
|
-
}
|
|
51
|
-
/** 转换columns */
|
|
52
|
-
export declare const transformColumns: (params: ColumnsTransformerParams) => any[];
|
|
53
|
-
export {};
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.defaultGetValueFromEvent = defaultGetValueFromEvent;
|
|
8
|
-
exports.transformNamesString = exports.transformColumns = exports.insertSeparator = exports.getValueTypeTrans = exports.getReactiveProps = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _lodash = require("lodash");
|
|
13
|
-
var _antd = require("antd");
|
|
14
|
-
var _valueType = _interopRequireDefault(require("../../../utils/valueType"));
|
|
15
|
-
/**
|
|
16
|
-
* 插入间隔符
|
|
17
|
-
* @param columns 表单配置数组
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
var insertSeparator = exports.insertSeparator = function insertSeparator(columns, space) {
|
|
21
|
-
if (!(space === null || space === void 0 ? void 0 : space.separator)) {
|
|
22
|
-
return columns;
|
|
23
|
-
}
|
|
24
|
-
return columns.reduce(function (result, current, index, array) {
|
|
25
|
-
// 将当前元素添加到结果数组中
|
|
26
|
-
result.push(current);
|
|
27
|
-
// 如果当前元素不是最后一个元素,则添加间隔符
|
|
28
|
-
if (index < array.length - 1) {
|
|
29
|
-
result.push({
|
|
30
|
-
component: (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
31
|
-
className: "group-separator",
|
|
32
|
-
children: space.separator
|
|
33
|
-
}),
|
|
34
|
-
fieldProps: {
|
|
35
|
-
disabled: true
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}, []);
|
|
41
|
-
};
|
|
42
|
-
/** 带出event的组件默认取值方法 */
|
|
43
|
-
function defaultGetValueFromEvent(valuePropName) {
|
|
44
|
-
var event = arguments.length <= 1 ? undefined : arguments[1];
|
|
45
|
-
if (event && event.target && (0, _typeof2.default)(event.target) === 'object' && valuePropName in event.target) {
|
|
46
|
-
return event.target[valuePropName];
|
|
47
|
-
}
|
|
48
|
-
return event;
|
|
49
|
-
}
|
|
50
|
-
/** 转换names */
|
|
51
|
-
var transformNamesString = exports.transformNamesString = function transformNamesString(arr) {
|
|
52
|
-
var result = arr.map(function (subArr) {
|
|
53
|
-
if (Array.isArray(subArr)) {
|
|
54
|
-
return subArr.join('_');
|
|
55
|
-
}
|
|
56
|
-
return subArr;
|
|
57
|
-
});
|
|
58
|
-
return result;
|
|
59
|
-
};
|
|
60
|
-
/** 计算响应式参数的值 */
|
|
61
|
-
var getReactiveProps = exports.getReactiveProps = function getReactiveProps(params) {
|
|
62
|
-
var form = params.form,
|
|
63
|
-
index = params.index,
|
|
64
|
-
namePath = params.namePath,
|
|
65
|
-
disabled = params.disabled,
|
|
66
|
-
show = params.show,
|
|
67
|
-
component = params.component,
|
|
68
|
-
fieldProps = params.fieldProps,
|
|
69
|
-
name = params.name;
|
|
70
|
-
var values = form.getFieldsValue(namePath || undefined);
|
|
71
|
-
var _disabled = (0, _lodash.isFunction)(disabled) ? disabled(values, {
|
|
72
|
-
form: form,
|
|
73
|
-
index: index,
|
|
74
|
-
namePath: namePath
|
|
75
|
-
}) : disabled;
|
|
76
|
-
var _show = (0, _lodash.isFunction)(show) ? show(values, {
|
|
77
|
-
form: form,
|
|
78
|
-
index: index,
|
|
79
|
-
namePath: namePath
|
|
80
|
-
}) : show;
|
|
81
|
-
var _component = (0, _lodash.isFunction)(component) ? component(values, {
|
|
82
|
-
form: form,
|
|
83
|
-
index: index,
|
|
84
|
-
namePath: namePath
|
|
85
|
-
}) : component;
|
|
86
|
-
var _fieldProps = (0, _lodash.isFunction)(fieldProps) ? fieldProps(values, {
|
|
87
|
-
form: form,
|
|
88
|
-
index: index,
|
|
89
|
-
namePath: namePath
|
|
90
|
-
}) : fieldProps;
|
|
91
|
-
return {
|
|
92
|
-
disabled: _disabled,
|
|
93
|
-
show: _show,
|
|
94
|
-
component: _component,
|
|
95
|
-
fieldProps: _fieldProps
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
/** 获取当前字段的转换函数 */
|
|
99
|
-
var getValueTypeTrans = exports.getValueTypeTrans = function getValueTypeTrans(params) {
|
|
100
|
-
var _valueTypeMap$valueTy;
|
|
101
|
-
var valueType = params.valueType;
|
|
102
|
-
var transform = (_valueTypeMap$valueTy = _valueType.default[valueType]) === null || _valueTypeMap$valueTy === void 0 ? void 0 : _valueTypeMap$valueTy.call(_valueType.default, params);
|
|
103
|
-
return transform;
|
|
104
|
-
};
|
|
105
|
-
/** 转换columns */
|
|
106
|
-
var transformColumns = exports.transformColumns = function transformColumns(params) {
|
|
107
|
-
var form = params.form,
|
|
108
|
-
columns = params.columns,
|
|
109
|
-
name = params.name,
|
|
110
|
-
names = params.names,
|
|
111
|
-
outerIndex = params.index,
|
|
112
|
-
namePath = params.namePath,
|
|
113
|
-
value = params.value,
|
|
114
|
-
internalChange = params.onChange;
|
|
115
|
-
return columns === null || columns === void 0 ? void 0 : columns.flatMap(function (column, index) {
|
|
116
|
-
var type = column.type,
|
|
117
|
-
valueType = column.valueType,
|
|
118
|
-
switchValue = column.switchValue,
|
|
119
|
-
toISOString = column.toISOString,
|
|
120
|
-
fieldProps = column.fieldProps,
|
|
121
|
-
getValueFromEvent = column.getValueFromEvent,
|
|
122
|
-
_column$valuePropName = column.valuePropName,
|
|
123
|
-
valuePropName = _column$valuePropName === void 0 ? 'value' : _column$valuePropName,
|
|
124
|
-
normalize = column.normalize,
|
|
125
|
-
disabled = column.disabled,
|
|
126
|
-
show = column.show,
|
|
127
|
-
component = column.component;
|
|
128
|
-
var _ref = fieldProps || {},
|
|
129
|
-
mode = _ref.mode,
|
|
130
|
-
onChange = _ref.onChange,
|
|
131
|
-
onFieldChange = _ref.onFieldChange,
|
|
132
|
-
comDisabled = _ref.disabled;
|
|
133
|
-
var _disabled = disabled !== null && disabled !== void 0 ? disabled : comDisabled;
|
|
134
|
-
var columnName = names ? names[index] : [].concat(name, index);
|
|
135
|
-
// 响应式字段
|
|
136
|
-
var reactiveProps = getReactiveProps({
|
|
137
|
-
form: form,
|
|
138
|
-
index: index,
|
|
139
|
-
type: type,
|
|
140
|
-
namePath: namePath,
|
|
141
|
-
disabled: _disabled,
|
|
142
|
-
show: show,
|
|
143
|
-
component: component,
|
|
144
|
-
fieldProps: fieldProps,
|
|
145
|
-
name: columnName
|
|
146
|
-
});
|
|
147
|
-
if (reactiveProps.show === false) return [];
|
|
148
|
-
var transform = getValueTypeTrans({
|
|
149
|
-
type: type,
|
|
150
|
-
valueType: valueType,
|
|
151
|
-
switchValue: switchValue,
|
|
152
|
-
toISOString: toISOString,
|
|
153
|
-
mode: mode
|
|
154
|
-
});
|
|
155
|
-
var newValue;
|
|
156
|
-
var handleChange = function handleChange() {
|
|
157
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
158
|
-
args[_key] = arguments[_key];
|
|
159
|
-
}
|
|
160
|
-
if (getValueFromEvent) {
|
|
161
|
-
newValue = getValueFromEvent.apply(void 0, args);
|
|
162
|
-
} else {
|
|
163
|
-
newValue = defaultGetValueFromEvent.apply(void 0, [valuePropName].concat(args));
|
|
164
|
-
}
|
|
165
|
-
if ((transform === null || transform === void 0 ? void 0 : transform.normalize) || normalize) {
|
|
166
|
-
var _transform$normalize;
|
|
167
|
-
// @ts-ignore
|
|
168
|
-
newValue = ((_transform$normalize = transform.normalize) === null || _transform$normalize === void 0 ? void 0 : _transform$normalize.call(transform, newValue)) || (normalize === null || normalize === void 0 ? void 0 : normalize(newValue));
|
|
169
|
-
}
|
|
170
|
-
internalChange === null || internalChange === void 0 ? void 0 : internalChange(newValue, args[1], index);
|
|
171
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, args);
|
|
172
|
-
onFieldChange === null || onFieldChange === void 0 ? void 0 : onFieldChange(newValue, form.getFieldValue(namePath), {
|
|
173
|
-
index: outerIndex,
|
|
174
|
-
namePath: namePath,
|
|
175
|
-
form: form
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
|
179
|
-
name: columnName
|
|
180
|
-
}, reactiveProps), {}, {
|
|
181
|
-
fieldProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
182
|
-
onChange: handleChange,
|
|
183
|
-
value: value === null || value === void 0 ? void 0 : value[index]
|
|
184
|
-
})
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|