vue-devui 1.0.0-beta.10 → 1.0.0-beta.14

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.
Files changed (82) hide show
  1. package/README.md +62 -45
  2. package/accordion/index.es.js +309 -38
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.es.js +5 -2
  6. package/alert/index.umd.js +1 -1
  7. package/auto-complete/index.d.ts +7 -0
  8. package/auto-complete/index.es.js +1121 -0
  9. package/auto-complete/index.umd.js +1 -0
  10. package/auto-complete/package.json +7 -0
  11. package/auto-complete/style.css +1 -0
  12. package/button/index.es.js +213 -8
  13. package/button/index.umd.js +1 -1
  14. package/button/style.css +1 -1
  15. package/color-picker/index.d.ts +7 -0
  16. package/color-picker/index.es.js +2960 -0
  17. package/color-picker/index.umd.js +1 -0
  18. package/color-picker/package.json +7 -0
  19. package/color-picker/style.css +1 -0
  20. package/dragdrop/index.es.js +135 -10
  21. package/dragdrop/index.umd.js +1 -1
  22. package/drawer/index.es.js +38 -6
  23. package/drawer/index.umd.js +1 -1
  24. package/dropdown/index.es.js +30 -22
  25. package/dropdown/index.umd.js +1 -1
  26. package/dropdown/style.css +1 -1
  27. package/editable-select/index.es.js +67 -3
  28. package/editable-select/index.umd.js +11 -11
  29. package/form/index.es.js +59 -17
  30. package/form/index.umd.js +1 -1
  31. package/gantt/index.es.js +3 -3
  32. package/gantt/index.umd.js +1 -1
  33. package/image-preview/index.es.js +33 -15
  34. package/image-preview/index.umd.js +1 -1
  35. package/modal/index.es.js +214 -13
  36. package/modal/index.umd.js +1 -1
  37. package/modal/style.css +1 -1
  38. package/nuxt/components/AutoComplete.js +3 -0
  39. package/nuxt/components/ColorPicker.js +3 -0
  40. package/nuxt/components/DrawerService.js +3 -0
  41. package/overlay/index.es.js +1 -1
  42. package/overlay/index.umd.js +1 -1
  43. package/package.json +1 -16
  44. package/popover/index.es.js +13 -4
  45. package/popover/index.umd.js +1 -1
  46. package/progress/index.es.js +8 -8
  47. package/progress/index.umd.js +3 -3
  48. package/radio/index.es.js +5 -5
  49. package/radio/index.umd.js +1 -1
  50. package/slider/index.es.js +2 -5
  51. package/slider/index.umd.js +1 -1
  52. package/slider/style.css +1 -1
  53. package/splitter/index.es.js +191 -14
  54. package/splitter/index.umd.js +1 -1
  55. package/splitter/style.css +1 -1
  56. package/statistic/index.es.js +4 -4
  57. package/statistic/index.umd.js +1 -1
  58. package/statistic/style.css +1 -1
  59. package/style.css +1 -1
  60. package/table/index.es.js +236 -26
  61. package/table/index.umd.js +1 -1
  62. package/table/style.css +1 -1
  63. package/time-picker/index.es.js +221 -11
  64. package/time-picker/index.umd.js +1 -1
  65. package/time-picker/style.css +1 -1
  66. package/toast/index.es.js +8 -5
  67. package/toast/index.umd.js +1 -1
  68. package/toast/style.css +1 -1
  69. package/transfer/index.es.js +503 -59
  70. package/transfer/index.umd.js +1 -1
  71. package/transfer/style.css +1 -1
  72. package/tree/index.es.js +6 -5
  73. package/tree/index.umd.js +1 -1
  74. package/tree-select/index.es.js +129 -34
  75. package/tree-select/index.umd.js +1 -1
  76. package/tree-select/style.css +1 -1
  77. package/upload/index.es.js +165 -507
  78. package/upload/index.umd.js +1 -1
  79. package/upload/style.css +1 -1
  80. package/vue-devui.es.js +16501 -13904
  81. package/vue-devui.umd.js +19 -19
  82. package/nuxt/components/MultiUpload.js +0 -3
@@ -0,0 +1,2960 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { ref, watch, defineComponent, reactive, provide, onUpdated, onBeforeMount, onMounted, createVNode, inject, getCurrentInstance, computed, nextTick, resolveComponent, readonly, unref, Teleport, Transition } from "vue";
33
+ function colorPickerResize(colorCubeRef, top, left) {
34
+ var _a;
35
+ const rect = (_a = colorCubeRef.value) == null ? void 0 : _a.getBoundingClientRect();
36
+ left.value = rect == null ? void 0 : rect.left;
37
+ top.value = (rect == null ? void 0 : rect.top) + window.scrollY + rect.height;
38
+ }
39
+ function isExhibitionColorPicker(event, colorCubeRef, pickerRef, showColorPicker) {
40
+ var _a, _b;
41
+ if ((_a = colorCubeRef.value) == null ? void 0 : _a.contains(event.target)) {
42
+ showColorPicker.value = true;
43
+ }
44
+ if (!!pickerRef.value && !((_b = pickerRef.value) == null ? void 0 : _b.contains(event.target))) {
45
+ showColorPicker.value = !showColorPicker.value;
46
+ }
47
+ }
48
+ function useReactive(source) {
49
+ const model = ref();
50
+ model.value = source();
51
+ watch(source, (newValue) => {
52
+ model.value = newValue;
53
+ });
54
+ return model;
55
+ }
56
+ function changeColorValue(value, maxValue) {
57
+ if (value.alpha > maxValue) {
58
+ return value.hsva.v > maxValue && value.hsva.s < maxValue ? { color: "#000" } : { color: "#fff" };
59
+ } else {
60
+ return { color: "#000" };
61
+ }
62
+ }
63
+ const colorPickerProps$1 = {
64
+ modelValue: {
65
+ type: [Object, String]
66
+ },
67
+ mode: {
68
+ type: String
69
+ },
70
+ showAlpha: {
71
+ type: Boolean,
72
+ default: true
73
+ },
74
+ dotSize: {
75
+ type: Number,
76
+ default: 15
77
+ },
78
+ swatches: {
79
+ type: Array
80
+ },
81
+ showHistory: {
82
+ type: Boolean,
83
+ default: true
84
+ }
85
+ };
86
+ const colorPickerProps = {
87
+ colorMap: {
88
+ type: Object
89
+ },
90
+ modelValue: {
91
+ type: Object
92
+ },
93
+ showAlpha: {
94
+ type: Boolean,
95
+ default: true
96
+ },
97
+ mode: {
98
+ type: String
99
+ }
100
+ };
101
+ var tabs = "";
102
+ var Tabs = defineComponent({
103
+ name: "DTabs",
104
+ props: {
105
+ modelValue: {
106
+ type: [String, Number],
107
+ default: null
108
+ },
109
+ type: {
110
+ type: String,
111
+ default: "tabs"
112
+ },
113
+ showContent: {
114
+ type: Boolean,
115
+ default: true
116
+ },
117
+ vertical: {
118
+ type: Boolean,
119
+ default: false
120
+ },
121
+ reactivable: {
122
+ type: Boolean,
123
+ default: true
124
+ },
125
+ customWidth: {
126
+ type: String,
127
+ default: ""
128
+ },
129
+ cssClass: {
130
+ type: String,
131
+ default: ""
132
+ },
133
+ beforeChange: {
134
+ type: Function,
135
+ default: null
136
+ }
137
+ },
138
+ emits: ["update:modelValue", "activeTabChange"],
139
+ setup(props, {
140
+ emit,
141
+ slots
142
+ }) {
143
+ const tabsEle = ref(null);
144
+ const data = reactive({
145
+ offsetLeft: 0,
146
+ offsetWidth: 0,
147
+ id: null
148
+ });
149
+ const state = reactive({
150
+ data: [],
151
+ active: props.modelValue,
152
+ showContent: props.showContent,
153
+ slots: []
154
+ });
155
+ provide("tabs", {
156
+ state
157
+ });
158
+ const canChange = function(currentTab) {
159
+ let changeResult = Promise.resolve(true);
160
+ if (typeof props.beforeChange === "function") {
161
+ const result = props.beforeChange(currentTab);
162
+ if (typeof result !== "undefined") {
163
+ if (result.then) {
164
+ changeResult = result;
165
+ } else {
166
+ console.log(result);
167
+ changeResult = Promise.resolve(result);
168
+ }
169
+ }
170
+ }
171
+ return changeResult;
172
+ };
173
+ const activeClick = function(item, tabEl) {
174
+ if (!props.reactivable && props.modelValue === item.id) {
175
+ return;
176
+ }
177
+ canChange(item.id).then((change) => {
178
+ if (!change) {
179
+ return;
180
+ }
181
+ const tab = state.data.find((itemOption) => itemOption.id === item.id);
182
+ if (tab && !tab.disabled) {
183
+ state.active = item.id;
184
+ emit("update:modelValue", tab.id);
185
+ if (props.type === "slider" && tabEl && tabsEle) {
186
+ this.offsetLeft = tabEl.getBoundingClientRect().left - this.tabsEle.nativeElement.getBoundingClientRect().left;
187
+ this.offsetWidth = tabEl.getBoundingClientRect().width;
188
+ }
189
+ emit("activeTabChange", tab.id);
190
+ }
191
+ });
192
+ };
193
+ const ulClass = [props.type];
194
+ props.cssClass && ulClass.push(props.cssClass);
195
+ props.vertical && ulClass.push("devui-nav-stacked");
196
+ onUpdated(() => {
197
+ if (props.type === "slider") {
198
+ setTimeout(() => {
199
+ const tabEle = tabsEle.value.querySelector("#" + props.modelValue + ".active");
200
+ if (tabEle) {
201
+ data.offsetLeft = tabEle.getBoundingClientRect().left - tabsEle.value.getBoundingClientRect().left;
202
+ data.offsetWidth = tabEle.getBoundingClientRect().width;
203
+ }
204
+ });
205
+ }
206
+ });
207
+ onBeforeMount(() => {
208
+ if (props.type !== "slider" && props.modelValue === void 0 && state.data.length > 0) {
209
+ activeClick(state.data[0]);
210
+ }
211
+ });
212
+ onMounted(() => {
213
+ if (props.type === "slider" && props.modelValue === void 0 && state.data.length > 0 && state.data[0]) {
214
+ activeClick(state.data[0].tabsEle.value.getElementById(state.data[0].tabId));
215
+ }
216
+ });
217
+ return () => {
218
+ return createVNode("div", null, [createVNode("ul", {
219
+ "ref": tabsEle,
220
+ "role": "tablist",
221
+ "class": `devui-nav devui-nav-${ulClass.join(" ")}`,
222
+ "id": "devuiTabs11"
223
+ }, [state.data.map((item, i) => {
224
+ return createVNode("li", {
225
+ "role": "presentation",
226
+ "onClick": () => {
227
+ activeClick(item);
228
+ },
229
+ "class": (props.modelValue === (item.id || item.tabId) ? "active" : "") + " " + (item.disabled ? "disabled" : ""),
230
+ "id": item.id || item.tabId
231
+ }, [createVNode("a", {
232
+ "role": "tab",
233
+ "data-toggle": item.id,
234
+ "aria-expanded": props.modelValue === (item.id || item.tabId)
235
+ }, [state.slots[i] ? state.slots[i]() : createVNode("span", null, [item.title])])]);
236
+ }), createVNode("div", {
237
+ "class": `devui-nav-${props.type}-animation`,
238
+ "style": {
239
+ left: data.offsetLeft + "px",
240
+ width: data.offsetWidth + "px"
241
+ }
242
+ }, null)]), slots.default()]);
243
+ };
244
+ }
245
+ });
246
+ var Tab = defineComponent({
247
+ name: "DTab",
248
+ props: {
249
+ title: {
250
+ default: null,
251
+ type: [String, Number]
252
+ },
253
+ id: {
254
+ default: null,
255
+ type: String
256
+ },
257
+ disabled: {
258
+ type: Boolean,
259
+ default: false
260
+ }
261
+ },
262
+ setup(props, {
263
+ slots
264
+ }) {
265
+ const tabs2 = inject("tabs");
266
+ tabs2.state.slots.push(slots.dTabTitle);
267
+ tabs2.state.data.push(props);
268
+ return () => {
269
+ const {
270
+ id
271
+ } = props;
272
+ const content = tabs2.state.showContent && tabs2.state.active === id ? createVNode("div", {
273
+ "class": "devui-tab-content"
274
+ }, [createVNode("div", {
275
+ "role": "tabpanel",
276
+ "class": "devui-tab-pane in active"
277
+ }, [slots.default()])]) : null;
278
+ return content;
279
+ };
280
+ }
281
+ });
282
+ Tabs.install = function(app) {
283
+ app.component(Tabs.name, Tabs);
284
+ app.component(Tab.name, Tab);
285
+ };
286
+ const isObject$1 = (val) => val !== null && typeof val === "object";
287
+ const isString = (val) => typeof val === "string";
288
+ var NodeType;
289
+ (function(NodeType2) {
290
+ NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
291
+ NodeType2[NodeType2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
292
+ NodeType2[NodeType2["TEXT_NODE"] = 3] = "TEXT_NODE";
293
+ NodeType2[NodeType2["CDATA_SECTION_NODE"] = 4] = "CDATA_SECTION_NODE";
294
+ NodeType2[NodeType2["ENTITY_REFERENCE_NODE"] = 5] = "ENTITY_REFERENCE_NODE";
295
+ NodeType2[NodeType2["COMMENT_NODE"] = 6] = "COMMENT_NODE";
296
+ NodeType2[NodeType2["PROCESSING_INSTRUCTION_NODE"] = 7] = "PROCESSING_INSTRUCTION_NODE";
297
+ NodeType2[NodeType2["DOCUMENT_NODE"] = 9] = "DOCUMENT_NODE";
298
+ })(NodeType || (NodeType = {}));
299
+ class DOMUtils {
300
+ static isWindow(val) {
301
+ return val === window;
302
+ }
303
+ static addEventListener(element, event, handler, options = false) {
304
+ if (element && event && handler) {
305
+ element.addEventListener(event, handler, options);
306
+ }
307
+ }
308
+ static removeEventListener(element, event, handler, options = false) {
309
+ if (element && event && handler) {
310
+ element.removeEventListener(event, handler, options);
311
+ }
312
+ }
313
+ static triggerDragEvent(element, options) {
314
+ let isDragging = false;
315
+ const moveFn = function(event) {
316
+ var _a;
317
+ (_a = options.drag) == null ? void 0 : _a.call(options, event);
318
+ };
319
+ const upFn = (event) => {
320
+ var _a;
321
+ DOMUtils.removeEventListener(document, "mousemove", moveFn);
322
+ DOMUtils.removeEventListener(document, "mouseup", upFn);
323
+ DOMUtils.removeEventListener(document, "touchmove", moveFn);
324
+ DOMUtils.removeEventListener(document, "touchend", upFn);
325
+ document.onselectstart = null;
326
+ document.ondragstart = null;
327
+ isDragging = false;
328
+ (_a = options.end) == null ? void 0 : _a.call(options, event);
329
+ };
330
+ const downFn = (event) => {
331
+ var _a;
332
+ if (isDragging)
333
+ return;
334
+ document.onselectstart = () => false;
335
+ document.ondragstart = () => false;
336
+ DOMUtils.addEventListener(document, "mousemove", moveFn);
337
+ DOMUtils.addEventListener(document, "mouseup", upFn);
338
+ DOMUtils.addEventListener(document, "touchmove", moveFn);
339
+ DOMUtils.addEventListener(document, "touchend", upFn);
340
+ isDragging = true;
341
+ (_a = options.start) == null ? void 0 : _a.call(options, event);
342
+ };
343
+ DOMUtils.addEventListener(element, "mousedown", downFn);
344
+ DOMUtils.addEventListener(element, "touchstart", downFn);
345
+ return;
346
+ }
347
+ static getBoundingClientRect(element) {
348
+ if (element && isObject$1(element) && element.nodeType === 1) {
349
+ return element.getBoundingClientRect();
350
+ }
351
+ return null;
352
+ }
353
+ static hasClass(element, className) {
354
+ if (element && isObject$1(element) && isString(className) && element.nodeType === 1) {
355
+ return element.classList.contains(className.trim());
356
+ }
357
+ return false;
358
+ }
359
+ static addClass(element, className) {
360
+ if (element && isObject$1(element) && isString(className) && element.nodeType === 1) {
361
+ className = className.trim();
362
+ if (!DOMUtils.hasClass(element, className)) {
363
+ const cl = element.className;
364
+ element.className = cl ? cl + " " + className : className;
365
+ }
366
+ }
367
+ }
368
+ static removeClass(element, className) {
369
+ if (element && isObject$1(element) && isString(className) && element.nodeType === 1 && typeof element.className === "string") {
370
+ className = className.trim();
371
+ const classes = element.className.trim().split(" ");
372
+ for (let i = classes.length - 1; i >= 0; i--) {
373
+ classes[i] = classes[i].trim();
374
+ if (!classes[i] || classes[i] === className) {
375
+ classes.splice(i, 1);
376
+ }
377
+ }
378
+ element.className = classes.join(" ");
379
+ }
380
+ }
381
+ static toggleClass(element, className, force) {
382
+ if (element && isObject$1(element) && isString(className) && element.nodeType === 1) {
383
+ element.classList.toggle(className, force);
384
+ }
385
+ }
386
+ static replaceClass(element, oldClassName, newClassName) {
387
+ if (element && isObject$1(element) && isString(oldClassName) && isString(newClassName) && element.nodeType === 1) {
388
+ oldClassName = oldClassName.trim();
389
+ newClassName = newClassName.trim();
390
+ DOMUtils.removeClass(element, oldClassName);
391
+ DOMUtils.addClass(element, newClassName);
392
+ }
393
+ }
394
+ static getScrollTop(el) {
395
+ const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
396
+ return Math.max(top, 0);
397
+ }
398
+ static setScrollTop(el, value) {
399
+ if ("scrollTop" in el) {
400
+ el.scrollTop = value;
401
+ } else {
402
+ el.scrollTo(el.scrollX, value);
403
+ }
404
+ }
405
+ static getRootScrollTop() {
406
+ return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
407
+ }
408
+ static setRootScrollTop(value) {
409
+ DOMUtils.setScrollTop(window, value);
410
+ DOMUtils.setScrollTop(document.body, value);
411
+ }
412
+ static getElementTop(el, scroller) {
413
+ if (DOMUtils.isWindow(el)) {
414
+ return 0;
415
+ }
416
+ const scrollTop = scroller ? DOMUtils.getScrollTop(scroller) : DOMUtils.getRootScrollTop();
417
+ return el.getBoundingClientRect().top + scrollTop;
418
+ }
419
+ static getVisibleHeight(el) {
420
+ if (DOMUtils.isWindow(el)) {
421
+ return el.innerHeight;
422
+ }
423
+ return el.getBoundingClientRect().height;
424
+ }
425
+ static isHidden(el) {
426
+ if (!el) {
427
+ return false;
428
+ }
429
+ const style = window.getComputedStyle(el);
430
+ const hidden = style.display === "none";
431
+ const parentHidden = el.offsetParent === null && style.position !== "fixed";
432
+ return hidden || parentHidden;
433
+ }
434
+ static triggerEvent(el, type4) {
435
+ if ("createEvent" in document) {
436
+ const e = document.createEvent("HTMLEvents");
437
+ e.initEvent(type4, false, true);
438
+ el.dispatchEvent(e);
439
+ }
440
+ }
441
+ static calcAngle(element, event) {
442
+ const rect = element.getBoundingClientRect();
443
+ const originX = rect.left + rect.width / 2;
444
+ const originY = rect.top + rect.height / 2;
445
+ const x = Math.abs(originX - event.clientX);
446
+ const y = Math.abs(originY - event.clientY);
447
+ const z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
448
+ const cos = y / z;
449
+ const rad = Math.acos(cos);
450
+ let angle = Math.floor(180 / (Math.PI / rad));
451
+ if (event.clientX > originX && event.clientY > originY) {
452
+ angle = 180 - angle;
453
+ }
454
+ if (event.clientX == originX && event.clientY > originY) {
455
+ angle = 180;
456
+ }
457
+ if (event.clientX > originX && event.clientY == originY) {
458
+ angle = 90;
459
+ }
460
+ if (event.clientX < originX && event.clientY > originY) {
461
+ angle = 180 + angle;
462
+ }
463
+ if (event.clientX < originX && event.clientY == originY) {
464
+ angle = 270;
465
+ }
466
+ if (event.clientX < originX && event.clientY < originY) {
467
+ angle = 360 - angle;
468
+ }
469
+ return angle;
470
+ }
471
+ static querySelector(selectors, parentElement) {
472
+ if (parentElement) {
473
+ return parentElement.querySelector(selectors);
474
+ }
475
+ return document.querySelector(selectors);
476
+ }
477
+ }
478
+ function padEnd(str, length, char = "0") {
479
+ return str + char.repeat(Math.max(0, length - str.length));
480
+ }
481
+ function chunk(str, size = 1) {
482
+ const chunked = [];
483
+ let index2 = 0;
484
+ while (index2 < str.length) {
485
+ chunked.push(str.substr(index2, size));
486
+ index2 += size;
487
+ }
488
+ return chunked;
489
+ }
490
+ const clamp = (value, min, max) => {
491
+ return min < max ? value < min ? min : value > max ? max : value : value < max ? max : value > min ? min : value;
492
+ };
493
+ function keepDecimal(value, digits = 0) {
494
+ const COUNT_VALUE = 10 ** digits;
495
+ return Math.round(value * COUNT_VALUE) / COUNT_VALUE;
496
+ }
497
+ function has(obj, key) {
498
+ return key.every((k) => obj.hasOwnProperty(k));
499
+ }
500
+ function HSVAtoRGBA(hsva) {
501
+ const { h, s, v, a } = hsva;
502
+ const f = (n) => {
503
+ const k = (n + h / 60) % 6;
504
+ return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
505
+ };
506
+ const rgb = [f(5), f(3), f(1)].map((v2) => Math.round(v2 * 255));
507
+ return { r: rgb[0], g: rgb[1], b: rgb[2], a };
508
+ }
509
+ function RGBAtoHSVA(rgba) {
510
+ if (!rgba)
511
+ return { h: 0, s: 1, v: 1, a: 1 };
512
+ const r = rgba.r / 255;
513
+ const g = rgba.g / 255;
514
+ const b = rgba.b / 255;
515
+ const max = Math.max(r, g, b);
516
+ const min = Math.min(r, g, b);
517
+ let h = 0;
518
+ if (max !== min) {
519
+ if (max === r) {
520
+ h = 60 * (0 + (g - b) / (max - min));
521
+ } else if (max === g) {
522
+ h = 60 * (2 + (b - r) / (max - min));
523
+ } else if (max === b) {
524
+ h = 60 * (4 + (r - g) / (max - min));
525
+ }
526
+ }
527
+ if (h < 0)
528
+ h = h + 360;
529
+ const s = max === 0 ? 0 : (max - min) / max;
530
+ const hsv = [h, s, max];
531
+ return { h: Math.round(hsv[0]), s: hsv[1], v: hsv[2], a: rgba.a };
532
+ }
533
+ function HSVAtoHSLA(hsva) {
534
+ const { h, s, v, a } = hsva;
535
+ const l = v - v * s / 2;
536
+ const sprime = l === 1 || l === 0 ? 0 : (v - l) / Math.min(l, 1 - l);
537
+ return { h: Math.round(h), s: sprime, l, a };
538
+ }
539
+ function HSLAtoHSVA(hsl) {
540
+ const { h, s, l, a } = hsl;
541
+ const v = l + s * Math.min(l, 1 - l);
542
+ const sprime = v === 0 ? 0 : 2 - 2 * l / v;
543
+ return { h: Math.round(h), s: sprime, v, a };
544
+ }
545
+ function RGBAtoCSS(rgba) {
546
+ return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;
547
+ }
548
+ function RGBtoCSS(rgba) {
549
+ return RGBAtoCSS(__spreadProps(__spreadValues({}, rgba), { a: 1 }));
550
+ }
551
+ function RGBAtoHex(rgba) {
552
+ const toHex = (v) => {
553
+ const h = Math.round(v).toString(16);
554
+ return ("00".substring(0, 2 - h.length) + h).toUpperCase();
555
+ };
556
+ return `#${[toHex(rgba.r), toHex(rgba.g), toHex(rgba.b), toHex(Math.round(rgba.a * 255))].join("")}`;
557
+ }
558
+ function HexToRGBA(hex2) {
559
+ const rgba = chunk(hex2.slice(1), 2).map((c) => parseInt(c, 16));
560
+ return {
561
+ r: rgba[0],
562
+ g: rgba[1],
563
+ b: rgba[2],
564
+ a: Math.round(rgba[3] / 255 * 100) / 100
565
+ };
566
+ }
567
+ function HexToHSVA(hex2) {
568
+ const rgb = HexToRGBA(hex2);
569
+ return RGBAtoHSVA(rgb);
570
+ }
571
+ function HSVAtoHex(hsva) {
572
+ return RGBAtoHex(HSVAtoRGBA(hsva));
573
+ }
574
+ function parseHex(hex2) {
575
+ if (hex2.startsWith("#")) {
576
+ hex2 = hex2.slice(1);
577
+ }
578
+ hex2 = hex2.replace(/([^0-9a-f])/gi, "F");
579
+ if (hex2.length === 3 || hex2.length === 4) {
580
+ hex2 = hex2.split("").map((x) => x + x).join("");
581
+ }
582
+ if (hex2.length === 6) {
583
+ hex2 = padEnd(hex2, 8, "F");
584
+ } else {
585
+ hex2 = padEnd(padEnd(hex2, 6), 8, "F");
586
+ }
587
+ return `#${hex2}`.toUpperCase().substring(0, 9);
588
+ }
589
+ function fromHSVA(hsva) {
590
+ hsva = __spreadValues({}, hsva);
591
+ const hexa = HSVAtoHex(hsva);
592
+ const hsla = HSVAtoHSLA(hsva);
593
+ const rgba = HSVAtoRGBA(hsva);
594
+ return {
595
+ alpha: hsva.a,
596
+ hex: hexa.substring(0, 7),
597
+ hexa,
598
+ hsla,
599
+ hsva,
600
+ hue: hsva.h,
601
+ rgba
602
+ };
603
+ }
604
+ function fromRGBA(rgba) {
605
+ const hsva = RGBAtoHSVA(rgba);
606
+ const hexa = RGBAtoHex(rgba);
607
+ const hsla = HSVAtoHSLA(hsva);
608
+ const hsv = { h: hsva.h, s: hsva.s, v: hsva.v };
609
+ const hsl = { h: hsla.h, s: hsla.s, l: hsla.l };
610
+ return {
611
+ alpha: hsva.a,
612
+ hex: hexa.substring(0, 7),
613
+ hexa,
614
+ hsla,
615
+ hsva,
616
+ hsv,
617
+ hsl,
618
+ hue: hsva.h,
619
+ rgba
620
+ };
621
+ }
622
+ function fromHexa(hexa) {
623
+ const hsva = HexToHSVA(hexa);
624
+ const hsla = HSVAtoHSLA(hsva);
625
+ const rgba = HSVAtoRGBA(hsva);
626
+ return {
627
+ alpha: hsva.a,
628
+ hex: hexa.substring(0, 7),
629
+ hexa,
630
+ hsla,
631
+ hsva,
632
+ hue: hsva.h,
633
+ rgba
634
+ };
635
+ }
636
+ function fromHSLA(hsla) {
637
+ const hsva = HSLAtoHSVA(hsla);
638
+ const hexa = HSVAtoHex(hsva);
639
+ const rgba = HSVAtoRGBA(hsva);
640
+ return {
641
+ alpha: hsva.a,
642
+ hex: hexa.substring(0, 7),
643
+ hexa,
644
+ hsla,
645
+ hsva,
646
+ hue: hsva.h,
647
+ rgba
648
+ };
649
+ }
650
+ function fromHex(hex2) {
651
+ return fromHexa(parseHex(hex2));
652
+ }
653
+ function parseColor(color2, oldColor) {
654
+ if (!color2)
655
+ return fromRGBA({ r: 0, g: 0, b: 0, a: 1 });
656
+ if (typeof color2 === "string") {
657
+ if (color2.indexOf("#") !== -1)
658
+ ;
659
+ else if (color2.indexOf("hsl") !== -1) {
660
+ let alpha = null;
661
+ const parts = color2.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val) => parseFloat(val));
662
+ if (parts.length === 4) {
663
+ alpha = parts[3];
664
+ } else if (parts.length === 3) {
665
+ alpha = 1;
666
+ }
667
+ return fromHSLA({ h: parts[0], s: parts[1], l: parts[2], a: alpha });
668
+ } else if (color2.indexOf("rgb") !== -1) {
669
+ let alpha = null;
670
+ const parts = color2.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val) => parseFloat(val));
671
+ if (parts.length === 4) {
672
+ alpha = parts[3];
673
+ } else if (parts.length === 3) {
674
+ alpha = 1;
675
+ }
676
+ return fromRGBA({ r: parts[0], g: parts[1], b: parts[2], a: alpha });
677
+ } else if (color2.indexOf("hsv") !== -1) {
678
+ let alpha = null;
679
+ const parts = color2.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val) => parseFloat(val));
680
+ if (parts.length === 4) {
681
+ alpha = parts[3];
682
+ } else if (parts.length === 3) {
683
+ alpha = 1;
684
+ }
685
+ return fromHSVA({ h: parts[0], s: parts[1], v: parts[2], a: alpha });
686
+ }
687
+ if (color2 === "transparent")
688
+ return fromHexa("#00000000");
689
+ const hex2 = parseHex(color2);
690
+ if (oldColor && hex2 === oldColor.hexa) {
691
+ return oldColor;
692
+ } else {
693
+ return fromHexa(hex2);
694
+ }
695
+ }
696
+ if (typeof color2 === "object") {
697
+ if (color2.hasOwnProperty("alpha"))
698
+ return color2;
699
+ const a = color2.hasOwnProperty("a") ? parseFloat(color2.a) : 1;
700
+ if (has(color2, ["r", "g", "b"])) {
701
+ if (oldColor && color2 === oldColor.rgba)
702
+ return oldColor;
703
+ else
704
+ return fromRGBA(__spreadProps(__spreadValues({}, color2), { a }));
705
+ } else if (has(color2, ["h", "s", "l"])) {
706
+ if (oldColor && color2 === oldColor.hsla)
707
+ return oldColor;
708
+ else
709
+ return fromHSLA(__spreadProps(__spreadValues({}, color2), { a }));
710
+ } else if (has(color2, ["h", "s", "v"])) {
711
+ if (oldColor && color2 === oldColor.hsva)
712
+ return oldColor;
713
+ else
714
+ return fromHSVA(__spreadProps(__spreadValues({}, color2), { a }));
715
+ }
716
+ }
717
+ return fromRGBA({ r: 255, g: 0, b: 0, a: 1 });
718
+ }
719
+ function stripAlpha(color2, stripAlpha2) {
720
+ if (stripAlpha2) {
721
+ const _a = color2, { a } = _a, rest = __objRest(_a, ["a"]);
722
+ return rest;
723
+ }
724
+ return color2;
725
+ }
726
+ function extractColor(color2, input, mode, showAlpha) {
727
+ const hue = keepDecimal(color2.hsla.h, 2);
728
+ const hslSaturation = keepDecimal(color2.hsla.s, 2);
729
+ const lightness = keepDecimal(color2.hsla.l, 2);
730
+ const red = keepDecimal(color2.rgba.r);
731
+ const green = keepDecimal(color2.rgba.g);
732
+ const blue = keepDecimal(color2.rgba.b);
733
+ const hsvSaturation = keepDecimal(color2.hsva.s, 2);
734
+ const value = keepDecimal(color2.hsva.v, 2);
735
+ if (input == null)
736
+ return color2;
737
+ function isShowAlpha(mode2) {
738
+ return showAlpha ? mode2 + "a" : mode2;
739
+ }
740
+ if (typeof input === "string") {
741
+ if (mode === "hex") {
742
+ return showAlpha ? color2.hexa : color2.hex;
743
+ } else if (mode === "hsl") {
744
+ return `${isShowAlpha(mode)}(${hue}, ${hslSaturation}, ${lightness}${showAlpha ? ", " + color2.alpha : ""})`;
745
+ } else if (mode === "rgb") {
746
+ return `${isShowAlpha(mode)}(${red}, ${green}, ${blue}${showAlpha ? ", " + color2.alpha : ""})`;
747
+ } else if (mode === "hsv") {
748
+ return `${isShowAlpha(mode)}(${hue}, ${hsvSaturation}, ${value}${showAlpha ? ", " + color2.alpha : ""})`;
749
+ }
750
+ return input.length === 7 ? color2.hex : color2.hexa;
751
+ }
752
+ if (typeof input === "object") {
753
+ const shouldStrip = typeof input.a === "number" && input.a === 0 ? !!input.a : !input.a;
754
+ if (has(input, ["r", "g", "b"]))
755
+ return stripAlpha(color2.rgba, shouldStrip);
756
+ else if (has(input, ["h", "s", "l"]))
757
+ return stripAlpha(color2.hsla, shouldStrip);
758
+ else if (has(input, ["h", "s", "v"]))
759
+ return stripAlpha(color2.hsva, shouldStrip);
760
+ }
761
+ }
762
+ const colorPickerPaletteProps = {
763
+ modelValue: {
764
+ type: Object,
765
+ default: () => fromRGBA({ r: 255, g: 0, b: 0, a: 1 })
766
+ },
767
+ height: {
768
+ type: Number,
769
+ default: 200
770
+ }
771
+ };
772
+ var colorPalette$1 = "";
773
+ var colorPalette = defineComponent({
774
+ name: "ColorPallete",
775
+ props: colorPickerPaletteProps,
776
+ emits: ["update:modelValue", "changeTextColor"],
777
+ setup(props, ctx) {
778
+ const DEFAULT_TRANSITION = {
779
+ transition: "all 0.3s ease"
780
+ };
781
+ const dotSizeInject = inject("provideData");
782
+ const clickTransfrom = ref(DEFAULT_TRANSITION);
783
+ const paletteElement = ref();
784
+ const canvasElement = ref();
785
+ const handlerElement = ref();
786
+ const paletteInstance = getCurrentInstance();
787
+ const cursorTop = ref(0);
788
+ const cursorLeft = ref(0);
789
+ const getDotStyle = computed(() => {
790
+ return {
791
+ width: `${dotSizeInject.dotSize}px`,
792
+ height: `${dotSizeInject.dotSize}px`,
793
+ transform: `translate(-${dotSizeInject.dotSize / 2}px, -${dotSizeInject.dotSize / 2}px)`
794
+ };
795
+ });
796
+ const getCursorStyle = computed(() => {
797
+ return __spreadValues({
798
+ top: cursorTop.value + "px",
799
+ left: cursorLeft.value + "px"
800
+ }, clickTransfrom.value);
801
+ });
802
+ function renderCanvas() {
803
+ const canvas = canvasElement.value.getContext("2d");
804
+ const parentWidth = paletteElement.value.offsetWidth;
805
+ canvasElement.value.width = parentWidth;
806
+ canvasElement.value.height = props.height;
807
+ const saturationGradient = canvas.createLinearGradient(0, 0, parentWidth, 0);
808
+ saturationGradient.addColorStop(0, "hsla(0, 0%, 100%, 1)");
809
+ saturationGradient.addColorStop(1, `hsla(${props.modelValue.hue}, 100%, 50%, 1)`);
810
+ canvas.fillStyle = saturationGradient;
811
+ canvas.fillRect(0, 0, parentWidth, props.height);
812
+ const valueGradient = canvas.createLinearGradient(0, 0, 0, props.height);
813
+ valueGradient.addColorStop(0, "hsla(0, 0%, 100%, 0)");
814
+ valueGradient.addColorStop(1, "hsla(0, 0%, 0%, 1)");
815
+ canvas.fillStyle = valueGradient;
816
+ canvas.fillRect(0, 0, parentWidth, props.height);
817
+ }
818
+ function clickPalette(event) {
819
+ const target = event.target;
820
+ if (target !== paletteElement.value) {
821
+ handleDrag(event);
822
+ }
823
+ }
824
+ function updatePosition() {
825
+ var _a, _b;
826
+ if (paletteInstance) {
827
+ const parentWidth = paletteElement.value.offsetWidth;
828
+ cursorLeft.value = Number((_a = props.modelValue) == null ? void 0 : _a.hsva.s) * parentWidth;
829
+ cursorTop.value = (1 - Number((_b = props.modelValue) == null ? void 0 : _b.hsva.v)) * props.height;
830
+ }
831
+ }
832
+ function handleDrag(event) {
833
+ const parentWidth = paletteElement.value.offsetWidth;
834
+ if (paletteInstance) {
835
+ const el = canvasElement.value;
836
+ const rect = el == null ? void 0 : el.getBoundingClientRect();
837
+ let left = event.clientX - rect.left;
838
+ let top = event.clientY - rect.top;
839
+ left = clamp(left, 0, parentWidth);
840
+ top = clamp(top, 0, props.height);
841
+ cursorLeft.value = left;
842
+ cursorTop.value = top;
843
+ const isChangeTextColor = computed(() => {
844
+ if (left > rect.width / 2 || top > rect.height / 2) {
845
+ return true;
846
+ } else {
847
+ return false;
848
+ }
849
+ });
850
+ ctx.emit("update:modelValue", fromHSVA({
851
+ h: props.modelValue.hue,
852
+ s: clamp(event.clientX - rect.left, 0, rect.width) / rect.width,
853
+ v: 1 - clamp(event.clientY - rect.top, 0, rect.height) / rect.height,
854
+ a: props.modelValue.alpha
855
+ }));
856
+ ctx.emit("changeTextColor", isChangeTextColor.value);
857
+ }
858
+ }
859
+ onMounted(() => {
860
+ renderCanvas();
861
+ if (paletteInstance && paletteInstance.vnode.el && handlerElement.value) {
862
+ DOMUtils.triggerDragEvent(paletteInstance.vnode.el, {
863
+ drag: (event) => {
864
+ clickTransfrom.value = null;
865
+ handleDrag(event);
866
+ },
867
+ end: (event) => {
868
+ clickTransfrom.value = DEFAULT_TRANSITION;
869
+ handleDrag(event);
870
+ }
871
+ });
872
+ updatePosition();
873
+ }
874
+ });
875
+ watch(() => props.modelValue, () => {
876
+ updatePosition();
877
+ });
878
+ ctx.expose({
879
+ renderCanvas
880
+ });
881
+ return () => {
882
+ return createVNode("div", {
883
+ "class": "devui-color-picker-palette",
884
+ "ref": paletteElement,
885
+ "onClick": clickPalette
886
+ }, [createVNode("canvas", {
887
+ "ref": canvasElement
888
+ }, null), createVNode("div", {
889
+ "class": "devui-color-picker-palette-handler",
890
+ "style": getCursorStyle.value
891
+ }, [createVNode("div", {
892
+ "ref": handlerElement,
893
+ "style": getDotStyle.value
894
+ }, null)])]);
895
+ };
896
+ }
897
+ });
898
+ const colorPickerHueSliderProps = {
899
+ color: {
900
+ type: Object
901
+ },
902
+ modelValue: {
903
+ type: Object
904
+ },
905
+ width: {
906
+ type: Number,
907
+ default: 300
908
+ },
909
+ height: {
910
+ type: Number,
911
+ default: 15
912
+ }
913
+ };
914
+ var colorHueSlider$1 = "";
915
+ var colorHueSlider = defineComponent({
916
+ name: "ColorHueSlider",
917
+ props: colorPickerHueSliderProps,
918
+ emits: ["update:modelValue"],
919
+ setup(props, ctx) {
920
+ const DEFAULT_TRANSITION = {
921
+ transition: "all 0.3s ease"
922
+ };
923
+ const barElement = ref(null);
924
+ const cursorElement = ref(null);
925
+ const clickTransfrom = ref(DEFAULT_TRANSITION);
926
+ const getCursorLeft = () => {
927
+ if (barElement.value && cursorElement.value) {
928
+ const rect = barElement.value.getBoundingClientRect();
929
+ const offsetWidth = cursorElement.value.offsetWidth;
930
+ if (props.modelValue.hue === 360) {
931
+ return rect.width - offsetWidth / 2;
932
+ }
933
+ return props.modelValue.hue % 360 * (rect.width - offsetWidth) / 360 + offsetWidth / 2;
934
+ }
935
+ return 0;
936
+ };
937
+ const getCursorStyle = computed(() => {
938
+ const left = getCursorLeft();
939
+ return __spreadValues({
940
+ left: left + "px",
941
+ top: 0
942
+ }, clickTransfrom.value);
943
+ });
944
+ const onClickSider = (event) => {
945
+ const target = event.target;
946
+ if (target !== barElement.value) {
947
+ onMoveBar(event);
948
+ }
949
+ };
950
+ const onMoveBar = (event) => {
951
+ event.stopPropagation();
952
+ if (barElement.value && cursorElement.value) {
953
+ const rect = barElement.value.getBoundingClientRect();
954
+ const offsetWidth = cursorElement.value.offsetWidth;
955
+ let left = event.clientX - rect.left;
956
+ left = Math.min(left, rect.width - offsetWidth / 2);
957
+ left = Math.max(offsetWidth / 2, left);
958
+ const hue = Math.round((left - offsetWidth / 2) / (rect.width - offsetWidth) * 360);
959
+ ctx.emit("update:modelValue", fromHSVA({
960
+ h: hue,
961
+ s: props.modelValue.hsva.s,
962
+ v: props.modelValue.hsva.v,
963
+ a: props.modelValue.hsva.a
964
+ }));
965
+ }
966
+ };
967
+ onMounted(() => {
968
+ const dragConfig = {
969
+ drag: (event) => {
970
+ clickTransfrom.value = null;
971
+ onMoveBar(event);
972
+ },
973
+ end: (event) => {
974
+ clickTransfrom.value = DEFAULT_TRANSITION;
975
+ onMoveBar(event);
976
+ }
977
+ };
978
+ if (barElement.value && cursorElement.value) {
979
+ DOMUtils.triggerDragEvent(barElement.value, dragConfig);
980
+ }
981
+ });
982
+ return () => {
983
+ return createVNode("div", {
984
+ "class": "devui-color-picker-hue-slider"
985
+ }, [createVNode("div", {
986
+ "ref": barElement,
987
+ "class": "devui-color-picker-hue-slider__bar",
988
+ "onClick": onClickSider
989
+ }, [createVNode("div", {
990
+ "class": "devui-color-picker-hue-slider__bar-pointer",
991
+ "ref": cursorElement,
992
+ "style": getCursorStyle.value
993
+ }, [createVNode("div", {
994
+ "class": "devui-color-picker-hue-slider__bar-handle"
995
+ }, null)])])]);
996
+ };
997
+ }
998
+ });
999
+ const colorPickerAlphaSliderProps = {
1000
+ color: {
1001
+ type: Object
1002
+ },
1003
+ modelValue: {
1004
+ type: Object
1005
+ },
1006
+ rgba: {
1007
+ type: Object,
1008
+ default: null
1009
+ },
1010
+ height: {
1011
+ type: Number,
1012
+ default: 15
1013
+ },
1014
+ width: {
1015
+ type: Number,
1016
+ default: 300
1017
+ }
1018
+ };
1019
+ var colorAlphaSlider$1 = "";
1020
+ var colorAlphaSlider = defineComponent({
1021
+ name: "ColorAlphaSlider",
1022
+ props: colorPickerAlphaSliderProps,
1023
+ emits: ["update:modelValue"],
1024
+ setup(props, ctx) {
1025
+ const DEFAULT_TRANSITION = {
1026
+ transition: "all 0.3s ease"
1027
+ };
1028
+ const clickTransfrom = ref(DEFAULT_TRANSITION);
1029
+ const barElement = ref(null);
1030
+ const cursorElement = ref(null);
1031
+ const onClickSider = (event) => {
1032
+ const target = event.target;
1033
+ if (target !== barElement.value) {
1034
+ onMoveBar(event);
1035
+ }
1036
+ };
1037
+ const onMoveBar = (event) => {
1038
+ event.stopPropagation();
1039
+ if (barElement.value && cursorElement.value) {
1040
+ const rect = barElement.value.getBoundingClientRect();
1041
+ const offsetWidth = cursorElement.value.offsetWidth;
1042
+ let left = event.clientX - rect.left;
1043
+ left = Math.max(offsetWidth / 2, left);
1044
+ left = Math.min(left, rect.width - offsetWidth / 2);
1045
+ const alpha = Math.round((left - offsetWidth / 2) / (rect.width - offsetWidth) * 100);
1046
+ ctx.emit("update:modelValue", fromHSVA(__spreadProps(__spreadValues({}, props.modelValue.hsva), {
1047
+ a: alpha / 100
1048
+ })));
1049
+ }
1050
+ };
1051
+ const getBackgroundStyle = computed(() => {
1052
+ return {
1053
+ background: `linear-gradient(to right, transparent , ${RGBtoCSS(props.modelValue.rgba)})`
1054
+ };
1055
+ });
1056
+ const getCursorLeft = computed(() => {
1057
+ if (barElement.value && cursorElement.value) {
1058
+ const alpha = props.modelValue.rgba.a;
1059
+ const rect = barElement.value.getBoundingClientRect();
1060
+ const offsetWidth = cursorElement.value.offsetWidth;
1061
+ return Math.round(alpha * (rect.width - offsetWidth) + offsetWidth / 2);
1062
+ }
1063
+ return 0;
1064
+ });
1065
+ const getCursorStyle = computed(() => {
1066
+ const left = getCursorLeft.value;
1067
+ return __spreadValues({
1068
+ left: left + "px",
1069
+ top: 0
1070
+ }, clickTransfrom.value);
1071
+ });
1072
+ onMounted(() => {
1073
+ const dragConfig = {
1074
+ drag: (event) => {
1075
+ clickTransfrom.value = null;
1076
+ onMoveBar(event);
1077
+ },
1078
+ end: (event) => {
1079
+ clickTransfrom.value = DEFAULT_TRANSITION;
1080
+ onMoveBar(event);
1081
+ }
1082
+ };
1083
+ if (barElement.value && cursorElement.value) {
1084
+ DOMUtils.triggerDragEvent(barElement.value, dragConfig);
1085
+ }
1086
+ });
1087
+ const alphaClass = computed(() => {
1088
+ return ["devui-color-picker-alpha-slider", "transparent"];
1089
+ });
1090
+ return () => {
1091
+ return createVNode("div", {
1092
+ "class": alphaClass.value
1093
+ }, [createVNode("div", {
1094
+ "ref": barElement,
1095
+ "class": "devui-color-picker-alpha-slider__bar",
1096
+ "style": getBackgroundStyle.value,
1097
+ "onClick": onClickSider
1098
+ }, [createVNode("div", {
1099
+ "class": ["devui-color-picker-alpha-slider__bar-pointer"],
1100
+ "ref": cursorElement,
1101
+ "style": getCursorStyle.value
1102
+ }, [createVNode("div", {
1103
+ "class": "devui-color-picker-alpha-slider__bar-handle"
1104
+ }, null)])])]);
1105
+ };
1106
+ }
1107
+ });
1108
+ const colorPickerEditProps = {
1109
+ showAlpha: {
1110
+ type: Boolean,
1111
+ default: false
1112
+ },
1113
+ mode: {
1114
+ type: String
1115
+ },
1116
+ color: {
1117
+ type: Object
1118
+ }
1119
+ };
1120
+ var colorEdit$1 = "";
1121
+ function _extends() {
1122
+ _extends = Object.assign || function(target) {
1123
+ for (var i = 1; i < arguments.length; i++) {
1124
+ var source = arguments[i];
1125
+ for (var key in source) {
1126
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1127
+ target[key] = source[key];
1128
+ }
1129
+ }
1130
+ }
1131
+ return target;
1132
+ };
1133
+ return _extends.apply(this, arguments);
1134
+ }
1135
+ function _inheritsLoose(subClass, superClass) {
1136
+ subClass.prototype = Object.create(superClass.prototype);
1137
+ subClass.prototype.constructor = subClass;
1138
+ _setPrototypeOf(subClass, superClass);
1139
+ }
1140
+ function _getPrototypeOf(o) {
1141
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
1142
+ return o2.__proto__ || Object.getPrototypeOf(o2);
1143
+ };
1144
+ return _getPrototypeOf(o);
1145
+ }
1146
+ function _setPrototypeOf(o, p) {
1147
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
1148
+ o2.__proto__ = p2;
1149
+ return o2;
1150
+ };
1151
+ return _setPrototypeOf(o, p);
1152
+ }
1153
+ function _isNativeReflectConstruct() {
1154
+ if (typeof Reflect === "undefined" || !Reflect.construct)
1155
+ return false;
1156
+ if (Reflect.construct.sham)
1157
+ return false;
1158
+ if (typeof Proxy === "function")
1159
+ return true;
1160
+ try {
1161
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1162
+ }));
1163
+ return true;
1164
+ } catch (e) {
1165
+ return false;
1166
+ }
1167
+ }
1168
+ function _construct(Parent, args, Class) {
1169
+ if (_isNativeReflectConstruct()) {
1170
+ _construct = Reflect.construct;
1171
+ } else {
1172
+ _construct = function _construct2(Parent2, args2, Class2) {
1173
+ var a = [null];
1174
+ a.push.apply(a, args2);
1175
+ var Constructor = Function.bind.apply(Parent2, a);
1176
+ var instance = new Constructor();
1177
+ if (Class2)
1178
+ _setPrototypeOf(instance, Class2.prototype);
1179
+ return instance;
1180
+ };
1181
+ }
1182
+ return _construct.apply(null, arguments);
1183
+ }
1184
+ function _isNativeFunction(fn) {
1185
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
1186
+ }
1187
+ function _wrapNativeSuper(Class) {
1188
+ var _cache = typeof Map === "function" ? new Map() : void 0;
1189
+ _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
1190
+ if (Class2 === null || !_isNativeFunction(Class2))
1191
+ return Class2;
1192
+ if (typeof Class2 !== "function") {
1193
+ throw new TypeError("Super expression must either be null or a function");
1194
+ }
1195
+ if (typeof _cache !== "undefined") {
1196
+ if (_cache.has(Class2))
1197
+ return _cache.get(Class2);
1198
+ _cache.set(Class2, Wrapper);
1199
+ }
1200
+ function Wrapper() {
1201
+ return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
1202
+ }
1203
+ Wrapper.prototype = Object.create(Class2.prototype, {
1204
+ constructor: {
1205
+ value: Wrapper,
1206
+ enumerable: false,
1207
+ writable: true,
1208
+ configurable: true
1209
+ }
1210
+ });
1211
+ return _setPrototypeOf(Wrapper, Class2);
1212
+ };
1213
+ return _wrapNativeSuper(Class);
1214
+ }
1215
+ var formatRegExp = /%[sdj%]/g;
1216
+ var warning = function warning2() {
1217
+ };
1218
+ if (typeof process !== "undefined" && process.env && false) {
1219
+ warning = function warning3(type4, errors) {
1220
+ if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
1221
+ if (errors.every(function(e) {
1222
+ return typeof e === "string";
1223
+ })) {
1224
+ console.warn(type4, errors);
1225
+ }
1226
+ }
1227
+ };
1228
+ }
1229
+ function convertFieldsError(errors) {
1230
+ if (!errors || !errors.length)
1231
+ return null;
1232
+ var fields = {};
1233
+ errors.forEach(function(error) {
1234
+ var field = error.field;
1235
+ fields[field] = fields[field] || [];
1236
+ fields[field].push(error);
1237
+ });
1238
+ return fields;
1239
+ }
1240
+ function format(template) {
1241
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1242
+ args[_key - 1] = arguments[_key];
1243
+ }
1244
+ var i = 0;
1245
+ var len = args.length;
1246
+ if (typeof template === "function") {
1247
+ return template.apply(null, args);
1248
+ }
1249
+ if (typeof template === "string") {
1250
+ var str = template.replace(formatRegExp, function(x) {
1251
+ if (x === "%%") {
1252
+ return "%";
1253
+ }
1254
+ if (i >= len) {
1255
+ return x;
1256
+ }
1257
+ switch (x) {
1258
+ case "%s":
1259
+ return String(args[i++]);
1260
+ case "%d":
1261
+ return Number(args[i++]);
1262
+ case "%j":
1263
+ try {
1264
+ return JSON.stringify(args[i++]);
1265
+ } catch (_) {
1266
+ return "[Circular]";
1267
+ }
1268
+ break;
1269
+ default:
1270
+ return x;
1271
+ }
1272
+ });
1273
+ return str;
1274
+ }
1275
+ return template;
1276
+ }
1277
+ function isNativeStringType(type4) {
1278
+ return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
1279
+ }
1280
+ function isEmptyValue(value, type4) {
1281
+ if (value === void 0 || value === null) {
1282
+ return true;
1283
+ }
1284
+ if (type4 === "array" && Array.isArray(value) && !value.length) {
1285
+ return true;
1286
+ }
1287
+ if (isNativeStringType(type4) && typeof value === "string" && !value) {
1288
+ return true;
1289
+ }
1290
+ return false;
1291
+ }
1292
+ function asyncParallelArray(arr, func, callback) {
1293
+ var results = [];
1294
+ var total = 0;
1295
+ var arrLength = arr.length;
1296
+ function count(errors) {
1297
+ results.push.apply(results, errors || []);
1298
+ total++;
1299
+ if (total === arrLength) {
1300
+ callback(results);
1301
+ }
1302
+ }
1303
+ arr.forEach(function(a) {
1304
+ func(a, count);
1305
+ });
1306
+ }
1307
+ function asyncSerialArray(arr, func, callback) {
1308
+ var index2 = 0;
1309
+ var arrLength = arr.length;
1310
+ function next(errors) {
1311
+ if (errors && errors.length) {
1312
+ callback(errors);
1313
+ return;
1314
+ }
1315
+ var original = index2;
1316
+ index2 = index2 + 1;
1317
+ if (original < arrLength) {
1318
+ func(arr[original], next);
1319
+ } else {
1320
+ callback([]);
1321
+ }
1322
+ }
1323
+ next([]);
1324
+ }
1325
+ function flattenObjArr(objArr) {
1326
+ var ret = [];
1327
+ Object.keys(objArr).forEach(function(k) {
1328
+ ret.push.apply(ret, objArr[k] || []);
1329
+ });
1330
+ return ret;
1331
+ }
1332
+ var AsyncValidationError = /* @__PURE__ */ function(_Error) {
1333
+ _inheritsLoose(AsyncValidationError2, _Error);
1334
+ function AsyncValidationError2(errors, fields) {
1335
+ var _this;
1336
+ _this = _Error.call(this, "Async Validation Error") || this;
1337
+ _this.errors = errors;
1338
+ _this.fields = fields;
1339
+ return _this;
1340
+ }
1341
+ return AsyncValidationError2;
1342
+ }(/* @__PURE__ */ _wrapNativeSuper(Error));
1343
+ function asyncMap(objArr, option, func, callback, source) {
1344
+ if (option.first) {
1345
+ var _pending = new Promise(function(resolve, reject) {
1346
+ var next = function next2(errors) {
1347
+ callback(errors);
1348
+ return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
1349
+ };
1350
+ var flattenArr = flattenObjArr(objArr);
1351
+ asyncSerialArray(flattenArr, func, next);
1352
+ });
1353
+ _pending["catch"](function(e) {
1354
+ return e;
1355
+ });
1356
+ return _pending;
1357
+ }
1358
+ var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
1359
+ var objArrKeys = Object.keys(objArr);
1360
+ var objArrLength = objArrKeys.length;
1361
+ var total = 0;
1362
+ var results = [];
1363
+ var pending = new Promise(function(resolve, reject) {
1364
+ var next = function next2(errors) {
1365
+ results.push.apply(results, errors);
1366
+ total++;
1367
+ if (total === objArrLength) {
1368
+ callback(results);
1369
+ return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
1370
+ }
1371
+ };
1372
+ if (!objArrKeys.length) {
1373
+ callback(results);
1374
+ resolve(source);
1375
+ }
1376
+ objArrKeys.forEach(function(key) {
1377
+ var arr = objArr[key];
1378
+ if (firstFields.indexOf(key) !== -1) {
1379
+ asyncSerialArray(arr, func, next);
1380
+ } else {
1381
+ asyncParallelArray(arr, func, next);
1382
+ }
1383
+ });
1384
+ });
1385
+ pending["catch"](function(e) {
1386
+ return e;
1387
+ });
1388
+ return pending;
1389
+ }
1390
+ function isErrorObj(obj) {
1391
+ return !!(obj && obj.message !== void 0);
1392
+ }
1393
+ function getValue(value, path) {
1394
+ var v = value;
1395
+ for (var i = 0; i < path.length; i++) {
1396
+ if (v == void 0) {
1397
+ return v;
1398
+ }
1399
+ v = v[path[i]];
1400
+ }
1401
+ return v;
1402
+ }
1403
+ function complementError(rule, source) {
1404
+ return function(oe) {
1405
+ var fieldValue;
1406
+ if (rule.fullFields) {
1407
+ fieldValue = getValue(source, rule.fullFields);
1408
+ } else {
1409
+ fieldValue = source[oe.field || rule.fullField];
1410
+ }
1411
+ if (isErrorObj(oe)) {
1412
+ oe.field = oe.field || rule.fullField;
1413
+ oe.fieldValue = fieldValue;
1414
+ return oe;
1415
+ }
1416
+ return {
1417
+ message: typeof oe === "function" ? oe() : oe,
1418
+ fieldValue,
1419
+ field: oe.field || rule.fullField
1420
+ };
1421
+ };
1422
+ }
1423
+ function deepMerge(target, source) {
1424
+ if (source) {
1425
+ for (var s in source) {
1426
+ if (source.hasOwnProperty(s)) {
1427
+ var value = source[s];
1428
+ if (typeof value === "object" && typeof target[s] === "object") {
1429
+ target[s] = _extends({}, target[s], value);
1430
+ } else {
1431
+ target[s] = value;
1432
+ }
1433
+ }
1434
+ }
1435
+ }
1436
+ return target;
1437
+ }
1438
+ var required$1 = function required(rule, value, source, errors, options, type4) {
1439
+ if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
1440
+ errors.push(format(options.messages.required, rule.fullField));
1441
+ }
1442
+ };
1443
+ var whitespace = function whitespace2(rule, value, source, errors, options) {
1444
+ if (/^\s+$/.test(value) || value === "") {
1445
+ errors.push(format(options.messages.whitespace, rule.fullField));
1446
+ }
1447
+ };
1448
+ var pattern$2 = {
1449
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
1450
+ url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
1451
+ hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
1452
+ };
1453
+ var types = {
1454
+ integer: function integer(value) {
1455
+ return types.number(value) && parseInt(value, 10) === value;
1456
+ },
1457
+ "float": function float(value) {
1458
+ return types.number(value) && !types.integer(value);
1459
+ },
1460
+ array: function array(value) {
1461
+ return Array.isArray(value);
1462
+ },
1463
+ regexp: function regexp(value) {
1464
+ if (value instanceof RegExp) {
1465
+ return true;
1466
+ }
1467
+ try {
1468
+ return !!new RegExp(value);
1469
+ } catch (e) {
1470
+ return false;
1471
+ }
1472
+ },
1473
+ date: function date(value) {
1474
+ return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
1475
+ },
1476
+ number: function number(value) {
1477
+ if (isNaN(value)) {
1478
+ return false;
1479
+ }
1480
+ return typeof value === "number";
1481
+ },
1482
+ object: function object(value) {
1483
+ return typeof value === "object" && !types.array(value);
1484
+ },
1485
+ method: function method(value) {
1486
+ return typeof value === "function";
1487
+ },
1488
+ email: function email(value) {
1489
+ return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
1490
+ },
1491
+ url: function url(value) {
1492
+ return typeof value === "string" && value.length <= 2048 && !!value.match(pattern$2.url);
1493
+ },
1494
+ hex: function hex(value) {
1495
+ return typeof value === "string" && !!value.match(pattern$2.hex);
1496
+ }
1497
+ };
1498
+ var type$1 = function type(rule, value, source, errors, options) {
1499
+ if (rule.required && value === void 0) {
1500
+ required$1(rule, value, source, errors, options);
1501
+ return;
1502
+ }
1503
+ var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
1504
+ var ruleType = rule.type;
1505
+ if (custom.indexOf(ruleType) > -1) {
1506
+ if (!types[ruleType](value)) {
1507
+ errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
1508
+ }
1509
+ } else if (ruleType && typeof value !== rule.type) {
1510
+ errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
1511
+ }
1512
+ };
1513
+ var range = function range2(rule, value, source, errors, options) {
1514
+ var len = typeof rule.len === "number";
1515
+ var min = typeof rule.min === "number";
1516
+ var max = typeof rule.max === "number";
1517
+ var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
1518
+ var val = value;
1519
+ var key = null;
1520
+ var num = typeof value === "number";
1521
+ var str = typeof value === "string";
1522
+ var arr = Array.isArray(value);
1523
+ if (num) {
1524
+ key = "number";
1525
+ } else if (str) {
1526
+ key = "string";
1527
+ } else if (arr) {
1528
+ key = "array";
1529
+ }
1530
+ if (!key) {
1531
+ return false;
1532
+ }
1533
+ if (arr) {
1534
+ val = value.length;
1535
+ }
1536
+ if (str) {
1537
+ val = value.replace(spRegexp, "_").length;
1538
+ }
1539
+ if (len) {
1540
+ if (val !== rule.len) {
1541
+ errors.push(format(options.messages[key].len, rule.fullField, rule.len));
1542
+ }
1543
+ } else if (min && !max && val < rule.min) {
1544
+ errors.push(format(options.messages[key].min, rule.fullField, rule.min));
1545
+ } else if (max && !min && val > rule.max) {
1546
+ errors.push(format(options.messages[key].max, rule.fullField, rule.max));
1547
+ } else if (min && max && (val < rule.min || val > rule.max)) {
1548
+ errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
1549
+ }
1550
+ };
1551
+ var ENUM$1 = "enum";
1552
+ var enumerable$1 = function enumerable(rule, value, source, errors, options) {
1553
+ rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
1554
+ if (rule[ENUM$1].indexOf(value) === -1) {
1555
+ errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
1556
+ }
1557
+ };
1558
+ var pattern$1 = function pattern(rule, value, source, errors, options) {
1559
+ if (rule.pattern) {
1560
+ if (rule.pattern instanceof RegExp) {
1561
+ rule.pattern.lastIndex = 0;
1562
+ if (!rule.pattern.test(value)) {
1563
+ errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
1564
+ }
1565
+ } else if (typeof rule.pattern === "string") {
1566
+ var _pattern = new RegExp(rule.pattern);
1567
+ if (!_pattern.test(value)) {
1568
+ errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
1569
+ }
1570
+ }
1571
+ }
1572
+ };
1573
+ var rules = {
1574
+ required: required$1,
1575
+ whitespace,
1576
+ type: type$1,
1577
+ range,
1578
+ "enum": enumerable$1,
1579
+ pattern: pattern$1
1580
+ };
1581
+ var string = function string2(rule, value, callback, source, options) {
1582
+ var errors = [];
1583
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1584
+ if (validate) {
1585
+ if (isEmptyValue(value, "string") && !rule.required) {
1586
+ return callback();
1587
+ }
1588
+ rules.required(rule, value, source, errors, options, "string");
1589
+ if (!isEmptyValue(value, "string")) {
1590
+ rules.type(rule, value, source, errors, options);
1591
+ rules.range(rule, value, source, errors, options);
1592
+ rules.pattern(rule, value, source, errors, options);
1593
+ if (rule.whitespace === true) {
1594
+ rules.whitespace(rule, value, source, errors, options);
1595
+ }
1596
+ }
1597
+ }
1598
+ callback(errors);
1599
+ };
1600
+ var method2 = function method3(rule, value, callback, source, options) {
1601
+ var errors = [];
1602
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1603
+ if (validate) {
1604
+ if (isEmptyValue(value) && !rule.required) {
1605
+ return callback();
1606
+ }
1607
+ rules.required(rule, value, source, errors, options);
1608
+ if (value !== void 0) {
1609
+ rules.type(rule, value, source, errors, options);
1610
+ }
1611
+ }
1612
+ callback(errors);
1613
+ };
1614
+ var number2 = function number3(rule, value, callback, source, options) {
1615
+ var errors = [];
1616
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1617
+ if (validate) {
1618
+ if (value === "") {
1619
+ value = void 0;
1620
+ }
1621
+ if (isEmptyValue(value) && !rule.required) {
1622
+ return callback();
1623
+ }
1624
+ rules.required(rule, value, source, errors, options);
1625
+ if (value !== void 0) {
1626
+ rules.type(rule, value, source, errors, options);
1627
+ rules.range(rule, value, source, errors, options);
1628
+ }
1629
+ }
1630
+ callback(errors);
1631
+ };
1632
+ var _boolean = function _boolean2(rule, value, callback, source, options) {
1633
+ var errors = [];
1634
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1635
+ if (validate) {
1636
+ if (isEmptyValue(value) && !rule.required) {
1637
+ return callback();
1638
+ }
1639
+ rules.required(rule, value, source, errors, options);
1640
+ if (value !== void 0) {
1641
+ rules.type(rule, value, source, errors, options);
1642
+ }
1643
+ }
1644
+ callback(errors);
1645
+ };
1646
+ var regexp2 = function regexp3(rule, value, callback, source, options) {
1647
+ var errors = [];
1648
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1649
+ if (validate) {
1650
+ if (isEmptyValue(value) && !rule.required) {
1651
+ return callback();
1652
+ }
1653
+ rules.required(rule, value, source, errors, options);
1654
+ if (!isEmptyValue(value)) {
1655
+ rules.type(rule, value, source, errors, options);
1656
+ }
1657
+ }
1658
+ callback(errors);
1659
+ };
1660
+ var integer2 = function integer3(rule, value, callback, source, options) {
1661
+ var errors = [];
1662
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1663
+ if (validate) {
1664
+ if (isEmptyValue(value) && !rule.required) {
1665
+ return callback();
1666
+ }
1667
+ rules.required(rule, value, source, errors, options);
1668
+ if (value !== void 0) {
1669
+ rules.type(rule, value, source, errors, options);
1670
+ rules.range(rule, value, source, errors, options);
1671
+ }
1672
+ }
1673
+ callback(errors);
1674
+ };
1675
+ var floatFn = function floatFn2(rule, value, callback, source, options) {
1676
+ var errors = [];
1677
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1678
+ if (validate) {
1679
+ if (isEmptyValue(value) && !rule.required) {
1680
+ return callback();
1681
+ }
1682
+ rules.required(rule, value, source, errors, options);
1683
+ if (value !== void 0) {
1684
+ rules.type(rule, value, source, errors, options);
1685
+ rules.range(rule, value, source, errors, options);
1686
+ }
1687
+ }
1688
+ callback(errors);
1689
+ };
1690
+ var array2 = function array3(rule, value, callback, source, options) {
1691
+ var errors = [];
1692
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1693
+ if (validate) {
1694
+ if ((value === void 0 || value === null) && !rule.required) {
1695
+ return callback();
1696
+ }
1697
+ rules.required(rule, value, source, errors, options, "array");
1698
+ if (value !== void 0 && value !== null) {
1699
+ rules.type(rule, value, source, errors, options);
1700
+ rules.range(rule, value, source, errors, options);
1701
+ }
1702
+ }
1703
+ callback(errors);
1704
+ };
1705
+ var object2 = function object3(rule, value, callback, source, options) {
1706
+ var errors = [];
1707
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1708
+ if (validate) {
1709
+ if (isEmptyValue(value) && !rule.required) {
1710
+ return callback();
1711
+ }
1712
+ rules.required(rule, value, source, errors, options);
1713
+ if (value !== void 0) {
1714
+ rules.type(rule, value, source, errors, options);
1715
+ }
1716
+ }
1717
+ callback(errors);
1718
+ };
1719
+ var ENUM = "enum";
1720
+ var enumerable2 = function enumerable3(rule, value, callback, source, options) {
1721
+ var errors = [];
1722
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1723
+ if (validate) {
1724
+ if (isEmptyValue(value) && !rule.required) {
1725
+ return callback();
1726
+ }
1727
+ rules.required(rule, value, source, errors, options);
1728
+ if (value !== void 0) {
1729
+ rules[ENUM](rule, value, source, errors, options);
1730
+ }
1731
+ }
1732
+ callback(errors);
1733
+ };
1734
+ var pattern2 = function pattern3(rule, value, callback, source, options) {
1735
+ var errors = [];
1736
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1737
+ if (validate) {
1738
+ if (isEmptyValue(value, "string") && !rule.required) {
1739
+ return callback();
1740
+ }
1741
+ rules.required(rule, value, source, errors, options);
1742
+ if (!isEmptyValue(value, "string")) {
1743
+ rules.pattern(rule, value, source, errors, options);
1744
+ }
1745
+ }
1746
+ callback(errors);
1747
+ };
1748
+ var date2 = function date3(rule, value, callback, source, options) {
1749
+ var errors = [];
1750
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1751
+ if (validate) {
1752
+ if (isEmptyValue(value, "date") && !rule.required) {
1753
+ return callback();
1754
+ }
1755
+ rules.required(rule, value, source, errors, options);
1756
+ if (!isEmptyValue(value, "date")) {
1757
+ var dateObject;
1758
+ if (value instanceof Date) {
1759
+ dateObject = value;
1760
+ } else {
1761
+ dateObject = new Date(value);
1762
+ }
1763
+ rules.type(rule, dateObject, source, errors, options);
1764
+ if (dateObject) {
1765
+ rules.range(rule, dateObject.getTime(), source, errors, options);
1766
+ }
1767
+ }
1768
+ }
1769
+ callback(errors);
1770
+ };
1771
+ var required2 = function required3(rule, value, callback, source, options) {
1772
+ var errors = [];
1773
+ var type4 = Array.isArray(value) ? "array" : typeof value;
1774
+ rules.required(rule, value, source, errors, options, type4);
1775
+ callback(errors);
1776
+ };
1777
+ var type2 = function type3(rule, value, callback, source, options) {
1778
+ var ruleType = rule.type;
1779
+ var errors = [];
1780
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1781
+ if (validate) {
1782
+ if (isEmptyValue(value, ruleType) && !rule.required) {
1783
+ return callback();
1784
+ }
1785
+ rules.required(rule, value, source, errors, options, ruleType);
1786
+ if (!isEmptyValue(value, ruleType)) {
1787
+ rules.type(rule, value, source, errors, options);
1788
+ }
1789
+ }
1790
+ callback(errors);
1791
+ };
1792
+ var any = function any2(rule, value, callback, source, options) {
1793
+ var errors = [];
1794
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
1795
+ if (validate) {
1796
+ if (isEmptyValue(value) && !rule.required) {
1797
+ return callback();
1798
+ }
1799
+ rules.required(rule, value, source, errors, options);
1800
+ }
1801
+ callback(errors);
1802
+ };
1803
+ var validators = {
1804
+ string,
1805
+ method: method2,
1806
+ number: number2,
1807
+ "boolean": _boolean,
1808
+ regexp: regexp2,
1809
+ integer: integer2,
1810
+ "float": floatFn,
1811
+ array: array2,
1812
+ object: object2,
1813
+ "enum": enumerable2,
1814
+ pattern: pattern2,
1815
+ date: date2,
1816
+ url: type2,
1817
+ hex: type2,
1818
+ email: type2,
1819
+ required: required2,
1820
+ any
1821
+ };
1822
+ function newMessages() {
1823
+ return {
1824
+ "default": "Validation error on field %s",
1825
+ required: "%s is required",
1826
+ "enum": "%s must be one of %s",
1827
+ whitespace: "%s cannot be empty",
1828
+ date: {
1829
+ format: "%s date %s is invalid for format %s",
1830
+ parse: "%s date could not be parsed, %s is invalid ",
1831
+ invalid: "%s date %s is invalid"
1832
+ },
1833
+ types: {
1834
+ string: "%s is not a %s",
1835
+ method: "%s is not a %s (function)",
1836
+ array: "%s is not an %s",
1837
+ object: "%s is not an %s",
1838
+ number: "%s is not a %s",
1839
+ date: "%s is not a %s",
1840
+ "boolean": "%s is not a %s",
1841
+ integer: "%s is not an %s",
1842
+ "float": "%s is not a %s",
1843
+ regexp: "%s is not a valid %s",
1844
+ email: "%s is not a valid %s",
1845
+ url: "%s is not a valid %s",
1846
+ hex: "%s is not a valid %s"
1847
+ },
1848
+ string: {
1849
+ len: "%s must be exactly %s characters",
1850
+ min: "%s must be at least %s characters",
1851
+ max: "%s cannot be longer than %s characters",
1852
+ range: "%s must be between %s and %s characters"
1853
+ },
1854
+ number: {
1855
+ len: "%s must equal %s",
1856
+ min: "%s cannot be less than %s",
1857
+ max: "%s cannot be greater than %s",
1858
+ range: "%s must be between %s and %s"
1859
+ },
1860
+ array: {
1861
+ len: "%s must be exactly %s in length",
1862
+ min: "%s cannot be less than %s in length",
1863
+ max: "%s cannot be greater than %s in length",
1864
+ range: "%s must be between %s and %s in length"
1865
+ },
1866
+ pattern: {
1867
+ mismatch: "%s value %s does not match pattern %s"
1868
+ },
1869
+ clone: function clone() {
1870
+ var cloned = JSON.parse(JSON.stringify(this));
1871
+ cloned.clone = this.clone;
1872
+ return cloned;
1873
+ }
1874
+ };
1875
+ }
1876
+ var messages = newMessages();
1877
+ var Schema = /* @__PURE__ */ function() {
1878
+ function Schema2(descriptor) {
1879
+ this.rules = null;
1880
+ this._messages = messages;
1881
+ this.define(descriptor);
1882
+ }
1883
+ var _proto = Schema2.prototype;
1884
+ _proto.define = function define(rules2) {
1885
+ var _this = this;
1886
+ if (!rules2) {
1887
+ throw new Error("Cannot configure a schema with no rules");
1888
+ }
1889
+ if (typeof rules2 !== "object" || Array.isArray(rules2)) {
1890
+ throw new Error("Rules must be an object");
1891
+ }
1892
+ this.rules = {};
1893
+ Object.keys(rules2).forEach(function(name) {
1894
+ var item = rules2[name];
1895
+ _this.rules[name] = Array.isArray(item) ? item : [item];
1896
+ });
1897
+ };
1898
+ _proto.messages = function messages2(_messages) {
1899
+ if (_messages) {
1900
+ this._messages = deepMerge(newMessages(), _messages);
1901
+ }
1902
+ return this._messages;
1903
+ };
1904
+ _proto.validate = function validate(source_, o, oc) {
1905
+ var _this2 = this;
1906
+ if (o === void 0) {
1907
+ o = {};
1908
+ }
1909
+ if (oc === void 0) {
1910
+ oc = function oc2() {
1911
+ };
1912
+ }
1913
+ var source = source_;
1914
+ var options = o;
1915
+ var callback = oc;
1916
+ if (typeof options === "function") {
1917
+ callback = options;
1918
+ options = {};
1919
+ }
1920
+ if (!this.rules || Object.keys(this.rules).length === 0) {
1921
+ if (callback) {
1922
+ callback(null, source);
1923
+ }
1924
+ return Promise.resolve(source);
1925
+ }
1926
+ function complete(results) {
1927
+ var errors = [];
1928
+ var fields = {};
1929
+ function add(e) {
1930
+ if (Array.isArray(e)) {
1931
+ var _errors;
1932
+ errors = (_errors = errors).concat.apply(_errors, e);
1933
+ } else {
1934
+ errors.push(e);
1935
+ }
1936
+ }
1937
+ for (var i = 0; i < results.length; i++) {
1938
+ add(results[i]);
1939
+ }
1940
+ if (!errors.length) {
1941
+ callback(null, source);
1942
+ } else {
1943
+ fields = convertFieldsError(errors);
1944
+ callback(errors, fields);
1945
+ }
1946
+ }
1947
+ if (options.messages) {
1948
+ var messages$1 = this.messages();
1949
+ if (messages$1 === messages) {
1950
+ messages$1 = newMessages();
1951
+ }
1952
+ deepMerge(messages$1, options.messages);
1953
+ options.messages = messages$1;
1954
+ } else {
1955
+ options.messages = this.messages();
1956
+ }
1957
+ var series = {};
1958
+ var keys = options.keys || Object.keys(this.rules);
1959
+ keys.forEach(function(z) {
1960
+ var arr = _this2.rules[z];
1961
+ var value = source[z];
1962
+ arr.forEach(function(r) {
1963
+ var rule = r;
1964
+ if (typeof rule.transform === "function") {
1965
+ if (source === source_) {
1966
+ source = _extends({}, source);
1967
+ }
1968
+ value = source[z] = rule.transform(value);
1969
+ }
1970
+ if (typeof rule === "function") {
1971
+ rule = {
1972
+ validator: rule
1973
+ };
1974
+ } else {
1975
+ rule = _extends({}, rule);
1976
+ }
1977
+ rule.validator = _this2.getValidationMethod(rule);
1978
+ if (!rule.validator) {
1979
+ return;
1980
+ }
1981
+ rule.field = z;
1982
+ rule.fullField = rule.fullField || z;
1983
+ rule.type = _this2.getType(rule);
1984
+ series[z] = series[z] || [];
1985
+ series[z].push({
1986
+ rule,
1987
+ value,
1988
+ source,
1989
+ field: z
1990
+ });
1991
+ });
1992
+ });
1993
+ var errorFields = {};
1994
+ return asyncMap(series, options, function(data, doIt) {
1995
+ var rule = data.rule;
1996
+ var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
1997
+ deep = deep && (rule.required || !rule.required && data.value);
1998
+ rule.field = data.field;
1999
+ function addFullField(key, schema) {
2000
+ return _extends({}, schema, {
2001
+ fullField: rule.fullField + "." + key,
2002
+ fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
2003
+ });
2004
+ }
2005
+ function cb(e) {
2006
+ if (e === void 0) {
2007
+ e = [];
2008
+ }
2009
+ var errorList = Array.isArray(e) ? e : [e];
2010
+ if (!options.suppressWarning && errorList.length) {
2011
+ Schema2.warning("async-validator:", errorList);
2012
+ }
2013
+ if (errorList.length && rule.message !== void 0) {
2014
+ errorList = [].concat(rule.message);
2015
+ }
2016
+ var filledErrors = errorList.map(complementError(rule, source));
2017
+ if (options.first && filledErrors.length) {
2018
+ errorFields[rule.field] = 1;
2019
+ return doIt(filledErrors);
2020
+ }
2021
+ if (!deep) {
2022
+ doIt(filledErrors);
2023
+ } else {
2024
+ if (rule.required && !data.value) {
2025
+ if (rule.message !== void 0) {
2026
+ filledErrors = [].concat(rule.message).map(complementError(rule, source));
2027
+ } else if (options.error) {
2028
+ filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
2029
+ }
2030
+ return doIt(filledErrors);
2031
+ }
2032
+ var fieldsSchema = {};
2033
+ if (rule.defaultField) {
2034
+ Object.keys(data.value).map(function(key) {
2035
+ fieldsSchema[key] = rule.defaultField;
2036
+ });
2037
+ }
2038
+ fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
2039
+ var paredFieldsSchema = {};
2040
+ Object.keys(fieldsSchema).forEach(function(field) {
2041
+ var fieldSchema = fieldsSchema[field];
2042
+ var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
2043
+ paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
2044
+ });
2045
+ var schema = new Schema2(paredFieldsSchema);
2046
+ schema.messages(options.messages);
2047
+ if (data.rule.options) {
2048
+ data.rule.options.messages = options.messages;
2049
+ data.rule.options.error = options.error;
2050
+ }
2051
+ schema.validate(data.value, data.rule.options || options, function(errs) {
2052
+ var finalErrors = [];
2053
+ if (filledErrors && filledErrors.length) {
2054
+ finalErrors.push.apply(finalErrors, filledErrors);
2055
+ }
2056
+ if (errs && errs.length) {
2057
+ finalErrors.push.apply(finalErrors, errs);
2058
+ }
2059
+ doIt(finalErrors.length ? finalErrors : null);
2060
+ });
2061
+ }
2062
+ }
2063
+ var res;
2064
+ if (rule.asyncValidator) {
2065
+ res = rule.asyncValidator(rule, data.value, cb, data.source, options);
2066
+ } else if (rule.validator) {
2067
+ res = rule.validator(rule, data.value, cb, data.source, options);
2068
+ if (res === true) {
2069
+ cb();
2070
+ } else if (res === false) {
2071
+ cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
2072
+ } else if (res instanceof Array) {
2073
+ cb(res);
2074
+ } else if (res instanceof Error) {
2075
+ cb(res.message);
2076
+ }
2077
+ }
2078
+ if (res && res.then) {
2079
+ res.then(function() {
2080
+ return cb();
2081
+ }, function(e) {
2082
+ return cb(e);
2083
+ });
2084
+ }
2085
+ }, function(results) {
2086
+ complete(results);
2087
+ }, source);
2088
+ };
2089
+ _proto.getType = function getType(rule) {
2090
+ if (rule.type === void 0 && rule.pattern instanceof RegExp) {
2091
+ rule.type = "pattern";
2092
+ }
2093
+ if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
2094
+ throw new Error(format("Unknown rule type %s", rule.type));
2095
+ }
2096
+ return rule.type || "string";
2097
+ };
2098
+ _proto.getValidationMethod = function getValidationMethod(rule) {
2099
+ if (typeof rule.validator === "function") {
2100
+ return rule.validator;
2101
+ }
2102
+ var keys = Object.keys(rule);
2103
+ var messageIndex = keys.indexOf("message");
2104
+ if (messageIndex !== -1) {
2105
+ keys.splice(messageIndex, 1);
2106
+ }
2107
+ if (keys.length === 1 && keys[0] === "required") {
2108
+ return validators.required;
2109
+ }
2110
+ return validators[this.getType(rule)] || void 0;
2111
+ };
2112
+ return Schema2;
2113
+ }();
2114
+ Schema.register = function register(type4, validator) {
2115
+ if (typeof validator !== "function") {
2116
+ throw new Error("Cannot register a validator by type, validator is not a function");
2117
+ }
2118
+ validators[type4] = validator;
2119
+ };
2120
+ Schema.warning = warning;
2121
+ Schema.messages = messages;
2122
+ Schema.validators = validators;
2123
+ const DEFAUTL_MODE = "rgb";
2124
+ const MODE_SUPPORT = ["rgb", "hex", "hsl", "hsv"];
2125
+ const colorRules = {
2126
+ alpha: [{
2127
+ type: "number",
2128
+ required: true,
2129
+ min: 0,
2130
+ max: 1
2131
+ }],
2132
+ hex: [{
2133
+ type: "string",
2134
+ pattern: /^#[0-9a-fA-F]{6}/
2135
+ }],
2136
+ hexa: [{
2137
+ type: "string",
2138
+ pattern: /^#[0-9a-fA-F]{6,8}/
2139
+ }],
2140
+ rgba: {
2141
+ type: "object",
2142
+ required: true,
2143
+ fields: {
2144
+ r: {
2145
+ type: "number",
2146
+ required: true,
2147
+ min: 0,
2148
+ max: 255
2149
+ },
2150
+ g: {
2151
+ type: "number",
2152
+ required: true,
2153
+ min: 0,
2154
+ max: 255
2155
+ },
2156
+ b: {
2157
+ type: "number",
2158
+ required: true,
2159
+ min: 0,
2160
+ max: 255
2161
+ },
2162
+ a: {
2163
+ type: "number",
2164
+ required: true,
2165
+ min: 0,
2166
+ max: 1
2167
+ }
2168
+ }
2169
+ },
2170
+ hsla: {
2171
+ type: "object",
2172
+ required: true,
2173
+ fields: {
2174
+ h: {
2175
+ type: "number",
2176
+ required: true,
2177
+ min: 0,
2178
+ max: 360
2179
+ },
2180
+ s: {
2181
+ type: "number",
2182
+ required: true,
2183
+ min: 0,
2184
+ max: 1
2185
+ },
2186
+ l: {
2187
+ type: "number",
2188
+ required: true,
2189
+ min: 0,
2190
+ max: 1
2191
+ },
2192
+ a: {
2193
+ type: "number",
2194
+ required: true,
2195
+ min: 0,
2196
+ max: 1
2197
+ }
2198
+ }
2199
+ },
2200
+ hsva: {
2201
+ type: "object",
2202
+ required: true,
2203
+ fields: {
2204
+ h: {
2205
+ type: "number",
2206
+ required: true,
2207
+ min: 0,
2208
+ max: 360
2209
+ },
2210
+ s: {
2211
+ type: "number",
2212
+ required: true,
2213
+ min: 0,
2214
+ max: 1
2215
+ },
2216
+ v: {
2217
+ type: "number",
2218
+ required: true,
2219
+ min: 0,
2220
+ max: 1
2221
+ },
2222
+ a: {
2223
+ type: "number",
2224
+ required: true,
2225
+ min: 0,
2226
+ max: 1
2227
+ }
2228
+ }
2229
+ }
2230
+ };
2231
+ var colorEdit = defineComponent({
2232
+ name: "ColorEdit",
2233
+ props: colorPickerEditProps,
2234
+ emits: ["changeTextModeColor", "update:modelValue"],
2235
+ setup(props, {
2236
+ emit
2237
+ }) {
2238
+ const isShowAlpha = inject("provideData");
2239
+ const modelValue = computed(() => {
2240
+ var _a;
2241
+ return `${(_a = props.mode) != null ? _a : DEFAUTL_MODE}${isShowAlpha.showAlpha ? "a" : ""}`;
2242
+ });
2243
+ const colorValue = ref(props.color);
2244
+ const modelValueType = computed(() => {
2245
+ var _a;
2246
+ return ((_a = props.mode) != null ? _a : DEFAUTL_MODE) === "hex" ? "string" : "number";
2247
+ });
2248
+ function getValidColor(color2) {
2249
+ const validator = new Schema(colorRules);
2250
+ return new Promise((resolve, reject) => {
2251
+ validator.validate(color2, (errors) => {
2252
+ errors && console.warn("\u8272\u503C\u6821\u9A8C\u5F02\u5E38:", errors);
2253
+ errors ? reject() : resolve(color2);
2254
+ });
2255
+ });
2256
+ }
2257
+ function onChangeModel() {
2258
+ const currentIndex = MODE_SUPPORT.findIndex((x) => x === props.mode);
2259
+ const mode = MODE_SUPPORT[(currentIndex + 1) % MODE_SUPPORT.length];
2260
+ emit("changeTextModeColor", mode);
2261
+ }
2262
+ function renderStringValue() {
2263
+ const key = modelValue.value;
2264
+ const value = colorValue.value[key];
2265
+ const getConvertColor = (v) => {
2266
+ const from = isShowAlpha.showAlpha ? fromHexa : fromHex;
2267
+ const color2 = from(v);
2268
+ return getValidColor(color2);
2269
+ };
2270
+ const updateValue = async (event) => {
2271
+ const target = event.target;
2272
+ getConvertColor(target.value).then((color2) => colorValue.value = color2).catch(() => target.value = value);
2273
+ };
2274
+ return createVNode("div", {
2275
+ "class": "devui-color-picker-edit-input string-input flex"
2276
+ }, [createVNode("div", {
2277
+ "class": "devui-color-picker-edit-input-wrapper"
2278
+ }, [createVNode("input", {
2279
+ "value": value,
2280
+ "onChange": updateValue,
2281
+ "class": "devui-color-picker-edit-input-value"
2282
+ }, null)])]);
2283
+ }
2284
+ function renderNumberValue() {
2285
+ const scaleKeys = ["s", "v", "l"];
2286
+ const percentKeys = ["a"];
2287
+ const key = modelValue.value;
2288
+ const value = colorValue.value[key.replace(/a?$/, "a")];
2289
+ const getConvertColor = (model) => {
2290
+ const {
2291
+ from
2292
+ } = [{
2293
+ mode: ["rgb", "rgba"],
2294
+ from: fromRGBA
2295
+ }, {
2296
+ mode: ["hsv", "hsva"],
2297
+ from: fromHSVA
2298
+ }, {
2299
+ mode: ["hsl", "hsla"],
2300
+ from: fromHSLA
2301
+ }].find((x) => x.mode.includes(key));
2302
+ const color2 = from(isShowAlpha.showAlpha ? model : __spreadProps(__spreadValues({}, model), {
2303
+ a: 1
2304
+ }));
2305
+ return getValidColor(color2);
2306
+ };
2307
+ const updateValue = (k) => async (event) => {
2308
+ const target = event.target;
2309
+ getConvertColor(__spreadProps(__spreadValues({}, value), {
2310
+ [k]: parseValue(k, target.value)
2311
+ })).then((color2) => colorValue.value = color2).catch(() => target.value = formatValue(k, value[k]));
2312
+ };
2313
+ function formatValue(k, v) {
2314
+ switch (true) {
2315
+ case scaleKeys.includes(k):
2316
+ return (v * 100).toFixed();
2317
+ case percentKeys.includes(k):
2318
+ return `${Math.round(v * 100)}%`;
2319
+ default:
2320
+ return v.toString();
2321
+ }
2322
+ }
2323
+ function parseValue(k, v) {
2324
+ switch (true) {
2325
+ case scaleKeys.includes(k):
2326
+ return parseFloat((parseInt(v) / 100).toFixed(2));
2327
+ case percentKeys.includes(k):
2328
+ return parseFloat((parseInt(v.replace(/%$/, "")) / 100).toFixed(2));
2329
+ default:
2330
+ return Number(v);
2331
+ }
2332
+ }
2333
+ function onKeyChangeValue() {
2334
+ return (e) => {
2335
+ const target = e.target;
2336
+ const changeValue = {
2337
+ ArrowUp: 1,
2338
+ ArrowDown: -1
2339
+ }[e.code];
2340
+ if (changeValue !== void 0) {
2341
+ e.preventDefault();
2342
+ const [v] = target.value.match(/\d+/g);
2343
+ const newValue = (parseInt(v) + changeValue).toString();
2344
+ target.value = target.value.replace(/\d+/g, newValue);
2345
+ target.dispatchEvent(new CustomEvent("change"));
2346
+ }
2347
+ };
2348
+ }
2349
+ return createVNode("div", {
2350
+ "class": "devui-color-picker-edit-input number-input flex"
2351
+ }, [key.split("").map((k) => createVNode("div", {
2352
+ "class": "devui-color-picker-edit-input-wrapper"
2353
+ }, [createVNode("input", {
2354
+ "onKeydown": onKeyChangeValue(),
2355
+ "class": "devui-color-picker-edit-input-value",
2356
+ "value": formatValue(k, value[k]),
2357
+ "onChange": updateValue(k)
2358
+ }, null)]))]);
2359
+ }
2360
+ function renderValueInput() {
2361
+ switch (modelValueType.value) {
2362
+ case "string":
2363
+ return renderStringValue();
2364
+ case "number":
2365
+ return renderNumberValue();
2366
+ }
2367
+ }
2368
+ return () => createVNode("div", {
2369
+ "class": "devui-color-picker-edit flex"
2370
+ }, [createVNode("div", {
2371
+ "class": "devui-color-picker-edit-name",
2372
+ "onClick": onChangeModel
2373
+ }, [modelValue.value.toUpperCase()]), renderValueInput()]);
2374
+ }
2375
+ });
2376
+ const colorPickerBasicColorProps = {
2377
+ color: {
2378
+ type: Object
2379
+ }
2380
+ };
2381
+ var colorBasic$1 = "";
2382
+ const color = [
2383
+ "#ffffff",
2384
+ "#ffd7d5",
2385
+ "#ffdaa9",
2386
+ "#fffed5",
2387
+ "#d4fa00",
2388
+ "#73fcd6",
2389
+ "#a5c8ff",
2390
+ "#ffacd5",
2391
+ "#ff7faa",
2392
+ "#d6d6d6",
2393
+ "#ffacaa",
2394
+ "#ffb995",
2395
+ "#fffb00",
2396
+ "#73fa79",
2397
+ "#00fcff",
2398
+ "#78acfe",
2399
+ "#d84fa9",
2400
+ "#ff4f79",
2401
+ "#b2b2b2",
2402
+ "#d7aba9",
2403
+ "#ff6827",
2404
+ "#ffda51",
2405
+ "#00d100",
2406
+ "#00d5ff",
2407
+ "#0080ff",
2408
+ "#ac39ff",
2409
+ "#ff2941",
2410
+ "#888888",
2411
+ "#7a4442",
2412
+ "#ff4c00",
2413
+ "#ffa900",
2414
+ "#3da742",
2415
+ "#3daad6",
2416
+ "#0052ff",
2417
+ "#7a4fd6",
2418
+ "#d92142",
2419
+ "#000000",
2420
+ "#7b0c00",
2421
+ "#ff4c41",
2422
+ "#d6a841",
2423
+ "#407600",
2424
+ "#007aaa",
2425
+ "#021eaa",
2426
+ "#797baa",
2427
+ "#ab1942"
2428
+ ];
2429
+ var colorBasic = defineComponent({
2430
+ name: "ColorBasic",
2431
+ props: colorPickerBasicColorProps,
2432
+ setup(props) {
2433
+ var _a;
2434
+ const swatchesInject = inject("provideData");
2435
+ const currentColor = ref(props.color);
2436
+ function changeBasicColor(hex2) {
2437
+ currentColor.value = fromHex(hex2);
2438
+ }
2439
+ const swatches = ref(Object.values((_a = swatchesInject.swatches) != null ? _a : []));
2440
+ return () => {
2441
+ return createVNode("div", {
2442
+ "class": "devui-color-picker-basic flex"
2443
+ }, [(swatches.value.length !== 0 ? swatches.value : color).map((hex2) => createVNode("div", {
2444
+ "onClick": () => changeBasicColor(hex2),
2445
+ "class": ["devui-color-picker-basic-div"],
2446
+ "style": {
2447
+ backgroundColor: hex2
2448
+ }
2449
+ }, null))]);
2450
+ };
2451
+ }
2452
+ });
2453
+ var colorPickerPanel = "";
2454
+ const colorPickerHistoryProps = {
2455
+ color: {
2456
+ type: Object
2457
+ }
2458
+ };
2459
+ var Icon = defineComponent({
2460
+ name: "DIcon",
2461
+ props: {
2462
+ name: {
2463
+ type: String,
2464
+ required: true
2465
+ },
2466
+ size: {
2467
+ type: String,
2468
+ default: "inherit"
2469
+ },
2470
+ color: {
2471
+ type: String,
2472
+ default: "inherit"
2473
+ },
2474
+ classPrefix: {
2475
+ type: String,
2476
+ default: "icon"
2477
+ }
2478
+ },
2479
+ setup(props) {
2480
+ return __spreadValues({}, props);
2481
+ },
2482
+ render() {
2483
+ const {
2484
+ name,
2485
+ size,
2486
+ color: color2,
2487
+ classPrefix
2488
+ } = this;
2489
+ return /^((https?):)?\/\//.test(name) ? createVNode("img", {
2490
+ "src": name,
2491
+ "alt": name.split("/")[name.split("/").length - 1],
2492
+ "style": {
2493
+ width: size,
2494
+ verticalAlign: "text-bottom"
2495
+ }
2496
+ }, null) : createVNode("i", {
2497
+ "class": `${classPrefix} ${classPrefix}-${name}`,
2498
+ "style": {
2499
+ fontSize: size,
2500
+ color: color2
2501
+ }
2502
+ }, null);
2503
+ }
2504
+ });
2505
+ Icon.install = function(app) {
2506
+ app.component(Icon.name, Icon);
2507
+ };
2508
+ var colorHistory$1 = "";
2509
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
2510
+ var freeGlobal$1 = freeGlobal;
2511
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
2512
+ var root = freeGlobal$1 || freeSelf || Function("return this")();
2513
+ var root$1 = root;
2514
+ var Symbol$1 = root$1.Symbol;
2515
+ var Symbol$2 = Symbol$1;
2516
+ var objectProto$1 = Object.prototype;
2517
+ var hasOwnProperty = objectProto$1.hasOwnProperty;
2518
+ var nativeObjectToString$1 = objectProto$1.toString;
2519
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
2520
+ function getRawTag(value) {
2521
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
2522
+ try {
2523
+ value[symToStringTag$1] = void 0;
2524
+ var unmasked = true;
2525
+ } catch (e) {
2526
+ }
2527
+ var result = nativeObjectToString$1.call(value);
2528
+ if (unmasked) {
2529
+ if (isOwn) {
2530
+ value[symToStringTag$1] = tag;
2531
+ } else {
2532
+ delete value[symToStringTag$1];
2533
+ }
2534
+ }
2535
+ return result;
2536
+ }
2537
+ var objectProto = Object.prototype;
2538
+ var nativeObjectToString = objectProto.toString;
2539
+ function objectToString(value) {
2540
+ return nativeObjectToString.call(value);
2541
+ }
2542
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
2543
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
2544
+ function baseGetTag(value) {
2545
+ if (value == null) {
2546
+ return value === void 0 ? undefinedTag : nullTag;
2547
+ }
2548
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
2549
+ }
2550
+ function isObjectLike(value) {
2551
+ return value != null && typeof value == "object";
2552
+ }
2553
+ var symbolTag = "[object Symbol]";
2554
+ function isSymbol(value) {
2555
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
2556
+ }
2557
+ var reWhitespace = /\s/;
2558
+ function trimmedEndIndex(string3) {
2559
+ var index2 = string3.length;
2560
+ while (index2-- && reWhitespace.test(string3.charAt(index2))) {
2561
+ }
2562
+ return index2;
2563
+ }
2564
+ var reTrimStart = /^\s+/;
2565
+ function baseTrim(string3) {
2566
+ return string3 ? string3.slice(0, trimmedEndIndex(string3) + 1).replace(reTrimStart, "") : string3;
2567
+ }
2568
+ function isObject(value) {
2569
+ var type4 = typeof value;
2570
+ return value != null && (type4 == "object" || type4 == "function");
2571
+ }
2572
+ var NAN = 0 / 0;
2573
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
2574
+ var reIsBinary = /^0b[01]+$/i;
2575
+ var reIsOctal = /^0o[0-7]+$/i;
2576
+ var freeParseInt = parseInt;
2577
+ function toNumber(value) {
2578
+ if (typeof value == "number") {
2579
+ return value;
2580
+ }
2581
+ if (isSymbol(value)) {
2582
+ return NAN;
2583
+ }
2584
+ if (isObject(value)) {
2585
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
2586
+ value = isObject(other) ? other + "" : other;
2587
+ }
2588
+ if (typeof value != "string") {
2589
+ return value === 0 ? value : +value;
2590
+ }
2591
+ value = baseTrim(value);
2592
+ var isBinary = reIsBinary.test(value);
2593
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
2594
+ }
2595
+ var now = function() {
2596
+ return root$1.Date.now();
2597
+ };
2598
+ var now$1 = now;
2599
+ var FUNC_ERROR_TEXT = "Expected a function";
2600
+ var nativeMax = Math.max, nativeMin = Math.min;
2601
+ function debounce(func, wait, options) {
2602
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
2603
+ if (typeof func != "function") {
2604
+ throw new TypeError(FUNC_ERROR_TEXT);
2605
+ }
2606
+ wait = toNumber(wait) || 0;
2607
+ if (isObject(options)) {
2608
+ leading = !!options.leading;
2609
+ maxing = "maxWait" in options;
2610
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
2611
+ trailing = "trailing" in options ? !!options.trailing : trailing;
2612
+ }
2613
+ function invokeFunc(time) {
2614
+ var args = lastArgs, thisArg = lastThis;
2615
+ lastArgs = lastThis = void 0;
2616
+ lastInvokeTime = time;
2617
+ result = func.apply(thisArg, args);
2618
+ return result;
2619
+ }
2620
+ function leadingEdge(time) {
2621
+ lastInvokeTime = time;
2622
+ timerId = setTimeout(timerExpired, wait);
2623
+ return leading ? invokeFunc(time) : result;
2624
+ }
2625
+ function remainingWait(time) {
2626
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
2627
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
2628
+ }
2629
+ function shouldInvoke(time) {
2630
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
2631
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
2632
+ }
2633
+ function timerExpired() {
2634
+ var time = now$1();
2635
+ if (shouldInvoke(time)) {
2636
+ return trailingEdge(time);
2637
+ }
2638
+ timerId = setTimeout(timerExpired, remainingWait(time));
2639
+ }
2640
+ function trailingEdge(time) {
2641
+ timerId = void 0;
2642
+ if (trailing && lastArgs) {
2643
+ return invokeFunc(time);
2644
+ }
2645
+ lastArgs = lastThis = void 0;
2646
+ return result;
2647
+ }
2648
+ function cancel() {
2649
+ if (timerId !== void 0) {
2650
+ clearTimeout(timerId);
2651
+ }
2652
+ lastInvokeTime = 0;
2653
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
2654
+ }
2655
+ function flush() {
2656
+ return timerId === void 0 ? result : trailingEdge(now$1());
2657
+ }
2658
+ function debounced() {
2659
+ var time = now$1(), isInvoking = shouldInvoke(time);
2660
+ lastArgs = arguments;
2661
+ lastThis = this;
2662
+ lastCallTime = time;
2663
+ if (isInvoking) {
2664
+ if (timerId === void 0) {
2665
+ return leadingEdge(lastCallTime);
2666
+ }
2667
+ if (maxing) {
2668
+ clearTimeout(timerId);
2669
+ timerId = setTimeout(timerExpired, wait);
2670
+ return invokeFunc(lastCallTime);
2671
+ }
2672
+ }
2673
+ if (timerId === void 0) {
2674
+ timerId = setTimeout(timerExpired, wait);
2675
+ }
2676
+ return result;
2677
+ }
2678
+ debounced.cancel = cancel;
2679
+ debounced.flush = flush;
2680
+ return debounced;
2681
+ }
2682
+ const STORAGE_KEY = "STORAGE_COLOR_PICKER_HISTORY_KEY";
2683
+ const MAX_HISOTRY_COUNT = 8;
2684
+ function useStore(v, {
2685
+ storage
2686
+ } = {}) {
2687
+ const getDefaultValue = () => {
2688
+ if (storage) {
2689
+ return JSON.parse(localStorage.getItem(STORAGE_KEY)) || v;
2690
+ } else {
2691
+ return v;
2692
+ }
2693
+ };
2694
+ const store = ref(getDefaultValue());
2695
+ watch(store, (value) => {
2696
+ if (storage) {
2697
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(value));
2698
+ }
2699
+ });
2700
+ return store;
2701
+ }
2702
+ var colorHistory = defineComponent({
2703
+ name: "ColorEdit",
2704
+ components: {
2705
+ Icon
2706
+ },
2707
+ props: colorPickerHistoryProps,
2708
+ emits: ["update:color"],
2709
+ setup(props) {
2710
+ const alphaInject = inject("provideData");
2711
+ const history = useStore([], {
2712
+ storage: true
2713
+ });
2714
+ const color2 = ref(props.color);
2715
+ const updateHistory = debounce((value) => {
2716
+ const index2 = history.value.findIndex((x) => x === value.hexa || x.endsWith("00") && value.alpha === 0);
2717
+ if (index2 >= 0) {
2718
+ history.value.splice(index2, 1);
2719
+ }
2720
+ history.value = [alphaInject.showAlpha ? value.hexa : value.hex, ...history.value].slice(0, MAX_HISOTRY_COUNT);
2721
+ }, 100);
2722
+ watch(props.color, (value) => {
2723
+ updateHistory(value);
2724
+ });
2725
+ function onChangeColor(value) {
2726
+ color2.value = fromHexa(value);
2727
+ }
2728
+ return () => createVNode("div", {
2729
+ "class": "devui-color-picker-history flex flex-wrap"
2730
+ }, [history.value.map((hexa) => createVNode("div", {
2731
+ "onClick": () => onChangeColor(hexa),
2732
+ "class": ["devui-color-picker-history_color-box", hexa.endsWith("00") ? "transparent" : ""],
2733
+ "style": {
2734
+ backgroundColor: hexa
2735
+ }
2736
+ }, null))]);
2737
+ }
2738
+ });
2739
+ var colorPanel = defineComponent({
2740
+ name: "ColorPanel",
2741
+ components: {
2742
+ colorPalette,
2743
+ colorHueSlider,
2744
+ colorAlphaSlider,
2745
+ colorEdit,
2746
+ colorBasic,
2747
+ Tabs,
2748
+ colorHistory
2749
+ },
2750
+ props: colorPickerProps,
2751
+ emits: ["update:modelValue", "changeTextColor", "changeTiggerColor", "changePaletteColor", "changeTextModeType"],
2752
+ setup(props, {
2753
+ emit
2754
+ }) {
2755
+ const injectData = inject("provideData");
2756
+ const paletteElement = ref(null);
2757
+ const showAlpha = injectData.showAlpha;
2758
+ const tab = ref("basic");
2759
+ function changeTextColor(isChange) {
2760
+ emit("changeTextColor", isChange);
2761
+ }
2762
+ function changeTextModeColor(currentType) {
2763
+ emit("changeTextModeType", currentType);
2764
+ }
2765
+ const paletteColorMap = ref(props.modelValue);
2766
+ watch(() => paletteColorMap.value, (newValue) => {
2767
+ emit("update:modelValue", newValue);
2768
+ emit("changePaletteColor", newValue);
2769
+ nextTick(() => {
2770
+ paletteElement.value && paletteElement.value.renderCanvas();
2771
+ });
2772
+ });
2773
+ return () => {
2774
+ return createVNode("div", {
2775
+ "class": "devui-color-picker-panel"
2776
+ }, [createVNode(resolveComponent("d-tabs"), {
2777
+ "type": "tabs",
2778
+ "modelValue": tab.value,
2779
+ "onUpdate:modelValue": ($event) => tab.value = $event
2780
+ }, {
2781
+ default: () => [createVNode(resolveComponent("d-tab"), {
2782
+ "id": "basic",
2783
+ "title": "\u57FA\u7840\u9762\u677F",
2784
+ "tabId": "basic"
2785
+ }, {
2786
+ default: () => [createVNode(resolveComponent("color-basic"), {
2787
+ "color": paletteColorMap
2788
+ }, null)]
2789
+ }), createVNode(resolveComponent("d-tab"), {
2790
+ "id": "palette",
2791
+ "title": "\u9AD8\u7EA7\u9762\u677F",
2792
+ "tabId": "palette"
2793
+ }, {
2794
+ default: () => [createVNode(resolveComponent("color-palette"), {
2795
+ "ref": paletteElement,
2796
+ "modelValue": paletteColorMap.value,
2797
+ "onUpdate:modelValue": ($event) => paletteColorMap.value = $event,
2798
+ "onChangeTextColor": changeTextColor
2799
+ }, null)]
2800
+ })]
2801
+ }), createVNode(resolveComponent("color-hue-slider"), {
2802
+ "modelValue": paletteColorMap.value,
2803
+ "onUpdate:modelValue": ($event) => paletteColorMap.value = $event
2804
+ }, null), showAlpha ? createVNode(resolveComponent("color-alpha-slider"), {
2805
+ "modelValue": paletteColorMap.value,
2806
+ "onUpdate:modelValue": ($event) => paletteColorMap.value = $event
2807
+ }, null) : null, createVNode(colorEdit, {
2808
+ "show-alpha": props.showAlpha,
2809
+ "mode": props.mode,
2810
+ "color": paletteColorMap,
2811
+ "onChangeTextModeColor": changeTextModeColor
2812
+ }, null), injectData.showHistory ? createVNode(colorHistory, {
2813
+ "color": paletteColorMap
2814
+ }, null) : null]);
2815
+ };
2816
+ }
2817
+ });
2818
+ var colorPicker = "";
2819
+ var ColorPicker = defineComponent({
2820
+ name: "DColorPicker",
2821
+ components: {
2822
+ colorPanel
2823
+ },
2824
+ props: colorPickerProps$1,
2825
+ emits: ["update:modelValue"],
2826
+ setup(props, {
2827
+ emit
2828
+ }) {
2829
+ var _a;
2830
+ const DEFAUTL_MODE2 = "rgb";
2831
+ const provideData = {
2832
+ showAlpha: useReactive(() => props.showAlpha),
2833
+ swatches: useReactive(() => props.swatches),
2834
+ dotSize: useReactive(() => props.dotSize),
2835
+ showHistory: useReactive(() => props.showHistory)
2836
+ };
2837
+ provide("provideData", readonly(provideData));
2838
+ const initialColor = ref(null);
2839
+ const colorCubeRef = ref();
2840
+ const pickerRef = ref();
2841
+ const containerRef = ref();
2842
+ const left = ref(0);
2843
+ const top = ref(0);
2844
+ const isChangeTextColor = ref(true);
2845
+ const showColorPicker = ref(false);
2846
+ const formItemText = ref(`${(_a = props.mode) != null ? _a : DEFAUTL_MODE2}`);
2847
+ const mode = ref(unref(props.mode));
2848
+ onMounted(() => {
2849
+ window.addEventListener("resize", resize);
2850
+ window.addEventListener("click", isExhibition);
2851
+ });
2852
+ const colorPickerPostion = computed(() => {
2853
+ if (colorCubeRef.value) {
2854
+ return {
2855
+ transform: `translate(${left.value}px, ${top.value}px)`
2856
+ };
2857
+ }
2858
+ return null;
2859
+ });
2860
+ const tiggerColor = computed(() => {
2861
+ const currentColor = initialColor.value.rgba;
2862
+ const trigger = __spreadProps(__spreadValues({}, currentColor), {
2863
+ a: props.showAlpha ? currentColor.a : 1
2864
+ });
2865
+ return {
2866
+ backgroundColor: `${RGBAtoCSS(trigger)}`
2867
+ };
2868
+ });
2869
+ const formItemValue = computed(() => {
2870
+ return extractColor(initialColor.value, "", formItemText.value, props.showAlpha);
2871
+ });
2872
+ const textColor = computed(() => {
2873
+ return changeColorValue(initialColor.value, 0.5);
2874
+ });
2875
+ function changeTextColor(value) {
2876
+ isChangeTextColor.value = value;
2877
+ }
2878
+ function changePaletteColor(colorMap) {
2879
+ updateUserColor(colorMap);
2880
+ }
2881
+ function changeTextModeType(type4) {
2882
+ mode.value = type4;
2883
+ formItemText.value = type4;
2884
+ }
2885
+ watch(() => showColorPicker.value, (newValue) => {
2886
+ var _a2;
2887
+ const textPalette = (_a2 = colorCubeRef.value) == null ? void 0 : _a2.getBoundingClientRect();
2888
+ newValue && nextTick(() => {
2889
+ pickerRef.value.style.transform = `translate(${textPalette.left + "px"}, ${textPalette.top + window.scrollY + textPalette.height + "px"})`;
2890
+ });
2891
+ });
2892
+ watch(() => props.modelValue, (newValue) => {
2893
+ updateUserColor(parseColor(newValue, initialColor.value));
2894
+ }, {
2895
+ immediate: true
2896
+ });
2897
+ function updateUserColor(color2) {
2898
+ initialColor.value = color2;
2899
+ const value = extractColor(initialColor.value, props.modelValue, mode.value, props.showAlpha);
2900
+ emit("update:modelValue", value);
2901
+ }
2902
+ function resize() {
2903
+ return colorPickerResize(colorCubeRef, top, left);
2904
+ }
2905
+ function isExhibition(event) {
2906
+ return isExhibitionColorPicker(event, colorCubeRef, pickerRef, showColorPicker);
2907
+ }
2908
+ return () => {
2909
+ return createVNode("div", {
2910
+ "class": "devui-color-picker",
2911
+ "ref": colorCubeRef
2912
+ }, [createVNode("div", {
2913
+ "class": "devui-color-picker-container"
2914
+ }, [createVNode("div", {
2915
+ "class": "devui-color-picker-container-wrap"
2916
+ }, [createVNode("div", {
2917
+ "class": "devui-color-picker-container-wrap-current-color",
2918
+ "style": tiggerColor.value
2919
+ }, null), createVNode("div", {
2920
+ "class": ["devui-color-picker-container-wrap-transparent", "devui-color-picker-container-wrap-current-color-transparent"]
2921
+ }, null), createVNode("div", {
2922
+ "class": "devui-color-picker-color-value"
2923
+ }, [createVNode("p", {
2924
+ "style": textColor.value
2925
+ }, [formItemValue.value])])])]), createVNode(Teleport, {
2926
+ "to": "body"
2927
+ }, {
2928
+ default: () => [createVNode(Transition, {
2929
+ "name": "color-picker-transition"
2930
+ }, {
2931
+ default: () => [showColorPicker.value ? createVNode("div", {
2932
+ "ref": pickerRef,
2933
+ "style": colorPickerPostion.value,
2934
+ "class": ["devui-color-picker-position"]
2935
+ }, [createVNode(resolveComponent("color-panel"), {
2936
+ "modelValue": initialColor.value,
2937
+ "onUpdate:modelValue": ($event) => initialColor.value = $event,
2938
+ "ref": containerRef,
2939
+ "mode": mode.value,
2940
+ "onChangeTextColor": changeTextColor,
2941
+ "onChangePaletteColor": changePaletteColor,
2942
+ "onChangeTextModeType": changeTextModeType
2943
+ }, null)]) : null]
2944
+ })]
2945
+ })]);
2946
+ };
2947
+ }
2948
+ });
2949
+ ColorPicker.install = function(app) {
2950
+ app.component(ColorPicker.name, ColorPicker);
2951
+ };
2952
+ var index = {
2953
+ title: "ColorPicker \u989C\u8272\u9009\u62E9\u5668",
2954
+ category: "\u6570\u636E\u5F55\u5165",
2955
+ status: "80%",
2956
+ install(app) {
2957
+ app.use(ColorPicker);
2958
+ }
2959
+ };
2960
+ export { ColorPicker, index as default };