@vtx/components 4.0.0-beta.7 → 4.0.0-beta.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/es/index.js +3 -0
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +53 -52
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-color-picker/index.js +138 -33
- package/es/vtx-color-picker/style/index.js +36 -12
- package/es/vtx-combogrid/Combogrid.js +16 -10
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-combogrid/style/index.js +4 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -132
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -9
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/index.js +2 -2
- package/es/vtx-datagrid/columnState.js +64 -0
- package/es/vtx-datagrid/index.js +114 -35
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -33
- package/es/vtx-export-async/History.js +11 -3
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +18 -17
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +155 -43
- package/es/vtx-import/result.js +6 -2
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +31 -20
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-input/TextArea/index.js +11 -6
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-modal/style/index.js +5 -3
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/Content.js +1 -1
- package/es/vtx-page-layout/TabLayout.js +7 -13
- package/es/vtx-page-layout/TableLayout.js +24 -14
- package/es/vtx-page-layout/TableWrap.js +3 -2
- package/es/vtx-page-layout/TreeLayout.js +8 -14
- package/es/vtx-page-layout/container.js +8 -7
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +50 -40
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_US.js +65 -5
- package/es/vtx-provider/locale/zh_CN.js +75 -5
- package/es/vtx-provider/useStyle/index.js +25 -21
- package/es/vtx-scrollable-row/index.js +38 -28
- package/es/vtx-search/index.js +18 -13
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +132 -46
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +34 -25
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +104 -40
- package/es/vtx-tree-select/index.js +75 -105
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +291 -113
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
- package/lib/index.js +36 -0
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +54 -52
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/index.js +0 -7
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-color-picker/index.js +139 -34
- package/lib/vtx-color-picker/style/index.js +36 -12
- package/lib/vtx-combogrid/Combogrid.js +16 -10
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-combogrid/style/index.js +4 -4
- package/lib/vtx-datagrid/Store/Provide.js +116 -138
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -10
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/index.js +2 -2
- package/lib/vtx-datagrid/columnState.js +73 -0
- package/lib/vtx-datagrid/index.js +115 -35
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -34
- package/lib/vtx-export-async/History.js +11 -3
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +18 -17
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +154 -42
- package/lib/vtx-import/result.js +6 -2
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +30 -19
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-input/TextArea/index.js +11 -6
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-modal/style/index.js +5 -3
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/Content.js +1 -1
- package/lib/vtx-page-layout/TabLayout.js +8 -14
- package/lib/vtx-page-layout/TableLayout.js +24 -14
- package/lib/vtx-page-layout/TableWrap.js +3 -2
- package/lib/vtx-page-layout/TreeLayout.js +9 -15
- package/lib/vtx-page-layout/container.js +8 -7
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +49 -40
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_US.js +65 -5
- package/lib/vtx-provider/locale/zh_CN.js +75 -5
- package/lib/vtx-provider/useStyle/index.js +25 -21
- package/lib/vtx-scrollable-row/index.js +38 -28
- package/lib/vtx-search/index.js +18 -13
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +134 -48
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +32 -23
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +102 -38
- package/lib/vtx-tree-select/index.js +75 -105
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +289 -113
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
- package/package.json +238 -222
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
package/es/vtx-tree/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
var _excluded = ["showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames", "titleClassName", "expandAction"];
|
|
2
|
+
var _excluded = ["showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames", "titleClassName", "expandAction", "maxButtonCount"];
|
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
4
|
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."); }
|
|
5
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -20,26 +20,27 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
20
|
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; }
|
|
21
21
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState, useContext } from 'react';
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
|
-
import { ConfigProvider, Input, Tooltip, Tree } from 'antd';
|
|
24
|
-
import { DownOutlined } from '@ant-design/icons';
|
|
23
|
+
import { Dropdown, ConfigProvider, Input, Menu, Tooltip, Tree } from 'antd';
|
|
24
|
+
import { DownOutlined, EllipsisOutlined } from '@ant-design/icons';
|
|
25
25
|
import { calcRangeKeys, convertDirectoryKeysToNodes } from "./utils";
|
|
26
26
|
import { useDebounceFn, useMemoizedFn } from 'ahooks';
|
|
27
27
|
import { parseTreeData } from '@vtx/utils';
|
|
28
28
|
import classnames from 'classnames';
|
|
29
29
|
import { useStyle } from "./style/index";
|
|
30
30
|
import { VtxProvider, useIntl } from "../vtx-provider";
|
|
31
|
+
import VtxIcon from "../vtx-icon";
|
|
31
32
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
33
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
-
var getParentKey = function getParentKey(key, tree) {
|
|
34
|
-
var parentKey = arguments.length >
|
|
34
|
+
var getParentKey = function getParentKey(keyValue, key, tree) {
|
|
35
|
+
var parentKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
35
36
|
var _iterator = _createForOfIteratorHelper(tree),
|
|
36
37
|
_step;
|
|
37
38
|
try {
|
|
38
39
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
39
40
|
var node = _step.value;
|
|
40
|
-
if (node
|
|
41
|
+
if (node[keyValue] === key) return parentKey;
|
|
41
42
|
if (node.children) {
|
|
42
|
-
var found = getParentKey(key, node.children, node
|
|
43
|
+
var found = getParentKey(keyValue, key, node.children, node[keyValue]);
|
|
43
44
|
if (found !== undefined) return found;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -63,6 +64,8 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
63
64
|
titleClassName = propsAll.titleClassName,
|
|
64
65
|
_propsAll$expandActio = propsAll.expandAction,
|
|
65
66
|
expandAction = _propsAll$expandActio === void 0 ? 'click' : _propsAll$expandActio,
|
|
67
|
+
_propsAll$maxButtonCo = propsAll.maxButtonCount,
|
|
68
|
+
maxButtonCount = _propsAll$maxButtonCo === void 0 ? 3 : _propsAll$maxButtonCo,
|
|
66
69
|
props = _objectWithoutProperties(propsAll, _excluded);
|
|
67
70
|
var _useContext = useContext(VtxProvider),
|
|
68
71
|
getPrefixCls = _useContext.getPrefixCls;
|
|
@@ -93,12 +96,12 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
93
96
|
var dataList = useMemo(function () {
|
|
94
97
|
var dataList = [];
|
|
95
98
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
99
|
+
var keyName = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key';
|
|
96
100
|
var generateList = function generateList(data) {
|
|
97
101
|
for (var i = 0; i < data.length; i++) {
|
|
98
102
|
var node = data[i];
|
|
99
|
-
var key = node.key;
|
|
100
103
|
dataList.push({
|
|
101
|
-
key:
|
|
104
|
+
key: node[keyName],
|
|
102
105
|
title: node[titleKey]
|
|
103
106
|
});
|
|
104
107
|
if (node.children) {
|
|
@@ -141,6 +144,7 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
141
144
|
var newTreeData = parseTreeData(treeData, {
|
|
142
145
|
renderNode: function renderNode(item) {
|
|
143
146
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
147
|
+
var keyName = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key';
|
|
144
148
|
var strTitle = item[titleKey] || '';
|
|
145
149
|
var index = strTitle.indexOf(searchValue);
|
|
146
150
|
var beforeStr = strTitle.substring(0, index);
|
|
@@ -156,7 +160,7 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
156
160
|
className: className,
|
|
157
161
|
children: strTitle
|
|
158
162
|
});
|
|
159
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title),
|
|
163
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title), keyName, item[keyName]), "strTitle", strTitle));
|
|
160
164
|
},
|
|
161
165
|
filterNode: function filterNode(item) {
|
|
162
166
|
return item.strTitle.indexOf(searchValue) > -1;
|
|
@@ -168,7 +172,7 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
168
172
|
var _props$onExpand2;
|
|
169
173
|
var newExpandedKeys = dataList.map(function (item) {
|
|
170
174
|
if (item.title.indexOf(value) > -1) {
|
|
171
|
-
return getParentKey(item.key, treeData);
|
|
175
|
+
return getParentKey((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key', item.key, treeData);
|
|
172
176
|
}
|
|
173
177
|
return null;
|
|
174
178
|
}).filter(function (item, i, self) {
|
|
@@ -190,17 +194,29 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
190
194
|
};
|
|
191
195
|
});
|
|
192
196
|
useEffect(function () {
|
|
193
|
-
var
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
var element = treeRef.current;
|
|
198
|
+
if (!element) return; // 提前返回,避免后续问题
|
|
199
|
+
|
|
200
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
201
|
+
var _iterator2 = _createForOfIteratorHelper(entries),
|
|
202
|
+
_step2;
|
|
203
|
+
try {
|
|
204
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
205
|
+
var entry = _step2.value;
|
|
206
|
+
setHeight(entry.contentRect.height);
|
|
207
|
+
}
|
|
208
|
+
} catch (err) {
|
|
209
|
+
_iterator2.e(err);
|
|
210
|
+
} finally {
|
|
211
|
+
_iterator2.f();
|
|
212
|
+
}
|
|
197
213
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
setHeight(
|
|
214
|
+
resizeObserver.observe(element, {
|
|
215
|
+
box: 'border-box'
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// 初始化高度
|
|
219
|
+
setHeight(element.offsetHeight);
|
|
204
220
|
return function () {
|
|
205
221
|
resizeObserver.disconnect();
|
|
206
222
|
};
|
|
@@ -252,6 +268,21 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
252
268
|
setSelectedKeys(newSelectedKeys);
|
|
253
269
|
}
|
|
254
270
|
};
|
|
271
|
+
var renderMenuIcon = function renderMenuIcon(arr, nodeData) {
|
|
272
|
+
return arr.map(function (item) {
|
|
273
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
274
|
+
title: item.label,
|
|
275
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
276
|
+
className: "".concat(prefixCls, "-menu-item-icon"),
|
|
277
|
+
onClick: function onClick(e) {
|
|
278
|
+
e.stopPropagation();
|
|
279
|
+
item.onClick && item.onClick(nodeData);
|
|
280
|
+
},
|
|
281
|
+
children: item.icon
|
|
282
|
+
})
|
|
283
|
+
}, item.label);
|
|
284
|
+
});
|
|
285
|
+
};
|
|
255
286
|
return wrapSSR( /*#__PURE__*/_jsxs("div", {
|
|
256
287
|
className: classnames("".concat(prefixCls, "-wraaper"), hashId),
|
|
257
288
|
children: [showSearch && /*#__PURE__*/_jsx(Input, {
|
|
@@ -268,7 +299,10 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
268
299
|
ref: treeRef,
|
|
269
300
|
children: /*#__PURE__*/_jsx(Tree, _objectSpread(_objectSpread(_objectSpread({}, props), {}, {
|
|
270
301
|
height: height,
|
|
271
|
-
switcherIcon: /*#__PURE__*/_jsx(
|
|
302
|
+
switcherIcon: /*#__PURE__*/_jsx(VtxIcon, {
|
|
303
|
+
type: "downOutlined",
|
|
304
|
+
fileType: "svg"
|
|
305
|
+
}),
|
|
272
306
|
showLine: {
|
|
273
307
|
showLeafIcon: false
|
|
274
308
|
},
|
|
@@ -287,28 +321,54 @@ var VtxTree = /*#__PURE__*/forwardRef(function (propsAll, ref) {
|
|
|
287
321
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
288
322
|
var title = nodeData[titleKey];
|
|
289
323
|
if (renderMenuList) {
|
|
290
|
-
var menuList = renderMenuList(nodeData)
|
|
324
|
+
var menuList = renderMenuList(nodeData).filter(function (item) {
|
|
325
|
+
return item.visible;
|
|
326
|
+
});
|
|
327
|
+
var arr = [];
|
|
328
|
+
if (menuList.length > maxButtonCount) {
|
|
329
|
+
arr = arr.concat(renderMenuIcon(menuList.slice(0, maxButtonCount - 1), nodeData));
|
|
330
|
+
arr.push( /*#__PURE__*/_jsx(Dropdown, {
|
|
331
|
+
placement: "bottom",
|
|
332
|
+
menu: {
|
|
333
|
+
items: menuList.slice(maxButtonCount - 1).map(function (item) {
|
|
334
|
+
return {
|
|
335
|
+
key: item.label,
|
|
336
|
+
label: /*#__PURE__*/_jsxs("div", {
|
|
337
|
+
className: "".concat(prefixCls, "-menu-item-label"),
|
|
338
|
+
children: [item.icon, item.label]
|
|
339
|
+
})
|
|
340
|
+
};
|
|
341
|
+
}),
|
|
342
|
+
onClick: function onClick(obj) {
|
|
343
|
+
var key = obj.key,
|
|
344
|
+
domEvent = obj.domEvent;
|
|
345
|
+
domEvent.stopPropagation();
|
|
346
|
+
var temp = menuList.find(function (v) {
|
|
347
|
+
return v.label == key;
|
|
348
|
+
});
|
|
349
|
+
(temp === null || temp === void 0 ? void 0 : temp.onClick) && temp.onClick(nodeData);
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
trigger: ['click'],
|
|
353
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
354
|
+
className: "".concat(prefixCls, "-menu-item-icon"),
|
|
355
|
+
onClick: function onClick(e) {
|
|
356
|
+
e.stopPropagation();
|
|
357
|
+
},
|
|
358
|
+
children: /*#__PURE__*/_jsx(EllipsisOutlined, {})
|
|
359
|
+
})
|
|
360
|
+
}));
|
|
361
|
+
} else {
|
|
362
|
+
arr = arr.concat(renderMenuIcon(menuList, nodeData));
|
|
363
|
+
}
|
|
291
364
|
return /*#__PURE__*/_jsxs("div", {
|
|
292
365
|
className: classnames("".concat(prefixCls, "-menu-wrap"), hashId),
|
|
293
366
|
children: [/*#__PURE__*/_jsx("span", {
|
|
294
367
|
children: title
|
|
295
368
|
}), /*#__PURE__*/_jsx("div", {
|
|
296
369
|
className: classnames("".concat(prefixCls, "-menu-list"), hashId),
|
|
297
|
-
children:
|
|
298
|
-
|
|
299
|
-
}).map(function (item) {
|
|
300
|
-
return /*#__PURE__*/_jsx(Tooltip, {
|
|
301
|
-
title: item.label,
|
|
302
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
303
|
-
className: classnames("".concat(prefixCls, "-menu-item-icon"), hashId),
|
|
304
|
-
onClick: function onClick(e) {
|
|
305
|
-
e.stopPropagation();
|
|
306
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
307
|
-
item.onClick && item.onClick(nodeData);
|
|
308
|
-
},
|
|
309
|
-
children: item.icon
|
|
310
|
-
})
|
|
311
|
-
}, item.label);
|
|
370
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
371
|
+
children: [arr, " "]
|
|
312
372
|
})
|
|
313
373
|
})]
|
|
314
374
|
});
|
|
@@ -325,7 +385,7 @@ VtxTree.propTypes = {
|
|
|
325
385
|
treeData: PropTypes.array,
|
|
326
386
|
selectedKeys: PropTypes.array,
|
|
327
387
|
defaultSelectedKeys: PropTypes.array,
|
|
328
|
-
expandedKeys: PropTypes.
|
|
388
|
+
expandedKeys: PropTypes.array,
|
|
329
389
|
onExpand: PropTypes.func,
|
|
330
390
|
multiple: PropTypes.bool,
|
|
331
391
|
autoExpandParent: PropTypes.bool,
|
|
@@ -333,7 +393,11 @@ VtxTree.propTypes = {
|
|
|
333
393
|
searchPlaceholder: PropTypes.string,
|
|
334
394
|
renderMenuList: PropTypes.func,
|
|
335
395
|
titleClassName: PropTypes.func,
|
|
336
|
-
fieldNames: PropTypes.
|
|
396
|
+
fieldNames: PropTypes.shape({
|
|
397
|
+
title: PropTypes.string,
|
|
398
|
+
key: PropTypes.string,
|
|
399
|
+
children: PropTypes.string
|
|
400
|
+
}),
|
|
337
401
|
defaultExpandAll: PropTypes.bool,
|
|
338
402
|
expandAction: PropTypes.oneOfType([PropTypes.string, PropTypes.bool])
|
|
339
403
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style"]
|
|
3
|
-
_excluded2 = ["children"];
|
|
2
|
+
var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style", "fieldNames", "onChange", "labelInValue"];
|
|
4
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
4
|
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."); }
|
|
6
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -10,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
9
|
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; }
|
|
11
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
11
|
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); }
|
|
12
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
13
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
15
|
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); }
|
|
@@ -38,7 +38,18 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
38
38
|
_ref$disabled = _ref.disabled,
|
|
39
39
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
40
40
|
style = _ref.style,
|
|
41
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
42
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
43
|
+
label: "title",
|
|
44
|
+
value: "value",
|
|
45
|
+
key: "value",
|
|
46
|
+
children: 'children'
|
|
47
|
+
} : _ref$fieldNames,
|
|
48
|
+
onChange = _ref.onChange,
|
|
49
|
+
labelInValue = _ref.labelInValue,
|
|
41
50
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
// checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 labelInValue 强制为 true
|
|
52
|
+
var _labelInValue = treeCheckable && props.treeCheckStrictly ? true : labelInValue;
|
|
42
53
|
var intl = useIntl();
|
|
43
54
|
var _useContext = useContext(VtxProvider),
|
|
44
55
|
getPrefixCls = _useContext.getPrefixCls;
|
|
@@ -58,13 +69,15 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
58
69
|
var size = useSize(ref);
|
|
59
70
|
var keyNodesMapping = useMemo(function () {
|
|
60
71
|
var keyNodesMapping = {};
|
|
72
|
+
// 建议:添加树数据有效性检查
|
|
73
|
+
if (!treeData || !Array.isArray(treeData)) {
|
|
74
|
+
return keyNodesMapping;
|
|
75
|
+
}
|
|
61
76
|
(function genNodes(nodes) {
|
|
62
77
|
nodes.map(function (item) {
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
keyNodesMapping[item.value
|
|
66
|
-
id: item.value || item.key
|
|
67
|
-
});
|
|
78
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(item), item));
|
|
79
|
+
var children = item[fieldNames.children];
|
|
80
|
+
keyNodesMapping[item[fieldNames.value]] = _objectSpread(_objectSpread({}, rest), {}, _defineProperty(_defineProperty({}, fieldNames.value, item[fieldNames.value]), fieldNames.label, item[fieldNames.label]));
|
|
68
81
|
if (Array.isArray(children) && children.length > 0) {
|
|
69
82
|
genNodes(children);
|
|
70
83
|
}
|
|
@@ -73,19 +86,17 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
73
86
|
return keyNodesMapping;
|
|
74
87
|
}, [treeData]);
|
|
75
88
|
var clear = function clear() {
|
|
76
|
-
|
|
77
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, [], [], {});
|
|
89
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect([], [], {});
|
|
78
90
|
};
|
|
79
91
|
var clearKey = function clearKey(id) {
|
|
80
|
-
var _props$onChange2;
|
|
81
92
|
var newValue = _toConsumableArray(props.value);
|
|
82
93
|
pull(newValue, id);
|
|
83
94
|
var label = newValue.map(function (item) {
|
|
84
|
-
return keyNodesMapping[item]
|
|
95
|
+
return keyNodesMapping[item[fieldNames.label]];
|
|
85
96
|
});
|
|
86
|
-
|
|
97
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect(newValue, label, {});
|
|
87
98
|
};
|
|
88
|
-
var
|
|
99
|
+
var getSelectedNodes = function getSelectedNodes(value) {
|
|
89
100
|
var value_arr = function (val) {
|
|
90
101
|
if (Array.isArray(val)) {
|
|
91
102
|
return val;
|
|
@@ -94,90 +105,29 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
94
105
|
} else {
|
|
95
106
|
return [];
|
|
96
107
|
}
|
|
97
|
-
}(
|
|
108
|
+
}(value);
|
|
98
109
|
var selectedNodes = value_arr.filter(function (k) {
|
|
99
|
-
|
|
110
|
+
if (_labelInValue) {
|
|
111
|
+
return k.value in keyNodesMapping;
|
|
112
|
+
} else {
|
|
113
|
+
return k in keyNodesMapping;
|
|
114
|
+
}
|
|
100
115
|
}).map(function (item) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
116
|
+
if (_labelInValue) {
|
|
117
|
+
return _objectSpread({}, keyNodesMapping[item.value]);
|
|
118
|
+
}
|
|
119
|
+
return _objectSpread({}, keyNodesMapping[item]);
|
|
105
120
|
});
|
|
106
121
|
return selectedNodes;
|
|
122
|
+
};
|
|
123
|
+
var selectedNodes = useMemo(function () {
|
|
124
|
+
return getSelectedNodes(props.value);
|
|
107
125
|
}, [props.value, keyNodesMapping]);
|
|
108
126
|
useEffect(function () {
|
|
109
127
|
if (size !== null && size !== void 0 && size.width) {
|
|
110
128
|
setPopWidth(size === null || size === void 0 ? void 0 : size.width);
|
|
111
129
|
}
|
|
112
130
|
}, [size === null || size === void 0 ? void 0 : size.width]);
|
|
113
|
-
|
|
114
|
-
// let suffixIconObj = {};
|
|
115
|
-
// if (multiple || treeCheckable) {
|
|
116
|
-
// suffixIconObj.suffixIcon = (
|
|
117
|
-
// <Popover
|
|
118
|
-
// content={
|
|
119
|
-
// <>
|
|
120
|
-
// <div
|
|
121
|
-
// className={classnames(`${prefixCls}-count-head`, hashId,)}
|
|
122
|
-
|
|
123
|
-
// >
|
|
124
|
-
// <span>已选择:{selectedNodes.length}</span>
|
|
125
|
-
// <span
|
|
126
|
-
// className={classnames(
|
|
127
|
-
// selectedNodes.length > 0 && !disabled
|
|
128
|
-
// ? 'clear-count'
|
|
129
|
-
// : 'disabled-count',
|
|
130
|
-
// )}
|
|
131
|
-
// onClick={e => {
|
|
132
|
-
// if (!disabled) {
|
|
133
|
-
// e.stopPropagation();
|
|
134
|
-
// clear();
|
|
135
|
-
// }
|
|
136
|
-
// }}
|
|
137
|
-
// >
|
|
138
|
-
// 清空已选项
|
|
139
|
-
// </span>
|
|
140
|
-
// </div>
|
|
141
|
-
// {selectedNodes.length > 0 ? (
|
|
142
|
-
// selectedNodes.map(item => (
|
|
143
|
-
// <Tag
|
|
144
|
-
// key={`tab-${item.id}`}
|
|
145
|
-
// closable={!disabled}
|
|
146
|
-
// onClose={e => {
|
|
147
|
-
// e.stopPropagation();
|
|
148
|
-
// clearKey(item.id);
|
|
149
|
-
// }}
|
|
150
|
-
// style={{ marginBottom: '5px' }}
|
|
151
|
-
// >
|
|
152
|
-
// {item.name && item.name.length > 20
|
|
153
|
-
// ? `${item.name.slice(0, 20)}...`
|
|
154
|
-
// : item.name}
|
|
155
|
-
// </Tag>
|
|
156
|
-
// ))
|
|
157
|
-
// ) : (
|
|
158
|
-
// <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
159
|
-
// )}
|
|
160
|
-
// </>
|
|
161
|
-
// }
|
|
162
|
-
// placement="bottomRight"
|
|
163
|
-
// trigger="click"
|
|
164
|
-
// // overlayStyle={{ width: popWidth }}
|
|
165
|
-
// styles={{ root: { width: popWidth } }}
|
|
166
|
-
// >
|
|
167
|
-
// <Button
|
|
168
|
-
// className={classnames(`${prefixCls}-count`, hashId,)}
|
|
169
|
-
|
|
170
|
-
// icon={<MoreOutlined />}
|
|
171
|
-
// size="default"
|
|
172
|
-
// onClick={e => {
|
|
173
|
-
// console.log('click', e)
|
|
174
|
-
// e.stopPropagation();
|
|
175
|
-
// }}
|
|
176
|
-
// />
|
|
177
|
-
// </Popover>
|
|
178
|
-
// );
|
|
179
|
-
// }
|
|
180
|
-
|
|
181
131
|
var popoverContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
182
132
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
183
133
|
className: classnames("".concat(prefixCls, "-count-head"), hashId),
|
|
@@ -193,22 +143,33 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
193
143
|
},
|
|
194
144
|
children: intl.getMessage('treeSelect.clearSelectedItems', '清空已选项')
|
|
195
145
|
})]
|
|
196
|
-
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
146
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
147
|
+
className: classnames("".concat(prefixCls, "-all-list"), hashId),
|
|
148
|
+
children: selectedNodes.length > 0 ? selectedNodes.map(function (item) {
|
|
149
|
+
var _item$fieldNames$labe;
|
|
150
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
151
|
+
closable: !disabled,
|
|
152
|
+
onClose: function onClose(e) {
|
|
153
|
+
e.stopPropagation();
|
|
154
|
+
clearKey(item[fieldNames.value]);
|
|
155
|
+
},
|
|
156
|
+
styles: {
|
|
157
|
+
root: {
|
|
158
|
+
marginBottom: 5,
|
|
159
|
+
marginRight: 5
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
children: ((_item$fieldNames$labe = item[fieldNames.label]) === null || _item$fieldNames$labe === void 0 ? void 0 : _item$fieldNames$labe.length) > 20 ? "".concat(item[fieldNames.label].slice(0, 20), "...") : item[fieldNames.label]
|
|
163
|
+
}, "tab-".concat(item[fieldNames.value]));
|
|
164
|
+
}) : /*#__PURE__*/_jsx(Empty, {
|
|
165
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
166
|
+
})
|
|
210
167
|
})]
|
|
211
168
|
});
|
|
169
|
+
var onChangeTreeSelect = function onChangeTreeSelect(value, label, extra) {
|
|
170
|
+
extra.list = getSelectedNodes(value);
|
|
171
|
+
onChange === null || onChange === void 0 || onChange(value, label, extra);
|
|
172
|
+
};
|
|
212
173
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
213
174
|
ref: ref,
|
|
214
175
|
style: style,
|
|
@@ -217,8 +178,10 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
217
178
|
style: {
|
|
218
179
|
width: '100%'
|
|
219
180
|
},
|
|
220
|
-
children: [/*#__PURE__*/_jsx(TreeSelect, _objectSpread({
|
|
221
|
-
showSearch:
|
|
181
|
+
children: [/*#__PURE__*/_jsx(TreeSelect, _objectSpread(_objectSpread({
|
|
182
|
+
showSearch: {
|
|
183
|
+
treeNodeFilterProp: fieldNames.label
|
|
184
|
+
},
|
|
222
185
|
placeholder: placeholder,
|
|
223
186
|
treeData: treeData,
|
|
224
187
|
treeLine: {
|
|
@@ -241,8 +204,15 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
241
204
|
popup: classnames("".concat(prefixCls, "-popup"), hashId)
|
|
242
205
|
},
|
|
243
206
|
maxTagCount: "responsive",
|
|
244
|
-
treeDefaultExpandAll: true
|
|
245
|
-
|
|
207
|
+
treeDefaultExpandAll: true,
|
|
208
|
+
fieldNames: fieldNames,
|
|
209
|
+
labelInValue: _labelInValue,
|
|
210
|
+
disabled: disabled
|
|
211
|
+
}, props), {}, {
|
|
212
|
+
onChange: function onChange(value, label, extra) {
|
|
213
|
+
return onChangeTreeSelect(value, label, extra, selectedNodes);
|
|
214
|
+
}
|
|
215
|
+
})), (multiple || treeCheckable) && /*#__PURE__*/_jsx(Popover, {
|
|
246
216
|
open: popOpen,
|
|
247
217
|
onOpenChange: setPopOpen,
|
|
248
218
|
placement: "bottomRight",
|
|
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
8
|
var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
9
9
|
var componentCls = token.componentCls;
|
|
10
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
|
|
10
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
|
|
11
11
|
minWidth: '200px',
|
|
12
12
|
height: '300px',
|
|
13
13
|
overflow: 'auto',
|
|
@@ -28,14 +28,16 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
28
28
|
color: '@input-placeholder-color'
|
|
29
29
|
}), '&-count', {
|
|
30
30
|
marginRight: '-12px'
|
|
31
|
-
})), "".concat(componentCls, "-popup"), _defineProperty({}, '&', _defineProperty(_defineProperty({}, '.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title', {
|
|
31
|
+
})), "".concat(componentCls, "-popup"), _defineProperty({}, '&', _defineProperty(_defineProperty(_defineProperty({}, '.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title', {
|
|
32
32
|
color: '#1890ff'
|
|
33
33
|
}), '.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-node-selected', {
|
|
34
34
|
backgroundColor: '#e6f7ff'
|
|
35
|
+
}), '.ant-select-tree .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper', {
|
|
36
|
+
flex: 1
|
|
35
37
|
}))), "".concat(componentCls, "-count-head"), {
|
|
36
38
|
display: 'flex',
|
|
37
39
|
justifyContent: 'space-between',
|
|
38
|
-
marginBottom:
|
|
40
|
+
marginBottom: 5,
|
|
39
41
|
'.disabled-count': {
|
|
40
42
|
color: '#aaa',
|
|
41
43
|
cursor: 'not-allowed'
|
|
@@ -45,6 +47,9 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
45
47
|
}, '&:hover', {
|
|
46
48
|
color: '#40a9ff'
|
|
47
49
|
})
|
|
50
|
+
}), "".concat(componentCls, "-all-list"), {
|
|
51
|
+
maxHeight: 300,
|
|
52
|
+
overflowY: "auto"
|
|
48
53
|
}), "".concat(componentCls, "-outer"), {
|
|
49
54
|
position: 'relative',
|
|
50
55
|
display: 'inline-flex',
|
|
@@ -57,6 +62,7 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
57
62
|
color: token.colorTextDescription,
|
|
58
63
|
display: 'inline-flex',
|
|
59
64
|
alignItems: 'center',
|
|
65
|
+
width: token.controlHeight,
|
|
60
66
|
'&:hover': {
|
|
61
67
|
color: token.colorPrimary
|
|
62
68
|
}
|
|
@@ -10,6 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
// import { volume, playbackRate } from 'xgplayer/dist/controls';
|
|
11
11
|
import { Modal, Button } from 'antd';
|
|
12
12
|
import { VtxProvider, useIntl } from "../vtx-provider";
|
|
13
|
+
import VtxModal from "../vtx-modal";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
function Preview(props) {
|
|
@@ -77,7 +78,7 @@ function Preview(props) {
|
|
|
77
78
|
timer && clearTimeout(timer);
|
|
78
79
|
onCancel();
|
|
79
80
|
};
|
|
80
|
-
return /*#__PURE__*/_jsxs(
|
|
81
|
+
return /*#__PURE__*/_jsxs(VtxModal, _objectSpread(_objectSpread({}, modalProps), {}, {
|
|
81
82
|
children: [type == 'file' ? /*#__PURE__*/_jsx("iframe", {
|
|
82
83
|
src: url,
|
|
83
84
|
style: {
|