vlite3 0.9.7 → 0.9.8
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/Accordion/Accordion.vue.d.ts +1 -1
- package/components/Accordion/AccordionItem.vue.d.ts +1 -1
- package/components/Accordion/AccordionTrigger.vue.d.ts +1 -1
- package/components/Alert.vue.d.ts +1 -1
- package/components/Avatar.vue.d.ts +2 -2
- package/components/Avatar.vue.js +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/BackButton.vue.d.ts +1 -1
- package/components/Badge.vue.d.ts +1 -1
- package/components/Barcode/Barcode.vue.d.ts +1 -1
- package/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/components/Button.vue.d.ts +2 -2
- package/components/CheckBox.vue.d.ts +1 -1
- package/components/Chip/Chip.vue.d.ts +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DataTable/DataTable.vue.js +55 -54
- package/components/DataTable/DataTableHeader.vue.js +5 -3
- package/components/DataTable/DataTableRow.vue.js +23 -24
- package/components/DatePicker.vue.js +93 -73
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Input.vue.d.ts +3 -3
- package/components/Kanban/KanbanBoard.vue2.js +29 -27
- package/components/List/List.vue.d.ts +1 -1
- package/components/List/List.vue.js +1 -1
- package/components/Navbar/Navbar.vue.d.ts +2 -2
- package/components/Navbar/NavbarItem.vue.d.ts +1 -1
- package/components/Navbar/NavbarTabs.vue.d.ts +1 -1
- package/components/NumberInput.vue.d.ts +1 -1
- package/components/OTPInput/OTPInput.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -2
- package/components/PermissionMatrix/PermissionMatrix.vue.d.ts +2 -2
- package/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.d.ts +1 -1
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidePanel.vue.d.ts +1 -1
- package/components/Spinner/Spinner.vue.d.ts +2 -2
- package/components/Stats/Stats.vue.d.ts +1 -1
- package/components/StatusChip/StatusChip.vue.d.ts +1 -1
- package/index.js +255 -254
- package/package.json +1 -1
- package/utils/functions.d.ts +25 -10
- package/utils/functions.js +112 -70
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
package/utils/functions.js
CHANGED
|
@@ -1,95 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { configState as f } from "../core/config.js";
|
|
2
|
+
import c from "dayjs";
|
|
3
|
+
const p = (t, r) => {
|
|
4
|
+
let e;
|
|
3
5
|
return (...n) => {
|
|
4
|
-
clearTimeout(
|
|
5
|
-
|
|
6
|
-
},
|
|
6
|
+
clearTimeout(e), e = setTimeout(() => {
|
|
7
|
+
t(...n);
|
|
8
|
+
}, r);
|
|
7
9
|
};
|
|
8
10
|
};
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return
|
|
11
|
+
function b() {
|
|
12
|
+
const t = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), r = Array.from(crypto.getRandomValues(new Uint8Array(5))).map((n) => n.toString(16).padStart(2, "0")).join(""), e = Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
|
|
13
|
+
return t + r + e;
|
|
12
14
|
}
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
},
|
|
15
|
+
const h = () => {
|
|
16
|
+
const t = /Mac|MacIntel|MacPPC/.test(navigator.platform) && !/iPad|iPhone|iPod/.test(navigator.platform), r = /iPhone/.test(navigator.platform) || /iPhone/.test(navigator.userAgent), e = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
17
|
+
return t || r || e;
|
|
18
|
+
}, g = async (t = "", r = "file") => {
|
|
17
19
|
try {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
} catch (
|
|
21
|
-
console.error("Download error:",
|
|
20
|
+
const e = r || "file", n = t?.includes(".application/") ? `${e}.${t?.split("/").pop()}` : `${e}.${t?.split(".").pop()}`, a = await (await fetch(t)).blob(), s = window.URL.createObjectURL(a), i = document.createElement("a");
|
|
21
|
+
i.href = s, i.setAttribute("download", n), document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(s);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.error("Download error:", e);
|
|
22
24
|
}
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
return !
|
|
26
|
-
(
|
|
25
|
+
}, m = (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(m) : !1;
|
|
26
|
+
function u(t, r) {
|
|
27
|
+
return !t || typeof t != "object" ? t : Array.isArray(t) ? t.map((e) => u(e, r)) : Object.entries(t).reduce(
|
|
28
|
+
(e, [n, o]) => (r.includes(n) || (e[n] = u(o, r)), e),
|
|
27
29
|
{}
|
|
28
30
|
);
|
|
29
31
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
Object?.values(
|
|
33
|
-
) :
|
|
32
|
+
function l(t) {
|
|
33
|
+
return t.reduce((r, e) => Array.isArray(e) ? r.concat(l(e)) : e && typeof e == "object" ? r.concat(
|
|
34
|
+
Object?.values(e)?.flatMap?.((n) => typeof n == "object" ? l([n]) : [n])
|
|
35
|
+
) : r.concat(e), []);
|
|
34
36
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
37
|
-
let
|
|
38
|
-
const
|
|
39
|
-
n && o ? (
|
|
37
|
+
const w = (t) => typeof t == "string" ? t?.replace(/(^\w|[.!?]\s+\w)/g, (r) => r.toUpperCase()) : t, O = (t) => !t || typeof t != "string" ? "" : t[0].toLowerCase() + t.slice(1);
|
|
38
|
+
function A(t, r) {
|
|
39
|
+
let e = null, n = null, o = null;
|
|
40
|
+
const a = () => {
|
|
41
|
+
n && o ? (t.apply(o, n), n = null, o = null, e = setTimeout(a, r)) : e = null;
|
|
40
42
|
};
|
|
41
|
-
return (...
|
|
42
|
-
|
|
43
|
+
return (...s) => {
|
|
44
|
+
e ? (n = s, o = this) : (t.apply(this, s), e = setTimeout(a, r));
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
|
-
const
|
|
46
|
-
if (!Number.isFinite(
|
|
47
|
+
const M = (t) => typeof t != "string" ? "" : t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/[\s-]+/g, "-").replace(/^-+|-+$/g, ""), j = (t, r) => {
|
|
48
|
+
if (!Number.isFinite(t) || !Number.isFinite(r))
|
|
47
49
|
throw new TypeError("Both min and max must be finite numbers");
|
|
48
|
-
if (
|
|
49
|
-
throw new RangeError(`min (${
|
|
50
|
-
const
|
|
51
|
-
return Math.floor(Math.random() * (n -
|
|
52
|
-
},
|
|
53
|
-
if (typeof
|
|
54
|
-
if (!Number.isFinite(
|
|
55
|
-
const n =
|
|
56
|
-
if (n <= 0) return
|
|
57
|
-
const o =
|
|
58
|
-
return (
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
currency
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
if (t > r)
|
|
51
|
+
throw new RangeError(`min (${t}) must not be greater than max (${r})`);
|
|
52
|
+
const e = Math.ceil(t), n = Math.floor(r);
|
|
53
|
+
return Math.floor(Math.random() * (n - e + 1)) + e;
|
|
54
|
+
}, k = (t, r, e = "...") => {
|
|
55
|
+
if (typeof t != "string") return "";
|
|
56
|
+
if (!Number.isFinite(r) || r < 0 || t.length <= r) return t;
|
|
57
|
+
const n = r - e.length;
|
|
58
|
+
if (n <= 0) return e.slice(0, r);
|
|
59
|
+
const o = t.slice(0, n), a = o.lastIndexOf(" ");
|
|
60
|
+
return (a > 0 ? o.slice(0, a) : o) + e;
|
|
61
|
+
}, C = (t, r = "en-US", e) => {
|
|
62
|
+
if (!Number.isFinite(t)) return "";
|
|
63
|
+
const n = e || f?.components?.price?.currency || "USD";
|
|
64
|
+
return new Intl.NumberFormat(r, {
|
|
65
|
+
style: "currency",
|
|
66
|
+
currency: n
|
|
67
|
+
}).format(t);
|
|
68
|
+
}, S = (t) => !Number.isFinite(t) || t < 0 ? Promise.reject(new RangeError("Delay must be a non-negative finite number")) : new Promise((r) => setTimeout(r, t)), N = async (t) => {
|
|
69
|
+
if (typeof t != "string") return !1;
|
|
64
70
|
if (navigator?.clipboard?.writeText)
|
|
65
71
|
try {
|
|
66
|
-
return await navigator.clipboard.writeText(
|
|
72
|
+
return await navigator.clipboard.writeText(t), !0;
|
|
67
73
|
} catch {
|
|
68
74
|
}
|
|
69
75
|
try {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
return document.body.removeChild(
|
|
76
|
+
const r = document.createElement("textarea");
|
|
77
|
+
r.value = t, r.setAttribute("readonly", ""), r.style.position = "fixed", r.style.left = "-9999px", r.style.opacity = "0", document.body.appendChild(r), r.select();
|
|
78
|
+
const e = document.execCommand("copy");
|
|
79
|
+
return document.body.removeChild(r), e;
|
|
74
80
|
} catch {
|
|
75
81
|
return !1;
|
|
76
82
|
}
|
|
83
|
+
}, P = (t = "month", r, e = c()) => {
|
|
84
|
+
let n = e, o, a = e;
|
|
85
|
+
switch (["week", "month", "3-months", "6-months", "year"].includes(t) && e.date() <= 7 && (a = e.subtract(1, "month")), t) {
|
|
86
|
+
case "last-week":
|
|
87
|
+
o = e.subtract(6, "day").startOf("day"), n = e.endOf("day");
|
|
88
|
+
break;
|
|
89
|
+
case "last-month":
|
|
90
|
+
o = e.subtract(29, "day").startOf("day"), n = e.endOf("day");
|
|
91
|
+
break;
|
|
92
|
+
case "year":
|
|
93
|
+
o = a.subtract(11, "month").startOf("month"), n = a.endOf("month");
|
|
94
|
+
break;
|
|
95
|
+
case "6-months":
|
|
96
|
+
o = a.subtract(5, "month").startOf("month"), n = a.endOf("month");
|
|
97
|
+
break;
|
|
98
|
+
case "3-months":
|
|
99
|
+
o = a.subtract(2, "month").startOf("month"), n = a.endOf("month");
|
|
100
|
+
break;
|
|
101
|
+
case "week":
|
|
102
|
+
o = a.startOf("week"), n = a.endOf("week");
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
o = a.startOf("month"), n = a.endOf("month");
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
if (r) {
|
|
109
|
+
const s = c(r);
|
|
110
|
+
n.isAfter(s) && (n = s), o.isAfter(s) && (o = s.startOf("day"));
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
startDate: o.format("YYYY-MM-DD"),
|
|
114
|
+
endDate: n.format("YYYY-MM-DD"),
|
|
115
|
+
startDayjs: o,
|
|
116
|
+
endDayjs: n
|
|
117
|
+
};
|
|
77
118
|
};
|
|
78
119
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
A as
|
|
120
|
+
O as camelCase,
|
|
121
|
+
w as capitalize,
|
|
122
|
+
N as copyToClipboard,
|
|
123
|
+
p as debounce,
|
|
124
|
+
S as delay,
|
|
125
|
+
g as downloadFile,
|
|
126
|
+
l as flattenArray,
|
|
127
|
+
C as formatCurrency,
|
|
128
|
+
P as getDefaultDateRange,
|
|
129
|
+
b as getUniqueId,
|
|
130
|
+
h as isAppleDevice,
|
|
131
|
+
m as isEmpty,
|
|
132
|
+
j as randomNumber,
|
|
133
|
+
u as removeExtraProperties,
|
|
134
|
+
M as slugify,
|
|
135
|
+
A as throttle,
|
|
136
|
+
k as truncate
|
|
95
137
|
};
|
|
File without changes
|