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