@vtx/components 3.1.149 → 3.1.151
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/lib/_util/filterSpecialCharacters.js +60 -49
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +1 -4
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getToken.js +8 -16
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +2 -9
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +0 -1
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +0 -1
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useColSize.js +3 -13
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js +0 -3
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +26 -42
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js +1 -2
- package/lib/config.js.map +1 -1
- package/lib/index.js +1 -30
- package/lib/index.js.map +1 -1
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/vtx-color-picker/index.js +14 -33
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +0 -2
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +0 -2
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-combogrid/Combogrid.js +55 -96
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +41 -66
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +0 -7
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +0 -7
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/Alert.js +6 -15
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/CheckboxList.js +35 -71
- package/lib/vtx-datagrid/CheckboxList.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +58 -105
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +6 -18
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +138 -217
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +15 -46
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +0 -10
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +0 -10
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-date-picker/QdatePicker.js +28 -58
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +35 -77
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +2 -8
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +0 -1
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +0 -1
- package/lib/vtx-date-picker/style/index.js.map +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-editor/index.js +13 -32
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +0 -1
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +0 -1
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-editor/style/index.less +8 -8
- package/lib/vtx-ellipsis-text/index.js +16 -29
- package/lib/vtx-ellipsis-text/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/css.js +0 -1
- package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.js +0 -1
- package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.less +13 -13
- package/lib/vtx-export/index.js +38 -73
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +0 -5
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +0 -5
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-export-async/ColumnsSelect.js +11 -23
- package/lib/vtx-export-async/ColumnsSelect.js.map +1 -1
- package/lib/vtx-export-async/History.js +75 -117
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +72 -116
- package/lib/vtx-export-async/index.js.map +1 -1
- package/lib/vtx-export-async/style/css.js.map +1 -1
- package/lib/vtx-export-async/style/index.js.map +1 -1
- package/lib/vtx-export-async/util.js +9 -21
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +17 -39
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +6 -12
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +19 -50
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +4 -10
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +2 -9
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +1 -4
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/demo/Modal.less +43 -43
- package/lib/vtx-form-layout/index.js +10 -25
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +0 -7
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +0 -7
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-form-layout/style/index.less +220 -220
- package/lib/vtx-image/Image.js +77 -117
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +34 -63
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +24 -54
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +4 -11
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +0 -1
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-import/index.js +91 -143
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +15 -33
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +0 -3
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +0 -3
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-import/style/index.less +8 -8
- package/lib/vtx-import2/CheckResult.js +2 -9
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +16 -38
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +2 -7
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +8 -15
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +2 -7
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +91 -176
- package/lib/vtx-import2/index.js.map +1 -1
- package/lib/vtx-import2/style/css.js +0 -3
- package/lib/vtx-import2/style/css.js.map +1 -1
- package/lib/vtx-import2/style/index.js +0 -3
- package/lib/vtx-import2/style/index.js.map +1 -1
- package/lib/vtx-import2/style/index.less +102 -102
- package/lib/vtx-input/TextArea.js +14 -31
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +24 -49
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +0 -1
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +0 -1
- package/lib/vtx-input/style/index.js.map +1 -1
- package/lib/vtx-input/style/index.less +24 -24
- package/lib/vtx-input/useLength.js +10 -23
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +3 -9
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +52 -85
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +0 -1
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +0 -1
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-page-layout/Basic.js +4 -9
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +16 -27
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +4 -13
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +34 -64
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +12 -23
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +32 -61
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +2 -11
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-page-layout/style/css.js.map +1 -1
- package/lib/vtx-page-layout/style/index.js.map +1 -1
- package/lib/vtx-page-layout/style/index.less +138 -138
- package/lib/vtx-rps-frame/index.js +38 -58
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-rps-frame/style/css.js.map +1 -1
- package/lib/vtx-rps-frame/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +34 -68
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.less +113 -113
- package/lib/vtx-search/VtxCol.js +8 -27
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +8 -15
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +67 -112
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +0 -4
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +0 -4
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search-map-input/index.js +63 -98
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +0 -2
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +0 -2
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +47 -99
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +0 -8
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +0 -8
- package/lib/vtx-select/style/index.js.map +1 -1
- package/lib/vtx-select/style/index.less +68 -68
- package/lib/vtx-signature/index.js +19 -34
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +0 -2
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +0 -2
- package/lib/vtx-signature/style/index.js.map +1 -1
- package/lib/vtx-signature/style/index.less +33 -33
- package/lib/vtx-split-pane/Pane.js +12 -23
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +21 -41
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +55 -111
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +2 -7
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +0 -3
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +0 -3
- package/lib/vtx-split-pane/style/index.js.map +1 -1
- package/lib/vtx-split-pane/style/index.less +76 -76
- package/lib/vtx-statistics-column/Back.js +4 -11
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +16 -32
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +15 -31
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +1 -4
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +2 -19
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js +0 -1
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js +0 -1
- package/lib/vtx-statistics-column/style/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.less +59 -59
- package/lib/vtx-time-picker/index.js +8 -22
- 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-tree/index.js +83 -153
- package/lib/vtx-tree/index.js.map +1 -1
- package/lib/vtx-tree/style/css.js +0 -2
- package/lib/vtx-tree/style/css.js.map +1 -1
- package/lib/vtx-tree/style/index.js +0 -2
- package/lib/vtx-tree/style/index.js.map +1 -1
- package/lib/vtx-tree/utils.js +10 -31
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +37 -81
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +0 -4
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +0 -4
- package/lib/vtx-tree-select/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +17 -35
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +90 -167
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +0 -6
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +0 -6
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-upload/style/index.less +61 -61
- package/lib/vtx-wang-editor/index.js +84 -126
- package/lib/vtx-wang-editor/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/css.js +0 -1
- package/lib/vtx-wang-editor/style/css.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.js +0 -1
- package/lib/vtx-wang-editor/style/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +80 -141
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +77 -138
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +0 -1
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.js +0 -1
- package/lib/vtx-ztree/style/index.js.map +1 -1
- package/lib/vtx-ztree/style/index.less +45 -45
- package/lib/vtx-ztree-select/index.js +91 -159
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +0 -3
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +0 -3
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +109 -109
- package/package.json +122 -122
package/lib/vtx-ztree/index.js
CHANGED
|
@@ -4,66 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
11
|
-
|
|
12
9
|
var _lodash = _interopRequireDefault(require("lodash.isequal"));
|
|
13
|
-
|
|
14
10
|
var _lodash2 = _interopRequireDefault(require("lodash.merge"));
|
|
15
|
-
|
|
16
11
|
var _lodash3 = _interopRequireDefault(require("lodash.debounce"));
|
|
17
|
-
|
|
18
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
13
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
14
|
var _config = _interopRequireDefault(require("../config"));
|
|
23
|
-
|
|
24
15
|
var _antd = require("antd");
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
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; } }
|
|
51
|
-
|
|
52
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
56
|
-
var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
_inherits(VtxZtree, _React$Component);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(VtxZtree);
|
|
60
|
-
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
20
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
22
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
25
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
26
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
28
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
29
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
30
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
32
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
|
|
33
|
+
* @Author: yemu
|
|
34
|
+
* @Date: 2021-04-08 22:03:07
|
|
35
|
+
* @LastEditTime: 2021-04-09 10:36:45
|
|
36
|
+
* @LastEditors: yemu
|
|
37
|
+
* @Description: 树形控件
|
|
38
|
+
*/
|
|
39
|
+
var VtxZtree = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
61
40
|
function VtxZtree(props) {
|
|
62
41
|
var _this;
|
|
63
|
-
|
|
64
42
|
_classCallCheck(this, VtxZtree);
|
|
65
|
-
|
|
66
|
-
_this = _super.call(this, props);
|
|
43
|
+
_this = _callSuper(this, VtxZtree, [props]);
|
|
67
44
|
_this.treeId = "tree-".concat(new Date().getTime(), "-").concat(parseInt(Math.random() * 10000));
|
|
68
45
|
_this.zTreeObj = null;
|
|
69
46
|
_this.treeSetting = {};
|
|
@@ -72,7 +49,7 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
72
49
|
_this.searchTimeOutId = null;
|
|
73
50
|
_this.loadPromise = _this.loadTreeResource();
|
|
74
51
|
_this.loadComplete = false;
|
|
75
|
-
_this.fuzzySearch = (0, _lodash3["default"])(_this.fuzzySearch.bind(
|
|
52
|
+
_this.fuzzySearch = (0, _lodash3["default"])(_this.fuzzySearch.bind(_this), 300);
|
|
76
53
|
_this.state = {
|
|
77
54
|
searchVal: '',
|
|
78
55
|
isEmpty: false
|
|
@@ -80,8 +57,8 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
80
57
|
_this.timer = null;
|
|
81
58
|
return _this;
|
|
82
59
|
}
|
|
83
|
-
|
|
84
|
-
_createClass(VtxZtree, [{
|
|
60
|
+
_inherits(VtxZtree, _React$Component);
|
|
61
|
+
return _createClass(VtxZtree, [{
|
|
85
62
|
key: "loadTreeResource",
|
|
86
63
|
value: function loadTreeResource() {
|
|
87
64
|
if (!$.fn.zTree) {
|
|
@@ -108,10 +85,8 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
108
85
|
key: "componentDidMount",
|
|
109
86
|
value: function componentDidMount() {
|
|
110
87
|
var _this2 = this;
|
|
111
|
-
|
|
112
88
|
this.loadPromise.then(function () {
|
|
113
89
|
_this2.loadComplete = true;
|
|
114
|
-
|
|
115
90
|
_this2.refreshTree(_this2.props);
|
|
116
91
|
});
|
|
117
92
|
}
|
|
@@ -119,7 +94,6 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
119
94
|
key: "componentDidUpdate",
|
|
120
95
|
value: function componentDidUpdate(prevProps) {
|
|
121
96
|
if (!this.loadComplete) return;
|
|
122
|
-
|
|
123
97
|
if (!(0, _lodash["default"])(prevProps.refreshFlag, this.props.refreshFlag) || !(0, _lodash["default"])(prevProps.data, this.props.data)) {
|
|
124
98
|
this.refreshTree(this.props);
|
|
125
99
|
}
|
|
@@ -128,13 +102,14 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
128
102
|
key: "componentWillUnmount",
|
|
129
103
|
value: function componentWillUnmount() {
|
|
130
104
|
this.zTreeObj && this.zTreeObj.destroy();
|
|
131
|
-
}
|
|
105
|
+
}
|
|
132
106
|
|
|
107
|
+
// 初始化树的配置
|
|
133
108
|
}, {
|
|
134
109
|
key: "initTreeSetting",
|
|
135
110
|
value: function initTreeSetting(props) {
|
|
136
|
-
var t = this;
|
|
137
|
-
|
|
111
|
+
var t = this;
|
|
112
|
+
// 初始化树的配置
|
|
138
113
|
this.treeSetting = {
|
|
139
114
|
check: {
|
|
140
115
|
enable: !!props.checkable,
|
|
@@ -166,10 +141,8 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
166
141
|
},
|
|
167
142
|
onClick: function onClick(e, treeId, treeNode) {
|
|
168
143
|
console.log('点击节点信息', treeNode, t.props.selectedKeys);
|
|
169
|
-
|
|
170
144
|
if (typeof props.onClick == 'function') {
|
|
171
145
|
var _t$props$selectedKeys;
|
|
172
|
-
|
|
173
146
|
var selectedNodes = t.getSelectedNodes();
|
|
174
147
|
var obj = {
|
|
175
148
|
key: treeNode.key,
|
|
@@ -183,7 +156,6 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
183
156
|
return item.name;
|
|
184
157
|
})
|
|
185
158
|
};
|
|
186
|
-
|
|
187
159
|
if (t.props.supportCancelSelect && ((_t$props$selectedKeys = t.props.selectedKeys) === null || _t$props$selectedKeys === void 0 ? void 0 : _t$props$selectedKeys.length) > 0 && t.props.selectedKeys[0] == treeNode.key) {
|
|
188
160
|
obj = {
|
|
189
161
|
key: '',
|
|
@@ -195,7 +167,6 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
195
167
|
};
|
|
196
168
|
t.cancelSelectedNodes(t.props.selectedKeys);
|
|
197
169
|
}
|
|
198
|
-
|
|
199
170
|
props.onClick(obj);
|
|
200
171
|
}
|
|
201
172
|
},
|
|
@@ -264,32 +235,30 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
264
235
|
}
|
|
265
236
|
}
|
|
266
237
|
}
|
|
267
|
-
};
|
|
268
|
-
|
|
238
|
+
};
|
|
239
|
+
// 继承外部配置
|
|
269
240
|
if (_typeof(this.props.customCfg) == 'object') {
|
|
270
241
|
(0, _lodash2["default"])(this.treeSetting, this.props.customCfg);
|
|
271
242
|
}
|
|
272
|
-
}
|
|
243
|
+
}
|
|
273
244
|
|
|
245
|
+
// 初始化树的数据,对expandedKeys,checkedKeys做处理
|
|
274
246
|
}, {
|
|
275
247
|
key: "initTreeNodes",
|
|
276
248
|
value: function initTreeNodes(props) {
|
|
277
249
|
var t = this;
|
|
278
250
|
this.keyNameMapping = {};
|
|
279
|
-
|
|
280
251
|
if (!Array.isArray(props.data)) {
|
|
281
252
|
this.treeNodes = [];
|
|
282
253
|
} else {
|
|
283
254
|
var checkedKeys = props.checkedKeys || [];
|
|
284
255
|
var expandedKeys = props.expandedKeys || [];
|
|
285
256
|
var chkDisabled = !!props.disableCheckboxAll;
|
|
286
|
-
|
|
287
257
|
this.treeNodes = function genNodes(nodes) {
|
|
288
258
|
return nodes.map(function (item) {
|
|
289
259
|
var checked = checkedKeys.indexOf(item.key) != -1;
|
|
290
260
|
var open = expandedKeys.indexOf(item.key) != -1;
|
|
291
261
|
t.keyNameMapping[item.key] = item.name;
|
|
292
|
-
|
|
293
262
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
294
263
|
return _objectSpread(_objectSpread({
|
|
295
264
|
chkDisabled: chkDisabled,
|
|
@@ -310,22 +279,19 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
310
279
|
}
|
|
311
280
|
}).map(function (item) {
|
|
312
281
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
313
|
-
var newNode = _objectSpread({}, item);
|
|
314
|
-
|
|
315
|
-
|
|
282
|
+
var newNode = _objectSpread({}, item);
|
|
283
|
+
// 如果子节点全部被勾选,父节点自动勾选
|
|
316
284
|
if (item.children.every(function (item) {
|
|
317
285
|
return item.checked;
|
|
318
286
|
})) {
|
|
319
287
|
newNode.checked = true;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
|
|
288
|
+
}
|
|
289
|
+
// 如果配置了自动展开父节点,父节点自动展开
|
|
323
290
|
if (props.autoExpandParent && item.children.some(function (item) {
|
|
324
291
|
return item.open;
|
|
325
292
|
})) {
|
|
326
293
|
newNode.open = true;
|
|
327
294
|
}
|
|
328
|
-
|
|
329
295
|
return newNode;
|
|
330
296
|
} else {
|
|
331
297
|
return item;
|
|
@@ -333,8 +299,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
333
299
|
});
|
|
334
300
|
}(props.data);
|
|
335
301
|
}
|
|
336
|
-
}
|
|
302
|
+
}
|
|
337
303
|
|
|
304
|
+
// 重新生成树
|
|
338
305
|
}, {
|
|
339
306
|
key: "refreshTree",
|
|
340
307
|
value: function refreshTree(newProps) {
|
|
@@ -342,65 +309,62 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
342
309
|
this.initTreeSetting(newProps);
|
|
343
310
|
this.initTreeNodes(newProps);
|
|
344
311
|
this.zTreeObj = $.fn.zTree.init($("#".concat(this.treeId)), this.treeSetting, this.treeNodes);
|
|
345
|
-
|
|
346
312
|
if (Array.isArray(newProps.selectedKeys)) {
|
|
347
313
|
this.selectNodes(newProps.selectedKeys, newProps.multiple);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
314
|
+
}
|
|
315
|
+
// 初始化全展开判断
|
|
351
316
|
if (newProps.defaultExpandAll && !newProps.expandedKeys) {
|
|
352
317
|
this.zTreeObj.expandAll(true);
|
|
353
318
|
}
|
|
354
|
-
}
|
|
319
|
+
}
|
|
355
320
|
|
|
321
|
+
// 展开或折叠相关节点,expandFlag为true表示展开,false表示折叠
|
|
356
322
|
}, {
|
|
357
323
|
key: "expandNodes",
|
|
358
324
|
value: function expandNodes(expandedKeys) {
|
|
359
325
|
var expandFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
360
|
-
|
|
361
326
|
for (var i = 0, len = expandedKeys.length; i < len; i++) {
|
|
362
327
|
var node = this.zTreeObj.getNodesByParam('key', expandedKeys[i]).pop();
|
|
363
|
-
|
|
364
328
|
if (node) {
|
|
365
329
|
this.zTreeObj.expandNode(node, expandFlag, false, false);
|
|
366
330
|
}
|
|
367
331
|
}
|
|
368
|
-
}
|
|
332
|
+
}
|
|
369
333
|
|
|
334
|
+
// 勾选节点, checkedFlag为true表示勾选,false表示取消勾选
|
|
370
335
|
}, {
|
|
371
336
|
key: "checkNodes",
|
|
372
337
|
value: function checkNodes(checkedKeys) {
|
|
373
338
|
var checkedFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
374
|
-
|
|
375
339
|
for (var i = 0, len = checkedKeys.length; i < len; i++) {
|
|
376
340
|
var node = this.zTreeObj.getNodesByParam('key', checkedKeys[i]).pop();
|
|
377
|
-
|
|
378
341
|
if (node) {
|
|
379
342
|
// 隐藏节点的勾选状态也要改变
|
|
380
343
|
node.checked = checkedFlag;
|
|
381
|
-
this.zTreeObj.updateNode(node, true);
|
|
344
|
+
this.zTreeObj.updateNode(node, true);
|
|
345
|
+
// this.zTreeObj.checkNode(node,checkedFlag,false);
|
|
382
346
|
}
|
|
383
347
|
}
|
|
384
|
-
}
|
|
348
|
+
}
|
|
385
349
|
|
|
350
|
+
// 点击选择节点
|
|
386
351
|
}, {
|
|
387
352
|
key: "selectNodes",
|
|
388
353
|
value: function selectNodes(selectedKeys, multiple) {
|
|
389
354
|
for (var i = 0, len = selectedKeys.length; i < len; i++) {
|
|
390
355
|
var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
|
|
391
|
-
|
|
392
356
|
if (node) {
|
|
393
357
|
this.zTreeObj.selectNode(node, multiple, true);
|
|
394
358
|
}
|
|
395
359
|
}
|
|
396
|
-
}
|
|
360
|
+
}
|
|
397
361
|
|
|
362
|
+
// 取消选择节点
|
|
398
363
|
}, {
|
|
399
364
|
key: "cancelSelectedNodes",
|
|
400
365
|
value: function cancelSelectedNodes(selectedKeys) {
|
|
401
366
|
for (var i = 0, len = selectedKeys.length; i < len; i++) {
|
|
402
367
|
var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
|
|
403
|
-
|
|
404
368
|
if (node) {
|
|
405
369
|
this.zTreeObj.cancelSelectedNode(node);
|
|
406
370
|
}
|
|
@@ -415,38 +379,34 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
415
379
|
var nameKey = this.zTreeObj.setting.data.key.name; // get the key of the node name
|
|
416
380
|
// isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
|
|
417
381
|
// isExpand = isExpand?true:false; // not to expand in default
|
|
418
|
-
|
|
419
382
|
this.zTreeObj.setting.view.nameIsHTML = isHighLight; // allow use html in node name for highlight use
|
|
420
383
|
|
|
421
384
|
var metaChar = '[\\[\\]\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; // js meta characters
|
|
422
|
-
|
|
423
385
|
var rexMeta = new RegExp(metaChar, 'gi'); // regular expression to match meta characters
|
|
386
|
+
|
|
424
387
|
// searchNodeLazy(keyworld);
|
|
388
|
+
ztreeFilter(t.zTreeObj, keyworld);
|
|
425
389
|
|
|
426
|
-
|
|
390
|
+
// -----------------------------内部函数----------------------------------
|
|
427
391
|
// keywords filter function
|
|
428
|
-
|
|
429
392
|
function ztreeFilter(zTreeObj, _keywords) {
|
|
430
393
|
if (!_keywords) {
|
|
431
394
|
_keywords = ''; // default blank for _keywords
|
|
432
|
-
}
|
|
433
|
-
|
|
395
|
+
}
|
|
434
396
|
|
|
397
|
+
// function to find the matching node
|
|
435
398
|
function filterFunc(node) {
|
|
436
399
|
if (node && node.oldname && node.oldname.length > 0) {
|
|
437
400
|
node[nameKey] = node.oldname; // recover oldname of the node if exist
|
|
438
401
|
}
|
|
439
|
-
|
|
440
402
|
zTreeObj.updateNode(node); // update node to for modifications take effect
|
|
441
|
-
|
|
442
403
|
if (_keywords.length == 0) {
|
|
443
404
|
// return true to show all nodes if the keyword is blank
|
|
444
|
-
zTreeObj.showNode(node);
|
|
445
|
-
|
|
405
|
+
zTreeObj.showNode(node);
|
|
406
|
+
// zTreeObj.expandNode(node,isExpand);
|
|
446
407
|
return true;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
408
|
+
}
|
|
409
|
+
// transform node name and keywords to lowercase
|
|
450
410
|
if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase()) != -1) {
|
|
451
411
|
if (isHighLight) {
|
|
452
412
|
// highlight process
|
|
@@ -457,12 +417,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
457
417
|
// add escape character before meta characters
|
|
458
418
|
return '\\' + matchStr;
|
|
459
419
|
});
|
|
460
|
-
|
|
461
420
|
node.oldname = node[nameKey]; // store the old name
|
|
462
|
-
|
|
463
421
|
var rexGlobal = new RegExp(newKeywords, 'gi'); // 'g' for global,'i' for ignore case
|
|
464
422
|
// use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
|
|
465
|
-
|
|
466
423
|
node[nameKey] = node.oldname.replace(rexGlobal, function (originalText) {
|
|
467
424
|
// highlight the matching words in node name
|
|
468
425
|
var highLightText = '<span style="color: whitesmoke;background-color:#f50;">' + originalText + '</span>';
|
|
@@ -470,38 +427,29 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
470
427
|
});
|
|
471
428
|
zTreeObj.updateNode(node); // update node for modifications take effect
|
|
472
429
|
}
|
|
473
|
-
|
|
474
430
|
zTreeObj.showNode(node); // show node with matching keywords
|
|
475
|
-
|
|
476
431
|
return true; // return true and show this node
|
|
477
432
|
}
|
|
478
|
-
|
|
479
433
|
zTreeObj.hideNode(node); // hide node that not matched
|
|
480
|
-
|
|
481
434
|
return false; // return false for node not matched
|
|
482
435
|
}
|
|
483
|
-
|
|
484
436
|
var nodesShow = zTreeObj.getNodesByFilter(filterFunc); // get all nodes that would be shown
|
|
485
|
-
|
|
486
437
|
processShowNodes(zTreeObj, nodesShow, _keywords); // nodes should be reprocessed to show correctly
|
|
487
438
|
}
|
|
439
|
+
|
|
488
440
|
/**
|
|
489
441
|
* reprocess of nodes before showing
|
|
490
442
|
*/
|
|
491
|
-
|
|
492
|
-
|
|
493
443
|
function processShowNodes(zTreeObj, nodesShow, _keywords) {
|
|
494
444
|
if (nodesShow && nodesShow.length > 0) {
|
|
495
445
|
// process the ancient nodes if _keywords is not blank
|
|
496
446
|
if (_keywords.length > 0) {
|
|
497
447
|
$.each(nodesShow, function (n, obj) {
|
|
498
448
|
var pathOfOne = obj.getPath(); // get all the ancient nodes including current node
|
|
499
|
-
|
|
500
449
|
if (pathOfOne && pathOfOne.length > 0) {
|
|
501
450
|
// i < pathOfOne.length-1 process every node in path except self
|
|
502
451
|
for (var i = 0; i < pathOfOne.length - 1; i++) {
|
|
503
452
|
zTreeObj.showNode(pathOfOne[i]); // show node
|
|
504
|
-
|
|
505
453
|
zTreeObj.expandNode(pathOfOne[i], true); // expand node
|
|
506
454
|
}
|
|
507
455
|
}
|
|
@@ -509,17 +457,16 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
509
457
|
} else {
|
|
510
458
|
// show all nodes when _keywords is blank and expand the root nodes
|
|
511
459
|
var rootNodes = zTreeObj.getNodesByParam('level', '0'); // get all root nodes
|
|
512
|
-
|
|
513
460
|
$.each(rootNodes, function (n, obj) {
|
|
514
461
|
zTreeObj.expandNode(obj, true); // expand all root nodes
|
|
515
462
|
});
|
|
516
463
|
}
|
|
517
464
|
}
|
|
518
|
-
|
|
519
465
|
callback && callback(nodesShow);
|
|
520
466
|
}
|
|
521
|
-
}
|
|
467
|
+
}
|
|
522
468
|
|
|
469
|
+
// 清空搜索框数据(供外部调用)
|
|
523
470
|
}, {
|
|
524
471
|
key: "clearSearch",
|
|
525
472
|
value: function clearSearch() {
|
|
@@ -528,13 +475,13 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
528
475
|
searchVal: ''
|
|
529
476
|
});
|
|
530
477
|
this.refreshTree(this.props);
|
|
531
|
-
}
|
|
478
|
+
}
|
|
532
479
|
|
|
480
|
+
// 获取所有已被勾选的节点
|
|
533
481
|
}, {
|
|
534
482
|
key: "getCheckedNodes",
|
|
535
483
|
value: function getCheckedNodes() {
|
|
536
484
|
var _this3 = this;
|
|
537
|
-
|
|
538
485
|
return this.zTreeObj.getNodesByFilter(function (node) {
|
|
539
486
|
// 节点被勾选(非半勾状态)
|
|
540
487
|
if (_this3.props.checkStrictly) return node.checked;
|
|
@@ -542,11 +489,11 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
542
489
|
}).map(function (item) {
|
|
543
490
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
544
491
|
name: item.oldname || item.name // 搜索树会改变节点的name
|
|
545
|
-
|
|
546
492
|
});
|
|
547
493
|
});
|
|
548
|
-
}
|
|
494
|
+
}
|
|
549
495
|
|
|
496
|
+
// 获取所有已被点击选中的节点
|
|
550
497
|
}, {
|
|
551
498
|
key: "getSelectedNodes",
|
|
552
499
|
value: function getSelectedNodes() {
|
|
@@ -555,14 +502,16 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
555
502
|
name: item.oldname || item.name
|
|
556
503
|
});
|
|
557
504
|
});
|
|
558
|
-
}
|
|
505
|
+
}
|
|
559
506
|
|
|
507
|
+
// 展开所有节点(供外部调用)
|
|
560
508
|
}, {
|
|
561
509
|
key: "expandAll",
|
|
562
510
|
value: function expandAll() {
|
|
563
511
|
this.zTreeObj.expandAll(true);
|
|
564
|
-
}
|
|
512
|
+
}
|
|
565
513
|
|
|
514
|
+
// 收起所有节点(供外部调用)
|
|
566
515
|
}, {
|
|
567
516
|
key: "collapseAll",
|
|
568
517
|
value: function collapseAll() {
|
|
@@ -573,9 +522,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
573
522
|
value: function render() {
|
|
574
523
|
var t = this;
|
|
575
524
|
var _t$props = t.props,
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
525
|
+
prefixCls = _t$props.prefixCls,
|
|
526
|
+
showSearch = _t$props.showSearch,
|
|
527
|
+
searchPlaceholder = _t$props.searchPlaceholder;
|
|
579
528
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
580
529
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-wraaper"), _defineProperty({}, "".concat(prefixCls, "-has-search"), showSearch))
|
|
581
530
|
}, showSearch && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -588,20 +537,16 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
588
537
|
searchVal: e.target.value
|
|
589
538
|
};
|
|
590
539
|
t.setState(obj);
|
|
591
|
-
|
|
592
540
|
if (t.timer) {
|
|
593
541
|
clearTimeout(t.timer);
|
|
594
542
|
t.timer = null;
|
|
595
543
|
}
|
|
596
|
-
|
|
597
544
|
t.timer = setTimeout(function () {
|
|
598
545
|
var _obj$searchVal;
|
|
599
|
-
|
|
600
546
|
t.fuzzySearch((_obj$searchVal = obj.searchVal) === null || _obj$searchVal === void 0 ? void 0 : _obj$searchVal.trim(), true, function (arr) {
|
|
601
547
|
t.setState({
|
|
602
548
|
isEmpty: arr.length == 0
|
|
603
549
|
});
|
|
604
|
-
|
|
605
550
|
if (arr.length !== 0) {
|
|
606
551
|
if (Array.isArray(t.props.selectedKeys)) {
|
|
607
552
|
t.selectNodes(t.props.selectedKeys, t.props.multiple);
|
|
@@ -622,17 +567,11 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
|
|
|
622
567
|
}));
|
|
623
568
|
}
|
|
624
569
|
}]);
|
|
625
|
-
|
|
626
|
-
return VtxZtree;
|
|
627
570
|
}(_react["default"].Component);
|
|
628
|
-
|
|
629
|
-
exports["default"] = VtxZtree;
|
|
630
|
-
|
|
631
571
|
_defineProperty(VtxZtree, "defaultProps", {
|
|
632
572
|
showSearch: true,
|
|
633
573
|
prefixCls: 'vtx-ztree'
|
|
634
574
|
});
|
|
635
|
-
|
|
636
575
|
VtxZtree.propTypes = {
|
|
637
576
|
showSearch: _propTypes["default"].bool,
|
|
638
577
|
searchPlaceholder: _propTypes["default"].string,
|