mvframe 1.1.21 → 1.1.23

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,28 +1,28 @@
1
1
  import { M as z, g as D, s as G } from "./vendor.js";
2
2
  import { a as Ve, m as Ue, b as Be, c as Ne, p as Fe, u as We } from "./vendor.js";
3
3
  import j from "axios";
4
- const Y = "lang", Se = (e, t) => {
5
- var i, a;
6
- const n = typeof window < "u", r = () => {
7
- var d;
8
- if (!n)
4
+ const Y = "lang", $e = (e, t) => {
5
+ var o, a;
6
+ const r = typeof window < "u", s = () => {
7
+ var m;
8
+ if (!r)
9
9
  return { innerWidth: 1920, innerHeight: 1080 };
10
- const s = window, l = typeof navigator < "u" ? s.navigator : {}, u = s.screen || {}, f = s.visualViewport, h = {
11
- innerWidth: s.innerWidth,
12
- innerHeight: s.innerHeight,
13
- outerWidth: s.outerWidth,
14
- outerHeight: s.outerHeight,
15
- screenWidth: u.width ?? s.innerWidth,
16
- screenHeight: u.height ?? s.innerHeight,
17
- availWidth: u.availWidth ?? s.innerWidth,
18
- availHeight: u.availHeight ?? s.innerHeight,
19
- devicePixelRatio: s.devicePixelRatio || 1,
20
- bodyHeight: s.innerHeight - ((d = t.pinia) != null && d.useTab ? 36 : 0) - 64 - 32,
21
- drawerHeight: parseInt(s.innerHeight * 0.9),
22
- pageHeight: s.innerHeight - 64 - 32,
23
- pageWidth: s.innerWidth
10
+ const i = window, l = typeof navigator < "u" ? i.navigator : {}, u = i.screen || {}, d = i.visualViewport, h = {
11
+ innerWidth: i.innerWidth,
12
+ innerHeight: i.innerHeight,
13
+ outerWidth: i.outerWidth,
14
+ outerHeight: i.outerHeight,
15
+ screenWidth: u.width ?? i.innerWidth,
16
+ screenHeight: u.height ?? i.innerHeight,
17
+ availWidth: u.availWidth ?? i.innerWidth,
18
+ availHeight: u.availHeight ?? i.innerHeight,
19
+ devicePixelRatio: i.devicePixelRatio || 1,
20
+ bodyHeight: i.innerHeight - ((m = t.pinia) != null && m.useTab ? 36 : 0) - 64 - 32,
21
+ drawerHeight: parseInt(i.innerHeight * 0.9),
22
+ pageHeight: i.innerHeight - 64 - 32,
23
+ pageWidth: i.innerWidth
24
24
  };
25
- f && (h.visualViewportWidth = f.width, h.visualViewportHeight = f.height, h.visualViewportScale = f.scale);
25
+ d && (h.visualViewportWidth = d.width, h.visualViewportHeight = d.height, h.visualViewportScale = d.scale);
26
26
  const c = l.userAgent || "";
27
27
  return h.env = {
28
28
  userAgent: c,
@@ -32,40 +32,40 @@ const Y = "lang", Se = (e, t) => {
32
32
  cookieEnabled: !!l.cookieEnabled,
33
33
  onLine: l.onLine !== !1,
34
34
  maxTouchPoints: l.maxTouchPoints || 0,
35
- isTouch: "ontouchstart" in s || (l.maxTouchPoints || 0) > 0,
35
+ isTouch: "ontouchstart" in i || (l.maxTouchPoints || 0) > 0,
36
36
  isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(
37
37
  c
38
38
  )
39
39
  }, console.info(h), h;
40
- }, o = () => {
40
+ }, n = () => {
41
41
  var l;
42
- const s = r();
42
+ const i = s();
43
43
  globalThis.$config = globalThis.$config || {}, globalThis.$config.options = {
44
44
  ...globalThis.$config.options || {},
45
- ...s
45
+ ...i
46
46
  }, (l = e == null ? void 0 : e.config) != null && l.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
47
47
  };
48
- o(), n && (window.addEventListener("resize", o, { passive: !0 }), (a = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || a.call(i, "resize", o, {
48
+ n(), r && (window.addEventListener("resize", n, { passive: !0 }), (a = (o = window.visualViewport) == null ? void 0 : o.addEventListener) == null || a.call(o, "resize", n, {
49
49
  passive: !0
50
50
  }));
51
- }, $e = (e, t) => {
52
- var u, f, h;
53
- const n = t || {}, r = Array.isArray(n.use) && n.use.length > 0 ? n.use : z;
54
- globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = r.filter(
51
+ }, ve = (e, t) => {
52
+ var u, d, h;
53
+ const r = t || {}, s = Array.isArray(r.use) && r.use.length > 0 ? r.use : z;
54
+ globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = s.filter(
55
55
  (c) => c && c.use !== !1 && c.value
56
56
  ), (u = e == null ? void 0 : e.config) != null && u.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
57
- const i = (typeof localStorage < "u" ? localStorage.getItem(Y) : null) || ((f = globalThis.$config) == null ? void 0 : f.lang) || "en_us", a = Object.assign(
57
+ const o = (typeof localStorage < "u" ? localStorage.getItem(Y) : null) || ((d = globalThis.$config) == null ? void 0 : d.lang) || "en_us", a = Object.assign(
58
58
  {},
59
- D(i),
59
+ D(o),
60
60
  ((h = globalThis.$config) == null ? void 0 : h.langMaps) || {},
61
- n.langMaps || {}
62
- ), s = (c, d) => !d || globalThis.$getType(d) !== "Object" ? c : String(c).replace(
61
+ r.langMaps || {}
62
+ ), i = (c, m) => !m || globalThis.$getType(m) !== "Object" ? c : String(c).replace(
63
63
  /\{([A-Za-z0-9_.$-]+)\}/g,
64
- (m, C) => Object.prototype.hasOwnProperty.call(d, C) ? d[C] : m
65
- ), l = (c, d) => {
64
+ (g, C) => Object.prototype.hasOwnProperty.call(m, C) ? m[C] : g
65
+ ), l = (c, m) => {
66
66
  if (c) {
67
- const m = a[c] || c;
68
- return s(m, d);
67
+ const g = a[c] || c;
68
+ return i(g, m);
69
69
  } else
70
70
  return c ?? "";
71
71
  };
@@ -76,253 +76,253 @@ const Y = "lang", Se = (e, t) => {
76
76
  };
77
77
  }, Ae = (e, t) => {
78
78
  if (!e || !t) return !1;
79
- const n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), o = r.right > n.left && r.left < n.right, i = r.bottom > n.top && r.top < n.bottom;
80
- return o && i;
79
+ const r = e.getBoundingClientRect(), s = t.getBoundingClientRect(), n = s.right > r.left && s.left < r.right, o = s.bottom > r.top && s.top < r.bottom;
80
+ return n && o;
81
81
  }, K = (e, t) => {
82
82
  if (e === t) return !0;
83
83
  if (e == null || t == null || typeof e != "object" || typeof t != "object")
84
84
  return JSON.stringify(e) === JSON.stringify(t);
85
- const n = Object.keys(e), r = Object.keys(t);
86
- if (n.length !== r.length) return !1;
87
- for (const o of n)
88
- if (!r.includes(o) || !K(e[o], t[o])) return !1;
85
+ const r = Object.keys(e), s = Object.keys(t);
86
+ if (r.length !== s.length) return !1;
87
+ for (const n of r)
88
+ if (!s.includes(n) || !K(e[n], t[n])) return !1;
89
89
  return !0;
90
90
  }, O = "download", X = 150, J = (e, t = O) => {
91
- const n = t || O, r = String(e ?? "").trim();
92
- if (!r) return n;
93
- const i = r.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || n, a = 200;
94
- return i.length > a ? i.slice(0, a) : i;
91
+ const r = t || O, s = String(e ?? "").trim();
92
+ if (!s) return r;
93
+ const o = s.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || r, a = 200;
94
+ return o.length > a ? o.slice(0, a) : o;
95
95
  }, Z = (e) => {
96
96
  const t = ((e == null ? void 0 : e.type) || "").toLowerCase();
97
97
  return t ? t.includes("spreadsheet") || t.includes("ms-excel") || t.includes("excel") && t.includes("application") : !1;
98
- }, S = (e, t) => {
99
- const n = URL.createObjectURL(e), r = J(t), o = document.createElement("a");
100
- o.href = n, o.download = r, o.style.display = "none", document.body.appendChild(o);
98
+ }, $ = (e, t) => {
99
+ const r = URL.createObjectURL(e), s = J(t), n = document.createElement("a");
100
+ n.href = r, n.download = s, n.style.display = "none", document.body.appendChild(n);
101
101
  try {
102
- o.click();
102
+ n.click();
103
103
  } finally {
104
- document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(n), X);
104
+ document.body.removeChild(n), setTimeout(() => URL.revokeObjectURL(r), X);
105
105
  }
106
106
  }, Q = (e) => {
107
107
  if (!e || e.source !== void 0 || e.type === void 0)
108
108
  return e;
109
- const { type: t, data: n, url: r, headers: o, name: i, filename: a, init: s, ...l } = e, u = a ?? i;
109
+ const { type: t, data: r, url: s, headers: n, name: o, filename: a, init: i, ...l } = e, u = a ?? o;
110
110
  return t === "csv" ? {
111
111
  ...l,
112
112
  source: "inline",
113
- content: n,
113
+ content: r,
114
114
  filename: u,
115
115
  bom: e.bom
116
116
  } : t === "excel" ? {
117
117
  ...l,
118
118
  source: "fetch",
119
- url: r,
120
- init: { ...s || {}, headers: o ?? (s == null ? void 0 : s.headers) },
119
+ url: s,
120
+ init: { ...i || {}, headers: n ?? (i == null ? void 0 : i.headers) },
121
121
  response: "blob",
122
122
  expectExcel: !0,
123
123
  filename: u
124
124
  } : e;
125
125
  }, Le = async (e = {}) => {
126
126
  const t = Q(e), {
127
- source: n = "inline",
128
- content: r,
129
- blob: o,
130
- bom: i = !0,
127
+ source: r = "inline",
128
+ content: s,
129
+ blob: n,
130
+ bom: o = !0,
131
131
  mime: a,
132
- url: s,
132
+ url: i,
133
133
  init: l,
134
134
  response: u = "blob",
135
- openIn: f = "self",
135
+ openIn: d = "self",
136
136
  expectExcel: h,
137
137
  filename: c,
138
- name: d,
139
- error: m = () => {
138
+ name: m,
139
+ error: g = () => {
140
140
  },
141
141
  // 避免 legacy 字段渗入后续逻辑
142
142
  type: C,
143
143
  data: Te,
144
- headers: we,
145
- ...Me
146
- } = t, M = c ?? d;
144
+ headers: Me,
145
+ ...we
146
+ } = t, w = c ?? m;
147
147
  try {
148
- if (n === "inline") {
149
- if (o instanceof Blob) {
150
- S(o, M);
148
+ if (r === "inline") {
149
+ if (n instanceof Blob) {
150
+ $(n, w);
151
151
  return;
152
152
  }
153
- if (r == null) {
154
- m(new Error("content or blob is required for inline"));
153
+ if (s == null) {
154
+ g(new Error("content or blob is required for inline"));
155
155
  return;
156
156
  }
157
- const g = typeof r == "string" ? r : String(r), R = i ? "\uFEFF" + g : g, v = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
158
- S(new Blob([R], { type: v }), M);
157
+ const p = typeof s == "string" ? s : String(s), R = o ? "\uFEFF" + p : p, S = a || (o ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
158
+ $(new Blob([R], { type: S }), w);
159
159
  return;
160
160
  }
161
- if (n === "fetch") {
162
- if (!s) {
163
- m(new Error("url is required for fetch"));
161
+ if (r === "fetch") {
162
+ if (!i) {
163
+ g(new Error("url is required for fetch"));
164
164
  return;
165
165
  }
166
- const g = await fetch(s, l);
167
- if (!g.ok) {
168
- m(new Error(`fetch failed: ${g.status}`));
166
+ const p = await fetch(i, l);
167
+ if (!p.ok) {
168
+ g(new Error(`fetch failed: ${p.status}`));
169
169
  return;
170
170
  }
171
171
  if (u === "text") {
172
- const v = await g.text(), W = i ? "\uFEFF" + v : v, q = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
173
- S(new Blob([W], { type: q }), M);
172
+ const S = await p.text(), W = o ? "\uFEFF" + S : S, q = a || (o ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
173
+ $(new Blob([W], { type: q }), w);
174
174
  return;
175
175
  }
176
- const R = await g.blob();
176
+ const R = await p.blob();
177
177
  if (h && !Z(R)) {
178
- m(new Error("excel does not exist"));
178
+ g(new Error("excel does not exist"));
179
179
  return;
180
180
  }
181
- S(R, M);
181
+ $(R, w);
182
182
  return;
183
183
  }
184
- if (n === "open") {
185
- if (!s) {
186
- m(new Error("url is required for open"));
184
+ if (r === "open") {
185
+ if (!i) {
186
+ g(new Error("url is required for open"));
187
187
  return;
188
188
  }
189
- f === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
189
+ d === "blank" ? window.open(i, "_blank", "noopener,noreferrer") : window.location.href = i;
190
190
  return;
191
191
  }
192
- m(new Error(`unknown source: ${n}`));
193
- } catch (g) {
194
- m(g instanceof Error ? g : new Error(String(g)));
192
+ g(new Error(`unknown source: ${r}`));
193
+ } catch (p) {
194
+ g(p instanceof Error ? p : new Error(String(p)));
195
195
  }
196
196
  };
197
- function ee(e, t, n) {
197
+ function ee(e, t, r) {
198
198
  if (t === "" || t === void 0 || t === null)
199
199
  return "";
200
- const r = globalThis.$fa, o = globalThis.$fu, i = (n == null ? void 0 : n.precision) ?? 2, a = n == null ? void 0 : n.unit;
201
- if ((a === "currency" || a === "%") && o) {
202
- const s = {
200
+ const s = globalThis.$fa, n = globalThis.$fu, o = (r == null ? void 0 : r.precision) ?? 2, a = r == null ? void 0 : r.unit;
201
+ if ((a === "currency" || a === "%") && n) {
202
+ const i = {
203
203
  [e]: {
204
204
  unit: a === "currency" ? "currency" : "%",
205
- precision: i
205
+ precision: o
206
206
  }
207
207
  };
208
208
  try {
209
- return o({
209
+ return n({
210
210
  prop: e,
211
- currency: n == null ? void 0 : n.currency,
211
+ currency: r == null ? void 0 : r.currency,
212
212
  value: t,
213
- obj: s
213
+ obj: i
214
214
  });
215
215
  } catch {
216
216
  }
217
217
  }
218
- if (r)
218
+ if (s)
219
219
  try {
220
- return r(t, i);
220
+ return s(t, o);
221
221
  } catch {
222
222
  return String(t);
223
223
  }
224
224
  return String(t);
225
225
  }
226
- function Pe(e, t, n = {}) {
227
- const { columns: r = [] } = e || {}, { resolveMetric: o } = n;
228
- return !r.length || !t || typeof t != "object" ? [] : r.map((i) => {
229
- const a = i.property ?? i.prop ?? "";
226
+ function Pe(e, t, r = {}) {
227
+ const { columns: s = [] } = e || {}, { resolveMetric: n } = r;
228
+ return !s.length || !t || typeof t != "object" ? [] : s.map((o) => {
229
+ const a = o.property ?? o.prop ?? "";
230
230
  if (!a)
231
231
  return "";
232
- let s = t[a];
233
- if (s === void 0 && (s = ""), s === "")
232
+ let i = t[a];
233
+ if (i === void 0 && (i = ""), i === "")
234
234
  return "";
235
- const l = typeof o == "function" ? o(a) : void 0;
235
+ const l = typeof n == "function" ? n(a) : void 0;
236
236
  try {
237
- return ee(a, s, l);
237
+ return ee(a, i, l);
238
238
  } catch {
239
- return String(s);
239
+ return String(i);
240
240
  }
241
241
  });
242
242
  }
243
- const I = "mvframe_primary", V = "mvframe_theme", x = "mvframe_theme_name", te = "dark", $ = "main", A = "mv-theme-", T = { r: 255, g: 255, b: 255 }, ne = { r: 0, g: 0, b: 0 }, U = [1, 3, 5, 7, 9], re = [
243
+ const I = "mvframe_primary", V = "mvframe_theme", x = "mvframe_theme_name", te = "dark", v = "main", A = "mv-theme-", T = { r: 255, g: 255, b: 255 }, re = { r: 0, g: 0, b: 0 }, U = [1, 3, 5, 7, 9], ne = [
244
244
  "--el-color-primary-light-3",
245
245
  "--el-color-primary-light-5",
246
246
  "--el-color-primary-light-7",
247
247
  "--el-color-primary-light-8",
248
248
  "--el-color-primary-light-9",
249
249
  "--el-color-primary-dark-2"
250
- ], oe = U.map(
250
+ ], se = U.map(
251
251
  (e) => `--color-primary${e}`
252
252
  );
253
253
  function L(e) {
254
254
  let t = String(e).trim().replace(/^#/, "");
255
- if (t.length === 3 && (t = t.split("").map((r) => r + r).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
255
+ if (t.length === 3 && (t = t.split("").map((s) => s + s).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
256
256
  return null;
257
- const n = parseInt(t, 16);
257
+ const r = parseInt(t, 16);
258
258
  return {
259
- r: n >> 16 & 255,
260
- g: n >> 8 & 255,
261
- b: n & 255
259
+ r: r >> 16 & 255,
260
+ g: r >> 8 & 255,
261
+ b: r & 255
262
262
  };
263
263
  }
264
- function y(e, t, n) {
265
- const r = (o) => Math.max(0, Math.min(255, Math.round(o)));
266
- return `#${[r(e), r(t), r(n)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
264
+ function y(e, t, r) {
265
+ const s = (n) => Math.max(0, Math.min(255, Math.round(n)));
266
+ return `#${[s(e), s(t), s(r)].map((n) => n.toString(16).padStart(2, "0")).join("")}`;
267
267
  }
268
- function B(e, t, n, r) {
269
- const o = (a) => Math.max(0, Math.min(255, Math.round(a))), i = Math.max(0, Math.min(1, r));
270
- return `rgba(${o(e)}, ${o(t)}, ${o(n)}, ${i})`;
268
+ function B(e, t, r, s) {
269
+ const n = (a) => Math.max(0, Math.min(255, Math.round(a))), o = Math.max(0, Math.min(1, s));
270
+ return `rgba(${n(e)}, ${n(t)}, ${n(r)}, ${o})`;
271
271
  }
272
- function se(e) {
273
- const t = [e.r, e.g, e.b].map((n) => (n /= 255, n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4));
272
+ function oe(e) {
273
+ const t = [e.r, e.g, e.b].map((r) => (r /= 255, r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4));
274
274
  return 0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2];
275
275
  }
276
276
  function N(e) {
277
- return se(e) > 0.5 ? "#1a1a1a" : "#ffffff";
277
+ return oe(e) > 0.5 ? "#1a1a1a" : "#ffffff";
278
278
  }
279
- function b(e, t, n) {
280
- const r = n / 100, o = 1 - r;
279
+ function b(e, t, r) {
280
+ const s = r / 100, n = 1 - s;
281
281
  return {
282
- r: e.r * r + t.r * o,
283
- g: e.g * r + t.g * o,
284
- b: e.b * r + t.b * o
282
+ r: e.r * s + t.r * n,
283
+ g: e.g * s + t.g * n,
284
+ b: e.b * s + t.b * n
285
285
  };
286
286
  }
287
287
  function ie(e, t = "light") {
288
- const n = L(e);
289
- if (!n)
288
+ const r = L(e);
289
+ if (!r)
290
290
  return null;
291
- const r = b(T, n, 30), o = b(T, n, 50), i = b(T, n, 70), a = b(T, n, 80), s = b(T, n, 90), l = b(ne, n, 20);
291
+ const s = b(T, r, 30), n = b(T, r, 50), o = b(T, r, 70), a = b(T, r, 80), i = b(T, r, 90), l = b(re, r, 20);
292
292
  return {
293
- "--el-color-primary-light-3": y(r.r, r.g, r.b),
294
- "--el-color-primary-light-5": y(o.r, o.g, o.b),
295
- "--el-color-primary-light-7": t === "dark" ? B(n.r, n.g, n.b, 0.7) : y(i.r, i.g, i.b),
293
+ "--el-color-primary-light-3": y(s.r, s.g, s.b),
294
+ "--el-color-primary-light-5": y(n.r, n.g, n.b),
295
+ "--el-color-primary-light-7": t === "dark" ? B(r.r, r.g, r.b, 0.7) : y(o.r, o.g, o.b),
296
296
  "--el-color-primary-light-8": y(a.r, a.g, a.b),
297
- "--el-color-primary-light-9": y(s.r, s.g, s.b),
297
+ "--el-color-primary-light-9": y(i.r, i.g, i.b),
298
298
  "--el-color-primary-dark-2": y(l.r, l.g, l.b)
299
299
  };
300
300
  }
301
301
  function ae(e) {
302
302
  const t = L(e);
303
303
  return t ? Object.fromEntries(
304
- U.map((n) => [
305
- `--color-primary${n}`,
306
- B(t.r, t.g, t.b, n / 10)
304
+ U.map((r) => [
305
+ `--color-primary${r}`,
306
+ B(t.r, t.g, t.b, r / 10)
307
307
  ])
308
308
  ) : null;
309
309
  }
310
310
  function le(e) {
311
311
  e.style.removeProperty("--el-color-primary"), e.style.removeProperty("--color-on-primary-text");
312
- for (const t of oe)
312
+ for (const t of se)
313
313
  e.style.removeProperty(t);
314
- for (const t of re)
314
+ for (const t of ne)
315
315
  e.style.removeProperty(t);
316
316
  }
317
317
  function F(e) {
318
318
  const t = String(e ?? "").trim().toLowerCase();
319
- return t && t.replace(/[^a-z0-9_-]/g, "-").replace(/-+/g, "-") || $;
319
+ return t && t.replace(/[^a-z0-9_-]/g, "-").replace(/-+/g, "-") || v;
320
320
  }
321
321
  function ce(e) {
322
322
  const t = [...e.classList].find(
323
- (n) => n.startsWith(A)
323
+ (r) => r.startsWith(A)
324
324
  );
325
- return t ? t.slice(A.length) : $;
325
+ return t ? t.slice(A.length) : v;
326
326
  }
327
327
  function ue(e) {
328
328
  [...e.classList].filter((t) => t.startsWith(A)).forEach((t) => e.classList.remove(t));
@@ -331,31 +331,31 @@ function he(e) {
331
331
  return e.classList.contains("light") ? "light" : e.classList.contains("dark") ? "dark" : te;
332
332
  }
333
333
  function de(e, t) {
334
- const n = F(t);
335
- return ue(e), e.classList.add(`${A}${n}`), n;
334
+ const r = F(t);
335
+ return ue(e), e.classList.add(`${A}${r}`), r;
336
336
  }
337
- function me(e, t, n = "light") {
338
- const r = L(t.startsWith("#") ? t : `#${t}`);
339
- if (!r)
337
+ function me(e, t, r = "light") {
338
+ const s = L(t.startsWith("#") ? t : `#${t}`);
339
+ if (!s)
340
340
  return !1;
341
- const o = y(r.r, r.g, r.b);
342
- e.style.setProperty("--color-primary", o), e.style.setProperty("--el-color-primary", o), e.style.setProperty("--color-on-primary-text", N(r));
343
- const i = ae(o);
344
- i && Object.entries(i).forEach(([s, l]) => e.style.setProperty(s, l));
345
- const a = ie(o, n);
346
- return a && Object.entries(a).forEach(([s, l]) => e.style.setProperty(s, l)), !0;
341
+ const n = y(s.r, s.g, s.b);
342
+ e.style.setProperty("--color-primary", n), e.style.setProperty("--el-color-primary", n), e.style.setProperty("--color-on-primary-text", N(s));
343
+ const o = ae(n);
344
+ o && Object.entries(o).forEach(([i, l]) => e.style.setProperty(i, l));
345
+ const a = ie(n, r);
346
+ return a && Object.entries(a).forEach(([i, l]) => e.style.setProperty(i, l)), !0;
347
347
  }
348
348
  function ge(e = {}) {
349
- const t = document.documentElement, n = (e.mode ?? he(t)) === "light" ? "light" : "dark", r = e.theme ?? ce(t);
350
- if (de(t, r), e.primary != null && e.primary !== "") {
351
- const o = String(e.primary).trim();
352
- if (!me(t, o, n)) {
353
- t.style.setProperty("--color-primary", o), t.style.setProperty("--el-color-primary", o);
354
- const i = L(o.startsWith("#") ? o : `#${o}`);
355
- i && t.style.setProperty("--color-on-primary-text", N(i));
349
+ const t = document.documentElement, r = (e.mode ?? he(t)) === "light" ? "light" : "dark", s = e.theme ?? ce(t);
350
+ if (de(t, s), e.primary != null && e.primary !== "") {
351
+ const n = String(e.primary).trim();
352
+ if (!me(t, n, r)) {
353
+ t.style.setProperty("--color-primary", n), t.style.setProperty("--el-color-primary", n);
354
+ const o = L(n.startsWith("#") ? n : `#${n}`);
355
+ o && t.style.setProperty("--color-on-primary-text", N(o));
356
356
  }
357
357
  } else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"), le(t));
358
- t.classList.toggle("light", n === "light"), t.classList.toggle("dark", n === "dark");
358
+ t.classList.toggle("light", r === "light"), t.classList.toggle("dark", r === "dark");
359
359
  }
360
360
  function Ce(e) {
361
361
  e.primary !== void 0 && (e.primary == null || e.primary === "" ? localStorage.removeItem(I) : localStorage.setItem(I, String(e.primary))), e.mode !== void 0 && localStorage.setItem(V, e.mode), e.theme !== void 0 && (e.theme == null || e.theme === "" ? localStorage.removeItem(x) : localStorage.setItem(
@@ -364,48 +364,48 @@ function Ce(e) {
364
364
  ));
365
365
  }
366
366
  function Ie() {
367
- var o;
368
- const e = localStorage.getItem(I), t = localStorage.getItem(V), n = localStorage.getItem(x) || ((o = globalThis.$config) == null ? void 0 : o.theme) || $, r = t === "light" ? "light" : "dark";
367
+ var n;
368
+ const e = localStorage.getItem(I), t = localStorage.getItem(V), r = localStorage.getItem(x) || ((n = globalThis.$config) == null ? void 0 : n.theme) || v, s = t === "light" ? "light" : "dark";
369
369
  ge({
370
370
  primary: e != null && e !== "" ? e : null,
371
- mode: r,
372
- theme: n
371
+ mode: s,
372
+ theme: r
373
373
  });
374
374
  }
375
- const fe = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
376
- let w = null;
375
+ const pe = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
376
+ let M = null;
377
377
  function H(e) {
378
378
  G("error", e);
379
379
  }
380
380
  function xe(e) {
381
- w = e && typeof e == "object" ? e : null;
381
+ M = e && typeof e == "object" ? e : null;
382
382
  }
383
383
  function P(e) {
384
- if (w && w[e] != null && w[e] !== "")
385
- return String(w[e]);
384
+ if (M && M[e] != null && M[e] !== "")
385
+ return String(M[e]);
386
386
  const t = typeof globalThis < "u" ? globalThis.__MVFRAME_ENV__ : null;
387
387
  if (t && t[e] != null && t[e] !== "")
388
388
  return String(t[e]);
389
- const n = typeof import.meta < "u" ? fe : null;
390
- return n && n[e] != null && n[e] !== "" ? String(n[e]) : "";
389
+ const r = typeof import.meta < "u" ? pe : null;
390
+ return r && r[e] != null && r[e] !== "" ? String(r[e]) : "";
391
391
  }
392
392
  const _ = j.create({
393
393
  timeout: 0,
394
394
  withCredentials: !1
395
395
  });
396
- let p = [];
397
- const pe = j.CancelToken, ye = (e) => {
398
- const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, n = [];
399
- if (p.length)
400
- for (let r in p)
401
- p[r].v === t && n.push(r);
402
- n.length > 0 && (p[n[0]].cb(), p.splice(n[0], 1));
396
+ let f = [];
397
+ const fe = j.CancelToken, ye = (e) => {
398
+ const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, r = [];
399
+ if (f.length)
400
+ for (let s in f)
401
+ f[s].v === t && r.push(s);
402
+ r.length > 0 && (f[r[0]].cb(), f.splice(r[0], 1));
403
403
  }, E = (e) => {
404
404
  if (e != null && e.url) {
405
405
  const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex;
406
- for (let n in p)
407
- if (p[n].v === t) {
408
- p.splice(n, 1);
406
+ for (let r in f)
407
+ if (f[r].v === t) {
408
+ f.splice(r, 1);
409
409
  break;
410
410
  }
411
411
  }
@@ -413,11 +413,11 @@ const pe = j.CancelToken, ye = (e) => {
413
413
  _.interceptors.request.use(
414
414
  (e) => {
415
415
  e.headers = e.headers || {};
416
- const { login: t, accountInfo: n = {} } = window.$store.launch(), { access_token: r } = t.info, o = e.noaccount === !0 || e.noAccount === !0;
417
- return r && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${r}`), globalThis.$config.useRqLang && (e.headers.lang = globalThis.$config.lang || "en_us"), n.partner_org_id && !o && (e.data ? e.method.toLowerCase() === "get" ? e.params.accountId = n.partner_org_id : e.data.accountId = n.partner_org_id : e.method.toLowerCase() === "get" ? e.params = { accountId: n.partner_org_id } : e.data = { accountId: n.partner_org_id }), ye(e), e.cancelToken = new pe((i) => {
418
- p.push({
416
+ const { login: t, accountInfo: r = {} } = window.$store.launch(), { access_token: s } = t.info, n = e.noaccount === !0 || e.noAccount === !0;
417
+ return s && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${s}`), globalThis.$config.useRqLang && (e.headers.lang = globalThis.$config.lang || "en_us"), r.partner_org_id && !n && (e.data ? e.method.toLowerCase() === "get" ? e.params.accountId = r.partner_org_id : e.data.accountId = r.partner_org_id : e.method.toLowerCase() === "get" ? e.params = { accountId: r.partner_org_id } : e.data = { accountId: r.partner_org_id }), ye(e), e.cancelToken = new fe((o) => {
418
+ f.push({
419
419
  v: e.url + "_" + e.headers["Content-HI"] + "_" + e.ex,
420
- cb: i
420
+ cb: o
421
421
  });
422
422
  }), e;
423
423
  },
@@ -425,28 +425,28 @@ _.interceptors.request.use(
425
425
  );
426
426
  _.interceptors.response.use(
427
427
  ({ data: e, config: t }) => {
428
- var i;
428
+ var o;
429
429
  if (e == null || typeof e != "object" || Array.isArray(e))
430
430
  return E(t), e;
431
- let { code: n, message: r, msg: o } = e;
432
- if (o = o || r, n === 200)
431
+ let { code: r, message: s, msg: n } = e;
432
+ if (n = n || s, r === 200)
433
433
  E(t);
434
- else if (n === 500) {
434
+ else if (r === 500) {
435
435
  if (t.showMsg !== !1) {
436
- const a = (i = t == null ? void 0 : t.headers) != null && i.CONTACT_CUSTOMER_SERVICE ? window.$l("CONTACT_CUSTOMER_SERVICE") : "";
436
+ const a = (o = t == null ? void 0 : t.headers) != null && o.CONTACT_CUSTOMER_SERVICE ? window.$l("CONTACT_CUSTOMER_SERVICE") : "";
437
437
  H({
438
438
  grouping: !0,
439
439
  showClose: !0,
440
440
  duration: 0,
441
- message: [o, a].filter(Boolean).join(" ")
441
+ message: [n, a].filter(Boolean).join(" ")
442
442
  });
443
443
  }
444
444
  E(t);
445
- } else n === 403 && window.location.replace("/"), E(t);
445
+ } else r === 403 && window.location.replace("/"), E(t);
446
446
  return e;
447
447
  },
448
448
  (e) => {
449
- var n, r, o, i, a;
449
+ var r, s, n, o, a;
450
450
  let t = !1;
451
451
  if (e && e.response)
452
452
  switch (e.response.status) {
@@ -466,10 +466,10 @@ _.interceptors.response.use(
466
466
  e.message = `Connection Error-${e.response.status}`;
467
467
  }
468
468
  else
469
- (n = e.stack) != null && n.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
470
- return t || ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status) !== 403 && H({
469
+ (r = e.stack) != null && r.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
470
+ return t || ((s = e == null ? void 0 : e.response) == null ? void 0 : s.status) !== 403 && H({
471
471
  grouping: !0,
472
- message: `${e.message} ${(i = (o = e.config) == null ? void 0 : o.headers) == null ? void 0 : i["Content-HI"]}`
472
+ message: `${e.message} ${(o = (n = e.config) == null ? void 0 : n.headers) == null ? void 0 : o["Content-HI"]}`
473
473
  }), E(e.config), e.code === "ERR_CANCELED" ? Promise.resolve({ code: e.code, msg: e.message }) : Promise.resolve({
474
474
  code: (a = e.response) == null ? void 0 : a.status,
475
475
  msg: e.message
@@ -489,38 +489,39 @@ function _e(e) {
489
489
  if (e.baseURL = P("VITE_APP_BASEURL"), e.method = "post", e.headers = {
490
490
  ...e.headers,
491
491
  "Content-HI": e.url
492
- }, e.data && window.$getType(e.data) === "Object") {
492
+ }, e.data && globalThis.$getType(e.data) === "Object") {
493
+ const { emptyMap: r = [void 0, null], emptyString: s = !1 } = e;
494
+ s && globalThis.$getType(r) === "Array" && r.push("");
493
495
  const n = {};
494
- Object.keys(e.data).forEach((r) => {
495
- const o = e.data[r];
496
- [null, "", void 0].includes(o) || (n[r] = o);
497
- }), e.data = n;
496
+ r.length && (Object.keys(e.data).forEach((o) => {
497
+ const a = e.data[o];
498
+ r.includes(a) || (n[o] = a);
499
+ }), e.data = n);
498
500
  }
499
501
  return e.url = e.ver ? `api/${e.ver}/ads` : "api/v3/ads", _(e);
500
502
  }
501
- function k({
502
- data: e,
503
- url: t,
504
- ex: n,
505
- method: r = "post",
506
- emptyString: o = !1
507
- }) {
508
- const i = {}, a = [void 0, null];
509
- o === !1 && a.push("");
510
- for (let u in e)
511
- a.indexOf(e[u]) === -1 && (i[u] = e[u]);
512
- const { login: s } = window.$store.launch(), { access_token: l } = s.info || {};
513
- return _({
514
- headers: {
515
- "Content-Type": "application/json",
516
- token: l != null ? String(l) : ""
517
- },
518
- baseURL: P("VITE_APP_AIURL"),
519
- url: t,
520
- method: r,
521
- data: i,
522
- ex: n
523
- });
503
+ function k(e) {
504
+ const {
505
+ data: t,
506
+ url: r,
507
+ ex: s,
508
+ method: n = "post",
509
+ emptyString: o = !1,
510
+ emptyMap: a = [void 0, null],
511
+ useToken: i = !0
512
+ } = e;
513
+ e.method = n;
514
+ const { login: l } = globalThis.$store.launch(), { access_token: u } = l.info || {}, d = {};
515
+ if (o && globalThis.$getType(a) === "Array" && a.push(""), a.length) {
516
+ for (let h in t)
517
+ a.indexOf(t[h]) === -1 && (d[h] = t[h]);
518
+ e.data = d;
519
+ }
520
+ return e.baseURL = P("VITE_APP_AIURL"), e.headers && (e.headers = {
521
+ ...e.headers,
522
+ "Content-Type": "application/json",
523
+ token: i && u != null ? String(u) : ""
524
+ }), _(e);
524
525
  }
525
526
  const ke = k;
526
527
  function Oe(e) {
@@ -528,7 +529,7 @@ function Oe(e) {
528
529
  }
529
530
  export {
530
531
  te as MVFRAME_DEFAULT_THEME_MODE,
531
- $ as MVFRAME_DEFAULT_THEME_NAME,
532
+ v as MVFRAME_DEFAULT_THEME_NAME,
532
533
  Y as MVFRAME_STORAGE_LANG,
533
534
  I as MVFRAME_STORAGE_PRIMARY,
534
535
  V as MVFRAME_STORAGE_THEME,
@@ -551,10 +552,10 @@ export {
551
552
  xe as setMvframeRqEnv,
552
553
  k as useForm,
553
554
  Ee as useGet,
554
- $e as useLang,
555
+ ve as useLang,
555
556
  be as useLogin,
556
557
  We as useMap,
557
- Se as useOptions,
558
+ $e as useOptions,
558
559
  _e as usePost,
559
560
  Pe as useRemoteSummary,
560
561
  ke as useXform
package/dist/vendor.js CHANGED
@@ -13948,7 +13948,7 @@ const Yr = (a, o = {}) => {
13948
13948
  }, Wr = {
13949
13949
  name: "Matt Avias Frame",
13950
13950
  copyright: "©2026",
13951
- version: "1.1.21",
13951
+ version: "1.1.23",
13952
13952
  author: "Matt Avias",
13953
13953
  date: "2026-02-26",
13954
13954
  /** 默认语言 key,与 `$getLang`、localStorage `lang` 一致;业务在 app.use(mvframe, { config }) 里覆盖 */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mvframe",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.1.21",
4
+ "version": "1.1.23",
5
5
  "author": "matt avis",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",