@opentiny/tiny-engine-setting-events 2.6.1 → 2.7.0-alpha.0

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