@zat-design/sisyphus-react 3.4.5 → 3.4.6-beta.10
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 +151 -35
- package/dist/less.esm.css +151 -35
- package/es/ProConfigProvider/index.d.ts +2 -2
- package/es/ProConfigProvider/index.js +0 -3
- package/es/ProEditTable/components/RenderField/index.js +56 -48
- package/es/ProEditTable/index.js +3 -3
- package/es/ProEditTable/style/index.less +5 -7
- package/es/ProEditTable/utils/tools.d.ts +12 -0
- package/es/ProEditTable/utils/tools.js +79 -2
- package/es/ProForm/components/base/RangePicker/index.js +9 -9
- 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/Container/index.js +3 -2
- package/es/ProForm/components/combination/Container/style/index.less +5 -1
- package/es/ProForm/components/combination/FormList/index.js +1 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProCascader/index.js +256 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/es/ProForm/components/combination/ProCascader/utils/index.js +26 -0
- package/es/ProForm/components/combination/ProModalSelect/index.js +47 -33
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +17 -10
- package/es/ProForm/components/index.d.ts +1 -2
- package/es/ProForm/components/index.js +1 -4
- package/es/ProForm/components/render/Render.js +25 -20
- package/es/ProForm/components/render/RenderFields.js +4 -1
- package/es/ProForm/components/render/propsType.d.ts +5 -8
- package/es/ProForm/index.js +6 -2
- package/es/ProForm/propsType.d.ts +3 -0
- package/es/ProForm/style/index.less +2 -1
- package/es/ProForm/utils/index.d.ts +6 -1
- package/es/ProForm/utils/index.js +9 -6
- package/es/ProForm/utils/useChanged.js +1 -2
- package/es/ProForm/utils/useForm.js +19 -6
- package/es/ProForm/utils/useListChanged.js +1 -3
- package/es/ProIcon/config/index.d.ts +2 -0
- package/es/ProIcon/config/index.js +4 -2
- package/es/ProIcon/index.js +148 -81
- package/es/ProIcon/propsTypes.d.ts +6 -1
- package/es/ProIcon/utils/index.d.ts +5 -0
- package/es/ProIcon/utils/index.js +60 -0
- package/es/ProLayout/components/ProCollapse/index.js +6 -3
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/es/ProSelect/index.js +15 -3
- package/es/ProSelect/propsType.d.ts +2 -0
- package/es/ProSelect/utils/index.d.ts +9 -0
- package/es/ProSelect/utils/index.js +60 -0
- package/es/ProStep/components/Step/index.js +4 -3
- package/es/ProStep/style/index.less +37 -0
- package/es/ProTable/utils.js +6 -3
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +16 -6
- package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/es/ProTree/components/ProTree.js +96 -74
- package/es/ProTree/components/ProTreeSelect/index.js +5 -9
- package/es/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/es/ProTree/components/Tree.js +63 -41
- package/es/ProTree/style/index.less +38 -16
- package/es/ProUpload/index.js +11 -13
- package/es/ProUpload/propsType.d.ts +8 -3
- package/es/assets/view.svg +2 -2
- package/es/global.less +37 -28
- package/lib/ProConfigProvider/index.d.ts +2 -2
- package/lib/ProConfigProvider/index.js +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +54 -46
- package/lib/ProEditTable/index.js +3 -3
- package/lib/ProEditTable/style/index.less +5 -7
- package/lib/ProEditTable/utils/tools.d.ts +12 -0
- package/lib/ProEditTable/utils/tools.js +80 -2
- package/lib/ProForm/components/base/RangePicker/index.js +9 -9
- 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/Container/index.js +3 -2
- package/lib/ProForm/components/combination/Container/style/index.less +5 -1
- package/lib/ProForm/components/combination/FormList/index.js +1 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProCascader/index.js +256 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
- package/lib/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +33 -0
- package/lib/ProForm/components/combination/ProModalSelect/index.js +46 -32
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +17 -10
- package/lib/ProForm/components/index.d.ts +1 -2
- package/lib/ProForm/components/index.js +1 -8
- package/lib/ProForm/components/render/Render.js +25 -20
- package/lib/ProForm/components/render/RenderFields.js +4 -1
- package/lib/ProForm/components/render/propsType.d.ts +5 -8
- package/lib/ProForm/index.js +5 -1
- package/lib/ProForm/propsType.d.ts +3 -0
- package/lib/ProForm/style/index.less +2 -1
- package/lib/ProForm/utils/index.d.ts +6 -1
- package/lib/ProForm/utils/index.js +9 -6
- package/lib/ProForm/utils/useChanged.js +1 -2
- package/lib/ProForm/utils/useForm.js +19 -6
- package/lib/ProForm/utils/useListChanged.js +1 -3
- package/lib/ProIcon/config/index.d.ts +2 -0
- package/lib/ProIcon/config/index.js +4 -2
- package/lib/ProIcon/index.js +144 -77
- package/lib/ProIcon/propsTypes.d.ts +6 -1
- package/lib/ProIcon/utils/index.d.ts +5 -0
- package/lib/ProIcon/utils/index.js +62 -1
- package/lib/ProLayout/components/ProCollapse/index.js +6 -3
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/lib/ProSelect/index.js +15 -3
- package/lib/ProSelect/propsType.d.ts +2 -0
- package/lib/ProSelect/utils/index.d.ts +9 -0
- package/lib/ProSelect/utils/index.js +68 -0
- package/lib/ProStep/components/Step/index.js +4 -3
- package/lib/ProStep/style/index.less +37 -0
- package/lib/ProTable/utils.js +6 -3
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +16 -6
- package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/lib/ProTree/components/ProTree.js +96 -74
- package/lib/ProTree/components/ProTreeSelect/index.js +5 -9
- package/lib/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/lib/ProTree/components/Tree.js +63 -41
- package/lib/ProTree/style/index.less +38 -16
- package/lib/ProUpload/index.js +10 -12
- package/lib/ProUpload/propsType.d.ts +8 -3
- package/lib/assets/view.svg +2 -2
- package/lib/global.less +37 -28
- package/package.json +2 -2
- package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/es/ProForm/components/base/ProCascader/index.js +0 -72
- package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
- package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/lib/ProForm/components/base/ProCascader/index.js +0 -78
- package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
|
@@ -226,7 +226,7 @@ var Render = function Render(props) {
|
|
|
226
226
|
}
|
|
227
227
|
_args[2].option = args[1];
|
|
228
228
|
switch (type) {
|
|
229
|
-
case '
|
|
229
|
+
case 'ProCascader':
|
|
230
230
|
_args[2].selectedOptions = args[1];
|
|
231
231
|
break;
|
|
232
232
|
case 'DatePicker':
|
|
@@ -242,7 +242,7 @@ var Render = function Render(props) {
|
|
|
242
242
|
* onChange参数重置 (value, record, { form, index, namePath, option }) => void
|
|
243
243
|
*/
|
|
244
244
|
var handleChange = function handleChange() {
|
|
245
|
-
var
|
|
245
|
+
var _lastComponentProps$c2;
|
|
246
246
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
247
247
|
args[_key] = arguments[_key];
|
|
248
248
|
}
|
|
@@ -260,11 +260,11 @@ var Render = function Render(props) {
|
|
|
260
260
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat(_toConsumableArray(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat(_toConsumableArray(_args))));
|
|
261
261
|
return false;
|
|
262
262
|
}
|
|
263
|
-
|
|
264
|
-
// FormList 和 Group场景 对比值改变的话, 回显到表单上
|
|
265
|
-
if (inList) {
|
|
266
|
-
|
|
267
|
-
}
|
|
263
|
+
// const inList = _otherFormItemProps?.namePath?.length;
|
|
264
|
+
// // FormList 和 Group场景 对比值改变的话, 回显到表单上
|
|
265
|
+
// if (inList) {
|
|
266
|
+
// form.setFieldsValue(_args[1]);
|
|
267
|
+
// }
|
|
268
268
|
// Group默认校验, 延时与重新setFieldValue,为了解决校验值未同步最新的问题,
|
|
269
269
|
if (formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames) {
|
|
270
270
|
setTimeout(function () {
|
|
@@ -276,7 +276,7 @@ var Render = function Render(props) {
|
|
|
276
276
|
// ProTreeSelect返回option
|
|
277
277
|
if (['ProTree'].includes(type)) {
|
|
278
278
|
var _args2, _args2$;
|
|
279
|
-
_args[2].option = findOptionByValue(lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.dataSource, (_args2 = _args) === null || _args2 === void 0 ? void 0 : (_args2$ = _args2[0]) === null || _args2$ === void 0 ? void 0 : _args2$[0]);
|
|
279
|
+
_args[2].option = findOptionByValue(lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.dataSource, (_args2 = _args) === null || _args2 === void 0 ? void 0 : (_args2$ = _args2[0]) === null || _args2$ === void 0 ? void 0 : _args2$[0], (lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.fieldNames) || {});
|
|
280
280
|
}
|
|
281
281
|
(_lastComponentProps$c2 = lastComponentProps[changeKey]) === null || _lastComponentProps$c2 === void 0 ? void 0 : _lastComponentProps$c2.call.apply(_lastComponentProps$c2, [lastComponentProps].concat(_toConsumableArray(_args)));
|
|
282
282
|
};
|
|
@@ -423,17 +423,21 @@ var Render = function Render(props) {
|
|
|
423
423
|
var formItem = orgFormItem;
|
|
424
424
|
// 当存在shouldUpdate时捕获所有form变更(防止表单onchange设置form值时无法更新的问题)
|
|
425
425
|
if (_otherFormItemProps.shouldUpdate) {
|
|
426
|
-
formItem =
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
children:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
426
|
+
formItem =
|
|
427
|
+
// 空标签防止气泡不显示
|
|
428
|
+
_jsx(_Fragment, {
|
|
429
|
+
children: _jsx(_Form.Item, {
|
|
430
|
+
shouldUpdate: _otherFormItemProps.shouldUpdate,
|
|
431
|
+
noStyle: true,
|
|
432
|
+
children: function children() {
|
|
433
|
+
return _jsx(_Form.Item, _objectSpread(_objectSpread({}, omit(_otherFormItemProps, filterFormItemKey)), {}, {
|
|
434
|
+
// @ts-ignore
|
|
435
|
+
_internalItemRender: internalItemRender,
|
|
436
|
+
className: _className,
|
|
437
|
+
children: child
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
})
|
|
437
441
|
});
|
|
438
442
|
}
|
|
439
443
|
// 不渲染tooltip
|
|
@@ -449,7 +453,8 @@ var Render = function Render(props) {
|
|
|
449
453
|
});
|
|
450
454
|
return _jsx(_Tooltip, {
|
|
451
455
|
title: title,
|
|
452
|
-
|
|
456
|
+
open: changed ? undefined : false,
|
|
457
|
+
// open={true}
|
|
453
458
|
getPopupContainer: function getPopupContainer(target) {
|
|
454
459
|
return target.parentElement;
|
|
455
460
|
},
|
|
@@ -178,7 +178,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
178
178
|
hiddenNames: column.hiddenNames,
|
|
179
179
|
colProps: _colProps,
|
|
180
180
|
mode: componentProps.mode,
|
|
181
|
-
namePath: column.namePath
|
|
181
|
+
namePath: column.namePath,
|
|
182
|
+
listName: column.listName,
|
|
183
|
+
globalControl: globalControl,
|
|
184
|
+
formDisabled: formDisabled
|
|
182
185
|
};
|
|
183
186
|
if (outerClearNotShow !== false && show === false && (column === null || column === void 0 ? void 0 : column.name) && form.getFieldValue(column === null || column === void 0 ? void 0 : column.name)) {
|
|
184
187
|
setTimeout(function () {
|
|
@@ -16,8 +16,7 @@ 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 { AddressProps } from '../combination/ProAddressBar/propsType';
|
|
19
|
+
import { ProCascaderProps } from '../combination/ProCascader/propsType';
|
|
21
20
|
import { ProCombinationProps } from '../combination/ProCombination/propsType';
|
|
22
21
|
import { ProModalSelectPropsType as ProModalSelectProps } from '../combination/ProModalSelect/propsType';
|
|
23
22
|
import { ProNumberRangeProps } from '../combination/ProNumberRange/propsType';
|
|
@@ -123,8 +122,8 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
123
122
|
type?: 'TextArea';
|
|
124
123
|
fieldProps?: FieldProps<TextAreaProps, Values, T>;
|
|
125
124
|
} | {
|
|
126
|
-
type?: '
|
|
127
|
-
fieldProps?: FieldProps<
|
|
125
|
+
type?: 'ProCascader';
|
|
126
|
+
fieldProps?: FieldProps<ProCascaderProps, Values, T>;
|
|
128
127
|
} | {
|
|
129
128
|
type?: 'ProCombination';
|
|
130
129
|
fieldProps?: FieldProps<ProCombinationProps, Values, T>;
|
|
@@ -155,9 +154,6 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
155
154
|
} | {
|
|
156
155
|
type?: 'ProUpload';
|
|
157
156
|
fieldProps?: FieldProps<ProUploadProps, Values, T>;
|
|
158
|
-
} | {
|
|
159
|
-
type?: 'ProCascader';
|
|
160
|
-
fieldProps?: FieldProps<ProCascaderProps<any, any[], any>, Values, T>;
|
|
161
157
|
} | {
|
|
162
158
|
type?: 'ProTree';
|
|
163
159
|
fieldProps?: FieldProps<ProTreeProps, Values, T>;
|
|
@@ -212,6 +208,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
212
208
|
clearNotShow?: boolean;
|
|
213
209
|
index?: number;
|
|
214
210
|
namePath?: NamePath;
|
|
211
|
+
listName?: NamePath;
|
|
215
212
|
/** 表单前缀信息 */
|
|
216
213
|
before?: string | React.ReactNode;
|
|
217
214
|
/** 表单后缀信息 */
|
|
@@ -220,7 +217,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
220
217
|
extra?: string | React.ReactNode;
|
|
221
218
|
/** 是否固定字段, 不隐藏 */
|
|
222
219
|
fixed?: boolean;
|
|
223
|
-
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
220
|
+
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
|
224
221
|
}
|
|
225
222
|
export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
|
|
226
223
|
/**
|
package/es/ProForm/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { DoubleLeftOutlined } from '@ant-design/icons';
|
|
|
18
18
|
import classnames from 'classnames';
|
|
19
19
|
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
20
20
|
import { isObject, isString, merge } from 'lodash';
|
|
21
|
-
import { FormFooter, InputRange, ProAddress,
|
|
21
|
+
import { FormFooter, InputRange, ProAddress, ProCascader, ProCertNo, ProCertValidity, ProCombination, ProModalSelect, ProNumberRange, ProRangeBox, ProTimeLimit, transferAddressInfoToRegion, ProUpload, ProTreeModal, ProTree, EnumSelect } from './components';
|
|
22
22
|
import RenderFields from './components/render/RenderFields';
|
|
23
23
|
import { useProConfig, useContextForms } from '../ProConfigProvider';
|
|
24
24
|
import { getLayout, splitNameStr, useControlled, initialValuesToNames } from './utils/index';
|
|
@@ -236,6 +236,10 @@ var ProForm = function ProForm(props, ref) {
|
|
|
236
236
|
onValuesChange: handleValuesChange,
|
|
237
237
|
onFinish: handleFinish,
|
|
238
238
|
initialValues: _initialValues,
|
|
239
|
+
scrollToFirstError: {
|
|
240
|
+
block: 'center',
|
|
241
|
+
behavior: 'smooth'
|
|
242
|
+
},
|
|
239
243
|
children: _jsxs(_Row, _objectSpread(_objectSpread({
|
|
240
244
|
gutter: 24
|
|
241
245
|
}, rowProps), {}, {
|
|
@@ -313,7 +317,7 @@ ProFormForward.Provider = ProFormProvider; // 包装Provider
|
|
|
313
317
|
ProFormForward.useFieldProps = useFieldProps; // 获取每个字段的其他参数 -otherProps
|
|
314
318
|
ProFormForward.useContextForms = useContextForms; // 获取 ProConfigProvider中的表单实例map
|
|
315
319
|
// 内置组合
|
|
316
|
-
ProFormForward.
|
|
320
|
+
ProFormForward.ProCascader = ProCascader;
|
|
317
321
|
ProFormForward.ProCombination = ProCombination;
|
|
318
322
|
ProFormForward.ProNumberRange = ProNumberRange;
|
|
319
323
|
ProFormForward.ProModalSelect = ProModalSelect;
|
|
@@ -41,6 +41,9 @@ export interface ProFormOtherProps {
|
|
|
41
41
|
required?: boolean | boolean[] | (() => boolean | boolean[]);
|
|
42
42
|
mode?: string;
|
|
43
43
|
namePath?: any[] | string | number;
|
|
44
|
+
listName?: any[] | string | number;
|
|
45
|
+
globalControl?: boolean;
|
|
46
|
+
formDisabled?: boolean;
|
|
44
47
|
}
|
|
45
48
|
export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
46
49
|
disabled?: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@import '../components/base/TextArea/index.less';
|
|
5
5
|
@import '../components/combination/FormList/style/index.less';
|
|
6
6
|
@import '../components/combination/ProTimeLimit/style/index.less';
|
|
7
|
-
@import '../components/combination/
|
|
7
|
+
@import '../components/combination/ProCascader/style/index.less';
|
|
8
8
|
@import '../components/combination/ProNumberRange/style/index.less';
|
|
9
9
|
@import '../components/combination/ProModalSelect/style/index.less';
|
|
10
10
|
@import '../components/combination/Group/style/index.less';
|
|
@@ -338,6 +338,7 @@
|
|
|
338
338
|
overflow: hidden;
|
|
339
339
|
white-space: nowrap;
|
|
340
340
|
text-overflow: ellipsis;
|
|
341
|
+
width: 100%;
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
.full-form-item {
|
|
@@ -83,7 +83,12 @@ export declare const deleteForPath: (values: any, namePath: string | number | (s
|
|
|
83
83
|
* @param value 选中值
|
|
84
84
|
* @returns {}
|
|
85
85
|
*/
|
|
86
|
-
export declare const findOptionByValue: (treeData: any[], value: string | number
|
|
86
|
+
export declare const findOptionByValue: (treeData: any[], value: string | number, fieldNames: {
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
label?: string;
|
|
89
|
+
value?: string;
|
|
90
|
+
children?: string;
|
|
91
|
+
}) => any;
|
|
87
92
|
/**
|
|
88
93
|
* 对比依赖列表中的 值是否变更
|
|
89
94
|
*/
|
|
@@ -43,7 +43,7 @@ export var useControlled = function useControlled(props) {
|
|
|
43
43
|
export var isSelect = function isSelect(props) {
|
|
44
44
|
var dataSource = props.dataSource,
|
|
45
45
|
type = props.type;
|
|
46
|
-
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', '
|
|
46
|
+
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProCascader', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload', 'TimePicker'].includes(type);
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Input TextArea 移除前后空格
|
|
@@ -127,6 +127,9 @@ export var filterInternalFields = function filterInternalFields(values) {
|
|
|
127
127
|
if ((values === null || values === void 0 ? void 0 : values._immutable) || moment.isMoment(values)) {
|
|
128
128
|
return nextValues;
|
|
129
129
|
}
|
|
130
|
+
if (values instanceof File) {
|
|
131
|
+
return nextValues;
|
|
132
|
+
}
|
|
130
133
|
if (Array.isArray(nextValues)) {
|
|
131
134
|
return nextValues.map(function (item) {
|
|
132
135
|
return filterInternalFields(item);
|
|
@@ -389,19 +392,19 @@ export var deleteForPath = function deleteForPath(values, namePath) {
|
|
|
389
392
|
* @param value 选中值
|
|
390
393
|
* @returns {}
|
|
391
394
|
*/
|
|
392
|
-
export var findOptionByValue = function findOptionByValue(treeData, value) {
|
|
395
|
+
export var findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
|
|
393
396
|
if (isObject(value)) {
|
|
394
397
|
return value;
|
|
395
398
|
}
|
|
396
399
|
for (var i = 0; i < (treeData === null || treeData === void 0 ? void 0 : treeData.length); i++) {
|
|
397
400
|
var node = treeData[i];
|
|
398
|
-
if (node.value === value) {
|
|
399
|
-
return omit(node, ['children']);
|
|
401
|
+
if (node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value'] === value) {
|
|
402
|
+
return omit(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
|
400
403
|
}
|
|
401
404
|
if (node.children) {
|
|
402
|
-
var foundNode = findOptionByValue(node.children, value);
|
|
405
|
+
var foundNode = findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
|
403
406
|
if (foundNode) {
|
|
404
|
-
return omit(foundNode, ['children']);
|
|
407
|
+
return omit(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
|
405
408
|
}
|
|
406
409
|
}
|
|
407
410
|
}
|
|
@@ -13,9 +13,8 @@ export var useChanged = function useChanged(_ref) {
|
|
|
13
13
|
return get(originalValues, name);
|
|
14
14
|
}) : get(originalValues, name);
|
|
15
15
|
var notWatch = !equalWith && (!originalValues || originalValue === undefined);
|
|
16
|
-
if (notWatch) form = [];
|
|
17
|
-
var value = _Form.useWatch(namesStr || name, form);
|
|
18
16
|
if (notWatch) return [false];
|
|
17
|
+
var value = _Form.useWatch(namesStr || name, form);
|
|
19
18
|
var changed = diffOriginal({
|
|
20
19
|
originalValue: originalValue,
|
|
21
20
|
value: value,
|
|
@@ -26,30 +26,43 @@ export var useForm = function useForm(originForm) {
|
|
|
26
26
|
_key,
|
|
27
27
|
values,
|
|
28
28
|
_values,
|
|
29
|
+
_error$errorFields,
|
|
30
|
+
_error$errorFields$,
|
|
29
31
|
_args = arguments;
|
|
30
32
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
31
33
|
while (1) switch (_context.prev = _context.next) {
|
|
32
34
|
case 0:
|
|
35
|
+
_context.prev = 0;
|
|
33
36
|
for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
34
37
|
rest[_key - 1] = _args[_key];
|
|
35
38
|
}
|
|
36
|
-
_context.next =
|
|
39
|
+
_context.next = 4;
|
|
37
40
|
return validateFields.apply(void 0, [nameList].concat(rest));
|
|
38
|
-
case
|
|
41
|
+
case 4:
|
|
39
42
|
values = _context.sent;
|
|
40
43
|
if (!nameList) {
|
|
41
|
-
_context.next =
|
|
44
|
+
_context.next = 7;
|
|
42
45
|
break;
|
|
43
46
|
}
|
|
44
47
|
return _context.abrupt("return", values);
|
|
45
|
-
case
|
|
48
|
+
case 7:
|
|
46
49
|
_values = _getFieldsValue();
|
|
47
50
|
return _context.abrupt("return", _values);
|
|
48
|
-
case
|
|
51
|
+
case 11:
|
|
52
|
+
_context.prev = 11;
|
|
53
|
+
_context.t0 = _context["catch"](0);
|
|
54
|
+
if (_context.t0 && (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields)) {
|
|
55
|
+
form === null || form === void 0 ? void 0 : form.scrollToField(_context.t0 === null || _context.t0 === void 0 ? void 0 : (_error$errorFields = _context.t0.errorFields) === null || _error$errorFields === void 0 ? void 0 : (_error$errorFields$ = _error$errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name, {
|
|
56
|
+
block: 'center',
|
|
57
|
+
behavior: 'smooth'
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
throw _context.t0;
|
|
61
|
+
case 15:
|
|
49
62
|
case "end":
|
|
50
63
|
return _context.stop();
|
|
51
64
|
}
|
|
52
|
-
}, _callee);
|
|
65
|
+
}, _callee, null, [[0, 11]]);
|
|
53
66
|
}));
|
|
54
67
|
return function _validateFields(_x) {
|
|
55
68
|
return _ref.apply(this, arguments);
|
|
@@ -80,10 +80,8 @@ export var useListChanged = function useListChanged(params) {
|
|
|
80
80
|
}) : undefined;
|
|
81
81
|
var noChange = !equalWith && (!originalValues || originalValue === undefined);
|
|
82
82
|
var _form = form;
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
if (notWatch) _form = [];
|
|
85
|
-
var value = _Form.useWatch(namePath, _form);
|
|
86
83
|
if (notWatch || noChange) return [false];
|
|
84
|
+
var value = _Form.useWatch(namePath, _form);
|
|
87
85
|
var changed = diffOriginal({
|
|
88
86
|
value: value,
|
|
89
87
|
originalValue: originalValue,
|
|
@@ -8,10 +8,12 @@ export declare const themeMap: {
|
|
|
8
8
|
'#00BC70': string[];
|
|
9
9
|
'#FF8C16': string[];
|
|
10
10
|
'#A00F20': string[];
|
|
11
|
+
'#31AF96': string[];
|
|
11
12
|
};
|
|
12
13
|
export declare const themeFillMap: {
|
|
13
14
|
'#006AFF': string[];
|
|
14
15
|
'#00BC70': string[];
|
|
15
16
|
'#FF8C16': string[];
|
|
16
17
|
'#A00F20': string[];
|
|
18
|
+
'#31AF96': string[];
|
|
17
19
|
};
|
|
@@ -260,12 +260,14 @@ export var themeMap = {
|
|
|
260
260
|
'#006AFF': ['#ADDDFF', '#5FB3D8', '#4181FF'],
|
|
261
261
|
'#00BC70': ['#FFFFFF', '#54DFA7', '#00BC70'],
|
|
262
262
|
'#FF8C16': ['#FFFFFF', '#FFA74E', '#FF8C17'],
|
|
263
|
-
'#A00F20': ['#FFFFFF', '#E47B7B', '#A00E20']
|
|
263
|
+
'#A00F20': ['#FFFFFF', '#E47B7B', '#A00E20'],
|
|
264
|
+
'#31AF96': ['#5FD8C7', '#5FD8C7', '#31AF96']
|
|
264
265
|
};
|
|
265
266
|
// 双色icon预设
|
|
266
267
|
export var themeFillMap = {
|
|
267
268
|
'#006AFF': ['none', '#87F1FC', 'black', '#4181FF'],
|
|
268
269
|
'#00BC70': ['none', '#05FFEC', 'black', '#00BC70'],
|
|
269
270
|
'#FF8C16': ['none', '#FED736', 'black', '#FF8C17'],
|
|
270
|
-
'#A00F20': ['none', '#FD8357', 'black', '#A00E20']
|
|
271
|
+
'#A00F20': ['none', '#FD8357', 'black', '#A00E20'],
|
|
272
|
+
'#31AF96': ['none', '#BBF392', 'black', '#31AF96']
|
|
271
273
|
};
|