@vtx/components 4.0.0-beta.8 → 4.0.0-beta.81
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-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +106 -137
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- 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/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +124 -32
- 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 +15 -7
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-export-async/util.js +16 -5
- 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 +16 -16
- 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 +211 -70
- package/es/vtx-import/result.js +28 -26
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +30 -19
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +37 -33
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_US.js +57 -3
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-search/index.js +13 -9
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +102 -36
- 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 +42 -34
- 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 +98 -35
- package/es/vtx-tree-select/index.js +71 -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 +93 -39
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/es/vtx-wang-editor/wangEditorUtil.js +4 -0
- 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-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +113 -143
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- 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/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +124 -32
- 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 +14 -8
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-export-async/util.js +16 -5
- 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 +16 -16
- 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 +209 -71
- package/lib/vtx-import/result.js +29 -27
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +29 -18
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +37 -33
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_US.js +57 -3
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-search/index.js +13 -9
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +104 -38
- 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 +40 -31
- 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 +96 -33
- package/lib/vtx-tree-select/index.js +71 -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 +91 -37
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/package.json +240 -225
- 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,18 +202,33 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
198
202
|
};
|
|
199
203
|
});
|
|
200
204
|
(0, _react.useEffect)(function () {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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
|
+
}
|
|
204
221
|
});
|
|
205
|
-
resizeObserver.observe(
|
|
222
|
+
resizeObserver.observe(element, {
|
|
206
223
|
box: 'border-box'
|
|
207
224
|
});
|
|
225
|
+
|
|
226
|
+
// 初始化高度
|
|
227
|
+
setHeight(element.offsetHeight);
|
|
208
228
|
return function () {
|
|
209
|
-
|
|
229
|
+
resizeObserver.disconnect();
|
|
210
230
|
};
|
|
211
|
-
}, [
|
|
212
|
-
|
|
231
|
+
}, []);
|
|
213
232
|
var onSelect = function onSelect(keys, event) {
|
|
214
233
|
var _props$onSelect;
|
|
215
234
|
var multiple = props.multiple;
|
|
@@ -257,6 +276,21 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
257
276
|
setSelectedKeys(newSelectedKeys);
|
|
258
277
|
}
|
|
259
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
|
+
};
|
|
260
294
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
261
295
|
className: (0, _classnames.default)("".concat(prefixCls, "-wraaper"), hashId),
|
|
262
296
|
children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
@@ -273,7 +307,10 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
273
307
|
ref: treeRef,
|
|
274
308
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tree, _objectSpread(_objectSpread(_objectSpread({}, props), {}, {
|
|
275
309
|
height: height,
|
|
276
|
-
switcherIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
310
|
+
switcherIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
|
|
311
|
+
type: "downOutlined",
|
|
312
|
+
fileType: "svg"
|
|
313
|
+
}),
|
|
277
314
|
showLine: {
|
|
278
315
|
showLeafIcon: false
|
|
279
316
|
},
|
|
@@ -292,28 +329,54 @@ var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
292
329
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
293
330
|
var title = nodeData[titleKey];
|
|
294
331
|
if (renderMenuList) {
|
|
295
|
-
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
|
+
}
|
|
296
372
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
297
373
|
className: (0, _classnames.default)("".concat(prefixCls, "-menu-wrap"), hashId),
|
|
298
374
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
299
375
|
children: title
|
|
300
376
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
301
377
|
className: (0, _classnames.default)("".concat(prefixCls, "-menu-list"), hashId),
|
|
302
|
-
children:
|
|
303
|
-
|
|
304
|
-
}).map(function (item) {
|
|
305
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
306
|
-
title: item.label,
|
|
307
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
308
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-menu-item-icon"), hashId),
|
|
309
|
-
onClick: function onClick(e) {
|
|
310
|
-
e.stopPropagation();
|
|
311
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
312
|
-
item.onClick && item.onClick(nodeData);
|
|
313
|
-
},
|
|
314
|
-
children: item.icon
|
|
315
|
-
})
|
|
316
|
-
}, item.label);
|
|
378
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
379
|
+
children: [arr, " "]
|
|
317
380
|
})
|
|
318
381
|
})]
|
|
319
382
|
});
|
|
@@ -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;
|
|
@@ -71,11 +82,9 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
71
82
|
}
|
|
72
83
|
(function genNodes(nodes) {
|
|
73
84
|
nodes.map(function (item) {
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
keyNodesMapping[item.value
|
|
77
|
-
id: item.value || item.key
|
|
78
|
-
});
|
|
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]));
|
|
79
88
|
if (Array.isArray(children) && children.length > 0) {
|
|
80
89
|
genNodes(children);
|
|
81
90
|
}
|
|
@@ -84,19 +93,17 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
84
93
|
return keyNodesMapping;
|
|
85
94
|
}, [treeData]);
|
|
86
95
|
var clear = function clear() {
|
|
87
|
-
|
|
88
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, [], [], {});
|
|
96
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect([], [], {});
|
|
89
97
|
};
|
|
90
98
|
var clearKey = function clearKey(id) {
|
|
91
|
-
var _props$onChange2;
|
|
92
99
|
var newValue = _toConsumableArray(props.value);
|
|
93
100
|
(0, _pull.default)(newValue, id);
|
|
94
101
|
var label = newValue.map(function (item) {
|
|
95
|
-
return keyNodesMapping[item]
|
|
102
|
+
return keyNodesMapping[item[fieldNames.label]];
|
|
96
103
|
});
|
|
97
|
-
|
|
104
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect(newValue, label, {});
|
|
98
105
|
};
|
|
99
|
-
var
|
|
106
|
+
var getSelectedNodes = function getSelectedNodes(value) {
|
|
100
107
|
var value_arr = function (val) {
|
|
101
108
|
if (Array.isArray(val)) {
|
|
102
109
|
return val;
|
|
@@ -105,90 +112,29 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
105
112
|
} else {
|
|
106
113
|
return [];
|
|
107
114
|
}
|
|
108
|
-
}(
|
|
115
|
+
}(value);
|
|
109
116
|
var selectedNodes = value_arr.filter(function (k) {
|
|
110
|
-
|
|
117
|
+
if (_labelInValue) {
|
|
118
|
+
return k.value in keyNodesMapping;
|
|
119
|
+
} else {
|
|
120
|
+
return k in keyNodesMapping;
|
|
121
|
+
}
|
|
111
122
|
}).map(function (item) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
};
|
|
123
|
+
if (_labelInValue) {
|
|
124
|
+
return _objectSpread({}, keyNodesMapping[item.value]);
|
|
125
|
+
}
|
|
126
|
+
return _objectSpread({}, keyNodesMapping[item]);
|
|
116
127
|
});
|
|
117
128
|
return selectedNodes;
|
|
129
|
+
};
|
|
130
|
+
var selectedNodes = (0, _react.useMemo)(function () {
|
|
131
|
+
return getSelectedNodes(props.value);
|
|
118
132
|
}, [props.value, keyNodesMapping]);
|
|
119
133
|
(0, _react.useEffect)(function () {
|
|
120
134
|
if (size !== null && size !== void 0 && size.width) {
|
|
121
135
|
setPopWidth(size === null || size === void 0 ? void 0 : size.width);
|
|
122
136
|
}
|
|
123
137
|
}, [size === null || size === void 0 ? void 0 : size.width]);
|
|
124
|
-
|
|
125
|
-
// let suffixIconObj = {};
|
|
126
|
-
// if (multiple || treeCheckable) {
|
|
127
|
-
// suffixIconObj.suffixIcon = (
|
|
128
|
-
// <Popover
|
|
129
|
-
// content={
|
|
130
|
-
// <>
|
|
131
|
-
// <div
|
|
132
|
-
// className={classnames(`${prefixCls}-count-head`, hashId,)}
|
|
133
|
-
|
|
134
|
-
// >
|
|
135
|
-
// <span>已选择:{selectedNodes.length}</span>
|
|
136
|
-
// <span
|
|
137
|
-
// className={classnames(
|
|
138
|
-
// selectedNodes.length > 0 && !disabled
|
|
139
|
-
// ? 'clear-count'
|
|
140
|
-
// : 'disabled-count',
|
|
141
|
-
// )}
|
|
142
|
-
// onClick={e => {
|
|
143
|
-
// if (!disabled) {
|
|
144
|
-
// e.stopPropagation();
|
|
145
|
-
// clear();
|
|
146
|
-
// }
|
|
147
|
-
// }}
|
|
148
|
-
// >
|
|
149
|
-
// 清空已选项
|
|
150
|
-
// </span>
|
|
151
|
-
// </div>
|
|
152
|
-
// {selectedNodes.length > 0 ? (
|
|
153
|
-
// selectedNodes.map(item => (
|
|
154
|
-
// <Tag
|
|
155
|
-
// key={`tab-${item.id}`}
|
|
156
|
-
// closable={!disabled}
|
|
157
|
-
// onClose={e => {
|
|
158
|
-
// e.stopPropagation();
|
|
159
|
-
// clearKey(item.id);
|
|
160
|
-
// }}
|
|
161
|
-
// style={{ marginBottom: '5px' }}
|
|
162
|
-
// >
|
|
163
|
-
// {item.name && item.name.length > 20
|
|
164
|
-
// ? `${item.name.slice(0, 20)}...`
|
|
165
|
-
// : item.name}
|
|
166
|
-
// </Tag>
|
|
167
|
-
// ))
|
|
168
|
-
// ) : (
|
|
169
|
-
// <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
170
|
-
// )}
|
|
171
|
-
// </>
|
|
172
|
-
// }
|
|
173
|
-
// placement="bottomRight"
|
|
174
|
-
// trigger="click"
|
|
175
|
-
// // overlayStyle={{ width: popWidth }}
|
|
176
|
-
// styles={{ root: { width: popWidth } }}
|
|
177
|
-
// >
|
|
178
|
-
// <Button
|
|
179
|
-
// className={classnames(`${prefixCls}-count`, hashId,)}
|
|
180
|
-
|
|
181
|
-
// icon={<MoreOutlined />}
|
|
182
|
-
// size="default"
|
|
183
|
-
// onClick={e => {
|
|
184
|
-
// console.log('click', e)
|
|
185
|
-
// e.stopPropagation();
|
|
186
|
-
// }}
|
|
187
|
-
// />
|
|
188
|
-
// </Popover>
|
|
189
|
-
// );
|
|
190
|
-
// }
|
|
191
|
-
|
|
192
138
|
var popoverContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
193
139
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
194
140
|
className: (0, _classnames.default)("".concat(prefixCls, "-count-head"), hashId),
|
|
@@ -204,22 +150,33 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
204
150
|
},
|
|
205
151
|
children: intl.getMessage('treeSelect.clearSelectedItems', '清空已选项')
|
|
206
152
|
})]
|
|
207
|
-
}),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
+
})
|
|
221
174
|
})]
|
|
222
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
|
+
};
|
|
223
180
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
224
181
|
ref: ref,
|
|
225
182
|
style: style,
|
|
@@ -228,8 +185,10 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
228
185
|
style: {
|
|
229
186
|
width: '100%'
|
|
230
187
|
},
|
|
231
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.TreeSelect, _objectSpread({
|
|
232
|
-
showSearch:
|
|
188
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.TreeSelect, _objectSpread(_objectSpread({
|
|
189
|
+
showSearch: {
|
|
190
|
+
treeNodeFilterProp: fieldNames.label
|
|
191
|
+
},
|
|
233
192
|
placeholder: placeholder,
|
|
234
193
|
treeData: treeData,
|
|
235
194
|
treeLine: {
|
|
@@ -252,8 +211,15 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
252
211
|
popup: (0, _classnames.default)("".concat(prefixCls, "-popup"), hashId)
|
|
253
212
|
},
|
|
254
213
|
maxTagCount: "responsive",
|
|
255
|
-
treeDefaultExpandAll: true
|
|
256
|
-
|
|
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, {
|
|
257
223
|
open: popOpen,
|
|
258
224
|
onOpenChange: setPopOpen,
|
|
259
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: {
|