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.
Files changed (44) hide show
  1. package/components/Accordion/Accordion.vue.d.ts +1 -1
  2. package/components/Accordion/AccordionItem.vue.d.ts +1 -1
  3. package/components/Accordion/AccordionTrigger.vue.d.ts +1 -1
  4. package/components/Alert.vue.d.ts +1 -1
  5. package/components/Avatar.vue.d.ts +2 -2
  6. package/components/Avatar.vue.js +1 -1
  7. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  8. package/components/BackButton.vue.d.ts +1 -1
  9. package/components/Badge.vue.d.ts +1 -1
  10. package/components/Barcode/Barcode.vue.d.ts +1 -1
  11. package/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
  12. package/components/Button.vue.d.ts +2 -2
  13. package/components/CheckBox.vue.d.ts +1 -1
  14. package/components/Chip/Chip.vue.d.ts +1 -1
  15. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  16. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  17. package/components/DataTable/DataTable.vue.js +55 -54
  18. package/components/DataTable/DataTableHeader.vue.js +5 -3
  19. package/components/DataTable/DataTableRow.vue.js +23 -24
  20. package/components/DatePicker.vue.js +93 -73
  21. package/components/Form/FormField.vue.d.ts +1 -1
  22. package/components/Input.vue.d.ts +3 -3
  23. package/components/Kanban/KanbanBoard.vue2.js +29 -27
  24. package/components/List/List.vue.d.ts +1 -1
  25. package/components/List/List.vue.js +1 -1
  26. package/components/Navbar/Navbar.vue.d.ts +2 -2
  27. package/components/Navbar/NavbarItem.vue.d.ts +1 -1
  28. package/components/Navbar/NavbarTabs.vue.d.ts +1 -1
  29. package/components/NumberInput.vue.d.ts +1 -1
  30. package/components/OTPInput/OTPInput.vue.d.ts +1 -1
  31. package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -2
  32. package/components/PermissionMatrix/PermissionMatrix.vue.d.ts +2 -2
  33. package/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
  34. package/components/Screen/Screen.vue.d.ts +1 -1
  35. package/components/Screen/ScreenFilter.vue.js +1 -1
  36. package/components/SidePanel.vue.d.ts +1 -1
  37. package/components/Spinner/Spinner.vue.d.ts +2 -2
  38. package/components/Stats/Stats.vue.d.ts +1 -1
  39. package/components/StatusChip/StatusChip.vue.d.ts +1 -1
  40. package/index.js +255 -254
  41. package/package.json +1 -1
  42. package/utils/functions.d.ts +25 -10
  43. package/utils/functions.js +112 -70
  44. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,95 +1,137 @@
1
- const f = (e, t) => {
2
- let r;
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(r), r = setTimeout(() => {
5
- e(...n);
6
- }, t);
6
+ clearTimeout(e), e = setTimeout(() => {
7
+ t(...n);
8
+ }, r);
7
9
  };
8
10
  };
9
- function p() {
10
- const e = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), t = 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");
11
- return e + t + r;
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 d = () => {
14
- const e = /Mac|MacIntel|MacPPC/.test(navigator.platform) && !/iPad|iPhone|iPod/.test(navigator.platform), t = /iPhone/.test(navigator.platform) || /iPhone/.test(navigator.userAgent), r = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
15
- return e || t || r;
16
- }, y = async (e = "", t = "file") => {
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 r = t || "file", n = e?.includes(".application/") ? `${r}.${e?.split("/").pop()}` : `${r}.${e?.split(".").pop()}`, i = await (await fetch(e)).blob(), a = window.URL.createObjectURL(i), c = document.createElement("a");
19
- c.href = a, c.setAttribute("download", n), document.body.appendChild(c), c.click(), document.body.removeChild(c), window.URL.revokeObjectURL(a);
20
- } catch (r) {
21
- console.error("Download error:", r);
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
- }, l = (e) => e == null || e === "" || typeof e == "number" && e === 0 || Array.isArray(e) && e.length === 0 ? !0 : typeof e == "object" && !Array.isArray(e) ? Object.keys(e).length === 0 || Object.values(e).every(l) : !1;
24
- function s(e, t) {
25
- return !e || typeof e != "object" ? e : Array.isArray(e) ? e.map((r) => s(r, t)) : Object.entries(e).reduce(
26
- (r, [n, o]) => (t.includes(n) || (r[n] = s(o, t)), r),
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 u(e) {
31
- return e.reduce((t, r) => Array.isArray(r) ? t.concat(u(r)) : r && typeof r == "object" ? t.concat(
32
- Object?.values(r)?.flatMap?.((n) => typeof n == "object" ? u([n]) : [n])
33
- ) : t.concat(r), []);
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 m = (e) => typeof e == "string" ? e?.replace(/(^\w|[.!?]\s+\w)/g, (t) => t.toUpperCase()) : e, b = (e) => !e || typeof e != "string" ? "" : e[0].toLowerCase() + e.slice(1);
36
- function g(e, t) {
37
- let r = null, n = null, o = null;
38
- const i = () => {
39
- n && o ? (e.apply(o, n), n = null, o = null, r = setTimeout(i, t)) : r = null;
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 (...a) => {
42
- r ? (n = a, o = this) : (e.apply(this, a), r = setTimeout(i, t));
43
+ return (...s) => {
44
+ e ? (n = s, o = this) : (t.apply(this, s), e = setTimeout(a, r));
43
45
  };
44
46
  }
45
- const h = (e) => typeof e != "string" ? "" : e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/[\s-]+/g, "-").replace(/^-+|-+$/g, ""), w = (e, t) => {
46
- if (!Number.isFinite(e) || !Number.isFinite(t))
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 (e > t)
49
- throw new RangeError(`min (${e}) must not be greater than max (${t})`);
50
- const r = Math.ceil(e), n = Math.floor(t);
51
- return Math.floor(Math.random() * (n - r + 1)) + r;
52
- }, A = (e, t, r = "") => {
53
- if (typeof e != "string") return "";
54
- if (!Number.isFinite(t) || t < 0 || e.length <= t) return e;
55
- const n = t - r.length;
56
- if (n <= 0) return r.slice(0, t);
57
- const o = e.slice(0, n), i = o.lastIndexOf(" ");
58
- return (i > 0 ? o.slice(0, i) : o) + r;
59
- }, j = (e, t = "en-US", r = "USD") => Number.isFinite(e) ? new Intl.NumberFormat(t, {
60
- style: "currency",
61
- currency: r
62
- }).format(e) : "", C = (e) => !Number.isFinite(e) || e < 0 ? Promise.reject(new RangeError("Delay must be a non-negative finite number")) : new Promise((t) => setTimeout(t, e)), M = async (e) => {
63
- if (typeof e != "string") return !1;
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(e), !0;
72
+ return await navigator.clipboard.writeText(t), !0;
67
73
  } catch {
68
74
  }
69
75
  try {
70
- const t = document.createElement("textarea");
71
- t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.left = "-9999px", t.style.opacity = "0", document.body.appendChild(t), t.select();
72
- const r = document.execCommand("copy");
73
- return document.body.removeChild(t), r;
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
- b as camelCase,
80
- m as capitalize,
81
- M as copyToClipboard,
82
- f as debounce,
83
- C as delay,
84
- y as downloadFile,
85
- u as flattenArray,
86
- j as formatCurrency,
87
- p as getUniqueId,
88
- d as isAppleDevice,
89
- l as isEmpty,
90
- w as randomNumber,
91
- s as removeExtraProperties,
92
- h as slugify,
93
- g as throttle,
94
- A as truncate
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
  };