@ui0/icon 0.1.1 → 0.1.3
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 +0 -1
- package/dist/icon.vue.d.ts +3 -1
- package/dist/icon.vue.d.ts.map +1 -1
- package/dist/index.js +342 -279
- package/dist/interactions.vue.d.ts +10 -0
- package/dist/interactions.vue.d.ts.map +1 -0
- package/dist/modifiers.d.ts +15 -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,14 +1,14 @@
|
|
|
1
1
|
var te = Object.defineProperty;
|
|
2
|
-
var ne = (
|
|
3
|
-
var
|
|
4
|
-
import { newErrorForSetupCall as ce, isArray as
|
|
5
|
-
import { inject as
|
|
2
|
+
var ne = (o, s, e) => s in o ? te(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
|
|
3
|
+
var V = (o, s, e) => ne(o, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { newErrorForSetupCall as ce, isArray as ie, hyphenate as re } from "@ui0/util";
|
|
5
|
+
import { inject as z, getCurrentInstance as ae, h as B, resolveComponent as le, reactive as pe, onScopeDispose as ue, defineComponent as fe, useCssModule as de, useAttrs as he, openBlock as me, createBlock as ge, mergeProps as G, camelize as ve } from "vue";
|
|
6
6
|
import { useComponentId as ke } from "@ui0/composable";
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const s =
|
|
7
|
+
const we = Symbol.for("ui0-icon"), X = Symbol("ui0-icon-instance");
|
|
8
|
+
function ls() {
|
|
9
|
+
const o = z(X, void 0);
|
|
10
|
+
if (o) return o;
|
|
11
|
+
const s = ae();
|
|
12
12
|
if (!s) throw ce("getIcon");
|
|
13
13
|
return s.appContext.config.globalProperties.$ui0Icon;
|
|
14
14
|
}
|
|
@@ -32,32 +32,32 @@ const ye = {
|
|
|
32
32
|
guides: !1
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function be(o, s) {
|
|
36
36
|
const e = [
|
|
37
|
-
|
|
37
|
+
o,
|
|
38
38
|
s,
|
|
39
39
|
ye
|
|
40
|
-
],
|
|
41
|
-
for (const
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
40
|
+
], i = (n) => {
|
|
41
|
+
for (const r of e) {
|
|
42
|
+
const u = r == null ? void 0 : r[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, r) => i(r),
|
|
48
|
+
ownKeys: () => [...new Set(e.flatMap((n) => n ? Object.keys(n) : []))],
|
|
49
|
+
getOwnPropertyDescriptor: (n, r) => ({
|
|
50
50
|
enumerable: !0,
|
|
51
51
|
configurable: !0,
|
|
52
|
-
value:
|
|
52
|
+
value: i(r)
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
function
|
|
58
|
-
return
|
|
56
|
+
const Q = Symbol("ui0-icon-framework");
|
|
57
|
+
function xe() {
|
|
58
|
+
return z(Q, {});
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const Y = {
|
|
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 Ie(o) {
|
|
69
|
+
return o in Y;
|
|
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 F(o) {
|
|
75
|
+
return (s) => B("g", o, s || []);
|
|
76
76
|
}
|
|
77
|
-
class
|
|
77
|
+
class _e {
|
|
78
78
|
constructor() {
|
|
79
|
-
|
|
79
|
+
V(this, "stack", []);
|
|
80
80
|
}
|
|
81
81
|
add(s) {
|
|
82
82
|
this.stack.push(s);
|
|
@@ -85,36 +85,109 @@ class Ie {
|
|
|
85
85
|
return this.stack.reduce((s, e) => e(s), {});
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function Se(
|
|
89
|
-
const e = () =>
|
|
88
|
+
function Se(o, s) {
|
|
89
|
+
const e = () => n.params.value ? `icon-${n.params.pack}-${n.params.value}` : "icon-none", n = {
|
|
90
90
|
modifiers: [],
|
|
91
91
|
params: {},
|
|
92
92
|
getComponentName: e,
|
|
93
93
|
getComponent: () => {
|
|
94
|
-
const
|
|
95
|
-
|
|
94
|
+
const k = z(Symbol.for("ui0-icon-generated"), {})[`${n.params.pack}/${n.params.value}`];
|
|
95
|
+
if (k) return k;
|
|
96
|
+
const P = le(e());
|
|
97
|
+
return typeof P == "string" ? null : P;
|
|
96
98
|
}
|
|
97
99
|
};
|
|
98
|
-
if (!
|
|
99
|
-
const
|
|
100
|
-
return
|
|
100
|
+
if (!o) return n;
|
|
101
|
+
const r = o.includes("/") ? o : `/${o}`, [u, y = ""] = r.split("?", 2), d = u.indexOf("/"), L = u.slice(0, d), D = u.slice(d + 1), [M, ...O] = D.split(".");
|
|
102
|
+
return O.length && (n.modifiers = O.reduce((g, k) => [...g, k.replace(":", "-")], [])), y && (n.params = Object.fromEntries(y.split("&").map((g) => g.split("=", 2)))), n.params.pack = L || s.pack || "ui0", M && (n.params.value = M), n;
|
|
101
103
|
}
|
|
102
|
-
function
|
|
103
|
-
const e = Se(
|
|
104
|
-
for (const [
|
|
105
|
-
|
|
106
|
-
const
|
|
104
|
+
function H(o, s) {
|
|
105
|
+
const e = Se(o, s);
|
|
106
|
+
for (const [n, r] of Object.entries(s))
|
|
107
|
+
r !== void 0 && n !== "value" && e.params[n] === void 0 && (e.params[n] = r);
|
|
108
|
+
const i = {
|
|
107
109
|
...s,
|
|
108
110
|
...e.params
|
|
109
111
|
};
|
|
110
112
|
return {
|
|
111
113
|
...e,
|
|
112
|
-
params:
|
|
114
|
+
params: i
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
|
-
|
|
117
|
+
function Be(o) {
|
|
118
|
+
return Array.isArray(o) ? o.filter((s) => typeof s == "string" && s.length > 0) : typeof o == "string" ? o.split(/[\s,]+/).filter(Boolean) : [];
|
|
119
|
+
}
|
|
120
|
+
function Me(o, s) {
|
|
121
|
+
const e = /* @__PURE__ */ new Set();
|
|
122
|
+
for (const i of o) {
|
|
123
|
+
const n = i.match(/^(.+?)(?::|-)(hover|active|focus)$/);
|
|
124
|
+
n ? s[n[2]] && e.add(n[1]) : e.add(i);
|
|
125
|
+
}
|
|
126
|
+
return [...e];
|
|
127
|
+
}
|
|
128
|
+
function $e(o, s) {
|
|
129
|
+
const e = { hover: o.matches(":hover"), active: o.matches(":active"), focus: o.matches(":focus-within") }, i = o.closest("button, input, a"), n = {
|
|
130
|
+
hover: (i == null ? void 0 : i.matches(":hover")) ?? !1,
|
|
131
|
+
active: (i == null ? void 0 : i.matches(":active")) ?? !1,
|
|
132
|
+
focus: (i == null ? void 0 : i.matches(":focus-within")) ?? !1
|
|
133
|
+
}, r = () => s({ hover: e.hover || n.hover, active: e.active || n.active, focus: e.focus || n.focus });
|
|
134
|
+
let u = () => {
|
|
135
|
+
};
|
|
136
|
+
const y = () => {
|
|
137
|
+
e.active = n.active = !1, u(), u = () => {
|
|
138
|
+
}, r();
|
|
139
|
+
}, d = o.ownerDocument.defaultView, L = (g, k) => {
|
|
140
|
+
if (g.type === "pointerdown" && g.button !== 0 || g.type === "keydown" && ![" ", "Enter"].includes(g.key) || (y(), k.active = !0, r(), !d)) return;
|
|
141
|
+
const P = (m) => {
|
|
142
|
+
(m.type !== "keyup" || [" ", "Enter"].includes(m.key)) && y();
|
|
143
|
+
};
|
|
144
|
+
for (const m of ["pointerup", "pointercancel", "keyup", "blur"]) d.addEventListener(m, P);
|
|
145
|
+
u = () => {
|
|
146
|
+
for (const m of ["pointerup", "pointercancel", "keyup", "blur"]) d.removeEventListener(m, P);
|
|
147
|
+
};
|
|
148
|
+
}, D = (g, k) => {
|
|
149
|
+
const P = {
|
|
150
|
+
pointerenter: () => {
|
|
151
|
+
k.hover = !0, r();
|
|
152
|
+
},
|
|
153
|
+
pointerleave: () => {
|
|
154
|
+
k.hover = !1, r();
|
|
155
|
+
},
|
|
156
|
+
pointerdown: (m) => L(m, k),
|
|
157
|
+
keydown: (m) => L(m, k),
|
|
158
|
+
focusin: () => {
|
|
159
|
+
k.focus = !0, r();
|
|
160
|
+
},
|
|
161
|
+
focusout: (m) => {
|
|
162
|
+
const E = m.relatedTarget;
|
|
163
|
+
k.focus = E !== null && g.contains(E), r();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
for (const [m, E] of Object.entries(P)) g.addEventListener(m, E);
|
|
167
|
+
return () => {
|
|
168
|
+
for (const [m, E] of Object.entries(P)) g.removeEventListener(m, E);
|
|
169
|
+
};
|
|
170
|
+
}, M = D(o, e), O = i && i !== o ? D(i, n) : () => {
|
|
171
|
+
};
|
|
172
|
+
return r(), () => {
|
|
173
|
+
M(), O(), u();
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function Ce() {
|
|
177
|
+
const o = pe({ hover: !1, active: !1, focus: !1 });
|
|
178
|
+
let s = null, e = () => {
|
|
179
|
+
};
|
|
180
|
+
const i = (n) => {
|
|
181
|
+
const r = n instanceof Element ? n : null;
|
|
182
|
+
r !== s && (e(), s = r, Object.assign(o, { hover: !1, active: !1, focus: !1 }), e = r ? $e(r, (u) => Object.assign(o, u)) : () => {
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
return ue(() => i(null)), { state: o, elementRef: i };
|
|
186
|
+
}
|
|
187
|
+
const Pe = /* @__PURE__ */ fe({
|
|
116
188
|
__name: "icon",
|
|
117
189
|
props: {
|
|
190
|
+
filled: { type: Boolean, default: void 0 },
|
|
118
191
|
badge: {},
|
|
119
192
|
display: {},
|
|
120
193
|
shape: {},
|
|
@@ -134,200 +207,191 @@ const Me = /* @__PURE__ */ pe({
|
|
|
134
207
|
height: {},
|
|
135
208
|
color: {}
|
|
136
209
|
},
|
|
137
|
-
setup(
|
|
138
|
-
var
|
|
139
|
-
const s =
|
|
140
|
-
badge:
|
|
141
|
-
radial:
|
|
142
|
-
shape:
|
|
143
|
-
shapeBadge:
|
|
144
|
-
strokeMask:
|
|
145
|
-
shapeStrokeMask:
|
|
146
|
-
icon:
|
|
147
|
-
iconMask:
|
|
148
|
-
},
|
|
149
|
-
...
|
|
210
|
+
setup(o) {
|
|
211
|
+
var Z, U;
|
|
212
|
+
const s = o, e = de(), i = xe(), n = (Z = i.useTheme) == null ? void 0 : Z.call(i, s, e), r = be(s, (U = i.useDefaults) == null ? void 0 : U.call(i)), u = se(), [, y] = ke("icon"), d = {
|
|
213
|
+
badge: y("badge"),
|
|
214
|
+
radial: y("radial"),
|
|
215
|
+
shape: y("shape"),
|
|
216
|
+
shapeBadge: y("shape-badge"),
|
|
217
|
+
strokeMask: y("stroke-mask"),
|
|
218
|
+
shapeStrokeMask: y("shape-stroke-mask"),
|
|
219
|
+
icon: y("icon"),
|
|
220
|
+
iconMask: y("mask-icon")
|
|
221
|
+
}, L = B("rect", {
|
|
222
|
+
...u.viewBox,
|
|
150
223
|
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}`);
|
|
224
|
+
}), M = {
|
|
225
|
+
...oe(s),
|
|
226
|
+
viewBox: u.getViewBox()
|
|
227
|
+
}, O = Ce(), g = he();
|
|
228
|
+
function k(c) {
|
|
229
|
+
const p = [], t = Object.keys(c), f = ["size", "color", "value", "fill", "weight"];
|
|
230
|
+
for (let l = 0; l < t.length; l++) {
|
|
231
|
+
const v = c[t[l]];
|
|
232
|
+
f.includes(t[l]) && v !== void 0 && ["string", "number", "boolean"].includes(typeof v) && p.push(`icon-${t[l]}-${v}`);
|
|
163
233
|
}
|
|
164
|
-
return
|
|
234
|
+
return p;
|
|
165
235
|
}
|
|
166
|
-
const
|
|
167
|
-
const { value:
|
|
168
|
-
if (!
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
236
|
+
const P = () => {
|
|
237
|
+
const { value: c } = s;
|
|
238
|
+
if (!c) return null;
|
|
239
|
+
const p = H(ie(c) ? c[0] : c, r), t = [e.icon];
|
|
240
|
+
n ? t.push(...n.classes(p.params)) : t.push(...k(p.params));
|
|
241
|
+
const f = { class: t, ref: O.elementRef };
|
|
242
|
+
if (p.params.value === "fake")
|
|
243
|
+
return B("i", G(g, f));
|
|
244
|
+
const l = E(p);
|
|
245
|
+
return l ? B("i", G(g, f), l) : null;
|
|
246
|
+
}, m = (c, p) => B("symbol", p, c), E = (c) => {
|
|
247
|
+
const p = N(c);
|
|
248
|
+
if (!p) return null;
|
|
249
|
+
const t = c.params, f = t.color && t.color.length === 2, l = t.color && t.color.length > 2, v = (f || l) && t.rendering && t.rendering === "multicolor", a = [e.canvas];
|
|
250
|
+
n && a.push(...n.classes(t, e));
|
|
251
|
+
const h = [], _ = [], A = {
|
|
252
|
+
viewBox: u.getViewBox(),
|
|
253
|
+
class: a
|
|
182
254
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
c && d.push(...c.classes(o, e));
|
|
192
|
-
const u = [], _ = [], M = {
|
|
193
|
-
viewBox: m.getViewBox(),
|
|
194
|
-
class: d
|
|
255
|
+
f && a.push(e.doubleColored), l && a.push(e.tripleColored);
|
|
256
|
+
let b = {};
|
|
257
|
+
const $ = /* @__PURE__ */ new Map(), j = (x, I, w) => {
|
|
258
|
+
const C = I.getComponent();
|
|
259
|
+
W(C) && (Array.from(C.customOptions.modifiers).length > 0 || C.customOptions.flags.some((T) => ["animation", "animate"].includes(T))) ? $.set(x, () => N(I)) : h.push(m(w, { id: x, viewBox: u.getViewBox() }));
|
|
260
|
+
}, S = (x, I = {}, w = {}) => {
|
|
261
|
+
const C = $.get(x);
|
|
262
|
+
return J(x, I, w, C);
|
|
195
263
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const g = Z(o.badge, {});
|
|
205
|
-
y = g.params;
|
|
206
|
-
const S = V(g);
|
|
207
|
-
if (S) {
|
|
208
|
-
const B = T(S, {
|
|
209
|
-
id: h.badge,
|
|
210
|
-
viewBox: m.getViewBox()
|
|
211
|
-
});
|
|
212
|
-
u.push(B), !o.shape && !y.shape && u.push(x(h.badge, y, w));
|
|
213
|
-
const I = x(h.badge, y, {
|
|
214
|
-
...w,
|
|
264
|
+
if (j(d.icon, c, p), t.badge && typeof t.badge == "string") {
|
|
265
|
+
const x = H(t.badge, {});
|
|
266
|
+
b = x.params;
|
|
267
|
+
const I = N(x);
|
|
268
|
+
if (I) {
|
|
269
|
+
j(d.badge, x, I), !t.shape && !b.shape && h.push(S(d.badge, b, M));
|
|
270
|
+
const w = S(d.badge, b, {
|
|
271
|
+
...M,
|
|
215
272
|
class: [e.strokeMask, e.masked]
|
|
216
273
|
});
|
|
217
|
-
_.push(
|
|
274
|
+
_.push(R(d.strokeMask, [w]));
|
|
218
275
|
}
|
|
219
276
|
}
|
|
220
|
-
if ((!
|
|
221
|
-
const
|
|
222
|
-
mask:
|
|
277
|
+
if ((!t.shape || v) && h.push(S(d.icon, t, { mask: d.strokeMask })), t.shape) {
|
|
278
|
+
const x = S(d.icon, t, {
|
|
279
|
+
mask: d.strokeMask,
|
|
223
280
|
class: e.masked
|
|
224
|
-
}),
|
|
225
|
-
...
|
|
281
|
+
}), I = S(d.badge, b, {
|
|
282
|
+
...M,
|
|
226
283
|
class: e.masked
|
|
227
284
|
});
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
...
|
|
233
|
-
viewBox:
|
|
285
|
+
b.shape && h.push(S(d.shape, {}, { mask: d.badge, ...M }));
|
|
286
|
+
const w = [x];
|
|
287
|
+
if (t.badge && w.push(I), b.shape) {
|
|
288
|
+
const C = {
|
|
289
|
+
...M,
|
|
290
|
+
viewBox: u.getViewBox()
|
|
234
291
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
292
|
+
w.push(
|
|
293
|
+
S(
|
|
294
|
+
d.shape,
|
|
238
295
|
{},
|
|
239
296
|
{
|
|
240
|
-
...
|
|
297
|
+
...C,
|
|
241
298
|
class: [e.strokeMask, e.shapeStrokeMask, e.masked]
|
|
242
299
|
}
|
|
243
300
|
)
|
|
244
301
|
);
|
|
245
302
|
}
|
|
246
|
-
if (_.push(
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
id:
|
|
251
|
-
viewBox:
|
|
303
|
+
if (_.push(R(d.iconMask, w)), t.shape || b.shape) {
|
|
304
|
+
const C = q(c);
|
|
305
|
+
C && h.push(
|
|
306
|
+
m(C, {
|
|
307
|
+
id: d.shape,
|
|
308
|
+
viewBox: u.getViewBox()
|
|
252
309
|
})
|
|
253
|
-
),
|
|
310
|
+
), h.push(S(d.shape, {}, v ? { mask: d.iconMask } : { mask: d.iconMask }));
|
|
254
311
|
}
|
|
255
|
-
|
|
312
|
+
t.badge && h.push(S(d.badge, b, v ? M : { ...M }));
|
|
256
313
|
}
|
|
257
|
-
return _.length &&
|
|
258
|
-
},
|
|
259
|
-
const
|
|
260
|
-
if (!
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
314
|
+
return _.length && h.unshift(B("defs", _)), B("svg", A, h);
|
|
315
|
+
}, N = (c) => {
|
|
316
|
+
const p = c.getComponent();
|
|
317
|
+
if (!W(p)) return null;
|
|
318
|
+
const t = new _e(), f = p.customOptions, l = Me(
|
|
319
|
+
[...c.modifiers, ...Be(c.params.modifiers)],
|
|
320
|
+
O.state
|
|
321
|
+
), v = {
|
|
322
|
+
fit: c.params.fit ?? "default",
|
|
323
|
+
progress: c.params.progress ?? 100,
|
|
324
|
+
rendering: c.params.rendering,
|
|
325
|
+
modifiers: l
|
|
326
|
+
}, a = [e.layerStyle], h = {
|
|
327
|
+
class: a,
|
|
268
328
|
style: "--0-icon-weight: 800;"
|
|
269
329
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
330
|
+
f.flags.includes("no-fill") || a.push(e.fillable), !f.flags.includes("no-stroke") && !f.flags.includes("no-process-stroke") && a.push(e.weighty), f.flags.includes("no-cap") || a.push(e.cap), f.flags.includes("no-join") || a.push(e.join), c.params.shape && a.push(e.shaped);
|
|
331
|
+
const _ = c.params.filled;
|
|
332
|
+
(_ !== void 0 ? _ === !0 || _ === "true" : l.some((S) => S === "fill" || S === "filled")) && a.push(e.filled), c.params.rendering && a.push(e[ve(c.params.rendering)]), t.add(() => B(p, v)), t.add(F(h)), c.params.animation && t.add(F({})), (c.params.flipped || l.includes("flip")) && t.add(F({ class: e.flip }));
|
|
333
|
+
const b = Number(c.params.rotate ?? 0), $ = u.viewBox.x + u.viewBox.width / 2, j = u.viewBox.y + u.viewBox.height / 2;
|
|
334
|
+
return t.add(
|
|
335
|
+
F({
|
|
336
|
+
"data-icon-rotate": "",
|
|
337
|
+
transform: `rotate(${Number.isFinite(b) ? b : 0} ${$} ${j})`
|
|
274
338
|
})
|
|
275
|
-
),
|
|
276
|
-
},
|
|
277
|
-
let
|
|
278
|
-
"--0-icon-weight": +(
|
|
279
|
-
"--0-icon-progress":
|
|
339
|
+
), t.render();
|
|
340
|
+
}, J = (c, p = {}, t = {}, f) => {
|
|
341
|
+
let l = {
|
|
342
|
+
"--0-icon-weight": +(p.weight ?? 400) / 100 * u.getStrokeUnit(),
|
|
343
|
+
"--0-icon-progress": p.progress ?? 100
|
|
280
344
|
};
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
href: `#${
|
|
285
|
-
style:
|
|
286
|
-
...
|
|
287
|
-
class:
|
|
345
|
+
const v = Array.isArray(t.class) ? t.class : [t.class];
|
|
346
|
+
n && (l = { ...l, ...n.styles(p) }, v.push(...n.classes(p, e)));
|
|
347
|
+
const a = {
|
|
348
|
+
href: `#${c}`,
|
|
349
|
+
style: l,
|
|
350
|
+
...t,
|
|
351
|
+
class: v
|
|
288
352
|
};
|
|
289
|
-
return
|
|
290
|
-
},
|
|
291
|
-
const
|
|
292
|
-
if (!
|
|
293
|
-
const
|
|
294
|
-
return
|
|
295
|
-
|
|
296
|
-
...
|
|
297
|
-
rx:
|
|
353
|
+
return t.mask && (a.mask = `url(#${t.mask})`), f ? (delete a.href, a.viewBox ?? (a.viewBox = u.getViewBox()), a["data-icon-inline"] = "", B("svg", a, [f()])) : B("use", a);
|
|
354
|
+
}, R = (c, p = []) => B("mask", { id: c }, [L, ...p]), q = (c) => {
|
|
355
|
+
const p = c.params;
|
|
356
|
+
if (!p.shape) return;
|
|
357
|
+
const t = [], f = ee(c), l = p.shape;
|
|
358
|
+
return l === "rect" || l === "circle" ? t.push(
|
|
359
|
+
B("rect", {
|
|
360
|
+
...f,
|
|
361
|
+
rx: l === "circle" ? "50%" : "10%"
|
|
298
362
|
// mask: 'url(#badgenumber)'
|
|
299
363
|
})
|
|
300
|
-
) :
|
|
301
|
-
|
|
364
|
+
) : Ie(l) && t.push(
|
|
365
|
+
B("path", {
|
|
302
366
|
// 'stroke-width': 80,
|
|
303
|
-
...
|
|
367
|
+
...f,
|
|
304
368
|
x: void 0,
|
|
305
369
|
y: void 0,
|
|
306
370
|
"stroke-linejoin": "round",
|
|
307
371
|
"stroke-linecap": "round",
|
|
308
|
-
d:
|
|
372
|
+
d: Y[l]
|
|
309
373
|
// !asMask ? shapes[p.shape] : scalePath(shapes[p.shape], .4),
|
|
310
374
|
})
|
|
311
|
-
),
|
|
375
|
+
), t;
|
|
312
376
|
};
|
|
313
|
-
function
|
|
314
|
-
const
|
|
377
|
+
function ee(c) {
|
|
378
|
+
const l = u.viewBox.height - u.viewBox.height / 16, v = l, a = l, h = (
|
|
315
379
|
/* isChild && isMask ? measure.x : */
|
|
316
|
-
|
|
380
|
+
u.viewBox.width / 32
|
|
317
381
|
), _ = (
|
|
318
382
|
/*isChild && isMask ? measure.y : */
|
|
319
|
-
|
|
320
|
-
),
|
|
321
|
-
return
|
|
322
|
-
class:
|
|
383
|
+
u.viewBox.height / 32
|
|
384
|
+
), A = [e.shape];
|
|
385
|
+
return n && A.push(...n.classes(c.params, e)), {
|
|
386
|
+
class: A,
|
|
323
387
|
// mask,
|
|
324
|
-
x:
|
|
388
|
+
x: h,
|
|
325
389
|
y: _,
|
|
326
|
-
height:
|
|
327
|
-
width:
|
|
390
|
+
height: v,
|
|
391
|
+
width: a
|
|
328
392
|
};
|
|
329
393
|
}
|
|
330
|
-
function
|
|
394
|
+
function se() {
|
|
331
395
|
return {
|
|
332
396
|
viewBox: {
|
|
333
397
|
width: 960,
|
|
@@ -348,93 +412,92 @@ const Me = /* @__PURE__ */ pe({
|
|
|
348
412
|
}
|
|
349
413
|
};
|
|
350
414
|
}
|
|
351
|
-
function
|
|
352
|
-
const { options:
|
|
353
|
-
small:
|
|
354
|
-
normal:
|
|
355
|
-
large:
|
|
356
|
-
},
|
|
357
|
-
if (
|
|
415
|
+
function oe(c) {
|
|
416
|
+
const { options: p } = c, t = 960, f = t / 4 * 3, l = (t - f) / 2, v = {
|
|
417
|
+
small: f / 4,
|
|
418
|
+
normal: f / 3,
|
|
419
|
+
large: f / 2
|
|
420
|
+
}, a = p == null ? void 0 : p.badge, h = a !== void 0 && a.scale || "normal", _ = a == null ? void 0 : a.cell, A = a == null ? void 0 : a.x, b = a == null ? void 0 : a.y;
|
|
421
|
+
if (h === "full" || h === 1)
|
|
358
422
|
return {
|
|
359
423
|
x: "0",
|
|
360
424
|
y: "0",
|
|
361
|
-
width: `${
|
|
362
|
-
height: `${
|
|
425
|
+
width: `${t}px`,
|
|
426
|
+
height: `${t}px`
|
|
363
427
|
};
|
|
364
|
-
let
|
|
365
|
-
if (typeof
|
|
366
|
-
const
|
|
428
|
+
let $;
|
|
429
|
+
if (typeof h == "number" ? $ = h > 0.75 ? h * t : Math.min(f, Math.round(f * h)) : $ = v[h], _) {
|
|
430
|
+
const I = typeof h == "string" ? {
|
|
367
431
|
small: 4,
|
|
368
432
|
normal: 3,
|
|
369
433
|
large: 2
|
|
370
|
-
}[
|
|
434
|
+
}[h] : 3, w = f / I, [C, K] = _.split(/\s|-|,/).map(Number), T = I - 1;
|
|
371
435
|
return {
|
|
372
|
-
x: `${
|
|
373
|
-
y: `${
|
|
374
|
-
width: `${
|
|
375
|
-
height: `${
|
|
436
|
+
x: `${l + Math.min(C, T) * w}`,
|
|
437
|
+
y: `${l + Math.min(K, T) * w}`,
|
|
438
|
+
width: `${$}px`,
|
|
439
|
+
height: `${$}px`
|
|
376
440
|
};
|
|
377
441
|
}
|
|
378
|
-
const
|
|
379
|
-
const
|
|
380
|
-
switch (
|
|
442
|
+
const j = (x) => {
|
|
443
|
+
const I = x === "x" ? A : b, w = f - $;
|
|
444
|
+
switch (I) {
|
|
381
445
|
case "center":
|
|
382
|
-
return
|
|
446
|
+
return l + w / 2;
|
|
383
447
|
case "end":
|
|
384
|
-
return
|
|
448
|
+
return l + w;
|
|
385
449
|
default:
|
|
386
|
-
return
|
|
450
|
+
return l;
|
|
387
451
|
}
|
|
388
452
|
};
|
|
389
453
|
return {
|
|
390
|
-
x: `${
|
|
391
|
-
y: `${
|
|
392
|
-
width: `${
|
|
393
|
-
height: `${
|
|
454
|
+
x: `${j("x")}`,
|
|
455
|
+
y: `${j("y")}`,
|
|
456
|
+
width: `${$}px`,
|
|
457
|
+
height: `${$}px`
|
|
394
458
|
};
|
|
395
459
|
}
|
|
396
|
-
return (
|
|
460
|
+
return (c, p) => (me(), ge(P));
|
|
397
461
|
}
|
|
398
|
-
}),
|
|
399
|
-
icon:
|
|
400
|
-
canvas:
|
|
401
|
-
sizeCustom:
|
|
402
|
-
strokeMask:
|
|
403
|
-
shapeStrokeMask:
|
|
404
|
-
shape:
|
|
405
|
-
layerStyle:
|
|
406
|
-
weighty:
|
|
407
|
-
fillable:
|
|
408
|
-
filled:
|
|
409
|
-
layers:
|
|
410
|
-
masked:
|
|
411
|
-
layersShift:
|
|
412
|
-
doubleColored:
|
|
413
|
-
multicolor:
|
|
414
|
-
shaped:
|
|
415
|
-
tripleColored:
|
|
416
|
-
join:
|
|
417
|
-
cap:
|
|
418
|
-
flip:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
e[f] = c;
|
|
462
|
+
}), Ee = "ic_c2d4", Oe = "ca_a457", Ae = "si_e681", je = "st_39f2", Le = "sh_6010", Ve = "sh_f589", De = "la_1353", Te = "we_0775", Fe = "fi_ff74", Ne = "fi_8a2f", ze = "la_e3b8", Re = "ma_30e1", Ze = "la_9af0", Ue = "do_9bcc", Ke = "mu_2455", Ge = "sh_0266", We = "tr_07fb", He = "jo_5839", Xe = "ca_45e8", Qe = "fl_4e44", Ye = {
|
|
463
|
+
icon: Ee,
|
|
464
|
+
canvas: Oe,
|
|
465
|
+
sizeCustom: Ae,
|
|
466
|
+
strokeMask: je,
|
|
467
|
+
shapeStrokeMask: Le,
|
|
468
|
+
shape: Ve,
|
|
469
|
+
layerStyle: De,
|
|
470
|
+
weighty: Te,
|
|
471
|
+
fillable: Fe,
|
|
472
|
+
filled: Ne,
|
|
473
|
+
layers: ze,
|
|
474
|
+
masked: Re,
|
|
475
|
+
layersShift: Ze,
|
|
476
|
+
doubleColored: Ue,
|
|
477
|
+
multicolor: Ke,
|
|
478
|
+
shaped: Ge,
|
|
479
|
+
tripleColored: We,
|
|
480
|
+
join: He,
|
|
481
|
+
cap: Xe,
|
|
482
|
+
flip: Qe
|
|
483
|
+
}, Je = (o, s) => {
|
|
484
|
+
const e = o.__vccOpts || o;
|
|
485
|
+
for (const [i, n] of s)
|
|
486
|
+
e[i] = n;
|
|
424
487
|
return e;
|
|
425
|
-
},
|
|
426
|
-
$style:
|
|
427
|
-
},
|
|
428
|
-
function
|
|
429
|
-
const s =
|
|
488
|
+
}, qe = {
|
|
489
|
+
$style: Ye
|
|
490
|
+
}, es = /* @__PURE__ */ Je(Pe, [["__cssModules", qe]]);
|
|
491
|
+
function ss(o) {
|
|
492
|
+
const s = re(o.replace("Icon", "")), e = s.split("-")[0];
|
|
430
493
|
return e ? e + "/" + s.replace(e + "-", "") : s.replace(e + "-", "");
|
|
431
494
|
}
|
|
432
|
-
class
|
|
495
|
+
class os {
|
|
433
496
|
constructor() {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
497
|
+
V(this, "icons", []);
|
|
498
|
+
V(this, "vueApp");
|
|
499
|
+
V(this, "packs", {});
|
|
500
|
+
V(this, "deferred", []);
|
|
438
501
|
}
|
|
439
502
|
/**
|
|
440
503
|
* add icon pack plugin
|
|
@@ -456,9 +519,9 @@ class qe {
|
|
|
456
519
|
* @param component
|
|
457
520
|
*/
|
|
458
521
|
add(s, e) {
|
|
459
|
-
var
|
|
460
|
-
const
|
|
461
|
-
this.icons.push(
|
|
522
|
+
var n;
|
|
523
|
+
const i = ss(s);
|
|
524
|
+
this.icons.push(i), this.vueApp ? (n = this.vueApp) == null || n.component(s, e) : this.deferred.push([s, e]);
|
|
462
525
|
}
|
|
463
526
|
setVue(s) {
|
|
464
527
|
if (!s) throw new Error("app is null");
|
|
@@ -468,29 +531,29 @@ class qe {
|
|
|
468
531
|
throw new Error("vue already installed");
|
|
469
532
|
}
|
|
470
533
|
}
|
|
471
|
-
function
|
|
472
|
-
const e = new
|
|
534
|
+
function ps(o = {}, s) {
|
|
535
|
+
const e = new os();
|
|
473
536
|
return {
|
|
474
|
-
install: (
|
|
475
|
-
if (!
|
|
476
|
-
|
|
537
|
+
install: (r) => {
|
|
538
|
+
if (!r) throw new Error("@ui0/icon can be run with vue 3 only");
|
|
539
|
+
r.provide(X, e), o.framework && r.provide(Q, o.framework), r.component("Icon", es), e.setVue(r), r.config.globalProperties.$ui0Icon = e;
|
|
477
540
|
},
|
|
478
|
-
use: (
|
|
479
|
-
e.addPack(
|
|
541
|
+
use: (r) => {
|
|
542
|
+
e.addPack(r);
|
|
480
543
|
},
|
|
481
|
-
key:
|
|
544
|
+
key: we
|
|
482
545
|
};
|
|
483
546
|
}
|
|
484
|
-
const
|
|
485
|
-
icon:
|
|
486
|
-
canvas:
|
|
547
|
+
const ts = "ic_c2d4", ns = "ca_a457", us = {
|
|
548
|
+
icon: ts,
|
|
549
|
+
canvas: ns
|
|
487
550
|
};
|
|
488
551
|
export {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
552
|
+
us as $style,
|
|
553
|
+
es as Icon,
|
|
554
|
+
Q as IconFrameworkKey,
|
|
555
|
+
ps as createIcon,
|
|
556
|
+
ls as getIcon,
|
|
557
|
+
be as resolveIconDefaults,
|
|
558
|
+
xe as useIconFramework
|
|
496
559
|
};
|