@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style"]
|
|
3
|
-
_excluded2 = ["children"];
|
|
2
|
+
var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style", "fieldNames", "onChange", "labelInValue"];
|
|
4
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -10,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
13
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -38,7 +38,18 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
38
38
|
_ref$disabled = _ref.disabled,
|
|
39
39
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
40
40
|
style = _ref.style,
|
|
41
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
42
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
43
|
+
label: "title",
|
|
44
|
+
value: "value",
|
|
45
|
+
key: "value",
|
|
46
|
+
children: 'children'
|
|
47
|
+
} : _ref$fieldNames,
|
|
48
|
+
onChange = _ref.onChange,
|
|
49
|
+
labelInValue = _ref.labelInValue,
|
|
41
50
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
// checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 labelInValue 强制为 true
|
|
52
|
+
var _labelInValue = treeCheckable && props.treeCheckStrictly ? true : labelInValue;
|
|
42
53
|
var intl = useIntl();
|
|
43
54
|
var _useContext = useContext(VtxProvider),
|
|
44
55
|
getPrefixCls = _useContext.getPrefixCls;
|
|
@@ -58,13 +69,15 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
58
69
|
var size = useSize(ref);
|
|
59
70
|
var keyNodesMapping = useMemo(function () {
|
|
60
71
|
var keyNodesMapping = {};
|
|
72
|
+
// 建议:添加树数据有效性检查
|
|
73
|
+
if (!treeData || !Array.isArray(treeData)) {
|
|
74
|
+
return keyNodesMapping;
|
|
75
|
+
}
|
|
61
76
|
(function genNodes(nodes) {
|
|
62
77
|
nodes.map(function (item) {
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
keyNodesMapping[item.value
|
|
66
|
-
id: item.value || item.key
|
|
67
|
-
});
|
|
78
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(item), item));
|
|
79
|
+
var children = item[fieldNames.children];
|
|
80
|
+
keyNodesMapping[item[fieldNames.value]] = _objectSpread(_objectSpread({}, rest), {}, _defineProperty(_defineProperty({}, fieldNames.value, item[fieldNames.value]), fieldNames.label, item[fieldNames.label]));
|
|
68
81
|
if (Array.isArray(children) && children.length > 0) {
|
|
69
82
|
genNodes(children);
|
|
70
83
|
}
|
|
@@ -73,19 +86,17 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
73
86
|
return keyNodesMapping;
|
|
74
87
|
}, [treeData]);
|
|
75
88
|
var clear = function clear() {
|
|
76
|
-
|
|
77
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, [], [], {});
|
|
89
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect([], [], {});
|
|
78
90
|
};
|
|
79
91
|
var clearKey = function clearKey(id) {
|
|
80
|
-
var _props$onChange2;
|
|
81
92
|
var newValue = _toConsumableArray(props.value);
|
|
82
93
|
pull(newValue, id);
|
|
83
94
|
var label = newValue.map(function (item) {
|
|
84
|
-
return keyNodesMapping[item]
|
|
95
|
+
return keyNodesMapping[item[fieldNames.label]];
|
|
85
96
|
});
|
|
86
|
-
|
|
97
|
+
onChangeTreeSelect === null || onChangeTreeSelect === void 0 || onChangeTreeSelect(newValue, label, {});
|
|
87
98
|
};
|
|
88
|
-
var
|
|
99
|
+
var getSelectedNodes = function getSelectedNodes(value) {
|
|
89
100
|
var value_arr = function (val) {
|
|
90
101
|
if (Array.isArray(val)) {
|
|
91
102
|
return val;
|
|
@@ -94,90 +105,29 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
94
105
|
} else {
|
|
95
106
|
return [];
|
|
96
107
|
}
|
|
97
|
-
}(
|
|
108
|
+
}(value);
|
|
98
109
|
var selectedNodes = value_arr.filter(function (k) {
|
|
99
|
-
|
|
110
|
+
if (_labelInValue) {
|
|
111
|
+
return k.value in keyNodesMapping;
|
|
112
|
+
} else {
|
|
113
|
+
return k in keyNodesMapping;
|
|
114
|
+
}
|
|
100
115
|
}).map(function (item) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
116
|
+
if (_labelInValue) {
|
|
117
|
+
return _objectSpread({}, keyNodesMapping[item.value]);
|
|
118
|
+
}
|
|
119
|
+
return _objectSpread({}, keyNodesMapping[item]);
|
|
105
120
|
});
|
|
106
121
|
return selectedNodes;
|
|
122
|
+
};
|
|
123
|
+
var selectedNodes = useMemo(function () {
|
|
124
|
+
return getSelectedNodes(props.value);
|
|
107
125
|
}, [props.value, keyNodesMapping]);
|
|
108
126
|
useEffect(function () {
|
|
109
127
|
if (size !== null && size !== void 0 && size.width) {
|
|
110
128
|
setPopWidth(size === null || size === void 0 ? void 0 : size.width);
|
|
111
129
|
}
|
|
112
130
|
}, [size === null || size === void 0 ? void 0 : size.width]);
|
|
113
|
-
|
|
114
|
-
// let suffixIconObj = {};
|
|
115
|
-
// if (multiple || treeCheckable) {
|
|
116
|
-
// suffixIconObj.suffixIcon = (
|
|
117
|
-
// <Popover
|
|
118
|
-
// content={
|
|
119
|
-
// <>
|
|
120
|
-
// <div
|
|
121
|
-
// className={classnames(`${prefixCls}-count-head`, hashId,)}
|
|
122
|
-
|
|
123
|
-
// >
|
|
124
|
-
// <span>已选择:{selectedNodes.length}</span>
|
|
125
|
-
// <span
|
|
126
|
-
// className={classnames(
|
|
127
|
-
// selectedNodes.length > 0 && !disabled
|
|
128
|
-
// ? 'clear-count'
|
|
129
|
-
// : 'disabled-count',
|
|
130
|
-
// )}
|
|
131
|
-
// onClick={e => {
|
|
132
|
-
// if (!disabled) {
|
|
133
|
-
// e.stopPropagation();
|
|
134
|
-
// clear();
|
|
135
|
-
// }
|
|
136
|
-
// }}
|
|
137
|
-
// >
|
|
138
|
-
// 清空已选项
|
|
139
|
-
// </span>
|
|
140
|
-
// </div>
|
|
141
|
-
// {selectedNodes.length > 0 ? (
|
|
142
|
-
// selectedNodes.map(item => (
|
|
143
|
-
// <Tag
|
|
144
|
-
// key={`tab-${item.id}`}
|
|
145
|
-
// closable={!disabled}
|
|
146
|
-
// onClose={e => {
|
|
147
|
-
// e.stopPropagation();
|
|
148
|
-
// clearKey(item.id);
|
|
149
|
-
// }}
|
|
150
|
-
// style={{ marginBottom: '5px' }}
|
|
151
|
-
// >
|
|
152
|
-
// {item.name && item.name.length > 20
|
|
153
|
-
// ? `${item.name.slice(0, 20)}...`
|
|
154
|
-
// : item.name}
|
|
155
|
-
// </Tag>
|
|
156
|
-
// ))
|
|
157
|
-
// ) : (
|
|
158
|
-
// <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
159
|
-
// )}
|
|
160
|
-
// </>
|
|
161
|
-
// }
|
|
162
|
-
// placement="bottomRight"
|
|
163
|
-
// trigger="click"
|
|
164
|
-
// // overlayStyle={{ width: popWidth }}
|
|
165
|
-
// styles={{ root: { width: popWidth } }}
|
|
166
|
-
// >
|
|
167
|
-
// <Button
|
|
168
|
-
// className={classnames(`${prefixCls}-count`, hashId,)}
|
|
169
|
-
|
|
170
|
-
// icon={<MoreOutlined />}
|
|
171
|
-
// size="default"
|
|
172
|
-
// onClick={e => {
|
|
173
|
-
// console.log('click', e)
|
|
174
|
-
// e.stopPropagation();
|
|
175
|
-
// }}
|
|
176
|
-
// />
|
|
177
|
-
// </Popover>
|
|
178
|
-
// );
|
|
179
|
-
// }
|
|
180
|
-
|
|
181
131
|
var popoverContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
182
132
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
183
133
|
className: classnames("".concat(prefixCls, "-count-head"), hashId),
|
|
@@ -193,22 +143,33 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
193
143
|
},
|
|
194
144
|
children: intl.getMessage('treeSelect.clearSelectedItems', '清空已选项')
|
|
195
145
|
})]
|
|
196
|
-
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
146
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
147
|
+
className: classnames("".concat(prefixCls, "-all-list"), hashId),
|
|
148
|
+
children: selectedNodes.length > 0 ? selectedNodes.map(function (item) {
|
|
149
|
+
var _item$fieldNames$labe;
|
|
150
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
151
|
+
closable: !disabled,
|
|
152
|
+
onClose: function onClose(e) {
|
|
153
|
+
e.stopPropagation();
|
|
154
|
+
clearKey(item[fieldNames.value]);
|
|
155
|
+
},
|
|
156
|
+
styles: {
|
|
157
|
+
root: {
|
|
158
|
+
marginBottom: 5,
|
|
159
|
+
marginRight: 5
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
children: ((_item$fieldNames$labe = item[fieldNames.label]) === null || _item$fieldNames$labe === void 0 ? void 0 : _item$fieldNames$labe.length) > 20 ? "".concat(item[fieldNames.label].slice(0, 20), "...") : item[fieldNames.label]
|
|
163
|
+
}, "tab-".concat(item[fieldNames.value]));
|
|
164
|
+
}) : /*#__PURE__*/_jsx(Empty, {
|
|
165
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
166
|
+
})
|
|
210
167
|
})]
|
|
211
168
|
});
|
|
169
|
+
var onChangeTreeSelect = function onChangeTreeSelect(value, label, extra) {
|
|
170
|
+
extra.list = getSelectedNodes(value);
|
|
171
|
+
onChange === null || onChange === void 0 || onChange(value, label, extra);
|
|
172
|
+
};
|
|
212
173
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
213
174
|
ref: ref,
|
|
214
175
|
style: style,
|
|
@@ -217,8 +178,10 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
217
178
|
style: {
|
|
218
179
|
width: '100%'
|
|
219
180
|
},
|
|
220
|
-
children: [/*#__PURE__*/_jsx(TreeSelect, _objectSpread({
|
|
221
|
-
showSearch:
|
|
181
|
+
children: [/*#__PURE__*/_jsx(TreeSelect, _objectSpread(_objectSpread({
|
|
182
|
+
showSearch: {
|
|
183
|
+
treeNodeFilterProp: fieldNames.label
|
|
184
|
+
},
|
|
222
185
|
placeholder: placeholder,
|
|
223
186
|
treeData: treeData,
|
|
224
187
|
treeLine: {
|
|
@@ -241,8 +204,15 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
|
|
|
241
204
|
popup: classnames("".concat(prefixCls, "-popup"), hashId)
|
|
242
205
|
},
|
|
243
206
|
maxTagCount: "responsive",
|
|
244
|
-
treeDefaultExpandAll: true
|
|
245
|
-
|
|
207
|
+
treeDefaultExpandAll: true,
|
|
208
|
+
fieldNames: fieldNames,
|
|
209
|
+
labelInValue: _labelInValue,
|
|
210
|
+
disabled: disabled
|
|
211
|
+
}, props), {}, {
|
|
212
|
+
onChange: function onChange(value, label, extra) {
|
|
213
|
+
return onChangeTreeSelect(value, label, extra, selectedNodes);
|
|
214
|
+
}
|
|
215
|
+
})), (multiple || treeCheckable) && /*#__PURE__*/_jsx(Popover, {
|
|
246
216
|
open: popOpen,
|
|
247
217
|
onOpenChange: setPopOpen,
|
|
248
218
|
placement: "bottomRight",
|
|
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
8
|
var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
9
9
|
var componentCls = token.componentCls;
|
|
10
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
|
|
10
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
|
|
11
11
|
minWidth: '200px',
|
|
12
12
|
height: '300px',
|
|
13
13
|
overflow: 'auto',
|
|
@@ -28,14 +28,16 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
28
28
|
color: '@input-placeholder-color'
|
|
29
29
|
}), '&-count', {
|
|
30
30
|
marginRight: '-12px'
|
|
31
|
-
})), "".concat(componentCls, "-popup"), _defineProperty({}, '&', _defineProperty(_defineProperty({}, '.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title', {
|
|
31
|
+
})), "".concat(componentCls, "-popup"), _defineProperty({}, '&', _defineProperty(_defineProperty(_defineProperty({}, '.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title', {
|
|
32
32
|
color: '#1890ff'
|
|
33
33
|
}), '.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-node-selected', {
|
|
34
34
|
backgroundColor: '#e6f7ff'
|
|
35
|
+
}), '.ant-select-tree .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper', {
|
|
36
|
+
flex: 1
|
|
35
37
|
}))), "".concat(componentCls, "-count-head"), {
|
|
36
38
|
display: 'flex',
|
|
37
39
|
justifyContent: 'space-between',
|
|
38
|
-
marginBottom:
|
|
40
|
+
marginBottom: 5,
|
|
39
41
|
'.disabled-count': {
|
|
40
42
|
color: '#aaa',
|
|
41
43
|
cursor: 'not-allowed'
|
|
@@ -45,6 +47,9 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
45
47
|
}, '&:hover', {
|
|
46
48
|
color: '#40a9ff'
|
|
47
49
|
})
|
|
50
|
+
}), "".concat(componentCls, "-all-list"), {
|
|
51
|
+
maxHeight: 300,
|
|
52
|
+
overflowY: "auto"
|
|
48
53
|
}), "".concat(componentCls, "-outer"), {
|
|
49
54
|
position: 'relative',
|
|
50
55
|
display: 'inline-flex',
|
|
@@ -57,6 +62,7 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
|
|
|
57
62
|
color: token.colorTextDescription,
|
|
58
63
|
display: 'inline-flex',
|
|
59
64
|
alignItems: 'center',
|
|
65
|
+
width: token.controlHeight,
|
|
60
66
|
'&:hover': {
|
|
61
67
|
color: token.colorPrimary
|
|
62
68
|
}
|
|
@@ -10,6 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
// import { volume, playbackRate } from 'xgplayer/dist/controls';
|
|
11
11
|
import { Modal, Button } from 'antd';
|
|
12
12
|
import { VtxProvider, useIntl } from "../vtx-provider";
|
|
13
|
+
import VtxModal from "../vtx-modal";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
function Preview(props) {
|
|
@@ -77,7 +78,7 @@ function Preview(props) {
|
|
|
77
78
|
timer && clearTimeout(timer);
|
|
78
79
|
onCancel();
|
|
79
80
|
};
|
|
80
|
-
return /*#__PURE__*/_jsxs(
|
|
81
|
+
return /*#__PURE__*/_jsxs(VtxModal, _objectSpread(_objectSpread({}, modalProps), {}, {
|
|
81
82
|
children: [type == 'file' ? /*#__PURE__*/_jsx("iframe", {
|
|
82
83
|
src: url,
|
|
83
84
|
style: {
|