@vtj/renderer 0.16.6 → 0.16.8
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 +9 -7
- package/dist/index.mjs +242 -230
- package/package.json +5 -5
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { url as
|
|
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 be, jsonp as Ee, 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
|
-
import { inject as je, defineComponent as Re, h as re, ref as oe, watchEffect as
|
|
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";
|
|
6
6
|
/**!
|
|
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.8
|
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const T = "0.16.8";
|
|
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",
|
|
@@ -24,7 +24,7 @@ const Se = [
|
|
|
24
24
|
"$props",
|
|
25
25
|
"$options",
|
|
26
26
|
"$forceUpdate"
|
|
27
|
-
],
|
|
27
|
+
], ws = [
|
|
28
28
|
"beforeCreate",
|
|
29
29
|
"created",
|
|
30
30
|
"beforeMount",
|
|
@@ -38,7 +38,7 @@ const Se = [
|
|
|
38
38
|
"renderTriggered",
|
|
39
39
|
"activated",
|
|
40
40
|
"deactivated"
|
|
41
|
-
],
|
|
41
|
+
], rt = [
|
|
42
42
|
"vIf",
|
|
43
43
|
"vElseIf",
|
|
44
44
|
"vElse",
|
|
@@ -47,7 +47,7 @@ const Se = [
|
|
|
47
47
|
"vFor",
|
|
48
48
|
"vBind",
|
|
49
49
|
"vHtml"
|
|
50
|
-
],
|
|
50
|
+
], ot = {
|
|
51
51
|
String,
|
|
52
52
|
Number,
|
|
53
53
|
Boolean,
|
|
@@ -55,9 +55,9 @@ const Se = [
|
|
|
55
55
|
Object,
|
|
56
56
|
Function,
|
|
57
57
|
Date
|
|
58
|
-
},
|
|
58
|
+
}, x = "VtjPage", N = "VtjHomepage", Ce = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(
|
|
59
59
|
","
|
|
60
|
-
), it = "component,slot".split(","),
|
|
60
|
+
), it = "component,slot".split(","), Ss = [
|
|
61
61
|
"h",
|
|
62
62
|
"t",
|
|
63
63
|
"t",
|
|
@@ -77,7 +77,7 @@ const Se = [
|
|
|
77
77
|
"p",
|
|
78
78
|
"r",
|
|
79
79
|
"o"
|
|
80
|
-
].join(""),
|
|
80
|
+
].join(""), $s = {
|
|
81
81
|
auth: [
|
|
82
82
|
"h",
|
|
83
83
|
"t",
|
|
@@ -149,14 +149,14 @@ function V(n) {
|
|
|
149
149
|
function at(n) {
|
|
150
150
|
return /\.json$/.test(n);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function bs(n) {
|
|
153
153
|
return n.map(
|
|
154
|
-
(e) => `<script src="${
|
|
154
|
+
(e) => `<script src="${k.append(e, { v: T })}"><\/script>`
|
|
155
155
|
).join("");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Es(n = []) {
|
|
158
158
|
return n.map(
|
|
159
|
-
(e) => `<link rel="stylesheet" href="${
|
|
159
|
+
(e) => `<link rel="stylesheet" href="${k.append(e, { v: T })}" />`
|
|
160
160
|
).join("");
|
|
161
161
|
}
|
|
162
162
|
function ct(n, e = !1) {
|
|
@@ -166,8 +166,8 @@ function lt(n, e, t = !1) {
|
|
|
166
166
|
const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
|
|
167
167
|
return s.forEach(
|
|
168
168
|
({ urls: p, assetsUrl: h, library: d, assetsLibrary: m, localeLibrary: g }) => {
|
|
169
|
-
p?.forEach((
|
|
170
|
-
V(
|
|
169
|
+
p?.forEach((v) => {
|
|
170
|
+
V(v) && r.push(ct(v, t)), G(v) && o.push(v);
|
|
171
171
|
}), d && (i.push(d), l[d] = B(p || [], e), g && (c[d] = g)), h && a.push(h), m && f.push(m), d && m && (u[m] = d);
|
|
172
172
|
}
|
|
173
173
|
), {
|
|
@@ -175,7 +175,7 @@ function lt(n, e, t = !1) {
|
|
|
175
175
|
css: B(o, e),
|
|
176
176
|
materials: B(a, e),
|
|
177
177
|
libraryExports: i,
|
|
178
|
-
materialExports:
|
|
178
|
+
materialExports: Ge(f),
|
|
179
179
|
materialMapLibrary: u,
|
|
180
180
|
libraryMap: l,
|
|
181
181
|
libraryLocaleMap: c
|
|
@@ -202,30 +202,30 @@ function pt(n, e) {
|
|
|
202
202
|
continue;
|
|
203
203
|
}
|
|
204
204
|
if (c.substring(u, u + 2) === "/*") {
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
u =
|
|
205
|
+
const v = c.indexOf("*/", u + 2);
|
|
206
|
+
if (v !== -1) {
|
|
207
|
+
u = v + 2;
|
|
208
208
|
continue;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (c[u] === "@") {
|
|
212
|
-
const
|
|
212
|
+
const v = u;
|
|
213
213
|
for (; u < c.length && c[u] !== "{" && c[u] !== ";"; )
|
|
214
214
|
u++;
|
|
215
|
-
const _ = c.substring(
|
|
215
|
+
const _ = c.substring(v, u).trim(), y = _.includes("@keyframes");
|
|
216
216
|
if (c[u] === ";")
|
|
217
217
|
f.push({
|
|
218
218
|
type: "simple-at-rule",
|
|
219
|
-
content: c.substring(
|
|
219
|
+
content: c.substring(v, u + 1)
|
|
220
220
|
}), u++;
|
|
221
221
|
else if (c[u] === "{") {
|
|
222
222
|
const S = u + 1;
|
|
223
223
|
let A = 1;
|
|
224
224
|
for (u++; u < c.length && A > 0; )
|
|
225
225
|
c[u] === "{" ? A++ : c[u] === "}" && A--, u++;
|
|
226
|
-
const W = c.substring(
|
|
226
|
+
const W = c.substring(v, u), P = c.substring(S, u - 1);
|
|
227
227
|
f.push({
|
|
228
|
-
type:
|
|
228
|
+
type: y ? "keyframes" : "at-rule",
|
|
229
229
|
rule: _,
|
|
230
230
|
content: W,
|
|
231
231
|
inner: P
|
|
@@ -329,7 +329,7 @@ function mt(n, e) {
|
|
|
329
329
|
}
|
|
330
330
|
return o;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Ae(n) {
|
|
333
333
|
return I(n) ? n : JSON.stringify(n);
|
|
334
334
|
}
|
|
335
335
|
function fe(n, e, t, s = !1) {
|
|
@@ -347,7 +347,7 @@ function fe(n, e, t, s = !1) {
|
|
|
347
347
|
c ? c.innerHTML = i : (c = l.createElement("style"), c.id = e, c.innerHTML = i, l.head.appendChild(c));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function js(n) {
|
|
351
351
|
const e = n.adoptedStyleSheets || [];
|
|
352
352
|
let t = "";
|
|
353
353
|
if (e.forEach((s) => {
|
|
@@ -367,7 +367,7 @@ async function gt(n, e) {
|
|
|
367
367
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
|
368
368
|
t && fe(window, n, t);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Ie(n, e = window) {
|
|
371
371
|
const t = e.document, s = e.document.head;
|
|
372
372
|
for (const r of n)
|
|
373
373
|
if (!t.getElementById(r)) {
|
|
@@ -375,7 +375,7 @@ function Ae(n, e = window) {
|
|
|
375
375
|
a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
async function
|
|
378
|
+
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) => {
|
|
@@ -389,14 +389,14 @@ async function Ie(n, e, t = window) {
|
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function vt(n) {
|
|
393
393
|
return q(n) && Object.getOwnPropertyNames(n.prototype || {}).length === 0 || q(n?.install);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function yt(n) {
|
|
396
396
|
return it.includes(n);
|
|
397
397
|
}
|
|
398
398
|
function _t(n) {
|
|
399
|
-
return
|
|
399
|
+
return Ce.includes(n);
|
|
400
400
|
}
|
|
401
401
|
function D(n = window) {
|
|
402
402
|
const e = window?.Mock;
|
|
@@ -405,7 +405,7 @@ function D(n = window) {
|
|
|
405
405
|
if (t && window)
|
|
406
406
|
return window.Mock = t, t;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Rs(n, e, t) {
|
|
409
409
|
Object.assign(e.meta, t.meta);
|
|
410
410
|
const s = n?._container;
|
|
411
411
|
t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
|
|
@@ -426,7 +426,7 @@ ${a}
|
|
|
426
426
|
throw o;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function R(n, e, t = !1, s = !1, r = !1) {
|
|
430
430
|
const o = H(n, e, t, s, r);
|
|
431
431
|
if (typeof o != "function" && (O.error(
|
|
432
432
|
"parseFunction.error",
|
|
@@ -446,7 +446,7 @@ function b(n) {
|
|
|
446
446
|
function wt(n) {
|
|
447
447
|
return E(n) || b(n);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Ps(n) {
|
|
450
450
|
return wt(n) ? n.value : JSON.stringify(n);
|
|
451
451
|
}
|
|
452
452
|
const St = {
|
|
@@ -535,7 +535,7 @@ class pe {
|
|
|
535
535
|
setData(e) {
|
|
536
536
|
const { privateKey: t } = this.options;
|
|
537
537
|
if (Array.isArray(e) && t) {
|
|
538
|
-
const s = e.map((r) =>
|
|
538
|
+
const s = e.map((r) => ve(r, t));
|
|
539
539
|
try {
|
|
540
540
|
this.data = JSON.parse(s.join(""));
|
|
541
541
|
} catch (r) {
|
|
@@ -545,7 +545,7 @@ class pe {
|
|
|
545
545
|
}
|
|
546
546
|
if (typeof e == "string")
|
|
547
547
|
try {
|
|
548
|
-
const s = t ?
|
|
548
|
+
const s = t ? ve(e, t) : e;
|
|
549
549
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
|
550
550
|
} catch (s) {
|
|
551
551
|
console.warn(s);
|
|
@@ -565,7 +565,7 @@ class pe {
|
|
|
565
565
|
return e && t ? !!Y.get(t) : !!this.getToken();
|
|
566
566
|
}
|
|
567
567
|
hasRoutePermission(e) {
|
|
568
|
-
if (e.name ===
|
|
568
|
+
if (e.name === x) {
|
|
569
569
|
const t = e.params.id;
|
|
570
570
|
return t && this.can(t);
|
|
571
571
|
}
|
|
@@ -622,7 +622,7 @@ class pe {
|
|
|
622
622
|
function $t() {
|
|
623
623
|
return je(ke, null);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Cs(n = {}) {
|
|
626
626
|
const {
|
|
627
627
|
notify: e,
|
|
628
628
|
loading: t,
|
|
@@ -663,7 +663,7 @@ function Ps(n = {}) {
|
|
|
663
663
|
access: o ? new pe({ alert: i, ...o }) : void 0
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function As(n = {}) {
|
|
667
667
|
return new pe(n);
|
|
668
668
|
}
|
|
669
669
|
function bt(n, e) {
|
|
@@ -682,7 +682,7 @@ function bt(n, e) {
|
|
|
682
682
|
headers: r
|
|
683
683
|
}
|
|
684
684
|
};
|
|
685
|
-
return (a, i) => (delete o.data, s.send(
|
|
685
|
+
return (a, i) => (delete o.data, s.send(Ve(o, i || {}, { data: a })));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
function Et(n, e) {
|
|
@@ -709,10 +709,10 @@ function jt(n = [], e = [], t) {
|
|
|
709
709
|
}
|
|
710
710
|
async function Rt(n = [], e = window) {
|
|
711
711
|
const t = D(e);
|
|
712
|
-
t && (
|
|
712
|
+
t && (Oe(e), n.forEach((s) => Ct(t, s)));
|
|
713
713
|
}
|
|
714
714
|
function Pt(n, e = window) {
|
|
715
|
-
const t = b(n.mockTemplate) && n.mockTemplate.value ?
|
|
715
|
+
const t = b(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)
|
|
@@ -729,9 +729,9 @@ function Ct(n, e) {
|
|
|
729
729
|
const { url: t, mockTemplate: s } = e;
|
|
730
730
|
if (t && s)
|
|
731
731
|
try {
|
|
732
|
-
const r = se(t) ? new URL(t).pathname : t, o =
|
|
732
|
+
const r = se(t) ? new URL(t).pathname : t, o = We(`(.*)${r}(.*)`), a = Qe(r, { decode: decodeURIComponent }), i = H(s, {}, !0);
|
|
733
733
|
n.mock(o, (l) => {
|
|
734
|
-
const c =
|
|
734
|
+
const c = k.parse(l.url) || {}, f = l.body instanceof FormData ? Xe(l.body) : l.body, u = se(l.url) ? new URL(l.url).pathname : l.url.split("?")[0], p = a(u)?.params;
|
|
735
735
|
Object.assign(l, { data: f, params: p, query: c });
|
|
736
736
|
try {
|
|
737
737
|
return n.mock(i(l));
|
|
@@ -743,7 +743,7 @@ function Ct(n, e) {
|
|
|
743
743
|
console.warn("mockApi", r);
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Oe(n = window) {
|
|
747
747
|
const e = D(n);
|
|
748
748
|
e && (e._mocked = {});
|
|
749
749
|
}
|
|
@@ -807,9 +807,9 @@ class At {
|
|
|
807
807
|
if (e)
|
|
808
808
|
if (this.__mode === w.Runtime) {
|
|
809
809
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
|
810
|
-
return
|
|
810
|
+
return R({ type: s, value: r }, this);
|
|
811
811
|
} else
|
|
812
|
-
return
|
|
812
|
+
return R(e, this);
|
|
813
813
|
}
|
|
814
814
|
__parseExpression(e) {
|
|
815
815
|
if (e)
|
|
@@ -867,7 +867,7 @@ function ie(n) {
|
|
|
867
867
|
name: i.value.name,
|
|
868
868
|
__scopeId: i.value.id ? `data-v-${i.value.id}` : void 0,
|
|
869
869
|
props: {
|
|
870
|
-
...
|
|
870
|
+
...Ft(i.value.props ?? [], c)
|
|
871
871
|
},
|
|
872
872
|
async setup(u) {
|
|
873
873
|
c.$props = u, c.props = u, i.value.id && fe(
|
|
@@ -875,11 +875,11 @@ function ie(n) {
|
|
|
875
875
|
i.value.id,
|
|
876
876
|
i.value.css || "",
|
|
877
877
|
!0
|
|
878
|
-
), c.state =
|
|
879
|
-
const p = Ot(e, i.value.computed ?? {}, c), h =
|
|
880
|
-
for (const [
|
|
881
|
-
d[
|
|
882
|
-
const m =
|
|
878
|
+
), c.state = kt(e, i.value.state ?? {}, c);
|
|
879
|
+
const p = Ot(e, i.value.computed ?? {}, c), h = Mt(i.value.methods ?? {}, c), d = Tt(e, i.value.inject, c);
|
|
880
|
+
for (const [v, _] of Object.entries(d || {}))
|
|
881
|
+
d[v] = e.inject(v, _);
|
|
882
|
+
const m = xt(
|
|
883
883
|
i.value.dataSources || {},
|
|
884
884
|
c
|
|
885
885
|
), g = {
|
|
@@ -900,8 +900,8 @@ function ie(n) {
|
|
|
900
900
|
render() {
|
|
901
901
|
if (!i.value.nodes) return null;
|
|
902
902
|
const u = i.value.nodes || [];
|
|
903
|
-
return u.length === 1 ?
|
|
904
|
-
(p) =>
|
|
903
|
+
return u.length === 1 ? M(u[0], c, e, a, u) : u.map(
|
|
904
|
+
(p) => M(p, c, e, a, u)
|
|
905
905
|
);
|
|
906
906
|
},
|
|
907
907
|
...Ht(i.value.lifeCycles ?? {}, c)
|
|
@@ -914,8 +914,8 @@ function ie(n) {
|
|
|
914
914
|
function It(n = []) {
|
|
915
915
|
return n.map((e) => I(e) ? e : e.name);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) =>
|
|
917
|
+
function Ft(n = [], e) {
|
|
918
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => ot[o]) : void 0;
|
|
919
919
|
return n.map((s) => I(s) ? {
|
|
920
920
|
name: s
|
|
921
921
|
} : {
|
|
@@ -932,7 +932,7 @@ function kt(n = [], e) {
|
|
|
932
932
|
{}
|
|
933
933
|
);
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function kt(n, e, t) {
|
|
936
936
|
return n.reactive(
|
|
937
937
|
Object.keys(e || {}).reduce(
|
|
938
938
|
(s, r) => {
|
|
@@ -949,13 +949,13 @@ function Ot(n, e, t) {
|
|
|
949
949
|
{}
|
|
950
950
|
);
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function Mt(n, e) {
|
|
953
953
|
return Object.entries(n ?? {}).reduce(
|
|
954
954
|
(t, [s, r]) => (t[s] = e.__parseFunction(r), t),
|
|
955
955
|
{}
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Tt(n, e = [], t) {
|
|
959
959
|
return e.reduce(
|
|
960
960
|
(s, r) => {
|
|
961
961
|
const { name: o, from: a } = r || {};
|
|
@@ -966,7 +966,7 @@ function Mt(n, e = [], t) {
|
|
|
966
966
|
{}
|
|
967
967
|
);
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function xt(n, e) {
|
|
970
970
|
return Object.keys(n).reduce(
|
|
971
971
|
(t, s) => {
|
|
972
972
|
const r = n[s];
|
|
@@ -1007,14 +1007,14 @@ function Ht(n, e) {
|
|
|
1007
1007
|
{}
|
|
1008
1008
|
);
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1011
|
-
let Z = [],
|
|
1010
|
+
const Me = new Ye();
|
|
1011
|
+
let Z = [], F = {};
|
|
1012
1012
|
const Bt = (n) => n;
|
|
1013
|
-
async function
|
|
1013
|
+
async function Te(n, e = window) {
|
|
1014
1014
|
const { urls: t = [], library: s } = n, r = t.filter((i) => V(i));
|
|
1015
1015
|
if (r.length === 0 || !s) return null;
|
|
1016
1016
|
const o = t.filter((i) => G(i));
|
|
1017
|
-
return o.length &&
|
|
1017
|
+
return o.length && Ie(o, e), await Fe(r, s, e).catch(
|
|
1018
1018
|
(i) => (console.warn("loadScriptUrl error", r, s, i), null)
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
@@ -1026,34 +1026,34 @@ function ae(n) {
|
|
|
1026
1026
|
if (!o || typeof o == "string") return r;
|
|
1027
1027
|
if (o.type === "Schema" && o.id)
|
|
1028
1028
|
return a.defineAsyncComponent(async () => {
|
|
1029
|
-
const i =
|
|
1029
|
+
const i = F[o.id] || await Me.add(
|
|
1030
1030
|
o.id,
|
|
1031
1031
|
() => e(o.id)
|
|
1032
1032
|
);
|
|
1033
|
-
return i && (i.name = r,
|
|
1033
|
+
return i && (i.name = r, F[o.id] = i), i ? ie({
|
|
1034
1034
|
...s,
|
|
1035
1035
|
Vue: a,
|
|
1036
|
-
dsl:
|
|
1036
|
+
dsl: ye(i),
|
|
1037
1037
|
mode: w.Runtime,
|
|
1038
1038
|
loader: ae(n)
|
|
1039
1039
|
}).renderer : null;
|
|
1040
1040
|
});
|
|
1041
1041
|
if (o.type === "UrlSchema" && o.url)
|
|
1042
1042
|
return a.defineAsyncComponent(async () => {
|
|
1043
|
-
const i =
|
|
1044
|
-
return i && (i.name = r,
|
|
1043
|
+
const i = F[o.url] || await t(o.url);
|
|
1044
|
+
return i && (i.name = r, F[o.url] = i), i ? ie({
|
|
1045
1045
|
...s,
|
|
1046
1046
|
Vue: a,
|
|
1047
|
-
dsl:
|
|
1047
|
+
dsl: ye(i),
|
|
1048
1048
|
mode: w.Runtime,
|
|
1049
1049
|
loader: ae(n)
|
|
1050
1050
|
}).renderer : null;
|
|
1051
1051
|
});
|
|
1052
1052
|
if (o.type === "Plugin") {
|
|
1053
|
-
let i = o.library ?
|
|
1054
|
-
return i || (o.library && Z.push(o.library), i =
|
|
1053
|
+
let i = o.library ? F[o.library] : null;
|
|
1054
|
+
return i || (o.library && Z.push(o.library), i = F[o.library || Symbol()] = a.defineAsyncComponent(
|
|
1055
1055
|
async () => {
|
|
1056
|
-
const l = await
|
|
1056
|
+
const l = await Te(o, s.window);
|
|
1057
1057
|
return l || (console.warn("getPlugin result is null", o), null);
|
|
1058
1058
|
}
|
|
1059
1059
|
), i);
|
|
@@ -1061,48 +1061,48 @@ function ae(n) {
|
|
|
1061
1061
|
return r;
|
|
1062
1062
|
};
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1065
|
-
|
|
1064
|
+
function Is() {
|
|
1065
|
+
F = {}, Me.clearAllCache();
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
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: l = [] } = n, { vIf: c, vElseIf: f, vElse: u, vFor: p, vShow: h, vModels: d, vBind: m, vHtml: g, others:
|
|
1069
|
+
const a = t.getCurrentInstance()?.appContext, { id: i = null, directives: l = [] } = n, { vIf: c, vElseIf: f, vElse: u, vFor: p, vShow: h, vModels: d, vBind: m, vHtml: g, others: v } = xe(l);
|
|
1070
1070
|
if (!o && (f || u))
|
|
1071
1071
|
return null;
|
|
1072
1072
|
if (c && !Nt(c, e))
|
|
1073
1073
|
return zt(n, e, t, s, r);
|
|
1074
|
-
const _ = (
|
|
1075
|
-
const A =
|
|
1074
|
+
const _ = (y, S = 0) => {
|
|
1075
|
+
const A = y.$components, W = (() => {
|
|
1076
1076
|
if (n.name === "component")
|
|
1077
|
-
return Ut(
|
|
1077
|
+
return Ut(y, n.props?.is);
|
|
1078
1078
|
if (n.name === "slot") return n.name;
|
|
1079
|
-
const
|
|
1080
|
-
return I(
|
|
1081
|
-
})(), P = qt(i, n.props ?? {},
|
|
1079
|
+
const j = s(n.name, n.from, t);
|
|
1080
|
+
return I(j) ? yt(j) || _t(j) ? j : A[j] ?? a?.app?.component(j) ?? j : j;
|
|
1081
|
+
})(), P = qt(i, n.props ?? {}, y), Ue = Kt(t, n.events ?? {}, y);
|
|
1082
1082
|
if (n.name === "slot")
|
|
1083
|
-
return Gt(t, n, P,
|
|
1084
|
-
m && Object.assign(P,
|
|
1083
|
+
return Gt(t, n, P, y, s);
|
|
1084
|
+
m && Object.assign(P, y.__parseExpression(m.value)), h && (P.style = Object.assign(
|
|
1085
1085
|
P.style ?? {},
|
|
1086
|
-
Wt(h,
|
|
1087
|
-
)), g && Object.assign(P, Qt(g,
|
|
1088
|
-
Object.assign(P, Xt(t,
|
|
1086
|
+
Wt(h, y)
|
|
1087
|
+
)), g && Object.assign(P, Qt(g, y)), d.forEach((j) => {
|
|
1088
|
+
Ce.includes(n.name) ? Object.assign(P, Xt(j, y)) : Object.assign(P, Yt(t, j, y));
|
|
1089
1089
|
});
|
|
1090
|
-
const
|
|
1090
|
+
const qe = Zt(
|
|
1091
1091
|
t,
|
|
1092
1092
|
n.children ?? [],
|
|
1093
|
-
|
|
1093
|
+
y,
|
|
1094
1094
|
s,
|
|
1095
1095
|
n
|
|
1096
|
-
), he =
|
|
1096
|
+
), he = y?.__id ? `data-v-${y.__id}` : void 0, Je = he ? { [he]: "" } : {};
|
|
1097
1097
|
let Q = t.createVNode(
|
|
1098
1098
|
W,
|
|
1099
|
-
{ key: `${i}_${S}`, ...
|
|
1100
|
-
|
|
1099
|
+
{ key: `${i}_${S}`, ...Je, ...P, ...Ue },
|
|
1100
|
+
qe
|
|
1101
1101
|
);
|
|
1102
|
-
const me = a ? Lt(a,
|
|
1102
|
+
const me = a ? Lt(a, v, y) : [];
|
|
1103
1103
|
return me.length && (Q = t.withDirectives(Q, me)), Q;
|
|
1104
1104
|
};
|
|
1105
|
-
return p ?
|
|
1105
|
+
return p ? ss(p, _, e) : _(e);
|
|
1106
1106
|
}
|
|
1107
1107
|
function Lt(n, e, t) {
|
|
1108
1108
|
const s = n.app;
|
|
@@ -1113,13 +1113,13 @@ function Lt(n, e, t) {
|
|
|
1113
1113
|
return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
|
|
1114
1114
|
}).filter((r) => !!r);
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function xe(n = []) {
|
|
1117
1117
|
const e = n.find((f) => C(f.name) === "vIf"), t = n.find(
|
|
1118
1118
|
(f) => C(f.name) === "vElseIf"
|
|
1119
1119
|
), s = n.find((f) => C(f.name) === "vElse"), r = n.find((f) => C(f.name) === "vFor"), o = n.find((f) => C(f.name) === "vShow"), a = n.find((f) => C(f.name) === "vBind"), i = n.find((f) => C(f.name) === "vHtml"), l = n.filter(
|
|
1120
1120
|
(f) => C(f.name) === "vModel"
|
|
1121
1121
|
), c = n.filter(
|
|
1122
|
-
(f) => !
|
|
1122
|
+
(f) => !rt.includes(C(f.name))
|
|
1123
1123
|
);
|
|
1124
1124
|
return {
|
|
1125
1125
|
vIf: e,
|
|
@@ -1165,7 +1165,7 @@ function Kt(n, e, t) {
|
|
|
1165
1165
|
};
|
|
1166
1166
|
return Object.keys(e || {}).reduce(
|
|
1167
1167
|
(o, a) => {
|
|
1168
|
-
const i = e[a], l =
|
|
1168
|
+
const i = e[a], l = De(i.modifiers), c = l.find((p) => s.includes(p)), f = "on" + Ze(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
|
|
1169
1169
|
return u && (o[f] = n.withModifiers(
|
|
1170
1170
|
l.includes("enter") ? Jt(u, "enter") : u,
|
|
1171
1171
|
l
|
|
@@ -1177,27 +1177,27 @@ 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: l, vElse: c } =
|
|
1180
|
+
const { directives: i = [] } = r[a], { vElseIf: l, vElse: c } = xe(i);
|
|
1181
1181
|
if (l) {
|
|
1182
1182
|
if (e.__parseExpression(l.value))
|
|
1183
|
-
return
|
|
1183
|
+
return M(r[a], e, t, s, r, !0);
|
|
1184
1184
|
continue;
|
|
1185
1185
|
}
|
|
1186
1186
|
if (c)
|
|
1187
|
-
return
|
|
1187
|
+
return M(r[a], e, t, s, r, !0);
|
|
1188
1188
|
}
|
|
1189
1189
|
return null;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function De(n = {}, e = !1) {
|
|
1192
1192
|
const t = Object.keys(n);
|
|
1193
1193
|
return e ? t.map((s) => "." + s) : t;
|
|
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
1197
|
return i ? i(t) : o ? I(o) ? n.createTextVNode(o) : E(o) ? n.createTextVNode(
|
|
1198
|
-
|
|
1198
|
+
Ae(s.__parseExpression(o))
|
|
1199
1199
|
) : Array.isArray(o) ? o.map(
|
|
1200
|
-
(l) =>
|
|
1200
|
+
(l) => M(l, s, n, r, o)
|
|
1201
1201
|
) : null : null;
|
|
1202
1202
|
}
|
|
1203
1203
|
function Vt(n, e) {
|
|
@@ -1217,13 +1217,25 @@ function Qt(n, e) {
|
|
|
1217
1217
|
innerHTML: e.__parseExpression(n.value) || ""
|
|
1218
1218
|
};
|
|
1219
1219
|
}
|
|
1220
|
-
function Xt(n, e
|
|
1220
|
+
function Xt(n, e) {
|
|
1221
|
+
const t = {
|
|
1222
|
+
type: "JSFunction",
|
|
1223
|
+
value: n.value?.value ? `(v) => {
|
|
1224
|
+
${n.value.value} = v?.target.value;
|
|
1225
|
+
}` : "(v) => {}"
|
|
1226
|
+
};
|
|
1227
|
+
return {
|
|
1228
|
+
[E(n.arg) ? e.__parseExpression(n.arg) : n.arg || "value"]: e.__parseExpression(n.value),
|
|
1229
|
+
onInput: e.__parseFunction(t)
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
function Yt(n, e, t) {
|
|
1221
1233
|
const s = {
|
|
1222
1234
|
type: "JSFunction",
|
|
1223
1235
|
value: e.value?.value ? `(v) => {
|
|
1224
1236
|
${e.value.value} = v;
|
|
1225
1237
|
}` : "(v) => {}"
|
|
1226
|
-
}, r = t.__parseFunction(s), o =
|
|
1238
|
+
}, r = t.__parseFunction(s), o = De(
|
|
1227
1239
|
E(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
|
1228
1240
|
), a = E(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
1229
1241
|
return {
|
|
@@ -1231,25 +1243,25 @@ function Xt(n, e, t) {
|
|
|
1231
1243
|
[`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
|
|
1232
1244
|
};
|
|
1233
1245
|
}
|
|
1234
|
-
function
|
|
1246
|
+
function Zt(n, e, t, s, r) {
|
|
1235
1247
|
if (!e) return null;
|
|
1236
1248
|
if (I(e))
|
|
1237
1249
|
return { default: () => e };
|
|
1238
1250
|
if (E(e))
|
|
1239
1251
|
return {
|
|
1240
|
-
default: () =>
|
|
1252
|
+
default: () => Ae(t.__parseExpression(e))
|
|
1241
1253
|
};
|
|
1242
1254
|
if (Array.isArray(e) && e.length > 0) {
|
|
1243
|
-
const o =
|
|
1255
|
+
const o = es(e), a = (i, l) => !i || !r ? {} : r?.id && Object.keys(i).length ? l ? {
|
|
1244
1256
|
[l]: i
|
|
1245
1257
|
} : {
|
|
1246
1258
|
[`scope_${r.id}`]: i
|
|
1247
1259
|
} : l ? { [l]: /* @__PURE__ */ Object.create(null) } : {};
|
|
1248
1260
|
return Object.entries(o).reduce(
|
|
1249
1261
|
(i, [l, { nodes: c, params: f, scope: u }]) => (i[l] = (p) => {
|
|
1250
|
-
const h = f.length ?
|
|
1262
|
+
const h = f.length ? et(p ?? {}, f) : a(p, u);
|
|
1251
1263
|
return c.map(
|
|
1252
|
-
(d) =>
|
|
1264
|
+
(d) => M(d, t.__clone(h), n, s, c)
|
|
1253
1265
|
);
|
|
1254
1266
|
}, i),
|
|
1255
1267
|
{}
|
|
@@ -1257,10 +1269,10 @@ function Yt(n, e, t, s, r) {
|
|
|
1257
1269
|
}
|
|
1258
1270
|
return null;
|
|
1259
1271
|
}
|
|
1260
|
-
function
|
|
1272
|
+
function es(n) {
|
|
1261
1273
|
const e = {};
|
|
1262
1274
|
for (const t of n) {
|
|
1263
|
-
const s =
|
|
1275
|
+
const s = ts(t.slot), r = s.name;
|
|
1264
1276
|
e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params), e[r].scope = s.scope || "") : e[r] = {
|
|
1265
1277
|
nodes: [t],
|
|
1266
1278
|
params: s.params,
|
|
@@ -1269,10 +1281,10 @@ function Zt(n) {
|
|
|
1269
1281
|
}
|
|
1270
1282
|
return e;
|
|
1271
1283
|
}
|
|
1272
|
-
function
|
|
1284
|
+
function ts(n = "default") {
|
|
1273
1285
|
return I(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
|
|
1274
1286
|
}
|
|
1275
|
-
function
|
|
1287
|
+
function ss(n, e, t) {
|
|
1276
1288
|
const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
|
|
1277
1289
|
let i = t.__parseExpression(s) || [];
|
|
1278
1290
|
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
|
@@ -1280,7 +1292,7 @@ function ts(n, e, t) {
|
|
|
1280
1292
|
const ee = Re({
|
|
1281
1293
|
name: "VtjPageContainer",
|
|
1282
1294
|
async setup() {
|
|
1283
|
-
const n =
|
|
1295
|
+
const n = Le(), e = Pe(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = oe(Symbol());
|
|
1284
1296
|
if (s) {
|
|
1285
1297
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
|
1286
1298
|
const { useTitle: a } = n?.adapter;
|
|
@@ -1306,7 +1318,7 @@ const ee = Re({
|
|
|
1306
1318
|
activated() {
|
|
1307
1319
|
this.meta.cache === !1 && (this.sid = Symbol());
|
|
1308
1320
|
}
|
|
1309
|
-
}),
|
|
1321
|
+
}), ns = Re({
|
|
1310
1322
|
name: "VtjStartupContainer",
|
|
1311
1323
|
render() {
|
|
1312
1324
|
return re("div", "page not found!");
|
|
@@ -1333,28 +1345,28 @@ function K(n, e, t = []) {
|
|
|
1333
1345
|
}
|
|
1334
1346
|
return s;
|
|
1335
1347
|
}
|
|
1336
|
-
function
|
|
1348
|
+
function He(n, e) {
|
|
1337
1349
|
if (!e) return n;
|
|
1338
1350
|
let t = [];
|
|
1339
1351
|
for (const s of n)
|
|
1340
1352
|
if (s.children && s.children.length) {
|
|
1341
|
-
const r =
|
|
1353
|
+
const r = He(s.children, e);
|
|
1342
1354
|
r.length && (s.children = r, t.push(s));
|
|
1343
1355
|
} else
|
|
1344
1356
|
e.can(s.id.toString()) && t.push(s);
|
|
1345
1357
|
return t;
|
|
1346
1358
|
}
|
|
1347
|
-
function
|
|
1359
|
+
function Fs(n) {
|
|
1348
1360
|
const {
|
|
1349
1361
|
menuPathPrefix: e = "",
|
|
1350
1362
|
pageRouteName: t = "page",
|
|
1351
1363
|
disableMenusFilter: s = !1
|
|
1352
|
-
} = n || {}, r =
|
|
1364
|
+
} = n || {}, r = Le(), o = Pe(), a = $t(), i = oe(!1), l = oe(!1), c = r.project, f = (h, d) => {
|
|
1353
1365
|
i.value = !h?.mask, l.value = d?.pure ?? !!h?.pure;
|
|
1354
1366
|
};
|
|
1355
|
-
|
|
1367
|
+
nt(() => {
|
|
1356
1368
|
const { name: h, params: d, meta: m } = o;
|
|
1357
|
-
if (h ===
|
|
1369
|
+
if (h === x) {
|
|
1358
1370
|
const g = r.getPage(d.id);
|
|
1359
1371
|
f(g, m);
|
|
1360
1372
|
} else if (h === N) {
|
|
@@ -1363,8 +1375,8 @@ function Is(n) {
|
|
|
1363
1375
|
} else {
|
|
1364
1376
|
const g = m.__vtj__;
|
|
1365
1377
|
if (g) {
|
|
1366
|
-
const
|
|
1367
|
-
f(
|
|
1378
|
+
const v = r.getPage(g);
|
|
1379
|
+
f(v, m);
|
|
1368
1380
|
} else
|
|
1369
1381
|
i.value = !m.mask, l.value = !!m.pure;
|
|
1370
1382
|
}
|
|
@@ -1379,7 +1391,7 @@ function Is(n) {
|
|
|
1379
1391
|
logo: p?.logo,
|
|
1380
1392
|
themeSwitchable: p?.themeSwitchable,
|
|
1381
1393
|
title: p?.title || c?.description || c?.name || "VTJ App",
|
|
1382
|
-
menus: s ? u :
|
|
1394
|
+
menus: s ? u : He(u, a),
|
|
1383
1395
|
pure: l
|
|
1384
1396
|
};
|
|
1385
1397
|
}
|
|
@@ -1429,7 +1441,7 @@ function le(n) {
|
|
|
1429
1441
|
homepage: i,
|
|
1430
1442
|
loader: o,
|
|
1431
1443
|
pages: d || []
|
|
1432
|
-
}),
|
|
1444
|
+
}), v = {
|
|
1433
1445
|
name: `layout_${f}`,
|
|
1434
1446
|
path: t,
|
|
1435
1447
|
component: () => o(f),
|
|
@@ -1441,7 +1453,7 @@ function le(n) {
|
|
|
1441
1453
|
},
|
|
1442
1454
|
children: g
|
|
1443
1455
|
};
|
|
1444
|
-
l.push(
|
|
1456
|
+
l.push(v), l.push(te(c, n));
|
|
1445
1457
|
} else if (l.push(te(c, n)), i === f) {
|
|
1446
1458
|
const g = te(c, n);
|
|
1447
1459
|
g.path = "", g.name = `home_${f}`, l.push(g);
|
|
@@ -1449,20 +1461,20 @@ function le(n) {
|
|
|
1449
1461
|
}
|
|
1450
1462
|
return l;
|
|
1451
1463
|
}
|
|
1452
|
-
function
|
|
1464
|
+
function rs(n = {}, e) {
|
|
1453
1465
|
const { css: t, store: s, enhance: r } = n, { window: o, app: a, library: i = {}, adapter: l, mode: c } = e, { Pinia: f } = i;
|
|
1454
|
-
a.config.globalProperties.$libs = i, fe(o, "global-css", t || ""), f && s &&
|
|
1466
|
+
a.config.globalProperties.$libs = i, fe(o, "global-css", t || ""), f && s && os(s, a, f), as(a, l, n), !l.access && n.access && is(n.access, a, c, l), cs(a, n), r && ls(r, a, i);
|
|
1455
1467
|
}
|
|
1456
|
-
function
|
|
1468
|
+
function os(n, e, t) {
|
|
1457
1469
|
const s = t.createPinia();
|
|
1458
1470
|
if (e.use(s), b(n) && n.value) {
|
|
1459
|
-
const r =
|
|
1471
|
+
const r = R(n, {}, !1, !1, !0), o = t.defineStore("$store", r(e) || {});
|
|
1460
1472
|
e.config.globalProperties.$store = o();
|
|
1461
1473
|
}
|
|
1462
1474
|
}
|
|
1463
|
-
function
|
|
1475
|
+
function is(n, e, t, s) {
|
|
1464
1476
|
if (b(n) && n.value) {
|
|
1465
|
-
const r =
|
|
1477
|
+
const r = R(n, {}, !1, !1, !0), { alert: o, request: a } = s, i = new pe({
|
|
1466
1478
|
alert: o,
|
|
1467
1479
|
storagePrefix: "__VTJ_APP_",
|
|
1468
1480
|
...r(e)
|
|
@@ -1470,37 +1482,37 @@ function os(n, e, t, s) {
|
|
|
1470
1482
|
i.connect({ mode: t, router: l, request: a }), e.use(i);
|
|
1471
1483
|
}
|
|
1472
1484
|
}
|
|
1473
|
-
function
|
|
1485
|
+
function as(n, e, t) {
|
|
1474
1486
|
if (!e.request) return;
|
|
1475
1487
|
const { axios: s, request: r, response: o } = t;
|
|
1476
1488
|
if (s && b(s) && s.value) {
|
|
1477
|
-
const a =
|
|
1489
|
+
const a = R(s, {}, !1, !1, !0);
|
|
1478
1490
|
e.request.setConfig(a(n));
|
|
1479
1491
|
}
|
|
1480
1492
|
if (r && b(r) && r.value) {
|
|
1481
|
-
const a =
|
|
1493
|
+
const a = R(r, {}, !1, !1, !0), i = e.request;
|
|
1482
1494
|
i.__unReq && i.__unReq(), i.__unReq = e.request.useRequest((l) => a(l, n));
|
|
1483
1495
|
}
|
|
1484
1496
|
if (o && b(o) && o.value) {
|
|
1485
|
-
const a =
|
|
1497
|
+
const a = R(o, {}, !1, !1, !0), i = e.request;
|
|
1486
1498
|
i.__unRes && i.__unRes(), i.__unRes = e.request.useResponse((l) => a(l, n));
|
|
1487
1499
|
}
|
|
1488
1500
|
}
|
|
1489
|
-
function
|
|
1501
|
+
function cs(n, e) {
|
|
1490
1502
|
const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
|
|
1491
1503
|
if (t && b(t) && t.value) {
|
|
1492
|
-
const o =
|
|
1504
|
+
const o = R(t, {}, !1, !1, !0);
|
|
1493
1505
|
r && r.beforeEach((a, i, l) => o(a, i, l, n));
|
|
1494
1506
|
}
|
|
1495
1507
|
if (s && b(s) && s.value) {
|
|
1496
|
-
const o =
|
|
1508
|
+
const o = R(s, {}, !1, !1, !0);
|
|
1497
1509
|
r && r.afterEach((a, i, l) => o(a, i, l, n));
|
|
1498
1510
|
}
|
|
1499
1511
|
}
|
|
1500
|
-
function
|
|
1501
|
-
b(n) && n.value &&
|
|
1512
|
+
function ls(n, e, t = {}) {
|
|
1513
|
+
b(n) && n.value && R(n, {}, !1, !1, !0)(e, t);
|
|
1502
1514
|
}
|
|
1503
|
-
function
|
|
1515
|
+
function us(n, e, t) {
|
|
1504
1516
|
if (!n || !e || !t) return;
|
|
1505
1517
|
const { VueI18n: s } = e;
|
|
1506
1518
|
if (s) {
|
|
@@ -1519,9 +1531,9 @@ function ls(n, e, t) {
|
|
|
1519
1531
|
n.use(l);
|
|
1520
1532
|
}
|
|
1521
1533
|
}
|
|
1522
|
-
const
|
|
1523
|
-
var
|
|
1524
|
-
class
|
|
1534
|
+
const Be = Symbol("Provider");
|
|
1535
|
+
var fs = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(fs || {});
|
|
1536
|
+
class ps extends Ke {
|
|
1525
1537
|
/**
|
|
1526
1538
|
* 创建Provider实例
|
|
1527
1539
|
* @param options 配置选项
|
|
@@ -1609,7 +1621,7 @@ class fs extends Je {
|
|
|
1609
1621
|
if (this.project = s ? await s() : await this.service.init(e), !this.project)
|
|
1610
1622
|
throw new Error("project is null");
|
|
1611
1623
|
const { apis: r = [], meta: o = [], env: a = [] } = this.project, i = window;
|
|
1612
|
-
i && (i.CKEDITOR_VERSION = void 0), this.initEnv(a), this.mode === w.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = jt(r, o, this.adapter),
|
|
1624
|
+
i && (i.CKEDITOR_VERSION = void 0), this.initEnv(a), this.mode === w.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = jt(r, o, this.adapter), Oe(i), Rt(r, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
|
1613
1625
|
}
|
|
1614
1626
|
initMock(e) {
|
|
1615
1627
|
const t = D(e);
|
|
@@ -1645,31 +1657,31 @@ class fs extends Je {
|
|
|
1645
1657
|
);
|
|
1646
1658
|
Object.assign(this.libraryLocaleMap, d);
|
|
1647
1659
|
for (const m of c) {
|
|
1648
|
-
const g = s[m],
|
|
1649
|
-
if (
|
|
1650
|
-
r[m] =
|
|
1660
|
+
const g = s[m], v = e[m];
|
|
1661
|
+
if (v)
|
|
1662
|
+
r[m] = v;
|
|
1651
1663
|
else if (g)
|
|
1652
1664
|
e[m] = r[m] = await g();
|
|
1653
1665
|
else {
|
|
1654
|
-
const
|
|
1655
|
-
for (const S of
|
|
1656
|
-
G(S) && await gt(S,
|
|
1666
|
+
const y = f[m] || [];
|
|
1667
|
+
for (const S of y)
|
|
1668
|
+
G(S) && await gt(S, k.append(S, { v: T })), V(S) && await _e(k.append(S, { v: T }));
|
|
1657
1669
|
r[m] = e[m];
|
|
1658
1670
|
}
|
|
1659
1671
|
const _ = d[m];
|
|
1660
1672
|
if (_) {
|
|
1661
|
-
const
|
|
1662
|
-
l[_] =
|
|
1673
|
+
const y = s[_];
|
|
1674
|
+
l[_] = y ? await y() : e[_];
|
|
1663
1675
|
}
|
|
1664
1676
|
}
|
|
1665
1677
|
if (i === "development") {
|
|
1666
1678
|
for (const g of u)
|
|
1667
|
-
await _e(
|
|
1679
|
+
await _e(k.append(g, { v: T }));
|
|
1668
1680
|
const m = this.materials || {};
|
|
1669
1681
|
for (const g of p) {
|
|
1670
|
-
const
|
|
1671
|
-
if (
|
|
1672
|
-
_ &&
|
|
1682
|
+
const v = e[h[g]], _ = v?.default || v, y = ze[g];
|
|
1683
|
+
if (y)
|
|
1684
|
+
_ && y.forEach((S) => {
|
|
1673
1685
|
o[S] = _[S];
|
|
1674
1686
|
});
|
|
1675
1687
|
else {
|
|
@@ -1690,15 +1702,15 @@ class fs extends Je {
|
|
|
1690
1702
|
routeMeta: l
|
|
1691
1703
|
} = s, c = a ? "" : "/", f = {
|
|
1692
1704
|
path: `${c}${i}/:id`,
|
|
1693
|
-
name:
|
|
1705
|
+
name: x,
|
|
1694
1706
|
component: ee
|
|
1695
1707
|
}, u = {
|
|
1696
1708
|
path: c,
|
|
1697
1709
|
name: N,
|
|
1698
|
-
component: t?.homepage ? ee : r.startupComponent ||
|
|
1710
|
+
component: t?.homepage ? ee : r.startupComponent || ns,
|
|
1699
1711
|
meta: l
|
|
1700
1712
|
};
|
|
1701
|
-
if (e.hasRoute(
|
|
1713
|
+
if (e.hasRoute(x) && e.removeRoute(x), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
|
|
1702
1714
|
const p = t?.pages || [];
|
|
1703
1715
|
le({
|
|
1704
1716
|
name: i,
|
|
@@ -1714,7 +1726,7 @@ class fs extends Je {
|
|
|
1714
1726
|
a ? (e.addRoute(a, f), e.addRoute(a, u)) : (e.addRoute(f), e.addRoute(u));
|
|
1715
1727
|
}
|
|
1716
1728
|
setErrorHandler(e) {
|
|
1717
|
-
e.config.errorHandler =
|
|
1729
|
+
e.config.errorHandler = tt((t, s, r) => {
|
|
1718
1730
|
const o = s?.$options.name, a = typeof t == "string" ? t : t?.message || t?.msg || "未知错误", i = `[ ${o} ] ${a} ${r}`;
|
|
1719
1731
|
["getComputedStyle", "ResizeObserver"].some((c) => i.includes(c)) || (console.error(
|
|
1720
1732
|
"[VTJ Error]:",
|
|
@@ -1740,11 +1752,11 @@ class fs extends Je {
|
|
|
1740
1752
|
install(e) {
|
|
1741
1753
|
const { libraryLocaleMap: t, libraryLocales: s } = this, { libraryOptions: r = {} } = this.options, o = e.config.globalProperties.installed || {};
|
|
1742
1754
|
for (const [a, i] of Object.entries(this.library))
|
|
1743
|
-
if (!o[a] &&
|
|
1755
|
+
if (!o[a] && vt(i)) {
|
|
1744
1756
|
const c = { locale: s[t[a]] }, f = r[a] || {}, u = { ...c, ...f };
|
|
1745
1757
|
e.use(i, u), o[a] = !0;
|
|
1746
1758
|
}
|
|
1747
|
-
e.provide(
|
|
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 || {}, {
|
|
1748
1760
|
app: e,
|
|
1749
1761
|
window,
|
|
1750
1762
|
adapter: this.adapter,
|
|
@@ -1865,7 +1877,7 @@ class fs extends Je {
|
|
|
1865
1877
|
* @returns Vue异步组件
|
|
1866
1878
|
*/
|
|
1867
1879
|
definePluginComponent(e) {
|
|
1868
|
-
return we(async () => await
|
|
1880
|
+
return we(async () => await Te(e, window));
|
|
1869
1881
|
}
|
|
1870
1882
|
/**
|
|
1871
1883
|
* 设置应用全局
|
|
@@ -1880,10 +1892,10 @@ class fs extends Je {
|
|
|
1880
1892
|
},
|
|
1881
1893
|
t
|
|
1882
1894
|
);
|
|
1883
|
-
|
|
1895
|
+
rs(e, s);
|
|
1884
1896
|
}
|
|
1885
1897
|
initI18n(e, t, s) {
|
|
1886
|
-
|
|
1898
|
+
us(e, t, s);
|
|
1887
1899
|
}
|
|
1888
1900
|
initEnv(e = []) {
|
|
1889
1901
|
this.env = e.reduce(
|
|
@@ -1893,14 +1905,14 @@ class fs extends Je {
|
|
|
1893
1905
|
}
|
|
1894
1906
|
}
|
|
1895
1907
|
function ks(n) {
|
|
1896
|
-
const e = new
|
|
1908
|
+
const e = new ps(n);
|
|
1897
1909
|
return {
|
|
1898
1910
|
provider: e,
|
|
1899
1911
|
onReady: (s) => e.ready(s)
|
|
1900
1912
|
};
|
|
1901
1913
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const e = je(
|
|
1914
|
+
function Le(n = {}) {
|
|
1915
|
+
const e = je(Be, null);
|
|
1904
1916
|
if (!e)
|
|
1905
1917
|
throw new Error("Can not find provider");
|
|
1906
1918
|
if (e.nodeEnv === "development") {
|
|
@@ -1916,21 +1928,21 @@ function Be(n = {}) {
|
|
|
1916
1928
|
}
|
|
1917
1929
|
return e;
|
|
1918
1930
|
}
|
|
1919
|
-
async function
|
|
1931
|
+
async function Os(n, e = "") {
|
|
1920
1932
|
const { name: t, urls: s = [] } = n || {}, r = s.map((i) => e + i), { css: o, js: a } = ft(r);
|
|
1921
|
-
if (o.length &&
|
|
1922
|
-
return await
|
|
1933
|
+
if (o.length && Ie(o), a.length)
|
|
1934
|
+
return await Fe(a, t).catch(
|
|
1923
1935
|
() => {
|
|
1924
1936
|
}
|
|
1925
1937
|
);
|
|
1926
1938
|
}
|
|
1927
|
-
const
|
|
1939
|
+
const Ne = {
|
|
1928
1940
|
type: "json",
|
|
1929
1941
|
validSuccess: !0,
|
|
1930
1942
|
originResponse: !1,
|
|
1931
1943
|
failMessage: !0,
|
|
1932
1944
|
validate: (n) => n.data?.code === 0
|
|
1933
|
-
},
|
|
1945
|
+
}, ds = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
|
|
1934
1946
|
url: e,
|
|
1935
1947
|
method: "post",
|
|
1936
1948
|
params: { type: t },
|
|
@@ -1939,8 +1951,8 @@ const Le = {
|
|
|
1939
1951
|
type: t,
|
|
1940
1952
|
data: s
|
|
1941
1953
|
},
|
|
1942
|
-
settings:
|
|
1943
|
-
}),
|
|
1954
|
+
settings: Ne
|
|
1955
|
+
}), hs = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
|
|
1944
1956
|
url: e,
|
|
1945
1957
|
method: "post",
|
|
1946
1958
|
data: {
|
|
@@ -1948,11 +1960,11 @@ const Le = {
|
|
|
1948
1960
|
projectId: s
|
|
1949
1961
|
},
|
|
1950
1962
|
settings: {
|
|
1951
|
-
...
|
|
1963
|
+
...Ne,
|
|
1952
1964
|
type: "data"
|
|
1953
1965
|
}
|
|
1954
1966
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
|
1955
|
-
function
|
|
1967
|
+
function Ms(n) {
|
|
1956
1968
|
return be({
|
|
1957
1969
|
settings: {
|
|
1958
1970
|
type: "json",
|
|
@@ -1968,7 +1980,7 @@ function Os(n) {
|
|
|
1968
1980
|
}
|
|
1969
1981
|
class de {
|
|
1970
1982
|
constructor(e = ne) {
|
|
1971
|
-
this.req = e, this.api =
|
|
1983
|
+
this.req = e, this.api = ds(e), this.uploader = hs(e);
|
|
1972
1984
|
}
|
|
1973
1985
|
api;
|
|
1974
1986
|
pluginCaches = {};
|
|
@@ -2068,12 +2080,12 @@ class de {
|
|
|
2068
2080
|
return console.log("BaseService.genSource", e), "";
|
|
2069
2081
|
}
|
|
2070
2082
|
}
|
|
2071
|
-
const $ = new
|
|
2083
|
+
const $ = new st({
|
|
2072
2084
|
type: "local",
|
|
2073
2085
|
expired: 0,
|
|
2074
2086
|
prefix: "__VTJ_"
|
|
2075
2087
|
});
|
|
2076
|
-
class
|
|
2088
|
+
class Ts extends de {
|
|
2077
2089
|
init(e) {
|
|
2078
2090
|
const t = new U(e), s = $.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
|
2079
2091
|
return $.save(`project_${t.id}`, r), Promise.resolve(r);
|
|
@@ -2123,7 +2135,7 @@ class xs extends de {
|
|
|
2123
2135
|
}), Promise.resolve(!0);
|
|
2124
2136
|
}
|
|
2125
2137
|
}
|
|
2126
|
-
class
|
|
2138
|
+
class ms extends de {
|
|
2127
2139
|
projects = {};
|
|
2128
2140
|
materials = {};
|
|
2129
2141
|
files = {};
|
|
@@ -2181,10 +2193,10 @@ class hs extends de {
|
|
|
2181
2193
|
}
|
|
2182
2194
|
}
|
|
2183
2195
|
let L = null;
|
|
2184
|
-
function
|
|
2185
|
-
return L || (L = new
|
|
2196
|
+
function xs() {
|
|
2197
|
+
return L || (L = new ms(), L);
|
|
2186
2198
|
}
|
|
2187
|
-
class
|
|
2199
|
+
class Ds extends de {
|
|
2188
2200
|
getFileCaches = {};
|
|
2189
2201
|
async getExtension() {
|
|
2190
2202
|
return await this.api("getExtension", {}).catch(() => {
|
|
@@ -2242,40 +2254,40 @@ class Ts extends de {
|
|
|
2242
2254
|
}
|
|
2243
2255
|
}
|
|
2244
2256
|
export {
|
|
2245
|
-
|
|
2257
|
+
$s as ACCESS,
|
|
2246
2258
|
ke as ACCESS_KEY,
|
|
2247
2259
|
pe as Access,
|
|
2248
2260
|
it as BUILD_IN_TAGS,
|
|
2249
|
-
|
|
2261
|
+
rt as BUILT_IN_DIRECTIVES,
|
|
2250
2262
|
de as BaseService,
|
|
2251
2263
|
Se as CONTEXT_HOST,
|
|
2252
2264
|
At as Context,
|
|
2253
2265
|
w as ContextMode,
|
|
2254
|
-
|
|
2266
|
+
ot as DATA_TYPES,
|
|
2255
2267
|
N as HOMEPAGE_ROUTE_NAME,
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
+
Ce as HTML_TAGS,
|
|
2269
|
+
Ps as JSCodeToString,
|
|
2270
|
+
ws as LIFE_CYCLES_LIST,
|
|
2271
|
+
Ds as LocalService,
|
|
2272
|
+
ms as MemoryService,
|
|
2273
|
+
fs as NodeEnv,
|
|
2274
|
+
x as PAGE_ROUTE_NAME,
|
|
2275
|
+
ps as Provider,
|
|
2276
|
+
Ss as REMOTE,
|
|
2277
|
+
Ts as StorageService,
|
|
2278
|
+
T as VTJ_RENDERER_VERSION,
|
|
2279
|
+
js as adoptStylesToInline,
|
|
2268
2280
|
fe as adoptedStyleSheets,
|
|
2269
|
-
|
|
2281
|
+
Is as clearLoaderCache,
|
|
2270
2282
|
pt as compileScopedCSS,
|
|
2271
2283
|
mt as convertCssRpx,
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2284
|
+
As as createAccess,
|
|
2285
|
+
Cs as createAdapter,
|
|
2286
|
+
bs as createAssetScripts,
|
|
2287
|
+
Es as createAssetsCss,
|
|
2288
|
+
xt as createDataSources,
|
|
2277
2289
|
ae as createLoader,
|
|
2278
|
-
|
|
2290
|
+
xs as createMemoryService,
|
|
2279
2291
|
K as createMenus,
|
|
2280
2292
|
Et as createMetaApi,
|
|
2281
2293
|
Pt as createMock,
|
|
@@ -2283,14 +2295,14 @@ export {
|
|
|
2283
2295
|
ie as createRenderer,
|
|
2284
2296
|
bt as createSchemaApi,
|
|
2285
2297
|
jt as createSchemaApis,
|
|
2286
|
-
|
|
2298
|
+
Ms as createServiceRequest,
|
|
2287
2299
|
Bt as defaultLoader,
|
|
2288
2300
|
B as fillBasePath,
|
|
2289
2301
|
D as getMock,
|
|
2290
|
-
|
|
2291
|
-
|
|
2302
|
+
De as getModifiers,
|
|
2303
|
+
Te as getPlugin,
|
|
2292
2304
|
ut as getRawComponent,
|
|
2293
|
-
|
|
2305
|
+
yt as isBuiltInTag,
|
|
2294
2306
|
G as isCSSUrl,
|
|
2295
2307
|
wt as isJSCode,
|
|
2296
2308
|
E as isJSExpression,
|
|
@@ -2298,26 +2310,26 @@ export {
|
|
|
2298
2310
|
at as isJSON,
|
|
2299
2311
|
V as isJSUrl,
|
|
2300
2312
|
_t as isNativeTag,
|
|
2301
|
-
|
|
2313
|
+
vt as isVuePlugin,
|
|
2302
2314
|
gt as loadCss,
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2315
|
+
Ie as loadCssUrl,
|
|
2316
|
+
Os as loadEnhance,
|
|
2317
|
+
Fe as loadScriptUrl,
|
|
2318
|
+
He as menusFilter,
|
|
2307
2319
|
Ct as mockApi,
|
|
2308
2320
|
Rt as mockApis,
|
|
2309
|
-
|
|
2310
|
-
|
|
2321
|
+
Oe as mockCleanup,
|
|
2322
|
+
M as nodeRender,
|
|
2311
2323
|
lt as parseDeps,
|
|
2312
2324
|
H as parseExpression,
|
|
2313
|
-
|
|
2325
|
+
R as parseFunction,
|
|
2314
2326
|
ft as parseUrls,
|
|
2315
|
-
|
|
2327
|
+
Be as providerKey,
|
|
2316
2328
|
ct as removeProdFlag,
|
|
2317
2329
|
ht as rpxToPx,
|
|
2318
|
-
|
|
2319
|
-
|
|
2330
|
+
Rs as setupPageSetting,
|
|
2331
|
+
Ae as toString,
|
|
2320
2332
|
$t as useAccess,
|
|
2321
|
-
|
|
2322
|
-
|
|
2333
|
+
Fs as useMask,
|
|
2334
|
+
Le as useProvider
|
|
2323
2335
|
};
|