epic-designer-gold 0.0.13 → 0.0.14

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.
Files changed (82) hide show
  1. package/dist/{attributeView-CqQCeL9p.js → attributeView-BN2nA4jI.js} +2 -2
  2. package/dist/attributeView-lpFl3t4a.cjs +1 -0
  3. package/dist/axios-CYGTE3lR.cjs +6 -0
  4. package/dist/axios-ITY6Uw7A.js +2085 -0
  5. package/dist/core/components/builder/src/builder.vue.d.ts +2 -0
  6. package/dist/core/components/node/src/node.vue.d.ts +2 -0
  7. package/dist/core/components/tree/src/tree.vue.d.ts +1 -1
  8. package/dist/{eventView-C_THyz3W.js → eventView-BKpQ9YIh.js} +2 -2
  9. package/dist/eventView-DgqXxWY1.cjs +1 -0
  10. package/dist/index-1afOcXnV.cjs +1 -0
  11. package/dist/{index-M-hTLR0c.js → index-ASoFJnMl.js} +1 -1
  12. package/dist/index-B03W7FZR.cjs +1 -0
  13. package/dist/index-BHmIF8aI.cjs +10 -0
  14. package/dist/index-BJlPL6eL.cjs +1 -0
  15. package/dist/index-BXNPTGKl.cjs +1 -0
  16. package/dist/{index-BC_6e5pJ.js → index-BlJ0TQyn.js} +1 -1
  17. package/dist/index-By5rfqCj.cjs +1 -0
  18. package/dist/{index-DtXxkuvD.js → index-BzsFImwK.js} +2 -2
  19. package/dist/{index-Ba0ZjQgI.js → index-C-XUgjda.js} +1 -1
  20. package/dist/{index-HM72iSCq.js → index-C4sdhgF2.js} +1 -1
  21. package/dist/index-C6ceZM1C.cjs +1 -0
  22. package/dist/{index-Dm_60RQ9.js → index-CCTMCqiz.js} +3 -4
  23. package/dist/index-CGHtM1lr.cjs +1 -0
  24. package/dist/{index-S4XwR1vD.js → index-CL_7RzF7.js} +39 -40
  25. package/dist/index-CNzcV-bQ.cjs +1 -0
  26. package/dist/{index-sZ9OfgE1.cjs → index-CdgT4gQu.cjs} +1 -1
  27. package/dist/index-CkRhCvJK.cjs +1 -0
  28. package/dist/index-D8YBJFH6.cjs +1 -0
  29. package/dist/{index-DBj3eppg.js → index-DPfAejnH.js} +2 -2
  30. package/dist/{index-GtUWspi3.js → index-DZYSBPVO.js} +2 -2
  31. package/dist/index-DpzLP1Zp.cjs +1 -0
  32. package/dist/{index-BqPDmqv7.js → index-Mf82MCCF.js} +2 -2
  33. package/dist/index-Ol-YPkY9.js +1550 -0
  34. package/dist/index-YHlIFgpT.cjs +1 -0
  35. package/dist/{index-DAWH9Tr_.js → index-Yx99TN9O.js} +2 -2
  36. package/dist/{index-BMnsWYrT.js → index-kWCcT4er.js} +3 -3
  37. package/dist/{index-BnRo1212.cjs → index-lH0_mCG-.cjs} +1 -1
  38. package/dist/{index-uaq_HmHi.js → index-ooVzYa5L.js} +1 -1
  39. package/dist/index-qJNRPNIj.js +4 -0
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.js +2 -2
  42. package/dist/outline-CJSEUbgc.cjs +1 -0
  43. package/dist/{outline-utbOTCBV.js → outline-yy4pIEi3.js} +2 -2
  44. package/dist/select-B479QwwL.cjs +1 -0
  45. package/dist/select-CtUVWh2M.js +29 -0
  46. package/dist/{sign-CdhDIjlg.js → sign-BDZCr3wJ.js} +11 -12
  47. package/dist/sign-Gwu2PIRy.cjs +1 -0
  48. package/dist/style.css +1 -1
  49. package/dist/{styleView-DX_XKKmF.js → styleView-CXp05_Ar.js} +2 -2
  50. package/dist/styleView-auUK19Dr.cjs +1 -0
  51. package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +1 -0
  52. package/dist/{tree.vue_vue_type_script_setup_true_lang-Bnl1CGxG.js → tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js} +1 -1
  53. package/dist/ui/elementPlus/index.cjs +1 -1
  54. package/dist/ui/elementPlus/index.js +2 -2
  55. package/package.json +1 -1
  56. package/dist/attributeView-CfMG9ANQ.cjs +0 -1
  57. package/dist/axios-CXDYiOMX.js +0 -1704
  58. package/dist/axios-tuVKNgv9.cjs +0 -6
  59. package/dist/eventView-CSJb3Zam.cjs +0 -1
  60. package/dist/index-B3dTIoEC.cjs +0 -1
  61. package/dist/index-Bd5nBb_T.cjs +0 -1
  62. package/dist/index-Bs6GdgDl.cjs +0 -1
  63. package/dist/index-CaIsXqm5.cjs +0 -1
  64. package/dist/index-Ctr7oJRf.cjs +0 -1
  65. package/dist/index-CuxnFxdY.cjs +0 -1
  66. package/dist/index-Cz47jN8A.cjs +0 -1
  67. package/dist/index-DAk3CFkW.cjs +0 -1
  68. package/dist/index-DBQ-tc2k.cjs +0 -1
  69. package/dist/index-DWjMyXtP.cjs +0 -1
  70. package/dist/index-DZ5RBl4U.cjs +0 -1
  71. package/dist/index-MwVOPR2b.js +0 -1509
  72. package/dist/index-jsf_Tgj1.js +0 -4
  73. package/dist/index-mxP1Ba2T.cjs +0 -1
  74. package/dist/index-p6doDa9j.cjs +0 -10
  75. package/dist/outline-UAdT8ap6.cjs +0 -1
  76. package/dist/pluginManager-D8PM7ICc.js +0 -383
  77. package/dist/pluginManager-itCTrGag.cjs +0 -1
  78. package/dist/select-B8HCbraJ.js +0 -29
  79. package/dist/select-D6bRz5G2.cjs +0 -1
  80. package/dist/sign-Dx0d5kWo.cjs +0 -1
  81. package/dist/styleView-0rthSdVL.cjs +0 -1
  82. package/dist/tree.vue_vue_type_script_setup_true_lang-BVopU0uv.cjs +0 -1
@@ -0,0 +1,1550 @@
1
+ import { ref as S, reactive as Z, defineComponent as G, openBlock as R, createBlock as L, unref as _, mergeProps as be, withCtx as P, renderSlot as $, getCurrentInstance as ne, inject as H, watch as V, onMounted as le, useAttrs as xe, provide as N, shallowRef as Pe, computed as T, watchEffect as se, onUnmounted as Se, resolveComponent as Ve, resolveDynamicComponent as Oe, createVNode as U, normalizeProps as Fe, guardReactiveProps as Me, createCommentVNode as Ae, useSlots as Re, createElementBlock as he, Suspense as De, createElementVNode as z, Fragment as $e, renderList as Ne, nextTick as Y, effectScope as Be, isRef as Te, getCurrentScope as Ue, onScopeDispose as Le, normalizeClass as ze, toRaw as ge } from "vue";
2
+ import { p as F, a as we, l as q, E as fe } from "./axios-ITY6Uw7A.js";
3
+ function ie(e = 10) {
4
+ const a = "abcdefghijklmnopqrstuvwxyz0123456789";
5
+ let n = "";
6
+ for (let o = 0; o < e; o++) {
7
+ const t = Math.floor(Math.random() * a.length);
8
+ n += a[t];
9
+ }
10
+ return n;
11
+ }
12
+ function Je(e) {
13
+ return e.charAt(0).toUpperCase() + e.slice(1);
14
+ }
15
+ function M(e, a = /* @__PURE__ */ new WeakMap()) {
16
+ if (typeof e != "object" || e === null)
17
+ return e;
18
+ if (a.has(e))
19
+ return a.get(e);
20
+ if (Array.isArray(e)) {
21
+ const o = e.map((t) => M(t, a));
22
+ return a.set(e, o), o;
23
+ }
24
+ const n = {};
25
+ return a.set(e, n), Object.keys(e).forEach((o) => {
26
+ n[o] = M(e[o], a);
27
+ }), n;
28
+ }
29
+ function Ft(e) {
30
+ const [a] = Ke([M(e)], (n) => {
31
+ var t, r;
32
+ const o = {
33
+ ...n,
34
+ id: `${n.type}_${ie(8)}`
35
+ };
36
+ return (o.field || o.input) && !((r = (t = F.getComponentConfingByType(o.type)) == null ? void 0 : t.editConstraints) != null && r.fixedField) && (o.field = o.id), o;
37
+ });
38
+ return a;
39
+ }
40
+ function J(e, a, n = !0) {
41
+ for (const [o, t] of Object.entries(a)) {
42
+ let r = e == null ? void 0 : e[o];
43
+ r && t && typeof r == "object" && typeof t == "object" ? (Array.isArray(r) && !Array.isArray(t) ? r = e[o] = {} : !Array.isArray(r) && Array.isArray(t) && (r = e[o] = []), J(r, t, n)) : e[o] = t;
44
+ }
45
+ n && Object.keys(e).reverse().forEach((o) => {
46
+ a.hasOwnProperty(o) || (Array.isArray(e) ? e.splice(Number(o), 1) : delete e[o]);
47
+ });
48
+ }
49
+ function Ee(e, a, n = [], o = /* @__PURE__ */ new WeakMap()) {
50
+ const t = (r) => {
51
+ if (Array.isArray(r))
52
+ return r.map(t);
53
+ if (typeof r == "object" && r !== null) {
54
+ if (o.has(r))
55
+ return "[Circular]";
56
+ o.set(r, !0);
57
+ const l = Object.keys(r).sort(), i = {};
58
+ return l.forEach((c) => {
59
+ n.includes(c) || (i[c] = t(r[c]));
60
+ }), o.delete(r), i;
61
+ } else
62
+ return r;
63
+ };
64
+ return JSON.stringify(t(e)) === JSON.stringify(t(a));
65
+ }
66
+ function We(e, a) {
67
+ const n = [];
68
+ let o = !1;
69
+ function t(r) {
70
+ if (n.push(r), r.id === a && (o = !0), !o && r.children != null && r.children.length > 0)
71
+ for (let l = 0; l < r.children.length && (t(r.children[l]), !o); l++)
72
+ ;
73
+ if (!o && r.slots)
74
+ for (let l in r.slots)
75
+ for (let i = 0; i < r.slots[l].length && (t(r.slots[l][i]), !o); i++)
76
+ ;
77
+ o || n.pop();
78
+ }
79
+ return e.forEach(t), o || console.error(`没有查询到id为${a}的节点`), n;
80
+ }
81
+ function Mt(e, a, n) {
82
+ const o = a.split(".");
83
+ let t = e;
84
+ for (let r = 0; r < o.length; r++) {
85
+ if (t == null)
86
+ return n;
87
+ t = t[o[r]];
88
+ }
89
+ return t === void 0 ? n : t;
90
+ }
91
+ function Rt(e, a, n) {
92
+ const o = a.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
93
+ let t = e;
94
+ for (let r = 0; r < o.length - 1; r++) {
95
+ const l = o[r];
96
+ t[l] == null && (t[l] = isNaN(Number(o[r + 1])) ? {} : []), t = t[l];
97
+ }
98
+ return t[o[o.length - 1]] = n, e;
99
+ }
100
+ function $t(e, a = "default") {
101
+ return He(e, a).map((o) => o.field);
102
+ }
103
+ function He(e, a = "default") {
104
+ const n = te(
105
+ e,
106
+ (t) => {
107
+ var r;
108
+ return t.type === "form" && (((r = t.componentProps) == null ? void 0 : r.name) ?? t.name === a);
109
+ },
110
+ !0
111
+ );
112
+ return te(
113
+ (n == null ? void 0 : n.children) ?? [],
114
+ (t) => !!t.input,
115
+ !1,
116
+ (t) => t.type !== "subform"
117
+ );
118
+ }
119
+ function te(e, a, n = !1, o) {
120
+ const t = [], r = [...e];
121
+ for (; r.length; ) {
122
+ const l = r.pop();
123
+ if (l != null && l.children && (!o || o(l)) && r.push(...l.children), l != null && l.slots && (!o || o(l)))
124
+ for (let i in l.slots)
125
+ r.push(...l.slots[i]);
126
+ if (a(l) && (t.push(l), n))
127
+ return l;
128
+ }
129
+ return n ? !1 : t;
130
+ }
131
+ function Ke(e, a, n) {
132
+ const o = [...e];
133
+ for (; o.length; ) {
134
+ const t = o.pop();
135
+ if (t != null && t.children && (!n || n(t)) && o.push(...t.children), t != null && t.slots && (!n || n(t)))
136
+ for (let r in t.slots)
137
+ o.push(...t.slots[r]);
138
+ J(t, a(t));
139
+ }
140
+ return e;
141
+ }
142
+ function Nt(e, a) {
143
+ const n = te(
144
+ e,
145
+ (o) => o.id === a,
146
+ !0
147
+ );
148
+ if (!n)
149
+ throw new Error(`没有查询到id为${a}的节点`);
150
+ return n;
151
+ }
152
+ function Bt(e, a) {
153
+ const n = [{ type: "", children: e }];
154
+ let o = 0, t = null;
155
+ if (te(
156
+ n,
157
+ (r) => {
158
+ if (t = r.children ?? null, !t) {
159
+ if (r != null && r.slots)
160
+ for (let l in r.slots) {
161
+ t = r.slots[l];
162
+ for (let i = 0; i < t.length; i++)
163
+ if (t[i].id === a)
164
+ return o = i, !0;
165
+ }
166
+ return !1;
167
+ }
168
+ for (let l = 0; l < t.length; l++)
169
+ if (t[l].id === a)
170
+ return o = l, !0;
171
+ return !1;
172
+ },
173
+ !0
174
+ ), !t)
175
+ throw new Error(`没有查询到id为${a}的节点`);
176
+ return {
177
+ list: t,
178
+ schema: t[o],
179
+ index: o
180
+ };
181
+ }
182
+ function Tt(e) {
183
+ const a = {
184
+ schemas: [
185
+ {
186
+ type: "page",
187
+ id: "root",
188
+ label: "页面",
189
+ children: [
190
+ {
191
+ label: "表单",
192
+ type: "form",
193
+ icon: "epic-icon-daibanshixiang",
194
+ labelWidth: e.config.labelWidth || 100,
195
+ name: "default",
196
+ componentProps: {
197
+ layout: e.config.layout || "horizontal",
198
+ labelWidth: e.config.labelWidth || 100,
199
+ labelLayout: e.config.labelLayout === "flex" ? "fixed" : "flex",
200
+ labelCol: e.config.labelCol || { span: 5 },
201
+ wrapperCol: e.config.wrapperCol || { span: 19 },
202
+ hideRequiredMark: e.config.hideRequiredMark || !1,
203
+ colon: e.config.colon || !0,
204
+ labelAlign: e.config.labelAlign || "right",
205
+ size: e.config.size || "middle"
206
+ },
207
+ children: [],
208
+ id: "form_" + ie()
209
+ }
210
+ ],
211
+ componentProps: {
212
+ style: {
213
+ padding: "16px"
214
+ }
215
+ }
216
+ }
217
+ ],
218
+ script: e.script || ""
219
+ };
220
+ return a.schemas[0].children[0].children = ee(e.list), a;
221
+ }
222
+ function ee(e, a) {
223
+ return e.map((n) => {
224
+ var c, w, h;
225
+ let o = n.type ?? "";
226
+ const t = n.options ?? {}, r = (s, y) => {
227
+ o === s && (o = y, t.defaultValue && (t.defaultValue = JSON.parse(t.defaultValue)));
228
+ };
229
+ if (r("uploadImg", "upload-image"), r("uploadFile", "upload-file"), o === "date" && t.range && (t.type = "daterange", delete t.range), (o === "date" || o === "time") && (t.valueFormat = t.format), o === "textarea") {
230
+ const { minRows: s, maxRows: y } = t;
231
+ t.autoSize = { minRows: s, maxRows: y }, delete t.minRows, delete t.maxRows;
232
+ }
233
+ o === "number" && !t.precision && delete t.precision, t.width && (t.style = { width: t.width }, delete t.width), o === "grid" && (o = "row"), a && a.type === "grid" && (o = "col", t.span = n.span, n.key = ie());
234
+ const l = {
235
+ label: n.label,
236
+ type: o,
237
+ icon: n.icon || "",
238
+ field: n.model,
239
+ componentProps: t,
240
+ id: n.key
241
+ };
242
+ return (t.noFormItem || !t.showLabel) && (l.noFormItem = !0, delete t.noFormItem, delete t.showLabel), t.clearable && (t.allowClear = !0, delete t.clearable), [
243
+ "input",
244
+ "textarea",
245
+ "number",
246
+ "password",
247
+ "select",
248
+ "cascader",
249
+ "checkbox",
250
+ "radio",
251
+ "date",
252
+ "time",
253
+ "slider",
254
+ "switch",
255
+ "color-picker",
256
+ "upload-file",
257
+ "upload-image"
258
+ ].includes(o) && (l.input = !0, ((w = (c = n.rules) == null ? void 0 : c[0]) == null ? void 0 : w.required) === !1 && n.rules.shift(), ((h = n.rules) == null ? void 0 : h.length) > 0 && (l.rules = n.rules)), n.list && (l.children = ee(n.list, n)), n.columns && (l.children = ee(n.columns, n)), n.trs && (l.children = ee(n.trs, n)), n.tds && (l.children = ee(n.tds, n)), l;
259
+ });
260
+ }
261
+ function Ut(e, a) {
262
+ let n = null;
263
+ return (...o) => {
264
+ n && clearTimeout(n), n = setTimeout(() => {
265
+ e(...o);
266
+ }, a);
267
+ };
268
+ }
269
+ function Ie() {
270
+ const e = S({}), a = S({}), n = S(!1), o = S([]), t = Z({});
271
+ function r(p) {
272
+ return e.value[p];
273
+ }
274
+ function l(p, g) {
275
+ e.value[p] = g;
276
+ }
277
+ function i(p) {
278
+ delete e.value[p];
279
+ }
280
+ function c(p, g = !1) {
281
+ const v = Object.entries(F.publicMethods).reduce(
282
+ (E, [O, B]) => (E[O] = B.handler, E),
283
+ {}
284
+ );
285
+ try {
286
+ new Function(`const epic = this;${p}`).bind({
287
+ ...v,
288
+ getComponent: r,
289
+ find: r,
290
+ defineExpose: w,
291
+ publicMethods: v,
292
+ pluginManager: F
293
+ })();
294
+ } catch (E) {
295
+ g && console.error("[epic:自定义函数]异常:", E);
296
+ }
297
+ }
298
+ function w(p) {
299
+ p != null && (a.value = p);
300
+ }
301
+ function h(p, ...g) {
302
+ if (!p || p.length === 0) {
303
+ console.warn("未提供任何动作");
304
+ return;
305
+ }
306
+ p.forEach((v) => {
307
+ const E = v.args ? JSON.parse(v.args) : g;
308
+ switch (v.type) {
309
+ case "public":
310
+ s(v, E);
311
+ break;
312
+ case "custom":
313
+ y(v, E);
314
+ break;
315
+ case "component":
316
+ d(v, E);
317
+ break;
318
+ default:
319
+ console.warn(`未知的动作类型: ${v.type}`);
320
+ break;
321
+ }
322
+ });
323
+ }
324
+ function s(p, g) {
325
+ var v;
326
+ try {
327
+ (v = F.publicMethods[p.methodName]) == null || v.handler(...g);
328
+ } catch (E) {
329
+ console.error(`[Epic:公共函数(${p.methodName})]执行异常:`, E);
330
+ }
331
+ }
332
+ function y(p, g) {
333
+ var v, E;
334
+ try {
335
+ (E = (v = a.value)[p.methodName]) == null || E.call(v, ...g);
336
+ } catch (O) {
337
+ console.error(`[Epic:自定义函数(${p.methodName})]执行异常:`, O);
338
+ }
339
+ }
340
+ function d(p, g) {
341
+ const v = p.componentId != null && r(p.componentId);
342
+ if (!v) {
343
+ console.warn(`[Epic:组件${p.componentId}]未找到`);
344
+ return;
345
+ }
346
+ try {
347
+ v[p.methodName](...g);
348
+ } catch (E) {
349
+ console.error(`[Epic:组件${p.componentId}函数(${p.methodName})]执行异常:`, E);
350
+ }
351
+ }
352
+ function f(p = !0) {
353
+ n.value = p;
354
+ }
355
+ function u(p) {
356
+ const g = te(p, () => !0);
357
+ o.value = g.map((v) => v.id);
358
+ }
359
+ function A(p, g = "default") {
360
+ if (t[g]) {
361
+ const v = t[g];
362
+ J(p, v);
363
+ }
364
+ t[g] = p;
365
+ }
366
+ function C(p, g = "default") {
367
+ if (t[g]) {
368
+ J(t[g], p, !1);
369
+ return;
370
+ }
371
+ t[g] = p;
372
+ }
373
+ return {
374
+ componentInstances: e,
375
+ funcs: a,
376
+ isDesignMode: n,
377
+ defaultComponentIds: o,
378
+ forms: t,
379
+ addFormData: A,
380
+ setFormData: C,
381
+ getComponentInstance: r,
382
+ // 简化查询函数, 推荐使用
383
+ find: r,
384
+ addComponentInstance: l,
385
+ removeComponentInstance: i,
386
+ setMethods: c,
387
+ doActions: h,
388
+ setDesignMode: f,
389
+ setDefaultComponentIds: u
390
+ };
391
+ }
392
+ function qe() {
393
+ const e = S([]), a = S([]), n = S(null);
394
+ let o = 0;
395
+ function t(c, w = "插入组件") {
396
+ const h = Date.now();
397
+ o + 150 > h || (o = h, n.value != null && (e.value.push(n.value), a.value.splice(0, a.value.length)), n.value = {
398
+ type: w,
399
+ componentSchema: JSON.stringify(c)
400
+ }, e.value.length > 60 && e.value.unshift());
401
+ }
402
+ function r() {
403
+ if (e.value.length === 0)
404
+ return !1;
405
+ const c = e.value.pop();
406
+ return n.value != null && a.value.push(n.value), n.value = c, JSON.parse(c.componentSchema);
407
+ }
408
+ function l() {
409
+ if (a.value.length === 0)
410
+ return !1;
411
+ const c = a.value.pop();
412
+ return n.value != null && e.value.push(n.value), n.value = c, JSON.parse(c.componentSchema);
413
+ }
414
+ function i() {
415
+ e.value = [], a.value = [], n.value = null;
416
+ }
417
+ return {
418
+ recordList: e,
419
+ undoList: a,
420
+ currentRecord: n,
421
+ push: t,
422
+ undo: r,
423
+ redo: l,
424
+ reset: i
425
+ };
426
+ }
427
+ const Ze = /* @__PURE__ */ G({
428
+ __name: "dynamicFormItem",
429
+ props: {
430
+ hasFormItem: { type: Boolean },
431
+ formItemProps: {}
432
+ },
433
+ emits: ["updateFormItemRef"],
434
+ setup(e, { emit: a }) {
435
+ const n = F.getComponent("form-item"), o = e, t = a, r = S(), l = () => {
436
+ t("updateFormItemRef", r.value);
437
+ };
438
+ return (i, c) => o.hasFormItem ? (R(), L(_(n), be({
439
+ key: 0,
440
+ ref_key: "formItemRef",
441
+ ref: r,
442
+ onVnodeMounted: l
443
+ }, o.formItemProps), {
444
+ default: P(() => [
445
+ $(i.$slots, "default")
446
+ ]),
447
+ _: 3
448
+ }, 16, ["onVnodeMounted"])) : $(i.$slots, "default", { key: 1 });
449
+ }
450
+ }), Ge = /* @__PURE__ */ G({
451
+ name: "ENode",
452
+ __name: "node",
453
+ props: {
454
+ componentSchema: {},
455
+ modelValue: {},
456
+ ruleField: {},
457
+ resetFormData: { type: Boolean },
458
+ name: {},
459
+ dynamicId: {},
460
+ sourceDateUrl: {}
461
+ },
462
+ emits: ["update:modelValue", "change", "update:dynamicId"],
463
+ setup(e, { emit: a }) {
464
+ const { proxy: n } = ne(), o = e, t = S(null);
465
+ let r = H("formData", Z({}));
466
+ const l = H("slots", {}), i = H("pageManager", {}), c = H("disabled", { value: !1 }), w = H("ruleFieldPrefix", null), h = H("resetFormData", !1);
467
+ let s = Z(M(o.componentSchema));
468
+ f();
469
+ async function y(m) {
470
+ if (["cascader", "checkbox", "select", "radio"].includes(m.type) && m.componentProps.dynamicId) {
471
+ const D = (await we({
472
+ // || "http://192.168.28.205:3000/dev-api/data-source
473
+ url: o.sourceDateUrl,
474
+ method: "get",
475
+ params: {
476
+ id: m.componentProps.dynamicId
477
+ }
478
+ })).data;
479
+ let k = await we({
480
+ url: D.url,
481
+ method: D.method,
482
+ data: JSON.parse(D.body),
483
+ params: JSON.parse(D.params),
484
+ headers: JSON.parse(D.headers)
485
+ });
486
+ if (D && (D != null && D.dataPath)) {
487
+ const Ce = D.dataPath.split(".").reduce((re, _e) => re[_e], k.data);
488
+ m.componentProps.options = d(Ce).map((re) => ({
489
+ label: re[D.dataKey],
490
+ value: re[D.dataValue]
491
+ }));
492
+ } else
493
+ m.componentProps.options = d(k.data).map((j) => ({
494
+ label: j[D.dataKey],
495
+ value: j[D.dataValue]
496
+ }));
497
+ return m;
498
+ }
499
+ return m;
500
+ }
501
+ function d(m) {
502
+ return m && Object.prototype.toString.call(m) === "[object Array]" ? m : [];
503
+ }
504
+ V(
505
+ () => o.componentSchema,
506
+ (m) => {
507
+ Ee(s, m, ["children"]) || (J(s, M(m)), f());
508
+ },
509
+ {
510
+ deep: !0
511
+ }
512
+ ), le(() => {
513
+ s = M(o.componentSchema);
514
+ });
515
+ function f() {
516
+ i.isDesignMode.value && typeof s.field == "string" && (s.field += "-design-mode");
517
+ }
518
+ (o.resetFormData || h) && (r = {});
519
+ const u = a, A = S(), C = S(), p = (m) => {
520
+ C.value = m;
521
+ }, g = xe();
522
+ Object.keys(g).length && N("nodeAttrs", g);
523
+ const v = Pe(null), E = T(() => {
524
+ var m, I;
525
+ return (m = s.componentProps) != null && m.hidden ? !1 : typeof s.show == "boolean" ? s.show : ((I = s.show) == null ? void 0 : I.call(s, { values: r })) ?? !0;
526
+ }), O = T(() => {
527
+ var D;
528
+ const m = E.value && ((D = s.rules) == null ? void 0 : D.map((k) => ({
529
+ ...k,
530
+ validator: k.validator && i.funcs.value[k.validator]
531
+ // 自定义校验函数
532
+ })));
533
+ let I = s.field;
534
+ o.ruleField ? I = o.ruleField : w && s.field && (I = M(w), I.push(s.field));
535
+ const x = {
536
+ ...s,
537
+ rules: m,
538
+ rule: m,
539
+ field: I
540
+ };
541
+ return x.children && delete x.children, x;
542
+ }), B = T(() => {
543
+ var x, D;
544
+ const m = ((x = W.value) == null ? void 0 : x.bindModel) ?? "modelValue", I = {};
545
+ return s.on && Object.keys(s.on).forEach((k) => {
546
+ I[`on${Je(k)}`] = (...j) => i.doActions(s.on[k], ...j);
547
+ }), {
548
+ ...o,
549
+ ...s.componentProps,
550
+ disabled: (c == null ? void 0 : c.value) || ((D = s.componentProps) == null ? void 0 : D.disabled),
551
+ bindModel: m,
552
+ ...I
553
+ };
554
+ }), W = T(() => F.getComponentConfingByType(s.type) ?? null);
555
+ se(() => {
556
+ t.value = o.modelValue ?? r[s.field ?? ""];
557
+ }), V(
558
+ () => t.value,
559
+ () => {
560
+ t.value !== (o.modelValue ?? r[s.field ?? ""]) && b(t.value);
561
+ }
562
+ ), V(
563
+ () => A.value,
564
+ () => {
565
+ oe();
566
+ },
567
+ { immediate: !0 }
568
+ );
569
+ function oe() {
570
+ var I;
571
+ const m = A.value || n;
572
+ s.id && m && (s.input && (m.setValue = b, m.getValue = () => r[s.field] || o.modelValue), m.setAttr = (x, D) => (s.componentProps || (s.componentProps = {}), s.componentProps[x] = D), m.getAttr = (x) => s.componentProps[x], i.addComponentInstance(s.id, m), (I = W.value) != null && I.defaultSchema.input && s.noFormItem !== !0 && C.value && i.addComponentInstance(s.id + "formItem", C.value));
573
+ }
574
+ function de() {
575
+ var m;
576
+ s.id && (i.removeComponentInstance(s.id), (m = W.value) != null && m.defaultSchema.input && s.noFormItem !== !0 && i.removeComponentInstance(s.id + "formItem"));
577
+ }
578
+ async function ae() {
579
+ var I, x, D;
580
+ if (s = await y(s), typeof ((I = s.componentProps) == null ? void 0 : I.defaultValue) < "u") {
581
+ const k = i.isDesignMode.value ? (x = s.componentProps) == null ? void 0 : x.defaultValue : r[s.field] ?? ((D = s.componentProps) == null ? void 0 : D.defaultValue);
582
+ b(M(k));
583
+ }
584
+ if (s.type === "slot") {
585
+ const k = s.slotName;
586
+ if (!k) return;
587
+ v.value = G({
588
+ setup() {
589
+ return () => $(l, k, {
590
+ componentSchema: s,
591
+ model: r
592
+ });
593
+ }
594
+ });
595
+ return;
596
+ }
597
+ const m = F.getComponent(s.type);
598
+ if (!m) {
599
+ console.error(`组件${s.type}未注册`);
600
+ return;
601
+ }
602
+ if (typeof m == "function") {
603
+ const k = await m();
604
+ v.value = k.default ?? k;
605
+ } else
606
+ v.value = m;
607
+ }
608
+ function b(m) {
609
+ u("update:modelValue", m), u("change", m), s.field && (r[s.field] = m);
610
+ }
611
+ function X(m) {
612
+ u("update:dynamicId", m);
613
+ }
614
+ let ye = null;
615
+ return V(
616
+ () => s,
617
+ async (m) => {
618
+ const I = JSON.stringify({ ...m, children: void 0 });
619
+ if (I === ye)
620
+ return !1;
621
+ ye = I, ae();
622
+ },
623
+ {
624
+ immediate: !0,
625
+ deep: !0
626
+ }
627
+ ), Se(de), (m, I) => {
628
+ var D;
629
+ const x = Ve("ENode");
630
+ return v.value && E.value ? (R(), L(Ze, {
631
+ key: 0,
632
+ hasFormItem: _(s).noFormItem !== !0 && ((D = W.value) == null ? void 0 : D.defaultSchema.input),
633
+ formItemProps: O.value,
634
+ onUpdateFormItemRef: p
635
+ }, {
636
+ default: P(() => [
637
+ (R(), L(Oe(v.value), be({
638
+ ref_key: "componentInstance",
639
+ ref: A,
640
+ onVnodeMounted: oe,
641
+ model: _(r)
642
+ }, { ...B.value }, {
643
+ [B.value.bindModel]: t.value,
644
+ ["onUpdate:" + B.value.bindModel]: I[0] || (I[0] = (k) => t.value = k),
645
+ [`onUpdate:${B.value.bindModel}` || ""]: b,
646
+ "onUpdate:dynamicId": X
647
+ }), {
648
+ node: P((k) => [
649
+ U(x, Fe(Me(k)), null, 16)
650
+ ]),
651
+ "edit-node": P(() => [
652
+ $(m.$slots, "edit-node")
653
+ ]),
654
+ _: 3
655
+ }, 16, ["model"]))
656
+ ]),
657
+ _: 3
658
+ }, 8, ["hasFormItem", "formItemProps"])) : Ae("", !0);
659
+ };
660
+ }
661
+ });
662
+ function Qe() {
663
+ const e = S(!1), a = Ie(), n = S({});
664
+ function o() {
665
+ return new Promise((d) => {
666
+ if (e.value)
667
+ d();
668
+ else {
669
+ const f = V(e, () => {
670
+ f(), d();
671
+ });
672
+ }
673
+ });
674
+ }
675
+ async function t(d = "default") {
676
+ var u;
677
+ await o();
678
+ const f = (u = n.value) == null ? void 0 : u[d];
679
+ if (!f) throw new Error(`表单 [name=${d}] 不存在`);
680
+ return f;
681
+ }
682
+ async function r(d, f) {
683
+ const u = await t(d);
684
+ return M(await f(u));
685
+ }
686
+ async function l(d = "default") {
687
+ return await r(d, (f) => f.getData());
688
+ }
689
+ function i(d, f = "default") {
690
+ var A;
691
+ a.setFormData(d, f);
692
+ const u = (A = n.value) == null ? void 0 : A[f];
693
+ u == null || u.clearValidate();
694
+ }
695
+ async function c(d = "default") {
696
+ return await r(d, async (f) => (await f.validate(), await f.getData()));
697
+ }
698
+ async function w(d) {
699
+ await o();
700
+ const f = {};
701
+ for (const u in n.value) {
702
+ const A = n.value[u];
703
+ A && (f[u] = M(await d(A)));
704
+ }
705
+ return f;
706
+ }
707
+ async function h() {
708
+ return await w((d) => d.getData());
709
+ }
710
+ function s(d) {
711
+ for (const f in d)
712
+ i(d[f], f);
713
+ }
714
+ async function y() {
715
+ return await w(async (d) => (await d.validate(), await d.getData()));
716
+ }
717
+ return {
718
+ ready: e,
719
+ pageManager: a,
720
+ forms: n,
721
+ getData: l,
722
+ setData: i,
723
+ validate: c,
724
+ getForms: h,
725
+ setForms: s,
726
+ validateAll: y,
727
+ getFormInstance: t
728
+ };
729
+ }
730
+ const Ye = {
731
+ key: 0,
732
+ class: "epic-loading-box"
733
+ }, Xe = { class: "epic-builder-main" }, je = { class: "epic-loading-box" }, et = /* @__PURE__ */ G({
734
+ __name: "builder",
735
+ props: {
736
+ pageSchema: {},
737
+ formData: {},
738
+ disabled: { type: Boolean },
739
+ sourceDateUrl: {}
740
+ },
741
+ emits: ["ready"],
742
+ setup(e, { expose: a, emit: n }) {
743
+ const o = q(() => import("./index-DgcFxYFp.js")), t = n, { ready: r, pageManager: l, forms: i, getData: c, setData: w, validate: h, getForms: s, setForms: y, validateAll: d, getFormInstance: f } = Qe(), u = e, A = Z({
744
+ schemas: []
745
+ });
746
+ V(
747
+ () => u.pageSchema,
748
+ (v) => {
749
+ J(A, v);
750
+ },
751
+ {
752
+ immediate: !0,
753
+ deep: !0
754
+ }
755
+ ), V(
756
+ () => u.formData,
757
+ (v) => {
758
+ v && w(v);
759
+ },
760
+ {
761
+ immediate: !0,
762
+ deep: !0
763
+ }
764
+ ), V(
765
+ () => A.script,
766
+ (v) => {
767
+ v && l.setMethods(v, !0);
768
+ },
769
+ {
770
+ immediate: !0
771
+ }
772
+ ), N("slots", Re()), N("pageManager", l), N("forms", i), N("pageSchema", A), N(
773
+ "disabled",
774
+ T(() => u.disabled)
775
+ );
776
+ const C = ne(), p = C == null ? void 0 : C.proxy;
777
+ function g() {
778
+ Y(() => {
779
+ r.value = !0, t("ready", l), p && l.addComponentInstance("builder", p);
780
+ });
781
+ }
782
+ return a({
783
+ ready: r,
784
+ pageManager: l,
785
+ getData: c,
786
+ setData: w,
787
+ validate: h,
788
+ getForms: s,
789
+ setForms: y,
790
+ validateAll: d,
791
+ getFormInstance: f
792
+ }), (v, E) => _(F).initialized.value ? (R(), L(De, {
793
+ key: 1,
794
+ onResolve: g
795
+ }, {
796
+ default: P(() => [
797
+ z("div", Xe, [
798
+ (R(!0), he($e, null, Ne(A.schemas, (O, B) => (R(), L(_(Ge), {
799
+ key: B,
800
+ sourceDateUrl: v.sourceDateUrl,
801
+ componentSchema: O
802
+ }, null, 8, ["sourceDateUrl", "componentSchema"]))), 128))
803
+ ])
804
+ ]),
805
+ fallback: P(() => [
806
+ z("div", je, [
807
+ U(_(o))
808
+ ])
809
+ ]),
810
+ _: 1
811
+ })) : (R(), he("div", Ye));
812
+ }
813
+ });
814
+ function ve(e) {
815
+ return Ue() ? (Le(e), !0) : !1;
816
+ }
817
+ function tt(e) {
818
+ let a = 0, n, o;
819
+ const t = () => {
820
+ a -= 1, o && a <= 0 && (o.stop(), n = void 0, o = void 0);
821
+ };
822
+ return (...r) => (a += 1, o || (o = Be(!0), n = o.run(() => e(...r))), ve(t), n);
823
+ }
824
+ function Q(e) {
825
+ return typeof e == "function" ? e() : _(e);
826
+ }
827
+ const nt = typeof window < "u" && typeof document < "u";
828
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
829
+ const ot = (e) => typeof e < "u", at = Object.prototype.toString, rt = (e) => at.call(e) === "[object Object]", st = () => {
830
+ };
831
+ function lt(e) {
832
+ return ne();
833
+ }
834
+ function it(e, a = !0, n) {
835
+ lt() ? le(e, n) : a ? e() : Y(e);
836
+ }
837
+ function ct(e = !1, a = {}) {
838
+ const {
839
+ truthyValue: n = !0,
840
+ falsyValue: o = !1
841
+ } = a, t = Te(e), r = S(e);
842
+ function l(i) {
843
+ if (arguments.length)
844
+ return r.value = i, r.value;
845
+ {
846
+ const c = Q(n);
847
+ return r.value = r.value === c ? Q(o) : c, r.value;
848
+ }
849
+ }
850
+ return t ? l : [r, l];
851
+ }
852
+ function Lt(e, a, n) {
853
+ const o = V(e, (...t) => (Y(() => o()), a(...t)), n);
854
+ return o;
855
+ }
856
+ const ce = nt ? window : void 0;
857
+ function K(e) {
858
+ var a;
859
+ const n = Q(e);
860
+ return (a = n == null ? void 0 : n.$el) != null ? a : n;
861
+ }
862
+ function ut(...e) {
863
+ let a, n, o, t;
864
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, t] = e, a = ce) : [a, n, o, t] = e, !a)
865
+ return st;
866
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
867
+ const r = [], l = () => {
868
+ r.forEach((h) => h()), r.length = 0;
869
+ }, i = (h, s, y, d) => (h.addEventListener(s, y, d), () => h.removeEventListener(s, y, d)), c = V(
870
+ () => [K(a), Q(t)],
871
+ ([h, s]) => {
872
+ if (l(), !h)
873
+ return;
874
+ const y = rt(s) ? { ...s } : s;
875
+ r.push(
876
+ ...n.flatMap((d) => o.map((f) => i(h, d, f, y)))
877
+ );
878
+ },
879
+ { immediate: !0, flush: "post" }
880
+ ), w = () => {
881
+ c(), l();
882
+ };
883
+ return ve(w), w;
884
+ }
885
+ function dt(e) {
886
+ return typeof e == "function" ? e : typeof e == "string" ? (a) => a.key === e : Array.isArray(e) ? (a) => e.includes(a.key) : () => !0;
887
+ }
888
+ function ke(...e) {
889
+ let a, n, o = {};
890
+ e.length === 3 ? (a = e[0], n = e[1], o = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (a = !0, n = e[0], o = e[1]) : (a = e[0], n = e[1]) : (a = !0, n = e[0]);
891
+ const {
892
+ target: t = ce,
893
+ eventName: r = "keydown",
894
+ passive: l = !1,
895
+ dedupe: i = !1
896
+ } = o, c = dt(a);
897
+ return ut(t, r, (h) => {
898
+ h.repeat && Q(i) || c(h) && n(h);
899
+ }, l);
900
+ }
901
+ function pe(e, a, n = {}) {
902
+ return ke(e, a, { ...n, eventName: "keydown" });
903
+ }
904
+ function me(e, a, n = {}) {
905
+ return ke(e, a, { ...n, eventName: "keyup" });
906
+ }
907
+ function ft() {
908
+ const e = S(!1), a = ne();
909
+ return a && le(() => {
910
+ e.value = !0;
911
+ }, a), e;
912
+ }
913
+ function pt(e) {
914
+ const a = ft();
915
+ return T(() => (a.value, !!e()));
916
+ }
917
+ function mt(e) {
918
+ return JSON.parse(JSON.stringify(e));
919
+ }
920
+ function ht(e, a, n = {}) {
921
+ const { window: o = ce, ...t } = n;
922
+ let r;
923
+ const l = pt(() => o && "ResizeObserver" in o), i = () => {
924
+ r && (r.disconnect(), r = void 0);
925
+ }, c = T(() => {
926
+ const s = Q(e);
927
+ return Array.isArray(s) ? s.map((y) => K(y)) : [K(s)];
928
+ }), w = V(
929
+ c,
930
+ (s) => {
931
+ if (i(), l.value && o) {
932
+ r = new ResizeObserver(a);
933
+ for (const y of s)
934
+ y && r.observe(y, t);
935
+ }
936
+ },
937
+ { immediate: !0, flush: "post" }
938
+ ), h = () => {
939
+ i(), w();
940
+ };
941
+ return ve(h), {
942
+ isSupported: l,
943
+ stop: h
944
+ };
945
+ }
946
+ function zt(e, a = { width: 0, height: 0 }, n = {}) {
947
+ const { window: o = ce, box: t = "content-box" } = n, r = T(() => {
948
+ var s, y;
949
+ return (y = (s = K(e)) == null ? void 0 : s.namespaceURI) == null ? void 0 : y.includes("svg");
950
+ }), l = S(a.width), i = S(a.height), { stop: c } = ht(
951
+ e,
952
+ ([s]) => {
953
+ const y = t === "border-box" ? s.borderBoxSize : t === "content-box" ? s.contentBoxSize : s.devicePixelContentBoxSize;
954
+ if (o && r.value) {
955
+ const d = K(e);
956
+ if (d) {
957
+ const f = d.getBoundingClientRect();
958
+ l.value = f.width, i.value = f.height;
959
+ }
960
+ } else if (y) {
961
+ const d = Array.isArray(y) ? y : [y];
962
+ l.value = d.reduce((f, { inlineSize: u }) => f + u, 0), i.value = d.reduce((f, { blockSize: u }) => f + u, 0);
963
+ } else
964
+ l.value = s.contentRect.width, i.value = s.contentRect.height;
965
+ },
966
+ n
967
+ );
968
+ it(() => {
969
+ const s = K(e);
970
+ s && (l.value = "offsetWidth" in s ? s.offsetWidth : a.width, i.value = "offsetHeight" in s ? s.offsetHeight : a.height);
971
+ });
972
+ const w = V(
973
+ () => K(e),
974
+ (s) => {
975
+ l.value = s ? a.width : 0, i.value = s ? a.height : 0;
976
+ }
977
+ );
978
+ function h() {
979
+ c(), w();
980
+ }
981
+ return {
982
+ width: l,
983
+ height: i,
984
+ stop: h
985
+ };
986
+ }
987
+ function Jt(e, a, n, o = {}) {
988
+ var t, r, l;
989
+ const {
990
+ clone: i = !1,
991
+ passive: c = !1,
992
+ eventName: w,
993
+ deep: h = !1,
994
+ defaultValue: s,
995
+ shouldEmit: y
996
+ } = o, d = ne(), f = n || (d == null ? void 0 : d.emit) || ((t = d == null ? void 0 : d.$emit) == null ? void 0 : t.bind(d)) || ((l = (r = d == null ? void 0 : d.proxy) == null ? void 0 : r.$emit) == null ? void 0 : l.bind(d == null ? void 0 : d.proxy));
997
+ let u = w;
998
+ a || (a = "modelValue"), u = u || `update:${a.toString()}`;
999
+ const A = (g) => i ? typeof i == "function" ? i(g) : mt(g) : g, C = () => ot(e[a]) ? A(e[a]) : s, p = (g) => {
1000
+ y ? y(g) && f(u, g) : f(u, g);
1001
+ };
1002
+ if (c) {
1003
+ const g = C(), v = S(g);
1004
+ let E = !1;
1005
+ return V(
1006
+ () => e[a],
1007
+ (O) => {
1008
+ E || (E = !0, v.value = A(O), Y(() => E = !1));
1009
+ }
1010
+ ), V(
1011
+ v,
1012
+ (O) => {
1013
+ !E && (O !== e[a] || h) && p(O);
1014
+ },
1015
+ { deep: h }
1016
+ ), v;
1017
+ } else
1018
+ return T({
1019
+ get() {
1020
+ return C();
1021
+ },
1022
+ set(g) {
1023
+ p(g);
1024
+ }
1025
+ });
1026
+ }
1027
+ function Wt() {
1028
+ const { isDark: e } = ue(), a = ct(e);
1029
+ return {
1030
+ isDark: e,
1031
+ toggleDark: a
1032
+ };
1033
+ }
1034
+ function vt() {
1035
+ const e = S(!1);
1036
+ return le(() => {
1037
+ yt(e), gt(e);
1038
+ }), V(
1039
+ () => e.value,
1040
+ () => {
1041
+ e.value ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
1042
+ }
1043
+ ), {
1044
+ isDark: e
1045
+ };
1046
+ }
1047
+ function yt(e) {
1048
+ var a = document.documentElement;
1049
+ a && (a.classList.contains("dark") ? e.value = !0 : e.value = !1);
1050
+ }
1051
+ function gt(e) {
1052
+ var a = document.querySelector("html"), n = new MutationObserver(function(o) {
1053
+ for (var t of o)
1054
+ if (t.type === "attributes" && t.attributeName === "class") {
1055
+ const r = t.target;
1056
+ new Array(...r.classList).includes("dark") ? e.value = !0 : e.value = !1;
1057
+ }
1058
+ });
1059
+ n.observe(a, {
1060
+ attributes: !0,
1061
+ attributeFilter: ["class"]
1062
+ }), Se(() => {
1063
+ n.disconnect();
1064
+ });
1065
+ }
1066
+ function wt() {
1067
+ const e = S(1), a = S(!1), { isDark: n } = vt(), { pressSpace: o, pressShift: t, pressCtrl: r } = bt();
1068
+ return {
1069
+ canvasScale: e,
1070
+ pressSpace: o,
1071
+ pressShift: t,
1072
+ pressCtrl: r,
1073
+ disabledZoom: a,
1074
+ isDark: n
1075
+ };
1076
+ }
1077
+ const ue = tt(wt);
1078
+ function bt() {
1079
+ const e = S(!1), a = S(!1), n = S(!1);
1080
+ return pe(" ", () => {
1081
+ e.value = !0;
1082
+ }), me(" ", () => {
1083
+ e.value = !1;
1084
+ }), pe("Shift", (o) => {
1085
+ o.preventDefault(), a.value = !0;
1086
+ }), me("Shift", () => {
1087
+ a.value = !1;
1088
+ }), pe("Control", (o) => {
1089
+ o.preventDefault(), n.value = !0;
1090
+ }), me("Control", () => {
1091
+ n.value = !1;
1092
+ }), { pressSpace: e, pressShift: a, pressCtrl: n };
1093
+ }
1094
+ function Ht(e) {
1095
+ const { pressSpace: a } = ue(), n = new Image(1, 1);
1096
+ n.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
1097
+ let o = 0, t = 0;
1098
+ function r(c) {
1099
+ var w;
1100
+ a.value && (o = c.x, t = c.y, (w = c.dataTransfer) == null || w.setDragImage(document.createElement("div"), 0, 0));
1101
+ }
1102
+ function l(c) {
1103
+ if (c.preventDefault(), !c.x || !c.y || !a.value)
1104
+ return;
1105
+ const w = c.x - o, h = c.y - t;
1106
+ o = c.x, t = c.y, e.value && (e.value.scrollTop -= h, e.value.scrollLeft -= w);
1107
+ }
1108
+ function i() {
1109
+ a.value = !1;
1110
+ }
1111
+ return { handleElementDragStart: r, handleElementDrag: l, handleElementDragEnd: i };
1112
+ }
1113
+ function Kt(e) {
1114
+ const { pressCtrl: a, canvasScale: n, disabledZoom: o } = ue();
1115
+ function t(r) {
1116
+ if (!a.value || o.value)
1117
+ return;
1118
+ r.preventDefault();
1119
+ let l = 0;
1120
+ r.deltaY < 0 ? l = n.value + 0.05 : l = n.value - 0.05, !(l > 150 || l < 0.5) && (n.value = l);
1121
+ }
1122
+ return V(
1123
+ () => n.value,
1124
+ (r) => {
1125
+ e.value && !o.value && (e.value.style.transform = `scale(${r})`);
1126
+ }
1127
+ ), { handleZoom: t, canvasScale: n };
1128
+ }
1129
+ function qt(e, a = 16.66) {
1130
+ let n;
1131
+ function o() {
1132
+ t(), n = window.setInterval(e, a);
1133
+ }
1134
+ function t() {
1135
+ window.clearInterval(n);
1136
+ }
1137
+ return {
1138
+ startTimedQuery: o,
1139
+ stopTimedQuery: t
1140
+ };
1141
+ }
1142
+ const St = { class: "min-w-750px rounded" }, At = { class: "h-full rounded" }, Dt = /* @__PURE__ */ G({
1143
+ __name: "index",
1144
+ setup(e, { expose: a }) {
1145
+ const n = F.getComponent("monacoEditor"), o = F.getComponent("modal"), t = S(null), r = S(!1), l = S(!1), i = S({}), c = H("pageSchema"), w = S(null), h = S("");
1146
+ function s() {
1147
+ l.value = !1;
1148
+ }
1149
+ function y() {
1150
+ r.value = !1;
1151
+ }
1152
+ function d() {
1153
+ r.value = !0, h.value = ie();
1154
+ }
1155
+ async function f() {
1156
+ try {
1157
+ let u = await w.value.validateAll();
1158
+ if (!Object.keys(u).length) {
1159
+ alert("请添加表单组件后再尝试!");
1160
+ return;
1161
+ }
1162
+ Object.keys(u).length === 1 && (u = u.default), i.value = JSON.stringify(u, null, 2), Y(() => {
1163
+ var A;
1164
+ (A = t.value) == null || A.setValue(i.value);
1165
+ }), l.value = !0;
1166
+ } catch (u) {
1167
+ console.error(u);
1168
+ }
1169
+ }
1170
+ return a({
1171
+ handleOpen: d
1172
+ }), (u, A) => (R(), L(_(o), {
1173
+ modelValue: r.value,
1174
+ "onUpdate:modelValue": A[1] || (A[1] = (C) => r.value = C),
1175
+ title: "预览",
1176
+ class: "w-900px",
1177
+ width: "900px",
1178
+ onClose: y,
1179
+ onOk: f,
1180
+ okText: "表单数据"
1181
+ }, {
1182
+ default: P(() => [
1183
+ z("div", St, [
1184
+ (R(), L(_(et), {
1185
+ key: h.value,
1186
+ ref_key: "kb",
1187
+ ref: w,
1188
+ "page-schema": _(c)
1189
+ }, null, 8, ["page-schema"])),
1190
+ U(_(o), {
1191
+ modelValue: l.value,
1192
+ "onUpdate:modelValue": A[0] || (A[0] = (C) => l.value = C),
1193
+ title: "表单数据",
1194
+ class: "w-860px",
1195
+ width: "860px",
1196
+ onClose: s,
1197
+ onOk: s
1198
+ }, {
1199
+ default: P(() => [
1200
+ z("div", At, [
1201
+ U(_(n), {
1202
+ ref_key: "monacoEditorRef",
1203
+ ref: t,
1204
+ autoToggleTheme: "",
1205
+ readOnly: "",
1206
+ class: "h-full editor",
1207
+ "model-value": i.value
1208
+ }, null, 8, ["model-value"])
1209
+ ])
1210
+ ]),
1211
+ _: 1
1212
+ }, 8, ["modelValue"])
1213
+ ])
1214
+ ]),
1215
+ _: 1
1216
+ }, 8, ["modelValue"]));
1217
+ }
1218
+ }), Et = {
1219
+ key: 0,
1220
+ class: "epic-loading-box"
1221
+ }, It = { class: "epic-designer-main" }, kt = { class: "epic-header-container" }, Ct = { class: "epic-loading-box" }, Zt = /* @__PURE__ */ G({
1222
+ __name: "designer",
1223
+ props: {
1224
+ disabledZoom: { type: Boolean, default: !1 },
1225
+ hiddenHeader: { type: Boolean, default: !1 },
1226
+ lockDefaultSchemaEdit: { type: Boolean, default: !1 },
1227
+ formMode: { type: Boolean, default: !1 },
1228
+ title: { default: "EpicDesigner默认项目" },
1229
+ defaultSchema: {},
1230
+ sourceCodeReadOnly: { type: Boolean },
1231
+ source: { default: [] }
1232
+ },
1233
+ emits: [
1234
+ "ready",
1235
+ "save",
1236
+ "reset",
1237
+ "toggleDeviceMode",
1238
+ "saveSourceData",
1239
+ "deleteSourceData",
1240
+ "updateSourceData"
1241
+ ],
1242
+ setup(e, { expose: a, emit: n }) {
1243
+ const o = q(() => import("./index-C-XUgjda.js")), t = q(() => import("./index-ASoFJnMl.js")), r = q(() => import("./index-BzsFImwK.js")), l = q(() => import("./index-ooVzYa5L.js")), i = q(() => import("./index-DgcFxYFp.js")), c = Ie(), w = qe(), h = e;
1244
+ let s = {
1245
+ schemas: [
1246
+ {
1247
+ type: "form",
1248
+ id: "root",
1249
+ label: "页面",
1250
+ children: [],
1251
+ componentProps: {
1252
+ name: "表单",
1253
+ style: {
1254
+ padding: "16px"
1255
+ }
1256
+ }
1257
+ }
1258
+ // {
1259
+ // type: "form",
1260
+ // id: "root",
1261
+ // label: "表单",
1262
+ // children: [],
1263
+ // componentProps: {
1264
+ // style: {
1265
+ // margin: "0px",
1266
+ // },
1267
+ // name: "default",
1268
+ // labelWidth: "100px",
1269
+ // labelLayout: "fixed",
1270
+ // labelCol: {
1271
+ // span: 5,
1272
+ // },
1273
+ // wrapperCol: {
1274
+ // span: 19,
1275
+ // },
1276
+ // },
1277
+ // },
1278
+ ],
1279
+ script: `const { defineExpose, find } = epic;
1280
+
1281
+ function test (){
1282
+ console.log('test')
1283
+ }
1284
+
1285
+ // 通过defineExpose暴露的函数或者属性
1286
+ defineExpose({
1287
+ test
1288
+ })`
1289
+ };
1290
+ se(() => {
1291
+ if (h.defaultSchema) {
1292
+ s = h.defaultSchema;
1293
+ return;
1294
+ }
1295
+ h.source && F.setSourceData(h.source), h.formMode && (s.schemas = F.formSchemas);
1296
+ }), c.setDesignMode(), c.setDefaultComponentIds(s.schemas);
1297
+ const y = n, d = S(null), f = Z({
1298
+ checkedNode: null,
1299
+ hoverNode: null,
1300
+ disableHover: !1,
1301
+ matched: []
1302
+ }), u = Z({
1303
+ schemas: [],
1304
+ script: s.script
1305
+ }), { disabledZoom: A } = ue();
1306
+ se(() => {
1307
+ A.value = h.disabledZoom;
1308
+ }), se(() => {
1309
+ const b = u.script;
1310
+ b && b !== "" && c.setMethods(b);
1311
+ }), N("pageSchema", u), N("revoke", w), N("pageManager", c), N(
1312
+ "designerProps",
1313
+ T(() => h)
1314
+ ), N("designer", {
1315
+ setCheckedNode: p,
1316
+ setHoverNode: g,
1317
+ setDisableHover: E,
1318
+ handleToggleDeviceMode: de,
1319
+ reset: W,
1320
+ state: f
1321
+ }), fe.on("saveSourceData", (b) => {
1322
+ y("saveSourceData", b);
1323
+ }), fe.on("deleteSourceData", (b) => {
1324
+ y("deleteSourceData", b);
1325
+ }), fe.on("updateSourceData", (b) => {
1326
+ y("updateSourceData", b);
1327
+ });
1328
+ function C() {
1329
+ u.schemas = M(s.schemas), p(u.schemas[0]), w.push(u.schemas, "初始化撤销功能");
1330
+ }
1331
+ async function p(b = u.schemas[0]) {
1332
+ f.checkedNode = b, f.matched = We(u.schemas, b.id);
1333
+ }
1334
+ async function g(b = null) {
1335
+ var X;
1336
+ if (!b || f.disableHover)
1337
+ return f.hoverNode = null, !1;
1338
+ if ((b == null ? void 0 : b.id) === ((X = f.hoverNode) == null ? void 0 : X.id))
1339
+ return !1;
1340
+ f.hoverNode = b;
1341
+ }
1342
+ function v() {
1343
+ Y(() => {
1344
+ y("ready", { pageManager: c });
1345
+ });
1346
+ }
1347
+ async function E(b = !1) {
1348
+ f.disableHover = b;
1349
+ }
1350
+ function O(b) {
1351
+ J(u, M(b));
1352
+ }
1353
+ function B() {
1354
+ return ge(u);
1355
+ }
1356
+ function W() {
1357
+ Ee(u.schemas, s.schemas) && u.script === s.script || (J(u.schemas, s.schemas), u.script = s.script, p(u.schemas[0]), w.push(u.schemas, "重置操作"), y("reset", u));
1358
+ }
1359
+ function oe() {
1360
+ y("save", ge(u));
1361
+ }
1362
+ function de(b) {
1363
+ y("toggleDeviceMode", b);
1364
+ }
1365
+ function ae() {
1366
+ d.value.handleOpen();
1367
+ }
1368
+ return C(), a({
1369
+ revoke: w,
1370
+ setData: O,
1371
+ getData: B,
1372
+ reset: W,
1373
+ preview: ae
1374
+ }), (b, X) => _(F).initialized.value ? (R(), L(De, {
1375
+ key: 1,
1376
+ onResolve: v
1377
+ }, {
1378
+ default: P(() => [
1379
+ z("div", It, [
1380
+ z("div", kt, [
1381
+ $(b.$slots, "header", {}, () => [
1382
+ h.hiddenHeader ? Ae("", !0) : (R(), L(_(o), {
1383
+ key: 0,
1384
+ onPreview: ae,
1385
+ onSave: oe
1386
+ }, {
1387
+ header: P(() => [
1388
+ $(b.$slots, "header-prefix")
1389
+ ]),
1390
+ prefix: P(() => [
1391
+ $(b.$slots, "header-prefix")
1392
+ ]),
1393
+ title: P(() => [
1394
+ $(b.$slots, "header-title")
1395
+ ]),
1396
+ "right-prefix": P(() => [
1397
+ $(b.$slots, "header-right-prefix")
1398
+ ]),
1399
+ "right-action": P(() => [
1400
+ $(b.$slots, "header-right-action")
1401
+ ]),
1402
+ "right-suffix": P(() => [
1403
+ $(b.$slots, "header-right-suffix")
1404
+ ]),
1405
+ _: 3
1406
+ }))
1407
+ ])
1408
+ ]),
1409
+ z("div", {
1410
+ class: ze(["epic-split-view-container", { "hidden-header": b.hiddenHeader }])
1411
+ }, [
1412
+ U(_(t)),
1413
+ U(_(r)),
1414
+ U(_(l))
1415
+ ], 2),
1416
+ U(Dt, {
1417
+ ref_key: "previewRef",
1418
+ ref: d
1419
+ }, null, 512)
1420
+ ])
1421
+ ]),
1422
+ fallback: P(() => [
1423
+ z("div", Ct, [
1424
+ U(_(i))
1425
+ ])
1426
+ ]),
1427
+ _: 3
1428
+ })) : (R(), he("div", Et));
1429
+ }
1430
+ }), _t = {
1431
+ component: async () => await import("./index-BlJ0TQyn.js"),
1432
+ defaultSchema: {
1433
+ label: "代码编辑器",
1434
+ type: "monacoEditor",
1435
+ field: "monacoEditor",
1436
+ icon: "epic-icon-write",
1437
+ input: !0
1438
+ },
1439
+ config: {
1440
+ attribute: [
1441
+ {
1442
+ label: "字段名",
1443
+ type: "input",
1444
+ field: "field"
1445
+ },
1446
+ {
1447
+ label: "标题",
1448
+ type: "input",
1449
+ field: "label"
1450
+ },
1451
+ {
1452
+ label: "默认值",
1453
+ type: "monacoEditor",
1454
+ field: "componentProps.defaultValue"
1455
+ }
1456
+ ]
1457
+ },
1458
+ bindModel: "model-value"
1459
+ }, xt = {
1460
+ component: async () => await import("./index-DiDIFoTk.js"),
1461
+ defaultSchema: {
1462
+ label: "页面",
1463
+ type: "page",
1464
+ componentProps: {},
1465
+ children: []
1466
+ },
1467
+ config: {
1468
+ attribute: [
1469
+ {
1470
+ label: "页面名称",
1471
+ type: "input",
1472
+ componentProps: {
1473
+ placeholder: "请输入"
1474
+ },
1475
+ field: "componentProps.name"
1476
+ }
1477
+ ]
1478
+ }
1479
+ };
1480
+ function Pt(e) {
1481
+ e.component("EInputSize", async () => await import("./index-C4sdhgF2.js")), e.component("EColEditor", async () => await import("./index-DZYSBPVO.js")), e.component("EActionEditor", async () => await import("./index-kWCcT4er.js")), e.component("ERuleEditor", async () => await import("./index-DPfAejnH.js")), e.component("EOptionsEditor", async () => await import("./index-CL_7RzF7.js")), e.component("ENode", async () => await import("./index-qJNRPNIj.js")), e.component("EDataSource", async () => await import("./index-CCTMCqiz.js")), e.registerActivitybar({
1482
+ id: "component_view",
1483
+ title: "组件",
1484
+ icon: "icon--epic--extension-outline",
1485
+ component: async () => await import("./index-Mf82MCCF.js")
1486
+ }), e.registerActivitybar({
1487
+ id: "sound_code_view",
1488
+ title: "源码",
1489
+ icon: "icon--epic--sdk-outline-rounded",
1490
+ component: async () => await import("./index-Yx99TN9O.js")
1491
+ }), e.registerActivitybar({
1492
+ id: "outline_view",
1493
+ title: "大纲",
1494
+ icon: "icon--epic--account-tree-outline-rounded",
1495
+ component: async () => await import("./outline-yy4pIEi3.js")
1496
+ }), e.registerRightSidebar({
1497
+ id: "attribute_view",
1498
+ title: "属性",
1499
+ component: async () => await import("./attributeView-BN2nA4jI.js")
1500
+ }), e.registerRightSidebar({
1501
+ id: "style_view",
1502
+ title: "样式",
1503
+ component: async () => await import("./styleView-CXp05_Ar.js")
1504
+ }), e.registerRightSidebar({
1505
+ id: "event_view",
1506
+ title: "事件",
1507
+ component: async () => await import("./eventView-BKpQ9YIh.js")
1508
+ }), [_t, xt].forEach((n) => {
1509
+ e.registerComponent(n);
1510
+ });
1511
+ }
1512
+ Pt(F);
1513
+ export {
1514
+ He as A,
1515
+ te as B,
1516
+ Ke as C,
1517
+ ee as D,
1518
+ Je as E,
1519
+ bt as F,
1520
+ vt as G,
1521
+ yt as H,
1522
+ wt as I,
1523
+ Ge as _,
1524
+ qt as a,
1525
+ ht as b,
1526
+ Tt as c,
1527
+ J as d,
1528
+ Ht as e,
1529
+ Bt as f,
1530
+ Ft as g,
1531
+ zt as h,
1532
+ Kt as i,
1533
+ Ut as j,
1534
+ ie as k,
1535
+ Nt as l,
1536
+ M as m,
1537
+ Jt as n,
1538
+ Ee as o,
1539
+ Mt as p,
1540
+ Wt as q,
1541
+ et as r,
1542
+ Rt as s,
1543
+ Zt as t,
1544
+ ue as u,
1545
+ Ie as v,
1546
+ Lt as w,
1547
+ qe as x,
1548
+ We as y,
1549
+ $t as z
1550
+ };