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,6 +1,6 @@
1
1
  import { configState as m } from "../core/config.js";
2
- import i from "dayjs";
3
- const w = (t, e) => {
2
+ import c from "dayjs";
3
+ const A = (t, e) => {
4
4
  let r;
5
5
  return (...n) => {
6
6
  clearTimeout(r), r = setTimeout(() => {
@@ -8,34 +8,34 @@ const w = (t, e) => {
8
8
  }, e);
9
9
  };
10
10
  };
11
- function A() {
11
+ function Y() {
12
12
  const t = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), e = Array.from(crypto.getRandomValues(new Uint8Array(5))).map((n) => n.toString(16).padStart(2, "0")).join(""), r = Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
13
13
  return t + e + r;
14
14
  }
15
- const Y = () => {
15
+ const I = () => {
16
16
  const t = /Mac|MacIntel|MacPPC/.test(navigator.platform) && !/iPad|iPhone|iPod/.test(navigator.platform), e = /iPhone/.test(navigator.platform) || /iPhone/.test(navigator.userAgent), r = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
17
17
  return t || e || r;
18
- }, I = async (t = "", e = "file") => {
18
+ }, $ = async (t = "", e = "file") => {
19
19
  try {
20
- const r = e || "file", n = t?.includes(".application/") ? `${r}.${t?.split("/").pop()}` : `${r}.${t?.split(".").pop()}`, s = await (await fetch(t)).blob(), a = window.URL.createObjectURL(s), c = document.createElement("a");
21
- c.href = a, c.setAttribute("download", n), document.body.appendChild(c), c.click(), document.body.removeChild(c), window.URL.revokeObjectURL(a);
20
+ const r = e || "file", n = t?.includes(".application/") ? `${r}.${t?.split("/").pop()}` : `${r}.${t?.split(".").pop()}`, s = await (await fetch(t)).blob(), a = window.URL.createObjectURL(s), i = document.createElement("a");
21
+ i.href = a, i.setAttribute("download", n), document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(a);
22
22
  } catch (r) {
23
23
  console.error("Download error:", r);
24
24
  }
25
- }, b = (t) => t == null || t === "" || typeof t == "number" && t === 0 || Array.isArray(t) && t.length === 0 ? !0 : typeof t == "object" && !Array.isArray(t) ? Object.keys(t).length === 0 || Object.values(t).every(b) : !1;
25
+ }, g = (t) => t == null || t === "" || typeof t == "number" && t === 0 || Array.isArray(t) && t.length === 0 ? !0 : typeof t == "object" && !Array.isArray(t) ? Object.keys(t).length === 0 || Object.values(t).every(g) : !1;
26
26
  function p(t, e) {
27
27
  return !t || typeof t != "object" ? t : Array.isArray(t) ? t.map((r) => p(r, e)) : Object.entries(t).reduce(
28
28
  (r, [n, o]) => (e.includes(n) || (r[n] = p(o, e)), r),
29
29
  {}
30
30
  );
31
31
  }
32
- function y(t) {
33
- return t.reduce((e, r) => Array.isArray(r) ? e.concat(y(r)) : r && typeof r == "object" ? e.concat(
34
- Object?.values(r)?.flatMap?.((n) => typeof n == "object" ? y([n]) : [n])
32
+ function h(t) {
33
+ return t.reduce((e, r) => Array.isArray(r) ? e.concat(h(r)) : r && typeof r == "object" ? e.concat(
34
+ Object?.values(r)?.flatMap?.((n) => typeof n == "object" ? h([n]) : [n])
35
35
  ) : e.concat(r), []);
36
36
  }
37
- const $ = (t) => typeof t == "string" ? t?.replace(/(^\w|[.!?]\s+\w)/g, (e) => e.toUpperCase()) : t, D = (t) => !t || typeof t != "string" ? "" : t[0].toLowerCase() + t.slice(1);
38
- function N(t, e) {
37
+ const F = (t) => typeof t == "string" ? t?.replace(/(^\w|[.!?]\s+\w)/g, (e) => e.toUpperCase()) : t, N = (t) => !t || typeof t != "string" ? "" : t[0].toLowerCase() + t.slice(1);
38
+ function D(t, e) {
39
39
  let r = null, n = null, o = null;
40
40
  const s = () => {
41
41
  n && o ? (t.apply(o, n), n = null, o = null, r = setTimeout(s, e)) : r = null;
@@ -58,14 +58,28 @@ const P = (t) => typeof t != "string" ? "" : t.normalize("NFD").replace(/[\u0300
58
58
  if (n <= 0) return r.slice(0, e);
59
59
  const o = t.slice(0, n), s = o.lastIndexOf(" ");
60
60
  return (s > 0 ? o.slice(0, s) : o) + r;
61
- }, E = (t, e = "en-US", r) => {
62
- if (console.log("amount", t), !Number.isFinite(t)) return "";
63
- const n = r || m?.components?.price?.currency || "USD";
64
- return console.log("resolvedCurrency", n), new Intl.NumberFormat(e, {
65
- style: "currency",
66
- currency: n
67
- }).format(t);
68
- }, j = (t) => !Number.isFinite(t) || t < 0 ? Promise.reject(new RangeError("Delay must be a non-negative finite number")) : new Promise((e) => setTimeout(e, t)), F = async (t) => {
61
+ };
62
+ function S(t, e = {}) {
63
+ const r = Number(t);
64
+ if (!Number.isFinite(r)) return "";
65
+ const n = e.locale || "en-US";
66
+ let o = e.numberFormat || "standard";
67
+ const s = e.compactThreshold ?? 1e3;
68
+ o === "compact" && Math.abs(r) < s && (o = "standard");
69
+ const a = {};
70
+ return e.currency && (a.style = "currency", a.currency = e.currency), o === "compact" && (a.notation = "compact", a.compactDisplay = "short"), new Intl.NumberFormat(n, a).format(r);
71
+ }
72
+ const E = (t, e = {}) => {
73
+ const r = Number(t);
74
+ if (!Number.isFinite(r)) return "";
75
+ const n = e.currency || m?.components?.price?.currency || "USD", o = e.numberFormat || m?.components?.price?.numberFormat || "standard", s = e.compactThreshold ?? m?.components?.price?.compactThreshold ?? 1e3;
76
+ return S(r, {
77
+ locale: e.locale,
78
+ currency: n,
79
+ numberFormat: o,
80
+ compactThreshold: s
81
+ });
82
+ }, j = (t) => !Number.isFinite(t) || t < 0 ? Promise.reject(new RangeError("Delay must be a non-negative finite number")) : new Promise((e) => setTimeout(e, t)), v = async (t) => {
69
83
  if (typeof t != "string") return !1;
70
84
  if (navigator?.clipboard?.writeText)
71
85
  try {
@@ -80,7 +94,7 @@ const P = (t) => typeof t != "string" ? "" : t.normalize("NFD").replace(/[\u0300
80
94
  } catch {
81
95
  return !1;
82
96
  }
83
- }, v = (t = "month", e, r = i()) => {
97
+ }, T = (t = "month", e, r = c()) => {
84
98
  let n = r, o, s = r;
85
99
  switch (["week", "month", "3-months", "6-months", "year"].includes(t) && r.date() <= 7 && (s = r.subtract(1, "month")), t) {
86
100
  case "last-week":
@@ -106,42 +120,42 @@ const P = (t) => typeof t != "string" ? "" : t.normalize("NFD").replace(/[\u0300
106
120
  break;
107
121
  }
108
122
  if (e) {
109
- const a = i(e);
123
+ const a = c(e);
110
124
  n.isAfter(a) && (n = a), o.isAfter(a) && (o = a.startOf("day"));
111
125
  }
112
126
  return {
113
127
  startDate: o.format("YYYY-MM-DD"),
114
128
  endDate: n.format("YYYY-MM-DD")
115
129
  };
116
- }, S = (t) => {
130
+ }, O = (t) => {
117
131
  if (!t) return "";
118
132
  const [e, r] = t.split(":");
119
133
  if (!e || !r) return t;
120
- const n = i().hour(Number(e)).minute(Number(r));
134
+ const n = c().hour(Number(e)).minute(Number(r));
121
135
  return n.isValid() ? n.format("hh:mm A") : t;
122
136
  }, R = (t, e, r) => {
123
- const n = m?.components?.datetime?.format || "MMM DD, YYYY", o = t ? i(t).format(n) : "";
137
+ const n = m?.components?.datetime?.format || "MMM DD, YYYY", o = t ? c(t).format(n) : "";
124
138
  let s = e;
125
139
  if (e) {
126
- const [c, d] = e.split(":");
127
- if (c && d) {
128
- const l = i().hour(Number(c)).minute(Number(d));
140
+ const [i, d] = e.split(":");
141
+ if (i && d) {
142
+ const l = c().hour(Number(i)).minute(Number(d));
129
143
  l.isValid() && (s = l.format("hh:mm"));
130
144
  }
131
145
  }
132
146
  let a = r;
133
- return r && (a = S(r)), !e && !r ? o : o ? `${o} • ${s} - ${a}` : `${s} - ${a}`;
134
- }, U = (t) => i(t || void 0).toISOString(), V = (t) => i(t || void 0).format("YYYY-MM-DDTHH:mm:ss.SSSZ"), L = () => i().toISOString(), x = () => i().subtract(1, "day").toISOString(), T = () => i().add(1, "day").toISOString(), z = (t = 7) => i().add(t, "day").toISOString(), H = () => i().add(1, "month").toISOString(), B = () => i().subtract(1, "month").toISOString(), G = () => i().toISOString(), X = () => i().add(1, "year").toISOString(), _ = () => i().subtract(1, "year").toISOString(), h = /^([01]?\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/, g = /^(0?[1-9]|1[0-2]):([0-5]\d)(:([0-5]\d))?\s*(AM|PM|am|pm)$/, f = (t) => {
147
+ return r && (a = O(r)), !e && !r ? o : o ? `${o} • ${s} - ${a}` : `${s} - ${a}`;
148
+ }, U = (t) => c(t || void 0).toISOString(), V = (t) => c(t || void 0).format("YYYY-MM-DDTHH:mm:ss.SSSZ"), L = () => c().toISOString(), x = () => c().subtract(1, "day").toISOString(), z = () => c().add(1, "day").toISOString(), H = (t = 7) => c().add(t, "day").toISOString(), B = () => c().add(1, "month").toISOString(), G = () => c().subtract(1, "month").toISOString(), X = () => c().toISOString(), _ = () => c().add(1, "year").toISOString(), q = () => c().subtract(1, "year").toISOString(), y = /^([01]?\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/, b = /^(0?[1-9]|1[0-2]):([0-5]\d)(:([0-5]\d))?\s*(AM|PM|am|pm)$/, f = (t) => {
135
149
  const e = t.trim();
136
- return h.test(e) || g.test(e);
137
- }, q = (t, e, r) => {
150
+ return y.test(e) || b.test(e);
151
+ }, Z = (t, e, r) => {
138
152
  if (t == null || t === "") return "--";
139
153
  const n = m?.components?.datetime?.format || "MM/DD/YYYY";
140
154
  if (typeof t == "string" && f(t)) {
141
155
  const a = u(t);
142
156
  if (a.isValid()) {
143
- const c = e || "hh:mm A";
144
- return a.format(c);
157
+ const i = e || "hh:mm A";
158
+ return a.format(i);
145
159
  }
146
160
  }
147
161
  let o = e;
@@ -151,21 +165,21 @@ const P = (t) => typeof t != "string" ? "" : t.normalize("NFD").replace(/[\u0300
151
165
  }, u = (t) => {
152
166
  if (typeof t == "string") {
153
167
  const e = t.trim();
154
- if (h.test(e)) {
168
+ if (y.test(e)) {
155
169
  const n = e.split(":"), o = n[0].padStart(2, "0"), s = n[1], a = n[2] || "00";
156
- return i(`1970-01-01T${o}:${s}:${a}`);
170
+ return c(`1970-01-01T${o}:${s}:${a}`);
157
171
  }
158
- const r = e.match(g);
172
+ const r = e.match(b);
159
173
  if (r) {
160
174
  let n = parseInt(r[1], 10);
161
175
  const o = r[2], s = r[4] || "00", a = r[5].toUpperCase();
162
176
  n === 12 && a === "AM" ? n = 0 : n < 12 && a === "PM" && (n += 12);
163
- const c = n.toString().padStart(2, "0");
164
- return i(`1970-01-01T${c}:${o}:${s}`);
177
+ const i = n.toString().padStart(2, "0");
178
+ return c(`1970-01-01T${i}:${o}:${s}`);
165
179
  }
166
180
  }
167
- return i(t || void 0);
168
- }, Z = (t, e, r) => {
181
+ return c(t || void 0);
182
+ }, J = (t, e, r) => {
169
183
  if (t == null || t === "" || e === null || e === void 0 || e === "")
170
184
  return !0;
171
185
  let n = r !== void 0 ? r : !0;
@@ -174,37 +188,38 @@ const P = (t) => typeof t != "string" ? "" : t.normalize("NFD").replace(/[\u0300
174
188
  return !o.isValid() || !s.isValid() ? !1 : n && s.isSame(o) || s.isAfter(o);
175
189
  };
176
190
  export {
177
- D as camelCase,
178
- $ as capitalize,
179
- F as copyToClipboard,
180
- w as debounce,
191
+ N as camelCase,
192
+ F as capitalize,
193
+ v as copyToClipboard,
194
+ A as debounce,
181
195
  j as delay,
182
- I as downloadFile,
183
- y as flattenArray,
184
- S as formatAmPm,
196
+ $ as downloadFile,
197
+ h as flattenArray,
198
+ O as formatAmPm,
185
199
  E as formatCurrency,
186
- q as formatDate,
200
+ Z as formatDate,
201
+ S as formatNumber,
187
202
  R as formatSchedule,
188
- v as getDefaultDateRange,
189
- H as getNextMonth,
190
- X as getNextYear,
191
- B as getPrevMonth,
192
- _ as getPrevYear,
203
+ T as getDefaultDateRange,
204
+ B as getNextMonth,
205
+ _ as getNextYear,
206
+ G as getPrevMonth,
207
+ q as getPrevYear,
193
208
  L as getToday,
194
- T as getTomorrow,
195
- A as getUniqueId,
196
- z as getUpcoming,
197
- G as getYear,
209
+ z as getTomorrow,
210
+ Y as getUniqueId,
211
+ H as getUpcoming,
212
+ X as getYear,
198
213
  x as getYesterday,
199
- Y as isAppleDevice,
200
- b as isEmpty,
214
+ I as isAppleDevice,
215
+ g as isEmpty,
201
216
  f as isPureTimeString,
202
- Z as isValidTimeRange,
217
+ J as isValidTimeRange,
203
218
  u as parseDateTime,
204
219
  k as randomNumber,
205
220
  p as removeExtraProperties,
206
221
  P as slugify,
207
- N as throttle,
222
+ D as throttle,
208
223
  U as toISO,
209
224
  V as toLocalISO,
210
225
  C as truncate