@vtx/components 4.0.0-beta.8 → 4.0.0-beta.80
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-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 +7 -3
- 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-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 +11 -3
- 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 +207 -65
- 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 +9 -4
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +7 -3
- package/es/vtx-provider/locale/en_US.js +57 -3
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- 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/wangEditorUtil.js +4 -0
- package/lib/index.js +36 -0
- package/lib/utils/filterSpecialCharacters.js +48 -46
- package/lib/utils/index.js +0 -7
- 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 +7 -3
- 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-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 +11 -3
- 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 +205 -63
- 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 +9 -4
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +7 -3
- package/lib/vtx-provider/locale/en_US.js +57 -3
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- 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/wangEditorUtil.js +4 -0
- package/package.json +47 -32
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
|
@@ -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: {
|