@zat-design/sisyphus-react 3.4.5 → 3.4.6-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 +140 -35
- package/dist/less.esm.css +140 -35
- package/es/ProConfigProvider/index.d.ts +2 -2
- package/es/ProConfigProvider/index.js +0 -3
- package/es/ProEditTable/components/RenderField/index.js +55 -48
- package/es/ProEditTable/index.js +3 -3
- package/es/ProEditTable/style/index.less +0 -5
- 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/combination/Container/index.js +3 -2
- package/es/ProForm/components/combination/Container/style/index.less +5 -1
- 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 +13 -5
- 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 +18 -13
- package/es/ProForm/components/render/RenderFields.js +3 -1
- package/es/ProForm/components/render/propsType.d.ts +3 -7
- package/es/ProForm/index.js +6 -2
- package/es/ProForm/propsType.d.ts +2 -0
- package/es/ProForm/style/index.less +2 -1
- package/es/ProForm/utils/index.js +4 -1
- package/es/ProForm/utils/useChanged.js +1 -2
- package/es/ProForm/utils/useForm.js +18 -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 +1 -1
- 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 +3 -7
- package/es/ProTree/components/Tree.js +63 -41
- package/es/ProTree/style/index.less +24 -17
- 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 +6 -6
- package/lib/ProConfigProvider/index.d.ts +2 -2
- package/lib/ProConfigProvider/index.js +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +53 -46
- package/lib/ProEditTable/index.js +3 -3
- package/lib/ProEditTable/style/index.less +0 -5
- 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/combination/Container/index.js +3 -2
- package/lib/ProForm/components/combination/Container/style/index.less +5 -1
- 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 +12 -4
- 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 +18 -13
- package/lib/ProForm/components/render/RenderFields.js +3 -1
- package/lib/ProForm/components/render/propsType.d.ts +3 -7
- package/lib/ProForm/index.js +5 -1
- package/lib/ProForm/propsType.d.ts +2 -0
- package/lib/ProForm/style/index.less +2 -1
- package/lib/ProForm/utils/index.js +4 -1
- package/lib/ProForm/utils/useChanged.js +1 -2
- package/lib/ProForm/utils/useForm.js +18 -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 +1 -1
- 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 +3 -7
- package/lib/ProTree/components/Tree.js +63 -41
- package/lib/ProTree/style/index.less +24 -17
- 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 +6 -6
- 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
|
@@ -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,3 @@
|
|
|
337
348
|
height: 16px !important;
|
|
338
349
|
}
|
|
339
350
|
|
|
340
|
-
// 解决双滚动条
|
|
341
|
-
.@{ant-prefix}-select-dropdown.pro-tree-select-drop-down-container.checkable-tree{
|
|
342
|
-
overflow: hidden!important;
|
|
343
|
-
}
|
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 拖拽框顶部的内容
|
|
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
|
@@ -7,11 +7,11 @@ pre {
|
|
|
7
7
|
* {
|
|
8
8
|
// 火狐浏览器
|
|
9
9
|
scrollbar-width: thin;
|
|
10
|
-
scrollbar-color: #
|
|
10
|
+
scrollbar-color: #d2d3d7 transparent;
|
|
11
11
|
// ie浏览器
|
|
12
|
-
scrollbar-face-color: #
|
|
13
|
-
scrollbar-highlight-color: #
|
|
14
|
-
scrollbar-3dlight-color: #
|
|
12
|
+
scrollbar-face-color: #d2d3d7;
|
|
13
|
+
scrollbar-highlight-color: #979797;
|
|
14
|
+
scrollbar-3dlight-color: #979797;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
::-webkit-scrollbar {
|
|
@@ -20,7 +20,7 @@ pre {
|
|
|
20
20
|
|
|
21
21
|
// // 滑块
|
|
22
22
|
::-webkit-scrollbar-thumb {
|
|
23
|
-
background-color: #
|
|
23
|
+
background-color: #d2d3d7;
|
|
24
24
|
background-clip: padding-box;
|
|
25
25
|
border-color: transparent;
|
|
26
26
|
border-style: dashed;
|
|
@@ -37,5 +37,5 @@ pre {
|
|
|
37
37
|
|
|
38
38
|
// 悬浮轨道
|
|
39
39
|
::-webkit-scrollbar-thumb:hover {
|
|
40
|
-
background-color: #
|
|
40
|
+
background-color: #979797;
|
|
41
41
|
}
|
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.1",
|
|
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;
|