@zat-design/sisyphus-react 3.4.6 → 3.4.8
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
package/lib/ProSelect/index.js
CHANGED
|
@@ -19,8 +19,9 @@ var _Container = _interopRequireDefault(require("../ProForm/components/Container
|
|
|
19
19
|
var _AdaptiveTooltip = _interopRequireDefault(require("./components/AdaptiveTooltip"));
|
|
20
20
|
var _ = require("..");
|
|
21
21
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
22
|
+
var _utils = require("./utils");
|
|
22
23
|
require("./index.less");
|
|
23
|
-
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
|
|
24
|
+
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
|
|
24
25
|
var Option = _antd.Select.Option;
|
|
25
26
|
var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
26
27
|
var _locale$ProSelect;
|
|
@@ -42,6 +43,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
42
43
|
tooltip = _props$tooltip === void 0 ? false : _props$tooltip,
|
|
43
44
|
otherProps = props.otherProps,
|
|
44
45
|
labelInValue = props.labelInValue,
|
|
46
|
+
_props$filterInList = props.filterInList,
|
|
47
|
+
filterInList = _props$filterInList === void 0 ? false : _props$filterInList,
|
|
45
48
|
_props$scrollFollowPa = props.scrollFollowParent,
|
|
46
49
|
scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa,
|
|
47
50
|
defaultOne = props.defaultOne,
|
|
@@ -266,6 +269,15 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
266
269
|
}
|
|
267
270
|
return value;
|
|
268
271
|
};
|
|
272
|
+
var newSelectList = selectList;
|
|
273
|
+
if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
|
|
274
|
+
newSelectList = (0, _utils.getSelectList)({
|
|
275
|
+
otherProps: otherProps,
|
|
276
|
+
value: props.value,
|
|
277
|
+
dataSource: selectList,
|
|
278
|
+
labelInValue: labelInValue
|
|
279
|
+
});
|
|
280
|
+
}
|
|
269
281
|
return (0, _jsxRuntime.jsx)(_antd.Select, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
270
282
|
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProSelect = _locale.default.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
|
|
271
283
|
allowClear: true,
|
|
@@ -288,7 +300,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
288
300
|
}
|
|
289
301
|
}, (0, _lodash.omit)((0, _lodash.cloneDeep)(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
|
|
290
302
|
value: transformValue(),
|
|
291
|
-
children: Array.isArray(
|
|
303
|
+
children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
|
|
292
304
|
return (0, _jsxRuntime.jsx)(Option, {
|
|
293
305
|
value: item[code],
|
|
294
306
|
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,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getSelectList = void 0;
|
|
8
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
+
/* eslint-disable no-restricted-syntax */
|
|
11
|
+
|
|
12
|
+
var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
13
|
+
var list = _ref.list,
|
|
14
|
+
selectName = _ref.selectName,
|
|
15
|
+
value = _ref.value,
|
|
16
|
+
dataSource = _ref.dataSource,
|
|
17
|
+
labelInValue = _ref.labelInValue;
|
|
18
|
+
var selectValues = [];
|
|
19
|
+
list.forEach(function (item) {
|
|
20
|
+
var result = item;
|
|
21
|
+
if (!item || !Object.keys(item).length || Object.keys(item).length === 1 && 'rowKey' in item) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
var _iterator = (0, _createForOfIteratorHelper2.default)(selectName),
|
|
25
|
+
_step;
|
|
26
|
+
try {
|
|
27
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
28
|
+
var key = _step.value;
|
|
29
|
+
result = result[key];
|
|
30
|
+
}
|
|
31
|
+
} catch (err) {
|
|
32
|
+
_iterator.e(err);
|
|
33
|
+
} finally {
|
|
34
|
+
_iterator.f();
|
|
35
|
+
}
|
|
36
|
+
selectValues.push(result);
|
|
37
|
+
});
|
|
38
|
+
var diffList = _lodash.default.difference(selectValues, [value]);
|
|
39
|
+
return dataSource.filter(function (item) {
|
|
40
|
+
return !diffList.includes(labelInValue ? item : item.value);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 返回当前组件可以显示的数据源
|
|
45
|
+
*/
|
|
46
|
+
var getSelectList = exports.getSelectList = function getSelectList(_ref2) {
|
|
47
|
+
var otherProps = _ref2.otherProps,
|
|
48
|
+
value = _ref2.value,
|
|
49
|
+
dataSource = _ref2.dataSource,
|
|
50
|
+
labelInValue = _ref2.labelInValue;
|
|
51
|
+
if (!otherProps) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
var listName = otherProps.listName,
|
|
55
|
+
form = otherProps.form;
|
|
56
|
+
var firstNumberIndex = listName.findIndex(function (item) {
|
|
57
|
+
return typeof item === 'number';
|
|
58
|
+
});
|
|
59
|
+
var fatherName = listName.slice(0, firstNumberIndex);
|
|
60
|
+
var selectName = listName.slice(firstNumberIndex + 1);
|
|
61
|
+
return findSelectNameValues({
|
|
62
|
+
list: form.getFieldValue(fatherName),
|
|
63
|
+
selectName: selectName,
|
|
64
|
+
value: value,
|
|
65
|
+
dataSource: dataSource,
|
|
66
|
+
labelInValue: labelInValue
|
|
67
|
+
});
|
|
68
|
+
};
|
|
@@ -409,13 +409,13 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
409
409
|
}
|
|
410
410
|
return result;
|
|
411
411
|
}
|
|
412
|
-
var handleChange = function handleChange(newVal) {
|
|
412
|
+
var handleChange = function handleChange(newVal, label, extra) {
|
|
413
413
|
// newVal回来得一定是label、value
|
|
414
414
|
var result = newVal;
|
|
415
415
|
if (props === null || props === void 0 ? void 0 : props.labelInValue) {
|
|
416
416
|
result = getLabelByValue(selectList, newVal);
|
|
417
417
|
}
|
|
418
|
-
onChange && onChange(result,
|
|
418
|
+
onChange && onChange(result, label, extra);
|
|
419
419
|
// 重置搜索
|
|
420
420
|
showSearch && searchTreeEvent('');
|
|
421
421
|
};
|
|
@@ -488,7 +488,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
488
488
|
allowClear: allowClear || true,
|
|
489
489
|
showArrow: true,
|
|
490
490
|
treeNodeFilterProp: treeNodeFilterProp,
|
|
491
|
-
virtual:
|
|
491
|
+
virtual: true
|
|
492
492
|
}, selectProps);
|
|
493
493
|
if (value === null) {
|
|
494
494
|
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/lib/ProUpload/index.js
CHANGED
|
@@ -182,10 +182,6 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
182
182
|
* @return {*}
|
|
183
183
|
*/
|
|
184
184
|
var handleBeforeUpload = function handleBeforeUpload(file, fileList) {
|
|
185
|
-
if (!(0, _lodash.isFunction)(beforeUpload)) {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
// TODO
|
|
189
185
|
if (!(0, _uitls.validateFileExt)(extExt, file)) {
|
|
190
186
|
var _locale$ProUpload2;
|
|
191
187
|
_antd.message.error("".concat(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload2 = _locale.default.ProUpload) === null || _locale$ProUpload2 === void 0 ? void 0 : _locale$ProUpload2.errorInfoExt, "\u3010").concat(extExt.join('、'), "\u3011"));
|
|
@@ -196,7 +192,9 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
196
192
|
_antd.message.error("".concat(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload3 = _locale.default.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.errorInfoSize).concat(size, "M"));
|
|
197
193
|
return false;
|
|
198
194
|
}
|
|
199
|
-
|
|
195
|
+
if (beforeUpload) {
|
|
196
|
+
return beforeUpload(file, fileList);
|
|
197
|
+
}
|
|
200
198
|
};
|
|
201
199
|
var handleRemove = function handleRemove(file) {
|
|
202
200
|
var nextList = _fileList.slice();
|
|
@@ -251,7 +249,8 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
251
249
|
showUploadList: showUploadList,
|
|
252
250
|
method: method,
|
|
253
251
|
accept: accept,
|
|
254
|
-
data: (0, _objectSpread2.default)({}, dataParams)
|
|
252
|
+
data: (0, _objectSpread2.default)({}, dataParams),
|
|
253
|
+
name: name
|
|
255
254
|
}, residueProps);
|
|
256
255
|
var baseProps = {
|
|
257
256
|
isView: isView,
|
package/lib/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/lib/locale/zh_CN.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GroupProps } from './propsType';
|
|
3
|
-
/**
|
|
4
|
-
* 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
|
|
5
|
-
* 2.
|
|
6
|
-
*
|
|
7
|
-
* render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
|
|
8
|
-
*/
|
|
9
|
-
declare const GroupCopy: React.FC<GroupProps>;
|
|
10
|
-
export default GroupCopy;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import "antd/es/space/style";
|
|
3
|
-
import _Space from "antd/es/space";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import React, { useMemo } from 'react';
|
|
8
|
-
import { omit } from 'lodash';
|
|
9
|
-
import classnames from 'classnames';
|
|
10
|
-
import { insertSeparator, transformColumns } from './utils';
|
|
11
|
-
import ProForm from '../../../../ProForm';
|
|
12
|
-
import ComRender from './component/ComRender';
|
|
13
|
-
/**
|
|
14
|
-
* 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
|
|
15
|
-
* 2.
|
|
16
|
-
*
|
|
17
|
-
* render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
|
|
18
|
-
*/
|
|
19
|
-
var GroupCopy = function GroupCopy(props) {
|
|
20
|
-
var children = props.children,
|
|
21
|
-
className = props.className,
|
|
22
|
-
_props$space = props.space,
|
|
23
|
-
space = _props$space === void 0 ? {
|
|
24
|
-
size: 12
|
|
25
|
-
} : _props$space,
|
|
26
|
-
value = props.value,
|
|
27
|
-
onChange = props.onChange;
|
|
28
|
-
var contextProps = ProForm.useFieldProps() || {};
|
|
29
|
-
var names = contextProps.names,
|
|
30
|
-
name = contextProps.name,
|
|
31
|
-
form = contextProps.form,
|
|
32
|
-
namePath = contextProps.namePath,
|
|
33
|
-
index = contextProps.index;
|
|
34
|
-
var _value = value && _toConsumableArray(value) || [];
|
|
35
|
-
var _option = React.useRef([]);
|
|
36
|
-
// 组合onChange
|
|
37
|
-
var handleChange = function handleChange(value, option, index) {
|
|
38
|
-
_value[index] = value;
|
|
39
|
-
_option.current[index] = option;
|
|
40
|
-
onChange(_value, _option.current);
|
|
41
|
-
};
|
|
42
|
-
var columns = useMemo(function () {
|
|
43
|
-
var columnsProps = transformColumns({
|
|
44
|
-
columns: children,
|
|
45
|
-
name: name,
|
|
46
|
-
names: names,
|
|
47
|
-
onChange: handleChange,
|
|
48
|
-
namePath: namePath,
|
|
49
|
-
form: form,
|
|
50
|
-
index: index,
|
|
51
|
-
value: _value
|
|
52
|
-
});
|
|
53
|
-
return insertSeparator(columnsProps, space);
|
|
54
|
-
}, [name, value, children, space, names, namePath, index]);
|
|
55
|
-
var _className = classnames(_defineProperty({
|
|
56
|
-
'pro-group': true,
|
|
57
|
-
'pro-group-diy-width': columns.some(function (item) {
|
|
58
|
-
var _item$fieldProps, _item$fieldProps$styl;
|
|
59
|
-
return item === null || item === void 0 ? void 0 : (_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : (_item$fieldProps$styl = _item$fieldProps.style) === null || _item$fieldProps$styl === void 0 ? void 0 : _item$fieldProps$styl.width;
|
|
60
|
-
}),
|
|
61
|
-
'pro-group-width-auto': columns.some(function (item) {
|
|
62
|
-
return ['Radio', 'Checkbox', 'Switch'].includes(item.type);
|
|
63
|
-
})
|
|
64
|
-
}, "".concat(className), className));
|
|
65
|
-
return _jsx("div", {
|
|
66
|
-
className: _className,
|
|
67
|
-
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? _jsx(_Space.Compact, {
|
|
68
|
-
children: columns.map(function (column) {
|
|
69
|
-
return _jsx(ComRender, _objectSpread({
|
|
70
|
-
contextProps: contextProps
|
|
71
|
-
}, column));
|
|
72
|
-
})
|
|
73
|
-
}) : _jsx(_Space, _objectSpread(_objectSpread({
|
|
74
|
-
align: "start"
|
|
75
|
-
}, omit(space, ['separator', 'compact'])), {}, {
|
|
76
|
-
children: columns.map(function (column, index) {
|
|
77
|
-
return _jsx(ComRender, _objectSpread({
|
|
78
|
-
contextProps: contextProps
|
|
79
|
-
}, column));
|
|
80
|
-
})
|
|
81
|
-
}))
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
export default GroupCopy;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormItemProps, ModalFuncProps, SpaceProps } from 'antd';
|
|
3
|
-
import { FormInstance } from 'antd/es/form/Form';
|
|
4
|
-
import { NamePath } from 'antd/lib/form/interface';
|
|
5
|
-
import { ColumnPropsMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../../propsType';
|
|
6
|
-
export interface SpaceType extends SpaceProps {
|
|
7
|
-
/**
|
|
8
|
-
* 是否紧凑合并
|
|
9
|
-
*/
|
|
10
|
-
compact?: Boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 分隔符
|
|
13
|
-
*/
|
|
14
|
-
separator?: string | React.ReactNode;
|
|
15
|
-
/** 间隔距离 */
|
|
16
|
-
size?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface GroupProps {
|
|
19
|
-
children?: GroupColumnProps[];
|
|
20
|
-
space?: SpaceType;
|
|
21
|
-
className?: string;
|
|
22
|
-
id?: string;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
isView?: boolean;
|
|
25
|
-
value?: any[];
|
|
26
|
-
onChange?: (value: any[] | null, options?: any[]) => void;
|
|
27
|
-
}
|
|
28
|
-
export type GroupColumnProps<Values = any> = {
|
|
29
|
-
component?: React.ReactNode | ReactiveFunction<Values, React.ReactNode>;
|
|
30
|
-
names?: NamePath[];
|
|
31
|
-
show?: boolean | ReactiveFunction<Values, boolean>;
|
|
32
|
-
valueType?: ProFormValueType;
|
|
33
|
-
switchValue?: [any, any];
|
|
34
|
-
isView?: boolean;
|
|
35
|
-
viewRender?: (value: any, record: Values, { form, index, namePath, }: {
|
|
36
|
-
form: FormInstance<Values>;
|
|
37
|
-
index?: number | undefined;
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}) => React.ReactElement<any, any> | string | undefined | null;
|
|
40
|
-
viewType?: ViewType;
|
|
41
|
-
disabled?: boolean | ReactiveFunction<Values, boolean>;
|
|
42
|
-
trim?: boolean;
|
|
43
|
-
upperCase?: boolean;
|
|
44
|
-
toISOString?: boolean;
|
|
45
|
-
clearNotShow?: boolean;
|
|
46
|
-
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
47
|
-
} & ColumnPropsMap & FormItemProps;
|
|
@@ -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 {};
|