vlite3 1.2.1 → 1.2.2

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 (38) hide show
  1. package/components/AppShell/AppShellLayoutClassic.vue.js +67 -64
  2. package/components/AppShell/AppShellLayoutDashboard.vue.js +75 -70
  3. package/components/AppShell/AppShellLayoutDock.vue.js +27 -27
  4. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +80 -75
  5. package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +56 -56
  6. package/components/DataTable/DataTable.vue.d.ts +3 -3
  7. package/components/DataTable/DataTableRow.vue.d.ts +1 -1
  8. package/components/Form/CustomFields.vue.js +2 -2
  9. package/components/Form/CustomFields.vue2.js +15 -2
  10. package/components/Invoice/InvoiceVariant1.vue.js +225 -176
  11. package/components/Invoice/InvoiceVariant2.vue.js +174 -125
  12. package/components/Invoice/InvoiceVariant3.vue.js +186 -157
  13. package/components/Invoice/InvoiceVariant4.vue.js +200 -156
  14. package/components/Invoice/types.d.ts +10 -1
  15. package/components/List/ListFieldRow.vue.js +16 -16
  16. package/components/List/utils.d.ts +2 -2
  17. package/components/List/utils.js +6 -9
  18. package/components/NavbarCommandPalette.vue.js +1 -1
  19. package/components/Price/Price.vue.d.ts +2 -0
  20. package/components/Price/Price.vue.js +15 -12
  21. package/components/Screen/Screen.vue.d.ts +36 -10
  22. package/components/Screen/Screen.vue.js +398 -304
  23. package/components/Screen/components/ScreenToolbar.vue.d.ts +62 -0
  24. package/components/Screen/components/ScreenToolbar.vue.js +116 -0
  25. package/components/Screen/components/ScreenToolbar.vue2.js +4 -0
  26. package/components/Screen/types.d.ts +9 -0
  27. package/components/Stats/StatItem.vue.js +88 -87
  28. package/components/Stats/Stats.vue.js +20 -20
  29. package/components/Stats/types.d.ts +3 -1
  30. package/core/config.d.ts +10 -0
  31. package/core/config.js +11 -9
  32. package/index.js +131 -131
  33. package/package.json +1 -1
  34. package/style.css +1 -1
  35. package/types/config.type.d.ts +2 -0
  36. package/types/list.type.d.ts +4 -0
  37. package/utils/functions.d.ts +9 -10
  38. package/utils/functions.js +78 -63
@@ -1,11 +1,11 @@
1
- import { defineComponent as M, ref as $, computed as v, openBlock as t, createElementBlock as a, normalizeClass as s, createElementVNode as c, createBlock as f, createCommentVNode as x, toDisplayString as b, renderSlot as w, resolveDynamicComponent as L, Fragment as m, createVNode as p } from "vue";
1
+ import { defineComponent as M, ref as $, computed as v, openBlock as t, createElementBlock as a, normalizeClass as s, createElementVNode as c, createBlock as f, createCommentVNode as x, toDisplayString as h, renderSlot as w, resolveDynamicComponent as L, Fragment as m, createVNode as p } from "vue";
2
2
  import g from "../Icon.vue.js";
3
3
  import k from "../Price/Price.vue.js";
4
4
  import { $t as j } from "../../utils/i18n.js";
5
- import { formatDate as V } from "../../utils/functions.js";
6
- import { getObjectValue as I, formatNumber as N } from "./utils.js";
7
- import { getStatusColorClass as D } from "../../utils/status.js";
8
- const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs font-normal text-muted-foreground leading-snug truncate" }, O = { class: "min-w-0" }, z = {
5
+ import { formatDate as V, formatNumber as I } from "../../utils/functions.js";
6
+ import { getObjectValue as N } from "./utils.js";
7
+ import { getStatusColorClass as F } from "../../utils/status.js";
8
+ const D = { class: "flex items-center gap-2 min-w-0" }, E = { class: "text-xs font-normal text-muted-foreground leading-snug truncate" }, O = { class: "min-w-0" }, z = {
9
9
  key: 2,
10
10
  class: "flex items-center gap-1.5"
11
11
  }, R = ["innerHTML"], Y = {
@@ -38,7 +38,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
38
38
  autoLineByLineThreshold: { default: 50 }
39
39
  },
40
40
  setup(e) {
41
- const l = e, i = $(!1), o = v(() => I(l.field.key, l.data)), r = v(() => {
41
+ const l = e, i = $(!1), o = v(() => N(l.field.key, l.data)), r = v(() => {
42
42
  const n = o.value;
43
43
  if (l.field.format)
44
44
  return l.field.format(n, l.data);
@@ -46,7 +46,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
46
46
  return l.field.emptyText ?? "--";
47
47
  switch (l.field.type) {
48
48
  case "number":
49
- return N(n);
49
+ return I(n, { numberFormat: l.field.numberFormat || "compact", compactThreshold: l.field.compactThreshold });
50
50
  case "boolean":
51
51
  return n ? "Yes" : "No";
52
52
  case "date":
@@ -61,7 +61,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
61
61
  ), d = v(() => {
62
62
  const n = [];
63
63
  if (l.field.addStatusColor) {
64
- const u = D(r.value);
64
+ const u = F(r.value);
65
65
  u && n.push(u);
66
66
  }
67
67
  if (l.field.class)
@@ -71,7 +71,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
71
71
  } else
72
72
  n.push(l.field.class);
73
73
  return n.join(" ");
74
- }), h = v(() => l.field.type === "image"), B = v(() => l.variant === "striped" && l.index % 2 !== 0), C = v(() => l.variant === "stacked"), S = v(() => l.field.lineByLineLayout === "inline" ? !1 : l.field.lineByLineLayout === "block" || l.field.lineByLine ? !0 : l.autoLineByLineThreshold > 0 ? String(r.value ?? "").length > l.autoLineByLineThreshold : !1), H = v(() => l.stackedBorderStyle === "divider" && l.stackedColIndex !== 0 ? "border-l border-border pl-4 pr-3.5 py-2" : "px-3.5 py-2");
74
+ }), b = v(() => l.field.type === "image"), B = v(() => l.variant === "striped" && l.index % 2 !== 0), C = v(() => l.variant === "stacked"), S = v(() => l.field.lineByLineLayout === "inline" ? !1 : l.field.lineByLineLayout === "block" || l.field.lineByLine ? !0 : l.autoLineByLineThreshold > 0 ? String(r.value ?? "").length > l.autoLineByLineThreshold : !1), H = v(() => l.stackedBorderStyle === "divider" && l.stackedColIndex !== 0 ? "border-l border-border pl-4 pr-3.5 py-2" : "px-3.5 py-2");
75
75
  return (n, u) => C.value ? (t(), a("div", {
76
76
  key: 0,
77
77
  class: s([
@@ -80,13 +80,13 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
80
80
  ]),
81
81
  role: "row"
82
82
  }, [
83
- c("div", E, [
83
+ c("div", D, [
84
84
  e.field.icon ? (t(), f(g, {
85
85
  key: 0,
86
86
  icon: e.field.icon,
87
87
  class: "w-3 h-3 text-muted-foreground shrink-0"
88
88
  }, null, 8, ["icon"])) : x("", !0),
89
- c("span", F, b(y.value), 1)
89
+ c("span", E, h(y.value), 1)
90
90
  ]),
91
91
  c("div", O, [
92
92
  n.$slots[e.field.key] ? w(n.$slots, e.field.key, {
@@ -121,7 +121,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
121
121
  class: "w-3 h-3"
122
122
  }, null, 8, ["icon"])
123
123
  ], 8, q)
124
- ])) : h.value ? (t(), a("img", {
124
+ ])) : b.value ? (t(), a("img", {
125
125
  key: 3,
126
126
  src: r.value,
127
127
  alt: y.value,
@@ -154,7 +154,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
154
154
  icon: e.field.icon,
155
155
  class: "w-3.5 h-3.5 text-gray-800 shrink-0"
156
156
  }, null, 8, ["icon"])) : x("", !0),
157
- c("span", K, b(y.value) + b(e.showColon ? ":" : ""), 1)
157
+ c("span", K, h(y.value) + h(e.showColon ? ":" : ""), 1)
158
158
  ]),
159
159
  c("div", P, [
160
160
  n.$slots[e.field.key] ? w(n.$slots, e.field.key, {
@@ -189,7 +189,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
189
189
  class: "w-3.5 h-3.5"
190
190
  }, null, 8, ["icon"])
191
191
  ], 8, X)
192
- ])) : h.value ? (t(), a("img", {
192
+ ])) : b.value ? (t(), a("img", {
193
193
  key: 3,
194
194
  src: r.value,
195
195
  alt: y.value,
@@ -222,7 +222,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
222
222
  icon: e.field.icon,
223
223
  class: "w-3.5 h-3.5 text-gray-800 shrink-0"
224
224
  }, null, 8, ["icon"])) : x("", !0),
225
- c("span", te, b(y.value) + b(e.showColon ? ":" : ""), 1)
225
+ c("span", te, h(y.value) + h(e.showColon ? ":" : ""), 1)
226
226
  ]),
227
227
  c("div", le, [
228
228
  n.$slots[e.field.key] ? w(n.$slots, e.field.key, {
@@ -257,7 +257,7 @@ const E = { class: "flex items-center gap-2 min-w-0" }, F = { class: "text-xs fo
257
257
  class: "w-3.5 h-3.5"
258
258
  }, null, 8, ["icon"])
259
259
  ], 8, ie)
260
- ], 64)) : h.value ? (t(), a("img", {
260
+ ], 64)) : b.value ? (t(), a("img", {
261
261
  key: 3,
262
262
  src: r.value,
263
263
  alt: y.value,
@@ -1,8 +1,8 @@
1
1
  import { getStatusColorClass } from '../../utils/status';
2
+ import { formatNumber } from '../../utils/functions';
2
3
  /**
3
4
  * Resolves a dot-notation path from a nested object.
4
5
  * e.g. getObjectValue('location.city', data) => 'New York'
5
6
  */
6
7
  export declare function getObjectValue(path: string, obj: Record<string, any>): any;
7
- export { getStatusColorClass };
8
- export declare function formatNumber(value: any): string;
8
+ export { getStatusColorClass, formatNumber };
@@ -1,12 +1,9 @@
1
- function u(r, e) {
2
- if (!(!r || !e))
3
- return r.includes(".") ? r.split(".").reduce((n, t) => n?.[t], e) : e[r];
4
- }
5
- function i(r) {
6
- const e = Number(r);
7
- return isNaN(e) ? String(r ?? "--") : new Intl.NumberFormat("en-US").format(e);
1
+ import "../../core/config.js";
2
+ import "dayjs";
3
+ function c(e, r) {
4
+ if (!(!e || !r))
5
+ return e.includes(".") ? e.split(".").reduce((i, t) => i?.[t], r) : r[e];
8
6
  }
9
7
  export {
10
- i as formatNumber,
11
- u as getObjectValue
8
+ c as getObjectValue
12
9
  };
@@ -48,7 +48,7 @@ const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline
48
48
  return (e, l) => o.enabled ? (M(), E(K, { key: 0 }, [
49
49
  a("button", {
50
50
  type: "button",
51
- class: D(["command-palette-trigger inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm text-muted-foreground bg-muted/60 hover:bg-muted border border-border/60 focus-visible:outline-none justify-between focus-visible:ring-2 focus-visible:ring-primary/50 select-none cursor-pointer shrink-0", o.triggerClass]),
51
+ class: D(["command-palette-trigger inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm text-muted-foreground bg-muted/60 hover:bg-muted border border-border/90 focus-visible:outline-none justify-between focus-visible:ring-2 focus-visible:ring-primary/50 select-none cursor-pointer shrink-0", o.triggerClass]),
52
52
  "aria-label": "Open command palette",
53
53
  onClick: b
54
54
  }, [
@@ -1,6 +1,8 @@
1
1
  type __VLS_Props = {
2
2
  value?: number | string;
3
3
  currency?: string;
4
+ numberFormat?: 'standard' | 'compact';
5
+ compactThreshold?: number;
4
6
  };
5
7
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
6
8
  value: number | string;
@@ -1,26 +1,29 @@
1
- import { defineComponent as m, computed as t, openBlock as s, createElementBlock as i, toDisplayString as l } from "vue";
2
- import { useVLiteConfig as p } from "../../core/config.js";
3
- const d = /* @__PURE__ */ m({
1
+ import { defineComponent as p, computed as o, openBlock as i, createElementBlock as l, toDisplayString as h } from "vue";
2
+ import { useVLiteConfig as f } from "../../core/config.js";
3
+ const v = /* @__PURE__ */ p({
4
4
  __name: "Price",
5
5
  props: {
6
6
  value: { default: 0 },
7
- currency: {}
7
+ currency: {},
8
+ numberFormat: {},
9
+ compactThreshold: {}
8
10
  },
9
11
  setup(n) {
10
- const r = n, c = p(), o = t(() => r.currency || c?.components?.price?.currency || "USD"), u = t(() => {
11
- const e = Number(r.value) || 0;
12
+ const t = n, c = f(), a = o(() => t.currency || c?.components?.price?.currency || "USD"), m = o(() => t.numberFormat || c?.components?.price?.numberFormat || "compact"), u = o(() => {
13
+ const r = Number(t.value) || 0;
12
14
  try {
13
- return new Intl.NumberFormat("en-US", {
15
+ const e = {
14
16
  style: "currency",
15
- currency: o.value
16
- }).format(e);
17
+ currency: a.value
18
+ }, s = t.compactThreshold ?? c?.components?.price?.compactThreshold ?? 1e3;
19
+ return m.value === "compact" && Math.abs(r) >= s && (e.notation = "compact", e.compactDisplay = "short"), new Intl.NumberFormat("en-US", e).format(r);
17
20
  } catch {
18
- return `$${e.toFixed(2)}`;
21
+ return `$${r.toFixed(2)}`;
19
22
  }
20
23
  });
21
- return (e, a) => (s(), i("span", null, l(u.value), 1));
24
+ return (r, e) => (i(), l("span", null, h(u.value), 1));
22
25
  }
23
26
  });
24
27
  export {
25
- d as default
28
+ v as default
26
29
  };
@@ -18,7 +18,7 @@ declare function __VLS_template(): {
18
18
  hasData: boolean;
19
19
  loading: boolean;
20
20
  }): any;
21
- description?(_: {
21
+ title?(_: {
22
22
  activeView: string;
23
23
  searchQuery: string;
24
24
  activeFilters: Record<string, any>;
@@ -34,7 +34,7 @@ declare function __VLS_template(): {
34
34
  hasData: boolean;
35
35
  loading: boolean;
36
36
  }): any;
37
- 'before-search'?(_: {
37
+ description?(_: {
38
38
  activeView: string;
39
39
  searchQuery: string;
40
40
  activeFilters: Record<string, any>;
@@ -50,7 +50,7 @@ declare function __VLS_template(): {
50
50
  hasData: boolean;
51
51
  loading: boolean;
52
52
  }): any;
53
- actions?(_: {
53
+ description?(_: {
54
54
  activeView: string;
55
55
  searchQuery: string;
56
56
  activeFilters: Record<string, any>;
@@ -66,7 +66,14 @@ declare function __VLS_template(): {
66
66
  hasData: boolean;
67
67
  loading: boolean;
68
68
  }): any;
69
- 'after-add'?(_: {
69
+ 'header-stats'?(_: {}): any;
70
+ 'before-search'?(_: any): any;
71
+ 'before-search'?(_: any): any;
72
+ actions?(_: any): any;
73
+ actions?(_: any): any;
74
+ 'after-add'?(_: any): any;
75
+ 'after-add'?(_: any): any;
76
+ 'custom-header'?(_: {
70
77
  activeView: string;
71
78
  searchQuery: string;
72
79
  activeFilters: Record<string, any>;
@@ -114,6 +121,22 @@ declare function __VLS_template(): {
114
121
  hasData: boolean;
115
122
  loading: boolean;
116
123
  }): any;
124
+ 'sub-header'?(_: {
125
+ activeView: string;
126
+ searchQuery: string;
127
+ activeFilters: Record<string, any>;
128
+ activeQuickFilter: string | number;
129
+ activeSort: {
130
+ field: string;
131
+ order: string;
132
+ };
133
+ page: number;
134
+ limit: number;
135
+ selectedRows: any[];
136
+ isFiltered: boolean;
137
+ hasData: boolean;
138
+ loading: boolean;
139
+ }): any;
117
140
  empty?(_: {
118
141
  activeView: string;
119
142
  searchQuery: string;
@@ -316,24 +339,27 @@ declare const __VLS_component: import('vue').DefineComponent<ScreenProps, {}, {}
316
339
  }>, {
317
340
  name: string;
318
341
  data: any[];
342
+ variant: "one" | "two";
319
343
  loading: boolean;
320
344
  exportProps: Record<string, any> | boolean;
321
345
  importProps: Record<string, any> | boolean;
322
346
  canAdd: boolean;
323
347
  emptyIcon: string;
348
+ hideSelectable: boolean;
349
+ hideDeleteBtn: boolean;
350
+ showRefresh: boolean;
351
+ filterSchema: import('../Form').IForm[];
352
+ filterType: "modal" | "dropdown";
353
+ canSearch: boolean;
354
+ stats: import('../Stats').StatItemSchema[] | any[];
355
+ statsProps: Partial<import('../Stats').StatsProps>;
324
356
  paginationProps: import('./types').ScreenPaginationProps;
325
357
  exportSchema: import('../ExportData').ExportField[] | any[];
326
358
  importSchema: import('../ImportData').ImportField[] | any[];
327
359
  importType: string;
328
360
  customHeader: boolean;
329
- canSearch: boolean;
330
361
  pagination: boolean;
331
- filterSchema: import('../Form').IForm[];
332
- filterType: "modal" | "dropdown";
333
- showRefresh: boolean;
334
362
  viewProps: Record<string, any>;
335
- hideSelectable: boolean;
336
- hideDeleteBtn: boolean;
337
363
  quickFilters: import('./types').ScreenQuickFilter[];
338
364
  skipQuickFilterViews: string[];
339
365
  quickFilterKey: string;