@vtx/components 2.5.13 → 2.5.15
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/CHANGELOG.md +842 -0
- package/lib/_util/filterSpecialCharacters.js +43 -54
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +3 -0
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getUrlParam.js +6 -0
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +1 -0
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +1 -0
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useInterval.js +3 -0
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +32 -14
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +22 -0
- package/lib/index.js.map +1 -1
- package/lib/vtx-color-picker/index.js +21 -5
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +2 -0
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +2 -0
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-combogrid/Combogrid.js +73 -33
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +45 -20
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +7 -0
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +7 -0
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-combogrid/style/index.less +29 -29
- package/lib/vtx-datagrid/Alert.js +11 -3
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +44 -19
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +13 -2
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +137 -77
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +35 -5
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +10 -0
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +10 -0
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/style/index.less +131 -131
- package/lib/vtx-date-picker/QdatePicker.js +46 -16
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/YearPicker.js +30 -7
- package/lib/vtx-date-picker/YearPicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +46 -5
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +8 -2
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +1 -0
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +1 -0
- package/lib/vtx-date-picker/style/index.js.map +1 -1
- package/lib/vtx-date-picker/style/index.less +38 -38
- package/lib/vtx-editor/index.js +23 -5
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +2 -0
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +2 -0
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-editor/style/index.less +6 -6
- package/lib/vtx-export/index.js +55 -23
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +6 -0
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +6 -0
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +26 -5
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +5 -0
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +34 -9
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +7 -2
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +6 -0
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +2 -0
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/demo/Modal.less +41 -41
- package/lib/vtx-form-layout/index.js +22 -8
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +8 -0
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +8 -0
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-form-layout/style/index.less +148 -148
- package/lib/vtx-image/Image.js +92 -56
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +51 -20
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +40 -11
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +6 -0
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +1 -0
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +1 -0
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-image/style/index.less +46 -46
- package/lib/vtx-import/index.js +72 -37
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +24 -7
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +2 -0
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +2 -0
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-input/TextArea.js +22 -6
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +37 -11
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +1 -0
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +1 -0
- package/lib/vtx-input/style/index.js.map +1 -1
- package/lib/vtx-input/style/index.less +20 -20
- package/lib/vtx-input/useLength.js +16 -4
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +6 -1
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +70 -32
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +2 -0
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +2 -0
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-modal/style/index.less +83 -83
- package/lib/vtx-page-layout/Basic.js +6 -2
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +19 -7
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +10 -2
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +52 -22
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +15 -3
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +34 -4
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +8 -0
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-page-layout/style/index.less +139 -139
- package/lib/vtx-rps-frame/index.js +44 -21
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +55 -19
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js +1 -0
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js +1 -0
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.less +111 -111
- package/lib/vtx-search/VtxCol.js +21 -0
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +12 -6
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +87 -36
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +5 -0
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +5 -0
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search/style/index.less +81 -81
- package/lib/vtx-search-map-input/index.js +68 -39
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +2 -0
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +2 -0
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +64 -20
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +8 -0
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +8 -0
- package/lib/vtx-select/style/index.js.map +1 -1
- package/lib/vtx-select/style/index.less +66 -66
- package/lib/vtx-signature/index.js +28 -14
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +2 -0
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +2 -0
- package/lib/vtx-signature/style/index.js.map +1 -1
- package/lib/vtx-signature/style/index.less +32 -32
- package/lib/vtx-split-pane/Pane.js +14 -2
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +30 -10
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +104 -52
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +4 -0
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +3 -0
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +3 -0
- package/lib/vtx-split-pane/style/index.js.map +1 -1
- package/lib/vtx-split-pane/style/index.less +59 -59
- package/lib/vtx-statistics-column/Back.js +7 -1
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +22 -5
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +22 -5
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +2 -0
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +16 -0
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.less +61 -61
- package/lib/vtx-time-picker/index.js +16 -3
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-time-picker/style/css.js.map +1 -1
- package/lib/vtx-time-picker/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +28 -9
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +136 -67
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +6 -0
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +6 -0
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-upload/style/index.less +59 -59
- package/lib/vtx-ztree/index.js +103 -51
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +1 -0
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.js +1 -0
- package/lib/vtx-ztree/style/index.js.map +1 -1
- package/lib/vtx-ztree/style/index.less +30 -30
- package/lib/vtx-ztree-select/index.js +97 -38
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +4 -0
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +4 -0
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +76 -76
- package/package.json +1 -1
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("antd/es/upload/style/css");
|
|
4
|
+
|
|
4
5
|
require("antd/es/button/style/css");
|
|
6
|
+
|
|
5
7
|
require("antd/es/icon/style/css");
|
|
8
|
+
|
|
6
9
|
require("antd/es/message/style/css");
|
|
10
|
+
|
|
7
11
|
require("antd/es/modal/style/css");
|
|
12
|
+
|
|
8
13
|
require("viewerjs/dist/viewer.css");
|
|
14
|
+
|
|
9
15
|
require("./index.css");
|
|
10
16
|
//# sourceMappingURL=css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-upload/style/index.js"],"sourcesContent":["import 'antd/es/upload/style/css';\nimport 'antd/es/button/style/css';\nimport 'antd/es/icon/style/css';\nimport 'antd/es/message/style/css';\nimport 'antd/es/modal/style/css';\nimport 'antd/es/button/style/css';\nimport 'viewerjs/dist/viewer.css';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["vtx-upload/style/index.js"],"sourcesContent":["import 'antd/es/upload/style/css';\r\nimport 'antd/es/button/style/css';\r\nimport 'antd/es/icon/style/css';\r\nimport 'antd/es/message/style/css';\r\nimport 'antd/es/modal/style/css';\r\nimport 'antd/es/button/style/css';\r\nimport 'viewerjs/dist/viewer.css';\r\nimport './index.less';\r\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("antd/es/upload/style/css");
|
|
4
|
+
|
|
4
5
|
require("antd/es/button/style/css");
|
|
6
|
+
|
|
5
7
|
require("antd/es/icon/style/css");
|
|
8
|
+
|
|
6
9
|
require("antd/es/message/style/css");
|
|
10
|
+
|
|
7
11
|
require("antd/es/modal/style/css");
|
|
12
|
+
|
|
8
13
|
require("viewerjs/dist/viewer.css");
|
|
14
|
+
|
|
9
15
|
require("./index.less");
|
|
10
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-upload/style/index.js"],"sourcesContent":["import 'antd/es/upload/style/css';\nimport 'antd/es/button/style/css';\nimport 'antd/es/icon/style/css';\nimport 'antd/es/message/style/css';\nimport 'antd/es/modal/style/css';\nimport 'antd/es/button/style/css';\nimport 'viewerjs/dist/viewer.css';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["vtx-upload/style/index.js"],"sourcesContent":["import 'antd/es/upload/style/css';\r\nimport 'antd/es/button/style/css';\r\nimport 'antd/es/icon/style/css';\r\nimport 'antd/es/message/style/css';\r\nimport 'antd/es/modal/style/css';\r\nimport 'antd/es/button/style/css';\r\nimport 'viewerjs/dist/viewer.css';\r\nimport './index.less';\r\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA"}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
.vtx-ui-upload-uploadct {
|
|
2
|
-
overflow: hidden; //upload组件由于float会失去高度
|
|
3
|
-
.ant-upload-list-item-info {
|
|
4
|
-
&::before {
|
|
5
|
-
height: 0 !important;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
.vtx_ui_upload_onlinepreview {
|
|
10
|
-
width: 100%;
|
|
11
|
-
.vtx_ui_upload_previewLine {
|
|
12
|
-
position: relative;
|
|
13
|
-
padding: 0 8px;
|
|
14
|
-
color: #108ee9;
|
|
15
|
-
line-height: 25px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
.vtx_ui_upload_iconHint {
|
|
18
|
-
margin-right: 5px;
|
|
19
|
-
color: #666;
|
|
20
|
-
}
|
|
21
|
-
.vtx_ui_upload_action_box {
|
|
22
|
-
position: absolute;
|
|
23
|
-
top: 2px;
|
|
24
|
-
right: 8px;
|
|
25
|
-
display: none;
|
|
26
|
-
.vtx_ui_upload_action_btn {
|
|
27
|
-
margin-left: 5px;
|
|
28
|
-
color: #aaa;
|
|
29
|
-
&:hover {
|
|
30
|
-
color: #333;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
&:hover {
|
|
35
|
-
background-color: #ecf6fd;
|
|
36
|
-
.vtx_ui_upload_action_box {
|
|
37
|
-
display: inline-block;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.vtx-modal-maxClass {
|
|
44
|
-
.ant-modal {
|
|
45
|
-
top: 0 !important;
|
|
46
|
-
left: 0 !important;
|
|
47
|
-
width: 100% !important;
|
|
48
|
-
height: 100% !important;
|
|
49
|
-
padding-bottom: 0 !important;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
.ant-modal-content {
|
|
52
|
-
height: 100%;
|
|
53
|
-
.ant-modal-body {
|
|
54
|
-
height: e('calc(100% - 108px)') !important;
|
|
55
|
-
background-color: #fbfbfb;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
.vtx-ui-upload-uploadct {
|
|
2
|
+
overflow: hidden; //upload组件由于float会失去高度
|
|
3
|
+
.ant-upload-list-item-info {
|
|
4
|
+
&::before {
|
|
5
|
+
height: 0 !important;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
.vtx_ui_upload_onlinepreview {
|
|
10
|
+
width: 100%;
|
|
11
|
+
.vtx_ui_upload_previewLine {
|
|
12
|
+
position: relative;
|
|
13
|
+
padding: 0 8px;
|
|
14
|
+
color: #108ee9;
|
|
15
|
+
line-height: 25px;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
.vtx_ui_upload_iconHint {
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
color: #666;
|
|
20
|
+
}
|
|
21
|
+
.vtx_ui_upload_action_box {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 2px;
|
|
24
|
+
right: 8px;
|
|
25
|
+
display: none;
|
|
26
|
+
.vtx_ui_upload_action_btn {
|
|
27
|
+
margin-left: 5px;
|
|
28
|
+
color: #aaa;
|
|
29
|
+
&:hover {
|
|
30
|
+
color: #333;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&:hover {
|
|
35
|
+
background-color: #ecf6fd;
|
|
36
|
+
.vtx_ui_upload_action_box {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.vtx-modal-maxClass {
|
|
44
|
+
.ant-modal {
|
|
45
|
+
top: 0 !important;
|
|
46
|
+
left: 0 !important;
|
|
47
|
+
width: 100% !important;
|
|
48
|
+
height: 100% !important;
|
|
49
|
+
padding-bottom: 0 !important;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
.ant-modal-content {
|
|
52
|
+
height: 100%;
|
|
53
|
+
.ant-modal-body {
|
|
54
|
+
height: e('calc(100% - 108px)') !important;
|
|
55
|
+
background-color: #fbfbfb;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
package/lib/vtx-ztree/index.js
CHANGED
|
@@ -4,35 +4,63 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
11
|
+
|
|
9
12
|
var _lodash = _interopRequireDefault(require("lodash.isequal"));
|
|
13
|
+
|
|
10
14
|
var _lodash2 = _interopRequireDefault(require("lodash.merge"));
|
|
15
|
+
|
|
11
16
|
var _lodash3 = _interopRequireDefault(require("lodash.debounce"));
|
|
17
|
+
|
|
12
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
13
20
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
21
|
+
|
|
14
22
|
var _config = _interopRequireDefault(require("../config"));
|
|
23
|
+
|
|
15
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
16
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
17
28
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
18
30
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
31
|
+
|
|
19
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
+
|
|
20
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
|
+
|
|
21
36
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
|
+
|
|
22
38
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
|
+
|
|
23
40
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
24
42
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
+
|
|
25
44
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
|
+
|
|
26
46
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
27
48
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
|
+
|
|
28
50
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
29
52
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
+
|
|
30
54
|
var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
31
55
|
_inherits(VtxZtree, _React$Component);
|
|
56
|
+
|
|
32
57
|
var _super = _createSuper(VtxZtree);
|
|
58
|
+
|
|
33
59
|
function VtxZtree(props) {
|
|
34
60
|
var _this;
|
|
61
|
+
|
|
35
62
|
_classCallCheck(this, VtxZtree);
|
|
63
|
+
|
|
36
64
|
_this = _super.call(this, props);
|
|
37
65
|
_this.treeId = "tree-".concat(new Date().getTime(), "-").concat(parseInt(Math.random() * 10000));
|
|
38
66
|
_this.zTreeObj = null;
|
|
@@ -48,6 +76,7 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
48
76
|
};
|
|
49
77
|
return _this;
|
|
50
78
|
}
|
|
79
|
+
|
|
51
80
|
_createClass(VtxZtree, [{
|
|
52
81
|
key: "loadTreeResource",
|
|
53
82
|
value: function loadTreeResource() {
|
|
@@ -75,8 +104,10 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
75
104
|
key: "componentDidMount",
|
|
76
105
|
value: function componentDidMount() {
|
|
77
106
|
var _this2 = this;
|
|
107
|
+
|
|
78
108
|
this.loadPromise.then(function () {
|
|
79
109
|
_this2.loadComplete = true;
|
|
110
|
+
|
|
80
111
|
_this2.refreshTree(_this2.props);
|
|
81
112
|
});
|
|
82
113
|
}
|
|
@@ -84,6 +115,7 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
84
115
|
key: "componentDidUpdate",
|
|
85
116
|
value: function componentDidUpdate(prevProps) {
|
|
86
117
|
if (!this.loadComplete) return;
|
|
118
|
+
|
|
87
119
|
if (!(0, _lodash["default"])(prevProps.refreshFlag, this.props.refreshFlag) || !(0, _lodash["default"])(prevProps.data, this.props.data)) {
|
|
88
120
|
this.refreshTree(this.props);
|
|
89
121
|
}
|
|
@@ -92,14 +124,13 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
92
124
|
key: "componentWillUnmount",
|
|
93
125
|
value: function componentWillUnmount() {
|
|
94
126
|
this.zTreeObj && this.zTreeObj.destroy();
|
|
95
|
-
}
|
|
127
|
+
} // 初始化树的配置
|
|
96
128
|
|
|
97
|
-
// 初始化树的配置
|
|
98
129
|
}, {
|
|
99
130
|
key: "initTreeSetting",
|
|
100
131
|
value: function initTreeSetting(props) {
|
|
101
|
-
var t = this;
|
|
102
|
-
|
|
132
|
+
var t = this; // 初始化树的配置
|
|
133
|
+
|
|
103
134
|
this.treeSetting = {
|
|
104
135
|
check: {
|
|
105
136
|
enable: !!props.checkable,
|
|
@@ -211,30 +242,32 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
211
242
|
}
|
|
212
243
|
}
|
|
213
244
|
}
|
|
214
|
-
};
|
|
215
|
-
|
|
245
|
+
}; // 继承外部配置
|
|
246
|
+
|
|
216
247
|
if (_typeof(this.props.customCfg) == 'object') {
|
|
217
248
|
(0, _lodash2["default"])(this.treeSetting, this.props.customCfg);
|
|
218
249
|
}
|
|
219
|
-
}
|
|
250
|
+
} // 初始化树的数据,对expandedKeys,checkedKeys做处理
|
|
220
251
|
|
|
221
|
-
// 初始化树的数据,对expandedKeys,checkedKeys做处理
|
|
222
252
|
}, {
|
|
223
253
|
key: "initTreeNodes",
|
|
224
254
|
value: function initTreeNodes(props) {
|
|
225
255
|
var t = this;
|
|
226
256
|
this.keyNameMapping = {};
|
|
257
|
+
|
|
227
258
|
if (!Array.isArray(props.data)) {
|
|
228
259
|
this.treeNodes = [];
|
|
229
260
|
} else {
|
|
230
261
|
var checkedKeys = props.checkedKeys || [];
|
|
231
262
|
var expandedKeys = props.expandedKeys || [];
|
|
232
263
|
var chkDisabled = !!props.disableCheckboxAll;
|
|
264
|
+
|
|
233
265
|
this.treeNodes = function genNodes(nodes) {
|
|
234
266
|
return nodes.map(function (item) {
|
|
235
267
|
var checked = checkedKeys.indexOf(item.key) != -1;
|
|
236
268
|
var open = expandedKeys.indexOf(item.key) != -1;
|
|
237
269
|
t.keyNameMapping[item.key] = item.name;
|
|
270
|
+
|
|
238
271
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
239
272
|
return _objectSpread(_objectSpread({
|
|
240
273
|
chkDisabled: chkDisabled,
|
|
@@ -255,19 +288,22 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
255
288
|
}
|
|
256
289
|
}).map(function (item) {
|
|
257
290
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
258
|
-
var newNode = _objectSpread({}, item);
|
|
259
|
-
|
|
291
|
+
var newNode = _objectSpread({}, item); // 如果子节点全部被勾选,父节点自动勾选
|
|
292
|
+
|
|
293
|
+
|
|
260
294
|
if (item.children.every(function (item) {
|
|
261
295
|
return item.checked;
|
|
262
296
|
})) {
|
|
263
297
|
newNode.checked = true;
|
|
264
|
-
}
|
|
265
|
-
|
|
298
|
+
} // 如果配置了自动展开父节点,父节点自动展开
|
|
299
|
+
|
|
300
|
+
|
|
266
301
|
if (props.autoExpandParent && item.children.some(function (item) {
|
|
267
302
|
return item.open;
|
|
268
303
|
})) {
|
|
269
304
|
newNode.open = true;
|
|
270
305
|
}
|
|
306
|
+
|
|
271
307
|
return newNode;
|
|
272
308
|
} else {
|
|
273
309
|
return item;
|
|
@@ -275,9 +311,8 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
275
311
|
});
|
|
276
312
|
}(props.data);
|
|
277
313
|
}
|
|
278
|
-
}
|
|
314
|
+
} // 重新生成树
|
|
279
315
|
|
|
280
|
-
// 重新生成树
|
|
281
316
|
}, {
|
|
282
317
|
key: "refreshTree",
|
|
283
318
|
value: function refreshTree(newProps) {
|
|
@@ -285,62 +320,65 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
285
320
|
this.initTreeSetting(newProps);
|
|
286
321
|
this.initTreeNodes(newProps);
|
|
287
322
|
this.zTreeObj = $.fn.zTree.init($("#".concat(this.treeId)), this.treeSetting, this.treeNodes);
|
|
323
|
+
|
|
288
324
|
if (Array.isArray(newProps.selectedKeys)) {
|
|
289
325
|
this.selectNodes(newProps.selectedKeys, newProps.multiple);
|
|
290
|
-
}
|
|
291
|
-
|
|
326
|
+
} // 初始化全展开判断
|
|
327
|
+
|
|
328
|
+
|
|
292
329
|
if (newProps.defaultExpandAll && !newProps.expandedKeys) {
|
|
293
330
|
this.zTreeObj.expandAll(true);
|
|
294
331
|
}
|
|
295
|
-
}
|
|
332
|
+
} // 展开或折叠相关节点,expandFlag为true表示展开,false表示折叠
|
|
296
333
|
|
|
297
|
-
// 展开或折叠相关节点,expandFlag为true表示展开,false表示折叠
|
|
298
334
|
}, {
|
|
299
335
|
key: "expandNodes",
|
|
300
336
|
value: function expandNodes(expandedKeys) {
|
|
301
337
|
var expandFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
338
|
+
|
|
302
339
|
for (var i = 0, len = expandedKeys.length; i < len; i++) {
|
|
303
340
|
var node = this.zTreeObj.getNodesByParam('key', expandedKeys[i]).pop();
|
|
341
|
+
|
|
304
342
|
if (node) {
|
|
305
343
|
this.zTreeObj.expandNode(node, expandFlag, false, false);
|
|
306
344
|
}
|
|
307
345
|
}
|
|
308
|
-
}
|
|
346
|
+
} // 勾选节点, checkedFlag为true表示勾选,false表示取消勾选
|
|
309
347
|
|
|
310
|
-
// 勾选节点, checkedFlag为true表示勾选,false表示取消勾选
|
|
311
348
|
}, {
|
|
312
349
|
key: "checkNodes",
|
|
313
350
|
value: function checkNodes(checkedKeys) {
|
|
314
351
|
var checkedFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
352
|
+
|
|
315
353
|
for (var i = 0, len = checkedKeys.length; i < len; i++) {
|
|
316
354
|
var node = this.zTreeObj.getNodesByParam('key', checkedKeys[i]).pop();
|
|
355
|
+
|
|
317
356
|
if (node) {
|
|
318
357
|
// 隐藏节点的勾选状态也要改变
|
|
319
358
|
node.checked = checkedFlag;
|
|
320
|
-
this.zTreeObj.updateNode(node, true);
|
|
321
|
-
// this.zTreeObj.checkNode(node,checkedFlag,false);
|
|
359
|
+
this.zTreeObj.updateNode(node, true); // this.zTreeObj.checkNode(node,checkedFlag,false);
|
|
322
360
|
}
|
|
323
361
|
}
|
|
324
|
-
}
|
|
362
|
+
} // 点击选择节点
|
|
325
363
|
|
|
326
|
-
// 点击选择节点
|
|
327
364
|
}, {
|
|
328
365
|
key: "selectNodes",
|
|
329
366
|
value: function selectNodes(selectedKeys, multiple) {
|
|
330
367
|
for (var i = 0, len = selectedKeys.length; i < len; i++) {
|
|
331
368
|
var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
|
|
369
|
+
|
|
332
370
|
if (node) {
|
|
333
371
|
this.zTreeObj.selectNode(node, multiple, true);
|
|
334
372
|
}
|
|
335
373
|
}
|
|
336
|
-
}
|
|
374
|
+
} // 取消选择节点
|
|
337
375
|
|
|
338
|
-
// 取消选择节点
|
|
339
376
|
}, {
|
|
340
377
|
key: "cancelSelectedNodes",
|
|
341
378
|
value: function cancelSelectedNodes(selectedKeys) {
|
|
342
379
|
for (var i = 0, len = selectedKeys.length; i < len; i++) {
|
|
343
380
|
var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
|
|
381
|
+
|
|
344
382
|
if (node) {
|
|
345
383
|
this.zTreeObj.cancelSelectedNode(node);
|
|
346
384
|
}
|
|
@@ -354,35 +392,38 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
354
392
|
var nameKey = this.zTreeObj.setting.data.key.name; // get the key of the node name
|
|
355
393
|
// isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
|
|
356
394
|
// isExpand = isExpand?true:false; // not to expand in default
|
|
395
|
+
|
|
357
396
|
this.zTreeObj.setting.view.nameIsHTML = isHighLight; // allow use html in node name for highlight use
|
|
358
397
|
|
|
359
398
|
var metaChar = '[\\[\\]\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; // js meta characters
|
|
360
|
-
var rexMeta = new RegExp(metaChar, 'gi'); // regular expression to match meta characters
|
|
361
399
|
|
|
400
|
+
var rexMeta = new RegExp(metaChar, 'gi'); // regular expression to match meta characters
|
|
362
401
|
// searchNodeLazy(keyworld);
|
|
363
|
-
ztreeFilter(t.zTreeObj, keyworld);
|
|
364
402
|
|
|
365
|
-
// -----------------------------内部函数----------------------------------
|
|
403
|
+
ztreeFilter(t.zTreeObj, keyworld); // -----------------------------内部函数----------------------------------
|
|
366
404
|
// keywords filter function
|
|
405
|
+
|
|
367
406
|
function ztreeFilter(zTreeObj, _keywords) {
|
|
368
407
|
if (!_keywords) {
|
|
369
408
|
_keywords = ''; // default blank for _keywords
|
|
370
|
-
}
|
|
409
|
+
} // function to find the matching node
|
|
410
|
+
|
|
371
411
|
|
|
372
|
-
// function to find the matching node
|
|
373
412
|
function filterFunc(node) {
|
|
374
413
|
if (node && node.oldname && node.oldname.length > 0) {
|
|
375
414
|
node[nameKey] = node.oldname; // recover oldname of the node if exist
|
|
376
415
|
}
|
|
377
416
|
|
|
378
417
|
zTreeObj.updateNode(node); // update node to for modifications take effect
|
|
418
|
+
|
|
379
419
|
if (_keywords.length == 0) {
|
|
380
420
|
// return true to show all nodes if the keyword is blank
|
|
381
|
-
zTreeObj.showNode(node);
|
|
382
|
-
|
|
421
|
+
zTreeObj.showNode(node); // zTreeObj.expandNode(node,isExpand);
|
|
422
|
+
|
|
383
423
|
return true;
|
|
384
|
-
}
|
|
385
|
-
|
|
424
|
+
} // transform node name and keywords to lowercase
|
|
425
|
+
|
|
426
|
+
|
|
386
427
|
if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase()) != -1) {
|
|
387
428
|
if (isHighLight) {
|
|
388
429
|
// highlight process
|
|
@@ -393,9 +434,12 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
393
434
|
// add escape character before meta characters
|
|
394
435
|
return '\\' + matchStr;
|
|
395
436
|
});
|
|
437
|
+
|
|
396
438
|
node.oldname = node[nameKey]; // store the old name
|
|
439
|
+
|
|
397
440
|
var rexGlobal = new RegExp(newKeywords, 'gi'); // 'g' for global,'i' for ignore case
|
|
398
441
|
// use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
|
|
442
|
+
|
|
399
443
|
node[nameKey] = node.oldname.replace(rexGlobal, function (originalText) {
|
|
400
444
|
// highlight the matching words in node name
|
|
401
445
|
var highLightText = '<span style="color: whitesmoke;background-color:#f50;">' + originalText + '</span>';
|
|
@@ -405,30 +449,36 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
405
449
|
}
|
|
406
450
|
|
|
407
451
|
zTreeObj.showNode(node); // show node with matching keywords
|
|
452
|
+
|
|
408
453
|
return true; // return true and show this node
|
|
409
454
|
}
|
|
410
455
|
|
|
411
456
|
zTreeObj.hideNode(node); // hide node that not matched
|
|
457
|
+
|
|
412
458
|
return false; // return false for node not matched
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
var nodesShow = zTreeObj.getNodesByFilter(filterFunc); // get all nodes that would be shown
|
|
462
|
+
|
|
416
463
|
processShowNodes(zTreeObj, nodesShow, _keywords); // nodes should be reprocessed to show correctly
|
|
417
464
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* reprocess of nodes before showing
|
|
465
|
+
/**
|
|
466
|
+
* reprocess of nodes before showing
|
|
421
467
|
*/
|
|
468
|
+
|
|
469
|
+
|
|
422
470
|
function processShowNodes(zTreeObj, nodesShow, _keywords) {
|
|
423
471
|
if (nodesShow && nodesShow.length > 0) {
|
|
424
472
|
// process the ancient nodes if _keywords is not blank
|
|
425
473
|
if (_keywords.length > 0) {
|
|
426
474
|
$.each(nodesShow, function (n, obj) {
|
|
427
475
|
var pathOfOne = obj.getPath(); // get all the ancient nodes including current node
|
|
476
|
+
|
|
428
477
|
if (pathOfOne && pathOfOne.length > 0) {
|
|
429
478
|
// i < pathOfOne.length-1 process every node in path except self
|
|
430
479
|
for (var i = 0; i < pathOfOne.length - 1; i++) {
|
|
431
480
|
zTreeObj.showNode(pathOfOne[i]); // show node
|
|
481
|
+
|
|
432
482
|
zTreeObj.expandNode(pathOfOne[i], true); // expand node
|
|
433
483
|
}
|
|
434
484
|
}
|
|
@@ -436,15 +486,15 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
436
486
|
} else {
|
|
437
487
|
// show all nodes when _keywords is blank and expand the root nodes
|
|
438
488
|
var rootNodes = zTreeObj.getNodesByParam('level', '0'); // get all root nodes
|
|
489
|
+
|
|
439
490
|
$.each(rootNodes, function (n, obj) {
|
|
440
491
|
zTreeObj.expandNode(obj, true); // expand all root nodes
|
|
441
492
|
});
|
|
442
493
|
}
|
|
443
494
|
}
|
|
444
495
|
}
|
|
445
|
-
}
|
|
496
|
+
} // 清空搜索框数据(供外部调用)
|
|
446
497
|
|
|
447
|
-
// 清空搜索框数据(供外部调用)
|
|
448
498
|
}, {
|
|
449
499
|
key: "clearSearch",
|
|
450
500
|
value: function clearSearch() {
|
|
@@ -453,13 +503,13 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
453
503
|
searchVal: ''
|
|
454
504
|
});
|
|
455
505
|
this.refreshTree(this.props);
|
|
456
|
-
}
|
|
506
|
+
} // 获取所有已被勾选的节点
|
|
457
507
|
|
|
458
|
-
// 获取所有已被勾选的节点
|
|
459
508
|
}, {
|
|
460
509
|
key: "getCheckedNodes",
|
|
461
510
|
value: function getCheckedNodes() {
|
|
462
511
|
var _this3 = this;
|
|
512
|
+
|
|
463
513
|
return this.zTreeObj.getNodesByFilter(function (node) {
|
|
464
514
|
// 节点被勾选(非半勾状态)
|
|
465
515
|
if (_this3.props.checkStrictly) return node.checked;
|
|
@@ -467,11 +517,11 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
467
517
|
}).map(function (item) {
|
|
468
518
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
469
519
|
name: item.oldname || item.name // 搜索树会改变节点的name
|
|
520
|
+
|
|
470
521
|
});
|
|
471
522
|
});
|
|
472
|
-
}
|
|
523
|
+
} // 获取所有已被点击选中的节点
|
|
473
524
|
|
|
474
|
-
// 获取所有已被点击选中的节点
|
|
475
525
|
}, {
|
|
476
526
|
key: "getSelectedNodes",
|
|
477
527
|
value: function getSelectedNodes() {
|
|
@@ -480,16 +530,14 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
480
530
|
name: item.oldname || item.name
|
|
481
531
|
});
|
|
482
532
|
});
|
|
483
|
-
}
|
|
533
|
+
} // 展开所有节点(供外部调用)
|
|
484
534
|
|
|
485
|
-
// 展开所有节点(供外部调用)
|
|
486
535
|
}, {
|
|
487
536
|
key: "expandAll",
|
|
488
537
|
value: function expandAll() {
|
|
489
538
|
this.zTreeObj.expandAll(true);
|
|
490
|
-
}
|
|
539
|
+
} // 收起所有节点(供外部调用)
|
|
491
540
|
|
|
492
|
-
// 收起所有节点(供外部调用)
|
|
493
541
|
}, {
|
|
494
542
|
key: "collapseAll",
|
|
495
543
|
value: function collapseAll() {
|
|
@@ -500,9 +548,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
500
548
|
value: function render() {
|
|
501
549
|
var t = this;
|
|
502
550
|
var _t$props = t.props,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
551
|
+
prefixCls = _t$props.prefixCls,
|
|
552
|
+
showSearch = _t$props.showSearch,
|
|
553
|
+
searchPlaceholder = _t$props.searchPlaceholder;
|
|
506
554
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
507
555
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-wraaper"), _defineProperty({}, "".concat(prefixCls, "-has-search"), showSearch))
|
|
508
556
|
}, showSearch && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -522,13 +570,17 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
522
570
|
}));
|
|
523
571
|
}
|
|
524
572
|
}]);
|
|
573
|
+
|
|
525
574
|
return VtxZtree;
|
|
526
575
|
}(_react["default"].Component);
|
|
576
|
+
|
|
527
577
|
exports["default"] = VtxZtree;
|
|
578
|
+
|
|
528
579
|
_defineProperty(VtxZtree, "defaultProps", {
|
|
529
580
|
showSearch: true,
|
|
530
581
|
prefixCls: 'vtx-ztree'
|
|
531
582
|
});
|
|
583
|
+
|
|
532
584
|
VtxZtree.propTypes = {
|
|
533
585
|
showSearch: _propTypes["default"].bool,
|
|
534
586
|
searchPlaceholder: _propTypes["default"].string,
|