@vtx/components 3.1.85 → 3.1.88
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 +55 -44
- 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 +7 -15
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +1 -8
- 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 +2 -12
- 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 +23 -39
- 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 +0 -29
- 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 +9 -26
- 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 +46 -86
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +30 -56
- 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 +5 -14
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +35 -74
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +3 -15
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +125 -201
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +7 -38
- 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 +21 -51
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +24 -65
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +1 -7
- 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 +9 -28
- 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 +14 -27
- 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 +28 -61
- 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/History.js +59 -100
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +64 -105
- 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 +2 -13
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +11 -33
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +5 -11
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +11 -33
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +3 -9
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +1 -8
- 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 +9 -24
- 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 +216 -216
- package/lib/vtx-image/Image.js +73 -113
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +30 -59
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +17 -47
- 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 +45 -78
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +10 -28
- 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 +1 -8
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +11 -33
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +1 -6
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +7 -14
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +1 -6
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +51 -107
- 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 +10 -27
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +20 -45
- 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 +7 -20
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +2 -8
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +49 -82
- 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 +3 -8
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +15 -26
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +3 -12
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +30 -60
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +11 -22
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +23 -51
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +1 -10
- 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 +37 -57
- 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 +30 -64
- 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 +7 -26
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +7 -14
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +61 -106
- 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 +58 -93
- 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 +50 -91
- 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 +18 -33
- 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 +11 -22
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +19 -39
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +51 -107
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +1 -6
- 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 +2 -9
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +14 -30
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +14 -30
- 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 +1 -18
- 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 +4 -18
- 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 +49 -114
- 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 +6 -27
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +27 -71
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +0 -3
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +0 -3
- package/lib/vtx-tree-select/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +15 -33
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +78 -151
- 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 +74 -116
- 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 +75 -136
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +69 -119
- 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 +85 -146
- 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 +107 -107
- package/package.json +121 -121
|
@@ -1,97 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
13
|
-
|
|
14
10
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
15
|
-
|
|
16
11
|
var _tag = _interopRequireDefault(require("antd/lib/tag"));
|
|
17
|
-
|
|
18
12
|
var _CloseCircleFilled = _interopRequireDefault(require("@ant-design/icons/CloseCircleFilled"));
|
|
19
|
-
|
|
20
13
|
var _DownOutlined = _interopRequireDefault(require("@ant-design/icons/DownOutlined"));
|
|
21
|
-
|
|
22
14
|
var _lodash = _interopRequireDefault(require("lodash.isequal"));
|
|
23
|
-
|
|
24
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
16
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
27
|
-
|
|
28
17
|
var _vtxZtree = _interopRequireDefault(require("../vtx-ztree"));
|
|
29
|
-
|
|
30
18
|
var _icons = require("@ant-design/icons");
|
|
31
|
-
|
|
32
19
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
33
|
-
|
|
34
20
|
var _empty = _interopRequireDefault(require("antd/lib/empty"));
|
|
35
|
-
|
|
36
21
|
var _excluded = ["children"];
|
|
37
|
-
|
|
38
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
39
|
-
|
|
40
23
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
48
24
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
49
|
-
|
|
50
25
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
51
|
-
|
|
52
26
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
53
|
-
|
|
54
27
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
55
|
-
|
|
56
28
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
57
|
-
|
|
58
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
59
|
-
|
|
29
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
60
30
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
61
|
-
|
|
62
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
63
|
-
|
|
32
|
+
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; }
|
|
33
|
+
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; }
|
|
34
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
64
35
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
65
|
-
|
|
66
|
-
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); } }
|
|
67
|
-
|
|
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
68
37
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
73
|
-
|
|
74
|
-
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); }; }
|
|
75
|
-
|
|
38
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
39
|
+
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); }
|
|
40
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
76
41
|
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); }
|
|
77
|
-
|
|
78
42
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
79
|
-
|
|
80
|
-
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; } }
|
|
81
|
-
|
|
43
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
82
44
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
83
|
-
|
|
84
|
-
|
|
45
|
+
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); }
|
|
46
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
47
|
+
var VtxZtreeSelect = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
85
48
|
_inherits(VtxZtreeSelect, _React$Component);
|
|
86
|
-
|
|
87
|
-
var _super = _createSuper(VtxZtreeSelect);
|
|
88
|
-
|
|
89
49
|
function VtxZtreeSelect(props) {
|
|
90
50
|
var _this;
|
|
91
|
-
|
|
92
51
|
_classCallCheck(this, VtxZtreeSelect);
|
|
93
|
-
|
|
94
|
-
_this = _super.call(this, props);
|
|
52
|
+
_this = _callSuper(this, VtxZtreeSelect, [props]);
|
|
95
53
|
_this.tree = null;
|
|
96
54
|
_this.treeRefreshFlag = 1;
|
|
97
55
|
_this.state = {
|
|
@@ -101,11 +59,16 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
101
59
|
inputRef: null
|
|
102
60
|
};
|
|
103
61
|
_this.keyNodesMapping = {};
|
|
104
|
-
|
|
105
62
|
_this.getKeyNodesMapping();
|
|
106
|
-
|
|
63
|
+
_this.TextEnum = _objectSpread({
|
|
64
|
+
alreadyChooseText: '已选择',
|
|
65
|
+
clearChoosedOptionsText: '清空已选项',
|
|
66
|
+
emptyDescriptionText: '暂无数据'
|
|
67
|
+
}, props.customEnumText || {});
|
|
107
68
|
return _this;
|
|
108
|
-
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// UNSAFE_componentWillReceiveProps(nextProps) {
|
|
109
72
|
// if (!isEqual(this.props.data, nextProps.data)) {
|
|
110
73
|
// this.getKeyNodesMapping(nextProps.data);
|
|
111
74
|
// }
|
|
@@ -113,16 +76,14 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
113
76
|
// this.treeRefreshFlag++;
|
|
114
77
|
// }
|
|
115
78
|
// }
|
|
116
|
-
// 替换componentWillReceiveProps
|
|
117
|
-
|
|
118
79
|
|
|
80
|
+
// 替换componentWillReceiveProps
|
|
119
81
|
_createClass(VtxZtreeSelect, [{
|
|
120
82
|
key: "componentDidUpdate",
|
|
121
83
|
value: function componentDidUpdate(prevProps) {
|
|
122
84
|
if (!(0, _lodash["default"])(this.props.data, prevProps.data)) {
|
|
123
85
|
this.getKeyNodesMapping(this.props.data);
|
|
124
86
|
}
|
|
125
|
-
|
|
126
87
|
if (!(0, _lodash["default"])(this.props.expandedKeys, prevProps.expandedKeys)) {
|
|
127
88
|
this.treeRefreshFlag++;
|
|
128
89
|
}
|
|
@@ -132,14 +93,11 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
132
93
|
value: function getKeyNodesMapping(nodes) {
|
|
133
94
|
var t = this;
|
|
134
95
|
t.keyNodesMapping = {};
|
|
135
|
-
|
|
136
96
|
(function genNodes(nodes) {
|
|
137
97
|
nodes.map(function (item) {
|
|
138
98
|
var children = item.children,
|
|
139
|
-
|
|
140
|
-
|
|
99
|
+
rest = _objectWithoutProperties(item, _excluded);
|
|
141
100
|
t.keyNodesMapping[item.key] = rest;
|
|
142
|
-
|
|
143
101
|
if (Array.isArray(children) && children.length > 0) {
|
|
144
102
|
genNodes(children);
|
|
145
103
|
}
|
|
@@ -158,38 +116,31 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
158
116
|
this.tree.cancelSelectedNodes(this.props.value);
|
|
159
117
|
}
|
|
160
118
|
}
|
|
161
|
-
|
|
162
119
|
this.props.onChange && this.props.onChange({
|
|
163
120
|
nodes: [],
|
|
164
121
|
keys: [],
|
|
165
122
|
leafKeys: [],
|
|
166
123
|
names: []
|
|
167
124
|
});
|
|
168
|
-
|
|
169
125
|
if (this.tree) {
|
|
170
126
|
var _this$tree;
|
|
171
|
-
|
|
172
127
|
this.setState({
|
|
173
128
|
searchValue: ''
|
|
174
129
|
});
|
|
175
|
-
(_this$tree = this.tree) === null || _this$tree === void 0
|
|
130
|
+
(_this$tree = this.tree) === null || _this$tree === void 0 || _this$tree.fuzzySearch('');
|
|
176
131
|
}
|
|
177
132
|
}
|
|
178
133
|
}, {
|
|
179
134
|
key: "clearKey",
|
|
180
135
|
value: function clearKey(key) {
|
|
181
136
|
var _this2 = this;
|
|
182
|
-
|
|
183
137
|
var keyIndex = this.props.value.indexOf(key);
|
|
184
|
-
|
|
185
138
|
if (keyIndex != -1) {
|
|
186
139
|
var keyList = _toConsumableArray(this.props.value);
|
|
187
|
-
|
|
188
140
|
keyList.splice(keyIndex, 1);
|
|
189
141
|
var nodes = keyList.map(function (key) {
|
|
190
142
|
return _this2.keyNodesMapping[key];
|
|
191
143
|
});
|
|
192
|
-
|
|
193
144
|
if (this.tree) {
|
|
194
145
|
if (this.props.treeCheckable) {
|
|
195
146
|
this.tree.checkNodes([key], false);
|
|
@@ -197,7 +148,6 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
197
148
|
this.tree.cancelSelectedNodes([key]);
|
|
198
149
|
}
|
|
199
150
|
}
|
|
200
|
-
|
|
201
151
|
this.props.onChange && this.props.onChange({
|
|
202
152
|
nodes: nodes,
|
|
203
153
|
keys: keyList,
|
|
@@ -220,42 +170,41 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
220
170
|
}, {
|
|
221
171
|
key: "render",
|
|
222
172
|
value: function render() {
|
|
223
|
-
var _data
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
173
|
+
var _data$;
|
|
174
|
+
var t = this;
|
|
175
|
+
// 必填参数
|
|
227
176
|
var _t$props = t.props,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
177
|
+
data = _t$props.data,
|
|
178
|
+
value = _t$props.value;
|
|
179
|
+
// 可配参数
|
|
231
180
|
var _t$props2 = t.props,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
181
|
+
_t$props2$prefixCls = _t$props2.prefixCls,
|
|
182
|
+
prefixCls = _t$props2$prefixCls === void 0 ? 'vtx-ztree-select' : _t$props2$prefixCls,
|
|
183
|
+
_t$props2$treeCheckab = _t$props2.treeCheckable,
|
|
184
|
+
treeCheckable = _t$props2$treeCheckab === void 0 ? false : _t$props2$treeCheckab,
|
|
185
|
+
_t$props2$treeDefault = _t$props2.treeDefaultExpandAll,
|
|
186
|
+
treeDefaultExpandAll = _t$props2$treeDefault === void 0 ? false : _t$props2$treeDefault,
|
|
187
|
+
_t$props2$multiple = _t$props2.multiple,
|
|
188
|
+
multiple = _t$props2$multiple === void 0 ? false : _t$props2$multiple,
|
|
189
|
+
_t$props2$showSearch = _t$props2.showSearch,
|
|
190
|
+
showSearch = _t$props2$showSearch === void 0 ? true : _t$props2$showSearch,
|
|
191
|
+
searchPlaceholder = _t$props2.searchPlaceholder,
|
|
192
|
+
_t$props2$dropdownSty = _t$props2.dropdownStyle,
|
|
193
|
+
dropdownStyle = _t$props2$dropdownSty === void 0 ? {} : _t$props2$dropdownSty,
|
|
194
|
+
_t$props2$style = _t$props2.style,
|
|
195
|
+
style = _t$props2$style === void 0 ? {} : _t$props2$style,
|
|
196
|
+
_t$props2$disabled = _t$props2.disabled,
|
|
197
|
+
disabled = _t$props2$disabled === void 0 ? false : _t$props2$disabled,
|
|
198
|
+
_t$props2$refreshFlag = _t$props2.refreshFlag,
|
|
199
|
+
refreshFlag = _t$props2$refreshFlag === void 0 ? null : _t$props2$refreshFlag,
|
|
200
|
+
expandedKeys = _t$props2.expandedKeys,
|
|
201
|
+
customCfg = _t$props2.customCfg,
|
|
202
|
+
checkStrictly = _t$props2.checkStrictly,
|
|
203
|
+
_t$props2$popoverProp = _t$props2.popoverProps,
|
|
204
|
+
popoverProps = _t$props2$popoverProp === void 0 ? {} : _t$props2$popoverProp,
|
|
205
|
+
_t$props2$allowClear = _t$props2.allowClear,
|
|
206
|
+
allowClear = _t$props2$allowClear === void 0 ? true : _t$props2$allowClear;
|
|
207
|
+
// eslint-disable-next-line camelcase
|
|
259
208
|
var value_arr = function (val) {
|
|
260
209
|
if (Array.isArray(val)) {
|
|
261
210
|
return val;
|
|
@@ -265,7 +214,6 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
265
214
|
return [];
|
|
266
215
|
}
|
|
267
216
|
}(value);
|
|
268
|
-
|
|
269
217
|
var selectedNodes = value_arr.filter(function (k) {
|
|
270
218
|
return k in t.keyNodesMapping;
|
|
271
219
|
}).map(function (item) {
|
|
@@ -273,9 +221,9 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
273
221
|
id: item,
|
|
274
222
|
name: t.keyNodesMapping[item].name
|
|
275
223
|
};
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
var treeProps = (
|
|
224
|
+
});
|
|
225
|
+
// ztree配置
|
|
226
|
+
var treeProps = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
279
227
|
data: data,
|
|
280
228
|
// 树的数据
|
|
281
229
|
// showSearch: showSearch,
|
|
@@ -283,13 +231,12 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
283
231
|
searchPlaceholder: searchPlaceholder,
|
|
284
232
|
multiple: multiple,
|
|
285
233
|
checkable: treeCheckable
|
|
286
|
-
},
|
|
234
|
+
}, treeCheckable ? 'checkedKeys' : 'selectedKeys', value_arr), "defaultExpandAll", treeDefaultExpandAll), "expandedKeys", expandedKeys ? expandedKeys : (data === null || data === void 0 || (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.key) || '-1'), "refreshFlag", refreshFlag || t.treeRefreshFlag), "customCfg", customCfg), "checkStrictly", checkStrictly), "ref", function ref(instance) {
|
|
287
235
|
if (instance) t.tree = instance;
|
|
288
|
-
}),
|
|
236
|
+
}), "onClick", function onClick(_ref) {
|
|
289
237
|
var selectedNodes = _ref.selectedNodes,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
238
|
+
selectedKeys = _ref.selectedKeys,
|
|
239
|
+
selectedNames = _ref.selectedNames;
|
|
293
240
|
// console.log(selectedNodes,selectedKeys,selectedNames)
|
|
294
241
|
if (!treeCheckable) {
|
|
295
242
|
t.props.onChange && t.props.onChange({
|
|
@@ -302,22 +249,19 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
302
249
|
}),
|
|
303
250
|
names: selectedNames
|
|
304
251
|
});
|
|
305
|
-
|
|
306
252
|
if (!multiple) {
|
|
307
253
|
var _t$tree;
|
|
308
|
-
|
|
309
254
|
t.setState({
|
|
310
255
|
popoverVisible: false,
|
|
311
256
|
searchValue: ''
|
|
312
257
|
});
|
|
313
|
-
(_t$tree = t.tree) === null || _t$tree === void 0
|
|
258
|
+
(_t$tree = t.tree) === null || _t$tree === void 0 || _t$tree.fuzzySearch('');
|
|
314
259
|
}
|
|
315
260
|
}
|
|
316
|
-
}),
|
|
261
|
+
}), "onCheck", function onCheck(_ref2) {
|
|
317
262
|
var checkedNodes = _ref2.checkedNodes,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
263
|
+
checkedKeys = _ref2.checkedKeys,
|
|
264
|
+
checkedNames = _ref2.checkedNames;
|
|
321
265
|
if (treeCheckable) {
|
|
322
266
|
t.props.onChange && t.props.onChange({
|
|
323
267
|
nodes: checkedNodes,
|
|
@@ -330,10 +274,11 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
330
274
|
names: checkedNames
|
|
331
275
|
});
|
|
332
276
|
}
|
|
333
|
-
}),
|
|
277
|
+
}), "beforeCheck", function beforeCheck(treeNode) {
|
|
334
278
|
return t.props.beforeCheck ? t.props.beforeCheck(treeNode) : true;
|
|
335
|
-
})
|
|
279
|
+
});
|
|
336
280
|
|
|
281
|
+
// 多选组件
|
|
337
282
|
var MultiSelect = /*#__PURE__*/_react["default"].createElement("div", {
|
|
338
283
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-multiple-box")),
|
|
339
284
|
style: style,
|
|
@@ -381,11 +326,10 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
381
326
|
onChange: function onChange(e) {
|
|
382
327
|
if (t.tree) {
|
|
383
328
|
var _t$tree2;
|
|
384
|
-
|
|
385
329
|
t.setState({
|
|
386
330
|
searchValue: e.target.value
|
|
387
331
|
});
|
|
388
|
-
(_t$tree2 = t.tree) === null || _t$tree2 === void 0
|
|
332
|
+
(_t$tree2 = t.tree) === null || _t$tree2 === void 0 || _t$tree2.fuzzySearch(e.target.value.trim());
|
|
389
333
|
}
|
|
390
334
|
},
|
|
391
335
|
onBlur: function onBlur() {
|
|
@@ -403,7 +347,7 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
403
347
|
}))), /*#__PURE__*/_react["default"].createElement(_popover["default"], {
|
|
404
348
|
content: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
405
349
|
className: (0, _classnames2["default"])('vtx-tree-count-head')
|
|
406
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, "\
|
|
350
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, this.TextEnum.alreadyChooseText, "\uFF1A", selectedNodes.length), /*#__PURE__*/_react["default"].createElement("span", {
|
|
407
351
|
className: (0, _classnames2["default"])(selectedNodes.length > 0 && !disabled ? 'clear-count' : 'disabled-count'),
|
|
408
352
|
onClick: function onClick(e) {
|
|
409
353
|
if (!disabled) {
|
|
@@ -411,7 +355,7 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
411
355
|
t.clear();
|
|
412
356
|
}
|
|
413
357
|
}
|
|
414
|
-
},
|
|
358
|
+
}, this.TextEnum.clearChoosedOptionsText)), selectedNodes.length > 0 ? selectedNodes.map(function (item) {
|
|
415
359
|
return /*#__PURE__*/_react["default"].createElement(_tag["default"], {
|
|
416
360
|
key: "tab-".concat(item.id),
|
|
417
361
|
closable: !disabled,
|
|
@@ -424,7 +368,8 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
424
368
|
}
|
|
425
369
|
}, item.name.length > 20 ? "".concat(item.name.slice(0, 20), "...") : item.name);
|
|
426
370
|
}) : /*#__PURE__*/_react["default"].createElement(_empty["default"], {
|
|
427
|
-
image: _empty["default"].PRESENTED_IMAGE_SIMPLE
|
|
371
|
+
image: _empty["default"].PRESENTED_IMAGE_SIMPLE,
|
|
372
|
+
description: this.TextEnum.emptyDescriptionText
|
|
428
373
|
})),
|
|
429
374
|
placement: "bottomRight",
|
|
430
375
|
trigger: "click",
|
|
@@ -438,14 +383,15 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
438
383
|
onClick: function onClick(e) {
|
|
439
384
|
e.stopPropagation();
|
|
440
385
|
}
|
|
441
|
-
})));
|
|
442
|
-
|
|
386
|
+
})));
|
|
443
387
|
|
|
388
|
+
// 单选组件
|
|
444
389
|
var SingleSelect = /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
445
390
|
value: t.state.focusSingle ? t.state.searchValue : t.state.searchValue || selectedNodes.map(function (item) {
|
|
446
391
|
return item.name;
|
|
447
392
|
}).join(', '),
|
|
448
|
-
style: style
|
|
393
|
+
style: style
|
|
394
|
+
// readOnly
|
|
449
395
|
,
|
|
450
396
|
disabled: disabled,
|
|
451
397
|
placeholder: t.props.placeholder,
|
|
@@ -473,15 +419,13 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
473
419
|
onChange: function onChange(e) {
|
|
474
420
|
if (t.tree) {
|
|
475
421
|
var _t$tree3;
|
|
476
|
-
|
|
477
422
|
t.setState({
|
|
478
423
|
searchValue: e.target.value
|
|
479
424
|
});
|
|
480
|
-
(_t$tree3 = t.tree) === null || _t$tree3 === void 0
|
|
425
|
+
(_t$tree3 = t.tree) === null || _t$tree3 === void 0 || _t$tree3.fuzzySearch(e.target.value.trim());
|
|
481
426
|
}
|
|
482
427
|
}
|
|
483
428
|
});
|
|
484
|
-
|
|
485
429
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
486
430
|
className: prefixCls
|
|
487
431
|
}, disabled ? multiple || treeCheckable ? MultiSelect : SingleSelect : /*#__PURE__*/_react["default"].createElement(_popover["default"], _extends({
|
|
@@ -498,30 +442,24 @@ var VtxZtreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
498
442
|
cursor: 'end'
|
|
499
443
|
});
|
|
500
444
|
}
|
|
501
|
-
|
|
502
445
|
t.setState({
|
|
503
446
|
popoverVisible: v,
|
|
504
447
|
focusMultiple: v
|
|
505
448
|
});
|
|
506
|
-
|
|
507
449
|
if (!v) {
|
|
508
450
|
var _t$tree4;
|
|
509
|
-
|
|
510
451
|
t.setState({
|
|
511
452
|
searchValue: ''
|
|
512
453
|
});
|
|
513
|
-
(_t$tree4 = t.tree) === null || _t$tree4 === void 0
|
|
454
|
+
(_t$tree4 = t.tree) === null || _t$tree4 === void 0 || _t$tree4.fuzzySearch('');
|
|
514
455
|
}
|
|
515
456
|
},
|
|
516
457
|
visible: t.state.popoverVisible
|
|
517
458
|
}), multiple || treeCheckable ? MultiSelect : SingleSelect));
|
|
518
459
|
}
|
|
519
460
|
}]);
|
|
520
|
-
|
|
521
461
|
return VtxZtreeSelect;
|
|
522
462
|
}(_react["default"].Component);
|
|
523
|
-
|
|
524
|
-
exports["default"] = VtxZtreeSelect;
|
|
525
463
|
VtxZtreeSelect.propTypes = {
|
|
526
464
|
data: _propTypes["default"].array,
|
|
527
465
|
expandedKeys: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
@@ -529,6 +467,7 @@ VtxZtreeSelect.propTypes = {
|
|
|
529
467
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].arrayOf(_propTypes["default"].string)]),
|
|
530
468
|
onChange: _propTypes["default"].func,
|
|
531
469
|
popoverProps: _propTypes["default"].object,
|
|
532
|
-
allowClear: _propTypes["default"].bool
|
|
470
|
+
allowClear: _propTypes["default"].bool,
|
|
471
|
+
customEnumText: _propTypes["default"].object
|
|
533
472
|
};
|
|
534
473
|
//# sourceMappingURL=index.js.map
|