@pixelium/web-vue 0.0.1-beta
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/README.md +27 -0
- package/README.zh.md +27 -0
- package/dist/font.css +1 -0
- package/dist/fusion-pixel-12px-proportional-zh_hans.ttf.woff2 +0 -0
- package/dist/icon-hn.d.ts +454 -0
- package/dist/index.d.ts +748 -0
- package/dist/pixelium-vue-icon-hn.cjs +1 -0
- package/dist/pixelium-vue-icon-hn.css +1 -0
- package/dist/pixelium-vue-icon-hn.js +8154 -0
- package/dist/pixelium-vue-icon-hn.umd.cjs +1 -0
- package/dist/pixelium-vue.cjs +1 -0
- package/dist/pixelium-vue.css +1 -0
- package/dist/pixelium-vue.js +1673 -0
- package/dist/pixelium-vue.umd.cjs +1 -0
- package/es/aside/css.js +2 -0
- package/es/aside/index.css +25 -0
- package/es/aside/index.d.ts +17 -0
- package/es/aside/index.js +106 -0
- package/es/aside/type.d.ts +29 -0
- package/es/button/css.js +2 -0
- package/es/button/draw.d.ts +9 -0
- package/es/button/draw.js +326 -0
- package/es/button/index.css +379 -0
- package/es/button/index.d.ts +25 -0
- package/es/button/index.js +309 -0
- package/es/button/type.d.ts +78 -0
- package/es/button-group/css.js +2 -0
- package/es/button-group/index.css +14 -0
- package/es/button-group/index.d.ts +18 -0
- package/es/button-group/index.js +59 -0
- package/es/button-group/type.d.ts +40 -0
- package/es/col/css.js +2 -0
- package/es/col/index.css +178 -0
- package/es/col/index.d.ts +16 -0
- package/es/col/index.js +60 -0
- package/es/col/type.d.ts +20 -0
- package/es/container/css.js +2 -0
- package/es/container/index.css +14 -0
- package/es/container/index.d.ts +13 -0
- package/es/container/index.js +33 -0
- package/es/container/type.d.ts +14 -0
- package/es/divider/css.js +2 -0
- package/es/divider/index.css +53 -0
- package/es/divider/index.d.ts +6 -0
- package/es/divider/index.js +55 -0
- package/es/divider/type.d.ts +22 -0
- package/es/footer/css.js +2 -0
- package/es/footer/index.css +17 -0
- package/es/footer/index.d.ts +15 -0
- package/es/footer/index.js +42 -0
- package/es/footer/type.d.ts +24 -0
- package/es/grid/css.js +2 -0
- package/es/grid/index.css +3 -0
- package/es/grid/index.d.ts +23 -0
- package/es/grid/index.js +73 -0
- package/es/grid/type.d.ts +26 -0
- package/es/grid-item/css.js +2 -0
- package/es/grid-item/index.css +0 -0
- package/es/grid-item/index.d.ts +15 -0
- package/es/grid-item/index.js +119 -0
- package/es/grid-item/type.d.ts +20 -0
- package/es/header/css.js +2 -0
- package/es/header/index.css +17 -0
- package/es/header/index.d.ts +15 -0
- package/es/header/index.js +42 -0
- package/es/header/type.d.ts +24 -0
- package/es/icon/css.js +2 -0
- package/es/icon/index.css +8 -0
- package/es/icon/index.d.ts +19 -0
- package/es/icon/index.js +57 -0
- package/es/icon/type.d.ts +34 -0
- package/es/icons/css.js +2 -0
- package/es/icons/icon-hn.css +12 -0
- package/es/icons/icon-hn.d.ts +454 -0
- package/es/icons/icon-hn.js +15988 -0
- package/es/index.css +501 -0
- package/es/index.d.ts +35 -0
- package/es/index.js +63 -0
- package/es/link/css.js +2 -0
- package/es/link/index.css +176 -0
- package/es/link/index.d.ts +15 -0
- package/es/link/index.js +104 -0
- package/es/link/type.d.ts +52 -0
- package/es/main/css.js +2 -0
- package/es/main/index.css +8 -0
- package/es/main/index.d.ts +12 -0
- package/es/main/index.js +17 -0
- package/es/main/type.d.ts +7 -0
- package/es/message/css.js +2 -0
- package/es/message/index.css +120 -0
- package/es/message/index.d.ts +14 -0
- package/es/message/index.js +376 -0
- package/es/message/type.d.ts +38 -0
- package/es/message-box/css.js +2 -0
- package/es/message-box/index.d.ts +7 -0
- package/es/message-box/index.js +107 -0
- package/es/message-box/message-box-wrapped.d.ts +11 -0
- package/es/message-box/message-box-wrapped.js +47 -0
- package/es/message-box/message-box.css +50 -0
- package/es/message-box/message-box.d.ts +13 -0
- package/es/message-box/message-box.js +110 -0
- package/es/message-box/type.d.ts +99 -0
- package/es/row/css.js +2 -0
- package/es/row/index.css +36 -0
- package/es/row/index.d.ts +25 -0
- package/es/row/index.js +72 -0
- package/es/row/type.d.ts +36 -0
- package/es/share/const/index.d.ts +11 -0
- package/es/share/const/index.js +21 -0
- package/es/share/hook/use-dark-mode.d.ts +1 -0
- package/es/share/hook/use-dark-mode.js +60 -0
- package/es/share/hook/use-index-of-children.d.ts +1 -0
- package/es/share/hook/use-index-of-children.js +58 -0
- package/es/share/hook/use-resize-observer.d.ts +3 -0
- package/es/share/hook/use-resize-observer.js +21 -0
- package/es/share/hook/use-screen-width.d.ts +2 -0
- package/es/share/hook/use-screen-width.js +38 -0
- package/es/share/hook/use-theme-mode.d.ts +2 -0
- package/es/share/hook/use-theme-mode.js +45 -0
- package/es/share/type/index.d.ts +13 -0
- package/es/share/type/shim.d.ts +6 -0
- package/es/share/util/color.d.ts +5 -0
- package/es/share/util/color.js +167 -0
- package/es/share/util/console.d.ts +5 -0
- package/es/share/util/console.js +9 -0
- package/es/share/util/env.d.ts +1 -0
- package/es/share/util/env.js +6 -0
- package/es/share/util/lru-cache.d.ts +8 -0
- package/es/share/util/lru-cache.js +35 -0
- package/es/share/util/plot.d.ts +12 -0
- package/es/share/util/plot.js +79 -0
- package/es/share/util/render.d.ts +22 -0
- package/es/share/util/render.js +47 -0
- package/es/share/util/theme.d.ts +4 -0
- package/es/share/util/theme.js +41 -0
- package/es/space/css.js +2 -0
- package/es/space/index.css +76 -0
- package/es/space/index.d.ts +12 -0
- package/es/space/index.js +99 -0
- package/es/space/type.d.ts +42 -0
- package/package.json +78 -0
|
@@ -0,0 +1,1673 @@
|
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var Ze = (t, e, r) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var ge = (t, e, r) => Ze(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { defineComponent as C, createElementBlock as H, openBlock as M, normalizeStyle as I, createElementVNode as Y, provide as de, ref as b, onMounted as F, nextTick as Be, onBeforeUnmount as J, renderSlot as q, computed as x, getCurrentInstance as se, inject as ve, useSlots as Me, watch as he, normalizeClass as N, createCommentVNode as Pe, unref as T, createBlock as pe, createVNode as P, Transition as Fe, useModel as ze, Fragment as Oe, renderList as Se, useAttrs as et, Teleport as tt, mergeProps as nt, render as rt, onUpdated as st, useId as ot, onScopeDispose as at } from "vue";
|
|
5
|
+
const ke = /* @__PURE__ */ C({
|
|
6
|
+
props: {
|
|
7
|
+
size: {},
|
|
8
|
+
color: {}
|
|
9
|
+
},
|
|
10
|
+
setup(t) {
|
|
11
|
+
const e = t;
|
|
12
|
+
return (r, n) => (M(), H("svg", {
|
|
13
|
+
class: "px-icon-hn",
|
|
14
|
+
style: I({ color: e.color, fontSize: e.size + "px" }),
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
viewBox: "0 0 24 24"
|
|
17
|
+
}, [...n[0] || (n[0] = [
|
|
18
|
+
Y("path", { d: "M23 9v6h-1v2h-3v-2h1V9h-1V7h-1V6h-1V5h-2V4h-2V3h-1V1h3v1h2v1h2v1h1v1h1v2h1v2z" }, null, -1)
|
|
19
|
+
])], 4));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function ut(t, e, r, n) {
|
|
23
|
+
let s = Math.atan2(e, t);
|
|
24
|
+
return s < 0 && (s += Math.PI * 2), s >= r && s <= n;
|
|
25
|
+
}
|
|
26
|
+
function lt(t, e, r, n, s, o, a, u) {
|
|
27
|
+
const l = [
|
|
28
|
+
[e, r],
|
|
29
|
+
[-e, r],
|
|
30
|
+
[e, -r],
|
|
31
|
+
[-e, -r],
|
|
32
|
+
[r, e],
|
|
33
|
+
[-r, e],
|
|
34
|
+
[r, -e],
|
|
35
|
+
[-r, -e]
|
|
36
|
+
];
|
|
37
|
+
for (const [i, h] of l)
|
|
38
|
+
ut(i, h, o, a) && t.fillRect(n + i, s + h, u, u);
|
|
39
|
+
}
|
|
40
|
+
function le(t, e, r, n, s = 0, o = Math.PI * 2, a) {
|
|
41
|
+
let u = 0, l = n, i = 3 - 2 * n;
|
|
42
|
+
for (; u <= l + a; )
|
|
43
|
+
lt(t, u, l, e, r, s, o, a), u += a, i > 0 ? (l -= a, i += 4 * (u - l) + 10) : i += 4 * u + 6;
|
|
44
|
+
}
|
|
45
|
+
function it(t, e, r, n) {
|
|
46
|
+
const s = t.getImageData(0, 0, t.canvas.width, t.canvas.height), o = s.data, a = (r * t.canvas.width + e) * 4, u = o[a], l = o[a + 1], i = o[a + 2], h = o[a + 3];
|
|
47
|
+
if (!(u === 0 && l === 0 && i === 0 && h === 0) || n.r === 0 && n.g === 0 && n.b === 0 && n.a === 0)
|
|
48
|
+
return;
|
|
49
|
+
const d = [[e, r]];
|
|
50
|
+
for (; d.length; ) {
|
|
51
|
+
const c = d.pop();
|
|
52
|
+
if (!c)
|
|
53
|
+
continue;
|
|
54
|
+
const [f, g] = c, p = (g * t.canvas.width + f) * 4;
|
|
55
|
+
f < 0 || f >= t.canvas.width || g < 0 || g >= t.canvas.height || o[p] !== u || o[p + 1] !== l || o[p + 2] !== i || o[p + 3] !== h || (o[p] = n.r, o[p + 1] = n.g, o[p + 2] = n.b, o[p + 3] = n.a, d.push([f + 1, g]), d.push([f - 1, g]), d.push([f, g + 1]), d.push([f, g - 1]));
|
|
56
|
+
}
|
|
57
|
+
t.putImageData(s, 0, 0);
|
|
58
|
+
}
|
|
59
|
+
const D = {
|
|
60
|
+
r: 0,
|
|
61
|
+
g: 0,
|
|
62
|
+
b: 0,
|
|
63
|
+
a: 0
|
|
64
|
+
}, He = 3e3;
|
|
65
|
+
var z = /* @__PURE__ */ ((t) => (t.XS = "xs", t.SM = "sm", t.MD = "md", t.LG = "lg", t.XL = "xl", t.XXL = "xxl", t))(z || {});
|
|
66
|
+
const U = () => typeof window < "u";
|
|
67
|
+
function De(t) {
|
|
68
|
+
if (!Number.isInteger(t) || t <= 0)
|
|
69
|
+
throw new RangeError("max must be a positive integer");
|
|
70
|
+
const e = /* @__PURE__ */ new Map();
|
|
71
|
+
return {
|
|
72
|
+
get(r) {
|
|
73
|
+
const n = e.get(r);
|
|
74
|
+
if (n !== void 0)
|
|
75
|
+
return e.delete(r), e.set(r, n), n;
|
|
76
|
+
},
|
|
77
|
+
set(r, n) {
|
|
78
|
+
e.has(r) ? e.delete(r) : e.size >= t && e.delete(e.keys().next().value), e.set(r, n);
|
|
79
|
+
},
|
|
80
|
+
delete(r) {
|
|
81
|
+
return e.delete(r);
|
|
82
|
+
},
|
|
83
|
+
clear() {
|
|
84
|
+
e.clear();
|
|
85
|
+
},
|
|
86
|
+
has(r) {
|
|
87
|
+
return e.has(r);
|
|
88
|
+
},
|
|
89
|
+
get size() {
|
|
90
|
+
return e.size;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const Le = De(120);
|
|
95
|
+
function oe(t) {
|
|
96
|
+
const e = Le.get(t);
|
|
97
|
+
if (e) return { ...e };
|
|
98
|
+
let r = { r: 0, g: 0, b: 0, a: 255 };
|
|
99
|
+
if (t.startsWith("rgb(") || t.startsWith("rgba(")) {
|
|
100
|
+
const n = t.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)/i);
|
|
101
|
+
n && (r.r = parseInt(n[1], 10), r.g = parseInt(n[2], 10), r.b = parseInt(n[3], 10), n[4] && (r.a = Math.round(parseFloat(n[4]) * 255)));
|
|
102
|
+
} else t.startsWith("#") && (t = t.slice(1), t.length === 3 ? (r.r = parseInt(t[0] + t[0], 16), r.g = parseInt(t[1] + t[1], 16), r.b = parseInt(t[2] + t[2], 16)) : t.length === 4 ? (r.r = parseInt(t[0] + t[0], 16), r.g = parseInt(t[1] + t[1], 16), r.b = parseInt(t[2] + t[2], 16), r.a = parseInt(t[3] + t[3], 16)) : t.length === 6 ? (r.r = parseInt(t.slice(0, 2), 16), r.g = parseInt(t.slice(2, 4), 16), r.b = parseInt(t.slice(4, 6), 16)) : t.length === 8 && (r.r = parseInt(t.slice(0, 2), 16), r.g = parseInt(t.slice(2, 4), 16), r.b = parseInt(t.slice(4, 6), 16), r.a = parseInt(t.slice(6, 8), 16)));
|
|
103
|
+
return Le.set(t, r), { ...r };
|
|
104
|
+
}
|
|
105
|
+
const v = (t, e) => U() ? oe(getComputedStyle(document.documentElement).getPropertyValue(`--px-${t}-${e}`)) : D;
|
|
106
|
+
function _e(t) {
|
|
107
|
+
return t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
|
|
108
|
+
}
|
|
109
|
+
function ct(t, e, r, n = 255) {
|
|
110
|
+
const s = t / 255, o = e / 255, a = r / 255, u = _e(s), l = _e(o), i = _e(a);
|
|
111
|
+
let h = u * 0.41239079926595934 + l * 0.357584339383878 + i * 0.1804807884018343, d = u * 0.21263900587151027 + l * 0.715168678767756 + i * 0.07219231536073371, c = u * 0.01933081871559182 + l * 0.11919477979462598 + i * 0.9505321522496607, f = 0.819022437996703 * h + 0.3619062600528904 * d - 0.1288737815209879 * c, g = 0.0329836539323885 * h + 0.9292868615863434 * d + 0.0361446663506424 * c, p = 0.0481771893596242 * h + 0.2642395317527308 * d + 0.6335478284694309 * c;
|
|
112
|
+
f = Math.cbrt(f), g = Math.cbrt(g), p = Math.cbrt(p);
|
|
113
|
+
const R = 0.210454268309314 * f + 0.7936177747023054 * g - 0.0040720430116193 * p, G = 1.9779985324311684 * f - 2.42859224204858 * g + 0.450593709617411 * p, k = 0.0259040424655478 * f + 0.7827717124575296 * g - 0.8086757549230774 * p, _ = Math.sqrt(G * G + k * k);
|
|
114
|
+
let $ = Math.atan2(k, G) * 180 / Math.PI;
|
|
115
|
+
return $ < 0 && ($ += 360), {
|
|
116
|
+
l: R,
|
|
117
|
+
c: _,
|
|
118
|
+
h: $,
|
|
119
|
+
a: n
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function ye(t) {
|
|
123
|
+
return t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055;
|
|
124
|
+
}
|
|
125
|
+
function ie(t, e, r, n = 255) {
|
|
126
|
+
const s = r * Math.PI / 180, o = e * Math.cos(s), a = e * Math.sin(s);
|
|
127
|
+
let u = t + 0.3963377773761749 * o + 0.2158037573099136 * a, l = t - 0.1055613458156586 * o - 0.0638541728258133 * a, i = t - 0.0894841775298119 * o - 1.2914855480194092 * a;
|
|
128
|
+
u = u * u * u, l = l * l * l, i = i * i * i;
|
|
129
|
+
const h = 1.2268798758459243 * u - 0.5578149944602171 * l + 0.2813910456659647 * i, d = -0.0405757452148008 * u + 1.112286803280317 * l - 0.0717110580655164 * i, c = -0.0763729366746601 * u - 0.4214933324022432 * l + 1.5869240198367816 * i, f = 3.2409699419045226 * h - 1.537383177570094 * d - 0.4986107602930034 * c, g = -0.9692436362808796 * h + 1.8759675015077202 * d + 0.04155505740717559 * c, p = 0.05563007969699366 * h - 0.20397695888897652 * d + 1.0569715142428786 * c, R = ye(f), G = ye(g), k = ye(p);
|
|
130
|
+
return {
|
|
131
|
+
r: Math.round(R * 255),
|
|
132
|
+
g: Math.round(G * 255),
|
|
133
|
+
b: Math.round(k * 255),
|
|
134
|
+
a: n
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function ft(t, e, r) {
|
|
138
|
+
const { r: n, g: s, b: o } = ie(e, t, r);
|
|
139
|
+
return n >= 0 && n <= 255 && s >= 0 && s <= 255 && o >= 0 && o <= 255;
|
|
140
|
+
}
|
|
141
|
+
function xe(t, e) {
|
|
142
|
+
let n = 0, s = 2;
|
|
143
|
+
for (; s - n > 1e-6; ) {
|
|
144
|
+
const o = (n + s) / 2;
|
|
145
|
+
ft(o, t, e) ? n = o : s = o;
|
|
146
|
+
}
|
|
147
|
+
return n;
|
|
148
|
+
}
|
|
149
|
+
const Ie = De(60);
|
|
150
|
+
function re(t, e, r, n = 255, s = !1) {
|
|
151
|
+
const o = `${t},${e},${r},${n},${s}`, a = Ie.get(o);
|
|
152
|
+
if (a) return a;
|
|
153
|
+
const u = ct(t, e, r, n);
|
|
154
|
+
let l = [];
|
|
155
|
+
const i = u.c < 0.049 ? 0 : 0.049, h = s ? Math.min(Math.max(u.l, 0.05), 0.85) : Math.min(Math.max(u.l, 0.15), 0.95), d = Math.min(Math.max(u.c, i), xe(h, u.h)), c = Math.min(h + 0.35, s ? 0.85 : 0.9), f = Math.max(h - 0.35, s ? 0.1 : 0.15), g = s ? (h - f) / 4 : (c - h) / 4, p = (d - i) / 4, R = s ? (c - h) / 3 : (h - f) / 3, G = (d - i) / 3;
|
|
156
|
+
for (let k = 0; k < 5; k++) {
|
|
157
|
+
const _ = h + (s ? -1 : 1) * g * (5 - k), $ = Math.min(d - p * (5 - k), xe(_, u.h)), j = u.h, B = ie(_, $, j, n);
|
|
158
|
+
l.push(B);
|
|
159
|
+
}
|
|
160
|
+
l.push(ie(h, d, u.h, n));
|
|
161
|
+
for (let k = 0; k < 4; k++) {
|
|
162
|
+
const _ = h - (s ? -1 : 1) * R * (k + 1), $ = Math.min(d - G * (k + 1), xe(_, u.h)), j = u.h, B = ie(_, $, j, n);
|
|
163
|
+
l.push(B);
|
|
164
|
+
}
|
|
165
|
+
return Ie.set(o, l), l;
|
|
166
|
+
}
|
|
167
|
+
const E = (t) => `rgba(${t.r}, ${t.g}, ${t.b}, ${+(t.a / 255)})`, Ge = /* @__PURE__ */ C({
|
|
168
|
+
name: "ButtonGroup",
|
|
169
|
+
__name: "index",
|
|
170
|
+
props: {
|
|
171
|
+
borderRadius: null,
|
|
172
|
+
shape: { default: "default" },
|
|
173
|
+
size: { default: "medium" },
|
|
174
|
+
disabled: { type: Boolean, default: !1 },
|
|
175
|
+
loading: { type: Boolean },
|
|
176
|
+
variant: { default: "primary" }
|
|
177
|
+
},
|
|
178
|
+
setup(t) {
|
|
179
|
+
de("px-button-group-props", t);
|
|
180
|
+
const r = b(null), n = () => {
|
|
181
|
+
Be(() => {
|
|
182
|
+
r.value && r.value.querySelectorAll("[data-px-button]").forEach((s) => s.dispatchEvent(new CustomEvent("slot-changed")));
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
if (U()) {
|
|
186
|
+
const s = new MutationObserver(n);
|
|
187
|
+
F(() => {
|
|
188
|
+
Be(() => {
|
|
189
|
+
r.value && s.observe(r.value, { childList: !0 });
|
|
190
|
+
}), n();
|
|
191
|
+
}), J(() => {
|
|
192
|
+
s.disconnect();
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return (s, o) => (M(), H("div", {
|
|
196
|
+
class: "pixelium px-button-group",
|
|
197
|
+
ref_key: "slotWrapper",
|
|
198
|
+
ref: r
|
|
199
|
+
}, [
|
|
200
|
+
q(s.$slots, "default")
|
|
201
|
+
], 512));
|
|
202
|
+
}
|
|
203
|
+
}), dt = new RegExp("[-_\\s]|(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|(\\d+)");
|
|
204
|
+
function vt(t) {
|
|
205
|
+
return t.split(dt).filter(Boolean);
|
|
206
|
+
}
|
|
207
|
+
function ht(t) {
|
|
208
|
+
const e = vt(t);
|
|
209
|
+
let r = "";
|
|
210
|
+
const n = e.length;
|
|
211
|
+
for (let s = 0; s < n; s++)
|
|
212
|
+
r += e[s].toLowerCase() + (s < n - 1 ? "-" : "");
|
|
213
|
+
return r;
|
|
214
|
+
}
|
|
215
|
+
function We(t) {
|
|
216
|
+
return typeof t == "function";
|
|
217
|
+
}
|
|
218
|
+
function ae(t) {
|
|
219
|
+
return typeof t == "string" || t instanceof String;
|
|
220
|
+
}
|
|
221
|
+
function A(t) {
|
|
222
|
+
return typeof t == "number" || t instanceof Number;
|
|
223
|
+
}
|
|
224
|
+
function Ce(t) {
|
|
225
|
+
return Array.isArray(t);
|
|
226
|
+
}
|
|
227
|
+
function Z(t) {
|
|
228
|
+
return t == null;
|
|
229
|
+
}
|
|
230
|
+
function Ne(...t) {
|
|
231
|
+
return t.reduce((e, r) => {
|
|
232
|
+
if (Z(r))
|
|
233
|
+
return e;
|
|
234
|
+
const n = Object.keys(r);
|
|
235
|
+
for (const s of n) {
|
|
236
|
+
const o = e[s], a = r[s];
|
|
237
|
+
(Z(o) || !Z(a)) && (e[s] = a);
|
|
238
|
+
}
|
|
239
|
+
return e;
|
|
240
|
+
}, {});
|
|
241
|
+
}
|
|
242
|
+
// @ts-ignore
|
|
243
|
+
typeof process < "u" && process.env.NODE_ENV;
|
|
244
|
+
function pt(t, e, r, n = "primary", s, o, a) {
|
|
245
|
+
if (s)
|
|
246
|
+
switch (r) {
|
|
247
|
+
case "text":
|
|
248
|
+
return t ? D : a ? s[1] : o && !e ? s[0] : D;
|
|
249
|
+
case "outline":
|
|
250
|
+
return D;
|
|
251
|
+
case "plain":
|
|
252
|
+
return t ? s[0] : a ? s[2] : o && !e ? s[1] : s[0];
|
|
253
|
+
default:
|
|
254
|
+
return t ? s[1] : a ? s[5] : o && !e ? s[4] : s[5];
|
|
255
|
+
}
|
|
256
|
+
else if (n !== "info")
|
|
257
|
+
switch (r) {
|
|
258
|
+
case "text":
|
|
259
|
+
return t ? D : a ? v(n, 2) : o && !e ? v(n, 1) : D;
|
|
260
|
+
case "outline":
|
|
261
|
+
return D;
|
|
262
|
+
case "plain":
|
|
263
|
+
return t ? v(n, 1) : a ? v(n, 3) : o && !e ? v(n, 2) : v(n, 1);
|
|
264
|
+
default:
|
|
265
|
+
return t ? v(n, 2) : a ? v(n, 6) : o && !e ? v(n, 5) : v(n, 6);
|
|
266
|
+
}
|
|
267
|
+
else
|
|
268
|
+
switch (r) {
|
|
269
|
+
case "outline":
|
|
270
|
+
return D;
|
|
271
|
+
case "text":
|
|
272
|
+
return t ? D : a ? v("neutral", 3) : o && !e ? v("neutral", 2) : D;
|
|
273
|
+
case "plain":
|
|
274
|
+
return t ? v("neutral", 1) : a ? v("neutral", 4) : o && !e ? v("neutral", 3) : v("neutral", 1);
|
|
275
|
+
default:
|
|
276
|
+
return t ? v("neutral", 1) : a ? v("neutral", 3) : o && !e ? v("neutral", 2) : v("neutral", 1);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function mt(t, e, r, n = "primary", s, o, a) {
|
|
280
|
+
if (s)
|
|
281
|
+
switch (r) {
|
|
282
|
+
case "text":
|
|
283
|
+
return t ? D : a ? s[1] : o && !e ? s[0] : D;
|
|
284
|
+
case "plain":
|
|
285
|
+
return t ? s[1] : a ? s[3] : o && !e ? s[2] : s[1];
|
|
286
|
+
case "outline":
|
|
287
|
+
return t ? s[1] : a ? s[6] : o && !e ? s[4] : s[5];
|
|
288
|
+
default:
|
|
289
|
+
return t ? v("neutral", 8) : v("neutral", 10);
|
|
290
|
+
}
|
|
291
|
+
else if (n !== "info")
|
|
292
|
+
switch (r) {
|
|
293
|
+
case "text":
|
|
294
|
+
return t ? D : a ? v(n, 2) : o && !e ? v(n, 1) : D;
|
|
295
|
+
case "plain":
|
|
296
|
+
return t ? v(n, 2) : a ? v(n, 4) : o && !e ? v(n, 3) : v(n, 2);
|
|
297
|
+
case "outline":
|
|
298
|
+
return t ? v(n, 1) : a ? v(n, 7) : o && !e ? v(n, 5) : v(n, 6);
|
|
299
|
+
default:
|
|
300
|
+
return t ? v("neutral", 8) : v("neutral", 10);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
switch (r) {
|
|
304
|
+
case "text":
|
|
305
|
+
return t ? D : a ? v("neutral", 3) : o && !e ? v("neutral", 2) : D;
|
|
306
|
+
case "plain":
|
|
307
|
+
return t ? v("neutral", 5) : a ? v("neutral", 9) : o && !e ? v("neutral", 8) : v("neutral", 7);
|
|
308
|
+
case "outline":
|
|
309
|
+
return t ? v("neutral", 6) : a ? v("neutral", 8) : o && !e ? v("neutral", 9) : v("neutral", 10);
|
|
310
|
+
}
|
|
311
|
+
return t ? v("neutral", 8) : v("neutral", 10);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
const gt = (t, e, r, n, s, o, a, u, l, i, h, d) => {
|
|
315
|
+
t.fillStyle = `rgba(${a.r}, ${a.g}, ${a.b}, ${a.a / 255})`;
|
|
316
|
+
for (let f = 0; f < 4; f++)
|
|
317
|
+
s[f] > u && (!(f === 1 || f === 2) || i && (d || l === "text") || !i) && le(t, n[f][0], n[f][1], s[f], o[f][0], o[f][1], u);
|
|
318
|
+
n[1][0] + u > n[0][0] && t.fillRect(n[0][0], 0, n[1][0] - n[0][0] + u, u), n[2][1] + u > n[1][1] && (i && (d || l === "text") || !i) && t.fillRect(e - u, n[1][1], u, n[2][1] - n[1][1] + u), n[3][0] < n[2][0] + u && t.fillRect(n[3][0], r - u, n[2][0] - n[3][0] + u, u), !(i && !h && l !== "text") && n[3][1] + u > n[0][1] && t.fillRect(0, n[0][1], u, n[3][1] - n[0][1] + u), i && !h && l !== "text" && t.fillRect(u / 2, 0, u / 2, r), i && !d && l !== "text" && t.fillRect(e - 2 * u - 1, 0, u, r);
|
|
319
|
+
};
|
|
320
|
+
function Re(t, e, r = "primary", n, s, o) {
|
|
321
|
+
return n ? t ? n[0] : o ? n[6] : s && !e ? n[3] : n[4] : r !== "info" ? t ? v(r, 1) : o ? v(r, 7) : s && !e ? v(r, 4) : v(r, 5) : t ? v("neutral", 2) : o ? v("neutral", 5) : s && !e ? v("neutral", 4) : v("neutral", 3);
|
|
322
|
+
}
|
|
323
|
+
function ue(t, e) {
|
|
324
|
+
return Math.ceil((-6 + Math.sqrt(36 - 48 * t + 32 * t * e)) / (8 * t)) * t;
|
|
325
|
+
}
|
|
326
|
+
const _t = (t, e, r, n, s, o, a, u, l, i, h = "primary", d, c, f, g, p, R) => {
|
|
327
|
+
const G = ue(a, s[2]), k = ue(a, s[3]), _ = ue(a, s[1]), $ = ue(a, s[0]), j = +!(c && !f && i !== "text");
|
|
328
|
+
if (!R || u) {
|
|
329
|
+
const B = Re(u, l, h, d, p, R);
|
|
330
|
+
t.fillStyle = `rgba(${B.r}, ${B.g}, ${B.b}, ${B.a / 255})`;
|
|
331
|
+
for (let m = 1; m < 3; m++)
|
|
332
|
+
s[m] > a && le(t, n[m][0] - a, n[m][1], s[m], o[m][0], o[m][1], a);
|
|
333
|
+
const K = n[2][0] + a - n[3][0] + k * j + G;
|
|
334
|
+
K > 0 && t.fillRect(n[3][0] - k * j, r - a * 2, K, a);
|
|
335
|
+
const Q = n[2][1] + a - n[1][1] + _ + G;
|
|
336
|
+
Q > 0 && t.fillRect(e - a * 2 - (g ? 0 : +c * a * 1), n[1][1] - _, a, Q);
|
|
337
|
+
} else {
|
|
338
|
+
const B = Re(u, l, h, d, p, R);
|
|
339
|
+
t.fillStyle = `rgba(${B.r}, ${B.g}, ${B.b}, ${B.a / 255})`, s[0] > a && le(t, n[0][0] + a, n[0][1], s[0], o[0][0], o[0][1], a), s[3] > a && le(t, n[3][0] + a, n[3][1], s[3], o[3][0], o[3][1], a);
|
|
340
|
+
const K = n[1][0] + a - n[0][0] + _ + $ * j;
|
|
341
|
+
K > 0 && t.fillRect(n[0][0] - $ * j, a, K, a);
|
|
342
|
+
const Q = a + n[3][1] - n[0][1] + k + $;
|
|
343
|
+
Q > 0 && t.fillRect(a, n[0][1] - $, a, Q);
|
|
344
|
+
}
|
|
345
|
+
}, L = (t, e, r) => A(e) ? Math.max(e, r) : Math.max(t.height * parseFloat(e) / 100, r), X = (t) => Array(4).fill(t), yt = (t, e, r) => {
|
|
346
|
+
if (!e) return X(r);
|
|
347
|
+
if (!Ce(e))
|
|
348
|
+
return X(L(t, e, r));
|
|
349
|
+
switch (e.length) {
|
|
350
|
+
case 1:
|
|
351
|
+
return X(L(t, e[0], r));
|
|
352
|
+
case 2: {
|
|
353
|
+
const n = L(t, e[0], r), s = L(t, e[1], r);
|
|
354
|
+
return [n, s, n, s];
|
|
355
|
+
}
|
|
356
|
+
case 3: {
|
|
357
|
+
const n = L(t, e[0], r), s = L(t, e[2], r), o = L(t, e[1], r);
|
|
358
|
+
return [n, o, s, o];
|
|
359
|
+
}
|
|
360
|
+
default:
|
|
361
|
+
return e.map((n) => L(t, n, r));
|
|
362
|
+
}
|
|
363
|
+
}, xt = (t, e, r, n, s) => {
|
|
364
|
+
if (!e) return X(r);
|
|
365
|
+
if (!Ce(e)) {
|
|
366
|
+
const o = L(t, e, r);
|
|
367
|
+
return s ? [r, o, o, r] : n ? [o, r, r, o] : X(r);
|
|
368
|
+
}
|
|
369
|
+
switch (e.length) {
|
|
370
|
+
case 1:
|
|
371
|
+
const o = L(t, e[0], r);
|
|
372
|
+
return s ? [r, o, o, r] : n ? [o, r, r, o] : X(r);
|
|
373
|
+
case 2: {
|
|
374
|
+
const a = L(t, e[0], r), u = L(t, e[1], r);
|
|
375
|
+
return s ? [r, u, u, r] : n ? [a, r, r, a] : X(r);
|
|
376
|
+
}
|
|
377
|
+
case 3: {
|
|
378
|
+
const a = L(t, e[0], r), u = L(t, e[2], r), l = L(t, e[1], r);
|
|
379
|
+
return s ? [r, l, u, r] : n ? [a, r, r, l] : X(r);
|
|
380
|
+
}
|
|
381
|
+
default:
|
|
382
|
+
return s ? [r, L(t, e[1], r), L(t, e[2], r), r] : n ? [L(t, e[0], r), r, r, L(t, e[3], r)] : X(r);
|
|
383
|
+
}
|
|
384
|
+
}, bt = (t, e, r, n, s, o, a) => {
|
|
385
|
+
if (s) {
|
|
386
|
+
if (r)
|
|
387
|
+
return xt(t, r, e, o, a);
|
|
388
|
+
switch (n) {
|
|
389
|
+
case "round":
|
|
390
|
+
const u = X(L(t, "50%", e));
|
|
391
|
+
return a ? u.map((l, i) => i < 1 || i > 2 ? e : l) : o ? u.map((l, i) => i > 0 && i < 3 ? e : l) : X(e);
|
|
392
|
+
default:
|
|
393
|
+
return X(e);
|
|
394
|
+
}
|
|
395
|
+
} else {
|
|
396
|
+
if (r)
|
|
397
|
+
return yt(t, r, e);
|
|
398
|
+
switch (n) {
|
|
399
|
+
case "round":
|
|
400
|
+
case "circle":
|
|
401
|
+
return X(L(t, "50%", e));
|
|
402
|
+
default:
|
|
403
|
+
return X(e);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}, wt = (t, e, r, n, s, o) => {
|
|
407
|
+
if (!(!t || e === "primary")) {
|
|
408
|
+
if (r)
|
|
409
|
+
return E(e === "plain" ? t[2] : t[1]);
|
|
410
|
+
if (n) return E(t[5]);
|
|
411
|
+
if (o && e !== "plain") return E(t[6]);
|
|
412
|
+
switch (e) {
|
|
413
|
+
case "text":
|
|
414
|
+
return E(t[5]);
|
|
415
|
+
case "outline":
|
|
416
|
+
return E(s ? t[4] : t[5]);
|
|
417
|
+
case "plain":
|
|
418
|
+
return E(t[5]);
|
|
419
|
+
default:
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}, Te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), $t = (t) => () => {
|
|
424
|
+
const e = te.get(t);
|
|
425
|
+
e == null || e.forEach((r) => r());
|
|
426
|
+
}, ee = () => {
|
|
427
|
+
const t = b(!1), e = b(void 0);
|
|
428
|
+
function r(s) {
|
|
429
|
+
t.value = s.matches;
|
|
430
|
+
}
|
|
431
|
+
if (U()) {
|
|
432
|
+
const s = window.matchMedia("(prefers-color-scheme: dark)");
|
|
433
|
+
r(s), s.addEventListener("change", r), J(() => {
|
|
434
|
+
s.removeEventListener("change", r);
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
const n = () => {
|
|
438
|
+
if (U()) {
|
|
439
|
+
let s = !1, o = !1;
|
|
440
|
+
document.documentElement.className.split(" ").forEach((a) => {
|
|
441
|
+
a === "dark" && (s = !0), a === "light" && (o = !0);
|
|
442
|
+
}), e.value = s ? !0 : o ? !1 : void 0;
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
return U() && (F(() => {
|
|
446
|
+
const s = Te.get(document.documentElement) || new MutationObserver($t(document.documentElement));
|
|
447
|
+
Te.set(document.documentElement, s), s.observe(document.documentElement, { attributes: !0, attributeFilter: ["class"] }), te.set(document.documentElement, [...te.get(document.documentElement) || [], n]), n();
|
|
448
|
+
}), J(() => {
|
|
449
|
+
te.set(
|
|
450
|
+
document.documentElement,
|
|
451
|
+
(te.get(document.documentElement) || []).filter((s) => s !== n)
|
|
452
|
+
);
|
|
453
|
+
})), x(() => e.value ?? t.value);
|
|
454
|
+
}, qe = (t, e, r = !0) => {
|
|
455
|
+
if (!U())
|
|
456
|
+
return null;
|
|
457
|
+
const n = new ResizeObserver(e);
|
|
458
|
+
return F(() => {
|
|
459
|
+
setTimeout(() => {
|
|
460
|
+
r && e(), t.value && n.observe(t.value);
|
|
461
|
+
});
|
|
462
|
+
}), J(() => {
|
|
463
|
+
n.disconnect();
|
|
464
|
+
}), n;
|
|
465
|
+
}, Mt = ["disabled", "type", "autofocus"], kt = /* @__PURE__ */ C({
|
|
466
|
+
name: "Button",
|
|
467
|
+
__name: "index",
|
|
468
|
+
props: {
|
|
469
|
+
borderRadius: null,
|
|
470
|
+
shape: { default: "default" },
|
|
471
|
+
size: { default: "medium" },
|
|
472
|
+
disabled: { type: Boolean, default: !1 },
|
|
473
|
+
loading: { type: Boolean, default: !1 },
|
|
474
|
+
variant: { default: "primary" },
|
|
475
|
+
theme: { default: "primary" },
|
|
476
|
+
color: null,
|
|
477
|
+
block: { type: Boolean, default: !1 },
|
|
478
|
+
nativeType: { default: "button" },
|
|
479
|
+
autofocus: { type: Boolean, default: !1 }
|
|
480
|
+
},
|
|
481
|
+
setup(t) {
|
|
482
|
+
var m;
|
|
483
|
+
const e = t, r = se(), n = b(((m = r == null ? void 0 : r.parent) == null ? void 0 : m.type) === Ge), s = b(!1), o = b(!1), a = ve("px-button-group-props"), u = x(() => n.value && a ? a.borderRadius : e.borderRadius), l = x(() => n.value && a ? a.variant : e.variant), i = x(() => n.value && a ? a.size : e.size), h = x(() => n.value && a ? a.shape : e.shape), d = x(() => n.value && a && a.disabled || e.disabled), c = () => {
|
|
484
|
+
if (r && r.vnode.el instanceof HTMLElement) {
|
|
485
|
+
const w = r.vnode.el.parentElement;
|
|
486
|
+
if (w && w.children.length) {
|
|
487
|
+
const y = [...w.children];
|
|
488
|
+
s.value = y.indexOf(r.vnode.el) === w.children.length - 1, o.value = y.indexOf(r.vnode.el) === 0;
|
|
489
|
+
} else
|
|
490
|
+
s.value = !1, o.value = !1;
|
|
491
|
+
}
|
|
492
|
+
}, f = Me(), g = b(!1), p = b(!1), R = (w) => {
|
|
493
|
+
g.value = w;
|
|
494
|
+
}, G = (w) => {
|
|
495
|
+
p.value = w;
|
|
496
|
+
}, k = ee(), _ = b(null), $ = b(null);
|
|
497
|
+
F(() => {
|
|
498
|
+
setTimeout(() => {
|
|
499
|
+
$.value && $.value.addEventListener("slot-changed", j), c();
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
const j = () => {
|
|
503
|
+
setTimeout(() => {
|
|
504
|
+
c(), Q();
|
|
505
|
+
});
|
|
506
|
+
};
|
|
507
|
+
J(() => {
|
|
508
|
+
$.value && $.value.removeEventListener("slot-changed", j);
|
|
509
|
+
});
|
|
510
|
+
const B = x(() => {
|
|
511
|
+
if (!e.color) return null;
|
|
512
|
+
const w = oe(e.color);
|
|
513
|
+
return re(w.r, w.g, w.b, w.a, k.value);
|
|
514
|
+
}), K = x(() => wt(B.value, l.value, d.value, e.loading, g.value, p.value));
|
|
515
|
+
he(
|
|
516
|
+
[
|
|
517
|
+
u,
|
|
518
|
+
h,
|
|
519
|
+
d,
|
|
520
|
+
() => e.loading,
|
|
521
|
+
l,
|
|
522
|
+
() => e.theme,
|
|
523
|
+
B,
|
|
524
|
+
g,
|
|
525
|
+
p,
|
|
526
|
+
k
|
|
527
|
+
],
|
|
528
|
+
() => {
|
|
529
|
+
setTimeout(() => {
|
|
530
|
+
c(), Q();
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
const Q = () => {
|
|
535
|
+
const w = getComputedStyle(document.documentElement), y = parseInt(w.getPropertyValue("--px-bit"));
|
|
536
|
+
if (!_.value || !$.value) return;
|
|
537
|
+
const O = _.value.getContext("2d", { willReadFrequently: !0 }), V = $.value.getBoundingClientRect();
|
|
538
|
+
if (_.value.width = V.width, _.value.height = V.height, !O) return;
|
|
539
|
+
const W = bt(
|
|
540
|
+
_.value,
|
|
541
|
+
y,
|
|
542
|
+
u.value,
|
|
543
|
+
h.value,
|
|
544
|
+
n.value,
|
|
545
|
+
o.value,
|
|
546
|
+
s.value
|
|
547
|
+
), Je = mt(
|
|
548
|
+
d.value,
|
|
549
|
+
e.loading,
|
|
550
|
+
l.value,
|
|
551
|
+
e.theme,
|
|
552
|
+
B.value,
|
|
553
|
+
g.value,
|
|
554
|
+
p.value
|
|
555
|
+
), S = [
|
|
556
|
+
[W[0], W[0]],
|
|
557
|
+
[_.value.width - W[1] - y, W[1]],
|
|
558
|
+
[_.value.width - W[2] - y, _.value.height - W[2] - y],
|
|
559
|
+
[W[3], _.value.height - W[3] - y]
|
|
560
|
+
], Ve = [
|
|
561
|
+
[Math.PI, Math.PI * 3 / 2],
|
|
562
|
+
[Math.PI * 3 / 2, Math.PI * 2],
|
|
563
|
+
[0, Math.PI / 2],
|
|
564
|
+
[Math.PI / 2, Math.PI]
|
|
565
|
+
];
|
|
566
|
+
l.value === "primary" && _t(
|
|
567
|
+
O,
|
|
568
|
+
_.value.width,
|
|
569
|
+
_.value.height,
|
|
570
|
+
S,
|
|
571
|
+
W,
|
|
572
|
+
Ve,
|
|
573
|
+
y,
|
|
574
|
+
d.value,
|
|
575
|
+
e.loading,
|
|
576
|
+
l.value,
|
|
577
|
+
e.theme,
|
|
578
|
+
B.value,
|
|
579
|
+
n.value,
|
|
580
|
+
o.value,
|
|
581
|
+
s.value,
|
|
582
|
+
g.value,
|
|
583
|
+
p.value
|
|
584
|
+
), gt(
|
|
585
|
+
O,
|
|
586
|
+
_.value.width,
|
|
587
|
+
_.value.height,
|
|
588
|
+
S,
|
|
589
|
+
W,
|
|
590
|
+
Ve,
|
|
591
|
+
Je,
|
|
592
|
+
y,
|
|
593
|
+
l.value,
|
|
594
|
+
n.value,
|
|
595
|
+
o.value,
|
|
596
|
+
s.value
|
|
597
|
+
);
|
|
598
|
+
const Ke = pt(
|
|
599
|
+
d.value,
|
|
600
|
+
e.loading,
|
|
601
|
+
l.value,
|
|
602
|
+
e.theme,
|
|
603
|
+
B.value,
|
|
604
|
+
g.value,
|
|
605
|
+
p.value
|
|
606
|
+
);
|
|
607
|
+
it(O, Math.round((S[0][0] + S[1][0]) / 2), Math.round((S[0][1] + S[2][1]) / 2), Ke);
|
|
608
|
+
};
|
|
609
|
+
return qe($, Q), (w, y) => (M(), H("button", {
|
|
610
|
+
disabled: d.value || e.loading,
|
|
611
|
+
class: N(["pixelium px-button", {
|
|
612
|
+
"px-button__block": !n.value && !!e.block,
|
|
613
|
+
"px-button__circle": h.value === "circle",
|
|
614
|
+
"px-button__square": h.value === "square",
|
|
615
|
+
"px-button__loading": e.loading,
|
|
616
|
+
"px-button__large": i.value === "large",
|
|
617
|
+
"px-button__small": i.value === "small",
|
|
618
|
+
"px-button__outline": l.value === "outline",
|
|
619
|
+
"px-button__plain": l.value === "plain",
|
|
620
|
+
"px-button__text": l.value === "text",
|
|
621
|
+
"px-button__disabled": d.value,
|
|
622
|
+
"px-button__custom": B.value,
|
|
623
|
+
"px-button__inner": n.value,
|
|
624
|
+
[`px-button__${e.theme || "primary"}`]: !0
|
|
625
|
+
}]),
|
|
626
|
+
style: I({
|
|
627
|
+
color: K.value
|
|
628
|
+
}),
|
|
629
|
+
ref_key: "buttonRef",
|
|
630
|
+
ref: $,
|
|
631
|
+
"data-px-button": "",
|
|
632
|
+
onMouseenter: y[0] || (y[0] = (O) => R(!0)),
|
|
633
|
+
onMouseleave: y[1] || (y[1] = (O) => R(!1)),
|
|
634
|
+
onMousedown: y[2] || (y[2] = (O) => G(!0)),
|
|
635
|
+
onMouseup: y[3] || (y[3] = (O) => G(!1)),
|
|
636
|
+
type: e.nativeType,
|
|
637
|
+
autofocus: e.autofocus
|
|
638
|
+
}, [
|
|
639
|
+
Y("canvas", {
|
|
640
|
+
ref_key: "canvasRef",
|
|
641
|
+
ref: _,
|
|
642
|
+
class: "px-button-canvas"
|
|
643
|
+
}, null, 512),
|
|
644
|
+
T(f).icon || e.loading ? (M(), H("div", {
|
|
645
|
+
key: 0,
|
|
646
|
+
class: N(["px-button-icon-wrapper", {
|
|
647
|
+
"px-button-icon-wrapper__last": !T(f).default
|
|
648
|
+
}])
|
|
649
|
+
}, [
|
|
650
|
+
e.loading ? (M(), pe(T(ke), {
|
|
651
|
+
key: 0,
|
|
652
|
+
class: N(["px-button-icon", {
|
|
653
|
+
"px-button-icon__loading": e.loading
|
|
654
|
+
}]),
|
|
655
|
+
style: I({
|
|
656
|
+
fill: K.value
|
|
657
|
+
})
|
|
658
|
+
}, null, 8, ["class", "style"])) : q(w.$slots, "icon", { key: 1 })
|
|
659
|
+
], 2)) : Pe("", !0),
|
|
660
|
+
q(w.$slots, "default")
|
|
661
|
+
], 46, Mt));
|
|
662
|
+
}
|
|
663
|
+
}), Ht = ["href", "target"], Ct = /* @__PURE__ */ C({
|
|
664
|
+
name: "Link",
|
|
665
|
+
__name: "index",
|
|
666
|
+
props: {
|
|
667
|
+
disabled: { type: Boolean },
|
|
668
|
+
loading: { type: Boolean },
|
|
669
|
+
theme: null,
|
|
670
|
+
color: null,
|
|
671
|
+
href: null,
|
|
672
|
+
target: null
|
|
673
|
+
},
|
|
674
|
+
setup(t) {
|
|
675
|
+
const e = t, r = Me(), n = ee(), s = x(() => {
|
|
676
|
+
if (!e.color) return null;
|
|
677
|
+
const c = oe(e.color);
|
|
678
|
+
return re(c.r, c.g, c.b, c.a, n.value);
|
|
679
|
+
}), o = b(!1), a = b(!1), u = (c) => {
|
|
680
|
+
o.value = c;
|
|
681
|
+
}, l = (c) => {
|
|
682
|
+
a.value = c;
|
|
683
|
+
}, i = (c, f, g, p, R) => {
|
|
684
|
+
if (c)
|
|
685
|
+
return E(f ? c[1] : g ? c[5] : R ? c[6] : p ? c[4] : c[5]);
|
|
686
|
+
}, h = x(() => i(s.value, e.disabled, e.loading, o.value, a.value)), d = (c) => {
|
|
687
|
+
(e.disabled || e.loading) && c.preventDefault();
|
|
688
|
+
};
|
|
689
|
+
return (c, f) => (M(), H("a", {
|
|
690
|
+
class: N(["pixelium px-link", {
|
|
691
|
+
"px-link__loading": e.loading,
|
|
692
|
+
"px-link__disabled": e.disabled,
|
|
693
|
+
"px-link__custom": s.value,
|
|
694
|
+
[`px-link__${e.theme || "primary"}`]: !0
|
|
695
|
+
}]),
|
|
696
|
+
style: I({
|
|
697
|
+
color: h.value
|
|
698
|
+
}),
|
|
699
|
+
onMouseenter: f[0] || (f[0] = (g) => u(!0)),
|
|
700
|
+
onMouseleave: f[1] || (f[1] = (g) => u(!1)),
|
|
701
|
+
onMousedown: f[2] || (f[2] = (g) => l(!0)),
|
|
702
|
+
onMouseup: f[3] || (f[3] = (g) => l(!1)),
|
|
703
|
+
href: e.href,
|
|
704
|
+
target: e.target,
|
|
705
|
+
onClick: d
|
|
706
|
+
}, [
|
|
707
|
+
T(r).icon || e.loading ? (M(), H("div", {
|
|
708
|
+
key: 0,
|
|
709
|
+
class: N(["px-link-icon-wrapper", {
|
|
710
|
+
"px-link-icon-wrapper__last": !T(r).default
|
|
711
|
+
}])
|
|
712
|
+
}, [
|
|
713
|
+
e.loading ? (M(), pe(T(ke), {
|
|
714
|
+
key: 0,
|
|
715
|
+
class: N(["px-link-icon", {
|
|
716
|
+
"px-link-icon__loading": e.loading
|
|
717
|
+
}]),
|
|
718
|
+
style: I({
|
|
719
|
+
fill: h.value
|
|
720
|
+
})
|
|
721
|
+
}, null, 8, ["class", "style"])) : q(c.$slots, "icon", { key: 1 })
|
|
722
|
+
], 2)) : Pe("", !0),
|
|
723
|
+
q(c.$slots, "default")
|
|
724
|
+
], 46, Ht));
|
|
725
|
+
}
|
|
726
|
+
}), Vt = /* @__PURE__ */ C({
|
|
727
|
+
props: {
|
|
728
|
+
size: {},
|
|
729
|
+
color: {}
|
|
730
|
+
},
|
|
731
|
+
setup(t) {
|
|
732
|
+
const e = t;
|
|
733
|
+
return (r, n) => (M(), H("svg", {
|
|
734
|
+
class: "px-icon-hn",
|
|
735
|
+
style: I({ color: e.color, fontSize: e.size + "px" }),
|
|
736
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
737
|
+
viewBox: "0 0 24 24"
|
|
738
|
+
}, [...n[0] || (n[0] = [
|
|
739
|
+
Y("path", { d: "M22 9V7h-1V5h-1V4h-1V3h-2V2h-2V1H9v1H7v1H5v1H4v1H3v2H2v2H1v6h1v2h1v2h1v1h1v1h2v1h2v1h6v-1h2v-1h2v-1h1v-1h1v-2h1v-2h1V9zM11 6h2v2h-2zm-1 9h1v-5h-1V9h3v6h1v2h-4z" }, null, -1),
|
|
740
|
+
Y("path", {
|
|
741
|
+
fill: "none",
|
|
742
|
+
d: "M0 0h24v24H0z"
|
|
743
|
+
}, null, -1)
|
|
744
|
+
])], 4));
|
|
745
|
+
}
|
|
746
|
+
}), Bt = /* @__PURE__ */ C({
|
|
747
|
+
props: {
|
|
748
|
+
size: {},
|
|
749
|
+
color: {}
|
|
750
|
+
},
|
|
751
|
+
setup(t) {
|
|
752
|
+
const e = t;
|
|
753
|
+
return (r, n) => (M(), H("svg", {
|
|
754
|
+
class: "px-icon-hn",
|
|
755
|
+
style: I({ color: e.color, fontSize: e.size + "px" }),
|
|
756
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
757
|
+
viewBox: "0 0 24 24"
|
|
758
|
+
}, [...n[0] || (n[0] = [
|
|
759
|
+
Y("path", { d: "M22 20v-2h-1v-2h-1v-2h-1v-2h-1v-2h-1V8h-1V6h-1V4h-1V2h-1V1h-2v1h-1v2H9v2H8v2H7v2H6v2H5v2H4v2H3v2H2v2H1v2h1v1h20v-1h1v-2zm-12-9h4v3h-1v3h-2v-3h-1zm1 7h2v2h-2z" }, null, -1)
|
|
760
|
+
])], 4));
|
|
761
|
+
}
|
|
762
|
+
}), Lt = /* @__PURE__ */ C({
|
|
763
|
+
props: {
|
|
764
|
+
size: {},
|
|
765
|
+
color: {}
|
|
766
|
+
},
|
|
767
|
+
setup(t) {
|
|
768
|
+
const e = t;
|
|
769
|
+
return (r, n) => (M(), H("svg", {
|
|
770
|
+
class: "px-icon-hn",
|
|
771
|
+
style: I({ color: e.color, fontSize: e.size + "px" }),
|
|
772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
773
|
+
viewBox: "0 0 24 24"
|
|
774
|
+
}, [...n[0] || (n[0] = [
|
|
775
|
+
Y("path", { d: "M22 8V7h-1V6h-1V5h-1V4h-1V3h-1V2h-1V1H8v1H7v1H6v1H5v1H4v1H3v1H2v1H1v8h1v1h1v1h1v1h1v1h1v1h1v1h1v1h8v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1V8zm-6 9h-2v-1h-1v-1h-2v1h-1v1H8v-1H7v-2h1v-1h1v-2H8v-1H7V8h1V7h2v1h1v1h2V8h1V7h2v1h1v2h-1v1h-1v2h1v1h1v2h-1z" }, null, -1)
|
|
776
|
+
])], 4));
|
|
777
|
+
}
|
|
778
|
+
}), It = /* @__PURE__ */ C({
|
|
779
|
+
props: {
|
|
780
|
+
size: {},
|
|
781
|
+
color: {}
|
|
782
|
+
},
|
|
783
|
+
setup(t) {
|
|
784
|
+
const e = t;
|
|
785
|
+
return (r, n) => (M(), H("svg", {
|
|
786
|
+
class: "px-icon-hn",
|
|
787
|
+
style: I({ color: e.color, fontSize: e.size + "px" }),
|
|
788
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
789
|
+
viewBox: "0 0 24 24"
|
|
790
|
+
}, [...n[0] || (n[0] = [
|
|
791
|
+
Y("path", { d: "M22 9V7h-1V5h-1V4h-1V3h-2V2h-2V1H9v1H7v1H5v1H4v1H3v2H2v2H1v6h1v2h1v2h1v1h1v1h2v1h2v1h6v-1h2v-1h2v-1h1v-1h1v-2h1v-2h1V9zm-4 3h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-2v-1H9v-1H8v-1H7v-1H6v-2h1v-1h2v1h1v1h2v-1h1v-1h1v-1h1V9h1V8h2v1h1v2h-1z" }, null, -1)
|
|
792
|
+
])], 4));
|
|
793
|
+
}
|
|
794
|
+
}), Rt = /* @__PURE__ */ C({
|
|
795
|
+
props: {
|
|
796
|
+
size: {},
|
|
797
|
+
color: {}
|
|
798
|
+
},
|
|
799
|
+
setup(t) {
|
|
800
|
+
const e = t;
|
|
801
|
+
return (r, n) => (M(), H("svg", {
|
|
802
|
+
class: "px-icon-hn",
|
|
803
|
+
style: I({ color: e.color, fontSize: e.size + "px" }),
|
|
804
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
805
|
+
viewBox: "0 0 24 24"
|
|
806
|
+
}, [...n[0] || (n[0] = [
|
|
807
|
+
Y("path", { d: "M14 13h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h-1v1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-2v1h-1v1H9v1H8v1H7v1H6v1H5v1H4v1H3v-1H2v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-2H9v-1H8V9H7V8H6V7H5V6H4V5H3V4H2V3h1V2h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h2V9h1V8h1V7h1V6h1V5h1V4h1V3h1V2h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1z" }, null, -1)
|
|
808
|
+
])], 4));
|
|
809
|
+
}
|
|
810
|
+
}), Tt = /* @__PURE__ */ C({
|
|
811
|
+
__name: "index",
|
|
812
|
+
props: {
|
|
813
|
+
content: {
|
|
814
|
+
default: ""
|
|
815
|
+
},
|
|
816
|
+
icon: null,
|
|
817
|
+
duration: {
|
|
818
|
+
default: 3e3
|
|
819
|
+
},
|
|
820
|
+
id: null,
|
|
821
|
+
type: {
|
|
822
|
+
default: "normal"
|
|
823
|
+
},
|
|
824
|
+
color: null,
|
|
825
|
+
closable: {
|
|
826
|
+
type: Boolean
|
|
827
|
+
}
|
|
828
|
+
},
|
|
829
|
+
emits: ["close"],
|
|
830
|
+
setup(t, {
|
|
831
|
+
expose: e,
|
|
832
|
+
emit: r
|
|
833
|
+
}) {
|
|
834
|
+
const n = t, s = b(!1), o = b(!1), a = (m) => {
|
|
835
|
+
o.value = m;
|
|
836
|
+
}, u = (m) => {
|
|
837
|
+
s.value = m;
|
|
838
|
+
}, l = b(!1);
|
|
839
|
+
let i;
|
|
840
|
+
F(() => {
|
|
841
|
+
l.value = !0, h();
|
|
842
|
+
}), J(() => {
|
|
843
|
+
clearTimeout(i);
|
|
844
|
+
});
|
|
845
|
+
function h() {
|
|
846
|
+
i = setTimeout(() => c(), n.duration);
|
|
847
|
+
}
|
|
848
|
+
function d() {
|
|
849
|
+
clearTimeout(i), i = void 0;
|
|
850
|
+
}
|
|
851
|
+
function c() {
|
|
852
|
+
l.value = !1;
|
|
853
|
+
}
|
|
854
|
+
const f = r, g = () => {
|
|
855
|
+
f("close", n.id), d();
|
|
856
|
+
}, p = b(), R = b(), G = (m) => {
|
|
857
|
+
if (!m)
|
|
858
|
+
return "normal";
|
|
859
|
+
switch (m) {
|
|
860
|
+
case "info":
|
|
861
|
+
return "primary";
|
|
862
|
+
case "error":
|
|
863
|
+
return "danger";
|
|
864
|
+
default:
|
|
865
|
+
return m;
|
|
866
|
+
}
|
|
867
|
+
}, k = ee(), _ = x(() => {
|
|
868
|
+
if (!n.color) return null;
|
|
869
|
+
const m = oe(n.color);
|
|
870
|
+
return re(m.r, m.g, m.b, m.a, k.value);
|
|
871
|
+
}), $ = x(() => _.value ? E(_.value[5]) : void 0), j = x(() => {
|
|
872
|
+
if (_.value)
|
|
873
|
+
return o.value ? E(_.value[6]) : s.value ? E(_.value[4]) : E(_.value[5]);
|
|
874
|
+
});
|
|
875
|
+
function B(m = "normal", w) {
|
|
876
|
+
if (w)
|
|
877
|
+
return w[5];
|
|
878
|
+
{
|
|
879
|
+
const y = G(m);
|
|
880
|
+
return y === "normal" ? v("neutral", 10) : y === "loading" ? v("neutral", 8) : v(y, 6);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
const K = (m, w, y, O, V) => {
|
|
884
|
+
m.fillStyle = `rgba(${O.r}, ${O.g}, ${O.b}, ${O.a / 255})`, m.fillRect(V, 0, w - 2 * V, V), m.fillRect(w - V, V, V, y - 2 * V), m.fillRect(V, y - V, w - 2 * V, V), m.fillRect(0, V, V, y - 2 * V);
|
|
885
|
+
const W = v("neutral", 1);
|
|
886
|
+
m.fillStyle = `rgba(${W.r}, ${W.g}, ${W.b}, ${W.a / 255})`, m.fillRect(V, V, w - 2 * V, y - 2 * V);
|
|
887
|
+
}, Q = () => {
|
|
888
|
+
const m = getComputedStyle(document.documentElement), w = parseInt(m.getPropertyValue("--px-bit"));
|
|
889
|
+
if (!p.value || !R.value) return;
|
|
890
|
+
const y = p.value.getContext("2d", {
|
|
891
|
+
willReadFrequently: !0
|
|
892
|
+
}), O = R.value.getBoundingClientRect();
|
|
893
|
+
if (p.value.width = O.width, p.value.height = O.height, !y) return;
|
|
894
|
+
const V = B(n.type, _.value);
|
|
895
|
+
K(y, p.value.width, p.value.height, V, w);
|
|
896
|
+
};
|
|
897
|
+
return qe(R, Q), he([() => n.type, _, k], () => {
|
|
898
|
+
setTimeout(() => {
|
|
899
|
+
Q();
|
|
900
|
+
});
|
|
901
|
+
}), e({
|
|
902
|
+
close: c
|
|
903
|
+
}), () => P(Fe, {
|
|
904
|
+
name: "px-message-fade",
|
|
905
|
+
onAfterLeave: g
|
|
906
|
+
}, {
|
|
907
|
+
default: () => [l.value && P("div", {
|
|
908
|
+
ref: (m) => R.value = m,
|
|
909
|
+
onMouseenter: d,
|
|
910
|
+
onMouseleave: h,
|
|
911
|
+
class: {
|
|
912
|
+
"px-message": !0,
|
|
913
|
+
pixelium: !0,
|
|
914
|
+
[`px-message__${n.type || "primary"}`]: !0
|
|
915
|
+
}
|
|
916
|
+
}, [(!!n.icon || n.type && n.type !== "normal" && n.type !== "sakura") && P("div", {
|
|
917
|
+
class: "px-message-icon-wrapper"
|
|
918
|
+
}, [n.icon ? n.icon() : n.type === "info" ? P(Vt, {
|
|
919
|
+
class: "px-message-icon",
|
|
920
|
+
style: {
|
|
921
|
+
fill: $.value
|
|
922
|
+
}
|
|
923
|
+
}, null) : n.type === "success" ? P(It, {
|
|
924
|
+
class: "px-message-icon",
|
|
925
|
+
style: {
|
|
926
|
+
fill: $.value
|
|
927
|
+
}
|
|
928
|
+
}, null) : n.type === "warning" ? P(Bt, {
|
|
929
|
+
class: "px-message-icon",
|
|
930
|
+
style: {
|
|
931
|
+
fill: $.value
|
|
932
|
+
}
|
|
933
|
+
}, null) : n.type === "error" ? P(Lt, {
|
|
934
|
+
class: "px-message-icon",
|
|
935
|
+
style: {
|
|
936
|
+
fill: $.value
|
|
937
|
+
}
|
|
938
|
+
}, null) : n.type === "loading" && P(ke, {
|
|
939
|
+
class: "px-message-icon px-message-icon__loading",
|
|
940
|
+
style: {
|
|
941
|
+
fill: $.value
|
|
942
|
+
}
|
|
943
|
+
}, null)]), P("span", {
|
|
944
|
+
class: "px-message-content",
|
|
945
|
+
style: {
|
|
946
|
+
color: $.value
|
|
947
|
+
}
|
|
948
|
+
}, [ae(n.content) ? n.content : n.content()]), n.closable && P("div", {
|
|
949
|
+
class: "px-message-close-wrapper"
|
|
950
|
+
}, [P(Rt, {
|
|
951
|
+
class: "px-message-icon",
|
|
952
|
+
style: {
|
|
953
|
+
fill: j.value
|
|
954
|
+
},
|
|
955
|
+
onMouseenter: u(!0),
|
|
956
|
+
onMouseleave: u(!1),
|
|
957
|
+
onMousedown: a(!0),
|
|
958
|
+
onMouseup: a(!1),
|
|
959
|
+
onClick: c
|
|
960
|
+
}, null)]), P("canvas", {
|
|
961
|
+
ref: (m) => p.value = m,
|
|
962
|
+
class: "px-message-canvas"
|
|
963
|
+
}, null)])]
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
}), Et = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
967
|
+
let $e = (t = 21) => {
|
|
968
|
+
let e = "", r = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
969
|
+
for (; t--; )
|
|
970
|
+
e += Et[r[t] & 63];
|
|
971
|
+
return e;
|
|
972
|
+
};
|
|
973
|
+
const Xe = /* @__PURE__ */ C({
|
|
974
|
+
name: "MessageBoxInner",
|
|
975
|
+
__name: "message-box",
|
|
976
|
+
props: {
|
|
977
|
+
messages: {},
|
|
978
|
+
position: {},
|
|
979
|
+
zIndex: { default: He },
|
|
980
|
+
root: {},
|
|
981
|
+
"onUpdate:messages": {}
|
|
982
|
+
},
|
|
983
|
+
emits: ["close"],
|
|
984
|
+
setup(t, { expose: e, emit: r }) {
|
|
985
|
+
const n = t, s = ze(n, "messages"), o = r, a = x(() => s.value.map((i) => ({
|
|
986
|
+
...i,
|
|
987
|
+
id: i.id ?? $e()
|
|
988
|
+
}))), u = (i) => {
|
|
989
|
+
if (!Z(i)) {
|
|
990
|
+
if (n["onUpdate:messages"]) {
|
|
991
|
+
const h = a.value.findIndex((d) => d.id === i);
|
|
992
|
+
if (h >= 0) {
|
|
993
|
+
const d = [...a.value];
|
|
994
|
+
d.splice(h, 1), s.value = d;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
o("close", i);
|
|
998
|
+
}
|
|
999
|
+
}, l = b([]);
|
|
1000
|
+
return e({
|
|
1001
|
+
close: (i) => {
|
|
1002
|
+
var d;
|
|
1003
|
+
const h = a.value.findIndex((c) => c.id === i);
|
|
1004
|
+
h !== -1 && ((d = l.value[h]) == null || d.close());
|
|
1005
|
+
}
|
|
1006
|
+
}), (i, h) => (M(), H("div", {
|
|
1007
|
+
class: "px-message-box",
|
|
1008
|
+
style: I({
|
|
1009
|
+
zIndex: n.zIndex
|
|
1010
|
+
})
|
|
1011
|
+
}, [
|
|
1012
|
+
Y("div", {
|
|
1013
|
+
class: N(["px-message-box-container", {
|
|
1014
|
+
[`px-message-box-container__${T(ht)(n.position || "top")}`]: !0
|
|
1015
|
+
}])
|
|
1016
|
+
}, [
|
|
1017
|
+
(M(!0), H(Oe, null, Se(a.value, (d) => (M(), pe(Tt, {
|
|
1018
|
+
key: d.id,
|
|
1019
|
+
duration: d.duration,
|
|
1020
|
+
content: d.content,
|
|
1021
|
+
id: d.id,
|
|
1022
|
+
onClose: u,
|
|
1023
|
+
type: d.type,
|
|
1024
|
+
color: d.color,
|
|
1025
|
+
icon: d.icon,
|
|
1026
|
+
closable: d.closable,
|
|
1027
|
+
ref_for: !0,
|
|
1028
|
+
ref_key: "messageRef",
|
|
1029
|
+
ref: l
|
|
1030
|
+
}, null, 8, ["duration", "content", "id", "type", "color", "icon", "closable"]))), 128))
|
|
1031
|
+
], 2)
|
|
1032
|
+
], 4));
|
|
1033
|
+
}
|
|
1034
|
+
}), At = /* @__PURE__ */ C({
|
|
1035
|
+
name: "MessageBox",
|
|
1036
|
+
__name: "message-box-wrapped",
|
|
1037
|
+
props: {
|
|
1038
|
+
messages: null,
|
|
1039
|
+
position: null,
|
|
1040
|
+
zIndex: { default: He },
|
|
1041
|
+
root: { default: "body" },
|
|
1042
|
+
"onUpdate:messages": { type: Function },
|
|
1043
|
+
onClose: { type: Function }
|
|
1044
|
+
},
|
|
1045
|
+
setup(t, { expose: e }) {
|
|
1046
|
+
const r = t, n = et(), s = b(null);
|
|
1047
|
+
return e({
|
|
1048
|
+
close: (o) => {
|
|
1049
|
+
var a;
|
|
1050
|
+
(a = s.value) == null || a.close(o);
|
|
1051
|
+
}
|
|
1052
|
+
}), (o, a) => (M(), pe(tt, {
|
|
1053
|
+
to: r.root
|
|
1054
|
+
}, [
|
|
1055
|
+
P(Xe, nt({ ...r, ...T(n) }, {
|
|
1056
|
+
ref_key: "messageBoxRef",
|
|
1057
|
+
ref: s
|
|
1058
|
+
}), null, 16)
|
|
1059
|
+
], 8, ["to"]));
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
class Pt {
|
|
1063
|
+
constructor(e) {
|
|
1064
|
+
ge(this, "messages");
|
|
1065
|
+
ge(this, "messageBox");
|
|
1066
|
+
this.messages = b([]), this.messageBox = P(Xe, {
|
|
1067
|
+
messages: this.messages.value,
|
|
1068
|
+
zIndex: e.zIndex,
|
|
1069
|
+
position: e.position,
|
|
1070
|
+
onClose: (o) => {
|
|
1071
|
+
const a = this.messages.value.findIndex((u) => u.id === o);
|
|
1072
|
+
a >= 0 && this.messages.value.splice(a, 1);
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
const r = (ae(e.root) ? document.querySelector(e.root) : e.root) || document.body, n = $e(), s = document.createElement("div");
|
|
1076
|
+
s.id = n, s.className = "px-message-box-wrapper", r.appendChild(s), rt(this.messageBox, s);
|
|
1077
|
+
}
|
|
1078
|
+
push(e) {
|
|
1079
|
+
const r = e.id ?? $e();
|
|
1080
|
+
return this.messages.value.push({
|
|
1081
|
+
...e,
|
|
1082
|
+
id: r
|
|
1083
|
+
}), r;
|
|
1084
|
+
}
|
|
1085
|
+
close(e) {
|
|
1086
|
+
var r, n;
|
|
1087
|
+
(n = (r = this.messageBox.component) == null ? void 0 : r.exposed) == null || n.close(e);
|
|
1088
|
+
}
|
|
1089
|
+
clear() {
|
|
1090
|
+
this.messages.value.length = 0;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
const be = {
|
|
1094
|
+
top: void 0,
|
|
1095
|
+
bottom: void 0,
|
|
1096
|
+
topLeft: void 0,
|
|
1097
|
+
topRight: void 0,
|
|
1098
|
+
bottomLeft: void 0,
|
|
1099
|
+
bottomRight: void 0
|
|
1100
|
+
}, Ot = (t) => {
|
|
1101
|
+
(ae(t) || We(t)) && (t = {
|
|
1102
|
+
content: t
|
|
1103
|
+
});
|
|
1104
|
+
const e = t.position || "top", r = be[e] ? be[e] : be[e] = new Pt({
|
|
1105
|
+
position: e,
|
|
1106
|
+
zIndex: He,
|
|
1107
|
+
root: t.root || "body"
|
|
1108
|
+
}), n = r.push({
|
|
1109
|
+
content: t.content,
|
|
1110
|
+
icon: t.icon,
|
|
1111
|
+
duration: t.duration || 3e3,
|
|
1112
|
+
type: t.type || "normal",
|
|
1113
|
+
color: t.color,
|
|
1114
|
+
closable: t.closable
|
|
1115
|
+
});
|
|
1116
|
+
return {
|
|
1117
|
+
close: () => r.close(n),
|
|
1118
|
+
clear: () => r.clear()
|
|
1119
|
+
};
|
|
1120
|
+
}, fe = Ot;
|
|
1121
|
+
["info", "success", "warning", "error", "loading", "sakura", "normal"].forEach((t) => {
|
|
1122
|
+
fe[t] = (e) => ((ae(e) || We(e)) && (e = {
|
|
1123
|
+
content: e
|
|
1124
|
+
}), fe({
|
|
1125
|
+
...e,
|
|
1126
|
+
type: t
|
|
1127
|
+
}));
|
|
1128
|
+
});
|
|
1129
|
+
const me = () => {
|
|
1130
|
+
const t = b(0);
|
|
1131
|
+
function e() {
|
|
1132
|
+
U() && (t.value = window.innerWidth);
|
|
1133
|
+
}
|
|
1134
|
+
e();
|
|
1135
|
+
const r = x(() => {
|
|
1136
|
+
let n;
|
|
1137
|
+
return t.value <= 576 ? n = z.XS : t.value <= 768 ? n = z.SM : t.value <= 992 ? n = z.MD : t.value <= 1200 ? n = z.LG : t.value <= 1600 ? n = z.XL : n = z.XXL, n;
|
|
1138
|
+
});
|
|
1139
|
+
return U() && (window.addEventListener("resize", e), J(() => {
|
|
1140
|
+
window.removeEventListener("resize", e);
|
|
1141
|
+
})), [r, t];
|
|
1142
|
+
}, Dt = { class: "pixelium px-row" }, je = /* @__PURE__ */ C({
|
|
1143
|
+
name: "Row",
|
|
1144
|
+
__name: "index",
|
|
1145
|
+
props: {
|
|
1146
|
+
gutter: { default: 0 },
|
|
1147
|
+
justify: { default: "start" },
|
|
1148
|
+
align: { default: "start" },
|
|
1149
|
+
wrap: { type: Boolean, default: !0 }
|
|
1150
|
+
},
|
|
1151
|
+
setup(t) {
|
|
1152
|
+
const e = t, [r] = me(), n = x(() => {
|
|
1153
|
+
if (A(e.gutter))
|
|
1154
|
+
return {
|
|
1155
|
+
x: e.gutter,
|
|
1156
|
+
y: e.gutter
|
|
1157
|
+
};
|
|
1158
|
+
if ("x" in e.gutter || "y" in e.gutter)
|
|
1159
|
+
return {
|
|
1160
|
+
x: e.gutter.x || 0,
|
|
1161
|
+
y: e.gutter.y || 0
|
|
1162
|
+
};
|
|
1163
|
+
const s = e.gutter[r.value];
|
|
1164
|
+
return A(s) ? {
|
|
1165
|
+
x: s,
|
|
1166
|
+
y: s
|
|
1167
|
+
} : Ne({ x: 0, y: 0 }, s);
|
|
1168
|
+
});
|
|
1169
|
+
return de("px-row-provide", n), (s, o) => (M(), H("div", Dt, [
|
|
1170
|
+
Y("div", {
|
|
1171
|
+
class: N(["px-row-inner", {
|
|
1172
|
+
[`px-row__justify-${e.justify}`]: !0,
|
|
1173
|
+
[`px-row__align-${e.align}`]: !0,
|
|
1174
|
+
"px-row__wrap": !!e.wrap
|
|
1175
|
+
}]),
|
|
1176
|
+
style: I({
|
|
1177
|
+
marginLeft: n.value ? -n.value.x / 2 + "px" : void 0,
|
|
1178
|
+
marginRight: n.value ? -n.value.x / 2 + "px" : void 0,
|
|
1179
|
+
marginTop: n.value ? -n.value.y / 2 + "px" : void 0,
|
|
1180
|
+
marginBottom: n.value ? -n.value.y / 2 + "px" : void 0
|
|
1181
|
+
})
|
|
1182
|
+
}, [
|
|
1183
|
+
q(s.$slots, "default")
|
|
1184
|
+
], 6)
|
|
1185
|
+
]));
|
|
1186
|
+
}
|
|
1187
|
+
}), Gt = /* @__PURE__ */ C({
|
|
1188
|
+
name: "Col",
|
|
1189
|
+
__name: "index",
|
|
1190
|
+
props: {
|
|
1191
|
+
offset: { default: 0 },
|
|
1192
|
+
span: { default: 24 }
|
|
1193
|
+
},
|
|
1194
|
+
setup(t) {
|
|
1195
|
+
var l;
|
|
1196
|
+
const e = t, [r] = me(), n = x(() => A(e.offset) ? e.offset : e.offset[r.value] || 0), s = x(() => A(e.span) ? e.span : e.span[r.value] || 24), o = se(), u = b(((l = o == null ? void 0 : o.parent) == null ? void 0 : l.type) === je).value && ve("px-row-provide") || b({ x: 0, y: 0 });
|
|
1197
|
+
return (i, h) => (M(), H("div", {
|
|
1198
|
+
class: N(["pixelium px-col", {
|
|
1199
|
+
[`px-col__span-${s.value}`]: !0,
|
|
1200
|
+
[`px-col__offset-${n.value}`]: !0
|
|
1201
|
+
}]),
|
|
1202
|
+
style: I({
|
|
1203
|
+
paddingLeft: T(u) ? T(u).x / 2 + "px" : void 0,
|
|
1204
|
+
paddingRight: T(u) ? T(u).x / 2 + "px" : void 0,
|
|
1205
|
+
paddingTop: T(u) ? T(u).y / 2 + "px" : void 0,
|
|
1206
|
+
paddingBottom: T(u) ? T(u).y / 2 + "px" : void 0
|
|
1207
|
+
})
|
|
1208
|
+
}, [
|
|
1209
|
+
q(i.$slots, "default")
|
|
1210
|
+
], 6));
|
|
1211
|
+
}
|
|
1212
|
+
}), Wt = /* @__PURE__ */ C({
|
|
1213
|
+
name: "Divider",
|
|
1214
|
+
__name: "index",
|
|
1215
|
+
props: {
|
|
1216
|
+
direction: { default: "horizontal" },
|
|
1217
|
+
variant: { default: "solid" },
|
|
1218
|
+
margin: null,
|
|
1219
|
+
size: null
|
|
1220
|
+
},
|
|
1221
|
+
setup(t) {
|
|
1222
|
+
const e = t, r = x(() => {
|
|
1223
|
+
if (!Z(e.margin))
|
|
1224
|
+
return A(e.margin) ? `${e.margin}px` : e.margin;
|
|
1225
|
+
}), n = x(() => {
|
|
1226
|
+
if (!Z(e.size))
|
|
1227
|
+
return A(e.size) ? `${e.size}px` : e.size;
|
|
1228
|
+
});
|
|
1229
|
+
return (s, o) => (M(), H("div", {
|
|
1230
|
+
class: N(["pixelium px-divider", {
|
|
1231
|
+
[`px-divider__${e.direction}`]: !0,
|
|
1232
|
+
[`px-divider__${e.variant}`]: !0
|
|
1233
|
+
}]),
|
|
1234
|
+
style: I({
|
|
1235
|
+
marginLeft: e.direction === "vertical" ? r.value : void 0,
|
|
1236
|
+
marginRight: e.direction === "vertical" ? r.value : void 0,
|
|
1237
|
+
marginTop: e.direction === "horizontal" ? r.value : void 0,
|
|
1238
|
+
marginBottom: e.direction === "horizontal" ? r.value : void 0,
|
|
1239
|
+
borderBottomWidth: e.direction === "horizontal" ? n.value : void 0,
|
|
1240
|
+
borderRightWidth: e.direction === "vertical" ? n.value : void 0
|
|
1241
|
+
})
|
|
1242
|
+
}, null, 6));
|
|
1243
|
+
}
|
|
1244
|
+
}), Nt = (t, e) => !!(t && t.shapeFlag & 1), qt = (t, e) => !!(t && t.shapeFlag & 6), Xt = (t, e) => !!(t && t.shapeFlag & 8), jt = (t, e) => !!(t && t.shapeFlag & 16), Ut = (t, e) => !!(t && t.shapeFlag & 32), ce = (t) => {
|
|
1245
|
+
var r, n;
|
|
1246
|
+
const e = [];
|
|
1247
|
+
for (const s of t ?? [])
|
|
1248
|
+
Nt(s) || qt(s) || Xt(s) ? e.push(s) : jt(s, s.children) ? e.push(...ce(s.children)) : Ut(s, s.children) ? e.push(...ce((n = (r = s.children).default) == null ? void 0 : n.call(r))) : Ce(s) && e.push(...ce(s));
|
|
1249
|
+
return e;
|
|
1250
|
+
}, Qt = /* @__PURE__ */ C({
|
|
1251
|
+
name: "Space",
|
|
1252
|
+
__name: "index",
|
|
1253
|
+
props: {
|
|
1254
|
+
margin: {
|
|
1255
|
+
default: "medium"
|
|
1256
|
+
},
|
|
1257
|
+
direction: {
|
|
1258
|
+
default: "horizontal"
|
|
1259
|
+
},
|
|
1260
|
+
justify: {
|
|
1261
|
+
default: "start"
|
|
1262
|
+
},
|
|
1263
|
+
align: null,
|
|
1264
|
+
wrap: {
|
|
1265
|
+
type: Boolean,
|
|
1266
|
+
default: !0
|
|
1267
|
+
},
|
|
1268
|
+
inline: {
|
|
1269
|
+
type: Boolean,
|
|
1270
|
+
default: !1
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
setup(t) {
|
|
1274
|
+
var a;
|
|
1275
|
+
const e = t, r = x(() => e.align ? e.align : e.direction === "horizontal" ? "center" : "stretch"), n = Me(), s = ce(((a = n.default) == null ? void 0 : a.call(n)) || []), o = x(() => {
|
|
1276
|
+
if (!(!e.margin || e.margin === "small" || e.margin === "medium" || e.margin === "large")) {
|
|
1277
|
+
if (A(e.margin))
|
|
1278
|
+
return {
|
|
1279
|
+
x: e.margin,
|
|
1280
|
+
y: e.margin
|
|
1281
|
+
};
|
|
1282
|
+
if ("x" in e.margin || "y" in e.margin) {
|
|
1283
|
+
const u = A(e.margin.x) ? e.margin.x : 0, l = A(e.margin.y) ? e.margin.y : 0;
|
|
1284
|
+
return {
|
|
1285
|
+
x: u,
|
|
1286
|
+
y: l
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
return () => P("div", {
|
|
1292
|
+
class: {
|
|
1293
|
+
pixelium: !0,
|
|
1294
|
+
"px-space": !0,
|
|
1295
|
+
"px-space__inline": !!e.inline
|
|
1296
|
+
}
|
|
1297
|
+
}, [P("div", {
|
|
1298
|
+
class: {
|
|
1299
|
+
"px-space-inner": !0,
|
|
1300
|
+
"px-space__small": e.margin === "small",
|
|
1301
|
+
"px-space__large": e.margin === "large",
|
|
1302
|
+
[`px-space__justify-${e.justify}`]: !0,
|
|
1303
|
+
[`px-space__align-${r.value}`]: !0,
|
|
1304
|
+
[`px-space__${e.direction}`]: !0,
|
|
1305
|
+
"px-space__wrap": !!e.wrap
|
|
1306
|
+
},
|
|
1307
|
+
style: {
|
|
1308
|
+
marginTop: o.value ? -o.value.y / 2 + "px" : void 0,
|
|
1309
|
+
marginBottom: o.value ? -o.value.y / 2 + "px" : void 0,
|
|
1310
|
+
marginLeft: o.value ? -o.value.x / 2 + "px" : void 0,
|
|
1311
|
+
marginRight: o.value ? -o.value.x / 2 + "px" : void 0
|
|
1312
|
+
}
|
|
1313
|
+
}, [s.map((u, l) => P(Oe, {
|
|
1314
|
+
key: u.key || `px-space-item-${l}`
|
|
1315
|
+
}, [P("div", {
|
|
1316
|
+
class: "px-space-item",
|
|
1317
|
+
style: {
|
|
1318
|
+
marginTop: o.value ? o.value.y / 2 + "px" : void 0,
|
|
1319
|
+
marginBottom: o.value ? o.value.y / 2 + "px" : void 0,
|
|
1320
|
+
marginLeft: o.value ? o.value.x / 2 + "px" : void 0,
|
|
1321
|
+
marginRight: o.value ? o.value.x / 2 + "px" : void 0
|
|
1322
|
+
}
|
|
1323
|
+
}, [u])]))])]);
|
|
1324
|
+
}
|
|
1325
|
+
}), Ue = /* @__PURE__ */ C({
|
|
1326
|
+
name: "Grid",
|
|
1327
|
+
__name: "index",
|
|
1328
|
+
props: {
|
|
1329
|
+
column: { default: 24 },
|
|
1330
|
+
gutter: { default: 0 }
|
|
1331
|
+
},
|
|
1332
|
+
setup(t) {
|
|
1333
|
+
const e = t, [r] = me(), n = x(() => {
|
|
1334
|
+
if (A(e.gutter))
|
|
1335
|
+
return {
|
|
1336
|
+
x: e.gutter,
|
|
1337
|
+
y: e.gutter
|
|
1338
|
+
};
|
|
1339
|
+
if ("x" in e.gutter || "y" in e.gutter)
|
|
1340
|
+
return {
|
|
1341
|
+
x: e.gutter.x || 0,
|
|
1342
|
+
y: e.gutter.y || 0
|
|
1343
|
+
};
|
|
1344
|
+
const a = e.gutter[r.value];
|
|
1345
|
+
return A(a) ? {
|
|
1346
|
+
x: a,
|
|
1347
|
+
y: a
|
|
1348
|
+
} : Ne({ x: 0, y: 0 }, a);
|
|
1349
|
+
}), s = x(() => A(e.column) ? e.column : e.column[r.value] || 24), o = b([]);
|
|
1350
|
+
return de("px-grid-provide", {
|
|
1351
|
+
column: s,
|
|
1352
|
+
gutter: n,
|
|
1353
|
+
itemsStat: o
|
|
1354
|
+
}), (a, u) => (M(), H("div", {
|
|
1355
|
+
class: "pixelium px-grid",
|
|
1356
|
+
style: I({
|
|
1357
|
+
gridTemplateColumns: `repeat(${s.value}, minmax(0, 1fr))`,
|
|
1358
|
+
gap: n.value ? `${n.value.y}px ${n.value.x}px` : void 0
|
|
1359
|
+
})
|
|
1360
|
+
}, [
|
|
1361
|
+
q(a.$slots, "default")
|
|
1362
|
+
], 4));
|
|
1363
|
+
}
|
|
1364
|
+
}), we = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), Jt = (t) => () => {
|
|
1365
|
+
const e = ne.get(t);
|
|
1366
|
+
e == null || e.forEach((r) => r());
|
|
1367
|
+
}, Kt = () => {
|
|
1368
|
+
const t = b(-1), e = se(), r = () => {
|
|
1369
|
+
if (e && e.vnode.el instanceof HTMLElement) {
|
|
1370
|
+
const s = e.vnode.el.parentElement;
|
|
1371
|
+
if (s && s.children.length) {
|
|
1372
|
+
const o = [...s.children];
|
|
1373
|
+
t.value = o.indexOf(e.vnode.el);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
let n = null;
|
|
1378
|
+
return U() && (F(() => {
|
|
1379
|
+
setTimeout(() => {
|
|
1380
|
+
var s;
|
|
1381
|
+
if (n = ((s = e == null ? void 0 : e.vnode) == null ? void 0 : s.el) instanceof HTMLElement ? e.vnode.el.parentElement : null, n) {
|
|
1382
|
+
const o = we.get(n) || new MutationObserver(Jt(n));
|
|
1383
|
+
we.set(n, o), ne.set(n, [...ne.get(n) || [], r]), o.observe(n, { childList: !0 });
|
|
1384
|
+
}
|
|
1385
|
+
r();
|
|
1386
|
+
});
|
|
1387
|
+
}), st(() => {
|
|
1388
|
+
setTimeout(() => {
|
|
1389
|
+
r();
|
|
1390
|
+
});
|
|
1391
|
+
}), J(() => {
|
|
1392
|
+
var s;
|
|
1393
|
+
n && ((s = we.get(n)) == null || s.disconnect(), ne.set(
|
|
1394
|
+
n,
|
|
1395
|
+
(ne.get(n) || []).filter((o) => o !== r)
|
|
1396
|
+
));
|
|
1397
|
+
})), t;
|
|
1398
|
+
}, Yt = /* @__PURE__ */ C({
|
|
1399
|
+
name: "GridItem",
|
|
1400
|
+
__name: "index",
|
|
1401
|
+
props: {
|
|
1402
|
+
offset: { default: 0 },
|
|
1403
|
+
span: null
|
|
1404
|
+
},
|
|
1405
|
+
setup(t) {
|
|
1406
|
+
var d;
|
|
1407
|
+
const e = se(), n = b(((d = e == null ? void 0 : e.parent) == null ? void 0 : d.type) === Ue).value ? ve("px-grid-provide") : void 0, s = t, o = ot(), a = Kt(), [u] = me(), l = x(() => A(s.offset) ? s.offset : s.offset[u.value] || 0), i = x(() => s.span === void 0 ? (n == null ? void 0 : n.column.value) || 24 : A(s.span) ? s.span : s.span[u.value] || 24);
|
|
1408
|
+
F(() => {
|
|
1409
|
+
n == null || n.itemsStat.value.push({
|
|
1410
|
+
id: o,
|
|
1411
|
+
index: a.value,
|
|
1412
|
+
offset: l.value,
|
|
1413
|
+
span: i.value
|
|
1414
|
+
});
|
|
1415
|
+
}), he([a, l, i], () => {
|
|
1416
|
+
const c = n == null ? void 0 : n.itemsStat.value.find((f) => f.id === o);
|
|
1417
|
+
c ? (c.index = a.value, c.offset = l.value, c.span = i.value) : n == null || n.itemsStat.value.push({
|
|
1418
|
+
id: o,
|
|
1419
|
+
index: a.value,
|
|
1420
|
+
offset: l.value,
|
|
1421
|
+
span: i.value
|
|
1422
|
+
});
|
|
1423
|
+
}), J(() => {
|
|
1424
|
+
const c = n == null ? void 0 : n.itemsStat.value.findIndex((f) => f.id === o);
|
|
1425
|
+
c !== void 0 && c > -1 && (n == null || n.itemsStat.value.splice(c, 1));
|
|
1426
|
+
});
|
|
1427
|
+
const h = x(() => {
|
|
1428
|
+
if (!n)
|
|
1429
|
+
return;
|
|
1430
|
+
if (l.value + i.value > n.column.value)
|
|
1431
|
+
return `${l.value + 1} / span ${i.value}`;
|
|
1432
|
+
const c = n.itemsStat.value.filter((p) => p.index !== -1 && p.index < a.value);
|
|
1433
|
+
if (c.length === 0)
|
|
1434
|
+
return `${l.value + 1} / span ${i.value}`;
|
|
1435
|
+
let f = 0;
|
|
1436
|
+
return c.forEach((p) => {
|
|
1437
|
+
if (p.span + p.offset >= n.column.value) {
|
|
1438
|
+
f = 0;
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
f += p.span + p.offset, f > n.column.value ? f = p.span + p.offset : f === n.column.value && (f = 0);
|
|
1442
|
+
}), f + l.value + i.value > n.column.value ? `${l.value + 1} / span ${i.value}` : `${f + l.value + 1} / span ${i.value}`;
|
|
1443
|
+
});
|
|
1444
|
+
return (c, f) => (M(), H("div", {
|
|
1445
|
+
class: "pixelium px-grid-item",
|
|
1446
|
+
style: I({
|
|
1447
|
+
gridColumn: h.value
|
|
1448
|
+
})
|
|
1449
|
+
}, [
|
|
1450
|
+
q(c.$slots, "default")
|
|
1451
|
+
], 4));
|
|
1452
|
+
}
|
|
1453
|
+
}), Qe = /* @__PURE__ */ C({
|
|
1454
|
+
name: "Container",
|
|
1455
|
+
__name: "index",
|
|
1456
|
+
props: {
|
|
1457
|
+
direction: null
|
|
1458
|
+
},
|
|
1459
|
+
setup(t) {
|
|
1460
|
+
const e = b(0);
|
|
1461
|
+
de("px-container-provide", e);
|
|
1462
|
+
const r = t;
|
|
1463
|
+
return (n, s) => (M(), H("section", {
|
|
1464
|
+
class: N(["pixelium px-container", {
|
|
1465
|
+
"px-container__has-aside": !!e.value,
|
|
1466
|
+
[`px-container__${r.direction}`]: !!r.direction
|
|
1467
|
+
}])
|
|
1468
|
+
}, [
|
|
1469
|
+
q(n.$slots, "default")
|
|
1470
|
+
], 2));
|
|
1471
|
+
}
|
|
1472
|
+
}), Zt = { class: "pixelium px-main" }, Ft = /* @__PURE__ */ C({
|
|
1473
|
+
name: "Main",
|
|
1474
|
+
__name: "index",
|
|
1475
|
+
setup(t) {
|
|
1476
|
+
return (e, r) => (M(), H("main", Zt, [
|
|
1477
|
+
q(e.$slots, "default")
|
|
1478
|
+
]));
|
|
1479
|
+
}
|
|
1480
|
+
}), zt = /* @__PURE__ */ C({
|
|
1481
|
+
name: "Aside",
|
|
1482
|
+
__name: "index",
|
|
1483
|
+
props: {
|
|
1484
|
+
width: null,
|
|
1485
|
+
bordered: { type: Boolean, default: !1 },
|
|
1486
|
+
side: { default: "left" },
|
|
1487
|
+
dark: { type: Boolean, default: !1 }
|
|
1488
|
+
},
|
|
1489
|
+
setup(t) {
|
|
1490
|
+
var u;
|
|
1491
|
+
const e = se(), n = b(((u = e == null ? void 0 : e.parent) == null ? void 0 : u.type) === Qe).value ? ve("px-container-provide") : void 0;
|
|
1492
|
+
F(() => {
|
|
1493
|
+
n && (n.value += 1);
|
|
1494
|
+
}), J(() => {
|
|
1495
|
+
n && (n.value -= 1);
|
|
1496
|
+
});
|
|
1497
|
+
const s = t, o = ee(), a = x(() => Z(s.width) ? void 0 : A(s.width) ? `${s.width}px` : s.width);
|
|
1498
|
+
return (l, i) => (M(), H("aside", {
|
|
1499
|
+
class: N(["pixelium px-aside", {
|
|
1500
|
+
"px-aside__dark": !T(o) && !!s.dark,
|
|
1501
|
+
"px-aside__bordered": !!s.bordered,
|
|
1502
|
+
[`px-aside__${s.side}`]: !0
|
|
1503
|
+
}]),
|
|
1504
|
+
style: I({
|
|
1505
|
+
width: a.value
|
|
1506
|
+
})
|
|
1507
|
+
}, [
|
|
1508
|
+
q(l.$slots, "default")
|
|
1509
|
+
], 6));
|
|
1510
|
+
}
|
|
1511
|
+
}), St = /* @__PURE__ */ C({
|
|
1512
|
+
name: "Header",
|
|
1513
|
+
__name: "index",
|
|
1514
|
+
props: {
|
|
1515
|
+
minHeight: null,
|
|
1516
|
+
bordered: { type: Boolean },
|
|
1517
|
+
dark: { type: Boolean, default: !1 }
|
|
1518
|
+
},
|
|
1519
|
+
setup(t) {
|
|
1520
|
+
const e = t, r = ee(), n = x(() => Z(e.minHeight) ? void 0 : A(e.minHeight) ? `${e.minHeight}px` : e.minHeight);
|
|
1521
|
+
return (s, o) => (M(), H("header", {
|
|
1522
|
+
class: N(["pixelium px-header", {
|
|
1523
|
+
"px-header__dark": !T(r) && !!e.dark,
|
|
1524
|
+
"px-header__bordered": !!e.bordered
|
|
1525
|
+
}]),
|
|
1526
|
+
style: I({
|
|
1527
|
+
minHeight: n.value
|
|
1528
|
+
})
|
|
1529
|
+
}, [
|
|
1530
|
+
q(s.$slots, "default")
|
|
1531
|
+
], 6));
|
|
1532
|
+
}
|
|
1533
|
+
}), en = /* @__PURE__ */ C({
|
|
1534
|
+
name: "Footer",
|
|
1535
|
+
__name: "index",
|
|
1536
|
+
props: {
|
|
1537
|
+
minHeight: null,
|
|
1538
|
+
bordered: { type: Boolean },
|
|
1539
|
+
dark: { type: Boolean, default: !1 }
|
|
1540
|
+
},
|
|
1541
|
+
setup(t) {
|
|
1542
|
+
const e = t, r = ee(), n = x(() => Z(e.minHeight) ? void 0 : A(e.minHeight) ? `${e.minHeight}px` : e.minHeight);
|
|
1543
|
+
return (s, o) => (M(), H("footer", {
|
|
1544
|
+
class: N(["pixelium px-footer", {
|
|
1545
|
+
"px-footer__dark": !T(r) && !!e.dark,
|
|
1546
|
+
"px-footer__bordered": !!e.bordered
|
|
1547
|
+
}]),
|
|
1548
|
+
style: I({
|
|
1549
|
+
minHeight: n.value
|
|
1550
|
+
})
|
|
1551
|
+
}, [
|
|
1552
|
+
q(s.$slots, "default")
|
|
1553
|
+
], 6));
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
// @ts-ignore
|
|
1557
|
+
typeof process < "u" && process.env.NODE_ENV;
|
|
1558
|
+
const tn = "Pixelium";
|
|
1559
|
+
function Ee(t) {
|
|
1560
|
+
throw new Error(`[${tn}] ${t}`);
|
|
1561
|
+
}
|
|
1562
|
+
const cn = (t, e) => {
|
|
1563
|
+
var n, s;
|
|
1564
|
+
if (!U())
|
|
1565
|
+
return;
|
|
1566
|
+
const r = {
|
|
1567
|
+
light: [],
|
|
1568
|
+
dark: []
|
|
1569
|
+
};
|
|
1570
|
+
if (ae(e)) {
|
|
1571
|
+
const o = oe(e);
|
|
1572
|
+
r.light = re(o.r, o.g, o.b, o.a, !1).map((a) => E(a)), r.dark = re(o.r, o.g, o.b, o.a, !0).map((a) => E(a));
|
|
1573
|
+
} else
|
|
1574
|
+
(n = e.light) != null && n.length && e.light.length !== 10 && Ee("The length of color.light does not match the required number of CSS color palette (10)."), (s = e.dark) != null && s.length && e.dark.length !== 10 && Ee("The length of color.dark does not match the required number of CSS color palette (10)."), r.light = e.light || [], r.dark = e.dark || [];
|
|
1575
|
+
r.light.forEach((o, a) => {
|
|
1576
|
+
document.documentElement.style.setProperty(`--px-${t}-light-custom-${a + 1}`, o);
|
|
1577
|
+
}), r.dark.forEach((o, a) => {
|
|
1578
|
+
document.documentElement.style.setProperty(`--px-${t}-dark-custom-${a + 1}`, o);
|
|
1579
|
+
});
|
|
1580
|
+
}, Ae = (t) => {
|
|
1581
|
+
if (!U())
|
|
1582
|
+
return;
|
|
1583
|
+
const e = document.documentElement;
|
|
1584
|
+
e.classList.remove("light", "dark"), t !== "unset" && e.classList.add(t);
|
|
1585
|
+
};
|
|
1586
|
+
function nn(t) {
|
|
1587
|
+
const e = b(!1);
|
|
1588
|
+
if (U()) {
|
|
1589
|
+
let u = function(i) {
|
|
1590
|
+
e.value = i.matches;
|
|
1591
|
+
};
|
|
1592
|
+
const l = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1593
|
+
u(l), l.addEventListener("change", u), J(() => {
|
|
1594
|
+
l.removeEventListener("change", u);
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
const r = b(t || e.value ? "dark" : "light");
|
|
1598
|
+
t && Ae(r.value);
|
|
1599
|
+
const n = () => {
|
|
1600
|
+
r.value = r.value === "unset" ? e.value ? "light" : "dark" : r.value === "light" ? "dark" : "light";
|
|
1601
|
+
}, s = () => {
|
|
1602
|
+
r.value = "unset";
|
|
1603
|
+
}, o = () => {
|
|
1604
|
+
r.value = e.value ? "dark" : "light";
|
|
1605
|
+
}, a = he(r, Ae, { flush: "post" });
|
|
1606
|
+
return at(() => {
|
|
1607
|
+
a();
|
|
1608
|
+
}), [r, n, s, o];
|
|
1609
|
+
}
|
|
1610
|
+
const rn = /* @__PURE__ */ C({
|
|
1611
|
+
name: "Icon",
|
|
1612
|
+
__name: "index",
|
|
1613
|
+
props: {
|
|
1614
|
+
size: { default: "1em" },
|
|
1615
|
+
color: { default: "currentColor" },
|
|
1616
|
+
rotate: { default: 0 },
|
|
1617
|
+
spin: { type: Boolean, default: !1 },
|
|
1618
|
+
flip: { default: "none" }
|
|
1619
|
+
},
|
|
1620
|
+
setup(t) {
|
|
1621
|
+
const e = t, r = x(() => {
|
|
1622
|
+
let s = 1, o = 1;
|
|
1623
|
+
return (e.flip === "horizontal" || e.flip === "both") && (s = -1), (e.flip === "vertical" || e.flip === "both") && (o = -1), `scale(${s}, ${o}) rotate(${e.rotate}deg)`;
|
|
1624
|
+
}), n = x(() => A(e.size) ? `${e.size}px` : e.size);
|
|
1625
|
+
return (s, o) => (M(), H("div", {
|
|
1626
|
+
class: N({
|
|
1627
|
+
"pixelium px-icon": !0,
|
|
1628
|
+
"px-icon__spin": !!e.spin
|
|
1629
|
+
}),
|
|
1630
|
+
style: I({
|
|
1631
|
+
height: n.value,
|
|
1632
|
+
width: n.value,
|
|
1633
|
+
fontSize: n.value,
|
|
1634
|
+
color: e.color,
|
|
1635
|
+
transform: r.value
|
|
1636
|
+
})
|
|
1637
|
+
}, [
|
|
1638
|
+
q(s.$slots, "default")
|
|
1639
|
+
], 6));
|
|
1640
|
+
}
|
|
1641
|
+
}), sn = [kt, Ge, Ct, At, je, Gt, Wt, Qt, Ue, Yt, Qe, Ft, zt, St, en, rn], on = "Px", an = (t, e = { prefix: on }) => {
|
|
1642
|
+
sn.forEach((r) => {
|
|
1643
|
+
r.name && t.component(e.prefix + r.name, r);
|
|
1644
|
+
}), e.attachToApp !== !1 && (t.config.globalProperties.PixeliumVue = {
|
|
1645
|
+
message: fe,
|
|
1646
|
+
useThemeMode: nn
|
|
1647
|
+
}), e.attachToWindow !== !1 && U() && (window.$message = fe);
|
|
1648
|
+
}, fn = {
|
|
1649
|
+
install: an
|
|
1650
|
+
};
|
|
1651
|
+
export {
|
|
1652
|
+
zt as Aside,
|
|
1653
|
+
kt as Button,
|
|
1654
|
+
Ge as ButtonGroup,
|
|
1655
|
+
Gt as Col,
|
|
1656
|
+
Qe as Container,
|
|
1657
|
+
Wt as Divider,
|
|
1658
|
+
en as Footer,
|
|
1659
|
+
Ue as Grid,
|
|
1660
|
+
Yt as GridItem,
|
|
1661
|
+
St as Header,
|
|
1662
|
+
rn as Icon,
|
|
1663
|
+
Ct as Link,
|
|
1664
|
+
Ft as Main,
|
|
1665
|
+
fe as Message,
|
|
1666
|
+
At as MessageBox,
|
|
1667
|
+
je as Row,
|
|
1668
|
+
Qt as Space,
|
|
1669
|
+
fn as default,
|
|
1670
|
+
an as install,
|
|
1671
|
+
cn as setThemeColor,
|
|
1672
|
+
nn as useThemeMode
|
|
1673
|
+
};
|