epic-designer-gold 1.0.6 → 1.0.8

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 (153) hide show
  1. package/dist/ETable-adkZzXhI.cjs +1 -0
  2. package/dist/ETable-ogvH56w7.js +50 -0
  3. package/dist/ETd-BCM7zA8V.cjs +1 -0
  4. package/dist/{row-DAy14ve9.js → ETd-CRUvOVnZ.js} +13 -13
  5. package/dist/ETr-BqGghav2.cjs +1 -0
  6. package/dist/ETr-nIjGkdzO.js +43 -0
  7. package/dist/{attributeView-C_rnFDGo.js → attributeView-4j---k7X.js} +7 -7
  8. package/dist/attributeView-DOL6IUO8.cjs +1 -0
  9. package/dist/axios-CXDYiOMX.js +1704 -0
  10. package/dist/axios-tuVKNgv9.cjs +6 -0
  11. package/dist/card-C9ua0f7r.cjs +1 -0
  12. package/dist/card-CI6L3YKU.js +33 -0
  13. package/dist/cell-AML-qIH9.cjs +1 -0
  14. package/dist/cell-B_q5hgzb.js +35 -0
  15. package/dist/col-C4lVVBzC.cjs +1 -0
  16. package/dist/col-DcVPBKEc.js +31 -0
  17. package/dist/core/components/builder/src/builder.vue.d.ts +2 -2
  18. package/dist/core/components/designer/src/modules/attributeView/eventView.vue.d.ts +2 -0
  19. package/dist/core/components/node/src/node.vue.d.ts +3 -2
  20. package/dist/core/extensions/EColumnEditor/columnItem.vue.d.ts +10 -0
  21. package/dist/core/extensions/EColumnEditor/index.vue.d.ts +18 -0
  22. package/dist/core/extensions/PaddingMarginControl/index.vue.d.ts +10 -0
  23. package/dist/eventView-5fa6mfSD.cjs +1 -0
  24. package/dist/eventView-C2wKhfU_.js +63 -0
  25. package/dist/{form-CthzLIgs.cjs → form-Bofkrmkd.cjs} +1 -1
  26. package/dist/{form-6cUK-Ari.js → form-VbfBmb63.js} +5 -5
  27. package/dist/iframe-CRF3GSRv.cjs +1 -0
  28. package/dist/iframe-Fgbk3vqJ.js +48 -0
  29. package/dist/{index-CeVV_SOj.js → index--PWf2Ut2.js} +3 -3
  30. package/dist/{index-CoCyrWM2.js → index-B0OgKtuT.js} +72 -71
  31. package/dist/{index-DWxy0GSJ.js → index-B1s67XDZ.js} +11 -15
  32. package/dist/index-B4sqskGf.cjs +1 -0
  33. package/dist/{index-DaJuXp0q.cjs → index-BBVUGri_.cjs} +1 -1
  34. package/dist/index-BEUYVwRA.cjs +1 -0
  35. package/dist/index-BHZbtFEF.cjs +1 -0
  36. package/dist/index-BJHU3Dzu.js +839 -0
  37. package/dist/{index-BpROfyMH.cjs → index-BoL2PSBk.cjs} +1 -1
  38. package/dist/index-CCCx1tbF.cjs +1 -0
  39. package/dist/index-CPkRsFQ7.cjs +1 -0
  40. package/dist/index-CXI_7l7O.js +1422 -0
  41. package/dist/{index-DK4PrvRF.cjs → index-CYxg6AdN.cjs} +1 -1
  42. package/dist/{index-P13z5c0g.js → index-Cctdx_Vq.js} +3 -3
  43. package/dist/index-CdnV7DS4.js +265 -0
  44. package/dist/{index-BfdYrl-Q.js → index-Cln9MN7u.js} +1 -1
  45. package/dist/{index-BEMPXyNN.js → index-CpTA2IRB.js} +2 -2
  46. package/dist/index-CpevxZqj.cjs +1 -0
  47. package/dist/{index-AH-Lj15r.js → index-CraRg8wh.js} +6 -6
  48. package/dist/{index-cElDeAm2.js → index-Cx7gKpkD.js} +2 -2
  49. package/dist/index-DOZPyH6X.cjs +10 -0
  50. package/dist/index-DYQi05p8.cjs +1 -0
  51. package/dist/index-Dftp7CV4.cjs +1 -0
  52. package/dist/index-DiQ4ZTF7.js +142 -0
  53. package/dist/index-DqLjoo13.cjs +1 -0
  54. package/dist/index-Dz59dUur.cjs +1 -0
  55. package/dist/{index-Ce470l1n.js → index-DzC3poxn.js} +3 -3
  56. package/dist/index-FgdbKgb5.cjs +1 -0
  57. package/dist/{index-CFZioB1O.js → index-IGxCNti8.js} +48 -28
  58. package/dist/index-JlyEcj-r.js +4 -0
  59. package/dist/index-R2r9Rw5O.cjs +1 -0
  60. package/dist/{index-DENcRmIy.js → index-WkZdU_zw.js} +2 -2
  61. package/dist/index-v2u1WTMm.cjs +1 -0
  62. package/dist/{index-DpF9E6J8.js → index-zxyA8Keq.js} +1 -1
  63. package/dist/index.cjs +1 -1
  64. package/dist/index.js +2 -2
  65. package/dist/modal-DCBqsiP2.cjs +1 -0
  66. package/dist/modal-DZRBS-Mt.js +58 -0
  67. package/dist/outline-BE98qFHQ.cjs +1 -0
  68. package/dist/{outline-DQ8wgGyH.js → outline-Ch5PHy3c.js} +2 -2
  69. package/dist/pluginManager-BCnrHPYv.js +660 -0
  70. package/dist/pluginManager-DWHAX8kP.cjs +1 -0
  71. package/dist/sign-BS-9u6is.cjs +1 -0
  72. package/dist/{sign-Dfqcv4Fg.js → sign-l63EYvVo.js} +21 -20
  73. package/dist/style.css +1 -1
  74. package/dist/styleView-CNmD046X.cjs +1 -0
  75. package/dist/styleView-DLmxP2vS.js +140 -0
  76. package/dist/tabPanel-CXZYMEwi.cjs +1 -0
  77. package/dist/{col-D4hvKfJ6.js → tabPanel-DAw7ENrC.js} +7 -7
  78. package/dist/table-75K2lqjD.js +65 -0
  79. package/dist/table-CN2LNWqY.cjs +1 -0
  80. package/dist/tabs-CYH9lAUk.cjs +1 -0
  81. package/dist/tabs-DCyifACM.js +41 -0
  82. package/dist/text-B92ioaoV.cjs +1 -0
  83. package/dist/text-C-b94tBH.js +47 -0
  84. package/dist/{tree.vue_vue_type_script_setup_true_lang-B-8wkdQS.js → tree.vue_vue_type_script_setup_true_lang-BsVyMb-n.js} +2 -2
  85. package/dist/tree.vue_vue_type_script_setup_true_lang-VGvT-OYl.cjs +1 -0
  86. package/dist/ui/elementPlus/ETable/ETable.d.ts +20 -0
  87. package/dist/ui/elementPlus/ETd/ETd.d.ts +20 -0
  88. package/dist/ui/elementPlus/ETr/ETr.d.ts +20 -0
  89. package/dist/ui/elementPlus/ETr/index.d.ts +3 -0
  90. package/dist/ui/elementPlus/iframe/iframe.d.ts +29 -0
  91. package/dist/ui/elementPlus/iframe/index.d.ts +3 -0
  92. package/dist/ui/elementPlus/index.cjs +1 -1
  93. package/dist/ui/elementPlus/index.js +904 -403
  94. package/dist/ui/elementPlus/rate/index.d.ts +3 -0
  95. package/dist/ui/elementPlus/tab-panel/index.d.ts +3 -0
  96. package/dist/ui/elementPlus/table/table.d.ts +9 -0
  97. package/dist/ui/elementPlus/table-cell/index.d.ts +3 -0
  98. package/dist/ui/elementPlus/tabs/index.d.ts +2 -0
  99. package/dist/ui/elementPlus/tabs/tabs.d.ts +29 -0
  100. package/dist/ui/elementPlus/text/text.d.ts +9 -0
  101. package/dist/ui/naiveUi/index.cjs +1 -1
  102. package/dist/ui/naiveUi/index.js +1 -1
  103. package/dist/uploadFile-pgvj4Lm9.cjs +1 -0
  104. package/dist/uploadFile-qCbXuHfd.js +81 -0
  105. package/dist/uploadImage-B3sOX-5F.cjs +1 -0
  106. package/dist/{uploadImage-B3tV49Mm.cjs → uploadImage-CNMsK4Lh.cjs} +1 -1
  107. package/dist/uploadImage-DQmVV0jl.js +121 -0
  108. package/dist/{uploadImage-Z6Y6KN1R.js → uploadImage-VFICaVgX.js} +1 -1
  109. package/package.json +1 -1
  110. package/vite.config.ts.timestamp-1748427578982-d7ce374e905ab.mjs +78 -0
  111. package/dist/attributeView-CEFjPemt.cjs +0 -1
  112. package/dist/axios-B5oA4AjJ.cjs +0 -6
  113. package/dist/axios-awtfJhsA.js +0 -2362
  114. package/dist/card-BowzD9vN.cjs +0 -1
  115. package/dist/card-CNGNDzPp.js +0 -31
  116. package/dist/col-B1GUMkMK.cjs +0 -1
  117. package/dist/col-BNNn9Yx8.cjs +0 -1
  118. package/dist/col-u5YiB-UK.js +0 -41
  119. package/dist/index-B0rUZfG_.js +0 -742
  120. package/dist/index-BOUKAGKU.cjs +0 -1
  121. package/dist/index-B_BKVTct.cjs +0 -1
  122. package/dist/index-Ba8KVYrQ.cjs +0 -1
  123. package/dist/index-BnLI5N3M.cjs +0 -1
  124. package/dist/index-BxCrqMkz.cjs +0 -1
  125. package/dist/index-CBBK4Aze.cjs +0 -1
  126. package/dist/index-CDTcUcwY.cjs +0 -1
  127. package/dist/index-Cq5wbnmA.cjs +0 -1
  128. package/dist/index-D8olMR4m.cjs +0 -10
  129. package/dist/index-DfRZtELz.js +0 -4
  130. package/dist/index-J9twEwWw.cjs +0 -1
  131. package/dist/index-oMkqg9Zb.js +0 -1367
  132. package/dist/index-tR-Y01R8.cjs +0 -1
  133. package/dist/index-vzxiD3pz.cjs +0 -1
  134. package/dist/modal-BLOgN3us.cjs +0 -1
  135. package/dist/modal-UFu4bD6x.js +0 -57
  136. package/dist/outline-JJ0IbSzs.cjs +0 -1
  137. package/dist/row-BWnbt6dh.cjs +0 -1
  138. package/dist/sign-BBoshwS_.cjs +0 -1
  139. package/dist/styleView-CZEOSq2l.cjs +0 -1
  140. package/dist/styleView-CajgzMOm.js +0 -106
  141. package/dist/table-CnBJm7Bx.js +0 -43
  142. package/dist/table-DM2-xHlv.cjs +0 -1
  143. package/dist/text-C-52xLjs.js +0 -33
  144. package/dist/text-X9fl5oe8.cjs +0 -1
  145. package/dist/tree.vue_vue_type_script_setup_true_lang-BS6Anq-8.cjs +0 -1
  146. package/dist/uploadFile-BHn9oVA8.cjs +0 -1
  147. package/dist/uploadFile-D_0_6ghp.js +0 -77
  148. package/dist/uploadImage-4U4YGGfK.js +0 -96
  149. package/dist/uploadImage-C-OyUMFn.cjs +0 -1
  150. /package/dist/ui/elementPlus/{table-col → ETable}/index.d.ts +0 -0
  151. /package/dist/ui/elementPlus/{table-row → ETd}/index.d.ts +0 -0
  152. /package/dist/ui/elementPlus/{table-col/col.d.ts → tab-panel/tabPanel.d.ts} +0 -0
  153. /package/dist/ui/elementPlus/{table-row/row.d.ts → table-cell/cell.d.ts} +0 -0
@@ -1,1367 +0,0 @@
1
- import { ref as V, reactive as te, defineComponent as ne, openBlock as B, createBlock as Z, unref as F, mergeProps as he, withCtx as R, renderSlot as L, getCurrentInstance as re, inject as q, watch as $, useAttrs as Ve, provide as z, shallowRef as Ne, computed as H, watchEffect as ce, onUnmounted as Ee, resolveComponent as Me, resolveDynamicComponent as Fe, createVNode as K, createCommentVNode as be, useSlots as Re, createElementBlock as ve, Suspense as Ae, createElementVNode as Q, Fragment as $e, renderList as Ue, nextTick as ae, effectScope as Be, isRef as Te, getCurrentScope as Le, onScopeDispose as ze, onMounted as ge, normalizeClass as Je, toRaw as De } from "vue";
2
- import { p as U, f as He, d as oe, a as Y, b as Ie, c as Ke, E as ee, e as Se, l as j, g as Ze, h as We } from "./axios-awtfJhsA.js";
3
- import { a as le, u as ye } from "./index-DWxy0GSJ.js";
4
- function Ft(e, n) {
5
- let s = null;
6
- return (...a) => {
7
- s && clearTimeout(s), s = setTimeout(() => {
8
- e(...a);
9
- }, n);
10
- };
11
- }
12
- function xe() {
13
- const e = V({}), n = V({}), s = V(!1), a = V([]), i = te({});
14
- function l(d) {
15
- return e.value[d];
16
- }
17
- function p(d, D) {
18
- e.value[d] = D;
19
- }
20
- function h(d) {
21
- delete e.value[d];
22
- }
23
- function v(d, D = !1) {
24
- const A = Object.entries(U.publicMethods).reduce(
25
- (P, [r, N]) => (P[r] = N.handler, P),
26
- {}
27
- );
28
- try {
29
- new Function(`const epic = this;${d}`).bind({
30
- ...A,
31
- getComponent: l,
32
- find: l,
33
- defineExpose: x,
34
- publicMethods: A,
35
- pluginManager: U
36
- })();
37
- } catch (P) {
38
- D && console.error("[epic:自定义函数]异常:", P);
39
- }
40
- }
41
- function x(d) {
42
- d != null && (n.value = d);
43
- }
44
- function E(d, ...D) {
45
- if (!d || d.length === 0) {
46
- console.warn("未提供任何动作");
47
- return;
48
- }
49
- d.forEach((A) => {
50
- const P = A.args ? JSON.parse(A.args) : D;
51
- switch (A.type) {
52
- case "public":
53
- o(A, P);
54
- break;
55
- case "custom":
56
- b(A, P);
57
- break;
58
- case "component":
59
- c(A, P);
60
- break;
61
- default:
62
- console.warn(`未知的动作类型: ${A.type}`);
63
- break;
64
- }
65
- });
66
- }
67
- function o(d, D) {
68
- var A;
69
- try {
70
- (A = U.publicMethods[d.methodName]) == null || A.handler(...D);
71
- } catch (P) {
72
- console.error(`[Epic:公共函数(${d.methodName})]执行异常:`, P);
73
- }
74
- }
75
- function b(d, D) {
76
- var A, P;
77
- try {
78
- (P = (A = n.value)[d.methodName]) == null || P.call(A, ...D);
79
- } catch (r) {
80
- console.error(`[Epic:自定义函数(${d.methodName})]执行异常:`, r);
81
- }
82
- }
83
- function c(d, D) {
84
- const A = d.componentId != null && l(d.componentId);
85
- if (!A) {
86
- console.warn(`[Epic:组件${d.componentId}]未找到`);
87
- return;
88
- }
89
- try {
90
- A[d.methodName](...D);
91
- } catch (P) {
92
- console.error(`[Epic:组件${d.componentId}函数(${d.methodName})]执行异常:`, P);
93
- }
94
- }
95
- function y(d = !0) {
96
- s.value = d;
97
- }
98
- function u(d) {
99
- const D = He(d, () => !0);
100
- a.value = D.map((A) => A.id);
101
- }
102
- function w(d, D = "default") {
103
- if (i[D]) {
104
- const A = i[D];
105
- oe(d, A);
106
- }
107
- i[D] = d;
108
- }
109
- function M(d, D = "default") {
110
- if (i[D]) {
111
- oe(i[D], d, !1);
112
- return;
113
- }
114
- i[D] = d;
115
- }
116
- return {
117
- componentInstances: e,
118
- funcs: n,
119
- isDesignMode: s,
120
- defaultComponentIds: a,
121
- forms: i,
122
- addFormData: w,
123
- setFormData: M,
124
- getComponentInstance: l,
125
- // 简化查询函数, 推荐使用
126
- find: l,
127
- addComponentInstance: p,
128
- removeComponentInstance: h,
129
- setMethods: v,
130
- doActions: E,
131
- setDesignMode: y,
132
- setDefaultComponentIds: u
133
- };
134
- }
135
- function Ge() {
136
- const e = V([]), n = V([]), s = V(null);
137
- let a = 0;
138
- function i(v, x = "插入组件") {
139
- const E = Date.now();
140
- a + 150 > E || (a = E, s.value != null && (e.value.push(s.value), n.value.splice(0, n.value.length)), s.value = {
141
- type: x,
142
- componentSchema: JSON.stringify(v)
143
- }, e.value.length > 60 && e.value.unshift());
144
- }
145
- function l() {
146
- if (e.value.length === 0)
147
- return !1;
148
- const v = e.value.pop();
149
- return s.value != null && n.value.push(s.value), s.value = v, JSON.parse(v.componentSchema);
150
- }
151
- function p() {
152
- if (n.value.length === 0)
153
- return !1;
154
- const v = n.value.pop();
155
- return s.value != null && e.value.push(s.value), s.value = v, JSON.parse(v.componentSchema);
156
- }
157
- function h() {
158
- e.value = [], n.value = [], s.value = null;
159
- }
160
- return {
161
- recordList: e,
162
- undoList: n,
163
- currentRecord: s,
164
- push: i,
165
- undo: l,
166
- redo: p,
167
- reset: h
168
- };
169
- }
170
- const Qe = /* @__PURE__ */ ne({
171
- __name: "dynamicFormItem",
172
- props: {
173
- hasFormItem: { type: Boolean },
174
- formItemProps: {}
175
- },
176
- emits: ["updateFormItemRef"],
177
- setup(e, { emit: n }) {
178
- const s = U.getComponent("form-item"), a = e, i = n, l = V(), p = () => {
179
- i("updateFormItemRef", l.value);
180
- };
181
- return (h, v) => a.hasFormItem ? (B(), Z(F(s), he({
182
- key: 0,
183
- ref_key: "formItemRef",
184
- ref: l,
185
- onVnodeMounted: p
186
- }, a.formItemProps), {
187
- default: R(() => [
188
- L(h.$slots, "default")
189
- ]),
190
- _: 3
191
- }, 16, ["onVnodeMounted"])) : L(h.$slots, "default", { key: 1 });
192
- }
193
- }), Ye = /* @__PURE__ */ ne({
194
- name: "ENode",
195
- __name: "node",
196
- props: {
197
- componentSchema: {},
198
- modelValue: {},
199
- ruleField: {},
200
- resetFormData: { type: Boolean },
201
- name: {},
202
- dynamicId: {},
203
- sourceDateUrl: {},
204
- id: {}
205
- },
206
- emits: ["update:modelValue", "change", "update:dynamicId"],
207
- setup(e, { emit: n }) {
208
- const { proxy: s } = re(), a = e, i = V(null);
209
- let l = q("formData", te({}));
210
- const p = q("slots", {}), h = q("pageManager", {}), v = q("disabled", { value: !1 }), x = q("ruleFieldPrefix", null), E = q("resetFormData", !1);
211
- let o = te(Y(a.componentSchema));
212
- y();
213
- async function b(t) {
214
- if (["cascader", "checkbox", "select", "radio"].includes(t.type) && t.componentProps.dynamicId && a.sourceDateUrl) {
215
- const f = (await Se({
216
- // || "http://192.168.28.205:3000/dev-api/data-source
217
- url: a.sourceDateUrl,
218
- method: "get",
219
- params: {
220
- id: t.componentProps.dynamicId
221
- },
222
- headers: {
223
- Authorization: "Bearer " + le.get("Admin-Token"),
224
- lang: le.get("saas-locale") || "zh-CN",
225
- //语言
226
- zone: Intl.DateTimeFormat().resolvedOptions().timeZone
227
- //时区
228
- }
229
- })).data.data;
230
- let O = await Se({
231
- url: f.url,
232
- method: f.method,
233
- data: JSON.parse(f.body),
234
- params: JSON.parse(f.params),
235
- headers: {
236
- ...JSON.parse(f.headers),
237
- Authorization: "Bearer " + le.get("Admin-Token"),
238
- lang: le.get("saas-locale") || "zh-CN",
239
- //语言
240
- zone: Intl.DateTimeFormat().resolvedOptions().timeZone
241
- //时区
242
- }
243
- });
244
- if (f && (f != null && f.dataPath)) {
245
- const Oe = f.dataPath.split(".").reduce((Ce, Pe) => Ce[Pe], O.data);
246
- t.componentProps.options = c(Oe, f.dataKey, f.dataValue);
247
- } else
248
- t.componentProps.options = c(O.data, f.dataKey, f.dataValue);
249
- return t;
250
- }
251
- return t;
252
- }
253
- function c(t, _, C) {
254
- return t && Object.prototype.toString.call(t) === "[object Array]" ? t.map((f) => f.children && f.children.length ? {
255
- label: f[_],
256
- value: f[C] + "",
257
- children: c(f.children, _, C)
258
- } : {
259
- label: f[_],
260
- value: f[C] + ""
261
- }) : [];
262
- }
263
- $(
264
- () => a.componentSchema,
265
- (t) => {
266
- Ie(o, t, ["children"]) || (oe(o, Y(t)), y());
267
- },
268
- {
269
- deep: !0
270
- }
271
- );
272
- function y() {
273
- h.isDesignMode.value && typeof o.field == "string" && (o.field += "-design-mode");
274
- }
275
- (a.resetFormData || E) && (l = {});
276
- const u = n, w = V(), M = V(), d = (t) => {
277
- M.value = t;
278
- }, D = Ve();
279
- Object.keys(D).length && z("nodeAttrs", D);
280
- const A = Ne(null), P = H(() => {
281
- var t, _;
282
- return (t = o.componentProps) != null && t.hidden ? !1 : typeof o.show == "boolean" ? o.show : ((_ = o.show) == null ? void 0 : _.call(o, { values: l })) ?? !0;
283
- }), r = H(() => {
284
- var f;
285
- const t = P.value && ((f = o.rules) == null ? void 0 : f.map((O) => ({
286
- ...O,
287
- validator: O.validator && h.funcs.value[O.validator]
288
- // 自定义校验函数
289
- })));
290
- let _ = o.field;
291
- a.ruleField ? _ = a.ruleField : x && o.field && (_ = Y(x), _.push(o.field));
292
- const C = {
293
- ...o,
294
- rules: t,
295
- rule: t,
296
- field: _
297
- };
298
- return C.children && delete C.children, C;
299
- }), N = H(() => {
300
- var C, f;
301
- const t = ((C = g.value) == null ? void 0 : C.bindModel) ?? "modelValue", _ = {};
302
- return o.on && Object.keys(o.on).forEach((O) => {
303
- _[`on${Ke(O)}`] = (...k) => h.doActions(o.on[O], ...k);
304
- }), {
305
- ...a,
306
- ...o.componentProps,
307
- disabled: (v == null ? void 0 : v.value) || ((f = o.componentProps) == null ? void 0 : f.disabled),
308
- bindModel: t,
309
- ..._
310
- };
311
- }), g = H(() => U.getComponentConfingByType(o.type) ?? null);
312
- ce(() => {
313
- i.value = a.modelValue ?? l[o.field ?? ""];
314
- }), $(
315
- () => i.value,
316
- () => {
317
- i.value !== (a.modelValue ?? l[o.field ?? ""]) && S(i.value);
318
- }
319
- ), $(
320
- () => w.value,
321
- () => {
322
- I();
323
- },
324
- { immediate: !0 }
325
- );
326
- function I() {
327
- var _;
328
- const t = w.value || s;
329
- o.id && t && (o.input && (t.setValue = S, t.getValue = () => l[o.field] || a.modelValue), t.setAttr = (C, f) => (o.componentProps || (o.componentProps = {}), o.componentProps[C] = f), t.getAttr = (C) => o.componentProps[C], h.addComponentInstance(o.id, t), (_ = g.value) != null && _.defaultSchema.input && o.noFormItem !== !0 && M.value && h.addComponentInstance(o.id + "formItem", M.value));
330
- }
331
- function m() {
332
- var t;
333
- o.id && (h.removeComponentInstance(o.id), (t = g.value) != null && t.defaultSchema.input && o.noFormItem !== !0 && h.removeComponentInstance(o.id + "formItem"));
334
- }
335
- async function W() {
336
- var _, C, f;
337
- if (o = await b(o), typeof ((_ = o.componentProps) == null ? void 0 : _.defaultValue) < "u") {
338
- const O = h.isDesignMode.value ? (C = o.componentProps) == null ? void 0 : C.defaultValue : l[o.field] ?? ((f = o.componentProps) == null ? void 0 : f.defaultValue);
339
- S(Y(O));
340
- }
341
- if (o.type === "slot") {
342
- const O = o.slotName;
343
- if (!O) return;
344
- A.value = ne({
345
- setup() {
346
- return () => L(p, O, {
347
- componentSchema: o,
348
- model: l
349
- });
350
- }
351
- });
352
- return;
353
- }
354
- const t = U.getComponent(o.type);
355
- if (!t) {
356
- console.error(`组件${o.type}未注册`);
357
- return;
358
- }
359
- if (typeof t == "function") {
360
- const O = await t();
361
- A.value = O.default ?? O;
362
- } else
363
- A.value = t;
364
- }
365
- function J(t) {
366
- Object.prototype.toString.call(t), Object.prototype.toString.call(t) === "[object Array]" ? t.forEach((_) => {
367
- l[_.value] = _.label;
368
- }) : l[t.value] = t.label, ee.emit("updateformData" + a.id, l);
369
- }
370
- function S(t) {
371
- u("update:modelValue", t), u("change", t), o.field && (l[o.field] = t), ee.emit("updateformData" + a.id, l);
372
- }
373
- function T(t) {
374
- u("update:dynamicId", t);
375
- }
376
- let G = null;
377
- return $(
378
- () => o,
379
- async (t) => {
380
- const _ = JSON.stringify({
381
- ...t,
382
- children: void 0,
383
- componentProps: {
384
- ...t.componentProps,
385
- options: null
386
- }
387
- });
388
- if (_ === G)
389
- return !1;
390
- G = _, W();
391
- },
392
- {
393
- immediate: !0,
394
- deep: !0
395
- }
396
- ), Ee(m), (t, _) => {
397
- var f;
398
- const C = Me("ENode");
399
- return A.value && P.value ? (B(), Z(Qe, {
400
- key: 0,
401
- hasFormItem: F(o).noFormItem !== !0 && ((f = g.value) == null ? void 0 : f.defaultSchema.input),
402
- formItemProps: r.value,
403
- onUpdateFormItemRef: d
404
- }, {
405
- default: R(() => [
406
- (B(), Z(Fe(A.value), he({
407
- ref_key: "componentInstance",
408
- ref: w,
409
- onVnodeMounted: I,
410
- model: F(l)
411
- }, { ...N.value }, {
412
- [N.value.bindModel]: i.value,
413
- ["onUpdate:" + N.value.bindModel]: _[0] || (_[0] = (O) => i.value = O),
414
- [`onUpdate:${N.value.bindModel}` || ""]: S,
415
- "onUpdate:modelValueLabel": J,
416
- "onUpdate:dynamicId": T
417
- }), {
418
- node: R((O) => [
419
- K(C, he({
420
- id: a.id
421
- }, O, {
422
- sourceDateUrl: a.sourceDateUrl
423
- }), null, 16, ["id", "sourceDateUrl"])
424
- ]),
425
- "edit-node": R(() => [
426
- L(t.$slots, "edit-node")
427
- ]),
428
- _: 3
429
- }, 16, ["model"]))
430
- ]),
431
- _: 3
432
- }, 8, ["hasFormItem", "formItemProps"])) : be("", !0);
433
- };
434
- }
435
- });
436
- function qe() {
437
- const e = V(!1), n = xe(), s = V({});
438
- function a() {
439
- return new Promise((c) => {
440
- if (e.value)
441
- c();
442
- else {
443
- const y = $(e, () => {
444
- y(), c();
445
- });
446
- }
447
- });
448
- }
449
- async function i(c = "default") {
450
- var u;
451
- await a();
452
- const y = (u = s.value) == null ? void 0 : u[c];
453
- if (!y) throw new Error(`表单 [name=${c}] 不存在`);
454
- return y;
455
- }
456
- async function l(c, y) {
457
- const u = await i(c);
458
- return Y(await y(u));
459
- }
460
- async function p(c = "default") {
461
- return await l(c, (y) => y.getData());
462
- }
463
- function h(c, y = "default", u = void 0) {
464
- var w, M;
465
- if (u && Object.keys(u).length) {
466
- let d = function(r) {
467
- let N = [];
468
- return r.forEach((g) => {
469
- g.children && (N = [...N, ...d(g.children)]), N.push(g);
470
- }), N;
471
- }, A = function(r) {
472
- var g;
473
- let N = d((g = u == null ? void 0 : u.schemas[0]) == null ? void 0 : g.children);
474
- return Object.keys(r).forEach((I) => {
475
- var J, S, T, G, t, _, C;
476
- const m = N.find((f) => f.field === I), W = ["datetimerange", "daterange", "monthrange", "dates"];
477
- if ((m && (m == null ? void 0 : m.type) === "checkbox" || (m == null ? void 0 : m.type) === "select" && ((J = m == null ? void 0 : m.componentProps) != null && J.multiple) || (m == null ? void 0 : m.type) === "cascader" && !((T = (S = m == null ? void 0 : m.componentProps) == null ? void 0 : S.props) != null && T.multiple) || (m == null ? void 0 : m.type) === "date" && W.includes((G = m == null ? void 0 : m.componentProps) == null ? void 0 : G.type)) && typeof r[I] == "string")
478
- r[I] = (t = r[I]) == null ? void 0 : t.split(",");
479
- else if ((m == null ? void 0 : m.type) === "cascader" && ((C = (_ = m == null ? void 0 : m.componentProps) == null ? void 0 : _.props) != null && C.multiple) && typeof r[I] == "string")
480
- r[I].indexOf(";") > -1 ? r[I] = r[I].split(";").map((f) => f.split(",")) : r[I] = r[I].split(","), r[I].indexOf(";") > -1 ? r[I] = r[I].split(";").map((f) => f.split(",")) : r[I] = r[I].split(",");
481
- else if (((m == null ? void 0 : m.type) === "upload-image" || (m == null ? void 0 : m.type) === "upload-file") && typeof r[I] == "string") {
482
- let f = [];
483
- Object.entries(r).forEach(([O, k]) => {
484
- r[I] === k && O !== m.field && O.indexOf("@") > -1 && O.indexOf(I) > -1 && (f = O.split("@")[1].split(","));
485
- }), r[I] = r[I].split(",").map((O, k) => ({
486
- url: O,
487
- name: f[k] || O
488
- }));
489
- } else (m == null ? void 0 : m.type) === "number" || (m == null ? void 0 : m.type) === "slider" ? r[I] = Number(r[I]) : (m == null ? void 0 : m.type) === "switch" && (r[I] = typeof r[I] == "boolean" ? r[I] : r[I].indexOf("true") > -1);
490
- }), r;
491
- }(c);
492
- n.setFormData(A, y);
493
- const P = (w = s.value) == null ? void 0 : w[y];
494
- P == null || P.clearValidate();
495
- } else {
496
- n.setFormData(c, y);
497
- const d = (M = s.value) == null ? void 0 : M[y];
498
- d == null || d.clearValidate();
499
- }
500
- }
501
- async function v(c = "default") {
502
- return await l(c, async (y) => (await y.validate(), await y.getData()));
503
- }
504
- async function x(c) {
505
- await a();
506
- const y = {};
507
- for (const u in s.value) {
508
- const w = s.value[u];
509
- w && (y[u] = Y(await c(w)));
510
- }
511
- return y;
512
- }
513
- async function E() {
514
- return await x((c) => c.getData());
515
- }
516
- function o(c) {
517
- for (const y in c)
518
- h(c[y], y);
519
- }
520
- async function b() {
521
- return await x(async (c) => (await c.validate(), await c.getData()));
522
- }
523
- return {
524
- ready: e,
525
- pageManager: n,
526
- forms: s,
527
- getData: p,
528
- setData: h,
529
- validate: v,
530
- getForms: E,
531
- setForms: o,
532
- validateAll: b,
533
- getFormInstance: i
534
- };
535
- }
536
- const Xe = {
537
- key: 0,
538
- class: "epic-loading-box"
539
- }, ke = { class: "epic-builder-main" }, je = { class: "epic-loading-box" }, et = /* @__PURE__ */ ne({
540
- __name: "builder",
541
- props: {
542
- pageSchema: {},
543
- formData: {},
544
- disabled: { type: Boolean },
545
- sourceDateUrl: {},
546
- id: {}
547
- },
548
- emits: ["change", "ready"],
549
- setup(e, { expose: n, emit: s }) {
550
- const a = j(() => import("./index-DgcFxYFp.js")), i = s, { ready: l, pageManager: p, forms: h, getData: v, setData: x, validate: E, getForms: o, setForms: b, validateAll: c, getFormInstance: y } = qe(), u = e, w = te({
551
- schemas: []
552
- });
553
- $(
554
- () => u.pageSchema,
555
- (r) => {
556
- oe(w, r);
557
- },
558
- {
559
- immediate: !0,
560
- deep: !0
561
- }
562
- ), $(
563
- () => u.formData,
564
- (r) => {
565
- if (r) {
566
- let N = d(r);
567
- x(N);
568
- }
569
- },
570
- {
571
- immediate: !0,
572
- deep: !0
573
- }
574
- );
575
- function M(r) {
576
- let N = [];
577
- return r.forEach((g) => {
578
- g.children && (N = [...N, ...M(g.children)]), N.push(g);
579
- }), N;
580
- }
581
- function d(r) {
582
- let N = M(u.pageSchema.schemas[0].children);
583
- return Object.keys(r).forEach((g) => {
584
- var I, m, W, J, S, T, G;
585
- if (g.indexOf("@") < 0) {
586
- const t = N.find((C) => C.field === g), _ = ["datetimerange", "daterange", "monthrange", "dates"];
587
- if ((t && (t == null ? void 0 : t.type) === "checkbox" || (t == null ? void 0 : t.type) === "select" && ((I = t == null ? void 0 : t.componentProps) != null && I.multiple) || (t == null ? void 0 : t.type) === "cascader" && !((W = (m = t == null ? void 0 : t.componentProps) == null ? void 0 : m.props) != null && W.multiple) || (t == null ? void 0 : t.type) === "date" && _.includes((J = t == null ? void 0 : t.componentProps) == null ? void 0 : J.type)) && typeof r[g] == "string")
588
- r[g] = (S = r[g]) == null ? void 0 : S.split(",");
589
- else if ((t == null ? void 0 : t.type) === "cascader" && ((G = (T = t == null ? void 0 : t.componentProps) == null ? void 0 : T.props) != null && G.multiple) && typeof r[g] == "string")
590
- r[g].indexOf(";") > -1 ? r[g] = r[g].split(";").map((C) => C.split(",")) : r[g] = r[g].split(","), r[g].indexOf(";") > -1 ? r[g] = r[g].split(";").map((C) => C.split(",")) : r[g] = r[g].split(",");
591
- else if (((t == null ? void 0 : t.type) === "upload-image" || (t == null ? void 0 : t.type) === "upload-file") && typeof r[g] == "string") {
592
- let C = [];
593
- Object.entries(r).forEach(([f, O]) => {
594
- r[g] === O && f !== t.field && f.indexOf("@") > -1 && f.indexOf(g) > -1 && (C = f.split("@")[1].split(","));
595
- }), r[g] = r[g].split(",").map((f, O) => ({
596
- url: f,
597
- name: C[O] || f
598
- }));
599
- } else (t == null ? void 0 : t.type) === "number" || (t == null ? void 0 : t.type) === "slider" ? r[g] = Number(r[g]) : (t == null ? void 0 : t.type) === "switch" && (r[g] = typeof r[g] == "boolean" ? r[g] : r[g].indexOf("true") > -1);
600
- }
601
- }), r;
602
- }
603
- $(
604
- () => w.script,
605
- (r) => {
606
- r && p.setMethods(r, !0);
607
- },
608
- {
609
- immediate: !0
610
- }
611
- ), z("slots", Re()), z("pageManager", p), z("forms", h), z("pageSchema", w), z(
612
- "disabled",
613
- H(() => u.disabled)
614
- );
615
- const D = re(), A = D == null ? void 0 : D.proxy;
616
- function P() {
617
- ae(() => {
618
- l.value = !0, i("ready", p), A && p.addComponentInstance("builder", A);
619
- });
620
- }
621
- return ee.on("updateformData" + u.id, (r) => {
622
- i("change", r);
623
- }), n({
624
- ready: l,
625
- pageManager: p,
626
- getData: v,
627
- setData: x,
628
- validate: E,
629
- getForms: o,
630
- setForms: b,
631
- validateAll: c,
632
- getFormInstance: y
633
- }), (r, N) => F(U).initialized.value ? (B(), Z(Ae, {
634
- key: 1,
635
- onResolve: P
636
- }, {
637
- default: R(() => [
638
- Q("div", ke, [
639
- (B(!0), ve($e, null, Ue(w.schemas, (g, I) => (B(), Z(F(Ye), {
640
- id: u.id,
641
- key: I,
642
- sourceDateUrl: u.sourceDateUrl,
643
- componentSchema: g
644
- }, null, 8, ["id", "sourceDateUrl", "componentSchema"]))), 128))
645
- ])
646
- ]),
647
- fallback: R(() => [
648
- Q("div", je, [
649
- K(F(a))
650
- ])
651
- ]),
652
- _: 1
653
- })) : (B(), ve("div", Xe));
654
- }
655
- });
656
- function we(e) {
657
- return Le() ? (ze(e), !0) : !1;
658
- }
659
- function tt(e) {
660
- let n = 0, s, a;
661
- const i = () => {
662
- n -= 1, a && n <= 0 && (a.stop(), s = void 0, a = void 0);
663
- };
664
- return (...l) => (n += 1, a || (a = Be(!0), s = a.run(() => e(...l))), we(i), s);
665
- }
666
- function se(e) {
667
- return typeof e == "function" ? e() : F(e);
668
- }
669
- const nt = typeof window < "u" && typeof document < "u";
670
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
671
- const ot = (e) => typeof e < "u", st = Object.prototype.toString, at = (e) => st.call(e) === "[object Object]", rt = () => {
672
- };
673
- function lt(e) {
674
- return re();
675
- }
676
- function it(e, n = !0, s) {
677
- lt() ? ge(e, s) : n ? e() : ae(e);
678
- }
679
- function ct(e = !1, n = {}) {
680
- const {
681
- truthyValue: s = !0,
682
- falsyValue: a = !1
683
- } = n, i = Te(e), l = V(e);
684
- function p(h) {
685
- if (arguments.length)
686
- return l.value = h, l.value;
687
- {
688
- const v = se(s);
689
- return l.value = l.value === v ? se(a) : v, l.value;
690
- }
691
- }
692
- return i ? p : [l, p];
693
- }
694
- function Rt(e, n, s) {
695
- const a = $(e, (...i) => (ae(() => a()), n(...i)), s);
696
- return a;
697
- }
698
- const ue = nt ? window : void 0;
699
- function X(e) {
700
- var n;
701
- const s = se(e);
702
- return (n = s == null ? void 0 : s.$el) != null ? n : s;
703
- }
704
- function ut(...e) {
705
- let n, s, a, i;
706
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([s, a, i] = e, n = ue) : [n, s, a, i] = e, !n)
707
- return rt;
708
- Array.isArray(s) || (s = [s]), Array.isArray(a) || (a = [a]);
709
- const l = [], p = () => {
710
- l.forEach((E) => E()), l.length = 0;
711
- }, h = (E, o, b, c) => (E.addEventListener(o, b, c), () => E.removeEventListener(o, b, c)), v = $(
712
- () => [X(n), se(i)],
713
- ([E, o]) => {
714
- if (p(), !E)
715
- return;
716
- const b = at(o) ? { ...o } : o;
717
- l.push(
718
- ...s.flatMap((c) => a.map((y) => h(E, c, y, b)))
719
- );
720
- },
721
- { immediate: !0, flush: "post" }
722
- ), x = () => {
723
- v(), p();
724
- };
725
- return we(x), x;
726
- }
727
- function dt(e) {
728
- return typeof e == "function" ? e : typeof e == "string" ? (n) => n.key === e : Array.isArray(e) ? (n) => e.includes(n.key) : () => !0;
729
- }
730
- function _e(...e) {
731
- let n, s, a = {};
732
- e.length === 3 ? (n = e[0], s = e[1], a = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (n = !0, s = e[0], a = e[1]) : (n = e[0], s = e[1]) : (n = !0, s = e[0]);
733
- const {
734
- target: i = ue,
735
- eventName: l = "keydown",
736
- passive: p = !1,
737
- dedupe: h = !1
738
- } = a, v = dt(n);
739
- return ut(i, l, (E) => {
740
- E.repeat && se(h) || v(E) && s(E);
741
- }, p);
742
- }
743
- function fe(e, n, s = {}) {
744
- return _e(e, n, { ...s, eventName: "keydown" });
745
- }
746
- function pe(e, n, s = {}) {
747
- return _e(e, n, { ...s, eventName: "keyup" });
748
- }
749
- function ft() {
750
- const e = V(!1), n = re();
751
- return n && ge(() => {
752
- e.value = !0;
753
- }, n), e;
754
- }
755
- function pt(e) {
756
- const n = ft();
757
- return H(() => (n.value, !!e()));
758
- }
759
- function mt(e) {
760
- return JSON.parse(JSON.stringify(e));
761
- }
762
- function ht(e, n, s = {}) {
763
- const { window: a = ue, ...i } = s;
764
- let l;
765
- const p = pt(() => a && "ResizeObserver" in a), h = () => {
766
- l && (l.disconnect(), l = void 0);
767
- }, v = H(() => {
768
- const o = se(e);
769
- return Array.isArray(o) ? o.map((b) => X(b)) : [X(o)];
770
- }), x = $(
771
- v,
772
- (o) => {
773
- if (h(), p.value && a) {
774
- l = new ResizeObserver(n);
775
- for (const b of o)
776
- b && l.observe(b, i);
777
- }
778
- },
779
- { immediate: !0, flush: "post" }
780
- ), E = () => {
781
- h(), x();
782
- };
783
- return we(E), {
784
- isSupported: p,
785
- stop: E
786
- };
787
- }
788
- function $t(e, n = { width: 0, height: 0 }, s = {}) {
789
- const { window: a = ue, box: i = "content-box" } = s, l = H(() => {
790
- var o, b;
791
- return (b = (o = X(e)) == null ? void 0 : o.namespaceURI) == null ? void 0 : b.includes("svg");
792
- }), p = V(n.width), h = V(n.height), { stop: v } = ht(
793
- e,
794
- ([o]) => {
795
- const b = i === "border-box" ? o.borderBoxSize : i === "content-box" ? o.contentBoxSize : o.devicePixelContentBoxSize;
796
- if (a && l.value) {
797
- const c = X(e);
798
- if (c) {
799
- const y = c.getBoundingClientRect();
800
- p.value = y.width, h.value = y.height;
801
- }
802
- } else if (b) {
803
- const c = Array.isArray(b) ? b : [b];
804
- p.value = c.reduce((y, { inlineSize: u }) => y + u, 0), h.value = c.reduce((y, { blockSize: u }) => y + u, 0);
805
- } else
806
- p.value = o.contentRect.width, h.value = o.contentRect.height;
807
- },
808
- s
809
- );
810
- it(() => {
811
- const o = X(e);
812
- o && (p.value = "offsetWidth" in o ? o.offsetWidth : n.width, h.value = "offsetHeight" in o ? o.offsetHeight : n.height);
813
- });
814
- const x = $(
815
- () => X(e),
816
- (o) => {
817
- p.value = o ? n.width : 0, h.value = o ? n.height : 0;
818
- }
819
- );
820
- function E() {
821
- v(), x();
822
- }
823
- return {
824
- width: p,
825
- height: h,
826
- stop: E
827
- };
828
- }
829
- function Ut(e, n, s, a = {}) {
830
- var i, l, p;
831
- const {
832
- clone: h = !1,
833
- passive: v = !1,
834
- eventName: x,
835
- deep: E = !1,
836
- defaultValue: o,
837
- shouldEmit: b
838
- } = a, c = re(), y = s || (c == null ? void 0 : c.emit) || ((i = c == null ? void 0 : c.$emit) == null ? void 0 : i.bind(c)) || ((p = (l = c == null ? void 0 : c.proxy) == null ? void 0 : l.$emit) == null ? void 0 : p.bind(c == null ? void 0 : c.proxy));
839
- let u = x;
840
- n || (n = "modelValue"), u = u || `update:${n.toString()}`;
841
- const w = (D) => h ? typeof h == "function" ? h(D) : mt(D) : D, M = () => ot(e[n]) ? w(e[n]) : o, d = (D) => {
842
- b ? b(D) && y(u, D) : y(u, D);
843
- };
844
- if (v) {
845
- const D = M(), A = V(D);
846
- let P = !1;
847
- return $(
848
- () => e[n],
849
- (r) => {
850
- P || (P = !0, A.value = w(r), ae(() => P = !1));
851
- }
852
- ), $(
853
- A,
854
- (r) => {
855
- !P && (r !== e[n] || E) && d(r);
856
- },
857
- { deep: E }
858
- ), A;
859
- } else
860
- return H({
861
- get() {
862
- return M();
863
- },
864
- set(D) {
865
- d(D);
866
- }
867
- });
868
- }
869
- function Bt() {
870
- const { isDark: e } = de(), n = ct(e);
871
- return {
872
- isDark: e,
873
- toggleDark: n
874
- };
875
- }
876
- function vt() {
877
- const e = V(!1);
878
- return ge(() => {
879
- gt(e), yt(e);
880
- }), $(
881
- () => e.value,
882
- () => {
883
- e.value ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
884
- }
885
- ), {
886
- isDark: e
887
- };
888
- }
889
- function gt(e) {
890
- var n = document.documentElement;
891
- n && (n.classList.contains("dark") ? e.value = !0 : e.value = !1);
892
- }
893
- function yt(e) {
894
- var n = document.querySelector("html"), s = new MutationObserver(function(a) {
895
- for (var i of a)
896
- if (i.type === "attributes" && i.attributeName === "class") {
897
- const l = i.target;
898
- new Array(...l.classList).includes("dark") ? e.value = !0 : e.value = !1;
899
- }
900
- });
901
- s.observe(n, {
902
- attributes: !0,
903
- attributeFilter: ["class"]
904
- }), Ee(() => {
905
- s.disconnect();
906
- });
907
- }
908
- function wt() {
909
- const e = V(1), n = V(!1), { isDark: s } = vt(), { pressSpace: a, pressShift: i, pressCtrl: l } = Dt();
910
- return {
911
- canvasScale: e,
912
- pressSpace: a,
913
- pressShift: i,
914
- pressCtrl: l,
915
- disabledZoom: n,
916
- isDark: s
917
- };
918
- }
919
- const de = tt(wt);
920
- function Dt() {
921
- const e = V(!1), n = V(!1), s = V(!1);
922
- return fe(" ", () => {
923
- e.value = !0;
924
- }), pe(" ", () => {
925
- e.value = !1;
926
- }), fe("Shift", (a) => {
927
- a.preventDefault(), n.value = !0;
928
- }), pe("Shift", () => {
929
- n.value = !1;
930
- }), fe("Control", (a) => {
931
- a.preventDefault(), s.value = !0;
932
- }), pe("Control", () => {
933
- s.value = !1;
934
- }), { pressSpace: e, pressShift: n, pressCtrl: s };
935
- }
936
- function Tt(e) {
937
- const { pressSpace: n } = de(), s = new Image(1, 1);
938
- s.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
939
- let a = 0, i = 0;
940
- function l(v) {
941
- var x;
942
- n.value && (a = v.x, i = v.y, (x = v.dataTransfer) == null || x.setDragImage(document.createElement("div"), 0, 0));
943
- }
944
- function p(v) {
945
- if (v.preventDefault(), !v.x || !v.y || !n.value)
946
- return;
947
- const x = v.x - a, E = v.y - i;
948
- a = v.x, i = v.y, e.value && (e.value.scrollTop -= E, e.value.scrollLeft -= x);
949
- }
950
- function h() {
951
- n.value = !1;
952
- }
953
- return { handleElementDragStart: l, handleElementDrag: p, handleElementDragEnd: h };
954
- }
955
- function Lt(e) {
956
- const { pressCtrl: n, canvasScale: s, disabledZoom: a } = de();
957
- function i(l) {
958
- if (!n.value || a.value)
959
- return;
960
- l.preventDefault();
961
- let p = 0;
962
- l.deltaY < 0 ? p = s.value + 0.05 : p = s.value - 0.05, !(p > 150 || p < 0.5) && (s.value = p);
963
- }
964
- return $(
965
- () => s.value,
966
- (l) => {
967
- e.value && !a.value && (e.value.style.transform = `scale(${l})`);
968
- }
969
- ), { handleZoom: i, canvasScale: s };
970
- }
971
- function zt(e, n = 16.66) {
972
- let s;
973
- function a() {
974
- i(), s = window.setInterval(e, n);
975
- }
976
- function i() {
977
- window.clearInterval(s);
978
- }
979
- return {
980
- startTimedQuery: a,
981
- stopTimedQuery: i
982
- };
983
- }
984
- const St = { class: "min-w-750px rounded" }, Et = { class: "h-full rounded" }, bt = /* @__PURE__ */ ne({
985
- __name: "index",
986
- setup(e, { expose: n }) {
987
- const s = U.getComponent("monacoEditor"), a = U.getComponent("modal"), i = V(null), l = V(!1), p = V(!1), h = V({}), v = q("pageSchema"), x = V(null), E = V("");
988
- function o() {
989
- p.value = !1;
990
- }
991
- function b() {
992
- l.value = !1;
993
- }
994
- function c() {
995
- l.value = !0, E.value = Ze();
996
- }
997
- async function y() {
998
- try {
999
- let u = await x.value.validateAll();
1000
- if (!Object.keys(u).length) {
1001
- alert("请添加表单组件后再尝试!");
1002
- return;
1003
- }
1004
- Object.keys(u).length === 1 && (u = u.default), h.value = JSON.stringify(u, null, 2), ae(() => {
1005
- var w;
1006
- (w = i.value) == null || w.setValue(h.value);
1007
- }), p.value = !0;
1008
- } catch (u) {
1009
- console.error(u);
1010
- }
1011
- }
1012
- return n({
1013
- handleOpen: c
1014
- }), (u, w) => (B(), Z(F(a), {
1015
- modelValue: l.value,
1016
- "onUpdate:modelValue": w[1] || (w[1] = (M) => l.value = M),
1017
- title: "预览",
1018
- class: "w-900px",
1019
- width: "900px",
1020
- onClose: b,
1021
- onOk: y,
1022
- okText: "表单数据"
1023
- }, {
1024
- default: R(() => [
1025
- Q("div", St, [
1026
- (B(), Z(F(et), {
1027
- key: E.value,
1028
- ref_key: "kb",
1029
- ref: x,
1030
- "page-schema": F(v)
1031
- }, null, 8, ["page-schema"])),
1032
- K(F(a), {
1033
- modelValue: p.value,
1034
- "onUpdate:modelValue": w[0] || (w[0] = (M) => p.value = M),
1035
- title: "表单数据",
1036
- class: "w-860px",
1037
- width: "860px",
1038
- onClose: o,
1039
- onOk: o
1040
- }, {
1041
- default: R(() => [
1042
- Q("div", Et, [
1043
- K(F(s), {
1044
- ref_key: "monacoEditorRef",
1045
- ref: i,
1046
- autoToggleTheme: "",
1047
- readOnly: "",
1048
- class: "h-full editor",
1049
- "model-value": h.value
1050
- }, null, 8, ["model-value"])
1051
- ])
1052
- ]),
1053
- _: 1
1054
- }, 8, ["modelValue"])
1055
- ])
1056
- ]),
1057
- _: 1
1058
- }, 8, ["modelValue"]));
1059
- }
1060
- }), At = {
1061
- key: 0,
1062
- class: "epic-loading-box"
1063
- }, It = { class: "epic-designer-main" }, xt = { class: "epic-header-container" }, _t = { class: "epic-loading-box" }, Jt = /* @__PURE__ */ ne({
1064
- __name: "designer",
1065
- props: {
1066
- disabledZoom: { type: Boolean, default: !1 },
1067
- hiddenHeader: { type: Boolean, default: !1 },
1068
- lockDefaultSchemaEdit: { type: Boolean, default: !1 },
1069
- formMode: { type: Boolean, default: !1 },
1070
- title: { default: "EpicDesigner默认项目" },
1071
- defaultSchema: {},
1072
- sourceCodeReadOnly: { type: Boolean },
1073
- source: { default: [] },
1074
- updateSourceId: {}
1075
- },
1076
- emits: [
1077
- "ready",
1078
- "save",
1079
- "reset",
1080
- "toggleDeviceMode",
1081
- "saveSourceData",
1082
- "deleteSourceData",
1083
- "updateSourceData"
1084
- ],
1085
- setup(e, { expose: n, emit: s }) {
1086
- const { t: a } = ye(), i = j(() => import("./index-CFZioB1O.js")), l = j(() => import("./index-DENcRmIy.js")), p = j(() => import("./index-B0rUZfG_.js")), h = j(() => import("./index-BfdYrl-Q.js")), v = j(() => import("./index-DgcFxYFp.js")), x = xe(), E = Ge(), o = e;
1087
- let b = {
1088
- schemas: [
1089
- {
1090
- type: "form",
1091
- id: "root",
1092
- label: a("page"),
1093
- children: [],
1094
- componentProps: {
1095
- name: a("form"),
1096
- style: {
1097
- padding: "16px"
1098
- }
1099
- }
1100
- }
1101
- // {
1102
- // type: "form",
1103
- // id: "root",
1104
- // label: "表单",
1105
- // children: [],
1106
- // componentProps: {
1107
- // style: {
1108
- // margin: "0px",
1109
- // },
1110
- // name: "default",
1111
- // labelWidth: "100px",
1112
- // labelLayout: "fixed",
1113
- // labelCol: {
1114
- // span: 5,
1115
- // },
1116
- // wrapperCol: {
1117
- // span: 19,
1118
- // },
1119
- // },
1120
- // },
1121
- ],
1122
- script: `const { defineExpose, find } = epic;
1123
-
1124
- function test (){
1125
- console.log('test')
1126
- }
1127
-
1128
- // 通过defineExpose暴露的函数或者属性
1129
- defineExpose({
1130
- test
1131
- })`
1132
- };
1133
- ce(() => {
1134
- if (o.defaultSchema) {
1135
- b = o.defaultSchema;
1136
- return;
1137
- }
1138
- o.source && U.setSourceData(o.source), o.formMode && (b.schemas = U.formSchemas);
1139
- }), x.setDesignMode(), x.setDefaultComponentIds(b.schemas);
1140
- const c = s, y = V(null), u = te({
1141
- checkedNode: null,
1142
- hoverNode: null,
1143
- disableHover: !1,
1144
- matched: []
1145
- }), w = te({
1146
- schemas: [],
1147
- script: b.script
1148
- }), { disabledZoom: M } = de();
1149
- ce(() => {
1150
- M.value = o.disabledZoom;
1151
- }), ce(() => {
1152
- const S = w.script;
1153
- S && S !== "" && x.setMethods(S);
1154
- }), z("pageSchema", w), z("revoke", E), z("pageManager", x), z(
1155
- "designerProps",
1156
- H(() => o)
1157
- ), z("designer", {
1158
- setCheckedNode: D,
1159
- setHoverNode: A,
1160
- setDisableHover: r,
1161
- handleToggleDeviceMode: W,
1162
- reset: I,
1163
- state: u
1164
- }), ee.on("saveSourceData", (S) => {
1165
- c("saveSourceData", S);
1166
- }), ee.on("deleteSourceData", (S) => {
1167
- c("deleteSourceData", S);
1168
- }), ee.on("updateSourceData", (S) => {
1169
- c("updateSourceData", S);
1170
- });
1171
- function d() {
1172
- w.schemas = Y(b.schemas), D(w.schemas[0]), E.push(w.schemas, "初始化撤销功能");
1173
- }
1174
- async function D(S = w.schemas[0]) {
1175
- u.checkedNode = S, u.matched = We(w.schemas, S.id);
1176
- }
1177
- async function A(S = null) {
1178
- var T;
1179
- if (!S || u.disableHover)
1180
- return u.hoverNode = null, !1;
1181
- if ((S == null ? void 0 : S.id) === ((T = u.hoverNode) == null ? void 0 : T.id))
1182
- return !1;
1183
- u.hoverNode = S;
1184
- }
1185
- function P() {
1186
- ae(() => {
1187
- c("ready", { pageManager: x });
1188
- });
1189
- }
1190
- async function r(S = !1) {
1191
- u.disableHover = S;
1192
- }
1193
- function N(S) {
1194
- oe(w, Y(S));
1195
- }
1196
- function g() {
1197
- return De(w);
1198
- }
1199
- function I() {
1200
- Ie(w.schemas, b.schemas) && w.script === b.script || (oe(w.schemas, b.schemas), w.script = b.script, D(w.schemas[0]), E.push(w.schemas, "重置操作"), c("reset", w));
1201
- }
1202
- function m() {
1203
- c("save", De(w));
1204
- }
1205
- function W(S) {
1206
- c("toggleDeviceMode", S);
1207
- }
1208
- function J() {
1209
- y.value.handleOpen();
1210
- }
1211
- return d(), n({
1212
- revoke: E,
1213
- setData: N,
1214
- getData: g,
1215
- reset: I,
1216
- preview: J
1217
- }), (S, T) => F(U).initialized.value ? (B(), Z(Ae, {
1218
- key: 1,
1219
- onResolve: P
1220
- }, {
1221
- default: R(() => [
1222
- Q("div", It, [
1223
- Q("div", xt, [
1224
- L(S.$slots, "header", {}, () => [
1225
- o.hiddenHeader ? be("", !0) : (B(), Z(F(i), {
1226
- key: 0,
1227
- onPreview: J,
1228
- onSave: m
1229
- }, {
1230
- header: R(() => [
1231
- L(S.$slots, "header-prefix")
1232
- ]),
1233
- prefix: R(() => [
1234
- L(S.$slots, "header-prefix")
1235
- ]),
1236
- title: R(() => [
1237
- L(S.$slots, "header-title")
1238
- ]),
1239
- "right-prefix": R(() => [
1240
- L(S.$slots, "header-right-prefix")
1241
- ]),
1242
- "right-action": R(() => [
1243
- L(S.$slots, "header-right-action")
1244
- ]),
1245
- "right-suffix": R(() => [
1246
- L(S.$slots, "header-right-suffix")
1247
- ]),
1248
- _: 3
1249
- }))
1250
- ])
1251
- ]),
1252
- Q("div", {
1253
- class: Je(["epic-split-view-container", { "hidden-header": S.hiddenHeader }])
1254
- }, [
1255
- K(F(l)),
1256
- K(F(p)),
1257
- K(F(h))
1258
- ], 2),
1259
- K(bt, {
1260
- ref_key: "previewRef",
1261
- ref: y
1262
- }, null, 512)
1263
- ])
1264
- ]),
1265
- fallback: R(() => [
1266
- Q("div", _t, [
1267
- K(F(v))
1268
- ])
1269
- ]),
1270
- _: 3
1271
- })) : (B(), ve("div", At));
1272
- }
1273
- }), Ot = {
1274
- component: async () => await import("./index-DpF9E6J8.js"),
1275
- defaultSchema: {
1276
- label: "代码编辑器",
1277
- type: "monacoEditor",
1278
- field: "monacoEditor",
1279
- icon: "epic-icon-write",
1280
- input: !0
1281
- },
1282
- config: {
1283
- attribute: [
1284
- {
1285
- label: "字段名",
1286
- type: "input",
1287
- field: "field"
1288
- },
1289
- {
1290
- label: "标题",
1291
- type: "input",
1292
- field: "label"
1293
- },
1294
- {
1295
- label: "默认值",
1296
- type: "monacoEditor",
1297
- field: "componentProps.defaultValue"
1298
- }
1299
- ]
1300
- },
1301
- bindModel: "model-value"
1302
- }, { t: me } = ye(), Ct = {
1303
- component: async () => await import("./index-DiDIFoTk.js"),
1304
- defaultSchema: {
1305
- label: me("page"),
1306
- type: "page",
1307
- componentProps: {},
1308
- children: []
1309
- },
1310
- config: {
1311
- attribute: [
1312
- {
1313
- label: me("pageName"),
1314
- type: "input",
1315
- componentProps: {
1316
- placeholder: me("pleaseEnter")
1317
- },
1318
- field: "componentProps.name"
1319
- }
1320
- ]
1321
- }
1322
- }, { t: ie } = ye();
1323
- function Pt(e) {
1324
- e.component("EInputSize", async () => await import("./index-cElDeAm2.js")), e.component("EColEditor", async () => await import("./index-BEMPXyNN.js")), e.component("EActionEditor", async () => await import("./index-CeVV_SOj.js")), e.component("ERuleEditor", async () => await import("./index-P13z5c0g.js")), e.component("EOptionsEditor", async () => await import("./index-Ce470l1n.js")), e.component("ENode", async () => await import("./index-DfRZtELz.js")), e.component("EDataSource", async () => await import("./index-CoCyrWM2.js")), e.registerActivitybar({
1325
- id: "component_view",
1326
- title: ie("component"),
1327
- icon: "icon--epic--extension-outline",
1328
- component: async () => await import("./index-AH-Lj15r.js")
1329
- }), e.registerActivitybar({
1330
- id: "outline_view",
1331
- title: ie("outline"),
1332
- icon: "icon--epic--account-tree-outline-rounded",
1333
- component: async () => await import("./outline-DQ8wgGyH.js")
1334
- }), e.registerRightSidebar({
1335
- id: "attribute_view",
1336
- title: ie("attribute"),
1337
- component: async () => await import("./attributeView-C_rnFDGo.js")
1338
- }), e.registerRightSidebar({
1339
- id: "style_view",
1340
- title: ie("style"),
1341
- component: async () => await import("./styleView-CajgzMOm.js")
1342
- }), [Ot, Ct].forEach((s) => {
1343
- e.registerComponent(s);
1344
- });
1345
- }
1346
- Pt(U);
1347
- export {
1348
- Ye as _,
1349
- zt as a,
1350
- ht as b,
1351
- Tt as c,
1352
- $t as d,
1353
- Lt as e,
1354
- Ft as f,
1355
- Ut as g,
1356
- Bt as h,
1357
- et as i,
1358
- Jt as j,
1359
- xe as k,
1360
- Ge as l,
1361
- Dt as m,
1362
- vt as n,
1363
- gt as o,
1364
- wt as p,
1365
- de as u,
1366
- Rt as w
1367
- };