mvframe 1.0.18 → 1.0.58

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./util.js";
2
2
  import "./directive.js";
3
3
  import "./store-shared.js";
4
- import { h as m, i as o, g as n, a as r, m as g, b as l, c as u, n as L, p as M, u as c } from "./vendor.js";
4
+ import { j as m, k as o, g as n, a as r, m as g, b as l, c as u, n as L, p as M, u as c } from "./vendor.js";
5
5
  import "./composition.js";
6
6
  export {
7
7
  m as builtinLocales,
package/dist/lodash.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as f, d as Cr } from "./vendor.js";
1
+ import { f, d as Cr } from "./vendor.js";
2
2
  var d, ye;
3
3
  function le() {
4
4
  if (ye) return d;
package/dist/maps.js CHANGED
@@ -1,10 +1,11 @@
1
- import { f as p, a as e, m, b as t, c as g, p as M, u as f } from "./vendor.js";
1
+ import { h as p, a as e, i as m, m as t, b as g, c as u, p as M, u as h } from "./vendor.js";
2
2
  export {
3
3
  p as default,
4
4
  e as getMaps,
5
- m as mapLang,
6
- t as mapLangPath,
7
- g as mergeMaps,
5
+ m as mapJumpKeys,
6
+ t as mapLang,
7
+ g as mapLangPath,
8
+ u as mergeMaps,
8
9
  M as patchMaps,
9
- f as useMap
10
+ h as useMap
10
11
  };
@@ -1,9 +1,9 @@
1
- import { createPinia as p, defineStore as h } from "pinia";
2
- const T = () => ({
1
+ import { createPinia as w, defineStore as g } from "pinia";
2
+ const O = () => ({
3
3
  lang: "en_us",
4
4
  /** 路由切换 / 异步页面 chunk 加载期间为 true,由 router guard 维护 */
5
5
  pageLoading: !1
6
- }), y = {
6
+ }), q = {
7
7
  saveData(t, e) {
8
8
  this[t] = e;
9
9
  },
@@ -13,16 +13,16 @@ const T = () => ({
13
13
  setPageLoading(t) {
14
14
  this.pageLoading = !!t;
15
15
  }
16
- }, $ = {
17
- state: T,
18
- actions: y
19
- }, d = () => ({
16
+ }, E = {
17
+ state: O,
18
+ actions: q
19
+ }, m = (t) => t && typeof t == "object" ? t : {}, p = (t) => t && typeof t == "object" ? t : {}, L = () => ({
20
20
  useTab: !1,
21
21
  // 是否使用tab
22
22
  tabs: [],
23
23
  ctab: {}
24
24
  // current tab
25
- }), S = {
25
+ }), N = {
26
26
  saveData(t, e) {
27
27
  this[t] = e;
28
28
  },
@@ -31,26 +31,40 @@ const T = () => ({
31
31
  },
32
32
  saveTab(t) {
33
33
  const { data: e, index: s } = this.tabs.filter1((r) => r.name === t.name);
34
- if (e)
35
- if (JSON.stringify(e.params) === JSON.stringify(t.params) && JSON.stringify(e.query) === JSON.stringify(t.query)) {
34
+ if (e) {
35
+ const r = JSON.stringify(m(e.params)) === JSON.stringify(m(t.params)), h = JSON.stringify(p(e.query)) === JSON.stringify(p(t.query));
36
+ if (r && h) {
36
37
  this.saveCurrentTab(e);
37
38
  return;
38
- } else
39
- this.closeTab(e, s);
40
- const { fullPath: a, name: n, meta: i, params: c, query: u } = t;
41
- if (n !== "Login") {
39
+ }
40
+ const { fullPath: u, name: y, meta: c, params: S, query: v } = t, l = u.split("/");
41
+ let f;
42
+ l[l.length - 1] === "Home" ? f = l[l.length - 2] : f = l[l.length - 1], c != null && c.icon && (f = c.icon);
43
+ const T = {
44
+ name: y,
45
+ meta: c ?? e.meta,
46
+ path: l,
47
+ params: m(S),
48
+ query: p(v),
49
+ icon: f
50
+ };
51
+ this.tabs.splice(s, 1, T), this.saveCurrentTab(T);
52
+ return;
53
+ }
54
+ const { fullPath: a, name: i, meta: n, params: b, query: $ } = t;
55
+ if (i !== "Login") {
42
56
  const r = a.split("/");
43
- let l;
44
- r[r.length - 1] === "Home" ? l = r[r.length - 2] : l = r[r.length - 1], i.icon && (l = i.icon);
45
- const b = {
46
- name: n,
47
- meta: i,
57
+ let h;
58
+ r[r.length - 1] === "Home" ? h = r[r.length - 2] : h = r[r.length - 1], n != null && n.icon && (h = n.icon);
59
+ const u = {
60
+ name: i,
61
+ meta: n,
48
62
  path: r,
49
- params: c,
50
- query: u,
51
- icon: l
52
- }, { index: m } = this.tabs.filter1((g) => g.name === this.ctab.name);
53
- this.tabs.splice(m + 1, 0, b), this.saveCurrentTab(b);
63
+ params: m(b),
64
+ query: p($),
65
+ icon: h
66
+ }, { index: y } = this.tabs.filter1((c) => c.name === this.ctab.name);
67
+ this.tabs.splice(y + 1, 0, u), this.saveCurrentTab(u);
54
68
  }
55
69
  },
56
70
  closeTab(t, e) {
@@ -58,20 +72,20 @@ const T = () => ({
58
72
  this.tabs.splice(e, 1), t.name === this.ctab.name && ((s = globalThis.$router) == null || s.push({ name: this.tabs[e - 1 > 0 ? e - 1 : 0].name }));
59
73
  },
60
74
  closeRightTab(t, e) {
61
- var n;
75
+ var i;
62
76
  const s = [];
63
77
  let a = !1;
64
- this.tabs.forEach((i, c) => {
65
- e >= c ? s.push(i) : i.name === this.ctab.name && (a = !0);
66
- }), this.tabs = s, a && ((n = globalThis.$router) == null || n.push({ name: t.name }));
78
+ this.tabs.forEach((n, b) => {
79
+ e >= b ? s.push(n) : n.name === this.ctab.name && (a = !0);
80
+ }), this.tabs = s, a && ((i = globalThis.$router) == null || i.push({ name: t.name }));
67
81
  },
68
82
  closeLeftTab(t, e) {
69
- var n;
83
+ var i;
70
84
  const s = [];
71
85
  let a = !1;
72
- this.tabs.forEach((i, c) => {
73
- e <= c ? s.push(i) : i.name === this.ctab.name && (a = !0);
74
- }), this.tabs = s, a && ((n = globalThis.$router) == null || n.push({ name: t.name }));
86
+ this.tabs.forEach((n, b) => {
87
+ e <= b ? s.push(n) : n.name === this.ctab.name && (a = !0);
88
+ }), this.tabs = s, a && ((i = globalThis.$router) == null || i.push({ name: t.name }));
75
89
  },
76
90
  closeOtherTab(t, e) {
77
91
  var s;
@@ -80,11 +94,11 @@ const T = () => ({
80
94
  closeAllTab() {
81
95
  this.tabs = [];
82
96
  }
83
- }, v = {}, w = {
84
- state: d,
85
- actions: S,
86
- getters: v
87
- }, O = () => ({
97
+ }, J = {}, j = {
98
+ state: L,
99
+ actions: N,
100
+ getters: J
101
+ }, x = () => ({
88
102
  type: "",
89
103
  visible: !1,
90
104
  options: [],
@@ -93,7 +107,7 @@ const T = () => ({
93
107
  x: 0,
94
108
  y: 0
95
109
  }
96
- }), L = {
110
+ }), C = {
97
111
  saveData(t, e) {
98
112
  this[t] = e;
99
113
  },
@@ -106,35 +120,35 @@ const T = () => ({
106
120
  y: 0
107
121
  }, this.type = "";
108
122
  }
109
- }, N = {}, J = {
110
- state: O,
111
- actions: L,
112
- getters: N
113
- }, x = p(), o = {}, D = (t) => {
123
+ }, D = {}, P = {
124
+ state: x,
125
+ actions: C,
126
+ getters: D
127
+ }, F = w(), o = {}, I = (t) => {
114
128
  const e = t.match(/(?:^|[/\\])([^/\\]+)\.js$/);
115
129
  return e ? e[1] : null;
116
- }, E = (t) => {
130
+ }, A = (t) => {
117
131
  Object.entries(t).forEach(([e, s]) => {
118
- const a = D(e);
132
+ const a = I(e);
119
133
  if (!a || !(s != null && s.default)) {
120
134
  console.warn(`Invalid store module: ${e}`);
121
135
  return;
122
136
  }
123
137
  try {
124
- o[a] = h(a, s.default);
125
- } catch (n) {
126
- console.error(`Failed to register store module '${a}':`, n);
138
+ o[a] = g(a, s.default);
139
+ } catch (i) {
140
+ console.error(`Failed to register store module '${a}':`, i);
127
141
  }
128
142
  });
129
143
  };
130
- o.init = h("init", $);
131
- o.tab = h("tab", w);
132
- o.rmenu = h("rmenu", J);
133
- const f = (t) => {
144
+ o.init = g("init", E);
145
+ o.tab = g("tab", j);
146
+ o.rmenu = g("rmenu", P);
147
+ const d = (t) => {
134
148
  try {
135
149
  switch (window.$getType(t)) {
136
150
  case "Array":
137
- t.forEach(f);
151
+ t.forEach(d);
138
152
  break;
139
153
  case "String":
140
154
  const s = localStorage.getItem(t);
@@ -147,16 +161,16 @@ const f = (t) => {
147
161
  } catch (e) {
148
162
  console.error(`Failed to parse '${t}' from localStorage:`, e);
149
163
  }
150
- }, F = (t, { storeChips: e, useTab: s } = {}) => {
164
+ }, B = (t, { storeChips: e, useTab: s } = {}) => {
151
165
  try {
152
- t.use(x).provide("store", o);
166
+ t.use(F).provide("store", o);
153
167
  } catch (a) {
154
168
  throw new Error("Failed to inject store into app:", a);
155
169
  }
156
- return s && (o.tab().saveData("useTab", !0), f(["tabs", "ctab"])), e && E(e), o;
170
+ return s && (o.tab().saveData("useTab", !0), d(["tabs", "ctab"])), e && A(e), o;
157
171
  };
158
172
  export {
159
- F as a,
160
- x as p,
173
+ B as a,
174
+ F as p,
161
175
  o as s
162
176
  };
package/dist/util.js CHANGED
@@ -1,35 +1,40 @@
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 { e as P } from "./vendor.js";
3
+ import { d as f, i as j, q as R } from "./dayjs.js";
4
+ f.extend(j);
5
+ f.extend(R);
6
+ const Q = (s) => {
7
+ globalThis.$d = f;
8
+ const u = P();
9
+ s.config.globalProperties.$message = u, globalThis.$message = u;
10
+ const g = (e) => {
6
11
  if (e.startsWith("/"))
7
12
  return new URL(e, import.meta.url).href;
8
13
  if (e)
9
14
  return new URL((/* @__PURE__ */ Object.assign({}))[`/src/assets/img/${e}`], import.meta.url).href;
10
15
  throw new Error("please provide an image url with getImg");
11
16
  };
12
- s.config.globalProperties.$getImg = f, globalThis.$getImg = f, globalThis.$getLang = () => {
17
+ s.config.globalProperties.$getImg = g, globalThis.$getImg = g, globalThis.$getLang = () => {
13
18
  var e;
14
- return localStorage.getItem(U) || ((e = globalThis.$config) == null ? void 0 : e.lang) || "en_us";
19
+ return localStorage.getItem(N) || ((e = globalThis.$config) == null ? void 0 : e.lang) || "en_us";
15
20
  }, 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) => {
21
+ const y = (e) => Number(e.match(/\d+(\.\d+)?/g).join(""));
22
+ globalThis.$md5 = (e) => y(e);
23
+ const T = (e, r = 0) => {
19
24
  let o = parseInt(Math.random() * e);
20
25
  return o += r, o;
21
26
  };
22
- globalThis.$rn = $;
23
- const y = (e, r) => {
27
+ globalThis.$rn = T;
28
+ const C = (e, r) => {
24
29
  let o = [];
25
30
  for (let t = 0; t < e; t++)
26
31
  o.push(r(t));
27
32
  return o;
28
33
  };
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) => {
34
+ globalThis.$fd = C;
35
+ const p = (e, r = !1) => e.substr(0, 1).toUpperCase() + (r ? e.substr(1, e.length).toLowerCase() : e.substr(1, e.length));
36
+ s.config.globalProperties.$toUpperCamel = p, globalThis.$toUpperCamel = p;
37
+ const b = (e, r = 2) => {
33
38
  const o = globalThis.$getType(e);
34
39
  let t;
35
40
  o === "Number" ? (e = e.toFixed(r), t = String(e), e = String(Math.abs(e))) : o === "String" && (t = e, e = String(Math.abs(Number(e))));
@@ -37,22 +42,22 @@ const R = (s) => {
37
42
  let n = l[0].split("");
38
43
  n = n.reverse();
39
44
  let a = [];
40
- n.forEach((E, d) => {
41
- d !== 0 && d % 3 === 0 && a.push(","), a.push(E);
45
+ n.forEach((I, $) => {
46
+ $ !== 0 && $ % 3 === 0 && a.push(","), a.push(I);
42
47
  });
43
48
  let i = a.reverse().join("");
44
49
  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;
45
50
  };
46
- globalThis.$fa = g, s.config.globalProperties.$fa = g;
47
- const T = (e, r) => {
51
+ globalThis.$fa = b, s.config.globalProperties.$fa = b;
52
+ const M = (e, r) => {
48
53
  var l, n;
49
54
  const o = r == null ? void 0 : r[e];
50
55
  if (o != null)
51
56
  return o;
52
57
  const t = (n = (l = globalThis.$config) == null ? void 0 : l.table) == null ? void 0 : n.summaryMetric;
53
58
  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);
59
+ }, h = ({ prop: e, currency: r, value: o, obj: t }) => {
60
+ const l = M(e, t);
56
61
  if (l == null || typeof l != "object")
57
62
  return globalThis.$fa(o, 2);
58
63
  if (l.unit === "currency") {
@@ -61,8 +66,8 @@ const R = (s) => {
61
66
  }
62
67
  return l.unit === "%" ? `${globalThis.$fa(o, l == null ? void 0 : l.precision)}%` : globalThis.$fa(o, l == null ? void 0 : l.precision);
63
68
  };
64
- globalThis.$fu = p, s.config.globalProperties.$fu = p;
65
- const C = (e = () => {
69
+ globalThis.$fu = h, s.config.globalProperties.$fu = h;
70
+ const k = (e = () => {
66
71
  }, r = 2) => {
67
72
  const o = Math.max(0, Number(r) || 2) * 100;
68
73
  return new Promise((t, l) => {
@@ -76,8 +81,8 @@ const R = (s) => {
76
81
  }, o);
77
82
  });
78
83
  };
79
- globalThis.$pm = C;
80
- const M = (e = () => {
84
+ globalThis.$pm = k;
85
+ const x = (e = () => {
81
86
  }, r = 500) => {
82
87
  let o;
83
88
  return function(...t) {
@@ -86,7 +91,7 @@ const R = (s) => {
86
91
  }, r);
87
92
  };
88
93
  };
89
- globalThis.$db = M, Number.prototype.toFixedNumber = function(e) {
94
+ globalThis.$db = x, Number.prototype.toFixedNumber = function(e) {
90
95
  return Number(this.toFixed(e));
91
96
  }, Array.prototype.filter1 = function(e) {
92
97
  if (!e || typeof e != "function")
@@ -102,11 +107,10 @@ const R = (s) => {
102
107
  data: r
103
108
  };
104
109
  }, globalThis.$getType = (e) => Object.prototype.toString.call(e).slice(8, -1);
105
- const b = (e) => {
106
- var o;
107
- const r = (o = s.config.globalProperties) == null ? void 0 : o.$message;
108
- r != null && r.success && r.success({ message: e, center: !0, duration: 5e3 });
109
- }, h = (e, r) => {
110
+ const m = (e) => {
111
+ var r;
112
+ (r = globalThis.$message) != null && r.success && globalThis.$message.success({ message: e, duration: 5e3 });
113
+ }, d = (e, r) => {
110
114
  var l;
111
115
  if (!e) {
112
116
  console.info("No Value");
@@ -115,34 +119,34 @@ const R = (s) => {
115
119
  const o = ((l = globalThis.$l) == null ? void 0 : l.call(globalThis, "Copied")) || "Copied";
116
120
  let t;
117
121
  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));
122
+ navigator.clipboard.writeText(e).then(() => m(t));
119
123
  else {
120
124
  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);
125
+ n.value = e, n.style.position = "fixed", n.style.opacity = 0, document.body.appendChild(n), n.select(), document.execCommand("Copy"), n.remove(), m(t);
122
126
  }
123
127
  };
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;
127
- const F = {
128
+ globalThis.$copy = d, s.config.globalProperties.$copy = d;
129
+ const F = (e) => e < 1e3 ? e : e < 1e6 ? parseInt(e / 1e3) + "k" : parseInt(e / 1e6) + "m";
130
+ globalThis.$sc = F;
131
+ const O = {
128
132
  cpa: "avgCPA",
129
133
  cpt: "avgCPT"
130
- }, w = (e, r = F) => {
134
+ }, w = (e, r = O) => {
131
135
  const o = r[e.name];
132
136
  o && (e.name = o);
133
137
  };
134
138
  globalThis.$nr = w;
135
- const O = (e, r) => (Object.keys(e).forEach((o) => {
139
+ const A = (e, r) => (Object.keys(e).forEach((o) => {
136
140
  objMap[o] && (e[objMap[o]] = e[o], delete e[o]);
137
141
  }), e);
138
- globalThis.$nro = O;
139
- const x = (e) => {
142
+ globalThis.$nro = A;
143
+ const S = (e) => {
140
144
  let r = 0;
141
145
  return Object.keys(e).forEach((o) => {
142
146
  (globalThis.$getType(e[o]) === "Array" && e[o].length !== 0 || e[o]) && r++;
143
147
  }), r;
144
148
  };
145
- globalThis.$pc = x;
149
+ globalThis.$pc = S;
146
150
  const c = {
147
151
  info: {
148
152
  tag: "background-color:#0085FF; color:#f1f7ff; border-radius: 2px 0 0 2px;",
@@ -164,7 +168,7 @@ const R = (s) => {
164
168
  tag: "background-color:#20c997; color:#f6fffc; border-radius: 2px 0 0 2px;",
165
169
  style: "background-color:#f6fffc; color:#20c997;"
166
170
  }
167
- }, A = (e) => {
171
+ }, E = (e) => {
168
172
  let r = !1;
169
173
  for (let o in e)
170
174
  if (globalThis.$getType(e[o]) === "Object") {
@@ -172,11 +176,11 @@ const R = (s) => {
172
176
  break;
173
177
  }
174
178
  return r;
175
- }, S = ["info", "log", "warn", "error", "success"];
176
- globalThis.$c = {}, S.forEach((e) => {
179
+ }, U = ["info", "log", "warn", "error", "success"];
180
+ globalThis.$c = {}, U.forEach((e) => {
177
181
  globalThis.$c[e] = (...r) => {
178
182
  const o = e.toUpperCase();
179
- A(r) ? (console.groupCollapsed(`%c ${o} `, `${c[e].tag}`), console[e](r), console.groupEnd()) : console.info(
183
+ E(r) ? (console.groupCollapsed(`%c ${o} `, `${c[e].tag}`), console[e](r), console.groupEnd()) : console.info(
180
184
  `%c ${o} %c┆${r}┆`,
181
185
  `${c[e].tag}`,
182
186
  `${c[e].style}`
@@ -198,5 +202,5 @@ const R = (s) => {
198
202
  };
199
203
  };
200
204
  export {
201
- R as u
205
+ Q as u
202
206
  };