@vtj/renderer 0.9.23 → 0.9.25
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 +6 -6
- package/dist/index.mjs +228 -224
- package/package.json +5 -5
- package/types/render/loader.d.ts +1 -0
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
import { Base as Ie, BUILT_IN_COMPONENTS as Me, ProjectModel as O, HistoryModel as de } from "@vtj/core";
|
2
2
|
import { isUrl as De, url as x, dedupArray as He, isString as j, isFunction as z, logger as P, storage as L, cookie as q, toArray as ie, unRSA as oe, delay as pe, createRequest as fe, jsonp as he, merge as Oe, pathToRegexp as Be, pathToRegexpMatch as Ne, formDataToJson as Ue, camelCase as $, upperFirst as Le, pick as qe, request as K, loadScript as ae, Storage as Je, mapToObject as X } from "@vtj/utils";
|
3
3
|
import * as N from "vue";
|
4
|
-
import { inject as me, toRef as Ve, readonly as ze, customRef as Ke, ref as
|
5
|
-
import
|
4
|
+
import { inject as me, toRef as Ve, readonly as ze, customRef as Ke, ref as F, onBeforeUnmount as We, getCurrentScope as Ge, onScopeDispose as Ye, getCurrentInstance as ge, watch as ye, computed as ve, toValue as Z, onMounted as Qe, defineComponent as ee, h as W, openBlock as Xe, createElementBlock as Ze, createElementVNode as E, toDisplayString as J, defineAsyncComponent as ce, watchEffect as et } from "vue";
|
5
|
+
import R from "mockjs";
|
6
6
|
import { useRoute as _e } from "vue-router";
|
7
7
|
/**!
|
8
8
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
9
9
|
* @name @vtj/renderer
|
10
10
|
* @author CHC chenhuachun1549@dingtalk.com
|
11
|
-
* @version 0.9.
|
11
|
+
* @version 0.9.25
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
13
13
|
*/
|
14
|
-
const C = "0.9.
|
15
|
-
var
|
14
|
+
const C = "0.9.25";
|
15
|
+
var v = /* @__PURE__ */ ((s) => (s.Runtime = "Runtime", s.Design = "Design", s.Raw = "Raw", s.VNode = "VNode", s))(v || {});
|
16
16
|
const le = [
|
17
17
|
"$el",
|
18
18
|
"$emit",
|
@@ -39,14 +39,14 @@ const le = [
|
|
39
39
|
"renderTriggered",
|
40
40
|
"activated",
|
41
41
|
"deactivated"
|
42
|
-
],
|
42
|
+
], tt = [
|
43
43
|
"vIf",
|
44
44
|
"vShow",
|
45
45
|
"vModel",
|
46
46
|
"vFor",
|
47
47
|
"vBind",
|
48
48
|
"vHtml"
|
49
|
-
],
|
49
|
+
], nt = {
|
50
50
|
String,
|
51
51
|
Number,
|
52
52
|
Boolean,
|
@@ -54,19 +54,19 @@ const le = [
|
|
54
54
|
Object,
|
55
55
|
Function,
|
56
56
|
Date
|
57
|
-
},
|
57
|
+
}, A = "VtjPage", H = "VtjHomepage", st = "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".split(
|
58
58
|
","
|
59
|
-
),
|
59
|
+
), rt = "component,slot".split(",");
|
60
60
|
function M(s, e) {
|
61
61
|
return s.map((t) => De(t) || t.startsWith("/") ? t : `${e}${t}`);
|
62
62
|
}
|
63
|
-
function
|
63
|
+
function te(s) {
|
64
64
|
return /\.css$/.test(s);
|
65
65
|
}
|
66
|
-
function
|
66
|
+
function ne(s) {
|
67
67
|
return /\.js$/.test(s);
|
68
68
|
}
|
69
|
-
function
|
69
|
+
function it(s) {
|
70
70
|
return /\.json$/.test(s);
|
71
71
|
}
|
72
72
|
function Cn(s) {
|
@@ -74,20 +74,20 @@ function Cn(s) {
|
|
74
74
|
(e) => `<script src="${x.append(e, { v: C })}"><\/script>`
|
75
75
|
).join("");
|
76
76
|
}
|
77
|
-
function
|
77
|
+
function An(s = []) {
|
78
78
|
return s.map(
|
79
79
|
(e) => `<link rel="stylesheet" href="${x.append(e, { v: C })}" />`
|
80
80
|
).join("");
|
81
81
|
}
|
82
|
-
function
|
82
|
+
function ot(s, e = !1) {
|
83
83
|
return e && s.endsWith(".prod.js") ? s.replace(".prod.js", ".js") : s;
|
84
84
|
}
|
85
|
-
function
|
85
|
+
function at(s, e, t = !1) {
|
86
86
|
const n = s.filter((d) => !!d.enabled), r = [], i = [], a = [], o = [], c = {}, l = {}, f = [], u = {};
|
87
87
|
return n.forEach(
|
88
88
|
({ urls: d, assetsUrl: h, library: m, assetsLibrary: p, localeLibrary: w }) => {
|
89
89
|
d?.forEach((g) => {
|
90
|
-
|
90
|
+
ne(g) && r.push(ot(g, t)), te(g) && i.push(g);
|
91
91
|
}), m && (o.push(m), c[m] = M(d || [], e), w && (l[m] = w)), h && a.push(h), p && f.push(p), m && p && (u[p] = m);
|
92
92
|
}
|
93
93
|
), {
|
@@ -101,7 +101,7 @@ function ct(s, e, t = !1) {
|
|
101
101
|
libraryLocaleMap: l
|
102
102
|
};
|
103
103
|
}
|
104
|
-
function
|
104
|
+
function ct(s, e) {
|
105
105
|
const { name: t, parent: n, alias: r } = s;
|
106
106
|
return n ? e[n]?.[r || t] : e[r || t];
|
107
107
|
}
|
@@ -123,11 +123,11 @@ function Se(s, e, t) {
|
|
123
123
|
i ? i.innerHTML = t : (i = r.createElement("style"), i.id = e, i.innerHTML = t, r.head.appendChild(i));
|
124
124
|
}
|
125
125
|
}
|
126
|
-
async function
|
126
|
+
async function lt(s, e) {
|
127
127
|
const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
|
128
128
|
t && Se(window, s, t);
|
129
129
|
}
|
130
|
-
function
|
130
|
+
function ut(s, e = window) {
|
131
131
|
const t = e.document, n = e.document.head;
|
132
132
|
for (const r of s)
|
133
133
|
if (!t.getElementById(r)) {
|
@@ -135,7 +135,7 @@ function dt(s, e = window) {
|
|
135
135
|
a.rel = "stylesheet", a.id = r, a.href = r, n.appendChild(a);
|
136
136
|
}
|
137
137
|
}
|
138
|
-
async function
|
138
|
+
async function dt(s, e, t = window) {
|
139
139
|
const n = t.document, r = t.document.head;
|
140
140
|
let i = t[e];
|
141
141
|
return i ? i.default || i : new Promise((a, o) => {
|
@@ -149,16 +149,16 @@ async function pt(s, e, t = window) {
|
|
149
149
|
}
|
150
150
|
});
|
151
151
|
}
|
152
|
-
function
|
152
|
+
function pt(s) {
|
153
153
|
return z(s) || z(s?.install);
|
154
154
|
}
|
155
|
-
function
|
156
|
-
return it.includes(s);
|
157
|
-
}
|
158
|
-
function mt(s) {
|
155
|
+
function ft(s) {
|
159
156
|
return rt.includes(s);
|
160
157
|
}
|
161
|
-
function
|
158
|
+
function ht(s) {
|
159
|
+
return st.includes(s);
|
160
|
+
}
|
161
|
+
function T(s, e, t = !1, n = !1) {
|
162
162
|
try {
|
163
163
|
const r = ['"use strict";', "var __self = arguments[0];"];
|
164
164
|
r.push("return ");
|
@@ -173,7 +173,7 @@ function A(s, e, t = !1, n = !1) {
|
|
173
173
|
}
|
174
174
|
}
|
175
175
|
function G(s, e, t = !1, n = !1) {
|
176
|
-
const r =
|
176
|
+
const r = T(s, e, t, n);
|
177
177
|
if (typeof r != "function" && (P.error(
|
178
178
|
"parseFunction.error",
|
179
179
|
"not a function",
|
@@ -189,13 +189,13 @@ function _(s) {
|
|
189
189
|
function I(s) {
|
190
190
|
return typeof s == "object" && s && s.type === "JSFunction";
|
191
191
|
}
|
192
|
-
function
|
192
|
+
function mt(s) {
|
193
193
|
return _(s) || I(s);
|
194
194
|
}
|
195
|
-
function
|
196
|
-
return
|
195
|
+
function Fn(s) {
|
196
|
+
return mt(s) ? s.value : JSON.stringify(s);
|
197
197
|
}
|
198
|
-
const
|
198
|
+
const gt = {
|
199
199
|
session: !1,
|
200
200
|
authKey: "Authorization",
|
201
201
|
storageKey: "ACCESS_STORAGE",
|
@@ -208,16 +208,16 @@ const vt = {
|
|
208
208
|
noPermissionMessage: "无权限访问该页面",
|
209
209
|
appName: ""
|
210
210
|
}, be = Symbol("access");
|
211
|
-
class
|
211
|
+
class Tn {
|
212
212
|
options;
|
213
213
|
data = null;
|
214
|
-
mode =
|
214
|
+
mode = v.Raw;
|
215
215
|
constructor(e) {
|
216
|
-
this.options = Object.assign({},
|
216
|
+
this.options = Object.assign({}, gt, e), this.loadData();
|
217
217
|
}
|
218
218
|
connect(e) {
|
219
219
|
const { mode: t, router: n, request: r } = e;
|
220
|
-
this.mode = t, n && this.mode ===
|
220
|
+
this.mode = t, n && this.mode === v.Raw && this.setGuard(n), r && this.setRequest(r);
|
221
221
|
}
|
222
222
|
login(e) {
|
223
223
|
const { storageKey: t, storagePrefix: n, session: r, authKey: i } = this.options;
|
@@ -298,7 +298,7 @@ class An {
|
|
298
298
|
return e && t ? !!q.get(t) : !!this.getToken();
|
299
299
|
}
|
300
300
|
hasRoutePermission(e) {
|
301
|
-
if (e.name ===
|
301
|
+
if (e.name === A) {
|
302
302
|
const t = e.params.id;
|
303
303
|
return t && this.can(t);
|
304
304
|
}
|
@@ -381,7 +381,7 @@ function In(s = {}) {
|
|
381
381
|
loading: t
|
382
382
|
};
|
383
383
|
}
|
384
|
-
function
|
384
|
+
function vt(s, e) {
|
385
385
|
const { jsonp: t, request: n } = e;
|
386
386
|
if (s.method === "jsonp")
|
387
387
|
return (r = {}) => t(s.url, {
|
@@ -389,7 +389,7 @@ function _t(s, e) {
|
|
389
389
|
query: r
|
390
390
|
});
|
391
391
|
{
|
392
|
-
const r = s.headers ?
|
392
|
+
const r = s.headers ? T(s.headers, {}, !0) : void 0, i = {
|
393
393
|
url: s.url,
|
394
394
|
method: s.method,
|
395
395
|
settings: {
|
@@ -400,7 +400,7 @@ function _t(s, e) {
|
|
400
400
|
return (a, o) => (delete i.data, n.send(Oe(i, o || {}, { data: a })));
|
401
401
|
}
|
402
402
|
}
|
403
|
-
function
|
403
|
+
function _t(s, e) {
|
404
404
|
const { metaQuery: t } = e;
|
405
405
|
if (!t) return;
|
406
406
|
const { code: n, queryCode: r } = s;
|
@@ -412,18 +412,18 @@ function wt(s, e) {
|
|
412
412
|
return t(n, r, i, a);
|
413
413
|
};
|
414
414
|
}
|
415
|
-
function
|
415
|
+
function wt(s = [], e = [], t) {
|
416
416
|
const n = {};
|
417
417
|
for (const r of s)
|
418
|
-
n[r.id] =
|
418
|
+
n[r.id] = vt(r, t);
|
419
419
|
for (const r of e)
|
420
|
-
n[r.id] =
|
420
|
+
n[r.id] = _t(r, t);
|
421
421
|
return n;
|
422
422
|
}
|
423
|
-
async function
|
424
|
-
|
423
|
+
async function St(s = []) {
|
424
|
+
R && (je(), s.forEach((e) => jt(R, e)));
|
425
425
|
}
|
426
|
-
function
|
426
|
+
function bt(s) {
|
427
427
|
const e = I(s.mockTemplate) && s.mockTemplate.value ? G(s.mockTemplate, {}, !0) : void 0;
|
428
428
|
return async (...t) => {
|
429
429
|
let n = {};
|
@@ -433,14 +433,14 @@ function jt(s) {
|
|
433
433
|
} catch (r) {
|
434
434
|
P.warn("模拟数据模版异常", r);
|
435
435
|
}
|
436
|
-
return
|
436
|
+
return R.mock(n);
|
437
437
|
};
|
438
438
|
}
|
439
|
-
function
|
439
|
+
function jt(s, e) {
|
440
440
|
if (!e.mock) return;
|
441
441
|
const { url: t, mockTemplate: n } = e;
|
442
442
|
if (t && n) {
|
443
|
-
const r = Be(`${t}(.*)`), i = Ne(t, { decode: decodeURIComponent }), a =
|
443
|
+
const r = Be(`${t}(.*)`), i = Ne(t, { decode: decodeURIComponent }), a = T(n, {}, !0);
|
444
444
|
s.mock(r, (o) => {
|
445
445
|
const c = x.parse(o.url) || {}, l = o.body instanceof FormData ? Ue(o.body) : o.body, f = i(o.url)?.params;
|
446
446
|
return Object.assign(o, { data: l, params: c, query: f }), s.mock(a(o));
|
@@ -448,9 +448,9 @@ function $t(s, e) {
|
|
448
448
|
}
|
449
449
|
}
|
450
450
|
function je() {
|
451
|
-
|
451
|
+
R && (R._mocked = {});
|
452
452
|
}
|
453
|
-
class
|
453
|
+
class $t {
|
454
454
|
__id = null;
|
455
455
|
__mode;
|
456
456
|
__instance = null;
|
@@ -507,7 +507,7 @@ class Et {
|
|
507
507
|
}
|
508
508
|
__parseFunction(e) {
|
509
509
|
if (e)
|
510
|
-
if (this.__mode ===
|
510
|
+
if (this.__mode === v.Runtime) {
|
511
511
|
const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
512
512
|
return G({ type: n, value: r }, this);
|
513
513
|
} else
|
@@ -515,14 +515,14 @@ class Et {
|
|
515
515
|
}
|
516
516
|
__parseExpression(e) {
|
517
517
|
if (e)
|
518
|
-
if (this.__mode ===
|
518
|
+
if (this.__mode === v.Runtime) {
|
519
519
|
const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
520
|
-
return
|
520
|
+
return T({ type: n, value: r }, this);
|
521
521
|
} else
|
522
|
-
return
|
522
|
+
return T(e, this);
|
523
523
|
}
|
524
524
|
__ref(e = null, t) {
|
525
|
-
if (this.__mode !==
|
525
|
+
if (this.__mode !== v.VNode)
|
526
526
|
return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
|
527
527
|
await pe(0);
|
528
528
|
let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
|
@@ -530,7 +530,7 @@ class Et {
|
|
530
530
|
typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
|
531
531
|
return;
|
532
532
|
}
|
533
|
-
return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e,
|
533
|
+
return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, v.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, n)), typeof t == "function" ? t(n) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, n)), n;
|
534
534
|
};
|
535
535
|
}
|
536
536
|
__getRefEl(e, t, n) {
|
@@ -552,7 +552,7 @@ class Et {
|
|
552
552
|
function Y(s) {
|
553
553
|
const {
|
554
554
|
Vue: e = N,
|
555
|
-
mode: t =
|
555
|
+
mode: t = v.Runtime,
|
556
556
|
components: n = {},
|
557
557
|
libs: r = {},
|
558
558
|
apis: i = {},
|
@@ -561,22 +561,22 @@ function Y(s) {
|
|
561
561
|
$components: n,
|
562
562
|
$libs: r,
|
563
563
|
$apis: i
|
564
|
-
}, l = new
|
564
|
+
}, l = new $t({
|
565
565
|
mode: t,
|
566
566
|
dsl: o.value,
|
567
567
|
attrs: c
|
568
568
|
}), f = e.defineComponent({
|
569
569
|
name: o.value.name,
|
570
570
|
props: {
|
571
|
-
...
|
571
|
+
...kt(o.value.props ?? [], l)
|
572
572
|
},
|
573
573
|
setup(u) {
|
574
574
|
l.$props = u, l.props = u, o.value.id && Se(
|
575
575
|
s.window || window,
|
576
576
|
o.value.id,
|
577
577
|
o.value.css || ""
|
578
|
-
), l.state =
|
579
|
-
const d =
|
578
|
+
), l.state = Rt(e, o.value.state ?? {}, l);
|
579
|
+
const d = xt(e, o.value.computed ?? {}, l), h = Pt(o.value.methods ?? {}, l), m = Ct(e, o.value.inject, l), p = At(
|
580
580
|
o.value.dataSources || {},
|
581
581
|
l
|
582
582
|
), w = {
|
@@ -585,29 +585,29 @@ function Y(s) {
|
|
585
585
|
...h,
|
586
586
|
...p
|
587
587
|
};
|
588
|
-
return l.setup(w, e),
|
588
|
+
return l.setup(w, e), Ft(e, o.value.watch ?? [], l), {
|
589
589
|
vtj: l
|
590
590
|
};
|
591
591
|
},
|
592
|
-
emits:
|
592
|
+
emits: Et(o.value.emits),
|
593
593
|
expose: ["vtj"],
|
594
594
|
render() {
|
595
595
|
if (!o.value.nodes) return null;
|
596
596
|
const u = o.value.nodes || [];
|
597
597
|
return u.length === 1 ? B(u[0], l, e, a) : u.map((d) => B(d, l, e, a));
|
598
598
|
},
|
599
|
-
...
|
599
|
+
...Tt(o.value.lifeCycles ?? {}, l)
|
600
600
|
});
|
601
601
|
return {
|
602
602
|
renderer: e.markRaw(f),
|
603
603
|
context: l
|
604
604
|
};
|
605
605
|
}
|
606
|
-
function
|
606
|
+
function Et(s = []) {
|
607
607
|
return s.map((e) => j(e) ? e : e.name);
|
608
608
|
}
|
609
|
-
function
|
610
|
-
const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((i) =>
|
609
|
+
function kt(s = [], e) {
|
610
|
+
const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((i) => nt[i]) : void 0;
|
611
611
|
return s.map((n) => j(n) ? {
|
612
612
|
name: n
|
613
613
|
} : {
|
@@ -624,7 +624,7 @@ function Rt(s = [], e) {
|
|
624
624
|
{}
|
625
625
|
);
|
626
626
|
}
|
627
|
-
function
|
627
|
+
function Rt(s, e, t) {
|
628
628
|
return s.reactive(
|
629
629
|
Object.keys(e || {}).reduce(
|
630
630
|
(n, r) => {
|
@@ -635,19 +635,19 @@ function xt(s, e, t) {
|
|
635
635
|
)
|
636
636
|
);
|
637
637
|
}
|
638
|
-
function
|
638
|
+
function xt(s, e, t) {
|
639
639
|
return Object.entries(e ?? {}).reduce(
|
640
640
|
(n, [r, i]) => (n[r] = s.computed(t.__parseFunction(i)), n),
|
641
641
|
{}
|
642
642
|
);
|
643
643
|
}
|
644
|
-
function
|
644
|
+
function Pt(s, e) {
|
645
645
|
return Object.entries(s ?? {}).reduce(
|
646
646
|
(t, [n, r]) => (t[n] = e.__parseFunction(r), t),
|
647
647
|
{}
|
648
648
|
);
|
649
649
|
}
|
650
|
-
function
|
650
|
+
function Ct(s, e = [], t) {
|
651
651
|
return e.reduce(
|
652
652
|
(n, r) => {
|
653
653
|
const { name: i, from: a } = r || {};
|
@@ -658,12 +658,12 @@ function Ft(s, e = [], t) {
|
|
658
658
|
{}
|
659
659
|
);
|
660
660
|
}
|
661
|
-
function
|
661
|
+
function At(s, e) {
|
662
662
|
return Object.keys(s).reduce(
|
663
663
|
(t, n) => {
|
664
664
|
const r = s[n];
|
665
665
|
if (r.type === "mock")
|
666
|
-
t[n] =
|
666
|
+
t[n] = bt(r);
|
667
667
|
else if (r.ref) {
|
668
668
|
const i = e.$apis[r.ref], a = I(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
669
669
|
t[n] = async (...o) => {
|
@@ -676,7 +676,7 @@ function Tt(s, e) {
|
|
676
676
|
{}
|
677
677
|
);
|
678
678
|
}
|
679
|
-
function
|
679
|
+
function Ft(s, e = [], t) {
|
680
680
|
e.forEach((n) => {
|
681
681
|
s.watch(
|
682
682
|
t.__parseExpression(n.source),
|
@@ -688,19 +688,19 @@ function At(s, e = [], t) {
|
|
688
688
|
);
|
689
689
|
});
|
690
690
|
}
|
691
|
-
function
|
691
|
+
function Tt(s, e) {
|
692
692
|
return Object.entries(s ?? {}).reduce(
|
693
693
|
(t, [n, r]) => (t[n] = e.__parseFunction(r), t),
|
694
694
|
{}
|
695
695
|
);
|
696
696
|
}
|
697
|
-
let V = [],
|
698
|
-
const
|
697
|
+
let V = [], k = {};
|
698
|
+
const It = (s) => s;
|
699
699
|
async function $e(s, e = window) {
|
700
|
-
const { urls: t = [], library: n } = s, r = t.filter((o) =>
|
700
|
+
const { urls: t = [], library: n } = s, r = t.filter((o) => ne(o));
|
701
701
|
if (r.length === 0 || !n) return null;
|
702
|
-
const i = t.filter((o) =>
|
703
|
-
return i.length &&
|
702
|
+
const i = t.filter((o) => te(o));
|
703
|
+
return i.length && ut(i, e), await dt(r, n, e).catch(
|
704
704
|
(o) => (console.warn("loadScriptUrl error", r, n, o), null)
|
705
705
|
);
|
706
706
|
}
|
@@ -711,34 +711,34 @@ function Q(s) {
|
|
711
711
|
}), V = []), (r, i, a = N) => {
|
712
712
|
if (!i || typeof i == "string") return r;
|
713
713
|
if (i.type === "Schema" && i.id) {
|
714
|
-
let o =
|
715
|
-
return o || (o =
|
714
|
+
let o = k[i.id];
|
715
|
+
return o || (o = k[i.id] = a.defineAsyncComponent(async () => {
|
716
716
|
const c = await e(i.id);
|
717
717
|
return c && (c.name = r), c ? Y({
|
718
718
|
...n,
|
719
719
|
Vue: a,
|
720
720
|
dsl: c,
|
721
|
-
mode:
|
721
|
+
mode: v.Runtime,
|
722
722
|
loader: Q(s)
|
723
723
|
}).renderer : null;
|
724
724
|
}), o);
|
725
725
|
}
|
726
726
|
if (i.type === "UrlSchema" && i.url) {
|
727
|
-
let o =
|
728
|
-
return o || (o =
|
727
|
+
let o = k[i.url];
|
728
|
+
return o || (o = k[i.url] = a.defineAsyncComponent(async () => {
|
729
729
|
const c = await t(i.url);
|
730
730
|
return c && (c.name = r), c ? Y({
|
731
731
|
...n,
|
732
732
|
Vue: a,
|
733
733
|
dsl: c,
|
734
|
-
mode:
|
734
|
+
mode: v.Runtime,
|
735
735
|
loader: Q(s)
|
736
736
|
}).renderer : null;
|
737
737
|
}), o);
|
738
738
|
}
|
739
739
|
if (i.type === "Plugin") {
|
740
|
-
let o = i.library ?
|
741
|
-
return o || (i.library && V.push(i.library), o =
|
740
|
+
let o = i.library ? k[i.library] : null;
|
741
|
+
return o || (i.library && V.push(i.library), o = k[i.library || Symbol()] = a.defineAsyncComponent(
|
742
742
|
async () => {
|
743
743
|
const c = await $e(i, n.window);
|
744
744
|
return c || (console.warn("getPlugin result is null", i), null);
|
@@ -748,41 +748,44 @@ function Q(s) {
|
|
748
748
|
return r;
|
749
749
|
};
|
750
750
|
}
|
751
|
-
function
|
751
|
+
function Mn() {
|
752
|
+
k = {};
|
753
|
+
}
|
754
|
+
function B(s, e, t = N, n = It) {
|
752
755
|
if (!s || !s.name || s.invisible) return null;
|
753
|
-
const r = t.getCurrentInstance()?.appContext, { id: i = null, directives: a = [] } = s, { vIf: o, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: d, others: h } =
|
754
|
-
if (o && !
|
756
|
+
const r = t.getCurrentInstance()?.appContext, { id: i = null, directives: a = [] } = s, { vIf: o, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: d, others: h } = Dt(a);
|
757
|
+
if (o && !Ht(o, e))
|
755
758
|
return null;
|
756
759
|
const m = (p) => {
|
757
760
|
const w = p.$components, g = (() => {
|
758
761
|
if (s.name === "component")
|
759
|
-
return
|
762
|
+
return Ot(p, s.props?.is);
|
760
763
|
if (s.name === "slot") return s.name;
|
761
764
|
const b = n(s.name, s.from, t);
|
762
|
-
return j(b) ?
|
763
|
-
})(), S =
|
765
|
+
return j(b) ? ft(b) || ht(b) ? b : w[b] ?? r?.app?.component(b) ?? b : b;
|
766
|
+
})(), S = Bt(i, s.props ?? {}, p), Fe = Nt(t, s.events ?? {}, p);
|
764
767
|
if (s.name === "slot")
|
765
|
-
return
|
768
|
+
return Ut(t, s, S, p, n);
|
766
769
|
u && Object.assign(S, p.__parseExpression(u.value)), l && (S.style = Object.assign(
|
767
770
|
S.style ?? {},
|
768
|
-
|
769
|
-
)), d && Object.assign(S,
|
770
|
-
Object.assign(S,
|
771
|
+
qt(l, p)
|
772
|
+
)), d && Object.assign(S, Jt(d, p)), f.forEach((b) => {
|
773
|
+
Object.assign(S, Vt(t, b, p));
|
771
774
|
});
|
772
|
-
const
|
775
|
+
const Te = zt(
|
773
776
|
t,
|
774
777
|
s.children ?? [],
|
775
778
|
p,
|
776
779
|
n,
|
777
780
|
s
|
778
781
|
);
|
779
|
-
let U = t.createVNode(g, { ...S, ...
|
780
|
-
const re = r ?
|
782
|
+
let U = t.createVNode(g, { ...S, ...Fe }, Te);
|
783
|
+
const re = r ? Mt(r, h, p) : [];
|
781
784
|
return re.length && (U = t.withDirectives(U, re)), U;
|
782
785
|
};
|
783
|
-
return c ?
|
786
|
+
return c ? Gt(c, m, e) : m(e);
|
784
787
|
}
|
785
|
-
function
|
788
|
+
function Mt(s, e, t) {
|
786
789
|
const n = s.app;
|
787
790
|
return e.map((r) => {
|
788
791
|
const i = typeof r.name == "string" ? n.directive(r.name) : t.__parseExpression(r.name);
|
@@ -791,11 +794,11 @@ function Dt(s, e, t) {
|
|
791
794
|
return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
|
792
795
|
}).filter((r) => !!r);
|
793
796
|
}
|
794
|
-
function
|
797
|
+
function Dt(s = []) {
|
795
798
|
const e = s.find((c) => $(c.name) === "vIf"), t = s.find((c) => $(c.name) === "vFor"), n = s.find((c) => $(c.name) === "vShow"), r = s.find((c) => $(c.name) === "vBind"), i = s.find((c) => $(c.name) === "vHtml"), a = s.filter(
|
796
799
|
(c) => $(c.name) === "vModel"
|
797
800
|
), o = s.filter(
|
798
|
-
(c) => !
|
801
|
+
(c) => !tt.includes($(c.name))
|
799
802
|
);
|
800
803
|
return {
|
801
804
|
vIf: e,
|
@@ -807,13 +810,13 @@ function Ht(s = []) {
|
|
807
810
|
vHtml: i
|
808
811
|
};
|
809
812
|
}
|
810
|
-
function
|
813
|
+
function Ht(s, e) {
|
811
814
|
return !!e.__parseExpression(s.value);
|
812
815
|
}
|
813
|
-
function
|
816
|
+
function Ot(s, e) {
|
814
817
|
return e ? _(e) ? s.__parseExpression(e) : e : "div";
|
815
818
|
}
|
816
|
-
function
|
819
|
+
function Bt(s, e, t) {
|
817
820
|
const n = Object.keys(e || {}).reduce(
|
818
821
|
(r, i) => {
|
819
822
|
let a = e[i];
|
@@ -823,7 +826,7 @@ function Nt(s, e, t) {
|
|
823
826
|
);
|
824
827
|
return n.ref = t.__ref(s, n.ref), n;
|
825
828
|
}
|
826
|
-
function
|
829
|
+
function Nt(s, e, t) {
|
827
830
|
const n = ["passive", "capture", "once"], r = {
|
828
831
|
capture: "Capture",
|
829
832
|
once: "Once",
|
@@ -841,32 +844,32 @@ function Ee(s = {}, e = !1) {
|
|
841
844
|
const t = Object.keys(s);
|
842
845
|
return e ? t.map((n) => "." + n) : t;
|
843
846
|
}
|
844
|
-
function
|
845
|
-
const { children: i } = e, a =
|
847
|
+
function Ut(s, e, t, n, r) {
|
848
|
+
const { children: i } = e, a = Lt(e, n), o = n.$slots?.[a.name];
|
846
849
|
return o ? o(t) : i ? j(i) ? s.createTextVNode(i) : _(i) ? s.createTextVNode(
|
847
850
|
we(n.__parseExpression(i))
|
848
851
|
) : Array.isArray(i) ? i.map(
|
849
852
|
(c) => B(c, n, s, r)
|
850
853
|
) : null : null;
|
851
854
|
}
|
852
|
-
function
|
855
|
+
function Lt(s, e) {
|
853
856
|
const { props: t } = s, n = t?.name || "default";
|
854
857
|
return {
|
855
858
|
name: _(n) ? e.__parseExpression(n) : n,
|
856
859
|
params: []
|
857
860
|
};
|
858
861
|
}
|
859
|
-
function
|
862
|
+
function qt(s, e) {
|
860
863
|
return e.__parseExpression(s.value) ? {} : {
|
861
864
|
display: "none"
|
862
865
|
};
|
863
866
|
}
|
864
|
-
function
|
867
|
+
function Jt(s, e) {
|
865
868
|
return {
|
866
869
|
innerHTML: e.__parseExpression(s.value) || ""
|
867
870
|
};
|
868
871
|
}
|
869
|
-
function
|
872
|
+
function Vt(s, e, t) {
|
870
873
|
const n = {
|
871
874
|
type: "JSFunction",
|
872
875
|
value: e.value?.value ? `(v) => {
|
@@ -880,7 +883,7 @@ function zt(s, e, t) {
|
|
880
883
|
[`onUpdate:${a}`]: i.length && r ? s.withModifiers(r, i) : r
|
881
884
|
};
|
882
885
|
}
|
883
|
-
function
|
886
|
+
function zt(s, e, t, n, r) {
|
884
887
|
if (!e) return null;
|
885
888
|
if (j(e))
|
886
889
|
return { default: () => e };
|
@@ -889,7 +892,7 @@ function Kt(s, e, t, n, r) {
|
|
889
892
|
default: () => we(t.__parseExpression(e))
|
890
893
|
};
|
891
894
|
if (Array.isArray(e) && e.length > 0) {
|
892
|
-
const i =
|
895
|
+
const i = Kt(e), a = (o) => !o || !r ? {} : r?.id && Object.keys(o).length ? {
|
893
896
|
[`scope_${r.id}`]: o
|
894
897
|
} : {};
|
895
898
|
return Object.entries(i).reduce((o, [c, { nodes: l, params: f }]) => (o[c] = (u) => {
|
@@ -901,7 +904,7 @@ function Kt(s, e, t, n, r) {
|
|
901
904
|
}
|
902
905
|
return null;
|
903
906
|
}
|
904
|
-
function
|
907
|
+
function Kt(s) {
|
905
908
|
const e = {
|
906
909
|
default: {
|
907
910
|
params: [],
|
@@ -909,7 +912,7 @@ function Wt(s) {
|
|
909
912
|
}
|
910
913
|
};
|
911
914
|
for (const t of s) {
|
912
|
-
const n =
|
915
|
+
const n = Wt(t.slot), r = n.name;
|
913
916
|
e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
|
914
917
|
nodes: [t],
|
915
918
|
params: n.params
|
@@ -917,61 +920,61 @@ function Wt(s) {
|
|
917
920
|
}
|
918
921
|
return e;
|
919
922
|
}
|
920
|
-
function
|
923
|
+
function Wt(s = "default") {
|
921
924
|
return j(s) ? { name: s, params: [] } : { params: [], ...s };
|
922
925
|
}
|
923
|
-
function
|
926
|
+
function Gt(s, e, t) {
|
924
927
|
const { value: n, iterator: r } = s, { item: i = "item", index: a = "index" } = r || {};
|
925
928
|
let o = t.__parseExpression(n) || [];
|
926
929
|
return Number.isInteger(o) && (o = new Array(o).fill(!0).map((c, l) => l + 1)), Array.isArray(o) ? o.map((c, l) => e(t.__clone({ [i]: c, [a]: l }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
|
927
930
|
}
|
928
|
-
function
|
931
|
+
function Yt(s) {
|
929
932
|
return Ge() ? (Ye(s), !0) : !1;
|
930
933
|
}
|
931
|
-
function ne(s) {
|
932
|
-
return typeof s == "function" ? s() : Qe(s);
|
933
|
-
}
|
934
934
|
const ke = typeof window < "u" && typeof document < "u";
|
935
935
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
936
|
-
const
|
936
|
+
const Qt = (s) => s != null, Xt = () => {
|
937
937
|
};
|
938
|
-
function
|
938
|
+
function Zt(s) {
|
939
939
|
return ge();
|
940
940
|
}
|
941
|
+
function en(s) {
|
942
|
+
return Array.isArray(s) ? s : [s];
|
943
|
+
}
|
941
944
|
function tn(...s) {
|
942
945
|
if (s.length !== 1)
|
943
946
|
return Ve(...s);
|
944
947
|
const e = s[0];
|
945
|
-
return typeof e == "function" ? ze(Ke(() => ({ get: e, set:
|
948
|
+
return typeof e == "function" ? ze(Ke(() => ({ get: e, set: Xt }))) : F(e);
|
946
949
|
}
|
947
950
|
function nn(s, e) {
|
948
|
-
|
951
|
+
Zt() && We(s, e);
|
949
952
|
}
|
950
953
|
const sn = ke ? window : void 0, rn = ke ? window.document : void 0;
|
951
954
|
function on(s) {
|
952
955
|
var e;
|
953
|
-
const t =
|
956
|
+
const t = Z(s);
|
954
957
|
return (e = t?.$el) != null ? e : t;
|
955
958
|
}
|
956
959
|
function an() {
|
957
|
-
const s =
|
958
|
-
return e &&
|
960
|
+
const s = F(!1), e = ge();
|
961
|
+
return e && Qe(() => {
|
959
962
|
s.value = !0;
|
960
963
|
}, e), s;
|
961
964
|
}
|
962
965
|
function cn(s) {
|
963
966
|
const e = an();
|
964
|
-
return
|
967
|
+
return ve(() => (e.value, !!s()));
|
965
968
|
}
|
966
969
|
function ln(s, e, t = {}) {
|
967
970
|
const { window: n = sn, ...r } = t;
|
968
971
|
let i;
|
969
972
|
const a = cn(() => n && "MutationObserver" in n), o = () => {
|
970
973
|
i && (i.disconnect(), i = void 0);
|
971
|
-
}, c =
|
972
|
-
const d =
|
974
|
+
}, c = ve(() => {
|
975
|
+
const d = Z(s), h = en(d).map(on).filter(Qt);
|
973
976
|
return new Set(h);
|
974
|
-
}), l =
|
977
|
+
}), l = ye(
|
975
978
|
() => c.value,
|
976
979
|
(d) => {
|
977
980
|
o(), a.value && d.size && (i = new MutationObserver(e), d.forEach((h) => i.observe(h, r)));
|
@@ -980,7 +983,7 @@ function ln(s, e, t = {}) {
|
|
980
983
|
), f = () => i?.takeRecords(), u = () => {
|
981
984
|
l(), o();
|
982
985
|
};
|
983
|
-
return
|
986
|
+
return Yt(u), {
|
984
987
|
isSupported: a,
|
985
988
|
stop: u,
|
986
989
|
takeRecords: f
|
@@ -996,9 +999,9 @@ function un(s = null, e = {}) {
|
|
996
999
|
if (!("titleTemplate" in e))
|
997
1000
|
return u;
|
998
1001
|
const d = e.titleTemplate || "%s";
|
999
|
-
return typeof d == "function" ? d(u) :
|
1002
|
+
return typeof d == "function" ? d(u) : Z(d).replace(/%s/g, u);
|
1000
1003
|
}
|
1001
|
-
return
|
1004
|
+
return ye(
|
1002
1005
|
c,
|
1003
1006
|
(u, d) => {
|
1004
1007
|
u !== d && i && (i.title = f(typeof u == "string" ? u : ""));
|
@@ -1017,10 +1020,10 @@ function un(s = null, e = {}) {
|
|
1017
1020
|
}
|
1018
1021
|
}), c;
|
1019
1022
|
}
|
1020
|
-
const ue =
|
1023
|
+
const ue = ee({
|
1021
1024
|
name: "VtjPageContainer",
|
1022
1025
|
async setup() {
|
1023
|
-
const s = xe(), e = _e(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null, i =
|
1026
|
+
const s = xe(), e = _e(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null, i = F(Symbol());
|
1024
1027
|
return n && (Object.assign(e.meta, n.meta || {}, { cache: n.cache }), un(n.title || "VTJ")), {
|
1025
1028
|
provider: s,
|
1026
1029
|
component: r,
|
@@ -1053,7 +1056,7 @@ const ue = Z({
|
|
1053
1056
|
}, gn = {
|
1054
1057
|
"data-l-h6o7ki7": "",
|
1055
1058
|
class: "vtj-startup__actions"
|
1056
|
-
},
|
1059
|
+
}, yn = /* @__PURE__ */ ee({
|
1057
1060
|
__name: "Startup",
|
1058
1061
|
props: {
|
1059
1062
|
name: { default: "VTJ.PRO" },
|
@@ -1153,7 +1156,7 @@ const ue = Z({
|
|
1153
1156
|
window.location.href = i;
|
1154
1157
|
}
|
1155
1158
|
};
|
1156
|
-
return (r, i) => (
|
1159
|
+
return (r, i) => (Xe(), Ze("div", dn, [
|
1157
1160
|
E("div", pn, [
|
1158
1161
|
E("h1", fn, [
|
1159
1162
|
E("span", hn, J(t.name), 1)
|
@@ -1169,10 +1172,10 @@ const ue = Z({
|
|
1169
1172
|
])
|
1170
1173
|
]));
|
1171
1174
|
}
|
1172
|
-
}),
|
1175
|
+
}), vn = ee({
|
1173
1176
|
name: "VtjStartupContainer",
|
1174
1177
|
render() {
|
1175
|
-
return W(
|
1178
|
+
return W(yn);
|
1176
1179
|
}
|
1177
1180
|
}), Re = Symbol("Provider");
|
1178
1181
|
var _n = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(_n || {});
|
@@ -1181,7 +1184,7 @@ class wn extends Ie {
|
|
1181
1184
|
super(), this.options = e;
|
1182
1185
|
const {
|
1183
1186
|
service: t,
|
1184
|
-
mode: n =
|
1187
|
+
mode: n = v.Raw,
|
1185
1188
|
dependencies: r,
|
1186
1189
|
materials: i,
|
1187
1190
|
project: a = {},
|
@@ -1195,7 +1198,7 @@ class wn extends Ie {
|
|
1195
1198
|
} = e;
|
1196
1199
|
this.mode = n, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = d, r && (this.dependencies = r), i && (this.materials = i), Object.assign(this.globals, c), Object.assign(this.adapter, o);
|
1197
1200
|
const { access: h, request: m } = this.adapter;
|
1198
|
-
h && h.connect({ mode: n, router: f, request: m }), a && n !==
|
1201
|
+
h && h.connect({ mode: n, router: f, request: m }), a && n !== v.Design ? this.load(a) : this.project = a, R.setup({
|
1199
1202
|
timeout: "50-500"
|
1200
1203
|
});
|
1201
1204
|
}
|
@@ -1223,7 +1226,7 @@ class wn extends Ie {
|
|
1223
1226
|
} catch (r) {
|
1224
1227
|
P.warn("模拟数据模版异常", r);
|
1225
1228
|
}
|
1226
|
-
return
|
1229
|
+
return R.mock(n);
|
1227
1230
|
};
|
1228
1231
|
}
|
1229
1232
|
async load(e) {
|
@@ -1231,7 +1234,7 @@ class wn extends Ie {
|
|
1231
1234
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
1232
1235
|
throw new Error("project is null");
|
1233
1236
|
const { apis: n = [], meta: r = [] } = this.project, i = window;
|
1234
|
-
i.CKEDITOR_VERSION = void 0, this.mode ===
|
1237
|
+
i.CKEDITOR_VERSION = void 0, this.mode === v.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.apis = wt(n, r, this.adapter), je(), St(n), this.initRouter(), this.triggerReady();
|
1235
1238
|
}
|
1236
1239
|
async loadDependencies(e) {
|
1237
1240
|
const t = Object.entries(this.dependencies);
|
@@ -1245,7 +1248,7 @@ class wn extends Ie {
|
|
1245
1248
|
materials: f,
|
1246
1249
|
materialExports: u,
|
1247
1250
|
materialMapLibrary: d
|
1248
|
-
} =
|
1251
|
+
} = at(
|
1249
1252
|
t,
|
1250
1253
|
a,
|
1251
1254
|
o === "development"
|
@@ -1260,7 +1263,7 @@ class wn extends Ie {
|
|
1260
1263
|
else {
|
1261
1264
|
const w = l[h] || [];
|
1262
1265
|
for (const g of w)
|
1263
|
-
|
1266
|
+
te(g) && await lt(h, x.append(g, { v: C })), ne(g) && await ae(x.append(g, { v: C }));
|
1264
1267
|
r[h] = e[h];
|
1265
1268
|
}
|
1266
1269
|
}
|
@@ -1277,7 +1280,7 @@ class wn extends Ie {
|
|
1277
1280
|
else {
|
1278
1281
|
const g = h[m] ? (await h[m]()).default : e[m];
|
1279
1282
|
g && p && (g.components || []).forEach((S) => {
|
1280
|
-
i[S.name] =
|
1283
|
+
i[S.name] = ct(S, p);
|
1281
1284
|
});
|
1282
1285
|
}
|
1283
1286
|
}
|
@@ -1288,21 +1291,21 @@ class wn extends Ie {
|
|
1288
1291
|
if (!e) return;
|
1289
1292
|
const { routeAppendTo: i, pageRouteName: a = "page", routeMeta: o } = n, c = i ? "" : "/", l = {
|
1290
1293
|
path: `${c}${a}/:id`,
|
1291
|
-
name:
|
1294
|
+
name: A,
|
1292
1295
|
component: ue
|
1293
1296
|
}, f = {
|
1294
1297
|
path: c,
|
1295
1298
|
name: H,
|
1296
|
-
component: t?.homepage ? ue : r.startupComponent ||
|
1299
|
+
component: t?.homepage ? ue : r.startupComponent || vn,
|
1297
1300
|
meta: o
|
1298
1301
|
};
|
1299
|
-
e.hasRoute(
|
1302
|
+
e.hasRoute(A) && e.removeRoute(A), e.hasRoute(H) && e.removeRoute(H), i ? (e.addRoute(i, l), e.addRoute(i, f)) : (e.addRoute(l), e.addRoute(f));
|
1300
1303
|
}
|
1301
1304
|
install(e) {
|
1302
1305
|
const t = e.config.globalProperties.installed || {};
|
1303
1306
|
for (const [n, r] of Object.entries(this.library))
|
1304
|
-
!t[n] &&
|
1305
|
-
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Re, this), e.config.globalProperties.installed = t, this.mode ===
|
1307
|
+
!t[n] && pt(r) && (e.use(r), t[n] = !0);
|
1308
|
+
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Re, this), e.config.globalProperties.installed = t, this.mode === v.Design && (e.config.errorHandler = (n, r, i) => {
|
1306
1309
|
const a = r?.$options.name, o = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", c = `[ ${a} ] ${o} ${i}`;
|
1307
1310
|
console.error(
|
1308
1311
|
"[VTJ Error]:",
|
@@ -1393,7 +1396,7 @@ class wn extends Ie {
|
|
1393
1396
|
return ce(async () => await $e(e, window));
|
1394
1397
|
}
|
1395
1398
|
}
|
1396
|
-
function
|
1399
|
+
function Dn(s) {
|
1397
1400
|
const e = new wn(s);
|
1398
1401
|
return {
|
1399
1402
|
provider: e,
|
@@ -1444,7 +1447,7 @@ const Pe = {
|
|
1444
1447
|
type: "data"
|
1445
1448
|
}
|
1446
1449
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
1447
|
-
function
|
1450
|
+
function Hn(s) {
|
1448
1451
|
return fe({
|
1449
1452
|
settings: {
|
1450
1453
|
type: "json",
|
@@ -1536,7 +1539,7 @@ class se {
|
|
1536
1539
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
1537
1540
|
}
|
1538
1541
|
async getPluginMaterial(e) {
|
1539
|
-
const { urls: t = [] } = e, n = t.filter((i) =>
|
1542
|
+
const { urls: t = [] } = e, n = t.filter((i) => it(i))[0];
|
1540
1543
|
if (!n) return null;
|
1541
1544
|
const r = this.pluginCaches[n];
|
1542
1545
|
return r || (this.pluginCaches[n] = K.send({
|
@@ -1552,58 +1555,58 @@ class se {
|
|
1552
1555
|
return console.log("BaseService.genSource", e), "";
|
1553
1556
|
}
|
1554
1557
|
}
|
1555
|
-
const
|
1558
|
+
const y = new Je({
|
1556
1559
|
type: "local",
|
1557
1560
|
expired: 0,
|
1558
1561
|
prefix: "__VTJ_"
|
1559
1562
|
});
|
1560
|
-
class
|
1563
|
+
class On extends se {
|
1561
1564
|
init(e) {
|
1562
|
-
const t = new O(e), n =
|
1563
|
-
return
|
1565
|
+
const t = new O(e), n = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
|
1566
|
+
return y.save(`project_${t.id}`, r), Promise.resolve(r);
|
1564
1567
|
}
|
1565
1568
|
saveProject(e) {
|
1566
1569
|
const t = new O(e);
|
1567
|
-
return
|
1570
|
+
return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
1568
1571
|
}
|
1569
1572
|
saveMaterials(e, t) {
|
1570
|
-
return
|
1573
|
+
return y.save(`materials_${e.id}`, X(t)), Promise.resolve(!0);
|
1571
1574
|
}
|
1572
1575
|
saveFile(e) {
|
1573
|
-
return
|
1576
|
+
return y.save(`file_${e.id}`, e), Promise.resolve(!0);
|
1574
1577
|
}
|
1575
1578
|
getFile(e) {
|
1576
|
-
const t =
|
1579
|
+
const t = y.get(`file_${e}`);
|
1577
1580
|
return t ? Promise.resolve(t) : Promise.reject(null);
|
1578
1581
|
}
|
1579
1582
|
removeFile(e) {
|
1580
|
-
return
|
1583
|
+
return y.remove(`file_${e}`), Promise.resolve(!0);
|
1581
1584
|
}
|
1582
1585
|
saveHistory(e) {
|
1583
|
-
return
|
1586
|
+
return y.save(`history_${e.id}`, e), Promise.resolve(!0);
|
1584
1587
|
}
|
1585
1588
|
removeHistory(e) {
|
1586
|
-
const t =
|
1589
|
+
const t = y.get(`history_${e}`);
|
1587
1590
|
if (t) {
|
1588
1591
|
const r = (t.items || []).map((i) => i.id);
|
1589
|
-
this.removeHistoryItem(e, r),
|
1592
|
+
this.removeHistoryItem(e, r), y.remove(`history_${e}`);
|
1590
1593
|
}
|
1591
1594
|
return Promise.resolve(!0);
|
1592
1595
|
}
|
1593
1596
|
getHistory(e) {
|
1594
|
-
const t =
|
1597
|
+
const t = y.get(`history_${e}`), n = new de(t || { id: e });
|
1595
1598
|
return Promise.resolve(n.toDsl());
|
1596
1599
|
}
|
1597
1600
|
getHistoryItem(e, t) {
|
1598
|
-
const n =
|
1601
|
+
const n = y.get(`history_${e}_${t}`);
|
1599
1602
|
return Promise.resolve(n);
|
1600
1603
|
}
|
1601
1604
|
saveHistoryItem(e, t) {
|
1602
|
-
return
|
1605
|
+
return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
|
1603
1606
|
}
|
1604
1607
|
removeHistoryItem(e, t) {
|
1605
1608
|
return t.forEach((n) => {
|
1606
|
-
|
1609
|
+
y.remove(`history_${e}_${n}`);
|
1607
1610
|
}), Promise.resolve(!0);
|
1608
1611
|
}
|
1609
1612
|
}
|
@@ -1665,10 +1668,10 @@ class jn extends se {
|
|
1665
1668
|
}
|
1666
1669
|
}
|
1667
1670
|
let D = null;
|
1668
|
-
function
|
1671
|
+
function Bn() {
|
1669
1672
|
return D || (D = new jn(), D);
|
1670
1673
|
}
|
1671
|
-
class
|
1674
|
+
class Nn extends se {
|
1672
1675
|
getFileCaches = {};
|
1673
1676
|
async getExtension() {
|
1674
1677
|
return await this.api("getExtension", {}).catch(() => {
|
@@ -1736,26 +1739,26 @@ function Ce(s, e, t = []) {
|
|
1736
1739
|
};
|
1737
1740
|
});
|
1738
1741
|
}
|
1739
|
-
function
|
1742
|
+
function Ae(s, e) {
|
1740
1743
|
if (!e) return s;
|
1741
1744
|
let t = [];
|
1742
1745
|
for (const n of s)
|
1743
1746
|
if (n.children && n.children.length) {
|
1744
|
-
const r =
|
1747
|
+
const r = Ae(n.children, e);
|
1745
1748
|
r.length && (n.children = r, t.push(n));
|
1746
1749
|
} else
|
1747
1750
|
e.can(n.id.toString()) && t.push(n);
|
1748
1751
|
return t;
|
1749
1752
|
}
|
1750
|
-
function
|
1753
|
+
function Un(s) {
|
1751
1754
|
const {
|
1752
1755
|
menuPathPrefix: e = "",
|
1753
1756
|
pageRouteName: t = "page",
|
1754
1757
|
disableMenusFilter: n = !1
|
1755
|
-
} = s || {}, r = xe(), i = _e(), a = yt(), o =
|
1756
|
-
|
1758
|
+
} = s || {}, r = xe(), i = _e(), a = yt(), o = F(!1), c = F(!1), l = r.project;
|
1759
|
+
et(() => {
|
1757
1760
|
const { name: d, params: h, meta: m } = i;
|
1758
|
-
if (d ===
|
1761
|
+
if (d === A) {
|
1759
1762
|
const p = r.getPage(h.id);
|
1760
1763
|
o.value = !p?.mask, c.value = !!p?.pure;
|
1761
1764
|
} else if (d === H) {
|
@@ -1774,74 +1777,75 @@ function Nn(s) {
|
|
1774
1777
|
logo: u?.logo,
|
1775
1778
|
themeSwitchable: u?.themeSwitchable,
|
1776
1779
|
title: u?.title || l?.description || l?.name || "VTJ App",
|
1777
|
-
menus: n ? f :
|
1780
|
+
menus: n ? f : Ae(f, a),
|
1778
1781
|
pure: c
|
1779
1782
|
};
|
1780
1783
|
}
|
1781
1784
|
export {
|
1782
1785
|
be as ACCESS_KEY,
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
+
Tn as Access,
|
1787
|
+
rt as BUILD_IN_TAGS,
|
1788
|
+
tt as BUILT_IN_DIRECTIVES,
|
1786
1789
|
se as BaseService,
|
1787
1790
|
le as CONTEXT_HOST,
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
+
$t as Context,
|
1792
|
+
v as ContextMode,
|
1793
|
+
nt as DATA_TYPES,
|
1791
1794
|
H as HOMEPAGE_ROUTE_NAME,
|
1792
|
-
|
1793
|
-
|
1795
|
+
st as HTML_TAGS,
|
1796
|
+
Fn as JSCodeToString,
|
1794
1797
|
Pn as LIFE_CYCLES_LIST,
|
1795
|
-
|
1798
|
+
Nn as LocalService,
|
1796
1799
|
jn as MemoryService,
|
1797
1800
|
_n as NodeEnv,
|
1798
|
-
|
1801
|
+
A as PAGE_ROUTE_NAME,
|
1799
1802
|
wn as Provider,
|
1800
|
-
|
1801
|
-
|
1803
|
+
yn as Startup,
|
1804
|
+
On as StorageService,
|
1802
1805
|
C as VTJ_RENDERER_VERSION,
|
1803
1806
|
Se as adoptedStyleSheets,
|
1807
|
+
Mn as clearLoaderCache,
|
1804
1808
|
In as createAdapter,
|
1805
1809
|
Cn as createAssetScripts,
|
1806
|
-
|
1807
|
-
|
1810
|
+
An as createAssetsCss,
|
1811
|
+
At as createDataSources,
|
1808
1812
|
Q as createLoader,
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
+
Bn as createMemoryService,
|
1814
|
+
_t as createMetaApi,
|
1815
|
+
bt as createMock,
|
1816
|
+
Dn as createProvider,
|
1813
1817
|
Y as createRenderer,
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
+
vt as createSchemaApi,
|
1819
|
+
wt as createSchemaApis,
|
1820
|
+
Hn as createServiceRequest,
|
1821
|
+
It as defaultLoader,
|
1818
1822
|
M as fillBasePath,
|
1819
1823
|
Ee as getModifiers,
|
1820
1824
|
$e as getPlugin,
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
+
ct as getRawComponent,
|
1826
|
+
ft as isBuiltInTag,
|
1827
|
+
te as isCSSUrl,
|
1828
|
+
mt as isJSCode,
|
1825
1829
|
_ as isJSExpression,
|
1826
1830
|
I as isJSFunction,
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1831
|
+
it as isJSON,
|
1832
|
+
ne as isJSUrl,
|
1833
|
+
ht as isNativeTag,
|
1834
|
+
pt as isVuePlugin,
|
1835
|
+
lt as loadCss,
|
1836
|
+
ut as loadCssUrl,
|
1837
|
+
dt as loadScriptUrl,
|
1838
|
+
jt as mockApi,
|
1839
|
+
St as mockApis,
|
1836
1840
|
je as mockCleanup,
|
1837
1841
|
B as nodeRender,
|
1838
|
-
|
1839
|
-
|
1842
|
+
at as parseDeps,
|
1843
|
+
T as parseExpression,
|
1840
1844
|
G as parseFunction,
|
1841
1845
|
Re as providerKey,
|
1842
|
-
|
1846
|
+
ot as removeProdFlag,
|
1843
1847
|
we as toString,
|
1844
1848
|
yt as useAccess,
|
1845
|
-
|
1849
|
+
Un as useMask,
|
1846
1850
|
xe as useProvider
|
1847
1851
|
};
|