@idux/charts-core 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/tooltipTheme.d.ts +8 -0
- package/dist/composables/useTooltips.d.ts +22 -1
- package/dist/index.js +516 -300
- package/dist/index.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
1
|
-
import { DataZoomComponent as e, GridComponent as t, LegendComponent as n,
|
|
2
|
-
import { LabelLayout as
|
|
3
|
-
import { SVGRenderer as
|
|
4
|
-
import { computed as
|
|
5
|
-
import { PictorialBarChart as
|
|
6
|
-
import { init as
|
|
7
|
-
import { cloneDeep as
|
|
1
|
+
import { DataZoomComponent as e, GridComponent as t, LegendComponent as n, MarkAreaComponent as r, MarkLineComponent as i, MarkPointComponent as a, TitleComponent as o, TooltipComponent as s } from "echarts/components";
|
|
2
|
+
import { LabelLayout as c, UniversalTransition as l } from "echarts/features";
|
|
3
|
+
import { SVGRenderer as u } from "echarts/renderers";
|
|
4
|
+
import { computed as d, defineComponent as f, getCurrentInstance as p, h as m, inject as ee, isVue2 as h, onBeforeUnmount as te, onBeforeUpdate as g, onMounted as ne, onUpdated as re, shallowRef as _, unref as v, watch as y, watchEffect as ie } from "vue-demi";
|
|
5
|
+
import { PictorialBarChart as b } from "echarts/charts";
|
|
6
|
+
import { init as ae, registerTheme as x, use as S } from "echarts/core";
|
|
7
|
+
import { cloneDeep as C, isBoolean as oe, isEqual as w, isNil as se } from "lodash-es";
|
|
8
|
+
// composables/tooltipTheme.ts
|
|
9
|
+
var ce = 0;
|
|
10
|
+
function le(e) {
|
|
11
|
+
let t = `ix-chart-tooltip-${++ce}`, n = "light", r = null, i = () => {
|
|
12
|
+
let i = e();
|
|
13
|
+
i && (i.dataset.ixChartTheme = n, r?.isConnected || (r = i.ownerDocument.querySelector(`.${t}`)), r && (r.dataset.ixChartTheme = n));
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
prepare(e) {
|
|
17
|
+
if (!e.tooltip) return e;
|
|
18
|
+
let n = (e) => ({
|
|
19
|
+
...e,
|
|
20
|
+
className: [e.className, t].filter(Boolean).join(" ")
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
...e,
|
|
24
|
+
tooltip: Array.isArray(e.tooltip) ? e.tooltip.map(n) : n(e.tooltip)
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
sync(e) {
|
|
28
|
+
n = e.getOption().darkMode === !0 ? "dark" : "light", i();
|
|
29
|
+
},
|
|
30
|
+
rendered: i
|
|
31
|
+
};
|
|
32
|
+
}
|
|
8
33
|
// composables/useResizeObserver.ts
|
|
9
|
-
function
|
|
10
|
-
|
|
34
|
+
function ue(e, t, n) {
|
|
35
|
+
y([
|
|
11
36
|
e,
|
|
12
37
|
t,
|
|
13
38
|
n
|
|
@@ -18,13 +43,13 @@ function ae(e, t, n) {
|
|
|
18
43
|
o = void 0, t.value === n && n.resize();
|
|
19
44
|
}));
|
|
20
45
|
};
|
|
21
|
-
|
|
22
|
-
|
|
46
|
+
de(e, s), a(() => {
|
|
47
|
+
fe(e, s), o !== void 0 && cancelAnimationFrame(o);
|
|
23
48
|
});
|
|
24
49
|
});
|
|
25
50
|
}
|
|
26
51
|
var T = /* @__PURE__ */ new Map();
|
|
27
|
-
function
|
|
52
|
+
function de(e, t, n) {
|
|
28
53
|
if (e && t) {
|
|
29
54
|
if (T.has(e)) T.get(e).listeners.push(t);
|
|
30
55
|
else {
|
|
@@ -38,79 +63,81 @@ function oe(e, t, n) {
|
|
|
38
63
|
}
|
|
39
64
|
}
|
|
40
65
|
}
|
|
41
|
-
function
|
|
66
|
+
function fe(e, t) {
|
|
42
67
|
if (!e || !t || !T.has(e)) return;
|
|
43
68
|
let { listeners: n, ro: r } = T.get(e), i = n.indexOf(t);
|
|
44
69
|
i > -1 && (n.splice(i, 1), n.length === 0 && (r.disconnect(), T.delete(e)));
|
|
45
70
|
}
|
|
46
71
|
// themes/token.ts
|
|
47
|
-
var
|
|
72
|
+
var pe = Symbol("CHART_THEME_TOKEN");
|
|
48
73
|
// composables/useChart.ts
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
function
|
|
52
|
-
let n = () => typeof t == "function" ? t() : t, r =
|
|
53
|
-
|
|
74
|
+
S([b]);
|
|
75
|
+
var me = { text: "加载中..." };
|
|
76
|
+
function he(e, t) {
|
|
77
|
+
let n = () => typeof t == "function" ? t() : t, r = _(), i = _(), a = _(), o = d(() => v(e).autoResize ?? !0), s = d(() => v(e).group), c = d(() => v(e).initOption), l = d(() => v(e).loading), u = d(() => v(e).setOptionOpts), f = ee(pe, void 0), p = d(() => v(e).theme ?? v(f) ?? "seer"), m = [], h = (e, t) => {
|
|
78
|
+
m = m.filter((n) => {
|
|
54
79
|
let r = t.some(([e, t, r]) => e === n.name && t === n.handler && r === n.once);
|
|
55
80
|
return r || e.off(n.name, n.wrapped), r;
|
|
56
81
|
}), t.forEach(([t, n, r]) => {
|
|
57
|
-
if (
|
|
82
|
+
if (m.some((e) => e.name === t && e.handler === n && e.once === r)) return;
|
|
58
83
|
let i = (...a) => {
|
|
59
84
|
r && e.off(t, i), n(...a);
|
|
60
85
|
};
|
|
61
|
-
|
|
86
|
+
m.push({
|
|
62
87
|
name: t,
|
|
63
88
|
handler: n,
|
|
64
89
|
once: r,
|
|
65
90
|
wrapped: i
|
|
66
91
|
}), e.on(t, i);
|
|
67
92
|
});
|
|
68
|
-
},
|
|
93
|
+
}, g = le(() => r.value), b = () => {
|
|
69
94
|
let t = r.value;
|
|
70
95
|
if (!t) return;
|
|
71
|
-
let o =
|
|
72
|
-
o.
|
|
96
|
+
let o = ae(t, p.value, c.value);
|
|
97
|
+
o.on("rendered", g.rendered);
|
|
98
|
+
let s = v(e), { restOptions: l, events: d } = E(s, n(), !1);
|
|
99
|
+
o.setOption(g.prepare(l), u.value), g.sync(o), a.value = C(l), h(o, d);
|
|
73
100
|
let f = s.onReady || n()?.ready;
|
|
74
101
|
f && f(o), i.value = o;
|
|
75
|
-
},
|
|
76
|
-
i.value && (i.value.dispose(), i.value = void 0,
|
|
102
|
+
}, x = () => {
|
|
103
|
+
i.value && (i.value.dispose(), i.value = void 0, m = []);
|
|
77
104
|
};
|
|
78
|
-
return
|
|
79
|
-
i.value &&
|
|
80
|
-
}),
|
|
105
|
+
return ne(() => b()), te(() => x()), re(() => {
|
|
106
|
+
i.value && h(i.value, E(v(e), n(), !1).events);
|
|
107
|
+
}), y(() => v(e), (e) => {
|
|
81
108
|
let t = i.value;
|
|
82
109
|
if (!t) return;
|
|
83
|
-
let { restOptions: r, events: o } =
|
|
84
|
-
|
|
85
|
-
}, { deep: !0 }),
|
|
86
|
-
|
|
87
|
-
}),
|
|
110
|
+
let { restOptions: r, events: o } = E(e, n(), !1);
|
|
111
|
+
h(t, o), w(r, a.value) || (t.setOption(g.prepare(r), u.value), r.darkMode === a.value?.darkMode ? g.rendered() : g.sync(t), a.value = C(r));
|
|
112
|
+
}, { deep: !0 }), y([() => C(p.value), () => C(c.value)], ([e, t], [n, r]) => {
|
|
113
|
+
w(e, n) && w(t, r) || (x(), b());
|
|
114
|
+
}), ie(() => {
|
|
88
115
|
let e = s.value;
|
|
89
116
|
i.value && (i.value.group = e ?? "");
|
|
90
|
-
}),
|
|
117
|
+
}), ie(() => {
|
|
91
118
|
let e = i.value;
|
|
92
119
|
if (!e) return;
|
|
93
|
-
let t =
|
|
120
|
+
let t = l.value;
|
|
94
121
|
if (t) {
|
|
95
122
|
let n = e.getOption().darkMode === !0 ? {
|
|
96
|
-
...
|
|
123
|
+
...me,
|
|
97
124
|
textColor: "#F4F8FF",
|
|
98
125
|
maskColor: "rgba(10, 12, 15, 0.8)"
|
|
99
|
-
} :
|
|
100
|
-
e.showLoading(
|
|
126
|
+
} : me;
|
|
127
|
+
e.showLoading(oe(t) ? n : {
|
|
101
128
|
...n,
|
|
102
129
|
...t
|
|
103
130
|
});
|
|
104
131
|
} else e.hideLoading();
|
|
105
|
-
}),
|
|
132
|
+
}), ue(r, i, o), {
|
|
106
133
|
containerRef: r,
|
|
107
134
|
chartRef: i
|
|
108
135
|
};
|
|
109
136
|
}
|
|
110
|
-
function
|
|
137
|
+
function ge(e) {
|
|
111
138
|
return /^on[^a-z]/.test(e);
|
|
112
139
|
}
|
|
113
|
-
var
|
|
140
|
+
var _e = [
|
|
114
141
|
"class",
|
|
115
142
|
"style",
|
|
116
143
|
"autoResize",
|
|
@@ -121,11 +148,11 @@ var le = [
|
|
|
121
148
|
"theme",
|
|
122
149
|
"onReady"
|
|
123
150
|
];
|
|
124
|
-
function
|
|
151
|
+
function E(e, t = {}, n = !0) {
|
|
125
152
|
let r = {}, i = [];
|
|
126
153
|
return Object.keys(e).forEach((t) => {
|
|
127
|
-
if (!
|
|
128
|
-
if (
|
|
154
|
+
if (!_e.includes(t)) {
|
|
155
|
+
if (ge(t)) {
|
|
129
156
|
if (n) return;
|
|
130
157
|
let r = e[t];
|
|
131
158
|
if (r) {
|
|
@@ -138,7 +165,7 @@ function k(e, t = {}, n = !0) {
|
|
|
138
165
|
}
|
|
139
166
|
} else r[t] = e[t];
|
|
140
167
|
}
|
|
141
|
-
}),
|
|
168
|
+
}), h && !n && Object.keys(t).forEach((e) => {
|
|
142
169
|
if (e === "ready" || e === "~ready") return;
|
|
143
170
|
let n = t[e];
|
|
144
171
|
if (n) {
|
|
@@ -154,164 +181,45 @@ function k(e, t = {}, n = !0) {
|
|
|
154
181
|
events: i
|
|
155
182
|
};
|
|
156
183
|
}
|
|
157
|
-
//
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<div class="charts-tooltips-title">${e}</div>
|
|
162
|
-
${t.map((e) => `
|
|
163
|
-
<div class="charts-tooltips-item">
|
|
164
|
-
<span class="charts-tooltips-item-border" style="background: ${e.color}"></span>
|
|
165
|
-
<span class="charts-tooltips-item-name">${e.name}</span>
|
|
166
|
-
<span class="charts-tooltips-item-value">${e.value}</span>
|
|
167
|
-
</div>`).join("")}
|
|
168
|
-
</div>`;
|
|
169
|
-
}
|
|
170
|
-
// composables/useStripe.ts
|
|
171
|
-
function j({ data: e = [], color: t = "", offset: n = [0, 0], rotate: r = -20, size: i = [2, 8] }) {
|
|
172
|
-
return {
|
|
173
|
-
name: "",
|
|
174
|
-
data: e,
|
|
175
|
-
type: "pictorialBar",
|
|
176
|
-
symbolRotate: r,
|
|
177
|
-
silent: !0,
|
|
178
|
-
itemStyle: {
|
|
179
|
-
color: t,
|
|
180
|
-
opacity: 0
|
|
181
|
-
},
|
|
182
|
-
emphasis: { itemStyle: { opacity: 1 } },
|
|
183
|
-
symbolRepeat: "fixed",
|
|
184
|
-
symbolMargin: 2,
|
|
185
|
-
symbol: "rect",
|
|
186
|
-
symbolClip: !0,
|
|
187
|
-
symbolSize: i,
|
|
188
|
-
symbolPosition: "start",
|
|
189
|
-
symbolOffset: n,
|
|
190
|
-
z: 1,
|
|
191
|
-
animationEasing: "elasticOut"
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function ue(e) {
|
|
195
|
-
return {
|
|
196
|
-
axisPointer: { lineStyle: { opacity: .6 } },
|
|
197
|
-
formatter: function(t) {
|
|
198
|
-
if (!t?.length) return "";
|
|
199
|
-
let n = t[0].name;
|
|
200
|
-
return A(n, t.filter((e) => !!e.seriesName).map((t) => ({
|
|
201
|
-
name: t.seriesName,
|
|
202
|
-
value: `${t.value} ${e}`,
|
|
203
|
-
color: t.color
|
|
204
|
-
})));
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function de({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
|
|
209
|
-
return [{
|
|
210
|
-
type: "bar",
|
|
211
|
-
z: 0,
|
|
212
|
-
...e
|
|
213
|
-
}, j({
|
|
214
|
-
data: e.data,
|
|
215
|
-
offset: n,
|
|
216
|
-
color: t,
|
|
217
|
-
rotate: r,
|
|
218
|
-
size: i
|
|
219
|
-
})];
|
|
220
|
-
}
|
|
221
|
-
function fe() {
|
|
222
|
-
return { aria: {
|
|
223
|
-
enabled: !0,
|
|
224
|
-
decal: {
|
|
225
|
-
show: !0,
|
|
226
|
-
decals: [{
|
|
227
|
-
color: "white",
|
|
228
|
-
dashArrayX: [1, 0],
|
|
229
|
-
dashArrayY: [6, 0],
|
|
230
|
-
symbolSize: .5,
|
|
231
|
-
rotation: Math.PI / 2
|
|
232
|
-
}]
|
|
233
|
-
}
|
|
234
|
-
} };
|
|
235
|
-
}
|
|
236
|
-
// composables/useReactiveAttrs.ts
|
|
237
|
-
var pe = {
|
|
238
|
-
"auto-resize": "autoResize",
|
|
239
|
-
"init-option": "initOption",
|
|
240
|
-
"set-option-opts": "setOptionOpts"
|
|
241
|
-
};
|
|
242
|
-
function M(e) {
|
|
243
|
-
let t = u()?.proxy, n = () => Object.fromEntries(Object.entries(p && t ? t.$attrs : e).map(([e, t]) => [pe[e] ?? e, t]));
|
|
244
|
-
if (p && t) return c(n);
|
|
245
|
-
let r = h(n());
|
|
246
|
-
return m(() => {
|
|
247
|
-
let e = n(), t = r.value;
|
|
248
|
-
(Object.keys(t).length !== Object.keys(e).length || Object.keys(e).some((n) => !Object.is(t[n], e[n]))) && (r.value = e);
|
|
249
|
-
}), r;
|
|
250
|
-
}
|
|
251
|
-
// utils/withChartProps.ts
|
|
252
|
-
function N() {
|
|
253
|
-
return (e) => e;
|
|
254
|
-
}
|
|
255
|
-
// components/Chart.ts
|
|
256
|
-
var me = N()(l({
|
|
257
|
-
name: "IxChart",
|
|
258
|
-
inheritAttrs: !1,
|
|
259
|
-
setup(e, t) {
|
|
260
|
-
let { containerRef: n } = O(M(t.attrs), () => t.listeners ?? {});
|
|
261
|
-
return { containerRef: n };
|
|
262
|
-
},
|
|
263
|
-
render() {
|
|
264
|
-
let { class: e, style: t } = this.$attrs;
|
|
265
|
-
return d("div", {
|
|
266
|
-
ref: "containerRef",
|
|
267
|
-
class: e,
|
|
268
|
-
style: {
|
|
269
|
-
width: "100%",
|
|
270
|
-
height: "100%",
|
|
271
|
-
...t
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}));
|
|
276
|
-
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
277
|
-
function P(e, t) {
|
|
278
|
-
he(e) && (e = "100%");
|
|
279
|
-
let n = I(e);
|
|
184
|
+
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
185
|
+
function D(e, t) {
|
|
186
|
+
ve(e) && (e = "100%");
|
|
187
|
+
let n = k(e);
|
|
280
188
|
return e = t === 360 ? parseFloat(e) : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (e = t === 360 ? (e < 0 ? e % t + t : e % t) / t : e % t / t, e);
|
|
281
189
|
}
|
|
282
|
-
function
|
|
190
|
+
function O(e) {
|
|
283
191
|
return Math.min(1, Math.max(0, e));
|
|
284
192
|
}
|
|
285
|
-
function
|
|
286
|
-
return typeof e == "string" && e.indexOf(".") !== -1 && !
|
|
193
|
+
function ve(e) {
|
|
194
|
+
return typeof e == "string" && e.indexOf(".") !== -1 && !k(e) && parseFloat(e) === 1;
|
|
287
195
|
}
|
|
288
|
-
function
|
|
196
|
+
function k(e) {
|
|
289
197
|
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
290
198
|
}
|
|
291
|
-
function
|
|
292
|
-
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
199
|
+
function A(e) {
|
|
200
|
+
return e = typeof e == "string" && e.trim().endsWith("%") ? parseFloat(e) / 100 : parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
293
201
|
}
|
|
294
|
-
function
|
|
202
|
+
function ye(e) {
|
|
295
203
|
return Number(e) <= 1 ? `${Number(e) * 100}%` : e;
|
|
296
204
|
}
|
|
297
|
-
function
|
|
298
|
-
if (typeof e != "number" || !(e <= 1)) return
|
|
205
|
+
function j(e) {
|
|
206
|
+
if (typeof e != "number" || !(e <= 1)) return ye(e);
|
|
299
207
|
let t = Math.min(100, Math.max(0, e * 100)) * 100;
|
|
300
208
|
return (t >= 1e-6 ? Math.trunc(t) : parseInt(String(t), 10)) / 100;
|
|
301
209
|
}
|
|
302
|
-
function
|
|
210
|
+
function be(e) {
|
|
303
211
|
return e.length === 1 ? "0" + e : String(e);
|
|
304
212
|
}
|
|
305
|
-
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.
|
|
306
|
-
function
|
|
213
|
+
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
214
|
+
function xe(e, t, n) {
|
|
307
215
|
return {
|
|
308
|
-
r:
|
|
309
|
-
g:
|
|
310
|
-
b:
|
|
216
|
+
r: D(e, 255) * 255,
|
|
217
|
+
g: D(t, 255) * 255,
|
|
218
|
+
b: D(n, 255) * 255
|
|
311
219
|
};
|
|
312
220
|
}
|
|
313
|
-
function
|
|
314
|
-
e =
|
|
221
|
+
function M(e, t, n) {
|
|
222
|
+
e = D(e, 255), t = D(t, 255), n = D(n, 255);
|
|
315
223
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o, s = (r + i) / 2;
|
|
316
224
|
if (r === i) o = 0, a = 0;
|
|
317
225
|
else {
|
|
@@ -333,15 +241,15 @@ function z(e, t, n) {
|
|
|
333
241
|
l: s
|
|
334
242
|
};
|
|
335
243
|
}
|
|
336
|
-
function
|
|
244
|
+
function N(e, t, n) {
|
|
337
245
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
338
246
|
}
|
|
339
|
-
function
|
|
247
|
+
function Se(e, t, n) {
|
|
340
248
|
let r, i, a;
|
|
341
|
-
if (e =
|
|
249
|
+
if (e = D(e, 360), t = D(t, 100), n = D(n, 100), t === 0) i = n, a = n, r = n;
|
|
342
250
|
else {
|
|
343
251
|
let o = n < .5 ? n * (1 + t) : n + t - n * t, s = 2 * n - o;
|
|
344
|
-
r =
|
|
252
|
+
r = N(s, o, e + 1 / 3), i = N(s, o, e), a = N(s, o, e - 1 / 3);
|
|
345
253
|
}
|
|
346
254
|
return {
|
|
347
255
|
r: r * 255,
|
|
@@ -349,8 +257,8 @@ function ye(e, t, n) {
|
|
|
349
257
|
b: a * 255
|
|
350
258
|
};
|
|
351
259
|
}
|
|
352
|
-
function
|
|
353
|
-
e =
|
|
260
|
+
function P(e, t, n) {
|
|
261
|
+
e = D(e, 255), t = D(t, 255), n = D(n, 255);
|
|
354
262
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = r, s = r - i, c = r === 0 ? 0 : s / r;
|
|
355
263
|
if (r === i) a = 0;
|
|
356
264
|
else {
|
|
@@ -371,8 +279,8 @@ function V(e, t, n) {
|
|
|
371
279
|
v: o
|
|
372
280
|
};
|
|
373
281
|
}
|
|
374
|
-
function
|
|
375
|
-
e =
|
|
282
|
+
function Ce(e, t, n) {
|
|
283
|
+
e = D(e, 360) * 6, t = D(t, 100), n = D(n, 100);
|
|
376
284
|
let r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
377
285
|
n,
|
|
378
286
|
o,
|
|
@@ -401,25 +309,25 @@ function be(e, t, n) {
|
|
|
401
309
|
b: d * 255
|
|
402
310
|
};
|
|
403
311
|
}
|
|
404
|
-
function
|
|
312
|
+
function F(e) {
|
|
405
313
|
return e < 10 ? 48 + e : 87 + e;
|
|
406
314
|
}
|
|
407
|
-
function
|
|
315
|
+
function I(e) {
|
|
408
316
|
let t = Math.round(e);
|
|
409
|
-
return t >= 0 && t <= 255 ? String.fromCharCode(
|
|
317
|
+
return t >= 0 && t <= 255 ? String.fromCharCode(F(t >> 4), F(t & 15)) : be(t.toString(16));
|
|
410
318
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
319
|
+
function we(e) {
|
|
320
|
+
return I(parseFloat(e) * 255);
|
|
413
321
|
}
|
|
414
|
-
function
|
|
415
|
-
let i =
|
|
322
|
+
function L(e, t, n, r) {
|
|
323
|
+
let i = I(e), a = I(t), o = I(n);
|
|
416
324
|
return r && i.startsWith(i.charAt(1)) && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) ? i.charAt(0) + a.charAt(0) + o.charAt(0) : i + a + o;
|
|
417
325
|
}
|
|
418
|
-
function
|
|
419
|
-
let a =
|
|
326
|
+
function Te(e, t, n, r, i) {
|
|
327
|
+
let a = I(e), o = I(t), s = I(n), c = we(r);
|
|
420
328
|
return i && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) && s.startsWith(s.charAt(1)) && c.startsWith(c.charAt(1)) ? a.charAt(0) + o.charAt(0) + s.charAt(0) + c.charAt(0) : a + o + s + c;
|
|
421
329
|
}
|
|
422
|
-
function
|
|
330
|
+
function Ee(e, t, n, r) {
|
|
423
331
|
let i = e / 100, a = t / 100, o = n / 100, s = r / 100;
|
|
424
332
|
return {
|
|
425
333
|
r: 255 * (1 - i) * (1 - s),
|
|
@@ -427,7 +335,7 @@ function Ce(e, t, n, r) {
|
|
|
427
335
|
b: 255 * (1 - o) * (1 - s)
|
|
428
336
|
};
|
|
429
337
|
}
|
|
430
|
-
function
|
|
338
|
+
function R(e, t, n) {
|
|
431
339
|
let r = 1 - e / 255, i = 1 - t / 255, a = 1 - n / 255, o = Math.min(r, i, a);
|
|
432
340
|
return o === 1 ? (r = 0, i = 0, a = 0) : (r = (r - o) / (1 - o) * 100, i = (i - o) / (1 - o) * 100, a = (a - o) / (1 - o) * 100), o *= 100, {
|
|
433
341
|
c: Math.round(r),
|
|
@@ -436,15 +344,102 @@ function G(e, t, n) {
|
|
|
436
344
|
k: Math.round(o)
|
|
437
345
|
};
|
|
438
346
|
}
|
|
439
|
-
function
|
|
347
|
+
function De(e, t, n) {
|
|
348
|
+
let [r, i, a] = Me(B(e / 255), B(t / 255), B(n / 255)), o = Math.sqrt(i * i + a * a);
|
|
349
|
+
if (o <= 4e-6) return {
|
|
350
|
+
l: Math.min(1, r),
|
|
351
|
+
c: 0,
|
|
352
|
+
h: 0
|
|
353
|
+
};
|
|
354
|
+
let s = Math.atan2(a, i) * 180 / Math.PI;
|
|
355
|
+
return {
|
|
356
|
+
l: Math.min(1, r),
|
|
357
|
+
c: o,
|
|
358
|
+
h: s < 0 ? s + 360 : s
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function Oe(e, t, n) {
|
|
362
|
+
if (e >= 1) return {
|
|
363
|
+
r: 255,
|
|
364
|
+
g: 255,
|
|
365
|
+
b: 255
|
|
366
|
+
};
|
|
367
|
+
if (e <= 0) return {
|
|
368
|
+
r: 0,
|
|
369
|
+
g: 0,
|
|
370
|
+
b: 0
|
|
371
|
+
};
|
|
372
|
+
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r), o = Math.max(0, t), s = H(e, o * i, o * a);
|
|
373
|
+
return Ae(s) || (s = ke(e, o, i, a)), {
|
|
374
|
+
r: V(s[0]) * 255,
|
|
375
|
+
g: V(s[1]) * 255,
|
|
376
|
+
b: V(s[2]) * 255
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function ke(e, t, n, r) {
|
|
380
|
+
let i = .02, a = 1e-4, o = je(H(e, t * n, t * r));
|
|
381
|
+
if (z(e, t * n, t * r, o) < i) return o;
|
|
382
|
+
let s = 0, c = t, l = !0;
|
|
383
|
+
for (; c - s > a;) {
|
|
384
|
+
let t = (s + c) / 2, u = H(e, t * n, t * r);
|
|
385
|
+
if (l && Ae(u)) {
|
|
386
|
+
s = t;
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
o = je(u);
|
|
390
|
+
let d = z(e, t * n, t * r, o);
|
|
391
|
+
if (d < i) {
|
|
392
|
+
if (i - d < a) break;
|
|
393
|
+
l = !1, s = t;
|
|
394
|
+
} else c = t;
|
|
395
|
+
}
|
|
396
|
+
return o;
|
|
397
|
+
}
|
|
398
|
+
function z(e, t, n, r) {
|
|
399
|
+
let [i, a, o] = Me(r[0], r[1], r[2]), s = e - i, c = t - a, l = n - o;
|
|
400
|
+
return Math.sqrt(s * s + c * c + l * l);
|
|
401
|
+
}
|
|
402
|
+
function Ae(e) {
|
|
403
|
+
return e[0] >= 0 && e[0] <= 1 && e[1] >= 0 && e[1] <= 1 && e[2] >= 0 && e[2] <= 1;
|
|
404
|
+
}
|
|
405
|
+
function je(e) {
|
|
406
|
+
return [
|
|
407
|
+
Math.min(1, Math.max(0, e[0])),
|
|
408
|
+
Math.min(1, Math.max(0, e[1])),
|
|
409
|
+
Math.min(1, Math.max(0, e[2]))
|
|
410
|
+
];
|
|
411
|
+
}
|
|
412
|
+
function B(e) {
|
|
413
|
+
return e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
414
|
+
}
|
|
415
|
+
function V(e) {
|
|
416
|
+
return e <= .0031308 ? e * 12.92 : 1.055 * e ** (1 / 2.4) - .055;
|
|
417
|
+
}
|
|
418
|
+
function Me(e, t, n) {
|
|
419
|
+
let r = Math.cbrt(.41222146947076305 * e + .5363325372617348 * t + .05144599326750221 * n), i = Math.cbrt(.21190349581782522 * e + .6806995506452344 * t + .10739695353694056 * n), a = Math.cbrt(.08830245919005643 * e + .2817188391361215 * t + .6299787016738222 * n);
|
|
420
|
+
return [
|
|
421
|
+
.210454268309314 * r + .7936177747023054 * i - .0040720430116193 * a,
|
|
422
|
+
1.9779985324311684 * r - 2.42859224204858 * i + .450593709617411 * a,
|
|
423
|
+
.0259040424655478 * r + .7827717124575296 * i - .8086757549230774 * a
|
|
424
|
+
];
|
|
425
|
+
}
|
|
426
|
+
function H(e, t, n) {
|
|
427
|
+
let r = e + .3963377773761749 * t + .2158037573099136 * n, i = e - .1055613458156586 * t - .0638541728258133 * n, a = e - .0894841775298119 * t - 1.2914855480194092 * n, o = r * r * r, s = i * i * i, c = a * a * a;
|
|
428
|
+
return [
|
|
429
|
+
4.076741636075958 * o - 3.3077115392580616 * s + .2309699031821043 * c,
|
|
430
|
+
-1.2684379732850317 * o + 2.6097573492876887 * s - .34131937600265727 * c,
|
|
431
|
+
-.004196076138675564 * o - .7034186179359363 * s + 1.7076146940746117 * c
|
|
432
|
+
];
|
|
433
|
+
}
|
|
434
|
+
function Ne(e) {
|
|
440
435
|
return {
|
|
441
436
|
r: e >> 16,
|
|
442
437
|
g: (e & 65280) >> 8,
|
|
443
438
|
b: e & 255
|
|
444
439
|
};
|
|
445
440
|
}
|
|
446
|
-
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.
|
|
447
|
-
var
|
|
441
|
+
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
|
|
442
|
+
var U = {
|
|
448
443
|
aliceblue: "#f0f8ff",
|
|
449
444
|
antiquewhite: "#faebd7",
|
|
450
445
|
aqua: "#00ffff",
|
|
@@ -594,50 +589,81 @@ var K = {
|
|
|
594
589
|
yellow: "#ffff00",
|
|
595
590
|
yellowgreen: "#9acd32"
|
|
596
591
|
};
|
|
597
|
-
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.
|
|
598
|
-
function
|
|
592
|
+
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/format-input.js
|
|
593
|
+
function Pe(e) {
|
|
599
594
|
let t = {
|
|
600
595
|
r: 0,
|
|
601
596
|
g: 0,
|
|
602
597
|
b: 0
|
|
603
|
-
}, n = 1, r = !1, i = !1;
|
|
604
|
-
if (typeof e == "string" && (e =
|
|
605
|
-
if (
|
|
606
|
-
t =
|
|
598
|
+
}, n = 1, r = !1, i = !1, a;
|
|
599
|
+
if (typeof e == "string" && (e = Re(e)), typeof e == "object") {
|
|
600
|
+
if (X(e.r) && X(e.g) && X(e.b)) {
|
|
601
|
+
t = xe(e.r, e.g, e.b), r = !0;
|
|
607
602
|
let { r: n } = e;
|
|
608
603
|
i = typeof n != "number" && String(n).endsWith("%") ? "prgb" : "rgb";
|
|
609
|
-
} else if (
|
|
610
|
-
let n =
|
|
611
|
-
t =
|
|
612
|
-
} else if (
|
|
613
|
-
let n =
|
|
614
|
-
t =
|
|
615
|
-
} else
|
|
604
|
+
} else if (X(e.h) && X(e.s) && X(e.v)) {
|
|
605
|
+
let n = j(e.s), a = j(e.v);
|
|
606
|
+
t = Ce(e.h, n, a), r = !0, i = "hsv";
|
|
607
|
+
} else if (X(e.h) && X(e.s) && X(e.l)) {
|
|
608
|
+
let n = j(e.s), a = j(e.l);
|
|
609
|
+
t = Se(e.h, n, a), r = !0, i = "hsl";
|
|
610
|
+
} else if (X(e.l) && X(e.c) && X(e.h)) {
|
|
611
|
+
let n = Fe(e.l), o = Ie(e.c), s = Le(e.h);
|
|
612
|
+
Number.isFinite(n + o + s) && (a = {
|
|
613
|
+
l: n,
|
|
614
|
+
c: o,
|
|
615
|
+
h: s
|
|
616
|
+
}, t = Oe(n, o, s), r = !0, i = "oklch");
|
|
617
|
+
} else X(e.c) && X(e.m) && X(e.y) && X(e.k) && (t = Ee(e.c, e.m, e.y, e.k), r = !0, i = "cmyk");
|
|
616
618
|
Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a);
|
|
617
619
|
}
|
|
618
|
-
return n =
|
|
620
|
+
return n = A(n), {
|
|
619
621
|
ok: r,
|
|
620
622
|
format: e.format || i,
|
|
621
623
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
622
624
|
g: Math.min(255, Math.max(t.g, 0)),
|
|
623
625
|
b: Math.min(255, Math.max(t.b, 0)),
|
|
624
|
-
a: n
|
|
626
|
+
a: n,
|
|
627
|
+
oklch: a
|
|
625
628
|
};
|
|
626
629
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
630
|
+
function Fe(e) {
|
|
631
|
+
return O(typeof e == "number" ? e : W(e, 1, !1));
|
|
632
|
+
}
|
|
633
|
+
function Ie(e) {
|
|
634
|
+
return Math.max(0, typeof e == "number" ? e : W(e, .4, !1));
|
|
635
|
+
}
|
|
636
|
+
function Le(e) {
|
|
637
|
+
let t = (typeof e == "number" ? e : W(e, NaN, !0)) % 360;
|
|
638
|
+
return t < 0 ? t + 360 : Math.abs(t);
|
|
639
|
+
}
|
|
640
|
+
function W(e, t, n) {
|
|
641
|
+
let r = /^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)([a-z%]*)$/.exec(e.trim().toLowerCase());
|
|
642
|
+
return r ? G(Number(r[1]), r[2], t, n) : NaN;
|
|
643
|
+
}
|
|
644
|
+
function G(e, t, n, r) {
|
|
645
|
+
switch (t) {
|
|
646
|
+
case "": return e;
|
|
647
|
+
case "%": return r ? NaN : e / 100 * n;
|
|
648
|
+
case "deg": return r ? e : NaN;
|
|
649
|
+
case "grad": return r ? e * .9 : NaN;
|
|
650
|
+
case "rad": return r ? e * 180 / Math.PI : NaN;
|
|
651
|
+
case "turn": return r ? e * 360 : NaN;
|
|
652
|
+
default: return NaN;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
var K = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", q = "[\\s|\\(]+(" + K + ")[,|\\s]+(" + K + ")[,|\\s]+(" + K + ")(?:[,|\\s|/]+(" + K + "))?\\s*\\)?", J = {
|
|
656
|
+
CSS_UNIT: new RegExp(K),
|
|
657
|
+
rgb: RegExp("rgba?" + q),
|
|
658
|
+
hsl: RegExp("hsla?" + q),
|
|
659
|
+
hsv: RegExp("hsva?" + q),
|
|
660
|
+
cmyk: /* @__PURE__ */ RegExp("cmyk[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?")
|
|
636
661
|
};
|
|
637
|
-
function
|
|
662
|
+
function Re(e) {
|
|
638
663
|
if (e = e.trim().toLowerCase(), e.length === 0) return !1;
|
|
664
|
+
if (e.startsWith("oklch")) return ze(e);
|
|
639
665
|
let t = !1;
|
|
640
|
-
if (
|
|
666
|
+
if (U[e]) e = U[e], t = !0;
|
|
641
667
|
else if (e === "transparent") return {
|
|
642
668
|
r: 0,
|
|
643
669
|
g: 0,
|
|
@@ -646,55 +672,70 @@ function Ee(e) {
|
|
|
646
672
|
format: "name"
|
|
647
673
|
};
|
|
648
674
|
if (typeof e == "string" && e.length <= 9) {
|
|
649
|
-
let n =
|
|
675
|
+
let n = Be(e, t);
|
|
650
676
|
if (n) return n;
|
|
651
677
|
}
|
|
652
|
-
let n =
|
|
653
|
-
return n ? {
|
|
678
|
+
let n = J.rgb.exec(e);
|
|
679
|
+
return n ? n[4] === void 0 ? {
|
|
654
680
|
r: n[1],
|
|
655
681
|
g: n[2],
|
|
656
682
|
b: n[3]
|
|
657
|
-
} :
|
|
683
|
+
} : {
|
|
658
684
|
r: n[1],
|
|
659
685
|
g: n[2],
|
|
660
686
|
b: n[3],
|
|
661
687
|
a: n[4]
|
|
662
|
-
} : (n =
|
|
688
|
+
} : (n = J.hsl.exec(e), n ? n[4] === void 0 ? {
|
|
663
689
|
h: n[1],
|
|
664
690
|
s: n[2],
|
|
665
691
|
l: n[3]
|
|
666
|
-
} :
|
|
692
|
+
} : {
|
|
667
693
|
h: n[1],
|
|
668
694
|
s: n[2],
|
|
669
695
|
l: n[3],
|
|
670
696
|
a: n[4]
|
|
671
|
-
} : (n =
|
|
697
|
+
} : (n = J.hsv.exec(e), n ? n[4] === void 0 ? {
|
|
672
698
|
h: n[1],
|
|
673
699
|
s: n[2],
|
|
674
700
|
v: n[3]
|
|
675
|
-
} :
|
|
701
|
+
} : {
|
|
676
702
|
h: n[1],
|
|
677
703
|
s: n[2],
|
|
678
704
|
v: n[3],
|
|
679
705
|
a: n[4]
|
|
680
|
-
} : (n =
|
|
706
|
+
} : (n = J.cmyk.exec(e), n ? {
|
|
681
707
|
c: n[1],
|
|
682
708
|
m: n[2],
|
|
683
709
|
y: n[3],
|
|
684
710
|
k: n[4]
|
|
685
|
-
} : !1)))
|
|
711
|
+
} : !1)));
|
|
712
|
+
}
|
|
713
|
+
function ze(e) {
|
|
714
|
+
let t = /^oklch(?:\s*\(\s*|\s+)(?:none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(%?))[\s,]+(?:none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(%?))[\s,]+(?:none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(deg|grad|rad|turn)?)(?:(?:\s*[,/]\s*|\s+)(none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(%?)))?\s*\)?$/.exec(e);
|
|
715
|
+
if (!t) return !1;
|
|
716
|
+
let n = t[1] === void 0 ? 0 : G(Number(t[1]), t[2], 1, !1), r = t[3] === void 0 ? 0 : G(Number(t[3]), t[4], .4, !1), i = t[5] === void 0 ? 0 : G(Number(t[5]), t[6] ?? "", NaN, !0);
|
|
717
|
+
return t[7] === void 0 ? {
|
|
718
|
+
l: n,
|
|
719
|
+
c: r,
|
|
720
|
+
h: i
|
|
721
|
+
} : {
|
|
722
|
+
l: n,
|
|
723
|
+
c: r,
|
|
724
|
+
h: i,
|
|
725
|
+
a: t[8] === void 0 ? 0 : G(Number(t[8]), t[9], 1, !1)
|
|
726
|
+
};
|
|
686
727
|
}
|
|
687
|
-
function
|
|
728
|
+
function Be(e, t) {
|
|
688
729
|
let n = +!!e.startsWith("#"), r = e.length - n;
|
|
689
730
|
if (r === 6 || r === 8) {
|
|
690
|
-
let i =
|
|
731
|
+
let i = Y(e, n) * 16 + Y(e, n + 1), a = Y(e, n + 2) * 16 + Y(e, n + 3), o = Y(e, n + 4) * 16 + Y(e, n + 5);
|
|
691
732
|
if (r === 6) return Number.isNaN(i + a + o) ? void 0 : {
|
|
692
733
|
r: i,
|
|
693
734
|
g: a,
|
|
694
735
|
b: o,
|
|
695
736
|
format: t ? "name" : "hex"
|
|
696
737
|
};
|
|
697
|
-
let s =
|
|
738
|
+
let s = Y(e, n + 6) * 16 + Y(e, n + 7);
|
|
698
739
|
return Number.isNaN(i + a + o + s) ? void 0 : {
|
|
699
740
|
r: i,
|
|
700
741
|
g: a,
|
|
@@ -704,14 +745,14 @@ function De(e, t) {
|
|
|
704
745
|
};
|
|
705
746
|
}
|
|
706
747
|
if (r === 3 || r === 4) {
|
|
707
|
-
let i =
|
|
748
|
+
let i = Y(e, n) * 17, a = Y(e, n + 1) * 17, o = Y(e, n + 2) * 17;
|
|
708
749
|
if (r === 3) return Number.isNaN(i + a + o) ? void 0 : {
|
|
709
750
|
r: i,
|
|
710
751
|
g: a,
|
|
711
752
|
b: o,
|
|
712
753
|
format: t ? "name" : "hex"
|
|
713
754
|
};
|
|
714
|
-
let s =
|
|
755
|
+
let s = Y(e, n + 3) * 17;
|
|
715
756
|
return Number.isNaN(i + a + o + s) ? void 0 : {
|
|
716
757
|
r: i,
|
|
717
758
|
g: a,
|
|
@@ -721,26 +762,26 @@ function De(e, t) {
|
|
|
721
762
|
};
|
|
722
763
|
}
|
|
723
764
|
}
|
|
724
|
-
function
|
|
765
|
+
function Y(e, t) {
|
|
725
766
|
let n = e.charCodeAt(t);
|
|
726
767
|
return n >= 48 && n <= 57 ? n - 48 : n >= 97 && n <= 102 ? n - 87 : n >= 65 && n <= 70 ? n - 55 : NaN;
|
|
727
768
|
}
|
|
728
|
-
function
|
|
729
|
-
return typeof e == "number" ? !Number.isNaN(e) : e !== void 0 &&
|
|
769
|
+
function X(e) {
|
|
770
|
+
return typeof e == "number" ? !Number.isNaN(e) : e !== void 0 && J.CSS_UNIT.test(e);
|
|
730
771
|
}
|
|
731
|
-
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.
|
|
732
|
-
var
|
|
772
|
+
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
773
|
+
var Ve = class e {
|
|
733
774
|
constructor(t = "", n = {}) {
|
|
734
775
|
if (t instanceof e) return t;
|
|
735
|
-
typeof t == "number" && (t =
|
|
736
|
-
let r =
|
|
776
|
+
typeof t == "number" && (t = Ne(t)), this.originalInput = t;
|
|
777
|
+
let r = Pe(t);
|
|
737
778
|
this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = n.format ?? r.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
|
|
738
779
|
}
|
|
739
|
-
isDark() {
|
|
740
|
-
return this.getBrightness() <
|
|
780
|
+
isDark(e = 128) {
|
|
781
|
+
return this.getBrightness() < e;
|
|
741
782
|
}
|
|
742
|
-
isLight() {
|
|
743
|
-
return !this.isDark();
|
|
783
|
+
isLight(e = 128) {
|
|
784
|
+
return !this.isDark(e);
|
|
744
785
|
}
|
|
745
786
|
getBrightness() {
|
|
746
787
|
let e = this.toRgb();
|
|
@@ -754,14 +795,14 @@ var Oe = class e {
|
|
|
754
795
|
return this.a;
|
|
755
796
|
}
|
|
756
797
|
setAlpha(e) {
|
|
757
|
-
return this.a =
|
|
798
|
+
return this.a = A(e), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
758
799
|
}
|
|
759
800
|
isMonochrome() {
|
|
760
801
|
let { s: e } = this.toHsl();
|
|
761
802
|
return e === 0;
|
|
762
803
|
}
|
|
763
804
|
toHsv() {
|
|
764
|
-
let e =
|
|
805
|
+
let e = P(this.r, this.g, this.b);
|
|
765
806
|
return {
|
|
766
807
|
h: e.h * 360,
|
|
767
808
|
s: e.s,
|
|
@@ -770,11 +811,11 @@ var Oe = class e {
|
|
|
770
811
|
};
|
|
771
812
|
}
|
|
772
813
|
toHsvString() {
|
|
773
|
-
let e =
|
|
814
|
+
let e = P(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
|
|
774
815
|
return this.a === 1 ? `hsv(${t}, ${n}%, ${r}%)` : `hsva(${t}, ${n}%, ${r}%, ${this.roundA})`;
|
|
775
816
|
}
|
|
776
817
|
toHsl() {
|
|
777
|
-
let e =
|
|
818
|
+
let e = M(this.r, this.g, this.b);
|
|
778
819
|
return {
|
|
779
820
|
h: e.h * 360,
|
|
780
821
|
s: e.s,
|
|
@@ -783,17 +824,42 @@ var Oe = class e {
|
|
|
783
824
|
};
|
|
784
825
|
}
|
|
785
826
|
toHslString() {
|
|
786
|
-
let e =
|
|
827
|
+
let e = M(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
|
|
787
828
|
return this.a === 1 ? `hsl(${t}, ${n}%, ${r}%)` : `hsla(${t}, ${n}%, ${r}%, ${this.roundA})`;
|
|
788
829
|
}
|
|
830
|
+
toOklch() {
|
|
831
|
+
if (He(this.originalInput)) {
|
|
832
|
+
let e = Pe(this.originalInput);
|
|
833
|
+
if (e.oklch && Z(e.r) === this.r && Z(e.g) === this.g && Z(e.b) === this.b) {
|
|
834
|
+
let { l: t, c: n, h: r } = e.oklch;
|
|
835
|
+
return {
|
|
836
|
+
l: t,
|
|
837
|
+
c: n,
|
|
838
|
+
h: r,
|
|
839
|
+
a: this.a
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
let { l: e, c: t, h: n } = De(this.r, this.g, this.b);
|
|
844
|
+
return {
|
|
845
|
+
l: e,
|
|
846
|
+
c: t,
|
|
847
|
+
h: n,
|
|
848
|
+
a: this.a
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
toOklchString() {
|
|
852
|
+
let { l: e, c: t, h: n } = this.toOklch();
|
|
853
|
+
return `oklch(${Math.round(e * 1e5) / 1e3}% ${Math.round(t * 1e5) / 1e5} ${Math.round(n * 1e3) / 1e3 % 360}${this.a === 1 ? "" : ` / ${this.roundA}`})`;
|
|
854
|
+
}
|
|
789
855
|
toHex(e = !1) {
|
|
790
|
-
return
|
|
856
|
+
return L(this.r, this.g, this.b, e);
|
|
791
857
|
}
|
|
792
858
|
toHexString(e = !1) {
|
|
793
859
|
return "#" + this.toHex(e);
|
|
794
860
|
}
|
|
795
861
|
toHex8(e = !1) {
|
|
796
|
-
return
|
|
862
|
+
return Te(this.r, this.g, this.b, this.a, e);
|
|
797
863
|
}
|
|
798
864
|
toHex8String(e = !1) {
|
|
799
865
|
return "#" + this.toHex8(e);
|
|
@@ -814,7 +880,7 @@ var Oe = class e {
|
|
|
814
880
|
return this.a === 1 ? `rgb(${e}, ${t}, ${n})` : `rgba(${e}, ${t}, ${n}, ${this.roundA})`;
|
|
815
881
|
}
|
|
816
882
|
toPercentageRgb() {
|
|
817
|
-
let e = (e) => `${Math.round(
|
|
883
|
+
let e = (e) => `${Math.round(D(e, 255) * 100)}%`;
|
|
818
884
|
return {
|
|
819
885
|
r: e(this.r),
|
|
820
886
|
g: e(this.g),
|
|
@@ -822,21 +888,29 @@ var Oe = class e {
|
|
|
822
888
|
a: this.a
|
|
823
889
|
};
|
|
824
890
|
}
|
|
891
|
+
toRgbRatio() {
|
|
892
|
+
return {
|
|
893
|
+
r: this.r / 255,
|
|
894
|
+
g: this.g / 255,
|
|
895
|
+
b: this.b / 255,
|
|
896
|
+
a: this.a
|
|
897
|
+
};
|
|
898
|
+
}
|
|
825
899
|
toPercentageRgbString() {
|
|
826
|
-
let e = (e) => Math.round(
|
|
900
|
+
let e = (e) => Math.round(D(e, 255) * 100);
|
|
827
901
|
return this.a === 1 ? `rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)` : `rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`;
|
|
828
902
|
}
|
|
829
903
|
toCmyk() {
|
|
830
|
-
return { ...
|
|
904
|
+
return { ...R(this.r, this.g, this.b) };
|
|
831
905
|
}
|
|
832
906
|
toCmykString() {
|
|
833
|
-
let { c: e, m: t, y: n, k: r } =
|
|
907
|
+
let { c: e, m: t, y: n, k: r } = R(this.r, this.g, this.b);
|
|
834
908
|
return `cmyk(${e}, ${t}, ${n}, ${r})`;
|
|
835
909
|
}
|
|
836
910
|
toName() {
|
|
837
911
|
if (this.a === 0) return "transparent";
|
|
838
912
|
if (this.a < 1) return !1;
|
|
839
|
-
let e = "#" +
|
|
913
|
+
let e = "#" + L(this.r, this.g, this.b, !1), t = U;
|
|
840
914
|
for (let n in t) if (Object.prototype.hasOwnProperty.call(t, n) && t[n] === e) return n;
|
|
841
915
|
return !1;
|
|
842
916
|
}
|
|
@@ -844,7 +918,7 @@ var Oe = class e {
|
|
|
844
918
|
let t = !!e;
|
|
845
919
|
e ??= this.format;
|
|
846
920
|
let n = !1, r = this.a < 1 && this.a >= 0;
|
|
847
|
-
return !t && r && (e.startsWith("hex") || e === "name") ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), e === "cmyk" && (n = this.toCmykString()), n || this.toHexString());
|
|
921
|
+
return !t && r && typeof e == "string" && (e.startsWith("hex") || e === "name") ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), e === "oklch" && (n = this.toOklchString()), e === "cmyk" && (n = this.toCmykString()), n || this.toHexString());
|
|
848
922
|
}
|
|
849
923
|
toNumber() {
|
|
850
924
|
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
@@ -854,7 +928,7 @@ var Oe = class e {
|
|
|
854
928
|
}
|
|
855
929
|
lighten(t = 10) {
|
|
856
930
|
let n = this.toHsl();
|
|
857
|
-
return n.l += t / 100, n.l =
|
|
931
|
+
return n.l += t / 100, n.l = O(n.l), new e(n);
|
|
858
932
|
}
|
|
859
933
|
brighten(t = 10) {
|
|
860
934
|
let n = this.toRgb();
|
|
@@ -862,7 +936,7 @@ var Oe = class e {
|
|
|
862
936
|
}
|
|
863
937
|
darken(t = 10) {
|
|
864
938
|
let n = this.toHsl();
|
|
865
|
-
return n.l -= t / 100, n.l =
|
|
939
|
+
return n.l -= t / 100, n.l = O(n.l), new e(n);
|
|
866
940
|
}
|
|
867
941
|
tint(e = 10) {
|
|
868
942
|
return this.mix("white", e);
|
|
@@ -872,11 +946,11 @@ var Oe = class e {
|
|
|
872
946
|
}
|
|
873
947
|
desaturate(t = 10) {
|
|
874
948
|
let n = this.toHsl();
|
|
875
|
-
return n.s -= t / 100, n.s =
|
|
949
|
+
return n.s -= t / 100, n.s = O(n.s), new e(n);
|
|
876
950
|
}
|
|
877
951
|
saturate(t = 10) {
|
|
878
952
|
let n = this.toHsl();
|
|
879
|
-
return n.s += t / 100, n.s =
|
|
953
|
+
return n.s += t / 100, n.s = O(n.s), new e(n);
|
|
880
954
|
}
|
|
881
955
|
greyscale() {
|
|
882
956
|
return this.desaturate(100);
|
|
@@ -956,7 +1030,146 @@ var Oe = class e {
|
|
|
956
1030
|
let n = new e(t);
|
|
957
1031
|
return this.format === "cmyk" || n.format === "cmyk" ? this.toCmykString() === n.toCmykString() : this.toRgbString() === n.toRgbString();
|
|
958
1032
|
}
|
|
959
|
-
}
|
|
1033
|
+
};
|
|
1034
|
+
function Z(e) {
|
|
1035
|
+
return e < 1 ? Math.round(e) : e;
|
|
1036
|
+
}
|
|
1037
|
+
function He(e) {
|
|
1038
|
+
return typeof e == "string" ? e.length >= 11 && /^\s*oklch/i.test(e) : typeof e == "object" && "l" in e && "c" in e && "h" in e;
|
|
1039
|
+
}
|
|
1040
|
+
// composables/useTooltips.ts
|
|
1041
|
+
function Ue(e) {
|
|
1042
|
+
if (!e) return "";
|
|
1043
|
+
if (typeof e == "string") return e;
|
|
1044
|
+
if (!("colorStops" in e)) return "";
|
|
1045
|
+
let t = (e.colorStops ?? []).flatMap((e) => {
|
|
1046
|
+
let t = new Ve(e?.color ?? "");
|
|
1047
|
+
return t.isValid && t.getAlpha() > 0 ? [{
|
|
1048
|
+
color: e.color,
|
|
1049
|
+
alpha: t.getAlpha(),
|
|
1050
|
+
luminance: t.getLuminance()
|
|
1051
|
+
}] : [];
|
|
1052
|
+
});
|
|
1053
|
+
return t.sort((e, t) => t.alpha - e.alpha || e.luminance - t.luminance), t[0]?.color ?? "";
|
|
1054
|
+
}
|
|
1055
|
+
function We(e, t) {
|
|
1056
|
+
return `
|
|
1057
|
+
<div class="charts-tooltips">
|
|
1058
|
+
<div class="charts-tooltips-title">${e}</div>
|
|
1059
|
+
${t.map((e) => `
|
|
1060
|
+
<div class="charts-tooltips-item">
|
|
1061
|
+
<span class="charts-tooltips-item-border" style="background: ${Ue(e.color)}"></span>
|
|
1062
|
+
<span class="charts-tooltips-item-name">${e.name}</span>
|
|
1063
|
+
<span class="charts-tooltips-item-value">${e.value}</span>
|
|
1064
|
+
</div>`).join("")}
|
|
1065
|
+
</div>`;
|
|
1066
|
+
}
|
|
1067
|
+
// composables/useStripe.ts
|
|
1068
|
+
function Ge({ data: e = [], color: t = "", offset: n = [0, 0], rotate: r = -20, size: i = [2, 8] }) {
|
|
1069
|
+
return {
|
|
1070
|
+
name: "",
|
|
1071
|
+
data: e,
|
|
1072
|
+
type: "pictorialBar",
|
|
1073
|
+
symbolRotate: r,
|
|
1074
|
+
silent: !0,
|
|
1075
|
+
itemStyle: {
|
|
1076
|
+
color: t,
|
|
1077
|
+
opacity: 0
|
|
1078
|
+
},
|
|
1079
|
+
emphasis: { itemStyle: { opacity: 1 } },
|
|
1080
|
+
symbolRepeat: "fixed",
|
|
1081
|
+
symbolMargin: 2,
|
|
1082
|
+
symbol: "rect",
|
|
1083
|
+
symbolClip: !0,
|
|
1084
|
+
symbolSize: i,
|
|
1085
|
+
symbolPosition: "start",
|
|
1086
|
+
symbolOffset: n,
|
|
1087
|
+
z: 1,
|
|
1088
|
+
animationEasing: "elasticOut"
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
function Ke(e) {
|
|
1092
|
+
return {
|
|
1093
|
+
axisPointer: { lineStyle: { opacity: .6 } },
|
|
1094
|
+
formatter: function(t) {
|
|
1095
|
+
if (!t?.length) return "";
|
|
1096
|
+
let n = t[0].name;
|
|
1097
|
+
return We(n, t.filter((e) => !!e.seriesName).map((t) => ({
|
|
1098
|
+
name: t.seriesName,
|
|
1099
|
+
value: `${t.value} ${e}`,
|
|
1100
|
+
color: t.color
|
|
1101
|
+
})));
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
function qe({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
|
|
1106
|
+
return [{
|
|
1107
|
+
type: "bar",
|
|
1108
|
+
z: 0,
|
|
1109
|
+
...e
|
|
1110
|
+
}, Ge({
|
|
1111
|
+
data: e.data,
|
|
1112
|
+
offset: n,
|
|
1113
|
+
color: t,
|
|
1114
|
+
rotate: r,
|
|
1115
|
+
size: i
|
|
1116
|
+
})];
|
|
1117
|
+
}
|
|
1118
|
+
function Je() {
|
|
1119
|
+
return { aria: {
|
|
1120
|
+
enabled: !0,
|
|
1121
|
+
decal: {
|
|
1122
|
+
show: !0,
|
|
1123
|
+
decals: [{
|
|
1124
|
+
color: "white",
|
|
1125
|
+
dashArrayX: [1, 0],
|
|
1126
|
+
dashArrayY: [6, 0],
|
|
1127
|
+
symbolSize: .5,
|
|
1128
|
+
rotation: Math.PI / 2
|
|
1129
|
+
}]
|
|
1130
|
+
}
|
|
1131
|
+
} };
|
|
1132
|
+
}
|
|
1133
|
+
// composables/useReactiveAttrs.ts
|
|
1134
|
+
var Ye = {
|
|
1135
|
+
"auto-resize": "autoResize",
|
|
1136
|
+
"init-option": "initOption",
|
|
1137
|
+
"set-option-opts": "setOptionOpts"
|
|
1138
|
+
};
|
|
1139
|
+
function Q(e) {
|
|
1140
|
+
let t = p()?.proxy, n = () => Object.fromEntries(Object.entries(h && t ? t.$attrs : e).map(([e, t]) => [Ye[e] ?? e, t]));
|
|
1141
|
+
if (h && t) return d(n);
|
|
1142
|
+
let r = _(n());
|
|
1143
|
+
return g(() => {
|
|
1144
|
+
let e = n(), t = r.value;
|
|
1145
|
+
(Object.keys(t).length !== Object.keys(e).length || Object.keys(e).some((n) => !Object.is(t[n], e[n]))) && (r.value = e);
|
|
1146
|
+
}), r;
|
|
1147
|
+
}
|
|
1148
|
+
// utils/withChartProps.ts
|
|
1149
|
+
function Xe() {
|
|
1150
|
+
return (e) => e;
|
|
1151
|
+
}
|
|
1152
|
+
// components/Chart.ts
|
|
1153
|
+
var Ze = Xe()(f({
|
|
1154
|
+
name: "IxChart",
|
|
1155
|
+
inheritAttrs: !1,
|
|
1156
|
+
setup(e, t) {
|
|
1157
|
+
let { containerRef: n } = he(Q(t.attrs), () => t.listeners ?? {});
|
|
1158
|
+
return { containerRef: n };
|
|
1159
|
+
},
|
|
1160
|
+
render() {
|
|
1161
|
+
let { class: e, style: t } = this.$attrs;
|
|
1162
|
+
return m("div", {
|
|
1163
|
+
ref: "containerRef",
|
|
1164
|
+
class: e,
|
|
1165
|
+
style: {
|
|
1166
|
+
width: "100%",
|
|
1167
|
+
height: "100%",
|
|
1168
|
+
...t
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
})), Qe = [
|
|
960
1173
|
"#458FFF",
|
|
961
1174
|
"#45D9A3",
|
|
962
1175
|
"#FFC145",
|
|
@@ -968,7 +1181,7 @@ var Oe = class e {
|
|
|
968
1181
|
"#F587B3",
|
|
969
1182
|
"#8352CC",
|
|
970
1183
|
"#65779B"
|
|
971
|
-
],
|
|
1184
|
+
], $e = [
|
|
972
1185
|
"#458FFF",
|
|
973
1186
|
"#C8DEFF",
|
|
974
1187
|
"#45D9A3",
|
|
@@ -991,7 +1204,7 @@ var Oe = class e {
|
|
|
991
1204
|
"#FCDBE8",
|
|
992
1205
|
"#65779B",
|
|
993
1206
|
"#65779B"
|
|
994
|
-
],
|
|
1207
|
+
], et = [
|
|
995
1208
|
"#8C1604",
|
|
996
1209
|
"#DB4C35",
|
|
997
1210
|
"#FF9245",
|
|
@@ -999,8 +1212,8 @@ var Oe = class e {
|
|
|
999
1212
|
"#689FFF",
|
|
1000
1213
|
"#45D9A3",
|
|
1001
1214
|
"#99ACD1"
|
|
1002
|
-
],
|
|
1003
|
-
color:
|
|
1215
|
+
], tt = {
|
|
1216
|
+
color: Qe,
|
|
1004
1217
|
textStyle: {
|
|
1005
1218
|
color: "#6F7785",
|
|
1006
1219
|
fontSize: "12px"
|
|
@@ -1068,12 +1281,12 @@ var Oe = class e {
|
|
|
1068
1281
|
categoryAxis: {
|
|
1069
1282
|
axisLine: {
|
|
1070
1283
|
show: !0,
|
|
1071
|
-
lineStyle: { color: "#
|
|
1284
|
+
lineStyle: { color: "#E1E5EB" }
|
|
1072
1285
|
},
|
|
1073
1286
|
axisTick: {
|
|
1074
1287
|
show: !0,
|
|
1075
1288
|
alignWithLabel: !0,
|
|
1076
|
-
lineStyle: { color: "#
|
|
1289
|
+
lineStyle: { color: "#E1E5EB" }
|
|
1077
1290
|
},
|
|
1078
1291
|
axisLabel: { color: "#6F7785" },
|
|
1079
1292
|
splitLine: { show: !1 },
|
|
@@ -1083,7 +1296,7 @@ var Oe = class e {
|
|
|
1083
1296
|
axisLine: { show: !1 },
|
|
1084
1297
|
axisTick: { show: !1 },
|
|
1085
1298
|
axisLabel: { color: "#6F7785" },
|
|
1086
|
-
splitLine: { lineStyle: { color: "#
|
|
1299
|
+
splitLine: { lineStyle: { color: "#E1E5EB" } },
|
|
1087
1300
|
splitArea: { show: !1 },
|
|
1088
1301
|
nameTextStyle: {
|
|
1089
1302
|
color: "#6F7785",
|
|
@@ -1098,36 +1311,39 @@ var Oe = class e {
|
|
|
1098
1311
|
dataZoom: { height: 16 }
|
|
1099
1312
|
};
|
|
1100
1313
|
// utils/index.ts
|
|
1101
|
-
function
|
|
1102
|
-
return
|
|
1314
|
+
function nt(e) {
|
|
1315
|
+
return at(e?.xAxis).some((e) => e.type === "category" || e.type === "time" || e.type === void 0 && e.data !== void 0);
|
|
1103
1316
|
}
|
|
1104
|
-
function
|
|
1105
|
-
return
|
|
1317
|
+
function rt(e, t) {
|
|
1318
|
+
return h ? {
|
|
1106
1319
|
attrs: { ...e },
|
|
1107
1320
|
on: { ...t }
|
|
1108
1321
|
} : { ...e };
|
|
1109
1322
|
}
|
|
1110
|
-
function
|
|
1323
|
+
function it(e) {
|
|
1111
1324
|
return Object.entries(e).reduce((e, [t, n]) => (n !== void 0 && (e[t] = n), e), {});
|
|
1112
1325
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
1326
|
+
function at(e) {
|
|
1327
|
+
return se(e) ? [] : Array.isArray(e) ? e : [e];
|
|
1115
1328
|
}
|
|
1116
|
-
var
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1329
|
+
var ot = (e, t) => new Ve(e).setAlpha(t).toRgbString();
|
|
1330
|
+
function $(e, t) {
|
|
1331
|
+
return S(t), x("seer", tt), e.install = (t) => {
|
|
1119
1332
|
t.component(e.name, e);
|
|
1120
1333
|
}, e;
|
|
1121
1334
|
}
|
|
1122
1335
|
// components/index.ts
|
|
1123
|
-
var
|
|
1336
|
+
var st = $(Ze, [
|
|
1124
1337
|
e,
|
|
1125
1338
|
n,
|
|
1126
1339
|
t,
|
|
1127
|
-
|
|
1340
|
+
o,
|
|
1341
|
+
s,
|
|
1128
1342
|
i,
|
|
1129
1343
|
a,
|
|
1130
|
-
|
|
1131
|
-
|
|
1344
|
+
r,
|
|
1345
|
+
c,
|
|
1346
|
+
l,
|
|
1347
|
+
u
|
|
1132
1348
|
]);
|
|
1133
|
-
export {
|
|
1349
|
+
export { pe as CHART_THEME_TOKEN, st as IxChart, at as convertArray, $ as createInstall, it as filterEmptyProps, ot as getAlphaColor, Ue as getTooltipsColor, nt as isVertical, rt as mergeAttrs, Qe as seerColors, $e as seerColorsForMore, et as seerColorsForRisk, tt as seerTheme, he as useChart, Q as useReactiveAttrs, Ge as useStripe, Je as useStripeArea, qe as useStripeBarSeries, Ke as useStripeBarTooltip, We as useTooltipsFormatter, Xe as withChartProps };
|