vlite3 1.5.5 → 1.5.6
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 +34 -0
- package/VLiteIconsVite.d.ts +36 -0
- package/components/AppShell/AppShell.vue.d.ts +1 -1
- package/components/AppShell/AppShellLayoutDashboard.vue.js +3 -2
- package/components/AppShell/AppShellLayoutDock.vue.js +3 -2
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +28 -27
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +3 -2
- package/components/AsyncSelect/createAsyncSelect.d.ts +4 -4
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/BackButton.vue.d.ts +1 -1
- package/components/CategoryManager/CategoryManager.vue2.js +16 -16
- package/components/CategoryManager/CategoryNode.vue.js +16 -16
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -8
- package/components/Chart/BarChart.vue.d.ts +1 -1
- package/components/Chart/GanttChart.vue.d.ts +1 -1
- package/components/Chart/LineChart.vue.d.ts +1 -1
- package/components/Chart/TimelineChart.vue.d.ts +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/ConfirmationModal.vue.d.ts +4 -0
- package/components/ConfirmationModal.vue.js +47 -39
- package/components/DataTable/DataTable.vue.js +319 -294
- package/components/DataTable/DataTableRow.vue.d.ts +2 -0
- package/components/DataTable/DataTableRow.vue.js +2 -2
- package/components/DataTable/DataTableRow.vue2.js +57 -54
- package/components/DataTable/types.d.ts +2 -0
- package/components/DatePicker.vue.js +5 -4
- package/components/Empty/Empty.vue.js +3 -2
- package/components/ExportData/ExportData.vue.d.ts +1 -1
- package/components/Form/Form.vue2.js +44 -43
- package/components/Form/FormField.vue.js +24 -24
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/Icon.vue.d.ts +3 -2
- package/components/Icon.vue.js +22 -12
- package/components/IconPicker.vue.js +5 -133
- package/components/IconPicker.vue2.js +218 -2
- package/components/ImportData/ImportData.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/Kanban/KanbanBoard.vue2.js +4 -2
- package/components/List/utils.js +5 -4
- package/components/Masonry/Masonry.vue2.js +14 -13
- package/components/Navbar/Navbar.vue.d.ts +1 -1
- package/components/Price/Price.vue.js +13 -12
- package/components/Rating/Rating.vue.js +2 -2
- package/components/Rating/Rating.vue2.js +41 -41
- package/components/Rating/ReviewSummary.vue.js +20 -20
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +7 -5
- package/components/Screen/components/ScreenExportModal.vue.d.ts +2 -2
- package/components/Stats/StatItem.vue.js +3 -2
- package/components/StatusChip/StatusChip.vue.js +6 -5
- package/components/Workbook/Sheet.vue.js +11 -11
- package/core/config.d.ts +28 -0
- package/core/config.js +23 -21
- package/core/index.js +18 -17
- package/icons/IconRegistry.d.ts +38 -0
- package/icons/IconRegistry.js +166 -0
- package/icons/IconTypes.d.ts +37 -0
- package/index.d.ts +2 -0
- package/index.js +473 -457
- package/package.json +15 -3
- package/style.css +1 -1
- package/types/config.type.d.ts +8 -1
- package/utils/functions.js +44 -43
- package/utils/index.d.ts +1 -0
- package/vite.d.ts +6 -0
- package/vite.js +223 -0
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextLinkPopover.vue2.js → RichTextLinkPopover.vue.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue2.js → RichTextToolbar.vue.js} +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { reactive as m } from "vue";
|
|
2
|
+
import { addIcon as h, getIcon as I, addCollection as b, buildIcon as k } from "@iconify/vue";
|
|
3
|
+
const l = {
|
|
4
|
+
mode: "online",
|
|
5
|
+
fallback: null,
|
|
6
|
+
warnOnMissing: !1
|
|
7
|
+
}, a = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), o = m({
|
|
8
|
+
...l,
|
|
9
|
+
revision: 0
|
|
10
|
+
}), O = /^(?:@[a-z0-9]+(?:-[a-z0-9]+)*:)?[a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
11
|
+
function s(e) {
|
|
12
|
+
return e.trim().toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
function y(e, r) {
|
|
15
|
+
return `${e.provider ? `@${e.provider}:` : ""}${e.prefix}:${r}`;
|
|
16
|
+
}
|
|
17
|
+
function $(e) {
|
|
18
|
+
const r = [
|
|
19
|
+
...Object.keys(e.icons).map(
|
|
20
|
+
(i) => `${i}:${JSON.stringify(e.icons[i])}`
|
|
21
|
+
),
|
|
22
|
+
...Object.keys(e.aliases ?? {}).map(
|
|
23
|
+
(i) => `${i}:${JSON.stringify(e.aliases?.[i])}`
|
|
24
|
+
)
|
|
25
|
+
].sort();
|
|
26
|
+
let n = 2166136261;
|
|
27
|
+
for (const i of r)
|
|
28
|
+
for (let t = 0; t < i.length; t += 1)
|
|
29
|
+
n ^= i.charCodeAt(t), n = Math.imul(n, 16777619);
|
|
30
|
+
return [
|
|
31
|
+
e.provider ?? "",
|
|
32
|
+
e.prefix,
|
|
33
|
+
e.lastModified ?? "",
|
|
34
|
+
r.length,
|
|
35
|
+
(n >>> 0).toString(16)
|
|
36
|
+
].join("::");
|
|
37
|
+
}
|
|
38
|
+
function C(e) {
|
|
39
|
+
return e ? Array.isArray(e) ? [...e] : Object.entries(e).map(([r, n]) => ({ name: r, data: n })) : [];
|
|
40
|
+
}
|
|
41
|
+
function p() {
|
|
42
|
+
o.revision += 1;
|
|
43
|
+
}
|
|
44
|
+
function L(e) {
|
|
45
|
+
return O.test(s(e));
|
|
46
|
+
}
|
|
47
|
+
function x(e, r) {
|
|
48
|
+
const n = s(e);
|
|
49
|
+
if (!L(n))
|
|
50
|
+
throw new Error(`[vlite3] Invalid Iconify icon identifier "${e}".`);
|
|
51
|
+
if (a.has(n)) return !1;
|
|
52
|
+
if (!h(n, r))
|
|
53
|
+
throw new Error(`[vlite3] Could not register icon "${n}".`);
|
|
54
|
+
const i = I(n);
|
|
55
|
+
if (!i)
|
|
56
|
+
throw new Error(`[vlite3] Icon "${n}" was not available after registration.`);
|
|
57
|
+
return a.set(n, i), f.delete(n), p(), !0;
|
|
58
|
+
}
|
|
59
|
+
function N(e) {
|
|
60
|
+
if (!e?.prefix || !e.icons)
|
|
61
|
+
throw new Error("[vlite3] Icon collections require a prefix and icons map.");
|
|
62
|
+
const r = $(e), n = [...Object.keys(e.icons), ...Object.keys(e.aliases ?? {})];
|
|
63
|
+
if (g.has(r))
|
|
64
|
+
return { added: 0, skipped: n.length };
|
|
65
|
+
if (!b(e, e.provider))
|
|
66
|
+
throw new Error(`[vlite3] Could not register the "${e.prefix}" icon collection.`);
|
|
67
|
+
let i = 0, t = 0;
|
|
68
|
+
for (const c of n.sort()) {
|
|
69
|
+
const d = s(y(e, c));
|
|
70
|
+
if (a.has(d)) {
|
|
71
|
+
t += 1;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const v = I(d);
|
|
75
|
+
if (!v) {
|
|
76
|
+
t += 1;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
a.set(d, v), f.delete(d), i += 1;
|
|
80
|
+
}
|
|
81
|
+
return g.add(r), i > 0 && p(), { added: i, skipped: t };
|
|
82
|
+
}
|
|
83
|
+
function z(e) {
|
|
84
|
+
return (Array.isArray(e) ? e : [e]).reduce(
|
|
85
|
+
(n, i) => {
|
|
86
|
+
const t = N(i);
|
|
87
|
+
return n.added += t.added, n.skipped += t.skipped, n;
|
|
88
|
+
},
|
|
89
|
+
{ added: 0, skipped: 0 }
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function M(e) {
|
|
93
|
+
const r = { added: 0, skipped: 0 };
|
|
94
|
+
if (e.collections) {
|
|
95
|
+
const n = z(e.collections);
|
|
96
|
+
r.added += n.added, r.skipped += n.skipped;
|
|
97
|
+
}
|
|
98
|
+
for (const n of C(e.individualIcons))
|
|
99
|
+
x(n.name, n.data) ? r.added += 1 : r.skipped += 1;
|
|
100
|
+
return r;
|
|
101
|
+
}
|
|
102
|
+
function E(e = {}) {
|
|
103
|
+
return M(e), o.mode = e.mode ?? l.mode, o.fallback = e.fallback ?? l.fallback, o.warnOnMissing = e.warnOnMissing ?? l.warnOnMissing, f.clear(), p(), V();
|
|
104
|
+
}
|
|
105
|
+
function V() {
|
|
106
|
+
return o.revision, {
|
|
107
|
+
mode: o.mode,
|
|
108
|
+
fallback: o.fallback,
|
|
109
|
+
warnOnMissing: o.warnOnMissing
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function S(e) {
|
|
113
|
+
return o.revision, a.has(s(e));
|
|
114
|
+
}
|
|
115
|
+
function u(e) {
|
|
116
|
+
return o.revision, a.get(s(e)) ?? null;
|
|
117
|
+
}
|
|
118
|
+
function F(e = {}) {
|
|
119
|
+
o.revision;
|
|
120
|
+
const r = e.prefix?.toLowerCase(), n = e.provider?.toLowerCase();
|
|
121
|
+
return [...a.keys()].filter((i) => {
|
|
122
|
+
const t = i.startsWith("@") ? i.slice(i.indexOf(":") + 1) : i, c = t.slice(0, t.indexOf(":")), d = i.startsWith("@") ? i.slice(1, i.indexOf(":")) : "";
|
|
123
|
+
return (!r || c === r) && (n === void 0 || d === n);
|
|
124
|
+
}).sort();
|
|
125
|
+
}
|
|
126
|
+
function w(e) {
|
|
127
|
+
const r = s(e);
|
|
128
|
+
!o.warnOnMissing || f.has(r) || (f.add(r), console.warn(
|
|
129
|
+
`[vlite3] Icon "${r}" is not locally registered and cannot render in offline mode.`
|
|
130
|
+
));
|
|
131
|
+
}
|
|
132
|
+
function P(e) {
|
|
133
|
+
if (typeof e != "string") return e;
|
|
134
|
+
const r = s(e), n = u(r);
|
|
135
|
+
if (n) return n;
|
|
136
|
+
if (o.mode !== "offline")
|
|
137
|
+
return o.mode === "hybrid" ? r : e;
|
|
138
|
+
w(r);
|
|
139
|
+
const i = o.fallback;
|
|
140
|
+
if (!i) return null;
|
|
141
|
+
if (typeof i != "string") return i;
|
|
142
|
+
if (s(i) === r) return null;
|
|
143
|
+
const t = u(i);
|
|
144
|
+
return t || w(i), t;
|
|
145
|
+
}
|
|
146
|
+
function R(e) {
|
|
147
|
+
const r = u(e);
|
|
148
|
+
if (!r) return "";
|
|
149
|
+
const n = k(r);
|
|
150
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" ${Object.entries(n.attributes).map(([t, c]) => `${t}="${String(c)}"`).join(" ")}>${n.body}</svg>`;
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
E as configureVLiteIcons,
|
|
154
|
+
V as getVLiteIconConfig,
|
|
155
|
+
S as hasVLiteIcon,
|
|
156
|
+
L as isVLiteIconName,
|
|
157
|
+
F as listVLiteIcons,
|
|
158
|
+
x as registerVLiteIcon,
|
|
159
|
+
N as registerVLiteIconCollection,
|
|
160
|
+
z as registerVLiteIconCollections,
|
|
161
|
+
M as registerVLiteIcons,
|
|
162
|
+
R as renderVLiteIconSvg,
|
|
163
|
+
u as resolveVLiteIcon,
|
|
164
|
+
P as resolveVLiteIconForRendering,
|
|
165
|
+
w as warnOnMissingVLiteIcon
|
|
166
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IconifyIcon, IconifyJSON } from '@iconify/vue';
|
|
2
|
+
export type VLiteIconMode = 'online' | 'hybrid' | 'offline';
|
|
3
|
+
export type VLiteIconData = IconifyIcon;
|
|
4
|
+
export type VLiteIconCollection = IconifyJSON;
|
|
5
|
+
export type VLiteIconSource = string | VLiteIconData;
|
|
6
|
+
export interface VLiteIconRegistration {
|
|
7
|
+
name: string;
|
|
8
|
+
data: VLiteIconData;
|
|
9
|
+
}
|
|
10
|
+
export type VLiteIndividualIcons = readonly VLiteIconRegistration[] | Readonly<Record<string, VLiteIconData>>;
|
|
11
|
+
/**
|
|
12
|
+
* Runtime icon resolution policy.
|
|
13
|
+
*
|
|
14
|
+
* Collections and individual icons are registered synchronously when the
|
|
15
|
+
* VLite plugin is installed. They can also be registered through the public
|
|
16
|
+
* registry helpers before or after plugin installation.
|
|
17
|
+
*/
|
|
18
|
+
export interface VLiteIconsConfig {
|
|
19
|
+
mode?: VLiteIconMode;
|
|
20
|
+
collections?: VLiteIconCollection | readonly VLiteIconCollection[];
|
|
21
|
+
individualIcons?: VLiteIndividualIcons;
|
|
22
|
+
fallback?: VLiteIconSource | null;
|
|
23
|
+
warnOnMissing?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ResolvedVLiteIconsConfig {
|
|
26
|
+
mode: VLiteIconMode;
|
|
27
|
+
fallback: VLiteIconSource | null;
|
|
28
|
+
warnOnMissing: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface VLiteIconListOptions {
|
|
31
|
+
prefix?: string;
|
|
32
|
+
provider?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface VLiteIconRegistrationResult {
|
|
35
|
+
added: number;
|
|
36
|
+
skipped: number;
|
|
37
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as GoogleSignInPlugin } from 'vue3-google-signin';
|
|
2
2
|
export * from './utils';
|
|
3
3
|
export * from './types';
|
|
4
|
+
export * from './icons/IconRegistry';
|
|
5
|
+
export * from './icons/IconTypes';
|
|
4
6
|
export * from './components/Chip';
|
|
5
7
|
export * from './components/Form';
|
|
6
8
|
export * from './components/Tabes';
|