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.
- package/components/AppShell/AppShellLayoutClassic.vue.js +67 -64
- package/components/AppShell/AppShellLayoutDashboard.vue.js +75 -70
- package/components/AppShell/AppShellLayoutDock.vue.js +27 -27
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +80 -75
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +56 -56
- package/components/DataTable/DataTable.vue.d.ts +3 -3
- package/components/DataTable/DataTableRow.vue.d.ts +1 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +15 -2
- package/components/Invoice/InvoiceVariant1.vue.js +225 -176
- package/components/Invoice/InvoiceVariant2.vue.js +174 -125
- package/components/Invoice/InvoiceVariant3.vue.js +186 -157
- package/components/Invoice/InvoiceVariant4.vue.js +200 -156
- package/components/Invoice/types.d.ts +10 -1
- package/components/List/ListFieldRow.vue.js +16 -16
- package/components/List/utils.d.ts +2 -2
- package/components/List/utils.js +6 -9
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Price/Price.vue.d.ts +2 -0
- package/components/Price/Price.vue.js +15 -12
- package/components/Screen/Screen.vue.d.ts +36 -10
- package/components/Screen/Screen.vue.js +398 -304
- package/components/Screen/components/ScreenToolbar.vue.d.ts +62 -0
- package/components/Screen/components/ScreenToolbar.vue.js +116 -0
- package/components/Screen/components/ScreenToolbar.vue2.js +4 -0
- package/components/Screen/types.d.ts +9 -0
- package/components/Stats/StatItem.vue.js +88 -87
- package/components/Stats/Stats.vue.js +20 -20
- package/components/Stats/types.d.ts +3 -1
- package/core/config.d.ts +10 -0
- package/core/config.js +11 -9
- package/index.js +131 -131
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/config.type.d.ts +2 -0
- package/types/list.type.d.ts +4 -0
- package/utils/functions.d.ts +9 -10
- package/utils/functions.js +78 -63
package/utils/functions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { configState as m } from "../core/config.js";
|
|
2
|
-
import
|
|
3
|
-
const
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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),
|
|
21
|
-
|
|
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
|
-
},
|
|
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
|
|
33
|
-
return t.reduce((e, r) => Array.isArray(r) ? e.concat(
|
|
34
|
-
Object?.values(r)?.flatMap?.((n) => typeof n == "object" ?
|
|
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
|
|
38
|
-
function
|
|
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
|
-
}
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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 =
|
|
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 ?
|
|
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 [
|
|
127
|
-
if (
|
|
128
|
-
const l =
|
|
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 =
|
|
134
|
-
}, U = (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
|
|
137
|
-
},
|
|
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
|
|
144
|
-
return a.format(
|
|
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 (
|
|
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
|
|
170
|
+
return c(`1970-01-01T${o}:${s}:${a}`);
|
|
157
171
|
}
|
|
158
|
-
const r = e.match(
|
|
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
|
|
164
|
-
return
|
|
177
|
+
const i = n.toString().padStart(2, "0");
|
|
178
|
+
return c(`1970-01-01T${i}:${o}:${s}`);
|
|
165
179
|
}
|
|
166
180
|
}
|
|
167
|
-
return
|
|
168
|
-
},
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
191
|
+
N as camelCase,
|
|
192
|
+
F as capitalize,
|
|
193
|
+
v as copyToClipboard,
|
|
194
|
+
A as debounce,
|
|
181
195
|
j as delay,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
$ as downloadFile,
|
|
197
|
+
h as flattenArray,
|
|
198
|
+
O as formatAmPm,
|
|
185
199
|
E as formatCurrency,
|
|
186
|
-
|
|
200
|
+
Z as formatDate,
|
|
201
|
+
S as formatNumber,
|
|
187
202
|
R as formatSchedule,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
209
|
+
z as getTomorrow,
|
|
210
|
+
Y as getUniqueId,
|
|
211
|
+
H as getUpcoming,
|
|
212
|
+
X as getYear,
|
|
198
213
|
x as getYesterday,
|
|
199
|
-
|
|
200
|
-
|
|
214
|
+
I as isAppleDevice,
|
|
215
|
+
g as isEmpty,
|
|
201
216
|
f as isPureTimeString,
|
|
202
|
-
|
|
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
|
-
|
|
222
|
+
D as throttle,
|
|
208
223
|
U as toISO,
|
|
209
224
|
V as toLocalISO,
|
|
210
225
|
C as truncate
|