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