@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
|
@@ -5,6 +5,25 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
5
5
|
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; } } }; }
|
|
6
6
|
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); }
|
|
7
7
|
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; }
|
|
8
|
+
import DOMPurify from 'dompurify';
|
|
9
|
+
|
|
10
|
+
// 添加HTML安全过滤函数
|
|
11
|
+
export function sanitizeHtml(html) {
|
|
12
|
+
if (!html) return '';
|
|
13
|
+
|
|
14
|
+
// 配置DOMPurify白名单
|
|
15
|
+
var config = {
|
|
16
|
+
ALLOWED_TAGS: ['p', 'br', 'strong', 'em', 'u', 's', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'span', 'div', 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'img', 'a', 'figure', 'figcaption'],
|
|
17
|
+
ALLOWED_ATTR: ['href', 'src', 'alt', 'title', 'class', 'style', 'width', 'height', 'target', 'rel', 'align', 'valign', 'colspan', 'rowspan', 'download'],
|
|
18
|
+
// 关键:允许所有data-*属性
|
|
19
|
+
ADD_ATTR: ['data-*'],
|
|
20
|
+
// 或者使用:
|
|
21
|
+
ALLOW_DATA_ATTR: true,
|
|
22
|
+
FORBID_PROTOCOLS: ['javascript:', 'data:', 'vbscript:'],
|
|
23
|
+
KEEP_CONTENT: true
|
|
24
|
+
};
|
|
25
|
+
return DOMPurify.sanitize(html, config);
|
|
26
|
+
}
|
|
8
27
|
export function replaceAllSpanFontSize(htmlData) {
|
|
9
28
|
var spanReg = /\<span([\s\S]+?)\<\/span\>/g;
|
|
10
29
|
var fontReg = /\<font([\s\S]+?)\<\/font\>/g;
|
|
@@ -132,6 +151,8 @@ export function extractImageDataFromRtf(rtfData) {
|
|
|
132
151
|
export function replaceImagesFileSourceWithInlineRepresentation(_x, _x2, _x3) {
|
|
133
152
|
return _replaceImagesFileSourceWithInlineRepresentation.apply(this, arguments);
|
|
134
153
|
}
|
|
154
|
+
|
|
155
|
+
// 验证base64数据有效性
|
|
135
156
|
function _replaceImagesFileSourceWithInlineRepresentation() {
|
|
136
157
|
_replaceImagesFileSourceWithInlineRepresentation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(htmlData, imageSrcs, imagesHexSources) {
|
|
137
158
|
var isBase64Data,
|
|
@@ -161,42 +182,53 @@ function _replaceImagesFileSourceWithInlineRepresentation() {
|
|
|
161
182
|
uploadUrl = _args.length > 4 ? _args[4] : undefined;
|
|
162
183
|
downloadUrl = _args.length > 5 ? _args[5] : undefined;
|
|
163
184
|
if (!(imageSrcs.length === imagesHexSources.length)) {
|
|
164
|
-
_context.next =
|
|
185
|
+
_context.next = 26;
|
|
165
186
|
break;
|
|
166
187
|
}
|
|
167
188
|
i = 0;
|
|
168
189
|
case 5:
|
|
169
190
|
if (!(i < imageSrcs.length)) {
|
|
170
|
-
_context.next =
|
|
191
|
+
_context.next = 26;
|
|
171
192
|
break;
|
|
172
193
|
}
|
|
173
194
|
url = imageSrcs === null || imageSrcs === void 0 || (_imageSrcs$i = imageSrcs[i]) === null || _imageSrcs$i === void 0 ? void 0 : _imageSrcs$i.url;
|
|
174
195
|
width = imageSrcs === null || imageSrcs === void 0 || (_imageSrcs$i2 = imageSrcs[i]) === null || _imageSrcs$i2 === void 0 ? void 0 : _imageSrcs$i2.width;
|
|
175
196
|
height = imageSrcs === null || imageSrcs === void 0 || (_imageSrcs$i3 = imageSrcs[i]) === null || _imageSrcs$i3 === void 0 ? void 0 : _imageSrcs$i3.height;
|
|
176
197
|
img = imageSrcs === null || imageSrcs === void 0 || (_imageSrcs$i4 = imageSrcs[i]) === null || _imageSrcs$i4 === void 0 ? void 0 : _imageSrcs$i4.img;
|
|
177
|
-
newSrc = isBase64Data ? "data:".concat(imagesHexSources[i].type, ";base64,").concat(_convertHexToBase64(imagesHexSources[i].hex)) : imagesHexSources[i];
|
|
198
|
+
newSrc = isBase64Data ? "data:".concat(imagesHexSources[i].type, ";base64,").concat(_convertHexToBase64(imagesHexSources[i].hex)) : imagesHexSources[i]; // 安全检查:验证base64数据的有效性
|
|
199
|
+
if (isValidBase64(newSrc)) {
|
|
200
|
+
_context.next = 14;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
console.warn('Invalid base64 image data detected, skipping...');
|
|
204
|
+
return _context.abrupt("continue", 23);
|
|
205
|
+
case 14:
|
|
178
206
|
formData = new FormData();
|
|
179
207
|
blob = convertBase64UrlToBlob(newSrc);
|
|
180
208
|
imgName = ((_url$split = url.split('\\')) === null || _url$split === void 0 || (_url$split = _url$split.slice(-1)) === null || _url$split === void 0 ? void 0 : _url$split[0]) || 'image.jpg';
|
|
181
209
|
file = new File([blob], imgName);
|
|
182
210
|
formData.append('file', file);
|
|
183
|
-
_context.next =
|
|
211
|
+
_context.next = 21;
|
|
184
212
|
return window.fetch(uploadUrl, {
|
|
185
213
|
method: 'POST',
|
|
214
|
+
headers: {
|
|
215
|
+
access_token: getToken(),
|
|
216
|
+
Authorization: 'Bearer ' + getToken()
|
|
217
|
+
},
|
|
186
218
|
body: formData
|
|
187
219
|
}).then(function (response) {
|
|
188
220
|
return response.json();
|
|
189
221
|
});
|
|
190
|
-
case
|
|
222
|
+
case 21:
|
|
191
223
|
res = _context.sent;
|
|
192
|
-
htmlData = htmlData.replace(img, "<img src=\"".concat(downloadUrl).concat(res.data[0].id, "\" style=\"width:").concat(width, "px;height:").concat(height, "px\""));
|
|
193
|
-
case
|
|
224
|
+
htmlData = htmlData.replace(img, "<img src=\"".concat(downloadUrl).concat(res.data[0].id, "\" style=\"width:").concat(width, "px;height:").concat(height, "px\" alt=\"").concat(res.data[0].fileName || imgName, "\" />"));
|
|
225
|
+
case 23:
|
|
194
226
|
i++;
|
|
195
227
|
_context.next = 5;
|
|
196
228
|
break;
|
|
197
|
-
case
|
|
229
|
+
case 26:
|
|
198
230
|
return _context.abrupt("return", htmlData);
|
|
199
|
-
case
|
|
231
|
+
case 27:
|
|
200
232
|
case "end":
|
|
201
233
|
return _context.stop();
|
|
202
234
|
}
|
|
@@ -204,6 +236,24 @@ function _replaceImagesFileSourceWithInlineRepresentation() {
|
|
|
204
236
|
}));
|
|
205
237
|
return _replaceImagesFileSourceWithInlineRepresentation.apply(this, arguments);
|
|
206
238
|
}
|
|
239
|
+
function isValidBase64(str) {
|
|
240
|
+
try {
|
|
241
|
+
// 检查是否包含有效的base64前缀
|
|
242
|
+
if (!str.startsWith('data:image/')) {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// 检查base64编码的有效性
|
|
247
|
+
var base64Part = str.split(',')[1];
|
|
248
|
+
if (!base64Part) return false;
|
|
249
|
+
|
|
250
|
+
// 尝试解码验证
|
|
251
|
+
atob(base64Part);
|
|
252
|
+
return true;
|
|
253
|
+
} catch (e) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
207
257
|
function _convertHexToBase64(hexString) {
|
|
208
258
|
return btoa(hexString.match(/\w{2}/g).map(function (char) {
|
|
209
259
|
return String.fromCharCode(parseInt(char, 16));
|
package/lib/index.js
CHANGED
|
@@ -253,6 +253,18 @@ Object.keys(_vtxSignature).forEach(function (key) {
|
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
});
|
|
256
|
+
var _vtxTransferSelect = require("./vtx-transfer-select");
|
|
257
|
+
Object.keys(_vtxTransferSelect).forEach(function (key) {
|
|
258
|
+
if (key === "default" || key === "__esModule") return;
|
|
259
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
260
|
+
if (key in exports && exports[key] === _vtxTransferSelect[key]) return;
|
|
261
|
+
Object.defineProperty(exports, key, {
|
|
262
|
+
enumerable: true,
|
|
263
|
+
get: function get() {
|
|
264
|
+
return _vtxTransferSelect[key];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
});
|
|
256
268
|
var _vtxDatagrid = require("./vtx-datagrid");
|
|
257
269
|
Object.keys(_vtxDatagrid).forEach(function (key) {
|
|
258
270
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -325,6 +337,18 @@ Object.keys(_vtxTree).forEach(function (key) {
|
|
|
325
337
|
}
|
|
326
338
|
});
|
|
327
339
|
});
|
|
340
|
+
var _vtxTransfer = require("./vtx-transfer");
|
|
341
|
+
Object.keys(_vtxTransfer).forEach(function (key) {
|
|
342
|
+
if (key === "default" || key === "__esModule") return;
|
|
343
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
344
|
+
if (key in exports && exports[key] === _vtxTransfer[key]) return;
|
|
345
|
+
Object.defineProperty(exports, key, {
|
|
346
|
+
enumerable: true,
|
|
347
|
+
get: function get() {
|
|
348
|
+
return _vtxTransfer[key];
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
});
|
|
328
352
|
var _vtxSplitPane = require("./vtx-split-pane");
|
|
329
353
|
Object.keys(_vtxSplitPane).forEach(function (key) {
|
|
330
354
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -349,6 +373,18 @@ Object.keys(_vtxIcon).forEach(function (key) {
|
|
|
349
373
|
}
|
|
350
374
|
});
|
|
351
375
|
});
|
|
376
|
+
var _vtxDescriptions = require("./vtx-descriptions");
|
|
377
|
+
Object.keys(_vtxDescriptions).forEach(function (key) {
|
|
378
|
+
if (key === "default" || key === "__esModule") return;
|
|
379
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
380
|
+
if (key in exports && exports[key] === _vtxDescriptions[key]) return;
|
|
381
|
+
Object.defineProperty(exports, key, {
|
|
382
|
+
enumerable: true,
|
|
383
|
+
get: function get() {
|
|
384
|
+
return _vtxDescriptions[key];
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
});
|
|
352
388
|
var _vtxModal = require("./vtx-modal");
|
|
353
389
|
Object.keys(_vtxModal).forEach(function (key) {
|
|
354
390
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.SpecialCharacters = void 0;
|
|
6
7
|
exports.default = filterSpecialCharacters;
|
|
7
8
|
var _difference = _interopRequireDefault(require("lodash-es/difference"));
|
|
8
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -16,6 +17,52 @@ function isNotEmpty(value) {
|
|
|
16
17
|
return Array.isArray(value) && value.length > 0;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
// 特殊符号,- _ 排除
|
|
21
|
+
var SpecialCharacters = exports.SpecialCharacters = [
|
|
22
|
+
// 小括号
|
|
23
|
+
'(', ')', '(', ')',
|
|
24
|
+
// 中括号
|
|
25
|
+
'\\[', '\\]', '[', ']',
|
|
26
|
+
// 大括号
|
|
27
|
+
'{', '}', '{', '}',
|
|
28
|
+
// 方头括号
|
|
29
|
+
'【', '】',
|
|
30
|
+
// 尖括号
|
|
31
|
+
'<', '>',
|
|
32
|
+
// 书名号
|
|
33
|
+
'《', '》',
|
|
34
|
+
// 斜杠
|
|
35
|
+
'/',
|
|
36
|
+
// 反斜杠
|
|
37
|
+
'\\\\',
|
|
38
|
+
// 逗号
|
|
39
|
+
',', ',',
|
|
40
|
+
// 句号
|
|
41
|
+
'.', '。',
|
|
42
|
+
// 冒号
|
|
43
|
+
':', ':',
|
|
44
|
+
// 分号
|
|
45
|
+
';', ';',
|
|
46
|
+
// 顿号
|
|
47
|
+
'、',
|
|
48
|
+
// 破折号
|
|
49
|
+
'——',
|
|
50
|
+
// 感叹号
|
|
51
|
+
'!', '!',
|
|
52
|
+
// 问号
|
|
53
|
+
'?', '?',
|
|
54
|
+
// 加减等于
|
|
55
|
+
'+', '=',
|
|
56
|
+
// 单引号
|
|
57
|
+
"'", '‘', '’',
|
|
58
|
+
// 双引号
|
|
59
|
+
'"', '“', '”',
|
|
60
|
+
// 金钱
|
|
61
|
+
'$', '¥',
|
|
62
|
+
// 百分号
|
|
63
|
+
'%', '%',
|
|
64
|
+
// 其它
|
|
65
|
+
'@', '#', '`', '~', '*', '^', '……', '|', '&'];
|
|
19
66
|
/**
|
|
20
67
|
* 过滤特殊字符
|
|
21
68
|
* @param {String} value 值
|
|
@@ -29,52 +76,7 @@ function filterSpecialCharacters(value) {
|
|
|
29
76
|
include = _ref$include === void 0 ? [] : _ref$include,
|
|
30
77
|
_ref$exclude = _ref.exclude,
|
|
31
78
|
exclude = _ref$exclude === void 0 ? [] : _ref$exclude;
|
|
32
|
-
|
|
33
|
-
var specialCharacter = [
|
|
34
|
-
// 小括号
|
|
35
|
-
'(', ')', '(', ')',
|
|
36
|
-
// 中括号
|
|
37
|
-
'\\[', '\\]', '[', ']',
|
|
38
|
-
// 大括号
|
|
39
|
-
'{', '}', '{', '}',
|
|
40
|
-
// 方头括号
|
|
41
|
-
'【', '】',
|
|
42
|
-
// 尖括号
|
|
43
|
-
'<', '>',
|
|
44
|
-
// 书名号
|
|
45
|
-
'《', '》',
|
|
46
|
-
// 斜杠
|
|
47
|
-
'/',
|
|
48
|
-
// 反斜杠
|
|
49
|
-
'\\\\',
|
|
50
|
-
// 逗号
|
|
51
|
-
',', ',',
|
|
52
|
-
// 句号
|
|
53
|
-
'.', '。',
|
|
54
|
-
// 冒号
|
|
55
|
-
':', ':',
|
|
56
|
-
// 分号
|
|
57
|
-
';', ';',
|
|
58
|
-
// 顿号
|
|
59
|
-
'、',
|
|
60
|
-
// 破折号
|
|
61
|
-
'——',
|
|
62
|
-
// 感叹号
|
|
63
|
-
'!', '!',
|
|
64
|
-
// 问号
|
|
65
|
-
'?', '?',
|
|
66
|
-
// 加减等于
|
|
67
|
-
'+', '=',
|
|
68
|
-
// 单引号
|
|
69
|
-
"'", '‘', '’',
|
|
70
|
-
// 双引号
|
|
71
|
-
'"', '“', '”',
|
|
72
|
-
// 金钱
|
|
73
|
-
'$', '¥',
|
|
74
|
-
// 百分号
|
|
75
|
-
'%', '%',
|
|
76
|
-
// 其它
|
|
77
|
-
'@', '#', '`', '~', '*', '^', '……', '|', '&'];
|
|
79
|
+
var specialCharacter = JSON.parse(JSON.stringify(SpecialCharacters));
|
|
78
80
|
|
|
79
81
|
// 新增
|
|
80
82
|
if (isNotEmpty(include)) {
|
package/lib/utils/index.js
CHANGED
|
@@ -333,12 +333,6 @@ Object.defineProperty(exports, "useEditableMap", {
|
|
|
333
333
|
return _useEditableMap.useEditableMap;
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
|
-
Object.defineProperty(exports, "useFetchData", {
|
|
337
|
-
enumerable: true,
|
|
338
|
-
get: function get() {
|
|
339
|
-
return _useFetchData.useFetchData;
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
336
|
Object.defineProperty(exports, "useLatest", {
|
|
343
337
|
enumerable: true,
|
|
344
338
|
get: function get() {
|
|
@@ -398,7 +392,6 @@ var _useDebounceValue = require("./hooks/useDebounceValue");
|
|
|
398
392
|
var _useDeepCompareEffect = require("./hooks/useDeepCompareEffect");
|
|
399
393
|
var _useDeepCompareMemo = _interopRequireDefault(require("./hooks/useDeepCompareMemo"));
|
|
400
394
|
var _useDocumentTitle = require("./hooks/useDocumentTitle");
|
|
401
|
-
var _useFetchData = require("./hooks/useFetchData");
|
|
402
395
|
var _useLatest = require("./hooks/useLatest");
|
|
403
396
|
var _usePrevious = require("./hooks/usePrevious");
|
|
404
397
|
var _useReactiveRef = require("./hooks/useReactiveRef");
|
|
@@ -5,73 +5,178 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.VtxColorPicker = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _antd = require("antd");
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _style = require("./style");
|
|
12
13
|
var _utils = require("../utils");
|
|
14
|
+
var _vtxProvider = require("../vtx-provider");
|
|
13
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["value", "onChange", "className", "style", "disabled"];
|
|
16
|
+
var _excluded = ["value", "onChange", "className", "style", "disabled", "format", "input", "panelStyle"];
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
18
|
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); }
|
|
16
19
|
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; }
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
22
|
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; }
|
|
21
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
24
|
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); }
|
|
23
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
24
|
-
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."); }
|
|
25
|
-
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); }
|
|
26
|
-
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; }
|
|
27
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
28
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
25
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
30
26
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
27
|
var VtxColorPicker = exports.VtxColorPicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
28
|
+
var intl = (0, _vtxProvider.useIntl)();
|
|
32
29
|
var value = props.value,
|
|
33
|
-
|
|
30
|
+
_onChange = props.onChange,
|
|
34
31
|
className = props.className,
|
|
35
32
|
style = props.style,
|
|
36
33
|
disabled = props.disabled,
|
|
34
|
+
_props$format = props.format,
|
|
35
|
+
format = _props$format === void 0 ? 'hex' : _props$format,
|
|
36
|
+
_props$input = props.input,
|
|
37
|
+
input = _props$input === void 0 ? true : _props$input,
|
|
38
|
+
panelStyle = props.panelStyle,
|
|
37
39
|
rest = _objectWithoutProperties(props, _excluded);
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
var
|
|
40
|
+
var getVtxPresets = function getVtxPresets() {
|
|
41
|
+
return [{
|
|
42
|
+
label: intl.getMessage('colorPicker.basic', '基础颜色'),
|
|
43
|
+
key: 'basic',
|
|
44
|
+
colors: ['#0EBF37', '#1890FF', '#FAAD14', '#FF4D4F', '#898989', '#13C2C2', '#FA8C16', '#722ED1', '#EB2F96', '#2F54EB']
|
|
45
|
+
}, {
|
|
46
|
+
label: intl.getMessage('colorPicker.chart', '图表颜色'),
|
|
47
|
+
key: 'chart',
|
|
48
|
+
colors: ['#249AF8', '#1FC678', '#FFB737', '#4ABEFF', '#FD6865', '#A09CF7', '#1BCEBF', '#F58E44', '#27AD8E', '#F18F86', '#7996FF', '#5AD8A6', '#E9C140', '#79C2E6', '#FF9E9E', '#D396DE', '#3CBDCB', '#F29F64', '#85ACD7', '#FDA3C7']
|
|
49
|
+
}];
|
|
50
|
+
};
|
|
51
|
+
var getNormalPresets = function getNormalPresets() {
|
|
52
|
+
return [{
|
|
53
|
+
label: '',
|
|
54
|
+
key: '1',
|
|
55
|
+
colors: ['#F5222D', '#FA8C16', '#FAAD14', '#52C41A', '#389E0D', '#CF1322', '#1677FF', '#5B83FB', '#9254DE', '#5D7092']
|
|
56
|
+
}];
|
|
57
|
+
};
|
|
58
|
+
var getHorizontalPresets = function getHorizontalPresets(token) {
|
|
59
|
+
return [{
|
|
60
|
+
label: intl.getMessage('colorPicker.primary', '主要'),
|
|
61
|
+
key: '主要',
|
|
62
|
+
colors: ['#E6F4FF', '#BAE0FF', '#91CAFF', '#69B1FF', '#4096FF', '#1677FF', '#0958D9', '#003EB3', '#002C8C', '#001D66']
|
|
63
|
+
}, {
|
|
64
|
+
label: intl.getMessage('colorPicker.danger', '红色'),
|
|
65
|
+
key: '红色',
|
|
66
|
+
colors: ['#FFF1F0', '#FFCCC7', '#FFA39E', '#FF7875', '#FF4D4F', '#F5222D', '#CF1322', '#A8071A', '#820014', '#5C0011']
|
|
67
|
+
}, {
|
|
68
|
+
label: intl.getMessage('colorPicker.success', '绿色'),
|
|
69
|
+
key: '绿色',
|
|
70
|
+
colors: ['#F6FFED', '#D9F7BE', '#B7EB8F', '#95DE64', '#73D13D', '#52C41A', '#389E0D', '#237804', '#135200', '#092B00']
|
|
71
|
+
}, {
|
|
72
|
+
label: intl.getMessage('colorPicker.info', '青色'),
|
|
73
|
+
key: '青色',
|
|
74
|
+
colors: ['#E6FFFB', '#B5F5EC', '#87E8DE', '#5CDBD3', '#36CFC9', '#13C2C2', '#08979C', '#006D75', '#00474F', '#002329']
|
|
75
|
+
}];
|
|
76
|
+
};
|
|
77
|
+
var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
|
|
50
78
|
getPrefixCls = _useContext.getPrefixCls;
|
|
51
|
-
var prefixCls = getPrefixCls('
|
|
52
|
-
var _useStyle = (0,
|
|
79
|
+
var prefixCls = getPrefixCls('color-picker', props.prefixCls);
|
|
80
|
+
var _useStyle = (0, _style.useStyle)(prefixCls),
|
|
53
81
|
wrapSSR = _useStyle.wrapSSR,
|
|
54
82
|
hashId = _useStyle.hashId;
|
|
83
|
+
var getChangeFun = (0, _react.useCallback)(function () {
|
|
84
|
+
switch (format) {
|
|
85
|
+
case 'hsb':
|
|
86
|
+
return 'toHsbString';
|
|
87
|
+
case 'rgb':
|
|
88
|
+
return 'toRgbString';
|
|
89
|
+
default:
|
|
90
|
+
return 'toHexString';
|
|
91
|
+
}
|
|
92
|
+
}, [format]);
|
|
93
|
+
var horizontalPanelRender = function horizontalPanelRender(_, _ref) {
|
|
94
|
+
var _ref$components = _ref.components,
|
|
95
|
+
Picker = _ref$components.Picker,
|
|
96
|
+
Presets = _ref$components.Presets;
|
|
97
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
98
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-horizontal")),
|
|
99
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Presets, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
100
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Picker, {})
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
var verticalPanelRender = function verticalPanelRender(_, _ref2) {
|
|
105
|
+
var _ref2$components = _ref2.components,
|
|
106
|
+
Picker = _ref2$components.Picker,
|
|
107
|
+
Presets = _ref2$components.Presets;
|
|
108
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
109
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-vertical")),
|
|
110
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Picker, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Presets, {})]
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
var panelStyleProps = _objectSpread(_objectSpread(_objectSpread({}, panelStyle === 'vtx' ? {
|
|
114
|
+
presets: getVtxPresets(),
|
|
115
|
+
styles: {
|
|
116
|
+
popupOverlayInner: {
|
|
117
|
+
width: 460
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
panelRender: horizontalPanelRender
|
|
121
|
+
} : {}), panelStyle === 'normal' ? {
|
|
122
|
+
presets: getNormalPresets(),
|
|
123
|
+
styles: {
|
|
124
|
+
popupOverlayInner: {
|
|
125
|
+
width: 258
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
panelRender: verticalPanelRender
|
|
129
|
+
} : {}), panelStyle === 'horizontal' ? {
|
|
130
|
+
presets: getHorizontalPresets(),
|
|
131
|
+
styles: {
|
|
132
|
+
popupOverlayInner: {
|
|
133
|
+
width: 504
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
panelRender: horizontalPanelRender
|
|
137
|
+
} : {});
|
|
55
138
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
|
56
139
|
style: {
|
|
57
140
|
width: '100%'
|
|
58
141
|
},
|
|
59
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
142
|
+
children: [input && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
60
143
|
ref: ref,
|
|
61
|
-
value:
|
|
144
|
+
value: value,
|
|
62
145
|
placeholder: (0, _utils.getPlaceholder)(props.placeholder),
|
|
63
146
|
readOnly: true,
|
|
64
147
|
disabled: disabled,
|
|
65
|
-
className: (0, _classnames.default)(prefixCls,
|
|
148
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-input"), hashId),
|
|
66
149
|
style: style
|
|
67
|
-
}),
|
|
150
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ColorPicker, _objectSpread(_objectSpread({
|
|
68
151
|
animation: "slide-up",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
onChange:
|
|
72
|
-
|
|
73
|
-
|
|
152
|
+
allowClear: true,
|
|
153
|
+
className: (0, _classnames.default)(prefixCls, className, hashId),
|
|
154
|
+
onChange: function onChange(e, css) {
|
|
155
|
+
var _e$colors;
|
|
156
|
+
var res = undefined;
|
|
157
|
+
if (((_e$colors = e.colors) === null || _e$colors === void 0 ? void 0 : _e$colors.length) > 1) {
|
|
158
|
+
res = e === null || e === void 0 ? void 0 : e.toCssString();
|
|
159
|
+
} else {
|
|
160
|
+
var _e$getChangeFun;
|
|
161
|
+
res = e === null || e === void 0 || (_e$getChangeFun = e[getChangeFun(format)]) === null || _e$getChangeFun === void 0 ? void 0 : _e$getChangeFun.call(e);
|
|
162
|
+
}
|
|
163
|
+
if (e.cleared) {
|
|
164
|
+
res = undefined;
|
|
165
|
+
}
|
|
166
|
+
_onChange === null || _onChange === void 0 || _onChange(res, css);
|
|
167
|
+
},
|
|
168
|
+
value: value,
|
|
169
|
+
disabled: disabled
|
|
170
|
+
}, panelStyleProps), rest))]
|
|
74
171
|
}));
|
|
75
172
|
});
|
|
76
173
|
VtxColorPicker.displayName = 'VtxColorPicker';
|
|
174
|
+
VtxColorPicker.propTypes = {
|
|
175
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
176
|
+
onChange: _propTypes.default.func,
|
|
177
|
+
className: _propTypes.default.string,
|
|
178
|
+
style: _propTypes.default.object,
|
|
179
|
+
disabled: _propTypes.default.bool,
|
|
180
|
+
placeholder: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node])
|
|
181
|
+
};
|
|
77
182
|
var _default = exports.default = VtxColorPicker;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useStyle = useStyle;
|
|
7
|
-
require("rc-color-picker/assets/index.css");
|
|
8
7
|
var _vtxProvider = require("../../vtx-provider");
|
|
9
8
|
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); }
|
|
10
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -14,17 +13,42 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
14
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); }
|
|
15
14
|
var genVtxColorPickerStyle = function genVtxColorPickerStyle(token) {
|
|
16
15
|
var componentCls = token.componentCls;
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
return {
|
|
17
|
+
'.ant-color-picker-inner': _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty({}, "&-vertical, &-horizontal", {
|
|
18
|
+
'.ant-color-picker-presets': {
|
|
19
|
+
paddingTop: 4,
|
|
20
|
+
'.ant-color-picker-presets-items': {
|
|
21
|
+
'.ant-color-picker-presets-color': {
|
|
22
|
+
width: 18,
|
|
23
|
+
height: 18,
|
|
24
|
+
'&::before': {
|
|
25
|
+
width: "calc(18px + var(--ant-line-width) * 4)",
|
|
26
|
+
height: "calc(18px + var(--ant-line-width) * 4)"
|
|
27
|
+
},
|
|
28
|
+
'&::affter': {
|
|
29
|
+
width: "calc(18px / 13 * 5)",
|
|
30
|
+
height: "calc(18px / 13 * 8)"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}), "&-vertical", {
|
|
36
|
+
'.ant-collapse-header': {
|
|
37
|
+
display: 'none'
|
|
38
|
+
}
|
|
39
|
+
}), "&-horizontal", {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
gap: 12,
|
|
42
|
+
'.ant-color-picker-presets': {
|
|
43
|
+
flex: 1
|
|
44
|
+
},
|
|
45
|
+
'>div': {
|
|
46
|
+
display: 'flex',
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
width: 234
|
|
49
|
+
}
|
|
50
|
+
}))
|
|
51
|
+
};
|
|
28
52
|
};
|
|
29
53
|
function useStyle(prefixCls) {
|
|
30
54
|
return (0, _vtxProvider.useStyle)('VtxColorPicker', function (token) {
|