@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
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -17,13 +19,13 @@ var _icons = require("@ant-design/icons");
|
|
|
17
19
|
var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
|
|
18
20
|
var _utils = require("../utils");
|
|
19
21
|
var _locale = _interopRequireDefault(require("../../locale"));
|
|
20
|
-
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode"];
|
|
22
|
+
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode", "isRadioSelect"];
|
|
21
23
|
/*
|
|
22
24
|
*@Date: 2023-07-25 13:49:35
|
|
23
25
|
*@LastEditTime: 2023-07-25 13:49:35
|
|
24
26
|
*@Author: liudongliang
|
|
25
27
|
*@Description: 树每行节点渲染组件,复选时阻止点击事件冒泡,只有点击树节点文本会向上触发onSelect事件
|
|
26
|
-
*/
|
|
28
|
+
*/
|
|
27
29
|
/* eslint-disable no-plusplus */
|
|
28
30
|
var tagsBgColors = ['rgba(0, 106, 255,0.16)', 'rgba(0, 196, 74,0.16)', 'rgba(255, 140, 0,0.16)', 'rgba(255, 80, 80,0.16)', 'rgba(97, 97, 97, 0.16)'];
|
|
29
31
|
var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
|
|
@@ -55,19 +57,22 @@ function List(props) {
|
|
|
55
57
|
innerExpandKeys = props.innerExpandKeys,
|
|
56
58
|
selectedKey = props.selectedKey,
|
|
57
59
|
disabledMode = props.disabledMode,
|
|
60
|
+
isRadioSelect = props.isRadioSelect,
|
|
58
61
|
other = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
59
62
|
var fieldNameLabel = fieldNames.label;
|
|
60
63
|
var fieldNameValue = fieldNames.value;
|
|
61
64
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
62
65
|
expandedKeys: [],
|
|
63
66
|
autoExpandParent: true,
|
|
64
|
-
currentClickTreeNode: null
|
|
67
|
+
currentClickTreeNode: null,
|
|
68
|
+
handing: false
|
|
65
69
|
}),
|
|
66
70
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
67
71
|
_useSetState2$ = _useSetState2[0],
|
|
68
72
|
expandedKeys = _useSetState2$.expandedKeys,
|
|
69
73
|
autoExpandParent = _useSetState2$.autoExpandParent,
|
|
70
74
|
currentClickTreeNode = _useSetState2$.currentClickTreeNode,
|
|
75
|
+
handing = _useSetState2$.handing,
|
|
71
76
|
setState = _useSetState2[1];
|
|
72
77
|
(0, _react.useEffect)(function () {
|
|
73
78
|
if (searchStr) {
|
|
@@ -107,18 +112,44 @@ function List(props) {
|
|
|
107
112
|
});
|
|
108
113
|
}
|
|
109
114
|
}, [selectedKey]);
|
|
110
|
-
var onSelect = function
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
var onSelect = /*#__PURE__*/function () {
|
|
116
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value, item) {
|
|
117
|
+
var _props$onSelect;
|
|
118
|
+
var val;
|
|
119
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
120
|
+
while (1) switch (_context.prev = _context.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
if (!handing) {
|
|
123
|
+
_context.next = 2;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return _context.abrupt("return", null);
|
|
127
|
+
case 2:
|
|
128
|
+
val = value;
|
|
129
|
+
if (!isRadioSelect && value === currentClickTreeNode) {
|
|
130
|
+
// 如果当前点击了已经选中节点,那么取消选择
|
|
131
|
+
val = '';
|
|
132
|
+
}
|
|
133
|
+
setState({
|
|
134
|
+
currentClickTreeNode: val,
|
|
135
|
+
handing: true
|
|
136
|
+
});
|
|
137
|
+
_context.next = 7;
|
|
138
|
+
return props === null || props === void 0 ? void 0 : (_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, val, item);
|
|
139
|
+
case 7:
|
|
140
|
+
setState({
|
|
141
|
+
handing: false
|
|
142
|
+
});
|
|
143
|
+
case 8:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context.stop();
|
|
146
|
+
}
|
|
147
|
+
}, _callee);
|
|
148
|
+
}));
|
|
149
|
+
return function onSelect(_x, _x2) {
|
|
150
|
+
return _ref.apply(this, arguments);
|
|
151
|
+
};
|
|
152
|
+
}();
|
|
122
153
|
var TreeNodeRow = function TreeNodeRow(props) {
|
|
123
154
|
var nodeClass = props.nodeClass,
|
|
124
155
|
item = props.item,
|
|
@@ -268,7 +299,6 @@ function List(props) {
|
|
|
268
299
|
})]
|
|
269
300
|
}, onlyKey);
|
|
270
301
|
};
|
|
271
|
-
// const _treeData = useMemo(() => {
|
|
272
302
|
function fn() {
|
|
273
303
|
var loop = function loop(data, index) {
|
|
274
304
|
index++;
|
|
@@ -280,33 +310,27 @@ function List(props) {
|
|
|
280
310
|
isChecked = true;
|
|
281
311
|
}
|
|
282
312
|
var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
|
|
313
|
+
var nodeTitle = (0, _jsxRuntime.jsx)(TreeNodeRow, {
|
|
314
|
+
nodeClass: nodeClass,
|
|
315
|
+
item: item,
|
|
316
|
+
index: index,
|
|
317
|
+
title: (item === null || item === void 0 ? void 0 : item.title) || title,
|
|
318
|
+
isChecked: isChecked,
|
|
319
|
+
onlyKey: item[fieldNameValue]
|
|
320
|
+
});
|
|
283
321
|
if (item[fieldNames.children]) {
|
|
284
|
-
return {
|
|
285
|
-
title:
|
|
286
|
-
|
|
287
|
-
item: item,
|
|
288
|
-
index: index,
|
|
289
|
-
title: title,
|
|
290
|
-
isChecked: isChecked,
|
|
291
|
-
onlyKey: item[fieldNameValue]
|
|
292
|
-
}),
|
|
293
|
-
key: item[fieldNameValue],
|
|
322
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
323
|
+
title: nodeTitle,
|
|
324
|
+
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
|
294
325
|
children: loop(item[fieldNames.children], index)
|
|
295
|
-
};
|
|
326
|
+
});
|
|
296
327
|
}
|
|
297
|
-
return {
|
|
298
|
-
title:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
index: index,
|
|
302
|
-
title: title,
|
|
303
|
-
isChecked: isChecked,
|
|
304
|
-
onlyKey: item[fieldNameValue]
|
|
305
|
-
}),
|
|
306
|
-
key: item[fieldNameValue]
|
|
307
|
-
};
|
|
328
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
329
|
+
title: nodeTitle,
|
|
330
|
+
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue]
|
|
331
|
+
});
|
|
308
332
|
});
|
|
309
|
-
return treeRow;
|
|
333
|
+
return treeRow;
|
|
310
334
|
};
|
|
311
335
|
if ((other === null || other === void 0 ? void 0 : other.mode) === 'view') {
|
|
312
336
|
return;
|
|
@@ -317,8 +341,6 @@ function List(props) {
|
|
|
317
341
|
}
|
|
318
342
|
return loop(newTreeData, -1);
|
|
319
343
|
}
|
|
320
|
-
// return fn();
|
|
321
|
-
// }, [searchStr, expandedKeys, showCodeName, originalTreeData, currentClickTreeNode]);
|
|
322
344
|
var _treeData = fn();
|
|
323
345
|
var onExpand = function onExpand(newExpandedKeys) {
|
|
324
346
|
setState({
|
|
@@ -4,6 +4,30 @@
|
|
|
4
4
|
.pro-tree {
|
|
5
5
|
height: 100%; // tree auto css
|
|
6
6
|
|
|
7
|
+
.@{ant-prefix}-tree-node-content-wrapper{
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: baseline;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.@{ant-prefix}-tree .@{ant-prefix}-tree-treenode-disabled {
|
|
13
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
14
|
+
color: var(--zaui-text);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pro-tree-tree-node.checked {
|
|
18
|
+
color: var(--zaui-text);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pro-tree-tree-node.checked .brand-bg-opa-ten {
|
|
22
|
+
background-color: inherit;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 解决双滚动条
|
|
27
|
+
.@{ant-prefix}-select-dropdown.pro-tree-select-drop-down-container.checkable-tree{
|
|
28
|
+
overflow: hidden!important;
|
|
29
|
+
}
|
|
30
|
+
|
|
7
31
|
.@{ant-prefix}-spin-nested-loading {
|
|
8
32
|
height: 100%; // tree auto css
|
|
9
33
|
|
|
@@ -304,19 +328,6 @@
|
|
|
304
328
|
}
|
|
305
329
|
}
|
|
306
330
|
|
|
307
|
-
.@{ant-prefix}-tree .@{ant-prefix}-tree-treenode-disabled {
|
|
308
|
-
.@{ant-prefix}-tree-node-content-wrapper {
|
|
309
|
-
color: var(--zaui-text);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.pro-tree-tree-node.checked {
|
|
313
|
-
color: var(--zaui-text);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.pro-tree-tree-node.checked .brand-bg-opa-ten {
|
|
317
|
-
background-color: inherit;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
331
|
|
|
321
332
|
// 重置ant-form view模式样式ant-tree样式
|
|
322
333
|
.pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree * {
|
|
@@ -337,7 +348,18 @@
|
|
|
337
348
|
height: 16px !important;
|
|
338
349
|
}
|
|
339
350
|
|
|
340
|
-
|
|
341
|
-
.@{ant-prefix}-select-
|
|
342
|
-
|
|
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
|
+
}
|
|
343
365
|
}
|
package/lib/ProUpload/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var _ButtonRender = _interopRequireDefault(require("./components/ButtonRender"))
|
|
|
21
21
|
var _ImageRender = _interopRequireDefault(require("./components/ImageRender"));
|
|
22
22
|
var _uitls = require("./uitls");
|
|
23
23
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
24
|
-
var _excluded = ["value", "size", "action", "maxCount", "headerRender", "footerRender", "disabled", "uploadType", "buttonProps", "accept", "extraTipText", "beforeUpload", "onChange", "onDownload", "onPreview", "onRemove", "method", "className", "dataParams", "name", "showExampleContent", "showUploadList", "otherProps", "transformResponse", "exampleTitle", "exampleContent", "exampleModalProps", "buttonText", "afterRender", "fieldNames"];
|
|
24
|
+
var _excluded = ["value", "size", "action", "maxCount", "headerRender", "footerRender", "disabled", "uploadType", "buttonProps", "accept", "extraTipText", "beforeUpload", "onChange", "onDownload", "onPreview", "onRemove", "filterOriginFileObj", "method", "className", "dataParams", "name", "showExampleContent", "showUploadList", "otherProps", "transformResponse", "exampleTitle", "exampleContent", "exampleModalProps", "buttonText", "afterRender", "fieldNames"];
|
|
25
25
|
/*
|
|
26
26
|
* @Author: wangshengqiang
|
|
27
27
|
* @Date: 2023-02-03 14:18:59
|
|
@@ -54,6 +54,8 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
54
54
|
onDownload = props.onDownload,
|
|
55
55
|
onPreview = props.onPreview,
|
|
56
56
|
onRemove = props.onRemove,
|
|
57
|
+
_props$filterOriginFi = props.filterOriginFileObj,
|
|
58
|
+
filterOriginFileObj = _props$filterOriginFi === void 0 ? false : _props$filterOriginFi,
|
|
57
59
|
_props$method = props.method,
|
|
58
60
|
method = _props$method === void 0 ? 'post' : _props$method,
|
|
59
61
|
className = props.className,
|
|
@@ -89,15 +91,11 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
89
91
|
var uploadResTransform = function uploadResTransform(fileList) {
|
|
90
92
|
var _list = fileList.map(function (file) {
|
|
91
93
|
if (file.status === 'done' && file.response) {
|
|
92
|
-
var nfile = {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
uid: file.uid,
|
|
98
|
-
response: file === null || file === void 0 ? void 0 : file.response
|
|
99
|
-
// url: file?.response?.data?.url,
|
|
100
|
-
};
|
|
94
|
+
var nfile = (0, _objectSpread2.default)({}, file);
|
|
95
|
+
// 过滤掉originFileObj
|
|
96
|
+
if (filterOriginFileObj) {
|
|
97
|
+
return (0, _lodash.omit)(nfile, 'originFileObj');
|
|
98
|
+
}
|
|
101
99
|
if (transformResponse) {
|
|
102
100
|
var data = transformResponse(file.response) || {};
|
|
103
101
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, nfile), data);
|
|
@@ -184,7 +182,6 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
184
182
|
* @return {*}
|
|
185
183
|
*/
|
|
186
184
|
var handleBeforeUpload = function handleBeforeUpload(file, fileList) {
|
|
187
|
-
// TODO
|
|
188
185
|
if (!(0, _uitls.validateFileExt)(extExt, file)) {
|
|
189
186
|
var _locale$ProUpload2;
|
|
190
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"));
|
|
@@ -252,7 +249,8 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
252
249
|
showUploadList: showUploadList,
|
|
253
250
|
method: method,
|
|
254
251
|
accept: accept,
|
|
255
|
-
data: (0, _objectSpread2.default)({}, dataParams)
|
|
252
|
+
data: (0, _objectSpread2.default)({}, dataParams),
|
|
253
|
+
name: name
|
|
256
254
|
}, residueProps);
|
|
257
255
|
var baseProps = {
|
|
258
256
|
isView: isView,
|
|
@@ -18,10 +18,15 @@ export interface fieldNamesProps {
|
|
|
18
18
|
}
|
|
19
19
|
export interface ProUploadProps {
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
* @description 顶部的内容(button类型的上传不适用)
|
|
22
|
+
* @default -
|
|
23
|
+
*/
|
|
24
24
|
headerRender?: React.ReactNode | (() => React.ReactNode);
|
|
25
|
+
/**
|
|
26
|
+
* @description 是否过滤掉file对象中的originFileObj
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
filterOriginFileObj?: boolean;
|
|
25
30
|
/**
|
|
26
31
|
* @description 拖拽框底部内容
|
|
27
32
|
* @default -
|
package/lib/assets/view.svg
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<svg width="19px" height="15px" viewBox="0 0 19 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
3
|
<title>icon-dropdown-searchlist</title>
|
|
4
4
|
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
-
<g id="询报价录入交互说明" transform="translate(-531, -308)" fill="
|
|
5
|
+
<g id="询报价录入交互说明" transform="translate(-531, -308)" fill="currentColor" fill-rule="nonzero">
|
|
6
6
|
<g id="Dropdown/下拉弹窗切换/default备份-2" transform="translate(215, 299)">
|
|
7
7
|
<g id="编组-2" transform="translate(288, 1)">
|
|
8
8
|
<g id="编组" transform="translate(22, 0)">
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
</g>
|
|
18
18
|
</g>
|
|
19
19
|
</g>
|
|
20
|
-
</svg>
|
|
20
|
+
</svg>
|
package/lib/global.less
CHANGED
|
@@ -5,37 +5,46 @@ pre {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
* {
|
|
8
|
-
// 火狐浏览器
|
|
9
|
-
scrollbar-width: thin;
|
|
10
|
-
scrollbar-color: #8b8b8b transparent;
|
|
11
8
|
// ie浏览器
|
|
12
|
-
scrollbar-face-color: #
|
|
13
|
-
scrollbar-highlight-color: #
|
|
14
|
-
scrollbar-3dlight-color: #
|
|
15
|
-
}
|
|
9
|
+
scrollbar-face-color: #d2d3d7;
|
|
10
|
+
scrollbar-highlight-color: #979797;
|
|
11
|
+
scrollbar-3dlight-color: #979797;
|
|
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
|
+
}
|
|
28
|
+
|
|
29
|
+
:hover::-webkit-scrollbar-track {
|
|
30
|
+
background: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:hover::-webkit-scrollbar-thumb {
|
|
34
|
+
background-color: #d2d3d7;
|
|
35
|
+
background-clip: padding-box;
|
|
36
|
+
border-color: transparent;
|
|
37
|
+
border-style: dashed;
|
|
38
|
+
border-width: 4px;
|
|
39
|
+
border-radius: 10px;
|
|
40
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:hover::-webkit-scrollbar-thumb:hover {
|
|
44
|
+
background-color: #979797;
|
|
45
|
+
}
|
|
37
46
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
:hover::-webkit-scrollbar-track {
|
|
48
|
+
background-color: #fff;
|
|
49
|
+
}
|
|
41
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.6-beta.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@dnd-kit/sortable": "^7.0.2",
|
|
59
59
|
"@dnd-kit/utilities": "^3.2.1",
|
|
60
60
|
"@pansy/react-watermark": "^3.1.13",
|
|
61
|
-
"@zat-design/utils": "^1.1.
|
|
61
|
+
"@zat-design/utils": "^1.1.20",
|
|
62
62
|
"ahooks": "3.7.4",
|
|
63
63
|
"antd": "4.24.8",
|
|
64
64
|
"big.js": "^6.2.1",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
|
2
|
-
import { CascaderProps } from 'antd';
|
|
3
|
-
interface RequestProps<T, P extends any[]> {
|
|
4
|
-
service: Service<T, P>;
|
|
5
|
-
options?: Options<T, P>;
|
|
6
|
-
}
|
|
7
|
-
export type Props<T, RT extends T[], RP> = CascaderProps<T> & {
|
|
8
|
-
useRequest?: RequestProps<RT, [RP]>;
|
|
9
|
-
otherProps?: any;
|
|
10
|
-
isView?: boolean;
|
|
11
|
-
dataSource?: T[];
|
|
12
|
-
};
|
|
13
|
-
declare const ProCascader: <T, RT extends T[], RP>(props: Props<T, RT, RP>) => JSX.Element;
|
|
14
|
-
export default ProCascader;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import "antd/es/cascader/style";
|
|
3
|
-
import _Cascader from "antd/es/cascader";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
7
|
-
var _excluded = ["useRequest", "otherProps", "dataSource", "options"];
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
import { useRequest } from 'ahooks';
|
|
10
|
-
import Container from '../../Container';
|
|
11
|
-
import ProForm from '../../../../ProForm';
|
|
12
|
-
var defaultFieldNames = {
|
|
13
|
-
value: 'value',
|
|
14
|
-
label: 'label',
|
|
15
|
-
children: 'children'
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* 获取值对应的选项对象
|
|
19
|
-
*/
|
|
20
|
-
var findTreeTarget = function findTreeTarget(dataSource, value, fieldNames) {
|
|
21
|
-
var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
22
|
-
var stack = _toConsumableArray(dataSource);
|
|
23
|
-
if ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
24
|
-
var valueName = fieldNames.value,
|
|
25
|
-
label = fieldNames.label,
|
|
26
|
-
children = fieldNames.children;
|
|
27
|
-
return value === null || value === void 0 ? void 0 : value.map(function (valueItem) {
|
|
28
|
-
var index = 0;
|
|
29
|
-
while (stack.length) {
|
|
30
|
-
var target = stack.shift();
|
|
31
|
-
if (target[valueName] === valueItem) {
|
|
32
|
-
stack = target[children] ? _toConsumableArray(target[children]) : [];
|
|
33
|
-
return target;
|
|
34
|
-
}
|
|
35
|
-
index += 1;
|
|
36
|
-
}
|
|
37
|
-
return _defineProperty({}, valueName, valueItem);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return [];
|
|
41
|
-
};
|
|
42
|
-
var ProCascader = function ProCascader(props) {
|
|
43
|
-
var _restProps$fieldNames;
|
|
44
|
-
var requestProps = props.useRequest,
|
|
45
|
-
otherProps = props.otherProps,
|
|
46
|
-
dataSource = props.dataSource,
|
|
47
|
-
options = props.options,
|
|
48
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
|
49
|
-
var _ref2 = ProForm.useFieldProps() || {},
|
|
50
|
-
isViewCon = _ref2.isView;
|
|
51
|
-
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
52
|
-
var _useRequest = useRequest(requestProps === null || requestProps === void 0 ? void 0 : requestProps.service, requestProps === null || requestProps === void 0 ? void 0 : requestProps.options),
|
|
53
|
-
data = _useRequest.data;
|
|
54
|
-
var _dataSource = data || dataSource || options;
|
|
55
|
-
var _fieldNames = (_restProps$fieldNames = restProps.fieldNames) !== null && _restProps$fieldNames !== void 0 ? _restProps$fieldNames : defaultFieldNames;
|
|
56
|
-
if (isView) {
|
|
57
|
-
var valueTarget = findTreeTarget(_dataSource, restProps.value, _fieldNames);
|
|
58
|
-
var valueName = _fieldNames.value,
|
|
59
|
-
label = _fieldNames.label;
|
|
60
|
-
var nameList = valueTarget.map(function (item) {
|
|
61
|
-
var _item$label;
|
|
62
|
-
return (_item$label = item[label]) !== null && _item$label !== void 0 ? _item$label : item[valueName];
|
|
63
|
-
});
|
|
64
|
-
return _jsx(Container, {
|
|
65
|
-
children: nameList.join('/')
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return _jsx(_Cascader, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
69
|
-
options: _dataSource
|
|
70
|
-
}));
|
|
71
|
-
};
|
|
72
|
-
export default ProCascader;
|