@zat-design/sisyphus-react 4.1.2-beta.2 → 4.1.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProEditTable/components/RenderField/index.js +134 -26
- package/es/ProEditTable/propsType.d.ts +6 -1
- package/es/ProEditTable/utils/index.js +26 -19
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +1 -0
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +37 -10
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +2 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +15 -11
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +61 -7
- package/es/ProForm/components/combination/Group/style/index.less +26 -1
- package/es/ProForm/components/combination/Group/utils/index.d.ts +7 -7
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/es/ProForm/propsType.d.ts +3 -3
- package/es/ProForm/utils/transformValue.d.ts +1 -1
- package/es/ProForm/utils/useForm.d.ts +1 -1
- package/es/ProForm/utils/useWatch.d.ts +2 -1
- package/es/ProForm/utils/useWatch.js +3 -1
- package/es/ProUpload/propsType.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +134 -26
- package/lib/ProEditTable/propsType.d.ts +6 -1
- package/lib/ProEditTable/utils/index.js +26 -19
- package/lib/ProEditTable/utils/useShouldUpdateForTable.d.ts +1 -0
- package/lib/ProEditTable/utils/useShouldUpdateForTable.js +37 -10
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +15 -11
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.js +61 -7
- package/lib/ProForm/components/combination/Group/style/index.less +26 -1
- package/lib/ProForm/components/combination/Group/utils/index.d.ts +7 -7
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.d.ts +3 -3
- package/lib/ProForm/utils/transformValue.d.ts +1 -1
- package/lib/ProForm/utils/useForm.d.ts +1 -1
- package/lib/ProForm/utils/useWatch.d.ts +2 -1
- package/lib/ProForm/utils/useWatch.js +3 -1
- package/lib/ProUpload/propsType.d.ts +1 -1
- package/package.json +4 -2
|
@@ -14,7 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
var useShouldUpdateForTable = props => {
|
|
17
|
-
var _isEditableRef$curren, _requiredRef$current, _rulesRef$current, _fieldPropsRef$curren, _desensitizationRef$c, _valueTypeRef$current;
|
|
17
|
+
var _isEditableRef$curren, _requiredRef$current, _rulesRef$current, _fieldPropsRef$curren, _desensitizationRef$c, _valueTypeRef$current, _componentRef$current;
|
|
18
18
|
var rowParams = props.rowParams,
|
|
19
19
|
column = props.column,
|
|
20
20
|
shouldUpdateDebounce = props.shouldUpdateDebounce;
|
|
@@ -26,11 +26,13 @@ var useShouldUpdateForTable = props => {
|
|
|
26
26
|
var fieldPropsRef = (0, _react.useRef)();
|
|
27
27
|
var desensitizationRef = (0, _react.useRef)();
|
|
28
28
|
var valueTypeRef = (0, _react.useRef)();
|
|
29
|
+
var componentRef = (0, _react.useRef)();
|
|
29
30
|
var _useState = (0, _react.useState)({}),
|
|
30
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
32
|
reRender = _useState2[1];
|
|
32
33
|
var debouncedUpdateRef = (0, _react.useRef)(null);
|
|
33
34
|
var pendingParamsRef = (0, _react.useRef)(null);
|
|
35
|
+
var isInitializedRef = (0, _react.useRef)(false);
|
|
34
36
|
|
|
35
37
|
// 统一处理所有动态属性的更新
|
|
36
38
|
var processUpdate = params => {
|
|
@@ -105,6 +107,19 @@ var useShouldUpdateForTable = props => {
|
|
|
105
107
|
} else {
|
|
106
108
|
valueTypeRef.current = column.valueType;
|
|
107
109
|
}
|
|
110
|
+
|
|
111
|
+
// component 处理(注意:component 是 editRender 的别名)
|
|
112
|
+
var componentOrEditRender = column.component || column.editRender;
|
|
113
|
+
if ((0, _lodash.isFunction)(componentOrEditRender)) {
|
|
114
|
+
var newComponent = componentOrEditRender(values, reactiveParams);
|
|
115
|
+
// 对于 ReactNode 类型的返回值,使用深度比较
|
|
116
|
+
if (!(0, _lodash.isEqualWith)(componentRef.current, newComponent, _utils.customEqualForFunction)) {
|
|
117
|
+
componentRef.current = newComponent;
|
|
118
|
+
hasChange = true;
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
componentRef.current = componentOrEditRender;
|
|
122
|
+
}
|
|
108
123
|
if (hasChange) {
|
|
109
124
|
reRender({});
|
|
110
125
|
}
|
|
@@ -112,7 +127,8 @@ var useShouldUpdateForTable = props => {
|
|
|
112
127
|
|
|
113
128
|
// 创建防抖函数(统一处理所有动态属性)
|
|
114
129
|
(0, _react.useEffect)(() => {
|
|
115
|
-
|
|
130
|
+
var componentOrEditRender = column.component || column.editRender;
|
|
131
|
+
if (shouldUpdateDebounce > 0 && ((0, _lodash.isFunction)(column.isEditable) || (0, _lodash.isFunction)(column.required) || (0, _lodash.isFunction)(column.rules) || (0, _lodash.isFunction)(column.fieldProps) || (0, _lodash.isFunction)(column.desensitization) || (0, _lodash.isFunction)(column.valueType) || (0, _lodash.isFunction)(componentOrEditRender))) {
|
|
116
132
|
debouncedUpdateRef.current = (0, _lodash.debounce)(() => {
|
|
117
133
|
if (pendingParamsRef.current) {
|
|
118
134
|
processUpdate(pendingParamsRef.current);
|
|
@@ -127,13 +143,23 @@ var useShouldUpdateForTable = props => {
|
|
|
127
143
|
}, [shouldUpdateDebounce, column]);
|
|
128
144
|
|
|
129
145
|
// 统一的属性处理逻辑
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
146
|
+
// 使用 ref 存储上一次的 rowParams,避免引用变化导致的重复调用
|
|
147
|
+
var prevRowParamsRef = (0, _react.useRef)(null);
|
|
148
|
+
|
|
149
|
+
// 只有当 rowParams 内容真正变化时才处理更新
|
|
150
|
+
// 或者是第一次初始化
|
|
151
|
+
var shouldProcess = !isInitializedRef.current || !(0, _lodash.isEqualWith)(prevRowParamsRef.current, rowParams, _utils.customEqualForFunction);
|
|
152
|
+
if (shouldProcess) {
|
|
153
|
+
prevRowParamsRef.current = rowParams;
|
|
154
|
+
isInitializedRef.current = true;
|
|
155
|
+
if (shouldUpdateDebounce > 0 && debouncedUpdateRef.current) {
|
|
156
|
+
// 使用防抖延迟更新
|
|
157
|
+
pendingParamsRef.current = rowParams;
|
|
158
|
+
debouncedUpdateRef.current();
|
|
159
|
+
} else {
|
|
160
|
+
// 立即更新(shouldUpdateDebounce = 0 或无防抖函数)
|
|
161
|
+
processUpdate(rowParams);
|
|
162
|
+
}
|
|
137
163
|
}
|
|
138
164
|
return {
|
|
139
165
|
isEditable: (_isEditableRef$curren = isEditableRef.current) !== null && _isEditableRef$curren !== void 0 ? _isEditableRef$curren : column.isEditable,
|
|
@@ -141,7 +167,8 @@ var useShouldUpdateForTable = props => {
|
|
|
141
167
|
rules: (_rulesRef$current = rulesRef.current) !== null && _rulesRef$current !== void 0 ? _rulesRef$current : column.rules,
|
|
142
168
|
fieldProps: (_fieldPropsRef$curren = fieldPropsRef.current) !== null && _fieldPropsRef$curren !== void 0 ? _fieldPropsRef$curren : column.fieldProps,
|
|
143
169
|
desensitization: (_desensitizationRef$c = desensitizationRef.current) !== null && _desensitizationRef$c !== void 0 ? _desensitizationRef$c : column.desensitization,
|
|
144
|
-
valueType: (_valueTypeRef$current = valueTypeRef.current) !== null && _valueTypeRef$current !== void 0 ? _valueTypeRef$current : column.valueType
|
|
170
|
+
valueType: (_valueTypeRef$current = valueTypeRef.current) !== null && _valueTypeRef$current !== void 0 ? _valueTypeRef$current : column.valueType,
|
|
171
|
+
component: (_componentRef$current = componentRef.current) !== null && _componentRef$current !== void 0 ? _componentRef$current : column.component || column.editRender
|
|
145
172
|
};
|
|
146
173
|
};
|
|
147
174
|
var _default = exports.default = useShouldUpdateForTable;
|
|
@@ -96,6 +96,16 @@ var ComRender = props => {
|
|
|
96
96
|
// 传统模式 compact 模式:需要 Form.Item 包装并应用宽度样式
|
|
97
97
|
// 通过 formItemClassName 和 formItemStyle 来判断是否需要 Form.Item 包装
|
|
98
98
|
if (formItemClassName && name) {
|
|
99
|
+
// 从 rest 中提取 required 和 rules,在非编辑态时移除校验
|
|
100
|
+
var formItemProps = _objectSpread({
|
|
101
|
+
name,
|
|
102
|
+
className: formItemClassName,
|
|
103
|
+
style: formItemStyle
|
|
104
|
+
}, isView ? {} : {
|
|
105
|
+
required: rest === null || rest === void 0 ? void 0 : rest.required,
|
|
106
|
+
rules: rest === null || rest === void 0 ? void 0 : rest.rules
|
|
107
|
+
});
|
|
108
|
+
|
|
99
109
|
// 如果有依赖字段,使用 shouldUpdate 来实时更新错误状态
|
|
100
110
|
if (dependencies && dependencies.length > 0) {
|
|
101
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
@@ -109,7 +119,7 @@ var ComRender = props => {
|
|
|
109
119
|
});
|
|
110
120
|
var hasChanged = currentFieldChanged || dependenciesChanged;
|
|
111
121
|
// 当检测到变化时,触发字段校验以更新错误状态
|
|
112
|
-
if (hasChanged && contextProps !== null && contextProps !== void 0 && contextProps.form && name) {
|
|
122
|
+
if (hasChanged && contextProps !== null && contextProps !== void 0 && contextProps.form && name && !isView) {
|
|
113
123
|
setTimeout(() => {
|
|
114
124
|
contextProps.form.validateFields([name]).catch(() => {});
|
|
115
125
|
}, 0);
|
|
@@ -117,10 +127,7 @@ var ComRender = props => {
|
|
|
117
127
|
return hasChanged;
|
|
118
128
|
},
|
|
119
129
|
noStyle: true,
|
|
120
|
-
children: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
121
|
-
name: name,
|
|
122
|
-
className: formItemClassName,
|
|
123
|
-
style: formItemStyle,
|
|
130
|
+
children: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, _objectSpread(_objectSpread({}, formItemProps), {}, {
|
|
124
131
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
125
132
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
126
133
|
valueType,
|
|
@@ -129,14 +136,11 @@ var ComRender = props => {
|
|
|
129
136
|
}),
|
|
130
137
|
children: renderComponent
|
|
131
138
|
})
|
|
132
|
-
})
|
|
139
|
+
}))
|
|
133
140
|
});
|
|
134
141
|
}
|
|
135
142
|
// 没有依赖字段,直接渲染 Form.Item
|
|
136
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
137
|
-
name: name,
|
|
138
|
-
className: formItemClassName,
|
|
139
|
-
style: formItemStyle,
|
|
143
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, _objectSpread(_objectSpread({}, formItemProps), {}, {
|
|
140
144
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
141
145
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
142
146
|
valueType,
|
|
@@ -145,7 +149,7 @@ var ComRender = props => {
|
|
|
145
149
|
}),
|
|
146
150
|
children: renderComponent
|
|
147
151
|
})
|
|
148
|
-
});
|
|
152
|
+
}));
|
|
149
153
|
}
|
|
150
154
|
|
|
151
155
|
// 非传统模式 compact 模式:直接渲染组件
|
|
@@ -127,16 +127,16 @@ var FlexibleGroupRender = props => {
|
|
|
127
127
|
var childDisabled = typeof child.disabled === 'function' ? false : child.disabled;
|
|
128
128
|
var finalDisabled = groupDisabled || childDisabled;
|
|
129
129
|
|
|
130
|
-
// 构建 formItemProps
|
|
130
|
+
// 构建 formItemProps - 在非编辑态时移除校验规则
|
|
131
131
|
var formItemProps = {
|
|
132
132
|
name: fullName,
|
|
133
133
|
label: child.label,
|
|
134
|
-
rules: child.rules,
|
|
134
|
+
rules: isView ? undefined : child.rules,
|
|
135
135
|
dependencies: processedDependencies,
|
|
136
136
|
extra: child.extra,
|
|
137
137
|
before: child.before,
|
|
138
138
|
after: child.after,
|
|
139
|
-
required: child.required,
|
|
139
|
+
required: isView ? undefined : child.required,
|
|
140
140
|
disabled: finalDisabled,
|
|
141
141
|
validateFirst: child.validateFirst
|
|
142
142
|
};
|
|
@@ -157,13 +157,40 @@ var FlexibleGroupRender = props => {
|
|
|
157
157
|
formItemProps.tooltip = child.tooltip;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
// 在ProEditTable场景下,如果同组其他字段有值,则当前字段空值不显示 -
|
|
161
|
+
var childViewEmpty = otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty;
|
|
162
|
+
if (isView && (otherProps === null || otherProps === void 0 ? void 0 : otherProps.source) === 'ProEditTable' && form && children.length > 1) {
|
|
163
|
+
// 检查同组其他字段是否有值
|
|
164
|
+
var hasOtherValues = children.some(otherChild => {
|
|
165
|
+
if (otherChild === child) return false; // 跳过当前字段
|
|
166
|
+
|
|
167
|
+
var otherChildNamePath = otherChild.namePath || contextProps.namePath;
|
|
168
|
+
var otherFullName = (() => {
|
|
169
|
+
if (otherChildNamePath && Array.isArray(otherChild.name) && otherChild.name.length > 1) {
|
|
170
|
+
return [...otherChildNamePath, ...otherChild.name];
|
|
171
|
+
}
|
|
172
|
+
if (otherChildNamePath) {
|
|
173
|
+
return [...otherChildNamePath, otherChild.name];
|
|
174
|
+
}
|
|
175
|
+
return otherChild.name;
|
|
176
|
+
})();
|
|
177
|
+
var value = form.getFieldValue(otherFullName);
|
|
178
|
+
return value !== undefined && value !== null && value !== '';
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// 如果有其他字段有值,当前字段空值显示为空字符串
|
|
182
|
+
if (hasOtherValues) {
|
|
183
|
+
childViewEmpty = '';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
160
187
|
// 构建 otherProps
|
|
161
188
|
var renderOtherProps = {
|
|
162
189
|
label: child.label,
|
|
163
190
|
name: fullName,
|
|
164
191
|
disabled: finalDisabled,
|
|
165
192
|
isView,
|
|
166
|
-
viewEmpty:
|
|
193
|
+
viewEmpty: childViewEmpty,
|
|
167
194
|
valueType: child.valueType,
|
|
168
195
|
form,
|
|
169
196
|
type,
|
|
@@ -277,12 +304,16 @@ var FlexibleGroupRender = props => {
|
|
|
277
304
|
elements.push(formElement);
|
|
278
305
|
|
|
279
306
|
// 添加分隔符
|
|
280
|
-
|
|
307
|
+
// 查看模式下,如果没有配置separator,使用默认的 finalSeparator
|
|
308
|
+
var separatorToUse = isView ? (space === null || space === void 0 ? void 0 : space.separator) || finalSeparator : space === null || space === void 0 ? void 0 : space.separator;
|
|
309
|
+
if (index < visibleChildren.length - 1 && separatorToUse) {
|
|
281
310
|
var shouldAddSeparator = space.separatorIndex ? Array.isArray(space.separatorIndex) ? space.separatorIndex.includes(originalIndex) : space.separatorIndex === originalIndex : true;
|
|
282
311
|
if (shouldAddSeparator) {
|
|
312
|
+
// 查看模式下使用不同的className,避免显示边框
|
|
313
|
+
var separatorClassName = isView ? 'pro-group-separator-compact pro-group-separator-view' : 'pro-group-separator-compact';
|
|
283
314
|
elements.push( /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
284
|
-
className:
|
|
285
|
-
children:
|
|
315
|
+
className: separatorClassName,
|
|
316
|
+
children: separatorToUse
|
|
286
317
|
}, child.name ? `separator-${child.name}` : `separator-${originalIndex}`));
|
|
287
318
|
}
|
|
288
319
|
}
|
|
@@ -312,6 +343,29 @@ var FlexibleGroupRender = props => {
|
|
|
312
343
|
return (otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty) || '-';
|
|
313
344
|
}
|
|
314
345
|
|
|
346
|
+
// 查看模式下,检查所有children的值是否都为空
|
|
347
|
+
if (isView && form && children.length > 0) {
|
|
348
|
+
var allValuesEmpty = children.every(child => {
|
|
349
|
+
var childNamePath = child.namePath || contextProps.namePath;
|
|
350
|
+
var fullName = (() => {
|
|
351
|
+
if (childNamePath && Array.isArray(child.name) && child.name.length > 1) {
|
|
352
|
+
return [...childNamePath, ...child.name];
|
|
353
|
+
}
|
|
354
|
+
if (childNamePath) {
|
|
355
|
+
return [...childNamePath, child.name];
|
|
356
|
+
}
|
|
357
|
+
return child.name;
|
|
358
|
+
})();
|
|
359
|
+
var value = form.getFieldValue(fullName);
|
|
360
|
+
return value === undefined || value === null || value === '';
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// 如果所有值都为空,显示一个 -
|
|
364
|
+
if (allValuesEmpty) {
|
|
365
|
+
return (otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty) || '-';
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
315
369
|
// 渲染内容
|
|
316
370
|
var renderContent = () => {
|
|
317
371
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
display: flex;
|
|
5
5
|
width: unset !important;
|
|
6
6
|
|
|
7
|
+
&.pro-group-view {
|
|
8
|
+
.pro-group-form-item {
|
|
9
|
+
flex: 0 0 auto !important;
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
.@{ant-prefix}-space-compact .pro-group-separator-compact{
|
|
13
|
+
color: #333 !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
7
16
|
|
|
8
17
|
|
|
9
18
|
&.pro-group-view {
|
|
@@ -385,6 +394,13 @@
|
|
|
385
394
|
// margin: 0 !important;
|
|
386
395
|
}
|
|
387
396
|
|
|
397
|
+
// 查看模式下,Form.Item不平分空间,而是根据内容自适应
|
|
398
|
+
&.pro-group-view {
|
|
399
|
+
.pro-group-form-item {
|
|
400
|
+
flex: 0 0 auto;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
388
404
|
// 当有自定义宽度时,只有设置了宽度的 Form.Item 不使用 flex:1
|
|
389
405
|
&.pro-group-diy-width {
|
|
390
406
|
// 覆盖 Space.Compact 内设置了宽度的 Form.Item
|
|
@@ -430,7 +446,7 @@
|
|
|
430
446
|
}
|
|
431
447
|
|
|
432
448
|
.@{ant-prefix}-input-number-input {
|
|
433
|
-
border-left:
|
|
449
|
+
border-left: 0 !important;
|
|
434
450
|
}
|
|
435
451
|
}
|
|
436
452
|
|
|
@@ -467,6 +483,15 @@
|
|
|
467
483
|
margin-left: -1px;
|
|
468
484
|
}
|
|
469
485
|
|
|
486
|
+
// 查看模式下的分隔符样式 - 移除边框,使用简洁样式
|
|
487
|
+
.pro-group-separator-view {
|
|
488
|
+
border: none !important;
|
|
489
|
+
background: transparent !important;
|
|
490
|
+
padding: 0 2px !important;
|
|
491
|
+
margin-inline-start: 0 !important;
|
|
492
|
+
color: #999 !important;
|
|
493
|
+
}
|
|
494
|
+
|
|
470
495
|
|
|
471
496
|
/* 1. 处理第一个子元素:左上、左下圆角 */
|
|
472
497
|
> .pro-group-form-item:first-child{
|
|
@@ -75,16 +75,15 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
75
75
|
confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
|
|
76
76
|
show?: boolean | ReactiveFunction<any, boolean>;
|
|
77
77
|
component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
|
|
78
|
-
|
|
78
|
+
status?: "" | "success" | "warning" | "error" | "validating";
|
|
79
79
|
className?: string;
|
|
80
80
|
hidden?: boolean;
|
|
81
|
+
id?: string;
|
|
81
82
|
style?: React.CSSProperties;
|
|
82
83
|
children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
|
|
83
84
|
onReset?: () => void;
|
|
84
85
|
prefixCls?: string;
|
|
85
|
-
status?: "" | "warning" | "error" | "success" | "validating";
|
|
86
86
|
rootClassName?: string;
|
|
87
|
-
isView?: boolean;
|
|
88
87
|
colon?: boolean;
|
|
89
88
|
htmlFor?: string;
|
|
90
89
|
labelAlign?: import("antd/es/form/interface").FormLabelAlign;
|
|
@@ -108,25 +107,26 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
108
107
|
hasFeedback?: boolean | {
|
|
109
108
|
icons: import("antd/es/form/FormItem").FeedbackIcons;
|
|
110
109
|
};
|
|
111
|
-
validateStatus?: "" | "
|
|
110
|
+
validateStatus?: "" | "success" | "warning" | "error" | "validating";
|
|
112
111
|
layout?: import("antd/es/form/Form").FormItemLayout;
|
|
113
112
|
wrapperCol?: import("antd").ColProps;
|
|
114
113
|
help?: React.ReactNode;
|
|
115
114
|
fieldId?: string;
|
|
116
115
|
valueType?: import("../../../render/propsType").ProFormValueType;
|
|
117
|
-
switchValue?: [any, any];
|
|
118
116
|
viewRender?: (value: any, record: any, { form, index, namePath, }: {
|
|
119
117
|
[key: string]: any;
|
|
120
118
|
form: FormInstance<any>;
|
|
121
119
|
index?: number;
|
|
122
120
|
}) => string | React.ReactElement<any, any>;
|
|
121
|
+
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
122
|
+
isView?: boolean;
|
|
123
|
+
switchValue?: [any, any];
|
|
123
124
|
viewType?: import("../../../render/propsType").ViewType;
|
|
124
125
|
trim?: boolean;
|
|
125
126
|
upperCase?: boolean;
|
|
126
127
|
toISOString?: boolean;
|
|
127
128
|
toCSTString?: boolean;
|
|
128
129
|
clearNotShow?: boolean;
|
|
129
|
-
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
130
130
|
name: any;
|
|
131
131
|
dependencies: any[];
|
|
132
132
|
tooltip: string | {
|
|
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
141
141
|
* 创建组件属性
|
|
142
142
|
*/
|
|
143
143
|
export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
|
|
144
|
-
componentProps: import("lodash").Omit<any, "
|
|
144
|
+
componentProps: import("lodash").Omit<any, "valueType" | "precision" | "format" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "clearNotShow">;
|
|
145
145
|
formItemTransform: {
|
|
146
146
|
getValueProps: any;
|
|
147
147
|
normalize: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { DefaultOptionType } from 'rc-select/
|
|
2
|
+
import { DefaultOptionType } from '@rc-component/select/es/Select';
|
|
3
3
|
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
|
4
4
|
export interface FieldNamesType {
|
|
5
5
|
label: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
1
2
|
import { ButtonProps, ColProps, RowProps } from 'antd';
|
|
2
3
|
import { FormProps, FormInstance } from 'antd/es/form/Form';
|
|
3
4
|
import { NamePath } from 'antd/es/form/interface';
|
|
4
|
-
import { StoreValue, Store } from 'rc-
|
|
5
|
-
import { ShouldUpdate } from 'rc-
|
|
6
|
-
import React, { ReactNode } from 'react';
|
|
5
|
+
import type { StoreValue, Store } from '@rc-component/form/es/interface';
|
|
6
|
+
import type { ShouldUpdate } from '@rc-component/form/es/Field';
|
|
7
7
|
import type { ProFormColumnType, ViewType } from './components/render/propsType';
|
|
8
8
|
import type { ProFormComponentType } from './components';
|
|
9
9
|
export interface ButtonType extends ButtonProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormInstance, FormItemProps } from 'antd';
|
|
2
2
|
import { NamePath } from 'antd/es/form/interface';
|
|
3
|
-
import { StoreValue, Store } from 'rc-
|
|
3
|
+
import type { StoreValue, Store } from '@rc-component/form/es/interface';
|
|
4
4
|
import type { TransformType } from '../propsType';
|
|
5
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,6 +1,6 @@
|
|
|
1
1
|
import { FormInstance } from 'antd';
|
|
2
2
|
import { NamePath } from 'antd/es/form/interface';
|
|
3
|
-
import { ValuedNotifyInfo } from 'rc-
|
|
3
|
+
import type { ValuedNotifyInfo } from '@rc-component/form/es/interface';
|
|
4
4
|
export type ModifiedFormInstanceType<T> = FormInstance<T> & {
|
|
5
5
|
isModified?: boolean;
|
|
6
6
|
/** 默认清空设置值的报错状态 */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FormInstance
|
|
1
|
+
import { FormInstance } from 'antd/es/form/Form';
|
|
2
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
2
3
|
export declare function toArray<T>(value?: T | T[] | null): T[];
|
|
3
4
|
/**
|
|
4
5
|
* ProForm的useWatch hook,用于监听表单字段变化
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UploadFile } from 'antd/es/upload/interface';
|
|
3
|
-
import { UploadRequestOption } from 'rc-upload/
|
|
3
|
+
import type { UploadRequestOption } from '@rc-component/upload/es/interface';
|
|
4
4
|
export type UploadType = 'drag' | 'button' | 'image';
|
|
5
5
|
export interface UploadFileResType {
|
|
6
6
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "4.1.2-beta.
|
|
3
|
+
"version": "4.1.2-beta.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
"lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
|
|
45
45
|
"lint-staged": "lint-staged",
|
|
46
46
|
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.*' --ignore-pattern '**/*.spec.*'",
|
|
47
|
+
"code-standards:check": "node ./scripts/code-standards-check.mjs",
|
|
48
|
+
"git:pull:dev_4": "git pull --tags --no-rebase origin dev_4",
|
|
47
49
|
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
|
48
50
|
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
|
49
51
|
"lint:prettier": "prettier --check \"**/*\" --end-of-line auto",
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
"husky": {
|
|
63
65
|
"hooks": {
|
|
64
66
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
65
|
-
"pre-commit": "npm run lint-staged"
|
|
67
|
+
"pre-commit": "npm run lint-staged && npm run code-standards:check"
|
|
66
68
|
}
|
|
67
69
|
},
|
|
68
70
|
"lint-staged": {
|