@opentiny/tiny-engine-setting-events 2.5.0-alpha.0 → 2.5.0-alpha.2

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,72 +1,34 @@
1
1
  import "./style.css";
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 = {
2
+ import { ref as F, reactive as K, provide as Ce, resolveComponent as k, createBlock as w, openBlock as b, 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 he, computed as $, watchEffect as Ve, watch as be, 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, useMessage as qe, useProperties as T } from "@opentiny/tiny-engine-meta-register";
5
+ import Ge from "@opentiny/tiny-engine-common/js/i18n";
6
+ import { SvgButton as Ye, BlockLinkEvent as Ze, PluginPanel as We, VueMonaco as Qe } from "@opentiny/tiny-engine-common";
7
+ import { iconChevronDown as en } from "@opentiny/vue-icon";
8
+ import { string2Ast as xe, ast2String as nn } from "@opentiny/tiny-engine-common/js/ast";
9
+ import { CodeConfigurator as on, InputConfigurator as tn, VariableConfigurator as sn, SwitchConfigurator as an } from "@opentiny/tiny-engine-configurator";
10
+ import { PROP_DATA_TYPE as X } from "@opentiny/tiny-engine-common/js/constants";
11
+ import { constants as ln, utils as dn } from "@opentiny/tiny-engine-utils";
12
+ const te = {
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
- }, 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 = {
19
+ }, J = (v, o) => {
20
+ const a = v.__vccOpts || v;
21
+ for (const [e, r] of o)
22
+ a[e] = r;
23
+ return a;
24
+ }, se = F(!1), rn = () => {
25
+ se.value = !0;
26
+ }, ke = () => {
27
+ se.value = !1;
28
+ }, cn = {
67
29
  components: {
68
- TinyButton: Me,
69
- TinyDialogBox: nt
30
+ TinyButton: G,
31
+ TinyDialogBox: Ae
70
32
  },
71
33
  inheritAttrs: !1,
72
34
  props: {
@@ -75,20 +37,8 @@ const U = {
75
37
  default: () => ({})
76
38
  }
77
39
  },
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({
40
+ setup(v) {
41
+ const { BindEventsDialogSidebar: o, BindEventsDialogContent: a } = De(te.id).components, { PLUGIN_NAME: e, activePlugin: r } = ie(), { pageState: _ } = L(), { getMethods: h, saveMethod: c, highlightMethod: p } = Y(Z.Page), s = K({
92
42
  editorContent: "",
93
43
  bindMethodInfo: {},
94
44
  tip: "",
@@ -96,494 +46,91 @@ const U = {
96
46
  enableExtraParams: !1,
97
47
  isValidParams: !0
98
48
  });
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)
49
+ Ce("context", s);
50
+ const x = (g) => {
51
+ s.bindMethodInfo = g;
52
+ }, n = (g) => {
53
+ var B, N;
54
+ if (!g)
144
55
  return;
145
- const _ = (Y = l.eventBinding) == null ? void 0 : Y.eventName;
146
- if (!_)
56
+ const m = (B = v.eventBinding) == null ? void 0 : B.eventName;
57
+ if (!m)
147
58
  return;
148
- const V = (T = g == null ? void 0 : g.currentSchema) == null ? void 0 : T.props;
149
- if (!V)
59
+ const f = (N = _ == null ? void 0 : _.currentSchema) == null ? void 0 : N.props;
60
+ if (!f)
150
61
  return;
151
- const {
152
- name: O,
153
- extra: G
154
- } = b;
155
- l[_] || (V[_] = {
62
+ const { name: C, extra: P } = g;
63
+ v[m] || (f[m] = {
156
64
  type: "JSExpression",
157
65
  value: ""
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)
66
+ }), P && s.enableExtraParams && (f[m].params = P), f[m].value = `this.${C}`, Xe().addHistory();
67
+ }, l = () => {
68
+ s.tipError = !1, s.tip = "", s.isValidParams = !0;
69
+ }, i = () => {
70
+ let g = "";
71
+ if (s.enableExtraParams)
242
72
  try {
243
- b = JSON.parse(a.editorContent), a.isValidParams = Array.isArray(b);
73
+ g = JSON.parse(s.editorContent), s.isValidParams = Array.isArray(g);
244
74
  } catch {
245
- a.isValidParams = !1;
75
+ s.isValidParams = !1;
246
76
  }
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 = {};
77
+ return g;
78
+ }, d = (g) => Array.from({ length: g.length }, (m, f) => `args${f}`).join(","), E = () => {
79
+ var f, C, P, B;
80
+ let g = (C = (f = h()) == null ? void 0 : f[s.bindMethodInfo.name]) == null ? void 0 : C.value, m = "{}";
81
+ if (g) {
82
+ let N = {};
333
83
  try {
334
- T = R(b);
84
+ N = xe(g);
335
85
  } catch {
336
- b = b.replace("function", `function ${a.bindMethodInfo.name}`), T = R(b);
86
+ g = g.replace("function", `function ${s.bindMethodInfo.name}`), N = xe(g);
337
87
  }
338
- (Y = (G = T == null ? void 0 : T.program) == null ? void 0 : G.body[0]) != null && Y.body && (_ = H(T.program.body[0].body));
88
+ (B = (P = N == null ? void 0 : N.program) == null ? void 0 : P.body[0]) != null && B.body && (m = nn(N.program.body[0].body));
339
89
  }
340
- return _ || `{
90
+ return m || `{
341
91
  }`;
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);
92
+ }, V = () => {
93
+ r(e.Page).then(() => {
94
+ Se(() => {
95
+ var g;
96
+ p && p((g = s.bindMethodInfo) == null ? void 0 : g.name);
386
97
  });
387
98
  });
388
- }, {
389
- metaData: {
390
- id: "engine.setting.event.activePagePlugin"
391
- },
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"
99
+ };
100
+ return {
101
+ BindEventsDialogSidebar: o,
102
+ BindEventsDialogContent: a,
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 = d(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();
452
119
  },
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"
120
+ closeDialog: () => {
121
+ l(), ke();
494
122
  },
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"
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), l();
535
126
  },
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
127
+ selectMethod: x
581
128
  };
582
129
  }
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, {
130
+ }, mn = { class: "bind-event-dialog-content" }, pn = { class: "bind-dialog-footer" };
131
+ function un(v, o, a, e, r, _) {
132
+ const h = k("tiny-button"), c = k("tiny-dialog-box");
133
+ return b(), w(c, {
587
134
  visible: e.dialogVisible,
588
135
  title: "事件绑定",
589
136
  width: "50%",
@@ -593,39 +140,39 @@ function Et(l, t, o, e, i, g) {
593
140
  onClose: e.closeDialog,
594
141
  onOpened: e.openedDialog
595
142
  }, {
596
- footer: P(() => [
597
- v("div", bt, [
598
- E(p, { onClick: e.closeDialog }, {
599
- default: P(() => t[0] || (t[0] = [
600
- be("取 消")
143
+ footer: y(() => [
144
+ t("div", pn, [
145
+ u(h, { onClick: e.closeDialog }, {
146
+ default: y(() => o[0] || (o[0] = [
147
+ j("取 消")
601
148
  ])),
602
149
  _: 1
603
150
  }, 8, ["onClick"]),
604
- E(p, {
151
+ u(h, {
605
152
  type: "info",
606
153
  onClick: e.confirm
607
154
  }, {
608
- default: P(() => t[1] || (t[1] = [
609
- be("确 定")
155
+ default: y(() => o[1] || (o[1] = [
156
+ j("确 定")
610
157
  ])),
611
158
  _: 1
612
159
  }, 8, ["onClick"])
613
160
  ])
614
161
  ]),
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), {
162
+ default: y(() => [
163
+ o[2] || (o[2] = t("div", { class: "bind-event-dialog-tip" }, " 选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)。 ", -1)),
164
+ t("div", mn, [
165
+ (b(), w(ge(e.BindEventsDialogSidebar), {
619
166
  dialogVisible: e.dialogVisible,
620
- eventBinding: o.eventBinding
167
+ eventBinding: a.eventBinding
621
168
  }, null, 8, ["dialogVisible", "eventBinding"])),
622
- (N(), Q($e(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
169
+ (b(), w(ge(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
623
170
  ])
624
171
  ]),
625
172
  _: 1
626
173
  }, 8, ["visible", "onClose", "onOpened"]);
627
174
  }
628
- const _e = /* @__PURE__ */ Ce(_t, [["render", Et], ["__scopeId", "data-v-dd1772f5"]]), ot = {
175
+ const vn = /* @__PURE__ */ J(cn, [["render", un], ["__scopeId", "data-v-6b711ca9"]]), fn = {
629
176
  onClick: {
630
177
  label: {
631
178
  zh_CN: "点击事件"
@@ -682,19 +229,120 @@ const _e = /* @__PURE__ */ Ce(_t, [["render", Et], ["__scopeId", "data-v-dd1772f
682
229
  },
683
230
  defaultValue: ""
684
231
  }
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 = {
232
+ }, gn = [
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
+ ], _n = (v) => !!gn.map((a) => {
343
+ const e = a[2].toUpperCase();
344
+ return `${a.substring(0, 2)}${e}${a.substring(3)}`;
345
+ }).includes(v), hn = { class: "footer" }, bn = {
698
346
  __name: "AddEventsDialog",
699
347
  props: {
700
348
  visible: {
@@ -707,155 +355,106 @@ const _e = /* @__PURE__ */ Ce(_t, [["render", Et], ["__scopeId", "data-v-dd1772f
707
355
  }
708
356
  },
709
357
  emits: ["closeDialog", "addEvent"],
710
- setup(l, { emit: t }) {
711
- const o = l, e = t, i = Ae({
358
+ setup(v, { emit: o }) {
359
+ const a = v, e = o, r = K({
712
360
  eventDescription: "",
713
361
  eventName: ""
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(() => {
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, l) => {
373
+ if (a.componentEvents[r.eventName]) {
374
+ l(new Error("事件名已存在"));
375
+ return;
376
+ }
377
+ if (!_n(r.eventName)) {
378
+ l(new Error("请输入正确的浏览器事件名"));
379
+ return;
380
+ }
381
+ l();
382
+ }
383
+ }
384
+ ]
385
+ }, p = () => {
751
386
  e("closeDialog");
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)
387
+ }, s = () => {
388
+ _.value && _.value.validate((x) => {
389
+ if (!x)
770
390
  return;
771
- const {
772
- eventName: n,
773
- eventDescription: c
774
- } = i;
775
- e("addEvent", {
776
- eventName: n,
777
- eventDescription: c
778
- });
391
+ const { eventName: n, eventDescription: l } = r;
392
+ e("addEvent", { eventName: n, eventDescription: l });
779
393
  });
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,
394
+ };
395
+ return (x, n) => (b(), w(D(Ae), {
396
+ visible: v.visible,
798
397
  title: "添加新事件",
799
398
  width: "400px",
800
399
  "append-to-body": !0,
801
400
  "close-on-click-modal": !1,
802
- onClose: S(r)
401
+ onClose: p
803
402
  }, {
804
- footer: P(() => [
805
- v("div", xt, [
806
- E(S(Me), { onClick: S(r) }, {
807
- default: P(() => n[2] || (n[2] = [
808
- be(" 取消")
403
+ footer: y(() => [
404
+ t("div", hn, [
405
+ u(D(G), { onClick: p }, {
406
+ default: y(() => n[2] || (n[2] = [
407
+ j(" 取消")
809
408
  ])),
810
409
  _: 1
811
- }, 8, ["onClick"]),
812
- E(S(Me), {
410
+ }),
411
+ u(D(G), {
813
412
  type: "primary",
814
- onClick: S(a)
413
+ onClick: s
815
414
  }, {
816
- default: P(() => n[3] || (n[3] = [
817
- be(" 确定")
415
+ default: y(() => n[3] || (n[3] = [
416
+ j(" 确定")
818
417
  ])),
819
418
  _: 1
820
- }, 8, ["onClick"])
419
+ })
821
420
  ])
822
421
  ]),
823
- default: P(() => [
824
- E(S(ct), {
422
+ default: y(() => [
423
+ u(D(Te), {
825
424
  ref_key: "ruleForm",
826
- ref: g,
827
- model: i,
828
- rules: s,
425
+ ref: _,
426
+ model: r,
427
+ rules: c,
829
428
  "label-width": "80px",
830
429
  "inline-message": !0,
831
430
  "validate-type": "text",
832
431
  "label-position": "left",
833
432
  class: "add-custom-event-form"
834
433
  }, {
835
- default: P(() => [
836
- E(S(Ye), {
434
+ default: y(() => [
435
+ u(D(Ee), {
837
436
  label: "事件函数名",
838
437
  prop: "eventName",
839
438
  required: ""
840
439
  }, {
841
- default: P(() => [
842
- E(S(Oe), {
843
- modelValue: i.eventName,
844
- "onUpdate:modelValue": n[0] || (n[0] = (c) => i.eventName = c),
440
+ default: y(() => [
441
+ u(D(oe), {
442
+ modelValue: r.eventName,
443
+ "onUpdate:modelValue": n[0] || (n[0] = (l) => r.eventName = l),
845
444
  placeholder: "小驼峰格式,如:onDrag"
846
445
  }, null, 8, ["modelValue"])
847
446
  ]),
848
447
  _: 1
849
448
  }),
850
- E(S(Ye), {
449
+ u(D(Ee), {
851
450
  label: "事件描述",
852
451
  prop: "eventDescription",
853
452
  required: ""
854
453
  }, {
855
- default: P(() => [
856
- E(S(Oe), {
857
- modelValue: i.eventDescription,
858
- "onUpdate:modelValue": n[1] || (n[1] = (c) => i.eventDescription = c)
454
+ default: y(() => [
455
+ u(D(oe), {
456
+ modelValue: r.eventDescription,
457
+ "onUpdate:modelValue": n[1] || (n[1] = (l) => r.eventDescription = l)
859
458
  }, null, 8, ["modelValue"])
860
459
  ]),
861
460
  _: 1
@@ -865,394 +464,114 @@ const _e = /* @__PURE__ */ Ce(_t, [["render", Et], ["__scopeId", "data-v-dd1772f
865
464
  }, 8, ["model"])
866
465
  ]),
867
466
  _: 1
868
- }, 8, ["visible", "onClose"]));
467
+ }, 8, ["visible"]));
869
468
  }
870
- }, he = /* @__PURE__ */ Ce(yt, [["__scopeId", "data-v-98498ef2"]]), Dt = {
469
+ }, En = /* @__PURE__ */ J(bn, [["__scopeId", "data-v-5033228a"]]), yn = {
871
470
  components: {
872
- BlockLinkEvent: ue,
873
- BindEventsDialog: _e,
874
- TinyPopover: mt,
875
- TinyButton: Me,
876
- IconChevronDown: fe(),
877
- SvgButton: ve,
878
- AddEventsDialog: he
471
+ BlockLinkEvent: Ze,
472
+ BindEventsDialog: vn,
473
+ TinyPopover: Ue,
474
+ TinyButton: G,
475
+ IconChevronDown: en(),
476
+ SvgButton: Ye,
477
+ AddEventsDialog: En
879
478
  },
880
479
  inheritAttrs: !1,
881
480
  setup() {
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({
481
+ const { PLUGIN_NAME: v, activePlugin: o } = ie(), { pageState: a } = L(), { getBlockEvents: e, getCurrentBlock: r, removeEventLink: _ } = $e(), { getMaterial: h } = Ke(), { confirm: c } = He(), p = Ge.global.locale.value, { highlightMethod: s } = Y(Z.Page), { commonEvents: x = {} } = De("engine.setting.event").options, n = K({
900
482
  eventName: "",
901
483
  // 事件名称
902
484
  eventBinding: null,
903
485
  // 事件绑定的处理方法对象
904
486
  componentEvent: {},
905
- customEvents: u,
487
+ customEvents: x,
906
488
  bindActions: {},
907
489
  showBindEventDialog: !1
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,
490
+ }), l = $(() => !!a.isBlock), i = $(() => Object.keys(n.bindActions).length === 0), d = $(() => ({ ...n.componentEvent, ...n.customEvents }));
491
+ Ve(() => {
492
+ var B, N, Q, ae, le;
493
+ const m = (B = a == null ? void 0 : a.currentSchema) == null ? void 0 : B.componentName, f = h(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 = a == null ? void 0 : a.currentSchema) == null ? void 0 : le.props) || {}, P = Object.keys(C);
496
+ n.bindActions = {}, Object.entries(d.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,
925
501
  ref: "",
926
- event: O[Ee],
927
- params: lt
502
+ event: C[z],
503
+ params: Le
928
504
  };
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);
505
+ if (O.event.type === "JSExpression" && (O.ref = O.event.value.replace("this.", "").replace(/\(.*\)$/, "")), a.isBlock) {
506
+ O.metaEvent = Be;
507
+ const pe = e(r()), ue = (ce = a == null ? void 0 : a.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);
935
511
  });
936
512
  }
937
- n.bindActions[Ee] = de;
513
+ n.bindActions[z] = O;
938
514
  }
939
515
  });
940
516
  });
941
- const f = h((_, V) => {
942
- V && n.bindActions[_.eventName] || (n.eventBinding = _, w());
943
- }, {
944
- metaData: {
945
- id: "engine.setting.event.openActionDialog"
946
- },
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"
991
- },
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"
517
+ const E = (m, f) => {
518
+ f && n.bindActions[m.eventName] || (n.eventBinding = m, rn());
519
+ }, V = (m) => {
520
+ var C;
521
+ Object.keys(((C = a == null ? void 0 : a.currentSchema) == null ? void 0 : C.props) || {}).indexOf(m.eventName) > -1 && (delete a.currentSchema.props[m.eventName], qe().publish({ topic: "schemaChange", data: { props: a.currentSchema.props } }));
522
+ };
523
+ return {
524
+ state: n,
525
+ isBlock: l,
526
+ isEmpty: i,
527
+ delEvent: (m) => {
528
+ c({
529
+ title: "提示",
530
+ message: `您确定要删除事件 ${m.eventName} 吗?`,
531
+ exec() {
532
+ a.isBlock && _({ linked: m.linked }), V(m);
533
+ }
534
+ });
1043
535
  },
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"
536
+ openCodePanel: (m) => {
537
+ m && o(v.Page).then(() => {
538
+ s && s(m.ref);
539
+ });
1089
540
  },
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"
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;
1133
560
  },
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"
561
+ handleToggleAddEventDialog: (m) => {
562
+ n.showBindEventDialog = m;
1196
563
  },
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
564
+ renderEventList: d,
565
+ locale: p
1247
566
  };
1248
567
  }
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, {
568
+ }, xn = { class: "bind-action-list" }, kn = { class: "popover-head" }, Cn = { class: "bind-event-list" }, Vn = ["onClick"], Nn = { class: "bind-actions" }, An = { class: "action-item bind-action-item" }, Dn = ["onClick"], In = { class: "event-bind" }, Pn = { class: "action-buttons" }, Bn = { class: "empty-action" }, Mn = { class: "icon" };
569
+ function wn(v, o, a, e, r, _) {
570
+ const h = k("icon-chevron-down"), c = k("tiny-button"), p = k("tiny-popover"), s = k("svg-icon"), x = k("block-link-event"), n = k("svg-button"), l = k("bind-events-dialog"), i = k("add-events-dialog");
571
+ return b(), A(H, null, [
572
+ t("div", xn, [
573
+ t("div", kn, [
574
+ u(p, {
1256
575
  popperClass: "option-popper setting-advanced-bind-event-list",
1257
576
  placement: "bottom-start",
1258
577
  trigger: "hover",
@@ -1260,575 +579,316 @@ function Ot(l, t, o, e, i, g) {
1260
579
  width: "256",
1261
580
  "visible-arrow": !1
1262
581
  }, {
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" })
582
+ reference: y(() => [
583
+ u(c, { class: "bind-event-btn" }, {
584
+ default: y(() => [
585
+ o[2] || (o[2] = t("span", null, "绑定事件", -1)),
586
+ u(h, { class: "icon-chevron-down bind-event-btn-icon" })
1268
587
  ]),
1269
588
  _: 1
1270
589
  })
1271
590
  ]),
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)
591
+ default: y(() => [
592
+ t("ul", Cn, [
593
+ (b(!0), A(H, null, ne(e.renderEventList, (d, E) => {
594
+ var V;
595
+ return b(), 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)
1280
599
  }, [
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);
600
+ t("div", null, M(E) + "  |  " + M(((V = d == null ? void 0 : d.label) == null ? void 0 : V[e.locale]) || E), 1)
601
+ ], 10, Vn);
1283
602
  }), 128))
1284
603
  ])
1285
604
  ]),
1286
605
  _: 1
1287
606
  }),
1288
- E(s, {
607
+ u(c, {
1289
608
  class: "title add-custom-event-button bind-action-button-item",
1290
- onClick: t[0] || (t[0] = (m) => e.handleToggleAddEventDialog(!0))
609
+ onClick: o[0] || (o[0] = (d) => e.handleToggleAddEventDialog(!0))
1291
610
  }, {
1292
- default: P(() => [
1293
- E(a, {
611
+ default: y(() => [
612
+ u(s, {
1294
613
  name: "add",
1295
614
  class: "custom-event-button-icon"
1296
615
  }),
1297
- t[3] || (t[3] = v("span", { class: "custom-event-button-text" }, "添加新事件", -1))
616
+ o[3] || (o[3] = t("span", { class: "custom-event-button-text" }, "添加新事件", -1))
1298
617
  ]),
1299
618
  _: 1
1300
619
  })
1301
620
  ]),
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
621
+ _e(t("ul", Nn, [
622
+ (b(!0), A(H, null, ne(e.state.bindActions, (d) => {
623
+ var E, V;
624
+ return b(), A("li", {
625
+ key: d.eventName
1307
626
  }, [
1308
- v("div", It, [
1309
- v("div", {
627
+ t("div", An, [
628
+ t("div", {
1310
629
  class: "binding-name",
1311
- onClick: (D) => e.openActionDialog(m)
630
+ onClick: (I) => e.openActionDialog(d)
1312
631
  }, [
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)
632
+ t("div", null, [
633
+ j(M(d.eventName), 1),
634
+ t("span", null, M((V = (E = e.renderEventList[d.eventName]) == null ? void 0 : E.label) == null ? void 0 : V[e.locale]), 1)
1316
635
  ]),
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, {
636
+ t("div", {
637
+ class: R({ linked: d.linked })
638
+ }, M(d.linkedEventName), 3),
639
+ t("span", In, M(d.ref), 1)
640
+ ], 8, Dn),
641
+ t("div", Pn, [
642
+ e.isBlock ? (b(), w(x, {
1324
643
  key: 0,
1325
- data: m
1326
- }, null, 8, ["data"])) : Pe("", !0),
1327
- E(n, {
644
+ data: d
645
+ }, null, 8, ["data"])) : q("", !0),
646
+ u(n, {
1328
647
  name: "plugin-icon-page-schema",
1329
648
  tips: "定位到代码",
1330
649
  placement: "top",
1331
650
  hoverBgColor: !1,
1332
- onClick: (D) => e.openCodePanel(m)
651
+ onClick: (I) => e.openCodePanel(d)
1333
652
  }, null, 8, ["onClick"]),
1334
- E(n, {
653
+ u(n, {
1335
654
  name: "setting",
1336
655
  hoverBgColor: !1,
1337
- onClick: (D) => e.openActionDialog(m, !1)
656
+ onClick: (I) => e.openActionDialog(d, !1)
1338
657
  }, null, 8, ["onClick"]),
1339
- E(n, {
658
+ u(n, {
1340
659
  name: "delete",
1341
660
  hoverBgColor: !1,
1342
- onClick: (D) => e.delEvent(m)
661
+ onClick: (I) => e.delEvent(d)
1343
662
  }, null, 8, ["onClick"])
1344
663
  ])
1345
664
  ])
1346
665
  ]);
1347
666
  }), 128))
1348
667
  ], 512), [
1349
- [qe, !e.isEmpty]
668
+ [he, !e.isEmpty]
1350
669
  ]),
1351
- He(v("div", wt, [
1352
- v("div", Lt, [
1353
- E(a, {
670
+ _e(t("div", Bn, [
671
+ t("div", Mn, [
672
+ u(s, {
1354
673
  name: "empty-action",
1355
674
  class: "empty-action-icon"
1356
675
  })
1357
676
  ]),
1358
- t[4] || (t[4] = v("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
677
+ o[4] || (o[4] = t("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
1359
678
  ], 512), [
1360
- [qe, e.isEmpty]
679
+ [he, e.isEmpty]
1361
680
  ])
1362
681
  ]),
1363
- E(c, {
682
+ u(l, {
1364
683
  eventBinding: e.state.eventBinding
1365
684
  }, null, 8, ["eventBinding"]),
1366
- E(d, {
685
+ u(i, {
1367
686
  visible: e.state.showBindEventDialog,
1368
687
  componentEvents: e.renderEventList,
1369
- onCloseDialog: t[1] || (t[1] = (m) => e.handleToggleAddEventDialog(!1)),
688
+ onCloseDialog: o[1] || (o[1] = (d) => e.handleToggleAddEventDialog(!1)),
1370
689
  onAddEvent: e.handleAddEvent
1371
690
  }, null, 8, ["visible", "componentEvents", "onAddEvent"])
1372
691
  ], 64);
1373
692
  }
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 = {
693
+ const Ln = /* @__PURE__ */ J(yn, [["render", wn], ["__scopeId", "data-v-3bfab6f4"]]), { DEFAULT_LOOP_NAME: U } = ln, { string2Obj: On } = dn, Sn = {
1379
694
  components: {
1380
- SwitchConfigurator: oe,
1381
- TinyTooltip: pt,
1382
- VariableConfigurator: ne,
1383
- InputConfigurator: te,
1384
- CodeConfigurator: ee
695
+ SwitchConfigurator: an,
696
+ TinyTooltip: je,
697
+ VariableConfigurator: sn,
698
+ InputConfigurator: tn,
699
+ CodeConfigurator: on
1385
700
  },
1386
701
  inheritAttrs: !1,
1387
702
  setup() {
1388
- const {
1389
- pageState: l
1390
- } = x(), t = ke(!1), o = Ne(() => {
703
+ const { pageState: v } = L(), o = F(!1), a = $(() => {
1391
704
  var n;
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({
705
+ return ((n = o.value) == null ? void 0 : n.type) === X.JSEXPRESSION;
706
+ }), e = () => {
707
+ var n, l;
708
+ return ((l = (n = T().getSchema()) == null ? void 0 : n.loopArgs) == null ? void 0 : l[1]) || U.INDEX;
709
+ }, r = K({
1425
710
  loopData: {
1426
- type: q.JSEXPRESSION,
711
+ type: X.JSEXPRESSION,
1427
712
  value: "[]"
1428
713
  },
1429
714
  loopItem: "item",
1430
715
  loopIndex: "index",
1431
- isLoop: Ne(() => {
716
+ isLoop: $(() => {
1432
717
  var n;
1433
- return ((n = i.loopData) == null ? void 0 : n.type) === q.JSEXPRESSION;
718
+ return ((n = r.loopData) == null ? void 0 : n.type) === X.JSEXPRESSION;
1434
719
  }),
1435
720
  loopKey: "",
1436
721
  shouldUpdate: !1
1437
722
  });
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;
723
+ be(
724
+ () => [v == null ? void 0 : v.currentSchema, r.shouldUpdate],
725
+ ([n]) => {
726
+ var l, i, d, 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 = ((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 = ((E = (d = n == null ? void 0 : n.props) == null ? void 0 : d.key) == null ? void 0 : E.value) || "";
728
+ }
729
+ );
730
+ const _ = (n = "") => {
731
+ var I;
1444
732
  n = n.replace(/\s*/g, "");
1445
- const {
1446
- getSchema: c,
1447
- setProp: d
1448
- } = z(), m = c();
1449
- if (!m)
733
+ const { getSchema: l, setProp: i } = T(), d = l();
734
+ if (!d)
1450
735
  return;
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,
736
+ const E = Number(n).toString() !== "NaN";
737
+ let V = (I = d.props) == null ? void 0 : I.key;
738
+ n && !E && (V = {
739
+ type: X.JSEXPRESSION,
1455
740
  value: n
1456
- }), n || (i.isLoop ? y = {
1457
- type: q.JSEXPRESSION,
741
+ }), n || (r.isLoop ? V = {
742
+ type: X.JSEXPRESSION,
1458
743
  value: e()
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
- })
1488
- });
1489
- Ge([() => i.isLoop, () => i.loopIndex], () => {
1490
- !i.loopKey && i.isLoop && g(e()), i.isLoop || g("");
744
+ } : V = ""), i("key", V);
745
+ };
746
+ be([() => r.isLoop, () => r.loopIndex], () => {
747
+ !r.loopKey && r.isLoop && _(e()), r.isLoop || _("");
1491
748
  });
1492
- const p = h(() => {
749
+ const h = () => {
1493
750
  var n;
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)
751
+ r.loopData = (n = T().getSchema()) == null ? void 0 : n.loop;
752
+ }, c = (n) => {
753
+ const { getSchema: l } = T(), i = l();
754
+ if (!i)
1528
755
  return;
1529
- const {
1530
- operateNode: m
1531
- } = x();
756
+ const { operateNode: d } = L();
1532
757
  if (n === !1 || n != null && n.type)
1533
- m({
1534
- type: "updateAttributes",
1535
- id: d.id,
1536
- value: {
1537
- condition: n
1538
- }
1539
- });
758
+ d({ type: "updateAttributes", id: i.id, value: { condition: n } });
1540
759
  else {
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
- });
760
+ const { condition: E, children: V, ...I } = i;
761
+ d({ type: "updateAttributes", id: i.id, value: { ...I }, overwrite: !0 });
1554
762
  }
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
763
+ L().canvasApi.value.updateRect(), o.value = n;
764
+ }, p = (n) => {
765
+ const l = T().getSchema();
766
+ let i = l.loopArgs;
767
+ const { operateNode: d } = L();
768
+ i ? i[1] = n || U.INDEX : i = [U.ITEM, n], d({ type: "updateAttributes", id: l.id, value: { loopArgs: i } });
769
+ };
770
+ return {
771
+ condition: o,
772
+ setConfig: c,
773
+ isBind: a,
774
+ state: r,
775
+ setLoop: (n) => {
776
+ const { operateNode: l } = L(), { getSchema: i } = T(), d = i();
777
+ if (n) {
778
+ const E = n != null && n.type ? n : On(n);
779
+ l({ type: "updateAttributes", id: d.id, value: { loop: E } }), p(U.INDEX);
780
+ } else {
781
+ _();
782
+ const { loop: E, loopArgs: V, children: I, ...W } = d;
783
+ l({ type: "updateAttributes", id: d.id, value: W, overwrite: !0 });
1595
784
  }
1596
- });
1597
- }, {
1598
- metaData: {
1599
- id: "engine.setting.event.setLoopIndex"
785
+ r.shouldUpdate = !r.shouldUpdate;
1600
786
  },
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"
787
+ setLoopItem: (n) => {
788
+ const l = T().getSchema();
789
+ let i = l.loopArgs;
790
+ const { operateNode: d } = L();
791
+ i ? i[0] = n || U.ITEM : i = [n, U.INDEX], d({ type: "updateAttributes", id: l.id, value: { loopArgs: i } });
1659
792
  },
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,
793
+ DEFAULT_LOOP_NAME: U,
794
+ openEditor: h,
795
+ setLoopIndex: p,
796
+ setLoopKey: _,
1737
797
  getIndexName: e
1738
798
  };
1739
799
  }
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", {
800
+ }, Tn = { class: "advanced-config-container" }, Un = { class: "advnce-config" }, jn = { class: "advanced-config-form-item" }, zn = ["title"], Rn = { class: "advnce-config loop-data-item" }, Fn = { class: "advanced-config-form-item" }, Jn = ["title"], Xn = { class: "advnce-config" }, $n = { class: "advanced-config-form-item" }, Kn = { class: "advnce-config" }, Hn = { class: "advanced-config-form-item" }, qn = { class: "advnce-config" }, Gn = { class: "advanced-config-form-item" };
801
+ function Yn(v, o, a, e, r, _) {
802
+ var n, l;
803
+ const h = k("switch-configurator"), c = k("variable-configurator"), p = k("code-configurator"), s = k("input-configurator"), x = k("tiny-tooltip");
804
+ return b(), A("div", Tn, [
805
+ t("div", Un, [
806
+ o[6] || (o[6] = t("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
807
+ t("div", jn, [
808
+ e.isBind ? (b(), A("div", {
1749
809
  key: 1,
1750
810
  class: "binding-state text-ellipsis-multiple",
1751
811
  title: e.condition.value
1752
- }, " 已绑定:" + Z(e.condition.value), 9, Ft)) : (N(), Q(p, {
812
+ }, " 已绑定:" + M(e.condition.value), 9, zn)) : (b(), w(h, {
1753
813
  key: 0,
1754
814
  modelValue: e.condition,
1755
815
  "onUpdate:modelValue": e.setConfig
1756
816
  }, null, 8, ["modelValue", "onUpdate:modelValue"])),
1757
- E(s, {
817
+ u(c, {
1758
818
  modelValue: e.condition,
1759
819
  "onUpdate:modelValue": [
1760
- t[0] || (t[0] = (d) => e.condition = d),
820
+ o[0] || (o[0] = (i) => e.condition = i),
1761
821
  e.setConfig
1762
822
  ],
1763
823
  name: "advance"
1764
824
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
1765
825
  ])
1766
826
  ]),
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", {
827
+ t("div", Rn, [
828
+ o[7] || (o[7] = t("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
829
+ t("div", Fn, [
830
+ e.state.isLoop ? (b(), A("div", {
1771
831
  key: 1,
1772
832
  class: "binding-state text-ellipsis-multiple",
1773
833
  title: (n = e.state.loopData) == null ? void 0 : n.value
1774
- }, " 已绑定:" + Z((c = e.state.loopData) == null ? void 0 : c.value), 9, Xt)) : (N(), Q(r, {
834
+ }, " 已绑定:" + M((l = e.state.loopData) == null ? void 0 : l.value), 9, Jn)) : (b(), w(p, {
1775
835
  key: 0,
1776
836
  modelValue: e.state.loopData,
1777
837
  "onUpdate:modelValue": [
1778
- t[1] || (t[1] = (d) => e.state.loopData = d),
838
+ o[1] || (o[1] = (i) => e.state.loopData = i),
1779
839
  e.setLoop
1780
840
  ],
1781
841
  "data-type": "JSExpression",
1782
842
  onOpen: e.openEditor
1783
843
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onOpen"])),
1784
- E(s, {
844
+ u(c, {
1785
845
  modelValue: e.state.loopData,
1786
846
  "onUpdate:modelValue": [
1787
- t[2] || (t[2] = (d) => e.state.loopData = d),
847
+ o[2] || (o[2] = (i) => e.state.loopData = i),
1788
848
  e.setLoop
1789
849
  ],
1790
850
  name: "advance"
1791
851
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
1792
852
  ])
1793
853
  ]),
1794
- v("div", Kt, [
1795
- t[8] || (t[8] = v("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
1796
- v("div", $t, [
1797
- E(a, {
854
+ t("div", Xn, [
855
+ o[8] || (o[8] = t("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
856
+ t("div", $n, [
857
+ u(s, {
1798
858
  modelValue: e.state.loopItem,
1799
859
  "onUpdate:modelValue": [
1800
- t[3] || (t[3] = (d) => e.state.loopItem = d),
860
+ o[3] || (o[3] = (i) => e.state.loopItem = i),
1801
861
  e.setLoopItem
1802
862
  ],
1803
863
  placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.ITEM}`
1804
864
  }, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
1805
865
  ])
1806
866
  ]),
1807
- v("div", Ht, [
1808
- t[9] || (t[9] = v("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
1809
- v("div", qt, [
1810
- E(a, {
867
+ t("div", Kn, [
868
+ o[9] || (o[9] = t("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
869
+ t("div", Hn, [
870
+ u(s, {
1811
871
  modelValue: e.state.loopIndex,
1812
872
  "onUpdate:modelValue": [
1813
- t[4] || (t[4] = (d) => e.state.loopIndex = d),
873
+ o[4] || (o[4] = (i) => e.state.loopIndex = i),
1814
874
  e.setLoopIndex
1815
875
  ],
1816
876
  placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.INDEX}`
1817
877
  }, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
1818
878
  ])
1819
879
  ]),
1820
- v("div", Gt, [
1821
- t[10] || (t[10] = v("label", { class: "text-ellipsis-multiple" }, "key", -1)),
1822
- v("div", Yt, [
1823
- E(u, {
880
+ t("div", qn, [
881
+ o[10] || (o[10] = t("label", { class: "text-ellipsis-multiple" }, "key", -1)),
882
+ t("div", Gn, [
883
+ u(x, {
1824
884
  content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存",
1825
885
  effect: "light"
1826
886
  }, {
1827
- default: P(() => [
1828
- E(a, {
887
+ default: y(() => [
888
+ u(s, {
1829
889
  modelValue: e.state.loopKey,
1830
890
  "onUpdate:modelValue": [
1831
- t[5] || (t[5] = (d) => e.state.loopKey = d),
891
+ o[5] || (o[5] = (i) => e.state.loopKey = i),
1832
892
  e.setLoopKey
1833
893
  ],
1834
894
  placeholder: `默认为索引名:${e.getIndexName()}`
@@ -1840,46 +900,44 @@ function Zt(l, t, o, e, i, g) {
1840
900
  ])
1841
901
  ]);
1842
902
  }
1843
- const Wt = /* @__PURE__ */ Ce(Tt, [["render", Zt], ["__scopeId", "data-v-9775ff6f"]]), Qt = {
903
+ const Zn = /* @__PURE__ */ J(Sn, [["render", Yn], ["__scopeId", "data-v-2254f006"]]), Wn = {
1844
904
  __name: "Main",
1845
905
  props: {
1846
906
  fixedPanels: Array
1847
907
  },
1848
908
  emits: [],
1849
- setup(l, { emit: t }) {
1850
- const o = ke(["bindEvent", "advancedConfig"]), {
1851
- PLUGIN_NAME: e
1852
- } = I(), g = Ae({
1853
- emitEvent: t
909
+ setup(v, { emit: o }) {
910
+ const a = F(["bindEvent", "advancedConfig"]), { PLUGIN_NAME: e } = ie(), _ = K({
911
+ emitEvent: o
1854
912
  });
1855
- return Qe("panelState", g), (p, s) => (N(), Q(S(ft), {
913
+ return Ce("panelState", _), (h, c) => (b(), w(D(We), {
1856
914
  title: "高级",
1857
- "fixed-panels": l.fixedPanels,
1858
- "fixed-name": S(e).Event,
915
+ "fixed-panels": v.fixedPanels,
916
+ "fixed-name": D(e).Event,
1859
917
  "header-margin-bottom": 0,
1860
- onClose: s[1] || (s[1] = (r) => p.$emit("close"))
918
+ onClose: c[1] || (c[1] = (p) => h.$emit("close"))
1861
919
  }, {
1862
- content: P(() => [
1863
- E(S(gt), {
1864
- modelValue: o.value,
1865
- "onUpdate:modelValue": s[0] || (s[0] = (r) => o.value = r)
920
+ content: y(() => [
921
+ u(D(ze), {
922
+ modelValue: a.value,
923
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => a.value = p)
1866
924
  }, {
1867
- default: P(() => [
1868
- E(S(Ze), {
925
+ default: y(() => [
926
+ u(D(ye), {
1869
927
  title: "事件绑定",
1870
928
  name: "bindEvent"
1871
929
  }, {
1872
- default: P(() => [
1873
- E(St)
930
+ default: y(() => [
931
+ u(Ln)
1874
932
  ]),
1875
933
  _: 1
1876
934
  }),
1877
- E(S(Ze), {
935
+ u(D(ye), {
1878
936
  title: "高级配置",
1879
937
  name: "advancedConfig"
1880
938
  }, {
1881
- default: P(() => [
1882
- E(Wt)
939
+ default: y(() => [
940
+ u(Zn)
1883
941
  ]),
1884
942
  _: 1
1885
943
  })
@@ -1890,221 +948,113 @@ const Wt = /* @__PURE__ */ Ce(Tt, [["render", Zt], ["__scopeId", "data-v-9775ff6
1890
948
  _: 1
1891
949
  }, 8, ["fixed-panels", "fixed-name"]));
1892
950
  }
1893
- }, W = "newMethod", we = /[^0-9a-zA-Z_$]/, ye = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, ae = {
1894
- default: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)",
951
+ }, Ie = "newMethod", Qn = /[^0-9a-zA-Z_$]/, eo = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, ee = {
1895
952
  exist: "方法名称已存在",
1896
953
  ruleInvalid: "请输入有效的方法名,可以由字母、数字、下划线、$ 符号组成,不能以数字开头",
1897
954
  empty: "方法名称不能为空"
1898
- }, en = {
955
+ }, no = {
1899
956
  components: {
1900
- MonacoEditor: xe,
1901
- TinyInput: Oe,
1902
- TinyCheckbox: vt
957
+ MonacoEditor: Qe,
958
+ TinyInput: oe,
959
+ TinyCheckbox: Re
1903
960
  },
1904
961
  props: {
1905
962
  dialogVisible: Boolean
1906
963
  },
1907
964
  setup() {
1908
- const {
1909
- getMethodNameList: l
1910
- } = C(k.Page), t = tt("context"), o = {
965
+ const { getMethodNameList: v } = Y(Z.Page), o = Ne("context"), a = {
1911
966
  language: "json",
1912
967
  lineNumbers: !1,
1913
968
  minimap: {
1914
969
  enabled: !1
1915
970
  }
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;
971
+ }, e = (p) => {
972
+ o.editorContent = p;
973
+ }, r = (p) => !p, _ = (p) => v == null ? void 0 : v().includes(p), h = (p) => !eo.test(p);
974
+ return {
975
+ NEW_METHOD_TYPE: Ie,
976
+ context: o,
977
+ editorOptions: a,
978
+ change: (p) => {
979
+ const s = [
980
+ { validator: r, tip: ee.empty },
981
+ { validator: _, tip: ee.exist },
982
+ { validator: h, 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
+ }
2014
990
  }
2015
- }
2016
- t.tipError = !1, t.tip = "";
2017
- }, {
2018
- metaData: {
2019
- id: "engine.setting.event.change"
991
+ o.tipError = !1, o.tip = "";
2020
992
  },
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,
2043
993
  editorContentChange: e
2044
994
  };
2045
995
  }
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 = {
996
+ }, oo = { class: "content-right" }, to = { class: "new-action-tip" }, io = { class: "content-right-title" }, so = { class: "set-params-tip" }, ao = { class: "content-right-monaco" }, lo = {
2047
997
  key: 1,
2048
998
  class: "mark"
2049
- }, dn = {
999
+ }, ro = {
2050
1000
  key: 0,
2051
1001
  class: "params-tip"
2052
1002
  };
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 }])
1003
+ function co(v, o, a, e, r, _) {
1004
+ const h = k("tiny-input"), c = k("tiny-checkbox"), p = k("monaco-editor");
1005
+ return b(), A("div", oo, [
1006
+ t("div", {
1007
+ class: R(["content-right-top", { "tip-error": e.context.tipError }])
2058
1008
  }, [
2059
- t[2] || (t[2] = v("div", { class: "content-right-title" }, "方法名称", -1)),
2060
- E(p, {
1009
+ o[2] || (o[2] = t("div", { class: "content-right-title" }, "方法名称", -1)),
1010
+ u(h, {
2061
1011
  modelValue: e.context.bindMethodInfo.name,
2062
1012
  "onUpdate:modelValue": [
2063
- t[0] || (t[0] = (a) => e.context.bindMethodInfo.name = a),
1013
+ o[0] || (o[0] = (s) => e.context.bindMethodInfo.name = s),
2064
1014
  e.change
2065
1015
  ],
2066
1016
  disabled: e.context.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
2067
- class: De([{ "status-error": e.context.tipError }]),
1017
+ class: R([{ "status-error": e.context.tipError }]),
2068
1018
  placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
2069
1019
  }, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
2070
- v("div", nn, Z(e.context.tip), 1)
1020
+ t("div", to, M(e.context.tip), 1)
2071
1021
  ], 2),
2072
- v("div", {
2073
- class: De(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
1022
+ t("div", {
1023
+ class: R(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
2074
1024
  }, [
2075
- v("div", on, [
2076
- E(s, {
1025
+ t("div", io, [
1026
+ u(c, {
2077
1027
  modelValue: e.context.enableExtraParams,
2078
- "onUpdate:modelValue": t[1] || (t[1] = (a) => e.context.enableExtraParams = a),
1028
+ "onUpdate:modelValue": o[1] || (o[1] = (s) => e.context.enableExtraParams = s),
2079
1029
  name: "tiny-checkbox"
2080
1030
  }, {
2081
- default: P(() => t[3] || (t[3] = [
2082
- be("扩展参数设置")
1031
+ default: y(() => o[3] || (o[3] = [
1032
+ j("扩展参数设置")
2083
1033
  ])),
2084
1034
  _: 1
2085
1035
  }, 8, ["modelValue"]),
2086
- v("div", an, [
2087
- t[4] || (t[4] = v("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
2088
- be(" 如: " + Z(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
1036
+ t("div", so, [
1037
+ o[4] || (o[4] = t("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
1038
+ j(" 如: " + M(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
2089
1039
  ])
2090
1040
  ]),
2091
- v("div", sn, [
2092
- o.dialogVisible ? (N(), Q(r, {
1041
+ t("div", ao, [
1042
+ a.dialogVisible ? (b(), w(p, {
2093
1043
  key: 0,
2094
1044
  value: e.context.editorContent,
2095
1045
  options: e.editorOptions,
2096
1046
  onChange: e.editorContentChange,
2097
1047
  class: "monaco-editor"
2098
- }, null, 8, ["value", "options", "onChange"])) : Pe("", !0),
2099
- e.context.enableExtraParams ? Pe("", !0) : (N(), X("div", ln))
1048
+ }, null, 8, ["value", "options", "onChange"])) : q("", !0),
1049
+ e.context.enableExtraParams ? q("", !0) : (b(), A("div", lo))
2100
1050
  ]),
2101
- !e.context.isValidParams && e.context.enableExtraParams ? (N(), X("div", dn, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : Pe("", !0)
1051
+ !e.context.isValidParams && e.context.enableExtraParams ? (b(), A("div", ro, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : q("", !0)
2102
1052
  ], 2)
2103
1053
  ]);
2104
1054
  }
2105
- const cn = /* @__PURE__ */ Ce(en, [["render", rn], ["__scopeId", "data-v-f458a3c0"]]), mn = {
1055
+ const mo = /* @__PURE__ */ J(no, [["render", co], ["__scopeId", "data-v-f2c9b5af"]]), po = {
2106
1056
  components: {
2107
- TinySearch: ut
1057
+ TinySearch: Fe
2108
1058
  },
2109
1059
  props: {
2110
1060
  eventBinding: {
@@ -2112,109 +1062,69 @@ const cn = /* @__PURE__ */ Ce(en, [["render", rn], ["__scopeId", "data-v-f458a3c
2112
1062
  default: () => ({})
2113
1063
  }
2114
1064
  },
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 = {
1065
+ setup(v) {
1066
+ const { getMethodNameList: o } = Y(Z.Page), a = F(""), e = F([]), r = Ne("context"), _ = (c, p) => {
1067
+ const s = c.map((l) => {
1068
+ var i;
1069
+ return Number.parseInt((i = l.match(/\d+$/)) == null ? void 0 : i[0]) || 0;
1070
+ }).sort((l, i) => l - i).pop();
1071
+ let n = `${(p == null ? void 0 : p.replace(Qn, "_")) || ""}New`;
1072
+ return s > -1 && (n += `${s + 1}`), n;
1073
+ }, h = (c) => {
1074
+ r.bindMethodInfo = c;
1075
+ };
1076
+ return Ve(() => {
1077
+ var l, i;
1078
+ const c = (l = v.eventBinding) == null ? void 0 : l.eventName, p = (o == null ? void 0 : o().filter((d) => d.includes(c))) || [], x = {
2165
1079
  title: "添加新方法",
2166
- name: g(r, s),
2167
- type: W
1080
+ name: _(p, c),
1081
+ type: Ie
2168
1082
  };
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];
1083
+ (i = v.eventBinding) != null && i.ref ? h({ name: v.eventBinding.ref }) : h(x);
1084
+ const n = (o == null ? void 0 : o().filter((d) => d.includes(a.value)).map((d) => ({ name: d }))) || [];
1085
+ e.value = [x, ...n];
2176
1086
  }), {
2177
- context: i,
2178
- searchValue: o,
1087
+ context: r,
1088
+ searchValue: a,
2179
1089
  filteredMethodList: e,
2180
- selectMethod: p
1090
+ selectMethod: h
2181
1091
  };
2182
1092
  }
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, {
1093
+ }, uo = { class: "dialog-content-left" }, vo = { class: "left-list-wrap" }, fo = { class: "left-action-list" }, go = { class: "action-list-wrap" }, _o = ["onClick"];
1094
+ function ho(v, o, a, e, r, _) {
1095
+ const h = k("tiny-search");
1096
+ return b(), A("div", uo, [
1097
+ o[1] || (o[1] = t("div", { class: "left-title" }, "响应方法", -1)),
1098
+ t("div", vo, [
1099
+ t("div", fo, [
1100
+ u(h, {
2191
1101
  modelValue: e.searchValue,
2192
- "onUpdate:modelValue": t[0] || (t[0] = (s) => e.searchValue = s),
1102
+ "onUpdate:modelValue": o[0] || (o[0] = (c) => e.searchValue = c),
2193
1103
  placeholder: "搜索"
2194
1104
  }, null, 8, ["modelValue"]),
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)
1105
+ t("ul", go, [
1106
+ (b(!0), A(H, null, ne(e.filteredMethodList, (c) => (b(), A("li", {
1107
+ key: c.name,
1108
+ onClick: (p) => e.selectMethod(c)
2199
1109
  }, [
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))
1110
+ t("div", {
1111
+ class: R(["action-name", { active: c.name === e.context.bindMethodInfo.name }])
1112
+ }, M(c.title || c.name), 3)
1113
+ ], 8, _o))), 128))
2204
1114
  ])
2205
1115
  ])
2206
1116
  ])
2207
1117
  ]);
2208
1118
  }
2209
- const hn = /* @__PURE__ */ Ce(mn, [["render", _n], ["__scopeId", "data-v-72be2619"]]), Pn = {
2210
- ...U,
2211
- entry: Qt,
2212
- options: { commonEvents: ot },
1119
+ const bo = /* @__PURE__ */ J(po, [["render", ho], ["__scopeId", "data-v-0859add1"]]), Bo = {
1120
+ ...te,
1121
+ entry: Wn,
1122
+ options: { commonEvents: fn },
2213
1123
  components: {
2214
- BindEventsDialogSidebar: hn,
2215
- BindEventsDialogContent: cn
1124
+ BindEventsDialogSidebar: bo,
1125
+ BindEventsDialogContent: mo
2216
1126
  }
2217
1127
  };
2218
1128
  export {
2219
- Pn as default
1129
+ Bo as default
2220
1130
  };