@vtj/renderer 0.7.5 → 0.7.6
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 +5 -5
- package/dist/index.mjs +340 -289
- package/package.json +7 -7
- package/types/provider/startup.d.ts +2 -0
- package/types/services/base.d.ts +1 -1
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { isUrl as
|
|
3
|
-
import * as
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { useRoute as
|
|
6
|
-
import { ElNotification as
|
|
7
|
-
import { useTitle as
|
|
8
|
-
import "@vtj/icons";
|
|
1
|
+
import { Base as ae, ProjectModel as H, HistoryModel as Y } from "@vtj/core";
|
|
2
|
+
import { isUrl as ce, isString as P, isFunction as J, createRequest as le, merge as ue, camelCase as $, upperFirst as pe, pick as fe, jsonp as me, loadScript as q, Request as de, Storage as he, mapToObject as D } from "@vtj/utils";
|
|
3
|
+
import * as M from "vue";
|
|
4
|
+
import { defineComponent as A, h as N, openBlock as ve, createElementBlock as ge, createElementVNode as E, toDisplayString as B, createVNode as _e, unref as U, withCtx as ye, createTextVNode as we, inject as Se, ref as $e, watchEffect as je } from "vue";
|
|
5
|
+
import { useRoute as X } from "vue-router";
|
|
6
|
+
import { ElNotification as V, ElLoading as Pe, ElButton as Ee } from "element-plus";
|
|
7
|
+
import { useTitle as be } from "@vueuse/core";
|
|
8
|
+
import { EditPen as Fe } from "@vtj/icons";
|
|
9
9
|
/**!
|
|
10
10
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
11
11
|
* @name @vtj/renderer
|
|
12
12
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
13
|
-
* @version 0.7.
|
|
13
|
+
* @version 0.7.6
|
|
14
14
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const Ot = "0.7.6";
|
|
17
17
|
var y = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(y || {});
|
|
18
|
-
const
|
|
18
|
+
const z = [
|
|
19
19
|
"$el",
|
|
20
20
|
"$emit",
|
|
21
21
|
"$nextTick",
|
|
@@ -27,7 +27,7 @@ const V = [
|
|
|
27
27
|
"$props",
|
|
28
28
|
"$options",
|
|
29
29
|
"$forceUpdate"
|
|
30
|
-
],
|
|
30
|
+
], Mt = [
|
|
31
31
|
"beforeCreate",
|
|
32
32
|
"created",
|
|
33
33
|
"beforeMount",
|
|
@@ -41,7 +41,7 @@ const V = [
|
|
|
41
41
|
"renderTriggered",
|
|
42
42
|
"activated",
|
|
43
43
|
"deactivated"
|
|
44
|
-
],
|
|
44
|
+
], xe = ["vIf", "vShow", "vModel", "vFor", "vBind"], He = {
|
|
45
45
|
String,
|
|
46
46
|
Number,
|
|
47
47
|
Boolean,
|
|
@@ -50,51 +50,51 @@ const V = [
|
|
|
50
50
|
Function,
|
|
51
51
|
Date
|
|
52
52
|
};
|
|
53
|
-
function
|
|
54
|
-
return r.map((t) =>
|
|
53
|
+
function F(r, e) {
|
|
54
|
+
return r.map((t) => ce(t) ? t : `${e}${t}`);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function G(r) {
|
|
57
57
|
return /\.css$/.test(r);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Q(r) {
|
|
60
60
|
return /\.js$/.test(r);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Tt(r) {
|
|
63
63
|
return r.map((e) => `<script src="${e}"><\/script>`).join("");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Bt(r = []) {
|
|
66
66
|
return r.map((e) => `<link rel="stylesheet" href="${e}" />`).join("");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const t = r.filter((m) => !!m.enabled), s = [], n = [], o = [], i = [], a = {},
|
|
70
|
-
return t.forEach(({ urls: m, assetsUrl:
|
|
68
|
+
function Ie(r, e) {
|
|
69
|
+
const t = r.filter((m) => !!m.enabled), s = [], n = [], o = [], i = [], a = {}, l = [], c = {};
|
|
70
|
+
return t.forEach(({ urls: m, assetsUrl: f, library: u, assetsLibrary: h }) => {
|
|
71
71
|
m?.forEach((v) => {
|
|
72
|
-
|
|
73
|
-
}),
|
|
72
|
+
Q(v) && s.push(v), G(v) && n.push(v);
|
|
73
|
+
}), u && (i.push(u), a[u] = F(m || [], e)), f && o.push(f), h && l.push(h), u && h && (c[h] = u);
|
|
74
74
|
}), {
|
|
75
|
-
scripts:
|
|
76
|
-
css:
|
|
77
|
-
materials:
|
|
75
|
+
scripts: F(s, e),
|
|
76
|
+
css: F(n, e),
|
|
77
|
+
materials: F(o, e),
|
|
78
78
|
libraryExports: i,
|
|
79
|
-
materialExports:
|
|
79
|
+
materialExports: l,
|
|
80
80
|
materialMapLibrary: c,
|
|
81
81
|
libraryMap: a
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Re(r, e) {
|
|
85
85
|
const { name: t, parent: s, alias: n } = r;
|
|
86
86
|
return s ? e[s]?.[n || t] : e[n || t];
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function Z(r) {
|
|
89
|
+
return P(r) ? r : JSON.stringify(r);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ee(r, e, t) {
|
|
92
92
|
const s = r.CSSStyleSheet;
|
|
93
93
|
if (s.prototype.replaceSync) {
|
|
94
94
|
const n = new s();
|
|
95
95
|
n.id = e, n.replaceSync(t);
|
|
96
96
|
const o = r.document, i = o.adoptedStyleSheets, a = Array.from(i).filter(
|
|
97
|
-
(
|
|
97
|
+
(l) => l.id !== e
|
|
98
98
|
);
|
|
99
99
|
o.adoptedStyleSheets = [...a, n];
|
|
100
100
|
} else {
|
|
@@ -103,34 +103,34 @@ function X(r, e, t) {
|
|
|
103
103
|
o ? o.innerHTML = t : (o = n.createElement("style"), o.id = e, o.innerHTML = t, n.head.appendChild(o));
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
async function
|
|
106
|
+
async function Ce(r, e) {
|
|
107
107
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
|
108
|
-
t &&
|
|
108
|
+
t && ee(window, r, t);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
110
|
+
function Oe(r) {
|
|
111
|
+
return J(r) || J(r?.install);
|
|
112
112
|
}
|
|
113
|
-
var
|
|
114
|
-
return
|
|
113
|
+
var I = function() {
|
|
114
|
+
return I = Object.assign || function(r) {
|
|
115
115
|
for (var e, t = 1, s = arguments.length; t < s; t++) {
|
|
116
116
|
e = arguments[t];
|
|
117
117
|
for (var n in e)
|
|
118
118
|
Object.prototype.hasOwnProperty.call(e, n) && (r[n] = e[n]);
|
|
119
119
|
}
|
|
120
120
|
return r;
|
|
121
|
-
},
|
|
122
|
-
},
|
|
121
|
+
}, I.apply(this, arguments);
|
|
122
|
+
}, k = { debug: -1, log: 0, info: 0, warn: 1, error: 2 }, Me = function(r, e, t, s) {
|
|
123
123
|
return function() {
|
|
124
124
|
for (var n = [], o = 0; o < arguments.length; o++)
|
|
125
125
|
n[o] = arguments[o];
|
|
126
|
-
if (e &&
|
|
127
|
-
return console[r].apply(console,
|
|
126
|
+
if (e && k[e] <= k[r] && console[r].apply && (s === "*" || t.startsWith(s)))
|
|
127
|
+
return console[r].apply(console, Te(n, t));
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
-
function
|
|
130
|
+
function Te(r, e) {
|
|
131
131
|
return e !== "*" && (typeof r[0] == "string" ? r[0] = "[" + e + "] " + r[0] : r = ["[" + e + "]"].concat(r)), r;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Be(r, e) {
|
|
134
134
|
if (!r)
|
|
135
135
|
return {
|
|
136
136
|
targetLevel: e.level,
|
|
@@ -148,42 +148,42 @@ function be(r, e) {
|
|
|
148
148
|
targetBizName: "*"
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
var
|
|
151
|
+
var Ne = {
|
|
152
152
|
level: "warn",
|
|
153
153
|
bizName: "*"
|
|
154
|
-
},
|
|
154
|
+
}, ke = (
|
|
155
155
|
/** @class */
|
|
156
156
|
/* @__PURE__ */ function() {
|
|
157
157
|
function r(e) {
|
|
158
|
-
e =
|
|
159
|
-
var t = location || {}, s = (/__(?:logConf|logLevel)__=([^#/&]*)/.exec(t.href) || [])[1], n =
|
|
160
|
-
for (var a in
|
|
161
|
-
this[a] =
|
|
158
|
+
e = I(I({}, Ne), e);
|
|
159
|
+
var t = location || {}, s = (/__(?:logConf|logLevel)__=([^#/&]*)/.exec(t.href) || [])[1], n = Be(s, e), o = n.targetLevel, i = n.targetBizName;
|
|
160
|
+
for (var a in k)
|
|
161
|
+
this[a] = Me(a, o, e.bizName, i);
|
|
162
162
|
}
|
|
163
163
|
return r;
|
|
164
164
|
}()
|
|
165
165
|
);
|
|
166
|
-
function
|
|
167
|
-
return new
|
|
166
|
+
function De(r) {
|
|
167
|
+
return new ke(r);
|
|
168
168
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
169
|
+
const R = De({ level: "log", bizName: "VTJ" });
|
|
170
|
+
function C(r, e, t = !1, s = !1) {
|
|
171
171
|
try {
|
|
172
172
|
const n = ['"use strict";', "var __self = arguments[0];"];
|
|
173
173
|
n.push("return ");
|
|
174
174
|
let o = (r.value || "").trim();
|
|
175
|
-
o = o.replace(/this(\W|$)/g, (a,
|
|
175
|
+
o = o.replace(/this(\W|$)/g, (a, l) => `__self${l}`), o = n.join(`
|
|
176
176
|
`) + o;
|
|
177
177
|
const i = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
|
|
178
178
|
return new Function("$scope", i)(e);
|
|
179
179
|
} catch (n) {
|
|
180
|
-
if (
|
|
180
|
+
if (R.error("parseExpression.error", n, r, e?.__self ?? e), s)
|
|
181
181
|
throw n;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const n =
|
|
186
|
-
if (typeof n != "function" && (
|
|
184
|
+
function W(r, e, t = !1, s = !1) {
|
|
185
|
+
const n = C(r, e, t, s);
|
|
186
|
+
if (typeof n != "function" && (R.error(
|
|
187
187
|
"parseFunction.error",
|
|
188
188
|
"not a function",
|
|
189
189
|
r,
|
|
@@ -195,17 +195,17 @@ function J(r, e, t = !1, s = !1) {
|
|
|
195
195
|
function _(r) {
|
|
196
196
|
return r && r.type === "JSExpression";
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function T(r) {
|
|
199
199
|
return typeof r == "object" && r && r.type === "JSFunction";
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
return _(r) ||
|
|
201
|
+
function Ae(r) {
|
|
202
|
+
return _(r) || T(r);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
return
|
|
204
|
+
function Nt(r) {
|
|
205
|
+
return Ae(r) ? r.value : JSON.stringify(r);
|
|
206
206
|
}
|
|
207
207
|
let j = null;
|
|
208
|
-
const
|
|
208
|
+
const Ve = le({
|
|
209
209
|
settings: {
|
|
210
210
|
type: "form",
|
|
211
211
|
validSuccess: !0,
|
|
@@ -214,12 +214,12 @@ const Oe = oe({
|
|
|
214
214
|
validate: (r) => r.data?.code === 0 || !!r.data?.success,
|
|
215
215
|
failMessage: !0,
|
|
216
216
|
showError: (r) => {
|
|
217
|
-
|
|
217
|
+
V.error({
|
|
218
218
|
message: r || "未知错误"
|
|
219
219
|
});
|
|
220
220
|
},
|
|
221
221
|
showLoading: () => {
|
|
222
|
-
j && j.close(), j =
|
|
222
|
+
j && j.close(), j = Pe.service({
|
|
223
223
|
lock: !0,
|
|
224
224
|
text: "Loading",
|
|
225
225
|
background: "rgba(0, 0, 0, 0.05)"
|
|
@@ -230,7 +230,7 @@ const Oe = oe({
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
-
function
|
|
233
|
+
function Le(r, e) {
|
|
234
234
|
const { jsonp: t, request: s } = e;
|
|
235
235
|
if (r.method === "jsonp")
|
|
236
236
|
return (n = {}) => t(r.url, {
|
|
@@ -238,7 +238,7 @@ function xe(r, e) {
|
|
|
238
238
|
query: n
|
|
239
239
|
});
|
|
240
240
|
{
|
|
241
|
-
const n = r.headers ?
|
|
241
|
+
const n = r.headers ? C(r.headers, {}, !0) : void 0, o = {
|
|
242
242
|
url: r.url,
|
|
243
243
|
method: r.method,
|
|
244
244
|
settings: {
|
|
@@ -246,13 +246,13 @@ function xe(r, e) {
|
|
|
246
246
|
headers: n
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
return (i, a) => s.send(
|
|
249
|
+
return (i, a) => s.send(ue(o, a || {}, { data: i }));
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
return r.reduce((t, s) => (t[s.id] =
|
|
252
|
+
function Je(r = [], e) {
|
|
253
|
+
return r.reduce((t, s) => (t[s.id] = Le(s, e), t), {});
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class qe {
|
|
256
256
|
__id = null;
|
|
257
257
|
__mode;
|
|
258
258
|
__instance = null;
|
|
@@ -280,7 +280,7 @@ class Me {
|
|
|
280
280
|
const { mode: t, dsl: s, attrs: n } = e;
|
|
281
281
|
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), n && Object.assign(this, n);
|
|
282
282
|
}
|
|
283
|
-
setup(e, t =
|
|
283
|
+
setup(e, t = M) {
|
|
284
284
|
const s = t.getCurrentInstance();
|
|
285
285
|
if (!s)
|
|
286
286
|
return;
|
|
@@ -293,12 +293,12 @@ class Me {
|
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
__proxy() {
|
|
296
|
-
this.__instance &&
|
|
296
|
+
this.__instance && z.forEach((e) => {
|
|
297
297
|
this[e] = this.__instance?.[e];
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
__cleanup() {
|
|
301
|
-
|
|
301
|
+
z.forEach((e) => {
|
|
302
302
|
this[e] = null;
|
|
303
303
|
});
|
|
304
304
|
}
|
|
@@ -306,17 +306,17 @@ class Me {
|
|
|
306
306
|
if (e)
|
|
307
307
|
if (this.__mode === y.Runtime) {
|
|
308
308
|
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
|
309
|
-
return
|
|
309
|
+
return W({ type: s, value: n }, this);
|
|
310
310
|
} else
|
|
311
|
-
return
|
|
311
|
+
return W(e, this);
|
|
312
312
|
}
|
|
313
313
|
__parseExpression(e) {
|
|
314
314
|
if (e)
|
|
315
315
|
if (this.__mode === y.Runtime) {
|
|
316
316
|
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
|
317
|
-
return
|
|
317
|
+
return C({ type: s, value: n }, this);
|
|
318
318
|
} else
|
|
319
|
-
return
|
|
319
|
+
return C(e, this);
|
|
320
320
|
}
|
|
321
321
|
__ref(e = null, t) {
|
|
322
322
|
if (this.__mode !== y.VNode)
|
|
@@ -347,43 +347,43 @@ class Me {
|
|
|
347
347
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function te(r) {
|
|
351
351
|
const {
|
|
352
|
-
Vue: e =
|
|
352
|
+
Vue: e = M,
|
|
353
353
|
mode: t = y.Runtime,
|
|
354
354
|
components: s = {},
|
|
355
355
|
libs: n = {},
|
|
356
356
|
apis: o = {},
|
|
357
357
|
loader: i
|
|
358
|
-
} = r, a = e.computed(() => r.dsl),
|
|
358
|
+
} = r, a = e.computed(() => r.dsl), l = {
|
|
359
359
|
$components: s,
|
|
360
360
|
$libs: n,
|
|
361
361
|
$apis: o
|
|
362
|
-
}, c = new
|
|
362
|
+
}, c = new qe({
|
|
363
363
|
mode: t,
|
|
364
364
|
dsl: a.value,
|
|
365
|
-
attrs:
|
|
365
|
+
attrs: l
|
|
366
366
|
}), m = e.defineComponent({
|
|
367
367
|
name: a.value.name,
|
|
368
368
|
props: {
|
|
369
|
-
...
|
|
369
|
+
...Ue(a.value.props ?? [], c)
|
|
370
370
|
},
|
|
371
|
-
setup(
|
|
372
|
-
c.$props =
|
|
371
|
+
setup(f) {
|
|
372
|
+
c.$props = f, a.value.id && ee(
|
|
373
373
|
r.window || window,
|
|
374
374
|
a.value.id,
|
|
375
375
|
a.value.css || ""
|
|
376
|
-
), c.state =
|
|
377
|
-
const
|
|
376
|
+
), c.state = ze(e, a.value.state ?? {}, c);
|
|
377
|
+
const u = We(e, a.value.computed ?? {}, c), h = Ke(a.value.methods ?? {}, c), v = Ye(e, a.value.inject, c), p = Xe(
|
|
378
378
|
a.value.dataSources || {},
|
|
379
379
|
c
|
|
380
380
|
), w = {
|
|
381
381
|
...v,
|
|
382
|
-
...
|
|
382
|
+
...u,
|
|
383
383
|
...h,
|
|
384
|
-
...
|
|
384
|
+
...p
|
|
385
385
|
};
|
|
386
|
-
return c.setup(w, e),
|
|
386
|
+
return c.setup(w, e), Ge(e, a.value.watch ?? [], c), {
|
|
387
387
|
vtj: c
|
|
388
388
|
};
|
|
389
389
|
},
|
|
@@ -392,19 +392,19 @@ function G(r) {
|
|
|
392
392
|
render() {
|
|
393
393
|
if (!a.value.nodes)
|
|
394
394
|
return null;
|
|
395
|
-
const
|
|
396
|
-
return
|
|
395
|
+
const f = a.value.nodes || [];
|
|
396
|
+
return f.length === 1 ? O(f[0], c, e, i) : f.map((u) => O(u, c, e, i));
|
|
397
397
|
},
|
|
398
|
-
...
|
|
398
|
+
...Qe(a.value.lifeCycles ?? {}, c)
|
|
399
399
|
});
|
|
400
400
|
return {
|
|
401
401
|
renderer: e.markRaw(m),
|
|
402
402
|
context: c
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) =>
|
|
407
|
-
return r.map((s) =>
|
|
405
|
+
function Ue(r = [], e) {
|
|
406
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => He[o]) : void 0;
|
|
407
|
+
return r.map((s) => P(s) ? {
|
|
408
408
|
name: s
|
|
409
409
|
} : {
|
|
410
410
|
name: s.name,
|
|
@@ -420,53 +420,53 @@ function Ne(r = [], e) {
|
|
|
420
420
|
{}
|
|
421
421
|
);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function ze(r, e, t) {
|
|
424
424
|
return r.reactive(
|
|
425
425
|
Object.keys(e || {}).reduce(
|
|
426
426
|
(s, n) => {
|
|
427
427
|
let o = e[n];
|
|
428
|
-
return _(o) ? o = t.__parseExpression(o) :
|
|
428
|
+
return _(o) ? o = t.__parseExpression(o) : T(o) && (o = t.__parseFunction(o)), s[n] = o, s;
|
|
429
429
|
},
|
|
430
430
|
{}
|
|
431
431
|
)
|
|
432
432
|
);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function We(r, e, t) {
|
|
435
435
|
return Object.entries(e ?? {}).reduce(
|
|
436
436
|
(s, [n, o]) => (s[n] = r.computed(t.__parseFunction(o)), s),
|
|
437
437
|
{}
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Ke(r, e) {
|
|
441
441
|
return Object.entries(r ?? {}).reduce(
|
|
442
442
|
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
|
443
443
|
{}
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Ye(r, e = [], t) {
|
|
447
447
|
return e.reduce(
|
|
448
448
|
(s, n) => {
|
|
449
449
|
const { name: o, from: i } = n || {};
|
|
450
450
|
n.default;
|
|
451
|
-
const a = _(i) ? t.__parseExpression(i) || o : i ?? o,
|
|
452
|
-
return s[o] = r.inject(a,
|
|
451
|
+
const a = _(i) ? t.__parseExpression(i) || o : i ?? o, l = _(n.default) ? t.__parseExpression(n.default) : n.default ?? null;
|
|
452
|
+
return s[o] = r.inject(a, l), s;
|
|
453
453
|
},
|
|
454
454
|
{}
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Xe(r, e) {
|
|
458
458
|
return Object.keys(r).reduce(
|
|
459
459
|
(t, s) => {
|
|
460
|
-
const n = r[s], o = e.$apis[n.ref], i =
|
|
460
|
+
const n = r[s], o = e.$apis[n.ref], i = T(n.transform) ? n.transform.value ? e.__parseFunction(n.transform) : void 0 : n.transform;
|
|
461
461
|
return t[s] = async (...a) => {
|
|
462
|
-
const
|
|
463
|
-
return i ? i(
|
|
462
|
+
const l = await o.apply(e, a);
|
|
463
|
+
return i ? i(l) : l;
|
|
464
464
|
}, t;
|
|
465
465
|
},
|
|
466
466
|
{}
|
|
467
467
|
);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Ge(r, e = [], t) {
|
|
470
470
|
e.forEach((s) => {
|
|
471
471
|
r.watch(
|
|
472
472
|
t.__parseExpression(s.source),
|
|
@@ -478,57 +478,57 @@ function Le(r, e = [], t) {
|
|
|
478
478
|
);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Qe(r, e) {
|
|
482
482
|
return Object.entries(r ?? {}).reduce(
|
|
483
483
|
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
|
484
484
|
{}
|
|
485
485
|
);
|
|
486
486
|
}
|
|
487
|
-
const
|
|
488
|
-
function
|
|
487
|
+
const Ze = (r) => r;
|
|
488
|
+
function re(r) {
|
|
489
489
|
const { getDsl: e, options: t } = r;
|
|
490
|
-
return (s, n, o =
|
|
490
|
+
return (s, n, o = M) => !n || typeof n == "string" ? s : n.type === "Schema" ? o.defineAsyncComponent(async () => {
|
|
491
491
|
const i = await e(n.id);
|
|
492
|
-
return i ?
|
|
492
|
+
return i ? te({
|
|
493
493
|
...t,
|
|
494
494
|
Vue: o,
|
|
495
495
|
dsl: i,
|
|
496
496
|
mode: y.Runtime,
|
|
497
|
-
loader:
|
|
497
|
+
loader: re(r)
|
|
498
498
|
}).renderer : null;
|
|
499
499
|
}) : s;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function O(r, e, t = M, s = Ze) {
|
|
502
502
|
if (!r || !r.name || r.invisible)
|
|
503
503
|
return null;
|
|
504
|
-
const { id: n = null, directives: o = [] } = r, { vIf: i, vFor: a, vShow:
|
|
505
|
-
if (i && !
|
|
504
|
+
const { id: n = null, directives: o = [] } = r, { vIf: i, vFor: a, vShow: l, vModels: c, vBind: m } = et(o);
|
|
505
|
+
if (i && !tt(i, e))
|
|
506
506
|
return null;
|
|
507
|
-
const
|
|
508
|
-
const h =
|
|
507
|
+
const f = (u) => {
|
|
508
|
+
const h = u.$components, v = (() => {
|
|
509
509
|
if (r.name === "component")
|
|
510
|
-
return
|
|
510
|
+
return rt(u, r.props?.is);
|
|
511
511
|
if (r.name === "slot")
|
|
512
512
|
return r.name;
|
|
513
513
|
const g = s(r.name, r.from, t);
|
|
514
|
-
return
|
|
515
|
-
})(),
|
|
514
|
+
return P(g) ? h[g] ?? g : g;
|
|
515
|
+
})(), p = st(n, r.props ?? {}, u), w = nt(t, r.events ?? {}, u);
|
|
516
516
|
if (r.name === "slot")
|
|
517
|
-
return
|
|
518
|
-
m && Object.assign(
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
return ot(t, r, p, u);
|
|
518
|
+
m && Object.assign(p, u.__parseExpression(m.value)), l && (p.style = Object.assign(
|
|
519
|
+
p.style ?? {},
|
|
520
|
+
at(l, u)
|
|
521
521
|
)), c.forEach((g) => {
|
|
522
|
-
Object.assign(
|
|
522
|
+
Object.assign(p, ct(t, g, u));
|
|
523
523
|
});
|
|
524
|
-
const S =
|
|
525
|
-
return t.createVNode(v, { ...
|
|
524
|
+
const S = lt(t, r.children ?? [], u, r);
|
|
525
|
+
return t.createVNode(v, { ...p, ...w }, S);
|
|
526
526
|
};
|
|
527
|
-
return a ?
|
|
527
|
+
return a ? ft(a, f, e) : f(e);
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function et(r = []) {
|
|
530
530
|
const e = r.find((a) => $(a.name) === "vIf"), t = r.find((a) => $(a.name) === "vFor"), s = r.find((a) => $(a.name) === "vShow"), n = r.find((a) => $(a.name) === "vBind"), o = r.filter((a) => $(a.name) === "vModel"), i = r.filter(
|
|
531
|
-
(a) => !
|
|
531
|
+
(a) => !xe.includes($(a.name))
|
|
532
532
|
);
|
|
533
533
|
return {
|
|
534
534
|
vIf: e,
|
|
@@ -539,86 +539,86 @@ function qe(r = []) {
|
|
|
539
539
|
others: i
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function tt(r, e) {
|
|
543
543
|
return !!e.__parseExpression(r.value);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function rt(r, e) {
|
|
546
546
|
return e ? _(e) ? r.__parseExpression(e) : e : "div";
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function st(r, e, t) {
|
|
549
549
|
const s = Object.keys(e || {}).reduce((n, o) => {
|
|
550
550
|
let i = e[o];
|
|
551
|
-
return _(i) ? i = t.__parseExpression(i) :
|
|
551
|
+
return _(i) ? i = t.__parseExpression(i) : T(i) && (i = t.__parseFunction(i)), n[o] = i, n;
|
|
552
552
|
}, {});
|
|
553
553
|
return s.ref = t.__ref(r, s.ref), s;
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function nt(r, e, t) {
|
|
556
556
|
const s = ["passive", "capture", "once"], n = {
|
|
557
557
|
capture: "Capture",
|
|
558
558
|
once: "Once",
|
|
559
559
|
passive: "OnceCapture"
|
|
560
560
|
};
|
|
561
561
|
return Object.keys(e || {}).reduce((o, i) => {
|
|
562
|
-
const a = e[i],
|
|
563
|
-
return
|
|
562
|
+
const a = e[i], l = se(a.modifiers), c = l.find((u) => s.includes(u)), m = "on" + pe(i) + (c && n[c] || ""), f = t.__parseFunction(a.handler);
|
|
563
|
+
return f && (o[m] = r.withModifiers(f, l)), o;
|
|
564
564
|
}, {});
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function se(r = {}, e = !1) {
|
|
567
567
|
const t = Object.keys(r);
|
|
568
568
|
return e ? t.map((s) => "." + s) : t;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
const { children: n } = e, o =
|
|
572
|
-
return i ? i(t) : n ?
|
|
573
|
-
|
|
574
|
-
) : Array.isArray(n) ? n.map((a) =>
|
|
570
|
+
function ot(r, e, t, s) {
|
|
571
|
+
const { children: n } = e, o = it(e, s), i = s.$slots?.[o.name];
|
|
572
|
+
return i ? i(t) : n ? P(n) ? r.createTextVNode(n) : _(n) ? r.createTextVNode(
|
|
573
|
+
Z(s.__parseExpression(n))
|
|
574
|
+
) : Array.isArray(n) ? n.map((a) => O(a, s, r)) : null : null;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function it(r, e) {
|
|
577
577
|
const { props: t } = r, s = t?.name || "default";
|
|
578
578
|
return {
|
|
579
579
|
name: _(s) ? e.__parseExpression(s) : s,
|
|
580
580
|
params: []
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function at(r, e) {
|
|
584
584
|
return e.__parseExpression(r.value) ? {} : {
|
|
585
585
|
display: "none"
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function ct(r, e, t) {
|
|
589
589
|
const s = {
|
|
590
590
|
type: "JSFunction",
|
|
591
591
|
value: e.value?.value ? `(v) => {
|
|
592
592
|
${e.value.value} = v;
|
|
593
593
|
}` : "(v) => {}"
|
|
594
|
-
}, n = t.__parseFunction(s), o =
|
|
594
|
+
}, n = t.__parseFunction(s), o = se(e.modifiers), i = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
595
595
|
return {
|
|
596
596
|
[i]: t.__parseExpression(e.value),
|
|
597
597
|
[`onUpdate:${i}`]: o.length && n ? r.withModifiers(n, o) : n
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function lt(r, e, t, s) {
|
|
601
601
|
if (!e)
|
|
602
602
|
return null;
|
|
603
|
-
if (
|
|
603
|
+
if (P(e))
|
|
604
604
|
return { default: () => e };
|
|
605
605
|
if (_(e))
|
|
606
606
|
return {
|
|
607
|
-
default: () =>
|
|
607
|
+
default: () => Z(t.__parseExpression(e))
|
|
608
608
|
};
|
|
609
609
|
if (Array.isArray(e)) {
|
|
610
|
-
const n =
|
|
610
|
+
const n = ut(e), o = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
|
|
611
611
|
[`scope_${s.id}`]: i
|
|
612
612
|
} : {};
|
|
613
|
-
return Object.entries(n).reduce((i, [a, { nodes:
|
|
614
|
-
const
|
|
615
|
-
return
|
|
616
|
-
(
|
|
613
|
+
return Object.entries(n).reduce((i, [a, { nodes: l, params: c }]) => (i[a] = (m) => {
|
|
614
|
+
const f = c.length ? fe(m ?? {}, c) : o(m);
|
|
615
|
+
return l.map(
|
|
616
|
+
(u) => O(u, t.__clone(f), r)
|
|
617
617
|
);
|
|
618
618
|
}, i), {});
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function ut(r) {
|
|
622
622
|
const e = {
|
|
623
623
|
default: {
|
|
624
624
|
params: [],
|
|
@@ -626,7 +626,7 @@ function et(r) {
|
|
|
626
626
|
}
|
|
627
627
|
};
|
|
628
628
|
for (const t of r) {
|
|
629
|
-
const s =
|
|
629
|
+
const s = pt(t.slot), n = s.name;
|
|
630
630
|
e[n] ? (e[n].nodes.push(t), e[n].params = e[n].params.concat(s.params)) : e[n] = {
|
|
631
631
|
nodes: [t],
|
|
632
632
|
params: s.params
|
|
@@ -634,19 +634,19 @@ function et(r) {
|
|
|
634
634
|
}
|
|
635
635
|
return e;
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
return
|
|
637
|
+
function pt(r = "default") {
|
|
638
|
+
return P(r) ? { name: r, params: [] } : { params: [], ...r };
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function ft(r, e, t) {
|
|
641
641
|
const { value: s, iterator: n } = r, { item: o = "item", index: i = "index" } = n || {};
|
|
642
642
|
let a = t.__parseExpression(s) || [];
|
|
643
|
-
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((
|
|
643
|
+
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((l, c) => c + 1)), Array.isArray(a) ? a.map((l, c) => e(t.__clone({ [o]: l, [i]: c }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
|
644
644
|
}
|
|
645
|
-
const
|
|
645
|
+
const K = A({
|
|
646
646
|
name: "VtjPageContainer",
|
|
647
647
|
async setup() {
|
|
648
|
-
const r =
|
|
649
|
-
return s &&
|
|
648
|
+
const r = oe(), e = X(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null;
|
|
649
|
+
return s && be(s.title || "VTJ"), {
|
|
650
650
|
provider: r,
|
|
651
651
|
component: n,
|
|
652
652
|
file: s,
|
|
@@ -654,16 +654,67 @@ const q = pe({
|
|
|
654
654
|
};
|
|
655
655
|
},
|
|
656
656
|
render() {
|
|
657
|
-
return this.component ?
|
|
657
|
+
return this.component ? N(this.component, this.query) : N("div", "页面不存在");
|
|
658
658
|
}
|
|
659
|
-
})
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
659
|
+
}), mt = {
|
|
660
|
+
name: {
|
|
661
|
+
type: String,
|
|
662
|
+
default: "VTJ.PRO"
|
|
663
|
+
},
|
|
664
|
+
tagline: {
|
|
665
|
+
type: String,
|
|
666
|
+
default: "基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台"
|
|
667
|
+
},
|
|
668
|
+
actionText: {
|
|
669
|
+
type: String,
|
|
670
|
+
default: "开始设计"
|
|
671
|
+
},
|
|
672
|
+
actionLink: {
|
|
673
|
+
type: String,
|
|
674
|
+
default: "/@vtj/pro/"
|
|
675
|
+
}
|
|
676
|
+
}, dt = { class: "x-startup" }, ht = { class: "x-startup__wrapper" }, vt = { class: "x-startup__name" }, gt = { class: "clip" }, _t = { class: "x-startup__tagline" }, yt = { class: "x-startup__actions" }, wt = /* @__PURE__ */ A({
|
|
677
|
+
__name: "Startup",
|
|
678
|
+
props: mt,
|
|
679
|
+
setup(r) {
|
|
680
|
+
const e = r, t = () => {
|
|
681
|
+
let s = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "@vtj/pro/#/";
|
|
682
|
+
location.href = s;
|
|
683
|
+
};
|
|
684
|
+
return (s, n) => (ve(), ge("div", dt, [
|
|
685
|
+
E("div", ht, [
|
|
686
|
+
E("div", vt, [
|
|
687
|
+
E("span", gt, B(e.name), 1)
|
|
688
|
+
]),
|
|
689
|
+
E("div", _t, B(e.tagline), 1),
|
|
690
|
+
E("div", yt, [
|
|
691
|
+
_e(U(Ee), {
|
|
692
|
+
type: "primary",
|
|
693
|
+
size: "large",
|
|
694
|
+
round: "",
|
|
695
|
+
icon: U(Fe),
|
|
696
|
+
onClick: t
|
|
697
|
+
}, {
|
|
698
|
+
default: ye(() => [
|
|
699
|
+
we(B(e.actionText), 1)
|
|
700
|
+
]),
|
|
701
|
+
_: 1
|
|
702
|
+
}, 8, ["icon"])
|
|
703
|
+
])
|
|
704
|
+
])
|
|
705
|
+
]));
|
|
706
|
+
}
|
|
707
|
+
}), St = A({
|
|
708
|
+
name: "VtjStartupContainer",
|
|
709
|
+
render() {
|
|
710
|
+
return N(wt);
|
|
711
|
+
}
|
|
712
|
+
}), ne = Symbol("Provider");
|
|
713
|
+
class $t extends ae {
|
|
663
714
|
mode;
|
|
664
715
|
globals = {};
|
|
665
716
|
modules = {};
|
|
666
|
-
adapter = { request:
|
|
717
|
+
adapter = { request: Ve, jsonp: me };
|
|
667
718
|
apis = {};
|
|
668
719
|
dependencies = {};
|
|
669
720
|
materials = {};
|
|
@@ -682,64 +733,64 @@ class nt extends se {
|
|
|
682
733
|
materials: o,
|
|
683
734
|
project: i = {},
|
|
684
735
|
adapter: a = {},
|
|
685
|
-
globals:
|
|
736
|
+
globals: l = {},
|
|
686
737
|
modules: c = {},
|
|
687
738
|
router: m = null,
|
|
688
|
-
materialPath:
|
|
739
|
+
materialPath: f = "./"
|
|
689
740
|
} = e;
|
|
690
|
-
this.mode = s, this.modules = c, this.service = t, this.router = m, this.materialPath =
|
|
741
|
+
this.mode = s, this.modules = c, this.service = t, this.router = m, this.materialPath = f, n && (this.dependencies = n), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, a), s !== y.Design && this.load(i);
|
|
691
742
|
}
|
|
692
743
|
async load(e) {
|
|
693
|
-
const t = this.modules[
|
|
744
|
+
const t = this.modules[`.vtj/projects/${e.id}.json`];
|
|
694
745
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
|
695
746
|
throw new Error("project is null");
|
|
696
|
-
const { dependencies: s = [], apis: n } = this.project, { dependencies: o, library: i, components: a, materialPath:
|
|
747
|
+
const { dependencies: s = [], apis: n } = this.project, { dependencies: o, library: i, components: a, materialPath: l } = this, {
|
|
697
748
|
libraryExports: c,
|
|
698
749
|
libraryMap: m,
|
|
699
|
-
materials:
|
|
700
|
-
materialExports:
|
|
750
|
+
materials: f,
|
|
751
|
+
materialExports: u,
|
|
701
752
|
materialMapLibrary: h
|
|
702
|
-
} =
|
|
703
|
-
for (const
|
|
704
|
-
const w = o[
|
|
753
|
+
} = Ie(s, l);
|
|
754
|
+
for (const p of c) {
|
|
755
|
+
const w = o[p], S = window[p];
|
|
705
756
|
if (S)
|
|
706
|
-
i[
|
|
757
|
+
i[p] = S;
|
|
707
758
|
else if (w)
|
|
708
|
-
window[
|
|
759
|
+
window[p] = i[p] = await w();
|
|
709
760
|
else {
|
|
710
|
-
const g = m[
|
|
711
|
-
for (const
|
|
712
|
-
|
|
761
|
+
const g = m[p] || [];
|
|
762
|
+
for (const b of g)
|
|
763
|
+
G(b) && await Ce(p, b), Q(b) && await q(b), i[p] = window[p];
|
|
713
764
|
}
|
|
714
765
|
}
|
|
715
|
-
for (const
|
|
716
|
-
await
|
|
766
|
+
for (const p of f)
|
|
767
|
+
await q(p);
|
|
717
768
|
const v = this.materials || {};
|
|
718
|
-
for (const
|
|
719
|
-
const w = v[
|
|
769
|
+
for (const p of u) {
|
|
770
|
+
const w = v[p] ? (await v[p]()).default : window[p], S = window[h[p]];
|
|
720
771
|
w && S && w.components.forEach((g) => {
|
|
721
|
-
a[g.name] =
|
|
772
|
+
a[g.name] = Re(g, S);
|
|
722
773
|
});
|
|
723
774
|
}
|
|
724
|
-
n && (this.apis =
|
|
775
|
+
n && (this.apis = Je(n, this.adapter)), this.initRouter(), this.triggerReady();
|
|
725
776
|
}
|
|
726
777
|
initRouter() {
|
|
727
778
|
const { router: e, project: t } = this;
|
|
728
779
|
e && (e.addRoute({
|
|
729
780
|
path: "/page/:id",
|
|
730
781
|
name: "VtjPage",
|
|
731
|
-
component:
|
|
732
|
-
}),
|
|
782
|
+
component: K
|
|
783
|
+
}), e.addRoute({
|
|
733
784
|
path: "/",
|
|
734
785
|
name: "VtjHomepage",
|
|
735
|
-
component:
|
|
786
|
+
component: t?.homepage ? K : St
|
|
736
787
|
}));
|
|
737
788
|
}
|
|
738
789
|
install(e) {
|
|
739
790
|
const t = e.config.globalProperties.installed || {};
|
|
740
791
|
for (const [s, n] of Object.entries(this.library))
|
|
741
|
-
!t[s] &&
|
|
742
|
-
e.provide(
|
|
792
|
+
!t[s] && Oe(n) && (e.use(n), t[s] = !0);
|
|
793
|
+
e.provide(ne, this), e.config.globalProperties.installed = t;
|
|
743
794
|
}
|
|
744
795
|
getFile(e) {
|
|
745
796
|
const { blocks: t = [] } = this.project || {};
|
|
@@ -770,47 +821,47 @@ class nt extends se {
|
|
|
770
821
|
async getRenderComponent(e) {
|
|
771
822
|
const t = this.getFile(e);
|
|
772
823
|
if (!t)
|
|
773
|
-
return
|
|
774
|
-
const s =
|
|
824
|
+
return R.warn(`Can not find file: ${e}`), null;
|
|
825
|
+
const s = `.vtj/vue/${e}.vue`, n = this.modules[s];
|
|
775
826
|
if (n)
|
|
776
827
|
return (await n())?.default;
|
|
777
828
|
const o = await this.getDsl(t.id);
|
|
778
829
|
if (!o)
|
|
779
|
-
return
|
|
780
|
-
const { library: i, components: a, mode:
|
|
781
|
-
mode:
|
|
830
|
+
return R.warn(`Can not find dsl: ${e}`), null;
|
|
831
|
+
const { library: i, components: a, mode: l, apis: c } = this, m = {
|
|
832
|
+
mode: l,
|
|
782
833
|
Vue: i.Vue,
|
|
783
834
|
components: a,
|
|
784
835
|
libs: i,
|
|
785
836
|
apis: c,
|
|
786
837
|
window
|
|
787
|
-
},
|
|
838
|
+
}, f = re({
|
|
788
839
|
getDsl: async (h) => await this.getDsl(h) || null,
|
|
789
840
|
options: m
|
|
790
|
-
}), { renderer:
|
|
841
|
+
}), { renderer: u } = te({
|
|
791
842
|
...m,
|
|
792
843
|
dsl: o,
|
|
793
|
-
loader:
|
|
844
|
+
loader: f
|
|
794
845
|
});
|
|
795
|
-
return
|
|
846
|
+
return u;
|
|
796
847
|
}
|
|
797
848
|
}
|
|
798
|
-
function
|
|
799
|
-
const e = new
|
|
849
|
+
function kt(r) {
|
|
850
|
+
const e = new $t(r);
|
|
800
851
|
return {
|
|
801
852
|
provider: e,
|
|
802
853
|
onReady: (s) => e.ready(s)
|
|
803
854
|
};
|
|
804
855
|
}
|
|
805
|
-
function
|
|
806
|
-
const e =
|
|
856
|
+
function oe(r = {}) {
|
|
857
|
+
const e = Se(ne);
|
|
807
858
|
if (!e)
|
|
808
859
|
throw new Error("Can not find provider");
|
|
809
|
-
if (e.mode === y.
|
|
860
|
+
if (e.mode === y.Raw) {
|
|
810
861
|
const { id: t, version: s } = r;
|
|
811
862
|
t && s && (async () => {
|
|
812
863
|
const n = await e.getDsl(t);
|
|
813
|
-
n?.__VERSION__ !== s &&
|
|
864
|
+
n?.__VERSION__ !== s && V.warning({
|
|
814
865
|
title: n?.name,
|
|
815
866
|
message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
|
|
816
867
|
});
|
|
@@ -818,7 +869,7 @@ function te(r = {}) {
|
|
|
818
869
|
}
|
|
819
870
|
return e;
|
|
820
871
|
}
|
|
821
|
-
const
|
|
872
|
+
const jt = new de({
|
|
822
873
|
settings: {
|
|
823
874
|
type: "json",
|
|
824
875
|
validSuccess: !0,
|
|
@@ -826,12 +877,12 @@ const ot = new le({
|
|
|
826
877
|
failMessage: !0,
|
|
827
878
|
validate: (r) => r.data?.code === 0,
|
|
828
879
|
showError: (r) => {
|
|
829
|
-
|
|
880
|
+
V.error({
|
|
830
881
|
message: r || "未知错误"
|
|
831
882
|
});
|
|
832
883
|
}
|
|
833
884
|
}
|
|
834
|
-
}),
|
|
885
|
+
}), Pt = (r = "/vtj/local/repository/${type}.json") => (e, t) => jt.send({
|
|
835
886
|
url: r,
|
|
836
887
|
method: "post",
|
|
837
888
|
query: { type: e },
|
|
@@ -840,10 +891,10 @@ const ot = new le({
|
|
|
840
891
|
data: t
|
|
841
892
|
}
|
|
842
893
|
});
|
|
843
|
-
class
|
|
894
|
+
class L {
|
|
844
895
|
api;
|
|
845
896
|
constructor() {
|
|
846
|
-
this.api =
|
|
897
|
+
this.api = Pt();
|
|
847
898
|
}
|
|
848
899
|
async init(e) {
|
|
849
900
|
return console.log("BaseService.init", e), {};
|
|
@@ -889,8 +940,8 @@ class D {
|
|
|
889
940
|
() => !1
|
|
890
941
|
);
|
|
891
942
|
}
|
|
892
|
-
async
|
|
893
|
-
return await this.api("
|
|
943
|
+
async genVueContent(e, t) {
|
|
944
|
+
return await this.api("genVueContent", { project: e, dsl: t }).catch(() => "");
|
|
894
945
|
}
|
|
895
946
|
async createRawPage(e) {
|
|
896
947
|
return await this.api("createRawPage", e).catch(() => "");
|
|
@@ -899,12 +950,12 @@ class D {
|
|
|
899
950
|
return await this.api("removeRawPage", e).catch(() => "");
|
|
900
951
|
}
|
|
901
952
|
}
|
|
902
|
-
const d = new
|
|
953
|
+
const d = new he({
|
|
903
954
|
type: "local",
|
|
904
955
|
expired: 0,
|
|
905
956
|
prefix: "__VTJ_"
|
|
906
957
|
});
|
|
907
|
-
class
|
|
958
|
+
class Dt extends L {
|
|
908
959
|
init(e) {
|
|
909
960
|
const t = new H(e), s = d.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
|
|
910
961
|
return d.save(`project_${t.id}`, n), Promise.resolve(n);
|
|
@@ -914,7 +965,7 @@ class St extends D {
|
|
|
914
965
|
return d.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
|
915
966
|
}
|
|
916
967
|
saveMaterials(e, t) {
|
|
917
|
-
return d.save(`materials_${e.id}`,
|
|
968
|
+
return d.save(`materials_${e.id}`, D(t)), Promise.resolve(!0);
|
|
918
969
|
}
|
|
919
970
|
saveFile(e) {
|
|
920
971
|
return d.save(`file_${e.id}`, e), Promise.resolve(!0);
|
|
@@ -938,7 +989,7 @@ class St extends D {
|
|
|
938
989
|
return Promise.resolve(!0);
|
|
939
990
|
}
|
|
940
991
|
getHistory(e) {
|
|
941
|
-
const t = d.get(`history_${e}`), s = new
|
|
992
|
+
const t = d.get(`history_${e}`), s = new Y(t || { id: e });
|
|
942
993
|
return Promise.resolve(s.toDsl());
|
|
943
994
|
}
|
|
944
995
|
getHistoryItem(e, t) {
|
|
@@ -954,7 +1005,7 @@ class St extends D {
|
|
|
954
1005
|
}), Promise.resolve(!0);
|
|
955
1006
|
}
|
|
956
1007
|
}
|
|
957
|
-
class
|
|
1008
|
+
class Et extends L {
|
|
958
1009
|
projects = {};
|
|
959
1010
|
materials = {};
|
|
960
1011
|
files = {};
|
|
@@ -969,7 +1020,7 @@ class at extends D {
|
|
|
969
1020
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
|
970
1021
|
}
|
|
971
1022
|
saveMaterials(e, t) {
|
|
972
|
-
return e.id && (this.materials[e.id] =
|
|
1023
|
+
return e.id && (this.materials[e.id] = D(t)), Promise.resolve(!0);
|
|
973
1024
|
}
|
|
974
1025
|
saveFile(e) {
|
|
975
1026
|
return this.files[e.id] = e, Promise.resolve(!0);
|
|
@@ -993,7 +1044,7 @@ class at extends D {
|
|
|
993
1044
|
return Promise.resolve(!0);
|
|
994
1045
|
}
|
|
995
1046
|
getHistory(e) {
|
|
996
|
-
const t = this.histories[e], s = new
|
|
1047
|
+
const t = this.histories[e], s = new Y(t || { id: e });
|
|
997
1048
|
return Promise.resolve(s);
|
|
998
1049
|
}
|
|
999
1050
|
getHistoryItem(e, t) {
|
|
@@ -1011,11 +1062,11 @@ class at extends D {
|
|
|
1011
1062
|
}), Promise.resolve(!0);
|
|
1012
1063
|
}
|
|
1013
1064
|
}
|
|
1014
|
-
let
|
|
1015
|
-
function
|
|
1016
|
-
return
|
|
1065
|
+
let x = null;
|
|
1066
|
+
function At() {
|
|
1067
|
+
return x || (x = new Et(), x);
|
|
1017
1068
|
}
|
|
1018
|
-
class
|
|
1069
|
+
class Vt extends L {
|
|
1019
1070
|
async init(e) {
|
|
1020
1071
|
return await this.api("init", e).catch(() => null) || {};
|
|
1021
1072
|
}
|
|
@@ -1025,7 +1076,7 @@ class jt extends D {
|
|
|
1025
1076
|
async saveMaterials(e, t) {
|
|
1026
1077
|
return !!await this.api("saveMaterials", {
|
|
1027
1078
|
project: e,
|
|
1028
|
-
materials:
|
|
1079
|
+
materials: D(t)
|
|
1029
1080
|
}).catch(() => !1);
|
|
1030
1081
|
}
|
|
1031
1082
|
async saveFile(e) {
|
|
@@ -1060,7 +1111,7 @@ class jt extends D {
|
|
|
1060
1111
|
);
|
|
1061
1112
|
}
|
|
1062
1113
|
}
|
|
1063
|
-
function
|
|
1114
|
+
function ie(r = []) {
|
|
1064
1115
|
return r.map((e) => {
|
|
1065
1116
|
const { id: t, title: s, icon: n, children: o, hidden: i } = e;
|
|
1066
1117
|
return {
|
|
@@ -1069,24 +1120,24 @@ function re(r = []) {
|
|
|
1069
1120
|
icon: n,
|
|
1070
1121
|
hidden: i,
|
|
1071
1122
|
url: `/page/${t}`,
|
|
1072
|
-
children: o && o.length ?
|
|
1123
|
+
children: o && o.length ? ie(o) : void 0
|
|
1073
1124
|
};
|
|
1074
1125
|
});
|
|
1075
1126
|
}
|
|
1076
|
-
function
|
|
1077
|
-
const r =
|
|
1078
|
-
|
|
1127
|
+
function Lt() {
|
|
1128
|
+
const r = oe(), e = X(), t = $e(!1), s = r.project;
|
|
1129
|
+
je(() => {
|
|
1079
1130
|
const { name: o, params: i, meta: a } = e;
|
|
1080
1131
|
if (o === "VtjPage") {
|
|
1081
|
-
const
|
|
1082
|
-
t.value = !
|
|
1132
|
+
const l = r.getPage(i.id);
|
|
1133
|
+
t.value = !l?.mask;
|
|
1083
1134
|
} else if (o === "VtjHomepage") {
|
|
1084
|
-
const
|
|
1085
|
-
t.value = !
|
|
1135
|
+
const l = r.getHomepage();
|
|
1136
|
+
t.value = !l?.mask;
|
|
1086
1137
|
} else
|
|
1087
1138
|
t.value = !a.mask;
|
|
1088
1139
|
});
|
|
1089
|
-
const n =
|
|
1140
|
+
const n = ie(s?.pages);
|
|
1090
1141
|
return {
|
|
1091
1142
|
disabled: t,
|
|
1092
1143
|
title: s?.description || s?.name || "VTJ App",
|
|
@@ -1094,49 +1145,49 @@ function Et() {
|
|
|
1094
1145
|
};
|
|
1095
1146
|
}
|
|
1096
1147
|
export {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1148
|
+
xe as BUILDIN_DIRECTIVES,
|
|
1149
|
+
L as BaseService,
|
|
1150
|
+
z as CONTEXT_HOST,
|
|
1151
|
+
qe as Context,
|
|
1101
1152
|
y as ContextMode,
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1153
|
+
He as DATA_TYPES,
|
|
1154
|
+
Nt as JSCodeToString,
|
|
1155
|
+
Mt as LIFE_CYCLES_LIST,
|
|
1156
|
+
Vt as LocalService,
|
|
1157
|
+
ke as Logger,
|
|
1158
|
+
Et as MemoryService,
|
|
1159
|
+
$t as Provider,
|
|
1160
|
+
Dt as StorageService,
|
|
1161
|
+
Ot as VTJ_RENDERER_VERSION,
|
|
1162
|
+
ee as adoptedStyleSheets,
|
|
1163
|
+
Tt as createAssetScripts,
|
|
1164
|
+
Bt as createAssetsCss,
|
|
1165
|
+
Xe as createDataSources,
|
|
1166
|
+
re as createLoader,
|
|
1167
|
+
At as createMemoryService,
|
|
1168
|
+
kt as createProvider,
|
|
1169
|
+
te as createRenderer,
|
|
1170
|
+
Le as createSchemaApi,
|
|
1171
|
+
Je as createSchemaApis,
|
|
1172
|
+
Ze as defaultLoader,
|
|
1173
|
+
F as fillBasePath,
|
|
1174
|
+
De as getLogger,
|
|
1175
|
+
se as getModifiers,
|
|
1176
|
+
Re as getRawComponent,
|
|
1177
|
+
G as isCSSUrl,
|
|
1178
|
+
Ae as isJSCode,
|
|
1128
1179
|
_ as isJSExpression,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1180
|
+
T as isJSFunction,
|
|
1181
|
+
Q as isJSUrl,
|
|
1182
|
+
Oe as isVuePlugin,
|
|
1183
|
+
Ce as loadCss,
|
|
1184
|
+
R as logger,
|
|
1185
|
+
O as nodeRender,
|
|
1186
|
+
Ie as parseDeps,
|
|
1187
|
+
C as parseExpression,
|
|
1188
|
+
W as parseFunction,
|
|
1189
|
+
ne as providerKey,
|
|
1190
|
+
Z as toString,
|
|
1191
|
+
Lt as useMask,
|
|
1192
|
+
oe as useProvider
|
|
1142
1193
|
};
|