@zat-design/sisyphus-react 3.4.4 → 3.4.5-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.
Files changed (154) hide show
  1. package/babel.config.js +3 -0
  2. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  3. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  4. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  5. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  6. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  7. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  8. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  9. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  11. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  12. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  13. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  14. package/coverage/lcov-report/src/.umi/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  16. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  18. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  24. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  29. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  37. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  39. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  40. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  41. package/dist/index.esm.css +70 -19
  42. package/dist/less.esm.css +70 -19
  43. package/es/ProConfigProvider/index.d.ts +2 -2
  44. package/es/ProConfigProvider/index.js +0 -3
  45. package/es/ProEditTable/components/RenderField/index.js +10 -9
  46. package/es/ProEditTable/index.js +14 -3
  47. package/es/ProEditTable/propsType.d.ts +1 -0
  48. package/es/ProEditTable/utils/index.js +7 -1
  49. package/es/ProEnum/components/Group.js +7 -1
  50. package/es/ProEnum/style/index.less +3 -2
  51. package/es/ProForm/components/combination/Container/index.js +3 -2
  52. package/es/ProForm/components/combination/Container/style/index.less +5 -1
  53. package/es/ProForm/components/combination/FormList/index.js +5 -5
  54. package/es/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
  55. package/es/ProForm/components/combination/GroupCopy/component/ComRender.js +36 -0
  56. package/es/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
  57. package/es/ProForm/components/combination/GroupCopy/index.js +84 -0
  58. package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
  59. package/es/ProForm/components/combination/GroupCopy/style/index.less +131 -0
  60. package/es/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
  61. package/es/ProForm/components/combination/GroupCopy/utils.js +180 -0
  62. package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
  63. package/es/ProForm/components/combination/ProCascader/index.js +255 -0
  64. package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
  65. package/es/ProForm/components/combination/ProCascader/propsType.js +1 -0
  66. package/es/ProForm/components/combination/ProModalSelect/index.js +25 -22
  67. package/es/ProForm/components/index.d.ts +1 -2
  68. package/es/ProForm/components/index.js +1 -3
  69. package/es/ProForm/components/render/Render.js +3 -3
  70. package/es/ProForm/components/render/propsType.d.ts +4 -8
  71. package/es/ProForm/index.js +2 -2
  72. package/es/ProForm/style/index.less +1 -1
  73. package/es/ProForm/utils/index.js +1 -1
  74. package/es/ProIcon/config/index.d.ts +14 -0
  75. package/es/ProIcon/config/index.js +17 -1
  76. package/es/ProIcon/index.js +134 -26
  77. package/es/ProIcon/propsTypes.d.ts +24 -0
  78. package/es/ProIcon/utils/index.d.ts +6 -0
  79. package/es/ProIcon/utils/index.js +83 -0
  80. package/es/ProLayout/components/ProCollapse/index.js +6 -3
  81. package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
  82. package/es/ProSelect/index.js +1 -1
  83. package/es/ProStep/components/Step/index.js +5 -4
  84. package/es/ProStep/style/index.less +20 -0
  85. package/es/ProTable/utils.js +6 -3
  86. package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  87. package/es/ProThemeTools/component/PrdTools/index.js +30 -4
  88. package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
  89. package/es/ProTreeModal/index.js +11 -15
  90. package/es/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
  91. package/es/global.less +38 -2
  92. package/jest.config.js +8 -0
  93. package/lib/ProConfigProvider/index.d.ts +2 -2
  94. package/lib/ProConfigProvider/index.js +0 -3
  95. package/lib/ProEditTable/components/RenderField/index.js +9 -8
  96. package/lib/ProEditTable/index.js +14 -3
  97. package/lib/ProEditTable/propsType.d.ts +1 -0
  98. package/lib/ProEditTable/utils/index.js +7 -1
  99. package/lib/ProEnum/components/Group.js +6 -0
  100. package/lib/ProEnum/style/index.less +3 -2
  101. package/lib/ProForm/components/combination/Container/index.js +3 -2
  102. package/lib/ProForm/components/combination/Container/style/index.less +5 -1
  103. package/lib/ProForm/components/combination/FormList/index.js +5 -5
  104. package/lib/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
  105. package/lib/ProForm/components/combination/GroupCopy/component/ComRender.js +44 -0
  106. package/lib/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
  107. package/lib/ProForm/components/combination/GroupCopy/index.js +91 -0
  108. package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
  109. package/lib/ProForm/components/combination/GroupCopy/style/index.less +131 -0
  110. package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
  111. package/lib/ProForm/components/combination/GroupCopy/utils.js +187 -0
  112. package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
  113. package/lib/ProForm/components/combination/ProCascader/index.js +255 -0
  114. package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
  115. package/lib/ProForm/components/combination/ProCascader/propsType.js +5 -0
  116. package/lib/ProForm/components/combination/ProModalSelect/index.js +26 -23
  117. package/lib/ProForm/components/index.d.ts +1 -2
  118. package/lib/ProForm/components/index.js +1 -8
  119. package/lib/ProForm/components/render/Render.js +3 -3
  120. package/lib/ProForm/components/render/propsType.d.ts +4 -8
  121. package/lib/ProForm/index.js +1 -1
  122. package/lib/ProForm/style/index.less +1 -1
  123. package/lib/ProForm/utils/index.js +1 -1
  124. package/lib/ProIcon/config/index.d.ts +14 -0
  125. package/lib/ProIcon/config/index.js +18 -2
  126. package/lib/ProIcon/index.js +132 -26
  127. package/lib/ProIcon/propsTypes.d.ts +24 -0
  128. package/lib/ProIcon/utils/index.d.ts +6 -0
  129. package/lib/ProIcon/utils/index.js +90 -0
  130. package/lib/ProLayout/components/ProCollapse/index.js +6 -3
  131. package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
  132. package/lib/ProSelect/index.js +1 -1
  133. package/lib/ProStep/components/Step/index.js +5 -4
  134. package/lib/ProStep/style/index.less +20 -0
  135. package/lib/ProTable/utils.js +6 -3
  136. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  137. package/lib/ProThemeTools/component/PrdTools/index.js +30 -4
  138. package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
  139. package/lib/ProTreeModal/index.js +11 -15
  140. package/lib/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
  141. package/lib/global.less +38 -2
  142. package/package.json +6 -2
  143. package/test/__mocks__/fileMock.js +0 -0
  144. package/test/__mocks__/styleMock.js +0 -0
  145. package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
  146. package/es/ProForm/components/base/ProCascader/index.js +0 -72
  147. package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
  148. package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
  149. package/lib/ProForm/components/base/ProCascader/index.js +0 -78
  150. package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
  151. /package/es/ProForm/components/combination/{ProAddressBar → GroupCopy}/propsType.js +0 -0
  152. /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
  153. /package/lib/ProForm/components/combination/{ProAddressBar → GroupCopy}/propsType.js +0 -0
  154. /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
@@ -16,20 +16,20 @@
16
16
  }
17
17
 
18
18
  p {
19
- padding-left : 12px;
20
- position : relative;
19
+ position: relative;
21
20
  margin-bottom: var(--zaui-space-size-md, 16px);
22
- font-size : var(--zaui-font-size, 14px);
21
+ padding-left: 12px;
22
+ font-size: var(--zaui-font-size, 14px);
23
23
 
24
24
  &:before {
25
- content : '';
26
- position : absolute;
27
- left : 0;
28
- top : 4px;
29
- width : 4px;
30
- height : 14px;
31
- background : var(--zaui-brand, #006aff);
25
+ position: absolute;
26
+ top: 4px;
27
+ left: 0;
28
+ width: 4px;
29
+ height: 14px;
30
+ background: var(--zaui-brand, #006aff);
32
31
  border-radius: var(zaui-border-radius-card, 4px);
32
+ content: '';
33
33
  }
34
34
  }
35
35
 
@@ -37,19 +37,19 @@
37
37
  display: flex;
38
38
 
39
39
  li {
40
- width : 38px;
41
- height : 38px;
42
- border-radius : 50%;
43
- background : #fff;
44
- display : flex;
40
+ display: flex;
41
+ align-items: center;
45
42
  justify-content: center;
46
- align-items : center;
47
- border : 6px solid #fff;
48
- color : #fff;
49
- margin-right : 34px;
43
+ width: 38px;
44
+ height: 38px;
45
+ margin-right: 34px;
46
+ color: #fff;
47
+ background: #fff;
48
+ border: 6px solid #fff;
49
+ border-radius: 50%;
50
50
 
51
51
  span {
52
- font-size : var(--zaui-font-size, 14px);
52
+ font-size: var(--zaui-font-size, 14px);
53
53
  vertical-align: -7px;
54
54
  }
55
55
 
@@ -81,8 +81,16 @@
81
81
  }
82
82
 
83
83
  &:nth-child(4) {
84
+ background: #a00f20;
85
+
86
+ &.active,
87
+ &:hover {
88
+ border-color: #f2dbdb;
89
+ }
90
+ }
91
+ &:nth-child(5) {
84
92
  margin-right: 0;
85
- background : #a00f20;
93
+ background: #31af96;
86
94
 
87
95
  &.active,
88
96
  &:hover {
@@ -98,16 +106,16 @@
98
106
 
99
107
  .copy-btn {
100
108
  position: absolute;
101
- width : calc(100% - 64px);
102
- bottom : 20px;
103
- left : 32px;
104
- z-index : 10;
109
+ bottom: 20px;
110
+ left: 32px;
111
+ z-index: 10;
112
+ width: calc(100% - 64px);
105
113
  }
106
114
 
107
115
  .pro-theme-tools-box {
108
- display : flex;
116
+ display: flex;
117
+ flex-wrap: wrap;
109
118
  justify-content: space-between;
110
- flex-wrap : wrap;
111
119
  }
112
120
 
113
121
  .pro-theme-tools-space {
@@ -129,22 +137,22 @@
129
137
  }
130
138
 
131
139
  .pro-drawer-close {
132
- position : absolute;
133
- top : 6px;
134
- left : -37px;
135
- display : flex;
136
- align-items : center;
140
+ position: absolute;
141
+ top: 6px;
142
+ left: -37px;
143
+ display: flex;
144
+ align-items: center;
137
145
  justify-content: center;
138
- width : 32px;
139
- height : 38px;
140
- color : #fff;
141
- cursor : pointer;
146
+ width: 32px;
147
+ height: 38px;
148
+ color: #fff;
149
+ cursor: pointer;
142
150
 
143
151
  .close-icon {
144
- position : relative;
145
- left : 4px;
146
- z-index : 1;
147
- color : var(--zaui-text, #343434);
152
+ position: relative;
153
+ left: 4px;
154
+ z-index: 1;
155
+ color: var(--zaui-text, #343434);
148
156
  font-size: var(--zaui-font-size-lg, 16px);
149
157
  transform: translateZ(100px);
150
158
 
@@ -155,14 +163,14 @@
155
163
  }
156
164
 
157
165
  .pro-drawer-close::after {
158
- position : absolute;
159
- top : 0;
160
- right : 0;
161
- bottom : 0;
162
- left : 0;
166
+ position: absolute;
167
+ top: 0;
168
+ right: 0;
169
+ bottom: 0;
170
+ left: 0;
163
171
  background-color: #fff;
164
- border-radius : 4px 0px 0px 4px;
165
- transform : perspective(0.15em) rotateY(-2deg);
166
- content : '';
172
+ border-radius: 4px 0px 0px 4px;
173
+ transform: perspective(0.15em) rotateY(-2deg);
174
+ content: '';
167
175
  }
168
176
  }
@@ -207,10 +207,11 @@ var ProTreeModal = function ProTreeModal(props) {
207
207
  setState({
208
208
  checkedValues: checkedValues,
209
209
  checkAll: checkedValues.length === allKeys.length,
210
- treeViewData: treeViewData
210
+ treeViewData: treeViewData,
211
+ beforeClearAllValues: checkedValues
211
212
  });
212
213
  }
213
- }, [value, state.allKeys]);
214
+ }, [value, state.allKeys, state.open]);
214
215
  var handleClick = function handleClick() {
215
216
  setState({
216
217
  open: true
@@ -277,24 +278,19 @@ var ProTreeModal = function ProTreeModal(props) {
277
278
  treeViewData: [],
278
279
  checkAll: false
279
280
  });
280
- onChange === null || onChange === void 0 ? void 0 : onChange(_checkedValues);
281
+ /* ******** fix:3.4.4-beta.4 点击清空全部不应该回调、所有的都是应该走统一的确定 ********* */
282
+ // onChange?.(_checkedValues);
281
283
  };
282
284
  /**
283
285
  * Drawer close
284
286
  */
285
287
  var handleClose = function handleClose() {
286
- var _state$beforeClearAll;
287
- if ((_state$beforeClearAll = state.beforeClearAllValues) === null || _state$beforeClearAll === void 0 ? void 0 : _state$beforeClearAll.length) {
288
- setState({
289
- open: false,
290
- checkedValues: state.beforeClearAllValues,
291
- beforeClearAllValues: []
292
- });
293
- } else {
294
- setState({
295
- open: false
296
- });
297
- }
288
+ setState({
289
+ open: false,
290
+ checkedValues: state.beforeClearAllValues,
291
+ beforeClearAllValues: []
292
+ });
293
+ // onChange?.(state.beforeClearAllValues);
298
294
  openChange === null || openChange === void 0 ? void 0 : openChange(false);
299
295
  };
300
296
  /**
@@ -0,0 +1,7 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`render ProWaterMark with dumi 1`] = `
4
+ <span>
5
+ 123
6
+ </span>
7
+ `;
package/lib/global.less CHANGED
@@ -1,5 +1,41 @@
1
- @import "./style/index.less";
1
+ @import './style/index.less';
2
2
 
3
- pre * {
3
+ pre {
4
4
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
5
5
  }
6
+
7
+ * {
8
+ // 火狐浏览器
9
+ scrollbar-width: thin;
10
+ scrollbar-color: #d2d3d7 transparent;
11
+ // ie浏览器
12
+ scrollbar-face-color: #d2d3d7;
13
+ scrollbar-highlight-color: #979797;
14
+ scrollbar-3dlight-color: #979797;
15
+ }
16
+
17
+ ::-webkit-scrollbar  {
18
+ width: 16px;
19
+ }
20
+
21
+ // // 滑块
22
+ ::-webkit-scrollbar-thumb {
23
+ background-color: #d2d3d7;
24
+ background-clip: padding-box;
25
+ border-color: transparent;
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
+ }
31
+
32
+ // 轨道
33
+ ::-webkit-scrollbar-track {
34
+ background-color: transparent;
35
+ border-radius: 10px;
36
+ }
37
+
38
+ // 悬浮轨道
39
+ ::-webkit-scrollbar-thumb:hover {
40
+ background-color: #979797;
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.4.4",
3
+ "version": "3.4.5-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.16",
61
+ "@zat-design/utils": "^1.1.16",
62
62
  "ahooks": "3.7.4",
63
63
  "antd": "4.24.8",
64
64
  "big.js": "^6.2.1",
@@ -77,7 +77,10 @@
77
77
  "devDependencies": {
78
78
  "@commitlint/cli": "^12.1.1",
79
79
  "@commitlint/config-conventional": "^12.1.1",
80
+ "@testing-library/jest-dom": "6.2.0",
81
+ "@testing-library/react": "12.1.5",
80
82
  "@types/classnames": "^2.3.1",
83
+ "@types/jest": "^29.5.11",
81
84
  "@types/lodash": "^4.14.171",
82
85
  "@types/mockjs": "^1.0.6",
83
86
  "@types/react": "^17.0.53",
@@ -104,6 +107,7 @@
104
107
  "father-build": "^1.18.1",
105
108
  "gh-pages": "^3.0.0",
106
109
  "husky": "^4.0.7",
110
+ "jest-canvas-mock": "^2.5.2",
107
111
  "lint-staged": "^10.0.0",
108
112
  "mockjs": "^1.1.0",
109
113
  "prettier": "^2.5.0",
File without changes
File without changes
@@ -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;