@opentiny/tiny-engine-setting-events 2.6.0-alpha.2 → 2.6.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,34 +1,71 @@
1
1
  import "./style.css";
2
- import { ref as K, reactive as Y, provide as Ve, resolveComponent as k, createBlock as O, openBlock as h, withCtx as E, createElementVNode as t, resolveDynamicComponent as _e, createVNode as u, createTextVNode as J, nextTick as Se, unref as D, createElementBlock as A, Fragment as W, withDirectives as be, renderList as ae, normalizeClass as X, toDisplayString as B, createCommentVNode as Q, vShow as he, computed as q, watchEffect as Ne, watch as ye, inject as Ae } from "vue";
3
- import { DialogBox as De, Button as ee, Form as Te, FormItem as Ee, Input as le, Popover as Ue, Tooltip as je, Collapse as ze, CollapseItem as xe, Checkbox as Re, Search as $e } from "@opentiny/vue";
4
- import { getMergeMeta as Ie, useLayout as re, useCanvas as j, getMetaApi as ne, META_APP as oe, getOptions as Fe, useHistory as Je, useBlock as Xe, useMaterial as Ke, useModal as He, useMessage as Ge, useProperties as $ } from "@opentiny/tiny-engine-meta-register";
5
- import qe from "@opentiny/tiny-engine-common/js/i18n";
6
- import { SvgButton as Ye, BlockLinkEvent as Ze, PluginPanel as We, VueMonaco as Qe } from "@opentiny/tiny-engine-common";
7
- import { iconChevronDown as en } from "@opentiny/vue-icon";
8
- import { string2Ast as ke, ast2String as nn } from "@opentiny/tiny-engine-common/js/ast";
9
- import { CodeConfigurator as on, InputConfigurator as tn, VariableConfigurator as sn, SwitchConfigurator as an } from "@opentiny/tiny-engine-configurator";
2
+ import { ref as Ve, reactive as we, provide as tt, nextTick as ct, resolveComponent as L, createBlock as te, openBlock as B, withCtx as I, createElementVNode as v, resolveDynamicComponent as Ge, createVNode as E, createTextVNode as ke, unref as S, createElementBlock as $, Fragment as Oe, withDirectives as qe, renderList as ze, normalizeClass as Ne, toDisplayString as Y, createCommentVNode as Se, vShow as Ye, computed as Me, watchEffect as nt, watch as Ze, inject as ot } from "vue";
3
+ import { callEntry as h, META_APP as C, getMetaApi as k, getOptions as X, useLayout as V, useHistory as K, useCanvas as y, getMergeMeta as P, useBlock as ue, useMaterial as fe, useModal as _e, useMessage as he, useProperties as z } from "@opentiny/tiny-engine-meta-register";
4
+ import { DialogBox as it, Button as Te, Form as mt, FormItem as We, Input as Fe, Popover as gt, Tooltip as pt, Collapse as vt, CollapseItem as Qe, Checkbox as ut, Search as ft } from "@opentiny/vue";
5
+ import be from "@opentiny/tiny-engine-common/js/i18n";
6
+ import { SvgButton as Ee, BlockLinkEvent as ye, PluginPanel as _t, VueMonaco as Ae } from "@opentiny/tiny-engine-common";
7
+ import { iconChevronDown as xe } from "@opentiny/vue-icon";
8
+ import { string2Ast as R, ast2String as H } from "@opentiny/tiny-engine-common/js/ast";
9
+ import { CodeConfigurator as ae, InputConfigurator as se, VariableConfigurator as le, SwitchConfigurator as de } from "@opentiny/tiny-engine-configurator";
10
10
  import { PROP_DATA_TYPE as G } from "@opentiny/tiny-engine-common/js/constants";
11
- import { constants as ln, utils as dn } from "@opentiny/tiny-engine-utils";
12
- const de = {
11
+ import { constants as me, utils as ge } from "@opentiny/tiny-engine-utils";
12
+ const U = {
13
13
  id: "engine.setting.event",
14
14
  title: "高级",
15
- type: "setting",
16
- align: "rightTop",
15
+ type: "plugins",
17
16
  name: "event",
18
17
  icon: "target"
19
- }, H = (f, o) => {
20
- const a = f.__vccOpts || f;
21
- for (const [e, r] of o)
22
- a[e] = r;
23
- return a;
24
- }, ce = K(!1), rn = () => {
25
- ce.value = !0;
26
- }, Ce = () => {
27
- ce.value = !1;
28
- }, cn = {
18
+ }, Ie = (l, t) => {
19
+ const o = l.__vccOpts || l;
20
+ for (const [e, i] of t)
21
+ o[e] = i;
22
+ return o;
23
+ }, j = Ve(!1), w = h(() => {
24
+ j.value = !0;
25
+ }, {
26
+ metaData: {
27
+ id: "engine.setting.event.BindEventsDialog.open"
28
+ },
29
+ ctx: () => ({
30
+ ast2String: H,
31
+ string2Ast: R,
32
+ getMergeMeta: P,
33
+ useCanvas: y,
34
+ useHistory: K,
35
+ useLayout: V,
36
+ getOptions: X,
37
+ getMetaApi: k,
38
+ META_APP: C,
39
+ meta: U,
40
+ dialogVisible: j,
41
+ open: w,
42
+ close: J
43
+ })
44
+ }), J = h(() => {
45
+ j.value = !1;
46
+ }, {
47
+ metaData: {
48
+ id: "engine.setting.event.BindEventsDialog.close"
49
+ },
50
+ ctx: () => ({
51
+ ast2String: H,
52
+ string2Ast: R,
53
+ getMergeMeta: P,
54
+ useCanvas: y,
55
+ useHistory: K,
56
+ useLayout: V,
57
+ getOptions: X,
58
+ getMetaApi: k,
59
+ META_APP: C,
60
+ meta: U,
61
+ dialogVisible: j,
62
+ open: w,
63
+ close: J
64
+ })
65
+ }), ht = {
29
66
  components: {
30
- TinyButton: ee,
31
- TinyDialogBox: De
67
+ TinyButton: Te,
68
+ TinyDialogBox: it
32
69
  },
33
70
  inheritAttrs: !1,
34
71
  props: {
@@ -37,8 +74,20 @@ const de = {
37
74
  default: () => ({})
38
75
  }
39
76
  },
40
- setup(f) {
41
- const { BindEventsDialogSidebar: o, BindEventsDialogContent: a } = Ie(de.id).components, { PLUGIN_NAME: e, activePlugin: r } = re(), { pageState: _ } = j(), { getMethods: b, saveMethod: c, highlightMethod: p } = ne(oe.Page), s = Y({
77
+ setup(l) {
78
+ const {
79
+ BindEventsDialogSidebar: t,
80
+ BindEventsDialogContent: o
81
+ } = P(U.id).components, {
82
+ PLUGIN_NAME: e,
83
+ activePlugin: i
84
+ } = V(), {
85
+ pageState: p
86
+ } = y(), {
87
+ getMethods: g,
88
+ saveMethod: s,
89
+ highlightMethod: r
90
+ } = k(C.Page), a = we({
42
91
  editorContent: "",
43
92
  bindMethodInfo: {},
44
93
  tip: "",
@@ -46,95 +95,502 @@ const de = {
46
95
  enableExtraParams: !1,
47
96
  isValidParams: !0
48
97
  });
49
- Ve("context", s);
50
- const x = (g) => {
51
- s.bindMethodInfo = g;
52
- }, n = (g) => {
53
- var M, P;
54
- if (!g)
98
+ tt("context", a);
99
+ const u = h((b) => {
100
+ a.bindMethodInfo = b;
101
+ }, {
102
+ metaData: {
103
+ id: "engine.setting.event.BindEventsDialog.selectMethod"
104
+ },
105
+ ctx: () => ({
106
+ props: l,
107
+ BindEventsDialogSidebar: t,
108
+ BindEventsDialogContent: o,
109
+ PLUGIN_NAME: e,
110
+ activePlugin: i,
111
+ pageState: p,
112
+ getMethods: g,
113
+ saveMethod: s,
114
+ highlightMethod: r,
115
+ state: a,
116
+ selectMethod: u,
117
+ bindMethod: n,
118
+ resetTipError: c,
119
+ getExtraParams: d,
120
+ getFormatParams: m,
121
+ getFunctionBody: f,
122
+ activePagePlugin: x,
123
+ confirm: D,
124
+ openedDialog: N,
125
+ closeDialog: M,
126
+ ast2String: H,
127
+ string2Ast: R,
128
+ getMergeMeta: P,
129
+ useCanvas: y,
130
+ useHistory: K,
131
+ useLayout: V,
132
+ getOptions: X,
133
+ getMetaApi: k,
134
+ META_APP: C,
135
+ meta: U,
136
+ dialogVisible: j,
137
+ open: w,
138
+ close: J
139
+ })
140
+ }), n = h((b) => {
141
+ var Z, q;
142
+ if (!b)
55
143
  return;
56
- const m = (M = f.eventBinding) == null ? void 0 : M.eventName;
57
- if (!m)
144
+ const _ = (Z = l.eventBinding) == null ? void 0 : Z.eventName;
145
+ if (!_)
58
146
  return;
59
- const v = (P = _ == null ? void 0 : _.currentSchema) == null ? void 0 : P.props;
60
- if (!v)
147
+ const A = (q = p == null ? void 0 : p.currentSchema) == null ? void 0 : q.props;
148
+ if (!A)
61
149
  return;
62
- const { name: C, extra: w } = g;
63
- f[m] || (v[m] = {
150
+ const {
151
+ name: O,
152
+ extra: W
153
+ } = b;
154
+ l[_] || (A[_] = {
64
155
  type: "JSExpression",
65
156
  value: ""
66
- }), w && s.enableExtraParams && (v[m].params = w), v[m].value = `this.${C}`, Je().addHistory();
67
- }, l = () => {
68
- s.tipError = !1, s.tip = "", s.isValidParams = !0;
69
- }, i = () => {
70
- let g = "";
71
- if (s.enableExtraParams)
157
+ }), W && a.enableExtraParams && (A[_].params = W), A[_].value = `this.${O}`, K().addHistory();
158
+ }, {
159
+ metaData: {
160
+ id: "engine.setting.event.BindEventsDialog.bindMethod"
161
+ },
162
+ ctx: () => ({
163
+ props: l,
164
+ BindEventsDialogSidebar: t,
165
+ BindEventsDialogContent: o,
166
+ PLUGIN_NAME: e,
167
+ activePlugin: i,
168
+ pageState: p,
169
+ getMethods: g,
170
+ saveMethod: s,
171
+ highlightMethod: r,
172
+ state: a,
173
+ selectMethod: u,
174
+ bindMethod: n,
175
+ resetTipError: c,
176
+ getExtraParams: d,
177
+ getFormatParams: m,
178
+ getFunctionBody: f,
179
+ activePagePlugin: x,
180
+ confirm: D,
181
+ openedDialog: N,
182
+ closeDialog: M,
183
+ ast2String: H,
184
+ string2Ast: R,
185
+ getMergeMeta: P,
186
+ useCanvas: y,
187
+ useHistory: K,
188
+ useLayout: V,
189
+ getOptions: X,
190
+ getMetaApi: k,
191
+ META_APP: C,
192
+ meta: U,
193
+ dialogVisible: j,
194
+ open: w,
195
+ close: J
196
+ })
197
+ }), c = h(() => {
198
+ a.tipError = !1, a.tip = "", a.isValidParams = !0;
199
+ }, {
200
+ metaData: {
201
+ id: "engine.setting.event.BindEventsDialog.resetTipError"
202
+ },
203
+ ctx: () => ({
204
+ props: l,
205
+ BindEventsDialogSidebar: t,
206
+ BindEventsDialogContent: o,
207
+ PLUGIN_NAME: e,
208
+ activePlugin: i,
209
+ pageState: p,
210
+ getMethods: g,
211
+ saveMethod: s,
212
+ highlightMethod: r,
213
+ state: a,
214
+ selectMethod: u,
215
+ bindMethod: n,
216
+ resetTipError: c,
217
+ getExtraParams: d,
218
+ getFormatParams: m,
219
+ getFunctionBody: f,
220
+ activePagePlugin: x,
221
+ confirm: D,
222
+ openedDialog: N,
223
+ closeDialog: M,
224
+ ast2String: H,
225
+ string2Ast: R,
226
+ getMergeMeta: P,
227
+ useCanvas: y,
228
+ useHistory: K,
229
+ useLayout: V,
230
+ getOptions: X,
231
+ getMetaApi: k,
232
+ META_APP: C,
233
+ meta: U,
234
+ dialogVisible: j,
235
+ open: w,
236
+ close: J
237
+ })
238
+ }), d = h(() => {
239
+ let b = "";
240
+ if (a.enableExtraParams)
72
241
  try {
73
- g = JSON.parse(s.editorContent), s.isValidParams = Array.isArray(g);
242
+ b = JSON.parse(a.editorContent), a.isValidParams = Array.isArray(b);
74
243
  } catch {
75
- s.isValidParams = !1;
244
+ a.isValidParams = !1;
76
245
  }
77
- return g;
78
- }, d = (g) => Array.from({ length: g.length }, (m, v) => `args${v}`).join(","), y = () => {
79
- var w, M, P, S, T, U, L, Z;
80
- let g = (M = (w = b()) == null ? void 0 : w[s.bindMethodInfo.name]) == null ? void 0 : M.value, m = "{}", v = !1, C = !1;
81
- if (g) {
82
- let N = {};
246
+ return b;
247
+ }, {
248
+ metaData: {
249
+ id: "engine.setting.event.BindEventsDialog.getExtraParams"
250
+ },
251
+ ctx: () => ({
252
+ props: l,
253
+ BindEventsDialogSidebar: t,
254
+ BindEventsDialogContent: o,
255
+ PLUGIN_NAME: e,
256
+ activePlugin: i,
257
+ pageState: p,
258
+ getMethods: g,
259
+ saveMethod: s,
260
+ highlightMethod: r,
261
+ state: a,
262
+ selectMethod: u,
263
+ bindMethod: n,
264
+ resetTipError: c,
265
+ getExtraParams: d,
266
+ getFormatParams: m,
267
+ getFunctionBody: f,
268
+ activePagePlugin: x,
269
+ confirm: D,
270
+ openedDialog: N,
271
+ closeDialog: M,
272
+ ast2String: H,
273
+ string2Ast: R,
274
+ getMergeMeta: P,
275
+ useCanvas: y,
276
+ useHistory: K,
277
+ useLayout: V,
278
+ getOptions: X,
279
+ getMetaApi: k,
280
+ META_APP: C,
281
+ meta: U,
282
+ dialogVisible: j,
283
+ open: w,
284
+ close: J
285
+ })
286
+ }), m = h((b) => Array.from({
287
+ length: b.length
288
+ }, (_, A) => `args${A}`).join(","), {
289
+ metaData: {
290
+ id: "engine.setting.event.BindEventsDialog.getFormatParams"
291
+ },
292
+ ctx: () => ({
293
+ props: l,
294
+ BindEventsDialogSidebar: t,
295
+ BindEventsDialogContent: o,
296
+ PLUGIN_NAME: e,
297
+ activePlugin: i,
298
+ pageState: p,
299
+ getMethods: g,
300
+ saveMethod: s,
301
+ highlightMethod: r,
302
+ state: a,
303
+ selectMethod: u,
304
+ bindMethod: n,
305
+ resetTipError: c,
306
+ getExtraParams: d,
307
+ getFormatParams: m,
308
+ getFunctionBody: f,
309
+ activePagePlugin: x,
310
+ confirm: D,
311
+ openedDialog: N,
312
+ closeDialog: M,
313
+ ast2String: H,
314
+ string2Ast: R,
315
+ getMergeMeta: P,
316
+ useCanvas: y,
317
+ useHistory: K,
318
+ useLayout: V,
319
+ getOptions: X,
320
+ getMetaApi: k,
321
+ META_APP: C,
322
+ meta: U,
323
+ dialogVisible: j,
324
+ open: w,
325
+ close: J
326
+ })
327
+ }), f = h(() => {
328
+ var W, Z, q, ne, oe, ie, Q, Le;
329
+ let b = (Z = (W = g()) == null ? void 0 : W[a.bindMethodInfo.name]) == null ? void 0 : Z.value, _ = "{}", A = !1, O = !1;
330
+ if (b) {
331
+ let T = {};
83
332
  try {
84
- N = ke(g);
333
+ T = R(b);
85
334
  } catch {
86
- g = g.replace("function", `function ${s.bindMethodInfo.name}`), N = ke(g);
335
+ b = b.replace("function", `function ${a.bindMethodInfo.name}`), T = R(b);
87
336
  }
88
- (S = (P = N == null ? void 0 : N.program) == null ? void 0 : P.body[0]) != null && S.body && (m = nn(N.program.body[0].body)), (U = (T = N == null ? void 0 : N.program) == null ? void 0 : T.body[0]) != null && U.async && (v = !0), (Z = (L = N == null ? void 0 : N.program) == null ? void 0 : L.body[0]) != null && Z.generator && (C = !0);
337
+ (ne = (q = T == null ? void 0 : T.program) == null ? void 0 : q.body[0]) != null && ne.body && (_ = H(T.program.body[0].body)), (ie = (oe = T == null ? void 0 : T.program) == null ? void 0 : oe.body[0]) != null && ie.async && (A = !0), (Le = (Q = T == null ? void 0 : T.program) == null ? void 0 : Q.body[0]) != null && Le.generator && (O = !0);
89
338
  }
90
339
  return {
91
- preBody: m || `{
340
+ preBody: _ || `{
92
341
  }`,
93
- isAsync: v,
94
- isGenerator: C
342
+ isAsync: A,
343
+ isGenerator: O
95
344
  };
96
- }, V = () => {
97
- r(e.Page).then(() => {
98
- Se(() => {
99
- var g;
100
- p && p((g = s.bindMethodInfo) == null ? void 0 : g.name);
345
+ }, {
346
+ metaData: {
347
+ id: "engine.setting.event.BindEventsDialog.getFunctionBody"
348
+ },
349
+ ctx: () => ({
350
+ props: l,
351
+ BindEventsDialogSidebar: t,
352
+ BindEventsDialogContent: o,
353
+ PLUGIN_NAME: e,
354
+ activePlugin: i,
355
+ pageState: p,
356
+ getMethods: g,
357
+ saveMethod: s,
358
+ highlightMethod: r,
359
+ state: a,
360
+ selectMethod: u,
361
+ bindMethod: n,
362
+ resetTipError: c,
363
+ getExtraParams: d,
364
+ getFormatParams: m,
365
+ getFunctionBody: f,
366
+ activePagePlugin: x,
367
+ confirm: D,
368
+ openedDialog: N,
369
+ closeDialog: M,
370
+ ast2String: H,
371
+ string2Ast: R,
372
+ getMergeMeta: P,
373
+ useCanvas: y,
374
+ useHistory: K,
375
+ useLayout: V,
376
+ getOptions: X,
377
+ getMetaApi: k,
378
+ META_APP: C,
379
+ meta: U,
380
+ dialogVisible: j,
381
+ open: w,
382
+ close: J
383
+ })
384
+ }), x = h(() => {
385
+ i(e.Page).then(() => {
386
+ ct(() => {
387
+ var b;
388
+ r && r((b = a.bindMethodInfo) == null ? void 0 : b.name);
101
389
  });
102
390
  });
103
- };
104
- return {
105
- BindEventsDialogSidebar: o,
106
- BindEventsDialogContent: a,
107
- state: s,
108
- dialogVisible: ce,
109
- confirm: async () => {
110
- if (s.tipError)
111
- return;
112
- let g = "event";
113
- const m = i();
114
- let v = g;
115
- if (!s.isValidParams)
116
- return;
117
- m && (g = m.join(","), v = d(m)), n({ ...s.bindMethodInfo, extra: m });
118
- const { preBody: C, isAsync: w, isGenerator: M } = y(), { name: P } = s.bindMethodInfo, S = `${w ? "async" : ""} function${M ? "*" : ""} ${P}`, T = {
119
- name: P,
120
- content: s.enableExtraParams ? `${S}(eventArgs,${v}) ${C}` : `${S}(${v}) ${C}`
121
- }, { beforeSaveMethod: U } = Fe(de.id);
122
- typeof U == "function" && await U(T, s.bindMethodInfo), c == null || c(T), V(), Ce();
391
+ }, {
392
+ metaData: {
393
+ id: "engine.setting.event.BindEventsDialog.activePagePlugin"
123
394
  },
124
- closeDialog: () => {
125
- l(), Ce();
395
+ ctx: () => ({
396
+ props: l,
397
+ BindEventsDialogSidebar: t,
398
+ BindEventsDialogContent: o,
399
+ PLUGIN_NAME: e,
400
+ activePlugin: i,
401
+ pageState: p,
402
+ getMethods: g,
403
+ saveMethod: s,
404
+ highlightMethod: r,
405
+ state: a,
406
+ selectMethod: u,
407
+ bindMethod: n,
408
+ resetTipError: c,
409
+ getExtraParams: d,
410
+ getFormatParams: m,
411
+ getFunctionBody: f,
412
+ activePagePlugin: x,
413
+ confirm: D,
414
+ openedDialog: N,
415
+ closeDialog: M,
416
+ ast2String: H,
417
+ string2Ast: R,
418
+ getMergeMeta: P,
419
+ useCanvas: y,
420
+ useHistory: K,
421
+ useLayout: V,
422
+ getOptions: X,
423
+ getMetaApi: k,
424
+ META_APP: C,
425
+ meta: U,
426
+ dialogVisible: j,
427
+ open: w,
428
+ close: J
429
+ })
430
+ }), D = h(async () => {
431
+ if (a.tipError)
432
+ return;
433
+ let b = "event";
434
+ const _ = d();
435
+ let A = b;
436
+ if (!a.isValidParams)
437
+ return;
438
+ _ && (b = _.join(","), A = m(_)), n({
439
+ ...a.bindMethodInfo,
440
+ params: b,
441
+ extra: _
442
+ });
443
+ const {
444
+ preBody: O,
445
+ isAsync: W,
446
+ isGenerator: Z
447
+ } = f(), {
448
+ name: q
449
+ } = a.bindMethodInfo, ne = `${W ? "async" : ""} function${Z ? "*" : ""} ${q}`, oe = {
450
+ name: q,
451
+ content: a.enableExtraParams ? `${ne}(eventArgs,${A}) ${O}` : `${ne}(${A}) ${O}`
452
+ }, {
453
+ beforeSaveMethod: ie
454
+ } = X(U.id);
455
+ typeof ie == "function" && await ie(oe, a.bindMethodInfo), s == null || s(oe), x(), J();
456
+ }, {
457
+ metaData: {
458
+ id: "engine.setting.event.BindEventsDialog.confirm"
126
459
  },
127
- openedDialog: () => {
128
- var g, m, v;
129
- s.enableExtraParams = !!((m = (g = f.eventBinding) == null ? void 0 : g.params) != null && m.length), s.editorContent = JSON.stringify(((v = f.eventBinding) == null ? void 0 : v.params) || [], null, 2), l();
460
+ ctx: () => ({
461
+ props: l,
462
+ BindEventsDialogSidebar: t,
463
+ BindEventsDialogContent: o,
464
+ PLUGIN_NAME: e,
465
+ activePlugin: i,
466
+ pageState: p,
467
+ getMethods: g,
468
+ saveMethod: s,
469
+ highlightMethod: r,
470
+ state: a,
471
+ selectMethod: u,
472
+ bindMethod: n,
473
+ resetTipError: c,
474
+ getExtraParams: d,
475
+ getFormatParams: m,
476
+ getFunctionBody: f,
477
+ activePagePlugin: x,
478
+ confirm: D,
479
+ openedDialog: N,
480
+ closeDialog: M,
481
+ ast2String: H,
482
+ string2Ast: R,
483
+ getMergeMeta: P,
484
+ useCanvas: y,
485
+ useHistory: K,
486
+ useLayout: V,
487
+ getOptions: X,
488
+ getMetaApi: k,
489
+ META_APP: C,
490
+ meta: U,
491
+ dialogVisible: j,
492
+ open: w,
493
+ close: J
494
+ })
495
+ }), N = h(() => {
496
+ var b, _, A;
497
+ a.enableExtraParams = !!((_ = (b = l.eventBinding) == null ? void 0 : b.params) != null && _.length), a.editorContent = JSON.stringify(((A = l.eventBinding) == null ? void 0 : A.params) || [], null, 2), c();
498
+ }, {
499
+ metaData: {
500
+ id: "engine.setting.event.BindEventsDialog.openedDialog"
130
501
  },
131
- selectMethod: x
502
+ ctx: () => ({
503
+ props: l,
504
+ BindEventsDialogSidebar: t,
505
+ BindEventsDialogContent: o,
506
+ PLUGIN_NAME: e,
507
+ activePlugin: i,
508
+ pageState: p,
509
+ getMethods: g,
510
+ saveMethod: s,
511
+ highlightMethod: r,
512
+ state: a,
513
+ selectMethod: u,
514
+ bindMethod: n,
515
+ resetTipError: c,
516
+ getExtraParams: d,
517
+ getFormatParams: m,
518
+ getFunctionBody: f,
519
+ activePagePlugin: x,
520
+ confirm: D,
521
+ openedDialog: N,
522
+ closeDialog: M,
523
+ ast2String: H,
524
+ string2Ast: R,
525
+ getMergeMeta: P,
526
+ useCanvas: y,
527
+ useHistory: K,
528
+ useLayout: V,
529
+ getOptions: X,
530
+ getMetaApi: k,
531
+ META_APP: C,
532
+ meta: U,
533
+ dialogVisible: j,
534
+ open: w,
535
+ close: J
536
+ })
537
+ }), M = h(() => {
538
+ c(), J();
539
+ }, {
540
+ metaData: {
541
+ id: "engine.setting.event.BindEventsDialog.closeDialog"
542
+ },
543
+ ctx: () => ({
544
+ props: l,
545
+ BindEventsDialogSidebar: t,
546
+ BindEventsDialogContent: o,
547
+ PLUGIN_NAME: e,
548
+ activePlugin: i,
549
+ pageState: p,
550
+ getMethods: g,
551
+ saveMethod: s,
552
+ highlightMethod: r,
553
+ state: a,
554
+ selectMethod: u,
555
+ bindMethod: n,
556
+ resetTipError: c,
557
+ getExtraParams: d,
558
+ getFormatParams: m,
559
+ getFunctionBody: f,
560
+ activePagePlugin: x,
561
+ confirm: D,
562
+ openedDialog: N,
563
+ closeDialog: M,
564
+ ast2String: H,
565
+ string2Ast: R,
566
+ getMergeMeta: P,
567
+ useCanvas: y,
568
+ useHistory: K,
569
+ useLayout: V,
570
+ getOptions: X,
571
+ getMetaApi: k,
572
+ META_APP: C,
573
+ meta: U,
574
+ dialogVisible: j,
575
+ open: w,
576
+ close: J
577
+ })
578
+ });
579
+ return {
580
+ BindEventsDialogSidebar: t,
581
+ BindEventsDialogContent: o,
582
+ state: a,
583
+ dialogVisible: j,
584
+ confirm: D,
585
+ closeDialog: M,
586
+ openedDialog: N,
587
+ selectMethod: u
132
588
  };
133
589
  }
134
- }, mn = { class: "bind-event-dialog-content" }, pn = { class: "bind-dialog-footer" };
135
- function un(f, o, a, e, r, _) {
136
- const b = k("tiny-button"), c = k("tiny-dialog-box");
137
- return h(), O(c, {
590
+ }, bt = { class: "bind-event-dialog-content" }, Et = { class: "bind-dialog-footer" };
591
+ function yt(l, t, o, e, i, p) {
592
+ const g = L("tiny-button"), s = L("tiny-dialog-box");
593
+ return B(), te(s, {
138
594
  visible: e.dialogVisible,
139
595
  title: "事件绑定",
140
596
  width: "50%",
@@ -144,42 +600,42 @@ function un(f, o, a, e, r, _) {
144
600
  onClose: e.closeDialog,
145
601
  onOpened: e.openedDialog
146
602
  }, {
147
- footer: E(() => [
148
- t("div", pn, [
149
- u(b, { onClick: e.closeDialog }, {
150
- default: E(() => o[0] || (o[0] = [
151
- J("取 消")
603
+ footer: I(() => [
604
+ v("div", Et, [
605
+ E(g, { onClick: e.closeDialog }, {
606
+ default: I(() => t[0] || (t[0] = [
607
+ ke("取 消")
152
608
  ])),
153
609
  _: 1,
154
610
  __: [0]
155
611
  }, 8, ["onClick"]),
156
- u(b, {
612
+ E(g, {
157
613
  type: "info",
158
614
  onClick: e.confirm
159
615
  }, {
160
- default: E(() => o[1] || (o[1] = [
161
- J("确 定")
616
+ default: I(() => t[1] || (t[1] = [
617
+ ke("确 定")
162
618
  ])),
163
619
  _: 1,
164
620
  __: [1]
165
621
  }, 8, ["onClick"])
166
622
  ])
167
623
  ]),
168
- default: E(() => [
169
- o[2] || (o[2] = t("div", { class: "bind-event-dialog-tip" }, " 选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)。 ", -1)),
170
- t("div", mn, [
171
- (h(), O(_e(e.BindEventsDialogSidebar), {
624
+ default: I(() => [
625
+ t[2] || (t[2] = v("div", { class: "bind-event-dialog-tip" }, " 选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)。 ", -1)),
626
+ v("div", bt, [
627
+ (B(), te(Ge(e.BindEventsDialogSidebar), {
172
628
  dialogVisible: e.dialogVisible,
173
- eventBinding: a.eventBinding
629
+ eventBinding: o.eventBinding
174
630
  }, null, 8, ["dialogVisible", "eventBinding"])),
175
- (h(), O(_e(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
631
+ (B(), te(Ge(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
176
632
  ])
177
633
  ]),
178
634
  _: 1,
179
635
  __: [2]
180
636
  }, 8, ["visible", "onClose", "onOpened"]);
181
637
  }
182
- const fn = /* @__PURE__ */ H(cn, [["render", un], ["__scopeId", "data-v-db4b4d71"]]), vn = {
638
+ const De = /* @__PURE__ */ Ie(ht, [["render", yt], ["__scopeId", "data-v-faf29014"]]), at = {
183
639
  onClick: {
184
640
  label: {
185
641
  zh_CN: "点击事件"
@@ -236,120 +692,19 @@ const fn = /* @__PURE__ */ H(cn, [["render", un], ["__scopeId", "data-v-db4b4d71
236
692
  },
237
693
  defaultValue: ""
238
694
  }
239
- }, gn = [
240
- "onabort",
241
- "onafterprint",
242
- "onanimationend",
243
- "onanimationiteration",
244
- "onanimationstart",
245
- "onappinstalled",
246
- "onauxclick",
247
- "onbeforeinstallprompt",
248
- "onbeforeprint",
249
- "onbeforeunload",
250
- "onbeforexrselect",
251
- "onblur",
252
- "oncancel",
253
- "oncanplay",
254
- "oncanplaythrough",
255
- "onchange",
256
- "onclick",
257
- "onclose",
258
- "oncontextlost",
259
- "oncontextmenu",
260
- "oncontextrestored",
261
- "oncuechange",
262
- "ondblclick",
263
- "ondrag",
264
- "ondragend",
265
- "ondragenter",
266
- "ondragleave",
267
- "ondragover",
268
- "ondragstart",
269
- "ondrop",
270
- "ondurationchange",
271
- "onemptied",
272
- "onended",
273
- "onerror",
274
- "onfocus",
275
- "onformdata",
276
- "ongotpointercapture",
277
- "onhashchange",
278
- "oninput",
279
- "oninvalid",
280
- "onkeydown",
281
- "onkeypress",
282
- "onkeyup",
283
- "onlanguagechange",
284
- "onload",
285
- "onloadeddata",
286
- "onloadedmetadata",
287
- "onloadstart",
288
- "onlostpointercapture",
289
- "onmessage",
290
- "onmessageerror",
291
- "onmousedown",
292
- "onmouseenter",
293
- "onmouseleave",
294
- "onmousemove",
295
- "onmouseout",
296
- "onmouseover",
297
- "onmouseup",
298
- "onmousewheel",
299
- "onoffline",
300
- "ononline",
301
- "onpagehide",
302
- "onpageshow",
303
- "onpause",
304
- "onplay",
305
- "onplaying",
306
- "onpointercancel",
307
- "onpointerdown",
308
- "onpointerenter",
309
- "onpointerleave",
310
- "onpointermove",
311
- "onpointerout",
312
- "onpointerover",
313
- "onpointerrawupdate",
314
- "onpointerup",
315
- "onpopstate",
316
- "onprogress",
317
- "onratechange",
318
- "onrejectionhandled",
319
- "onreset",
320
- "onresize",
321
- "onscroll",
322
- "onsearch",
323
- "onsecuritypolicyviolation",
324
- "onseeked",
325
- "onseeking",
326
- "onselect",
327
- "onselectionchange",
328
- "onselectstart",
329
- "onslotchange",
330
- "onstalled",
331
- "onstorage",
332
- "onsubmit",
333
- "onsuspend",
334
- "ontimeupdate",
335
- "ontoggle",
336
- "ontransitioncancel",
337
- "ontransitionend",
338
- "ontransitionrun",
339
- "ontransitionstart",
340
- "onunhandledrejection",
341
- "onunload",
342
- "onvolumechange",
343
- "onwaiting",
344
- "onwebkitanimationend",
345
- "onwebkitanimationiteration",
346
- "onwebkitanimationstart",
347
- "onwebkittransitionend",
348
- "onwheel"
349
- ], _n = (f) => !!gn.map((a) => {
350
- const e = a[2].toUpperCase();
351
- return `${a.substring(0, 2)}${e}${a.substring(3)}`;
352
- }).includes(f), bn = { class: "footer" }, hn = {
695
+ }, et = ["onabort", "onafterprint", "onanimationend", "onanimationiteration", "onanimationstart", "onappinstalled", "onauxclick", "onbeforeinstallprompt", "onbeforeprint", "onbeforeunload", "onbeforexrselect", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextlost", "oncontextmenu", "oncontextrestored", "oncuechange", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "onformdata", "ongotpointercapture", "onhashchange", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onlanguagechange", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onlostpointercapture", "onmessage", "onmessageerror", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onoffline", "ononline", "onpagehide", "onpageshow", "onpause", "onplay", "onplaying", "onpointercancel", "onpointerdown", "onpointerenter", "onpointerleave", "onpointermove", "onpointerout", "onpointerover", "onpointerrawupdate", "onpointerup", "onpopstate", "onprogress", "onratechange", "onrejectionhandled", "onreset", "onresize", "onscroll", "onsearch", "onsecuritypolicyviolation", "onseeked", "onseeking", "onselect", "onselectionchange", "onselectstart", "onslotchange", "onstalled", "onstorage", "onsubmit", "onsuspend", "ontimeupdate", "ontoggle", "ontransitioncancel", "ontransitionend", "ontransitionrun", "ontransitionstart", "onunhandledrejection", "onunload", "onvolumechange", "onwaiting", "onwebkitanimationend", "onwebkitanimationiteration", "onwebkitanimationstart", "onwebkittransitionend", "onwheel"], Pe = h((l) => !!et.map((o) => {
696
+ const e = o[2].toUpperCase();
697
+ return `${o.substring(0, 2)}${e}${o.substring(3)}`;
698
+ }).includes(l), {
699
+ metaData: {
700
+ id: "engine.setting.event.commonjs-events.checkEvent"
701
+ },
702
+ ctx: () => ({
703
+ commonEvents: at,
704
+ allEvents: et,
705
+ checkEvent: Pe
706
+ })
707
+ }), xt = { class: "footer" }, Dt = {
353
708
  __name: "AddEventsDialog",
354
709
  props: {
355
710
  visible: {
@@ -362,108 +717,157 @@ const fn = /* @__PURE__ */ H(cn, [["render", un], ["__scopeId", "data-v-db4b4d71
362
717
  }
363
718
  },
364
719
  emits: ["closeDialog", "addEvent"],
365
- setup(f, { emit: o }) {
366
- const a = f, e = o, r = Y({
720
+ setup(l, { emit: t }) {
721
+ const o = l, e = t, i = we({
367
722
  eventDescription: "",
368
723
  eventName: ""
369
- }), _ = K(null), c = {
370
- eventDescription: [
371
- {
372
- required: !0,
373
- message: "必填"
374
- }
375
- ],
376
- eventName: [
377
- { required: !0, message: "必填" },
378
- {
379
- validator: (x, n, l) => {
380
- if (a.componentEvents[r.eventName]) {
381
- l(new Error("事件名已存在"));
382
- return;
383
- }
384
- if (!_n(r.eventName)) {
385
- l(new Error("请输入正确的浏览器事件名"));
386
- return;
387
- }
388
- l();
389
- }
390
- }
391
- ]
392
- }, p = () => {
724
+ }), p = Ve(null), g = h((u, n, c) => {
725
+ if (o.componentEvents[i.eventName]) {
726
+ c(new Error("事件名已存在"));
727
+ return;
728
+ }
729
+ if (!Pe(i.eventName)) {
730
+ c(new Error("请输入正确的浏览器事件名"));
731
+ return;
732
+ }
733
+ c();
734
+ }, {
735
+ metaData: {
736
+ id: "engine.setting.event.AddEventsDialog.eventNameValidator"
737
+ },
738
+ ctx: () => ({
739
+ checkEvent: Pe,
740
+ props: o,
741
+ emits: e,
742
+ formData: i,
743
+ ruleForm: p,
744
+ eventNameValidator: g,
745
+ rules: s,
746
+ closeDialog: r,
747
+ addMethod: a
748
+ })
749
+ }), s = {
750
+ eventDescription: [{
751
+ required: !0,
752
+ message: "必填"
753
+ }],
754
+ eventName: [{
755
+ required: !0,
756
+ message: "必填"
757
+ }, {
758
+ validator: g
759
+ }]
760
+ }, r = h(() => {
393
761
  e("closeDialog");
394
- }, s = () => {
395
- _.value && _.value.validate((x) => {
396
- if (!x)
762
+ }, {
763
+ metaData: {
764
+ id: "engine.setting.event.AddEventsDialog.closeDialog"
765
+ },
766
+ ctx: () => ({
767
+ checkEvent: Pe,
768
+ props: o,
769
+ emits: e,
770
+ formData: i,
771
+ ruleForm: p,
772
+ eventNameValidator: g,
773
+ rules: s,
774
+ closeDialog: r,
775
+ addMethod: a
776
+ })
777
+ }), a = h(() => {
778
+ p.value && p.value.validate((u) => {
779
+ if (!u)
397
780
  return;
398
- const { eventName: n, eventDescription: l } = r;
399
- e("addEvent", { eventName: n, eventDescription: l });
781
+ const {
782
+ eventName: n,
783
+ eventDescription: c
784
+ } = i;
785
+ e("addEvent", {
786
+ eventName: n,
787
+ eventDescription: c
788
+ });
400
789
  });
401
- };
402
- return (x, n) => (h(), O(D(De), {
403
- visible: f.visible,
790
+ }, {
791
+ metaData: {
792
+ id: "engine.setting.event.AddEventsDialog.addMethod"
793
+ },
794
+ ctx: () => ({
795
+ checkEvent: Pe,
796
+ props: o,
797
+ emits: e,
798
+ formData: i,
799
+ ruleForm: p,
800
+ eventNameValidator: g,
801
+ rules: s,
802
+ closeDialog: r,
803
+ addMethod: a
804
+ })
805
+ });
806
+ return (u, n) => (B(), te(S(it), {
807
+ visible: l.visible,
404
808
  title: "添加新事件",
405
809
  width: "400px",
406
810
  "append-to-body": !0,
407
811
  "close-on-click-modal": !1,
408
- onClose: p
812
+ onClose: S(r)
409
813
  }, {
410
- footer: E(() => [
411
- t("div", bn, [
412
- u(D(ee), { onClick: p }, {
413
- default: E(() => n[2] || (n[2] = [
414
- J(" 取消")
814
+ footer: I(() => [
815
+ v("div", xt, [
816
+ E(S(Te), { onClick: S(r) }, {
817
+ default: I(() => n[2] || (n[2] = [
818
+ ke(" 取消")
415
819
  ])),
416
820
  _: 1,
417
821
  __: [2]
418
- }),
419
- u(D(ee), {
822
+ }, 8, ["onClick"]),
823
+ E(S(Te), {
420
824
  type: "primary",
421
- onClick: s
825
+ onClick: S(a)
422
826
  }, {
423
- default: E(() => n[3] || (n[3] = [
424
- J(" 确定")
827
+ default: I(() => n[3] || (n[3] = [
828
+ ke(" 确定")
425
829
  ])),
426
830
  _: 1,
427
831
  __: [3]
428
- })
832
+ }, 8, ["onClick"])
429
833
  ])
430
834
  ]),
431
- default: E(() => [
432
- u(D(Te), {
835
+ default: I(() => [
836
+ E(S(mt), {
433
837
  ref_key: "ruleForm",
434
- ref: _,
435
- model: r,
436
- rules: c,
838
+ ref: p,
839
+ model: i,
840
+ rules: s,
437
841
  "label-width": "80px",
438
842
  "inline-message": !0,
439
843
  "validate-type": "text",
440
844
  "label-position": "left",
441
845
  class: "add-custom-event-form"
442
846
  }, {
443
- default: E(() => [
444
- u(D(Ee), {
847
+ default: I(() => [
848
+ E(S(We), {
445
849
  label: "事件函数名",
446
850
  prop: "eventName",
447
851
  required: ""
448
852
  }, {
449
- default: E(() => [
450
- u(D(le), {
451
- modelValue: r.eventName,
452
- "onUpdate:modelValue": n[0] || (n[0] = (l) => r.eventName = l),
853
+ default: I(() => [
854
+ E(S(Fe), {
855
+ modelValue: i.eventName,
856
+ "onUpdate:modelValue": n[0] || (n[0] = (c) => i.eventName = c),
453
857
  placeholder: "小驼峰格式,如:onDrag"
454
858
  }, null, 8, ["modelValue"])
455
859
  ]),
456
860
  _: 1
457
861
  }),
458
- u(D(Ee), {
862
+ E(S(We), {
459
863
  label: "事件描述",
460
864
  prop: "eventDescription",
461
865
  required: ""
462
866
  }, {
463
- default: E(() => [
464
- u(D(le), {
465
- modelValue: r.eventDescription,
466
- "onUpdate:modelValue": n[1] || (n[1] = (l) => r.eventDescription = l)
867
+ default: I(() => [
868
+ E(S(Fe), {
869
+ modelValue: i.eventDescription,
870
+ "onUpdate:modelValue": n[1] || (n[1] = (c) => i.eventDescription = c)
467
871
  }, null, 8, ["modelValue"])
468
872
  ]),
469
873
  _: 1
@@ -473,114 +877,405 @@ const fn = /* @__PURE__ */ H(cn, [["render", un], ["__scopeId", "data-v-db4b4d71
473
877
  }, 8, ["model"])
474
878
  ]),
475
879
  _: 1
476
- }, 8, ["visible"]));
880
+ }, 8, ["visible", "onClose"]));
477
881
  }
478
- }, yn = /* @__PURE__ */ H(hn, [["__scopeId", "data-v-5033228a"]]), En = {
882
+ }, Ce = /* @__PURE__ */ Ie(Dt, [["__scopeId", "data-v-2ed7fac6"]]), Ct = {
479
883
  components: {
480
- BlockLinkEvent: Ze,
481
- BindEventsDialog: fn,
482
- TinyPopover: Ue,
483
- TinyButton: ee,
484
- IconChevronDown: en(),
485
- SvgButton: Ye,
486
- AddEventsDialog: yn
884
+ BlockLinkEvent: ye,
885
+ BindEventsDialog: De,
886
+ TinyPopover: gt,
887
+ TinyButton: Te,
888
+ IconChevronDown: xe(),
889
+ SvgButton: Ee,
890
+ AddEventsDialog: Ce
487
891
  },
488
892
  inheritAttrs: !1,
489
893
  setup() {
490
- const { PLUGIN_NAME: f, activePlugin: o } = re(), { pageState: a } = j(), { getBlockEvents: e, getCurrentBlock: r, removeEventLink: _ } = Xe(), { getMaterial: b } = Ke(), { confirm: c } = He(), p = qe.global.locale.value, { highlightMethod: s } = ne(oe.Page), { commonEvents: x = {} } = Ie("engine.setting.event").options, n = Y({
894
+ const {
895
+ PLUGIN_NAME: l,
896
+ activePlugin: t
897
+ } = V(), {
898
+ pageState: o
899
+ } = y(), {
900
+ getBlockEvents: e,
901
+ getCurrentBlock: i,
902
+ removeEventLink: p
903
+ } = ue(), {
904
+ getMaterial: g
905
+ } = fe(), {
906
+ confirm: s
907
+ } = _e(), r = be.global.locale.value, {
908
+ highlightMethod: a
909
+ } = k(C.Page), {
910
+ commonEvents: u = {}
911
+ } = P("engine.setting.event").options, n = we({
491
912
  eventName: "",
492
913
  // 事件名称
493
914
  eventBinding: null,
494
915
  // 事件绑定的处理方法对象
495
916
  componentEvent: {},
496
- customEvents: x,
917
+ customEvents: u,
497
918
  bindActions: {},
498
919
  showBindEventDialog: !1
499
- }), l = q(() => !!a.isBlock), i = q(() => Object.keys(n.bindActions).length === 0), d = q(() => ({ ...n.componentEvent, ...n.customEvents }));
500
- Ne(() => {
501
- var M, P, S, T, U;
502
- const m = (M = a == null ? void 0 : a.currentSchema) == null ? void 0 : M.componentName, v = b(m);
503
- n.componentEvent = ((S = (P = v == null ? void 0 : v.content) == null ? void 0 : P.schema) == null ? void 0 : S.events) || ((T = v == null ? void 0 : v.schema) == null ? void 0 : T.events) || {};
504
- const C = ((U = a == null ? void 0 : a.currentSchema) == null ? void 0 : U.props) || {}, w = Object.keys(C);
505
- n.bindActions = {}, Object.entries(d.value).forEach(([L, Z]) => {
506
- var N, ie, me;
507
- if (w.indexOf(L) > -1) {
508
- const Me = C[L], { value: we, params: pe } = Me, Le = !pe && ((ie = (N = we.match(/\((.+)\)$/)) == null ? void 0 : N[1]) == null ? void 0 : ie.split(",")) || pe, z = {
509
- eventName: L,
920
+ }), c = Me(() => !!o.isBlock), d = Me(() => Object.keys(n.bindActions).length === 0), m = Me(() => ({
921
+ ...n.componentEvent,
922
+ ...n.customEvents
923
+ }));
924
+ nt(() => {
925
+ var Z, q, ne, oe, ie;
926
+ const _ = (Z = o == null ? void 0 : o.currentSchema) == null ? void 0 : Z.componentName, A = g(_);
927
+ n.componentEvent = ((ne = (q = A == null ? void 0 : A.content) == null ? void 0 : q.schema) == null ? void 0 : ne.events) || ((oe = A == null ? void 0 : A.schema) == null ? void 0 : oe.events) || {};
928
+ const O = ((ie = o == null ? void 0 : o.currentSchema) == null ? void 0 : ie.props) || {}, W = Object.keys(O);
929
+ n.bindActions = {}, Object.entries(m.value).forEach(([Q, Le]) => {
930
+ var T, Ue, Re;
931
+ if (W.indexOf(Q) > -1) {
932
+ const st = O[Q], {
933
+ value: lt,
934
+ params: Je
935
+ } = st, dt = !Je && ((Ue = (T = lt.match(/\((.+)\)$/)) == null ? void 0 : T[1]) == null ? void 0 : Ue.split(",")) || Je, pe = {
936
+ eventName: Q,
510
937
  ref: "",
511
- event: C[L],
512
- params: Le
938
+ event: O[Q],
939
+ params: dt
513
940
  };
514
- if (z.event.type === "JSExpression" && (z.ref = z.event.value.replace("this.", "").replace(/\(.*\)$/, "")), a.isBlock) {
515
- z.metaEvent = Z;
516
- const ue = e(r()), fe = (me = a == null ? void 0 : a.currentSchema) == null ? void 0 : me.id;
517
- fe && ue && Object.entries(ue).forEach(([Oe, R]) => {
518
- var ve, ge;
519
- fe === ((ve = R == null ? void 0 : R.linked) == null ? void 0 : ve.id) && L === ((ge = R == null ? void 0 : R.linked) == null ? void 0 : ge.event) && (z.linked = R.linked, z.linkedEventName = Oe);
941
+ if (pe.event.type === "JSExpression" && (pe.ref = pe.event.value.replace("this.", "").replace(/\(.*\)$/, "")), o.isBlock) {
942
+ pe.metaEvent = Le;
943
+ const $e = e(i()), Xe = (Re = o == null ? void 0 : o.currentSchema) == null ? void 0 : Re.id;
944
+ Xe && $e && Object.entries($e).forEach(([rt, ve]) => {
945
+ var Ke, He;
946
+ Xe === ((Ke = ve == null ? void 0 : ve.linked) == null ? void 0 : Ke.id) && Q === ((He = ve == null ? void 0 : ve.linked) == null ? void 0 : He.event) && (pe.linked = ve.linked, pe.linkedEventName = rt);
520
947
  });
521
948
  }
522
- n.bindActions[L] = z;
949
+ n.bindActions[Q] = pe;
523
950
  }
524
951
  });
525
952
  });
526
- const y = (m, v) => {
527
- v && n.bindActions[m.eventName] || (n.eventBinding = m, rn());
528
- }, V = (m) => {
529
- var C;
530
- Object.keys(((C = a == null ? void 0 : a.currentSchema) == null ? void 0 : C.props) || {}).indexOf(m.eventName) > -1 && (delete a.currentSchema.props[m.eventName], Ge().publish({ topic: "schemaChange", data: { props: a.currentSchema.props } }));
531
- };
532
- return {
533
- state: n,
534
- isBlock: l,
535
- isEmpty: i,
536
- delEvent: (m) => {
537
- c({
538
- title: "提示",
539
- message: `您确定要删除事件 ${m.eventName} 吗?`,
540
- exec() {
541
- a.isBlock && _({ linked: m.linked }), V(m);
542
- }
543
- });
953
+ const f = h((_, A) => {
954
+ A && n.bindActions[_.eventName] || (n.eventBinding = _, w());
955
+ }, {
956
+ metaData: {
957
+ id: "engine.setting.event.BindEvents.openActionDialog"
544
958
  },
545
- openCodePanel: (m) => {
546
- m && o(f.Page).then(() => {
547
- s && s(m.ref);
548
- });
959
+ ctx: () => ({
960
+ PLUGIN_NAME: l,
961
+ activePlugin: t,
962
+ pageState: o,
963
+ getBlockEvents: e,
964
+ getCurrentBlock: i,
965
+ removeEventLink: p,
966
+ getMaterial: g,
967
+ confirm: s,
968
+ locale: r,
969
+ highlightMethod: a,
970
+ commonEvents: u,
971
+ state: n,
972
+ isBlock: c,
973
+ isEmpty: d,
974
+ renderEventList: m,
975
+ openActionDialog: f,
976
+ deleteAction: x,
977
+ delEvent: D,
978
+ openCodePanel: N,
979
+ handleToggleAddEventDialog: M,
980
+ handleAddEvent: b,
981
+ useModal: _e,
982
+ getMergeMeta: P,
983
+ useCanvas: y,
984
+ useLayout: V,
985
+ useBlock: ue,
986
+ useMaterial: fe,
987
+ getMetaApi: k,
988
+ META_APP: C,
989
+ useMessage: he,
990
+ i18n: be,
991
+ BlockLinkEvent: ye,
992
+ SvgButton: Ee,
993
+ iconChevronDown: xe,
994
+ BindEventsDialog: De,
995
+ openDialog: w,
996
+ AddEventsDialog: Ce
997
+ })
998
+ }), x = h((_) => {
999
+ var O;
1000
+ Object.keys(((O = o == null ? void 0 : o.currentSchema) == null ? void 0 : O.props) || {}).indexOf(_.eventName) > -1 && (delete o.currentSchema.props[_.eventName], he().publish({
1001
+ topic: "schemaChange",
1002
+ data: {
1003
+ props: o.currentSchema.props
1004
+ }
1005
+ }));
1006
+ }, {
1007
+ metaData: {
1008
+ id: "engine.setting.event.BindEvents.deleteAction"
549
1009
  },
550
- openActionDialog: y,
551
- handleAddEvent: (m) => {
552
- const { eventName: v, eventDescription: C } = m;
553
- Object.assign(n.customEvents, {
554
- [v]: {
555
- label: {
556
- zh_CN: C
557
- },
558
- description: {
559
- zh_CN: `${C}的回调函数`
560
- },
561
- type: "event",
562
- functionInfo: {
563
- params: [],
564
- returns: {}
565
- },
566
- defaultValue: ""
567
- }
568
- }), n.showBindEventDialog = !1;
1010
+ ctx: () => ({
1011
+ PLUGIN_NAME: l,
1012
+ activePlugin: t,
1013
+ pageState: o,
1014
+ getBlockEvents: e,
1015
+ getCurrentBlock: i,
1016
+ removeEventLink: p,
1017
+ getMaterial: g,
1018
+ confirm: s,
1019
+ locale: r,
1020
+ highlightMethod: a,
1021
+ commonEvents: u,
1022
+ state: n,
1023
+ isBlock: c,
1024
+ isEmpty: d,
1025
+ renderEventList: m,
1026
+ openActionDialog: f,
1027
+ deleteAction: x,
1028
+ delEvent: D,
1029
+ openCodePanel: N,
1030
+ handleToggleAddEventDialog: M,
1031
+ handleAddEvent: b,
1032
+ useModal: _e,
1033
+ getMergeMeta: P,
1034
+ useCanvas: y,
1035
+ useLayout: V,
1036
+ useBlock: ue,
1037
+ useMaterial: fe,
1038
+ getMetaApi: k,
1039
+ META_APP: C,
1040
+ useMessage: he,
1041
+ i18n: be,
1042
+ BlockLinkEvent: ye,
1043
+ SvgButton: Ee,
1044
+ iconChevronDown: xe,
1045
+ BindEventsDialog: De,
1046
+ openDialog: w,
1047
+ AddEventsDialog: Ce
1048
+ })
1049
+ }), D = h((_) => {
1050
+ s({
1051
+ title: "提示",
1052
+ message: `您确定要删除事件 ${_.eventName} 吗?`,
1053
+ exec() {
1054
+ o.isBlock && p({
1055
+ linked: _.linked
1056
+ }), x(_);
1057
+ }
1058
+ });
1059
+ }, {
1060
+ metaData: {
1061
+ id: "engine.setting.event.BindEvents.delEvent"
1062
+ },
1063
+ ctx: () => ({
1064
+ PLUGIN_NAME: l,
1065
+ activePlugin: t,
1066
+ pageState: o,
1067
+ getBlockEvents: e,
1068
+ getCurrentBlock: i,
1069
+ removeEventLink: p,
1070
+ getMaterial: g,
1071
+ confirm: s,
1072
+ locale: r,
1073
+ highlightMethod: a,
1074
+ commonEvents: u,
1075
+ state: n,
1076
+ isBlock: c,
1077
+ isEmpty: d,
1078
+ renderEventList: m,
1079
+ openActionDialog: f,
1080
+ deleteAction: x,
1081
+ delEvent: D,
1082
+ openCodePanel: N,
1083
+ handleToggleAddEventDialog: M,
1084
+ handleAddEvent: b,
1085
+ useModal: _e,
1086
+ getMergeMeta: P,
1087
+ useCanvas: y,
1088
+ useLayout: V,
1089
+ useBlock: ue,
1090
+ useMaterial: fe,
1091
+ getMetaApi: k,
1092
+ META_APP: C,
1093
+ useMessage: he,
1094
+ i18n: be,
1095
+ BlockLinkEvent: ye,
1096
+ SvgButton: Ee,
1097
+ iconChevronDown: xe,
1098
+ BindEventsDialog: De,
1099
+ openDialog: w,
1100
+ AddEventsDialog: Ce
1101
+ })
1102
+ }), N = h((_) => {
1103
+ _ && t(l.Page).then(() => {
1104
+ a && a(_.ref);
1105
+ });
1106
+ }, {
1107
+ metaData: {
1108
+ id: "engine.setting.event.BindEvents.openCodePanel"
1109
+ },
1110
+ ctx: () => ({
1111
+ PLUGIN_NAME: l,
1112
+ activePlugin: t,
1113
+ pageState: o,
1114
+ getBlockEvents: e,
1115
+ getCurrentBlock: i,
1116
+ removeEventLink: p,
1117
+ getMaterial: g,
1118
+ confirm: s,
1119
+ locale: r,
1120
+ highlightMethod: a,
1121
+ commonEvents: u,
1122
+ state: n,
1123
+ isBlock: c,
1124
+ isEmpty: d,
1125
+ renderEventList: m,
1126
+ openActionDialog: f,
1127
+ deleteAction: x,
1128
+ delEvent: D,
1129
+ openCodePanel: N,
1130
+ handleToggleAddEventDialog: M,
1131
+ handleAddEvent: b,
1132
+ useModal: _e,
1133
+ getMergeMeta: P,
1134
+ useCanvas: y,
1135
+ useLayout: V,
1136
+ useBlock: ue,
1137
+ useMaterial: fe,
1138
+ getMetaApi: k,
1139
+ META_APP: C,
1140
+ useMessage: he,
1141
+ i18n: be,
1142
+ BlockLinkEvent: ye,
1143
+ SvgButton: Ee,
1144
+ iconChevronDown: xe,
1145
+ BindEventsDialog: De,
1146
+ openDialog: w,
1147
+ AddEventsDialog: Ce
1148
+ })
1149
+ }), M = h((_) => {
1150
+ n.showBindEventDialog = _;
1151
+ }, {
1152
+ metaData: {
1153
+ id: "engine.setting.event.BindEvents.handleToggleAddEventDialog"
569
1154
  },
570
- handleToggleAddEventDialog: (m) => {
571
- n.showBindEventDialog = m;
1155
+ ctx: () => ({
1156
+ PLUGIN_NAME: l,
1157
+ activePlugin: t,
1158
+ pageState: o,
1159
+ getBlockEvents: e,
1160
+ getCurrentBlock: i,
1161
+ removeEventLink: p,
1162
+ getMaterial: g,
1163
+ confirm: s,
1164
+ locale: r,
1165
+ highlightMethod: a,
1166
+ commonEvents: u,
1167
+ state: n,
1168
+ isBlock: c,
1169
+ isEmpty: d,
1170
+ renderEventList: m,
1171
+ openActionDialog: f,
1172
+ deleteAction: x,
1173
+ delEvent: D,
1174
+ openCodePanel: N,
1175
+ handleToggleAddEventDialog: M,
1176
+ handleAddEvent: b,
1177
+ useModal: _e,
1178
+ getMergeMeta: P,
1179
+ useCanvas: y,
1180
+ useLayout: V,
1181
+ useBlock: ue,
1182
+ useMaterial: fe,
1183
+ getMetaApi: k,
1184
+ META_APP: C,
1185
+ useMessage: he,
1186
+ i18n: be,
1187
+ BlockLinkEvent: ye,
1188
+ SvgButton: Ee,
1189
+ iconChevronDown: xe,
1190
+ BindEventsDialog: De,
1191
+ openDialog: w,
1192
+ AddEventsDialog: Ce
1193
+ })
1194
+ }), b = h((_) => {
1195
+ const {
1196
+ eventName: A,
1197
+ eventDescription: O
1198
+ } = _;
1199
+ Object.assign(n.customEvents, {
1200
+ [A]: {
1201
+ label: {
1202
+ zh_CN: O
1203
+ },
1204
+ description: {
1205
+ zh_CN: `${O}的回调函数`
1206
+ },
1207
+ type: "event",
1208
+ functionInfo: {
1209
+ params: [],
1210
+ returns: {}
1211
+ },
1212
+ defaultValue: ""
1213
+ }
1214
+ }), n.showBindEventDialog = !1;
1215
+ }, {
1216
+ metaData: {
1217
+ id: "engine.setting.event.BindEvents.handleAddEvent"
572
1218
  },
573
- renderEventList: d,
574
- locale: p
1219
+ ctx: () => ({
1220
+ PLUGIN_NAME: l,
1221
+ activePlugin: t,
1222
+ pageState: o,
1223
+ getBlockEvents: e,
1224
+ getCurrentBlock: i,
1225
+ removeEventLink: p,
1226
+ getMaterial: g,
1227
+ confirm: s,
1228
+ locale: r,
1229
+ highlightMethod: a,
1230
+ commonEvents: u,
1231
+ state: n,
1232
+ isBlock: c,
1233
+ isEmpty: d,
1234
+ renderEventList: m,
1235
+ openActionDialog: f,
1236
+ deleteAction: x,
1237
+ delEvent: D,
1238
+ openCodePanel: N,
1239
+ handleToggleAddEventDialog: M,
1240
+ handleAddEvent: b,
1241
+ useModal: _e,
1242
+ getMergeMeta: P,
1243
+ useCanvas: y,
1244
+ useLayout: V,
1245
+ useBlock: ue,
1246
+ useMaterial: fe,
1247
+ getMetaApi: k,
1248
+ META_APP: C,
1249
+ useMessage: he,
1250
+ i18n: be,
1251
+ BlockLinkEvent: ye,
1252
+ SvgButton: Ee,
1253
+ iconChevronDown: xe,
1254
+ BindEventsDialog: De,
1255
+ openDialog: w,
1256
+ AddEventsDialog: Ce
1257
+ })
1258
+ });
1259
+ return {
1260
+ state: n,
1261
+ isBlock: c,
1262
+ isEmpty: d,
1263
+ delEvent: D,
1264
+ openCodePanel: N,
1265
+ openActionDialog: f,
1266
+ handleAddEvent: b,
1267
+ handleToggleAddEventDialog: M,
1268
+ renderEventList: m,
1269
+ locale: r
575
1270
  };
576
1271
  }
577
- }, xn = { class: "bind-action-list" }, kn = { class: "popover-head" }, Cn = { class: "bind-event-list" }, Vn = ["onClick"], Nn = { class: "bind-actions" }, An = { class: "action-item bind-action-item" }, Dn = ["onClick"], In = { class: "event-bind" }, Pn = { class: "action-buttons" }, Bn = { class: "empty-action" }, Mn = { class: "icon" };
578
- function wn(f, o, a, e, r, _) {
579
- const b = k("icon-chevron-down"), c = k("tiny-button"), p = k("tiny-popover"), s = k("svg-icon"), x = k("block-link-event"), n = k("svg-button"), l = k("bind-events-dialog"), i = k("add-events-dialog");
580
- return h(), A(W, null, [
581
- t("div", xn, [
582
- t("div", kn, [
583
- u(p, {
1272
+ }, kt = { class: "bind-action-list" }, At = { class: "popover-head" }, Bt = { class: "bind-event-list" }, Nt = ["onClick"], Vt = { class: "bind-actions" }, It = { class: "action-item bind-action-item" }, Pt = ["onClick"], Mt = { class: "event-bind" }, wt = { class: "action-buttons" }, Lt = { class: "empty-action" }, Ot = { class: "icon" };
1273
+ function St(l, t, o, e, i, p) {
1274
+ const g = L("icon-chevron-down"), s = L("tiny-button"), r = L("tiny-popover"), a = L("svg-icon"), u = L("block-link-event"), n = L("svg-button"), c = L("bind-events-dialog"), d = L("add-events-dialog");
1275
+ return B(), $(Oe, null, [
1276
+ v("div", kt, [
1277
+ v("div", At, [
1278
+ E(r, {
584
1279
  popperClass: "option-popper setting-advanced-bind-event-list",
585
1280
  placement: "bottom-start",
586
1281
  trigger: "hover",
@@ -588,318 +1283,577 @@ function wn(f, o, a, e, r, _) {
588
1283
  width: "256",
589
1284
  "visible-arrow": !1
590
1285
  }, {
591
- reference: E(() => [
592
- u(c, { class: "bind-event-btn" }, {
593
- default: E(() => [
594
- o[2] || (o[2] = t("span", null, "绑定事件", -1)),
595
- u(b, { class: "icon-chevron-down bind-event-btn-icon" })
1286
+ reference: I(() => [
1287
+ E(s, { class: "bind-event-btn" }, {
1288
+ default: I(() => [
1289
+ t[2] || (t[2] = v("span", null, "绑定事件", -1)),
1290
+ E(g, { class: "icon-chevron-down bind-event-btn-icon" })
596
1291
  ]),
597
1292
  _: 1,
598
1293
  __: [2]
599
1294
  })
600
1295
  ]),
601
- default: E(() => [
602
- t("ul", Cn, [
603
- (h(!0), A(W, null, ae(e.renderEventList, (d, y) => {
604
- var V;
605
- return h(), A("li", {
606
- key: y,
607
- class: X(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[y] }]),
608
- onClick: (I) => e.openActionDialog({ eventName: y }, !0)
1296
+ default: I(() => [
1297
+ v("ul", Bt, [
1298
+ (B(!0), $(Oe, null, ze(e.renderEventList, (m, f) => {
1299
+ var x;
1300
+ return B(), $("li", {
1301
+ key: f,
1302
+ class: Ne(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[f] }]),
1303
+ onClick: (D) => e.openActionDialog({ eventName: f }, !0)
609
1304
  }, [
610
- t("div", null, B(y) + "  |  " + B(((V = d == null ? void 0 : d.label) == null ? void 0 : V[e.locale]) || y), 1)
611
- ], 10, Vn);
1305
+ v("div", null, Y(f) + "  |  " + Y(((x = m == null ? void 0 : m.label) == null ? void 0 : x[e.locale]) || f), 1)
1306
+ ], 10, Nt);
612
1307
  }), 128))
613
1308
  ])
614
1309
  ]),
615
1310
  _: 1
616
1311
  }),
617
- u(c, {
1312
+ E(s, {
618
1313
  class: "title add-custom-event-button bind-action-button-item",
619
- onClick: o[0] || (o[0] = (d) => e.handleToggleAddEventDialog(!0))
1314
+ onClick: t[0] || (t[0] = (m) => e.handleToggleAddEventDialog(!0))
620
1315
  }, {
621
- default: E(() => [
622
- u(s, {
1316
+ default: I(() => [
1317
+ E(a, {
623
1318
  name: "add",
624
1319
  class: "custom-event-button-icon"
625
1320
  }),
626
- o[3] || (o[3] = t("span", { class: "custom-event-button-text" }, "添加新事件", -1))
1321
+ t[3] || (t[3] = v("span", { class: "custom-event-button-text" }, "添加新事件", -1))
627
1322
  ]),
628
1323
  _: 1,
629
1324
  __: [3]
630
1325
  })
631
1326
  ]),
632
- be(t("ul", Nn, [
633
- (h(!0), A(W, null, ae(e.state.bindActions, (d) => {
634
- var y, V;
635
- return h(), A("li", {
636
- key: d.eventName
1327
+ qe(v("ul", Vt, [
1328
+ (B(!0), $(Oe, null, ze(e.state.bindActions, (m) => {
1329
+ var f, x;
1330
+ return B(), $("li", {
1331
+ key: m.eventName
637
1332
  }, [
638
- t("div", An, [
639
- t("div", {
1333
+ v("div", It, [
1334
+ v("div", {
640
1335
  class: "binding-name",
641
- onClick: (I) => e.openActionDialog(d)
1336
+ onClick: (D) => e.openActionDialog(m)
642
1337
  }, [
643
- t("div", null, [
644
- J(B(d.eventName), 1),
645
- t("span", null, B((V = (y = e.renderEventList[d.eventName]) == null ? void 0 : y.label) == null ? void 0 : V[e.locale]), 1)
1338
+ v("div", null, [
1339
+ ke(Y(m.eventName), 1),
1340
+ v("span", null, Y((x = (f = e.renderEventList[m.eventName]) == null ? void 0 : f.label) == null ? void 0 : x[e.locale]), 1)
646
1341
  ]),
647
- t("div", {
648
- class: X({ linked: d.linked })
649
- }, B(d.linkedEventName), 3),
650
- t("span", In, B(d.ref), 1)
651
- ], 8, Dn),
652
- t("div", Pn, [
653
- e.isBlock ? (h(), O(x, {
1342
+ v("div", {
1343
+ class: Ne({ linked: m.linked })
1344
+ }, Y(m.linkedEventName), 3),
1345
+ v("span", Mt, Y(m.ref), 1)
1346
+ ], 8, Pt),
1347
+ v("div", wt, [
1348
+ e.isBlock ? (B(), te(u, {
654
1349
  key: 0,
655
- data: d
656
- }, null, 8, ["data"])) : Q("", !0),
657
- u(n, {
1350
+ data: m
1351
+ }, null, 8, ["data"])) : Se("", !0),
1352
+ E(n, {
658
1353
  name: "plugin-icon-page-schema",
659
1354
  tips: "定位到代码",
660
1355
  placement: "top",
661
1356
  hoverBgColor: !1,
662
- onClick: (I) => e.openCodePanel(d)
1357
+ onClick: (D) => e.openCodePanel(m)
663
1358
  }, null, 8, ["onClick"]),
664
- u(n, {
1359
+ E(n, {
665
1360
  name: "setting",
666
1361
  hoverBgColor: !1,
667
- onClick: (I) => e.openActionDialog(d, !1)
1362
+ onClick: (D) => e.openActionDialog(m, !1)
668
1363
  }, null, 8, ["onClick"]),
669
- u(n, {
1364
+ E(n, {
670
1365
  name: "delete",
671
1366
  hoverBgColor: !1,
672
- onClick: (I) => e.delEvent(d)
1367
+ onClick: (D) => e.delEvent(m)
673
1368
  }, null, 8, ["onClick"])
674
1369
  ])
675
1370
  ])
676
1371
  ]);
677
1372
  }), 128))
678
1373
  ], 512), [
679
- [he, !e.isEmpty]
1374
+ [Ye, !e.isEmpty]
680
1375
  ]),
681
- be(t("div", Bn, [
682
- t("div", Mn, [
683
- u(s, {
1376
+ qe(v("div", Lt, [
1377
+ v("div", Ot, [
1378
+ E(a, {
684
1379
  name: "empty-action",
685
1380
  class: "empty-action-icon"
686
1381
  })
687
1382
  ]),
688
- o[4] || (o[4] = t("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
1383
+ t[4] || (t[4] = v("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
689
1384
  ], 512), [
690
- [he, e.isEmpty]
1385
+ [Ye, e.isEmpty]
691
1386
  ])
692
1387
  ]),
693
- u(l, {
1388
+ E(c, {
694
1389
  eventBinding: e.state.eventBinding
695
1390
  }, null, 8, ["eventBinding"]),
696
- u(i, {
1391
+ E(d, {
697
1392
  visible: e.state.showBindEventDialog,
698
1393
  componentEvents: e.renderEventList,
699
- onCloseDialog: o[1] || (o[1] = (d) => e.handleToggleAddEventDialog(!1)),
1394
+ onCloseDialog: t[1] || (t[1] = (m) => e.handleToggleAddEventDialog(!1)),
700
1395
  onAddEvent: e.handleAddEvent
701
1396
  }, null, 8, ["visible", "componentEvents", "onAddEvent"])
702
1397
  ], 64);
703
1398
  }
704
- const Ln = /* @__PURE__ */ H(En, [["render", wn], ["__scopeId", "data-v-3bfab6f4"]]), { DEFAULT_LOOP_NAME: F } = ln, { string2Obj: On } = dn, Sn = {
1399
+ const Tt = /* @__PURE__ */ Ie(Ct, [["render", St], ["__scopeId", "data-v-64f96b67"]]), {
1400
+ DEFAULT_LOOP_NAME: F
1401
+ } = me, {
1402
+ string2Obj: re
1403
+ } = ge, Ut = {
705
1404
  components: {
706
- SwitchConfigurator: an,
707
- TinyTooltip: je,
708
- VariableConfigurator: sn,
709
- InputConfigurator: tn,
710
- CodeConfigurator: on
1405
+ SwitchConfigurator: de,
1406
+ TinyTooltip: pt,
1407
+ VariableConfigurator: le,
1408
+ InputConfigurator: se,
1409
+ CodeConfigurator: ae
711
1410
  },
712
1411
  inheritAttrs: !1,
713
1412
  setup() {
714
- const { pageState: f } = j(), o = K(!1), a = q(() => {
1413
+ const {
1414
+ pageState: l
1415
+ } = y(), t = Ve(!1), o = Me(() => {
715
1416
  var n;
716
- return ((n = o.value) == null ? void 0 : n.type) === G.JSEXPRESSION;
717
- }), e = () => {
718
- var n, l;
719
- return ((l = (n = $().getSchema()) == null ? void 0 : n.loopArgs) == null ? void 0 : l[1]) || F.INDEX;
720
- }, r = Y({
1417
+ return ((n = t.value) == null ? void 0 : n.type) === G.JSEXPRESSION;
1418
+ }), e = h(() => {
1419
+ var n, c;
1420
+ return ((c = (n = z().getSchema()) == null ? void 0 : n.loopArgs) == null ? void 0 : c[1]) || F.INDEX;
1421
+ }, {
1422
+ metaData: {
1423
+ id: "engine.setting.event.AdvanceConfig.getIndexName"
1424
+ },
1425
+ ctx: () => ({
1426
+ pageState: l,
1427
+ condition: t,
1428
+ isBind: o,
1429
+ getIndexName: e,
1430
+ state: i,
1431
+ setLoopKey: p,
1432
+ openEditor: g,
1433
+ setConfig: s,
1434
+ setLoopIndex: r,
1435
+ setLoop: a,
1436
+ setLoopItem: u,
1437
+ CodeConfigurator: ae,
1438
+ InputConfigurator: se,
1439
+ SwitchConfigurator: de,
1440
+ VariableConfigurator: le,
1441
+ useProperties: z,
1442
+ useCanvas: y,
1443
+ PROP_DATA_TYPE: G,
1444
+ constants: me,
1445
+ utils: ge,
1446
+ DEFAULT_LOOP_NAME: F,
1447
+ string2Obj: re
1448
+ })
1449
+ }), i = we({
721
1450
  loopData: {
722
1451
  type: G.JSEXPRESSION,
723
1452
  value: "[]"
724
1453
  },
725
1454
  loopItem: "item",
726
1455
  loopIndex: "index",
727
- isLoop: q(() => {
1456
+ isLoop: Me(() => {
728
1457
  var n;
729
- return ((n = r.loopData) == null ? void 0 : n.type) === G.JSEXPRESSION;
1458
+ return ((n = i.loopData) == null ? void 0 : n.type) === G.JSEXPRESSION;
730
1459
  }),
731
1460
  loopKey: "",
732
1461
  shouldUpdate: !1
733
1462
  });
734
- ye(
735
- () => [f == null ? void 0 : f.currentSchema, r.shouldUpdate],
736
- ([n]) => {
737
- var l, i, d, y;
738
- o.value = (n == null ? void 0 : n.condition) === void 0 ? !0 : n == null ? void 0 : n.condition, r.loopData = n == null ? void 0 : n.loop, r.loopItem = ((l = n == null ? void 0 : n.loopArgs) == null ? void 0 : l[0]) || "", r.loopIndex = ((i = n == null ? void 0 : n.loopArgs) == null ? void 0 : i[1]) || "", r.loopKey = ((y = (d = n == null ? void 0 : n.props) == null ? void 0 : d.key) == null ? void 0 : y.value) || "";
739
- }
740
- );
741
- const _ = (n = "") => {
742
- var I;
1463
+ Ze(() => [l == null ? void 0 : l.currentSchema, i.shouldUpdate], ([n]) => {
1464
+ var c, d, m, f;
1465
+ t.value = (n == null ? void 0 : n.condition) === void 0 ? !0 : n == null ? void 0 : n.condition, i.loopData = n == null ? void 0 : n.loop, i.loopItem = ((c = n == null ? void 0 : n.loopArgs) == null ? void 0 : c[0]) || "", i.loopIndex = ((d = n == null ? void 0 : n.loopArgs) == null ? void 0 : d[1]) || "", i.loopKey = ((f = (m = n == null ? void 0 : n.props) == null ? void 0 : m.key) == null ? void 0 : f.value) || "";
1466
+ });
1467
+ const p = h((n = "") => {
1468
+ var D;
743
1469
  n = n.replace(/\s*/g, "");
744
- const { getSchema: l, setProp: i } = $(), d = l();
745
- if (!d)
1470
+ const {
1471
+ getSchema: c,
1472
+ setProp: d
1473
+ } = z(), m = c();
1474
+ if (!m)
746
1475
  return;
747
- const y = Number(n).toString() !== "NaN";
748
- let V = (I = d.props) == null ? void 0 : I.key;
749
- n && !y && (V = {
1476
+ const f = Number(n).toString() !== "NaN";
1477
+ let x = (D = m.props) == null ? void 0 : D.key;
1478
+ n && !f && (x = {
750
1479
  type: G.JSEXPRESSION,
751
1480
  value: n
752
- }), n || (r.isLoop ? V = {
1481
+ }), n || (i.isLoop ? x = {
753
1482
  type: G.JSEXPRESSION,
754
1483
  value: e()
755
- } : V = ""), i("key", V);
756
- };
757
- ye([() => r.isLoop, () => r.loopIndex], () => {
758
- !r.loopKey && r.isLoop && _(e()), r.isLoop || _("");
1484
+ } : x = ""), d("key", x);
1485
+ }, {
1486
+ metaData: {
1487
+ id: "engine.setting.event.AdvanceConfig.setLoopKey"
1488
+ },
1489
+ ctx: () => ({
1490
+ pageState: l,
1491
+ condition: t,
1492
+ isBind: o,
1493
+ getIndexName: e,
1494
+ state: i,
1495
+ setLoopKey: p,
1496
+ openEditor: g,
1497
+ setConfig: s,
1498
+ setLoopIndex: r,
1499
+ setLoop: a,
1500
+ setLoopItem: u,
1501
+ CodeConfigurator: ae,
1502
+ InputConfigurator: se,
1503
+ SwitchConfigurator: de,
1504
+ VariableConfigurator: le,
1505
+ useProperties: z,
1506
+ useCanvas: y,
1507
+ PROP_DATA_TYPE: G,
1508
+ constants: me,
1509
+ utils: ge,
1510
+ DEFAULT_LOOP_NAME: F,
1511
+ string2Obj: re
1512
+ })
759
1513
  });
760
- const b = () => {
1514
+ Ze([() => i.isLoop, () => i.loopIndex], () => {
1515
+ !i.loopKey && i.isLoop && p(e()), i.isLoop || p("");
1516
+ });
1517
+ const g = h(() => {
761
1518
  var n;
762
- r.loopData = (n = $().getSchema()) == null ? void 0 : n.loop;
763
- }, c = (n) => {
764
- const { getSchema: l } = $(), i = l();
765
- if (!i)
1519
+ i.loopData = (n = z().getSchema()) == null ? void 0 : n.loop;
1520
+ }, {
1521
+ metaData: {
1522
+ id: "engine.setting.event.AdvanceConfig.openEditor"
1523
+ },
1524
+ ctx: () => ({
1525
+ pageState: l,
1526
+ condition: t,
1527
+ isBind: o,
1528
+ getIndexName: e,
1529
+ state: i,
1530
+ setLoopKey: p,
1531
+ openEditor: g,
1532
+ setConfig: s,
1533
+ setLoopIndex: r,
1534
+ setLoop: a,
1535
+ setLoopItem: u,
1536
+ CodeConfigurator: ae,
1537
+ InputConfigurator: se,
1538
+ SwitchConfigurator: de,
1539
+ VariableConfigurator: le,
1540
+ useProperties: z,
1541
+ useCanvas: y,
1542
+ PROP_DATA_TYPE: G,
1543
+ constants: me,
1544
+ utils: ge,
1545
+ DEFAULT_LOOP_NAME: F,
1546
+ string2Obj: re
1547
+ })
1548
+ }), s = h((n) => {
1549
+ const {
1550
+ getSchema: c
1551
+ } = z(), d = c();
1552
+ if (!d)
766
1553
  return;
767
- const { operateNode: d } = j();
1554
+ const {
1555
+ operateNode: m
1556
+ } = y();
768
1557
  if (n === !1 || n != null && n.type)
769
- d({ type: "updateAttributes", id: i.id, value: { condition: n } });
1558
+ m({
1559
+ type: "updateAttributes",
1560
+ id: d.id,
1561
+ value: {
1562
+ condition: n
1563
+ }
1564
+ });
770
1565
  else {
771
- const { condition: y, children: V, ...I } = i;
772
- d({ type: "updateAttributes", id: i.id, value: { ...I }, overwrite: !0 });
1566
+ const {
1567
+ condition: f,
1568
+ children: x,
1569
+ ...D
1570
+ } = d;
1571
+ m({
1572
+ type: "updateAttributes",
1573
+ id: d.id,
1574
+ value: {
1575
+ ...D
1576
+ },
1577
+ overwrite: !0
1578
+ });
773
1579
  }
774
- j().canvasApi.value.updateRect(), o.value = n;
775
- }, p = (n) => {
776
- const l = $().getSchema();
777
- let i = l.loopArgs;
778
- const { operateNode: d } = j();
779
- i ? i[1] = n || F.INDEX : i = [F.ITEM, n], d({ type: "updateAttributes", id: l.id, value: { loopArgs: i } });
780
- };
781
- return {
782
- condition: o,
783
- setConfig: c,
784
- isBind: a,
785
- state: r,
786
- setLoop: (n) => {
787
- const { operateNode: l } = j(), { getSchema: i } = $(), d = i();
788
- if (n) {
789
- const y = n != null && n.type ? n : On(n);
790
- l({ type: "updateAttributes", id: d.id, value: { loop: y } }), p(F.INDEX);
791
- } else {
792
- _();
793
- const { loop: y, loopArgs: V, children: I, ...te } = d;
794
- l({ type: "updateAttributes", id: d.id, value: te, overwrite: !0 });
1580
+ y().canvasApi.value.updateRect(), t.value = n;
1581
+ }, {
1582
+ metaData: {
1583
+ id: "engine.setting.event.AdvanceConfig.setConfig"
1584
+ },
1585
+ ctx: () => ({
1586
+ pageState: l,
1587
+ condition: t,
1588
+ isBind: o,
1589
+ getIndexName: e,
1590
+ state: i,
1591
+ setLoopKey: p,
1592
+ openEditor: g,
1593
+ setConfig: s,
1594
+ setLoopIndex: r,
1595
+ setLoop: a,
1596
+ setLoopItem: u,
1597
+ CodeConfigurator: ae,
1598
+ InputConfigurator: se,
1599
+ SwitchConfigurator: de,
1600
+ VariableConfigurator: le,
1601
+ useProperties: z,
1602
+ useCanvas: y,
1603
+ PROP_DATA_TYPE: G,
1604
+ constants: me,
1605
+ utils: ge,
1606
+ DEFAULT_LOOP_NAME: F,
1607
+ string2Obj: re
1608
+ })
1609
+ }), r = h((n) => {
1610
+ const c = z().getSchema();
1611
+ let d = c.loopArgs;
1612
+ const {
1613
+ operateNode: m
1614
+ } = y();
1615
+ d ? d[1] = n || F.INDEX : d = [F.ITEM, n], m({
1616
+ type: "updateAttributes",
1617
+ id: c.id,
1618
+ value: {
1619
+ loopArgs: d
795
1620
  }
796
- r.shouldUpdate = !r.shouldUpdate;
1621
+ });
1622
+ }, {
1623
+ metaData: {
1624
+ id: "engine.setting.event.AdvanceConfig.setLoopIndex"
797
1625
  },
798
- setLoopItem: (n) => {
799
- const l = $().getSchema();
800
- let i = l.loopArgs;
801
- const { operateNode: d } = j();
802
- i ? i[0] = n || F.ITEM : i = [n, F.INDEX], d({ type: "updateAttributes", id: l.id, value: { loopArgs: i } });
1626
+ ctx: () => ({
1627
+ pageState: l,
1628
+ condition: t,
1629
+ isBind: o,
1630
+ getIndexName: e,
1631
+ state: i,
1632
+ setLoopKey: p,
1633
+ openEditor: g,
1634
+ setConfig: s,
1635
+ setLoopIndex: r,
1636
+ setLoop: a,
1637
+ setLoopItem: u,
1638
+ CodeConfigurator: ae,
1639
+ InputConfigurator: se,
1640
+ SwitchConfigurator: de,
1641
+ VariableConfigurator: le,
1642
+ useProperties: z,
1643
+ useCanvas: y,
1644
+ PROP_DATA_TYPE: G,
1645
+ constants: me,
1646
+ utils: ge,
1647
+ DEFAULT_LOOP_NAME: F,
1648
+ string2Obj: re
1649
+ })
1650
+ }), a = h((n) => {
1651
+ const {
1652
+ operateNode: c
1653
+ } = y(), {
1654
+ getSchema: d
1655
+ } = z(), m = d();
1656
+ if (n) {
1657
+ const f = n != null && n.type ? n : re(n);
1658
+ c({
1659
+ type: "updateAttributes",
1660
+ id: m.id,
1661
+ value: {
1662
+ loop: f
1663
+ }
1664
+ }), r(F.INDEX);
1665
+ } else {
1666
+ p();
1667
+ const {
1668
+ loop: f,
1669
+ loopArgs: x,
1670
+ children: D,
1671
+ ...N
1672
+ } = m;
1673
+ c({
1674
+ type: "updateAttributes",
1675
+ id: m.id,
1676
+ value: N,
1677
+ overwrite: !0
1678
+ });
1679
+ }
1680
+ i.shouldUpdate = !i.shouldUpdate;
1681
+ }, {
1682
+ metaData: {
1683
+ id: "engine.setting.event.AdvanceConfig.setLoop"
803
1684
  },
1685
+ ctx: () => ({
1686
+ pageState: l,
1687
+ condition: t,
1688
+ isBind: o,
1689
+ getIndexName: e,
1690
+ state: i,
1691
+ setLoopKey: p,
1692
+ openEditor: g,
1693
+ setConfig: s,
1694
+ setLoopIndex: r,
1695
+ setLoop: a,
1696
+ setLoopItem: u,
1697
+ CodeConfigurator: ae,
1698
+ InputConfigurator: se,
1699
+ SwitchConfigurator: de,
1700
+ VariableConfigurator: le,
1701
+ useProperties: z,
1702
+ useCanvas: y,
1703
+ PROP_DATA_TYPE: G,
1704
+ constants: me,
1705
+ utils: ge,
1706
+ DEFAULT_LOOP_NAME: F,
1707
+ string2Obj: re
1708
+ })
1709
+ }), u = h((n) => {
1710
+ const c = z().getSchema();
1711
+ let d = c.loopArgs;
1712
+ const {
1713
+ operateNode: m
1714
+ } = y();
1715
+ d ? d[0] = n || F.ITEM : d = [n, F.INDEX], m({
1716
+ type: "updateAttributes",
1717
+ id: c.id,
1718
+ value: {
1719
+ loopArgs: d
1720
+ }
1721
+ });
1722
+ }, {
1723
+ metaData: {
1724
+ id: "engine.setting.event.AdvanceConfig.setLoopItem"
1725
+ },
1726
+ ctx: () => ({
1727
+ pageState: l,
1728
+ condition: t,
1729
+ isBind: o,
1730
+ getIndexName: e,
1731
+ state: i,
1732
+ setLoopKey: p,
1733
+ openEditor: g,
1734
+ setConfig: s,
1735
+ setLoopIndex: r,
1736
+ setLoop: a,
1737
+ setLoopItem: u,
1738
+ CodeConfigurator: ae,
1739
+ InputConfigurator: se,
1740
+ SwitchConfigurator: de,
1741
+ VariableConfigurator: le,
1742
+ useProperties: z,
1743
+ useCanvas: y,
1744
+ PROP_DATA_TYPE: G,
1745
+ constants: me,
1746
+ utils: ge,
1747
+ DEFAULT_LOOP_NAME: F,
1748
+ string2Obj: re
1749
+ })
1750
+ });
1751
+ return {
1752
+ condition: t,
1753
+ setConfig: s,
1754
+ isBind: o,
1755
+ state: i,
1756
+ setLoop: a,
1757
+ setLoopItem: u,
804
1758
  DEFAULT_LOOP_NAME: F,
805
- openEditor: b,
806
- setLoopIndex: p,
807
- setLoopKey: _,
1759
+ openEditor: g,
1760
+ setLoopIndex: r,
1761
+ setLoopKey: p,
808
1762
  getIndexName: e
809
1763
  };
810
1764
  }
811
- }, Tn = { class: "advanced-config-container" }, Un = { class: "advnce-config" }, jn = { class: "advanced-config-form-item" }, zn = ["title"], Rn = { class: "advnce-config loop-data-item" }, $n = { class: "advanced-config-form-item" }, Fn = ["title"], Jn = { class: "advnce-config" }, Xn = { class: "advanced-config-form-item" }, Kn = { class: "advnce-config" }, Hn = { class: "advanced-config-form-item" }, Gn = { class: "advnce-config" }, qn = { class: "advanced-config-form-item" };
812
- function Yn(f, o, a, e, r, _) {
813
- var n, l;
814
- const b = k("switch-configurator"), c = k("variable-configurator"), p = k("code-configurator"), s = k("input-configurator"), x = k("tiny-tooltip");
815
- return h(), A("div", Tn, [
816
- t("div", Un, [
817
- o[6] || (o[6] = t("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
818
- t("div", jn, [
819
- e.isBind ? (h(), A("div", {
1765
+ }, jt = { class: "advanced-config-container" }, zt = { class: "advnce-config" }, Ft = { class: "advanced-config-form-item" }, Rt = ["title"], Jt = { class: "advnce-config loop-data-item" }, $t = { class: "advanced-config-form-item" }, Xt = ["title"], Kt = { class: "advnce-config" }, Ht = { class: "advanced-config-form-item" }, Gt = { class: "advnce-config" }, qt = { class: "advanced-config-form-item" }, Yt = { class: "advnce-config" }, Zt = { class: "advanced-config-form-item" };
1766
+ function Wt(l, t, o, e, i, p) {
1767
+ var n, c;
1768
+ const g = L("switch-configurator"), s = L("variable-configurator"), r = L("code-configurator"), a = L("input-configurator"), u = L("tiny-tooltip");
1769
+ return B(), $("div", jt, [
1770
+ v("div", zt, [
1771
+ t[6] || (t[6] = v("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
1772
+ v("div", Ft, [
1773
+ e.isBind ? (B(), $("div", {
820
1774
  key: 1,
821
1775
  class: "binding-state text-ellipsis-multiple",
822
1776
  title: e.condition.value
823
- }, " 已绑定:" + B(e.condition.value), 9, zn)) : (h(), O(b, {
1777
+ }, " 已绑定:" + Y(e.condition.value), 9, Rt)) : (B(), te(g, {
824
1778
  key: 0,
825
1779
  modelValue: e.condition,
826
1780
  "onUpdate:modelValue": e.setConfig
827
1781
  }, null, 8, ["modelValue", "onUpdate:modelValue"])),
828
- u(c, {
1782
+ E(s, {
829
1783
  modelValue: e.condition,
830
1784
  "onUpdate:modelValue": [
831
- o[0] || (o[0] = (i) => e.condition = i),
1785
+ t[0] || (t[0] = (d) => e.condition = d),
832
1786
  e.setConfig
833
1787
  ],
834
1788
  name: "advance"
835
1789
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
836
1790
  ])
837
1791
  ]),
838
- t("div", Rn, [
839
- o[7] || (o[7] = t("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
840
- t("div", $n, [
841
- e.state.isLoop ? (h(), A("div", {
1792
+ v("div", Jt, [
1793
+ t[7] || (t[7] = v("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
1794
+ v("div", $t, [
1795
+ e.state.isLoop ? (B(), $("div", {
842
1796
  key: 1,
843
1797
  class: "binding-state text-ellipsis-multiple",
844
1798
  title: (n = e.state.loopData) == null ? void 0 : n.value
845
- }, " 已绑定:" + B((l = e.state.loopData) == null ? void 0 : l.value), 9, Fn)) : (h(), O(p, {
1799
+ }, " 已绑定:" + Y((c = e.state.loopData) == null ? void 0 : c.value), 9, Xt)) : (B(), te(r, {
846
1800
  key: 0,
847
1801
  modelValue: e.state.loopData,
848
1802
  "onUpdate:modelValue": [
849
- o[1] || (o[1] = (i) => e.state.loopData = i),
1803
+ t[1] || (t[1] = (d) => e.state.loopData = d),
850
1804
  e.setLoop
851
1805
  ],
852
1806
  "data-type": "JSExpression",
853
1807
  onOpen: e.openEditor
854
1808
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onOpen"])),
855
- u(c, {
1809
+ E(s, {
856
1810
  modelValue: e.state.loopData,
857
1811
  "onUpdate:modelValue": [
858
- o[2] || (o[2] = (i) => e.state.loopData = i),
1812
+ t[2] || (t[2] = (d) => e.state.loopData = d),
859
1813
  e.setLoop
860
1814
  ],
861
1815
  name: "advance"
862
1816
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
863
1817
  ])
864
1818
  ]),
865
- t("div", Jn, [
866
- o[8] || (o[8] = t("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
867
- t("div", Xn, [
868
- u(s, {
1819
+ v("div", Kt, [
1820
+ t[8] || (t[8] = v("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
1821
+ v("div", Ht, [
1822
+ E(a, {
869
1823
  modelValue: e.state.loopItem,
870
1824
  "onUpdate:modelValue": [
871
- o[3] || (o[3] = (i) => e.state.loopItem = i),
1825
+ t[3] || (t[3] = (d) => e.state.loopItem = d),
872
1826
  e.setLoopItem
873
1827
  ],
874
1828
  placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.ITEM}`
875
1829
  }, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
876
1830
  ])
877
1831
  ]),
878
- t("div", Kn, [
879
- o[9] || (o[9] = t("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
880
- t("div", Hn, [
881
- u(s, {
1832
+ v("div", Gt, [
1833
+ t[9] || (t[9] = v("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
1834
+ v("div", qt, [
1835
+ E(a, {
882
1836
  modelValue: e.state.loopIndex,
883
1837
  "onUpdate:modelValue": [
884
- o[4] || (o[4] = (i) => e.state.loopIndex = i),
1838
+ t[4] || (t[4] = (d) => e.state.loopIndex = d),
885
1839
  e.setLoopIndex
886
1840
  ],
887
1841
  placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.INDEX}`
888
1842
  }, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
889
1843
  ])
890
1844
  ]),
891
- t("div", Gn, [
892
- o[10] || (o[10] = t("label", { class: "text-ellipsis-multiple" }, "key", -1)),
893
- t("div", qn, [
894
- u(x, {
1845
+ v("div", Yt, [
1846
+ t[10] || (t[10] = v("label", { class: "text-ellipsis-multiple" }, "key", -1)),
1847
+ v("div", Zt, [
1848
+ E(u, {
895
1849
  content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存",
896
1850
  effect: "light"
897
1851
  }, {
898
- default: E(() => [
899
- u(s, {
1852
+ default: I(() => [
1853
+ E(a, {
900
1854
  modelValue: e.state.loopKey,
901
1855
  "onUpdate:modelValue": [
902
- o[5] || (o[5] = (i) => e.state.loopKey = i),
1856
+ t[5] || (t[5] = (d) => e.state.loopKey = d),
903
1857
  e.setLoopKey
904
1858
  ],
905
1859
  placeholder: `默认为索引名:${e.getIndexName()}`
@@ -911,44 +1865,46 @@ function Yn(f, o, a, e, r, _) {
911
1865
  ])
912
1866
  ]);
913
1867
  }
914
- const Zn = /* @__PURE__ */ H(Sn, [["render", Yn], ["__scopeId", "data-v-2254f006"]]), Wn = {
1868
+ const Qt = /* @__PURE__ */ Ie(Ut, [["render", Wt], ["__scopeId", "data-v-17653d06"]]), en = {
915
1869
  __name: "Main",
916
1870
  props: {
917
1871
  fixedPanels: Array
918
1872
  },
919
1873
  emits: [],
920
- setup(f, { emit: o }) {
921
- const a = K(["bindEvent", "advancedConfig"]), { PLUGIN_NAME: e } = re(), _ = Y({
922
- emitEvent: o
1874
+ setup(l, { emit: t }) {
1875
+ const o = Ve(["bindEvent", "advancedConfig"]), {
1876
+ PLUGIN_NAME: e
1877
+ } = V(), p = we({
1878
+ emitEvent: t
923
1879
  });
924
- return Ve("panelState", _), (b, c) => (h(), O(D(We), {
1880
+ return tt("panelState", p), (g, s) => (B(), te(S(_t), {
925
1881
  title: "高级",
926
- "fixed-panels": f.fixedPanels,
927
- "fixed-name": D(e).Event,
1882
+ "fixed-panels": l.fixedPanels,
1883
+ "fixed-name": S(e).Event,
928
1884
  "header-margin-bottom": 0,
929
- onClose: c[1] || (c[1] = (p) => b.$emit("close"))
1885
+ onClose: s[1] || (s[1] = (r) => g.$emit("close"))
930
1886
  }, {
931
- content: E(() => [
932
- u(D(ze), {
933
- modelValue: a.value,
934
- "onUpdate:modelValue": c[0] || (c[0] = (p) => a.value = p)
1887
+ content: I(() => [
1888
+ E(S(vt), {
1889
+ modelValue: o.value,
1890
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => o.value = r)
935
1891
  }, {
936
- default: E(() => [
937
- u(D(xe), {
1892
+ default: I(() => [
1893
+ E(S(Qe), {
938
1894
  title: "事件绑定",
939
1895
  name: "bindEvent"
940
1896
  }, {
941
- default: E(() => [
942
- u(Ln)
1897
+ default: I(() => [
1898
+ E(Tt)
943
1899
  ]),
944
1900
  _: 1
945
1901
  }),
946
- u(D(xe), {
1902
+ E(S(Qe), {
947
1903
  title: "高级配置",
948
1904
  name: "advancedConfig"
949
1905
  }, {
950
- default: E(() => [
951
- u(Zn)
1906
+ default: I(() => [
1907
+ E(Qt)
952
1908
  ]),
953
1909
  _: 1
954
1910
  })
@@ -959,114 +1915,222 @@ const Zn = /* @__PURE__ */ H(Sn, [["render", Yn], ["__scopeId", "data-v-2254f006
959
1915
  _: 1
960
1916
  }, 8, ["fixed-panels", "fixed-name"]));
961
1917
  }
962
- }, Pe = "newMethod", Qn = /[^0-9a-zA-Z_$]/, eo = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, se = {
1918
+ }, ee = "newMethod", je = /[^0-9a-zA-Z_$]/, Be = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, ce = {
1919
+ default: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)",
963
1920
  exist: "方法名称已存在",
964
1921
  ruleInvalid: "请输入有效的方法名,可以由字母、数字、下划线、$ 符号组成,不能以数字开头",
965
1922
  empty: "方法名称不能为空"
966
- }, no = {
1923
+ }, tn = {
967
1924
  components: {
968
- MonacoEditor: Qe,
969
- TinyInput: le,
970
- TinyCheckbox: Re
1925
+ MonacoEditor: Ae,
1926
+ TinyInput: Fe,
1927
+ TinyCheckbox: ut
971
1928
  },
972
1929
  props: {
973
1930
  dialogVisible: Boolean
974
1931
  },
975
1932
  setup() {
976
- const { getMethodNameList: f } = ne(oe.Page), o = Ae("context"), a = {
1933
+ const {
1934
+ getMethodNameList: l
1935
+ } = k(C.Page), t = ot("context"), o = {
977
1936
  language: "json",
978
1937
  lineNumbers: !1,
979
1938
  minimap: {
980
1939
  enabled: !1
981
1940
  }
982
- }, e = (p) => {
983
- o.editorContent = p;
984
- }, r = (p) => !p, _ = (p) => f == null ? void 0 : f().includes(p), b = (p) => !eo.test(p);
985
- return {
986
- NEW_METHOD_TYPE: Pe,
987
- context: o,
988
- editorOptions: a,
989
- change: (p) => {
990
- const s = [
991
- { validator: r, tip: se.empty },
992
- { validator: _, tip: se.exist },
993
- { validator: b, tip: se.ruleInvalid }
994
- ];
995
- for (let x = 0; x < s.length; x++) {
996
- const n = s[x];
997
- if (n.validator(p)) {
998
- o.tipError = !0, o.tip = n.tip;
999
- return;
1000
- }
1941
+ }, e = h((r) => {
1942
+ t.editorContent = r;
1943
+ }, {
1944
+ metaData: {
1945
+ id: "engine.setting.event.BindEventsDialogContent.editorContentChange"
1946
+ },
1947
+ ctx: () => ({
1948
+ getMethodNameList: l,
1949
+ context: t,
1950
+ editorOptions: o,
1951
+ editorContentChange: e,
1952
+ validMethodNameEmpty: i,
1953
+ validMethodNameExist: p,
1954
+ invalidMethodName: g,
1955
+ change: s,
1956
+ VueMonaco: Ae,
1957
+ getMetaApi: k,
1958
+ META_APP: C,
1959
+ METHOD_TIPS_MAP: ce,
1960
+ NEW_METHOD_TYPE: ee,
1961
+ VALID_VARNAME_RE: Be
1962
+ })
1963
+ }), i = h((r) => !r, {
1964
+ metaData: {
1965
+ id: "engine.setting.event.BindEventsDialogContent.validMethodNameEmpty"
1966
+ },
1967
+ ctx: () => ({
1968
+ getMethodNameList: l,
1969
+ context: t,
1970
+ editorOptions: o,
1971
+ editorContentChange: e,
1972
+ validMethodNameEmpty: i,
1973
+ validMethodNameExist: p,
1974
+ invalidMethodName: g,
1975
+ change: s,
1976
+ VueMonaco: Ae,
1977
+ getMetaApi: k,
1978
+ META_APP: C,
1979
+ METHOD_TIPS_MAP: ce,
1980
+ NEW_METHOD_TYPE: ee,
1981
+ VALID_VARNAME_RE: Be
1982
+ })
1983
+ }), p = h((r) => l == null ? void 0 : l().includes(r), {
1984
+ metaData: {
1985
+ id: "engine.setting.event.BindEventsDialogContent.validMethodNameExist"
1986
+ },
1987
+ ctx: () => ({
1988
+ getMethodNameList: l,
1989
+ context: t,
1990
+ editorOptions: o,
1991
+ editorContentChange: e,
1992
+ validMethodNameEmpty: i,
1993
+ validMethodNameExist: p,
1994
+ invalidMethodName: g,
1995
+ change: s,
1996
+ VueMonaco: Ae,
1997
+ getMetaApi: k,
1998
+ META_APP: C,
1999
+ METHOD_TIPS_MAP: ce,
2000
+ NEW_METHOD_TYPE: ee,
2001
+ VALID_VARNAME_RE: Be
2002
+ })
2003
+ }), g = h((r) => !Be.test(r), {
2004
+ metaData: {
2005
+ id: "engine.setting.event.BindEventsDialogContent.invalidMethodName"
2006
+ },
2007
+ ctx: () => ({
2008
+ getMethodNameList: l,
2009
+ context: t,
2010
+ editorOptions: o,
2011
+ editorContentChange: e,
2012
+ validMethodNameEmpty: i,
2013
+ validMethodNameExist: p,
2014
+ invalidMethodName: g,
2015
+ change: s,
2016
+ VueMonaco: Ae,
2017
+ getMetaApi: k,
2018
+ META_APP: C,
2019
+ METHOD_TIPS_MAP: ce,
2020
+ NEW_METHOD_TYPE: ee,
2021
+ VALID_VARNAME_RE: Be
2022
+ })
2023
+ }), s = h((r) => {
2024
+ const a = [{
2025
+ validator: i,
2026
+ tip: ce.empty
2027
+ }, {
2028
+ validator: p,
2029
+ tip: ce.exist
2030
+ }, {
2031
+ validator: g,
2032
+ tip: ce.ruleInvalid
2033
+ }];
2034
+ for (let u = 0; u < a.length; u++) {
2035
+ const n = a[u];
2036
+ if (n.validator(r)) {
2037
+ t.tipError = !0, t.tip = n.tip;
2038
+ return;
1001
2039
  }
1002
- o.tipError = !1, o.tip = "";
2040
+ }
2041
+ t.tipError = !1, t.tip = "";
2042
+ }, {
2043
+ metaData: {
2044
+ id: "engine.setting.event.BindEventsDialogContent.change"
1003
2045
  },
2046
+ ctx: () => ({
2047
+ getMethodNameList: l,
2048
+ context: t,
2049
+ editorOptions: o,
2050
+ editorContentChange: e,
2051
+ validMethodNameEmpty: i,
2052
+ validMethodNameExist: p,
2053
+ invalidMethodName: g,
2054
+ change: s,
2055
+ VueMonaco: Ae,
2056
+ getMetaApi: k,
2057
+ META_APP: C,
2058
+ METHOD_TIPS_MAP: ce,
2059
+ NEW_METHOD_TYPE: ee,
2060
+ VALID_VARNAME_RE: Be
2061
+ })
2062
+ });
2063
+ return {
2064
+ NEW_METHOD_TYPE: ee,
2065
+ context: t,
2066
+ editorOptions: o,
2067
+ change: s,
1004
2068
  editorContentChange: e
1005
2069
  };
1006
2070
  }
1007
- }, oo = { class: "content-right" }, to = { class: "new-action-tip" }, io = { class: "content-right-title" }, so = { class: "set-params-tip" }, ao = { class: "content-right-monaco" }, lo = {
2071
+ }, nn = { class: "content-right" }, on = { class: "new-action-tip" }, an = { class: "content-right-title" }, sn = { class: "set-params-tip" }, ln = { class: "content-right-monaco" }, dn = {
1008
2072
  key: 1,
1009
2073
  class: "mark"
1010
- }, ro = {
2074
+ }, rn = {
1011
2075
  key: 0,
1012
2076
  class: "params-tip"
1013
2077
  };
1014
- function co(f, o, a, e, r, _) {
1015
- const b = k("tiny-input"), c = k("tiny-checkbox"), p = k("monaco-editor");
1016
- return h(), A("div", oo, [
1017
- t("div", {
1018
- class: X(["content-right-top", { "tip-error": e.context.tipError }])
2078
+ function cn(l, t, o, e, i, p) {
2079
+ const g = L("tiny-input"), s = L("tiny-checkbox"), r = L("monaco-editor");
2080
+ return B(), $("div", nn, [
2081
+ v("div", {
2082
+ class: Ne(["content-right-top", { "tip-error": e.context.tipError }])
1019
2083
  }, [
1020
- o[2] || (o[2] = t("div", { class: "content-right-title" }, "方法名称", -1)),
1021
- u(b, {
2084
+ t[2] || (t[2] = v("div", { class: "content-right-title" }, "方法名称", -1)),
2085
+ E(g, {
1022
2086
  modelValue: e.context.bindMethodInfo.name,
1023
2087
  "onUpdate:modelValue": [
1024
- o[0] || (o[0] = (s) => e.context.bindMethodInfo.name = s),
2088
+ t[0] || (t[0] = (a) => e.context.bindMethodInfo.name = a),
1025
2089
  e.change
1026
2090
  ],
1027
2091
  disabled: e.context.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
1028
- class: X([{ "status-error": e.context.tipError }]),
2092
+ class: Ne([{ "status-error": e.context.tipError }]),
1029
2093
  placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
1030
2094
  }, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
1031
- t("div", to, B(e.context.tip), 1)
2095
+ v("div", on, Y(e.context.tip), 1)
1032
2096
  ], 2),
1033
- t("div", {
1034
- class: X(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
2097
+ v("div", {
2098
+ class: Ne(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
1035
2099
  }, [
1036
- t("div", io, [
1037
- u(c, {
2100
+ v("div", an, [
2101
+ E(s, {
1038
2102
  modelValue: e.context.enableExtraParams,
1039
- "onUpdate:modelValue": o[1] || (o[1] = (s) => e.context.enableExtraParams = s),
2103
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => e.context.enableExtraParams = a),
1040
2104
  name: "tiny-checkbox"
1041
2105
  }, {
1042
- default: E(() => o[3] || (o[3] = [
1043
- J("扩展参数设置")
2106
+ default: I(() => t[3] || (t[3] = [
2107
+ ke("扩展参数设置")
1044
2108
  ])),
1045
2109
  _: 1,
1046
2110
  __: [3]
1047
2111
  }, 8, ["modelValue"]),
1048
- t("div", so, [
1049
- o[4] || (o[4] = t("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
1050
- J(" 如: " + B(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
2112
+ v("div", sn, [
2113
+ t[4] || (t[4] = v("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
2114
+ ke(" 如: " + Y(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
1051
2115
  ])
1052
2116
  ]),
1053
- t("div", ao, [
1054
- a.dialogVisible ? (h(), O(p, {
2117
+ v("div", ln, [
2118
+ o.dialogVisible ? (B(), te(r, {
1055
2119
  key: 0,
1056
2120
  value: e.context.editorContent,
1057
2121
  options: e.editorOptions,
1058
2122
  onChange: e.editorContentChange,
1059
2123
  class: "monaco-editor"
1060
- }, null, 8, ["value", "options", "onChange"])) : Q("", !0),
1061
- e.context.enableExtraParams ? Q("", !0) : (h(), A("div", lo))
2124
+ }, null, 8, ["value", "options", "onChange"])) : Se("", !0),
2125
+ e.context.enableExtraParams ? Se("", !0) : (B(), $("div", dn))
1062
2126
  ]),
1063
- !e.context.isValidParams && e.context.enableExtraParams ? (h(), A("div", ro, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : Q("", !0)
2127
+ !e.context.isValidParams && e.context.enableExtraParams ? (B(), $("div", rn, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : Se("", !0)
1064
2128
  ], 2)
1065
2129
  ]);
1066
2130
  }
1067
- const mo = /* @__PURE__ */ H(no, [["render", co], ["__scopeId", "data-v-f2c9b5af"]]), po = {
2131
+ const mn = /* @__PURE__ */ Ie(tn, [["render", cn], ["__scopeId", "data-v-fc0b367d"]]), gn = {
1068
2132
  components: {
1069
- TinySearch: $e
2133
+ TinySearch: ft
1070
2134
  },
1071
2135
  props: {
1072
2136
  eventBinding: {
@@ -1074,70 +2138,110 @@ const mo = /* @__PURE__ */ H(no, [["render", co], ["__scopeId", "data-v-f2c9b5af
1074
2138
  default: () => ({})
1075
2139
  }
1076
2140
  },
1077
- setup(f) {
1078
- const { getMethodNameList: o } = ne(oe.Page), a = K(""), e = K([]), r = Ae("context"), _ = (c, p) => {
1079
- const s = c.map((l) => {
1080
- var i;
1081
- return Number.parseInt((i = l.match(/\d+$/)) == null ? void 0 : i[0]) || 0;
1082
- }).sort((l, i) => l - i).pop();
1083
- let n = `${(p == null ? void 0 : p.replace(Qn, "_")) || ""}New`;
1084
- return s > -1 && (n += `${s + 1}`), n;
1085
- }, b = (c) => {
1086
- r.bindMethodInfo = c;
1087
- };
1088
- return Ne(() => {
1089
- var l, i;
1090
- const c = (l = f.eventBinding) == null ? void 0 : l.eventName, p = (o == null ? void 0 : o().filter((d) => d.includes(c))) || [], x = {
2141
+ setup(l) {
2142
+ const {
2143
+ getMethodNameList: t
2144
+ } = k(C.Page), o = Ve(""), e = Ve([]), i = ot("context"), p = h((s, r) => {
2145
+ const a = s.map((c) => {
2146
+ var d;
2147
+ return Number.parseInt((d = c.match(/\d+$/)) == null ? void 0 : d[0]) || 0;
2148
+ }).sort((c, d) => c - d).pop();
2149
+ let n = `${(r == null ? void 0 : r.replace(je, "_")) || ""}New`;
2150
+ return a > -1 && (n += `${a + 1}`), n;
2151
+ }, {
2152
+ metaData: {
2153
+ id: "engine.setting.event.BindEventsDialogSidebar.generateMethodName"
2154
+ },
2155
+ ctx: () => ({
2156
+ props: l,
2157
+ getMethodNameList: t,
2158
+ searchValue: o,
2159
+ filteredMethodList: e,
2160
+ context: i,
2161
+ generateMethodName: p,
2162
+ selectMethod: g,
2163
+ getMetaApi: k,
2164
+ META_APP: C,
2165
+ INVALID_VARNAME_CHAR_RE: je,
2166
+ NEW_METHOD_TYPE: ee
2167
+ })
2168
+ }), g = h((s) => {
2169
+ i.bindMethodInfo = s;
2170
+ }, {
2171
+ metaData: {
2172
+ id: "engine.setting.event.BindEventsDialogSidebar.selectMethod"
2173
+ },
2174
+ ctx: () => ({
2175
+ props: l,
2176
+ getMethodNameList: t,
2177
+ searchValue: o,
2178
+ filteredMethodList: e,
2179
+ context: i,
2180
+ generateMethodName: p,
2181
+ selectMethod: g,
2182
+ getMetaApi: k,
2183
+ META_APP: C,
2184
+ INVALID_VARNAME_CHAR_RE: je,
2185
+ NEW_METHOD_TYPE: ee
2186
+ })
2187
+ });
2188
+ return nt(() => {
2189
+ var c, d;
2190
+ const s = (c = l.eventBinding) == null ? void 0 : c.eventName, r = (t == null ? void 0 : t().filter((m) => m.includes(s))) || [], u = {
1091
2191
  title: "添加新方法",
1092
- name: _(p, c),
1093
- type: Pe
2192
+ name: p(r, s),
2193
+ type: ee
1094
2194
  };
1095
- (i = f.eventBinding) != null && i.ref ? b({ name: f.eventBinding.ref }) : b(x);
1096
- const n = (o == null ? void 0 : o().filter((d) => d.includes(a.value)).map((d) => ({ name: d }))) || [];
1097
- e.value = [x, ...n];
2195
+ (d = l.eventBinding) != null && d.ref ? g({
2196
+ name: l.eventBinding.ref
2197
+ }) : g(u);
2198
+ const n = (t == null ? void 0 : t().filter((m) => m.includes(o.value)).map((m) => ({
2199
+ name: m
2200
+ }))) || [];
2201
+ e.value = [u, ...n];
1098
2202
  }), {
1099
- context: r,
1100
- searchValue: a,
2203
+ context: i,
2204
+ searchValue: o,
1101
2205
  filteredMethodList: e,
1102
- selectMethod: b
2206
+ selectMethod: g
1103
2207
  };
1104
2208
  }
1105
- }, uo = { class: "dialog-content-left" }, fo = { class: "left-list-wrap" }, vo = { class: "left-action-list" }, go = { class: "action-list-wrap" }, _o = ["onClick"];
1106
- function bo(f, o, a, e, r, _) {
1107
- const b = k("tiny-search");
1108
- return h(), A("div", uo, [
1109
- o[1] || (o[1] = t("div", { class: "left-title" }, "响应方法", -1)),
1110
- t("div", fo, [
1111
- t("div", vo, [
1112
- u(b, {
2209
+ }, pn = { class: "dialog-content-left" }, vn = { class: "left-list-wrap" }, un = { class: "left-action-list" }, fn = { class: "action-list-wrap" }, _n = ["onClick"];
2210
+ function hn(l, t, o, e, i, p) {
2211
+ const g = L("tiny-search");
2212
+ return B(), $("div", pn, [
2213
+ t[1] || (t[1] = v("div", { class: "left-title" }, "响应方法", -1)),
2214
+ v("div", vn, [
2215
+ v("div", un, [
2216
+ E(g, {
1113
2217
  modelValue: e.searchValue,
1114
- "onUpdate:modelValue": o[0] || (o[0] = (c) => e.searchValue = c),
2218
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => e.searchValue = s),
1115
2219
  placeholder: "搜索"
1116
2220
  }, null, 8, ["modelValue"]),
1117
- t("ul", go, [
1118
- (h(!0), A(W, null, ae(e.filteredMethodList, (c) => (h(), A("li", {
1119
- key: c.name,
1120
- onClick: (p) => e.selectMethod(c)
2221
+ v("ul", fn, [
2222
+ (B(!0), $(Oe, null, ze(e.filteredMethodList, (s) => (B(), $("li", {
2223
+ key: s.name,
2224
+ onClick: (r) => e.selectMethod(s)
1121
2225
  }, [
1122
- t("div", {
1123
- class: X(["action-name", { active: c.name === e.context.bindMethodInfo.name }])
1124
- }, B(c.title || c.name), 3)
1125
- ], 8, _o))), 128))
2226
+ v("div", {
2227
+ class: Ne(["action-name", { active: s.name === e.context.bindMethodInfo.name }])
2228
+ }, Y(s.title || s.name), 3)
2229
+ ], 8, _n))), 128))
1126
2230
  ])
1127
2231
  ])
1128
2232
  ])
1129
2233
  ]);
1130
2234
  }
1131
- const ho = /* @__PURE__ */ H(po, [["render", bo], ["__scopeId", "data-v-0859add1"]]), Bo = {
1132
- ...de,
1133
- entry: Wn,
1134
- options: { commonEvents: vn },
2235
+ const bn = /* @__PURE__ */ Ie(gn, [["render", hn], ["__scopeId", "data-v-9bcc2645"]]), Pn = {
2236
+ ...U,
2237
+ entry: en,
2238
+ options: { commonEvents: at },
1135
2239
  components: {
1136
- BindEventsDialogSidebar: ho,
1137
- BindEventsDialogContent: mo
2240
+ BindEventsDialogSidebar: bn,
2241
+ BindEventsDialogContent: mn
1138
2242
  }
1139
2243
  };
1140
2244
  export {
1141
- Bo as default
2245
+ Pn as default
1142
2246
  };
1143
2247
  //# sourceMappingURL=index.js.map