@ui0/icon 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icon.module.css +1 -1
- package/dist/icon.vue.d.ts +3 -1
- package/dist/icon.vue.d.ts.map +1 -1
- package/dist/index.js +345 -269
- package/dist/interactions.vue.d.ts +10 -0
- package/dist/interactions.vue.d.ts.map +1 -0
- package/dist/modifiers.d.ts +21 -0
- package/dist/modifiers.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +4 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/vite/compose.d.ts.map +1 -1
- package/dist/vite/index.d.ts +2 -3
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +704 -500
- package/dist/vite/next/compose.d.ts +15 -0
- package/dist/vite/next/compose.d.ts.map +1 -0
- package/dist/vite/next/plugin.d.ts +5 -0
- package/dist/vite/next/plugin.d.ts.map +1 -0
- package/dist/vite/next/sources.d.ts +27 -0
- package/dist/vite/next/sources.d.ts.map +1 -0
- package/dist/vite/options.d.ts +2 -0
- package/dist/vite/options.d.ts.map +1 -1
- package/dist/vite/progress/compiler.d.ts +25 -0
- package/dist/vite/progress/compiler.d.ts.map +1 -0
- package/dist/vite/progress/runtime.d.ts +3 -0
- package/dist/vite/progress/runtime.d.ts.map +1 -0
- package/dist/vite/progress/types.d.ts +21 -0
- package/dist/vite/progress/types.d.ts.map +1 -0
- package/dist/vite/transformer-next.d.ts +16 -0
- package/dist/vite/transformer-next.d.ts.map +1 -0
- package/dist/vite/transformer.d.ts +3 -0
- package/dist/vite/transformer.d.ts.map +1 -1
- package/dist/vite/types.d.ts +22 -3
- package/dist/vite/types.d.ts.map +1 -1
- package/package.json +11 -10
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { newErrorForSetupCall as
|
|
5
|
-
import { inject as
|
|
6
|
-
import { useComponentId as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const s =
|
|
12
|
-
if (!s) throw
|
|
1
|
+
var ne = Object.defineProperty;
|
|
2
|
+
var ce = (o, s, e) => s in o ? ne(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
|
|
3
|
+
var z = (o, s, e) => ce(o, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { newErrorForSetupCall as ie, isArray as re, hyphenate as ae } from "@ui0/util";
|
|
5
|
+
import { inject as Z, getCurrentInstance as le, h as E, reactive as ue, onScopeDispose as pe, resolveComponent as fe, defineComponent as de, useCssModule as he, useAttrs as me, openBlock as ge, createBlock as ve, mergeProps as G, camelize as ke } from "vue";
|
|
6
|
+
import { useComponentId as we } from "@ui0/composable";
|
|
7
|
+
const ye = Symbol.for("ui0-icon"), Y = Symbol("ui0-icon-instance");
|
|
8
|
+
function ps() {
|
|
9
|
+
const o = Z(Y, void 0);
|
|
10
|
+
if (o) return o;
|
|
11
|
+
const s = le();
|
|
12
|
+
if (!s) throw ie("getIcon");
|
|
13
13
|
return s.appContext.config.globalProperties.$ui0Icon;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const be = {
|
|
16
16
|
value: "fake",
|
|
17
17
|
rotate: 0,
|
|
18
18
|
weight: 400,
|
|
@@ -32,32 +32,32 @@ const ye = {
|
|
|
32
32
|
guides: !1
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function xe(o, s) {
|
|
36
36
|
const e = [
|
|
37
|
-
|
|
37
|
+
o,
|
|
38
38
|
s,
|
|
39
|
-
|
|
40
|
-
],
|
|
41
|
-
for (const
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
39
|
+
be
|
|
40
|
+
], d = (n) => {
|
|
41
|
+
for (const i of e) {
|
|
42
|
+
const u = i == null ? void 0 : i[n];
|
|
43
|
+
if (u !== void 0) return u;
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
return new Proxy({}, {
|
|
47
|
-
get: (
|
|
48
|
-
ownKeys: () => [...new Set(e.flatMap((
|
|
49
|
-
getOwnPropertyDescriptor: (
|
|
47
|
+
get: (n, i) => d(i),
|
|
48
|
+
ownKeys: () => [...new Set(e.flatMap((n) => n ? Object.keys(n) : []))],
|
|
49
|
+
getOwnPropertyDescriptor: (n, i) => ({
|
|
50
50
|
enumerable: !0,
|
|
51
51
|
configurable: !0,
|
|
52
|
-
value:
|
|
52
|
+
value: d(i)
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
function
|
|
58
|
-
return
|
|
56
|
+
const J = Symbol("ui0-icon-framework");
|
|
57
|
+
function Ie() {
|
|
58
|
+
return Z(J, {});
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const q = {
|
|
61
61
|
"ellipse-rect": "M930,602.17c0,12.52,0,25.03-.07,37.55-.06,10.54-.18,21.09-.47,31.63-.62,22.97-1.97,46.14-6.06,68.85-4.14,23.04-10.9,44.49-21.56,65.42-10.47,20.58-24.16,39.41-40.49,55.73-16.33,16.33-35.16,30.01-55.73,40.49-20.94,10.66-42.38,17.42-65.42,21.56-22.71,4.08-45.88,5.43-68.85,6.06-10.54.29-21.08.41-31.63.47-12.52.08-25.03.07-37.55.07h-244.34c-12.52,0-25.03,0-37.55-.07-10.54-.06-21.09-.18-31.63-.47-22.97-.62-46.14-1.97-68.85-6.06-23.04-4.14-44.49-10.9-65.42-21.56-20.58-10.47-39.41-24.16-55.73-40.49-16.33-16.33-30.01-35.16-40.49-55.73-10.66-20.94-17.42-42.38-21.56-65.42-4.08-22.71-5.43-45.88-6.06-68.85-.29-10.54-.41-21.08-.47-31.63-.08-12.52-.07-25.03-.07-37.55v-244.34c0-12.52,0-25.03.07-37.55.06-10.54.18-21.09.47-31.63.62-22.97,1.97-46.14,6.06-68.85,4.14-23.04,10.9-44.49,21.56-65.42,10.47-20.58,24.16-39.41,40.49-55.73,16.33-16.33,35.16-30.01,55.73-40.49,20.94-10.66,42.38-17.42,65.42-21.56,22.71-4.08,45.88-5.43,68.85-6.06,10.54-.29,21.08-.41,31.63-.47,12.52-.08,25.03-.07,37.55-.07h244.34c12.52,0,25.03,0,37.55.07,10.54.06,21.09.18,31.63.47,22.97.62,46.14,1.97,68.85,6.06,23.04,4.14,44.49,10.9,65.42,21.56,20.58,10.47,39.41,24.16,55.73,40.49,16.33,16.33,30.01,35.16,40.49,55.73,10.66,20.94,17.42,42.38,21.56,65.42,4.08,22.71,5.43,45.88,6.06,68.85.29,10.54.41,21.08.47,31.63.08,12.52.07,25.03.07,37.55v244.34Z",
|
|
62
62
|
shield: "M75,408.8c0-143.9,0-215.8,17-240,17-24.2,84.6-47.4,219.9-93.7l25.8-8.8c70.5-24.1,105.8-36.2,142.3-36.2s71.8,12.1,142.3,36.2l25.8,8.8c135.3,46.3,202.9,69.5,219.9,93.7,17,24.2,17,96.2,17,240v70.9c0,253.7-190.8,376.8-310.4,429.1-32.5,14.2-48.7,21.3-94.6,21.3s-62.1-7.1-94.6-21.3c-119.7-52.3-310.4-175.4-310.4-429.1v-70.9h0Z",
|
|
63
63
|
pentagon: "M515.9,52.2l114.6,232.2c5.8,11.8,17.1,20,30.1,21.9l256.3,37.2c32.8,4.8,45.9,45.1,22.2,68.2l-185.4,180.8c-9.4,9.2-13.7,22.4-11.5,35.4l43.8,255.2c5.6,32.7-28.7,57.6-58,42.2l-229.2-120.5c-11.7-6.1-25.6-6.1-37.2,0l-229.2,120.5c-29.3,15.4-63.6-9.5-58-42.2l43.8-255.2c2.2-13-2.1-26.2-11.5-35.4L21,411.8c-23.7-23.1-10.6-63.5,22.2-68.2l256.3-37.2c13-1.9,24.3-10.1,30.1-21.9l114.6-232.2c14.7-29.7,57.1-29.7,71.7,0Z",
|
|
@@ -65,18 +65,18 @@ const G = {
|
|
|
65
65
|
heptagon: "M462.6,40.8L133.9,199.2c-11,5.3-18.9,15.3-21.6,27.1L31.1,582c-2.7,11.9.1,24.3,7.7,33.8l227.5,285.3c7.6,9.5,19.1,15.1,31.3,15.1h364.9c12.2,0,23.7-5.5,31.3-15.1l227.5-285.3c7.6-9.5,10.4-22,7.7-33.8l-81.2-355.7c-2.7-11.9-10.7-21.9-21.6-27.1L497.4,40.8c-11-5.3-23.7-5.3-34.7,0Z",
|
|
66
66
|
octagon: "M523,38.5l238.7,98.9c27.6,11.4,49.5,33.3,60.9,60.9l98.9,238.7c11.4,27.6,11.4,58.5,0,86.1l-98.9,238.7c-11.4,27.6-33.3,49.5-60.9,60.9l-238.7,98.9c-27.6,11.4-58.5,11.4-86.1,0l-238.7-98.9c-27.6-11.4-49.5-33.3-60.9-60.9l-98.9-238.7c-11.4-27.6-11.4-58.5,0-86.1l98.9-238.7c11.4-27.6,33.3-49.5,60.9-60.9l238.7-98.9c27.6-11.4,58.5-11.4,86.1,0h0Z"
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function _e(o) {
|
|
69
|
+
return o in q;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return !!
|
|
71
|
+
function W(o) {
|
|
72
|
+
return !!o && "customOptions" in o;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
return (s) =>
|
|
74
|
+
function R(o) {
|
|
75
|
+
return (s) => E("g", o, s || []);
|
|
76
76
|
}
|
|
77
|
-
class
|
|
77
|
+
class Se {
|
|
78
78
|
constructor() {
|
|
79
|
-
|
|
79
|
+
z(this, "stack", []);
|
|
80
80
|
}
|
|
81
81
|
add(s) {
|
|
82
82
|
this.stack.push(s);
|
|
@@ -85,36 +85,118 @@ class Ie {
|
|
|
85
85
|
return this.stack.reduce((s, e) => e(s), {});
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
88
|
+
function X(o) {
|
|
89
|
+
return Array.isArray(o) ? o.filter((s) => typeof s == "string" && s.length > 0) : typeof o == "string" ? o.split(/[\s,]+/).filter(Boolean) : [];
|
|
90
|
+
}
|
|
91
|
+
function Be(o, s) {
|
|
92
|
+
const e = /* @__PURE__ */ new Set();
|
|
93
|
+
for (const d of o) {
|
|
94
|
+
const n = d.match(/^(.+?)(?::|-)(hover|active|focus)$/);
|
|
95
|
+
n ? s[n[2]] && e.add(n[1]) : e.add(d);
|
|
96
|
+
}
|
|
97
|
+
return [...e];
|
|
98
|
+
}
|
|
99
|
+
function Ee(o) {
|
|
100
|
+
return o.some((s) => /(?::|-)(hover|active|focus)$/.test(s));
|
|
101
|
+
}
|
|
102
|
+
function Me(o, s) {
|
|
103
|
+
const e = { hover: o.matches(":hover"), active: o.matches(":active"), focus: o.matches(":focus-within") }, d = () => o.closest("button, input, a, [data-icon-host]");
|
|
104
|
+
let n = null;
|
|
105
|
+
const i = { hover: !1, active: !1, focus: !1 }, u = () => s({ hover: e.hover || i.hover, active: e.active || i.active, focus: e.focus || i.focus });
|
|
106
|
+
let v = () => {
|
|
107
|
+
};
|
|
108
|
+
const h = () => {
|
|
109
|
+
e.active = i.active = !1, v(), v = () => {
|
|
110
|
+
}, u();
|
|
111
|
+
}, L = o.ownerDocument.defaultView, F = (f, P) => {
|
|
112
|
+
if (f.type === "pointerdown" && f.button !== 0 || f.type === "keydown" && ![" ", "Enter"].includes(f.key) || (h(), P.active = !0, u(), !L)) return;
|
|
113
|
+
const O = (g) => {
|
|
114
|
+
(g.type !== "keyup" || [" ", "Enter"].includes(g.key)) && h();
|
|
115
|
+
};
|
|
116
|
+
for (const g of ["pointerup", "pointercancel", "keyup", "blur"]) L.addEventListener(g, O);
|
|
117
|
+
v = () => {
|
|
118
|
+
for (const g of ["pointerup", "pointercancel", "keyup", "blur"]) L.removeEventListener(g, O);
|
|
119
|
+
};
|
|
120
|
+
}, I = (f, P) => {
|
|
121
|
+
const O = {
|
|
122
|
+
pointerenter: () => {
|
|
123
|
+
P.hover = !0, u();
|
|
124
|
+
},
|
|
125
|
+
pointerleave: () => {
|
|
126
|
+
P.hover = !1, u();
|
|
127
|
+
},
|
|
128
|
+
pointerdown: (g) => F(g, P),
|
|
129
|
+
keydown: (g) => F(g, P),
|
|
130
|
+
focusin: () => {
|
|
131
|
+
P.focus = !0, u();
|
|
132
|
+
},
|
|
133
|
+
focusout: (g) => {
|
|
134
|
+
const A = g.relatedTarget;
|
|
135
|
+
P.focus = A !== null && f.contains(A), u();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
for (const [g, A] of Object.entries(O)) f.addEventListener(g, A);
|
|
139
|
+
return () => {
|
|
140
|
+
for (const [g, A] of Object.entries(O)) f.removeEventListener(g, A);
|
|
141
|
+
};
|
|
142
|
+
}, j = I(o, e);
|
|
143
|
+
let C = () => {
|
|
144
|
+
};
|
|
145
|
+
const _ = () => {
|
|
146
|
+
const f = d();
|
|
147
|
+
f !== n && (n = f, C(), C = f && f !== o ? I(f, i) : () => {
|
|
148
|
+
}, i.hover = (f == null ? void 0 : f.matches(":hover")) ?? !1, i.active = (f == null ? void 0 : f.matches(":active")) ?? !1, i.focus = (f == null ? void 0 : f.matches(":focus-within")) ?? !1);
|
|
149
|
+
};
|
|
150
|
+
_();
|
|
151
|
+
const D = () => _();
|
|
152
|
+
return o.addEventListener("pointerenter", _), o.addEventListener("focusin", _), o.ownerDocument.addEventListener("pointerover", D), u(), () => {
|
|
153
|
+
j(), C(), o.removeEventListener("pointerenter", _), o.removeEventListener("focusin", _), o.ownerDocument.removeEventListener("pointerover", D), v();
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function $e() {
|
|
157
|
+
const o = ue({ hover: !1, active: !1, focus: !1 });
|
|
158
|
+
let s = null, e = () => {
|
|
159
|
+
};
|
|
160
|
+
const d = (n) => {
|
|
161
|
+
const i = n instanceof Element ? n : null;
|
|
162
|
+
i !== s && (e(), s = i, Object.assign(o, { hover: !1, active: !1, focus: !1 }), e = i ? Me(i, (u) => Object.assign(o, u)) : () => {
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
return pe(() => d(null)), { state: o, elementRef: d };
|
|
166
|
+
}
|
|
167
|
+
function Ce(o, s) {
|
|
168
|
+
const e = () => n.params.value ? `icon-${n.params.pack}-${n.params.value}` : "icon-none", n = {
|
|
90
169
|
modifiers: [],
|
|
91
170
|
params: {},
|
|
92
171
|
getComponentName: e,
|
|
93
172
|
getComponent: () => {
|
|
94
|
-
const
|
|
95
|
-
|
|
173
|
+
const _ = Z(Symbol.for("ui0-icon-generated"), {})[`${n.params.pack}/${n.params.value}`];
|
|
174
|
+
if (_) return _;
|
|
175
|
+
const D = fe(e());
|
|
176
|
+
return typeof D == "string" ? null : D;
|
|
96
177
|
}
|
|
97
178
|
};
|
|
98
|
-
if (!
|
|
99
|
-
const
|
|
100
|
-
return
|
|
179
|
+
if (!o) return n;
|
|
180
|
+
const i = o.includes("/") ? o : `/${o}`, [u, v = ""] = i.split("?", 2), h = u.indexOf("/"), L = u.slice(0, h), F = u.slice(h + 1), [I, ...j] = F.split(".");
|
|
181
|
+
return j.length && (n.modifiers = j.reduce((C, _) => [...C, _.replace(":", "-")], [])), v && (n.params = Object.fromEntries(v.split("&").map((C) => C.split("=", 2)))), n.params.pack = L || s.pack || "ui0", I && (n.params.value = I), n;
|
|
101
182
|
}
|
|
102
|
-
function
|
|
103
|
-
const e =
|
|
104
|
-
for (const [
|
|
105
|
-
|
|
106
|
-
const
|
|
183
|
+
function Q(o, s) {
|
|
184
|
+
const e = Ce(o, s);
|
|
185
|
+
for (const [n, i] of Object.entries(s))
|
|
186
|
+
i !== void 0 && n !== "value" && e.params[n] === void 0 && (e.params[n] = i);
|
|
187
|
+
const d = {
|
|
107
188
|
...s,
|
|
108
189
|
...e.params
|
|
109
190
|
};
|
|
110
191
|
return {
|
|
111
192
|
...e,
|
|
112
|
-
params:
|
|
193
|
+
params: d
|
|
113
194
|
};
|
|
114
195
|
}
|
|
115
|
-
const
|
|
196
|
+
const Pe = /* @__PURE__ */ de({
|
|
116
197
|
__name: "icon",
|
|
117
198
|
props: {
|
|
199
|
+
filled: { type: Boolean, default: void 0 },
|
|
118
200
|
badge: {},
|
|
119
201
|
display: {},
|
|
120
202
|
shape: {},
|
|
@@ -134,9 +216,9 @@ const Me = /* @__PURE__ */ pe({
|
|
|
134
216
|
height: {},
|
|
135
217
|
color: {}
|
|
136
218
|
},
|
|
137
|
-
setup(
|
|
138
|
-
var
|
|
139
|
-
const s =
|
|
219
|
+
setup(o) {
|
|
220
|
+
var U, H;
|
|
221
|
+
const s = o, e = he(), d = Ie(), n = (U = d.useTheme) == null ? void 0 : U.call(d, s, e), i = xe(s, (H = d.useDefaults) == null ? void 0 : H.call(d)), u = oe(), [, v] = we("icon"), h = {
|
|
140
222
|
badge: v("badge"),
|
|
141
223
|
radial: v("radial"),
|
|
142
224
|
shape: v("shape"),
|
|
@@ -145,189 +227,183 @@ const Me = /* @__PURE__ */ pe({
|
|
|
145
227
|
shapeStrokeMask: v("shape-stroke-mask"),
|
|
146
228
|
icon: v("icon"),
|
|
147
229
|
iconMask: v("mask-icon")
|
|
148
|
-
},
|
|
149
|
-
...
|
|
230
|
+
}, L = E("rect", {
|
|
231
|
+
...u.viewBox,
|
|
150
232
|
fill: "#FFF"
|
|
151
|
-
}),
|
|
152
|
-
...
|
|
153
|
-
viewBox:
|
|
154
|
-
},
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
for (let i = 0; i < o.length; i++) {
|
|
161
|
-
const l = t[o[i]];
|
|
162
|
-
r.includes(o[i]) && l !== void 0 && ["string", "number", "boolean"].includes(typeof l) && a.push(`icon-${o[i]}-${l}`);
|
|
233
|
+
}), I = {
|
|
234
|
+
...te(s),
|
|
235
|
+
viewBox: u.getViewBox()
|
|
236
|
+
}, j = $e(), C = me();
|
|
237
|
+
function _(c) {
|
|
238
|
+
const a = [], t = Object.keys(c), p = ["size", "color", "value", "fill", "weight"];
|
|
239
|
+
for (let l = 0; l < t.length; l++) {
|
|
240
|
+
const k = c[t[l]];
|
|
241
|
+
p.includes(t[l]) && k !== void 0 && ["string", "number", "boolean"].includes(typeof k) && a.push(`icon-${t[l]}-${k}`);
|
|
163
242
|
}
|
|
164
243
|
return a;
|
|
165
244
|
}
|
|
166
|
-
const
|
|
167
|
-
const { value:
|
|
168
|
-
if (!
|
|
169
|
-
const a =
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
class:
|
|
173
|
-
|
|
174
|
-
b.value = !0;
|
|
175
|
-
},
|
|
176
|
-
onPointerleave() {
|
|
177
|
-
b.value = !1;
|
|
178
|
-
},
|
|
179
|
-
onVnodeMounted(l) {
|
|
180
|
-
l.el instanceof HTMLElement && l.el.parentElement && l.el.parentElement instanceof HTMLElement && l.el.parentElement;
|
|
181
|
-
}
|
|
245
|
+
const D = () => {
|
|
246
|
+
const { value: c } = s;
|
|
247
|
+
if (!c) return null;
|
|
248
|
+
const a = Q(re(c) ? c[0] : c, i), t = [e.icon];
|
|
249
|
+
n ? t.push(...n.classes(a.params)) : t.push(..._(a.params));
|
|
250
|
+
const p = {
|
|
251
|
+
class: t,
|
|
252
|
+
ref: Ee([...a.modifiers, ...X(a.params.modifiers)]) ? j.elementRef : void 0
|
|
182
253
|
};
|
|
183
254
|
if (a.params.value === "fake")
|
|
184
|
-
return
|
|
185
|
-
const
|
|
186
|
-
return
|
|
187
|
-
},
|
|
188
|
-
const a =
|
|
255
|
+
return E("i", G(C, p));
|
|
256
|
+
const l = P(a);
|
|
257
|
+
return l ? E("i", G(C, p), l) : null;
|
|
258
|
+
}, f = (c, a) => E("symbol", a, c), P = (c) => {
|
|
259
|
+
const a = O(c);
|
|
189
260
|
if (!a) return null;
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
viewBox:
|
|
194
|
-
class:
|
|
261
|
+
const t = c.params, p = t.color && t.color.length === 2, l = t.color && t.color.length > 2, k = (p || l) && t.rendering && t.rendering === "multicolor", r = [e.canvas];
|
|
262
|
+
n && r.push(...n.classes(t, e));
|
|
263
|
+
const m = [], S = [], V = {
|
|
264
|
+
viewBox: u.getViewBox(),
|
|
265
|
+
class: r
|
|
195
266
|
};
|
|
196
|
-
|
|
267
|
+
p && r.push(e.doubleColored), l && r.push(e.tripleColored);
|
|
197
268
|
let y = {};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const I = x(h.badge, y, {
|
|
214
|
-
...w,
|
|
269
|
+
const M = /* @__PURE__ */ new Map(), T = (b, x, w) => {
|
|
270
|
+
const $ = x.getComponent();
|
|
271
|
+
W($) && (Array.from($.customOptions.modifiers).length > 0 || $.customOptions.flags.some((N) => ["animation", "animate"].includes(N))) ? M.set(b, () => O(x)) : m.push(f(w, { id: b, viewBox: u.getViewBox() }));
|
|
272
|
+
}, B = (b, x = {}, w = {}) => {
|
|
273
|
+
const $ = M.get(b);
|
|
274
|
+
return g(b, x, w, $);
|
|
275
|
+
};
|
|
276
|
+
if (T(h.icon, c, a), t.badge && typeof t.badge == "string") {
|
|
277
|
+
const b = Q(t.badge, {});
|
|
278
|
+
y = b.params;
|
|
279
|
+
const x = O(b);
|
|
280
|
+
if (x) {
|
|
281
|
+
T(h.badge, b, x), !t.shape && !y.shape && m.push(B(h.badge, y, I));
|
|
282
|
+
const w = B(h.badge, y, {
|
|
283
|
+
...I,
|
|
215
284
|
class: [e.strokeMask, e.masked]
|
|
216
285
|
});
|
|
217
|
-
|
|
286
|
+
S.push(A(h.strokeMask, [w]));
|
|
218
287
|
}
|
|
219
288
|
}
|
|
220
|
-
if ((!
|
|
221
|
-
const
|
|
289
|
+
if ((!t.shape || k) && m.push(B(h.icon, t, { mask: h.strokeMask })), t.shape) {
|
|
290
|
+
const b = B(h.icon, t, {
|
|
222
291
|
mask: h.strokeMask,
|
|
223
292
|
class: e.masked
|
|
224
|
-
}),
|
|
225
|
-
...
|
|
293
|
+
}), x = B(h.badge, y, {
|
|
294
|
+
...I,
|
|
226
295
|
class: e.masked
|
|
227
296
|
});
|
|
228
|
-
y.shape &&
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
...
|
|
233
|
-
viewBox:
|
|
297
|
+
y.shape && m.push(B(h.shape, {}, { mask: h.badge, ...I }));
|
|
298
|
+
const w = [b];
|
|
299
|
+
if (t.badge && w.push(x), y.shape) {
|
|
300
|
+
const $ = {
|
|
301
|
+
...I,
|
|
302
|
+
viewBox: u.getViewBox()
|
|
234
303
|
};
|
|
235
|
-
|
|
236
|
-
|
|
304
|
+
w.push(
|
|
305
|
+
B(
|
|
237
306
|
h.shape,
|
|
238
307
|
{},
|
|
239
308
|
{
|
|
240
|
-
|
|
309
|
+
...$,
|
|
241
310
|
class: [e.strokeMask, e.shapeStrokeMask, e.masked]
|
|
242
311
|
}
|
|
243
312
|
)
|
|
244
313
|
);
|
|
245
314
|
}
|
|
246
|
-
if (
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
315
|
+
if (S.push(A(h.iconMask, w)), t.shape || y.shape) {
|
|
316
|
+
const $ = ee(c);
|
|
317
|
+
$ && m.push(
|
|
318
|
+
f($, {
|
|
250
319
|
id: h.shape,
|
|
251
|
-
viewBox:
|
|
320
|
+
viewBox: u.getViewBox()
|
|
252
321
|
})
|
|
253
|
-
),
|
|
322
|
+
), m.push(B(h.shape, {}, k ? { mask: h.iconMask } : { mask: h.iconMask }));
|
|
254
323
|
}
|
|
255
|
-
|
|
324
|
+
t.badge && m.push(B(h.badge, y, k ? I : { ...I }));
|
|
256
325
|
}
|
|
257
|
-
return
|
|
258
|
-
},
|
|
259
|
-
const a =
|
|
260
|
-
if (!
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
326
|
+
return S.length && m.unshift(E("defs", S)), E("svg", V, m);
|
|
327
|
+
}, O = (c) => {
|
|
328
|
+
const a = c.getComponent();
|
|
329
|
+
if (!W(a)) return null;
|
|
330
|
+
const t = new Se(), p = a.customOptions, l = Be(
|
|
331
|
+
[...c.modifiers, ...X(c.params.modifiers)],
|
|
332
|
+
j.state
|
|
333
|
+
), k = {
|
|
334
|
+
fit: c.params.fit ?? "default",
|
|
335
|
+
progress: c.params.progress ?? 100,
|
|
336
|
+
rendering: c.params.rendering,
|
|
337
|
+
modifiers: l
|
|
338
|
+
}, r = [e.layerStyle], m = {
|
|
339
|
+
class: r,
|
|
268
340
|
style: "--0-icon-weight: 800;"
|
|
269
341
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
342
|
+
p.flags.includes("no-fill") || r.push(e.fillable), !p.flags.includes("no-stroke") && !p.flags.includes("no-process-stroke") && r.push(e.weighty), p.flags.includes("no-cap") || r.push(e.cap), p.flags.includes("no-join") || r.push(e.join), c.params.shape && r.push(e.shaped);
|
|
343
|
+
const S = c.params.filled;
|
|
344
|
+
(S !== void 0 ? S === !0 || S === "true" : l.some((B) => B === "fill" || B === "filled")) && r.push(e.filled), c.params.rendering && r.push(e[ke(c.params.rendering)]), t.add(() => E(a, k)), t.add(R(m)), c.params.animation && t.add(R({})), (c.params.flipped || l.includes("flip")) && t.add(R({ class: e.flip }));
|
|
345
|
+
const y = Number(c.params.rotate ?? 0), M = u.viewBox.x + u.viewBox.width / 2, T = u.viewBox.y + u.viewBox.height / 2;
|
|
346
|
+
return t.add(
|
|
347
|
+
R({
|
|
348
|
+
"data-icon-rotate": "",
|
|
349
|
+
transform: `rotate(${Number.isFinite(y) ? y : 0} ${M} ${T})`
|
|
274
350
|
})
|
|
275
|
-
),
|
|
276
|
-
},
|
|
277
|
-
let
|
|
278
|
-
"--0-icon-weight": +(a.weight ?? 400) / 100 *
|
|
351
|
+
), t.render();
|
|
352
|
+
}, g = (c, a = {}, t = {}, p) => {
|
|
353
|
+
let l = {
|
|
354
|
+
"--0-icon-weight": +(a.weight ?? 400) / 100 * u.getStrokeUnit(),
|
|
279
355
|
"--0-icon-progress": a.progress ?? 100
|
|
280
356
|
};
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
href: `#${
|
|
285
|
-
style:
|
|
286
|
-
...
|
|
287
|
-
class:
|
|
357
|
+
const k = Array.isArray(t.class) ? t.class : [t.class];
|
|
358
|
+
n && (l = { ...l, ...n.styles(a) }, k.push(...n.classes(a, e)));
|
|
359
|
+
const r = {
|
|
360
|
+
href: `#${c}`,
|
|
361
|
+
style: l,
|
|
362
|
+
...t,
|
|
363
|
+
class: k
|
|
288
364
|
};
|
|
289
|
-
return
|
|
290
|
-
},
|
|
291
|
-
const a =
|
|
365
|
+
return t.mask && (r.mask = `url(#${t.mask})`), p ? (delete r.href, r.viewBox ?? (r.viewBox = u.getViewBox()), r["data-icon-inline"] = "", E("svg", r, [p()])) : E("use", r);
|
|
366
|
+
}, A = (c, a = []) => E("mask", { id: c }, [L, ...a]), ee = (c) => {
|
|
367
|
+
const a = c.params;
|
|
292
368
|
if (!a.shape) return;
|
|
293
|
-
const
|
|
294
|
-
return
|
|
295
|
-
|
|
296
|
-
...
|
|
297
|
-
rx:
|
|
369
|
+
const t = [], p = se(c), l = a.shape;
|
|
370
|
+
return l === "rect" || l === "circle" ? t.push(
|
|
371
|
+
E("rect", {
|
|
372
|
+
...p,
|
|
373
|
+
rx: l === "circle" ? "50%" : "10%"
|
|
298
374
|
// mask: 'url(#badgenumber)'
|
|
299
375
|
})
|
|
300
|
-
) :
|
|
301
|
-
|
|
376
|
+
) : _e(l) && t.push(
|
|
377
|
+
E("path", {
|
|
302
378
|
// 'stroke-width': 80,
|
|
303
|
-
...
|
|
379
|
+
...p,
|
|
304
380
|
x: void 0,
|
|
305
381
|
y: void 0,
|
|
306
382
|
"stroke-linejoin": "round",
|
|
307
383
|
"stroke-linecap": "round",
|
|
308
|
-
d:
|
|
384
|
+
d: q[l]
|
|
309
385
|
// !asMask ? shapes[p.shape] : scalePath(shapes[p.shape], .4),
|
|
310
386
|
})
|
|
311
|
-
),
|
|
387
|
+
), t;
|
|
312
388
|
};
|
|
313
|
-
function
|
|
314
|
-
const
|
|
389
|
+
function se(c) {
|
|
390
|
+
const l = u.viewBox.height - u.viewBox.height / 16, k = l, r = l, m = (
|
|
315
391
|
/* isChild && isMask ? measure.x : */
|
|
316
|
-
|
|
317
|
-
),
|
|
392
|
+
u.viewBox.width / 32
|
|
393
|
+
), S = (
|
|
318
394
|
/*isChild && isMask ? measure.y : */
|
|
319
|
-
|
|
320
|
-
),
|
|
321
|
-
return
|
|
322
|
-
class:
|
|
395
|
+
u.viewBox.height / 32
|
|
396
|
+
), V = [e.shape];
|
|
397
|
+
return n && V.push(...n.classes(c.params, e)), {
|
|
398
|
+
class: V,
|
|
323
399
|
// mask,
|
|
324
|
-
x:
|
|
325
|
-
y:
|
|
326
|
-
height:
|
|
327
|
-
width:
|
|
400
|
+
x: m,
|
|
401
|
+
y: S,
|
|
402
|
+
height: k,
|
|
403
|
+
width: r
|
|
328
404
|
};
|
|
329
405
|
}
|
|
330
|
-
function
|
|
406
|
+
function oe() {
|
|
331
407
|
return {
|
|
332
408
|
viewBox: {
|
|
333
409
|
width: 960,
|
|
@@ -348,93 +424,93 @@ const Me = /* @__PURE__ */ pe({
|
|
|
348
424
|
}
|
|
349
425
|
};
|
|
350
426
|
}
|
|
351
|
-
function
|
|
352
|
-
const { options: a } =
|
|
353
|
-
small:
|
|
354
|
-
normal:
|
|
355
|
-
large:
|
|
356
|
-
},
|
|
357
|
-
if (
|
|
427
|
+
function te(c) {
|
|
428
|
+
const { options: a } = c, t = 960, p = t / 4 * 3, l = (t - p) / 2, k = {
|
|
429
|
+
small: p / 4,
|
|
430
|
+
normal: p / 3,
|
|
431
|
+
large: p / 2
|
|
432
|
+
}, r = a == null ? void 0 : a.badge, m = r !== void 0 && r.scale || "normal", S = r == null ? void 0 : r.cell, V = r == null ? void 0 : r.x, y = r == null ? void 0 : r.y;
|
|
433
|
+
if (m === "full" || m === 1)
|
|
358
434
|
return {
|
|
359
435
|
x: "0",
|
|
360
436
|
y: "0",
|
|
361
|
-
width: `${
|
|
362
|
-
height: `${
|
|
437
|
+
width: `${t}px`,
|
|
438
|
+
height: `${t}px`
|
|
363
439
|
};
|
|
364
|
-
let
|
|
365
|
-
if (typeof
|
|
366
|
-
const
|
|
440
|
+
let M;
|
|
441
|
+
if (typeof m == "number" ? M = m > 0.75 ? m * t : Math.min(p, Math.round(p * m)) : M = k[m], S) {
|
|
442
|
+
const x = typeof m == "string" ? {
|
|
367
443
|
small: 4,
|
|
368
444
|
normal: 3,
|
|
369
445
|
large: 2
|
|
370
|
-
}[
|
|
446
|
+
}[m] : 3, w = p / x, [$, K] = S.split(/\s|-|,/).map(Number), N = x - 1;
|
|
371
447
|
return {
|
|
372
|
-
x: `${
|
|
373
|
-
y: `${
|
|
374
|
-
width: `${
|
|
375
|
-
height: `${
|
|
448
|
+
x: `${l + Math.min($, N) * w}`,
|
|
449
|
+
y: `${l + Math.min(K, N) * w}`,
|
|
450
|
+
width: `${M}px`,
|
|
451
|
+
height: `${M}px`
|
|
376
452
|
};
|
|
377
453
|
}
|
|
378
|
-
const
|
|
379
|
-
const
|
|
380
|
-
switch (
|
|
454
|
+
const T = (b) => {
|
|
455
|
+
const x = b === "x" ? V : y, w = p - M;
|
|
456
|
+
switch (x) {
|
|
381
457
|
case "center":
|
|
382
|
-
return
|
|
458
|
+
return l + w / 2;
|
|
383
459
|
case "end":
|
|
384
|
-
return
|
|
460
|
+
return l + w;
|
|
385
461
|
default:
|
|
386
|
-
return
|
|
462
|
+
return l;
|
|
387
463
|
}
|
|
388
464
|
};
|
|
389
465
|
return {
|
|
390
|
-
x: `${
|
|
391
|
-
y: `${
|
|
392
|
-
width: `${
|
|
393
|
-
height: `${
|
|
466
|
+
x: `${T("x")}`,
|
|
467
|
+
y: `${T("y")}`,
|
|
468
|
+
width: `${M}px`,
|
|
469
|
+
height: `${M}px`
|
|
394
470
|
};
|
|
395
471
|
}
|
|
396
|
-
return (
|
|
472
|
+
return (c, a) => (ge(), ve(D));
|
|
397
473
|
}
|
|
398
|
-
}),
|
|
399
|
-
icon:
|
|
400
|
-
canvas:
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
const e =
|
|
422
|
-
for (const [
|
|
423
|
-
e[
|
|
474
|
+
}), Oe = "ic_c2d4", Ae = "ca_a457", Le = "si_3f5b", je = "si_e681", De = "st_39f2", Ve = "sh_6010", Te = "sh_f589", ze = "la_1353", Fe = "we_0775", Ne = "fi_ff74", Re = "fi_8a2f", Ze = "la_e3b8", Ue = "ma_30e1", He = "la_9af0", Ke = "do_9bcc", Ge = "mu_2455", We = "sh_0266", Xe = "tr_07fb", Qe = "jo_5839", Ye = "ca_45e8", Je = "fl_4e44", qe = {
|
|
475
|
+
icon: Oe,
|
|
476
|
+
canvas: Ae,
|
|
477
|
+
sized: Le,
|
|
478
|
+
sizeCustom: je,
|
|
479
|
+
strokeMask: De,
|
|
480
|
+
shapeStrokeMask: Ve,
|
|
481
|
+
shape: Te,
|
|
482
|
+
layerStyle: ze,
|
|
483
|
+
weighty: Fe,
|
|
484
|
+
fillable: Ne,
|
|
485
|
+
filled: Re,
|
|
486
|
+
layers: Ze,
|
|
487
|
+
masked: Ue,
|
|
488
|
+
layersShift: He,
|
|
489
|
+
doubleColored: Ke,
|
|
490
|
+
multicolor: Ge,
|
|
491
|
+
shaped: We,
|
|
492
|
+
tripleColored: Xe,
|
|
493
|
+
join: Qe,
|
|
494
|
+
cap: Ye,
|
|
495
|
+
flip: Je
|
|
496
|
+
}, es = (o, s) => {
|
|
497
|
+
const e = o.__vccOpts || o;
|
|
498
|
+
for (const [d, n] of s)
|
|
499
|
+
e[d] = n;
|
|
424
500
|
return e;
|
|
425
|
-
},
|
|
426
|
-
$style:
|
|
427
|
-
},
|
|
428
|
-
function
|
|
429
|
-
const s =
|
|
501
|
+
}, ss = {
|
|
502
|
+
$style: qe
|
|
503
|
+
}, os = /* @__PURE__ */ es(Pe, [["__cssModules", ss]]);
|
|
504
|
+
function ts(o) {
|
|
505
|
+
const s = ae(o.replace("Icon", "")), e = s.split("-")[0];
|
|
430
506
|
return e ? e + "/" + s.replace(e + "-", "") : s.replace(e + "-", "");
|
|
431
507
|
}
|
|
432
|
-
class
|
|
508
|
+
class ns {
|
|
433
509
|
constructor() {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
510
|
+
z(this, "icons", []);
|
|
511
|
+
z(this, "vueApp");
|
|
512
|
+
z(this, "packs", {});
|
|
513
|
+
z(this, "deferred", []);
|
|
438
514
|
}
|
|
439
515
|
/**
|
|
440
516
|
* add icon pack plugin
|
|
@@ -456,9 +532,9 @@ class qe {
|
|
|
456
532
|
* @param component
|
|
457
533
|
*/
|
|
458
534
|
add(s, e) {
|
|
459
|
-
var
|
|
460
|
-
const
|
|
461
|
-
this.icons.push(
|
|
535
|
+
var n;
|
|
536
|
+
const d = ts(s);
|
|
537
|
+
this.icons.push(d), this.vueApp ? (n = this.vueApp) == null || n.component(s, e) : this.deferred.push([s, e]);
|
|
462
538
|
}
|
|
463
539
|
setVue(s) {
|
|
464
540
|
if (!s) throw new Error("app is null");
|
|
@@ -468,29 +544,29 @@ class qe {
|
|
|
468
544
|
throw new Error("vue already installed");
|
|
469
545
|
}
|
|
470
546
|
}
|
|
471
|
-
function
|
|
472
|
-
const e = new
|
|
547
|
+
function fs(o = {}, s) {
|
|
548
|
+
const e = new ns();
|
|
473
549
|
return {
|
|
474
|
-
install: (
|
|
475
|
-
if (!
|
|
476
|
-
|
|
550
|
+
install: (i) => {
|
|
551
|
+
if (!i) throw new Error("@ui0/icon can be run with vue 3 only");
|
|
552
|
+
i.provide(Y, e), o.framework && i.provide(J, o.framework), i.component("Icon", os), e.setVue(i), i.config.globalProperties.$ui0Icon = e;
|
|
477
553
|
},
|
|
478
|
-
use: (
|
|
479
|
-
e.addPack(
|
|
554
|
+
use: (i) => {
|
|
555
|
+
e.addPack(i);
|
|
480
556
|
},
|
|
481
|
-
key:
|
|
557
|
+
key: ye
|
|
482
558
|
};
|
|
483
559
|
}
|
|
484
|
-
const
|
|
485
|
-
icon:
|
|
486
|
-
canvas:
|
|
560
|
+
const cs = "ic_c2d4", is = "ca_a457", ds = {
|
|
561
|
+
icon: cs,
|
|
562
|
+
canvas: is
|
|
487
563
|
};
|
|
488
564
|
export {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
565
|
+
ds as $style,
|
|
566
|
+
os as Icon,
|
|
567
|
+
J as IconFrameworkKey,
|
|
568
|
+
fs as createIcon,
|
|
569
|
+
ps as getIcon,
|
|
570
|
+
xe as resolveIconDefaults,
|
|
571
|
+
Ie as useIconFramework
|
|
496
572
|
};
|