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