vuesp-components 2.2.0 → 2.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.
@@ -4,56 +4,61 @@ const c = (t) => {
4
4
  } catch (e) {
5
5
  return console.warn(e), t;
6
6
  }
7
- }, i = (t) => typeof t == "object" ? JSON.stringify(t) : t, h = (t) => c(i(t)), f = (t) => {
7
+ }, i = (t) => typeof t == "object" ? JSON.stringify(t) : t, g = (t) => c(i(t)), h = (t) => {
8
8
  const e = ["B", "KB", "MB"];
9
9
  if (t == 0) return "0 B";
10
10
  let o = Math.floor(Math.log(t) / Math.log(1024));
11
11
  return o > 1 && (o = 1), Math.round(t / Math.pow(1024, o)) + " " + e[o];
12
- }, p = (t, e = { year: "numeric", month: "numeric", day: "numeric" }, o = []) => new Date(t).toLocaleDateString(o, e), S = (t, e = { minute: "2-digit", hour: "2-digit" }, o = []) => new Date(t).toLocaleTimeString(o, e), r = (t) => t >= 10 ? t : `0${t}`, w = (t) => {
12
+ }, p = (t, e = { year: "numeric", month: "numeric", day: "numeric" }, o = []) => new Date(t).toLocaleDateString(o, e), S = (t, e = { minute: "2-digit", hour: "2-digit" }, o = []) => new Date(t).toLocaleTimeString(o, e), s = (t) => t >= 10 ? t : `0${t}`, y = (t) => {
13
13
  const e = Math.floor(t % 31536e3 % 2628e3 / 86400), o = Math.floor(t % (3600 * 24) / 3600), n = Math.floor(t % 3600 / 60), u = Math.floor(t % 60);
14
- return `${e ? e + " days " : ""} ${r(o)}:${r(n)}:${r(u)}`;
15
- }, y = (t) => t.join("."), M = (t) => t.split(".").map((e) => +e), T = (t = 6) => [...Array(t)].map(() => "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[Math.random() * 62 | 0]).join(""), j = (t, e = "file") => {
14
+ return `${e ? e + " days " : ""} ${s(o)}:${s(n)}:${s(u)}`;
15
+ }, w = (t) => t.join("."), M = (t) => t.split(".").map((e) => +e), T = (t = 6) => [...Array(t)].map(() => "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[Math.random() * 62 | 0]).join(""), E = (t, e = "file") => {
16
+ if (typeof document > "u") return;
16
17
  const o = document.createElement("a");
17
18
  o.setAttribute("download", e), o.href = t, document.body.appendChild(o), o.click(), o.remove();
18
- }, E = (t) => new Promise((e, o) => {
19
+ }, b = (t) => new Promise((e, o) => {
20
+ if (typeof document > "u") {
21
+ o(new Error("Script loading is available only in a browser"));
22
+ return;
23
+ }
19
24
  const n = document.createElement("script");
20
25
  n.src = t, n.type = "text/javascript", n.async = !0, n.onload = () => e(n), n.onerror = () => o(new Error(`Ошибка загрузки скрипта: ${t}`)), document.head.appendChild(n);
21
- }), s = typeof window < "u", a = (t) => (e, o) => o ? c(t.getItem(e)) : t.getItem(e), l = (t) => (e, o) => {
26
+ }), r = typeof window < "u", a = (t) => (e, o) => o ? c(t.getItem(e)) : t.getItem(e), l = (t) => (e, o) => {
22
27
  t.setItem(e, typeof o == "string" ? o : i(o));
23
- }, d = s ? a(localStorage) : () => null, m = s ? l(localStorage) : () => {
24
- }, L = s ? a(sessionStorage) : () => null, k = s ? l(sessionStorage) : () => {
25
- }, B = (t = "isShow") => {
26
- const e = d(t);
27
- return e || m(t, "true"), !e;
28
- }, $ = (t) => {
29
- m("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
30
- }, g = (t, e) => {
28
+ }, m = r ? a(localStorage) : () => null, d = r ? l(localStorage) : () => {
29
+ }, j = r ? a(sessionStorage) : () => null, L = r ? l(sessionStorage) : () => {
30
+ }, k = (t = "isShow") => {
31
+ const e = m(t);
32
+ return e || d(t, "true"), !e;
33
+ }, B = (t) => {
34
+ d("theme", t), !(typeof document > "u") && (document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t));
35
+ }, f = (t, e) => {
31
36
  if (!t) return null;
32
37
  for (const o of t)
33
38
  if (!(e === "/" || o.path === "/") && (o.path === e || e.includes(o.path)))
34
39
  return o;
35
40
  return null;
36
- }, b = (t, e) => g(t, e);
41
+ }, $ = (t, e) => f(t, e);
37
42
  export {
38
- r as a,
39
- y as b,
40
- $ as c,
41
- h as d,
42
- j as e,
43
+ s as a,
44
+ w as b,
45
+ B as c,
46
+ g as d,
47
+ E as e,
43
48
  p as f,
44
- g,
45
- b as h,
46
- B as i,
49
+ f as g,
50
+ $ as h,
51
+ k as i,
47
52
  c as j,
48
53
  i as k,
49
- E as l,
50
- d as m,
51
- m as n,
52
- L as o,
53
- k as p,
54
+ b as l,
55
+ m,
56
+ d as n,
57
+ j as o,
58
+ L as p,
54
59
  M as q,
55
60
  T as r,
56
- w as s,
61
+ y as s,
57
62
  S as t,
58
- f as u
63
+ h as u
59
64
  };