vlite3 1.5.4 → 1.5.5

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.
@@ -1,9 +1,9 @@
1
1
  import { QRCodeProps } from './types';
2
2
  declare const _default: import('vue').DefineComponent<QRCodeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<QRCodeProps> & Readonly<{}>, {
3
+ scale: number;
3
4
  alt: string;
4
5
  size: number | string;
5
6
  margin: number;
6
- scale: number;
7
7
  errorCorrectionLevel: import('./types').QRCodeErrorCorrectionLevel;
8
8
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
9
9
  export default _default;
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as te, ref as v, shallowRef as ne, watch as oe, computed as h, onMounted as le, onUnmounted as ae, openBlock as C, createElementBlock as L, normalizeClass as re, toDisplayString as I, createCommentVNode as U, createElementVNode as w, createVNode as q, unref as a, normalizeStyle as ie } from "vue";
2
2
  /* empty css */
3
- import se from "./RichTextToolbar.vue.js";
4
- /* empty css */
5
- import de from "./RichTextLinkPopover.vue.js";
6
- /* empty css */
3
+ import se from "./RichTextToolbar.vue2.js";
4
+ /* empty css */
5
+ import de from "./RichTextLinkPopover.vue2.js";
6
+ /* empty css */
7
7
  import { useRichTextImageUpload as ue } from "./composables/useRichTextImageUpload.js";
8
8
  import { useRichTextLinks as ce } from "./composables/useRichTextLinks.js";
9
9
  const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { class: "rte-wrapper" }, ye = { class: "rte-body-wrap" }, ge = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
@@ -1,5 +1,5 @@
1
- import o from "./RichTextLinkPopover.vue.js";
2
- /* empty css */
1
+ import o from "./RichTextLinkPopover.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
- import o from "./RichTextToolbar.vue.js";
2
- /* empty css */
1
+ import o from "./RichTextToolbar.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -25,10 +25,10 @@ declare const __VLS_component: import('vue').DefineComponent<ScaleGeneratorProps
25
25
  "onUpdate:containerWidth"?: (value: number) => any;
26
26
  "onUpdate:ready"?: (value: boolean) => any;
27
27
  }>, {
28
+ scale: number | null;
28
29
  maxWidth: number;
29
30
  contentClass: string;
30
31
  enabled: boolean;
31
- scale: number | null;
32
32
  targetWidth: number;
33
33
  minScale: number;
34
34
  maxScale: number;
@@ -24,8 +24,8 @@ import "iconify-icon-picker/style.css";
24
24
  /* empty css */
25
25
  /* empty css */
26
26
  /* empty css */
27
- /* empty css */
28
- /* empty css */
27
+ /* empty css */
28
+ /* empty css */
29
29
  import "../../core/config.js";
30
30
  /* empty css */
31
31
  /* empty css */
@@ -1,7 +1,7 @@
1
1
  import o from "./SidePanel.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-10bfdf18"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c7083f88"]]);
5
5
  export {
6
- e as default
6
+ f as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as E, ref as N, inject as P, computed as f, markRaw as D, watch as h, onMounted as L, onUnmounted as V, openBlock as l, createElementBlock as i, Fragment as j, createElementVNode as p, mergeProps as w, withModifiers as K, renderSlot as c, createCommentVNode as a, createBlock as g, Teleport as M, normalizeClass as m, createVNode as F, Transition as R, withCtx as U, normalizeStyle as q, toDisplayString as k, resolveDynamicComponent as G } from "vue";
1
+ import { defineComponent as E, ref as N, inject as P, computed as f, markRaw as D, watch as w, onMounted as L, onUnmounted as V, openBlock as l, createElementBlock as i, Fragment as j, createElementVNode as p, mergeProps as h, withModifiers as K, renderSlot as m, createCommentVNode as a, createBlock as g, Teleport as M, normalizeClass as c, createVNode as F, Transition as R, withCtx as U, normalizeStyle as q, toDisplayString as k, resolveDynamicComponent as G } from "vue";
2
2
  import H from "./Button.vue.js";
3
3
  import { useKeyStroke as J } from "../composables/useKeyStroke.js";
4
4
  import { $t as $ } from "../utils/i18n.js";
@@ -34,7 +34,7 @@ const Q = ["data-testid"], W = ["data-testid"], X = { class: "text-lg font-bold
34
34
  const t = o, v = x, s = N(t.show);
35
35
  let u = null;
36
36
  const r = P("dropdown-context", null), b = f(() => t.body ? D(t.body) : void 0);
37
- h(
37
+ w(
38
38
  () => t.show,
39
39
  (e) => {
40
40
  s.value = e, e && (v("onOpen"), r?.close());
@@ -47,7 +47,7 @@ const Q = ["data-testid"], W = ["data-testid"], X = { class: "text-lg font-bold
47
47
  }, T = () => {
48
48
  t.closeOutside && n();
49
49
  }, { onKeyStroke: z } = J();
50
- z("Escape", n), h(s, (e) => {
50
+ z("Escape", n), w(s, (e) => {
51
51
  u && clearTimeout(u), e ? (r?.onChildToggle?.(!0), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", u = setTimeout(() => {
52
52
  r?.onChildToggle?.(!1);
53
53
  }, 150));
@@ -57,29 +57,29 @@ const Q = ["data-testid"], W = ["data-testid"], X = { class: "text-lg font-bold
57
57
  u && clearTimeout(u), s.value && r?.onChildToggle?.(!1), document.body.style.overflow = "";
58
58
  });
59
59
  const S = {
60
- sm: "max-w-sm",
61
- md: "max-w-md",
62
- lg: "max-w-lg",
63
- xl: "max-w-xl",
60
+ sm: "max-w-full sm:max-w-sm",
61
+ md: "max-w-full sm:max-w-md",
62
+ lg: "max-w-full sm:max-w-lg",
63
+ xl: "max-w-full sm:max-w-xl",
64
64
  full: "max-w-full"
65
65
  }, A = f(() => t.position === "left" ? "start-0 rounded-e-lg" : "end-0 rounded-s-md"), O = f(() => t.position === "left" ? "slide-left" : "slide-right"), d = f(() => t.titleI18n ? $(t.titleI18n) : t.title), C = f(
66
66
  () => t.descriptionI18n ? $(t.descriptionI18n) : t.description
67
67
  );
68
68
  return (e, y) => (l(), i(j, null, [
69
- p("span", w({
69
+ p("span", h({
70
70
  onClick: K(B, ["stop"]),
71
71
  class: `${o.triggerClass}`
72
72
  }, e.$attrs, {
73
73
  "data-testid": e.$attrs["data-testid"] ? `${e.$attrs["data-testid"]}-trigger` : d.value ? `sidepanel-trigger-${d.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "sidepanel-trigger"
74
74
  }), [
75
- c(e.$slots, "trigger", {}, () => [
76
- o.body ? c(e.$slots, "default", { key: 0 }, void 0, !0) : a("", !0)
75
+ m(e.$slots, "trigger", {}, () => [
76
+ o.body ? m(e.$slots, "default", { key: 0 }, void 0, !0) : a("", !0)
77
77
  ], !0)
78
78
  ], 16, Q),
79
79
  (l(), g(M, { to: "body" }, [
80
80
  s.value ? (l(), i("div", {
81
81
  key: 0,
82
- class: m(["fixed inset-0 z-50 v-sidepanel-overlay", o.overlayClass]),
82
+ class: c(["fixed inset-0 z-50 v-sidepanel-overlay", o.overlayClass]),
83
83
  onClick: T
84
84
  }, null, 2)) : a("", !0),
85
85
  F(R, {
@@ -93,14 +93,14 @@ const Q = ["data-testid"], W = ["data-testid"], X = { class: "text-lg font-bold
93
93
  role: "dialog",
94
94
  style: q(o.styles),
95
95
  "aria-modal": "true",
96
- class: m(["sidepanel-body fixed inset-y-0 z-50 flex flex-col bg-body shadow-sm border border-border/80 w-full", [S[o.size], A.value, t.class]]),
96
+ class: c(["sidepanel-body fixed inset-y-0 z-50 flex flex-col bg-body shadow-sm border border-border/80 w-full", [S[o.size], A.value, t.class]]),
97
97
  "data-testid": e.$attrs["data-testid"] || (d.value ? `sidepanel-${d.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "sidepanel")
98
98
  }, [
99
99
  d.value || e.$slots.header ? (l(), i("div", {
100
100
  key: 0,
101
- class: m([o.headerClass, "flex-none flex items-center justify-between px-5 py-2 border-b border-border"])
101
+ class: c([o.headerClass, "flex-none flex items-center justify-between px-5 py-2 border-b border-border"])
102
102
  }, [
103
- c(e.$slots, "header", {}, () => [
103
+ m(e.$slots, "header", {}, () => [
104
104
  p("div", null, [
105
105
  p("h3", X, k(d.value), 1),
106
106
  C.value ? (l(), i("p", Y, k(C.value), 1)) : a("", !0)
@@ -118,18 +118,18 @@ const Q = ["data-testid"], W = ["data-testid"], X = { class: "text-lg font-bold
118
118
  }))
119
119
  ], 2)) : a("", !0),
120
120
  p("div", {
121
- class: m(["flex-1 overflow-y-auto px-6 py-4 scrollbar-thin scrollbar-stable", o.bodyClass])
121
+ class: c(["flex-1 overflow-y-auto px-6 py-4 scrollbar-thin scrollbar-stable", o.bodyClass])
122
122
  }, [
123
- b.value ? (l(), g(G(b.value), w({ key: 0 }, { ...o.bodyProps, ...e.$attrs }, { close: n }), null, 16)) : c(e.$slots, "default", {
123
+ b.value ? (l(), g(G(b.value), h({ key: 0 }, { ...o.bodyProps, ...e.$attrs }, { close: n }), null, 16)) : m(e.$slots, "default", {
124
124
  key: 1,
125
125
  close: n
126
126
  }, void 0, !0)
127
127
  ], 2),
128
128
  e.$slots.footer ? (l(), i("div", {
129
129
  key: 1,
130
- class: m(["flex-none px-6 py-3 border-t border-border", o.footerClass])
130
+ class: c(["flex-none px-6 py-3 border-t border-border", o.footerClass])
131
131
  }, [
132
- c(e.$slots, "footer", { close: n }, void 0, !0)
132
+ m(e.$slots, "footer", { close: n }, void 0, !0)
133
133
  ], 2)) : a("", !0)
134
134
  ], 14, W)) : a("", !0)
135
135
  ]),
@@ -0,0 +1,18 @@
1
+ import { VLiteScale } from '../types/config.type.ts';
2
+ export declare const DEFAULT_VLITE_SCALE: VLiteScale;
3
+ export declare const VLITE_SCALE_ATTRIBUTE = "data-vlite-scale";
4
+ export declare const VLITE_SCALE_STORAGE_KEY = "vlite-scale";
5
+ export declare function isVLiteScale(value: unknown): value is VLiteScale;
6
+ export declare function resolveVLiteScale(value: unknown): VLiteScale;
7
+ export declare function getStoredVLiteScale(): VLiteScale | null;
8
+ /**
9
+ * Applies the resolved scale without disturbing any other root attributes.
10
+ * User-initiated runtime changes are persisted synchronously for future loads.
11
+ * Safe to call repeatedly and in server-rendered environments.
12
+ */
13
+ export declare function applyVLiteScale(scale: VLiteScale): VLiteScale;
14
+ /**
15
+ * Restores a saved user preference before mount, falling back to application
16
+ * configuration and finally the backward-compatible large preset.
17
+ */
18
+ export declare function initializeVLiteScale(configuredScale: unknown): VLiteScale;
@@ -0,0 +1,44 @@
1
+ const r = "large", c = "data-vlite-scale", n = "vlite-scale", u = ["small", "medium", "large"];
2
+ function i(e) {
3
+ return typeof e == "string" && u.includes(e);
4
+ }
5
+ function o(e) {
6
+ return i(e) ? e : r;
7
+ }
8
+ function a() {
9
+ if (typeof window > "u") return null;
10
+ try {
11
+ const e = window.localStorage.getItem(n);
12
+ return i(e) ? e : (e !== null && window.localStorage.removeItem(n), null);
13
+ } catch {
14
+ return null;
15
+ }
16
+ }
17
+ function d(e) {
18
+ if (!(typeof window > "u"))
19
+ try {
20
+ window.localStorage.setItem(n, e);
21
+ } catch {
22
+ }
23
+ }
24
+ function l(e) {
25
+ typeof document > "u" || document.documentElement.setAttribute(c, e);
26
+ }
27
+ function s(e) {
28
+ const t = o(e);
29
+ return d(t), l(t), t;
30
+ }
31
+ function S(e) {
32
+ const t = a() ?? o(e);
33
+ return l(t), t;
34
+ }
35
+ export {
36
+ r as DEFAULT_VLITE_SCALE,
37
+ c as VLITE_SCALE_ATTRIBUTE,
38
+ n as VLITE_SCALE_STORAGE_KEY,
39
+ s as applyVLiteScale,
40
+ a as getStoredVLiteScale,
41
+ S as initializeVLiteScale,
42
+ i as isVLiteScale,
43
+ o as resolveVLiteScale
44
+ };
package/core/config.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { InjectionKey } from 'vue';
2
- import { VLiteConfig } from '../types/config.type';
2
+ import { ResolvedVLiteConfig, VLiteConfig, VLiteScale } from '../types/config.type.ts';
3
3
  /**
4
4
  * Unique symbol for injecting the VLite configuration.
5
5
  */
6
- export declare const VLITE_CONFIG_KEY: InjectionKey<VLiteConfig>;
6
+ export declare const VLITE_CONFIG_KEY: InjectionKey<ResolvedVLiteConfig>;
7
7
  /**
8
8
  * Global reactive configuration state.
9
9
  * This acts as a singleton fallback if inject() is used outside a component
@@ -11,8 +11,8 @@ export declare const VLITE_CONFIG_KEY: InjectionKey<VLiteConfig>;
11
11
  */
12
12
  export declare const configState: {
13
13
  services?: {
14
- upload?: import('..').FileUploadHandler;
15
- t?: import('..').TranslationHandler;
14
+ upload?: import('../index.ts').FileUploadHandler;
15
+ t?: import('../index.ts').TranslationHandler;
16
16
  importApi?: (entity: string, payload: any) => Promise<any>;
17
17
  exportApi?: (entity: string, payload: any) => Promise<any>;
18
18
  };
@@ -25,9 +25,9 @@ export declare const configState: {
25
25
  };
26
26
  components?: {
27
27
  form?: {
28
- variant?: import('..').InputVariant;
29
- size?: import('..').InputSize;
30
- rounded?: import('..').InputRounded;
28
+ variant?: import('../index.ts').InputVariant;
29
+ size?: import('../index.ts').InputSize;
30
+ rounded?: import('../index.ts').InputRounded;
31
31
  showRequiredAsterisk?: boolean;
32
32
  };
33
33
  price?: {
@@ -42,11 +42,11 @@ export declare const configState: {
42
42
  apiKey?: string;
43
43
  };
44
44
  empty?: {
45
- variant?: import('..').EmptyVariant;
45
+ variant?: import('../index.ts').EmptyVariant;
46
46
  };
47
47
  statusChip?: {
48
48
  hideIcon?: boolean;
49
- customStatuses?: Record<string, import('..').CustomStatusConfig>;
49
+ customStatuses?: Record<string, import('../index.ts').CustomStatusConfig>;
50
50
  };
51
51
  attachmentsList?: {
52
52
  variant?: "default" | "list" | "inline" | "card";
@@ -73,16 +73,16 @@ export declare const configState: {
73
73
  title?: string;
74
74
  class?: string;
75
75
  titleI18n?: string;
76
- variant?: import('..').ListVariant;
76
+ variant?: import('../index.ts').ListVariant;
77
77
  titleIcon?: string;
78
- columns?: import('..').ListColumns;
78
+ columns?: import('../index.ts').ListColumns;
79
79
  showColon?: boolean;
80
80
  loading?: boolean;
81
81
  skeletonRows?: number;
82
- stackedBorderStyle?: import('..').StackedBorderStyle;
82
+ stackedBorderStyle?: import('../index.ts').StackedBorderStyle;
83
83
  };
84
84
  invoice?: {
85
- variant?: import('..').InvoiceVariant;
85
+ variant?: import('../index.ts').InvoiceVariant;
86
86
  compact?: boolean;
87
87
  displayBarcodeValue?: boolean;
88
88
  labels?: {
@@ -108,7 +108,7 @@ export declare const configState: {
108
108
  };
109
109
  };
110
110
  footer?: {
111
- variant?: import('..').FooterVariant;
111
+ variant?: import('../index.ts').FooterVariant;
112
112
  labels?: {
113
113
  followUs?: string;
114
114
  subscribe?: string;
@@ -117,7 +117,7 @@ export declare const configState: {
117
117
  containerClass?: string | any[] | Record<string, boolean>;
118
118
  };
119
119
  cart?: {
120
- variant?: import('..').CartVariant;
120
+ variant?: import('../index.ts').CartVariant;
121
121
  labels?: {
122
122
  cart?: string;
123
123
  emptyTitle?: string;
@@ -173,28 +173,33 @@ export declare const configState: {
173
173
  validateCoupon?: (code: string, context: {
174
174
  subtotal: number;
175
175
  currency?: string;
176
- items: import('..').CartItem[];
177
- }) => Promise<import('..').CartCouponDefinition | {
176
+ items: import('../index.ts').CartItem[];
177
+ }) => Promise<import('../index.ts').CartCouponDefinition | {
178
178
  code: string;
179
179
  message: string;
180
180
  state?: "invalid" | "expired" | "error";
181
181
  } | null>;
182
182
  };
183
183
  };
184
+ scale: VLiteScale;
184
185
  };
185
186
  /**
186
187
  * Helper to update the global configuration safely.
187
188
  * Uses deep merge to preserve existing nested objects.
188
189
  */
189
190
  export declare function updateConfig(updates: Partial<VLiteConfig>): void;
191
+ /**
192
+ * Updates the reactive configuration, root attribute, and saved user preference.
193
+ */
194
+ export declare function setVLiteScale(scale: VLiteScale): VLiteScale;
190
195
  /**
191
196
  * Composable to access the VLite configuration.
192
197
  * It attempts to inject from the Vue context first, falling back to the global singleton.
193
198
  */
194
199
  export declare function useVLiteConfig(): {
195
200
  services?: {
196
- upload?: import('..').FileUploadHandler;
197
- t?: import('..').TranslationHandler;
201
+ upload?: import('../index.ts').FileUploadHandler;
202
+ t?: import('../index.ts').TranslationHandler;
198
203
  importApi?: (entity: string, payload: any) => Promise<any>;
199
204
  exportApi?: (entity: string, payload: any) => Promise<any>;
200
205
  };
@@ -207,9 +212,9 @@ export declare function useVLiteConfig(): {
207
212
  };
208
213
  components?: {
209
214
  form?: {
210
- variant?: import('..').InputVariant;
211
- size?: import('..').InputSize;
212
- rounded?: import('..').InputRounded;
215
+ variant?: import('../index.ts').InputVariant;
216
+ size?: import('../index.ts').InputSize;
217
+ rounded?: import('../index.ts').InputRounded;
213
218
  showRequiredAsterisk?: boolean;
214
219
  };
215
220
  price?: {
@@ -224,11 +229,11 @@ export declare function useVLiteConfig(): {
224
229
  apiKey?: string;
225
230
  };
226
231
  empty?: {
227
- variant?: import('..').EmptyVariant;
232
+ variant?: import('../index.ts').EmptyVariant;
228
233
  };
229
234
  statusChip?: {
230
235
  hideIcon?: boolean;
231
- customStatuses?: Record<string, import('..').CustomStatusConfig>;
236
+ customStatuses?: Record<string, import('../index.ts').CustomStatusConfig>;
232
237
  };
233
238
  attachmentsList?: {
234
239
  variant?: "default" | "list" | "inline" | "card";
@@ -255,16 +260,16 @@ export declare function useVLiteConfig(): {
255
260
  title?: string;
256
261
  class?: string;
257
262
  titleI18n?: string;
258
- variant?: import('..').ListVariant;
263
+ variant?: import('../index.ts').ListVariant;
259
264
  titleIcon?: string;
260
- columns?: import('..').ListColumns;
265
+ columns?: import('../index.ts').ListColumns;
261
266
  showColon?: boolean;
262
267
  loading?: boolean;
263
268
  skeletonRows?: number;
264
- stackedBorderStyle?: import('..').StackedBorderStyle;
269
+ stackedBorderStyle?: import('../index.ts').StackedBorderStyle;
265
270
  };
266
271
  invoice?: {
267
- variant?: import('..').InvoiceVariant;
272
+ variant?: import('../index.ts').InvoiceVariant;
268
273
  compact?: boolean;
269
274
  displayBarcodeValue?: boolean;
270
275
  labels?: {
@@ -290,7 +295,7 @@ export declare function useVLiteConfig(): {
290
295
  };
291
296
  };
292
297
  footer?: {
293
- variant?: import('..').FooterVariant;
298
+ variant?: import('../index.ts').FooterVariant;
294
299
  labels?: {
295
300
  followUs?: string;
296
301
  subscribe?: string;
@@ -299,7 +304,7 @@ export declare function useVLiteConfig(): {
299
304
  containerClass?: string | any[] | Record<string, boolean>;
300
305
  };
301
306
  cart?: {
302
- variant?: import('..').CartVariant;
307
+ variant?: import('../index.ts').CartVariant;
303
308
  labels?: {
304
309
  cart?: string;
305
310
  emptyTitle?: string;
@@ -355,12 +360,13 @@ export declare function useVLiteConfig(): {
355
360
  validateCoupon?: (code: string, context: {
356
361
  subtotal: number;
357
362
  currency?: string;
358
- items: import('..').CartItem[];
359
- }) => Promise<import('..').CartCouponDefinition | {
363
+ items: import('../index.ts').CartItem[];
364
+ }) => Promise<import('../index.ts').CartCouponDefinition | {
360
365
  code: string;
361
366
  message: string;
362
367
  state?: "invalid" | "expired" | "error";
363
368
  } | null>;
364
369
  };
365
370
  };
371
+ scale: VLiteScale;
366
372
  };
package/core/config.js CHANGED
@@ -1,6 +1,8 @@
1
- import { reactive as n, inject as c } from "vue";
2
- import { deepMerge as r } from "../utils/object.js";
3
- const i = /* @__PURE__ */ Symbol("vlite-config"), s = {
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,
4
6
  services: {},
5
7
  components: {
6
8
  form: {},
@@ -17,17 +19,25 @@ const i = /* @__PURE__ */ Symbol("vlite-config"), s = {
17
19
  customStatuses: {}
18
20
  }
19
21
  }
20
- }, e = n({ ...s });
21
- function f(t) {
22
- const o = r(e, t);
23
- Object.assign(e, o);
22
+ }, t = i({ ...f });
23
+ function p(e) {
24
+ const c = n(t, {
25
+ ...e,
26
+ ...e.scale === void 0 ? {} : { scale: a(e.scale) }
27
+ });
28
+ Object.assign(t, c), e.scale !== void 0 && (t.scale = o(t.scale));
24
29
  }
25
- function u() {
26
- return c(i, e);
30
+ function S(e) {
31
+ const c = o(e);
32
+ return t.scale = c, c;
33
+ }
34
+ function g() {
35
+ return s(l, t);
27
36
  }
28
37
  export {
29
- i as VLITE_CONFIG_KEY,
30
- e as configState,
31
- f as updateConfig,
32
- u as useVLiteConfig
38
+ l as VLITE_CONFIG_KEY,
39
+ t as configState,
40
+ S as setVLiteScale,
41
+ p as updateConfig,
42
+ g as useVLiteConfig
33
43
  };
package/core/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { App } from 'vue';
2
- import { VLiteConfig } from '../types/config.type';
2
+ import { VLiteConfig } from '../types/config.type.ts';
3
3
  /**
4
4
  * Creates the VLite plugin instance.
5
5
  */
6
6
  export declare function createVLite(options?: VLiteConfig): {
7
7
  install(app: App): void;
8
8
  };
9
- export * from './config';
9
+ export * from './config.ts';
10
+ export * from './CoreScale.ts';
package/core/index.js CHANGED
@@ -1,59 +1,70 @@
1
- import { configState as t, VLITE_CONFIG_KEY as m } from "./config.js";
2
- import { updateConfig as p, useVLiteConfig as i } from "./config.js";
3
- function c(e = {}) {
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 = {}) {
4
6
  return {
5
- install(o) {
6
- e && (e.services && (t.services = { ...t.services, ...e.services }), e.importData && (t.importData = { ...t.importData, ...e.importData }), e.exportData && (t.exportData = { ...t.exportData, ...e.exportData }), e.components && (t.components = {
7
- ...t.components,
7
+ 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 = {
8
9
  ...e.components,
10
+ ...t.components,
9
11
  form: {
10
- ...t.components?.form || {},
11
- ...e.components.form || {}
12
+ ...e.components?.form || {},
13
+ ...t.components.form || {}
12
14
  },
13
15
  price: {
14
- ...t.components?.price || {},
15
- ...e.components.price || {}
16
+ ...e.components?.price || {},
17
+ ...t.components.price || {}
16
18
  },
17
19
  datetime: {
18
- ...t.components?.datetime || {},
19
- ...e.components.datetime || {}
20
+ ...e.components?.datetime || {},
21
+ ...t.components.datetime || {}
20
22
  },
21
23
  googleMap: {
22
- ...t.components?.googleMap || {},
23
- ...e.components.googleMap || {}
24
+ ...e.components?.googleMap || {},
25
+ ...t.components.googleMap || {}
24
26
  },
25
27
  empty: {
26
- ...t.components?.empty || {},
27
- ...e.components.empty || {}
28
+ ...e.components?.empty || {},
29
+ ...t.components.empty || {}
28
30
  },
29
31
  statusChip: {
30
- ...t.components?.statusChip || {},
31
- ...e.components.statusChip || {},
32
+ ...e.components?.statusChip || {},
33
+ ...t.components.statusChip || {},
32
34
  customStatuses: {
33
- ...t.components?.statusChip?.customStatuses || {},
34
- ...e.components.statusChip?.customStatuses || {}
35
+ ...e.components?.statusChip?.customStatuses || {},
36
+ ...t.components.statusChip?.customStatuses || {}
35
37
  }
36
38
  },
37
39
  attachmentsList: {
38
- ...t.components?.attachmentsList || {},
39
- ...e.components.attachmentsList || {}
40
+ ...e.components?.attachmentsList || {},
41
+ ...t.components.attachmentsList || {}
40
42
  },
41
43
  list: {
42
- ...t.components?.list || {},
43
- ...e.components.list || {}
44
+ ...e.components?.list || {},
45
+ ...t.components.list || {}
44
46
  },
45
47
  invoice: {
46
- ...t.components?.invoice || {},
47
- ...e.components.invoice || {}
48
+ ...e.components?.invoice || {},
49
+ ...t.components.invoice || {}
48
50
  }
49
- })), o.provide(m, t), o.config.globalProperties.$vlite = t;
51
+ })), c.provide(o, e), c.config.globalProperties.$vlite = e;
50
52
  }
51
53
  };
52
54
  }
53
55
  export {
54
- m as VLITE_CONFIG_KEY,
55
- t as configState,
56
- c as createVLite,
57
- p as updateConfig,
58
- i as useVLiteConfig
56
+ u as DEFAULT_VLITE_SCALE,
57
+ o as VLITE_CONFIG_KEY,
58
+ S as VLITE_SCALE_ATTRIBUTE,
59
+ g as VLITE_SCALE_STORAGE_KEY,
60
+ E as applyVLiteScale,
61
+ 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
59
70
  };
package/index.d.ts CHANGED
@@ -104,7 +104,7 @@ export { default as CommandPaletteContent } from './components/CommandPalette/Co
104
104
  export { default as NavbarCommandPalette } from './components/NavbarCommandPalette.vue';
105
105
  export { default as DateRangePicker } from './components/DateRangePicker.vue';
106
106
  export { $t } from './utils/i18n';
107
- export { createVLite, useVLiteConfig } from './core';
107
+ export { applyVLiteScale, createVLite, DEFAULT_VLITE_SCALE, getStoredVLiteScale, initializeVLiteScale, isVLiteScale, resolveVLiteScale, setVLiteScale, useVLiteConfig, VLITE_SCALE_ATTRIBUTE, VLITE_SCALE_STORAGE_KEY, } from './core';
108
108
  export { GoogleSignInPlugin };
109
109
  export * from './components/StatusChip';
110
110
  export * from './components/Price';