@zat-design/sisyphus-react 3.2.2 → 3.3.0
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/README.md +7 -0
- package/dist/index.esm.css +82 -37
- package/es/ProAction/index.less +3 -0
- package/es/ProDownload/index.js +9 -6
- package/es/ProDownload/style/index.less +5 -2
- package/es/ProDrawerForm/index.js +1 -15
- package/es/ProDrawerForm/style/index.less +76 -73
- package/es/ProEditLabel/style/index.less +12 -9
- package/es/ProEditTable/index.js +8 -4
- package/es/ProEditTable/style/index.less +57 -47
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +3 -3
- package/es/ProEnum/style/index.less +3 -0
- package/es/ProForm/components/base/DatePicker/index.js +0 -3
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/es/ProForm/components/base/TextArea/index.less +4 -3
- package/es/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/es/ProForm/components/combination/Container/style/index.less +6 -3
- package/es/ProForm/components/combination/FormList/style/index.less +20 -24
- package/es/ProForm/components/combination/Group/style/index.less +18 -15
- package/es/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
- package/es/ProForm/components/combination/ProCombination/style/index.less +5 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -1
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
- package/es/ProForm/components/render/RenderFields.js +4 -5
- package/es/ProForm/style/index.less +46 -44
- package/es/ProIcon/style/index.less +4 -1
- package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/es/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/es/ProLayout/components/ProCollapse/style/index.less +27 -24
- package/es/ProLayout/components/ProFooter/style/index.less +11 -7
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
- package/es/ProLayout/components/ProHeader/style/index.less +12 -11
- package/es/ProLayout/style/index.less +10 -7
- package/es/ProSelect/index.less +3 -0
- package/es/ProStep/style/index.less +3 -0
- package/es/ProTable/index.js +15 -7
- package/es/ProTable/style/index.less +76 -54
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +38 -19
- package/es/ProTabs/style/index.less +25 -23
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +7 -6
- package/es/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.js +7 -2
- package/es/ProThemeTools/propsType.d.ts +4 -0
- package/es/ProThemeTools/style/index.less +6 -3
- package/es/ProThemeTools/utils/index.d.ts +1 -1
- package/es/ProThemeTools/utils/index.js +2 -1
- package/es/ProTooltip/style/index.less +3 -0
- package/es/ProTree/components/CloseIcon.js +2 -4
- package/es/ProTree/components/ProTree.js +27 -11
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/propsType.d.ts +2 -2
- package/es/ProTree/style/index.less +29 -26
- package/es/ProTree/utils.d.ts +6 -0
- package/es/ProTree/utils.js +11 -0
- package/es/ProTreeModal/components/CloseIcon.js +2 -4
- package/es/ProTreeModal/components/Trigger.d.ts +3 -0
- package/es/ProTreeModal/components/Trigger.js +79 -19
- package/es/ProTreeModal/index.js +38 -6
- package/es/ProTreeModal/propsType.d.ts +5 -2
- package/es/ProTreeModal/style/index.less +11 -8
- package/es/ProTreeSelect/index.js +6 -4
- package/es/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTreeSelect/style/index.less +25 -22
- package/es/ProUpload/components/DragRender.js +7 -4
- package/es/ProUpload/components/ImageRender.js +5 -1
- package/es/ProUpload/index.js +11 -7
- package/es/ProUpload/style/index.less +13 -4
- package/es/ProViewer/index.js +3 -1
- package/es/ProViewer/style/index.less +6 -3
- package/es/locale/en_US.d.ts +4 -0
- package/es/locale/en_US.js +5 -1
- package/es/locale/zh_CN.d.ts +4 -0
- package/es/locale/zh_CN.js +6 -2
- package/es/style/core/compatible.less +6 -6
- package/es/style/theme/antd.less +272 -253
- package/lib/ProAction/index.less +3 -0
- package/lib/ProDownload/index.js +9 -6
- package/lib/ProDownload/style/index.less +5 -2
- package/lib/ProDrawerForm/index.js +0 -14
- package/lib/ProDrawerForm/style/index.less +76 -73
- package/lib/ProEditLabel/style/index.less +12 -9
- package/lib/ProEditTable/index.js +6 -2
- package/lib/ProEditTable/style/index.less +57 -47
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +3 -3
- package/lib/ProEnum/style/index.less +3 -0
- package/lib/ProForm/components/base/DatePicker/index.js +0 -3
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/lib/ProForm/components/base/TextArea/index.less +4 -3
- package/lib/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/lib/ProForm/components/combination/Container/style/index.less +6 -3
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -24
- package/lib/ProForm/components/combination/Group/style/index.less +18 -15
- package/lib/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
- package/lib/ProForm/components/combination/ProCombination/style/index.less +5 -2
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
- package/lib/ProForm/components/render/RenderFields.js +4 -5
- package/lib/ProForm/style/index.less +46 -44
- package/lib/ProIcon/style/index.less +4 -1
- package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/lib/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/lib/ProLayout/components/ProCollapse/style/index.less +27 -24
- package/lib/ProLayout/components/ProFooter/style/index.less +11 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
- package/lib/ProLayout/components/ProHeader/style/index.less +12 -11
- package/lib/ProLayout/style/index.less +10 -7
- package/lib/ProSelect/index.less +3 -0
- package/lib/ProStep/style/index.less +3 -0
- package/lib/ProTable/index.js +14 -6
- package/lib/ProTable/style/index.less +76 -54
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +38 -19
- package/lib/ProTabs/style/index.less +25 -23
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +7 -6
- package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.js +7 -2
- package/lib/ProThemeTools/propsType.d.ts +4 -0
- package/lib/ProThemeTools/style/index.less +6 -3
- package/lib/ProThemeTools/utils/index.d.ts +1 -1
- package/lib/ProThemeTools/utils/index.js +2 -1
- package/lib/ProTooltip/style/index.less +3 -0
- package/lib/ProTree/components/CloseIcon.js +2 -4
- package/lib/ProTree/components/ProTree.js +26 -10
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/propsType.d.ts +2 -2
- package/lib/ProTree/style/index.less +29 -26
- package/lib/ProTree/utils.d.ts +6 -0
- package/lib/ProTree/utils.js +12 -0
- package/lib/ProTreeModal/components/CloseIcon.js +2 -4
- package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
- package/lib/ProTreeModal/components/Trigger.js +74 -18
- package/lib/ProTreeModal/index.js +38 -6
- package/lib/ProTreeModal/propsType.d.ts +5 -2
- package/lib/ProTreeModal/style/index.less +11 -8
- package/lib/ProTreeSelect/index.js +6 -4
- package/lib/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTreeSelect/style/index.less +25 -22
- package/lib/ProUpload/components/DragRender.js +7 -4
- package/lib/ProUpload/components/ImageRender.js +5 -1
- package/lib/ProUpload/index.js +11 -7
- package/lib/ProUpload/style/index.less +13 -4
- package/lib/ProViewer/index.js +4 -3
- package/lib/ProViewer/style/index.less +6 -3
- package/lib/locale/en_US.d.ts +4 -0
- package/lib/locale/en_US.js +5 -1
- package/lib/locale/zh_CN.d.ts +4 -0
- package/lib/locale/zh_CN.js +6 -2
- package/lib/style/core/compatible.less +6 -6
- package/lib/style/theme/antd.less +272 -253
- package/package.json +1 -1
- package/typings.d.ts +0 -6
|
@@ -118,8 +118,8 @@ export interface ProTreeProps extends PropTreeSelectProps {
|
|
|
118
118
|
prefixCls?: string;
|
|
119
119
|
children?: any;
|
|
120
120
|
blockNode?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
|
|
121
|
+
/** 点中的树节点key,表单模式下value有值该配置优先级降低 */
|
|
122
|
+
selectedKey?: string | number | undefined;
|
|
123
123
|
}
|
|
124
124
|
export interface DataProps {
|
|
125
125
|
label?: string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-tree {
|
|
2
5
|
height: 100%; // tree auto css
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
.@{ant-prefix}-spin-nested-loading {
|
|
5
8
|
height: 100%; // tree auto css
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
.@{ant-prefix}-spin-container {
|
|
8
11
|
height: 100%; // tree auto css
|
|
9
12
|
}
|
|
10
13
|
}
|
|
@@ -68,19 +71,19 @@
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
.@{ant-prefix}-tree-checkbox {
|
|
72
75
|
margin-top: 11px;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
|
|
78
|
+
.@{ant-prefix}-tree-switcher {
|
|
76
79
|
line-height: 44px;
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
.@{ant-prefix}-tree-switcher-leaf-line {
|
|
80
83
|
display: none;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
|
|
86
|
+
.@{ant-prefix}-tree-treenode {
|
|
84
87
|
align-items: flex-start;
|
|
85
88
|
width : 100%;
|
|
86
89
|
padding : 0;
|
|
@@ -88,15 +91,15 @@
|
|
|
88
91
|
font-size : var(--zaui-font-size);
|
|
89
92
|
}
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
92
95
|
min-height : 20px;
|
|
93
96
|
line-height: 20px;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
|
|
99
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
97
100
|
width: 100%;
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
.@{ant-prefix}-tree-title {
|
|
100
103
|
display: block;
|
|
101
104
|
width : 100%;
|
|
102
105
|
}
|
|
@@ -104,13 +107,13 @@
|
|
|
104
107
|
|
|
105
108
|
// 只读状态下,是否隐藏未勾选行
|
|
106
109
|
.hide-disable-node {
|
|
107
|
-
|
|
110
|
+
.@{ant-prefix}-tree-treenode.@{ant-prefix}-tree-treenode-disabled {
|
|
108
111
|
display: none;
|
|
109
112
|
}
|
|
110
113
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
.@{ant-prefix}-tree-treenode-checkbox-indeterminate,
|
|
115
|
+
.@{ant-prefix}-tree-treenode-checkbox-checked {
|
|
116
|
+
&.@{ant-prefix}-tree-treenode-disabled {
|
|
114
117
|
display: flex;
|
|
115
118
|
}
|
|
116
119
|
}
|
|
@@ -221,17 +224,17 @@
|
|
|
221
224
|
}
|
|
222
225
|
|
|
223
226
|
// 连接线、箭头宽度
|
|
224
|
-
|
|
227
|
+
.@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-indent-unit {
|
|
225
228
|
width: 20px;
|
|
226
229
|
}
|
|
227
230
|
|
|
228
|
-
|
|
231
|
+
.@{ant-prefix}-tree-switcher {
|
|
229
232
|
width : 20px;
|
|
230
233
|
align-self: flex-start;
|
|
231
234
|
margin-top: -4px;
|
|
232
235
|
}
|
|
233
236
|
|
|
234
|
-
|
|
237
|
+
.@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-indent-unit::before {
|
|
235
238
|
right: 9px;
|
|
236
239
|
}
|
|
237
240
|
|
|
@@ -244,8 +247,8 @@
|
|
|
244
247
|
}
|
|
245
248
|
|
|
246
249
|
// 去除antd白色背景
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
.@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-switcher,
|
|
251
|
+
.@{ant-prefix}-tree {
|
|
249
252
|
background-color: transparent;
|
|
250
253
|
}
|
|
251
254
|
|
|
@@ -264,12 +267,12 @@
|
|
|
264
267
|
padding-top: 0px;
|
|
265
268
|
min-width : 120px;
|
|
266
269
|
|
|
267
|
-
|
|
270
|
+
.@{ant-prefix}-popover-inner-content {
|
|
268
271
|
padding: 0px;
|
|
269
272
|
width : 100%;
|
|
270
273
|
}
|
|
271
274
|
|
|
272
|
-
|
|
275
|
+
.@{ant-prefix}-popover-arrow {
|
|
273
276
|
display: none;
|
|
274
277
|
}
|
|
275
278
|
|
|
@@ -301,8 +304,8 @@
|
|
|
301
304
|
}
|
|
302
305
|
}
|
|
303
306
|
|
|
304
|
-
|
|
305
|
-
|
|
307
|
+
.@{ant-prefix}-tree .@{ant-prefix}-tree-treenode-disabled {
|
|
308
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
306
309
|
color: var(--zaui-text);
|
|
307
310
|
}
|
|
308
311
|
|
|
@@ -316,20 +319,20 @@
|
|
|
316
319
|
}
|
|
317
320
|
|
|
318
321
|
// 重置ant-form view模式样式ant-tree样式
|
|
319
|
-
.pro-form.pro-form-view
|
|
322
|
+
.pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree * {
|
|
320
323
|
line-height: 1 !important;
|
|
321
324
|
height : auto !important;
|
|
322
325
|
min-height : auto !important;
|
|
323
326
|
}
|
|
324
327
|
|
|
325
|
-
.pro-form.pro-form-view
|
|
328
|
+
.pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-checkbox {
|
|
326
329
|
margin-top: var(--zaui-space-size-sm);
|
|
327
330
|
}
|
|
328
331
|
|
|
329
|
-
.pro-form.pro-form-view
|
|
332
|
+
.pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-switcher {
|
|
330
333
|
padding-top: var(--zaui-font-size-sm);
|
|
331
334
|
}
|
|
332
335
|
|
|
333
|
-
.pro-form.pro-form-view
|
|
336
|
+
.pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-checkbox * {
|
|
334
337
|
height: 16px !important;
|
|
335
338
|
}
|
package/lib/ProTree/utils.d.ts
CHANGED
|
@@ -35,3 +35,9 @@ export declare function filterCheckedNodes(data: any, checkedKeys: any, searchSt
|
|
|
35
35
|
* @returns
|
|
36
36
|
*/
|
|
37
37
|
export declare function getChildrenKeys(node: TreeDataProps, childrenKeys: string[], fieldNames: FieldNamesType, type: 'treeClose' | 'treeCheck'): void;
|
|
38
|
+
/**
|
|
39
|
+
* 如果默认全开展那么返回所有key,否则返回空[]
|
|
40
|
+
* @param isExpand 是否全展开
|
|
41
|
+
* @param allkeys 所有key
|
|
42
|
+
*/
|
|
43
|
+
export declare function getDefaultExpandKeys(isExpand: any, allKeys: any): any;
|
package/lib/ProTree/utils.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.filterCheckedNodes = filterCheckedNodes;
|
|
|
8
8
|
exports.findTreeNodeByKey = findTreeNodeByKey;
|
|
9
9
|
exports.getAllKeys = getAllKeys;
|
|
10
10
|
exports.getChildrenKeys = getChildrenKeys;
|
|
11
|
+
exports.getDefaultExpandKeys = getDefaultExpandKeys;
|
|
11
12
|
exports.getFlatTreeData = getFlatTreeData;
|
|
12
13
|
exports.getParentKey = void 0;
|
|
13
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -192,4 +193,15 @@ function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
|
192
193
|
}
|
|
193
194
|
});
|
|
194
195
|
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* 如果默认全开展那么返回所有key,否则返回空[]
|
|
199
|
+
* @param isExpand 是否全展开
|
|
200
|
+
* @param allkeys 所有key
|
|
201
|
+
*/
|
|
202
|
+
function getDefaultExpandKeys(isExpand, allKeys) {
|
|
203
|
+
if (isExpand) {
|
|
204
|
+
return allKeys;
|
|
205
|
+
}
|
|
206
|
+
return [];
|
|
195
207
|
}
|
|
@@ -8,11 +8,9 @@ exports.default = void 0;
|
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function CloseIcon(props) {
|
|
11
|
-
return (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
12
|
-
className: "ant-input-suffix"
|
|
13
|
-
}, props), {}, {
|
|
11
|
+
return (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
14
12
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
15
|
-
className: "
|
|
13
|
+
className: "pro-tree-modal-checkbox-close",
|
|
16
14
|
role: "button",
|
|
17
15
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
18
16
|
role: "img",
|
|
@@ -5,9 +5,12 @@ interface TriggerProps {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
isView?: boolean;
|
|
7
7
|
checkAll?: boolean;
|
|
8
|
+
appoint: boolean;
|
|
9
|
+
allValue?: string | number;
|
|
8
10
|
triggerStyle?: CSSProperties;
|
|
9
11
|
handleClick: () => void;
|
|
10
12
|
handleClearAll: () => void;
|
|
13
|
+
appointChange: (appoint?: boolean) => void;
|
|
11
14
|
}
|
|
12
15
|
declare function Trigger(props: TriggerProps): JSX.Element;
|
|
13
16
|
export default Trigger;
|
|
@@ -7,25 +7,51 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _react = require("react");
|
|
11
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
14
|
var _antd = require("antd");
|
|
13
15
|
var _icons = require("@ant-design/icons");
|
|
14
16
|
var _reactSvg = require("react-svg");
|
|
17
|
+
var _ahooks = require("ahooks");
|
|
15
18
|
var _locale = _interopRequireWildcard(require("../../locale"));
|
|
16
19
|
var _view = _interopRequireDefault(require("../../assets/view.svg"));
|
|
17
20
|
function Trigger(props) {
|
|
18
|
-
var _locale$
|
|
19
|
-
var
|
|
20
|
-
handleClick = props.handleClick,
|
|
21
|
-
handleClearAll = props.handleClearAll,
|
|
22
|
-
value = props.value,
|
|
23
|
-
checkAll = props.checkAll,
|
|
21
|
+
var _locale$ProTreeModal2, _locale$ProTreeModal3;
|
|
22
|
+
var value = props.value,
|
|
24
23
|
disabled = props.disabled,
|
|
25
24
|
isView = props.isView,
|
|
26
|
-
triggerStyle = props.triggerStyle
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
triggerStyle = props.triggerStyle,
|
|
26
|
+
appoint = props.appoint,
|
|
27
|
+
allValue = props.allValue,
|
|
28
|
+
checkAll = props.checkAll,
|
|
29
|
+
checkedValues = props.checkedValues,
|
|
30
|
+
handleClick = props.handleClick,
|
|
31
|
+
handleClearAll = props.handleClearAll,
|
|
32
|
+
appointChange = props.appointChange;
|
|
33
|
+
var _useSetState = (0, _ahooks.useSetState)({
|
|
34
|
+
mode: 'appoint'
|
|
35
|
+
}),
|
|
36
|
+
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
37
|
+
state = _useSetState2[0],
|
|
38
|
+
setState = _useSetState2[1];
|
|
39
|
+
(0, _react.useEffect)(function () {
|
|
40
|
+
if (checkAll && appoint) {
|
|
41
|
+
setState({
|
|
42
|
+
mode: 'all'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, [checkAll]);
|
|
46
|
+
var onIconClick = function onIconClick() {
|
|
47
|
+
if (appoint && state.mode === 'all') {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
handleClick();
|
|
51
|
+
};
|
|
52
|
+
if (isView) {
|
|
53
|
+
var _locale$ProTreeModal;
|
|
54
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
29
55
|
className: "pro-tree-modal-isView",
|
|
30
56
|
children: [(0, _jsxRuntime.jsx)("div", {
|
|
31
57
|
children: checkedValues.length === 0 ? '-' : checkAll ? _locale.default === null || _locale.default === void 0 ? void 0 : _locale.default.ProTreeModal.checkAll : (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTreeModal = _locale.default.ProTreeModal) === null || _locale$ProTreeModal === void 0 ? void 0 : _locale$ProTreeModal.checkNumber, {
|
|
@@ -36,11 +62,44 @@ function Trigger(props) {
|
|
|
36
62
|
children: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
37
63
|
className: "viewSvg",
|
|
38
64
|
src: _view.default,
|
|
39
|
-
onClick:
|
|
65
|
+
onClick: onIconClick
|
|
40
66
|
})
|
|
41
67
|
})]
|
|
42
|
-
})
|
|
43
|
-
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
var onAppointChange = function onAppointChange(value) {
|
|
71
|
+
setState({
|
|
72
|
+
mode: value
|
|
73
|
+
});
|
|
74
|
+
if (value === 'all') {
|
|
75
|
+
appointChange === null || appointChange === void 0 ? void 0 : appointChange(true);
|
|
76
|
+
} else {
|
|
77
|
+
appointChange === null || appointChange === void 0 ? void 0 : appointChange(false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var TriggerComponent = function TriggerComponent(props) {
|
|
81
|
+
if (appoint) {
|
|
82
|
+
return (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
|
83
|
+
block: true,
|
|
84
|
+
children: [(0, _jsxRuntime.jsxs)(_antd.Select, {
|
|
85
|
+
defaultValue: "appoint",
|
|
86
|
+
value: state.mode,
|
|
87
|
+
onChange: onAppointChange,
|
|
88
|
+
children: [(0, _jsxRuntime.jsx)(_antd.Select.Option, {
|
|
89
|
+
value: "all",
|
|
90
|
+
children: "\u5168\u90E8"
|
|
91
|
+
}), (0, _jsxRuntime.jsx)(_antd.Select.Option, {
|
|
92
|
+
value: "appoint",
|
|
93
|
+
children: "\u6307\u5B9A"
|
|
94
|
+
})]
|
|
95
|
+
}), props.children]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return props.children;
|
|
99
|
+
};
|
|
100
|
+
return (0, _jsxRuntime.jsx)(TriggerComponent, {
|
|
101
|
+
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
102
|
+
className: (0, _classnames.default)(disabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
|
|
44
103
|
onClick: handleClick,
|
|
45
104
|
value: checkedValues.length === 0 ? null : checkAll ? _locale.default === null || _locale.default === void 0 ? void 0 : _locale.default.ProTreeModal.checkAll : (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTreeModal2 = _locale.default.ProTreeModal) === null || _locale$ProTreeModal2 === void 0 ? void 0 : _locale$ProTreeModal2.checkNumber, {
|
|
46
105
|
num: checkedValues.length
|
|
@@ -55,16 +114,13 @@ function Trigger(props) {
|
|
|
55
114
|
}), (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
56
115
|
className: "viewSvg",
|
|
57
116
|
src: _view.default,
|
|
58
|
-
onClick:
|
|
117
|
+
onClick: onIconClick
|
|
59
118
|
})]
|
|
60
119
|
}),
|
|
61
120
|
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTreeModal3 = _locale.default.ProTreeModal) === null || _locale$ProTreeModal3 === void 0 ? void 0 : _locale$ProTreeModal3.select,
|
|
62
|
-
disabled: disabled,
|
|
121
|
+
disabled: disabled || appoint && value === allValue,
|
|
63
122
|
style: (0, _objectSpread2.default)({}, triggerStyle)
|
|
64
|
-
})
|
|
65
|
-
type: "hidden",
|
|
66
|
-
value: value
|
|
67
|
-
})]
|
|
123
|
+
})
|
|
68
124
|
});
|
|
69
125
|
}
|
|
70
126
|
var _default = exports.default = Trigger;
|
|
@@ -58,6 +58,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
58
58
|
max = props.max,
|
|
59
59
|
draggable = props.draggable,
|
|
60
60
|
span = props.span,
|
|
61
|
+
appoint = props.appoint,
|
|
61
62
|
_props$fieldNames = props.fieldNames,
|
|
62
63
|
fieldNames = _props$fieldNames === void 0 ? {
|
|
63
64
|
label: 'label',
|
|
@@ -78,6 +79,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
78
79
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
79
80
|
open: false,
|
|
80
81
|
checkedValues: [],
|
|
82
|
+
beforeClearAllValues: [],
|
|
81
83
|
treeData: [],
|
|
82
84
|
treeViewData: [],
|
|
83
85
|
originalTreeData: [],
|
|
@@ -264,6 +266,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
264
266
|
}) : [];
|
|
265
267
|
setState({
|
|
266
268
|
checkedValues: _checkedValues,
|
|
269
|
+
beforeClearAllValues: state.checkedValues,
|
|
267
270
|
treeViewData: [],
|
|
268
271
|
checkAll: false
|
|
269
272
|
});
|
|
@@ -272,9 +275,18 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
272
275
|
* Drawer close
|
|
273
276
|
*/
|
|
274
277
|
var handleClose = function handleClose() {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
+
var _state$beforeClearAll;
|
|
279
|
+
if ((_state$beforeClearAll = state.beforeClearAllValues) === null || _state$beforeClearAll === void 0 ? void 0 : _state$beforeClearAll.length) {
|
|
280
|
+
setState({
|
|
281
|
+
open: false,
|
|
282
|
+
checkedValues: state.beforeClearAllValues,
|
|
283
|
+
beforeClearAllValues: []
|
|
284
|
+
});
|
|
285
|
+
} else {
|
|
286
|
+
setState({
|
|
287
|
+
open: false
|
|
288
|
+
});
|
|
289
|
+
}
|
|
278
290
|
openChange === null || openChange === void 0 ? void 0 : openChange(false);
|
|
279
291
|
};
|
|
280
292
|
/**
|
|
@@ -459,6 +471,23 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
459
471
|
});
|
|
460
472
|
}
|
|
461
473
|
};
|
|
474
|
+
/**
|
|
475
|
+
* 指定模式下的操作
|
|
476
|
+
* @param appoint
|
|
477
|
+
*/
|
|
478
|
+
var appointChange = function appointChange(appoint) {
|
|
479
|
+
if (appoint) {
|
|
480
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(allValue);
|
|
481
|
+
setState({
|
|
482
|
+
checkAll: true
|
|
483
|
+
});
|
|
484
|
+
} else {
|
|
485
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([]);
|
|
486
|
+
setState({
|
|
487
|
+
checkAll: false
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
};
|
|
462
491
|
/**
|
|
463
492
|
* Trigger the container opened by Drawer
|
|
464
493
|
* default example and you can customize trigger={<Button>打开</Button>}
|
|
@@ -474,12 +503,15 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
474
503
|
return (0, _jsxRuntime.jsx)(_components.Trigger, {
|
|
475
504
|
checkedValues: state.checkedValues,
|
|
476
505
|
value: value,
|
|
477
|
-
handleClick: handleClick,
|
|
478
|
-
handleClearAll: handleClearAll,
|
|
479
506
|
checkAll: state.checkAll,
|
|
480
507
|
triggerStyle: style,
|
|
481
508
|
disabled: disabled,
|
|
482
|
-
isView: isView
|
|
509
|
+
isView: isView,
|
|
510
|
+
appoint: appoint,
|
|
511
|
+
allValue: allValue,
|
|
512
|
+
handleClick: handleClick,
|
|
513
|
+
handleClearAll: handleClearAll,
|
|
514
|
+
appointChange: appointChange
|
|
483
515
|
});
|
|
484
516
|
}, [state.checkedValues, state.checkAll, style, disabled, isView]);
|
|
485
517
|
/**
|
|
@@ -21,6 +21,7 @@ export interface FieldNamesType {
|
|
|
21
21
|
value: string;
|
|
22
22
|
children?: string;
|
|
23
23
|
}
|
|
24
|
+
export type TreeModalMode = 'tree' | 'list' | 'Cascader' | 'Tree' | 'List';
|
|
24
25
|
export interface ProTreeModalProps {
|
|
25
26
|
/** value */
|
|
26
27
|
value?: AllValueType | string[];
|
|
@@ -30,8 +31,10 @@ export interface ProTreeModalProps {
|
|
|
30
31
|
open?: boolean;
|
|
31
32
|
/** 列表时候一行放几个 */
|
|
32
33
|
span?: number;
|
|
33
|
-
/** 展示类型、默认list
|
|
34
|
-
mode?:
|
|
34
|
+
/** 展示类型、默认list 列表展示形式、appoint 指定模式展示形式会不一样 */
|
|
35
|
+
mode?: TreeModalMode;
|
|
36
|
+
/** 是否开启指定模式 */
|
|
37
|
+
appoint?: boolean;
|
|
35
38
|
/** 开启后、提交给后端 [{ label:xx, value: ""}] 形式 */
|
|
36
39
|
labelInValue?: boolean;
|
|
37
40
|
/** 查看模式、同 disabled 一样 */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
4
|
+
.pro-tree-modal-container .@{ant-prefix}-modal-content .@{ant-prefix}-modal-body {
|
|
2
5
|
max-height: 498px;
|
|
3
6
|
}
|
|
4
7
|
|
|
@@ -13,16 +16,16 @@
|
|
|
13
16
|
height : 482px;
|
|
14
17
|
margin-bottom : calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
.@{ant-prefix}-tree-checkbox {
|
|
17
20
|
margin-top: 2px;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
.@{ant-prefix}-tree-switcher {
|
|
21
24
|
width : 20px;
|
|
22
25
|
line-height: 20px;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
.@{ant-prefix}-tree-treenode {
|
|
26
29
|
width : 100%;
|
|
27
30
|
padding : 0;
|
|
28
31
|
padding-bottom: var(--zaui-font-size-sm, 12px);
|
|
@@ -31,12 +34,12 @@
|
|
|
31
34
|
line-height : 20px;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
35
38
|
min-height : 20px;
|
|
36
39
|
line-height: 20px;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
40
43
|
width: 100%;
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -113,7 +116,7 @@
|
|
|
113
116
|
color: #616161;
|
|
114
117
|
}
|
|
115
118
|
|
|
116
|
-
|
|
119
|
+
.@{ant-prefix}-btn-link {
|
|
117
120
|
padding: 0;
|
|
118
121
|
}
|
|
119
122
|
}
|
|
@@ -223,7 +226,7 @@
|
|
|
223
226
|
margin-top: 0;
|
|
224
227
|
}
|
|
225
228
|
|
|
226
|
-
|
|
229
|
+
.@{ant-prefix}-tag {
|
|
227
230
|
display : flex;
|
|
228
231
|
align-items : center;
|
|
229
232
|
justify-content: space-between;
|
|
@@ -17,7 +17,7 @@ var _react = require("react");
|
|
|
17
17
|
var _lodash = require("lodash");
|
|
18
18
|
var _ProConfigProvider = require("../ProConfigProvider");
|
|
19
19
|
var _Container = _interopRequireDefault(require("../ProForm/components/Container"));
|
|
20
|
-
var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "
|
|
20
|
+
var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className"],
|
|
21
21
|
_excluded2 = ["children"];
|
|
22
22
|
var SHOW_PARENT = _antd.TreeSelect.SHOW_PARENT;
|
|
23
23
|
var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
@@ -51,8 +51,9 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
51
51
|
filterTreeNode = props.filterTreeNode,
|
|
52
52
|
_props$treeNodeFilter = props.treeNodeFilterProp,
|
|
53
53
|
treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'label' : _props$treeNodeFilter,
|
|
54
|
-
_props$
|
|
55
|
-
|
|
54
|
+
_props$defaultExpandA = props.defaultExpandAll,
|
|
55
|
+
defaultExpandAll = _props$defaultExpandA === void 0 ? true : _props$defaultExpandA,
|
|
56
|
+
expandedKeys = props.expandedKeys,
|
|
56
57
|
_props$treeCheckable = props.treeCheckable,
|
|
57
58
|
treeCheckable = _props$treeCheckable === void 0 ? true : _props$treeCheckable,
|
|
58
59
|
_onSearch = props.onSearch,
|
|
@@ -477,7 +478,8 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
477
478
|
disabled: disabled,
|
|
478
479
|
showSearch: showSearch,
|
|
479
480
|
// filterTreeNode: filterTreeNodeEvent,
|
|
480
|
-
treeDefaultExpandAll:
|
|
481
|
+
treeDefaultExpandAll: defaultExpandAll,
|
|
482
|
+
treeExpandedKeys: expandedKeys,
|
|
481
483
|
treeCheckable: treeCheckable,
|
|
482
484
|
showCheckedStrategy: SHOW_PARENT,
|
|
483
485
|
value: value,
|
|
@@ -69,6 +69,8 @@ export interface PropTreeSelectProps extends Omit<TreeSelectProps, 'onSearch'> {
|
|
|
69
69
|
service: Service<any, any>;
|
|
70
70
|
options?: Options<any, any>;
|
|
71
71
|
};
|
|
72
|
+
defaultExpandAll?: boolean;
|
|
73
|
+
expandedKeys?: any[];
|
|
72
74
|
}
|
|
73
75
|
export interface ProSelectAction {
|
|
74
76
|
/** 获取发生请求的 useRequest 的 ref */
|