mvframe 1.0.17 → 1.0.20

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.
@@ -6,7 +6,7 @@ import { i as no, c as vi, w as Os, s as Od, a as jn, b as ca, d as pi, l as ia,
6
6
  import { S as mm } from "./async-validator.js";
7
7
  import { w as gm, E as Ga } from "./@sxzz.js";
8
8
  import { T as Sl } from "./@ctrl.js";
9
- import { d as Ue, c as hi, l as Vd, a as bm, w as ym, b as Cm, e as wm, i as Sm, f as km } from "./dayjs.js";
9
+ import { d as Ue, c as hi, l as Vd, a as bm, w as ym, b as Cm, e as wm, f as Sm, g as km } from "./dayjs.js";
10
10
  import { m as Em } from "./memoize-one.js";
11
11
  import { Y as Tm } from "./normalize-wheel-es.js";
12
12
  import { o as $m, f as Nm, s as Im, a as xm, b as Om, d as Rm, c as Mm } from "./@floating-ui.js";
package/dist/util.js CHANGED
@@ -1,82 +1,84 @@
1
- import { MVFRAME_STORAGE_LANG as U } from "./composition.js";
2
- import { d as N } from "./dayjs.js";
3
- const R = (s) => {
4
- globalThis.$d = N;
5
- const f = (e) => {
1
+ import { MVFRAME_STORAGE_LANG as N } from "./composition.js";
2
+ import { d as f, i as I, q as P } from "./dayjs.js";
3
+ f.extend(I);
4
+ f.extend(P);
5
+ const Y = (s) => {
6
+ globalThis.$d = f;
7
+ const u = (e) => {
6
8
  if (e.startsWith("/"))
7
9
  return new URL(e, import.meta.url).href;
8
10
  if (e)
9
11
  return new URL((/* @__PURE__ */ Object.assign({}))[`/src/assets/img/${e}`], import.meta.url).href;
10
12
  throw new Error("please provide an image url with getImg");
11
13
  };
12
- s.config.globalProperties.$getImg = f, globalThis.$getImg = f, globalThis.$getLang = () => {
14
+ s.config.globalProperties.$getImg = u, globalThis.$getImg = u, globalThis.$getLang = () => {
13
15
  var e;
14
- return localStorage.getItem(U) || ((e = globalThis.$config) == null ? void 0 : e.lang) || "en_us";
16
+ return localStorage.getItem(N) || ((e = globalThis.$config) == null ? void 0 : e.lang) || "en_us";
15
17
  }, globalThis.token = "WQpvrYIEnSzAxhOWrbUpGvElhGztdOjOGOdbrSlhUYlrQArOdpMhY1vYMSA7l4xMOUl9MAl1I6AvSrQ8vlE0bpChQ0UWMMlYt0hQC0M0pSz0rUhvlIllSWzMESnAMUlt";
16
- const m = (e) => Number(e.match(/\d+(\.\d+)?/g).join(""));
17
- globalThis.$md5 = (e) => m(e);
18
- const $ = (e, r = 0) => {
18
+ const $ = (e) => Number(e.match(/\d+(\.\d+)?/g).join(""));
19
+ globalThis.$md5 = (e) => $(e);
20
+ const y = (e, r = 0) => {
19
21
  let o = parseInt(Math.random() * e);
20
22
  return o += r, o;
21
23
  };
22
- globalThis.$rn = $;
23
- const y = (e, r) => {
24
+ globalThis.$rn = y;
25
+ const T = (e, r) => {
24
26
  let o = [];
25
27
  for (let t = 0; t < e; t++)
26
28
  o.push(r(t));
27
29
  return o;
28
30
  };
29
- globalThis.$fd = y;
30
- const u = (e, r = !1) => e.substr(0, 1).toUpperCase() + (r ? e.substr(1, e.length).toLowerCase() : e.substr(1, e.length));
31
- s.config.globalProperties.$toUpperCamel = u, globalThis.$toUpperCamel = u;
32
- const g = (e, r = 2) => {
31
+ globalThis.$fd = T;
32
+ const g = (e, r = !1) => e.substr(0, 1).toUpperCase() + (r ? e.substr(1, e.length).toLowerCase() : e.substr(1, e.length));
33
+ s.config.globalProperties.$toUpperCamel = g, globalThis.$toUpperCamel = g;
34
+ const p = (e, r = 2) => {
33
35
  const o = globalThis.$getType(e);
34
36
  let t;
35
37
  o === "Number" ? (e = e.toFixed(r), t = String(e), e = String(Math.abs(e))) : o === "String" && (t = e, e = String(Math.abs(Number(e))));
36
- const l = e.split(".");
37
- let n = l[0].split("");
38
- n = n.reverse();
38
+ const n = e.split(".");
39
+ let l = n[0].split("");
40
+ l = l.reverse();
39
41
  let a = [];
40
- n.forEach((E, d) => {
41
- d !== 0 && d % 3 === 0 && a.push(","), a.push(E);
42
+ l.forEach((U, m) => {
43
+ m !== 0 && m % 3 === 0 && a.push(","), a.push(U);
42
44
  });
43
45
  let i = a.reverse().join("");
44
- return globalThis.$getType(r) === "Number" && r > 0 && (i += ".", l[1] ? i += l[1].padEnd(r, 0).substr(0, r) : i += "0".padEnd(r, "0")), Number(t) !== Number(e) ? `-${i}` : i;
46
+ return globalThis.$getType(r) === "Number" && r > 0 && (i += ".", n[1] ? i += n[1].padEnd(r, 0).substr(0, r) : i += "0".padEnd(r, "0")), Number(t) !== Number(e) ? `-${i}` : i;
45
47
  };
46
- globalThis.$fa = g, s.config.globalProperties.$fa = g;
47
- const T = (e, r) => {
48
- var l, n;
48
+ globalThis.$fa = p, s.config.globalProperties.$fa = p;
49
+ const C = (e, r) => {
50
+ var n, l;
49
51
  const o = r == null ? void 0 : r[e];
50
52
  if (o != null)
51
53
  return o;
52
- const t = (n = (l = globalThis.$config) == null ? void 0 : l.table) == null ? void 0 : n.summaryMetric;
54
+ const t = (l = (n = globalThis.$config) == null ? void 0 : n.table) == null ? void 0 : l.summaryMetric;
53
55
  return t == null ? null : typeof t == "function" ? t(e) ?? null : t[e] ?? null;
54
- }, p = ({ prop: e, currency: r, value: o, obj: t }) => {
55
- const l = T(e, t);
56
- if (l == null || typeof l != "object")
56
+ }, b = ({ prop: e, currency: r, value: o, obj: t }) => {
57
+ const n = C(e, t);
58
+ if (n == null || typeof n != "object")
57
59
  return globalThis.$fa(o, 2);
58
- if (l.unit === "currency") {
59
- const n = r ?? l.currency;
60
- return n ? `${n} ${globalThis.$fa(o, l == null ? void 0 : l.precision)}` : globalThis.$fa(o, l == null ? void 0 : l.precision);
60
+ if (n.unit === "currency") {
61
+ const l = r ?? n.currency;
62
+ return l ? `${l} ${globalThis.$fa(o, n == null ? void 0 : n.precision)}` : globalThis.$fa(o, n == null ? void 0 : n.precision);
61
63
  }
62
- return l.unit === "%" ? `${globalThis.$fa(o, l == null ? void 0 : l.precision)}%` : globalThis.$fa(o, l == null ? void 0 : l.precision);
64
+ return n.unit === "%" ? `${globalThis.$fa(o, n == null ? void 0 : n.precision)}%` : globalThis.$fa(o, n == null ? void 0 : n.precision);
63
65
  };
64
- globalThis.$fu = p, s.config.globalProperties.$fu = p;
65
- const C = (e = () => {
66
+ globalThis.$fu = b, s.config.globalProperties.$fu = b;
67
+ const k = (e = () => {
66
68
  }, r = 2) => {
67
69
  const o = Math.max(0, Number(r) || 2) * 100;
68
- return new Promise((t, l) => {
70
+ return new Promise((t, n) => {
69
71
  setTimeout(() => {
70
72
  try {
71
- const n = e();
72
- n != null && typeof n.then == "function" ? Promise.resolve(n).then((a) => t(a === void 0 ? !0 : a)).catch(l) : t(n === void 0 ? !0 : n);
73
- } catch (n) {
74
- l(n);
73
+ const l = e();
74
+ l != null && typeof l.then == "function" ? Promise.resolve(l).then((a) => t(a === void 0 ? !0 : a)).catch(n) : t(l === void 0 ? !0 : l);
75
+ } catch (l) {
76
+ n(l);
75
77
  }
76
78
  }, o);
77
79
  });
78
80
  };
79
- globalThis.$pm = C;
81
+ globalThis.$pm = k;
80
82
  const M = (e = () => {
81
83
  }, r = 500) => {
82
84
  let o;
@@ -102,47 +104,47 @@ const R = (s) => {
102
104
  data: r
103
105
  };
104
106
  }, globalThis.$getType = (e) => Object.prototype.toString.call(e).slice(8, -1);
105
- const b = (e) => {
107
+ const h = (e) => {
106
108
  var o;
107
109
  const r = (o = s.config.globalProperties) == null ? void 0 : o.$message;
108
110
  r != null && r.success && r.success({ message: e, center: !0, duration: 5e3 });
109
- }, h = (e, r) => {
110
- var l;
111
+ }, d = (e, r) => {
112
+ var n;
111
113
  if (!e) {
112
114
  console.info("No Value");
113
115
  return;
114
116
  }
115
- const o = ((l = globalThis.$l) == null ? void 0 : l.call(globalThis, "Copied")) || "Copied";
117
+ const o = ((n = globalThis.$l) == null ? void 0 : n.call(globalThis, "Copied")) || "Copied";
116
118
  let t;
117
119
  if (r ? globalThis.$getType(r) !== "Boolean" ? t = `${o} ${r}: ${e}` : t = `${o}: ${e}` : t = o, navigator.clipboard && globalThis.isSecureContext)
118
- navigator.clipboard.writeText(e).then(() => b(t));
120
+ navigator.clipboard.writeText(e).then(() => h(t));
119
121
  else {
120
- let n = document.createElement("textarea");
121
- n.value = e, n.style.position = "fixed", n.style.opacity = 0, document.body.appendChild(n), n.select(), document.execCommand("Copy"), n.remove(), b(t);
122
+ let l = document.createElement("textarea");
123
+ l.value = e, l.style.position = "fixed", l.style.opacity = 0, document.body.appendChild(l), l.select(), document.execCommand("Copy"), l.remove(), h(t);
122
124
  }
123
125
  };
124
- globalThis.$copy = h, s.config.globalProperties.$copy = h;
125
- const k = (e) => e < 1e3 ? e : e < 1e6 ? parseInt(e / 1e3) + "k" : parseInt(e / 1e6) + "m";
126
- globalThis.$sc = k;
126
+ globalThis.$copy = d, s.config.globalProperties.$copy = d;
127
+ const x = (e) => e < 1e3 ? e : e < 1e6 ? parseInt(e / 1e3) + "k" : parseInt(e / 1e6) + "m";
128
+ globalThis.$sc = x;
127
129
  const F = {
128
130
  cpa: "avgCPA",
129
131
  cpt: "avgCPT"
130
- }, w = (e, r = F) => {
132
+ }, O = (e, r = F) => {
131
133
  const o = r[e.name];
132
134
  o && (e.name = o);
133
135
  };
134
- globalThis.$nr = w;
135
- const O = (e, r) => (Object.keys(e).forEach((o) => {
136
+ globalThis.$nr = O;
137
+ const w = (e, r) => (Object.keys(e).forEach((o) => {
136
138
  objMap[o] && (e[objMap[o]] = e[o], delete e[o]);
137
139
  }), e);
138
- globalThis.$nro = O;
139
- const x = (e) => {
140
+ globalThis.$nro = w;
141
+ const A = (e) => {
140
142
  let r = 0;
141
143
  return Object.keys(e).forEach((o) => {
142
144
  (globalThis.$getType(e[o]) === "Array" && e[o].length !== 0 || e[o]) && r++;
143
145
  }), r;
144
146
  };
145
- globalThis.$pc = x;
147
+ globalThis.$pc = A;
146
148
  const c = {
147
149
  info: {
148
150
  tag: "background-color:#0085FF; color:#f1f7ff; border-radius: 2px 0 0 2px;",
@@ -164,7 +166,7 @@ const R = (s) => {
164
166
  tag: "background-color:#20c997; color:#f6fffc; border-radius: 2px 0 0 2px;",
165
167
  style: "background-color:#f6fffc; color:#20c997;"
166
168
  }
167
- }, A = (e) => {
169
+ }, S = (e) => {
168
170
  let r = !1;
169
171
  for (let o in e)
170
172
  if (globalThis.$getType(e[o]) === "Object") {
@@ -172,11 +174,11 @@ const R = (s) => {
172
174
  break;
173
175
  }
174
176
  return r;
175
- }, S = ["info", "log", "warn", "error", "success"];
176
- globalThis.$c = {}, S.forEach((e) => {
177
+ }, E = ["info", "log", "warn", "error", "success"];
178
+ globalThis.$c = {}, E.forEach((e) => {
177
179
  globalThis.$c[e] = (...r) => {
178
180
  const o = e.toUpperCase();
179
- A(r) ? (console.groupCollapsed(`%c ${o} `, `${c[e].tag}`), console[e](r), console.groupEnd()) : console.info(
181
+ S(r) ? (console.groupCollapsed(`%c ${o} `, `${c[e].tag}`), console[e](r), console.groupEnd()) : console.info(
180
182
  `%c ${o} %c┆${r}┆`,
181
183
  `${c[e].tag}`,
182
184
  `${c[e].style}`
@@ -191,12 +193,12 @@ const R = (s) => {
191
193
  let o = r === "Array" ? [] : {};
192
194
  for (let t in e)
193
195
  if (Object.prototype.hasOwnProperty.call(e, t)) {
194
- const l = window.$getType(e[t]);
195
- l === "Object" || l === "Array" ? o[t] = window.$deepClone(e[t]) : o[t] = e[t];
196
+ const n = window.$getType(e[t]);
197
+ n === "Object" || n === "Array" ? o[t] = window.$deepClone(e[t]) : o[t] = e[t];
196
198
  }
197
199
  return o;
198
200
  };
199
201
  };
200
202
  export {
201
- R as u
203
+ Y as u
202
204
  };