mvframe 1.0.82 → 1.0.86
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/.cursor/rules/style-system.mdc +45 -0
- package/README.cn.md +23 -0
- package/README.md +23 -0
- package/dist/composition.js +148 -130
- package/dist/css/cpt.css +1 -1
- package/dist/css/style.css +1 -1
- package/dist/vendor.js +1176 -1164
- package/package.json +1 -1
- package/scripts/install-codex-agents.js +6 -2
- package/scripts/scaffold-app.js +23 -0
|
@@ -238,6 +238,51 @@ alwaysApply: true
|
|
|
238
238
|
| `tipbtn bottom/left/right` | 控制提示方向 |
|
|
239
239
|
| `MvcIcon` | 组件图标类,默认 `flex-shrink: 0` |
|
|
240
240
|
|
|
241
|
+
### 表单 Label(element.scss)
|
|
242
|
+
|
|
243
|
+
`Input`、`Textarea`、`Select`、`SelectV2` 支持统一的 label 接口:
|
|
244
|
+
|
|
245
|
+
| 属性 | 用途 |
|
|
246
|
+
|------|------|
|
|
247
|
+
| `label` | 显示表单标题 |
|
|
248
|
+
| `material-label` | 启用 Material 风格浮动 label |
|
|
249
|
+
|
|
250
|
+
使用规则:
|
|
251
|
+
|
|
252
|
+
- 只传 `label`:渲染为普通上方标题
|
|
253
|
+
- 传 `label` + `material-label`:渲染为 Material 风格浮动标签
|
|
254
|
+
- 不传 `label`:保持原组件默认外观
|
|
255
|
+
|
|
256
|
+
Material 风格的上浮条件:
|
|
257
|
+
|
|
258
|
+
- 当前控件有值
|
|
259
|
+
- 当前控件有 placeholder
|
|
260
|
+
- 当前控件处于 focus / 打开状态(Select / SelectV2)
|
|
261
|
+
|
|
262
|
+
推荐写法:
|
|
263
|
+
|
|
264
|
+
```vue
|
|
265
|
+
<Input v-model="form.name" label="Name" />
|
|
266
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
267
|
+
|
|
268
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
269
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
270
|
+
|
|
271
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
272
|
+
<Select
|
|
273
|
+
v-model="form.type"
|
|
274
|
+
:options="options"
|
|
275
|
+
label="Material Type"
|
|
276
|
+
material-label
|
|
277
|
+
/>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
约束:
|
|
281
|
+
|
|
282
|
+
- Material label 的壳样式统一在 `src/style/chip/element.scss`,不要在业务组件里重复写一套 scoped 浮动 label
|
|
283
|
+
- 如果要做 Material 风格,优先直接使用 `label` + `material-label`,不要再额外包一层自定义标题
|
|
284
|
+
- 如需特殊背景色,优先通过 field surface 相关变量覆写,不要直接把 label 写死成固定背景色
|
|
285
|
+
|
|
241
286
|
## 7. 动画(ani.scss)
|
|
242
287
|
|
|
243
288
|
| 类名 | 用途 |
|
package/README.cn.md
CHANGED
|
@@ -220,6 +220,29 @@ await notify("需要发送到钉钉的消息");
|
|
|
220
220
|
- **组件 class 与单位**:根节点 `Mvc*` + 子命名 camelCase;组件内尺寸除 1px/2px 外建议 **rem**(根号 16px),与 `style-system.mdc` 一致。
|
|
221
221
|
- 工具函数、Store、路由在非 setup 场景(如守卫)中通过 **`globalThis`** 或 **`store` / `pinia` 导出**访问,与 `src/router/chip/guard.js` 用法一致。
|
|
222
222
|
|
|
223
|
+
## 表单 Label
|
|
224
|
+
|
|
225
|
+
`Input`、`Textarea`、`Select`、`SelectV2` 现已支持统一的 label 接口:
|
|
226
|
+
|
|
227
|
+
```vue
|
|
228
|
+
<Input v-model="form.name" label="Name" />
|
|
229
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
230
|
+
|
|
231
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
232
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
233
|
+
|
|
234
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
235
|
+
<Select v-model="form.type" :options="options" label="Material Type" material-label />
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
规则:
|
|
239
|
+
|
|
240
|
+
- 只传 `label`:渲染普通上方标题
|
|
241
|
+
- 传 `label` + `material-label`:渲染 Material 风格浮动标签
|
|
242
|
+
- 不传 `label`:保持组件默认外观
|
|
243
|
+
|
|
244
|
+
浮动 label 的公共壳样式统一实现在 `src/style/chip/element.scss`。如果你希望表单控件呈现 Material 风格,优先直接使用 `label` + `material-label`,不要在业务侧再重复造一套浮动标题样式。
|
|
245
|
+
|
|
223
246
|
---
|
|
224
247
|
|
|
225
248
|
## 命令行:项目目录雏形(推荐)
|
package/README.md
CHANGED
|
@@ -207,6 +207,29 @@ Send messages with `globalThis.$notify.send("message")` or `import { notify } fr
|
|
|
207
207
|
- **CSS naming & units**: root `Mvc*`, children camelCase; prefer **rem** for sizes other than 1px/2px (16px root)—see `style-system.mdc`.
|
|
208
208
|
- Use **`globalThis`** or **`store` / `pinia` exports** outside `setup` (e.g. guards), as in `src/router/chip/guard.js`.
|
|
209
209
|
|
|
210
|
+
## Form Labels
|
|
211
|
+
|
|
212
|
+
`Input`, `Textarea`, `Select`, and `SelectV2` support a shared label API:
|
|
213
|
+
|
|
214
|
+
```vue
|
|
215
|
+
<Input v-model="form.name" label="Name" />
|
|
216
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
217
|
+
|
|
218
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
219
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
220
|
+
|
|
221
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
222
|
+
<Select v-model="form.type" :options="options" label="Material Type" material-label />
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Rules:
|
|
226
|
+
|
|
227
|
+
- `label` only: renders a normal top label
|
|
228
|
+
- `label` + `material-label`: renders a Material-style floating label
|
|
229
|
+
- no `label`: keeps the default control appearance
|
|
230
|
+
|
|
231
|
+
The floating label shell is implemented centrally in `src/style/chip/element.scss`. When you want a Material-style form field, prefer the built-in `label` + `material-label` API instead of recreating the same pattern locally.
|
|
232
|
+
|
|
210
233
|
---
|
|
211
234
|
|
|
212
235
|
## CLI: project skeleton
|
package/dist/composition.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
import { a as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { M as V, g as W, s as N } from "./vendor.js";
|
|
2
|
+
import { a as Le, m as Ae, b as xe, c as ke, p as Ce, u as Ie } from "./vendor.js";
|
|
3
|
+
import C from "axios";
|
|
4
|
+
const q = "lang", ye = (e, t) => {
|
|
5
5
|
var i, a;
|
|
6
6
|
const r = typeof window < "u", n = () => {
|
|
7
7
|
var m;
|
|
@@ -48,23 +48,23 @@ const W = "lang", fe = (e, t) => {
|
|
|
48
48
|
o(), r && (window.addEventListener("resize", o, { passive: !0 }), (a = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || a.call(i, "resize", o, {
|
|
49
49
|
passive: !0
|
|
50
50
|
}));
|
|
51
|
-
},
|
|
51
|
+
}, be = (e, t) => {
|
|
52
52
|
var l, u, f;
|
|
53
|
-
const r = t || {}, n = Array.isArray(r.use) && r.use.length > 0 ? r.use :
|
|
53
|
+
const r = t || {}, n = Array.isArray(r.use) && r.use.length > 0 ? r.use : V;
|
|
54
54
|
globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = n.filter(
|
|
55
55
|
(c) => c && c.use !== !1 && c.value
|
|
56
56
|
), (l = e == null ? void 0 : e.config) != null && l.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
|
|
57
|
-
const i = (typeof localStorage < "u" ? localStorage.getItem(
|
|
57
|
+
const i = (typeof localStorage < "u" ? localStorage.getItem(q) : null) || ((u = globalThis.$config) == null ? void 0 : u.lang) || "en_us", a = Object.assign(
|
|
58
58
|
{},
|
|
59
|
-
|
|
59
|
+
W(i),
|
|
60
60
|
((f = globalThis.$config) == null ? void 0 : f.langMaps) || {},
|
|
61
61
|
r.langMaps || {}
|
|
62
62
|
), s = (c, g) => {
|
|
63
63
|
if (c)
|
|
64
64
|
if (g && globalThis.$getType(g) === "Object") {
|
|
65
65
|
let m = a[c] || c;
|
|
66
|
-
return Object.keys(g).forEach((
|
|
67
|
-
m[`{${
|
|
66
|
+
return Object.keys(g).forEach((d) => {
|
|
67
|
+
m[`{${d}}`] = g[d];
|
|
68
68
|
}), m;
|
|
69
69
|
} else
|
|
70
70
|
return a[c] || c;
|
|
@@ -76,36 +76,36 @@ const W = "lang", fe = (e, t) => {
|
|
|
76
76
|
}, globalThis.$l = s, e.config.globalProperties.$l = s, e.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = function() {
|
|
77
77
|
return $l(this);
|
|
78
78
|
};
|
|
79
|
-
},
|
|
79
|
+
}, _e = (e, t) => {
|
|
80
80
|
if (!e || !t) return !1;
|
|
81
81
|
const r = e.getBoundingClientRect(), n = t.getBoundingClientRect(), o = n.right > r.left && n.left < r.right, i = n.bottom > r.top && n.top < r.bottom;
|
|
82
82
|
return o && i;
|
|
83
|
-
},
|
|
83
|
+
}, F = (e, t) => {
|
|
84
84
|
if (e === t) return !0;
|
|
85
85
|
if (e == null || t == null || typeof e != "object" || typeof t != "object")
|
|
86
86
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
87
87
|
const r = Object.keys(e), n = Object.keys(t);
|
|
88
88
|
if (r.length !== n.length) return !1;
|
|
89
89
|
for (const o of r)
|
|
90
|
-
if (!n.includes(o) || !
|
|
90
|
+
if (!n.includes(o) || !F(e[o], t[o])) return !1;
|
|
91
91
|
return !0;
|
|
92
|
-
}, x = "download",
|
|
92
|
+
}, x = "download", D = 150, Y = (e, t = x) => {
|
|
93
93
|
const r = t || x, n = String(e ?? "").trim();
|
|
94
94
|
if (!n) return r;
|
|
95
95
|
const i = n.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || r, a = 200;
|
|
96
96
|
return i.length > a ? i.slice(0, a) : i;
|
|
97
|
-
},
|
|
97
|
+
}, z = (e) => {
|
|
98
98
|
const t = ((e == null ? void 0 : e.type) || "").toLowerCase();
|
|
99
99
|
return t ? t.includes("spreadsheet") || t.includes("ms-excel") || t.includes("excel") && t.includes("application") : !1;
|
|
100
100
|
}, $ = (e, t) => {
|
|
101
|
-
const r = URL.createObjectURL(e), n =
|
|
101
|
+
const r = URL.createObjectURL(e), n = Y(t), o = document.createElement("a");
|
|
102
102
|
o.href = r, o.download = n, o.style.display = "none", document.body.appendChild(o);
|
|
103
103
|
try {
|
|
104
104
|
o.click();
|
|
105
105
|
} finally {
|
|
106
|
-
document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(r),
|
|
106
|
+
document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(r), D);
|
|
107
107
|
}
|
|
108
|
-
},
|
|
108
|
+
}, G = (e) => {
|
|
109
109
|
if (!e || e.source !== void 0 || e.type === void 0)
|
|
110
110
|
return e;
|
|
111
111
|
const { type: t, data: r, url: n, headers: o, name: i, filename: a, init: s, ...l } = e, u = a ?? i;
|
|
@@ -124,8 +124,8 @@ const W = "lang", fe = (e, t) => {
|
|
|
124
124
|
expectExcel: !0,
|
|
125
125
|
filename: u
|
|
126
126
|
} : e;
|
|
127
|
-
},
|
|
128
|
-
const t =
|
|
127
|
+
}, Ee = async (e = {}) => {
|
|
128
|
+
const t = G(e), {
|
|
129
129
|
source: r = "inline",
|
|
130
130
|
content: n,
|
|
131
131
|
blob: o,
|
|
@@ -138,13 +138,13 @@ const W = "lang", fe = (e, t) => {
|
|
|
138
138
|
expectExcel: c,
|
|
139
139
|
filename: g,
|
|
140
140
|
name: m,
|
|
141
|
-
error:
|
|
141
|
+
error: d = () => {
|
|
142
142
|
},
|
|
143
143
|
// 避免 legacy 字段渗入后续逻辑
|
|
144
|
-
type:
|
|
145
|
-
data:
|
|
146
|
-
headers:
|
|
147
|
-
...
|
|
144
|
+
type: pe,
|
|
145
|
+
data: de,
|
|
146
|
+
headers: fe,
|
|
147
|
+
...ge
|
|
148
148
|
} = t, v = g ?? m;
|
|
149
149
|
try {
|
|
150
150
|
if (r === "inline") {
|
|
@@ -153,31 +153,31 @@ const W = "lang", fe = (e, t) => {
|
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
if (n == null) {
|
|
156
|
-
|
|
156
|
+
d(new Error("content or blob is required for inline"));
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
const
|
|
160
|
-
$(new Blob([R], { type:
|
|
159
|
+
const p = typeof n == "string" ? n : String(n), R = i ? "\uFEFF" + p : p, P = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
|
|
160
|
+
$(new Blob([R], { type: P }), v);
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
163
|
if (r === "fetch") {
|
|
164
164
|
if (!s) {
|
|
165
|
-
|
|
165
|
+
d(new Error("url is required for fetch"));
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
|
|
168
|
+
const p = await fetch(s, l);
|
|
169
|
+
if (!p.ok) {
|
|
170
|
+
d(new Error(`fetch failed: ${p.status}`));
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
if (u === "text") {
|
|
174
|
-
const
|
|
175
|
-
$(new Blob([
|
|
174
|
+
const P = await p.text(), B = i ? "\uFEFF" + P : P, U = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
|
|
175
|
+
$(new Blob([B], { type: U }), v);
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
const R = await
|
|
179
|
-
if (c && !
|
|
180
|
-
|
|
178
|
+
const R = await p.blob();
|
|
179
|
+
if (c && !z(R)) {
|
|
180
|
+
d(new Error("excel does not exist"));
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
$(R, v);
|
|
@@ -185,18 +185,18 @@ const W = "lang", fe = (e, t) => {
|
|
|
185
185
|
}
|
|
186
186
|
if (r === "open") {
|
|
187
187
|
if (!s) {
|
|
188
|
-
|
|
188
|
+
d(new Error("url is required for open"));
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
f === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
|
-
|
|
195
|
-
} catch (
|
|
196
|
-
p
|
|
194
|
+
d(new Error(`unknown source: ${r}`));
|
|
195
|
+
} catch (p) {
|
|
196
|
+
d(p instanceof Error ? p : new Error(String(p)));
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function K(e, t, r) {
|
|
200
200
|
if (t === "" || t === void 0 || t === null)
|
|
201
201
|
return "";
|
|
202
202
|
const n = globalThis.$fa, o = globalThis.$fu, i = (r == null ? void 0 : r.precision) ?? 2, a = r == null ? void 0 : r.unit;
|
|
@@ -225,7 +225,7 @@ function G(e, t, r) {
|
|
|
225
225
|
}
|
|
226
226
|
return String(t);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function Te(e, t, r = {}) {
|
|
229
229
|
const { columns: n = [] } = e || {}, { resolveMetric: o } = r;
|
|
230
230
|
return !n.length || !t || typeof t != "object" ? [] : n.map((i) => {
|
|
231
231
|
const a = i.property ?? i.prop ?? "";
|
|
@@ -236,21 +236,23 @@ function ye(e, t, r = {}) {
|
|
|
236
236
|
return "";
|
|
237
237
|
const l = typeof o == "function" ? o(a) : void 0;
|
|
238
238
|
try {
|
|
239
|
-
return
|
|
239
|
+
return K(a, s, l);
|
|
240
240
|
} catch {
|
|
241
241
|
return String(s);
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
const L = "mvframe_primary", I = "mvframe_theme",
|
|
245
|
+
const L = "mvframe_primary", I = "mvframe_theme", T = { r: 255, g: 255, b: 255 }, J = { r: 0, g: 0, b: 0 }, O = [1, 3, 5, 7, 9], X = [
|
|
246
246
|
"--el-color-primary-light-3",
|
|
247
247
|
"--el-color-primary-light-5",
|
|
248
248
|
"--el-color-primary-light-7",
|
|
249
249
|
"--el-color-primary-light-8",
|
|
250
250
|
"--el-color-primary-light-9",
|
|
251
251
|
"--el-color-primary-dark-2"
|
|
252
|
-
]
|
|
253
|
-
|
|
252
|
+
], Q = O.map(
|
|
253
|
+
(e) => `--color-primary${e}`
|
|
254
|
+
);
|
|
255
|
+
function M(e) {
|
|
254
256
|
let t = String(e).trim().replace(/^#/, "");
|
|
255
257
|
if (t.length === 3 && (t = t.split("").map((n) => n + n).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
|
|
256
258
|
return null;
|
|
@@ -265,12 +267,16 @@ function y(e, t, r) {
|
|
|
265
267
|
const n = (o) => Math.max(0, Math.min(255, Math.round(o)));
|
|
266
268
|
return `#${[n(e), n(t), n(r)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
|
|
267
269
|
}
|
|
268
|
-
function
|
|
270
|
+
function H(e, t, r, n) {
|
|
271
|
+
const o = (a) => Math.max(0, Math.min(255, Math.round(a))), i = Math.max(0, Math.min(1, n));
|
|
272
|
+
return `rgba(${o(e)}, ${o(t)}, ${o(r)}, ${i})`;
|
|
273
|
+
}
|
|
274
|
+
function Z(e) {
|
|
269
275
|
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));
|
|
270
276
|
return 0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2];
|
|
271
277
|
}
|
|
272
|
-
function
|
|
273
|
-
return
|
|
278
|
+
function j(e) {
|
|
279
|
+
return Z(e) > 0.5 ? "#1a1a1a" : "#ffffff";
|
|
274
280
|
}
|
|
275
281
|
function b(e, t, r) {
|
|
276
282
|
const n = r / 100, o = 1 - n;
|
|
@@ -280,80 +286,92 @@ function b(e, t, r) {
|
|
|
280
286
|
b: e.b * n + t.b * o
|
|
281
287
|
};
|
|
282
288
|
}
|
|
283
|
-
function
|
|
284
|
-
const
|
|
285
|
-
if (!
|
|
289
|
+
function ee(e, t = "light") {
|
|
290
|
+
const r = M(e);
|
|
291
|
+
if (!r)
|
|
286
292
|
return null;
|
|
287
|
-
const
|
|
293
|
+
const n = b(T, r, 30), o = b(T, r, 50), i = b(T, r, 70), a = b(T, r, 80), s = b(T, r, 90), l = b(J, r, 20);
|
|
288
294
|
return {
|
|
289
|
-
"--el-color-primary-light-3": y(
|
|
290
|
-
"--el-color-primary-light-5": y(
|
|
291
|
-
"--el-color-primary-light-7": y(
|
|
292
|
-
"--el-color-primary-light-8": y(
|
|
293
|
-
"--el-color-primary-light-9": y(
|
|
294
|
-
"--el-color-primary-dark-2": y(
|
|
295
|
+
"--el-color-primary-light-3": y(n.r, n.g, n.b),
|
|
296
|
+
"--el-color-primary-light-5": y(o.r, o.g, o.b),
|
|
297
|
+
"--el-color-primary-light-7": t === "dark" ? H(r.r, r.g, r.b, 0.7) : y(i.r, i.g, i.b),
|
|
298
|
+
"--el-color-primary-light-8": y(a.r, a.g, a.b),
|
|
299
|
+
"--el-color-primary-light-9": y(s.r, s.g, s.b),
|
|
300
|
+
"--el-color-primary-dark-2": y(l.r, l.g, l.b)
|
|
295
301
|
};
|
|
296
302
|
}
|
|
297
|
-
function
|
|
303
|
+
function te(e) {
|
|
304
|
+
const t = M(e);
|
|
305
|
+
return t ? Object.fromEntries(
|
|
306
|
+
O.map((r) => [
|
|
307
|
+
`--color-primary${r}`,
|
|
308
|
+
H(t.r, t.g, t.b, r / 10)
|
|
309
|
+
])
|
|
310
|
+
) : null;
|
|
311
|
+
}
|
|
312
|
+
function re(e) {
|
|
298
313
|
e.style.removeProperty("--el-color-primary"), e.style.removeProperty("--color-on-primary-text");
|
|
299
|
-
for (const t of
|
|
314
|
+
for (const t of Q)
|
|
315
|
+
e.style.removeProperty(t);
|
|
316
|
+
for (const t of X)
|
|
300
317
|
e.style.removeProperty(t);
|
|
301
318
|
}
|
|
302
|
-
function
|
|
303
|
-
const
|
|
304
|
-
if (!
|
|
319
|
+
function ne(e, t, r = "light") {
|
|
320
|
+
const n = M(t.startsWith("#") ? t : `#${t}`);
|
|
321
|
+
if (!n)
|
|
305
322
|
return !1;
|
|
306
|
-
const
|
|
307
|
-
e.style.setProperty("--color-primary",
|
|
308
|
-
const
|
|
309
|
-
|
|
323
|
+
const o = y(n.r, n.g, n.b);
|
|
324
|
+
e.style.setProperty("--color-primary", o), e.style.setProperty("--el-color-primary", o), e.style.setProperty("--color-on-primary-text", j(n));
|
|
325
|
+
const i = te(o);
|
|
326
|
+
i && Object.entries(i).forEach(([s, l]) => e.style.setProperty(s, l));
|
|
327
|
+
const a = ee(o, r);
|
|
328
|
+
return a && Object.entries(a).forEach(([s, l]) => e.style.setProperty(s, l)), !0;
|
|
310
329
|
}
|
|
311
|
-
function
|
|
312
|
-
const t = document.documentElement;
|
|
330
|
+
function oe(e = {}) {
|
|
331
|
+
const t = document.documentElement, r = e.mode ?? (t.classList.contains("dark") ? "dark" : "light");
|
|
313
332
|
if (e.primary != null && e.primary !== "") {
|
|
314
333
|
const n = String(e.primary).trim();
|
|
315
|
-
if (!
|
|
334
|
+
if (!ne(t, n, r)) {
|
|
316
335
|
t.style.setProperty("--color-primary", n), t.style.setProperty("--el-color-primary", n);
|
|
317
|
-
const o =
|
|
318
|
-
o && t.style.setProperty("--color-on-primary-text",
|
|
336
|
+
const o = M(n.startsWith("#") ? n : `#${n}`);
|
|
337
|
+
o && t.style.setProperty("--color-on-primary-text", j(o));
|
|
319
338
|
}
|
|
320
|
-
} else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"),
|
|
321
|
-
const r = e.mode ?? (t.classList.contains("dark") ? "dark" : "light");
|
|
339
|
+
} else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"), re(t));
|
|
322
340
|
t.classList.toggle("dark", r === "dark");
|
|
323
341
|
}
|
|
324
|
-
function
|
|
342
|
+
function we(e) {
|
|
325
343
|
e.primary !== void 0 && (e.primary == null || e.primary === "" ? localStorage.removeItem(L) : localStorage.setItem(L, String(e.primary))), e.mode !== void 0 && localStorage.setItem(I, e.mode);
|
|
326
344
|
}
|
|
327
|
-
function
|
|
345
|
+
function ve() {
|
|
328
346
|
const e = localStorage.getItem(L), r = localStorage.getItem(I) === "dark" ? "dark" : "light";
|
|
329
|
-
|
|
347
|
+
oe({
|
|
330
348
|
primary: e != null && e !== "" ? e : null,
|
|
331
349
|
mode: r
|
|
332
350
|
});
|
|
333
351
|
}
|
|
334
|
-
const
|
|
335
|
-
let
|
|
336
|
-
function
|
|
337
|
-
|
|
352
|
+
const se = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
|
|
353
|
+
let w = null;
|
|
354
|
+
function k(e) {
|
|
355
|
+
N("error", e);
|
|
338
356
|
}
|
|
339
|
-
function
|
|
340
|
-
|
|
357
|
+
function Re(e) {
|
|
358
|
+
w = e && typeof e == "object" ? e : null;
|
|
341
359
|
}
|
|
342
|
-
function
|
|
343
|
-
if (
|
|
344
|
-
return String(
|
|
360
|
+
function S(e) {
|
|
361
|
+
if (w && w[e] != null && w[e] !== "")
|
|
362
|
+
return String(w[e]);
|
|
345
363
|
const t = typeof globalThis < "u" ? globalThis.__MVFRAME_ENV__ : null;
|
|
346
364
|
if (t && t[e] != null && t[e] !== "")
|
|
347
365
|
return String(t[e]);
|
|
348
|
-
const r = typeof import.meta < "u" ?
|
|
366
|
+
const r = typeof import.meta < "u" ? se : null;
|
|
349
367
|
return r && r[e] != null && r[e] !== "" ? String(r[e]) : "";
|
|
350
368
|
}
|
|
351
|
-
const E =
|
|
369
|
+
const E = C.create({
|
|
352
370
|
timeout: 0,
|
|
353
371
|
withCredentials: !1
|
|
354
372
|
});
|
|
355
373
|
let h = [];
|
|
356
|
-
const
|
|
374
|
+
const ie = C.CancelToken, ae = (e) => {
|
|
357
375
|
const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, r = [];
|
|
358
376
|
if (h.length)
|
|
359
377
|
for (let n in h)
|
|
@@ -373,7 +391,7 @@ E.interceptors.request.use(
|
|
|
373
391
|
(e) => {
|
|
374
392
|
e.headers = e.headers || {};
|
|
375
393
|
const { login: t, accountInfo: r = {} } = window.$store.launch(), { access_token: n } = t.info;
|
|
376
|
-
return n && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${n}`), r.partner_org_id && (e.data ? e.method.toLowerCase() === "get" ? e.params.partner_org_id = r.partner_org_id : e.data.partner_org_id = r.partner_org_id : e.method.toLowerCase() === "get" ? e.params = { partner_org_id: r.partner_org_id } : e.data = { partner_org_id: r.partner_org_id }),
|
|
394
|
+
return n && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${n}`), r.partner_org_id && (e.data ? e.method.toLowerCase() === "get" ? e.params.partner_org_id = r.partner_org_id : e.data.partner_org_id = r.partner_org_id : e.method.toLowerCase() === "get" ? e.params = { partner_org_id: r.partner_org_id } : e.data = { partner_org_id: r.partner_org_id }), ae(e), e.cancelToken = new ie((o) => {
|
|
377
395
|
h.push({
|
|
378
396
|
v: e.url + "_" + e.headers["Content-HI"] + "_" + e.ex,
|
|
379
397
|
cb: o
|
|
@@ -393,7 +411,7 @@ E.interceptors.response.use(
|
|
|
393
411
|
else if (r === 500) {
|
|
394
412
|
if (t.showMsg !== !1) {
|
|
395
413
|
const a = (i = t == null ? void 0 : t.headers) != null && i.CONTACT_CUSTOMER_SERVICE ? window.$l("CONTACT_CUSTOMER_SERVICE") : "";
|
|
396
|
-
|
|
414
|
+
k({
|
|
397
415
|
grouping: !0,
|
|
398
416
|
showClose: !0,
|
|
399
417
|
duration: 0,
|
|
@@ -426,7 +444,7 @@ E.interceptors.response.use(
|
|
|
426
444
|
}
|
|
427
445
|
else
|
|
428
446
|
(r = e.stack) != null && r.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
|
|
429
|
-
return t || ((n = e == null ? void 0 : e.response) == null ? void 0 : n.status) !== 403 &&
|
|
447
|
+
return t || ((n = e == null ? void 0 : e.response) == null ? void 0 : n.status) !== 403 && k({
|
|
430
448
|
grouping: !0,
|
|
431
449
|
message: `${e.message} ${(i = (o = e.config) == null ? void 0 : o.headers) == null ? void 0 : i["Content-HI"]}`
|
|
432
450
|
}), _(e.config), e.code === "ERR_CANCELED" ? Promise.resolve({ code: e.code, msg: e.message }) : Promise.resolve({
|
|
@@ -435,17 +453,17 @@ E.interceptors.response.use(
|
|
|
435
453
|
});
|
|
436
454
|
}
|
|
437
455
|
);
|
|
438
|
-
function
|
|
439
|
-
return e.baseURL =
|
|
456
|
+
function le(e) {
|
|
457
|
+
return e.baseURL = S("VITE_APP_BASEURL"), e.method = "get", e.headers = { "Content-Type": "application/x-www-form-urlencoded" }, e.data && (e.params = e.data), E(e);
|
|
440
458
|
}
|
|
441
|
-
function
|
|
442
|
-
return e.baseURL =
|
|
459
|
+
function ce(e) {
|
|
460
|
+
return e.baseURL = S("VITE_APP_BASEURL"), e.method = "get", e.headers = {
|
|
443
461
|
...e.headers,
|
|
444
462
|
"Content-HI": e.url
|
|
445
463
|
}, e.url = e.ver ? `api/${e.ver}/ads` : "api/v3/ads", e.data && (e.params = e.data), E(e);
|
|
446
464
|
}
|
|
447
|
-
function
|
|
448
|
-
if (e.baseURL =
|
|
465
|
+
function ue(e) {
|
|
466
|
+
if (e.baseURL = S("VITE_APP_BASEURL"), e.method = "post", e.headers = {
|
|
449
467
|
...e.headers,
|
|
450
468
|
"Content-HI": e.url
|
|
451
469
|
}, e.data && window.$getType(e.data) === "Object") {
|
|
@@ -457,7 +475,7 @@ function ie(e) {
|
|
|
457
475
|
}
|
|
458
476
|
return e.url = e.ver ? `api/${e.ver}/ads` : "api/v3/ads", E(e);
|
|
459
477
|
}
|
|
460
|
-
function
|
|
478
|
+
function A({
|
|
461
479
|
data: e,
|
|
462
480
|
url: t,
|
|
463
481
|
ex: r,
|
|
@@ -474,43 +492,43 @@ function M({
|
|
|
474
492
|
"Content-Type": "application/json",
|
|
475
493
|
token: l != null ? String(l) : ""
|
|
476
494
|
},
|
|
477
|
-
baseURL:
|
|
495
|
+
baseURL: S("VITE_APP_AIURL"),
|
|
478
496
|
url: t,
|
|
479
497
|
method: n,
|
|
480
498
|
data: i,
|
|
481
499
|
ex: r
|
|
482
500
|
});
|
|
483
501
|
}
|
|
484
|
-
const
|
|
485
|
-
function
|
|
486
|
-
globalThis.$login =
|
|
502
|
+
const Pe = A;
|
|
503
|
+
function $e(e) {
|
|
504
|
+
globalThis.$login = le, globalThis.$get = ce, globalThis.$post = ue, globalThis.$form = A, globalThis.$xform = A;
|
|
487
505
|
}
|
|
488
506
|
export {
|
|
489
|
-
|
|
507
|
+
q as MVFRAME_STORAGE_LANG,
|
|
490
508
|
L as MVFRAME_STORAGE_PRIMARY,
|
|
491
509
|
I as MVFRAME_STORAGE_THEME,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
510
|
+
oe as applyMvframeTheme,
|
|
511
|
+
F as deepEqual,
|
|
512
|
+
Ee as download,
|
|
513
|
+
K as formatSummaryCell,
|
|
514
|
+
Le as getMaps,
|
|
515
|
+
$e as installRq,
|
|
516
|
+
_e as isInView,
|
|
517
|
+
ve as loadMvframeTheme,
|
|
518
|
+
Ae as mapLang,
|
|
519
|
+
xe as mapLangPath,
|
|
520
|
+
ke as mergeMaps,
|
|
521
|
+
Ce as patchMaps,
|
|
522
|
+
we as persistMvframeTheme,
|
|
523
|
+
Y as sanitizeDownloadFileName,
|
|
524
|
+
Re as setMvframeRqEnv,
|
|
525
|
+
A as useForm,
|
|
526
|
+
ce as useGet,
|
|
527
|
+
be as useLang,
|
|
528
|
+
le as useLogin,
|
|
529
|
+
Ie as useMap,
|
|
530
|
+
ye as useOptions,
|
|
531
|
+
ue as usePost,
|
|
532
|
+
Te as useRemoteSummary,
|
|
533
|
+
Pe as useXform
|
|
516
534
|
};
|