@vtx/components 4.0.0-beta.7 → 4.0.0-beta.70
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/es/index.js +3 -0
- package/es/utils/filterSpecialCharacters.js +47 -46
- package/es/utils/index.js +1 -2
- 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 +11 -5
- 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-date-picker/QdatePicker.js +1 -1
- 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 +25 -25
- package/es/vtx-export-async/History.js +7 -3
- package/es/vtx-export-async/index.js +42 -14
- 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 +9 -4
- package/es/vtx-modal/style/index.js +5 -3
- package/es/vtx-page-layout/Content.js +1 -1
- package/es/vtx-page-layout/TabLayout.js +1 -7
- package/es/vtx-page-layout/TableLayout.js +14 -4
- package/es/vtx-page-layout/TableWrap.js +3 -2
- package/es/vtx-page-layout/TreeLayout.js +2 -8
- package/es/vtx-page-layout/container.js +6 -5
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +20 -10
- 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 +8 -4
- 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/wangEditorUtil.js +59 -9
- package/lib/index.js +36 -0
- package/lib/utils/filterSpecialCharacters.js +48 -46
- package/lib/utils/index.js +0 -7
- 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 +11 -6
- 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-date-picker/QdatePicker.js +1 -1
- 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 +26 -26
- package/lib/vtx-export-async/History.js +7 -3
- package/lib/vtx-export-async/index.js +40 -12
- 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 +9 -4
- package/lib/vtx-modal/style/index.js +5 -3
- package/lib/vtx-page-layout/Content.js +1 -1
- package/lib/vtx-page-layout/TabLayout.js +3 -9
- package/lib/vtx-page-layout/TableLayout.js +14 -4
- package/lib/vtx-page-layout/TableWrap.js +3 -2
- package/lib/vtx-page-layout/TreeLayout.js +4 -10
- package/lib/vtx-page-layout/container.js +6 -5
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +19 -10
- 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 +8 -4
- 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/wangEditorUtil.js +59 -10
- package/package.json +44 -28
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
package/lib/vtx-tree/index.js
CHANGED
|
@@ -15,8 +15,9 @@ var _utils2 = require("@vtx/utils");
|
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
var _index = require("./style/index");
|
|
17
17
|
var _vtxProvider = require("../vtx-provider");
|
|
18
|
+
var _vtxIcon = _interopRequireDefault(require("../vtx-icon"));
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
var _excluded = ["showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames", "titleClassName", "expandAction"];
|
|
20
|
+
var _excluded = ["showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames", "titleClassName", "expandAction", "maxButtonCount"];
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -38,16 +39,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
38
39
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
39
40
|
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); }
|
|
40
41
|
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; }
|
|
41
|
-
var getParentKey = function getParentKey(key, tree) {
|
|
42
|
-
var parentKey = arguments.length >
|
|
42
|
+
var getParentKey = function getParentKey(keyValue, key, tree) {
|
|
43
|
+
var parentKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
43
44
|
var _iterator = _createForOfIteratorHelper(tree),
|
|
44
45
|
_step;
|
|
45
46
|
try {
|
|
46
47
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
47
48
|
var node = _step.value;
|
|
48
|
-
if (node
|
|
49
|
+
if (node[keyValue] === key) return parentKey;
|
|
49
50
|
if (node.children) {
|
|
50
|
-
var found = getParentKey(key, node.children, node
|
|
51
|
+
var found = getParentKey(keyValue, key, node.children, node[keyValue]);
|
|
51
52
|
if (found !== undefined) return found;
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -71,6 +72,8 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
71
72
|
titleClassName = propsAll.titleClassName,
|
|
72
73
|
_propsAll$expandActio = propsAll.expandAction,
|
|
73
74
|
expandAction = _propsAll$expandActio === void 0 ? 'click' : _propsAll$expandActio,
|
|
75
|
+
_propsAll$maxButtonCo = propsAll.maxButtonCount,
|
|
76
|
+
maxButtonCount = _propsAll$maxButtonCo === void 0 ? 3 : _propsAll$maxButtonCo,
|
|
74
77
|
props = _objectWithoutProperties(propsAll, _excluded);
|
|
75
78
|
var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
|
|
76
79
|
getPrefixCls = _useContext.getPrefixCls;
|
|
@@ -101,12 +104,12 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
101
104
|
var dataList = (0, _react.useMemo)(function () {
|
|
102
105
|
var dataList = [];
|
|
103
106
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
107
|
+
var keyName = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key';
|
|
104
108
|
var generateList = function generateList(data) {
|
|
105
109
|
for (var i = 0; i < data.length; i++) {
|
|
106
110
|
var node = data[i];
|
|
107
|
-
var key = node.key;
|
|
108
111
|
dataList.push({
|
|
109
|
-
key:
|
|
112
|
+
key: node[keyName],
|
|
110
113
|
title: node[titleKey]
|
|
111
114
|
});
|
|
112
115
|
if (node.children) {
|
|
@@ -149,6 +152,7 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
149
152
|
var newTreeData = (0, _utils2.parseTreeData)(treeData, {
|
|
150
153
|
renderNode: function renderNode(item) {
|
|
151
154
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
155
|
+
var keyName = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key';
|
|
152
156
|
var strTitle = item[titleKey] || '';
|
|
153
157
|
var index = strTitle.indexOf(searchValue);
|
|
154
158
|
var beforeStr = strTitle.substring(0, index);
|
|
@@ -164,7 +168,7 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
164
168
|
className: className,
|
|
165
169
|
children: strTitle
|
|
166
170
|
});
|
|
167
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title),
|
|
171
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title), keyName, item[keyName]), "strTitle", strTitle));
|
|
168
172
|
},
|
|
169
173
|
filterNode: function filterNode(item) {
|
|
170
174
|
return item.strTitle.indexOf(searchValue) > -1;
|
|
@@ -176,7 +180,7 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
176
180
|
var _props$onExpand2;
|
|
177
181
|
var newExpandedKeys = dataList.map(function (item) {
|
|
178
182
|
if (item.title.indexOf(value) > -1) {
|
|
179
|
-
return getParentKey(item.key, treeData);
|
|
183
|
+
return getParentKey((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key', item.key, treeData);
|
|
180
184
|
}
|
|
181
185
|
return null;
|
|
182
186
|
}).filter(function (item, i, self) {
|
|
@@ -198,17 +202,29 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
198
202
|
};
|
|
199
203
|
});
|
|
200
204
|
(0, _react.useEffect)(function () {
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
var element = treeRef.current;
|
|
206
|
+
if (!element) return; // 提前返回,避免后续问题
|
|
207
|
+
|
|
208
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
209
|
+
var _iterator2 = _createForOfIteratorHelper(entries),
|
|
210
|
+
_step2;
|
|
211
|
+
try {
|
|
212
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
213
|
+
var entry = _step2.value;
|
|
214
|
+
setHeight(entry.contentRect.height);
|
|
215
|
+
}
|
|
216
|
+
} catch (err) {
|
|
217
|
+
_iterator2.e(err);
|
|
218
|
+
} finally {
|
|
219
|
+
_iterator2.f();
|
|
220
|
+
}
|
|
205
221
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
setHeight(
|
|
222
|
+
resizeObserver.observe(element, {
|
|
223
|
+
box: 'border-box'
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// 初始化高度
|
|
227
|
+
setHeight(element.offsetHeight);
|
|
212
228
|
return function () {
|
|
213
229
|
resizeObserver.disconnect();
|
|
214
230
|
};
|
|
@@ -260,6 +276,21 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
260
276
|
setSelectedKeys(newSelectedKeys);
|
|
261
277
|
}
|
|
262
278
|
};
|
|
279
|
+
var renderMenuIcon = function renderMenuIcon(arr, nodeData) {
|
|
280
|
+
return arr.map(function (item) {
|
|
281
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
282
|
+
title: item.label,
|
|
283
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
284
|
+
className: "".concat(prefixCls, "-menu-item-icon"),
|
|
285
|
+
onClick: function onClick(e) {
|
|
286
|
+
e.stopPropagation();
|
|
287
|
+
item.onClick && item.onClick(nodeData);
|
|
288
|
+
},
|
|
289
|
+
children: item.icon
|
|
290
|
+
})
|
|
291
|
+
}, item.label);
|
|
292
|
+
});
|
|
293
|
+
};
|
|
263
294
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
264
295
|
className: (0, _classnames.default)("".concat(prefixCls, "-wraaper"), hashId),
|
|
265
296
|
children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
@@ -276,7 +307,10 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
276
307
|
ref: treeRef,
|
|
277
308
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tree, _objectSpread(_objectSpread(_objectSpread({}, props), {}, {
|
|
278
309
|
height: height,
|
|
279
|
-
switcherIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
310
|
+
switcherIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
|
|
311
|
+
type: "downOutlined",
|
|
312
|
+
fileType: "svg"
|
|
313
|
+
}),
|
|
280
314
|
showLine: {
|
|
281
315
|
showLeafIcon: false
|
|
282
316
|
},
|
|
@@ -295,28 +329,54 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
295
329
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
296
330
|
var title = nodeData[titleKey];
|
|
297
331
|
if (renderMenuList) {
|
|
298
|
-
var menuList = renderMenuList(nodeData)
|
|
332
|
+
var menuList = renderMenuList(nodeData).filter(function (item) {
|
|
333
|
+
return item.visible;
|
|
334
|
+
});
|
|
335
|
+
var arr = [];
|
|
336
|
+
if (menuList.length > maxButtonCount) {
|
|
337
|
+
arr = arr.concat(renderMenuIcon(menuList.slice(0, maxButtonCount - 1), nodeData));
|
|
338
|
+
arr.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, {
|
|
339
|
+
placement: "bottom",
|
|
340
|
+
menu: {
|
|
341
|
+
items: menuList.slice(maxButtonCount - 1).map(function (item) {
|
|
342
|
+
return {
|
|
343
|
+
key: item.label,
|
|
344
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
345
|
+
className: "".concat(prefixCls, "-menu-item-label"),
|
|
346
|
+
children: [item.icon, item.label]
|
|
347
|
+
})
|
|
348
|
+
};
|
|
349
|
+
}),
|
|
350
|
+
onClick: function onClick(obj) {
|
|
351
|
+
var key = obj.key,
|
|
352
|
+
domEvent = obj.domEvent;
|
|
353
|
+
domEvent.stopPropagation();
|
|
354
|
+
var temp = menuList.find(function (v) {
|
|
355
|
+
return v.label == key;
|
|
356
|
+
});
|
|
357
|
+
(temp === null || temp === void 0 ? void 0 : temp.onClick) && temp.onClick(nodeData);
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
trigger: ['click'],
|
|
361
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
362
|
+
className: "".concat(prefixCls, "-menu-item-icon"),
|
|
363
|
+
onClick: function onClick(e) {
|
|
364
|
+
e.stopPropagation();
|
|
365
|
+
},
|
|
366
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.EllipsisOutlined, {})
|
|
367
|
+
})
|
|
368
|
+
}));
|
|
369
|
+
} else {
|
|
370
|
+
arr = arr.concat(renderMenuIcon(menuList, nodeData));
|
|
371
|
+
}
|
|
299
372
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
300
373
|
className: (0, _classnames.default)("".concat(prefixCls, "-menu-wrap"), hashId),
|
|
301
374
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
302
375
|
children: title
|
|
303
376
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
304
377
|
className: (0, _classnames.default)("".concat(prefixCls, "-menu-list"), hashId),
|
|
305
|
-
children:
|
|
306
|
-
|
|
307
|
-
}).map(function (item) {
|
|
308
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
309
|
-
title: item.label,
|
|
310
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
311
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-menu-item-icon"), hashId),
|
|
312
|
-
onClick: function onClick(e) {
|
|
313
|
-
e.stopPropagation();
|
|
314
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
315
|
-
item.onClick && item.onClick(nodeData);
|
|
316
|
-
},
|
|
317
|
-
children: item.icon
|
|
318
|
-
})
|
|
319
|
-
}, item.label);
|
|
378
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
379
|
+
children: [arr, " "]
|
|
320
380
|
})
|
|
321
381
|
})]
|
|
322
382
|
});
|
|
@@ -333,7 +393,7 @@ VtxTree.propTypes = {
|
|
|
333
393
|
treeData: _propTypes.default.array,
|
|
334
394
|
selectedKeys: _propTypes.default.array,
|
|
335
395
|
defaultSelectedKeys: _propTypes.default.array,
|
|
336
|
-
expandedKeys: _propTypes.default.
|
|
396
|
+
expandedKeys: _propTypes.default.array,
|
|
337
397
|
onExpand: _propTypes.default.func,
|
|
338
398
|
multiple: _propTypes.default.bool,
|
|
339
399
|
autoExpandParent: _propTypes.default.bool,
|
|
@@ -341,7 +401,11 @@ VtxTree.propTypes = {
|
|
|
341
401
|
searchPlaceholder: _propTypes.default.string,
|
|
342
402
|
renderMenuList: _propTypes.default.func,
|
|
343
403
|
titleClassName: _propTypes.default.func,
|
|
344
|
-
fieldNames: _propTypes.default.
|
|
404
|
+
fieldNames: _propTypes.default.shape({
|
|
405
|
+
title: _propTypes.default.string,
|
|
406
|
+
key: _propTypes.default.string,
|
|
407
|
+
children: _propTypes.default.string
|
|
408
|
+
}),
|
|
345
409
|
defaultExpandAll: _propTypes.default.bool,
|
|
346
410
|
expandAction: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool])
|
|
347
411
|
};
|
|
@@ -15,8 +15,7 @@ var _index = require("./style/index");
|
|
|
15
15
|
var _ahooks = require("ahooks");
|
|
16
16
|
var _vtxProvider = require("../vtx-provider");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style"]
|
|
19
|
-
_excluded2 = ["children"];
|
|
18
|
+
var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style", "fieldNames", "onChange", "labelInValue"];
|
|
20
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -29,6 +28,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
29
28
|
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; }
|
|
30
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
31
30
|
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); }
|
|
31
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
32
32
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
33
|
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."); }
|
|
34
34
|
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); }
|
|
@@ -45,7 +45,18 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
45
45
|
_ref$disabled = _ref.disabled,
|
|
46
46
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
47
47
|
style = _ref.style,
|
|
48
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
49
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
50
|
+
label: "title",
|
|
51
|
+
value: "value",
|
|
52
|
+
key: "value",
|
|
53
|
+
children: 'children'
|
|
54
|
+
} : _ref$fieldNames,
|
|
55
|
+
onChange = _ref.onChange,
|
|
56
|
+
labelInValue = _ref.labelInValue,
|
|
48
57
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
58
|
+
// checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 labelInValue 强制为 true
|
|
59
|
+
var _labelInValue = treeCheckable && props.treeCheckStrictly ? true : labelInValue;
|
|
49
60
|
var intl = (0, _vtxProvider.useIntl)();
|
|
50
61
|
var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
|
|
51
62
|
getPrefixCls = _useContext.getPrefixCls;
|
|
@@ -65,13 +76,15 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
65
76
|
var size = (0, _ahooks.useSize)(ref);
|
|
66
77
|
var keyNodesMapping = (0, _react.useMemo)(function () {
|
|
67
78
|
var keyNodesMapping = {};
|
|
79
|
+
// 建议:添加树数据有效性检查
|
|
80
|
+
if (!treeData || !Array.isArray(treeData)) {
|
|
81
|
+
return keyNodesMapping;
|
|
82
|
+
}
|
|
68
83
|
(function genNodes(nodes) {
|
|
69
84
|
nodes.map(function (item) {
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
keyNodesMapping[item.value
|
|
73
|
-
id: item.value || item.key
|
|
74
|
-
});
|
|
85
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(item), item));
|
|
86
|
+
var children = item[fieldNames.children];
|
|
87
|
+
keyNodesMapping[item[fieldNames.value]] = _objectSpread(_objectSpread({}, rest), {}, _defineProperty(_defineProperty({}, fieldNames.value, item[fieldNames.value]), fieldNames.label, item[fieldNames.label]));
|
|
75
88
|
if (Array.isArray(children) && children.length > 0) {
|
|
76
89
|
genNodes(children);
|
|
77
90
|
}
|
|
@@ -80,19 +93,17 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
80
93
|
return keyNodesMapping;
|
|
81
94
|
}, [treeData]);
|
|
82
95
|
var clear = function clear() {
|
|
83
|
-
|
|
84
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, [], [], {});
|
|
96
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect([], [], {});
|
|
85
97
|
};
|
|
86
98
|
var clearKey = function clearKey(id) {
|
|
87
|
-
var _props$onChange2;
|
|
88
99
|
var newValue = _toConsumableArray(props.value);
|
|
89
100
|
(0, _pull.default)(newValue, id);
|
|
90
101
|
var label = newValue.map(function (item) {
|
|
91
|
-
return keyNodesMapping[item]
|
|
102
|
+
return keyNodesMapping[item[fieldNames.label]];
|
|
92
103
|
});
|
|
93
|
-
|
|
104
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect(newValue, label, {});
|
|
94
105
|
};
|
|
95
|
-
var
|
|
106
|
+
var getSelectedNodes = function getSelectedNodes(value) {
|
|
96
107
|
var value_arr = function (val) {
|
|
97
108
|
if (Array.isArray(val)) {
|
|
98
109
|
return val;
|
|
@@ -101,90 +112,29 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
101
112
|
} else {
|
|
102
113
|
return [];
|
|
103
114
|
}
|
|
104
|
-
}(
|
|
115
|
+
}(value);
|
|
105
116
|
var selectedNodes = value_arr.filter(function (k) {
|
|
106
|
-
|
|
117
|
+
if (_labelInValue) {
|
|
118
|
+
return k.value in keyNodesMapping;
|
|
119
|
+
} else {
|
|
120
|
+
return k in keyNodesMapping;
|
|
121
|
+
}
|
|
107
122
|
}).map(function (item) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
123
|
+
if (_labelInValue) {
|
|
124
|
+
return _objectSpread({}, keyNodesMapping[item.value]);
|
|
125
|
+
}
|
|
126
|
+
return _objectSpread({}, keyNodesMapping[item]);
|
|
112
127
|
});
|
|
113
128
|
return selectedNodes;
|
|
129
|
+
};
|
|
130
|
+
var selectedNodes = (0, _react.useMemo)(function () {
|
|
131
|
+
return getSelectedNodes(props.value);
|
|
114
132
|
}, [props.value, keyNodesMapping]);
|
|
115
133
|
(0, _react.useEffect)(function () {
|
|
116
134
|
if (size !== null && size !== void 0 && size.width) {
|
|
117
135
|
setPopWidth(size === null || size === void 0 ? void 0 : size.width);
|
|
118
136
|
}
|
|
119
137
|
}, [size === null || size === void 0 ? void 0 : size.width]);
|
|
120
|
-
|
|
121
|
-
// let suffixIconObj = {};
|
|
122
|
-
// if (multiple || treeCheckable) {
|
|
123
|
-
// suffixIconObj.suffixIcon = (
|
|
124
|
-
// <Popover
|
|
125
|
-
// content={
|
|
126
|
-
// <>
|
|
127
|
-
// <div
|
|
128
|
-
// className={classnames(`${prefixCls}-count-head`, hashId,)}
|
|
129
|
-
|
|
130
|
-
// >
|
|
131
|
-
// <span>已选择:{selectedNodes.length}</span>
|
|
132
|
-
// <span
|
|
133
|
-
// className={classnames(
|
|
134
|
-
// selectedNodes.length > 0 && !disabled
|
|
135
|
-
// ? 'clear-count'
|
|
136
|
-
// : 'disabled-count',
|
|
137
|
-
// )}
|
|
138
|
-
// onClick={e => {
|
|
139
|
-
// if (!disabled) {
|
|
140
|
-
// e.stopPropagation();
|
|
141
|
-
// clear();
|
|
142
|
-
// }
|
|
143
|
-
// }}
|
|
144
|
-
// >
|
|
145
|
-
// 清空已选项
|
|
146
|
-
// </span>
|
|
147
|
-
// </div>
|
|
148
|
-
// {selectedNodes.length > 0 ? (
|
|
149
|
-
// selectedNodes.map(item => (
|
|
150
|
-
// <Tag
|
|
151
|
-
// key={`tab-${item.id}`}
|
|
152
|
-
// closable={!disabled}
|
|
153
|
-
// onClose={e => {
|
|
154
|
-
// e.stopPropagation();
|
|
155
|
-
// clearKey(item.id);
|
|
156
|
-
// }}
|
|
157
|
-
// style={{ marginBottom: '5px' }}
|
|
158
|
-
// >
|
|
159
|
-
// {item.name && item.name.length > 20
|
|
160
|
-
// ? `${item.name.slice(0, 20)}...`
|
|
161
|
-
// : item.name}
|
|
162
|
-
// </Tag>
|
|
163
|
-
// ))
|
|
164
|
-
// ) : (
|
|
165
|
-
// <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
166
|
-
// )}
|
|
167
|
-
// </>
|
|
168
|
-
// }
|
|
169
|
-
// placement="bottomRight"
|
|
170
|
-
// trigger="click"
|
|
171
|
-
// // overlayStyle={{ width: popWidth }}
|
|
172
|
-
// styles={{ root: { width: popWidth } }}
|
|
173
|
-
// >
|
|
174
|
-
// <Button
|
|
175
|
-
// className={classnames(`${prefixCls}-count`, hashId,)}
|
|
176
|
-
|
|
177
|
-
// icon={<MoreOutlined />}
|
|
178
|
-
// size="default"
|
|
179
|
-
// onClick={e => {
|
|
180
|
-
// console.log('click', e)
|
|
181
|
-
// e.stopPropagation();
|
|
182
|
-
// }}
|
|
183
|
-
// />
|
|
184
|
-
// </Popover>
|
|
185
|
-
// );
|
|
186
|
-
// }
|
|
187
|
-
|
|
188
138
|
var popoverContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
189
139
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
190
140
|
className: (0, _classnames.default)("".concat(prefixCls, "-count-head"), hashId),
|
|
@@ -200,22 +150,33 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
200
150
|
},
|
|
201
151
|
children: intl.getMessage('treeSelect.clearSelectedItems', '清空已选项')
|
|
202
152
|
})]
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
153
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
154
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-all-list"), hashId),
|
|
155
|
+
children: selectedNodes.length > 0 ? selectedNodes.map(function (item) {
|
|
156
|
+
var _item$fieldNames$labe;
|
|
157
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tag, {
|
|
158
|
+
closable: !disabled,
|
|
159
|
+
onClose: function onClose(e) {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
clearKey(item[fieldNames.value]);
|
|
162
|
+
},
|
|
163
|
+
styles: {
|
|
164
|
+
root: {
|
|
165
|
+
marginBottom: 5,
|
|
166
|
+
marginRight: 5
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
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]
|
|
170
|
+
}, "tab-".concat(item[fieldNames.value]));
|
|
171
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Empty, {
|
|
172
|
+
image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
|
|
173
|
+
})
|
|
217
174
|
})]
|
|
218
175
|
});
|
|
176
|
+
var onChangeTreeSelect = function onChangeTreeSelect(value, label, extra) {
|
|
177
|
+
extra.list = getSelectedNodes(value);
|
|
178
|
+
onChange === null || onChange === void 0 || onChange(value, label, extra);
|
|
179
|
+
};
|
|
219
180
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
220
181
|
ref: ref,
|
|
221
182
|
style: style,
|
|
@@ -224,8 +185,10 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
224
185
|
style: {
|
|
225
186
|
width: '100%'
|
|
226
187
|
},
|
|
227
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.TreeSelect, _objectSpread({
|
|
228
|
-
showSearch:
|
|
188
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.TreeSelect, _objectSpread(_objectSpread({
|
|
189
|
+
showSearch: {
|
|
190
|
+
treeNodeFilterProp: fieldNames.label
|
|
191
|
+
},
|
|
229
192
|
placeholder: placeholder,
|
|
230
193
|
treeData: treeData,
|
|
231
194
|
treeLine: {
|
|
@@ -248,8 +211,15 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
248
211
|
popup: (0, _classnames.default)("".concat(prefixCls, "-popup"), hashId)
|
|
249
212
|
},
|
|
250
213
|
maxTagCount: "responsive",
|
|
251
|
-
treeDefaultExpandAll: true
|
|
252
|
-
|
|
214
|
+
treeDefaultExpandAll: true,
|
|
215
|
+
fieldNames: fieldNames,
|
|
216
|
+
labelInValue: _labelInValue,
|
|
217
|
+
disabled: disabled
|
|
218
|
+
}, props), {}, {
|
|
219
|
+
onChange: function onChange(value, label, extra) {
|
|
220
|
+
return onChangeTreeSelect(value, label, extra, selectedNodes);
|
|
221
|
+
}
|
|
222
|
+
})), (multiple || treeCheckable) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Popover, {
|
|
253
223
|
open: popOpen,
|
|
254
224
|
onOpenChange: setPopOpen,
|
|
255
225
|
placement: "bottomRight",
|
|
@@ -13,7 +13,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
13
13
|
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); }
|
|
14
14
|
var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
15
15
|
var componentCls = token.componentCls;
|
|
16
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
|
|
16
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
|
|
17
17
|
minWidth: '200px',
|
|
18
18
|
height: '300px',
|
|
19
19
|
overflow: 'auto',
|
|
@@ -34,14 +34,16 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
34
34
|
color: '@input-placeholder-color'
|
|
35
35
|
}), '&-count', {
|
|
36
36
|
marginRight: '-12px'
|
|
37
|
-
})), "".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', {
|
|
37
|
+
})), "".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', {
|
|
38
38
|
color: '#1890ff'
|
|
39
39
|
}), '.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-node-selected', {
|
|
40
40
|
backgroundColor: '#e6f7ff'
|
|
41
|
+
}), '.ant-select-tree .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper', {
|
|
42
|
+
flex: 1
|
|
41
43
|
}))), "".concat(componentCls, "-count-head"), {
|
|
42
44
|
display: 'flex',
|
|
43
45
|
justifyContent: 'space-between',
|
|
44
|
-
marginBottom:
|
|
46
|
+
marginBottom: 5,
|
|
45
47
|
'.disabled-count': {
|
|
46
48
|
color: '#aaa',
|
|
47
49
|
cursor: 'not-allowed'
|
|
@@ -51,6 +53,9 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
51
53
|
}, '&:hover', {
|
|
52
54
|
color: '#40a9ff'
|
|
53
55
|
})
|
|
56
|
+
}), "".concat(componentCls, "-all-list"), {
|
|
57
|
+
maxHeight: 300,
|
|
58
|
+
overflowY: "auto"
|
|
54
59
|
}), "".concat(componentCls, "-outer"), {
|
|
55
60
|
position: 'relative',
|
|
56
61
|
display: 'inline-flex',
|
|
@@ -63,6 +68,7 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
63
68
|
color: token.colorTextDescription,
|
|
64
69
|
display: 'inline-flex',
|
|
65
70
|
alignItems: 'center',
|
|
71
|
+
width: token.controlHeight,
|
|
66
72
|
'&:hover': {
|
|
67
73
|
color: token.colorPrimary
|
|
68
74
|
}
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _vtxProvider = require("../vtx-provider");
|
|
11
|
+
var _vtxModal = _interopRequireDefault(require("../vtx-modal"));
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
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); }
|
|
@@ -82,7 +83,7 @@ function Preview(props) {
|
|
|
82
83
|
timer && clearTimeout(timer);
|
|
83
84
|
onCancel();
|
|
84
85
|
};
|
|
85
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
86
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_vtxModal.default, _objectSpread(_objectSpread({}, modalProps), {}, {
|
|
86
87
|
children: [type == 'file' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("iframe", {
|
|
87
88
|
src: url,
|
|
88
89
|
style: {
|