vlite3 1.5.4 → 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.
Files changed (78) hide show
  1. package/README.md +105 -0
  2. package/VLiteIconsVite.d.ts +36 -0
  3. package/components/AppShell/AppShell.vue.d.ts +1 -1
  4. package/components/AppShell/AppShellLayoutDashboard.vue.js +3 -2
  5. package/components/AppShell/AppShellLayoutDock.vue.js +3 -2
  6. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +28 -27
  7. package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +3 -2
  8. package/components/AsyncSelect/createAsyncSelect.d.ts +4 -4
  9. package/components/AsyncSelect/createAsyncSelect.js +3 -2
  10. package/components/BackButton.vue.d.ts +1 -1
  11. package/components/Calendar/Calendar.vue.js +1 -1
  12. package/components/Calendar/Calendar.vue2.js +29 -29
  13. package/components/CategoryManager/CategoryManager.vue2.js +14 -14
  14. package/components/CategoryManager/CategoryNode.vue.js +16 -16
  15. package/components/CategoryMenu/CategoryMenu.vue.js +9 -8
  16. package/components/Chart/BarChart.vue.d.ts +1 -1
  17. package/components/Chart/GanttChart.vue.d.ts +3 -1
  18. package/components/Chart/GanttChart.vue.js +2 -2
  19. package/components/Chart/GanttChart.vue2.js +591 -656
  20. package/components/Chart/LineChart.vue.d.ts +1 -1
  21. package/components/Chart/TimelineChart.vue.d.ts +1 -1
  22. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  23. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  24. package/components/ConfirmationModal.vue.d.ts +4 -0
  25. package/components/ConfirmationModal.vue.js +47 -39
  26. package/components/DataTable/DataTable.vue.js +319 -294
  27. package/components/DataTable/DataTableRow.vue.d.ts +2 -0
  28. package/components/DataTable/DataTableRow.vue.js +2 -2
  29. package/components/DataTable/DataTableRow.vue2.js +57 -54
  30. package/components/DataTable/types.d.ts +2 -0
  31. package/components/DatePicker.vue.js +5 -4
  32. package/components/Empty/Empty.vue.js +3 -2
  33. package/components/ExportData/ExportData.vue.d.ts +1 -1
  34. package/components/Form/Form.vue2.js +44 -43
  35. package/components/Form/FormField.vue.js +24 -24
  36. package/components/Heatmap/Heatmap.vue2.js +3 -2
  37. package/components/Icon.vue.d.ts +3 -2
  38. package/components/Icon.vue.js +22 -12
  39. package/components/IconPicker.vue.js +5 -133
  40. package/components/IconPicker.vue2.js +218 -2
  41. package/components/ImportData/ImportData.vue.js +3 -2
  42. package/components/ImportData/ImportStep2.vue.js +3 -2
  43. package/components/Kanban/KanbanBoard.vue2.js +4 -2
  44. package/components/List/utils.js +5 -4
  45. package/components/Masonry/Masonry.vue2.js +14 -13
  46. package/components/Navbar/Navbar.vue.d.ts +1 -1
  47. package/components/Price/Price.vue.js +13 -12
  48. package/components/QRCode/QRCode.vue.d.ts +1 -1
  49. package/components/Rating/Rating.vue.js +2 -2
  50. package/components/Rating/Rating.vue2.js +41 -41
  51. package/components/Rating/ReviewSummary.vue.js +20 -20
  52. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +1 -1
  53. package/components/Screen/ScreenFilter.vue.js +5 -3
  54. package/components/Screen/components/ScreenExportModal.vue.d.ts +2 -2
  55. package/components/SidePanel.vue.js +2 -2
  56. package/components/SidePanel.vue2.js +18 -18
  57. package/components/Stats/StatItem.vue.js +3 -2
  58. package/components/StatusChip/StatusChip.vue.js +6 -5
  59. package/components/Workbook/Sheet.vue.js +11 -11
  60. package/core/CoreScale.d.ts +18 -0
  61. package/core/CoreScale.js +44 -0
  62. package/core/config.d.ts +66 -32
  63. package/core/config.js +24 -12
  64. package/core/index.d.ts +3 -2
  65. package/core/index.js +44 -32
  66. package/icons/IconRegistry.d.ts +38 -0
  67. package/icons/IconRegistry.js +166 -0
  68. package/icons/IconTypes.d.ts +37 -0
  69. package/index.d.ts +3 -1
  70. package/index.js +478 -452
  71. package/package.json +15 -3
  72. package/style.css +45 -15
  73. package/types/config.type.d.ts +23 -0
  74. package/utils/functions.js +44 -43
  75. package/utils/index.d.ts +1 -0
  76. package/vite.d.ts +6 -0
  77. package/vite.js +223 -0
  78. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
package/vite.js ADDED
@@ -0,0 +1,223 @@
1
+ import { readFile as E } from "node:fs/promises";
2
+ import { createRequire as N } from "node:module";
3
+ import { resolve as O, dirname as $ } from "node:path";
4
+ import { glob as b } from "tinyglobby";
5
+ const L = "virtual:vlite-icons", S = "\0virtual:vlite-icons", k = ["src/**/*.{vue,ts,tsx,js,jsx,mjs,cjs}"], T = ["**/*.{vue,ts,tsx,js,jsx,mjs,cjs}"], U = [
6
+ "**/node_modules/**",
7
+ "**/*.generated.*",
8
+ "**/dist/**",
9
+ "**/coverage/**",
10
+ "**/*.map"
11
+ ], V = /(['"`])((?:@[a-z0-9]+(?:-[a-z0-9]+)*:)?[a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*)\1/g, D = /* @__PURE__ */ new Set([
12
+ "active",
13
+ "checked",
14
+ "click",
15
+ "color",
16
+ "disabled",
17
+ "first-child",
18
+ "focus",
19
+ "focus-visible",
20
+ "group-hover",
21
+ "has",
22
+ "hover",
23
+ "lg",
24
+ "max-lg",
25
+ "max-md",
26
+ "max-sm",
27
+ "max-xl",
28
+ "max-2xl",
29
+ "md",
30
+ "model-value",
31
+ "og",
32
+ "peer",
33
+ "sm",
34
+ "twitter",
35
+ "update",
36
+ "xl",
37
+ "2xl"
38
+ ]);
39
+ function z(t) {
40
+ const c = t.trim().toLowerCase(), n = c.match(
41
+ /^@([a-z0-9]+(?:-[a-z0-9]+)*):([a-z0-9]+(?:-[a-z0-9]+)*):([a-z0-9]+(?:-[a-z0-9]+)*)$/
42
+ );
43
+ if (n)
44
+ return {
45
+ provider: n[1],
46
+ prefix: n[2],
47
+ name: n[3]
48
+ };
49
+ const o = c.match(
50
+ /^([a-z0-9]+(?:-[a-z0-9]+)*):([a-z0-9]+(?:-[a-z0-9]+)*)$/
51
+ );
52
+ return o ? { provider: "", prefix: o[1], name: o[2] } : null;
53
+ }
54
+ function M(t) {
55
+ const c = /* @__PURE__ */ new Map();
56
+ for (const n of t.matchAll(V)) {
57
+ const o = n[2].toLowerCase(), f = z(o);
58
+ if (!f || D.has(f.prefix)) continue;
59
+ const u = Math.max(0, (n.index ?? 0) - 100), s = t.slice(u, n.index), m = /\b(icon|icons|activeIcon|inactiveIcon|emptyIcon|titleIcon|fallback)\b[^'"]*$/i.test(s);
60
+ c.set(o, (c.get(o) ?? !1) || m);
61
+ }
62
+ return [...c.entries()].map(([n, o]) => ({
63
+ name: n,
64
+ reportIfMissing: o
65
+ }));
66
+ }
67
+ function P(t) {
68
+ return {
69
+ prefix: t.prefix,
70
+ icons: {},
71
+ ...t.provider ? { provider: t.provider } : {},
72
+ ...t.width !== void 0 ? { width: t.width } : {},
73
+ ...t.height !== void 0 ? { height: t.height } : {},
74
+ ...t.lastModified !== void 0 ? { lastModified: t.lastModified } : {}
75
+ };
76
+ }
77
+ function A(t, c) {
78
+ const n = P(t), o = {}, f = [], u = (s, m) => {
79
+ if (n.icons[s] || o[s]) return !0;
80
+ if (t.icons[s])
81
+ return n.icons[s] = t.icons[s], !0;
82
+ const h = t.aliases?.[s];
83
+ if (!h || m.has(s)) return !1;
84
+ const g = new Set(m);
85
+ return g.add(s), u(h.parent, g) ? (o[s] = h, !0) : !1;
86
+ };
87
+ for (const s of [...new Set(c)].sort())
88
+ u(s, /* @__PURE__ */ new Set()) || f.push(s);
89
+ return Object.keys(o).length > 0 && (n.aliases = o), { collection: n, missing: f };
90
+ }
91
+ async function R(t, c) {
92
+ const n = await b([...t], {
93
+ cwd: c,
94
+ absolute: !0,
95
+ onlyFiles: !0,
96
+ ignore: U
97
+ });
98
+ return Promise.all(
99
+ n.sort().map(async (o) => ({
100
+ file: o,
101
+ source: await E(o, "utf8")
102
+ }))
103
+ );
104
+ }
105
+ function G(t = {}) {
106
+ let c, n = "";
107
+ const o = t.include, f = o === void 0 ? [...k] : typeof o == "string" ? [o] : [...o], u = t.mode ?? "offline", s = t.onMissing ?? (u === "offline" ? "error" : "warn"), m = t.scanVLite ?? !0, h = t.autoRegister ?? !0, g = async (a) => {
108
+ const d = N(O(c.root, "package.json")), p = /* @__PURE__ */ new Map(), j = (e) => {
109
+ p.set(
110
+ e.name,
111
+ (p.get(e.name) ?? !1) || e.reportIfMissing
112
+ );
113
+ };
114
+ for (const e of await R(f, c.root))
115
+ for (const r of M(e.source)) j(r);
116
+ if (m)
117
+ try {
118
+ const e = d.resolve("vlite3"), r = $(e);
119
+ for (const i of await R(T, r))
120
+ for (const l of M(i.source)) j(l);
121
+ } catch (e) {
122
+ a(
123
+ `[vlite3/vite] Could not scan the installed vlite3 distribution: ${e instanceof Error ? e.message : String(e)}`,
124
+ !1
125
+ );
126
+ }
127
+ for (const e of t.icons ?? []) {
128
+ if (!z(e)) {
129
+ a(`[vlite3/vite] Invalid explicit icon identifier "${e}".`, !0);
130
+ continue;
131
+ }
132
+ p.set(e.toLowerCase(), !0);
133
+ }
134
+ const x = /* @__PURE__ */ new Map(), C = async (e) => {
135
+ if (x.has(e)) return x.get(e) ?? null;
136
+ try {
137
+ const r = d.resolve(
138
+ `@iconify-json/${e}/icons.json`
139
+ ), i = JSON.parse(await E(r, "utf8"));
140
+ return x.set(e, i), i;
141
+ } catch {
142
+ return x.set(e, null), null;
143
+ }
144
+ }, w = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set();
145
+ for (const e of [...new Set(t.collections ?? [])].sort()) {
146
+ const r = e.trim().toLowerCase(), i = await C(r);
147
+ i ? w.set(r, i) : v.add(`${r}:*`);
148
+ }
149
+ const y = /* @__PURE__ */ new Map();
150
+ for (const [e, r] of [...p.entries()].sort()) {
151
+ const i = z(e);
152
+ if (!i) continue;
153
+ const l = await C(i.prefix);
154
+ if (!l) {
155
+ r && v.add(e);
156
+ continue;
157
+ }
158
+ if (i.provider && i.provider !== (l.provider ?? "")) {
159
+ v.add(e);
160
+ continue;
161
+ }
162
+ const I = y.get(i.prefix) ?? [];
163
+ I.push(i.name), y.set(i.prefix, I);
164
+ }
165
+ for (const [e, r] of [...y.entries()].sort()) {
166
+ const i = await C(e);
167
+ if (!i) continue;
168
+ const l = A(i, r);
169
+ !w.has(e) && Object.keys(l.collection.icons).length > 0 && w.set(e, l.collection);
170
+ for (const I of l.missing) v.add(`${e}:${I}`);
171
+ }
172
+ v.size > 0 && a(
173
+ `[vlite3/vite] Could not resolve local icon data for: ${[...v].sort().join(", ")}. Install the matching @iconify-json/<prefix> package or remove the identifier.`,
174
+ s === "error"
175
+ );
176
+ const _ = [...w.entries()].sort(([e], [r]) => e.localeCompare(r)).map(([, e]) => e);
177
+ n = [
178
+ "import { registerVLiteIconCollections } from 'vlite3'",
179
+ `export const collections = ${JSON.stringify(_)}`,
180
+ "registerVLiteIconCollections(collections)",
181
+ "export default collections"
182
+ ].join(`
183
+ `);
184
+ };
185
+ return {
186
+ name: "vlite3-icons",
187
+ enforce: "pre",
188
+ configResolved(a) {
189
+ c = a;
190
+ },
191
+ async buildStart() {
192
+ await g((a, d) => {
193
+ d ? this.error(a) : this.warn(a);
194
+ });
195
+ },
196
+ resolveId(a) {
197
+ if (a === L) return S;
198
+ },
199
+ async load(a) {
200
+ if (a === S)
201
+ return n || await g((d, p) => {
202
+ p ? this.error(d) : this.warn(d);
203
+ }), n;
204
+ },
205
+ transformIndexHtml() {
206
+ if (h)
207
+ return [
208
+ {
209
+ tag: "script",
210
+ attrs: {
211
+ type: "module",
212
+ src: `/@id/${L}`
213
+ },
214
+ injectTo: "head-prepend"
215
+ }
216
+ ];
217
+ }
218
+ };
219
+ }
220
+ export {
221
+ G as default,
222
+ G as vliteIcons
223
+ };