vuesp-components 1.3.4 → 1.3.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/helpers/general.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,GAAG,IAAI,QAQ5C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,OAAO,KAAG,MAA8E,CAAC;AAE1H,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,QAA+B,CAAC;AAEjE,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,WAMnC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,UAAS,IAAI,CAAC,qBAA6E,EAAE,kBAAa,WAClH,CAAC;AAExD,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,UAAS,IAAI,CAAC,qBAA8D,EAAE,kBAAa,WACnG,CAAC;AAExD,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,oBAAwC,CAAC;AAE9E,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,WAQxC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,EAAE,WAAgB,CAAC;AACrD,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,aAAgC,CAAC"}
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/helpers/general.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,GAAG,IAAI,QAO5C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,OAAO,KAAG,MAA8E,CAAC;AAE1H,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,QAA+B,CAAC;AAEjE,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,WAMnC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,UAAS,IAAI,CAAC,qBAA6E,EAAE,kBAAa,WAClH,CAAC;AAExD,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,UAAS,IAAI,CAAC,qBAA8D,EAAE,kBAAa,WACnG,CAAC;AAExD,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,oBAAwC,CAAC;AAE9E,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,WAQxC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,EAAE,WAAgB,CAAC;AACrD,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,aAAgC,CAAC"}
@@ -4,7 +4,7 @@ const c = (t) => {
4
4
  } catch (e) {
5
5
  return console.warn(e), t;
6
6
  }
7
- }, s = (t) => typeof t == "object" ? JSON.stringify(t) : t, h = (t) => c(s(t)), g = (t) => {
7
+ }, s = (t) => typeof t == "object" ? JSON.stringify(t) : t, g = (t) => c(s(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));
@@ -12,19 +12,19 @@ const c = (t) => {
12
12
  }, f = (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}`, p = (t) => {
13
13
  const e = Math.floor(t % 31536e3 % 2628e3 / 86400), o = Math.floor(t % (3600 * 24) / 3600), n = Math.floor(t % 3600 / 60), m = Math.floor(t % 60);
14
14
  return `${e ? e + " days " : ""} ${r(o)}:${r(n)}:${r(m)}`;
15
- }, w = (t) => t.join("."), M = (t) => t.split(".").map((e) => +e), y = (t, e = "file") => {
15
+ }, w = (t) => t.join("."), y = (t) => t.split(".").map((e) => +e), M = (t, e = "file") => {
16
16
  const o = document.createElement("a");
17
17
  o.setAttribute("download", e), o.href = t, document.body.appendChild(o), o.click(), o.remove();
18
18
  }, T = (t) => new Promise((e, o) => {
19
19
  const n = document.createElement("script");
20
20
  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
- }), i = (t) => (e) => c(t.getItem(e)), a = (t) => (e, o) => {
22
- t && t.setItem(e, s(o));
23
- }, u = i(localStorage), l = a(localStorage), E = i(sessionStorage), L = a(sessionStorage), $ = (t = "isShow") => {
21
+ }), i = (t) => (e, o) => o ? c(t.getItem(e)) : t.getItem(e), l = (t) => (e, o) => {
22
+ t && t.setItem(e, typeof o == "string" ? o : s(o));
23
+ }, u = i(localStorage), a = l(localStorage), E = i(sessionStorage), L = l(sessionStorage), $ = (t = "isShow") => {
24
24
  const e = u(t);
25
- return e || l(t, !0), !e;
25
+ return e || a(t, "true"), !e;
26
26
  }, j = (t) => {
27
- l("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
27
+ a("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
28
28
  }, d = (t, e) => {
29
29
  if (!t) return null;
30
30
  for (const o of t)
@@ -36,8 +36,8 @@ export {
36
36
  r as addZero,
37
37
  w as arrToStr,
38
38
  j as changeTheme,
39
- h as clone,
40
- y as createDownloadLink,
39
+ g as clone,
40
+ M as createDownloadLink,
41
41
  f as dateUtcToString,
42
42
  d as findMenuItem,
43
43
  B as getPageTitle,
@@ -46,11 +46,11 @@ export {
46
46
  s as jsonString,
47
47
  T as loadScript,
48
48
  u as localGet,
49
- l as localSet,
49
+ a as localSet,
50
50
  p as secToTime,
51
51
  E as sessionGet,
52
52
  L as sessionSet,
53
- M as strToArr,
53
+ y as strToArr,
54
54
  S as timeUtcToString,
55
- g as toByte
55
+ h as toByte
56
56
  };
@@ -1,7 +1,7 @@
1
1
  export declare const createDownloadLink: (href: string, name?: string) => void;
2
2
  export declare const loadScript: (src: string) => Promise<unknown>;
3
- export declare const localGet: (name: string) => any;
4
- export declare const localSet: (name: string, data: unknown) => void;
5
- export declare const sessionGet: (name: string) => any;
6
- export declare const sessionSet: (name: string, data: unknown) => void;
3
+ export declare const localGet: (name: string, isJSON?: boolean) => any;
4
+ export declare const localSet: (name: string, data: string | object) => void;
5
+ export declare const sessionGet: (name: string, isJSON?: boolean) => any;
6
+ export declare const sessionSet: (name: string, data: string | object) => void;
7
7
  //# sourceMappingURL=web-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-api.d.ts","sourceRoot":"","sources":["../../src/helpers/web-api.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,aAAa,SAO7D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,qBAUrC,CAAC;AAOF,eAAO,MAAM,QAAQ,SALyB,MAAM,QAKJ,CAAC;AACjD,eAAO,MAAM,QAAQ,SALyB,MAAM,QAAQ,OAAO,SAKnB,CAAC;AACjD,eAAO,MAAM,UAAU,SAPuB,MAAM,QAOA,CAAC;AACrD,eAAO,MAAM,UAAU,SAPuB,MAAM,QAAQ,OAAO,SAOf,CAAC"}
1
+ {"version":3,"file":"web-api.d.ts","sourceRoot":"","sources":["../../src/helpers/web-api.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,aAAa,SAO7D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,qBAUrC,CAAC;AASF,eAAO,MAAM,QAAQ,SAPyB,MAAM,WAAW,OAAO,QAOtB,CAAC;AACjD,eAAO,MAAM,QAAQ,SALyB,MAAM,QAAQ,MAAM,GAAG,MAAM,SAK3B,CAAC;AACjD,eAAO,MAAM,UAAU,SATuB,MAAM,WAAW,OAAO,QASlB,CAAC;AACrD,eAAO,MAAM,UAAU,SAPuB,MAAM,QAAQ,MAAM,GAAG,MAAM,SAOvB,CAAC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.4",
2
+ "version": "1.3.5",
3
3
  "name": "vuesp-components",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",