@zat-design/sisyphus-react 3.4.6 → 3.4.8-beta.1
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 +17 -1
- package/dist/less.esm.css +17 -1
- package/es/ProEditTable/components/RenderField/index.js +5 -8
- package/es/ProEditTable/style/index.less +5 -2
- 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 +2 -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 +58 -76
- 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 +8 -6
- package/es/ProForm/components/render/RenderFields.js +1 -0
- package/es/ProForm/components/render/propsType.d.ts +4 -3
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +7 -0
- package/es/ProForm/utils/diffOriginal.js +2 -1
- package/es/ProForm/utils/index.d.ts +6 -1
- package/es/ProForm/utils/index.js +5 -5
- 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 +2 -1
- package/es/ProForm/utils/useListChanged.js +2 -2
- package/es/ProForm/utils/useRules.js +2 -20
- package/es/ProSelect/index.js +14 -2
- 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/ProTree/components/ProTreeSelect/index.js +3 -3
- package/es/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/es/ProTree/style/index.less +15 -0
- package/es/ProUpload/index.js +5 -6
- package/es/ProUpload/propsType.d.ts +1 -1
- package/es/global.less +40 -25
- package/es/locale/zh_CN.js +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +5 -8
- package/lib/ProEditTable/style/index.less +5 -2
- 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 +2 -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 +57 -72
- 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 +7 -5
- package/lib/ProForm/components/render/RenderFields.js +1 -0
- package/lib/ProForm/components/render/propsType.d.ts +4 -3
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +7 -0
- package/lib/ProForm/utils/diffOriginal.js +2 -1
- package/lib/ProForm/utils/index.d.ts +6 -1
- package/lib/ProForm/utils/index.js +5 -5
- 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 +2 -1
- package/lib/ProForm/utils/useListChanged.js +1 -1
- package/lib/ProForm/utils/useRules.js +2 -20
- package/lib/ProSelect/index.js +14 -2
- 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/ProTree/components/ProTreeSelect/index.js +3 -3
- package/lib/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/lib/ProTree/style/index.less +15 -0
- package/lib/ProUpload/index.js +5 -6
- package/lib/ProUpload/propsType.d.ts +1 -1
- package/lib/global.less +40 -25
- 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
|
@@ -28,7 +28,7 @@ import { ProEditTableProps } from '../../../ProEditTable/propsType';
|
|
|
28
28
|
import { ProTreeModalProps } from '../../../ProTreeModal/propsType';
|
|
29
29
|
import { ProUploadProps } from '../../../ProUpload/propsType';
|
|
30
30
|
import { ProTreeProps } from '../../../ProTree/propsType';
|
|
31
|
-
import { GroupProps } from '../combination/Group/propsType';
|
|
31
|
+
import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
|
|
32
32
|
import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
|
33
33
|
import { DistributiveOmit } from '../../propsType';
|
|
34
34
|
export type ComponentMap = keyof typeof componentMap;
|
|
@@ -159,7 +159,7 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
159
159
|
fieldProps?: FieldProps<ProTreeProps, Values, T>;
|
|
160
160
|
} | {
|
|
161
161
|
type?: 'Group';
|
|
162
|
-
fieldProps?:
|
|
162
|
+
fieldProps?: GroupCopyProps | ReactiveFunction<Values, GroupCopyProps>;
|
|
163
163
|
} | {
|
|
164
164
|
type?: 'ProCollapse';
|
|
165
165
|
fieldProps?: ProCollapseProps | ReactiveFunction<Values, ProCollapseProps>;
|
|
@@ -208,6 +208,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
208
208
|
clearNotShow?: boolean;
|
|
209
209
|
index?: number;
|
|
210
210
|
namePath?: NamePath;
|
|
211
|
+
listName?: NamePath;
|
|
211
212
|
/** 表单前缀信息 */
|
|
212
213
|
before?: string | React.ReactNode;
|
|
213
214
|
/** 表单后缀信息 */
|
|
@@ -216,7 +217,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
216
217
|
extra?: string | React.ReactNode;
|
|
217
218
|
/** 是否固定字段, 不隐藏 */
|
|
218
219
|
fixed?: boolean;
|
|
219
|
-
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
220
|
+
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
|
220
221
|
}
|
|
221
222
|
export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
|
|
222
223
|
/**
|
|
@@ -140,6 +140,13 @@
|
|
|
140
140
|
|
|
141
141
|
// 地址组件
|
|
142
142
|
.@{ant-prefix}-form-item-control-input-content {
|
|
143
|
+
// 查看模式
|
|
144
|
+
& > span {
|
|
145
|
+
border-radius: 4px;
|
|
146
|
+
padding: 5px 8px;
|
|
147
|
+
background: @zaui-contract-bg;
|
|
148
|
+
}
|
|
149
|
+
|
|
143
150
|
& > .pro-address {
|
|
144
151
|
.@{ant-prefix}-select-selector,
|
|
145
152
|
.@{ant-prefix}-input-affix-wrapper,
|
|
@@ -40,7 +40,8 @@ export var diffOriginal = function diffOriginal(params) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
|
|
43
|
-
|
|
43
|
+
var res = !isEqual(value, originalValue);
|
|
44
|
+
return res;
|
|
44
45
|
}
|
|
45
46
|
return false;
|
|
46
47
|
};
|
|
@@ -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
|
*/
|
|
@@ -392,19 +392,19 @@ export var deleteForPath = function deleteForPath(values, namePath) {
|
|
|
392
392
|
* @param value 选中值
|
|
393
393
|
* @returns {}
|
|
394
394
|
*/
|
|
395
|
-
export var findOptionByValue = function findOptionByValue(treeData, value) {
|
|
395
|
+
export var findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
|
|
396
396
|
if (isObject(value)) {
|
|
397
397
|
return value;
|
|
398
398
|
}
|
|
399
399
|
for (var i = 0; i < (treeData === null || treeData === void 0 ? void 0 : treeData.length); i++) {
|
|
400
400
|
var node = treeData[i];
|
|
401
|
-
if (node.value === value) {
|
|
402
|
-
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]);
|
|
403
403
|
}
|
|
404
404
|
if (node.children) {
|
|
405
|
-
var foundNode = findOptionByValue(node.children, value);
|
|
405
|
+
var foundNode = findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
|
406
406
|
if (foundNode) {
|
|
407
|
-
return omit(foundNode, ['children']);
|
|
407
|
+
return omit(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import { union
|
|
1
|
+
import { union } from 'lodash';
|
|
2
2
|
import { transformValue } from './transformValue';
|
|
3
3
|
var transformNames = function transformNames(formItem, form, names, fieldName, type) {
|
|
4
|
-
var _names2, _names3, _names3$;
|
|
5
4
|
var _ref = formItem || {},
|
|
6
5
|
normalize = _ref.normalize,
|
|
7
6
|
getValueProps = _ref.getValueProps,
|
|
8
7
|
_shouldUpdate2 = _ref.shouldUpdate;
|
|
9
|
-
|
|
10
|
-
if (!((_names2 = _names) === null || _names2 === void 0 ? void 0 : _names2.length)) {
|
|
8
|
+
if (!(names === null || names === void 0 ? void 0 : names.length)) {
|
|
11
9
|
return {};
|
|
12
10
|
}
|
|
13
11
|
// 当在formList场景下,给transformValue函数的setFiledProps的name, 需要全namePath
|
|
14
12
|
var _fieldName = Array.isArray(formItem === null || formItem === void 0 ? void 0 : formItem.name) ? union(formItem === null || formItem === void 0 ? void 0 : formItem.namePath, formItem === null || formItem === void 0 ? void 0 : formItem.name) : fieldName;
|
|
15
|
-
|
|
16
|
-
_names = _names.map(function (item) {
|
|
17
|
-
return union(formItem === null || formItem === void 0 ? void 0 : formItem.namePath, item);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
var _transformValue = transformValue(_names, form, _fieldName, normalize, getValueProps),
|
|
13
|
+
var _transformValue = transformValue(names, form, _fieldName, normalize, getValueProps),
|
|
21
14
|
_normalize = _transformValue.normalize,
|
|
22
15
|
_getValueProps = _transformValue.getValueProps,
|
|
23
16
|
_shouldUpdate = _transformValue.shouldUpdate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { isEqualWith } from 'lodash';
|
|
3
|
+
import { customEqualForFun } from '.';
|
|
4
|
+
/** 深度比较依赖变化memo */
|
|
5
|
+
export var useDeepCompareMemo = function useDeepCompareMemo(fun, depList) {
|
|
6
|
+
var lastDependency = useRef(); // 上一次的依赖
|
|
7
|
+
var lastRes = useRef(); // 上一次的结果
|
|
8
|
+
if (!isEqualWith(depList, lastDependency.current, customEqualForFun)) {
|
|
9
|
+
var res = fun();
|
|
10
|
+
lastRes.current = res;
|
|
11
|
+
}
|
|
12
|
+
lastDependency.current = depList;
|
|
13
|
+
return lastRes.current;
|
|
14
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "antd/es/form/style";
|
|
2
2
|
import _Form from "antd/es/form";
|
|
3
|
-
import { get } from 'lodash';
|
|
3
|
+
import { get, isString } from 'lodash';
|
|
4
4
|
import { diffOriginal } from './diffOriginal';
|
|
5
5
|
var toNamePath = function toNamePath(name) {
|
|
6
6
|
if (Array.isArray(name)) {
|
|
@@ -87,7 +87,7 @@ export var useListChanged = function useListChanged(params) {
|
|
|
87
87
|
originalValue: originalValue,
|
|
88
88
|
form: form,
|
|
89
89
|
equalWith: equalWith,
|
|
90
|
-
name: namesStr || name
|
|
90
|
+
name: isString(namesStr) ? namesStr : originalName || name
|
|
91
91
|
});
|
|
92
92
|
return [changed, originalValue];
|
|
93
93
|
};
|
|
@@ -24,10 +24,6 @@ var useRules = function useRules(props) {
|
|
|
24
24
|
var result = {
|
|
25
25
|
rules: rules || []
|
|
26
26
|
};
|
|
27
|
-
// Group required: true时,直接走完整校验
|
|
28
|
-
if (allRequired && type === 'Group') {
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
27
|
if (allRequired) {
|
|
32
28
|
if (!requiredRule) {
|
|
33
29
|
var message = isSelect ? "".concat(locale.ProForm.selectPlaceHolder).concat(_label) : "".concat(locale.ProForm.inputPlaceholder).concat(_label);
|
|
@@ -58,23 +54,9 @@ var useRules = function useRules(props) {
|
|
|
58
54
|
required: required
|
|
59
55
|
});
|
|
60
56
|
useEffect(function () {
|
|
61
|
-
if (type === 'Group' && (allRequired || requiredRule)) {
|
|
62
|
-
var customRequired = {
|
|
63
|
-
validator: function validator(rules, value) {
|
|
64
|
-
// 完整性校验, 数组有值且值不完整则校验不通过
|
|
65
|
-
if (Array.isArray(value) && isNotFullArray(value, names.length, required)) {
|
|
66
|
-
return Promise.reject(new Error("".concat(locale.ProForm.completeText).concat(_label)));
|
|
67
|
-
}
|
|
68
|
-
return Promise.resolve();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
// 插入rules第一条,完整性校验大于自定义
|
|
72
|
-
internalRule.rules.unshift(customRequired);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
57
|
// 添加完整性校验
|
|
76
58
|
if (names && !isBoolean(labelRequired)) {
|
|
77
|
-
var
|
|
59
|
+
var customRequired = {
|
|
78
60
|
validator: function validator(rules, value) {
|
|
79
61
|
// 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
|
|
80
62
|
if (Array.isArray(value) && !isNullArray(value) && isNotFullArray(value, names.length, required)) {
|
|
@@ -83,7 +65,7 @@ var useRules = function useRules(props) {
|
|
|
83
65
|
return Promise.resolve();
|
|
84
66
|
}
|
|
85
67
|
};
|
|
86
|
-
internalRule.rules.unshift(
|
|
68
|
+
internalRule.rules.unshift(customRequired);
|
|
87
69
|
}
|
|
88
70
|
}, [internalRule]);
|
|
89
71
|
return internalRule;
|
package/es/ProSelect/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
10
|
import "antd/es/select/style";
|
|
11
11
|
import _Select from "antd/es/select";
|
|
12
|
-
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
|
|
12
|
+
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
|
15
15
|
import React, { useImperativeHandle, useState, forwardRef } from 'react';
|
|
@@ -19,6 +19,7 @@ import Container from '../ProForm/components/Container';
|
|
|
19
19
|
import AdaptiveTooltip from './components/AdaptiveTooltip';
|
|
20
20
|
import { ProForm } from '..';
|
|
21
21
|
import locale from '../locale';
|
|
22
|
+
import { getSelectList } from './utils';
|
|
22
23
|
import './index.less';
|
|
23
24
|
var Option = _Select.Option;
|
|
24
25
|
export var ProSelect = function ProSelect(props, ref) {
|
|
@@ -41,6 +42,8 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
41
42
|
tooltip = _props$tooltip === void 0 ? false : _props$tooltip,
|
|
42
43
|
otherProps = props.otherProps,
|
|
43
44
|
labelInValue = props.labelInValue,
|
|
45
|
+
_props$filterInList = props.filterInList,
|
|
46
|
+
filterInList = _props$filterInList === void 0 ? false : _props$filterInList,
|
|
44
47
|
_props$scrollFollowPa = props.scrollFollowParent,
|
|
45
48
|
scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa,
|
|
46
49
|
defaultOne = props.defaultOne,
|
|
@@ -265,6 +268,15 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
265
268
|
}
|
|
266
269
|
return value;
|
|
267
270
|
};
|
|
271
|
+
var newSelectList = selectList;
|
|
272
|
+
if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
|
|
273
|
+
newSelectList = getSelectList({
|
|
274
|
+
otherProps: otherProps,
|
|
275
|
+
value: props.value,
|
|
276
|
+
dataSource: selectList,
|
|
277
|
+
labelInValue: labelInValue
|
|
278
|
+
});
|
|
279
|
+
}
|
|
268
280
|
return _jsx(_Select, _objectSpread(_objectSpread({
|
|
269
281
|
placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProSelect = locale.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
|
|
270
282
|
allowClear: true,
|
|
@@ -287,7 +299,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
287
299
|
}
|
|
288
300
|
}, omit(cloneDeep(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
|
|
289
301
|
value: transformValue(),
|
|
290
|
-
children: Array.isArray(
|
|
302
|
+
children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
|
|
291
303
|
return _jsx(Option, {
|
|
292
304
|
value: item[code],
|
|
293
305
|
record: item,
|
|
@@ -14,6 +14,8 @@ export interface PropSelectProps extends Omit<SelectProps, 'onSearch'> {
|
|
|
14
14
|
defaultOne?: boolean;
|
|
15
15
|
/** 数据源 */
|
|
16
16
|
dataSource?: DataOption[];
|
|
17
|
+
/** list场景中过滤掉已选择的值 */
|
|
18
|
+
filterInList?: boolean;
|
|
17
19
|
/** @deprecated 兼容 2.0 版本、3.0 使用view 模式 */
|
|
18
20
|
defaultDisableValue?: string;
|
|
19
21
|
/** 是否展示 tooltip、当 label 特别长的时候使用 */
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
|
+
/* eslint-disable no-restricted-syntax */
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
5
|
+
var list = _ref.list,
|
|
6
|
+
selectName = _ref.selectName,
|
|
7
|
+
value = _ref.value,
|
|
8
|
+
dataSource = _ref.dataSource,
|
|
9
|
+
labelInValue = _ref.labelInValue;
|
|
10
|
+
var selectValues = [];
|
|
11
|
+
list.forEach(function (item) {
|
|
12
|
+
var result = item;
|
|
13
|
+
if (!item || !Object.keys(item).length || Object.keys(item).length === 1 && 'rowKey' in item) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var _iterator = _createForOfIteratorHelper(selectName),
|
|
17
|
+
_step;
|
|
18
|
+
try {
|
|
19
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
20
|
+
var key = _step.value;
|
|
21
|
+
result = result[key];
|
|
22
|
+
}
|
|
23
|
+
} catch (err) {
|
|
24
|
+
_iterator.e(err);
|
|
25
|
+
} finally {
|
|
26
|
+
_iterator.f();
|
|
27
|
+
}
|
|
28
|
+
selectValues.push(result);
|
|
29
|
+
});
|
|
30
|
+
var diffList = _.difference(selectValues, [value]);
|
|
31
|
+
return dataSource.filter(function (item) {
|
|
32
|
+
return !diffList.includes(labelInValue ? item : item.value);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 返回当前组件可以显示的数据源
|
|
37
|
+
*/
|
|
38
|
+
export var getSelectList = function getSelectList(_ref2) {
|
|
39
|
+
var otherProps = _ref2.otherProps,
|
|
40
|
+
value = _ref2.value,
|
|
41
|
+
dataSource = _ref2.dataSource,
|
|
42
|
+
labelInValue = _ref2.labelInValue;
|
|
43
|
+
if (!otherProps) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
var listName = otherProps.listName,
|
|
47
|
+
form = otherProps.form;
|
|
48
|
+
var firstNumberIndex = listName.findIndex(function (item) {
|
|
49
|
+
return typeof item === 'number';
|
|
50
|
+
});
|
|
51
|
+
var fatherName = listName.slice(0, firstNumberIndex);
|
|
52
|
+
var selectName = listName.slice(firstNumberIndex + 1);
|
|
53
|
+
return findSelectNameValues({
|
|
54
|
+
list: form.getFieldValue(fatherName),
|
|
55
|
+
selectName: selectName,
|
|
56
|
+
value: value,
|
|
57
|
+
dataSource: dataSource,
|
|
58
|
+
labelInValue: labelInValue
|
|
59
|
+
});
|
|
60
|
+
};
|
|
@@ -407,13 +407,13 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
407
407
|
}
|
|
408
408
|
return result;
|
|
409
409
|
}
|
|
410
|
-
var handleChange = function handleChange(newVal) {
|
|
410
|
+
var handleChange = function handleChange(newVal, label, extra) {
|
|
411
411
|
// newVal回来得一定是label、value
|
|
412
412
|
var result = newVal;
|
|
413
413
|
if (props === null || props === void 0 ? void 0 : props.labelInValue) {
|
|
414
414
|
result = getLabelByValue(selectList, newVal);
|
|
415
415
|
}
|
|
416
|
-
onChange && onChange(result,
|
|
416
|
+
onChange && onChange(result, label, extra);
|
|
417
417
|
// 重置搜索
|
|
418
418
|
showSearch && searchTreeEvent('');
|
|
419
419
|
};
|
|
@@ -486,7 +486,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
486
486
|
allowClear: allowClear || true,
|
|
487
487
|
showArrow: true,
|
|
488
488
|
treeNodeFilterProp: treeNodeFilterProp,
|
|
489
|
-
virtual:
|
|
489
|
+
virtual: true
|
|
490
490
|
}, selectProps);
|
|
491
491
|
if (value === null) {
|
|
492
492
|
delete treeProps.value;
|
|
@@ -40,6 +40,12 @@
|
|
|
40
40
|
color: red;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
// 隐藏单选下拉树后面勾号
|
|
44
|
+
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
45
|
+
.check-mark-icon{
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
43
49
|
// 单选
|
|
44
50
|
&.signal-tree{
|
|
45
51
|
.@{ant-prefix}-select-tree{
|
|
@@ -63,14 +69,6 @@
|
|
|
63
69
|
display: block;
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
|
-
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
67
|
-
background-color: transparent;
|
|
68
|
-
&.@{ant-prefix}-select-tree-node-selected{
|
|
69
|
-
.check-mark-icon{
|
|
70
|
-
display: block;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
72
|
.@{ant-prefix}-select-tree-treenode:hover{
|
|
75
73
|
background-color: #f5f5f5;
|
|
76
74
|
}
|
|
@@ -348,3 +348,18 @@
|
|
|
348
348
|
height: 16px !important;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
.pro-tree-select, .pro-tree-select-drop-down-container{
|
|
352
|
+
.@{ant-prefix}-select-selector{
|
|
353
|
+
.check-mark-icon{
|
|
354
|
+
display: none;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
&.@{ant-prefix}-select-dropdown{
|
|
358
|
+
// 隐藏单选下拉树后面勾号
|
|
359
|
+
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
360
|
+
.check-mark-icon{
|
|
361
|
+
display: none;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
package/es/ProUpload/index.js
CHANGED
|
@@ -175,10 +175,6 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
175
175
|
* @return {*}
|
|
176
176
|
*/
|
|
177
177
|
var handleBeforeUpload = function handleBeforeUpload(file, fileList) {
|
|
178
|
-
if (!isFunction(beforeUpload)) {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
// TODO
|
|
182
178
|
if (!validateFileExt(extExt, file)) {
|
|
183
179
|
var _locale$ProUpload2;
|
|
184
180
|
_message.error("".concat(locale === null || locale === void 0 ? void 0 : (_locale$ProUpload2 = locale.ProUpload) === null || _locale$ProUpload2 === void 0 ? void 0 : _locale$ProUpload2.errorInfoExt, "\u3010").concat(extExt.join('、'), "\u3011"));
|
|
@@ -189,7 +185,9 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
189
185
|
_message.error("".concat(locale === null || locale === void 0 ? void 0 : (_locale$ProUpload3 = locale.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.errorInfoSize).concat(size, "M"));
|
|
190
186
|
return false;
|
|
191
187
|
}
|
|
192
|
-
|
|
188
|
+
if (beforeUpload) {
|
|
189
|
+
return beforeUpload(file, fileList);
|
|
190
|
+
}
|
|
193
191
|
};
|
|
194
192
|
var handleRemove = function handleRemove(file) {
|
|
195
193
|
var nextList = _fileList.slice();
|
|
@@ -244,7 +242,8 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
244
242
|
showUploadList: showUploadList,
|
|
245
243
|
method: method,
|
|
246
244
|
accept: accept,
|
|
247
|
-
data: _objectSpread({}, dataParams)
|
|
245
|
+
data: _objectSpread({}, dataParams),
|
|
246
|
+
name: name
|
|
248
247
|
}, residueProps);
|
|
249
248
|
var baseProps = {
|
|
250
249
|
isView: isView,
|
package/es/global.less
CHANGED
|
@@ -5,37 +5,52 @@ pre {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
* {
|
|
8
|
-
// 火狐浏览器
|
|
9
|
-
scrollbar-width: thin;
|
|
10
|
-
scrollbar-color: #d2d3d7 transparent;
|
|
11
8
|
// ie浏览器
|
|
12
9
|
scrollbar-face-color: #d2d3d7;
|
|
13
10
|
scrollbar-highlight-color: #979797;
|
|
14
11
|
scrollbar-3dlight-color: #979797;
|
|
15
|
-
}
|
|
16
12
|
|
|
17
|
-
::-webkit-scrollbar {
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
::-webkit-scrollbar {
|
|
14
|
+
width: 16px;
|
|
15
|
+
background: transparent;
|
|
16
|
+
}
|
|
20
17
|
|
|
21
|
-
//
|
|
22
|
-
::-webkit-scrollbar-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
border-style: dashed;
|
|
27
|
-
border-width: 4px;
|
|
28
|
-
border-radius: 10px;
|
|
29
|
-
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
|
30
|
-
}
|
|
18
|
+
// 轨道
|
|
19
|
+
::-webkit-scrollbar-track {
|
|
20
|
+
background-color: #fff;
|
|
21
|
+
border-radius: 10px;
|
|
22
|
+
}
|
|
31
23
|
|
|
32
|
-
//
|
|
33
|
-
::-webkit-scrollbar-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
// 悬浮轨道
|
|
25
|
+
::-webkit-scrollbar-thumb:hover {
|
|
26
|
+
background-color: #979797;
|
|
27
|
+
background-clip: padding-box;
|
|
28
|
+
border-color: transparent;
|
|
29
|
+
border-style: dashed;
|
|
30
|
+
border-width: 4px;
|
|
31
|
+
border-radius: 10px;
|
|
32
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:hover::-webkit-scrollbar-track {
|
|
36
|
+
background: transparent;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:hover::-webkit-scrollbar-thumb {
|
|
40
|
+
background-color: #d2d3d7;
|
|
41
|
+
background-clip: padding-box;
|
|
42
|
+
border-color: transparent;
|
|
43
|
+
border-style: dashed;
|
|
44
|
+
border-width: 4px;
|
|
45
|
+
border-radius: 10px;
|
|
46
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:hover::-webkit-scrollbar-thumb:hover {
|
|
50
|
+
background-color: #979797;
|
|
51
|
+
}
|
|
37
52
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
:hover::-webkit-scrollbar-track {
|
|
54
|
+
background-color: #fff;
|
|
55
|
+
}
|
|
41
56
|
}
|
package/es/locale/zh_CN.js
CHANGED
|
@@ -318,7 +318,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
318
318
|
}
|
|
319
319
|
_args = [].concat(args);
|
|
320
320
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
321
|
-
row =
|
|
321
|
+
row = form.getFieldValue(rowPath, true);
|
|
322
322
|
orgRow = (0, _lodash.cloneDeep)(row);
|
|
323
323
|
if (!onFieldChange) {
|
|
324
324
|
_context.next = 18;
|
|
@@ -363,7 +363,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
363
363
|
return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
364
364
|
case 27:
|
|
365
365
|
// 判断属性是否变动
|
|
366
|
-
|
|
366
|
+
form.setFieldValue(rowPath, row);
|
|
367
367
|
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
|
368
368
|
diff = (0, _tools.difference)(row, orgRow) || {};
|
|
369
369
|
validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
|
@@ -409,7 +409,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
409
409
|
}
|
|
410
410
|
_args = formatArgs([].concat(args));
|
|
411
411
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
412
|
-
row =
|
|
412
|
+
row = form.getFieldValue(rowPath, true);
|
|
413
413
|
orgRow = (0, _lodash.cloneDeep)(row);
|
|
414
414
|
_args[1] = row;
|
|
415
415
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
|
@@ -494,16 +494,13 @@ var RenderField = function RenderField(_ref) {
|
|
|
494
494
|
form: form,
|
|
495
495
|
names: names,
|
|
496
496
|
name: cellName,
|
|
497
|
+
listName: cellName,
|
|
497
498
|
viewEmpty: viewEmpty,
|
|
498
499
|
valueType: valueType,
|
|
499
500
|
isView: isView
|
|
500
501
|
}
|
|
501
502
|
});
|
|
502
|
-
|
|
503
|
-
componentProps.onFieldChange = _onchange;
|
|
504
|
-
} else {
|
|
505
|
-
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
|
|
506
|
-
}
|
|
503
|
+
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
|
|
507
504
|
// 单元格编辑时,设置各个单元格disabled属性
|
|
508
505
|
if (isCell) {
|
|
509
506
|
record["".concat(dataIndex, "-Disabled")] = _disabled;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
4
|
.pro-edit-table {
|
|
5
|
+
td[rowspan]{
|
|
6
|
+
vertical-align: middle !important;
|
|
7
|
+
}
|
|
5
8
|
.pro-edit-table-tooltip {
|
|
6
9
|
display : inline-flex;
|
|
7
10
|
align-items: center;
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
|
|
63
66
|
.drag-wrapper {
|
|
64
67
|
display: flex;
|
|
65
|
-
.
|
|
68
|
+
.anticon {
|
|
66
69
|
margin-right: var(--zaui-space-size-md, 16px);
|
|
67
70
|
margin-left: var(--zaui-space-size-xs, 4px);
|
|
68
71
|
cursor: pointer;
|
|
@@ -137,7 +140,7 @@
|
|
|
137
140
|
.@{ant-prefix}-table-cell-fix-left,
|
|
138
141
|
.@{ant-prefix}-table-cell-fix-right {
|
|
139
142
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
140
|
-
|
|
143
|
+
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
|