@vtj/renderer 0.9.0-alpha.8 → 0.9.0
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 +509 -485
- package/package.json +7 -7
- package/types/components/Startup.d.ts +1 -0
- package/types/hooks/mask.d.ts +6 -1
- package/types/plugins/access.d.ts +4 -0
- package/types/provider/page.d.ts +5 -3
- package/types/provider/provider.d.ts +2 -1
- package/types/services/base.d.ts +1 -0
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import { Base as xe, BUILT_IN_COMPONENTS as
|
2
|
-
import { isUrl as
|
3
|
-
import * as
|
4
|
-
import { inject as
|
5
|
-
import { ElNotification as
|
6
|
-
import { useRoute as
|
1
|
+
import { Base as xe, BUILT_IN_COMPONENTS as ke, ProjectModel as T, HistoryModel as ue } from "@vtj/core";
|
2
|
+
import { isUrl as Ce, url as P, dedupArray as Fe, isString as S, isFunction as z, logger as D, createRequest as Ae, merge as Ie, pathToRegexp as Oe, pathToRegexpMatch as Me, formDataToJson as Te, storage as L, cookie as q, toArray as ne, unRSA as re, delay as de, camelCase as $, upperFirst as De, pick as He, jsonp as Be, loadScript as oe, Request as Ne, Storage as Ue, mapToObject as Y } from "@vtj/utils";
|
3
|
+
import * as B from "vue";
|
4
|
+
import { inject as pe, toRef as Le, readonly as qe, customRef as Je, ref as C, onBeforeUnmount as Ve, getCurrentScope as ze, onScopeDispose as Ke, unref as We, getCurrentInstance as fe, watch as he, computed as me, onMounted as Ge, defineComponent as Q, h as K, openBlock as Ye, createElementBlock as Qe, createElementVNode as b, toDisplayString as J, defineAsyncComponent as ie, watchEffect as Xe } from "vue";
|
5
|
+
import { ElNotification as N, ElLoading as Ze } from "element-plus";
|
6
|
+
import { useRoute as ge } from "vue-router";
|
7
7
|
/**!
|
8
8
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
9
9
|
* @name @vtj/renderer
|
10
10
|
* @author CHC chenhuachun1549@dingtalk.com
|
11
|
-
* @version 0.9.0
|
11
|
+
* @version 0.9.0
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
13
13
|
*/
|
14
|
-
const
|
14
|
+
const x = "0.9.0";
|
15
15
|
var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
|
16
|
-
const
|
16
|
+
const ae = [
|
17
17
|
"$el",
|
18
18
|
"$emit",
|
19
19
|
"$nextTick",
|
@@ -25,7 +25,7 @@ const oe = [
|
|
25
25
|
"$props",
|
26
26
|
"$options",
|
27
27
|
"$forceUpdate"
|
28
|
-
],
|
28
|
+
], ws = [
|
29
29
|
"beforeCreate",
|
30
30
|
"created",
|
31
31
|
"beforeMount",
|
@@ -39,7 +39,7 @@ const oe = [
|
|
39
39
|
"renderTriggered",
|
40
40
|
"activated",
|
41
41
|
"deactivated"
|
42
|
-
],
|
42
|
+
], et = ["vIf", "vShow", "vModel", "vFor", "vBind"], tt = {
|
43
43
|
String,
|
44
44
|
Number,
|
45
45
|
Boolean,
|
@@ -47,65 +47,65 @@ const oe = [
|
|
47
47
|
Object,
|
48
48
|
Function,
|
49
49
|
Date
|
50
|
-
},
|
51
|
-
function
|
52
|
-
return n.map((t) =>
|
50
|
+
}, k = "VtjPage", M = "VtjHomepage";
|
51
|
+
function I(n, e) {
|
52
|
+
return n.map((t) => Ce(t) || t.startsWith("/") ? t : `${e}${t}`);
|
53
53
|
}
|
54
|
-
function
|
54
|
+
function X(n) {
|
55
55
|
return /\.css$/.test(n);
|
56
56
|
}
|
57
|
-
function
|
57
|
+
function Z(n) {
|
58
58
|
return /\.js$/.test(n);
|
59
59
|
}
|
60
|
-
function
|
60
|
+
function st(n) {
|
61
61
|
return /\.json$/.test(n);
|
62
62
|
}
|
63
|
-
function
|
63
|
+
function Ss(n) {
|
64
64
|
return n.map(
|
65
|
-
(e) => `<script src="${
|
65
|
+
(e) => `<script src="${P.append(e, { v: x })}"><\/script>`
|
66
66
|
).join("");
|
67
67
|
}
|
68
|
-
function
|
68
|
+
function js(n = []) {
|
69
69
|
return n.map(
|
70
|
-
(e) => `<link rel="stylesheet" href="${
|
70
|
+
(e) => `<link rel="stylesheet" href="${P.append(e, { v: x })}" />`
|
71
71
|
).join("");
|
72
72
|
}
|
73
|
-
function
|
73
|
+
function nt(n, e = !1) {
|
74
74
|
return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
|
75
75
|
}
|
76
|
-
function
|
77
|
-
const s = n.filter((
|
76
|
+
function rt(n, e, t = !1) {
|
77
|
+
const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
|
78
78
|
return s.forEach(
|
79
|
-
({ urls:
|
80
|
-
|
81
|
-
|
82
|
-
}),
|
79
|
+
({ urls: p, assetsUrl: d, library: h, assetsLibrary: m, localeLibrary: v }) => {
|
80
|
+
p?.forEach((g) => {
|
81
|
+
Z(g) && r.push(nt(g, t)), X(g) && o.push(g);
|
82
|
+
}), h && (i.push(h), l[h] = I(p || [], e), v && (c[h] = v)), d && a.push(d), m && f.push(m), h && m && (u[m] = h);
|
83
83
|
}
|
84
84
|
), {
|
85
|
-
scripts:
|
86
|
-
css:
|
87
|
-
materials:
|
85
|
+
scripts: I(r, e),
|
86
|
+
css: I(o, e),
|
87
|
+
materials: I(a, e),
|
88
88
|
libraryExports: i,
|
89
|
-
materialExports:
|
90
|
-
materialMapLibrary:
|
91
|
-
libraryMap:
|
92
|
-
libraryLocaleMap:
|
89
|
+
materialExports: Fe(f),
|
90
|
+
materialMapLibrary: u,
|
91
|
+
libraryMap: l,
|
92
|
+
libraryLocaleMap: c
|
93
93
|
};
|
94
94
|
}
|
95
|
-
function
|
95
|
+
function ot(n, e) {
|
96
96
|
const { name: t, parent: s, alias: r } = n;
|
97
97
|
return s ? e[s]?.[r || t] : e[r || t];
|
98
98
|
}
|
99
|
-
function
|
100
|
-
return
|
99
|
+
function ve(n) {
|
100
|
+
return S(n) ? n : JSON.stringify(n);
|
101
101
|
}
|
102
|
-
function
|
102
|
+
function ye(n, e, t) {
|
103
103
|
const s = n.CSSStyleSheet;
|
104
104
|
if (s.prototype.replaceSync) {
|
105
105
|
const r = new s();
|
106
106
|
r.id = e, r.replaceSync(t);
|
107
107
|
const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
|
108
|
-
(
|
108
|
+
(l) => l.id !== e
|
109
109
|
);
|
110
110
|
o.adoptedStyleSheets = [...i, r];
|
111
111
|
} else {
|
@@ -114,11 +114,11 @@ function ve(n, e, t) {
|
|
114
114
|
o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
|
115
115
|
}
|
116
116
|
}
|
117
|
-
async function
|
117
|
+
async function it(n, e) {
|
118
118
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
119
|
-
t &&
|
119
|
+
t && ye(window, n, t);
|
120
120
|
}
|
121
|
-
function
|
121
|
+
function at(n, e = window) {
|
122
122
|
const t = e.document, s = e.document.head;
|
123
123
|
for (const r of n)
|
124
124
|
if (!t.getElementById(r)) {
|
@@ -126,40 +126,40 @@ function it(n, e = window) {
|
|
126
126
|
a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
|
127
127
|
}
|
128
128
|
}
|
129
|
-
async function
|
129
|
+
async function ct(n, e, t = window) {
|
130
130
|
const s = t.document, r = t.document.head;
|
131
131
|
let o = t[e];
|
132
132
|
return o ? o.default || o : new Promise((a, i) => {
|
133
|
-
for (const
|
134
|
-
const
|
135
|
-
|
133
|
+
for (const l of n) {
|
134
|
+
const c = s.createElement("script");
|
135
|
+
c.src = l, c.onload = () => {
|
136
136
|
o = t[e], o ? a(o.default || o) : i(null);
|
137
|
-
},
|
137
|
+
}, c.onerror = (f) => {
|
138
138
|
i(f);
|
139
|
-
}, r.appendChild(
|
139
|
+
}, r.appendChild(c);
|
140
140
|
}
|
141
141
|
});
|
142
142
|
}
|
143
|
-
function
|
144
|
-
return
|
143
|
+
function lt(n) {
|
144
|
+
return z(n) || z(n?.install);
|
145
145
|
}
|
146
|
-
function
|
146
|
+
function F(n, e, t = !1, s = !1) {
|
147
147
|
try {
|
148
148
|
const r = ['"use strict";', "var __self = arguments[0];"];
|
149
149
|
r.push("return ");
|
150
150
|
let o = (n.value || "").trim();
|
151
|
-
o = o.replace(/this(\W|$)/g, (i,
|
151
|
+
o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = r.join(`
|
152
152
|
`) + o;
|
153
153
|
const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
|
154
154
|
return new Function("$scope", a)(e);
|
155
155
|
} catch (r) {
|
156
|
-
if (
|
156
|
+
if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
|
157
157
|
throw r;
|
158
158
|
}
|
159
159
|
}
|
160
|
-
function
|
161
|
-
const r =
|
162
|
-
if (typeof r != "function" && (
|
160
|
+
function ce(n, e, t = !1, s = !1) {
|
161
|
+
const r = F(n, e, t, s);
|
162
|
+
if (typeof r != "function" && (D.error(
|
163
163
|
"parseFunction.error",
|
164
164
|
"not a function",
|
165
165
|
n,
|
@@ -168,20 +168,20 @@ function ie(n, e, t = !1, s = !1) {
|
|
168
168
|
throw new Error(`"${n.value}" not a function`);
|
169
169
|
return r;
|
170
170
|
}
|
171
|
-
function
|
171
|
+
function w(n) {
|
172
172
|
return n && n.type === "JSExpression";
|
173
173
|
}
|
174
|
-
function
|
174
|
+
function U(n) {
|
175
175
|
return typeof n == "object" && n && n.type === "JSFunction";
|
176
176
|
}
|
177
|
-
function
|
178
|
-
return
|
177
|
+
function ut(n) {
|
178
|
+
return w(n) || U(n);
|
179
179
|
}
|
180
|
-
function
|
181
|
-
return
|
180
|
+
function $s(n) {
|
181
|
+
return ut(n) ? n.value : JSON.stringify(n);
|
182
182
|
}
|
183
183
|
let E = null;
|
184
|
-
const
|
184
|
+
const dt = Ae({
|
185
185
|
settings: {
|
186
186
|
type: "form",
|
187
187
|
validSuccess: !0,
|
@@ -190,12 +190,12 @@ const ut = Fe({
|
|
190
190
|
validate: (n) => n.data?.code === 0 || !!n.data?.success,
|
191
191
|
failMessage: !0,
|
192
192
|
showError: (n) => {
|
193
|
-
|
193
|
+
N.error({
|
194
194
|
message: n || "未知错误"
|
195
195
|
});
|
196
196
|
},
|
197
197
|
showLoading: () => {
|
198
|
-
E && E.close(), E =
|
198
|
+
E && E.close(), E = Ze.service({
|
199
199
|
lock: !0,
|
200
200
|
text: "Loading",
|
201
201
|
background: "rgba(0, 0, 0, 0.05)"
|
@@ -206,8 +206,8 @@ const ut = Fe({
|
|
206
206
|
}
|
207
207
|
}
|
208
208
|
});
|
209
|
-
let
|
210
|
-
function
|
209
|
+
let R;
|
210
|
+
function pt(n, e) {
|
211
211
|
const { jsonp: t, request: s } = e;
|
212
212
|
if (n.method === "jsonp")
|
213
213
|
return (r = {}) => t(n.url, {
|
@@ -215,7 +215,7 @@ function dt(n, e) {
|
|
215
215
|
query: r
|
216
216
|
});
|
217
217
|
{
|
218
|
-
const r = n.headers ?
|
218
|
+
const r = n.headers ? F(n.headers, {}, !0) : void 0, o = {
|
219
219
|
url: n.url,
|
220
220
|
method: n.method,
|
221
221
|
settings: {
|
@@ -223,10 +223,10 @@ function dt(n, e) {
|
|
223
223
|
headers: r
|
224
224
|
}
|
225
225
|
};
|
226
|
-
return (a, i) => (delete o.data, s.send(
|
226
|
+
return (a, i) => (delete o.data, s.send(Ie(o, i || {}, { data: a })));
|
227
227
|
}
|
228
228
|
}
|
229
|
-
function
|
229
|
+
function ft(n, e) {
|
230
230
|
const { metaQuery: t } = e;
|
231
231
|
if (!t) return;
|
232
232
|
const { code: s, queryCode: r } = n;
|
@@ -238,89 +238,90 @@ function pt(n, e) {
|
|
238
238
|
return t(s, r, o, a);
|
239
239
|
};
|
240
240
|
}
|
241
|
-
function
|
241
|
+
function ht(n = [], e = [], t) {
|
242
242
|
const s = {};
|
243
243
|
for (const r of n)
|
244
|
-
s[r.id] = dt(r, t);
|
245
|
-
for (const r of e)
|
246
244
|
s[r.id] = pt(r, t);
|
245
|
+
for (const r of e)
|
246
|
+
s[r.id] = ft(r, t);
|
247
247
|
return s;
|
248
248
|
}
|
249
|
-
async function
|
250
|
-
|
249
|
+
async function mt(n = []) {
|
250
|
+
R = await import("mockjs").then((e) => e.default || e), R && (R.setup({
|
251
251
|
timeout: "50-500"
|
252
|
-
}),
|
252
|
+
}), _e(), n.forEach((e) => gt(R, e)));
|
253
253
|
}
|
254
|
-
function
|
254
|
+
function gt(n, e) {
|
255
255
|
if (!e.mock) return;
|
256
256
|
const { url: t, mockTemplate: s } = e;
|
257
257
|
if (t && s) {
|
258
|
-
const r =
|
258
|
+
const r = Oe(`${t}(.*)`), o = Me(t, { decode: decodeURIComponent }), a = F(s, {}, !0);
|
259
259
|
n.mock(r, (i) => {
|
260
|
-
const
|
261
|
-
return Object.assign(i, { data:
|
260
|
+
const l = P.parse(i.url) || {}, c = i.body instanceof FormData ? Te(i.body) : i.body, f = o(i.url)?.params;
|
261
|
+
return Object.assign(i, { data: c, params: l, query: f }), n.mock(a(i));
|
262
262
|
});
|
263
263
|
}
|
264
264
|
}
|
265
|
-
function
|
266
|
-
|
265
|
+
function _e() {
|
266
|
+
R && (R._mocked = {});
|
267
267
|
}
|
268
|
-
const
|
268
|
+
const vt = {
|
269
269
|
session: !1,
|
270
270
|
authKey: "Authorization",
|
271
271
|
storageKey: "ACCESS_STORAGE",
|
272
272
|
storagePrefix: "__VTJ_",
|
273
|
-
unauthorized:
|
273
|
+
unauthorized: void 0,
|
274
274
|
auth: "/#/login",
|
275
275
|
redirectParam: "r",
|
276
276
|
unauthorizedCode: 401,
|
277
277
|
unauthorizedMessage: "登录已经失效,请重新登录!",
|
278
|
-
noPermissionMessage: "无权限访问该页面"
|
279
|
-
|
280
|
-
|
278
|
+
noPermissionMessage: "无权限访问该页面",
|
279
|
+
appName: ""
|
280
|
+
}, we = Symbol("access");
|
281
|
+
class bs {
|
281
282
|
options;
|
282
283
|
data = null;
|
283
284
|
mode = _.Raw;
|
284
285
|
constructor(e) {
|
285
|
-
this.options = Object.assign({},
|
286
|
+
this.options = Object.assign({}, vt, e), this.loadData();
|
286
287
|
}
|
287
288
|
connect(e) {
|
288
289
|
const { mode: t, router: s, request: r } = e;
|
289
|
-
this.mode = t, s &&
|
290
|
+
this.mode = t, s && this.mode === _.Raw && this.setGuard(s), r && this.setRequest(r);
|
290
291
|
}
|
291
292
|
login(e) {
|
292
293
|
const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
|
293
|
-
this.setData(e), this.data && (
|
294
|
+
this.setData(e), this.data && (L.save(t, e, {
|
294
295
|
type: "local",
|
295
296
|
prefix: s
|
296
|
-
}), r &&
|
297
|
+
}), r && q.set(o, this.data.token));
|
297
298
|
}
|
298
299
|
clear() {
|
299
300
|
const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
|
300
|
-
this.data = null,
|
301
|
+
this.data = null, L.remove(e, {
|
301
302
|
type: "local",
|
302
303
|
prefix: t
|
303
|
-
}), s &&
|
304
|
+
}), s && q.remove(r);
|
304
305
|
}
|
305
306
|
logout() {
|
306
307
|
this.clear(), this.toLogin();
|
307
308
|
}
|
308
309
|
getData() {
|
309
|
-
return this.data;
|
310
|
+
return this.data ? this.data : (this.loadData(), this.data);
|
310
311
|
}
|
311
312
|
getToken() {
|
312
|
-
return this.data?.token;
|
313
|
+
return this.data || this.loadData(), this.data?.token;
|
313
314
|
}
|
314
315
|
can(e) {
|
315
|
-
const {
|
316
|
-
return typeof e == "function" ? e(
|
316
|
+
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
317
|
+
return typeof e == "function" ? e(s) : ne(e).every((o) => s[o] || s[t + "." + o]);
|
317
318
|
}
|
318
319
|
some(e) {
|
319
|
-
const {
|
320
|
-
return
|
320
|
+
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
321
|
+
return ne(e).some((o) => s[o] || s[t + "." + o]);
|
321
322
|
}
|
322
323
|
install(e) {
|
323
|
-
e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(
|
324
|
+
e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(we, this);
|
324
325
|
}
|
325
326
|
isAuthPath(e) {
|
326
327
|
const { auth: t, isAuth: s } = this.options;
|
@@ -334,20 +335,20 @@ class $s {
|
|
334
335
|
}
|
335
336
|
toLogin() {
|
336
337
|
const { auth: e, redirectParam: t } = this.options;
|
337
|
-
if (!e
|
338
|
+
if (!e) return;
|
338
339
|
const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
|
339
340
|
typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
|
340
341
|
}
|
341
342
|
setData(e) {
|
342
343
|
const { privateKey: t } = this.options;
|
343
344
|
if (Array.isArray(e) && t) {
|
344
|
-
const s = e.map((r) =>
|
345
|
+
const s = e.map((r) => re(r, t));
|
345
346
|
this.data = JSON.parse(s.join(""));
|
346
347
|
return;
|
347
348
|
}
|
348
349
|
if (typeof e == "string")
|
349
350
|
try {
|
350
|
-
const s = t ?
|
351
|
+
const s = t ? re(e, t) : e;
|
351
352
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
352
353
|
} catch (s) {
|
353
354
|
console.warn(s);
|
@@ -356,18 +357,18 @@ class $s {
|
|
356
357
|
this.data = e;
|
357
358
|
}
|
358
359
|
loadData() {
|
359
|
-
const { storageKey: e, storagePrefix: t } = this.options, s =
|
360
|
+
const { storageKey: e, storagePrefix: t } = this.options, s = L.get(e, {
|
360
361
|
type: "local",
|
361
362
|
prefix: t
|
362
363
|
});
|
363
|
-
this.setData(s);
|
364
|
+
this.setData(s || null);
|
364
365
|
}
|
365
366
|
isLogined() {
|
366
367
|
const { session: e, authKey: t } = this.options;
|
367
|
-
return e && t ? !!
|
368
|
+
return e && t ? !!q.get(t) : !!this.getToken();
|
368
369
|
}
|
369
370
|
hasRoutePermission(e) {
|
370
|
-
if (e.name ===
|
371
|
+
if (e.name === k) {
|
371
372
|
const t = e.params.id;
|
372
373
|
return t && this.can(t);
|
373
374
|
}
|
@@ -376,15 +377,15 @@ class $s {
|
|
376
377
|
setGuard(e) {
|
377
378
|
e.beforeEach((t, s, r) => this.guard(t, r));
|
378
379
|
}
|
379
|
-
guard(e, t) {
|
380
|
+
async guard(e, t) {
|
380
381
|
if (this.isWhiteList(e) || this.isAuthPath(e))
|
381
382
|
return t();
|
382
383
|
if (this.isLogined()) {
|
383
384
|
if (this.hasRoutePermission(e))
|
384
385
|
return t();
|
385
386
|
{
|
386
|
-
const s = this.options
|
387
|
-
return this.showTip(s), t(!1);
|
387
|
+
const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
|
388
|
+
return await this.showTip(s), z(r) ? (r(), t(!1)) : S(r) ? t(r) : t(!1);
|
388
389
|
}
|
389
390
|
}
|
390
391
|
t(!1), this.toLogin();
|
@@ -403,10 +404,10 @@ class $s {
|
|
403
404
|
}
|
404
405
|
async showTip(e) {
|
405
406
|
const { alert: t } = this.options;
|
406
|
-
t
|
407
|
+
return t ? (await de(150), await t(e, {
|
407
408
|
title: "提示",
|
408
409
|
type: "warning"
|
409
|
-
}).catch((
|
410
|
+
}).catch(() => !1)) : !1;
|
410
411
|
}
|
411
412
|
setRequest(e) {
|
412
413
|
e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
|
@@ -418,10 +419,10 @@ class $s {
|
|
418
419
|
);
|
419
420
|
}
|
420
421
|
}
|
421
|
-
function
|
422
|
-
return
|
422
|
+
function yt() {
|
423
|
+
return pe(we, null);
|
423
424
|
}
|
424
|
-
class
|
425
|
+
class _t {
|
425
426
|
__id = null;
|
426
427
|
__mode;
|
427
428
|
__instance = null;
|
@@ -450,7 +451,7 @@ class yt {
|
|
450
451
|
const { mode: t, dsl: s, attrs: r } = e;
|
451
452
|
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
|
452
453
|
}
|
453
|
-
setup(e, t =
|
454
|
+
setup(e, t = B) {
|
454
455
|
const s = t.getCurrentInstance();
|
455
456
|
if (!s) return;
|
456
457
|
this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
|
@@ -464,12 +465,12 @@ class yt {
|
|
464
465
|
});
|
465
466
|
}
|
466
467
|
__proxy() {
|
467
|
-
this.__instance &&
|
468
|
+
this.__instance && ae.forEach((e) => {
|
468
469
|
this[e] = this.__instance?.[e];
|
469
470
|
});
|
470
471
|
}
|
471
472
|
__cleanup() {
|
472
|
-
|
473
|
+
ae.forEach((e) => {
|
473
474
|
this[e] = null;
|
474
475
|
});
|
475
476
|
}
|
@@ -477,22 +478,22 @@ class yt {
|
|
477
478
|
if (e)
|
478
479
|
if (this.__mode === _.Runtime) {
|
479
480
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
480
|
-
return
|
481
|
+
return ce({ type: s, value: r }, this);
|
481
482
|
} else
|
482
|
-
return
|
483
|
+
return ce(e, this);
|
483
484
|
}
|
484
485
|
__parseExpression(e) {
|
485
486
|
if (e)
|
486
487
|
if (this.__mode === _.Runtime) {
|
487
488
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
488
|
-
return
|
489
|
+
return F({ type: s, value: r }, this);
|
489
490
|
} else
|
490
|
-
return
|
491
|
+
return F(e, this);
|
491
492
|
}
|
492
493
|
__ref(e = null, t) {
|
493
494
|
if (this.__mode !== _.VNode)
|
494
495
|
return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
|
495
|
-
await
|
496
|
+
await de(0);
|
496
497
|
let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
|
497
498
|
if (!r) {
|
498
499
|
typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
|
@@ -519,72 +520,72 @@ class yt {
|
|
519
520
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
520
521
|
}
|
521
522
|
}
|
522
|
-
function
|
523
|
+
function W(n) {
|
523
524
|
const {
|
524
|
-
Vue: e =
|
525
|
+
Vue: e = B,
|
525
526
|
mode: t = _.Runtime,
|
526
527
|
components: s = {},
|
527
528
|
libs: r = {},
|
528
529
|
apis: o = {},
|
529
530
|
loader: a
|
530
|
-
} = n, i = e.computed(() => n.dsl),
|
531
|
+
} = n, i = e.computed(() => n.dsl), l = {
|
531
532
|
$components: s,
|
532
533
|
$libs: r,
|
533
534
|
$apis: o
|
534
|
-
},
|
535
|
+
}, c = new _t({
|
535
536
|
mode: t,
|
536
537
|
dsl: i.value,
|
537
|
-
attrs:
|
538
|
+
attrs: l
|
538
539
|
}), f = e.defineComponent({
|
539
540
|
name: i.value.name,
|
540
541
|
props: {
|
541
|
-
...
|
542
|
+
...St(i.value.props ?? [], c)
|
542
543
|
},
|
543
|
-
setup(
|
544
|
-
|
544
|
+
setup(u) {
|
545
|
+
c.$props = u, c.props = u, i.value.id && ye(
|
545
546
|
n.window || window,
|
546
547
|
i.value.id,
|
547
548
|
i.value.css || ""
|
548
|
-
),
|
549
|
-
const
|
549
|
+
), c.state = jt(e, i.value.state ?? {}, c);
|
550
|
+
const p = $t(e, i.value.computed ?? {}, c), d = bt(i.value.methods ?? {}, c), h = Et(e, i.value.inject, c), m = Rt(
|
550
551
|
i.value.dataSources || {},
|
551
|
-
|
552
|
-
),
|
552
|
+
c
|
553
|
+
), v = {
|
554
|
+
...h,
|
553
555
|
...p,
|
554
|
-
...
|
555
|
-
...m
|
556
|
-
...h
|
556
|
+
...d,
|
557
|
+
...m
|
557
558
|
};
|
558
|
-
return
|
559
|
-
vtj:
|
559
|
+
return c.setup(v, e), Pt(e, i.value.watch ?? [], c), {
|
560
|
+
vtj: c
|
560
561
|
};
|
561
562
|
},
|
562
|
-
emits:
|
563
|
+
emits: wt(i.value.emits),
|
563
564
|
expose: ["vtj"],
|
564
565
|
render() {
|
565
566
|
if (!i.value.nodes) return null;
|
566
|
-
const
|
567
|
-
return
|
567
|
+
const u = i.value.nodes || [];
|
568
|
+
return u.length === 1 ? H(u[0], c, e, a) : u.map((p) => H(p, c, e, a));
|
568
569
|
},
|
569
|
-
...xt(i.value.lifeCycles ?? {},
|
570
|
+
...xt(i.value.lifeCycles ?? {}, c)
|
570
571
|
});
|
571
572
|
return {
|
572
573
|
renderer: e.markRaw(f),
|
573
|
-
context:
|
574
|
+
context: c
|
574
575
|
};
|
575
576
|
}
|
576
|
-
function
|
577
|
-
return n.map((e) =>
|
577
|
+
function wt(n = []) {
|
578
|
+
return n.map((e) => S(e) ? e : e.name);
|
578
579
|
}
|
579
|
-
function
|
580
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) =>
|
581
|
-
return n.map((s) =>
|
580
|
+
function St(n = [], e) {
|
581
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => tt[o]) : void 0;
|
582
|
+
return n.map((s) => S(s) ? {
|
582
583
|
name: s
|
583
584
|
} : {
|
584
585
|
name: s.name,
|
585
586
|
type: s.type,
|
586
587
|
required: s.required,
|
587
|
-
default:
|
588
|
+
default: w(s.default) ? e.__parseExpression(s.default) : s.default
|
588
589
|
}).reduce(
|
589
590
|
(s, r) => (s[r.name] = {
|
590
591
|
type: t(r.type),
|
@@ -594,47 +595,47 @@ function wt(n = [], e) {
|
|
594
595
|
{}
|
595
596
|
);
|
596
597
|
}
|
597
|
-
function
|
598
|
+
function jt(n, e, t) {
|
598
599
|
return n.reactive(
|
599
600
|
Object.keys(e || {}).reduce(
|
600
601
|
(s, r) => {
|
601
602
|
let o = e[r];
|
602
|
-
return
|
603
|
+
return w(o) ? o = t.__parseExpression(o) : U(o) && (o = t.__parseFunction(o)), s[r] = o, s;
|
603
604
|
},
|
604
605
|
{}
|
605
606
|
)
|
606
607
|
);
|
607
608
|
}
|
608
|
-
function
|
609
|
+
function $t(n, e, t) {
|
609
610
|
return Object.entries(e ?? {}).reduce(
|
610
611
|
(s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
|
611
612
|
{}
|
612
613
|
);
|
613
614
|
}
|
614
|
-
function
|
615
|
+
function bt(n, e) {
|
615
616
|
return Object.entries(n ?? {}).reduce(
|
616
617
|
(t, [s, r]) => (t[s] = e.__parseFunction(r), t),
|
617
618
|
{}
|
618
619
|
);
|
619
620
|
}
|
620
|
-
function
|
621
|
+
function Et(n, e = [], t) {
|
621
622
|
return e.reduce(
|
622
623
|
(s, r) => {
|
623
624
|
const { name: o, from: a } = r || {};
|
624
625
|
r.default;
|
625
|
-
const i =
|
626
|
-
return s[o] = n.inject(i,
|
626
|
+
const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
|
627
|
+
return s[o] = n.inject(i, l), s;
|
627
628
|
},
|
628
629
|
{}
|
629
630
|
);
|
630
631
|
}
|
631
|
-
function
|
632
|
+
function Rt(n, e) {
|
632
633
|
return Object.keys(n).reduce(
|
633
634
|
(t, s) => {
|
634
|
-
const r = n[s], o = e.$apis[r.ref], a =
|
635
|
+
const r = n[s], o = e.$apis[r.ref], a = U(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
635
636
|
return t[s] = async (...i) => {
|
636
|
-
const
|
637
|
-
return a ? a(
|
637
|
+
const l = await o.apply(e, i);
|
638
|
+
return a ? a(l) : l;
|
638
639
|
}, t;
|
639
640
|
},
|
640
641
|
{}
|
@@ -658,78 +659,78 @@ function xt(n, e) {
|
|
658
659
|
{}
|
659
660
|
);
|
660
661
|
}
|
661
|
-
let
|
662
|
-
const
|
663
|
-
async function
|
664
|
-
const { urls: t = [], library: s } = n, r = t.filter((i) =>
|
662
|
+
let V = [];
|
663
|
+
const kt = (n) => n;
|
664
|
+
async function Se(n, e = window) {
|
665
|
+
const { urls: t = [], library: s } = n, r = t.filter((i) => Z(i));
|
665
666
|
if (r.length === 0 || !s) return null;
|
666
|
-
const o = t.filter((i) =>
|
667
|
-
return o.length &&
|
667
|
+
const o = t.filter((i) => X(i));
|
668
|
+
return o.length && at(o, e), await ct(r, s, e).catch(
|
668
669
|
(i) => (console.warn("loadScriptUrl error", r, s, i), null)
|
669
670
|
);
|
670
671
|
}
|
671
|
-
function
|
672
|
+
function G(n) {
|
672
673
|
const { getDsl: e, getDslByUrl: t, options: s } = n;
|
673
|
-
return s.window && (
|
674
|
+
return s.window && (V.forEach((r) => {
|
674
675
|
delete s.window[r];
|
675
|
-
}),
|
676
|
+
}), V = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
|
676
677
|
const i = await e(o.id);
|
677
|
-
return i && (i.name = r), i ?
|
678
|
+
return i && (i.name = r), i ? W({
|
678
679
|
...s,
|
679
680
|
Vue: a,
|
680
681
|
dsl: i,
|
681
682
|
mode: _.Runtime,
|
682
|
-
loader:
|
683
|
+
loader: G(n)
|
683
684
|
}).renderer : null;
|
684
685
|
}) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
|
685
686
|
const i = await t(o.url);
|
686
|
-
return i && (i.name = r), i ?
|
687
|
+
return i && (i.name = r), i ? W({
|
687
688
|
...s,
|
688
689
|
Vue: a,
|
689
690
|
dsl: i,
|
690
691
|
mode: _.Runtime,
|
691
|
-
loader:
|
692
|
+
loader: G(n)
|
692
693
|
}).renderer : null;
|
693
|
-
}) : o.type === "Plugin" ? (o.library &&
|
694
|
-
const i = await
|
694
|
+
}) : o.type === "Plugin" ? (o.library && V.push(o.library), a.defineAsyncComponent(async () => {
|
695
|
+
const i = await Se(o, s.window);
|
695
696
|
return i || (console.warn("getPlugin result is null", o), null);
|
696
697
|
})) : r;
|
697
698
|
}
|
698
|
-
function
|
699
|
+
function H(n, e, t = B, s = kt) {
|
699
700
|
if (!n || !n.name || n.invisible) return null;
|
700
|
-
const { id:
|
701
|
-
if (
|
701
|
+
const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: l, vShow: c, vModels: f, vBind: u } = Ct(a);
|
702
|
+
if (i && !Ft(i, e))
|
702
703
|
return null;
|
703
|
-
const
|
704
|
-
const
|
704
|
+
const p = (d) => {
|
705
|
+
const h = d.$components, m = (() => {
|
705
706
|
if (n.name === "component")
|
706
|
-
return
|
707
|
+
return At(d, n.props?.is);
|
707
708
|
if (n.name === "slot") return n.name;
|
708
|
-
const
|
709
|
-
return j
|
710
|
-
})(),
|
709
|
+
const j = s(n.name, n.from, t);
|
710
|
+
return S(j) ? h[j] ?? r?.app?.component(j) ?? j : j;
|
711
|
+
})(), v = It(o, n.props ?? {}, d), g = Ot(t, n.events ?? {}, d);
|
711
712
|
if (n.name === "slot")
|
712
|
-
return
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
)),
|
717
|
-
Object.assign(
|
713
|
+
return Mt(t, n, v, d, s);
|
714
|
+
u && Object.assign(v, d.__parseExpression(u.value)), c && (v.style = Object.assign(
|
715
|
+
v.style ?? {},
|
716
|
+
Dt(c, d)
|
717
|
+
)), f.forEach((j) => {
|
718
|
+
Object.assign(v, Ht(t, j, d));
|
718
719
|
});
|
719
|
-
const
|
720
|
+
const A = Bt(
|
720
721
|
t,
|
721
722
|
n.children ?? [],
|
722
|
-
|
723
|
+
d,
|
723
724
|
s,
|
724
725
|
n
|
725
726
|
);
|
726
|
-
return t.createVNode(
|
727
|
+
return t.createVNode(m, { ...v, ...g }, A);
|
727
728
|
};
|
728
|
-
return
|
729
|
+
return l ? Lt(l, p, e) : p(e);
|
729
730
|
}
|
730
|
-
function
|
731
|
+
function Ct(n = []) {
|
731
732
|
const e = n.find((i) => $(i.name) === "vIf"), t = n.find((i) => $(i.name) === "vFor"), s = n.find((i) => $(i.name) === "vShow"), r = n.find((i) => $(i.name) === "vBind"), o = n.filter((i) => $(i.name) === "vModel"), a = n.filter(
|
732
|
-
(i) => !
|
733
|
+
(i) => !et.includes($(i.name))
|
733
734
|
);
|
734
735
|
return {
|
735
736
|
vIf: e,
|
@@ -740,23 +741,23 @@ function kt(n = []) {
|
|
740
741
|
others: a
|
741
742
|
};
|
742
743
|
}
|
743
|
-
function
|
744
|
+
function Ft(n, e) {
|
744
745
|
return !!e.__parseExpression(n.value);
|
745
746
|
}
|
746
|
-
function
|
747
|
-
return e ?
|
747
|
+
function At(n, e) {
|
748
|
+
return e ? w(e) ? n.__parseExpression(e) : e : "div";
|
748
749
|
}
|
749
|
-
function
|
750
|
+
function It(n, e, t) {
|
750
751
|
const s = Object.keys(e || {}).reduce(
|
751
752
|
(r, o) => {
|
752
753
|
let a = e[o];
|
753
|
-
return
|
754
|
+
return w(a) ? a = t.__parseExpression(a) : U(a) && (a = t.__parseFunction(a)), r[o] = a, r;
|
754
755
|
},
|
755
756
|
{}
|
756
757
|
);
|
757
758
|
return s.ref = t.__ref(n, s.ref), s;
|
758
759
|
}
|
759
|
-
function
|
760
|
+
function Ot(n, e, t) {
|
760
761
|
const s = ["passive", "capture", "once"], r = {
|
761
762
|
capture: "Capture",
|
762
763
|
once: "Once",
|
@@ -764,70 +765,70 @@ function It(n, e, t) {
|
|
764
765
|
};
|
765
766
|
return Object.keys(e || {}).reduce(
|
766
767
|
(o, a) => {
|
767
|
-
const i = e[a],
|
768
|
-
return
|
768
|
+
const i = e[a], l = je(i.modifiers), c = l.find((p) => s.includes(p)), f = "on" + De(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
|
769
|
+
return u && (o[f] = n.withModifiers(u, l)), o;
|
769
770
|
},
|
770
771
|
{}
|
771
772
|
);
|
772
773
|
}
|
773
|
-
function
|
774
|
+
function je(n = {}, e = !1) {
|
774
775
|
const t = Object.keys(n);
|
775
776
|
return e ? t.map((s) => "." + s) : t;
|
776
777
|
}
|
777
|
-
function
|
778
|
-
const { children: o } = e, a =
|
779
|
-
return i ? i(t) : o ?
|
780
|
-
|
778
|
+
function Mt(n, e, t, s, r) {
|
779
|
+
const { children: o } = e, a = Tt(e, s), i = s.$slots?.[a.name];
|
780
|
+
return i ? i(t) : o ? S(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
|
781
|
+
ve(s.__parseExpression(o))
|
781
782
|
) : Array.isArray(o) ? o.map(
|
782
|
-
(
|
783
|
+
(l) => H(l, s, n, r)
|
783
784
|
) : null : null;
|
784
785
|
}
|
785
|
-
function
|
786
|
+
function Tt(n, e) {
|
786
787
|
const { props: t } = n, s = t?.name || "default";
|
787
788
|
return {
|
788
|
-
name:
|
789
|
+
name: w(s) ? e.__parseExpression(s) : s,
|
789
790
|
params: []
|
790
791
|
};
|
791
792
|
}
|
792
|
-
function
|
793
|
+
function Dt(n, e) {
|
793
794
|
return e.__parseExpression(n.value) ? {} : {
|
794
795
|
display: "none"
|
795
796
|
};
|
796
797
|
}
|
797
|
-
function
|
798
|
+
function Ht(n, e, t) {
|
798
799
|
const s = {
|
799
800
|
type: "JSFunction",
|
800
801
|
value: e.value?.value ? `(v) => {
|
801
802
|
${e.value.value} = v;
|
802
803
|
}` : "(v) => {}"
|
803
|
-
}, r = t.__parseFunction(s), o =
|
804
|
+
}, r = t.__parseFunction(s), o = je(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
804
805
|
return {
|
805
806
|
[a]: t.__parseExpression(e.value),
|
806
807
|
[`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
|
807
808
|
};
|
808
809
|
}
|
809
|
-
function
|
810
|
+
function Bt(n, e, t, s, r) {
|
810
811
|
if (!e) return null;
|
811
|
-
if (j(e))
|
812
|
-
return { default: () => e };
|
813
812
|
if (S(e))
|
813
|
+
return { default: () => e };
|
814
|
+
if (w(e))
|
814
815
|
return {
|
815
|
-
default: () =>
|
816
|
+
default: () => ve(t.__parseExpression(e))
|
816
817
|
};
|
817
818
|
if (Array.isArray(e) && e.length > 0) {
|
818
|
-
const o =
|
819
|
+
const o = Nt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
|
819
820
|
[`scope_${r.id}`]: i
|
820
821
|
} : {};
|
821
|
-
return Object.entries(o).reduce((i, [
|
822
|
-
const
|
823
|
-
return
|
824
|
-
(
|
822
|
+
return Object.entries(o).reduce((i, [l, { nodes: c, params: f }]) => (i[l] = (u) => {
|
823
|
+
const p = f.length ? He(u ?? {}, f) : a(u);
|
824
|
+
return c.map(
|
825
|
+
(d) => H(d, t.__clone(p), n, s)
|
825
826
|
);
|
826
827
|
}, i), {});
|
827
828
|
}
|
828
829
|
return null;
|
829
830
|
}
|
830
|
-
function
|
831
|
+
function Nt(n) {
|
831
832
|
const e = {
|
832
833
|
default: {
|
833
834
|
params: [],
|
@@ -844,142 +845,148 @@ function Bt(n) {
|
|
844
845
|
return e;
|
845
846
|
}
|
846
847
|
function Ut(n = "default") {
|
847
|
-
return
|
848
|
+
return S(n) ? { name: n, params: [] } : { params: [], ...n };
|
848
849
|
}
|
849
|
-
function
|
850
|
+
function Lt(n, e, t) {
|
850
851
|
const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
|
851
852
|
let i = t.__parseExpression(s) || [];
|
852
|
-
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((
|
853
|
+
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 }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
853
854
|
}
|
854
|
-
function
|
855
|
-
return
|
855
|
+
function qt(n) {
|
856
|
+
return ze() ? (Ke(n), !0) : !1;
|
856
857
|
}
|
857
|
-
function
|
858
|
-
return typeof n == "function" ? n() :
|
858
|
+
function ee(n) {
|
859
|
+
return typeof n == "function" ? n() : We(n);
|
859
860
|
}
|
860
|
-
const
|
861
|
+
const $e = typeof window < "u" && typeof document < "u";
|
861
862
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
862
|
-
const
|
863
|
+
const Jt = (n) => n != null, Vt = () => {
|
863
864
|
};
|
864
|
-
function
|
865
|
-
return
|
865
|
+
function zt(n) {
|
866
|
+
return fe();
|
866
867
|
}
|
867
|
-
function
|
868
|
+
function Kt(...n) {
|
868
869
|
if (n.length !== 1)
|
869
|
-
return
|
870
|
+
return Le(...n);
|
870
871
|
const e = n[0];
|
871
|
-
return typeof e == "function" ?
|
872
|
+
return typeof e == "function" ? qe(Je(() => ({ get: e, set: Vt }))) : C(e);
|
872
873
|
}
|
873
|
-
function
|
874
|
-
|
874
|
+
function Wt(n, e) {
|
875
|
+
zt() && Ve(n, e);
|
875
876
|
}
|
876
|
-
const
|
877
|
-
function
|
877
|
+
const Gt = $e ? window : void 0, Yt = $e ? window.document : void 0;
|
878
|
+
function Qt(n) {
|
878
879
|
var e;
|
879
|
-
const t =
|
880
|
+
const t = ee(n);
|
880
881
|
return (e = t?.$el) != null ? e : t;
|
881
882
|
}
|
882
|
-
function
|
883
|
-
const n =
|
884
|
-
return e &&
|
883
|
+
function Xt() {
|
884
|
+
const n = C(!1), e = fe();
|
885
|
+
return e && Ge(() => {
|
885
886
|
n.value = !0;
|
886
887
|
}, e), n;
|
887
888
|
}
|
888
|
-
function
|
889
|
-
const e =
|
890
|
-
return
|
889
|
+
function Zt(n) {
|
890
|
+
const e = Xt();
|
891
|
+
return me(() => (e.value, !!n()));
|
891
892
|
}
|
892
|
-
function
|
893
|
-
const { window: s =
|
893
|
+
function es(n, e, t = {}) {
|
894
|
+
const { window: s = Gt, ...r } = t;
|
894
895
|
let o;
|
895
|
-
const a =
|
896
|
+
const a = Zt(() => s && "MutationObserver" in s), i = () => {
|
896
897
|
o && (o.disconnect(), o = void 0);
|
897
|
-
},
|
898
|
-
const
|
899
|
-
return new Set(
|
900
|
-
}),
|
901
|
-
() =>
|
902
|
-
(
|
903
|
-
i(), a.value &&
|
898
|
+
}, l = me(() => {
|
899
|
+
const p = ee(n), d = (Array.isArray(p) ? p : [p]).map(Qt).filter(Jt);
|
900
|
+
return new Set(d);
|
901
|
+
}), c = he(
|
902
|
+
() => l.value,
|
903
|
+
(p) => {
|
904
|
+
i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((d) => o.observe(d, r)));
|
904
905
|
},
|
905
906
|
{ immediate: !0, flush: "post" }
|
906
|
-
), f = () => o?.takeRecords(),
|
907
|
-
|
907
|
+
), f = () => o?.takeRecords(), u = () => {
|
908
|
+
c(), i();
|
908
909
|
};
|
909
|
-
return
|
910
|
+
return qt(u), {
|
910
911
|
isSupported: a,
|
911
|
-
stop:
|
912
|
+
stop: u,
|
912
913
|
takeRecords: f
|
913
914
|
};
|
914
915
|
}
|
915
|
-
function
|
916
|
+
function ts(n = null, e = {}) {
|
916
917
|
var t, s, r;
|
917
918
|
const {
|
918
|
-
document: o =
|
919
|
-
restoreOnUnmount: a = (
|
920
|
-
} = e, i = (t = o?.title) != null ? t : "",
|
921
|
-
function f(
|
919
|
+
document: o = Yt,
|
920
|
+
restoreOnUnmount: a = (u) => u
|
921
|
+
} = e, i = (t = o?.title) != null ? t : "", l = Kt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
|
922
|
+
function f(u) {
|
922
923
|
if (!("titleTemplate" in e))
|
923
|
-
return
|
924
|
-
const
|
925
|
-
return typeof
|
926
|
-
}
|
927
|
-
return
|
928
|
-
|
929
|
-
(
|
930
|
-
|
924
|
+
return u;
|
925
|
+
const p = e.titleTemplate || "%s";
|
926
|
+
return typeof p == "function" ? p(u) : ee(p).replace(/%s/g, u);
|
927
|
+
}
|
928
|
+
return he(
|
929
|
+
l,
|
930
|
+
(u, p) => {
|
931
|
+
u !== p && o && (o.title = f(typeof u == "string" ? u : ""));
|
931
932
|
},
|
932
933
|
{ immediate: !0 }
|
933
|
-
), e.observe && !e.titleTemplate && o && !
|
934
|
+
), e.observe && !e.titleTemplate && o && !c && es(
|
934
935
|
(r = o.head) == null ? void 0 : r.querySelector("title"),
|
935
936
|
() => {
|
936
|
-
o && o.title !==
|
937
|
+
o && o.title !== l.value && (l.value = f(o.title));
|
937
938
|
},
|
938
939
|
{ childList: !0 }
|
939
|
-
),
|
940
|
+
), Wt(() => {
|
940
941
|
if (a) {
|
941
|
-
const
|
942
|
-
|
942
|
+
const u = a(i, l.value || "");
|
943
|
+
u != null && o && (o.title = u);
|
943
944
|
}
|
944
|
-
}),
|
945
|
+
}), l;
|
945
946
|
}
|
946
|
-
const
|
947
|
+
const le = Q({
|
947
948
|
name: "VtjPageContainer",
|
948
949
|
async setup() {
|
949
|
-
const n =
|
950
|
-
return s && (Object.assign(e.meta, s.meta || {}),
|
950
|
+
const n = Ee(), e = ge(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = C(Symbol());
|
951
|
+
return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), ts(s.title || "VTJ")), {
|
951
952
|
provider: n,
|
952
953
|
component: r,
|
953
954
|
file: s,
|
954
955
|
query: e.query,
|
955
|
-
meta:
|
956
|
+
meta: e.meta,
|
957
|
+
sid: o,
|
958
|
+
route: e
|
956
959
|
};
|
957
960
|
},
|
958
961
|
render() {
|
959
|
-
const { component: n, query: e } = this;
|
960
|
-
return n ?
|
962
|
+
const { component: n, query: e, sid: t } = this;
|
963
|
+
return n ? K(n, { ...e, key: t }) : K("div", "页面不存在");
|
964
|
+
},
|
965
|
+
activated() {
|
966
|
+
this.meta.cache === !1 && (this.sid = Symbol());
|
961
967
|
}
|
962
|
-
}),
|
968
|
+
}), ss = {
|
963
969
|
"data-l-h6o7ki7": "",
|
964
970
|
class: "vtj-startup__wrapper"
|
965
|
-
},
|
971
|
+
}, ns = {
|
966
972
|
"data-l-h6o7ki7": "",
|
967
973
|
class: "vtj-startup"
|
968
|
-
},
|
974
|
+
}, rs = {
|
969
975
|
"data-l-h6o7ki7": "",
|
970
976
|
class: "vtj-startup__name"
|
971
|
-
},
|
977
|
+
}, os = { "data-l-h6o7ki7": "" }, is = {
|
972
978
|
"data-l-h6o7ki7": "",
|
973
979
|
class: "vtj-startup__tagline"
|
974
|
-
},
|
980
|
+
}, as = {
|
975
981
|
"data-l-h6o7ki7": "",
|
976
982
|
class: "vtj-startup__actions"
|
977
|
-
},
|
983
|
+
}, cs = /* @__PURE__ */ Q({
|
978
984
|
__name: "Startup",
|
979
985
|
props: {
|
980
986
|
name: { default: "VTJ.PRO" },
|
981
987
|
tagline: { default: "基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台" },
|
982
|
-
actionText: { default: "开始设计" }
|
988
|
+
actionText: { default: "开始设计" },
|
989
|
+
link: {}
|
983
990
|
},
|
984
991
|
setup(n) {
|
985
992
|
((r, o) => {
|
@@ -1053,33 +1060,37 @@ const ae = K({
|
|
1053
1060
|
}`);
|
1054
1061
|
const t = n, s = () => {
|
1055
1062
|
if (typeof window < "u") {
|
1063
|
+
if (t.link) {
|
1064
|
+
typeof t.link == "function" ? t.link() : window.location.href = t.link;
|
1065
|
+
return;
|
1066
|
+
}
|
1056
1067
|
let o = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "__vtj__/#/";
|
1057
1068
|
window.location.href = o;
|
1058
1069
|
}
|
1059
1070
|
};
|
1060
|
-
return (r, o) => (
|
1061
|
-
b("div",
|
1062
|
-
b("h1",
|
1063
|
-
b("span",
|
1071
|
+
return (r, o) => (Ye(), Qe("div", ss, [
|
1072
|
+
b("div", ns, [
|
1073
|
+
b("h1", rs, [
|
1074
|
+
b("span", os, J(t.name), 1)
|
1064
1075
|
]),
|
1065
|
-
b("div",
|
1066
|
-
b("div",
|
1076
|
+
b("div", is, J(t.tagline), 1),
|
1077
|
+
b("div", as, [
|
1067
1078
|
b("button", {
|
1068
1079
|
"data-l-h6o7ki7": "",
|
1069
1080
|
onClick: s
|
1070
|
-
},
|
1081
|
+
}, J(t.actionText), 1)
|
1071
1082
|
])
|
1072
1083
|
])
|
1073
1084
|
]));
|
1074
1085
|
}
|
1075
|
-
}),
|
1086
|
+
}), ls = Q({
|
1076
1087
|
name: "VtjStartupContainer",
|
1077
1088
|
render() {
|
1078
|
-
return
|
1089
|
+
return K(cs);
|
1079
1090
|
}
|
1080
|
-
}),
|
1081
|
-
var
|
1082
|
-
class
|
1091
|
+
}), be = Symbol("Provider");
|
1092
|
+
var us = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(us || {});
|
1093
|
+
class ds extends xe {
|
1083
1094
|
constructor(e) {
|
1084
1095
|
super(), this.options = e;
|
1085
1096
|
const {
|
@@ -1089,21 +1100,21 @@ class us extends xe {
|
|
1089
1100
|
materials: o,
|
1090
1101
|
project: a = {},
|
1091
1102
|
adapter: i = {},
|
1092
|
-
globals:
|
1093
|
-
modules:
|
1103
|
+
globals: l = {},
|
1104
|
+
modules: c = {},
|
1094
1105
|
router: f = null,
|
1095
|
-
materialPath:
|
1096
|
-
nodeEnv:
|
1106
|
+
materialPath: u = "./",
|
1107
|
+
nodeEnv: p = "development"
|
1097
1108
|
/* Development */
|
1098
1109
|
} = e;
|
1099
|
-
this.mode = s, this.modules =
|
1100
|
-
const { access:
|
1101
|
-
|
1110
|
+
this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
|
1111
|
+
const { access: d, request: h } = this.adapter;
|
1112
|
+
d && d.connect({ mode: s, router: f, request: h }), a && s !== _.Design ? this.load(a) : this.project = a;
|
1102
1113
|
}
|
1103
1114
|
mode;
|
1104
1115
|
globals = {};
|
1105
1116
|
modules = {};
|
1106
|
-
adapter = { request:
|
1117
|
+
adapter = { request: dt, jsonp: Be };
|
1107
1118
|
apis = {};
|
1108
1119
|
dependencies = {};
|
1109
1120
|
materials = {};
|
@@ -1120,77 +1131,79 @@ class us extends xe {
|
|
1120
1131
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
1121
1132
|
throw new Error("project is null");
|
1122
1133
|
const { apis: s = [], meta: r = [] } = this.project, o = window;
|
1123
|
-
o.CKEDITOR_VERSION = void 0, this.
|
1134
|
+
o.CKEDITOR_VERSION = void 0, this.mode === _.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = ht(s, r, this.adapter), _e(), this.project.config?.mock && mt(s), this.initRouter(), this.triggerReady();
|
1124
1135
|
}
|
1125
1136
|
async loadDependencies(e) {
|
1126
1137
|
const t = Object.entries(this.dependencies);
|
1127
1138
|
for (const [s, r] of t)
|
1128
|
-
e[s] || (e[s] = await r());
|
1139
|
+
e[s] || (e[s] = this.library[s] = await r());
|
1129
1140
|
}
|
1130
1141
|
async loadAssets(e) {
|
1131
1142
|
const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
|
1132
|
-
libraryExports:
|
1133
|
-
libraryMap:
|
1143
|
+
libraryExports: l,
|
1144
|
+
libraryMap: c,
|
1134
1145
|
materials: f,
|
1135
|
-
materialExports:
|
1136
|
-
materialMapLibrary:
|
1137
|
-
} =
|
1146
|
+
materialExports: u,
|
1147
|
+
materialMapLibrary: p
|
1148
|
+
} = rt(
|
1138
1149
|
t,
|
1139
1150
|
a,
|
1140
1151
|
i === "development"
|
1141
1152
|
/* Development */
|
1142
1153
|
);
|
1143
|
-
for (const
|
1144
|
-
const h = s[
|
1145
|
-
if (
|
1146
|
-
r[
|
1154
|
+
for (const d of l) {
|
1155
|
+
const h = s[d], m = e[d];
|
1156
|
+
if (m)
|
1157
|
+
r[d] = m;
|
1147
1158
|
else if (h)
|
1148
|
-
e[
|
1159
|
+
e[d] = r[d] = await h();
|
1149
1160
|
else {
|
1150
|
-
const
|
1151
|
-
for (const
|
1152
|
-
|
1153
|
-
r[
|
1161
|
+
const v = c[d] || [];
|
1162
|
+
for (const g of v)
|
1163
|
+
X(g) && await it(d, P.append(g, { v: x })), Z(g) && await oe(P.append(g, { v: x }));
|
1164
|
+
r[d] = e[d];
|
1154
1165
|
}
|
1155
1166
|
}
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
const h
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1167
|
+
if (i === "development") {
|
1168
|
+
for (const h of f)
|
1169
|
+
await oe(P.append(h, { v: x }));
|
1170
|
+
const d = this.materials || {};
|
1171
|
+
for (const h of u) {
|
1172
|
+
const m = e[p[h]], v = ke[h];
|
1173
|
+
if (v)
|
1174
|
+
m && v.forEach((g) => {
|
1175
|
+
o[g] = m[g];
|
1176
|
+
});
|
1177
|
+
else {
|
1178
|
+
const g = d[h] ? (await d[h]()).default : e[h];
|
1179
|
+
g && m && (g.components || []).forEach((A) => {
|
1180
|
+
o[A.name] = ot(A, m);
|
1181
|
+
});
|
1182
|
+
}
|
1170
1183
|
}
|
1171
1184
|
}
|
1172
1185
|
}
|
1173
1186
|
initRouter() {
|
1174
|
-
const { router: e, project: t, options: s } = this;
|
1187
|
+
const { router: e, project: t, options: s, adapter: r } = this;
|
1175
1188
|
if (!e) return;
|
1176
|
-
const {
|
1177
|
-
path:
|
1178
|
-
name:
|
1179
|
-
component:
|
1180
|
-
},
|
1181
|
-
path:
|
1182
|
-
name:
|
1183
|
-
component: t?.homepage ?
|
1184
|
-
meta:
|
1189
|
+
const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, l = o ? "" : "/", c = {
|
1190
|
+
path: `${l}${a}/:id`,
|
1191
|
+
name: k,
|
1192
|
+
component: le
|
1193
|
+
}, f = {
|
1194
|
+
path: l,
|
1195
|
+
name: M,
|
1196
|
+
component: t?.homepage ? le : r.startupComponent || ls,
|
1197
|
+
meta: i
|
1185
1198
|
};
|
1186
|
-
|
1199
|
+
e.hasRoute(k) && e.removeRoute(k), e.hasRoute(M) && e.removeRoute(M), o ? (e.addRoute(o, c), e.addRoute(o, f)) : (e.addRoute(c), e.addRoute(f));
|
1187
1200
|
}
|
1188
1201
|
install(e) {
|
1189
1202
|
const t = e.config.globalProperties.installed || {};
|
1190
1203
|
for (const [s, r] of Object.entries(this.library))
|
1191
|
-
!t[s] &&
|
1192
|
-
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(
|
1193
|
-
const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误",
|
1204
|
+
!t[s] && lt(r) && (e.use(r), t[s] = !0);
|
1205
|
+
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(be, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
|
1206
|
+
const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
|
1194
1207
|
console.error(
|
1195
1208
|
"[VTJ Error]:",
|
1196
1209
|
{
|
@@ -1199,9 +1212,9 @@ class us extends xe {
|
|
1199
1212
|
info: o
|
1200
1213
|
},
|
1201
1214
|
s?.stack
|
1202
|
-
),
|
1215
|
+
), N.error({
|
1203
1216
|
title: "未处理的异常:请在控制台查看详情",
|
1204
|
-
message:
|
1217
|
+
message: l
|
1205
1218
|
});
|
1206
1219
|
});
|
1207
1220
|
}
|
@@ -1229,7 +1242,7 @@ class us extends xe {
|
|
1229
1242
|
}
|
1230
1243
|
async getDsl(e) {
|
1231
1244
|
const t = this.modules[`.vtj/files/${e}.json`];
|
1232
|
-
return t ? await t() : this.service.getFile(e).catch(() => null);
|
1245
|
+
return t ? await t() : this.service.getFile(e, this.project || void 0).catch(() => null);
|
1233
1246
|
}
|
1234
1247
|
async getDslByUrl(e) {
|
1235
1248
|
const t = this.urlDslCaches[e];
|
@@ -1251,54 +1264,54 @@ class us extends xe {
|
|
1251
1264
|
apis: a,
|
1252
1265
|
window,
|
1253
1266
|
...t
|
1254
|
-
},
|
1255
|
-
getDsl: async (
|
1256
|
-
getDslByUrl: async (
|
1267
|
+
}, l = G({
|
1268
|
+
getDsl: async (c) => await this.getDsl(c) || null,
|
1269
|
+
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
1257
1270
|
options: i
|
1258
1271
|
});
|
1259
|
-
return
|
1272
|
+
return W({
|
1260
1273
|
...i,
|
1261
1274
|
dsl: e,
|
1262
|
-
loader:
|
1275
|
+
loader: l
|
1263
1276
|
});
|
1264
1277
|
}
|
1265
1278
|
async getRenderComponent(e, t) {
|
1266
1279
|
const s = this.getFile(e);
|
1267
1280
|
if (!s)
|
1268
|
-
return
|
1281
|
+
return D.warn(`Can not find file: ${e}`), null;
|
1269
1282
|
t && t(s);
|
1270
1283
|
const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
|
1271
1284
|
if (o)
|
1272
1285
|
return (await o())?.default;
|
1273
1286
|
const a = await this.getDsl(s.id);
|
1274
|
-
return a ? this.createDslRenderer(a).renderer : (
|
1287
|
+
return a ? this.createDslRenderer(a).renderer : (D.warn(`Can not find dsl: ${e}`), null);
|
1275
1288
|
}
|
1276
1289
|
defineUrlSchemaComponent(e, t) {
|
1277
|
-
return
|
1290
|
+
return ie(async () => {
|
1278
1291
|
const s = await this.getDslByUrl(e);
|
1279
1292
|
return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
|
1280
1293
|
});
|
1281
1294
|
}
|
1282
1295
|
definePluginComponent(e) {
|
1283
|
-
return
|
1296
|
+
return ie(async () => await Se(e, window));
|
1284
1297
|
}
|
1285
1298
|
}
|
1286
|
-
function
|
1287
|
-
const e = new
|
1299
|
+
function Es(n) {
|
1300
|
+
const e = new ds(n);
|
1288
1301
|
return {
|
1289
1302
|
provider: e,
|
1290
1303
|
onReady: (s) => e.ready(s)
|
1291
1304
|
};
|
1292
1305
|
}
|
1293
|
-
function
|
1294
|
-
const e =
|
1306
|
+
function Ee(n = {}) {
|
1307
|
+
const e = pe(be);
|
1295
1308
|
if (!e)
|
1296
1309
|
throw new Error("Can not find provider");
|
1297
1310
|
if (e.nodeEnv === "development") {
|
1298
1311
|
const { id: t, version: s } = n;
|
1299
1312
|
t && s && (async () => {
|
1300
1313
|
const r = await e.getDsl(t);
|
1301
|
-
r?.__VERSION__ !== s &&
|
1314
|
+
r?.__VERSION__ !== s && N.warning({
|
1302
1315
|
title: r?.name,
|
1303
1316
|
message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
|
1304
1317
|
});
|
@@ -1306,7 +1319,7 @@ function be(n = {}) {
|
|
1306
1319
|
}
|
1307
1320
|
return e;
|
1308
1321
|
}
|
1309
|
-
const
|
1322
|
+
const te = new Ne({
|
1310
1323
|
settings: {
|
1311
1324
|
type: "json",
|
1312
1325
|
validSuccess: !0,
|
@@ -1314,12 +1327,12 @@ const X = new Be({
|
|
1314
1327
|
failMessage: !0,
|
1315
1328
|
validate: (n) => n.data?.code === 0,
|
1316
1329
|
showError: (n) => {
|
1317
|
-
|
1330
|
+
N.error({
|
1318
1331
|
message: n || "未知错误"
|
1319
1332
|
});
|
1320
1333
|
}
|
1321
1334
|
}
|
1322
|
-
}),
|
1335
|
+
}), ps = (n = "/__vtj__/api/:type.json") => (e, t) => te.send({
|
1323
1336
|
url: n,
|
1324
1337
|
method: "post",
|
1325
1338
|
params: { type: e },
|
@@ -1327,7 +1340,7 @@ const X = new Be({
|
|
1327
1340
|
type: e,
|
1328
1341
|
data: t
|
1329
1342
|
}
|
1330
|
-
}),
|
1343
|
+
}), fs = (n = "/__vtj__/api/uploader.json") => async (e, t) => await te.send({
|
1331
1344
|
url: n,
|
1332
1345
|
method: "post",
|
1333
1346
|
data: {
|
@@ -1338,12 +1351,12 @@ const X = new Be({
|
|
1338
1351
|
type: "data"
|
1339
1352
|
}
|
1340
1353
|
}).then((s) => s && s[0] ? s[0] : null).catch(() => null);
|
1341
|
-
class
|
1354
|
+
class se {
|
1342
1355
|
api;
|
1343
1356
|
pluginCaches = {};
|
1344
1357
|
uploader;
|
1345
1358
|
constructor() {
|
1346
|
-
this.api =
|
1359
|
+
this.api = ps(), this.uploader = fs();
|
1347
1360
|
}
|
1348
1361
|
async getExtension() {
|
1349
1362
|
console.log("BaseService.getExtension");
|
@@ -1416,10 +1429,10 @@ class Z {
|
|
1416
1429
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
1417
1430
|
}
|
1418
1431
|
async getPluginMaterial(e) {
|
1419
|
-
const { urls: t = [] } = e, s = t.filter((o) =>
|
1432
|
+
const { urls: t = [] } = e, s = t.filter((o) => st(o))[0];
|
1420
1433
|
if (!s) return null;
|
1421
1434
|
const r = this.pluginCaches[s];
|
1422
|
-
return r || (this.pluginCaches[s] =
|
1435
|
+
return r || (this.pluginCaches[s] = te.send({
|
1423
1436
|
url: s,
|
1424
1437
|
method: "get",
|
1425
1438
|
settings: {
|
@@ -1428,23 +1441,26 @@ class Z {
|
|
1428
1441
|
}
|
1429
1442
|
}).then((o) => o.data).catch(() => null));
|
1430
1443
|
}
|
1444
|
+
async genSource(e) {
|
1445
|
+
return console.log("BaseService.genSource", e), "";
|
1446
|
+
}
|
1431
1447
|
}
|
1432
1448
|
const y = new Ue({
|
1433
1449
|
type: "local",
|
1434
1450
|
expired: 0,
|
1435
1451
|
prefix: "__VTJ_"
|
1436
1452
|
});
|
1437
|
-
class
|
1453
|
+
class Rs extends se {
|
1438
1454
|
init(e) {
|
1439
|
-
const t = new
|
1455
|
+
const t = new T(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
1440
1456
|
return y.save(`project_${t.id}`, r), Promise.resolve(r);
|
1441
1457
|
}
|
1442
1458
|
saveProject(e) {
|
1443
|
-
const t = new
|
1459
|
+
const t = new T(e);
|
1444
1460
|
return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
1445
1461
|
}
|
1446
1462
|
saveMaterials(e, t) {
|
1447
|
-
return y.save(`materials_${e.id}`,
|
1463
|
+
return y.save(`materials_${e.id}`, Y(t)), Promise.resolve(!0);
|
1448
1464
|
}
|
1449
1465
|
saveFile(e) {
|
1450
1466
|
return y.save(`file_${e.id}`, e), Promise.resolve(!0);
|
@@ -1468,7 +1484,7 @@ class Es extends Z {
|
|
1468
1484
|
return Promise.resolve(!0);
|
1469
1485
|
}
|
1470
1486
|
getHistory(e) {
|
1471
|
-
const t = y.get(`history_${e}`), s = new
|
1487
|
+
const t = y.get(`history_${e}`), s = new ue(t || { id: e });
|
1472
1488
|
return Promise.resolve(s.toDsl());
|
1473
1489
|
}
|
1474
1490
|
getHistoryItem(e, t) {
|
@@ -1484,22 +1500,22 @@ class Es extends Z {
|
|
1484
1500
|
}), Promise.resolve(!0);
|
1485
1501
|
}
|
1486
1502
|
}
|
1487
|
-
class
|
1503
|
+
class hs extends se {
|
1488
1504
|
projects = {};
|
1489
1505
|
materials = {};
|
1490
1506
|
files = {};
|
1491
1507
|
histories = {};
|
1492
1508
|
historyItems = {};
|
1493
1509
|
init(e) {
|
1494
|
-
const t = new
|
1510
|
+
const t = new T(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
|
1495
1511
|
return this.projects[r.id] = r, Promise.resolve(r);
|
1496
1512
|
}
|
1497
1513
|
saveProject(e) {
|
1498
|
-
const t = new
|
1514
|
+
const t = new T(e);
|
1499
1515
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
1500
1516
|
}
|
1501
1517
|
saveMaterials(e, t) {
|
1502
|
-
return e.id && (this.materials[e.id] =
|
1518
|
+
return e.id && (this.materials[e.id] = Y(t)), Promise.resolve(!0);
|
1503
1519
|
}
|
1504
1520
|
saveFile(e) {
|
1505
1521
|
return this.files[e.id] = e, Promise.resolve(!0);
|
@@ -1523,7 +1539,7 @@ class fs extends Z {
|
|
1523
1539
|
return Promise.resolve(!0);
|
1524
1540
|
}
|
1525
1541
|
getHistory(e) {
|
1526
|
-
const t = this.histories[e], s = new
|
1542
|
+
const t = this.histories[e], s = new ue(t || { id: e });
|
1527
1543
|
return Promise.resolve(s);
|
1528
1544
|
}
|
1529
1545
|
getHistoryItem(e, t) {
|
@@ -1541,11 +1557,11 @@ class fs extends Z {
|
|
1541
1557
|
}), Promise.resolve(!0);
|
1542
1558
|
}
|
1543
1559
|
}
|
1544
|
-
let
|
1560
|
+
let O = null;
|
1545
1561
|
function Ps() {
|
1546
|
-
return
|
1562
|
+
return O || (O = new hs(), O);
|
1547
1563
|
}
|
1548
|
-
class xs extends
|
1564
|
+
class xs extends se {
|
1549
1565
|
getFileCaches = {};
|
1550
1566
|
async getExtension() {
|
1551
1567
|
return await this.api("getExtension", {}).catch(() => {
|
@@ -1560,7 +1576,7 @@ class xs extends Z {
|
|
1560
1576
|
async saveMaterials(e, t) {
|
1561
1577
|
return !!await this.api("saveMaterials", {
|
1562
1578
|
project: e,
|
1563
|
-
materials:
|
1579
|
+
materials: Y(t)
|
1564
1580
|
}).catch(() => !1);
|
1565
1581
|
}
|
1566
1582
|
async saveFile(e) {
|
@@ -1600,16 +1616,16 @@ class xs extends Z {
|
|
1600
1616
|
);
|
1601
1617
|
}
|
1602
1618
|
}
|
1603
|
-
function
|
1604
|
-
return
|
1605
|
-
const { id:
|
1619
|
+
function Re(n, e, t = []) {
|
1620
|
+
return t.map((s) => {
|
1621
|
+
const { id: r, title: o, icon: a, children: i, hidden: l } = s;
|
1606
1622
|
return {
|
1607
|
-
id:
|
1608
|
-
title:
|
1609
|
-
icon:
|
1610
|
-
hidden:
|
1611
|
-
url:
|
1612
|
-
children:
|
1623
|
+
id: r,
|
1624
|
+
title: o,
|
1625
|
+
icon: a,
|
1626
|
+
hidden: l,
|
1627
|
+
url: `${n}/${e}/${r}`,
|
1628
|
+
children: i && i.length ? Re(n, e, i) : void 0
|
1613
1629
|
};
|
1614
1630
|
});
|
1615
1631
|
}
|
@@ -1621,89 +1637,97 @@ function Pe(n, e) {
|
|
1621
1637
|
const r = Pe(s.children, e);
|
1622
1638
|
r.length && (s.children = r, t.push(s));
|
1623
1639
|
} else
|
1624
|
-
e
|
1640
|
+
e.can(s.id.toString()) && t.push(s);
|
1625
1641
|
return t;
|
1626
1642
|
}
|
1627
|
-
function
|
1628
|
-
const
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1643
|
+
function ks(n) {
|
1644
|
+
const {
|
1645
|
+
menuPathPrefix: e = "",
|
1646
|
+
pageRouteName: t = "page",
|
1647
|
+
disableMenusFilter: s = !1
|
1648
|
+
} = n || {}, r = Ee(), o = ge(), a = yt(), i = C(!1), l = C(!1), c = r.project;
|
1649
|
+
Xe(() => {
|
1650
|
+
const { name: p, params: d, meta: h } = o;
|
1651
|
+
if (p === k) {
|
1652
|
+
const m = r.getPage(d.id);
|
1653
|
+
i.value = !m?.mask, l.value = !!m?.pure;
|
1654
|
+
} else if (p === M) {
|
1655
|
+
const m = r.getHomepage();
|
1656
|
+
i.value = !m?.mask, l.value = !!m?.pure;
|
1637
1657
|
} else
|
1638
|
-
|
1658
|
+
i.value = !h.mask, l.value = !!h.pure;
|
1639
1659
|
});
|
1640
|
-
const
|
1660
|
+
const f = Re(
|
1661
|
+
e,
|
1662
|
+
t,
|
1663
|
+
c?.pages
|
1664
|
+
), u = c?.config;
|
1641
1665
|
return {
|
1642
|
-
disabled:
|
1643
|
-
logo:
|
1644
|
-
themeSwitchable:
|
1645
|
-
title:
|
1646
|
-
menus: Pe(
|
1647
|
-
pure:
|
1666
|
+
disabled: i,
|
1667
|
+
logo: u?.logo,
|
1668
|
+
themeSwitchable: u?.themeSwitchable,
|
1669
|
+
title: u?.title || c?.description || c?.name || "VTJ App",
|
1670
|
+
menus: s ? f : Pe(f, a),
|
1671
|
+
pure: l
|
1648
1672
|
};
|
1649
1673
|
}
|
1650
1674
|
export {
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1675
|
+
we as ACCESS_KEY,
|
1676
|
+
bs as Access,
|
1677
|
+
et as BUILT_IN_DIRECTIVES,
|
1678
|
+
se as BaseService,
|
1679
|
+
ae as CONTEXT_HOST,
|
1680
|
+
_t as Context,
|
1657
1681
|
_ as ContextMode,
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1682
|
+
tt as DATA_TYPES,
|
1683
|
+
M as HOMEPAGE_ROUTE_NAME,
|
1684
|
+
$s as JSCodeToString,
|
1685
|
+
ws as LIFE_CYCLES_LIST,
|
1662
1686
|
xs as LocalService,
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1687
|
+
hs as MemoryService,
|
1688
|
+
us as NodeEnv,
|
1689
|
+
k as PAGE_ROUTE_NAME,
|
1690
|
+
ds as Provider,
|
1691
|
+
cs as Startup,
|
1692
|
+
Rs as StorageService,
|
1693
|
+
x as VTJ_RENDERER_VERSION,
|
1694
|
+
ye as adoptedStyleSheets,
|
1695
|
+
Ss as createAssetScripts,
|
1696
|
+
js as createAssetsCss,
|
1697
|
+
Rt as createDataSources,
|
1698
|
+
G as createLoader,
|
1675
1699
|
Ps as createMemoryService,
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1700
|
+
ft as createMetaApi,
|
1701
|
+
Es as createProvider,
|
1702
|
+
W as createRenderer,
|
1703
|
+
pt as createSchemaApi,
|
1704
|
+
ht as createSchemaApis,
|
1705
|
+
kt as defaultLoader,
|
1706
|
+
I as fillBasePath,
|
1707
|
+
je as getModifiers,
|
1708
|
+
Se as getPlugin,
|
1709
|
+
ot as getRawComponent,
|
1710
|
+
X as isCSSUrl,
|
1711
|
+
ut as isJSCode,
|
1712
|
+
w as isJSExpression,
|
1713
|
+
U as isJSFunction,
|
1714
|
+
st as isJSON,
|
1715
|
+
Z as isJSUrl,
|
1716
|
+
lt as isVuePlugin,
|
1717
|
+
it as loadCss,
|
1718
|
+
at as loadCssUrl,
|
1719
|
+
ct as loadScriptUrl,
|
1720
|
+
gt as mockApi,
|
1721
|
+
mt as mockApis,
|
1722
|
+
_e as mockCleanup,
|
1723
|
+
H as nodeRender,
|
1724
|
+
rt as parseDeps,
|
1725
|
+
F as parseExpression,
|
1726
|
+
ce as parseFunction,
|
1727
|
+
be as providerKey,
|
1728
|
+
nt as removeProdFlag,
|
1729
|
+
ve as toString,
|
1730
|
+
yt as useAccess,
|
1731
|
+
ks as useMask,
|
1732
|
+
Ee as useProvider
|
1709
1733
|
};
|