@gct-paas/core-web 0.1.4-dev.3 → 0.1.4-dev.4

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 (85) hide show
  1. package/dist/core-web.css +1 -1
  2. package/dist/index.min.cjs +11 -11
  3. package/dist/index.system.min.js +11 -11
  4. package/es/components/code-editor/code-editor.mjs +1 -2
  5. package/es/editor/gct-form-field-select/gct-model-select.vue +2 -2
  6. package/es/editor/index.mjs +2 -2
  7. package/package.json +5 -5
  8. package/es/_virtual/_commonjsHelpers.mjs +0 -44
  9. package/es/_virtual/node.mjs +0 -7
  10. package/es/_virtual/node2.mjs +0 -3
  11. package/es/node_modules/.pnpm/@aesoper_normal-utils@0.1.5/node_modules/@aesoper/normal-utils/NormalUtils.es.mjs +0 -3
  12. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.mjs +0 -142
  13. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/config/index.mjs +0 -7
  14. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/index.mjs +0 -1
  15. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/loader/index.mjs +0 -188
  16. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.mjs +0 -13
  17. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.mjs +0 -19
  18. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.mjs +0 -14
  19. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.mjs +0 -5
  20. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.mjs +0 -20
  21. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/validators/index.mjs +0 -49
  22. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/createPopper.mjs +0 -200
  23. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/contains.mjs +0 -26
  24. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.mjs +0 -44
  25. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.mjs +0 -72
  26. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.mjs +0 -60
  27. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.mjs +0 -7
  28. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.mjs +0 -9
  29. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.mjs +0 -32
  30. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.mjs +0 -8
  31. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.mjs +0 -28
  32. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeName.mjs +0 -5
  33. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.mjs +0 -14
  34. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.mjs +0 -71
  35. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getParentNode.mjs +0 -22
  36. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.mjs +0 -19
  37. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.mjs +0 -34
  38. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindow.mjs +0 -14
  39. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.mjs +0 -13
  40. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.mjs +0 -16
  41. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/instanceOf.mjs +0 -23
  42. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.mjs +0 -7
  43. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.mjs +0 -13
  44. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isTableElement.mjs +0 -7
  45. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.mjs +0 -29
  46. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/enums.mjs +0 -33
  47. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/index.mjs +0 -5
  48. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/applyStyles.mjs +0 -87
  49. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/arrow.mjs +0 -92
  50. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/computeStyles.mjs +0 -171
  51. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/eventListeners.mjs +0 -51
  52. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/flip.mjs +0 -149
  53. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/hide.mjs +0 -63
  54. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/index.mjs +0 -9
  55. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/offset.mjs +0 -56
  56. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/popperOffsets.mjs +0 -27
  57. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.mjs +0 -144
  58. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper-lite.mjs +0 -12
  59. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper.mjs +0 -19
  60. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.mjs +0 -46
  61. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeOffsets.mjs +0 -73
  62. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/debounce.mjs +0 -17
  63. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.mjs +0 -67
  64. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/expandToHashMap.mjs +0 -8
  65. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getAltAxis.mjs +0 -5
  66. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getBasePlacement.mjs +0 -7
  67. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getFreshSideObject.mjs +0 -10
  68. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.mjs +0 -5
  69. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositePlacement.mjs +0 -13
  70. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.mjs +0 -11
  71. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getVariation.mjs +0 -5
  72. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/math.mjs +0 -5
  73. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergeByName.mjs +0 -16
  74. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergePaddingObject.mjs +0 -7
  75. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/orderModifiers.mjs +0 -46
  76. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/rectToClientRect.mjs +0 -10
  77. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/userAgent.mjs +0 -13
  78. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/within.mjs +0 -11
  79. package/es/node_modules/.pnpm/@vueuse_core@13.7.0_vue@3.5.18_typescript@5.9.2_/node_modules/@vueuse/core/index.mjs +0 -8285
  80. package/es/node_modules/.pnpm/@vueuse_shared@13.7.0_vue@3.5.18_typescript@5.9.2_/node_modules/@vueuse/shared/index.mjs +0 -1641
  81. package/es/node_modules/.pnpm/gradient-parser@1.0.2/node_modules/gradient-parser/build/node.mjs +0 -528
  82. package/es/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.mjs +0 -193
  83. package/es/node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.mjs +0 -1180
  84. package/es/node_modules/.pnpm/vue-types@3.0.2_vue@3.5.18_typescript@5.9.2_/node_modules/vue-types/dist/vue-types.m.mjs +0 -3
  85. package/es/node_modules/.pnpm/vue3-colorpicker@2.3.0_@aesoper_normal-utils@0.1.5_@popperjs_core@2.11.8_@vueuse_core@1_c6850a6c65df63e96440af393dfce213/node_modules/vue3-colorpicker/index.es.mjs +0 -1815
@@ -1,1815 +0,0 @@
1
- import { defineComponent, ref, reactive, watch, computed, pushScopeId, popScopeId, createElementVNode, createElementBlock, openBlock, normalizeClass, normalizeStyle, Fragment, renderList, getCurrentInstance, nextTick, createCommentVNode, withDirectives, vModelText, createTextVNode, toDisplayString, resolveComponent, createBlock, createVNode, onMounted, inject, vShow, renderSlot, provide, useSlots, withCtx, resolveDynamicComponent, mergeProps, Teleport } from 'vue';
2
- import { useClipboard, useLocalStorage, onClickOutside } from '../../../@vueuse_core@13.7.0_vue@3.5.18_typescript@5.9.2_/node_modules/@vueuse/core/index.mjs';
3
- import tinycolor from '../../../tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.mjs';
4
- import { n as nodeExports } from '../../../../../_virtual/node.mjs';
5
- import '../../../@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/index.mjs';
6
- import C from '../../../vue-types@3.0.2_vue@3.5.18_typescript@5.9.2_/node_modules/vue-types/dist/vue-types.m.mjs';
7
- import { DOMUtils as Vn } from '../../../@aesoper_normal-utils@0.1.5/node_modules/@aesoper/normal-utils/NormalUtils.es.mjs';
8
- import { merge } from 'lodash-es';
9
- import { tryOnMounted, whenever, useDebounceFn } from '../../../@vueuse_shared@13.7.0_vue@3.5.18_typescript@5.9.2_/node_modules/@vueuse/shared/index.mjs';
10
- import { createPopper } from '../../../@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper.mjs';
11
-
12
- var qe = Object.defineProperty;
13
- var Ye = (e, t, o) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
14
- var W = (e, t, o) => (Ye(e, typeof t != "symbol" ? t + "" : t, o), o);
15
- const P = (e) => Math.round(e * 100) / 100;
16
- class A {
17
- constructor(t) {
18
- W(this, "instance");
19
- W(this, "alphaValue", 0);
20
- // RGB
21
- W(this, "redValue", 0);
22
- W(this, "greenValue", 0);
23
- W(this, "blueValue", 0);
24
- // HSV
25
- W(this, "hueValue", 0);
26
- W(this, "saturationValue", 0);
27
- W(this, "brightnessValue", 0);
28
- // HSL
29
- W(this, "hslSaturationValue", 0);
30
- W(this, "lightnessValue", 0);
31
- W(this, "initAlpha", () => {
32
- const t = this.instance.getAlpha();
33
- this.alphaValue = Math.min(1, t) * 100;
34
- });
35
- W(this, "initLightness", () => {
36
- const { s: t, l: o } = this.instance.toHsl();
37
- this.hslSaturationValue = P(t), this.lightnessValue = P(o);
38
- });
39
- W(this, "initRgb", () => {
40
- const { r: t, g: o, b: n } = this.instance.toRgb();
41
- this.redValue = P(t), this.greenValue = P(o), this.blueValue = P(n);
42
- });
43
- W(this, "initHsb", () => {
44
- const { h: t, s: o, v: n } = this.instance.toHsv();
45
- this.hueValue = Math.min(360, Math.ceil(t)), this.saturationValue = P(o), this.brightnessValue = P(n);
46
- });
47
- W(this, "toHexString", () => this.instance.toHexString());
48
- W(this, "toRgbString", () => this.instance.toRgbString());
49
- this.instance = tinycolor(t), this.initRgb(), this.initHsb(), this.initLightness(), this.initAlpha();
50
- }
51
- toString(t) {
52
- return this.instance.toString(t);
53
- }
54
- get hex() {
55
- return this.instance.toHex();
56
- }
57
- set hex(t) {
58
- this.instance = tinycolor(t), this.initHsb(), this.initRgb(), this.initAlpha(), this.initLightness();
59
- }
60
- // 色调
61
- set hue(t) {
62
- this.saturation === 0 && this.brightness === 0 && (this.saturationValue = 1, this.brightnessValue = 1), this.instance = tinycolor({
63
- h: P(t),
64
- s: this.saturation,
65
- v: this.brightness,
66
- a: this.alphaValue / 100
67
- }), this.initRgb(), this.initLightness(), this.hueValue = P(t);
68
- }
69
- get hue() {
70
- return this.hueValue;
71
- }
72
- // 饱和度
73
- set saturation(t) {
74
- this.instance = tinycolor({
75
- h: this.hue,
76
- s: P(t),
77
- v: this.brightness,
78
- a: this.alphaValue / 100
79
- }), this.initRgb(), this.initLightness(), this.saturationValue = P(t);
80
- }
81
- get saturation() {
82
- return this.saturationValue;
83
- }
84
- // 明度
85
- set brightness(t) {
86
- this.instance = tinycolor({
87
- h: this.hue,
88
- s: this.saturation,
89
- v: P(t),
90
- a: this.alphaValue / 100
91
- }), this.initRgb(), this.initLightness(), this.brightnessValue = P(t);
92
- }
93
- get brightness() {
94
- return this.brightnessValue;
95
- }
96
- // 亮度
97
- set lightness(t) {
98
- this.instance = tinycolor({
99
- h: this.hue,
100
- s: this.hslSaturationValue,
101
- l: P(t),
102
- a: this.alphaValue / 100
103
- }), this.initRgb(), this.initHsb(), this.lightnessValue = P(t);
104
- }
105
- get lightness() {
106
- return this.lightnessValue;
107
- }
108
- // red
109
- set red(t) {
110
- const o = this.instance.toRgb();
111
- this.instance = tinycolor({
112
- ...o,
113
- r: P(t),
114
- a: this.alphaValue / 100
115
- }), this.initHsb(), this.initLightness(), this.redValue = P(t);
116
- }
117
- get red() {
118
- return this.redValue;
119
- }
120
- // green
121
- set green(t) {
122
- const o = this.instance.toRgb();
123
- this.instance = tinycolor({
124
- ...o,
125
- g: P(t),
126
- a: this.alphaValue / 100
127
- }), this.initHsb(), this.initLightness(), this.greenValue = P(t);
128
- }
129
- get green() {
130
- return this.greenValue;
131
- }
132
- // blue
133
- set blue(t) {
134
- const o = this.instance.toRgb();
135
- this.instance = tinycolor({
136
- ...o,
137
- b: P(t),
138
- a: this.alphaValue / 100
139
- }), this.initHsb(), this.initLightness(), this.blueValue = P(t);
140
- }
141
- get blue() {
142
- return this.blueValue;
143
- }
144
- // alpha
145
- set alpha(t) {
146
- this.instance.setAlpha(t / 100), this.alphaValue = t;
147
- }
148
- get alpha() {
149
- return this.alphaValue;
150
- }
151
- get RGB() {
152
- return [this.red, this.green, this.blue, parseFloat((this.alpha / 100).toFixed(2))];
153
- }
154
- get HSB() {
155
- return [this.hue, this.saturation, this.brightness, parseFloat((this.alpha / 100).toFixed(2))];
156
- }
157
- get HSL() {
158
- return [
159
- this.hue,
160
- this.hslSaturationValue,
161
- this.lightness,
162
- parseFloat((this.alpha / 100).toFixed(2))
163
- ];
164
- }
165
- }
166
- function Ae(e, t, o, n) {
167
- return `rgba(${[e, t, o, n / 100].join(",")})`;
168
- }
169
- const ue = (e, t, o) => t < o ? e < t ? t : e > o ? o : e : e < o ? o : e > t ? t : e, fe = "color-history", Ce = 8;
170
- const q = (e, t) => {
171
- const o = e.__vccOpts || e;
172
- for (const [n, i] of t)
173
- o[n] = i;
174
- return o;
175
- }, lt = defineComponent({
176
- name: "Alpha",
177
- props: {
178
- color: C.instanceOf(A),
179
- size: C.oneOf(["small", "default"]).def("default")
180
- },
181
- emits: ["change"],
182
- setup(e, { emit: t }) {
183
- const o = ref(null), n = ref(null);
184
- let i = e.color || new A();
185
- const l = reactive({
186
- red: i.red,
187
- green: i.green,
188
- blue: i.blue,
189
- alpha: i.alpha
190
- });
191
- watch(
192
- () => e.color,
193
- (g) => {
194
- g && (i = g, merge(l, {
195
- red: g.red,
196
- green: g.green,
197
- blue: g.blue,
198
- alpha: g.alpha
199
- }));
200
- },
201
- { deep: !0 }
202
- );
203
- const a = computed(() => {
204
- const g = Ae(l.red, l.green, l.blue, 0), d = Ae(l.red, l.green, l.blue, 100);
205
- return {
206
- background: `linear-gradient(to right, ${g} , ${d})`
207
- };
208
- }), r = () => {
209
- if (o.value && n.value) {
210
- const g = l.alpha / 100, d = o.value.getBoundingClientRect(), m = n.value.offsetWidth;
211
- return Math.round(g * (d.width - m) + m / 2);
212
- }
213
- return 0;
214
- }, c = computed(() => ({
215
- left: r() + "px",
216
- top: 0
217
- })), k = (g) => {
218
- g.target !== o.value && p(g);
219
- }, p = (g) => {
220
- if (g.stopPropagation(), o.value && n.value) {
221
- const d = o.value.getBoundingClientRect(), m = n.value.offsetWidth;
222
- let b = g.clientX - d.left;
223
- b = Math.max(m / 2, b), b = Math.min(b, d.width - m / 2);
224
- const h = Math.round((b - m / 2) / (d.width - m) * 100);
225
- i.alpha = h, l.alpha = h, t("change", h);
226
- }
227
- };
228
- return tryOnMounted(() => {
229
- const g = {
230
- drag: (d) => {
231
- p(d);
232
- },
233
- end: (d) => {
234
- p(d);
235
- }
236
- };
237
- o.value && n.value && Vn.triggerDragEvent(o.value, g);
238
- }), { barElement: o, cursorElement: n, getCursorStyle: c, getBackgroundStyle: a, onClickSider: k };
239
- }
240
- }), st = (e) => (pushScopeId("data-v-18925ba6"), e = e(), popScopeId(), e), it = /* @__PURE__ */ st(() => /* @__PURE__ */ createElementVNode("div", { class: "vc-alpha-slider__bar-handle" }, null, -1)), ct = [
241
- it
242
- ];
243
- function ut(e, t, o, n, i, l) {
244
- return openBlock(), createElementBlock("div", {
245
- class: normalizeClass(["vc-alpha-slider", "transparent", { "small-slider": e.size === "small" }])
246
- }, [
247
- createElementVNode("div", {
248
- ref: "barElement",
249
- class: "vc-alpha-slider__bar",
250
- style: normalizeStyle(e.getBackgroundStyle),
251
- onClick: t[0] || (t[0] = (...a) => e.onClickSider && e.onClickSider(...a))
252
- }, [
253
- createElementVNode("div", {
254
- class: normalizeClass(["vc-alpha-slider__bar-pointer", { "small-bar": e.size === "small" }]),
255
- ref: "cursorElement",
256
- style: normalizeStyle(e.getCursorStyle)
257
- }, ct, 6)
258
- ], 4)
259
- ], 2);
260
- }
261
- const ve = /* @__PURE__ */ q(lt, [["render", ut], ["__scopeId", "data-v-18925ba6"]]);
262
- const dt = [
263
- // 第一行
264
- [
265
- "#fcc02e",
266
- "#f67c01",
267
- "#e64a19",
268
- "#d81b43",
269
- "#8e24aa",
270
- "#512da7",
271
- "#1f87e8",
272
- "#008781",
273
- "#05a045"
274
- ],
275
- // 第二行
276
- [
277
- "#fed835",
278
- "#fb8c00",
279
- "#f5511e",
280
- "#eb1d4e",
281
- "#9c28b1",
282
- "#5d35b0",
283
- "#2097f3",
284
- "#029688",
285
- "#4cb050"
286
- ],
287
- // 第三行
288
- [
289
- "#ffeb3c",
290
- "#ffa727",
291
- "#fe5722",
292
- "#eb4165",
293
- "#aa47bc",
294
- "#673bb7",
295
- "#42a5f6",
296
- "#26a59a",
297
- "#83c683"
298
- ],
299
- // 第四行
300
- [
301
- "#fff176",
302
- "#ffb74e",
303
- "#ff8a66",
304
- "#f1627e",
305
- "#b968c7",
306
- "#7986cc",
307
- "#64b5f6",
308
- "#80cbc4",
309
- "#a5d6a7"
310
- ],
311
- // 第五行
312
- [
313
- "#fff59c",
314
- "#ffcc80",
315
- "#ffab91",
316
- "#fb879e",
317
- "#cf93d9",
318
- "#9ea8db",
319
- "#90caf8",
320
- "#b2dfdc",
321
- "#c8e6ca"
322
- ],
323
- // 最后一行
324
- [
325
- "transparent",
326
- "#ffffff",
327
- "#dedede",
328
- "#a9a9a9",
329
- "#4b4b4b",
330
- "#353535",
331
- "#212121",
332
- "#000000",
333
- "advance"
334
- ]
335
- ], gt = defineComponent({
336
- name: "Palette",
337
- emits: ["change"],
338
- setup(e, { emit: t }) {
339
- return { palettes: dt, computedBgStyle: (i) => i === "transparent" ? i : i === "advance" ? {} : { background: tinycolor(i).toRgbString() }, onColorChange: (i) => {
340
- t("change", i);
341
- } };
342
- }
343
- }), ht = { class: "vc-compact" }, pt = ["onClick"];
344
- function ft(e, t, o, n, i, l) {
345
- return openBlock(), createElementBlock("div", ht, [
346
- (openBlock(!0), createElementBlock(Fragment, null, renderList(e.palettes, (a, r) => (openBlock(), createElementBlock("div", {
347
- key: r,
348
- class: "vc-compact__row"
349
- }, [
350
- (openBlock(!0), createElementBlock(Fragment, null, renderList(a, (c, k) => (openBlock(), createElementBlock("div", {
351
- key: k,
352
- class: "vc-compact__color-cube--wrap",
353
- onClick: (p) => e.onColorChange(c)
354
- }, [
355
- createElementVNode("div", {
356
- class: normalizeClass([
357
- "vc-compact__color_cube",
358
- {
359
- advance: c === "advance",
360
- transparent: c === "transparent"
361
- }
362
- ]),
363
- style: normalizeStyle(e.computedBgStyle(c))
364
- }, null, 6)
365
- ], 8, pt))), 128))
366
- ]))), 128))
367
- ]);
368
- }
369
- const Ke = /* @__PURE__ */ q(gt, [["render", ft], ["__scopeId", "data-v-b969fd48"]]);
370
- const Ct = defineComponent({
371
- name: "Board",
372
- props: {
373
- color: C.instanceOf(A),
374
- round: C.bool.def(!1),
375
- hide: C.bool.def(!0)
376
- },
377
- emits: ["change"],
378
- setup(e, { emit: t }) {
379
- var y, f, w;
380
- const o = getCurrentInstance(), n = {
381
- h: ((y = e.color) == null ? void 0 : y.hue) || 0,
382
- s: 1,
383
- v: 1
384
- }, i = new A(n).toHexString(), l = reactive({
385
- hueColor: i,
386
- saturation: ((f = e.color) == null ? void 0 : f.saturation) || 0,
387
- brightness: ((w = e.color) == null ? void 0 : w.brightness) || 0
388
- }), a = ref(0), r = ref(0), c = ref(), k = computed(() => ({
389
- top: a.value + "px",
390
- left: r.value + "px"
391
- })), p = () => {
392
- if (o) {
393
- const S = o.vnode.el;
394
- r.value = l.saturation * (S == null ? void 0 : S.clientWidth), a.value = (1 - l.brightness) * (S == null ? void 0 : S.clientHeight);
395
- }
396
- };
397
- let g = !1;
398
- const d = (S) => {
399
- g = !0, h(S);
400
- }, m = (S) => {
401
- g && h(S);
402
- }, b = () => {
403
- g = !1;
404
- }, h = (S) => {
405
- if (o) {
406
- const F = o.vnode.el, E = F == null ? void 0 : F.getBoundingClientRect();
407
- let L = S.clientX - E.left, U = S.clientY - E.top;
408
- L = ue(L, 0, E.width), U = ue(U, 0, E.height);
409
- const J = L / E.width, X = ue(-(U / E.height) + 1, 0, 1);
410
- r.value = L, a.value = U, l.saturation = J, l.brightness = X, t("change", J, X);
411
- }
412
- };
413
- return tryOnMounted(() => {
414
- o && o.vnode.el && c.value && nextTick(() => {
415
- p();
416
- });
417
- }), whenever(
418
- () => e.color,
419
- (S) => {
420
- merge(l, {
421
- hueColor: new A({ h: S.hue, s: 1, v: 1 }).toHexString(),
422
- saturation: S.saturation,
423
- brightness: S.brightness
424
- }), p();
425
- },
426
- { deep: !0 }
427
- ), { state: l, cursorElement: c, getCursorStyle: k, onClickBoard: d, onDrag: m, onDragEnd: b };
428
- }
429
- }), be = (e) => (pushScopeId("data-v-7f0cdcdf"), e = e(), popScopeId(), e), vt = /* @__PURE__ */ be(() => /* @__PURE__ */ createElementVNode("div", { class: "vc-saturation__white" }, null, -1)), bt = /* @__PURE__ */ be(() => /* @__PURE__ */ createElementVNode("div", { class: "vc-saturation__black" }, null, -1)), yt = /* @__PURE__ */ be(() => /* @__PURE__ */ createElementVNode("div", null, null, -1)), _t = [
430
- yt
431
- ];
432
- function mt(e, t, o, n, i, l) {
433
- return openBlock(), createElementBlock("div", {
434
- ref: "boardElement",
435
- class: normalizeClass(["vc-saturation", { "vc-saturation__chrome": e.round, "vc-saturation__hidden": e.hide }]),
436
- style: normalizeStyle({ backgroundColor: e.state.hueColor }),
437
- onMousedown: t[0] || (t[0] = (...a) => e.onClickBoard && e.onClickBoard(...a)),
438
- onMousemove: t[1] || (t[1] = (...a) => e.onDrag && e.onDrag(...a)),
439
- onMouseup: t[2] || (t[2] = (...a) => e.onDragEnd && e.onDragEnd(...a))
440
- }, [
441
- vt,
442
- bt,
443
- createElementVNode("div", {
444
- class: "vc-saturation__cursor",
445
- ref: "cursorElement",
446
- style: normalizeStyle(e.getCursorStyle)
447
- }, _t, 4)
448
- ], 38);
449
- }
450
- const ye = /* @__PURE__ */ q(Ct, [["render", mt], ["__scopeId", "data-v-7f0cdcdf"]]);
451
- const St = defineComponent({
452
- name: "Hue",
453
- props: {
454
- color: C.instanceOf(A),
455
- size: C.oneOf(["small", "default"]).def("default")
456
- },
457
- emits: ["change"],
458
- setup(e, { emit: t }) {
459
- const o = ref(null), n = ref(null);
460
- let i = e.color || new A();
461
- const l = reactive({
462
- hue: i.hue || 0
463
- });
464
- watch(
465
- () => e.color,
466
- (p) => {
467
- p && (i = p, merge(l, { hue: i.hue }));
468
- },
469
- { deep: !0 }
470
- );
471
- const a = () => {
472
- if (o.value && n.value) {
473
- const p = o.value.getBoundingClientRect(), g = n.value.offsetWidth;
474
- return l.hue === 360 ? p.width - g / 2 : l.hue % 360 * (p.width - g) / 360 + g / 2;
475
- }
476
- return 0;
477
- }, r = computed(() => ({
478
- left: a() + "px",
479
- top: 0
480
- })), c = (p) => {
481
- p.target !== o.value && k(p);
482
- }, k = (p) => {
483
- if (p.stopPropagation(), o.value && n.value) {
484
- const g = o.value.getBoundingClientRect(), d = n.value.offsetWidth;
485
- let m = p.clientX - g.left;
486
- m = Math.min(m, g.width - d / 2), m = Math.max(d / 2, m);
487
- const b = Math.round((m - d / 2) / (g.width - d) * 360);
488
- i.hue = b, l.hue = b, t("change", b);
489
- }
490
- };
491
- return tryOnMounted(() => {
492
- const p = {
493
- drag: (g) => {
494
- k(g);
495
- },
496
- end: (g) => {
497
- k(g);
498
- }
499
- };
500
- o.value && n.value && Vn.triggerDragEvent(o.value, p);
501
- }), { barElement: o, cursorElement: n, getCursorStyle: r, onClickSider: c };
502
- }
503
- }), kt = (e) => (pushScopeId("data-v-e1a08576"), e = e(), popScopeId(), e), $t = /* @__PURE__ */ kt(() => /* @__PURE__ */ createElementVNode("div", { class: "vc-hue-slider__bar-handle" }, null, -1)), wt = [
504
- $t
505
- ];
506
- function Bt(e, t, o, n, i, l) {
507
- return openBlock(), createElementBlock("div", {
508
- class: normalizeClass(["vc-hue-slider", { "small-slider": e.size === "small" }])
509
- }, [
510
- createElementVNode("div", {
511
- ref: "barElement",
512
- class: "vc-hue-slider__bar",
513
- onClick: t[0] || (t[0] = (...a) => e.onClickSider && e.onClickSider(...a))
514
- }, [
515
- createElementVNode("div", {
516
- class: normalizeClass(["vc-hue-slider__bar-pointer", { "small-bar": e.size === "small" }]),
517
- ref: "cursorElement",
518
- style: normalizeStyle(e.getCursorStyle)
519
- }, wt, 6)
520
- ], 512)
521
- ], 2);
522
- }
523
- const _e = /* @__PURE__ */ q(St, [["render", Bt], ["__scopeId", "data-v-e1a08576"]]);
524
- const Ht = defineComponent({
525
- name: "Lightness",
526
- props: {
527
- color: C.instanceOf(A),
528
- size: C.oneOf(["small", "default"]).def("default")
529
- },
530
- emits: ["change"],
531
- setup(e, { emit: t }) {
532
- const o = ref(null), n = ref(null);
533
- let i = e.color || new A();
534
- const [l, a, r] = i.HSL, c = reactive({
535
- hue: l,
536
- saturation: a,
537
- lightness: r
538
- });
539
- watch(
540
- () => e.color,
541
- (b) => {
542
- if (b) {
543
- i = b;
544
- const [h, y, f] = i.HSL;
545
- merge(c, {
546
- hue: h,
547
- saturation: y,
548
- lightness: f
549
- });
550
- }
551
- },
552
- { deep: !0 }
553
- );
554
- const k = computed(() => {
555
- const b = tinycolor({
556
- h: c.hue,
557
- s: c.saturation,
558
- l: 0.8
559
- }).toPercentageRgbString(), h = tinycolor({
560
- h: c.hue,
561
- s: c.saturation,
562
- l: 0.6
563
- }).toPercentageRgbString(), y = tinycolor({
564
- h: c.hue,
565
- s: c.saturation,
566
- l: 0.4
567
- }).toPercentageRgbString(), f = tinycolor({
568
- h: c.hue,
569
- s: c.saturation,
570
- l: 0.2
571
- }).toPercentageRgbString();
572
- return {
573
- background: [
574
- `linear-gradient(to right, rgb(255, 255, 255), ${b}, ${h}, ${y}, ${f}, rgb(0, 0, 0))`,
575
- `-webkit-linear-gradient(left, rgb(255, 255, 255), ${b}, ${h}, ${y}, ${f}, rgb(0, 0, 0))`,
576
- `-moz-linear-gradient(left, rgb(255, 255, 255), ${b}, ${h}, ${y}, ${f}, rgb(0, 0, 0))`,
577
- `-ms-linear-gradient(left, rgb(255, 255, 255), ${b}, ${h}, ${y}, ${f}, rgb(0, 0, 0))`
578
- ]
579
- };
580
- }), p = () => {
581
- if (o.value && n.value) {
582
- const b = c.lightness, h = o.value.getBoundingClientRect(), y = n.value.offsetWidth;
583
- return (1 - b) * (h.width - y) + y / 2;
584
- }
585
- return 0;
586
- }, g = computed(() => ({
587
- left: p() + "px",
588
- top: 0
589
- })), d = (b) => {
590
- b.target !== o.value && m(b);
591
- }, m = (b) => {
592
- if (b.stopPropagation(), o.value && n.value) {
593
- const h = o.value.getBoundingClientRect(), y = n.value.offsetWidth;
594
- let f = b.clientX - h.left;
595
- f = Math.max(y / 2, f), f = Math.min(f, h.width - y / 2);
596
- const w = 1 - (f - y / 2) / (h.width - y);
597
- i.lightness = w, t("change", w);
598
- }
599
- };
600
- return tryOnMounted(() => {
601
- const b = {
602
- drag: (h) => {
603
- m(h);
604
- },
605
- end: (h) => {
606
- m(h);
607
- }
608
- };
609
- o.value && n.value && Vn.triggerDragEvent(o.value, b);
610
- }), { barElement: o, cursorElement: n, getCursorStyle: g, getBackgroundStyle: k, onClickSider: d };
611
- }
612
- }), Rt = (e) => (pushScopeId("data-v-94a50a9e"), e = e(), popScopeId(), e), At = /* @__PURE__ */ Rt(() => /* @__PURE__ */ createElementVNode("div", { class: "vc-lightness-slider__bar-handle" }, null, -1)), Pt = [
613
- At
614
- ];
615
- function Vt(e, t, o, n, i, l) {
616
- return openBlock(), createElementBlock("div", {
617
- class: normalizeClass(["vc-lightness-slider", { "small-slider": e.size === "small" }])
618
- }, [
619
- createElementVNode("div", {
620
- ref: "barElement",
621
- class: "vc-lightness-slider__bar",
622
- style: normalizeStyle(e.getBackgroundStyle),
623
- onClick: t[0] || (t[0] = (...a) => e.onClickSider && e.onClickSider(...a))
624
- }, [
625
- createElementVNode("div", {
626
- class: normalizeClass(["vc-lightness-slider__bar-pointer", { "small-bar": e.size === "small" }]),
627
- ref: "cursorElement",
628
- style: normalizeStyle(e.getCursorStyle)
629
- }, Pt, 6)
630
- ], 4)
631
- ], 2);
632
- }
633
- const Le = /* @__PURE__ */ q(Ht, [["render", Vt], ["__scopeId", "data-v-94a50a9e"]]);
634
- const Mt = defineComponent({
635
- name: "History",
636
- props: {
637
- colors: C.arrayOf(String).def(() => []),
638
- round: C.bool.def(!1)
639
- },
640
- emits: ["change"],
641
- setup(e, { emit: t }) {
642
- return { onColorSelect: (n) => {
643
- t("change", n);
644
- } };
645
- }
646
- }), Et = {
647
- key: 0,
648
- class: "vc-colorPicker__record"
649
- }, It = { class: "color-list" }, Kt = ["onClick"];
650
- function Lt(e, t, o, n, i, l) {
651
- return e.colors && e.colors.length > 0 ? (openBlock(), createElementBlock("div", Et, [
652
- createElementVNode("div", It, [
653
- (openBlock(!0), createElementBlock(Fragment, null, renderList(e.colors, (a, r) => (openBlock(), createElementBlock("div", {
654
- key: r,
655
- class: normalizeClass(["color-item", "transparent", { "color-item__round": e.round }]),
656
- onClick: (c) => e.onColorSelect(a)
657
- }, [
658
- createElementVNode("div", {
659
- class: "color-item__display",
660
- style: normalizeStyle({ backgroundColor: a })
661
- }, null, 4)
662
- ], 10, Kt))), 128))
663
- ])
664
- ])) : createCommentVNode("", !0);
665
- }
666
- const me = /* @__PURE__ */ q(Mt, [["render", Lt], ["__scopeId", "data-v-0f657238"]]);
667
- const Nt = defineComponent({
668
- name: "Display",
669
- props: {
670
- color: C.instanceOf(A),
671
- disableAlpha: C.bool.def(!1)
672
- },
673
- emits: ["update:color", "change"],
674
- setup(e, { emit: t }) {
675
- var m, b, h, y;
676
- const { copy: o, copied: n, isSupported: i } = useClipboard(), l = ref("hex"), a = reactive({
677
- color: e.color,
678
- hex: (m = e.color) == null ? void 0 : m.hex,
679
- alpha: Math.round(((b = e.color) == null ? void 0 : b.alpha) || 100),
680
- rgba: (h = e.color) == null ? void 0 : h.RGB,
681
- previewBgColor: (y = e.color) == null ? void 0 : y.toRgbString()
682
- }), r = computed(() => ({
683
- background: a.previewBgColor
684
- })), c = () => {
685
- l.value = l.value === "rgba" ? "hex" : "rgba";
686
- }, k = useDebounceFn((f) => {
687
- if (!f.target.value)
688
- return;
689
- let w = parseInt(f.target.value.replace("%", ""));
690
- w > 100 && (f.target.value = "100", w = 100), w < 0 && (f.target.value = "0", w = 0), isNaN(w) && (f.target.value = "100", w = 100), !isNaN(w) && a.color && (a.color.alpha = w), t("change", a.color);
691
- }, 300), p = useDebounceFn((f, w) => {
692
- if (a.color) {
693
- if (l.value === "hex") {
694
- const S = f.target.value.replace("#", "");
695
- tinycolor(S).isValid() ? [3, 4].includes(S.length) && (a.color.hex = S) : a.color.hex = "000000", t("change", a.color);
696
- } else if (l.value === "rgba" && w === 3 && f.target.value.toString() === "0." && a.rgba) {
697
- a.rgba[w] = f.target.value;
698
- const [S, F, E, L] = a.rgba;
699
- a.color.hex = tinycolor({ r: S, g: F, b: E }).toHex(), a.color.alpha = Math.round(L * 100), t("change", a.color);
700
- }
701
- }
702
- }, 100), g = useDebounceFn((f, w) => {
703
- if (f.target.value) {
704
- if (l.value === "hex") {
705
- const S = f.target.value.replace("#", "");
706
- tinycolor(S).isValid() && a.color && [6, 8].includes(S.length) && (a.color.hex = S);
707
- } else if (w !== void 0 && a.rgba && a.color) {
708
- if (f.target.value < 0 && (f.target.value = 0), w === 3 && ((f.target.value > 1 || isNaN(f.target.value)) && (f.target.value = 1), f.target.value.toString() === "0."))
709
- return;
710
- w < 3 && f.target.value > 255 && (f.target.value = 255), a.rgba[w] = f.target.value;
711
- const [S, F, E, L] = a.rgba;
712
- a.color.hex = tinycolor({ r: S, g: F, b: E }).toHex(), a.color.alpha = Math.round(L * 100);
713
- }
714
- t("change", a.color);
715
- }
716
- }, 300), d = () => {
717
- if (i && a.color) {
718
- const f = l.value === "hex" ? a.color.toString(a.color.alpha === 100 ? "hex6" : "hex8") : a.color.toRgbString();
719
- o(f || "");
720
- }
721
- };
722
- return whenever(
723
- () => e.color,
724
- (f) => {
725
- f && (a.color = f, a.alpha = Math.round(a.color.alpha), a.hex = a.color.hex, a.rgba = a.color.RGB);
726
- },
727
- { deep: !0 }
728
- ), whenever(
729
- () => a.color,
730
- () => {
731
- a.color && (a.previewBgColor = a.color.toRgbString());
732
- },
733
- { deep: !0 }
734
- ), {
735
- state: a,
736
- getBgColorStyle: r,
737
- inputType: l,
738
- copied: n,
739
- onInputTypeChange: c,
740
- onAlphaBlur: k,
741
- onInputChange: g,
742
- onBlurChange: p,
743
- onCopyColorStr: d
744
- };
745
- }
746
- }), Wt = { class: "vc-display" }, Dt = { class: "vc-current-color vc-transparent" }, Tt = {
747
- key: 0,
748
- class: "copy-text"
749
- }, Ot = {
750
- key: 0,
751
- style: { display: "flex", flex: "1", gap: "4px", height: "100%" }
752
- }, zt = { class: "vc-color-input" }, Gt = {
753
- key: 0,
754
- class: "vc-alpha-input"
755
- }, Ft = ["value"], Xt = {
756
- key: 1,
757
- style: { display: "flex", flex: "1", gap: "4px", height: "100%" }
758
- }, qt = ["value", "onInput", "onBlur"];
759
- function Yt(e, t, o, n, i, l) {
760
- return openBlock(), createElementBlock("div", Wt, [
761
- createElementVNode("div", Dt, [
762
- createElementVNode("div", {
763
- class: "color-cube",
764
- style: normalizeStyle(e.getBgColorStyle),
765
- onClick: t[0] || (t[0] = (...a) => e.onCopyColorStr && e.onCopyColorStr(...a))
766
- }, [
767
- e.copied ? (openBlock(), createElementBlock("span", Tt, "Copied!")) : createCommentVNode("", !0)
768
- ], 4)
769
- ]),
770
- e.inputType === "hex" ? (openBlock(), createElementBlock("div", Ot, [
771
- createElementVNode("div", zt, [
772
- withDirectives(createElementVNode("input", {
773
- "onUpdate:modelValue": t[1] || (t[1] = (a) => e.state.hex = a),
774
- maxlength: "8",
775
- onInput: t[2] || (t[2] = (...a) => e.onInputChange && e.onInputChange(...a)),
776
- onBlur: t[3] || (t[3] = (...a) => e.onBlurChange && e.onBlurChange(...a))
777
- }, null, 544), [
778
- [vModelText, e.state.hex]
779
- ])
780
- ]),
781
- e.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", Gt, [
782
- createElementVNode("input", {
783
- class: "vc-alpha-input__inner",
784
- value: e.state.alpha,
785
- onInput: t[4] || (t[4] = (...a) => e.onAlphaBlur && e.onAlphaBlur(...a))
786
- }, null, 40, Ft),
787
- createTextVNode("% ")
788
- ]))
789
- ])) : e.state.rgba ? (openBlock(), createElementBlock("div", Xt, [
790
- (openBlock(!0), createElementBlock(Fragment, null, renderList(e.state.rgba, (a, r) => (openBlock(), createElementBlock("div", {
791
- class: "vc-color-input",
792
- key: r
793
- }, [
794
- createElementVNode("input", {
795
- value: a,
796
- onInput: (c) => e.onInputChange(c, r),
797
- onBlur: (c) => e.onBlurChange(c, r)
798
- }, null, 40, qt)
799
- ]))), 128))
800
- ])) : createCommentVNode("", !0),
801
- createElementVNode("div", {
802
- class: "vc-input-toggle",
803
- onClick: t[5] || (t[5] = (...a) => e.onInputTypeChange && e.onInputTypeChange(...a))
804
- }, toDisplayString(e.inputType), 1)
805
- ]);
806
- }
807
- const Se = /* @__PURE__ */ q(Nt, [["render", Yt], ["__scopeId", "data-v-7334ac20"]]);
808
- const Ut = defineComponent({
809
- name: "FkColorPicker",
810
- components: { Display: Se, Alpha: ve, Palette: Ke, Board: ye, Hue: _e, Lightness: Le, History: me },
811
- props: {
812
- color: C.instanceOf(A),
813
- disableHistory: C.bool.def(!1),
814
- roundHistory: C.bool.def(!1),
815
- disableAlpha: C.bool.def(!1)
816
- },
817
- emits: ["update:color", "change", "advanceChange"],
818
- setup(e, { emit: t }) {
819
- const o = e.color || new A(), n = reactive({
820
- color: o,
821
- hex: o.toHexString(),
822
- rgb: o.toRgbString()
823
- }), i = ref(!1), l = computed(() => ({ background: n.rgb })), a = () => {
824
- i.value = !1, t("advanceChange", !1);
825
- }, r = useLocalStorage(fe, [], {}), c = useDebounceFn(() => {
826
- if (e.disableHistory)
827
- return;
828
- const h = n.color.toRgbString();
829
- if (r.value = r.value.filter((y) => !tinycolor.equals(y, h)), !r.value.includes(h)) {
830
- for (; r.value.length > Ce; )
831
- r.value.pop();
832
- r.value.unshift(h);
833
- }
834
- }, 500), k = (h) => {
835
- h === "advance" ? (i.value = !0, t("advanceChange", !0)) : (n.color.hex = h, t("advanceChange", !1));
836
- }, p = (h) => {
837
- n.color.alpha = h;
838
- }, g = (h) => {
839
- n.color.hue = h;
840
- }, d = (h, y) => {
841
- n.color.saturation = h, n.color.brightness = y;
842
- }, m = (h) => {
843
- n.color.lightness = h;
844
- }, b = (h) => {
845
- const f = h.target.value.replace("#", "");
846
- tinycolor(f).isValid() && (n.color.hex = f);
847
- };
848
- return whenever(
849
- () => e.color,
850
- (h) => {
851
- h && (n.color = h);
852
- },
853
- { deep: !0 }
854
- ), whenever(
855
- () => n.color,
856
- () => {
857
- n.hex = n.color.hex, n.rgb = n.color.toRgbString(), c(), t("update:color", n.color), t("change", n.color);
858
- },
859
- { deep: !0 }
860
- ), {
861
- state: n,
862
- advancePanelShow: i,
863
- onBack: a,
864
- onCompactChange: k,
865
- onAlphaChange: p,
866
- onHueChange: g,
867
- onBoardChange: d,
868
- onLightChange: m,
869
- onInputChange: b,
870
- previewStyle: l,
871
- historyColors: r
872
- };
873
- }
874
- }), jt = (e) => (pushScopeId("data-v-48e3c224"), e = e(), popScopeId(), e), Zt = { class: "vc-fk-colorPicker" }, Jt = { class: "vc-fk-colorPicker__inner" }, Qt = { class: "vc-fk-colorPicker__header" }, xt = /* @__PURE__ */ jt(() => /* @__PURE__ */ createElementVNode("div", { class: "back" }, null, -1)), eo = [
875
- xt
876
- ];
877
- function to(e, t, o, n, i, l) {
878
- const a = resolveComponent("Palette"), r = resolveComponent("Board"), c = resolveComponent("Hue"), k = resolveComponent("Lightness"), p = resolveComponent("Alpha"), g = resolveComponent("Display"), d = resolveComponent("History");
879
- return openBlock(), createElementBlock("div", Zt, [
880
- createElementVNode("div", Jt, [
881
- createElementVNode("div", Qt, [
882
- e.advancePanelShow ? (openBlock(), createElementBlock("span", {
883
- key: 0,
884
- style: { cursor: "pointer" },
885
- onClick: t[0] || (t[0] = (...m) => e.onBack && e.onBack(...m))
886
- }, eo)) : createCommentVNode("", !0)
887
- ]),
888
- e.advancePanelShow ? createCommentVNode("", !0) : (openBlock(), createBlock(a, {
889
- key: 0,
890
- onChange: e.onCompactChange
891
- }, null, 8, ["onChange"])),
892
- e.advancePanelShow ? (openBlock(), createBlock(r, {
893
- key: 1,
894
- color: e.state.color,
895
- onChange: e.onBoardChange
896
- }, null, 8, ["color", "onChange"])) : createCommentVNode("", !0),
897
- e.advancePanelShow ? (openBlock(), createBlock(c, {
898
- key: 2,
899
- color: e.state.color,
900
- onChange: e.onHueChange
901
- }, null, 8, ["color", "onChange"])) : createCommentVNode("", !0),
902
- e.advancePanelShow ? createCommentVNode("", !0) : (openBlock(), createBlock(k, {
903
- key: 3,
904
- color: e.state.color,
905
- onChange: e.onLightChange
906
- }, null, 8, ["color", "onChange"])),
907
- e.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
908
- key: 4,
909
- color: e.state.color,
910
- onChange: e.onAlphaChange
911
- }, null, 8, ["color", "onChange"])),
912
- createVNode(g, {
913
- color: e.state.color,
914
- "disable-alpha": e.disableAlpha
915
- }, null, 8, ["color", "disable-alpha"]),
916
- e.disableHistory ? createCommentVNode("", !0) : (openBlock(), createBlock(d, {
917
- key: 5,
918
- round: e.roundHistory,
919
- colors: e.historyColors,
920
- onChange: e.onCompactChange
921
- }, null, 8, ["round", "colors", "onChange"]))
922
- ])
923
- ]);
924
- }
925
- const Pe = /* @__PURE__ */ q(Ut, [["render", to], ["__scopeId", "data-v-48e3c224"]]);
926
- const oo = defineComponent({
927
- name: "ChromeColorPicker",
928
- components: { Display: Se, Alpha: ve, Board: ye, Hue: _e, History: me },
929
- props: {
930
- color: C.instanceOf(A),
931
- disableHistory: C.bool.def(!1),
932
- roundHistory: C.bool.def(!1),
933
- disableAlpha: C.bool.def(!1)
934
- },
935
- emits: ["update:color", "change"],
936
- setup(e, { emit: t }) {
937
- const o = e.color || new A(), n = reactive({
938
- color: o,
939
- hex: o.toHexString(),
940
- rgb: o.toRgbString()
941
- }), i = computed(() => ({ background: n.rgb })), l = useLocalStorage(fe, [], {}), a = useDebounceFn(() => {
942
- if (e.disableHistory)
943
- return;
944
- const d = n.color.toRgbString();
945
- if (l.value = l.value.filter((m) => !tinycolor.equals(m, d)), !l.value.includes(d)) {
946
- for (; l.value.length > Ce; )
947
- l.value.pop();
948
- l.value.unshift(d);
949
- }
950
- }, 500), r = (d) => {
951
- n.color.alpha = d;
952
- }, c = (d) => {
953
- n.color.hue = d;
954
- }, k = (d) => {
955
- d.hex !== void 0 && (n.color.hex = d.hex), d.alpha !== void 0 && (n.color.alpha = d.alpha);
956
- }, p = (d, m) => {
957
- n.color.saturation = d, n.color.brightness = m;
958
- }, g = (d) => {
959
- d !== "advance" && (n.color.hex = d);
960
- };
961
- return whenever(
962
- () => e.color,
963
- (d) => {
964
- d && (n.color = d);
965
- },
966
- { deep: !0 }
967
- ), whenever(
968
- () => n.color,
969
- () => {
970
- n.hex = n.color.hex, n.rgb = n.color.toRgbString(), a(), t("update:color", n.color), t("change", n.color);
971
- },
972
- { deep: !0 }
973
- ), {
974
- state: n,
975
- previewStyle: i,
976
- historyColors: l,
977
- onAlphaChange: r,
978
- onHueChange: c,
979
- onBoardChange: p,
980
- onInputChange: k,
981
- onCompactChange: g
982
- };
983
- }
984
- }), no = { class: "vc-chrome-colorPicker" }, ao = { class: "vc-chrome-colorPicker-body" }, ro = { class: "chrome-controls" }, lo = { class: "chrome-sliders" };
985
- function so(e, t, o, n, i, l) {
986
- const a = resolveComponent("Board"), r = resolveComponent("Hue"), c = resolveComponent("Alpha"), k = resolveComponent("Display"), p = resolveComponent("History");
987
- return openBlock(), createElementBlock("div", no, [
988
- createVNode(a, {
989
- round: !0,
990
- hide: !1,
991
- color: e.state.color,
992
- onChange: e.onBoardChange
993
- }, null, 8, ["color", "onChange"]),
994
- createElementVNode("div", ao, [
995
- createElementVNode("div", ro, [
996
- createElementVNode("div", lo, [
997
- createVNode(r, {
998
- size: "small",
999
- color: e.state.color,
1000
- onChange: e.onHueChange
1001
- }, null, 8, ["color", "onChange"]),
1002
- e.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
1003
- key: 0,
1004
- size: "small",
1005
- color: e.state.color,
1006
- onChange: e.onAlphaChange
1007
- }, null, 8, ["color", "onChange"]))
1008
- ])
1009
- ]),
1010
- createVNode(k, {
1011
- color: e.state.color,
1012
- "disable-alpha": e.disableAlpha
1013
- }, null, 8, ["color", "disable-alpha"]),
1014
- e.disableHistory ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
1015
- key: 0,
1016
- round: e.roundHistory,
1017
- colors: e.historyColors,
1018
- onChange: e.onCompactChange
1019
- }, null, 8, ["round", "colors", "onChange"]))
1020
- ])
1021
- ]);
1022
- }
1023
- const Ve = /* @__PURE__ */ q(oo, [["render", so], ["__scopeId", "data-v-2611d66c"]]), ke = "Vue3ColorPickerProvider", io = (e, t) => {
1024
- const o = e.getBoundingClientRect(), n = o.left + o.width / 2, i = o.top + o.height / 2, l = Math.abs(n - t.clientX), a = Math.abs(i - t.clientY), r = Math.sqrt(Math.pow(l, 2) + Math.pow(a, 2)), c = a / r, k = Math.acos(c);
1025
- let p = Math.floor(180 / (Math.PI / k));
1026
- return t.clientX > n && t.clientY > i && (p = 180 - p), t.clientX == n && t.clientY > i && (p = 180), t.clientX > n && t.clientY == i && (p = 90), t.clientX < n && t.clientY > i && (p = 180 + p), t.clientX < n && t.clientY == i && (p = 270), t.clientX < n && t.clientY < i && (p = 360 - p), p;
1027
- };
1028
- let de = !1;
1029
- const co = (e, t) => {
1030
- const o = function(i) {
1031
- var l;
1032
- (l = t.drag) == null || l.call(t, i);
1033
- }, n = function(i) {
1034
- var l;
1035
- document.removeEventListener("mousemove", o, !1), document.removeEventListener("mouseup", n, !1), document.onselectstart = null, document.ondragstart = null, de = !1, (l = t.end) == null || l.call(t, i);
1036
- };
1037
- e && e.addEventListener("mousedown", (i) => {
1038
- var l;
1039
- de || (document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", o, !1), document.addEventListener("mouseup", n, !1), de = !0, (l = t.start) == null || l.call(t, i));
1040
- });
1041
- };
1042
- const uo = {
1043
- angle: {
1044
- type: Number,
1045
- default: 0
1046
- },
1047
- size: {
1048
- type: Number,
1049
- default: 16,
1050
- validator: (e) => e >= 16
1051
- },
1052
- borderWidth: {
1053
- type: Number,
1054
- default: 1,
1055
- validator: (e) => e >= 1
1056
- },
1057
- borderColor: {
1058
- type: String,
1059
- default: "#666"
1060
- }
1061
- }, go = defineComponent({
1062
- name: "Angle",
1063
- props: uo,
1064
- emits: ["update:angle", "change"],
1065
- setup(e, {
1066
- emit: t
1067
- }) {
1068
- const o = ref(null), n = ref(0);
1069
- watch(() => e.angle, (r) => {
1070
- n.value = r;
1071
- });
1072
- const i = () => {
1073
- let r = Number(n.value);
1074
- isNaN(r) || (r = r > 360 || r < 0 ? e.angle : r, n.value = r === 360 ? 0 : r, t("update:angle", n.value), t("change", n.value));
1075
- }, l = computed(() => ({
1076
- width: e.size + "px",
1077
- height: e.size + "px",
1078
- borderWidth: e.borderWidth + "px",
1079
- borderColor: e.borderColor,
1080
- transform: `rotate(${n.value}deg)`
1081
- })), a = (r) => {
1082
- o.value && (n.value = io(o.value, r) % 360, i());
1083
- };
1084
- return onMounted(() => {
1085
- const r = {
1086
- drag: (c) => {
1087
- a(c);
1088
- },
1089
- end: (c) => {
1090
- a(c);
1091
- }
1092
- };
1093
- o.value && co(o.value, r);
1094
- }), () => createVNode("div", {
1095
- class: "bee-angle"
1096
- }, [createVNode("div", {
1097
- class: "bee-angle__round",
1098
- ref: o,
1099
- style: l.value
1100
- }, null)]);
1101
- }
1102
- });
1103
- const ho = defineComponent({
1104
- name: "GradientColorPicker",
1105
- components: { Angle: go, Display: Se, Alpha: ve, Palette: Ke, Board: ye, Hue: _e, Lightness: Le, History: me },
1106
- props: {
1107
- startColor: C.instanceOf(A).isRequired,
1108
- endColor: C.instanceOf(A).isRequired,
1109
- startColorStop: C.number.def(0),
1110
- endColorStop: C.number.def(100),
1111
- angle: C.number.def(0),
1112
- type: C.oneOf(["linear", "radial"]).def("linear"),
1113
- disableHistory: C.bool.def(!1),
1114
- roundHistory: C.bool.def(!1),
1115
- disableAlpha: C.bool.def(!1),
1116
- pickerType: C.oneOf(["fk", "chrome"]).def("fk")
1117
- },
1118
- emits: [
1119
- "update:startColor",
1120
- "update:endColor",
1121
- "update:angle",
1122
- "update:startColorStop",
1123
- "update:endColorStop",
1124
- "startColorChange",
1125
- "endColorChange",
1126
- "advanceChange",
1127
- "angleChange",
1128
- "startColorStopChange",
1129
- "endColorStopChange",
1130
- "typeChange"
1131
- ],
1132
- setup(e, { emit: t }) {
1133
- const o = reactive({
1134
- startActive: !0,
1135
- startColor: e.startColor,
1136
- endColor: e.endColor,
1137
- startColorStop: e.startColorStop,
1138
- endColorStop: e.endColorStop,
1139
- angle: e.angle,
1140
- type: e.type,
1141
- // rgba
1142
- startColorRgba: e.startColor.toRgbString(),
1143
- endColorRgba: e.endColor.toRgbString()
1144
- }), n = inject(ke), i = ref(e.pickerType === "chrome"), l = ref(), a = ref(), r = ref();
1145
- watch(
1146
- () => [e.startColor, e.endColor, e.angle],
1147
- (s) => {
1148
- o.startColor = s[0], o.endColor = s[1], o.angle = s[2];
1149
- }
1150
- ), watch(
1151
- () => e.type,
1152
- (s) => {
1153
- o.type = s;
1154
- }
1155
- );
1156
- const c = computed({
1157
- get: () => o.startActive ? o.startColor : o.endColor,
1158
- set: (s) => {
1159
- if (o.startActive) {
1160
- o.startColor = s;
1161
- return;
1162
- }
1163
- o.endColor = s;
1164
- }
1165
- }), k = computed(() => {
1166
- if (r.value && l.value) {
1167
- const s = o.startColorStop / 100, _ = r.value.getBoundingClientRect(), H = l.value.offsetWidth;
1168
- return Math.round(s * (_.width - H) + H / 2);
1169
- }
1170
- return 0;
1171
- }), p = computed(() => {
1172
- if (r.value && a.value) {
1173
- const s = o.endColorStop / 100, _ = r.value.getBoundingClientRect(), H = a.value.offsetWidth;
1174
- return Math.round(s * (_.width - H) + H / 2);
1175
- }
1176
- return 0;
1177
- }), g = computed(() => {
1178
- let s = `background: linear-gradient(${o.angle}deg, ${o.startColorRgba} ${o.startColorStop}%, ${o.endColorRgba} ${o.endColorStop}%)`;
1179
- return o.type === "radial" && (s = `background: radial-gradient(circle, ${o.startColorRgba} ${o.startColorStop}%, ${o.endColorRgba} ${o.endColorStop}%)`), s;
1180
- }), d = (s) => {
1181
- var _;
1182
- if (o.startActive = !0, r.value && l.value) {
1183
- const H = (_ = r.value) == null ? void 0 : _.getBoundingClientRect();
1184
- let N = s.clientX - H.left;
1185
- N = Math.max(l.value.offsetWidth / 2, N), N = Math.min(N, H.width - l.value.offsetWidth / 2), o.startColorStop = Math.round(
1186
- (N - l.value.offsetWidth / 2) / (H.width - l.value.offsetWidth) * 100
1187
- ), t("update:startColorStop", o.startColorStop), t("startColorStopChange", o.startColorStop);
1188
- }
1189
- }, m = (s) => {
1190
- var _;
1191
- if (o.startActive = !1, r.value && a.value) {
1192
- const H = (_ = r.value) == null ? void 0 : _.getBoundingClientRect();
1193
- let N = s.clientX - H.left;
1194
- N = Math.max(a.value.offsetWidth / 2, N), N = Math.min(N, H.width - a.value.offsetWidth / 2), o.endColorStop = Math.round(
1195
- (N - a.value.offsetWidth / 2) / (H.width - a.value.offsetWidth) * 100
1196
- ), t("update:endColorStop", o.endColorStop), t("endColorStopChange", o.endColorStop);
1197
- }
1198
- }, b = (s) => {
1199
- const _ = s.target, H = parseInt(_.value.replace("°", ""));
1200
- isNaN(H) || (o.angle = H % 360), t("update:angle", o.angle), t("angleChange", o.angle);
1201
- }, h = (s) => {
1202
- o.angle = s, t("update:angle", o.angle), t("angleChange", o.angle);
1203
- }, y = (s) => {
1204
- s === "advance" ? (i.value = !0, t("advanceChange", !0)) : (c.value.hex = s, t("advanceChange", !1)), L();
1205
- }, f = (s) => {
1206
- c.value.alpha = s, L();
1207
- }, w = (s) => {
1208
- c.value.hue = s, L();
1209
- }, S = (s, _) => {
1210
- c.value.saturation = s, c.value.brightness = _, L();
1211
- }, F = (s) => {
1212
- c.value.lightness = s, L();
1213
- }, E = () => {
1214
- L();
1215
- }, L = () => {
1216
- o.startActive ? (t("update:startColor", o.startColor), t("startColorChange", o.startColor)) : (t("update:endColor", o.endColor), t("endColorChange", o.endColor));
1217
- }, U = () => {
1218
- i.value = !1, t("advanceChange", !1);
1219
- }, J = () => {
1220
- o.type = o.type === "linear" ? "radial" : "linear", t("typeChange", o.type);
1221
- }, X = useLocalStorage(fe, [], {}), ce = useDebounceFn(() => {
1222
- if (e.disableHistory)
1223
- return;
1224
- const s = c.value.toRgbString();
1225
- if (X.value = X.value.filter((_) => !tinycolor.equals(_, s)), !X.value.includes(s)) {
1226
- for (; X.value.length > Ce; )
1227
- X.value.pop();
1228
- X.value.unshift(s);
1229
- }
1230
- }, 500);
1231
- return tryOnMounted(() => {
1232
- a.value && l.value && (Vn.triggerDragEvent(a.value, {
1233
- drag: (s) => {
1234
- m(s);
1235
- },
1236
- end: (s) => {
1237
- m(s);
1238
- }
1239
- }), Vn.triggerDragEvent(l.value, {
1240
- drag: (s) => {
1241
- d(s);
1242
- },
1243
- end: (s) => {
1244
- d(s);
1245
- }
1246
- }));
1247
- }), whenever(
1248
- () => o.startColor,
1249
- (s) => {
1250
- o.startColorRgba = s.toRgbString();
1251
- },
1252
- { deep: !0 }
1253
- ), whenever(
1254
- () => o.endColor,
1255
- (s) => {
1256
- o.endColorRgba = s.toRgbString();
1257
- },
1258
- { deep: !0 }
1259
- ), whenever(
1260
- () => c.value,
1261
- () => {
1262
- ce();
1263
- },
1264
- { deep: !0 }
1265
- ), {
1266
- startGradientRef: l,
1267
- stopGradientRef: a,
1268
- colorRangeRef: r,
1269
- state: o,
1270
- currentColor: c,
1271
- getStartColorLeft: k,
1272
- getEndColorLeft: p,
1273
- gradientBg: g,
1274
- advancePanelShow: i,
1275
- onDegreeBlur: b,
1276
- onCompactChange: y,
1277
- onAlphaChange: f,
1278
- onHueChange: w,
1279
- onBoardChange: S,
1280
- onLightChange: F,
1281
- historyColors: X,
1282
- onBack: U,
1283
- onDegreeChange: h,
1284
- onDisplayChange: E,
1285
- onTypeChange: J,
1286
- lang: n == null ? void 0 : n.lang
1287
- };
1288
- }
1289
- }), Ne = (e) => (pushScopeId("data-v-c4d6d6ea"), e = e(), popScopeId(), e), po = { class: "vc-gradient-picker" }, fo = { class: "vc-gradient-picker__header" }, Co = { class: "vc-gradient__types" }, vo = { class: "vc-gradient-wrap__types" }, bo = { class: "vc-picker-degree-input vc-degree-input" }, yo = { class: "vc-degree-input__control" }, _o = ["value"], mo = { class: "vc-degree-input__panel" }, So = { class: "vc-degree-input__disk" }, ko = { class: "vc-gradient-picker__body" }, $o = {
1290
- class: "vc-color-range",
1291
- ref: "colorRangeRef"
1292
- }, wo = { class: "vc-color-range__container" }, Bo = { class: "vc-gradient__stop__container" }, Ho = ["title"], Ro = /* @__PURE__ */ Ne(() => /* @__PURE__ */ createElementVNode("span", { class: "vc-gradient__stop--inner" }, null, -1)), Ao = [
1293
- Ro
1294
- ], Po = ["title"], Vo = /* @__PURE__ */ Ne(() => /* @__PURE__ */ createElementVNode("span", { class: "vc-gradient__stop--inner" }, null, -1)), Mo = [
1295
- Vo
1296
- ];
1297
- function Eo(e, t, o, n, i, l) {
1298
- var b, h;
1299
- const a = resolveComponent("Angle"), r = resolveComponent("Board"), c = resolveComponent("Hue"), k = resolveComponent("Palette"), p = resolveComponent("Lightness"), g = resolveComponent("Alpha"), d = resolveComponent("Display"), m = resolveComponent("History");
1300
- return openBlock(), createElementBlock("div", po, [
1301
- createElementVNode("div", fo, [
1302
- createElementVNode("div", null, [
1303
- withDirectives(createElementVNode("div", {
1304
- class: "back",
1305
- style: { cursor: "pointer" },
1306
- onClick: t[0] || (t[0] = (...y) => e.onBack && e.onBack(...y))
1307
- }, null, 512), [
1308
- [vShow, e.pickerType === "fk" && e.advancePanelShow]
1309
- ])
1310
- ]),
1311
- createElementVNode("div", Co, [
1312
- createElementVNode("div", vo, [
1313
- (openBlock(), createElementBlock(Fragment, null, renderList(["linear", "radial"], (y) => createElementVNode("div", {
1314
- class: normalizeClass(["vc-gradient__type", { active: e.state.type === y }]),
1315
- key: y,
1316
- onClick: t[1] || (t[1] = (...f) => e.onTypeChange && e.onTypeChange(...f))
1317
- }, toDisplayString(e.lang ? e.lang[y] : y), 3)), 64))
1318
- ]),
1319
- withDirectives(createElementVNode("div", bo, [
1320
- createElementVNode("div", yo, [
1321
- createElementVNode("input", {
1322
- value: e.state.angle,
1323
- onBlur: t[2] || (t[2] = (...y) => e.onDegreeBlur && e.onDegreeBlur(...y))
1324
- }, null, 40, _o),
1325
- createTextVNode("deg ")
1326
- ]),
1327
- createElementVNode("div", mo, [
1328
- createElementVNode("div", So, [
1329
- createVNode(a, {
1330
- angle: e.state.angle,
1331
- "onUpdate:angle": t[3] || (t[3] = (y) => e.state.angle = y),
1332
- size: 40,
1333
- onChange: e.onDegreeChange
1334
- }, null, 8, ["angle", "onChange"])
1335
- ])
1336
- ])
1337
- ], 512), [
1338
- [vShow, e.state.type === "linear"]
1339
- ])
1340
- ])
1341
- ]),
1342
- createElementVNode("div", ko, [
1343
- createElementVNode("div", $o, [
1344
- createElementVNode("div", wo, [
1345
- createElementVNode("div", {
1346
- class: "vc-background",
1347
- style: normalizeStyle(e.gradientBg)
1348
- }, null, 4),
1349
- createElementVNode("div", Bo, [
1350
- createElementVNode("div", {
1351
- class: normalizeClass(["vc-gradient__stop", {
1352
- "vc-gradient__stop--current": e.state.startActive
1353
- }]),
1354
- ref: "startGradientRef",
1355
- title: (b = e.lang) == null ? void 0 : b.start,
1356
- style: normalizeStyle({ left: e.getStartColorLeft + "px", backgroundColor: e.state.startColorRgba })
1357
- }, Ao, 14, Ho),
1358
- createElementVNode("div", {
1359
- class: normalizeClass(["vc-gradient__stop", {
1360
- "vc-gradient__stop--current": !e.state.startActive
1361
- }]),
1362
- ref: "stopGradientRef",
1363
- title: (h = e.lang) == null ? void 0 : h.end,
1364
- style: normalizeStyle({ left: e.getEndColorLeft + "px", backgroundColor: e.state.endColorRgba })
1365
- }, Mo, 14, Po)
1366
- ])
1367
- ])
1368
- ], 512)
1369
- ]),
1370
- e.advancePanelShow ? (openBlock(), createBlock(r, {
1371
- key: 0,
1372
- color: e.currentColor,
1373
- onChange: e.onBoardChange
1374
- }, null, 8, ["color", "onChange"])) : createCommentVNode("", !0),
1375
- e.advancePanelShow ? (openBlock(), createBlock(c, {
1376
- key: 1,
1377
- color: e.currentColor,
1378
- onChange: e.onHueChange
1379
- }, null, 8, ["color", "onChange"])) : createCommentVNode("", !0),
1380
- e.advancePanelShow ? createCommentVNode("", !0) : (openBlock(), createBlock(k, {
1381
- key: 2,
1382
- onChange: e.onCompactChange
1383
- }, null, 8, ["onChange"])),
1384
- e.advancePanelShow ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
1385
- key: 3,
1386
- color: e.currentColor,
1387
- onChange: e.onLightChange
1388
- }, null, 8, ["color", "onChange"])),
1389
- e.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createBlock(g, {
1390
- key: 4,
1391
- color: e.currentColor,
1392
- onChange: e.onAlphaChange
1393
- }, null, 8, ["color", "onChange"])),
1394
- createVNode(d, {
1395
- color: e.currentColor,
1396
- "disable-alpha": e.disableAlpha,
1397
- onChange: e.onDisplayChange
1398
- }, null, 8, ["color", "disable-alpha", "onChange"]),
1399
- e.disableHistory ? createCommentVNode("", !0) : (openBlock(), createBlock(m, {
1400
- key: 5,
1401
- round: e.roundHistory,
1402
- colors: e.historyColors,
1403
- onChange: e.onCompactChange
1404
- }, null, 8, ["round", "colors", "onChange"]))
1405
- ]);
1406
- }
1407
- const Me = /* @__PURE__ */ q(ho, [["render", Eo], ["__scopeId", "data-v-c4d6d6ea"]]);
1408
- const Io = defineComponent({
1409
- name: "WrapContainer",
1410
- props: {
1411
- theme: C.oneOf(["white", "black"]).def("white"),
1412
- showTab: C.bool.def(!1),
1413
- activeKey: C.oneOf(["pure", "gradient"]).def("pure")
1414
- },
1415
- emits: ["update:activeKey", "change"],
1416
- setup(e, { emit: t }) {
1417
- const o = reactive({
1418
- activeKey: e.activeKey
1419
- }), n = inject(ke), i = (l) => {
1420
- o.activeKey = l, t("update:activeKey", l), t("change", l);
1421
- };
1422
- return whenever(
1423
- () => e.activeKey,
1424
- (l) => {
1425
- o.activeKey = l;
1426
- }
1427
- ), { state: o, onActiveKeyChange: i, lang: n == null ? void 0 : n.lang };
1428
- }
1429
- }), Ko = { class: "vc-colorpicker--container" }, Lo = {
1430
- key: 0,
1431
- class: "vc-colorpicker--tabs"
1432
- }, No = { class: "vc-colorpicker--tabs__inner" }, Wo = { class: "vc-btn__content" }, Do = { class: "vc-btn__content" };
1433
- function To(e, t, o, n, i, l) {
1434
- var a, r;
1435
- return openBlock(), createElementBlock("div", {
1436
- class: normalizeClass(["vc-colorpicker", e.theme])
1437
- }, [
1438
- createElementVNode("div", Ko, [
1439
- e.showTab ? (openBlock(), createElementBlock("div", Lo, [
1440
- createElementVNode("div", No, [
1441
- createElementVNode("div", {
1442
- class: normalizeClass([
1443
- "vc-colorpicker--tabs__btn",
1444
- {
1445
- "vc-btn-active": e.state.activeKey === "pure"
1446
- }
1447
- ]),
1448
- onClick: t[0] || (t[0] = (c) => e.onActiveKeyChange("pure"))
1449
- }, [
1450
- createElementVNode("button", null, [
1451
- createElementVNode("div", Wo, toDisplayString((a = e.lang) == null ? void 0 : a.pure), 1)
1452
- ])
1453
- ], 2),
1454
- createElementVNode("div", {
1455
- class: normalizeClass([
1456
- "vc-colorpicker--tabs__btn",
1457
- {
1458
- "vc-btn-active": e.state.activeKey === "gradient"
1459
- }
1460
- ]),
1461
- onClick: t[1] || (t[1] = (c) => e.onActiveKeyChange("gradient"))
1462
- }, [
1463
- createElementVNode("button", null, [
1464
- createElementVNode("div", Do, toDisplayString((r = e.lang) == null ? void 0 : r.gradient), 1)
1465
- ])
1466
- ], 2),
1467
- createElementVNode("div", {
1468
- class: "vc-colorpicker--tabs__bg",
1469
- style: normalizeStyle({
1470
- width: "50%",
1471
- left: `calc(${e.state.activeKey === "gradient" ? 50 : 0}%)`
1472
- })
1473
- }, null, 4)
1474
- ])
1475
- ])) : createCommentVNode("", !0),
1476
- renderSlot(e.$slots, "default", {}, void 0, !0)
1477
- ])
1478
- ], 2);
1479
- }
1480
- const Oo = /* @__PURE__ */ q(Io, [["render", To], ["__scopeId", "data-v-0492277d"]]), zo = {
1481
- start: "Start",
1482
- end: "End",
1483
- pure: "Pure",
1484
- gradient: "Gradient",
1485
- linear: "linear",
1486
- radial: "radial"
1487
- }, Go = {
1488
- start: "开始",
1489
- end: "结束",
1490
- pure: "纯色",
1491
- gradient: "渐变",
1492
- linear: "线性",
1493
- radial: "径向"
1494
- }, Fo = {
1495
- En: zo,
1496
- "ZH-cn": Go
1497
- };
1498
- const Xo = {
1499
- isWidget: C.bool.def(!1),
1500
- pickerType: C.oneOf(["fk", "chrome"]).def("fk"),
1501
- shape: C.oneOf(["circle", "square"]).def("square"),
1502
- pureColor: {
1503
- type: [String, Object],
1504
- default: "#000000"
1505
- },
1506
- gradientColor: C.string.def(
1507
- "linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)"
1508
- ),
1509
- format: {
1510
- type: String,
1511
- default: "rgb"
1512
- },
1513
- disableAlpha: C.bool.def(!1),
1514
- disableHistory: C.bool.def(!1),
1515
- roundHistory: C.bool.def(!1),
1516
- useType: C.oneOf(["pure", "gradient", "both"]).def("pure"),
1517
- activeKey: C.oneOf(["pure", "gradient"]).def("pure"),
1518
- lang: {
1519
- type: String,
1520
- default: "ZH-cn"
1521
- },
1522
- zIndex: C.number.def(9999),
1523
- pickerContainer: {
1524
- type: [String, HTMLElement],
1525
- default: "body"
1526
- },
1527
- debounce: C.number.def(100),
1528
- theme: C.oneOf(["white", "black"]).def("white"),
1529
- blurClose: C.bool.def(!1),
1530
- defaultPopup: C.bool.def(!1)
1531
- }, qo = defineComponent({
1532
- name: "ColorPicker",
1533
- components: { FkColorPicker: Pe, ChromeColorPicker: Ve, GradientColorPicker: Me, WrapContainer: Oo },
1534
- inheritAttrs: !1,
1535
- props: Xo,
1536
- emits: [
1537
- "update:pureColor",
1538
- "pureColorChange",
1539
- "update:gradientColor",
1540
- "gradientColorChange",
1541
- "update:activeKey",
1542
- "activeKeyChange"
1543
- ],
1544
- setup(e, { emit: t }) {
1545
- provide(ke, {
1546
- lang: computed(() => Fo[e.lang || "ZH-cn"])
1547
- });
1548
- const o = !!useSlots().extra, n = reactive({
1549
- pureColor: e.pureColor || "",
1550
- activeKey: e.useType === "gradient" ? "gradient" : e.activeKey,
1551
- // "pure" | "gradient"
1552
- isAdvanceMode: !1
1553
- }), i = new A("#000"), l = new A("#000"), a = new A(n.pureColor), r = reactive({
1554
- startColor: i,
1555
- endColor: l,
1556
- startColorStop: 0,
1557
- endColorStop: 100,
1558
- angle: 0,
1559
- type: "linear",
1560
- gradientColor: e.gradientColor
1561
- }), c = ref(a), k = ref(e.defaultPopup), p = ref(null), g = ref(null);
1562
- let d = null;
1563
- const m = computed(() => ({
1564
- background: n.activeKey !== "gradient" ? tinycolor(n.pureColor).toRgbString() : r.gradientColor
1565
- })), b = computed(() => n.activeKey === "gradient" ? Me.name : e.pickerType === "fk" ? Pe.name : Ve.name), h = (s) => {
1566
- n.isAdvanceMode = s;
1567
- }, y = computed(() => {
1568
- const s = {
1569
- disableAlpha: e.disableAlpha,
1570
- disableHistory: e.disableHistory,
1571
- roundHistory: e.roundHistory,
1572
- pickerType: e.pickerType
1573
- };
1574
- return n.activeKey === "gradient" ? {
1575
- ...s,
1576
- startColor: r.startColor,
1577
- endColor: r.endColor,
1578
- angle: r.angle,
1579
- type: r.type,
1580
- startColorStop: r.startColorStop,
1581
- endColorStop: r.endColorStop,
1582
- onStartColorChange: (_) => {
1583
- r.startColor = _, E();
1584
- },
1585
- onEndColorChange: (_) => {
1586
- r.endColor = _, E();
1587
- },
1588
- onStartColorStopChange: (_) => {
1589
- r.startColorStop = _, E();
1590
- },
1591
- onEndColorStopChange: (_) => {
1592
- r.endColorStop = _, E();
1593
- },
1594
- onAngleChange: (_) => {
1595
- r.angle = _, E();
1596
- },
1597
- onTypeChange: (_) => {
1598
- r.type = _, E();
1599
- },
1600
- onAdvanceChange: h
1601
- } : {
1602
- ...s,
1603
- disableAlpha: e.disableAlpha,
1604
- disableHistory: e.disableHistory,
1605
- roundHistory: e.roundHistory,
1606
- color: c.value,
1607
- onChange: J,
1608
- onAdvanceChange: h
1609
- };
1610
- }), f = () => {
1611
- k.value = !0, d ? d.update() : U();
1612
- }, w = () => {
1613
- k.value = !1;
1614
- }, S = useDebounceFn(() => {
1615
- !e.isWidget && e.blurClose && w();
1616
- }, 100);
1617
- onClickOutside(g, () => {
1618
- w();
1619
- });
1620
- const F = () => {
1621
- var s, _, H, N;
1622
- try {
1623
- const [z] = nodeExports.parse(r.gradientColor);
1624
- if (z && z.type.includes("gradient") && z.colorStops.length >= 2) {
1625
- const $e = z.colorStops[0], we = z.colorStops[1];
1626
- r.startColorStop = Number((s = $e.length) == null ? void 0 : s.value) || 0, r.endColorStop = Number((_ = we.length) == null ? void 0 : _.value) || 0, z.type === "linear-gradient" && ((H = z.orientation) == null ? void 0 : H.type) === "angular" && (r.angle = Number((N = z.orientation) == null ? void 0 : N.value) || 0), r.type = z.type.split("-")[0];
1627
- const [We, De, Te, Oe] = $e.value, [ze, Ge, Fe, Xe] = we.value;
1628
- r.startColor = new A({
1629
- r: Number(We),
1630
- g: Number(De),
1631
- b: Number(Te),
1632
- a: Number(Oe)
1633
- }), r.endColor = new A({
1634
- r: Number(ze),
1635
- g: Number(Ge),
1636
- b: Number(Fe),
1637
- a: Number(Xe)
1638
- });
1639
- }
1640
- } catch (z) {
1641
- console.log(`[Parse Color]: ${z}`);
1642
- }
1643
- }, E = useDebounceFn(() => {
1644
- const s = L();
1645
- try {
1646
- r.gradientColor = nodeExports.stringify(s), t("update:gradientColor", r.gradientColor), t("gradientColorChange", r.gradientColor);
1647
- } catch (_) {
1648
- console.log(_);
1649
- }
1650
- }, e.debounce), L = () => {
1651
- const s = [], _ = r.startColor.RGB.map((z) => z.toString()), H = r.endColor.RGB.map((z) => z.toString()), N = [
1652
- {
1653
- type: "rgba",
1654
- value: [_[0], _[1], _[2], _[3]],
1655
- length: { value: r.startColorStop + "", type: "%" }
1656
- },
1657
- {
1658
- type: "rgba",
1659
- value: [H[0], H[1], H[2], H[3]],
1660
- length: { value: r.endColorStop + "", type: "%" }
1661
- }
1662
- ];
1663
- return r.type === "linear" ? s.push({
1664
- type: "linear-gradient",
1665
- orientation: { type: "angular", value: r.angle + "" },
1666
- colorStops: N
1667
- }) : r.type === "radial" && s.push({
1668
- type: "radial-gradient",
1669
- orientation: [{ type: "shape", value: "circle" }],
1670
- colorStops: N
1671
- }), s;
1672
- }, U = () => {
1673
- p.value && g.value && (d = createPopper(p.value, g.value, {
1674
- placement: "auto",
1675
- modifiers: [
1676
- {
1677
- name: "offset",
1678
- options: {
1679
- offset: [0, 8]
1680
- }
1681
- },
1682
- {
1683
- name: "flip",
1684
- options: {
1685
- allowedAutoPlacements: ["top", "bottom", "left", "right"],
1686
- rootBoundary: "viewport"
1687
- }
1688
- }
1689
- ]
1690
- }));
1691
- }, J = (s) => {
1692
- c.value = s, n.pureColor = s.toString(e.format), X();
1693
- }, X = useDebounceFn(() => {
1694
- t("update:pureColor", n.pureColor), t("pureColorChange", n.pureColor);
1695
- }, e.debounce), ce = (s) => {
1696
- n.activeKey = s, t("update:activeKey", s), t("activeKeyChange", s);
1697
- };
1698
- return tryOnMounted(() => {
1699
- F(), d || U();
1700
- }), whenever(
1701
- () => e.gradientColor,
1702
- (s) => {
1703
- s != r.gradientColor && (r.gradientColor = s);
1704
- }
1705
- ), whenever(
1706
- () => r.gradientColor,
1707
- () => {
1708
- F();
1709
- }
1710
- ), whenever(
1711
- () => e.activeKey,
1712
- (s) => {
1713
- n.activeKey = s;
1714
- }
1715
- ), whenever(
1716
- () => e.useType,
1717
- (s) => {
1718
- n.activeKey !== "gradient" && s === "gradient" ? n.activeKey = "gradient" : n.activeKey = "pure";
1719
- }
1720
- ), whenever(
1721
- () => e.pureColor,
1722
- (s) => {
1723
- tinycolor.equals(s, n.pureColor) || (n.pureColor = s, c.value = new A(s));
1724
- },
1725
- { deep: !0 }
1726
- ), {
1727
- colorCubeRef: p,
1728
- pickerRef: g,
1729
- showPicker: k,
1730
- colorInstance: c,
1731
- getBgColorStyle: m,
1732
- getComponentName: b,
1733
- getBindArgs: y,
1734
- state: n,
1735
- hasExtra: o,
1736
- onColorChange: J,
1737
- onShowPicker: f,
1738
- onActiveKeyChange: ce,
1739
- onAutoClose: S
1740
- };
1741
- }
1742
- }), Yo = {
1743
- key: 0,
1744
- class: "vc-color-extra"
1745
- }, Uo = {
1746
- key: 0,
1747
- class: "vc-color-extra"
1748
- };
1749
- function jo(e, t, o, n, i, l) {
1750
- const a = resolveComponent("WrapContainer");
1751
- return openBlock(), createElementBlock(Fragment, null, [
1752
- e.isWidget ? (openBlock(), createBlock(a, {
1753
- key: 0,
1754
- "active-key": e.state.activeKey,
1755
- "onUpdate:activeKey": t[0] || (t[0] = (r) => e.state.activeKey = r),
1756
- "show-tab": e.useType === "both",
1757
- style: normalizeStyle({ zIndex: e.zIndex }),
1758
- theme: e.theme,
1759
- onChange: e.onActiveKeyChange
1760
- }, {
1761
- default: withCtx(() => [
1762
- (openBlock(), createBlock(resolveDynamicComponent(e.getComponentName), mergeProps({ key: e.getComponentName }, e.getBindArgs), null, 16)),
1763
- e.hasExtra ? (openBlock(), createElementBlock("div", Yo, [
1764
- renderSlot(e.$slots, "extra", {}, void 0, !0)
1765
- ])) : createCommentVNode("", !0)
1766
- ]),
1767
- _: 3
1768
- }, 8, ["active-key", "show-tab", "style", "theme", "onChange"])) : createCommentVNode("", !0),
1769
- e.isWidget ? createCommentVNode("", !0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1770
- createElementVNode("div", {
1771
- class: normalizeClass(["vc-color-wrap transparent", { round: e.shape === "circle" }]),
1772
- ref: "colorCubeRef"
1773
- }, [
1774
- createElementVNode("div", {
1775
- class: "current-color",
1776
- style: normalizeStyle(e.getBgColorStyle),
1777
- onClick: t[1] || (t[1] = (...r) => e.onShowPicker && e.onShowPicker(...r))
1778
- }, null, 4)
1779
- ], 2),
1780
- (openBlock(), createBlock(Teleport, { to: e.pickerContainer }, [
1781
- withDirectives(createElementVNode("div", {
1782
- ref: "pickerRef",
1783
- style: normalizeStyle({ zIndex: e.zIndex }),
1784
- onMouseleave: t[3] || (t[3] = (...r) => e.onAutoClose && e.onAutoClose(...r))
1785
- }, [
1786
- e.showPicker ? (openBlock(), createBlock(a, {
1787
- key: 0,
1788
- "show-tab": e.useType === "both" && !e.state.isAdvanceMode,
1789
- theme: e.theme,
1790
- "active-key": e.state.activeKey,
1791
- "onUpdate:activeKey": t[2] || (t[2] = (r) => e.state.activeKey = r),
1792
- onChange: e.onActiveKeyChange
1793
- }, {
1794
- default: withCtx(() => [
1795
- (openBlock(), createBlock(resolveDynamicComponent(e.getComponentName), mergeProps({ key: e.getComponentName }, e.getBindArgs), null, 16)),
1796
- e.hasExtra ? (openBlock(), createElementBlock("div", Uo, [
1797
- renderSlot(e.$slots, "extra", {}, void 0, !0)
1798
- ])) : createCommentVNode("", !0)
1799
- ]),
1800
- _: 3
1801
- }, 8, ["show-tab", "theme", "active-key", "onChange"])) : createCommentVNode("", !0)
1802
- ], 36), [
1803
- [vShow, e.showPicker]
1804
- ])
1805
- ], 8, ["to"]))
1806
- ], 64))
1807
- ], 64);
1808
- }
1809
- const re = /* @__PURE__ */ q(qo, [["render", jo], ["__scopeId", "data-v-354ca836"]]), rn = {
1810
- install: (e) => {
1811
- e.component(re.name, re), e.component("Vue3" + re.name, re);
1812
- }
1813
- };
1814
-
1815
- export { re as ColorPicker, rn as default };