@vtj/renderer 0.12.9 → 0.12.11

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.mjs CHANGED
@@ -1,18 +1,18 @@
1
- import { Base as Fe, BUILT_IN_COMPONENTS as Ae, ProjectModel as D, HistoryModel as ue } from "@vtj/core";
2
- import { isUrl as Me, url as P, dedupArray as Ie, isString as j, isFunction as q, logger as R, storage as B, cookie as U, toArray as se, unRSA as re, delay as le, createRequest as pe, jsonp as de, merge as He, pathToRegexp as Te, pathToRegexpMatch as De, formDataToJson as xe, cloneDeep as ne, camelCase as b, upperFirst as Oe, pick as Ne, request as J, loadScript as ie, Storage as Be, mapToObject as Q } from "@vtj/utils";
3
- import * as O from "vue";
4
- import { inject as fe, defineComponent as he, h as K, ref as V, defineAsyncComponent as oe, watchEffect as Ue } from "vue";
5
- import { useRoute as me } from "vue-router";
1
+ import { Base as Te, BUILT_IN_COMPONENTS as De, ProjectModel as N, HistoryModel as pe } from "@vtj/core";
2
+ import { isUrl as xe, url as b, dedupArray as Oe, isString as j, isFunction as K, logger as C, storage as L, cookie as q, toArray as re, unRSA as ie, delay as fe, createRequest as de, jsonp as he, merge as Ne, pathToRegexp as Be, pathToRegexpMatch as Ue, formDataToJson as Le, cloneDeep as oe, camelCase as E, upperFirst as qe, pick as Je, request as z, loadScript as ae, Storage as Ke, mapToObject as Z } from "@vtj/utils";
3
+ import * as B from "vue";
4
+ import { inject as me, defineComponent as ve, h as V, ref as W, defineAsyncComponent as ce, watchEffect as ze } from "vue";
5
+ import { useRoute as ge } from "vue-router";
6
6
  /**!
7
7
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
8
8
  * @name @vtj/renderer
9
9
  * @author CHC chenhuachun1549@dingtalk.com
10
- * @version 0.12.9
10
+ * @version 0.12.11
11
11
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
12
12
  */
13
- const C = "0.12.9";
14
- var y = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(y || {});
15
- const ae = [
13
+ const A = "0.12.11";
14
+ var y = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(y || {});
15
+ const le = [
16
16
  "$el",
17
17
  "$emit",
18
18
  "$nextTick",
@@ -24,7 +24,7 @@ const ae = [
24
24
  "$props",
25
25
  "$options",
26
26
  "$forceUpdate"
27
- ], zt = [
27
+ ], Xt = [
28
28
  "beforeCreate",
29
29
  "created",
30
30
  "beforeMount",
@@ -38,14 +38,16 @@ const ae = [
38
38
  "renderTriggered",
39
39
  "activated",
40
40
  "deactivated"
41
- ], Le = [
41
+ ], Ve = [
42
42
  "vIf",
43
+ "vElseIf",
44
+ "vElse",
43
45
  "vShow",
44
46
  "vModel",
45
47
  "vFor",
46
48
  "vBind",
47
49
  "vHtml"
48
- ], qe = {
50
+ ], We = {
49
51
  String,
50
52
  Number,
51
53
  Boolean,
@@ -53,160 +55,160 @@ const ae = [
53
55
  Object,
54
56
  Function,
55
57
  Date
56
- }, k = "VtjPage", T = "VtjHomepage", Je = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
58
+ }, I = "VtjPage", O = "VtjHomepage", Ge = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
57
59
  ","
58
- ), Ke = "component,slot".split(",");
59
- function I(r, e) {
60
- return r.map((t) => Me(t) || t.startsWith("/") ? t : `${e}${t}`);
60
+ ), Ye = "component,slot".split(",");
61
+ function D(n, e) {
62
+ return n.map((t) => xe(t) || t.startsWith("/") ? t : `${e}${t}`);
61
63
  }
62
- function X(r) {
63
- return /\.css$/.test(r);
64
+ function ee(n) {
65
+ return /\.css$/.test(n);
64
66
  }
65
- function Z(r) {
66
- return /\.js$/.test(r);
67
+ function te(n) {
68
+ return /\.js$/.test(n);
67
69
  }
68
- function Ve(r) {
69
- return /\.json$/.test(r);
70
+ function Qe(n) {
71
+ return /\.json$/.test(n);
70
72
  }
71
- function Wt(r) {
72
- return r.map(
73
- (e) => `<script src="${P.append(e, { v: C })}"><\/script>`
73
+ function Zt(n) {
74
+ return n.map(
75
+ (e) => `<script src="${b.append(e, { v: A })}"><\/script>`
74
76
  ).join("");
75
77
  }
76
- function Gt(r = []) {
77
- return r.map(
78
- (e) => `<link rel="stylesheet" href="${P.append(e, { v: C })}" />`
78
+ function es(n = []) {
79
+ return n.map(
80
+ (e) => `<link rel="stylesheet" href="${b.append(e, { v: A })}" />`
79
81
  ).join("");
80
82
  }
81
- function ze(r, e = !1) {
82
- return e && r.endsWith(".prod.js") ? r.replace(".prod.js", ".js") : r;
83
+ function Xe(n, e = !1) {
84
+ return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
83
85
  }
84
- function We(r, e, t = !1) {
85
- const s = r.filter((m) => !!m.enabled), n = [], i = [], a = [], o = [], c = {}, u = {}, p = [], d = {};
86
+ function Ze(n, e, t = !1) {
87
+ const s = n.filter((m) => !!m.enabled), r = [], i = [], a = [], o = [], c = {}, l = {}, u = [], p = {};
86
88
  return s.forEach(
87
- ({ urls: m, assetsUrl: h, library: f, assetsLibrary: l, localeLibrary: w }) => {
88
- m?.forEach((g) => {
89
- Z(g) && n.push(ze(g, t)), X(g) && i.push(g);
90
- }), f && (o.push(f), c[f] = I(m || [], e), w && (u[f] = w)), h && a.push(h), l && p.push(l), f && l && (d[l] = f);
89
+ ({ urls: m, assetsUrl: f, library: d, assetsLibrary: h, localeLibrary: _ }) => {
90
+ m?.forEach((v) => {
91
+ te(v) && r.push(Xe(v, t)), ee(v) && i.push(v);
92
+ }), d && (o.push(d), c[d] = D(m || [], e), _ && (l[d] = _)), f && a.push(f), h && u.push(h), d && h && (p[h] = d);
91
93
  }
92
94
  ), {
93
- scripts: I(n, e),
94
- css: I(i, e),
95
- materials: I(a, e),
95
+ scripts: D(r, e),
96
+ css: D(i, e),
97
+ materials: D(a, e),
96
98
  libraryExports: o,
97
- materialExports: Ie(p),
98
- materialMapLibrary: d,
99
+ materialExports: Oe(u),
100
+ materialMapLibrary: p,
99
101
  libraryMap: c,
100
- libraryLocaleMap: u
102
+ libraryLocaleMap: l
101
103
  };
102
104
  }
103
- function Ge(r, e) {
104
- const { name: t, parent: s, alias: n } = r;
105
- return s ? e[s]?.[n || t] : e[n || t];
105
+ function et(n, e) {
106
+ const { name: t, parent: s, alias: r } = n;
107
+ return s ? e[s]?.[r || t] : e[r || t];
106
108
  }
107
- function ge(r) {
108
- return j(r) ? r : JSON.stringify(r);
109
+ function ye(n) {
110
+ return j(n) ? n : JSON.stringify(n);
109
111
  }
110
- function ve(r, e, t) {
111
- const s = r.CSSStyleSheet;
112
+ function _e(n, e, t) {
113
+ const s = n.CSSStyleSheet;
112
114
  if (s.prototype.replaceSync) {
113
- const n = new s();
114
- n.id = e, n.replaceSync(t);
115
- const i = r.document, a = i.adoptedStyleSheets, o = Array.from(a).filter(
115
+ const r = new s();
116
+ r.id = e, r.replaceSync(t);
117
+ const i = n.document, a = i.adoptedStyleSheets, o = Array.from(a).filter(
116
118
  (c) => c.id !== e
117
119
  );
118
- i.adoptedStyleSheets = [...o, n];
120
+ i.adoptedStyleSheets = [...o, r];
119
121
  } else {
120
- const n = r.document;
121
- let i = n.getElementById(e);
122
- i ? i.innerHTML = t : (i = n.createElement("style"), i.id = e, i.innerHTML = t, n.head.appendChild(i));
122
+ const r = n.document;
123
+ let i = r.getElementById(e);
124
+ i ? i.innerHTML = t : (i = r.createElement("style"), i.id = e, i.innerHTML = t, r.head.appendChild(i));
123
125
  }
124
126
  }
125
- async function Ye(r, e) {
127
+ async function tt(n, e) {
126
128
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
127
- t && ve(window, r, t);
129
+ t && _e(window, n, t);
128
130
  }
129
- function Qe(r, e = window) {
131
+ function st(n, e = window) {
130
132
  const t = e.document, s = e.document.head;
131
- for (const n of r)
132
- if (!t.getElementById(n)) {
133
+ for (const r of n)
134
+ if (!t.getElementById(r)) {
133
135
  const a = t.createElement("link");
134
- a.rel = "stylesheet", a.id = n, a.href = n, s.appendChild(a);
136
+ a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
135
137
  }
136
138
  }
137
- async function Xe(r, e, t = window) {
138
- const s = t.document, n = t.document.head;
139
+ async function nt(n, e, t = window) {
140
+ const s = t.document, r = t.document.head;
139
141
  let i = t[e];
140
142
  return i ? i.default || i : new Promise((a, o) => {
141
- for (const c of r) {
142
- const u = s.createElement("script");
143
- u.src = c, u.onload = () => {
143
+ for (const c of n) {
144
+ const l = s.createElement("script");
145
+ l.src = c, l.onload = () => {
144
146
  i = t[e], i ? a(i.default || i) : o(null);
145
- }, u.onerror = (p) => {
146
- o(p);
147
- }, n.appendChild(u);
147
+ }, l.onerror = (u) => {
148
+ o(u);
149
+ }, r.appendChild(l);
148
150
  }
149
151
  });
150
152
  }
151
- function Ze(r) {
152
- return q(r) || q(r?.install);
153
+ function rt(n) {
154
+ return K(n) || K(n?.install);
153
155
  }
154
- function et(r) {
155
- return Ke.includes(r);
156
+ function it(n) {
157
+ return Ye.includes(n);
156
158
  }
157
- function tt(r) {
158
- return Je.includes(r);
159
+ function ot(n) {
160
+ return Ge.includes(n);
159
161
  }
160
- function F(r = window) {
162
+ function M(n = window) {
161
163
  const e = window?.Mock;
162
164
  if (e) return e;
163
- const t = r?.Mock;
165
+ const t = n?.Mock;
164
166
  if (t && window)
165
167
  return window.Mock = t, t;
166
168
  }
167
- function Yt(r, e, t) {
169
+ function ts(n, e, t) {
168
170
  Object.assign(e.meta, t.meta);
169
- const s = r?._container;
171
+ const s = n?._container;
170
172
  t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
171
173
  }
172
- function A(r, e, t = !1, s = !1) {
174
+ function H(n, e, t = !1, s = !1) {
173
175
  try {
174
- const n = ['"use strict";', "var __self = arguments[0];"];
175
- n.push("return ");
176
- let i = (r.value || "").trim();
177
- i = i.replace(/this(\W|$)/g, (o, c) => `__self${c}`), i = n.join(`
176
+ const r = ['"use strict";', "var __self = arguments[0];"];
177
+ r.push("return ");
178
+ let i = (n.value || "").trim();
179
+ i = i.replace(/this(\W|$)/g, (o, c) => `__self${c}`), i = r.join(`
178
180
  `) + i;
179
181
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
180
182
  return new Function("$scope", a)(e);
181
- } catch (n) {
182
- if (R.error("parseExpression.error", n, r, e?.__self ?? e), s)
183
- throw n;
183
+ } catch (r) {
184
+ if (C.error("parseExpression.error", r, n, e?.__self ?? e), s)
185
+ throw r;
184
186
  }
185
187
  }
186
- function z(r, e, t = !1, s = !1) {
187
- const n = A(r, e, t, s);
188
- if (typeof n != "function" && (R.error(
188
+ function G(n, e, t = !1, s = !1) {
189
+ const r = H(n, e, t, s);
190
+ if (typeof r != "function" && (C.error(
189
191
  "parseFunction.error",
190
192
  "not a function",
191
- r,
193
+ n,
192
194
  e?.__self ?? e
193
195
  ), s))
194
- throw new Error(`"${r.value}" not a function`);
195
- return n;
196
+ throw new Error(`"${n.value}" not a function`);
197
+ return r;
196
198
  }
197
- function _(r) {
198
- return r && r.type === "JSExpression";
199
+ function w(n) {
200
+ return n && n.type === "JSExpression";
199
201
  }
200
- function M(r) {
201
- return typeof r == "object" && r && r.type === "JSFunction";
202
+ function T(n) {
203
+ return typeof n == "object" && n && n.type === "JSFunction";
202
204
  }
203
- function st(r) {
204
- return _(r) || M(r);
205
+ function at(n) {
206
+ return w(n) || T(n);
205
207
  }
206
- function Qt(r) {
207
- return st(r) ? r.value : JSON.stringify(r);
208
+ function ss(n) {
209
+ return at(n) ? n.value : JSON.stringify(n);
208
210
  }
209
- const rt = {
211
+ const ct = {
210
212
  session: !1,
211
213
  authKey: "Authorization",
212
214
  storageKey: "ACCESS_STORAGE",
@@ -219,14 +221,14 @@ const rt = {
219
221
  noPermissionMessage: "无权限访问该页面",
220
222
  appName: "",
221
223
  statusKey: "code"
222
- }, ye = Symbol("access");
223
- class _e {
224
+ }, we = Symbol("access");
225
+ class Se {
224
226
  options;
225
227
  data = null;
226
228
  mode = y.Raw;
227
229
  interceptResponse = !0;
228
230
  constructor(e) {
229
- this.options = Object.assign({}, rt, e), this.loadData();
231
+ this.options = Object.assign({}, ct, e), this.loadData();
230
232
  }
231
233
  enableIntercept() {
232
234
  this.interceptResponse = !0;
@@ -235,22 +237,22 @@ class _e {
235
237
  this.interceptResponse = !1;
236
238
  }
237
239
  connect(e) {
238
- const { mode: t, router: s, request: n } = e;
239
- this.mode = t, s && this.mode === y.Raw && this.setGuard(s), n && this.setRequest(n);
240
+ const { mode: t, router: s, request: r } = e;
241
+ this.mode = t, s && this.mode === y.Raw && this.setGuard(s), r && this.setRequest(r);
240
242
  }
241
243
  login(e) {
242
- const { storageKey: t, storagePrefix: s, session: n, authKey: i } = this.options;
243
- this.setData(e), this.data && (B.save(t, e, {
244
+ const { storageKey: t, storagePrefix: s, session: r, authKey: i } = this.options;
245
+ this.setData(e), this.data && (L.save(t, e, {
244
246
  type: "local",
245
247
  prefix: s
246
- }), n && U.set(i, this.data.token));
248
+ }), r && q.set(i, this.data.token));
247
249
  }
248
250
  clear() {
249
- const { storageKey: e, storagePrefix: t, session: s, authKey: n } = this.options;
250
- this.data = null, B.remove(e, {
251
+ const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
252
+ this.data = null, L.remove(e, {
251
253
  type: "local",
252
254
  prefix: t
253
- }), s && U.remove(n);
255
+ }), s && q.remove(r);
254
256
  }
255
257
  logout() {
256
258
  this.clear(), this.toLogin();
@@ -263,22 +265,22 @@ class _e {
263
265
  }
264
266
  can(e) {
265
267
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
266
- return typeof e == "function" ? e(s) : se(e).every((i) => s[i] || s[t + "." + i]);
268
+ return typeof e == "function" ? e(s) : re(e).every((i) => s[i] || s[t + "." + i]);
267
269
  }
268
270
  some(e) {
269
271
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
270
- return se(e).some((i) => s[i] || s[t + "." + i]);
272
+ return re(e).some((i) => s[i] || s[t + "." + i]);
271
273
  }
272
274
  install(e) {
273
- e.config.globalProperties.$access = this, e.provide(ye, this);
275
+ e.config.globalProperties.$access = this, e.provide(we, this);
274
276
  }
275
277
  isAuthPath(e) {
276
278
  const { auth: t, isAuth: s } = this.options;
277
279
  if (s)
278
280
  return s(e);
279
281
  if (e.path && typeof t == "string") {
280
- const n = t.split("#")[1] || t;
281
- return e.path === n;
282
+ const r = t.split("#")[1] || t;
283
+ return e.path === r;
282
284
  }
283
285
  return !1;
284
286
  }
@@ -291,17 +293,17 @@ class _e {
291
293
  setData(e) {
292
294
  const { privateKey: t } = this.options;
293
295
  if (Array.isArray(e) && t) {
294
- const s = e.map((n) => re(n, t));
296
+ const s = e.map((r) => ie(r, t));
295
297
  try {
296
298
  this.data = JSON.parse(s.join(""));
297
- } catch (n) {
298
- console.warn(n);
299
+ } catch (r) {
300
+ console.warn(r);
299
301
  }
300
302
  return;
301
303
  }
302
304
  if (typeof e == "string")
303
305
  try {
304
- const s = t ? re(e, t) : e;
306
+ const s = t ? ie(e, t) : e;
305
307
  s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
306
308
  } catch (s) {
307
309
  console.warn(s);
@@ -310,7 +312,7 @@ class _e {
310
312
  this.data = e;
311
313
  }
312
314
  loadData() {
313
- const { storageKey: e, storagePrefix: t } = this.options, s = B.get(e, {
315
+ const { storageKey: e, storagePrefix: t } = this.options, s = L.get(e, {
314
316
  type: "local",
315
317
  prefix: t
316
318
  });
@@ -318,17 +320,17 @@ class _e {
318
320
  }
319
321
  isLogined() {
320
322
  const { session: e, authKey: t } = this.options;
321
- return e && t ? !!U.get(t) : !!this.getToken();
323
+ return e && t ? !!q.get(t) : !!this.getToken();
322
324
  }
323
325
  hasRoutePermission(e) {
324
- if (e.name === k) {
326
+ if (e.name === I) {
325
327
  const t = e.params.id;
326
328
  return t && this.can(t);
327
329
  }
328
330
  return !0;
329
331
  }
330
332
  setGuard(e) {
331
- e.beforeEach((t, s, n) => this.guard(t, n));
333
+ e.beforeEach((t, s, r) => this.guard(t, r));
332
334
  }
333
335
  async guard(e, t) {
334
336
  if (this.isWhiteList(e) || this.isAuthPath(e))
@@ -337,8 +339,8 @@ class _e {
337
339
  if (this.hasRoutePermission(e))
338
340
  return t();
339
341
  {
340
- const { noPermissionMessage: s = "无权限访问", unauthorized: n = !1 } = this.options;
341
- return await this.showTip(s), q(n) ? (n(), t(!1)) : j(n) ? t(n) : t(!1);
342
+ const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
343
+ return await this.showTip(s), K(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
342
344
  }
343
345
  }
344
346
  t(!1), this.toLogin();
@@ -357,7 +359,7 @@ class _e {
357
359
  }
358
360
  async showTip(e) {
359
361
  const { alert: t } = this.options;
360
- return t ? (await le(150), await t(e, {
362
+ return t ? (await fe(150), await t(e, {
361
363
  title: "提示",
362
364
  type: "warning"
363
365
  }).catch(() => !1)) : !1;
@@ -373,31 +375,31 @@ class _e {
373
375
  );
374
376
  }
375
377
  }
376
- function nt() {
377
- return fe(ye, null);
378
+ function lt() {
379
+ return me(we, null);
378
380
  }
379
- function Xt(r = {}) {
381
+ function ns(n = {}) {
380
382
  const {
381
383
  notify: e,
382
384
  loading: t,
383
385
  settings: s = {},
384
- Startup: n,
386
+ Startup: r,
385
387
  access: i,
386
388
  useTitle: a,
387
389
  alert: o
388
- } = r;
390
+ } = n;
389
391
  let c = null;
390
392
  return {
391
- request: pe({
393
+ request: de({
392
394
  settings: {
393
395
  type: "form",
394
396
  validSuccess: !0,
395
397
  originResponse: !1,
396
398
  loading: !0,
397
- validate: (p) => p.data?.code === 0 || !!p.data?.success,
399
+ validate: (u) => u.data?.code === 0 || !!u.data?.success,
398
400
  failMessage: !0,
399
- showError: (p) => {
400
- e && e(p || "未知错误");
401
+ showError: (u) => {
402
+ e && e(u || "未知错误");
401
403
  },
402
404
  showLoading: () => {
403
405
  c && c.close(), t && (c = t());
@@ -408,89 +410,89 @@ function Xt(r = {}) {
408
410
  ...s
409
411
  }
410
412
  }),
411
- jsonp: de,
413
+ jsonp: he,
412
414
  notify: e,
413
415
  loading: t,
414
416
  useTitle: a,
415
- startupComponent: n,
416
- access: i ? new _e({ alert: o, ...i }) : void 0
417
+ startupComponent: r,
418
+ access: i ? new Se({ alert: o, ...i }) : void 0
417
419
  };
418
420
  }
419
- function Zt(r = {}) {
420
- return new _e(r);
421
+ function rs(n = {}) {
422
+ return new Se(n);
421
423
  }
422
- function it(r, e) {
424
+ function ut(n, e) {
423
425
  const { jsonp: t, request: s } = e;
424
- if (r.method === "jsonp")
425
- return (n = {}) => t(r.url, {
426
- ...r.jsonpOptions,
427
- query: n
426
+ if (n.method === "jsonp")
427
+ return (r = {}) => t(n.url, {
428
+ ...n.jsonpOptions,
429
+ query: r
428
430
  });
429
431
  {
430
- const n = r.headers ? A(r.headers, {}, !0) : void 0, i = {
431
- url: r.url,
432
- method: r.method,
432
+ const r = n.headers ? H(n.headers, {}, !0) : void 0, i = {
433
+ url: n.url,
434
+ method: n.method,
433
435
  settings: {
434
- ...r.settings,
435
- headers: n
436
+ ...n.settings,
437
+ headers: r
436
438
  }
437
439
  };
438
- return (a, o) => (delete i.data, s.send(He(i, o || {}, { data: a })));
440
+ return (a, o) => (delete i.data, s.send(Ne(i, o || {}, { data: a })));
439
441
  }
440
442
  }
441
- function ot(r, e) {
443
+ function pt(n, e) {
442
444
  const { metaQuery: t } = e;
443
445
  if (!t) return;
444
- const { code: s, queryCode: n } = r;
446
+ const { code: s, queryCode: r } = n;
445
447
  return (i, a) => {
446
448
  if (!t) {
447
449
  console.warn("adapter.metaQuery is not defined!");
448
450
  return;
449
451
  }
450
- return t(s, n, i, a);
452
+ return t(s, r, i, a);
451
453
  };
452
454
  }
453
- function at(r = [], e = [], t) {
455
+ function ft(n = [], e = [], t) {
454
456
  const s = {};
455
- for (const n of r)
456
- s[n.id] = it(n, t);
457
- for (const n of e)
458
- s[n.id] = ot(n, t);
457
+ for (const r of n)
458
+ s[r.id] = ut(r, t);
459
+ for (const r of e)
460
+ s[r.id] = pt(r, t);
459
461
  return s;
460
462
  }
461
- async function ct(r = [], e = window) {
462
- const t = F(e);
463
- t && (we(e), r.forEach((s) => lt(t, s)));
463
+ async function dt(n = [], e = window) {
464
+ const t = M(e);
465
+ t && ($e(e), n.forEach((s) => mt(t, s)));
464
466
  }
465
- function ut(r, e = window) {
466
- const t = M(r.mockTemplate) && r.mockTemplate.value ? z(r.mockTemplate, {}, !0) : void 0, s = F(e);
467
- return async (...n) => {
467
+ function ht(n, e = window) {
468
+ const t = T(n.mockTemplate) && n.mockTemplate.value ? G(n.mockTemplate, {}, !0) : void 0, s = M(e);
469
+ return async (...r) => {
468
470
  let i = {};
469
471
  if (t)
470
472
  try {
471
- i = await t.apply(t, n);
473
+ i = await t.apply(t, r);
472
474
  } catch (a) {
473
- R.warn("模拟数据模版异常", a);
475
+ C.warn("模拟数据模版异常", a);
474
476
  }
475
477
  return s?.mock(i);
476
478
  };
477
479
  }
478
- function lt(r, e) {
480
+ function mt(n, e) {
479
481
  if (!e.mock) return;
480
482
  const { url: t, mockTemplate: s } = e;
481
483
  if (t && s) {
482
- const n = Te(`${t}(.*)`), i = De(t, { decode: decodeURIComponent }), a = A(s, {}, !0);
483
- r.mock(n, (o) => {
484
- const c = P.parse(o.url) || {}, u = o.body instanceof FormData ? xe(o.body) : o.body, p = i(o.url)?.params;
485
- return Object.assign(o, { data: u, params: c, query: p }), r.mock(a(o));
484
+ const r = Be(`${t}(.*)`), i = Ue(t, { decode: decodeURIComponent }), a = H(s, {}, !0);
485
+ n.mock(r, (o) => {
486
+ const c = b.parse(o.url) || {}, l = o.body instanceof FormData ? Le(o.body) : o.body, u = i(o.url)?.params;
487
+ return Object.assign(o, { data: l, params: c, query: u }), n.mock(a(o));
486
488
  });
487
489
  }
488
490
  }
489
- function we(r = window) {
490
- const e = F(r);
491
+ function $e(n = window) {
492
+ const e = M(n);
491
493
  e && (e._mocked = {});
492
494
  }
493
- class pt {
495
+ class vt {
494
496
  __id = null;
495
497
  __mode;
496
498
  __instance = null;
@@ -516,15 +518,15 @@ class pt {
516
518
  $apis = {};
517
519
  __transform = {};
518
520
  constructor(e) {
519
- const { mode: t, dsl: s, attrs: n } = e;
520
- this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), n && Object.assign(this, n);
521
+ const { mode: t, dsl: s, attrs: r } = e;
522
+ this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
521
523
  }
522
- setup(e, t = O) {
524
+ setup(e, t = B) {
523
525
  const s = t.getCurrentInstance();
524
526
  if (!s) return;
525
527
  this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
526
- const n = s.appContext.config.globalProperties;
527
- Object.assign(this, n), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
528
+ const r = s.appContext.config.globalProperties;
529
+ Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
528
530
  this.__proxy();
529
531
  }), t.onUnmounted(() => {
530
532
  this.__cleanup();
@@ -533,12 +535,12 @@ class pt {
533
535
  });
534
536
  }
535
537
  __proxy() {
536
- this.__instance && ae.forEach((e) => {
538
+ this.__instance && le.forEach((e) => {
537
539
  this[e] = this.__instance?.[e];
538
540
  });
539
541
  }
540
542
  __cleanup() {
541
- ae.forEach((e) => {
543
+ le.forEach((e) => {
542
544
  this[e] = null;
543
545
  }), this.__reset();
544
546
  }
@@ -548,35 +550,35 @@ class pt {
548
550
  __parseFunction(e) {
549
551
  if (e)
550
552
  if (this.__mode === y.Runtime) {
551
- const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
552
- return z({ type: s, value: n }, this);
553
+ const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
554
+ return G({ type: s, value: r }, this);
553
555
  } else
554
- return z(e, this);
556
+ return G(e, this);
555
557
  }
556
558
  __parseExpression(e) {
557
559
  if (e)
558
560
  if (this.__mode === y.Runtime) {
559
- const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
560
- return A({ type: s, value: n }, this);
561
+ const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
562
+ return H({ type: s, value: r }, this);
561
563
  } else
562
- return A(e, this);
564
+ return H(e, this);
563
565
  }
564
566
  __ref(e = null, t) {
565
567
  if (this.__mode !== y.VNode)
566
568
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
567
- await le(0);
568
- let n = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
569
- if (!n) {
569
+ await fe(0);
570
+ let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
571
+ if (!r) {
570
572
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
571
573
  return;
572
574
  }
573
- return n.nodeType === 3 && n.nextSibling && (n = n.nextSibling), n.__vtj__ = e, y.Design === this.__mode && (n.__context__ = this, n.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
575
+ return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, y.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
574
576
  };
575
577
  }
576
578
  __getRefEl(e, t, s) {
577
- const n = e[t];
578
- if (n && s !== n) {
579
- const i = new Set([].concat(n, s));
579
+ const r = e[t];
580
+ if (r && s !== r) {
581
+ const i = new Set([].concat(r, s));
580
582
  return Array.from(i);
581
583
  } else
582
584
  return s;
@@ -589,123 +591,125 @@ class pt {
589
591
  return s.context.__proto__ = this.context, s.__proto__ = this, s;
590
592
  }
591
593
  }
592
- function W(r) {
594
+ function Y(n) {
593
595
  const {
594
- Vue: e = O,
596
+ Vue: e = B,
595
597
  mode: t = y.Runtime,
596
598
  components: s = {},
597
- libs: n = {},
599
+ libs: r = {},
598
600
  apis: i = {},
599
601
  loader: a
600
- } = r, o = e.computed(() => r.dsl), c = {
602
+ } = n, o = e.computed(() => n.dsl), c = {
601
603
  $components: s,
602
- $libs: n,
604
+ $libs: r,
603
605
  $apis: i
604
- }, u = new pt({
606
+ }, l = new vt({
605
607
  mode: t,
606
608
  dsl: o.value,
607
609
  attrs: c
608
- }), p = e.defineComponent({
610
+ }), u = e.defineComponent({
609
611
  name: o.value.name,
610
612
  props: {
611
- ...ft(o.value.props ?? [], u)
613
+ ...yt(o.value.props ?? [], l)
612
614
  },
613
- setup(d) {
614
- u.$props = d, u.props = d, o.value.id && ve(
615
- r.window || window,
615
+ setup(p) {
616
+ l.$props = p, l.props = p, o.value.id && _e(
617
+ n.window || window,
616
618
  o.value.id,
617
619
  o.value.css || ""
618
- ), u.state = ht(e, o.value.state ?? {}, u);
619
- const m = mt(e, o.value.computed ?? {}, u), h = gt(o.value.methods ?? {}, u), f = vt(e, o.value.inject, u), l = yt(
620
+ ), l.state = _t(e, o.value.state ?? {}, l);
621
+ const m = wt(e, o.value.computed ?? {}, l), f = St(o.value.methods ?? {}, l), d = $t(e, o.value.inject, l), h = Et(
620
622
  o.value.dataSources || {},
621
- u
622
- ), w = {
623
- ...f,
623
+ l
624
+ ), _ = {
625
+ ...d,
624
626
  ...m,
625
- ...h,
626
- ...l
627
+ ...f,
628
+ ...h
627
629
  };
628
- return u.setup(w, e), _t(e, o.value.watch ?? [], u), {
629
- vtj: u
630
+ return l.setup(_, e), jt(e, o.value.watch ?? [], l), {
631
+ vtj: l
630
632
  };
631
633
  },
632
- emits: dt(o.value.emits),
634
+ emits: gt(o.value.emits),
633
635
  expose: ["vtj"],
634
636
  render() {
635
637
  if (!o.value.nodes) return null;
636
- const d = o.value.nodes || [];
637
- return d.length === 1 ? x(d[0], u, e, a) : d.map((m) => x(m, u, e, a));
638
+ const p = o.value.nodes || [];
639
+ return p.length === 1 ? k(p[0], l, e, a, p) : p.map(
640
+ (m) => k(m, l, e, a, p)
641
+ );
638
642
  },
639
- ...wt(o.value.lifeCycles ?? {}, u)
643
+ ...Pt(o.value.lifeCycles ?? {}, l)
640
644
  });
641
645
  return {
642
- renderer: e.markRaw(p),
643
- context: u
646
+ renderer: e.markRaw(u),
647
+ context: l
644
648
  };
645
649
  }
646
- function dt(r = []) {
647
- return r.map((e) => j(e) ? e : e.name);
650
+ function gt(n = []) {
651
+ return n.map((e) => j(e) ? e : e.name);
648
652
  }
649
- function ft(r = [], e) {
650
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) => qe[i]) : void 0;
651
- return r.map((s) => j(s) ? {
653
+ function yt(n = [], e) {
654
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) => We[i]) : void 0;
655
+ return n.map((s) => j(s) ? {
652
656
  name: s
653
657
  } : {
654
658
  name: s.name,
655
659
  type: s.type,
656
660
  required: s.required,
657
- default: _(s.default) ? e.__parseExpression(s.default) : s.default
661
+ default: w(s.default) ? e.__parseExpression(s.default) : s.default
658
662
  }).reduce(
659
- (s, n) => (s[n.name] = {
660
- type: t(n.type),
661
- required: n.required,
662
- default: n.default
663
+ (s, r) => (s[r.name] = {
664
+ type: t(r.type),
665
+ required: r.required,
666
+ default: r.default
663
667
  }, s),
664
668
  {}
665
669
  );
666
670
  }
667
- function ht(r, e, t) {
668
- return r.reactive(
671
+ function _t(n, e, t) {
672
+ return n.reactive(
669
673
  Object.keys(e || {}).reduce(
670
- (s, n) => {
671
- let i = e[n];
672
- return _(i) ? i = t.__parseExpression(i) : M(i) && (i = t.__parseFunction(i)), s[n] = i, s;
674
+ (s, r) => {
675
+ let i = e[r];
676
+ return w(i) ? i = t.__parseExpression(i) : T(i) && (i = t.__parseFunction(i)), s[r] = i, s;
673
677
  },
674
678
  {}
675
679
  )
676
680
  );
677
681
  }
678
- function mt(r, e, t) {
682
+ function wt(n, e, t) {
679
683
  return Object.entries(e ?? {}).reduce(
680
- (s, [n, i]) => (s[n] = r.computed(t.__parseFunction(i)), s),
684
+ (s, [r, i]) => (s[r] = n.computed(t.__parseFunction(i)), s),
681
685
  {}
682
686
  );
683
687
  }
684
- function gt(r, e) {
685
- return Object.entries(r ?? {}).reduce(
686
- (t, [s, n]) => (t[s] = e.__parseFunction(n), t),
688
+ function St(n, e) {
689
+ return Object.entries(n ?? {}).reduce(
690
+ (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
687
691
  {}
688
692
  );
689
693
  }
690
- function vt(r, e = [], t) {
694
+ function $t(n, e = [], t) {
691
695
  return e.reduce(
692
- (s, n) => {
693
- const { name: i, from: a } = n || {};
694
- n.default;
695
- const o = _(a) ? t.__parseExpression(a) || i : a ?? i, c = _(n.default) ? t.__parseExpression(n.default) : n.default ?? null;
696
- return s[i] = r.inject(o, c), s;
696
+ (s, r) => {
697
+ const { name: i, from: a } = r || {};
698
+ r.default;
699
+ const o = w(a) ? t.__parseExpression(a) || i : a ?? i, c = w(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
700
+ return s[i] = n.inject(o, c), s;
697
701
  },
698
702
  {}
699
703
  );
700
704
  }
701
- function yt(r, e) {
702
- return Object.keys(r).reduce(
705
+ function Et(n, e) {
706
+ return Object.keys(n).reduce(
703
707
  (t, s) => {
704
- const n = r[s];
705
- if (n.type === "mock")
706
- t[s] = ut(n);
707
- else if (n.ref) {
708
- const i = e.$apis[n.ref], a = M(n.transform) ? n.transform.value ? e.__parseFunction(n.transform) : void 0 : n.transform;
708
+ const r = n[s];
709
+ if (r.type === "mock")
710
+ t[s] = ht(r);
711
+ else if (r.ref) {
712
+ const i = e.$apis[r.ref], a = T(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
709
713
  t[s] = async (...o) => {
710
714
  const c = await i.apply(e, o);
711
715
  return a ? a(c) : c;
@@ -716,9 +720,9 @@ function yt(r, e) {
716
720
  {}
717
721
  );
718
722
  }
719
- function _t(r, e = [], t) {
723
+ function jt(n, e = [], t) {
720
724
  e.forEach((s) => {
721
- r.watch(
725
+ n.watch(
722
726
  t.__parseExpression(s.source),
723
727
  t.__parseFunction(s.handler),
724
728
  {
@@ -728,257 +732,277 @@ function _t(r, e = [], t) {
728
732
  );
729
733
  });
730
734
  }
731
- function wt(r, e) {
732
- return Object.entries(r ?? {}).reduce(
733
- (t, [s, n]) => (t[s] = e.__parseFunction(n), t),
735
+ function Pt(n, e) {
736
+ return Object.entries(n ?? {}).reduce(
737
+ (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
734
738
  {}
735
739
  );
736
740
  }
737
- let L = [], E = {};
738
- const St = (r) => r;
739
- async function Se(r, e = window) {
740
- const { urls: t = [], library: s } = r, n = t.filter((o) => Z(o));
741
- if (n.length === 0 || !s) return null;
742
- const i = t.filter((o) => X(o));
743
- return i.length && Qe(i, e), await Xe(n, s, e).catch(
744
- (o) => (console.warn("loadScriptUrl error", n, s, o), null)
741
+ let J = [], R = {};
742
+ const Rt = (n) => n;
743
+ async function Ee(n, e = window) {
744
+ const { urls: t = [], library: s } = n, r = t.filter((o) => te(o));
745
+ if (r.length === 0 || !s) return null;
746
+ const i = t.filter((o) => ee(o));
747
+ return i.length && st(i, e), await nt(r, s, e).catch(
748
+ (o) => (console.warn("loadScriptUrl error", r, s, o), null)
745
749
  );
746
750
  }
747
- function G(r) {
748
- const { getDsl: e, getDslByUrl: t, options: s } = r;
749
- return s.window && (L.forEach((n) => {
750
- delete s.window[n];
751
- }), L = []), (n, i, a = O) => {
752
- if (!i || typeof i == "string") return n;
751
+ function Q(n) {
752
+ const { getDsl: e, getDslByUrl: t, options: s } = n;
753
+ return s.window && (J.forEach((r) => {
754
+ delete s.window[r];
755
+ }), J = []), (r, i, a = B) => {
756
+ if (!i || typeof i == "string") return r;
753
757
  if (i.type === "Schema" && i.id)
754
758
  return a.defineAsyncComponent(async () => {
755
- const o = E[i.id] || await e(i.id);
756
- return o && (o.name = n, E[i.id] = o), o ? W({
759
+ const o = R[i.id] || await e(i.id);
760
+ return o && (o.name = r, R[i.id] = o), o ? Y({
757
761
  ...s,
758
762
  Vue: a,
759
- dsl: ne(o),
763
+ dsl: oe(o),
760
764
  mode: y.Runtime,
761
- loader: G(r)
765
+ loader: Q(n)
762
766
  }).renderer : null;
763
767
  });
764
768
  if (i.type === "UrlSchema" && i.url)
765
769
  return a.defineAsyncComponent(async () => {
766
- const o = E[i.url] || await t(i.url);
767
- return o && (o.name = n, E[i.url] = o), o ? W({
770
+ const o = R[i.url] || await t(i.url);
771
+ return o && (o.name = r, R[i.url] = o), o ? Y({
768
772
  ...s,
769
773
  Vue: a,
770
- dsl: ne(o),
774
+ dsl: oe(o),
771
775
  mode: y.Runtime,
772
- loader: G(r)
776
+ loader: Q(n)
773
777
  }).renderer : null;
774
778
  });
775
779
  if (i.type === "Plugin") {
776
- let o = i.library ? E[i.library] : null;
777
- return o || (i.library && L.push(i.library), o = E[i.library || Symbol()] = a.defineAsyncComponent(
780
+ let o = i.library ? R[i.library] : null;
781
+ return o || (i.library && J.push(i.library), o = R[i.library || Symbol()] = a.defineAsyncComponent(
778
782
  async () => {
779
- const c = await Se(i, s.window);
783
+ const c = await Ee(i, s.window);
780
784
  return c || (console.warn("getPlugin result is null", i), null);
781
785
  }
782
786
  ), o);
783
787
  }
784
- return n;
788
+ return r;
785
789
  };
786
790
  }
787
- function es() {
788
- E = {};
791
+ function is() {
792
+ R = {};
789
793
  }
790
- function x(r, e, t = O, s = St) {
791
- if (!r || !r.name || r.invisible) return null;
792
- const n = t.getCurrentInstance()?.appContext, { id: i = null, directives: a = [] } = r, { vIf: o, vFor: c, vShow: u, vModels: p, vBind: d, vHtml: m, others: h } = jt(a);
793
- if (o && !bt(o, e))
794
+ function k(n, e, t = B, s = Rt, r = [], i = !1) {
795
+ if (!n || !n.name || n.invisible) return null;
796
+ const a = t.getCurrentInstance()?.appContext, { id: o = null, directives: c = [] } = n, { vIf: l, vElseIf: u, vElse: p, vFor: m, vShow: f, vModels: d, vBind: h, vHtml: _, others: v } = je(c);
797
+ if (!i && (u || p))
794
798
  return null;
795
- const f = (l) => {
796
- const w = l.$components, g = (() => {
797
- if (r.name === "component")
798
- return Et(l, r.props?.is);
799
- if (r.name === "slot") return r.name;
800
- const $ = s(r.name, r.from, t);
801
- return j($) ? et($) || tt($) ? $ : w[$] ?? n?.app?.component($) ?? $ : $;
802
- })(), S = Pt(i, r.props ?? {}, l), Ce = Rt(t, r.events ?? {}, l);
803
- if (r.name === "slot")
804
- return Ct(t, r, S, l, s);
805
- d && Object.assign(S, l.__parseExpression(d.value)), u && (S.style = Object.assign(
806
- S.style ?? {},
807
- Ft(u, l)
808
- )), m && Object.assign(S, At(m, l)), p.forEach(($) => {
809
- Object.assign(S, Mt(t, $, l));
799
+ if (l && !Ct(l, e))
800
+ return It(n, e, t, s, r);
801
+ const F = (S) => {
802
+ const Ae = S.$components, Ie = (() => {
803
+ if (n.name === "component")
804
+ return kt(S, n.props?.is);
805
+ if (n.name === "slot") return n.name;
806
+ const $ = s(n.name, n.from, t);
807
+ return j($) ? it($) || ot($) ? $ : Ae[$] ?? a?.app?.component($) ?? $ : $;
808
+ })(), P = Ft(o, n.props ?? {}, S), Me = At(t, n.events ?? {}, S);
809
+ if (n.name === "slot")
810
+ return Mt(t, n, P, S, s);
811
+ h && Object.assign(P, S.__parseExpression(h.value)), f && (P.style = Object.assign(
812
+ P.style ?? {},
813
+ Tt(f, S)
814
+ )), _ && Object.assign(P, Dt(_, S)), d.forEach(($) => {
815
+ Object.assign(P, xt(t, $, S));
810
816
  });
811
- const ke = It(
817
+ const He = Ot(
812
818
  t,
813
- r.children ?? [],
814
- l,
819
+ n.children ?? [],
820
+ S,
815
821
  s,
816
- r
822
+ n
817
823
  );
818
- let N = t.createVNode(g, { ...S, ...Ce }, ke);
819
- const te = n ? $t(n, h, l) : [];
820
- return te.length && (N = t.withDirectives(N, te)), N;
824
+ let U = t.createVNode(Ie, { ...P, ...Me }, He);
825
+ const ne = a ? bt(a, v, S) : [];
826
+ return ne.length && (U = t.withDirectives(U, ne)), U;
821
827
  };
822
- return c ? Dt(c, f, e) : f(e);
828
+ return m ? Ut(m, F, e) : F(e);
823
829
  }
824
- function $t(r, e, t) {
825
- const s = r.app;
826
- return e.map((n) => {
827
- const i = typeof n.name == "string" ? s.directive(n.name) : t.__parseExpression(n.name);
830
+ function bt(n, e, t) {
831
+ const s = n.app;
832
+ return e.map((r) => {
833
+ const i = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
828
834
  if (!i) return null;
829
835
  const a = [i];
830
- return n.value && a.push(t.__parseExpression(n.value)), n.arg && a.push(n.arg), n.modifiers && a.push(n.modifiers), a;
831
- }).filter((n) => !!n);
832
- }
833
- function jt(r = []) {
834
- const e = r.find((c) => b(c.name) === "vIf"), t = r.find((c) => b(c.name) === "vFor"), s = r.find((c) => b(c.name) === "vShow"), n = r.find((c) => b(c.name) === "vBind"), i = r.find((c) => b(c.name) === "vHtml"), a = r.filter(
835
- (c) => b(c.name) === "vModel"
836
- ), o = r.filter(
837
- (c) => !Le.includes(b(c.name))
836
+ return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
837
+ }).filter((r) => !!r);
838
+ }
839
+ function je(n = []) {
840
+ const e = n.find((u) => E(u.name) === "vIf"), t = n.find(
841
+ (u) => E(u.name) === "vElseIf"
842
+ ), s = n.find((u) => E(u.name) === "vElse"), r = n.find((u) => E(u.name) === "vFor"), i = n.find((u) => E(u.name) === "vShow"), a = n.find((u) => E(u.name) === "vBind"), o = n.find((u) => E(u.name) === "vHtml"), c = n.filter(
843
+ (u) => E(u.name) === "vModel"
844
+ ), l = n.filter(
845
+ (u) => !Ve.includes(E(u.name))
838
846
  );
839
847
  return {
840
848
  vIf: e,
841
- vFor: t,
842
- vShow: s,
843
- vModels: a,
844
- vBind: n,
845
- others: o,
846
- vHtml: i
849
+ vElseIf: t,
850
+ vElse: s,
851
+ vFor: r,
852
+ vShow: i,
853
+ vModels: c,
854
+ vBind: a,
855
+ others: l,
856
+ vHtml: o
847
857
  };
848
858
  }
849
- function bt(r, e) {
850
- return !!e.__parseExpression(r.value);
859
+ function Ct(n, e) {
860
+ return !!e.__parseExpression(n.value);
851
861
  }
852
- function Et(r, e) {
853
- return e ? _(e) ? r.__parseExpression(e) : e : "div";
862
+ function kt(n, e) {
863
+ return e ? w(e) ? n.__parseExpression(e) : e : "div";
854
864
  }
855
- function Pt(r, e, t) {
856
- const s = Y(e, t);
857
- return s.ref = t.__ref(r, s.ref), s;
865
+ function Ft(n, e, t) {
866
+ const s = X(e, t);
867
+ return s.ref = t.__ref(n, s.ref), s;
858
868
  }
859
- function Y(r, e) {
860
- return _(r) ? e.__parseExpression(r) : M(r) ? e.__parseFunction(r) : Array.isArray(r) ? r.map((t) => Y(t, e)) : typeof r == "object" ? Object.keys(r || {}).reduce(
869
+ function X(n, e) {
870
+ return w(n) ? e.__parseExpression(n) : T(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => X(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
861
871
  (t, s) => {
862
- let n = r[s];
863
- return t[s] = Y(n, e), t;
872
+ let r = n[s];
873
+ return t[s] = X(r, e), t;
864
874
  },
865
875
  {}
866
- ) : r;
876
+ ) : n;
867
877
  }
868
- function Rt(r, e, t) {
869
- const s = ["passive", "capture", "once"], n = {
878
+ function At(n, e, t) {
879
+ const s = ["passive", "capture", "once"], r = {
870
880
  capture: "Capture",
871
881
  once: "Once",
872
882
  passive: "OnceCapture"
873
883
  };
874
884
  return Object.keys(e || {}).reduce(
875
885
  (i, a) => {
876
- const o = e[a], c = $e(o.modifiers), u = c.find((m) => s.includes(m)), p = "on" + Oe(a) + (u && n[u] || ""), d = t.__parseFunction(o.handler);
877
- return d && (i[p] = r.withModifiers(d, c)), i;
886
+ const o = e[a], c = Pe(o.modifiers), l = c.find((m) => s.includes(m)), u = "on" + qe(a) + (l && r[l] || ""), p = t.__parseFunction(o.handler);
887
+ return p && (i[u] = n.withModifiers(p, c)), i;
878
888
  },
879
889
  {}
880
890
  );
881
891
  }
882
- function $e(r = {}, e = !1) {
883
- const t = Object.keys(r);
892
+ function It(n, e, t, s, r = []) {
893
+ let i = r.findIndex((a) => a.id === n.id);
894
+ for (let a = ++i; a < r.length; a++) {
895
+ const { directives: o = [] } = r[a], { vElseIf: c, vElse: l } = je(o);
896
+ if (console.log(o), c) {
897
+ if (e.__parseExpression(c.value))
898
+ return k(r[a], e, t, s, r, !0);
899
+ continue;
900
+ }
901
+ if (l)
902
+ return k(r[a], e, t, s, r, !0);
903
+ }
904
+ return null;
905
+ }
906
+ function Pe(n = {}, e = !1) {
907
+ const t = Object.keys(n);
884
908
  return e ? t.map((s) => "." + s) : t;
885
909
  }
886
- function Ct(r, e, t, s, n) {
887
- const { children: i } = e, a = kt(e, s), o = s.$slots?.[a.name];
888
- return o ? o(t) : i ? j(i) ? r.createTextVNode(i) : _(i) ? r.createTextVNode(
889
- ge(s.__parseExpression(i))
910
+ function Mt(n, e, t, s, r) {
911
+ const { children: i } = e, a = Ht(e, s), o = s.$slots?.[a.name];
912
+ return o ? o(t) : i ? j(i) ? n.createTextVNode(i) : w(i) ? n.createTextVNode(
913
+ ye(s.__parseExpression(i))
890
914
  ) : Array.isArray(i) ? i.map(
891
- (c) => x(c, s, r, n)
915
+ (c) => k(c, s, n, r, i)
892
916
  ) : null : null;
893
917
  }
894
- function kt(r, e) {
895
- const { props: t } = r, s = t?.name || "default";
918
+ function Ht(n, e) {
919
+ const { props: t } = n, s = t?.name || "default";
896
920
  return {
897
- name: _(s) ? e.__parseExpression(s) : s,
921
+ name: w(s) ? e.__parseExpression(s) : s,
898
922
  params: []
899
923
  };
900
924
  }
901
- function Ft(r, e) {
902
- return e.__parseExpression(r.value) ? {} : {
925
+ function Tt(n, e) {
926
+ return e.__parseExpression(n.value) ? {} : {
903
927
  display: "none"
904
928
  };
905
929
  }
906
- function At(r, e) {
930
+ function Dt(n, e) {
907
931
  return {
908
- innerHTML: e.__parseExpression(r.value) || ""
932
+ innerHTML: e.__parseExpression(n.value) || ""
909
933
  };
910
934
  }
911
- function Mt(r, e, t) {
935
+ function xt(n, e, t) {
912
936
  const s = {
913
937
  type: "JSFunction",
914
938
  value: e.value?.value ? `(v) => {
915
939
  ${e.value.value} = v;
916
940
  }` : "(v) => {}"
917
- }, n = t.__parseFunction(s), i = $e(
918
- _(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
919
- ), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
941
+ }, r = t.__parseFunction(s), i = Pe(
942
+ w(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
943
+ ), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
920
944
  return {
921
945
  [a]: t.__parseExpression(e.value),
922
- [`onUpdate:${a}`]: i.length && n ? r.withModifiers(n, i) : n
946
+ [`onUpdate:${a}`]: i.length && r ? n.withModifiers(r, i) : r
923
947
  };
924
948
  }
925
- function It(r, e, t, s, n) {
949
+ function Ot(n, e, t, s, r) {
926
950
  if (!e) return null;
927
951
  if (j(e))
928
952
  return { default: () => e };
929
- if (_(e))
953
+ if (w(e))
930
954
  return {
931
- default: () => ge(t.__parseExpression(e))
955
+ default: () => ye(t.__parseExpression(e))
932
956
  };
933
957
  if (Array.isArray(e) && e.length > 0) {
934
- const i = Ht(e), a = (o) => !o || !n ? {} : n?.id && Object.keys(o).length ? {
935
- [`scope_${n.id}`]: o
958
+ const i = Nt(e), a = (o) => !o || !r ? {} : r?.id && Object.keys(o).length ? {
959
+ [`scope_${r.id}`]: o
936
960
  } : {};
937
- return Object.entries(i).reduce((o, [c, { nodes: u, params: p }]) => (o[c] = (d) => {
938
- const m = p.length ? Ne(d ?? {}, p) : a(d);
939
- return u.map(
940
- (h) => x(h, t.__clone(m), r, s)
961
+ return Object.entries(i).reduce((o, [c, { nodes: l, params: u }]) => (o[c] = (p) => {
962
+ const m = u.length ? Je(p ?? {}, u) : a(p);
963
+ return l.map(
964
+ (f) => k(f, t.__clone(m), n, s, l)
941
965
  );
942
966
  }, o), {});
943
967
  }
944
968
  return null;
945
969
  }
946
- function Ht(r) {
970
+ function Nt(n) {
947
971
  const e = {
948
972
  default: {
949
973
  params: [],
950
974
  nodes: []
951
975
  }
952
976
  };
953
- for (const t of r) {
954
- const s = Tt(t.slot), n = s.name;
955
- e[n] ? (e[n].nodes.push(t), e[n].params = e[n].params.concat(s.params)) : e[n] = {
977
+ for (const t of n) {
978
+ const s = Bt(t.slot), r = s.name;
979
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
956
980
  nodes: [t],
957
981
  params: s.params
958
982
  };
959
983
  }
960
984
  return e;
961
985
  }
962
- function Tt(r = "default") {
963
- return j(r) ? { name: r, params: [] } : { params: [], ...r };
986
+ function Bt(n = "default") {
987
+ return j(n) ? { name: n, params: [] } : { params: [], ...n };
964
988
  }
965
- function Dt(r, e, t) {
966
- const { value: s, iterator: n } = r, { item: i = "item", index: a = "index" } = n || {};
989
+ function Ut(n, e, t) {
990
+ const { value: s, iterator: r } = n, { item: i = "item", index: a = "index" } = r || {};
967
991
  let o = t.__parseExpression(s) || [];
968
- return Number.isInteger(o) && (o = new Array(o).fill(!0).map((c, u) => u + 1)), Array.isArray(o) ? o.map((c, u) => e(t.__clone({ [i]: c, [a]: u }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
992
+ return Number.isInteger(o) && (o = new Array(o).fill(!0).map((c, l) => l + 1)), Array.isArray(o) ? o.map((c, l) => e(t.__clone({ [i]: c, [a]: l }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
969
993
  }
970
- const ce = he({
994
+ const ue = ve({
971
995
  name: "VtjPageContainer",
972
996
  async setup() {
973
- const r = be(), e = me(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null, i = V(Symbol());
997
+ const n = be(), e = ge(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, i = W(Symbol());
974
998
  if (s) {
975
999
  Object.assign(e.meta, s.meta || {}, { cache: s.cache });
976
- const { useTitle: a } = r?.adapter;
1000
+ const { useTitle: a } = n?.adapter;
977
1001
  a && a(s.title || "VTJ");
978
1002
  }
979
1003
  return {
980
- provider: r,
981
- component: n,
1004
+ provider: n,
1005
+ component: r,
982
1006
  file: s,
983
1007
  query: e.query,
984
1008
  meta: e.meta,
@@ -987,44 +1011,44 @@ const ce = he({
987
1011
  };
988
1012
  },
989
1013
  render() {
990
- const { component: r, query: e, sid: t } = this;
991
- return r ? K(r, { ...e, key: t }) : K("div", "页面不存在");
1014
+ const { component: n, query: e, sid: t } = this;
1015
+ return n ? V(n, { ...e, key: t }) : V("div", "页面不存在");
992
1016
  },
993
1017
  activated() {
994
1018
  this.meta.cache === !1 && (this.sid = Symbol());
995
1019
  }
996
- }), xt = he({
1020
+ }), Lt = ve({
997
1021
  name: "VtjStartupContainer",
998
1022
  render() {
999
- return K("div", "page not found!");
1023
+ return V("div", "page not found!");
1000
1024
  }
1001
- }), je = Symbol("Provider");
1002
- var Ot = /* @__PURE__ */ ((r) => (r.Production = "production", r.Development = "development", r))(Ot || {});
1003
- class Nt extends Fe {
1025
+ }), Re = Symbol("Provider");
1026
+ var qt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(qt || {});
1027
+ class Jt extends Te {
1004
1028
  constructor(e) {
1005
1029
  super(), this.options = e;
1006
1030
  const {
1007
1031
  service: t,
1008
1032
  mode: s = y.Raw,
1009
- dependencies: n,
1033
+ dependencies: r,
1010
1034
  materials: i,
1011
1035
  project: a = {},
1012
1036
  adapter: o = {},
1013
1037
  globals: c = {},
1014
- modules: u = {},
1015
- router: p = null,
1016
- materialPath: d = "./",
1038
+ modules: l = {},
1039
+ router: u = null,
1040
+ materialPath: p = "./",
1017
1041
  nodeEnv: m = "development"
1018
1042
  /* Development */
1019
1043
  } = e;
1020
- this.mode = s, this.modules = u, this.service = t, this.router = p, this.materialPath = d, this.nodeEnv = m, n && (this.dependencies = n), i && (this.materials = i), Object.assign(this.globals, c), Object.assign(this.adapter, o);
1021
- const { access: h, request: f } = this.adapter;
1022
- h && h.connect({ mode: s, router: p, request: f }), a && s !== y.Design ? this.load(a) : this.project = a;
1044
+ this.mode = s, this.modules = l, this.service = t, this.router = u, this.materialPath = p, this.nodeEnv = m, r && (this.dependencies = r), i && (this.materials = i), Object.assign(this.globals, c), Object.assign(this.adapter, o);
1045
+ const { access: f, request: d } = this.adapter;
1046
+ f && f.connect({ mode: s, router: u, request: d }), a && s !== y.Design ? this.load(a) : this.project = a;
1023
1047
  }
1024
1048
  mode;
1025
1049
  globals = {};
1026
1050
  modules = {};
1027
- adapter = { request: J, jsonp: de };
1051
+ adapter = { request: z, jsonp: he };
1028
1052
  apis = {};
1029
1053
  dependencies = {};
1030
1054
  materials = {};
@@ -1043,104 +1067,104 @@ class Nt extends Fe {
1043
1067
  try {
1044
1068
  s = await e.apply(e, t);
1045
1069
  } catch (i) {
1046
- R.warn("模拟数据模版异常", i);
1070
+ C.warn("模拟数据模版异常", i);
1047
1071
  }
1048
- return F()?.mock(s);
1072
+ return M()?.mock(s);
1049
1073
  };
1050
1074
  }
1051
1075
  async load(e) {
1052
1076
  const t = this.modules[`.vtj/projects/${e.id}.json`] || this.modules[`/src/.vtj/projects/${e.id}.json`];
1053
1077
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1054
1078
  throw new Error("project is null");
1055
- const { apis: s = [], meta: n = [] } = this.project, i = window;
1056
- i && (i.CKEDITOR_VERSION = void 0), this.mode === y.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = at(s, n, this.adapter), we(i), ct(s, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1079
+ const { apis: s = [], meta: r = [] } = this.project, i = window;
1080
+ i && (i.CKEDITOR_VERSION = void 0), this.mode === y.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = ft(s, r, this.adapter), $e(i), dt(s, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1057
1081
  }
1058
1082
  initMock(e) {
1059
- const t = F(e);
1083
+ const t = M(e);
1060
1084
  t && t.setup({
1061
1085
  timeout: "50-500"
1062
1086
  });
1063
1087
  }
1064
1088
  async loadDependencies(e) {
1065
1089
  const t = Object.entries(this.dependencies);
1066
- for (const [s, n] of t)
1067
- e[s] || (e[s] = this.library[s] = await n());
1090
+ for (const [s, r] of t)
1091
+ e[s] || (e[s] = this.library[s] = await r());
1068
1092
  }
1069
1093
  async loadAssets(e) {
1070
- const { dependencies: t = [] } = this.project, { dependencies: s, library: n, components: i, materialPath: a, nodeEnv: o } = this, {
1094
+ const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: i, materialPath: a, nodeEnv: o } = this, {
1071
1095
  libraryExports: c,
1072
- libraryMap: u,
1073
- materials: p,
1074
- materialExports: d,
1096
+ libraryMap: l,
1097
+ materials: u,
1098
+ materialExports: p,
1075
1099
  materialMapLibrary: m
1076
- } = We(
1100
+ } = Ze(
1077
1101
  t,
1078
1102
  a,
1079
1103
  o === "development"
1080
1104
  /* Development */
1081
1105
  );
1082
- for (const h of c) {
1083
- const f = s[h], l = e[h];
1084
- if (l)
1085
- n[h] = l;
1086
- else if (f)
1087
- e[h] = n[h] = await f();
1106
+ for (const f of c) {
1107
+ const d = s[f], h = e[f];
1108
+ if (h)
1109
+ r[f] = h;
1110
+ else if (d)
1111
+ e[f] = r[f] = await d();
1088
1112
  else {
1089
- const w = u[h] || [];
1090
- for (const g of w)
1091
- X(g) && await Ye(h, P.append(g, { v: C })), Z(g) && await ie(P.append(g, { v: C }));
1092
- n[h] = e[h];
1113
+ const _ = l[f] || [];
1114
+ for (const v of _)
1115
+ ee(v) && await tt(f, b.append(v, { v: A })), te(v) && await ae(b.append(v, { v: A }));
1116
+ r[f] = e[f];
1093
1117
  }
1094
1118
  }
1095
1119
  if (o === "development") {
1096
- for (const f of p)
1097
- await ie(P.append(f, { v: C }));
1098
- const h = this.materials || {};
1099
- for (const f of d) {
1100
- const l = e[m[f]], w = Ae[f];
1101
- if (w)
1102
- l && w.forEach((g) => {
1103
- i[g] = l[g];
1120
+ for (const d of u)
1121
+ await ae(b.append(d, { v: A }));
1122
+ const f = this.materials || {};
1123
+ for (const d of p) {
1124
+ const h = e[m[d]], _ = De[d];
1125
+ if (_)
1126
+ h && _.forEach((v) => {
1127
+ i[v] = h[v];
1104
1128
  });
1105
1129
  else {
1106
- const g = h[f] ? (await h[f]()).default : e[f];
1107
- g && l && (g.components || []).forEach((S) => {
1108
- i[S.name] = Ge(S, l);
1130
+ const v = f[d] ? (await f[d]()).default : e[d];
1131
+ v && h && (v.components || []).forEach((F) => {
1132
+ i[F.name] = et(F, h);
1109
1133
  });
1110
1134
  }
1111
1135
  }
1112
1136
  }
1113
1137
  }
1114
1138
  initRouter() {
1115
- const { router: e, project: t, options: s, adapter: n } = this;
1139
+ const { router: e, project: t, options: s, adapter: r } = this;
1116
1140
  if (!e) return;
1117
1141
  const i = t?.platform === "uniapp" ? "pages" : "page", {
1118
1142
  routeAppendTo: a,
1119
1143
  pageRouteName: o = i,
1120
1144
  routeMeta: c
1121
- } = s, u = a ? "" : "/", p = {
1122
- path: `${u}${o}/:id`,
1123
- name: k,
1124
- component: ce
1125
- }, d = {
1126
- path: u,
1127
- name: T,
1128
- component: t?.homepage ? ce : n.startupComponent || xt,
1145
+ } = s, l = a ? "" : "/", u = {
1146
+ path: `${l}${o}/:id`,
1147
+ name: I,
1148
+ component: ue
1149
+ }, p = {
1150
+ path: l,
1151
+ name: O,
1152
+ component: t?.homepage ? ue : r.startupComponent || Lt,
1129
1153
  meta: c
1130
1154
  };
1131
- e.hasRoute(k) && e.removeRoute(k), e.hasRoute(T) && e.removeRoute(T), a ? (e.addRoute(a, p), e.addRoute(a, d)) : (e.addRoute(p), e.addRoute(d));
1155
+ e.hasRoute(I) && e.removeRoute(I), e.hasRoute(O) && e.removeRoute(O), a ? (e.addRoute(a, u), e.addRoute(a, p)) : (e.addRoute(u), e.addRoute(p));
1132
1156
  }
1133
1157
  install(e) {
1134
1158
  const t = e.config.globalProperties.installed || {};
1135
- for (const [s, n] of Object.entries(this.library))
1136
- !t[s] && Ze(n) && (e.use(n), t[s] = !0);
1137
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(je, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (s, n, i) => {
1138
- const a = n?.$options.name, o = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${o} ${i}`;
1159
+ for (const [s, r] of Object.entries(this.library))
1160
+ !t[s] && rt(r) && (e.use(r), t[s] = !0);
1161
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Re, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (s, r, i) => {
1162
+ const a = r?.$options.name, o = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${o} ${i}`;
1139
1163
  console.error(
1140
1164
  "[VTJ Error]:",
1141
1165
  {
1142
1166
  err: s,
1143
- instance: n,
1167
+ instance: r,
1144
1168
  info: i
1145
1169
  },
1146
1170
  s?.stack
@@ -1152,12 +1176,12 @@ class Nt extends Fe {
1152
1176
  return this.getPage(e) || t.find((s) => s.id === e) || null;
1153
1177
  }
1154
1178
  getPage(e) {
1155
- const { pages: t = [] } = this.project || {}, s = (n, i = []) => {
1179
+ const { pages: t = [] } = this.project || {}, s = (r, i = []) => {
1156
1180
  for (const a of i) {
1157
- if (a.id === n)
1181
+ if (a.id === r)
1158
1182
  return a;
1159
1183
  if (a.children && a.children.length) {
1160
- const o = s(n, a.children);
1184
+ const o = s(r, a.children);
1161
1185
  if (o)
1162
1186
  return o;
1163
1187
  }
@@ -1185,20 +1209,20 @@ class Nt extends Fe {
1185
1209
  }).then((s) => s.data).catch(() => null) : null);
1186
1210
  }
1187
1211
  createDslRenderer(e, t = {}) {
1188
- const { library: s, components: n, mode: i, apis: a } = this, o = {
1212
+ const { library: s, components: r, mode: i, apis: a } = this, o = {
1189
1213
  mode: i,
1190
1214
  Vue: s.Vue,
1191
- components: n,
1215
+ components: r,
1192
1216
  libs: s,
1193
1217
  apis: a,
1194
1218
  window,
1195
1219
  ...t
1196
- }, c = G({
1197
- getDsl: async (u) => await this.getDsl(u) || null,
1198
- getDslByUrl: async (u) => await this.getDslByUrl(u) || null,
1220
+ }, c = Q({
1221
+ getDsl: async (l) => await this.getDsl(l) || null,
1222
+ getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
1199
1223
  options: o
1200
1224
  });
1201
- return W({
1225
+ return Y({
1202
1226
  ...o,
1203
1227
  dsl: e,
1204
1228
  loader: c
@@ -1207,41 +1231,41 @@ class Nt extends Fe {
1207
1231
  async getRenderComponent(e, t) {
1208
1232
  const s = this.getFile(e);
1209
1233
  if (!s)
1210
- return R.warn(`Can not find file: ${e}`), null;
1234
+ return C.warn(`Can not find file: ${e}`), null;
1211
1235
  t && t(s);
1212
- const n = `.vtj/vue/${e}.vue`, i = this.modules[n] || this.modules[`/src/pages/${e}.vue`];
1236
+ const r = `.vtj/vue/${e}.vue`, i = this.modules[r] || this.modules[`/src/pages/${e}.vue`];
1213
1237
  if (i)
1214
1238
  return (await i())?.default;
1215
1239
  const a = await this.getDsl(s.id);
1216
- return a ? this.createDslRenderer(a).renderer : (R.warn(`Can not find dsl: ${e}`), null);
1240
+ return a ? this.createDslRenderer(a).renderer : (C.warn(`Can not find dsl: ${e}`), null);
1217
1241
  }
1218
1242
  defineUrlSchemaComponent(e, t) {
1219
- return oe(async () => {
1243
+ return ce(async () => {
1220
1244
  const s = await this.getDslByUrl(e);
1221
1245
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1222
1246
  });
1223
1247
  }
1224
1248
  definePluginComponent(e) {
1225
- return oe(async () => await Se(e, window));
1249
+ return ce(async () => await Ee(e, window));
1226
1250
  }
1227
1251
  }
1228
- function ts(r) {
1229
- const e = new Nt(r);
1252
+ function os(n) {
1253
+ const e = new Jt(n);
1230
1254
  return {
1231
1255
  provider: e,
1232
1256
  onReady: (s) => e.ready(s)
1233
1257
  };
1234
1258
  }
1235
- function be(r = {}) {
1236
- const e = fe(je, null);
1259
+ function be(n = {}) {
1260
+ const e = me(Re, null);
1237
1261
  if (!e)
1238
1262
  throw new Error("Can not find provider");
1239
1263
  if (e.nodeEnv === "development") {
1240
- const { id: t, version: s } = r;
1264
+ const { id: t, version: s } = n;
1241
1265
  t && s && (async () => {
1242
- const n = await e.getDsl(t);
1243
- n?.__VERSION__ !== s && e.adapter.notify && e.adapter.notify(
1244
- `[ ${n?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,
1266
+ const r = await e.getDsl(t);
1267
+ r?.__VERSION__ !== s && e.adapter.notify && e.adapter.notify(
1268
+ `[ ${r?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,
1245
1269
  "版本不一致",
1246
1270
  "warning"
1247
1271
  );
@@ -1249,23 +1273,23 @@ function be(r = {}) {
1249
1273
  }
1250
1274
  return e;
1251
1275
  }
1252
- const Ee = {
1276
+ const Ce = {
1253
1277
  type: "json",
1254
1278
  validSuccess: !0,
1255
1279
  originResponse: !1,
1256
1280
  failMessage: !0,
1257
- validate: (r) => r.data?.code === 0
1258
- }, Bt = (r, e = "/__vtj__/api/:type.json") => (t, s, n) => r.send({
1281
+ validate: (n) => n.data?.code === 0
1282
+ }, Kt = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
1259
1283
  url: e,
1260
1284
  method: "post",
1261
1285
  params: { type: t },
1262
- query: n,
1286
+ query: r,
1263
1287
  data: {
1264
1288
  type: t,
1265
1289
  data: s
1266
1290
  },
1267
- settings: Ee
1268
- }), Ut = (r, e = "/__vtj__/api/uploader.json") => async (t, s) => await r.send({
1291
+ settings: Ce
1292
+ }), zt = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
1269
1293
  url: e,
1270
1294
  method: "post",
1271
1295
  data: {
@@ -1273,12 +1297,12 @@ const Ee = {
1273
1297
  projectId: s
1274
1298
  },
1275
1299
  settings: {
1276
- ...Ee,
1300
+ ...Ce,
1277
1301
  type: "data"
1278
1302
  }
1279
- }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1280
- function ss(r) {
1281
- return pe({
1303
+ }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1304
+ function as(n) {
1305
+ return de({
1282
1306
  settings: {
1283
1307
  type: "json",
1284
1308
  validSuccess: !0,
@@ -1286,14 +1310,14 @@ function ss(r) {
1286
1310
  failMessage: !0,
1287
1311
  validate: (e) => e.data?.code === 0,
1288
1312
  showError: (e) => {
1289
- r && r(e || "未知错误");
1313
+ n && n(e || "未知错误");
1290
1314
  }
1291
1315
  }
1292
1316
  });
1293
1317
  }
1294
- class ee {
1295
- constructor(e = J) {
1296
- this.req = e, this.api = Bt(e), this.uploader = Ut(e);
1318
+ class se {
1319
+ constructor(e = z) {
1320
+ this.req = e, this.api = Kt(e), this.uploader = zt(e);
1297
1321
  }
1298
1322
  api;
1299
1323
  pluginCaches = {};
@@ -1377,10 +1401,10 @@ class ee {
1377
1401
  return await this.api("clearStaticFiles", e).catch(() => "");
1378
1402
  }
1379
1403
  async getPluginMaterial(e) {
1380
- const { urls: t = [] } = e, s = t.filter((i) => Ve(i))[0];
1404
+ const { urls: t = [] } = e, s = t.filter((i) => Qe(i))[0];
1381
1405
  if (!s) return null;
1382
- const n = this.pluginCaches[s];
1383
- return n || (this.pluginCaches[s] = J.send({
1406
+ const r = this.pluginCaches[s];
1407
+ return r || (this.pluginCaches[s] = z.send({
1384
1408
  url: s,
1385
1409
  method: "get",
1386
1410
  settings: {
@@ -1393,77 +1417,77 @@ class ee {
1393
1417
  return console.log("BaseService.genSource", e), "";
1394
1418
  }
1395
1419
  }
1396
- const v = new Be({
1420
+ const g = new Ke({
1397
1421
  type: "local",
1398
1422
  expired: 0,
1399
1423
  prefix: "__VTJ_"
1400
1424
  });
1401
- class rs extends ee {
1425
+ class cs extends se {
1402
1426
  init(e) {
1403
- const t = new D(e), s = v.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
1404
- return v.save(`project_${t.id}`, n), Promise.resolve(n);
1427
+ const t = new N(e), s = g.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1428
+ return g.save(`project_${t.id}`, r), Promise.resolve(r);
1405
1429
  }
1406
1430
  saveProject(e) {
1407
- const t = new D(e);
1408
- return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1431
+ const t = new N(e);
1432
+ return g.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1409
1433
  }
1410
1434
  saveMaterials(e, t) {
1411
- return v.save(`materials_${e.id}`, Q(t)), Promise.resolve(!0);
1435
+ return g.save(`materials_${e.id}`, Z(t)), Promise.resolve(!0);
1412
1436
  }
1413
1437
  saveFile(e) {
1414
- return v.save(`file_${e.id}`, e), Promise.resolve(!0);
1438
+ return g.save(`file_${e.id}`, e), Promise.resolve(!0);
1415
1439
  }
1416
1440
  getFile(e) {
1417
- const t = v.get(`file_${e}`);
1441
+ const t = g.get(`file_${e}`);
1418
1442
  return t ? Promise.resolve(t) : Promise.reject(null);
1419
1443
  }
1420
1444
  removeFile(e) {
1421
- return v.remove(`file_${e}`), Promise.resolve(!0);
1445
+ return g.remove(`file_${e}`), Promise.resolve(!0);
1422
1446
  }
1423
1447
  saveHistory(e) {
1424
- return v.save(`history_${e.id}`, e), Promise.resolve(!0);
1448
+ return g.save(`history_${e.id}`, e), Promise.resolve(!0);
1425
1449
  }
1426
1450
  removeHistory(e) {
1427
- const t = v.get(`history_${e}`);
1451
+ const t = g.get(`history_${e}`);
1428
1452
  if (t) {
1429
- const n = (t.items || []).map((i) => i.id);
1430
- this.removeHistoryItem(e, n), v.remove(`history_${e}`);
1453
+ const r = (t.items || []).map((i) => i.id);
1454
+ this.removeHistoryItem(e, r), g.remove(`history_${e}`);
1431
1455
  }
1432
1456
  return Promise.resolve(!0);
1433
1457
  }
1434
1458
  getHistory(e) {
1435
- const t = v.get(`history_${e}`), s = new ue(t || { id: e });
1459
+ const t = g.get(`history_${e}`), s = new pe(t || { id: e });
1436
1460
  return Promise.resolve(s.toDsl());
1437
1461
  }
1438
1462
  getHistoryItem(e, t) {
1439
- const s = v.get(`history_${e}_${t}`);
1463
+ const s = g.get(`history_${e}_${t}`);
1440
1464
  return Promise.resolve(s);
1441
1465
  }
1442
1466
  saveHistoryItem(e, t) {
1443
- return v.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1467
+ return g.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1444
1468
  }
1445
1469
  removeHistoryItem(e, t) {
1446
1470
  return t.forEach((s) => {
1447
- v.remove(`history_${e}_${s}`);
1471
+ g.remove(`history_${e}_${s}`);
1448
1472
  }), Promise.resolve(!0);
1449
1473
  }
1450
1474
  }
1451
- class Lt extends ee {
1475
+ class Vt extends se {
1452
1476
  projects = {};
1453
1477
  materials = {};
1454
1478
  files = {};
1455
1479
  histories = {};
1456
1480
  historyItems = {};
1457
1481
  init(e) {
1458
- const t = new D(e), s = this.projects[t.id] || {}, n = Object.assign(t.toDsl(), s);
1459
- return this.projects[n.id] = n, Promise.resolve(n);
1482
+ const t = new N(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1483
+ return this.projects[r.id] = r, Promise.resolve(r);
1460
1484
  }
1461
1485
  saveProject(e) {
1462
- const t = new D(e);
1486
+ const t = new N(e);
1463
1487
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1464
1488
  }
1465
1489
  saveMaterials(e, t) {
1466
- return e.id && (this.materials[e.id] = Q(t)), Promise.resolve(!0);
1490
+ return e.id && (this.materials[e.id] = Z(t)), Promise.resolve(!0);
1467
1491
  }
1468
1492
  saveFile(e) {
1469
1493
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1481,18 +1505,18 @@ class Lt extends ee {
1481
1505
  removeHistory(e) {
1482
1506
  const t = this.histories[e];
1483
1507
  if (t) {
1484
- const n = (t.items || []).map((i) => i.id);
1485
- this.removeHistoryItem(e, n), delete this.historyItems[e];
1508
+ const r = (t.items || []).map((i) => i.id);
1509
+ this.removeHistoryItem(e, r), delete this.historyItems[e];
1486
1510
  }
1487
1511
  return Promise.resolve(!0);
1488
1512
  }
1489
1513
  getHistory(e) {
1490
- const t = this.histories[e], s = new ue(t || { id: e });
1514
+ const t = this.histories[e], s = new pe(t || { id: e });
1491
1515
  return Promise.resolve(s);
1492
1516
  }
1493
1517
  getHistoryItem(e, t) {
1494
- const s = `${e}_${t}`, n = this.historyItems[s] || {};
1495
- return Promise.resolve(n);
1518
+ const s = `${e}_${t}`, r = this.historyItems[s] || {};
1519
+ return Promise.resolve(r);
1496
1520
  }
1497
1521
  saveHistoryItem(e, t) {
1498
1522
  const s = `${e}_${t.id}`;
@@ -1500,16 +1524,16 @@ class Lt extends ee {
1500
1524
  }
1501
1525
  removeHistoryItem(e, t) {
1502
1526
  return t.forEach((s) => {
1503
- const n = `${e}_${s}`;
1504
- delete this.historyItems[n];
1527
+ const r = `${e}_${s}`;
1528
+ delete this.historyItems[r];
1505
1529
  }), Promise.resolve(!0);
1506
1530
  }
1507
1531
  }
1508
- let H = null;
1509
- function ns() {
1510
- return H || (H = new Lt(), H);
1532
+ let x = null;
1533
+ function ls() {
1534
+ return x || (x = new Vt(), x);
1511
1535
  }
1512
- class is extends ee {
1536
+ class us extends se {
1513
1537
  getFileCaches = {};
1514
1538
  async getExtension() {
1515
1539
  return await this.api("getExtension", {}).catch(() => {
@@ -1526,7 +1550,7 @@ class is extends ee {
1526
1550
  async saveMaterials(e, t) {
1527
1551
  return !!await this.api("saveMaterials", {
1528
1552
  project: e,
1529
- materials: Q(t)
1553
+ materials: Z(t)
1530
1554
  }).catch(() => !1);
1531
1555
  }
1532
1556
  async saveFile(e) {
@@ -1566,128 +1590,128 @@ class is extends ee {
1566
1590
  );
1567
1591
  }
1568
1592
  }
1569
- function Pe(r, e, t = []) {
1593
+ function ke(n, e, t = []) {
1570
1594
  return t.map((s) => {
1571
- const { id: n, title: i, icon: a, children: o, hidden: c } = s;
1595
+ const { id: r, title: i, icon: a, children: o, hidden: c } = s;
1572
1596
  return {
1573
- id: n,
1597
+ id: r,
1574
1598
  title: i,
1575
1599
  icon: a,
1576
1600
  hidden: c,
1577
- url: `${r}/${e}/${n}`,
1578
- children: o && o.length ? Pe(r, e, o) : void 0
1601
+ url: `${n}/${e}/${r}`,
1602
+ children: o && o.length ? ke(n, e, o) : void 0
1579
1603
  };
1580
1604
  });
1581
1605
  }
1582
- function Re(r, e) {
1583
- if (!e) return r;
1606
+ function Fe(n, e) {
1607
+ if (!e) return n;
1584
1608
  let t = [];
1585
- for (const s of r)
1609
+ for (const s of n)
1586
1610
  if (s.children && s.children.length) {
1587
- const n = Re(s.children, e);
1588
- n.length && (s.children = n, t.push(s));
1611
+ const r = Fe(s.children, e);
1612
+ r.length && (s.children = r, t.push(s));
1589
1613
  } else
1590
1614
  e.can(s.id.toString()) && t.push(s);
1591
1615
  return t;
1592
1616
  }
1593
- function os(r) {
1617
+ function ps(n) {
1594
1618
  const {
1595
1619
  menuPathPrefix: e = "",
1596
1620
  pageRouteName: t = "page",
1597
1621
  disableMenusFilter: s = !1
1598
- } = r || {}, n = be(), i = me(), a = nt(), o = V(!1), c = V(!1), u = n.project;
1599
- Ue(() => {
1600
- const { name: m, params: h, meta: f } = i;
1601
- if (m === k) {
1602
- const l = n.getPage(h.id);
1603
- o.value = !l?.mask, c.value = !!l?.pure;
1604
- } else if (m === T) {
1605
- const l = n.getHomepage();
1606
- o.value = !l?.mask, c.value = !!l?.pure;
1622
+ } = n || {}, r = be(), i = ge(), a = lt(), o = W(!1), c = W(!1), l = r.project;
1623
+ ze(() => {
1624
+ const { name: m, params: f, meta: d } = i;
1625
+ if (m === I) {
1626
+ const h = r.getPage(f.id);
1627
+ o.value = !h?.mask, c.value = !!h?.pure;
1628
+ } else if (m === O) {
1629
+ const h = r.getHomepage();
1630
+ o.value = !h?.mask, c.value = !!h?.pure;
1607
1631
  } else
1608
- o.value = !f.mask, c.value = !!f.pure;
1632
+ o.value = !d.mask, c.value = !!d.pure;
1609
1633
  });
1610
- const p = Pe(
1634
+ const u = ke(
1611
1635
  e,
1612
1636
  t,
1613
- u?.pages
1614
- ), d = u?.config;
1637
+ l?.pages
1638
+ ), p = l?.config;
1615
1639
  return {
1616
1640
  disabled: o,
1617
- logo: d?.logo,
1618
- themeSwitchable: d?.themeSwitchable,
1619
- title: d?.title || u?.description || u?.name || "VTJ App",
1620
- menus: s ? p : Re(p, a),
1641
+ logo: p?.logo,
1642
+ themeSwitchable: p?.themeSwitchable,
1643
+ title: p?.title || l?.description || l?.name || "VTJ App",
1644
+ menus: s ? u : Fe(u, a),
1621
1645
  pure: c
1622
1646
  };
1623
1647
  }
1624
1648
  export {
1625
- ye as ACCESS_KEY,
1626
- _e as Access,
1627
- Ke as BUILD_IN_TAGS,
1628
- Le as BUILT_IN_DIRECTIVES,
1629
- ee as BaseService,
1630
- ae as CONTEXT_HOST,
1631
- pt as Context,
1649
+ we as ACCESS_KEY,
1650
+ Se as Access,
1651
+ Ye as BUILD_IN_TAGS,
1652
+ Ve as BUILT_IN_DIRECTIVES,
1653
+ se as BaseService,
1654
+ le as CONTEXT_HOST,
1655
+ vt as Context,
1632
1656
  y as ContextMode,
1633
- qe as DATA_TYPES,
1634
- T as HOMEPAGE_ROUTE_NAME,
1635
- Je as HTML_TAGS,
1636
- Qt as JSCodeToString,
1637
- zt as LIFE_CYCLES_LIST,
1638
- is as LocalService,
1639
- Lt as MemoryService,
1640
- Ot as NodeEnv,
1641
- k as PAGE_ROUTE_NAME,
1642
- Nt as Provider,
1643
- rs as StorageService,
1644
- C as VTJ_RENDERER_VERSION,
1645
- ve as adoptedStyleSheets,
1646
- es as clearLoaderCache,
1647
- Zt as createAccess,
1648
- Xt as createAdapter,
1649
- Wt as createAssetScripts,
1650
- Gt as createAssetsCss,
1651
- yt as createDataSources,
1652
- G as createLoader,
1653
- ns as createMemoryService,
1654
- ot as createMetaApi,
1655
- ut as createMock,
1656
- ts as createProvider,
1657
- W as createRenderer,
1658
- it as createSchemaApi,
1659
- at as createSchemaApis,
1660
- ss as createServiceRequest,
1661
- St as defaultLoader,
1662
- I as fillBasePath,
1663
- F as getMock,
1664
- $e as getModifiers,
1665
- Se as getPlugin,
1666
- Ge as getRawComponent,
1667
- et as isBuiltInTag,
1668
- X as isCSSUrl,
1669
- st as isJSCode,
1670
- _ as isJSExpression,
1671
- M as isJSFunction,
1672
- Ve as isJSON,
1673
- Z as isJSUrl,
1674
- tt as isNativeTag,
1675
- Ze as isVuePlugin,
1676
- Ye as loadCss,
1677
- Qe as loadCssUrl,
1678
- Xe as loadScriptUrl,
1679
- lt as mockApi,
1680
- ct as mockApis,
1681
- we as mockCleanup,
1682
- x as nodeRender,
1683
- We as parseDeps,
1684
- A as parseExpression,
1685
- z as parseFunction,
1686
- je as providerKey,
1687
- ze as removeProdFlag,
1688
- Yt as setupPageSetting,
1689
- ge as toString,
1690
- nt as useAccess,
1691
- os as useMask,
1657
+ We as DATA_TYPES,
1658
+ O as HOMEPAGE_ROUTE_NAME,
1659
+ Ge as HTML_TAGS,
1660
+ ss as JSCodeToString,
1661
+ Xt as LIFE_CYCLES_LIST,
1662
+ us as LocalService,
1663
+ Vt as MemoryService,
1664
+ qt as NodeEnv,
1665
+ I as PAGE_ROUTE_NAME,
1666
+ Jt as Provider,
1667
+ cs as StorageService,
1668
+ A as VTJ_RENDERER_VERSION,
1669
+ _e as adoptedStyleSheets,
1670
+ is as clearLoaderCache,
1671
+ rs as createAccess,
1672
+ ns as createAdapter,
1673
+ Zt as createAssetScripts,
1674
+ es as createAssetsCss,
1675
+ Et as createDataSources,
1676
+ Q as createLoader,
1677
+ ls as createMemoryService,
1678
+ pt as createMetaApi,
1679
+ ht as createMock,
1680
+ os as createProvider,
1681
+ Y as createRenderer,
1682
+ ut as createSchemaApi,
1683
+ ft as createSchemaApis,
1684
+ as as createServiceRequest,
1685
+ Rt as defaultLoader,
1686
+ D as fillBasePath,
1687
+ M as getMock,
1688
+ Pe as getModifiers,
1689
+ Ee as getPlugin,
1690
+ et as getRawComponent,
1691
+ it as isBuiltInTag,
1692
+ ee as isCSSUrl,
1693
+ at as isJSCode,
1694
+ w as isJSExpression,
1695
+ T as isJSFunction,
1696
+ Qe as isJSON,
1697
+ te as isJSUrl,
1698
+ ot as isNativeTag,
1699
+ rt as isVuePlugin,
1700
+ tt as loadCss,
1701
+ st as loadCssUrl,
1702
+ nt as loadScriptUrl,
1703
+ mt as mockApi,
1704
+ dt as mockApis,
1705
+ $e as mockCleanup,
1706
+ k as nodeRender,
1707
+ Ze as parseDeps,
1708
+ H as parseExpression,
1709
+ G as parseFunction,
1710
+ Re as providerKey,
1711
+ Xe as removeProdFlag,
1712
+ ts as setupPageSetting,
1713
+ ye as toString,
1714
+ lt as useAccess,
1715
+ ps as useMask,
1692
1716
  be as useProvider
1693
1717
  };