vlite3 1.5.5 → 1.5.7

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 (92) hide show
  1. package/README.md +34 -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/ButtonGroup.vue.js +2 -2
  12. package/components/CategoryManager/CategoryManager.vue2.js +15 -15
  13. package/components/CategoryManager/CategoryNode.vue.js +16 -16
  14. package/components/CategoryMenu/CategoryMenu.vue.js +9 -8
  15. package/components/Chart/BarChart.vue.d.ts +1 -1
  16. package/components/Chart/GanttChart.vue.d.ts +1 -1
  17. package/components/Chart/LineChart.vue.d.ts +1 -1
  18. package/components/Chart/TimelineChart.vue.d.ts +1 -1
  19. package/components/Chip/Chip.vue.d.ts +1 -0
  20. package/components/Chip/Chip.vue.js +67 -36
  21. package/components/Chip/types.d.ts +5 -1
  22. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  23. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  24. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  25. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  26. package/components/ConfirmationModal.vue.d.ts +4 -0
  27. package/components/ConfirmationModal.vue.js +47 -39
  28. package/components/DataTable/DataTable.vue.d.ts +12 -3
  29. package/components/DataTable/DataTable.vue.js +5 -561
  30. package/components/DataTable/DataTable.vue2.js +711 -2
  31. package/components/DataTable/DataTableHeader.vue.d.ts +22 -0
  32. package/components/DataTable/DataTableHeader.vue.js +5 -58
  33. package/components/DataTable/DataTableHeader.vue2.js +106 -2
  34. package/components/DataTable/DataTableRow.vue.d.ts +15 -0
  35. package/components/DataTable/DataTableRow.vue.js +3 -3
  36. package/components/DataTable/DataTableRow.vue2.js +131 -118
  37. package/components/DataTable/dataTableColumnWidths.d.ts +91 -0
  38. package/components/DataTable/dataTableColumnWidths.js +82 -0
  39. package/components/DataTable/types.d.ts +50 -0
  40. package/components/DataTable/useDataTableColumnResize.d.ts +52 -0
  41. package/components/DataTable/useDataTableColumnResize.js +328 -0
  42. package/components/DatePicker.vue.js +5 -4
  43. package/components/Empty/Empty.vue.js +3 -2
  44. package/components/ExportData/ExportData.vue.d.ts +1 -1
  45. package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
  46. package/components/Form/Form.vue2.js +44 -43
  47. package/components/Form/FormField.vue.js +24 -24
  48. package/components/Form/index.vue2.js +1 -1
  49. package/components/Heatmap/Heatmap.vue2.js +3 -2
  50. package/components/Icon.vue.d.ts +3 -2
  51. package/components/Icon.vue.js +22 -12
  52. package/components/IconPicker.vue.js +5 -133
  53. package/components/IconPicker.vue2.js +218 -2
  54. package/components/ImportData/ImportData.vue.js +3 -2
  55. package/components/ImportData/ImportStep2.vue.js +3 -2
  56. package/components/Kanban/KanbanBoard.vue2.js +4 -2
  57. package/components/List/utils.js +5 -4
  58. package/components/Masonry/Masonry.vue2.js +14 -13
  59. package/components/Navbar/Navbar.vue.d.ts +1 -1
  60. package/components/NavbarCommandPalette.vue.js +1 -1
  61. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +1 -1
  62. package/components/Price/Price.vue.js +13 -12
  63. package/components/Rating/Rating.vue.js +2 -2
  64. package/components/Rating/Rating.vue2.js +41 -41
  65. package/components/Rating/ReviewSummary.vue.js +20 -20
  66. package/components/Screen/ScreenFilter.vue.js +6 -4
  67. package/components/Screen/components/ScreenExportModal.vue.d.ts +2 -2
  68. package/components/Stats/StatItem.vue.js +3 -2
  69. package/components/StatusChip/StatusChip.vue.d.ts +6 -0
  70. package/components/StatusChip/StatusChip.vue.js +14 -11
  71. package/components/Tabes/Tabes.vue.js +3 -3
  72. package/components/Tabes/Tabes.vue2.js +241 -220
  73. package/components/Tabes/types.d.ts +3 -1
  74. package/components/Workbook/Sheet.vue.js +11 -11
  75. package/core/config.d.ts +28 -0
  76. package/core/config.js +23 -21
  77. package/core/index.js +18 -17
  78. package/icons/IconRegistry.d.ts +38 -0
  79. package/icons/IconRegistry.js +166 -0
  80. package/icons/IconTypes.d.ts +37 -0
  81. package/index.d.ts +2 -0
  82. package/index.js +473 -457
  83. package/package.json +15 -3
  84. package/style.css +17 -3
  85. package/types/config.type.d.ts +8 -1
  86. package/utils/functions.js +44 -43
  87. package/utils/index.d.ts +1 -0
  88. package/utils/usePersistentState.d.ts +4 -1
  89. package/utils/usePersistentState.js +4 -3
  90. package/vite.d.ts +6 -0
  91. package/vite.js +223 -0
  92. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -38,7 +38,9 @@ export interface TabesOption {
38
38
  dropdown?: TabesDropdownConfig;
39
39
  }
40
40
  export type TabesSize = 'sm' | 'md' | 'lg';
41
- export type TabesVariant = 'surface' | 'primary' | 'secondary' | 'danger' | 'success' | 'outline' | 'line';
41
+ export type TabesVariant = 'surface' | 'primary' | 'secondary' | 'danger' | 'success' | 'outline' | 'line'
42
+ /** Independent selectable chips — transparent group, bordered items, single-select */
43
+ | 'checkbox';
42
44
  export type TabesMenuSelectPayload = {
43
45
  value: any;
44
46
  option?: IDropdownOption;
@@ -1,4 +1,4 @@
1
- import { defineComponent as I, ref as b, computed as v, openBlock as r, createElementBlock as d, normalizeClass as $, createElementVNode as u, withModifiers as a, createBlock as S, withCtx as x, createVNode as m, createCommentVNode as V, withDirectives as j, withKeys as g, vModelText as z, toDisplayString as K, unref as M, nextTick as N } from "vue";
1
+ import { defineComponent as I, ref as b, computed as v, openBlock as r, createElementBlock as d, normalizeClass as S, createElementVNode as u, withModifiers as a, createBlock as $, withCtx as x, createVNode as m, createCommentVNode as V, withDirectives as j, withKeys as g, vModelText as z, toDisplayString as K, unref as M, nextTick as N } from "vue";
2
2
  import y from "../Icon.vue.js";
3
3
  import O from "../Dropdown/Dropdown.vue.js";
4
4
  import { $t as l } from "../../utils/i18n.js";
@@ -7,13 +7,13 @@ import { $t as l } from "../../utils/i18n.js";
7
7
  /* empty css */
8
8
  import R from "../Button.vue.js";
9
9
  import A from "../IconPicker.vue.js";
10
- const U = {
10
+ const P = {
11
11
  type: "button",
12
12
  class: "flex items-center justify-center rounded hover:bg-accent transition-colors p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-primary/20 mt-1"
13
- }, q = {
13
+ }, U = {
14
14
  key: 1,
15
15
  class: "flex items-center justify-center p-0.5"
16
- }, F = { class: "flex-1 min-w-0 pr-1" }, G = ["onKeydown"], H = {
16
+ }, q = { class: "flex-1 min-w-0 pr-1" }, F = ["onKeydown"], G = {
17
17
  key: 1,
18
18
  class: "block truncate text-sm font-medium leading-normal"
19
19
  }, ee = /* @__PURE__ */ I({
@@ -88,7 +88,7 @@ const U = {
88
88
  e.isEditing ? "cursor-text" : ""
89
89
  ].filter(Boolean).join(" "));
90
90
  return (n, t) => (r(), d("div", {
91
- class: $(E.value),
91
+ class: S(E.value),
92
92
  onClick: t[5] || (t[5] = (c) => o("select", i.sheet.id)),
93
93
  onDblclick: h
94
94
  }, [
@@ -97,14 +97,14 @@ const U = {
97
97
  }, ["stop"])),
98
98
  class: "mr-2 flex items-center shrink-0"
99
99
  }, [
100
- (i.sheet.icon || i.isEditing) && i.allowIconChange ? (r(), S(A, {
100
+ (i.sheet.icon || i.isEditing) && i.allowIconChange ? (r(), $(A, {
101
101
  key: 0,
102
102
  value: i.sheet.icon || "lucide:file",
103
103
  position: "bottom-start",
104
104
  onOnSelect: t[0] || (t[0] = (c) => o("update:icon", i.sheet.id, c))
105
105
  }, {
106
106
  default: x(() => [
107
- u("button", U, [
107
+ u("button", P, [
108
108
  m(y, {
109
109
  icon: i.sheet.icon || "lucide:file",
110
110
  class: "w-4 h-4 opacity-70 hover:opacity-100 transition-opacity"
@@ -112,14 +112,14 @@ const U = {
112
112
  ])
113
113
  ]),
114
114
  _: 1
115
- }, 8, ["value"])) : i.sheet.icon ? (r(), d("div", q, [
115
+ }, 8, ["value"])) : i.sheet.icon ? (r(), d("div", U, [
116
116
  m(y, {
117
117
  icon: i.sheet.icon,
118
118
  class: "w-4 h-4 opacity-70"
119
119
  }, null, 8, ["icon"])
120
120
  ])) : V("", !0)
121
121
  ]),
122
- u("div", F, [
122
+ u("div", q, [
123
123
  i.isEditing ? j((r(), d("input", {
124
124
  key: 0,
125
125
  ref_key: "inputRef",
@@ -134,9 +134,9 @@ const U = {
134
134
  ],
135
135
  onClick: t[3] || (t[3] = a(() => {
136
136
  }, ["stop"]))
137
- }, null, 40, G)), [
137
+ }, null, 40, F)), [
138
138
  [z, s.value]
139
- ]) : (r(), d("span", H, K(C.value), 1))
139
+ ]) : (r(), d("span", G, K(C.value), 1))
140
140
  ]),
141
141
  u("div", {
142
142
  class: "opacity-0 group-hover:opacity-100 transition-opacity ml-auto pl-1 -mr-2 flex items-center",
package/core/config.d.ts CHANGED
@@ -182,6 +182,20 @@ export declare const configState: {
182
182
  };
183
183
  };
184
184
  scale: VLiteScale;
185
+ icons: {
186
+ mode: import('../index.ts').VLiteIconMode;
187
+ fallback: string | {
188
+ body: string;
189
+ left?: number;
190
+ top?: number;
191
+ width?: number;
192
+ height?: number;
193
+ rotate?: number;
194
+ hFlip?: boolean;
195
+ vFlip?: boolean;
196
+ };
197
+ warnOnMissing: boolean;
198
+ };
185
199
  };
186
200
  /**
187
201
  * Helper to update the global configuration safely.
@@ -369,4 +383,18 @@ export declare function useVLiteConfig(): {
369
383
  };
370
384
  };
371
385
  scale: VLiteScale;
386
+ icons: {
387
+ mode: import('../index.ts').VLiteIconMode;
388
+ fallback: string | {
389
+ body: string;
390
+ left?: number;
391
+ top?: number;
392
+ width?: number;
393
+ height?: number;
394
+ rotate?: number;
395
+ hFlip?: boolean;
396
+ vFlip?: boolean;
397
+ };
398
+ warnOnMissing: boolean;
399
+ };
372
400
  };
package/core/config.js CHANGED
@@ -1,8 +1,10 @@
1
- import { reactive as i, inject as s } from "vue";
2
- import { deepMerge as n } from "../utils/object.js";
3
- import { DEFAULT_VLITE_SCALE as r, applyVLiteScale as o, resolveVLiteScale as a } from "./CoreScale.js";
4
- const l = /* @__PURE__ */ Symbol("vlite-config"), f = {
5
- scale: r,
1
+ import { reactive as s, inject as r } from "vue";
2
+ import { deepMerge as a } from "../utils/object.js";
3
+ import { DEFAULT_VLITE_SCALE as f, applyVLiteScale as t, resolveVLiteScale as l } from "./CoreScale.js";
4
+ import { getVLiteIconConfig as m, configureVLiteIcons as g } from "../icons/IconRegistry.js";
5
+ const d = /* @__PURE__ */ Symbol("vlite-config"), p = {
6
+ scale: f,
7
+ icons: m(),
6
8
  services: {},
7
9
  components: {
8
10
  form: {},
@@ -19,25 +21,25 @@ const l = /* @__PURE__ */ Symbol("vlite-config"), f = {
19
21
  customStatuses: {}
20
22
  }
21
23
  }
22
- }, t = i({ ...f });
23
- function p(e) {
24
- const c = n(t, {
25
- ...e,
26
- ...e.scale === void 0 ? {} : { scale: a(e.scale) }
24
+ }, e = s({ ...p });
25
+ function V(o) {
26
+ const { icons: c, ...i } = o, n = a(e, {
27
+ ...i,
28
+ ...o.scale === void 0 ? {} : { scale: l(o.scale) }
27
29
  });
28
- Object.assign(t, c), e.scale !== void 0 && (t.scale = o(t.scale));
30
+ Object.assign(e, n), c !== void 0 && (e.icons = g(c)), o.scale !== void 0 && (e.scale = t(e.scale));
29
31
  }
30
- function S(e) {
31
- const c = o(e);
32
- return t.scale = c, c;
32
+ function C(o) {
33
+ const c = t(o);
34
+ return e.scale = c, c;
33
35
  }
34
- function g() {
35
- return s(l, t);
36
+ function I() {
37
+ return r(d, e);
36
38
  }
37
39
  export {
38
- l as VLITE_CONFIG_KEY,
39
- t as configState,
40
- S as setVLiteScale,
41
- p as updateConfig,
42
- g as useVLiteConfig
40
+ d as VLITE_CONFIG_KEY,
41
+ e as configState,
42
+ C as setVLiteScale,
43
+ V as updateConfig,
44
+ I as useVLiteConfig
43
45
  };
package/core/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { configState as e, VLITE_CONFIG_KEY as o } from "./config.js";
2
- import { setVLiteScale as r, updateConfig as l, useVLiteConfig as L } from "./config.js";
3
- import { initializeVLiteScale as a } from "./CoreScale.js";
4
- import { DEFAULT_VLITE_SCALE as u, VLITE_SCALE_ATTRIBUTE as S, VLITE_SCALE_STORAGE_KEY as g, applyVLiteScale as E, getStoredVLiteScale as V, isVLiteScale as C, resolveVLiteScale as v } from "./CoreScale.js";
5
- function n(t = {}) {
2
+ import { setVLiteScale as L, updateConfig as f, useVLiteConfig as u } from "./config.js";
3
+ import { initializeVLiteScale as m } from "./CoreScale.js";
4
+ import { DEFAULT_VLITE_SCALE as g, VLITE_SCALE_ATTRIBUTE as V, VLITE_SCALE_STORAGE_KEY as E, applyVLiteScale as C, getStoredVLiteScale as v, isVLiteScale as D, resolveVLiteScale as T } from "./CoreScale.js";
5
+ import { configureVLiteIcons as s } from "../icons/IconRegistry.js";
6
+ function r(t = {}) {
6
7
  return {
7
8
  install(c) {
8
- e.scale = a(t.scale), t && (t.services && (e.services = { ...e.services, ...t.services }), t.importData && (e.importData = { ...e.importData, ...t.importData }), t.exportData && (e.exportData = { ...e.exportData, ...t.exportData }), t.components && (e.components = {
9
+ e.icons = s(t.icons), e.scale = m(t.scale), t && (t.services && (e.services = { ...e.services, ...t.services }), t.importData && (e.importData = { ...e.importData, ...t.importData }), t.exportData && (e.exportData = { ...e.exportData, ...t.exportData }), t.components && (e.components = {
9
10
  ...e.components,
10
11
  ...t.components,
11
12
  form: {
@@ -53,18 +54,18 @@ function n(t = {}) {
53
54
  };
54
55
  }
55
56
  export {
56
- u as DEFAULT_VLITE_SCALE,
57
+ g as DEFAULT_VLITE_SCALE,
57
58
  o as VLITE_CONFIG_KEY,
58
- S as VLITE_SCALE_ATTRIBUTE,
59
- g as VLITE_SCALE_STORAGE_KEY,
60
- E as applyVLiteScale,
59
+ V as VLITE_SCALE_ATTRIBUTE,
60
+ E as VLITE_SCALE_STORAGE_KEY,
61
+ C as applyVLiteScale,
61
62
  e as configState,
62
- n as createVLite,
63
- V as getStoredVLiteScale,
64
- a as initializeVLiteScale,
65
- C as isVLiteScale,
66
- v as resolveVLiteScale,
67
- r as setVLiteScale,
68
- l as updateConfig,
69
- L as useVLiteConfig
63
+ r as createVLite,
64
+ v as getStoredVLiteScale,
65
+ m as initializeVLiteScale,
66
+ D as isVLiteScale,
67
+ T as resolveVLiteScale,
68
+ L as setVLiteScale,
69
+ f as updateConfig,
70
+ u as useVLiteConfig
70
71
  };
@@ -0,0 +1,38 @@
1
+ import { IconifyIcon } from '@iconify/vue';
2
+ import { ResolvedVLiteIconsConfig, VLiteIconCollection, VLiteIconListOptions, VLiteIconRegistrationResult, VLiteIconsConfig, VLiteIconSource } from './IconTypes';
3
+ export declare function isVLiteIconName(name: string): boolean;
4
+ /**
5
+ * Register one Iconify icon in the same module registry used by VLite's Icon.
6
+ */
7
+ export declare function registerVLiteIcon(name: string, data: IconifyIcon): boolean;
8
+ /**
9
+ * Register one complete or partial IconifyJSON collection.
10
+ */
11
+ export declare function registerVLiteIconCollection(collection: VLiteIconCollection): VLiteIconRegistrationResult;
12
+ export declare function registerVLiteIconCollections(collections: VLiteIconCollection | readonly VLiteIconCollection[]): VLiteIconRegistrationResult;
13
+ /**
14
+ * Register the data-bearing part of an icon configuration without changing
15
+ * the current online/hybrid/offline resolution strategy.
16
+ */
17
+ export declare function registerVLiteIcons(registration: Pick<VLiteIconsConfig, 'collections' | 'individualIcons'>): VLiteIconRegistrationResult;
18
+ /**
19
+ * Configure resolution and synchronously register supplied local data.
20
+ */
21
+ export declare function configureVLiteIcons(config?: VLiteIconsConfig): ResolvedVLiteIconsConfig;
22
+ export declare function getVLiteIconConfig(): ResolvedVLiteIconsConfig;
23
+ export declare function hasVLiteIcon(name: string): boolean;
24
+ /**
25
+ * Resolve only explicitly VLite-registered local data. This never loads.
26
+ */
27
+ export declare function resolveVLiteIcon(name: string): Required<IconifyIcon> | null;
28
+ export declare function listVLiteIcons(options?: VLiteIconListOptions): string[];
29
+ export declare function warnOnMissingVLiteIcon(name: string): void;
30
+ /**
31
+ * Resolve the value passed to Iconify's Vue renderer. Offline mode returns
32
+ * icon data (or null) only, so unresolved names never reach its API loader.
33
+ */
34
+ export declare function resolveVLiteIconForRendering(icon: VLiteIconSource): VLiteIconSource | null;
35
+ /**
36
+ * Serialize a registered icon for IconPicker's existing SVG event payload.
37
+ */
38
+ export declare function renderVLiteIconSvg(name: string): string;
@@ -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';