@vtj/renderer 0.16.11 → 0.16.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/index.cjs +7 -7
- package/dist/index.mjs +224 -224
- package/package.json +5 -5
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Base as Ke, BUILT_IN_COMPONENTS as ze, ProjectModel as U, HistoryModel as $e } from "@vtj/core";
|
|
2
|
-
import { url as k, isUrl as se, dedupArray as Ge, isFunction as q, isString as I, logger as O, storage as X, cookie as Y, toArray as ge, unRSA as ve, delay as J, createRequest as
|
|
2
|
+
import { url as k, isUrl as se, dedupArray as Ge, isFunction as q, isString as I, logger as O, storage as X, cookie as Y, toArray as ge, unRSA as ve, delay as J, createRequest as Ee, jsonp as be, merge as Ve, pathToRegexp as We, pathToRegexpMatch as Qe, formDataToJson as Xe, Queue as Ye, cloneDeep as ye, camelCase as C, upperFirst as Ze, pick as et, request as ne, loadScript as _e, debounce as tt, Storage as st, mapToObject as ue } from "@vtj/utils";
|
|
3
3
|
import * as z from "vue";
|
|
4
4
|
import { inject as je, defineComponent as Re, h as re, ref as oe, watchEffect as nt, defineAsyncComponent as we } from "vue";
|
|
5
5
|
import { useRoute as Pe } from "vue-router";
|
|
@@ -7,10 +7,10 @@ import { useRoute as Pe } from "vue-router";
|
|
|
7
7
|
* Copyright (c) 2026, VTJ.PRO All rights reserved.
|
|
8
8
|
* @name @vtj/renderer
|
|
9
9
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
10
|
-
* @version 0.16.
|
|
10
|
+
* @version 0.16.13
|
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
12
12
|
*/
|
|
13
|
-
const T = "0.16.
|
|
13
|
+
const T = "0.16.13";
|
|
14
14
|
var w = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(w || {});
|
|
15
15
|
const Se = [
|
|
16
16
|
"$el",
|
|
@@ -149,12 +149,12 @@ function V(n) {
|
|
|
149
149
|
function at(n) {
|
|
150
150
|
return /\.json$/.test(n);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Es(n) {
|
|
153
153
|
return n.map(
|
|
154
154
|
(e) => `<script src="${k.append(e, { v: T })}"><\/script>`
|
|
155
155
|
).join("");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function bs(n = []) {
|
|
158
158
|
return n.map(
|
|
159
159
|
(e) => `<link rel="stylesheet" href="${k.append(e, { v: T })}" />`
|
|
160
160
|
).join("");
|
|
@@ -163,21 +163,21 @@ function ct(n, e = !1) {
|
|
|
163
163
|
return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
|
|
164
164
|
}
|
|
165
165
|
function lt(n, e, t = !1) {
|
|
166
|
-
const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [],
|
|
166
|
+
const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], f = {}, c = {}, l = [], u = {};
|
|
167
167
|
return s.forEach(
|
|
168
|
-
({ urls: p, assetsUrl:
|
|
168
|
+
({ urls: p, assetsUrl: d, library: h, assetsLibrary: m, localeLibrary: g }) => {
|
|
169
169
|
p?.forEach((v) => {
|
|
170
170
|
V(v) && r.push(ct(v, t)), G(v) && o.push(v);
|
|
171
|
-
}),
|
|
171
|
+
}), h && (i.push(h), f[h] = B(p || [], e), g && (c[h] = g)), d && a.push(d), m && l.push(m), h && m && (u[m] = h);
|
|
172
172
|
}
|
|
173
173
|
), {
|
|
174
174
|
scripts: B(r, e),
|
|
175
175
|
css: B(o, e),
|
|
176
176
|
materials: B(a, e),
|
|
177
177
|
libraryExports: i,
|
|
178
|
-
materialExports: Ge(
|
|
178
|
+
materialExports: Ge(l),
|
|
179
179
|
materialMapLibrary: u,
|
|
180
|
-
libraryMap:
|
|
180
|
+
libraryMap: f,
|
|
181
181
|
libraryLocaleMap: c
|
|
182
182
|
};
|
|
183
183
|
}
|
|
@@ -194,7 +194,7 @@ function ft(n = []) {
|
|
|
194
194
|
}
|
|
195
195
|
function pt(n, e) {
|
|
196
196
|
const t = (c) => {
|
|
197
|
-
const
|
|
197
|
+
const l = [];
|
|
198
198
|
let u = 0;
|
|
199
199
|
for (; u < c.length; ) {
|
|
200
200
|
if (/\s/.test(c[u])) {
|
|
@@ -214,7 +214,7 @@ function pt(n, e) {
|
|
|
214
214
|
u++;
|
|
215
215
|
const _ = c.substring(v, u).trim(), y = _.includes("@keyframes");
|
|
216
216
|
if (c[u] === ";")
|
|
217
|
-
|
|
217
|
+
l.push({
|
|
218
218
|
type: "simple-at-rule",
|
|
219
219
|
content: c.substring(v, u + 1)
|
|
220
220
|
}), u++;
|
|
@@ -224,7 +224,7 @@ function pt(n, e) {
|
|
|
224
224
|
for (u++; u < c.length && A > 0; )
|
|
225
225
|
c[u] === "{" ? A++ : c[u] === "}" && A--, u++;
|
|
226
226
|
const W = c.substring(v, u), P = c.substring(S, u - 1);
|
|
227
|
-
|
|
227
|
+
l.push({
|
|
228
228
|
type: y ? "keyframes" : "at-rule",
|
|
229
229
|
rule: _,
|
|
230
230
|
content: W,
|
|
@@ -237,72 +237,72 @@ function pt(n, e) {
|
|
|
237
237
|
for (; u < c.length && c[u] !== "{"; )
|
|
238
238
|
u++;
|
|
239
239
|
if (u >= c.length) break;
|
|
240
|
-
const
|
|
241
|
-
if (!
|
|
240
|
+
const d = c.substring(p, u).trim();
|
|
241
|
+
if (!d) {
|
|
242
242
|
u++;
|
|
243
243
|
continue;
|
|
244
244
|
}
|
|
245
|
-
const
|
|
245
|
+
const h = u + 1;
|
|
246
246
|
let m = 1;
|
|
247
247
|
for (u++; u < c.length && m > 0; )
|
|
248
248
|
c[u] === "{" ? m++ : c[u] === "}" && m--, u++;
|
|
249
|
-
const g = c.substring(
|
|
250
|
-
|
|
249
|
+
const g = c.substring(h, u - 1);
|
|
250
|
+
l.push({
|
|
251
251
|
type: "rule",
|
|
252
|
-
selector:
|
|
252
|
+
selector: d,
|
|
253
253
|
content: g.trim()
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
return
|
|
256
|
+
return l;
|
|
257
257
|
}, s = (c) => {
|
|
258
|
-
const
|
|
259
|
-
return /^(from|to|\d+(\.\d+)?%)$/.test(
|
|
260
|
-
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (
|
|
261
|
-
const
|
|
262
|
-
return
|
|
258
|
+
const l = c.trim();
|
|
259
|
+
return /^(from|to|\d+(\.\d+)?%)$/.test(l);
|
|
260
|
+
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (l, u, p) => {
|
|
261
|
+
const d = u.trim(), h = p.trim();
|
|
262
|
+
return d ? `${d}[${e}] ${h}` : h;
|
|
263
263
|
}), o = (c) => {
|
|
264
|
-
const
|
|
265
|
-
if (!
|
|
266
|
-
return
|
|
267
|
-
const u =
|
|
264
|
+
const l = c.trim();
|
|
265
|
+
if (!l || l.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l) || s(l))
|
|
266
|
+
return l;
|
|
267
|
+
const u = l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
|
|
268
268
|
if (u) {
|
|
269
|
-
const [, p,
|
|
270
|
-
return
|
|
269
|
+
const [, p, d = ""] = u, h = p.trim();
|
|
270
|
+
return h ? `${h}[${e}]${d}` : l;
|
|
271
271
|
}
|
|
272
|
-
return `${
|
|
273
|
-
}, a = (c) => r(c).split(",").map((u) => o(u)).filter((u) => u.trim()).join(", "), i = (c) => c.map((
|
|
274
|
-
switch (
|
|
272
|
+
return `${l}[${e}]`;
|
|
273
|
+
}, a = (c) => r(c).split(",").map((u) => o(u)).filter((u) => u.trim()).join(", "), i = (c) => c.map((l) => {
|
|
274
|
+
switch (l.type) {
|
|
275
275
|
case "simple-at-rule":
|
|
276
|
-
return
|
|
276
|
+
return l.content;
|
|
277
277
|
case "keyframes":
|
|
278
|
-
return
|
|
278
|
+
return l.content;
|
|
279
279
|
case "at-rule":
|
|
280
280
|
try {
|
|
281
|
-
const p = t(
|
|
282
|
-
return `${
|
|
281
|
+
const p = t(l.inner), d = i(p);
|
|
282
|
+
return `${l.rule} { ${d} }`;
|
|
283
283
|
} catch {
|
|
284
|
-
return
|
|
284
|
+
return l.content;
|
|
285
285
|
}
|
|
286
286
|
case "rule":
|
|
287
|
-
if (!
|
|
287
|
+
if (!l.selector || !l.content)
|
|
288
288
|
return "";
|
|
289
|
-
const u = a(
|
|
290
|
-
return u.trim() ? `${u} { ${
|
|
289
|
+
const u = a(l.selector);
|
|
290
|
+
return u.trim() ? `${u} { ${l.content} }` : "";
|
|
291
291
|
default:
|
|
292
292
|
return "";
|
|
293
293
|
}
|
|
294
|
-
}).filter((
|
|
294
|
+
}).filter((l) => l.trim()).join(" "), f = (c) => c.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim();
|
|
295
295
|
try {
|
|
296
296
|
const c = n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
|
|
297
|
-
`),
|
|
298
|
-
return
|
|
297
|
+
`), l = t(c), u = i(l);
|
|
298
|
+
return f(u);
|
|
299
299
|
} catch (c) {
|
|
300
300
|
return console.error("CSS scoping failed:", c), console.error("Input CSS:", n), n.replace(/\/\*[\s\S]*?\*\//g, "").replace(
|
|
301
301
|
/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,
|
|
302
|
-
(
|
|
303
|
-
).replace(/([^{}@]+)(?=\s*{)/g, (
|
|
304
|
-
const u =
|
|
305
|
-
return !u || u.startsWith("@") || u.includes(`[${e}]`) || s(u) ?
|
|
302
|
+
(l) => l
|
|
303
|
+
).replace(/([^{}@]+)(?=\s*{)/g, (l) => {
|
|
304
|
+
const u = l.trim();
|
|
305
|
+
return !u || u.startsWith("@") || u.includes(`[${e}]`) || s(u) ? l : `${u}[${e}]`;
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
}
|
|
@@ -318,10 +318,10 @@ function mt(n, e) {
|
|
|
318
318
|
for (let a = 0; a < e.length; a++) {
|
|
319
319
|
const i = e[a];
|
|
320
320
|
if (i === "'" && !s && !r ? t = !t : i === '"' && !t && !r ? s = !s : e.substr(a, 4).toLowerCase() === "url(" && !t && !s ? r = !0 : i === ")" && r && (r = !1), !t && !s && !r) {
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
const c =
|
|
324
|
-
o += p, a +=
|
|
321
|
+
const f = e.substr(a).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);
|
|
322
|
+
if (f) {
|
|
323
|
+
const c = f[1], l = parseFloat(c), p = `${ht(n, l).toFixed(6).replace(/\.?0+$/, "")}px`;
|
|
324
|
+
o += p, a += f[0].length - 1;
|
|
325
325
|
continue;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
@@ -333,18 +333,18 @@ function Ae(n) {
|
|
|
333
333
|
return I(n) ? n : JSON.stringify(n);
|
|
334
334
|
}
|
|
335
335
|
function fe(n, e, t, s = !1) {
|
|
336
|
-
const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, a = n.__uniConfig ? mt(n, t) : t, i = s ? pt(a, o) : a;
|
|
337
|
-
if (r.prototype.replaceSync) {
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
(
|
|
336
|
+
const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, a = n.__uniConfig ? mt(n, t) : t, i = s ? pt(a, o) : a, f = !!n.__uniConfig;
|
|
337
|
+
if (r.prototype.replaceSync && !f) {
|
|
338
|
+
const c = new r();
|
|
339
|
+
c.id = e, c.replaceSync(i);
|
|
340
|
+
const l = n.document, u = l.adoptedStyleSheets, p = Array.from(u).filter(
|
|
341
|
+
(d) => d.id !== e
|
|
342
342
|
);
|
|
343
|
-
|
|
343
|
+
l.adoptedStyleSheets = [...p, c];
|
|
344
344
|
} else {
|
|
345
|
-
const
|
|
346
|
-
let
|
|
347
|
-
|
|
345
|
+
const c = n.document;
|
|
346
|
+
let l = c.getElementById(e);
|
|
347
|
+
l ? l.innerHTML = i : (l = c.createElement("style"), l.id = e, l.innerHTML = i, c.head.appendChild(l));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
function js(n) {
|
|
@@ -379,12 +379,12 @@ async function Fe(n, e, t = window) {
|
|
|
379
379
|
const s = t.document, r = t.document.head;
|
|
380
380
|
let o = t[e];
|
|
381
381
|
return o ? o.default || o : new Promise((a, i) => {
|
|
382
|
-
for (const
|
|
382
|
+
for (const f of n) {
|
|
383
383
|
const c = s.createElement("script");
|
|
384
|
-
c.src =
|
|
384
|
+
c.src = f, c.onload = () => {
|
|
385
385
|
o = t[e], o ? a(o.default || o) : i(null);
|
|
386
|
-
}, c.onerror = (
|
|
387
|
-
i(
|
|
386
|
+
}, c.onerror = (l) => {
|
|
387
|
+
i(l);
|
|
388
388
|
}, r.appendChild(c);
|
|
389
389
|
}
|
|
390
390
|
});
|
|
@@ -415,7 +415,7 @@ function H(n, e, t = !1, s = !1, r = !1) {
|
|
|
415
415
|
const o = ['"use strict";', "var __self = arguments[0];"];
|
|
416
416
|
o.push("return ");
|
|
417
417
|
let a = (n.value || "").trim();
|
|
418
|
-
r || (a = a.replace(/this(\W|$)/g, (
|
|
418
|
+
r || (a = a.replace(/this(\W|$)/g, (f, c) => `__self${c}`)), a = o.join(`
|
|
419
419
|
`) + a;
|
|
420
420
|
const i = r ? `
|
|
421
421
|
${a}
|
|
@@ -437,14 +437,14 @@ function R(n, e, t = !1, s = !1, r = !1) {
|
|
|
437
437
|
throw new Error(`"${n.value}" not a function`);
|
|
438
438
|
return o;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function b(n) {
|
|
441
441
|
return n && n.type === "JSExpression";
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function E(n) {
|
|
444
444
|
return typeof n == "object" && n && n.type === "JSFunction";
|
|
445
445
|
}
|
|
446
446
|
function wt(n) {
|
|
447
|
-
return
|
|
447
|
+
return b(n) || E(n);
|
|
448
448
|
}
|
|
449
449
|
function Ps(n) {
|
|
450
450
|
return wt(n) ? n.value : JSON.stringify(n);
|
|
@@ -632,29 +632,29 @@ function Cs(n = {}) {
|
|
|
632
632
|
useTitle: a,
|
|
633
633
|
alert: i
|
|
634
634
|
} = n;
|
|
635
|
-
let
|
|
635
|
+
let f = null;
|
|
636
636
|
return {
|
|
637
|
-
request:
|
|
637
|
+
request: Ee({
|
|
638
638
|
settings: {
|
|
639
639
|
type: "form",
|
|
640
640
|
validSuccess: !0,
|
|
641
641
|
originResponse: !1,
|
|
642
642
|
loading: !0,
|
|
643
|
-
validate: (
|
|
643
|
+
validate: (l) => l.data?.code === 0 || !!l.data?.success,
|
|
644
644
|
failMessage: !0,
|
|
645
|
-
showError: (
|
|
646
|
-
e && e(
|
|
645
|
+
showError: (l) => {
|
|
646
|
+
e && e(l || "未知错误");
|
|
647
647
|
},
|
|
648
648
|
showLoading: () => {
|
|
649
|
-
|
|
649
|
+
f && f.close(), t && (f = t());
|
|
650
650
|
},
|
|
651
651
|
hideLoading: () => {
|
|
652
|
-
|
|
652
|
+
f && (f.close(), f = null);
|
|
653
653
|
},
|
|
654
654
|
...s
|
|
655
655
|
}
|
|
656
656
|
}),
|
|
657
|
-
jsonp:
|
|
657
|
+
jsonp: be,
|
|
658
658
|
notify: e,
|
|
659
659
|
loading: t,
|
|
660
660
|
useTitle: a,
|
|
@@ -666,7 +666,7 @@ function Cs(n = {}) {
|
|
|
666
666
|
function As(n = {}) {
|
|
667
667
|
return new pe(n);
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Et(n, e) {
|
|
670
670
|
const { jsonp: t, request: s } = e;
|
|
671
671
|
if (n.method === "jsonp")
|
|
672
672
|
return (r = {}) => t(n.url, {
|
|
@@ -685,7 +685,7 @@ function bt(n, e) {
|
|
|
685
685
|
return (a, i) => (delete o.data, s.send(Ve(o, i || {}, { data: a })));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function bt(n, e) {
|
|
689
689
|
const { metaQuery: t } = e;
|
|
690
690
|
if (!t) return;
|
|
691
691
|
const { code: s, queryCode: r } = n;
|
|
@@ -700,11 +700,11 @@ function Et(n, e) {
|
|
|
700
700
|
function jt(n = [], e = [], t) {
|
|
701
701
|
const s = {};
|
|
702
702
|
for (const r of n) {
|
|
703
|
-
const o =
|
|
703
|
+
const o = Et(r, t);
|
|
704
704
|
s[r.id] = o, s[r.name] = o;
|
|
705
705
|
}
|
|
706
706
|
for (const r of e)
|
|
707
|
-
s[r.id] =
|
|
707
|
+
s[r.id] = bt(r, t);
|
|
708
708
|
return s;
|
|
709
709
|
}
|
|
710
710
|
async function Rt(n = [], e = window) {
|
|
@@ -712,7 +712,7 @@ async function Rt(n = [], e = window) {
|
|
|
712
712
|
t && (Oe(e), n.forEach((s) => Ct(t, s)));
|
|
713
713
|
}
|
|
714
714
|
function Pt(n, e = window) {
|
|
715
|
-
const t =
|
|
715
|
+
const t = E(n.mockTemplate) && n.mockTemplate.value ? R(n.mockTemplate, {}, !0) : void 0, s = D(e);
|
|
716
716
|
return async (...r) => {
|
|
717
717
|
let o = {};
|
|
718
718
|
if (t)
|
|
@@ -730,13 +730,13 @@ function Ct(n, e) {
|
|
|
730
730
|
if (t && s)
|
|
731
731
|
try {
|
|
732
732
|
const r = se(t) ? new URL(t).pathname : t, o = We(`(.*)${r}(.*)`), a = Qe(r, { decode: decodeURIComponent }), i = H(s, {}, !0);
|
|
733
|
-
n.mock(o, (
|
|
734
|
-
const c = k.parse(
|
|
735
|
-
Object.assign(
|
|
733
|
+
n.mock(o, (f) => {
|
|
734
|
+
const c = k.parse(f.url) || {}, l = f.body instanceof FormData ? Xe(f.body) : f.body, u = se(f.url) ? new URL(f.url).pathname : f.url.split("?")[0], p = a(u)?.params;
|
|
735
|
+
Object.assign(f, { data: l, params: p, query: c });
|
|
736
736
|
try {
|
|
737
|
-
return n.mock(i(
|
|
738
|
-
} catch (
|
|
739
|
-
return console.warn("[mockApi]", o,
|
|
737
|
+
return n.mock(i(f));
|
|
738
|
+
} catch (d) {
|
|
739
|
+
return console.warn("[mockApi]", o, f, d), null;
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
} catch (r) {
|
|
@@ -855,15 +855,15 @@ function ie(n) {
|
|
|
855
855
|
libs: r = {},
|
|
856
856
|
apis: o = {},
|
|
857
857
|
loader: a
|
|
858
|
-
} = n, i = e.computed(() => n.dsl),
|
|
858
|
+
} = n, i = e.computed(() => n.dsl), f = {
|
|
859
859
|
$components: s,
|
|
860
860
|
$libs: r,
|
|
861
861
|
$apis: o
|
|
862
862
|
}, c = new At({
|
|
863
863
|
mode: t,
|
|
864
864
|
dsl: i.value,
|
|
865
|
-
attrs:
|
|
866
|
-
}),
|
|
865
|
+
attrs: f
|
|
866
|
+
}), l = e.defineComponent({
|
|
867
867
|
name: i.value.name,
|
|
868
868
|
__scopeId: i.value.id ? `data-v-${i.value.id}` : void 0,
|
|
869
869
|
props: {
|
|
@@ -876,23 +876,23 @@ function ie(n) {
|
|
|
876
876
|
i.value.css || "",
|
|
877
877
|
!0
|
|
878
878
|
), c.state = kt(e, i.value.state ?? {}, c);
|
|
879
|
-
const p = Ot(e, i.value.computed ?? {}, c),
|
|
880
|
-
for (const [v, _] of Object.entries(
|
|
881
|
-
|
|
879
|
+
const p = Ot(e, i.value.computed ?? {}, c), d = Mt(i.value.methods ?? {}, c), h = Tt(e, i.value.inject, c);
|
|
880
|
+
for (const [v, _] of Object.entries(h || {}))
|
|
881
|
+
h[v] = e.inject(v, _);
|
|
882
882
|
const m = xt(
|
|
883
883
|
i.value.dataSources || {},
|
|
884
884
|
c
|
|
885
885
|
), g = {
|
|
886
|
-
...d,
|
|
887
|
-
...p,
|
|
888
886
|
...h,
|
|
887
|
+
...p,
|
|
888
|
+
...d,
|
|
889
889
|
...m
|
|
890
890
|
};
|
|
891
891
|
return c.setup(g, e), Dt(e, i.value.watch ?? [], c), {
|
|
892
892
|
vtj: c,
|
|
893
893
|
state: c.state,
|
|
894
894
|
...p,
|
|
895
|
-
...
|
|
895
|
+
...d
|
|
896
896
|
};
|
|
897
897
|
},
|
|
898
898
|
emits: It(i.value.emits),
|
|
@@ -907,7 +907,7 @@ function ie(n) {
|
|
|
907
907
|
...Ht(i.value.lifeCycles ?? {}, c)
|
|
908
908
|
});
|
|
909
909
|
return {
|
|
910
|
-
renderer: e.markRaw(
|
|
910
|
+
renderer: e.markRaw(l),
|
|
911
911
|
context: c
|
|
912
912
|
};
|
|
913
913
|
}
|
|
@@ -922,7 +922,7 @@ function Ft(n = [], e) {
|
|
|
922
922
|
name: s.name,
|
|
923
923
|
type: s.type,
|
|
924
924
|
required: s.required,
|
|
925
|
-
default:
|
|
925
|
+
default: b(s.default) ? e.__parseExpression(s.default) : s.default
|
|
926
926
|
}).reduce(
|
|
927
927
|
(s, r) => (s[r.name] = {
|
|
928
928
|
type: t(r.type),
|
|
@@ -937,7 +937,7 @@ function kt(n, e, t) {
|
|
|
937
937
|
Object.keys(e || {}).reduce(
|
|
938
938
|
(s, r) => {
|
|
939
939
|
let o = e[r];
|
|
940
|
-
return
|
|
940
|
+
return b(o) ? o = t.__parseExpression(o) : E(o) && (o = t.__parseFunction(o)), s[r] = o, s;
|
|
941
941
|
},
|
|
942
942
|
{}
|
|
943
943
|
)
|
|
@@ -960,8 +960,8 @@ function Tt(n, e = [], t) {
|
|
|
960
960
|
(s, r) => {
|
|
961
961
|
const { name: o, from: a } = r || {};
|
|
962
962
|
r.default;
|
|
963
|
-
const i =
|
|
964
|
-
return s[o] = n.inject(i,
|
|
963
|
+
const i = b(a) ? t.__parseExpression(a) || o : a ?? o, f = b(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
|
|
964
|
+
return s[o] = n.inject(i, f), s;
|
|
965
965
|
},
|
|
966
966
|
{}
|
|
967
967
|
);
|
|
@@ -973,10 +973,10 @@ function xt(n, e) {
|
|
|
973
973
|
if (r.type === "mock")
|
|
974
974
|
t[s] = Pt(r);
|
|
975
975
|
else if (r.ref) {
|
|
976
|
-
const o = e.$apis[r.ref], a =
|
|
976
|
+
const o = e.$apis[r.ref], a = E(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
|
977
977
|
t[s] = async (...i) => {
|
|
978
|
-
const
|
|
979
|
-
return a ? a(
|
|
978
|
+
const f = await o.apply(e, i);
|
|
979
|
+
return a ? a(f) : f;
|
|
980
980
|
};
|
|
981
981
|
}
|
|
982
982
|
return t;
|
|
@@ -1053,8 +1053,8 @@ function ae(n) {
|
|
|
1053
1053
|
let i = o.library ? F[o.library] : null;
|
|
1054
1054
|
return i || (o.library && Z.push(o.library), i = F[o.library || Symbol()] = a.defineAsyncComponent(
|
|
1055
1055
|
async () => {
|
|
1056
|
-
const
|
|
1057
|
-
return
|
|
1056
|
+
const f = await Te(o, s.window);
|
|
1057
|
+
return f || (console.warn("getPlugin result is null", o), null);
|
|
1058
1058
|
}
|
|
1059
1059
|
), i);
|
|
1060
1060
|
}
|
|
@@ -1066,8 +1066,8 @@ function Is() {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
function M(n, e, t = z, s = Bt, r = [], o = !1) {
|
|
1068
1068
|
if (!n || !n.name || n.invisible) return null;
|
|
1069
|
-
const a = t.getCurrentInstance()?.appContext, { id: i = null, directives:
|
|
1070
|
-
if (!o && (
|
|
1069
|
+
const a = t.getCurrentInstance()?.appContext, { id: i = null, directives: f = [] } = n, { vIf: c, vElseIf: l, vElse: u, vFor: p, vShow: d, vModels: h, vBind: m, vHtml: g, others: v } = xe(f);
|
|
1070
|
+
if (!o && (l || u))
|
|
1071
1071
|
return null;
|
|
1072
1072
|
if (c && !Nt(c, e))
|
|
1073
1073
|
return zt(n, e, t, s, r);
|
|
@@ -1081,10 +1081,10 @@ function M(n, e, t = z, s = Bt, r = [], o = !1) {
|
|
|
1081
1081
|
})(), P = qt(i, n.props ?? {}, y), Ue = Kt(t, n.events ?? {}, y);
|
|
1082
1082
|
if (n.name === "slot")
|
|
1083
1083
|
return Gt(t, n, P, y, s);
|
|
1084
|
-
m && Object.assign(P, y.__parseExpression(m.value)),
|
|
1084
|
+
m && Object.assign(P, y.__parseExpression(m.value)), d && (P.style = Object.assign(
|
|
1085
1085
|
P.style ?? {},
|
|
1086
|
-
Wt(
|
|
1087
|
-
)), g && Object.assign(P, Qt(g, y)),
|
|
1086
|
+
Wt(d, y)
|
|
1087
|
+
)), g && Object.assign(P, Qt(g, y)), h.forEach((j) => {
|
|
1088
1088
|
Ce.includes(n.name) ? Object.assign(P, Xt(j, y)) : Object.assign(P, Yt(t, j, y));
|
|
1089
1089
|
});
|
|
1090
1090
|
const qe = Zt(
|
|
@@ -1114,12 +1114,12 @@ function Lt(n, e, t) {
|
|
|
1114
1114
|
}).filter((r) => !!r);
|
|
1115
1115
|
}
|
|
1116
1116
|
function xe(n = []) {
|
|
1117
|
-
const e = n.find((
|
|
1118
|
-
(
|
|
1119
|
-
), s = n.find((
|
|
1120
|
-
(
|
|
1117
|
+
const e = n.find((l) => C(l.name) === "vIf"), t = n.find(
|
|
1118
|
+
(l) => C(l.name) === "vElseIf"
|
|
1119
|
+
), s = n.find((l) => C(l.name) === "vElse"), r = n.find((l) => C(l.name) === "vFor"), o = n.find((l) => C(l.name) === "vShow"), a = n.find((l) => C(l.name) === "vBind"), i = n.find((l) => C(l.name) === "vHtml"), f = n.filter(
|
|
1120
|
+
(l) => C(l.name) === "vModel"
|
|
1121
1121
|
), c = n.filter(
|
|
1122
|
-
(
|
|
1122
|
+
(l) => !rt.includes(C(l.name))
|
|
1123
1123
|
);
|
|
1124
1124
|
return {
|
|
1125
1125
|
vIf: e,
|
|
@@ -1127,7 +1127,7 @@ function xe(n = []) {
|
|
|
1127
1127
|
vElse: s,
|
|
1128
1128
|
vFor: r,
|
|
1129
1129
|
vShow: o,
|
|
1130
|
-
vModels:
|
|
1130
|
+
vModels: f,
|
|
1131
1131
|
vBind: a,
|
|
1132
1132
|
others: c,
|
|
1133
1133
|
vHtml: i
|
|
@@ -1137,14 +1137,14 @@ function Nt(n, e) {
|
|
|
1137
1137
|
return !!e.__parseExpression(n.value);
|
|
1138
1138
|
}
|
|
1139
1139
|
function Ut(n, e) {
|
|
1140
|
-
return e ?
|
|
1140
|
+
return e ? b(e) ? n.__parseExpression(e) : e : "div";
|
|
1141
1141
|
}
|
|
1142
1142
|
function qt(n, e, t) {
|
|
1143
1143
|
const s = ce(e, t);
|
|
1144
1144
|
return s.ref = t.__ref(n, s.ref), s;
|
|
1145
1145
|
}
|
|
1146
1146
|
function ce(n, e) {
|
|
1147
|
-
return
|
|
1147
|
+
return b(n) ? e.__parseExpression(n) : E(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ce(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
|
|
1148
1148
|
(t, s) => {
|
|
1149
1149
|
let r = n[s];
|
|
1150
1150
|
return t[s] = ce(r, e), t;
|
|
@@ -1165,10 +1165,10 @@ function Kt(n, e, t) {
|
|
|
1165
1165
|
};
|
|
1166
1166
|
return Object.keys(e || {}).reduce(
|
|
1167
1167
|
(o, a) => {
|
|
1168
|
-
const i = e[a],
|
|
1169
|
-
return u && (o[
|
|
1170
|
-
|
|
1171
|
-
|
|
1168
|
+
const i = e[a], f = De(i.modifiers), c = f.find((p) => s.includes(p)), l = "on" + Ze(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
|
|
1169
|
+
return u && (o[l] = n.withModifiers(
|
|
1170
|
+
f.includes("enter") ? Jt(u, "enter") : u,
|
|
1171
|
+
f
|
|
1172
1172
|
)), o;
|
|
1173
1173
|
},
|
|
1174
1174
|
{}
|
|
@@ -1177,9 +1177,9 @@ function Kt(n, e, t) {
|
|
|
1177
1177
|
function zt(n, e, t, s, r = []) {
|
|
1178
1178
|
let o = r.findIndex((a) => a.id === n.id);
|
|
1179
1179
|
for (let a = ++o; a < r.length; a++) {
|
|
1180
|
-
const { directives: i = [] } = r[a], { vElseIf:
|
|
1181
|
-
if (
|
|
1182
|
-
if (e.__parseExpression(
|
|
1180
|
+
const { directives: i = [] } = r[a], { vElseIf: f, vElse: c } = xe(i);
|
|
1181
|
+
if (f) {
|
|
1182
|
+
if (e.__parseExpression(f.value))
|
|
1183
1183
|
return M(r[a], e, t, s, r, !0);
|
|
1184
1184
|
continue;
|
|
1185
1185
|
}
|
|
@@ -1194,16 +1194,16 @@ function De(n = {}, e = !1) {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
function Gt(n, e, t, s, r) {
|
|
1196
1196
|
const { children: o } = e, a = Vt(e, s), i = s.$slots?.[a.name];
|
|
1197
|
-
return i ? i(t) : o ? I(o) ? n.createTextVNode(o) :
|
|
1197
|
+
return i ? i(t) : o ? I(o) ? n.createTextVNode(o) : b(o) ? n.createTextVNode(
|
|
1198
1198
|
Ae(s.__parseExpression(o))
|
|
1199
1199
|
) : Array.isArray(o) ? o.map(
|
|
1200
|
-
(
|
|
1200
|
+
(f) => M(f, s, n, r, o)
|
|
1201
1201
|
) : null : null;
|
|
1202
1202
|
}
|
|
1203
1203
|
function Vt(n, e) {
|
|
1204
1204
|
const { props: t } = n, s = t?.name || "default";
|
|
1205
1205
|
return {
|
|
1206
|
-
name:
|
|
1206
|
+
name: b(s) ? e.__parseExpression(s) : s,
|
|
1207
1207
|
params: []
|
|
1208
1208
|
};
|
|
1209
1209
|
}
|
|
@@ -1225,7 +1225,7 @@ function Xt(n, e) {
|
|
|
1225
1225
|
}` : "(v) => {}"
|
|
1226
1226
|
};
|
|
1227
1227
|
return {
|
|
1228
|
-
[
|
|
1228
|
+
[b(n.arg) ? e.__parseExpression(n.arg) : n.arg || "value"]: e.__parseExpression(n.value),
|
|
1229
1229
|
onInput: e.__parseFunction(t)
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
@@ -1236,8 +1236,8 @@ function Yt(n, e, t) {
|
|
|
1236
1236
|
${e.value.value} = v;
|
|
1237
1237
|
}` : "(v) => {}"
|
|
1238
1238
|
}, r = t.__parseFunction(s), o = De(
|
|
1239
|
-
|
|
1240
|
-
), a =
|
|
1239
|
+
b(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
|
1240
|
+
), a = b(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
1241
1241
|
return {
|
|
1242
1242
|
[a]: t.__parseExpression(e.value),
|
|
1243
1243
|
[`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
|
|
@@ -1247,21 +1247,21 @@ function Zt(n, e, t, s, r) {
|
|
|
1247
1247
|
if (!e) return null;
|
|
1248
1248
|
if (I(e))
|
|
1249
1249
|
return { default: () => e };
|
|
1250
|
-
if (
|
|
1250
|
+
if (b(e))
|
|
1251
1251
|
return {
|
|
1252
1252
|
default: () => Ae(t.__parseExpression(e))
|
|
1253
1253
|
};
|
|
1254
1254
|
if (Array.isArray(e) && e.length > 0) {
|
|
1255
|
-
const o = es(e), a = (i,
|
|
1256
|
-
[
|
|
1255
|
+
const o = es(e), a = (i, f) => !i || !r ? {} : r?.id && Object.keys(i).length ? f ? {
|
|
1256
|
+
[f]: i
|
|
1257
1257
|
} : {
|
|
1258
1258
|
[`scope_${r.id}`]: i
|
|
1259
|
-
} :
|
|
1259
|
+
} : f ? { [f]: /* @__PURE__ */ Object.create(null) } : {};
|
|
1260
1260
|
return Object.entries(o).reduce(
|
|
1261
|
-
(i, [
|
|
1262
|
-
const
|
|
1261
|
+
(i, [f, { nodes: c, params: l, scope: u }]) => (i[f] = (p) => {
|
|
1262
|
+
const d = l.length ? et(p ?? {}, l) : a(p, u);
|
|
1263
1263
|
return c.map(
|
|
1264
|
-
(
|
|
1264
|
+
(h) => M(h, t.__clone(d), n, s, c)
|
|
1265
1265
|
);
|
|
1266
1266
|
}, i),
|
|
1267
1267
|
{}
|
|
@@ -1287,7 +1287,7 @@ function ts(n = "default") {
|
|
|
1287
1287
|
function ss(n, e, t) {
|
|
1288
1288
|
const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
|
|
1289
1289
|
let i = t.__parseExpression(s) || [];
|
|
1290
|
-
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((
|
|
1290
|
+
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((f, c) => c + 1)), Array.isArray(i) ? i.map((f, c) => e(t.__clone({ [o]: f, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
|
1291
1291
|
}
|
|
1292
1292
|
const ee = Re({
|
|
1293
1293
|
name: "VtjPageContainer",
|
|
@@ -1327,9 +1327,9 @@ const ee = Re({
|
|
|
1327
1327
|
function K(n, e, t = []) {
|
|
1328
1328
|
const s = [];
|
|
1329
1329
|
for (const r of t) {
|
|
1330
|
-
const { id: o, title: a, icon: i, children:
|
|
1331
|
-
if (
|
|
1332
|
-
const u = K(n, e,
|
|
1330
|
+
const { id: o, title: a, icon: i, children: f, hidden: c, layout: l } = r;
|
|
1331
|
+
if (l) {
|
|
1332
|
+
const u = K(n, e, f || []);
|
|
1333
1333
|
s.push(...u);
|
|
1334
1334
|
} else {
|
|
1335
1335
|
const u = {
|
|
@@ -1338,7 +1338,7 @@ function K(n, e, t = []) {
|
|
|
1338
1338
|
icon: i,
|
|
1339
1339
|
hidden: c,
|
|
1340
1340
|
url: `${n}/${e}/${o}`,
|
|
1341
|
-
children:
|
|
1341
|
+
children: f && f.length ? K(n, e, f) : void 0
|
|
1342
1342
|
};
|
|
1343
1343
|
s.push(u);
|
|
1344
1344
|
}
|
|
@@ -1361,24 +1361,24 @@ function Fs(n) {
|
|
|
1361
1361
|
menuPathPrefix: e = "",
|
|
1362
1362
|
pageRouteName: t = "page",
|
|
1363
1363
|
disableMenusFilter: s = !1
|
|
1364
|
-
} = n || {}, r = Le(), o = Pe(), a = $t(), i = oe(!1),
|
|
1365
|
-
i.value = !
|
|
1364
|
+
} = n || {}, r = Le(), o = Pe(), a = $t(), i = oe(!1), f = oe(!1), c = r.project, l = (d, h) => {
|
|
1365
|
+
i.value = !d?.mask, f.value = h?.pure ?? !!d?.pure;
|
|
1366
1366
|
};
|
|
1367
1367
|
nt(() => {
|
|
1368
|
-
const { name:
|
|
1369
|
-
if (
|
|
1370
|
-
const g = r.getPage(
|
|
1371
|
-
|
|
1372
|
-
} else if (
|
|
1368
|
+
const { name: d, params: h, meta: m } = o;
|
|
1369
|
+
if (d === x) {
|
|
1370
|
+
const g = r.getPage(h.id);
|
|
1371
|
+
l(g, m);
|
|
1372
|
+
} else if (d === N) {
|
|
1373
1373
|
const g = r.getHomepage();
|
|
1374
|
-
|
|
1374
|
+
l(g, m);
|
|
1375
1375
|
} else {
|
|
1376
1376
|
const g = m.__vtj__;
|
|
1377
1377
|
if (g) {
|
|
1378
1378
|
const v = r.getPage(g);
|
|
1379
|
-
|
|
1379
|
+
l(v, m);
|
|
1380
1380
|
} else
|
|
1381
|
-
i.value = !m.mask,
|
|
1381
|
+
i.value = !m.mask, f.value = !!m.pure;
|
|
1382
1382
|
}
|
|
1383
1383
|
});
|
|
1384
1384
|
const u = K(
|
|
@@ -1392,18 +1392,18 @@ function Fs(n) {
|
|
|
1392
1392
|
themeSwitchable: p?.themeSwitchable,
|
|
1393
1393
|
title: p?.title || c?.description || c?.name || "VTJ App",
|
|
1394
1394
|
menus: s ? u : He(u, a),
|
|
1395
|
-
pure:
|
|
1395
|
+
pure: f
|
|
1396
1396
|
};
|
|
1397
1397
|
}
|
|
1398
1398
|
function te(n, e) {
|
|
1399
|
-
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: a = "", component: i, routeMeta:
|
|
1399
|
+
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: a = "", component: i, routeMeta: f } = e;
|
|
1400
1400
|
return {
|
|
1401
1401
|
name: t,
|
|
1402
1402
|
path: `${a}${o}/${t}`,
|
|
1403
1403
|
component: i,
|
|
1404
1404
|
meta: {
|
|
1405
1405
|
title: s,
|
|
1406
|
-
...
|
|
1406
|
+
...f,
|
|
1407
1407
|
...r,
|
|
1408
1408
|
__vtj__: t
|
|
1409
1409
|
}
|
|
@@ -1418,9 +1418,9 @@ function le(n) {
|
|
|
1418
1418
|
loader: o,
|
|
1419
1419
|
routeMeta: a,
|
|
1420
1420
|
homepage: i
|
|
1421
|
-
} = n,
|
|
1421
|
+
} = n, f = [];
|
|
1422
1422
|
for (const c of s) {
|
|
1423
|
-
const { id:
|
|
1423
|
+
const { id: l, title: u, dir: p, layout: d, children: h, meta: m } = c;
|
|
1424
1424
|
if (p) {
|
|
1425
1425
|
const g = le({
|
|
1426
1426
|
name: e,
|
|
@@ -1429,10 +1429,10 @@ function le(n) {
|
|
|
1429
1429
|
routeMeta: a,
|
|
1430
1430
|
homepage: i,
|
|
1431
1431
|
loader: o,
|
|
1432
|
-
pages:
|
|
1432
|
+
pages: h || []
|
|
1433
1433
|
});
|
|
1434
|
-
|
|
1435
|
-
} else if (
|
|
1434
|
+
f.push(...g);
|
|
1435
|
+
} else if (d) {
|
|
1436
1436
|
const g = le({
|
|
1437
1437
|
name: e,
|
|
1438
1438
|
prefix: t,
|
|
@@ -1440,77 +1440,77 @@ function le(n) {
|
|
|
1440
1440
|
routeMeta: a,
|
|
1441
1441
|
homepage: i,
|
|
1442
1442
|
loader: o,
|
|
1443
|
-
pages:
|
|
1443
|
+
pages: h || []
|
|
1444
1444
|
}), v = {
|
|
1445
|
-
name: `layout_${
|
|
1445
|
+
name: `layout_${l}`,
|
|
1446
1446
|
path: t,
|
|
1447
|
-
component: () => o(
|
|
1447
|
+
component: () => o(l),
|
|
1448
1448
|
meta: {
|
|
1449
1449
|
title: u,
|
|
1450
1450
|
...a,
|
|
1451
1451
|
...m,
|
|
1452
|
-
__vtj__:
|
|
1452
|
+
__vtj__: l
|
|
1453
1453
|
},
|
|
1454
1454
|
children: g
|
|
1455
1455
|
};
|
|
1456
|
-
|
|
1457
|
-
} else if (
|
|
1456
|
+
f.push(v), f.push(te(c, n));
|
|
1457
|
+
} else if (f.push(te(c, n)), i === l) {
|
|
1458
1458
|
const g = te(c, n);
|
|
1459
|
-
g.path = "", g.name = `home_${
|
|
1459
|
+
g.path = "", g.name = `home_${l}`, f.push(g);
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
return
|
|
1462
|
+
return f;
|
|
1463
1463
|
}
|
|
1464
1464
|
function rs(n = {}, e) {
|
|
1465
|
-
const { css: t, store: s, enhance: r } = n, { window: o, app: a, library: i = {}, adapter:
|
|
1466
|
-
a.config.globalProperties.$libs = i, fe(o, "global-css", t || ""),
|
|
1465
|
+
const { css: t, store: s, enhance: r } = n, { window: o, app: a, library: i = {}, adapter: f, mode: c } = e, { Pinia: l } = i;
|
|
1466
|
+
a.config.globalProperties.$libs = i, fe(o, "global-css", t || ""), l && s && os(s, a, l), as(a, f, n), !f.access && n.access && is(n.access, a, c, f), cs(a, n), r && ls(r, a, i);
|
|
1467
1467
|
}
|
|
1468
1468
|
function os(n, e, t) {
|
|
1469
1469
|
const s = t.createPinia();
|
|
1470
|
-
if (e.use(s),
|
|
1470
|
+
if (e.use(s), E(n) && n.value) {
|
|
1471
1471
|
const r = R(n, {}, !1, !1, !0), o = t.defineStore("$store", r(e) || {});
|
|
1472
1472
|
e.config.globalProperties.$store = o();
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
1475
|
function is(n, e, t, s) {
|
|
1476
|
-
if (
|
|
1476
|
+
if (E(n) && n.value) {
|
|
1477
1477
|
const r = R(n, {}, !1, !1, !0), { alert: o, request: a } = s, i = new pe({
|
|
1478
1478
|
alert: o,
|
|
1479
1479
|
storagePrefix: "__VTJ_APP_",
|
|
1480
1480
|
...r(e)
|
|
1481
|
-
}),
|
|
1482
|
-
i.connect({ mode: t, router:
|
|
1481
|
+
}), f = e.config.globalProperties.$router;
|
|
1482
|
+
i.connect({ mode: t, router: f, request: a }), e.use(i);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
function as(n, e, t) {
|
|
1486
1486
|
if (!e.request) return;
|
|
1487
1487
|
const { axios: s, request: r, response: o } = t;
|
|
1488
|
-
if (s &&
|
|
1488
|
+
if (s && E(s) && s.value) {
|
|
1489
1489
|
const a = R(s, {}, !1, !1, !0);
|
|
1490
1490
|
e.request.setConfig(a(n));
|
|
1491
1491
|
}
|
|
1492
|
-
if (r &&
|
|
1492
|
+
if (r && E(r) && r.value) {
|
|
1493
1493
|
const a = R(r, {}, !1, !1, !0), i = e.request;
|
|
1494
|
-
i.__unReq && i.__unReq(), i.__unReq = e.request.useRequest((
|
|
1494
|
+
i.__unReq && i.__unReq(), i.__unReq = e.request.useRequest((f) => a(f, n));
|
|
1495
1495
|
}
|
|
1496
|
-
if (o &&
|
|
1496
|
+
if (o && E(o) && o.value) {
|
|
1497
1497
|
const a = R(o, {}, !1, !1, !0), i = e.request;
|
|
1498
|
-
i.__unRes && i.__unRes(), i.__unRes = e.request.useResponse((
|
|
1498
|
+
i.__unRes && i.__unRes(), i.__unRes = e.request.useResponse((f) => a(f, n));
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
1501
1501
|
function cs(n, e) {
|
|
1502
1502
|
const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
|
|
1503
|
-
if (t &&
|
|
1503
|
+
if (t && E(t) && t.value) {
|
|
1504
1504
|
const o = R(t, {}, !1, !1, !0);
|
|
1505
|
-
r && r.beforeEach((a, i,
|
|
1505
|
+
r && r.beforeEach((a, i, f) => o(a, i, f, n));
|
|
1506
1506
|
}
|
|
1507
|
-
if (s &&
|
|
1507
|
+
if (s && E(s) && s.value) {
|
|
1508
1508
|
const o = R(s, {}, !1, !1, !0);
|
|
1509
|
-
r && r.afterEach((a, i,
|
|
1509
|
+
r && r.afterEach((a, i, f) => o(a, i, f, n));
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
1512
|
function ls(n, e, t = {}) {
|
|
1513
|
-
|
|
1513
|
+
E(n) && n.value && R(n, {}, !1, !1, !0)(e, t);
|
|
1514
1514
|
}
|
|
1515
1515
|
function us(n, e, t) {
|
|
1516
1516
|
if (!n || !e || !t) return;
|
|
@@ -1518,17 +1518,17 @@ function us(n, e, t) {
|
|
|
1518
1518
|
if (s) {
|
|
1519
1519
|
const { locale: r, fallbackLocale: o, messages: a = [] } = t, i = {};
|
|
1520
1520
|
for (let c of a) {
|
|
1521
|
-
const
|
|
1522
|
-
for (const u of
|
|
1521
|
+
const l = Object.keys(c).filter((u) => u !== "key");
|
|
1522
|
+
for (const u of l)
|
|
1523
1523
|
i[u] || (i[u] = {}), i[u][c.key] = c[u];
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const f = s.createI18n({
|
|
1526
1526
|
legacy: !1,
|
|
1527
1527
|
locale: r,
|
|
1528
1528
|
fallbackLocale: o,
|
|
1529
1529
|
messages: i
|
|
1530
1530
|
});
|
|
1531
|
-
n.use(
|
|
1531
|
+
n.use(f);
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
1534
1534
|
const Be = Symbol("Provider");
|
|
@@ -1547,16 +1547,16 @@ class ps extends Ke {
|
|
|
1547
1547
|
materials: o,
|
|
1548
1548
|
project: a = {},
|
|
1549
1549
|
adapter: i = {},
|
|
1550
|
-
globals:
|
|
1550
|
+
globals: f = {},
|
|
1551
1551
|
modules: c = {},
|
|
1552
|
-
router:
|
|
1552
|
+
router: l = null,
|
|
1553
1553
|
materialPath: u = "./",
|
|
1554
1554
|
nodeEnv: p = "development"
|
|
1555
1555
|
/* Development */
|
|
1556
1556
|
} = e;
|
|
1557
|
-
this.mode = s, this.modules = c, this.service = t, this.router =
|
|
1558
|
-
const { access:
|
|
1559
|
-
|
|
1557
|
+
this.mode = s, this.modules = c, this.service = t, this.router = l, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, f), Object.assign(this.adapter, i);
|
|
1558
|
+
const { access: d, request: h } = this.adapter;
|
|
1559
|
+
d && d.connect({ mode: s, router: l, request: h }), a && s !== w.Design ? this.load(a) : this.project = a;
|
|
1560
1560
|
}
|
|
1561
1561
|
mode;
|
|
1562
1562
|
// 当前运行模式(设计/源码/预览等)
|
|
@@ -1564,7 +1564,7 @@ class ps extends Ke {
|
|
|
1564
1564
|
// 全局变量
|
|
1565
1565
|
modules = {};
|
|
1566
1566
|
// 异步模块加载器
|
|
1567
|
-
adapter = { request: ne, jsonp:
|
|
1567
|
+
adapter = { request: ne, jsonp: be };
|
|
1568
1568
|
// 适配器接口
|
|
1569
1569
|
apis = {};
|
|
1570
1570
|
// API集合
|
|
@@ -1641,21 +1641,21 @@ class ps extends Ke {
|
|
|
1641
1641
|
components: o,
|
|
1642
1642
|
materialPath: a,
|
|
1643
1643
|
nodeEnv: i,
|
|
1644
|
-
libraryLocales:
|
|
1644
|
+
libraryLocales: f
|
|
1645
1645
|
} = this, {
|
|
1646
1646
|
libraryExports: c,
|
|
1647
|
-
libraryMap:
|
|
1647
|
+
libraryMap: l,
|
|
1648
1648
|
materials: u,
|
|
1649
1649
|
materialExports: p,
|
|
1650
|
-
materialMapLibrary:
|
|
1651
|
-
libraryLocaleMap:
|
|
1650
|
+
materialMapLibrary: d,
|
|
1651
|
+
libraryLocaleMap: h
|
|
1652
1652
|
} = lt(
|
|
1653
1653
|
t,
|
|
1654
1654
|
a,
|
|
1655
1655
|
i === "development"
|
|
1656
1656
|
/* Development */
|
|
1657
1657
|
);
|
|
1658
|
-
Object.assign(this.libraryLocaleMap,
|
|
1658
|
+
Object.assign(this.libraryLocaleMap, h);
|
|
1659
1659
|
for (const m of c) {
|
|
1660
1660
|
const g = s[m], v = e[m];
|
|
1661
1661
|
if (v)
|
|
@@ -1663,15 +1663,15 @@ class ps extends Ke {
|
|
|
1663
1663
|
else if (g)
|
|
1664
1664
|
e[m] = r[m] = await g();
|
|
1665
1665
|
else {
|
|
1666
|
-
const y =
|
|
1666
|
+
const y = l[m] || [];
|
|
1667
1667
|
for (const S of y)
|
|
1668
1668
|
G(S) && await gt(S, k.append(S, { v: T })), V(S) && await _e(k.append(S, { v: T }));
|
|
1669
1669
|
r[m] = e[m];
|
|
1670
1670
|
}
|
|
1671
|
-
const _ =
|
|
1671
|
+
const _ = h[m];
|
|
1672
1672
|
if (_) {
|
|
1673
1673
|
const y = s[_];
|
|
1674
|
-
|
|
1674
|
+
f[_] = y ? await y() : e[_];
|
|
1675
1675
|
}
|
|
1676
1676
|
}
|
|
1677
1677
|
if (i === "development") {
|
|
@@ -1679,7 +1679,7 @@ class ps extends Ke {
|
|
|
1679
1679
|
await _e(k.append(g, { v: T }));
|
|
1680
1680
|
const m = this.materials || {};
|
|
1681
1681
|
for (const g of p) {
|
|
1682
|
-
const v = e[
|
|
1682
|
+
const v = e[d[g]], _ = v?.default || v, y = ze[g];
|
|
1683
1683
|
if (y)
|
|
1684
1684
|
_ && y.forEach((S) => {
|
|
1685
1685
|
o[S] = _[S];
|
|
@@ -1699,8 +1699,8 @@ class ps extends Ke {
|
|
|
1699
1699
|
const o = t?.platform === "uniapp" ? "pages" : "page", {
|
|
1700
1700
|
routeAppendTo: a,
|
|
1701
1701
|
pageRouteName: i = o,
|
|
1702
|
-
routeMeta:
|
|
1703
|
-
} = s, c = a ? "" : "/",
|
|
1702
|
+
routeMeta: f
|
|
1703
|
+
} = s, c = a ? "" : "/", l = {
|
|
1704
1704
|
path: `${c}${i}/:id`,
|
|
1705
1705
|
name: x,
|
|
1706
1706
|
component: ee
|
|
@@ -1708,7 +1708,7 @@ class ps extends Ke {
|
|
|
1708
1708
|
path: c,
|
|
1709
1709
|
name: N,
|
|
1710
1710
|
component: t?.homepage ? ee : r.startupComponent || ns,
|
|
1711
|
-
meta:
|
|
1711
|
+
meta: f
|
|
1712
1712
|
};
|
|
1713
1713
|
if (e.hasRoute(x) && e.removeRoute(x), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
|
|
1714
1714
|
const p = t?.pages || [];
|
|
@@ -1719,11 +1719,11 @@ class ps extends Ke {
|
|
|
1719
1719
|
component: ee,
|
|
1720
1720
|
loader: this.getRenderComponent.bind(this),
|
|
1721
1721
|
homepage: t?.homepage
|
|
1722
|
-
}).forEach((
|
|
1723
|
-
a ? e.addRoute(a,
|
|
1722
|
+
}).forEach((h) => {
|
|
1723
|
+
a ? e.addRoute(a, h) : e.addRoute(h);
|
|
1724
1724
|
}), t?.homepage || (a ? e.addRoute(a, u) : e.addRoute(u));
|
|
1725
1725
|
} else
|
|
1726
|
-
a ? (e.addRoute(a,
|
|
1726
|
+
a ? (e.addRoute(a, l), e.addRoute(a, u)) : (e.addRoute(l), e.addRoute(u));
|
|
1727
1727
|
}
|
|
1728
1728
|
setErrorHandler(e) {
|
|
1729
1729
|
e.config.errorHandler = tt((t, s, r) => {
|
|
@@ -1753,7 +1753,7 @@ class ps extends Ke {
|
|
|
1753
1753
|
const { libraryLocaleMap: t, libraryLocales: s } = this, { libraryOptions: r = {} } = this.options, o = e.config.globalProperties.installed || {};
|
|
1754
1754
|
for (const [a, i] of Object.entries(this.library))
|
|
1755
1755
|
if (!o[a] && vt(i)) {
|
|
1756
|
-
const c = { locale: s[t[a]] },
|
|
1756
|
+
const c = { locale: s[t[a]] }, l = r[a] || {}, u = { ...c, ...l };
|
|
1757
1757
|
e.use(i, u), o[a] = !0;
|
|
1758
1758
|
}
|
|
1759
1759
|
e.provide(Be, this), e.config.globalProperties.$provider = this, e.config.globalProperties.$request = this.adapter?.request, this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), this.project?.platform !== "uniapp" && this.mode !== w.Design && this.initGlobals(this.project?.globals || {}, {
|
|
@@ -1822,7 +1822,7 @@ class ps extends Ke {
|
|
|
1822
1822
|
apis: a,
|
|
1823
1823
|
window,
|
|
1824
1824
|
...t
|
|
1825
|
-
},
|
|
1825
|
+
}, f = ae({
|
|
1826
1826
|
getDsl: async (c) => await this.getDsl(c) || null,
|
|
1827
1827
|
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
|
1828
1828
|
options: i
|
|
@@ -1830,7 +1830,7 @@ class ps extends Ke {
|
|
|
1830
1830
|
return ie({
|
|
1831
1831
|
...i,
|
|
1832
1832
|
dsl: e,
|
|
1833
|
-
loader:
|
|
1833
|
+
loader: f
|
|
1834
1834
|
});
|
|
1835
1835
|
}
|
|
1836
1836
|
/**
|
|
@@ -1965,7 +1965,7 @@ const Ne = {
|
|
|
1965
1965
|
}
|
|
1966
1966
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
|
1967
1967
|
function Ms(n) {
|
|
1968
|
-
return
|
|
1968
|
+
return Ee({
|
|
1969
1969
|
settings: {
|
|
1970
1970
|
type: "json",
|
|
1971
1971
|
validSuccess: !0,
|
|
@@ -2283,17 +2283,17 @@ export {
|
|
|
2283
2283
|
mt as convertCssRpx,
|
|
2284
2284
|
As as createAccess,
|
|
2285
2285
|
Cs as createAdapter,
|
|
2286
|
-
|
|
2287
|
-
|
|
2286
|
+
Es as createAssetScripts,
|
|
2287
|
+
bs as createAssetsCss,
|
|
2288
2288
|
xt as createDataSources,
|
|
2289
2289
|
ae as createLoader,
|
|
2290
2290
|
xs as createMemoryService,
|
|
2291
2291
|
K as createMenus,
|
|
2292
|
-
|
|
2292
|
+
bt as createMetaApi,
|
|
2293
2293
|
Pt as createMock,
|
|
2294
2294
|
ks as createProvider,
|
|
2295
2295
|
ie as createRenderer,
|
|
2296
|
-
|
|
2296
|
+
Et as createSchemaApi,
|
|
2297
2297
|
jt as createSchemaApis,
|
|
2298
2298
|
Ms as createServiceRequest,
|
|
2299
2299
|
Bt as defaultLoader,
|
|
@@ -2305,8 +2305,8 @@ export {
|
|
|
2305
2305
|
yt as isBuiltInTag,
|
|
2306
2306
|
G as isCSSUrl,
|
|
2307
2307
|
wt as isJSCode,
|
|
2308
|
-
|
|
2309
|
-
|
|
2308
|
+
b as isJSExpression,
|
|
2309
|
+
E as isJSFunction,
|
|
2310
2310
|
at as isJSON,
|
|
2311
2311
|
V as isJSUrl,
|
|
2312
2312
|
_t as isNativeTag,
|