mvframe 1.0.10 → 1.0.13
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.
- package/dist/Config.js +200 -0
- package/dist/composition.js +267 -133
- package/dist/css/cpt.css +1 -1
- package/dist/css/style.css +1 -1
- package/dist/index.js +2003 -1050
- package/dist/store.js +40 -33
- package/dist/util.js +23 -19
- package/package.json +4 -1
- package/scripts/scaffold-app.js +16 -9
package/dist/Config.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { reactive as j, onMounted as O, computed as x, resolveComponent as i, openBlock as d, createBlock as b, mergeProps as U, unref as a, withCtx as u, createElementVNode as o, toDisplayString as s, createVNode as p, createTextVNode as B, createElementBlock as V, Fragment as G, renderList as z, createCommentVNode as Y, nextTick as M } from "vue";
|
|
2
|
+
import { MVFRAME_STORAGE_PRIMARY as C, persistMvframeTheme as g, applyMvframeTheme as f, MVFRAME_STORAGE_LANG as D } from "./composition.js";
|
|
3
|
+
const q = { class: "flexMode flexV g24 p0-24" }, H = { class: "section flexMode flexV g12" }, J = { class: "flexMode vc g16 vl" }, K = { class: "section flexMode flexV g12" }, Q = { class: "flexMode vc hb g8 wp100" }, W = { class: "txt-p fs14" }, X = { class: "section flexMode flexV g12" }, Z = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "langPrefix flexMode vc g4 noShrink"
|
|
6
|
+
}, ee = { class: "langTag fs12 txt-tip" }, te = { class: "flexMode vc g8 vl" }, le = { class: "langTag fs12 txt-tip noShrink" }, oe = { class: "txt-p" }, re = /* @__PURE__ */ Object.assign({
|
|
7
|
+
name: "FrameConfig",
|
|
8
|
+
inheritAttrs: !1
|
|
9
|
+
}, {
|
|
10
|
+
__name: "Config",
|
|
11
|
+
emits: ["mounted"],
|
|
12
|
+
setup(ne, { emit: S }) {
|
|
13
|
+
const w = S, t = j({
|
|
14
|
+
loading: !1,
|
|
15
|
+
primary: "#007bff",
|
|
16
|
+
isDark: !1,
|
|
17
|
+
lang: "en_us"
|
|
18
|
+
});
|
|
19
|
+
O(() => {
|
|
20
|
+
T(), w("mounted");
|
|
21
|
+
});
|
|
22
|
+
const _ = () => {
|
|
23
|
+
const e = getComputedStyle(document.documentElement).getPropertyValue("--color-primary").trim();
|
|
24
|
+
t.primary = e || "#007bff";
|
|
25
|
+
}, T = () => {
|
|
26
|
+
var m;
|
|
27
|
+
const e = localStorage.getItem(C);
|
|
28
|
+
e ? t.primary = e : _(), t.isDark = document.documentElement.classList.contains("dark");
|
|
29
|
+
const l = ((m = globalThis.$getLang) == null ? void 0 : m.call(globalThis)) || "en_us", r = y.filter((c) => c.use !== !1).map((c) => c.value);
|
|
30
|
+
t.lang = r.includes(l) ? l : "en_us";
|
|
31
|
+
}, h = () => {
|
|
32
|
+
g({
|
|
33
|
+
primary: t.primary,
|
|
34
|
+
mode: t.isDark ? "dark" : "light"
|
|
35
|
+
});
|
|
36
|
+
}, A = () => {
|
|
37
|
+
const e = t.isDark ? "dark" : "light";
|
|
38
|
+
if (!t.primary) {
|
|
39
|
+
g({ primary: null }), f({ primary: null, mode: e }), M(() => _());
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
f({ primary: t.primary, mode: e }), h();
|
|
43
|
+
}, E = () => {
|
|
44
|
+
const e = t.isDark ? "dark" : "light", l = localStorage.getItem(C);
|
|
45
|
+
f({
|
|
46
|
+
primary: l != null && l !== "" ? l : null,
|
|
47
|
+
mode: e
|
|
48
|
+
}), g({ mode: e });
|
|
49
|
+
}, $ = () => {
|
|
50
|
+
g({ primary: null }), f({
|
|
51
|
+
primary: null,
|
|
52
|
+
mode: t.isDark ? "dark" : "light"
|
|
53
|
+
}), M(() => _());
|
|
54
|
+
}, L = (e) => {
|
|
55
|
+
var r;
|
|
56
|
+
const l = localStorage.getItem(D) || ((r = globalThis.$config) == null ? void 0 : r.lang) || "en_us";
|
|
57
|
+
e == null || e === l || (localStorage.setItem(D, e), window.location.reload());
|
|
58
|
+
}, F = async () => {
|
|
59
|
+
h();
|
|
60
|
+
}, v = x(
|
|
61
|
+
() => y.filter((e) => e.use !== !1)
|
|
62
|
+
), k = x(() => v.value.find((e) => e.value === t.lang) ?? null), y = [
|
|
63
|
+
{
|
|
64
|
+
label: "English",
|
|
65
|
+
icon: "us",
|
|
66
|
+
txt: "EN",
|
|
67
|
+
value: "en_us",
|
|
68
|
+
use: !0
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: "简体中文",
|
|
72
|
+
icon: "cn",
|
|
73
|
+
txt: "简",
|
|
74
|
+
value: "zh_cn",
|
|
75
|
+
use: !0
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "繁體中文",
|
|
79
|
+
icon: "hk",
|
|
80
|
+
txt: "繁",
|
|
81
|
+
value: "zh_tw",
|
|
82
|
+
use: !0
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: "日本語",
|
|
86
|
+
icon: "jp",
|
|
87
|
+
txt: "日",
|
|
88
|
+
value: "ja_jp",
|
|
89
|
+
use: !0
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: "한국어",
|
|
93
|
+
icon: "kr",
|
|
94
|
+
txt: "한",
|
|
95
|
+
value: "ko_kr",
|
|
96
|
+
use: !0
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: "Tiếng Việt",
|
|
100
|
+
icon: "vn",
|
|
101
|
+
txt: "Vi",
|
|
102
|
+
value: "vi_vn",
|
|
103
|
+
use: !0
|
|
104
|
+
}
|
|
105
|
+
], P = [
|
|
106
|
+
"#007bff",
|
|
107
|
+
"#409eff",
|
|
108
|
+
"#16b1ff",
|
|
109
|
+
"#28a745",
|
|
110
|
+
"#6f42c1",
|
|
111
|
+
"#e83e8c",
|
|
112
|
+
"#dc3545",
|
|
113
|
+
"#fd7e14"
|
|
114
|
+
];
|
|
115
|
+
return (e, l) => {
|
|
116
|
+
const r = i("el-color-picker"), m = i("el-button"), c = i("el-switch"), R = i("el-option"), I = i("el-select"), N = i("DrawerArea");
|
|
117
|
+
return d(), b(N, U({
|
|
118
|
+
loading: a(t).loading,
|
|
119
|
+
onSubmit: F
|
|
120
|
+
}, e.$attrs, { class: "MvcFrameConfig" }), {
|
|
121
|
+
default: u(() => [
|
|
122
|
+
o("div", q, [
|
|
123
|
+
o("section", H, [
|
|
124
|
+
o("h3", null, s(e.$l("Theme color")), 1),
|
|
125
|
+
o("div", J, [
|
|
126
|
+
p(r, {
|
|
127
|
+
modelValue: a(t).primary,
|
|
128
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => a(t).primary = n),
|
|
129
|
+
"color-format": "hex",
|
|
130
|
+
predefine: P,
|
|
131
|
+
onChange: A
|
|
132
|
+
}, null, 8, ["modelValue"]),
|
|
133
|
+
p(m, {
|
|
134
|
+
text: "",
|
|
135
|
+
type: "primary",
|
|
136
|
+
onClick: $
|
|
137
|
+
}, {
|
|
138
|
+
default: u(() => [
|
|
139
|
+
B(s(e.$l("Restore default")), 1)
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
})
|
|
143
|
+
])
|
|
144
|
+
]),
|
|
145
|
+
o("section", K, [
|
|
146
|
+
o("h3", null, s(e.$l("Appearance")), 1),
|
|
147
|
+
o("div", Q, [
|
|
148
|
+
o("span", W, s(e.$l("Light / dark mode")), 1),
|
|
149
|
+
p(c, {
|
|
150
|
+
modelValue: a(t).isDark,
|
|
151
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => a(t).isDark = n),
|
|
152
|
+
"inline-prompt": "",
|
|
153
|
+
"active-text": e.$l("Dark"),
|
|
154
|
+
"inactive-text": e.$l("Light"),
|
|
155
|
+
onChange: E
|
|
156
|
+
}, null, 8, ["modelValue", "active-text", "inactive-text"])
|
|
157
|
+
])
|
|
158
|
+
]),
|
|
159
|
+
o("section", X, [
|
|
160
|
+
o("h3", null, s(e.$l("Language")), 1),
|
|
161
|
+
p(I, {
|
|
162
|
+
modelValue: a(t).lang,
|
|
163
|
+
"onUpdate:modelValue": l[2] || (l[2] = (n) => a(t).lang = n),
|
|
164
|
+
class: "langSelect w160",
|
|
165
|
+
teleported: !0,
|
|
166
|
+
onChange: L
|
|
167
|
+
}, {
|
|
168
|
+
prefix: u(() => [
|
|
169
|
+
a(k) ? (d(), V("div", Z, [
|
|
170
|
+
o("span", ee, s(a(k).txt), 1)
|
|
171
|
+
])) : Y("", !0)
|
|
172
|
+
]),
|
|
173
|
+
default: u(() => [
|
|
174
|
+
(d(!0), V(G, null, z(a(v), (n) => (d(), b(R, {
|
|
175
|
+
key: n.value,
|
|
176
|
+
label: n.label,
|
|
177
|
+
value: n.value
|
|
178
|
+
}, {
|
|
179
|
+
default: u(() => [
|
|
180
|
+
o("div", te, [
|
|
181
|
+
o("span", le, s(n.txt), 1),
|
|
182
|
+
o("span", oe, s(n.label), 1)
|
|
183
|
+
])
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, 1032, ["label", "value"]))), 128))
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
}, 8, ["modelValue"])
|
|
190
|
+
])
|
|
191
|
+
])
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
}, 16, ["loading"]);
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
export {
|
|
199
|
+
re as default
|
|
200
|
+
};
|
package/dist/composition.js
CHANGED
|
@@ -1,203 +1,337 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getBuiltinLangMaps as L } from "./index.js";
|
|
2
|
+
const x = "lang", J = (t) => {
|
|
3
|
+
var o, s;
|
|
4
|
+
const e = typeof window < "u", r = () => {
|
|
5
|
+
if (!e)
|
|
6
|
+
return { innerWidth: 1920, innerHeight: 1080 };
|
|
7
|
+
const i = window, l = typeof navigator < "u" ? i.navigator : {}, a = i.screen || {}, c = i.visualViewport, u = {
|
|
8
|
+
innerWidth: i.innerWidth,
|
|
9
|
+
innerHeight: i.innerHeight,
|
|
10
|
+
outerWidth: i.outerWidth,
|
|
11
|
+
outerHeight: i.outerHeight,
|
|
12
|
+
screenWidth: a.width ?? i.innerWidth,
|
|
13
|
+
screenHeight: a.height ?? i.innerHeight,
|
|
14
|
+
availWidth: a.availWidth ?? i.innerWidth,
|
|
15
|
+
availHeight: a.availHeight ?? i.innerHeight,
|
|
16
|
+
devicePixelRatio: i.devicePixelRatio || 1
|
|
17
|
+
};
|
|
18
|
+
c && (u.visualViewportWidth = c.width, u.visualViewportHeight = c.height, u.visualViewportScale = c.scale);
|
|
19
|
+
const g = l.userAgent || "";
|
|
20
|
+
return u.env = {
|
|
21
|
+
userAgent: g,
|
|
22
|
+
language: l.language || "",
|
|
23
|
+
languages: l.languages ? [...l.languages] : [],
|
|
24
|
+
platform: l.platform || "",
|
|
25
|
+
cookieEnabled: !!l.cookieEnabled,
|
|
26
|
+
onLine: l.onLine !== !1,
|
|
27
|
+
maxTouchPoints: l.maxTouchPoints || 0,
|
|
28
|
+
isTouch: "ontouchstart" in i || (l.maxTouchPoints || 0) > 0,
|
|
29
|
+
isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(
|
|
30
|
+
g
|
|
31
|
+
)
|
|
32
|
+
}, u;
|
|
33
|
+
}, n = () => {
|
|
34
|
+
var l;
|
|
35
|
+
const i = r();
|
|
36
|
+
globalThis.$config = globalThis.$config || {}, globalThis.$config.options = {
|
|
37
|
+
...globalThis.$config.options || {},
|
|
38
|
+
...i
|
|
39
|
+
}, (l = t == null ? void 0 : t.config) != null && l.globalProperties && (t.config.globalProperties.$config = globalThis.$config);
|
|
40
|
+
};
|
|
41
|
+
n(), e && (window.addEventListener("resize", n, { passive: !0 }), (s = (o = window.visualViewport) == null ? void 0 : o.addEventListener) == null || s.call(o, "resize", n, {
|
|
42
|
+
passive: !0
|
|
43
|
+
}));
|
|
44
|
+
}, K = (t, e) => {
|
|
45
|
+
var l, a;
|
|
46
|
+
const r = e || {}, o = (typeof localStorage < "u" ? localStorage.getItem(x) : null) || ((l = globalThis.$config) == null ? void 0 : l.lang) || "en_us", s = Object.assign(
|
|
47
|
+
{},
|
|
48
|
+
L(o),
|
|
49
|
+
((a = globalThis.$config) == null ? void 0 : a.langMaps) || {},
|
|
50
|
+
r.langMaps || {}
|
|
51
|
+
), i = (c, u) => {
|
|
52
|
+
if (c)
|
|
53
|
+
if (u && globalThis.$getType(u) === "Object") {
|
|
54
|
+
let g = s[c] || c;
|
|
55
|
+
return Object.keys(u).forEach((y) => {
|
|
56
|
+
g[`{${y}}`] = u[y];
|
|
57
|
+
}), g;
|
|
58
|
+
} else
|
|
59
|
+
return s[c] || c;
|
|
60
|
+
else
|
|
61
|
+
return c;
|
|
62
|
+
};
|
|
63
|
+
globalThis.$patchLangMaps = (c) => {
|
|
64
|
+
c && globalThis.$getType(c) === "Object" && Object.assign(s, c);
|
|
65
|
+
}, globalThis.$l = i, t.config.globalProperties.$l = i, t.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = i;
|
|
66
|
+
}, D = (t) => {
|
|
67
|
+
if (!t)
|
|
68
|
+
return maps;
|
|
69
|
+
const e = t.split(".");
|
|
70
|
+
if (e.length > 1) {
|
|
71
|
+
let r = maps;
|
|
72
|
+
for (let n = 0; n < e.length; n++)
|
|
73
|
+
r[e[n]] ? r = r[e[n]] : console.error(`No Map node at ${e[n]} in ${t}`);
|
|
74
|
+
return r;
|
|
75
|
+
} else
|
|
76
|
+
return maps[t];
|
|
77
|
+
}, X = (t, e) => {
|
|
78
|
+
if (!t || !e) return !1;
|
|
79
|
+
const r = t.getBoundingClientRect(), n = e.getBoundingClientRect(), o = n.right > r.left && n.left < r.right, s = n.bottom > r.top && n.top < r.bottom;
|
|
4
80
|
return o && s;
|
|
5
|
-
}, _ = (
|
|
6
|
-
if (
|
|
7
|
-
if (
|
|
8
|
-
return JSON.stringify(
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
for (const o of
|
|
12
|
-
if (!
|
|
81
|
+
}, _ = (t, e) => {
|
|
82
|
+
if (t === e) return !0;
|
|
83
|
+
if (t == null || e == null || typeof t != "object" || typeof e != "object")
|
|
84
|
+
return JSON.stringify(t) === JSON.stringify(e);
|
|
85
|
+
const r = Object.keys(t), n = Object.keys(e);
|
|
86
|
+
if (r.length !== n.length) return !1;
|
|
87
|
+
for (const o of r)
|
|
88
|
+
if (!n.includes(o) || !_(t[o], e[o])) return !1;
|
|
13
89
|
return !0;
|
|
14
|
-
},
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const e = ((n == null ? void 0 : n.type) || "").toLowerCase();
|
|
90
|
+
}, v = "download", O = 150, A = (t, e = v) => {
|
|
91
|
+
const r = e || v, n = String(t ?? "").trim();
|
|
92
|
+
if (!n) return r;
|
|
93
|
+
const s = n.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || r, i = 200;
|
|
94
|
+
return s.length > i ? s.slice(0, i) : s;
|
|
95
|
+
}, B = (t) => {
|
|
96
|
+
const e = ((t == null ? void 0 : t.type) || "").toLowerCase();
|
|
22
97
|
return e ? e.includes("spreadsheet") || e.includes("ms-excel") || e.includes("excel") && e.includes("application") : !1;
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
o.href =
|
|
98
|
+
}, S = (t, e) => {
|
|
99
|
+
const r = URL.createObjectURL(t), n = A(e), o = document.createElement("a");
|
|
100
|
+
o.href = r, o.download = n, o.style.display = "none", document.body.appendChild(o);
|
|
26
101
|
try {
|
|
27
102
|
o.click();
|
|
28
103
|
} finally {
|
|
29
|
-
document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(
|
|
104
|
+
document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(r), O);
|
|
30
105
|
}
|
|
31
|
-
},
|
|
32
|
-
if (!
|
|
33
|
-
return
|
|
34
|
-
const { type: e, data:
|
|
106
|
+
}, I = (t) => {
|
|
107
|
+
if (!t || t.source !== void 0 || t.type === void 0)
|
|
108
|
+
return t;
|
|
109
|
+
const { type: e, data: r, url: n, headers: o, name: s, filename: i, init: l, ...a } = t, c = i ?? s;
|
|
35
110
|
return e === "csv" ? {
|
|
36
|
-
...
|
|
111
|
+
...a,
|
|
37
112
|
source: "inline",
|
|
38
|
-
content:
|
|
39
|
-
filename:
|
|
40
|
-
bom:
|
|
113
|
+
content: r,
|
|
114
|
+
filename: c,
|
|
115
|
+
bom: t.bom
|
|
41
116
|
} : e === "excel" ? {
|
|
42
|
-
...
|
|
117
|
+
...a,
|
|
43
118
|
source: "fetch",
|
|
44
|
-
url:
|
|
45
|
-
init: { ...
|
|
119
|
+
url: n,
|
|
120
|
+
init: { ...l || {}, headers: o ?? (l == null ? void 0 : l.headers) },
|
|
46
121
|
response: "blob",
|
|
47
122
|
expectExcel: !0,
|
|
48
|
-
filename:
|
|
49
|
-
} :
|
|
50
|
-
},
|
|
51
|
-
const e =
|
|
52
|
-
source:
|
|
53
|
-
content:
|
|
123
|
+
filename: c
|
|
124
|
+
} : t;
|
|
125
|
+
}, Q = async (t = {}) => {
|
|
126
|
+
const e = I(t), {
|
|
127
|
+
source: r = "inline",
|
|
128
|
+
content: n,
|
|
54
129
|
blob: o,
|
|
55
130
|
bom: s = !0,
|
|
56
|
-
mime:
|
|
57
|
-
url:
|
|
58
|
-
init:
|
|
59
|
-
response:
|
|
60
|
-
openIn:
|
|
61
|
-
expectExcel:
|
|
62
|
-
filename:
|
|
63
|
-
name:
|
|
64
|
-
error:
|
|
131
|
+
mime: i,
|
|
132
|
+
url: l,
|
|
133
|
+
init: a,
|
|
134
|
+
response: c = "blob",
|
|
135
|
+
openIn: u = "self",
|
|
136
|
+
expectExcel: g,
|
|
137
|
+
filename: y,
|
|
138
|
+
name: $,
|
|
139
|
+
error: p = () => {
|
|
65
140
|
},
|
|
66
141
|
// 避免 legacy 字段渗入后续逻辑
|
|
67
|
-
type:
|
|
68
|
-
data:
|
|
69
|
-
headers:
|
|
70
|
-
...
|
|
71
|
-
} = e,
|
|
142
|
+
type: F,
|
|
143
|
+
data: z,
|
|
144
|
+
headers: q,
|
|
145
|
+
...G
|
|
146
|
+
} = e, b = y ?? $;
|
|
72
147
|
try {
|
|
73
|
-
if (
|
|
148
|
+
if (r === "inline") {
|
|
74
149
|
if (o instanceof Blob) {
|
|
75
|
-
|
|
150
|
+
S(o, b);
|
|
76
151
|
return;
|
|
77
152
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
153
|
+
if (n == null) {
|
|
154
|
+
p(new Error("content or blob is required for inline"));
|
|
80
155
|
return;
|
|
81
156
|
}
|
|
82
|
-
const
|
|
83
|
-
|
|
157
|
+
const f = typeof n == "string" ? n : String(n), E = s ? "\uFEFF" + f : f, w = i || (s ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
|
|
158
|
+
S(new Blob([E], { type: w }), b);
|
|
84
159
|
return;
|
|
85
160
|
}
|
|
86
|
-
if (
|
|
87
|
-
if (!
|
|
88
|
-
|
|
161
|
+
if (r === "fetch") {
|
|
162
|
+
if (!l) {
|
|
163
|
+
p(new Error("url is required for fetch"));
|
|
89
164
|
return;
|
|
90
165
|
}
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
93
|
-
|
|
166
|
+
const f = await fetch(l, a);
|
|
167
|
+
if (!f.ok) {
|
|
168
|
+
p(new Error(`fetch failed: ${f.status}`));
|
|
94
169
|
return;
|
|
95
170
|
}
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
171
|
+
if (c === "text") {
|
|
172
|
+
const w = await f.text(), k = s ? "\uFEFF" + w : w, P = i || (s ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
|
|
173
|
+
S(new Blob([k], { type: P }), b);
|
|
99
174
|
return;
|
|
100
175
|
}
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
|
|
176
|
+
const E = await f.blob();
|
|
177
|
+
if (g && !B(E)) {
|
|
178
|
+
p(new Error("excel does not exist"));
|
|
104
179
|
return;
|
|
105
180
|
}
|
|
106
|
-
|
|
181
|
+
S(E, b);
|
|
107
182
|
return;
|
|
108
183
|
}
|
|
109
|
-
if (
|
|
110
|
-
if (!
|
|
111
|
-
|
|
184
|
+
if (r === "open") {
|
|
185
|
+
if (!l) {
|
|
186
|
+
p(new Error("url is required for open"));
|
|
112
187
|
return;
|
|
113
188
|
}
|
|
114
|
-
|
|
189
|
+
u === "blank" ? window.open(l, "_blank", "noopener,noreferrer") : window.location.href = l;
|
|
115
190
|
return;
|
|
116
191
|
}
|
|
117
|
-
|
|
118
|
-
} catch (
|
|
119
|
-
|
|
192
|
+
p(new Error(`unknown source: ${r}`));
|
|
193
|
+
} catch (f) {
|
|
194
|
+
p(f instanceof Error ? f : new Error(String(f)));
|
|
120
195
|
}
|
|
121
196
|
};
|
|
122
|
-
function
|
|
197
|
+
function j(t, e, r) {
|
|
123
198
|
if (e === "" || e === void 0 || e === null)
|
|
124
199
|
return "";
|
|
125
|
-
const
|
|
126
|
-
if ((
|
|
127
|
-
const
|
|
128
|
-
[
|
|
129
|
-
unit:
|
|
200
|
+
const n = globalThis.$fa, o = globalThis.$fu, s = (r == null ? void 0 : r.precision) ?? 2, i = r == null ? void 0 : r.unit;
|
|
201
|
+
if ((i === "currency" || i === "%") && o) {
|
|
202
|
+
const l = {
|
|
203
|
+
[t]: {
|
|
204
|
+
unit: i === "currency" ? "currency" : "%",
|
|
130
205
|
precision: s
|
|
131
206
|
}
|
|
132
207
|
};
|
|
133
208
|
try {
|
|
134
209
|
return o({
|
|
135
|
-
prop:
|
|
136
|
-
currency:
|
|
210
|
+
prop: t,
|
|
211
|
+
currency: r == null ? void 0 : r.currency,
|
|
137
212
|
value: e,
|
|
138
|
-
obj:
|
|
213
|
+
obj: l
|
|
139
214
|
});
|
|
140
215
|
} catch {
|
|
141
216
|
}
|
|
142
217
|
}
|
|
143
|
-
if (
|
|
218
|
+
if (n)
|
|
144
219
|
try {
|
|
145
|
-
return
|
|
220
|
+
return n(e, s);
|
|
146
221
|
} catch {
|
|
147
222
|
return String(e);
|
|
148
223
|
}
|
|
149
224
|
return String(e);
|
|
150
225
|
}
|
|
151
|
-
function
|
|
152
|
-
const { columns:
|
|
153
|
-
return !
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
226
|
+
function Z(t, e, r = {}) {
|
|
227
|
+
const { columns: n = [] } = t || {}, { resolveMetric: o } = r;
|
|
228
|
+
return !n.length || !e || typeof e != "object" ? [] : n.map((s) => {
|
|
229
|
+
const i = s.property ?? s.prop ?? "";
|
|
230
|
+
if (!i)
|
|
156
231
|
return "";
|
|
157
|
-
let
|
|
158
|
-
if (
|
|
232
|
+
let l = e[i];
|
|
233
|
+
if (l === void 0 && (l = ""), l === "")
|
|
159
234
|
return "";
|
|
160
|
-
const
|
|
235
|
+
const a = typeof o == "function" ? o(i) : void 0;
|
|
161
236
|
try {
|
|
162
|
-
return
|
|
237
|
+
return j(i, l, a);
|
|
163
238
|
} catch {
|
|
164
|
-
return String(
|
|
239
|
+
return String(l);
|
|
165
240
|
}
|
|
166
241
|
});
|
|
167
242
|
}
|
|
168
|
-
const M =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
243
|
+
const T = "mvframe_primary", M = "mvframe_theme", m = { r: 255, g: 255, b: 255 }, H = { r: 0, g: 0, b: 0 }, W = [
|
|
244
|
+
"--el-color-primary-light-3",
|
|
245
|
+
"--el-color-primary-light-5",
|
|
246
|
+
"--el-color-primary-light-7",
|
|
247
|
+
"--el-color-primary-light-8",
|
|
248
|
+
"--el-color-primary-light-9",
|
|
249
|
+
"--el-color-primary-dark-2"
|
|
250
|
+
];
|
|
251
|
+
function R(t) {
|
|
252
|
+
let e = String(t).trim().replace(/^#/, "");
|
|
253
|
+
if (e.length === 3 && (e = e.split("").map((n) => n + n).join("")), e.length >= 8 && (e = e.slice(0, 6)), e.length !== 6 || Number.isNaN(parseInt(e, 16)))
|
|
254
|
+
return null;
|
|
255
|
+
const r = parseInt(e, 16);
|
|
256
|
+
return {
|
|
257
|
+
r: r >> 16 & 255,
|
|
258
|
+
g: r >> 8 & 255,
|
|
259
|
+
b: r & 255
|
|
180
260
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
261
|
+
}
|
|
262
|
+
function d(t, e, r) {
|
|
263
|
+
const n = (o) => Math.max(0, Math.min(255, Math.round(o)));
|
|
264
|
+
return `#${[n(t), n(e), n(r)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
|
|
265
|
+
}
|
|
266
|
+
function h(t, e, r) {
|
|
267
|
+
const n = r / 100, o = 1 - n;
|
|
268
|
+
return {
|
|
269
|
+
r: t.r * n + e.r * o,
|
|
270
|
+
g: t.g * n + e.g * o,
|
|
271
|
+
b: t.b * n + e.b * o
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function V(t) {
|
|
275
|
+
const e = R(t);
|
|
276
|
+
if (!e)
|
|
277
|
+
return null;
|
|
278
|
+
const r = h(m, e, 30), n = h(m, e, 50), o = h(m, e, 70), s = h(m, e, 80), i = h(m, e, 90), l = h(H, e, 20);
|
|
279
|
+
return {
|
|
280
|
+
"--el-color-primary-light-3": d(r.r, r.g, r.b),
|
|
281
|
+
"--el-color-primary-light-5": d(n.r, n.g, n.b),
|
|
282
|
+
"--el-color-primary-light-7": d(o.r, o.g, o.b),
|
|
283
|
+
"--el-color-primary-light-8": d(s.r, s.g, s.b),
|
|
284
|
+
"--el-color-primary-light-9": d(i.r, i.g, i.b),
|
|
285
|
+
"--el-color-primary-dark-2": d(l.r, l.g, l.b)
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function C(t) {
|
|
289
|
+
t.style.removeProperty("--el-color-primary");
|
|
290
|
+
for (const e of W)
|
|
291
|
+
t.style.removeProperty(e);
|
|
292
|
+
}
|
|
293
|
+
function N(t, e) {
|
|
294
|
+
const r = R(e.startsWith("#") ? e : `#${e}`);
|
|
295
|
+
if (!r)
|
|
296
|
+
return !1;
|
|
297
|
+
const n = d(r.r, r.g, r.b);
|
|
298
|
+
t.style.setProperty("--color-primary", n), t.style.setProperty("--el-color-primary", n);
|
|
299
|
+
const o = V(n);
|
|
300
|
+
return o && Object.entries(o).forEach(([s, i]) => t.style.setProperty(s, i)), !0;
|
|
301
|
+
}
|
|
302
|
+
function U(t = {}) {
|
|
303
|
+
const e = document.documentElement;
|
|
304
|
+
if (t.primary != null && t.primary !== "") {
|
|
305
|
+
const n = String(t.primary).trim();
|
|
306
|
+
N(e, n) || (e.style.setProperty("--color-primary", n), e.style.setProperty("--el-color-primary", n));
|
|
307
|
+
} else (t.primary === null || t.primary === "") && (e.style.removeProperty("--color-primary"), C(e));
|
|
308
|
+
const r = t.mode ?? (e.classList.contains("dark") ? "dark" : "light");
|
|
309
|
+
e.classList.toggle("dark", r === "dark");
|
|
310
|
+
}
|
|
311
|
+
function ee(t) {
|
|
312
|
+
t.primary !== void 0 && (t.primary == null || t.primary === "" ? localStorage.removeItem(T) : localStorage.setItem(T, String(t.primary))), t.mode !== void 0 && localStorage.setItem(M, t.mode);
|
|
313
|
+
}
|
|
314
|
+
function te() {
|
|
315
|
+
const t = localStorage.getItem(T), r = localStorage.getItem(M) === "dark" ? "dark" : "light";
|
|
316
|
+
U({
|
|
317
|
+
primary: t != null && t !== "" ? t : null,
|
|
318
|
+
mode: r
|
|
319
|
+
});
|
|
320
|
+
}
|
|
194
321
|
export {
|
|
322
|
+
x as MVFRAME_STORAGE_LANG,
|
|
323
|
+
T as MVFRAME_STORAGE_PRIMARY,
|
|
324
|
+
M as MVFRAME_STORAGE_THEME,
|
|
325
|
+
U as applyMvframeTheme,
|
|
195
326
|
_ as deepEqual,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
327
|
+
Q as download,
|
|
328
|
+
j as formatSummaryCell,
|
|
329
|
+
X as isInView,
|
|
330
|
+
te as loadMvframeTheme,
|
|
331
|
+
ee as persistMvframeTheme,
|
|
332
|
+
A as sanitizeDownloadFileName,
|
|
333
|
+
K as useLang,
|
|
334
|
+
D as useMap,
|
|
335
|
+
J as useOptions,
|
|
336
|
+
Z as useRemoteSummary
|
|
203
337
|
};
|