@opentiny/tiny-engine-setting-events 2.0.0 → 2.1.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,34 @@
1
1
  import "./style.css";
2
- import { ref as R, reactive as q, provide as Oe, resolveComponent as y, openBlock as _, createBlock as M, withCtx as x, createElementVNode as t, createVNode as m, createTextVNode as S, resolveDynamicComponent as fe, nextTick as Le, unref as P, computed as X, watchEffect as xe, createElementBlock as I, Fragment as H, renderList as ee, normalizeClass as z, toDisplayString as B, withDirectives as ge, createCommentVNode as K, vShow as ve, watch as _e, inject as ke } from "vue";
3
- import { Button as $, DialogBox as Ve, Form as Te, FormItem as he, Input as ne, Popover as Ue, Tooltip as je, Collapse as ze, CollapseItem as be, Checkbox as Re, Search as Je } from "@opentiny/vue";
4
- import { getMergeMeta as Ce, useLayout as De, useCanvas as Y, getMetaApi as Z, META_APP as G, getOptions as Fe, useHistory as Xe, useBlock as Ke, useMaterial as He, useModal as $e, useProperties as D } from "@opentiny/tiny-engine-meta-register";
2
+ import { ref as J, reactive as q, provide as Oe, resolveComponent as x, openBlock as _, createBlock as w, withCtx as k, createElementVNode as t, createVNode as p, createTextVNode as O, resolveDynamicComponent as fe, nextTick as Se, unref as B, computed as K, watchEffect as ke, createElementBlock as A, Fragment as $, renderList as ne, normalizeClass as R, toDisplayString as M, withDirectives as ge, createCommentVNode as H, vShow as _e, watch as be, inject as Ve } from "vue";
3
+ import { Button as Y, DialogBox as Ce, Form as Te, FormItem as he, Input as oe, Popover as Ue, Tooltip as je, Collapse as ze, CollapseItem as ye, Checkbox as Re, Search as Je } from "@opentiny/vue";
4
+ import { getMergeMeta as Ne, useLayout as Ae, useCanvas as L, getMetaApi as Z, META_APP as G, getOptions as Fe, useHistory as Xe, useBlock as Ke, useMaterial as He, useModal as $e, useProperties as U } from "@opentiny/tiny-engine-meta-register";
5
5
  import Ye from "@opentiny/tiny-engine-common/js/i18n";
6
6
  import { BlockLinkEvent as qe, SvgButton as Ze, VueMonaco as Ge } from "@opentiny/tiny-engine-common";
7
7
  import { iconChevronDown as We, iconYes as Qe } from "@opentiny/vue-icon";
8
8
  import { string2Ast as Ee, ast2String as en } from "@opentiny/tiny-engine-common/js/ast";
9
9
  import { SwitchConfigurator as nn, VariableConfigurator as on, InputConfigurator as tn, CodeConfigurator as sn } from "@opentiny/tiny-engine-configurator";
10
- import { PROP_DATA_TYPE as F } from "@opentiny/tiny-engine-common/js/constants";
10
+ import { PROP_DATA_TYPE as X } from "@opentiny/tiny-engine-common/js/constants";
11
11
  import { constants as an, utils as ln } from "@opentiny/tiny-engine-utils";
12
- const oe = {
12
+ const te = {
13
13
  id: "engine.setting.event",
14
14
  title: "高级",
15
15
  type: "setting",
16
16
  align: "left",
17
17
  name: "event",
18
18
  icon: ""
19
- }, J = (p, o) => {
20
- const a = p.__vccOpts || p;
21
- for (const [e, s] of o)
22
- a[e] = s;
23
- return a;
24
- }, te = R(!1), dn = () => {
25
- te.value = !0;
26
- }, ye = () => {
27
- te.value = !1;
19
+ }, F = (u, o) => {
20
+ const r = u.__vccOpts || u;
21
+ for (const [e, d] of o)
22
+ r[e] = d;
23
+ return r;
24
+ }, ie = J(!1), dn = () => {
25
+ ie.value = !0;
26
+ }, xe = () => {
27
+ ie.value = !1;
28
28
  }, rn = {
29
29
  components: {
30
- TinyButton: $,
31
- TinyDialogBox: Ve
30
+ TinyButton: Y,
31
+ TinyDialogBox: Ce
32
32
  },
33
33
  inheritAttrs: !1,
34
34
  props: {
@@ -37,8 +37,8 @@ const oe = {
37
37
  default: () => ({})
38
38
  }
39
39
  },
40
- setup(p) {
41
- const { BindEventsDialogSidebar: o, BindEventsDialogContent: a } = Ce(oe.id).components, { PLUGIN_NAME: e, activePlugin: s } = De(), { pageState: h } = Y(), { getMethods: b, saveMethod: f, highlightMethod: l } = Z(G.Page), i = q({
40
+ setup(u) {
41
+ const { BindEventsDialogSidebar: o, BindEventsDialogContent: r } = Ne(te.id).components, { PLUGIN_NAME: e, activePlugin: d } = Ae(), { pageState: b } = L(), { getMethods: h, saveMethod: v, highlightMethod: c } = Z(G.Page), i = q({
42
42
  editorContent: "",
43
43
  bindMethodInfo: {},
44
44
  tip: "",
@@ -47,88 +47,88 @@ const oe = {
47
47
  isValidParams: !0
48
48
  });
49
49
  Oe("context", i);
50
- const E = (v) => {
51
- i.bindMethodInfo = v;
52
- }, n = (v) => {
53
- var A, C;
54
- if (!v)
50
+ const E = (g) => {
51
+ i.bindMethodInfo = g;
52
+ }, n = (g) => {
53
+ var P, N;
54
+ if (!g)
55
55
  return;
56
- const r = (A = p.eventBinding) == null ? void 0 : A.eventName;
57
- if (!r)
56
+ const m = (P = u.eventBinding) == null ? void 0 : P.eventName;
57
+ if (!m)
58
58
  return;
59
- const g = (C = h == null ? void 0 : h.currentSchema) == null ? void 0 : C.props;
60
- if (!g)
59
+ const f = (N = b == null ? void 0 : b.currentSchema) == null ? void 0 : N.props;
60
+ if (!f)
61
61
  return;
62
- const { name: k, extra: N } = v;
63
- p[r] || (g[r] = {
62
+ const { name: V, extra: I } = g;
63
+ u[m] || (f[m] = {
64
64
  type: "JSExpression",
65
65
  value: ""
66
- }), N && i.enableExtraParams && (g[r].params = N), g[r].value = `this.${k}`, Xe().addHistory();
67
- }, d = () => {
66
+ }), I && i.enableExtraParams && (f[m].params = I), f[m].value = `this.${V}`, Xe().addHistory();
67
+ }, a = () => {
68
68
  i.tipError = !1, i.tip = "", i.isValidParams = !0;
69
- }, u = () => {
70
- let v = "";
69
+ }, s = () => {
70
+ let g = "";
71
71
  if (i.enableExtraParams)
72
72
  try {
73
- v = JSON.parse(i.editorContent), i.isValidParams = Array.isArray(v);
73
+ g = JSON.parse(i.editorContent), i.isValidParams = Array.isArray(g);
74
74
  } catch {
75
75
  i.isValidParams = !1;
76
76
  }
77
- return v;
78
- }, c = (v) => Array.from({ length: v.length }, (r, g) => `args${g}`).join(","), V = () => {
79
- var g, k, N, A;
80
- let v = (k = (g = b()) == null ? void 0 : g[i.bindMethodInfo.name]) == null ? void 0 : k.value, r = "{}";
81
- if (v) {
82
- let C = {};
77
+ return g;
78
+ }, l = (g) => Array.from({ length: g.length }, (m, f) => `args${f}`).join(","), y = () => {
79
+ var f, V, I, P;
80
+ let g = (V = (f = h()) == null ? void 0 : f[i.bindMethodInfo.name]) == null ? void 0 : V.value, m = "{}";
81
+ if (g) {
82
+ let N = {};
83
83
  try {
84
- C = Ee(v);
84
+ N = Ee(g);
85
85
  } catch {
86
- v = v.replace("function", `function ${i.bindMethodInfo.name}`), C = Ee(v);
86
+ g = g.replace("function", `function ${i.bindMethodInfo.name}`), N = Ee(g);
87
87
  }
88
- (A = (N = C == null ? void 0 : C.program) == null ? void 0 : N.body[0]) != null && A.body && (r = en(C.program.body[0].body));
88
+ (P = (I = N == null ? void 0 : N.program) == null ? void 0 : I.body[0]) != null && P.body && (m = en(N.program.body[0].body));
89
89
  }
90
- return r || `{
90
+ return m || `{
91
91
  }`;
92
- }, w = () => {
93
- s(e.Page).then(() => {
94
- Le(() => {
95
- var v;
96
- l && l((v = i.bindMethodInfo) == null ? void 0 : v.name);
92
+ }, C = () => {
93
+ d(e.Page).then(() => {
94
+ Se(() => {
95
+ var g;
96
+ c && c((g = i.bindMethodInfo) == null ? void 0 : g.name);
97
97
  });
98
98
  });
99
99
  };
100
100
  return {
101
101
  BindEventsDialogSidebar: o,
102
- BindEventsDialogContent: a,
102
+ BindEventsDialogContent: r,
103
103
  state: i,
104
- dialogVisible: te,
104
+ dialogVisible: ie,
105
105
  confirm: async () => {
106
106
  if (i.tipError)
107
107
  return;
108
- let v = "event", r = u(), g = v;
108
+ let g = "event", m = s(), f = g;
109
109
  if (!i.isValidParams)
110
110
  return;
111
- r && (v = r.join(","), g = c(r)), n({ ...i.bindMethodInfo, params: v, extra: r });
112
- const k = V(), { name: N } = i.bindMethodInfo, A = {
113
- name: N,
114
- content: i.enableExtraParams ? `function ${N}(eventArgs,${g}) ${k}` : `function ${N}(${g}) ${k}`
115
- }, { beforeSaveMethod: C } = Fe(oe.id);
116
- typeof C == "function" && await C(A, i.bindMethodInfo), f == null || f(A), w(), ye();
111
+ m && (g = m.join(","), f = l(m)), n({ ...i.bindMethodInfo, params: g, extra: m });
112
+ const V = y(), { name: I } = i.bindMethodInfo, P = {
113
+ name: I,
114
+ content: i.enableExtraParams ? `function ${I}(eventArgs,${f}) ${V}` : `function ${I}(${f}) ${V}`
115
+ }, { beforeSaveMethod: N } = Fe(te.id);
116
+ typeof N == "function" && await N(P, i.bindMethodInfo), v == null || v(P), C(), xe();
117
117
  },
118
118
  closeDialog: () => {
119
- d(), ye();
119
+ a(), xe();
120
120
  },
121
121
  openedDialog: () => {
122
- var v, r, g;
123
- i.enableExtraParams = !!((r = (v = p.eventBinding) == null ? void 0 : v.params) != null && r.length), i.editorContent = JSON.stringify(((g = p.eventBinding) == null ? void 0 : g.params) || [], null, 2), d();
122
+ var g, m, f;
123
+ i.enableExtraParams = !!((m = (g = u.eventBinding) == null ? void 0 : g.params) != null && m.length), i.editorContent = JSON.stringify(((f = u.eventBinding) == null ? void 0 : f.params) || [], null, 2), a();
124
124
  },
125
125
  selectMethod: E
126
126
  };
127
127
  }
128
128
  }, cn = { class: "bind-event-dialog-content" }, mn = { class: "bind-dialog-footer" };
129
- function pn(p, o, a, e, s, h) {
130
- const b = y("tiny-button"), f = y("tiny-dialog-box");
131
- return _(), M(f, {
129
+ function pn(u, o, r, e, d, b) {
130
+ const h = x("tiny-button"), v = x("tiny-dialog-box");
131
+ return _(), w(v, {
132
132
  visible: e.dialogVisible,
133
133
  title: "事件绑定",
134
134
  width: "50%",
@@ -138,39 +138,39 @@ function pn(p, o, a, e, s, h) {
138
138
  onClose: e.closeDialog,
139
139
  onOpened: e.openedDialog
140
140
  }, {
141
- footer: x(() => [
141
+ footer: k(() => [
142
142
  t("div", mn, [
143
- m(b, { onClick: e.closeDialog }, {
144
- default: x(() => o[0] || (o[0] = [
145
- S("取 消")
143
+ p(h, { onClick: e.closeDialog }, {
144
+ default: k(() => o[0] || (o[0] = [
145
+ O("取 消")
146
146
  ])),
147
147
  _: 1
148
148
  }, 8, ["onClick"]),
149
- m(b, {
149
+ p(h, {
150
150
  type: "info",
151
151
  onClick: e.confirm
152
152
  }, {
153
- default: x(() => o[1] || (o[1] = [
154
- S("确 定")
153
+ default: k(() => o[1] || (o[1] = [
154
+ O("确 定")
155
155
  ])),
156
156
  _: 1
157
157
  }, 8, ["onClick"])
158
158
  ])
159
159
  ]),
160
- default: x(() => [
160
+ default: k(() => [
161
161
  o[2] || (o[2] = t("div", { class: "bind-event-dialog-tip" }, " 选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)。 ", -1)),
162
162
  t("div", cn, [
163
- (_(), M(fe(e.BindEventsDialogSidebar), {
163
+ (_(), w(fe(e.BindEventsDialogSidebar), {
164
164
  dialogVisible: e.dialogVisible,
165
- eventBinding: a.eventBinding
165
+ eventBinding: r.eventBinding
166
166
  }, null, 8, ["dialogVisible", "eventBinding"])),
167
- (_(), M(fe(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
167
+ (_(), w(fe(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
168
168
  ])
169
169
  ]),
170
170
  _: 1
171
171
  }, 8, ["visible", "onClose", "onOpened"]);
172
172
  }
173
- const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c"]]), fn = {
173
+ const un = /* @__PURE__ */ F(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c"]]), vn = {
174
174
  onClick: {
175
175
  label: {
176
176
  zh_CN: "点击事件"
@@ -227,7 +227,7 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
227
227
  },
228
228
  defaultValue: ""
229
229
  }
230
- }, gn = [
230
+ }, fn = [
231
231
  "onabort",
232
232
  "onafterprint",
233
233
  "onanimationend",
@@ -337,10 +337,10 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
337
337
  "onwebkitanimationstart",
338
338
  "onwebkittransitionend",
339
339
  "onwheel"
340
- ], vn = (p) => !!gn.map((a) => {
341
- let e = a[2].toUpperCase();
342
- return `${a.substring(0, 2)}${e}${a.substring(3)}`;
343
- }).includes(p), _n = { class: "footer" }, hn = {
340
+ ], gn = (u) => !!fn.map((r) => {
341
+ let e = r[2].toUpperCase();
342
+ return `${r.substring(0, 2)}${e}${r.substring(3)}`;
343
+ }).includes(u), _n = { class: "footer" }, bn = {
344
344
  __name: "AddEventsDialog",
345
345
  props: {
346
346
  visible: {
@@ -353,11 +353,11 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
353
353
  }
354
354
  },
355
355
  emits: ["closeDialog", "addEvent"],
356
- setup(p, { emit: o }) {
357
- const a = p, e = o, s = q({
356
+ setup(u, { emit: o }) {
357
+ const r = u, e = o, d = q({
358
358
  eventDescription: "",
359
359
  eventName: ""
360
- }), h = R(null), f = {
360
+ }), b = J(null), v = {
361
361
  eventDescription: [
362
362
  {
363
363
  required: !0,
@@ -367,92 +367,92 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
367
367
  eventName: [
368
368
  { required: !0, message: "必填" },
369
369
  {
370
- validator: (E, n, d) => {
371
- if (a.componentEvents[s.eventName]) {
372
- d(new Error("事件名已存在"));
370
+ validator: (E, n, a) => {
371
+ if (r.componentEvents[d.eventName]) {
372
+ a(new Error("事件名已存在"));
373
373
  return;
374
374
  }
375
- if (!vn(s.eventName)) {
376
- d(new Error("请输入正确的浏览器事件名"));
375
+ if (!gn(d.eventName)) {
376
+ a(new Error("请输入正确的浏览器事件名"));
377
377
  return;
378
378
  }
379
- d();
379
+ a();
380
380
  }
381
381
  }
382
382
  ]
383
- }, l = () => {
383
+ }, c = () => {
384
384
  e("closeDialog");
385
385
  }, i = () => {
386
- h.value && h.value.validate((E) => {
386
+ b.value && b.value.validate((E) => {
387
387
  if (!E)
388
388
  return;
389
- const { eventName: n, eventDescription: d } = s;
390
- e("addEvent", { eventName: n, eventDescription: d });
389
+ const { eventName: n, eventDescription: a } = d;
390
+ e("addEvent", { eventName: n, eventDescription: a });
391
391
  });
392
392
  };
393
- return (E, n) => (_(), M(P(Ve), {
394
- visible: p.visible,
393
+ return (E, n) => (_(), w(B(Ce), {
394
+ visible: u.visible,
395
395
  title: "添加新事件",
396
396
  width: "400px",
397
397
  "append-to-body": !0,
398
398
  "close-on-click-modal": !1,
399
- onClose: l
399
+ onClose: c
400
400
  }, {
401
- footer: x(() => [
401
+ footer: k(() => [
402
402
  t("div", _n, [
403
- m(P($), { onClick: l }, {
404
- default: x(() => n[2] || (n[2] = [
405
- S(" 取消")
403
+ p(B(Y), { onClick: c }, {
404
+ default: k(() => n[2] || (n[2] = [
405
+ O(" 取消")
406
406
  ])),
407
407
  _: 1
408
408
  }),
409
- m(P($), {
409
+ p(B(Y), {
410
410
  type: "primary",
411
411
  onClick: i
412
412
  }, {
413
- default: x(() => n[3] || (n[3] = [
414
- S(" 确定")
413
+ default: k(() => n[3] || (n[3] = [
414
+ O(" 确定")
415
415
  ])),
416
416
  _: 1
417
417
  })
418
418
  ])
419
419
  ]),
420
- default: x(() => [
421
- m(P(Te), {
420
+ default: k(() => [
421
+ p(B(Te), {
422
422
  ref_key: "ruleForm",
423
- ref: h,
424
- model: s,
425
- rules: f,
423
+ ref: b,
424
+ model: d,
425
+ rules: v,
426
426
  "label-width": "100px",
427
427
  "inline-message": !0,
428
428
  "validate-type": "text",
429
429
  "label-position": "left",
430
430
  class: "add-custom-event-form"
431
431
  }, {
432
- default: x(() => [
433
- m(P(he), {
432
+ default: k(() => [
433
+ p(B(he), {
434
434
  label: "事件函数名",
435
435
  prop: "eventName",
436
436
  required: ""
437
437
  }, {
438
- default: x(() => [
439
- m(P(ne), {
440
- modelValue: s.eventName,
441
- "onUpdate:modelValue": n[0] || (n[0] = (d) => s.eventName = d),
438
+ default: k(() => [
439
+ p(B(oe), {
440
+ modelValue: d.eventName,
441
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => d.eventName = a),
442
442
  placeholder: "小驼峰格式,如:onDrag"
443
443
  }, null, 8, ["modelValue"])
444
444
  ]),
445
445
  _: 1
446
446
  }),
447
- m(P(he), {
447
+ p(B(he), {
448
448
  label: "事件描述",
449
449
  prop: "eventDescription",
450
450
  required: ""
451
451
  }, {
452
- default: x(() => [
453
- m(P(ne), {
454
- modelValue: s.eventDescription,
455
- "onUpdate:modelValue": n[1] || (n[1] = (d) => s.eventDescription = d)
452
+ default: k(() => [
453
+ p(B(oe), {
454
+ modelValue: d.eventDescription,
455
+ "onUpdate:modelValue": n[1] || (n[1] = (a) => d.eventDescription = a)
456
456
  }, null, 8, ["modelValue"])
457
457
  ]),
458
458
  _: 1
@@ -464,19 +464,19 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
464
464
  _: 1
465
465
  }, 8, ["visible"]));
466
466
  }
467
- }, bn = /* @__PURE__ */ J(hn, [["__scopeId", "data-v-46f7fc7a"]]), En = {
467
+ }, hn = /* @__PURE__ */ F(bn, [["__scopeId", "data-v-46f7fc7a"]]), yn = {
468
468
  components: {
469
469
  BlockLinkEvent: qe,
470
470
  BindEventsDialog: un,
471
471
  TinyPopover: Ue,
472
- TinyButton: $,
472
+ TinyButton: Y,
473
473
  IconChevronDown: We(),
474
474
  SvgButton: Ze,
475
- AddEventsDialog: bn
475
+ AddEventsDialog: hn
476
476
  },
477
477
  inheritAttrs: !1,
478
478
  setup() {
479
- const { PLUGIN_NAME: p, activePlugin: o } = De(), { pageState: a } = Y(), { getBlockEvents: e, getCurrentBlock: s, removeEventLink: h } = Ke(), { getMaterial: b } = He(), { confirm: f } = $e(), l = Ye.global.locale.value, { highlightMethod: i } = Z(G.Page), { commonEvents: E = {} } = Ce("engine.setting.event").options, n = q({
479
+ const { PLUGIN_NAME: u, activePlugin: o } = Ae(), { pageState: r } = L(), { getBlockEvents: e, getCurrentBlock: d, removeEventLink: b } = Ke(), { getMaterial: h } = He(), { confirm: v } = $e(), c = Ye.global.locale.value, { highlightMethod: i } = Z(G.Page), { commonEvents: E = {} } = Ne("engine.setting.event").options, n = q({
480
480
  eventName: "",
481
481
  // 事件名称
482
482
  eventBinding: null,
@@ -485,67 +485,67 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
485
485
  customEvents: E,
486
486
  bindActions: {},
487
487
  showBindEventDialog: !1
488
- }), d = X(() => !!a.isBlock), u = X(() => Object.keys(n.bindActions).length === 0), c = X(() => ({ ...n.componentEvent, ...n.customEvents }));
489
- xe(() => {
490
- var A, C, W, ie, se;
491
- const r = (A = a == null ? void 0 : a.currentSchema) == null ? void 0 : A.componentName, g = b(r);
492
- n.componentEvent = ((W = (C = g == null ? void 0 : g.content) == null ? void 0 : C.schema) == null ? void 0 : W.events) || ((ie = g == null ? void 0 : g.schema) == null ? void 0 : ie.events) || {};
493
- const k = ((se = a == null ? void 0 : a.currentSchema) == null ? void 0 : se.props) || {}, N = Object.keys(k);
494
- n.bindActions = {}, Object.entries(c.value).forEach(([j, Pe]) => {
495
- var ae, le, de;
496
- if (N.indexOf(j) > -1) {
497
- const Be = k[j], { value: Me, params: re } = Be, we = !re && ((le = (ae = Me.match(/\((.+)\)$/)) == null ? void 0 : ae[1]) == null ? void 0 : le.split(",")) || re, O = {
498
- eventName: j,
488
+ }), a = K(() => !!r.isBlock), s = K(() => Object.keys(n.bindActions).length === 0), l = K(() => ({ ...n.componentEvent, ...n.customEvents }));
489
+ ke(() => {
490
+ var P, N, Q, se, ae;
491
+ const m = (P = r == null ? void 0 : r.currentSchema) == null ? void 0 : P.componentName, f = h(m);
492
+ n.componentEvent = ((Q = (N = f == null ? void 0 : f.content) == null ? void 0 : N.schema) == null ? void 0 : Q.events) || ((se = f == null ? void 0 : f.schema) == null ? void 0 : se.events) || {};
493
+ const V = ((ae = r == null ? void 0 : r.currentSchema) == null ? void 0 : ae.props) || {}, I = Object.keys(V);
494
+ n.bindActions = {}, Object.entries(l.value).forEach(([z, Pe]) => {
495
+ var le, de, re;
496
+ if (I.indexOf(z) > -1) {
497
+ const Be = V[z], { value: Me, params: ce } = Be, we = !ce && ((de = (le = Me.match(/\((.+)\)$/)) == null ? void 0 : le[1]) == null ? void 0 : de.split(",")) || ce, S = {
498
+ eventName: z,
499
499
  ref: "",
500
- event: k[j],
500
+ event: V[z],
501
501
  params: we
502
502
  };
503
- if (O.event.type === "JSExpression" && (O.ref = O.event.value.replace("this.", "").replace(/\(.*\)$/, "")), a.isBlock) {
504
- O.metaEvent = Pe;
505
- const ce = e(s()), me = (de = a == null ? void 0 : a.currentSchema) == null ? void 0 : de.id;
506
- me && ce && Object.entries(ce).forEach(([Se, L]) => {
507
- var pe, ue;
508
- me === ((pe = L == null ? void 0 : L.linked) == null ? void 0 : pe.id) && j === ((ue = L == null ? void 0 : L.linked) == null ? void 0 : ue.event) && (O.linked = L.linked, O.linkedEventName = Se);
503
+ if (S.event.type === "JSExpression" && (S.ref = S.event.value.replace("this.", "").replace(/\(.*\)$/, "")), r.isBlock) {
504
+ S.metaEvent = Pe;
505
+ const me = e(d()), pe = (re = r == null ? void 0 : r.currentSchema) == null ? void 0 : re.id;
506
+ pe && me && Object.entries(me).forEach(([Le, T]) => {
507
+ var ue, ve;
508
+ pe === ((ue = T == null ? void 0 : T.linked) == null ? void 0 : ue.id) && z === ((ve = T == null ? void 0 : T.linked) == null ? void 0 : ve.event) && (S.linked = T.linked, S.linkedEventName = Le);
509
509
  });
510
510
  }
511
- n.bindActions[j] = O;
511
+ n.bindActions[z] = S;
512
512
  }
513
513
  });
514
514
  });
515
- const V = (r, g) => {
516
- g && n.bindActions[r.eventName] || (n.eventBinding = r, dn());
517
- }, w = (r) => {
518
- var k;
519
- Object.keys(((k = a == null ? void 0 : a.currentSchema) == null ? void 0 : k.props) || {}).indexOf(r.eventName) > -1 && delete a.currentSchema.props[r.eventName];
515
+ const y = (m, f) => {
516
+ f && n.bindActions[m.eventName] || (n.eventBinding = m, dn());
517
+ }, C = (m) => {
518
+ var V;
519
+ Object.keys(((V = r == null ? void 0 : r.currentSchema) == null ? void 0 : V.props) || {}).indexOf(m.eventName) > -1 && delete r.currentSchema.props[m.eventName];
520
520
  };
521
521
  return {
522
522
  state: n,
523
- isBlock: d,
524
- isEmpty: u,
525
- delEvent: (r) => {
526
- f({
523
+ isBlock: a,
524
+ isEmpty: s,
525
+ delEvent: (m) => {
526
+ v({
527
527
  title: "提示",
528
- message: `您确定要删除事件 ${r.eventName} 吗?`,
528
+ message: `您确定要删除事件 ${m.eventName} 吗?`,
529
529
  exec() {
530
- a.isBlock && h({ linked: r.linked }), w(r);
530
+ r.isBlock && b({ linked: m.linked }), C(m);
531
531
  }
532
532
  });
533
533
  },
534
- openCodePanel: (r) => {
535
- r && o(p.Page).then(() => {
536
- i && i(r.ref);
534
+ openCodePanel: (m) => {
535
+ m && o(u.Page).then(() => {
536
+ i && i(m.ref);
537
537
  });
538
538
  },
539
- openActionDialog: V,
540
- handleAddEvent: (r) => {
541
- const { eventName: g, eventDescription: k } = r;
539
+ openActionDialog: y,
540
+ handleAddEvent: (m) => {
541
+ const { eventName: f, eventDescription: V } = m;
542
542
  Object.assign(n.customEvents, {
543
- [g]: {
543
+ [f]: {
544
544
  label: {
545
- zh_CN: k
545
+ zh_CN: V
546
546
  },
547
547
  description: {
548
- zh_CN: `${k}的回调函数`
548
+ zh_CN: `${V}的回调函数`
549
549
  },
550
550
  type: "event",
551
551
  functionInfo: {
@@ -556,20 +556,20 @@ const un = /* @__PURE__ */ J(rn, [["render", pn], ["__scopeId", "data-v-98e32e3c
556
556
  }
557
557
  }), n.showBindEventDialog = !1;
558
558
  },
559
- handleToggleAddEventDialog: (r) => {
560
- n.showBindEventDialog = r;
559
+ handleToggleAddEventDialog: (m) => {
560
+ n.showBindEventDialog = m;
561
561
  },
562
- renderEventList: c,
563
- locale: l
562
+ renderEventList: l,
563
+ locale: c
564
564
  };
565
565
  }
566
- }, yn = { class: "bind-action-list" }, xn = { class: "popover-head" }, kn = { class: "bind-event-list" }, Vn = ["onClick"], Cn = { class: "bind-actions" }, Dn = { class: "action-item bind-action-item" }, In = ["onClick"], Nn = { class: "event-bind" }, An = { class: "action-buttons" }, Pn = { class: "empty-action" }, Bn = { class: "icon" };
567
- function Mn(p, o, a, e, s, h) {
568
- const b = y("icon-chevron-down"), f = y("tiny-button"), l = y("tiny-popover"), i = y("svg-icon"), E = y("block-link-event"), n = y("svg-button"), d = y("bind-events-dialog"), u = y("add-events-dialog");
569
- return _(), I(H, null, [
570
- t("div", yn, [
566
+ }, En = { class: "bind-action-list" }, xn = { class: "popover-head" }, kn = { class: "bind-event-list" }, Vn = ["onClick"], Cn = { 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" };
567
+ function Mn(u, o, r, e, d, b) {
568
+ const h = x("icon-chevron-down"), v = x("tiny-button"), c = x("tiny-popover"), i = x("svg-icon"), E = x("block-link-event"), n = x("svg-button"), a = x("bind-events-dialog"), s = x("add-events-dialog");
569
+ return _(), A($, null, [
570
+ t("div", En, [
571
571
  t("div", xn, [
572
- m(l, {
572
+ p(c, {
573
573
  popperClass: "option-popper setting-advanced-bind-event-list",
574
574
  placement: "bottom-start",
575
575
  trigger: "hover",
@@ -577,37 +577,37 @@ function Mn(p, o, a, e, s, h) {
577
577
  width: "256",
578
578
  "visible-arrow": !1
579
579
  }, {
580
- reference: x(() => [
581
- m(f, { class: "bind-event-btn" }, {
582
- default: x(() => [
580
+ reference: k(() => [
581
+ p(v, { class: "bind-event-btn" }, {
582
+ default: k(() => [
583
583
  o[2] || (o[2] = t("span", null, "绑定事件", -1)),
584
- m(b, { class: "icon-chevron-down" })
584
+ p(h, { class: "icon-chevron-down bind-event-btn-icon" })
585
585
  ]),
586
586
  _: 1
587
587
  })
588
588
  ]),
589
- default: x(() => [
589
+ default: k(() => [
590
590
  t("ul", kn, [
591
- (_(!0), I(H, null, ee(e.renderEventList, (c, V) => {
592
- var w;
593
- return _(), I("li", {
594
- key: V,
595
- class: z(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[V] }]),
596
- onClick: (U) => e.openActionDialog({ eventName: V }, !0)
591
+ (_(!0), A($, null, ne(e.renderEventList, (l, y) => {
592
+ var C;
593
+ return _(), A("li", {
594
+ key: y,
595
+ class: R(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[y] }]),
596
+ onClick: (D) => e.openActionDialog({ eventName: y }, !0)
597
597
  }, [
598
- t("div", null, B(V) + "  |  " + B(((w = c == null ? void 0 : c.label) == null ? void 0 : w[e.locale]) || V), 1)
598
+ t("div", null, M(y) + "  |  " + M(((C = l == null ? void 0 : l.label) == null ? void 0 : C[e.locale]) || y), 1)
599
599
  ], 10, Vn);
600
600
  }), 128))
601
601
  ])
602
602
  ]),
603
603
  _: 1
604
604
  }),
605
- m(f, {
605
+ p(v, {
606
606
  class: "title add-custom-event-button bind-action-button-item",
607
- onClick: o[0] || (o[0] = (c) => e.handleToggleAddEventDialog(!0))
607
+ onClick: o[0] || (o[0] = (l) => e.handleToggleAddEventDialog(!0))
608
608
  }, {
609
- default: x(() => [
610
- m(i, {
609
+ default: k(() => [
610
+ p(i, {
611
611
  name: "add",
612
612
  class: "custom-event-button-icon"
613
613
  }),
@@ -617,79 +617,79 @@ function Mn(p, o, a, e, s, h) {
617
617
  })
618
618
  ]),
619
619
  ge(t("ul", Cn, [
620
- (_(!0), I(H, null, ee(e.state.bindActions, (c) => {
621
- var V, w;
622
- return _(), I("li", {
623
- key: c.eventName
620
+ (_(!0), A($, null, ne(e.state.bindActions, (l) => {
621
+ var y, C;
622
+ return _(), A("li", {
623
+ key: l.eventName
624
624
  }, [
625
- t("div", Dn, [
625
+ t("div", Nn, [
626
626
  t("div", {
627
627
  class: "binding-name",
628
- onClick: (U) => e.openActionDialog(c)
628
+ onClick: (D) => e.openActionDialog(l)
629
629
  }, [
630
630
  t("div", null, [
631
- S(B(c.eventName), 1),
632
- t("span", null, B((w = (V = e.renderEventList[c.eventName]) == null ? void 0 : V.label) == null ? void 0 : w[e.locale]), 1)
631
+ O(M(l.eventName), 1),
632
+ t("span", null, M((C = (y = e.renderEventList[l.eventName]) == null ? void 0 : y.label) == null ? void 0 : C[e.locale]), 1)
633
633
  ]),
634
634
  t("div", {
635
- class: z({ linked: c.linked })
636
- }, B(c.linkedEventName), 3),
637
- t("span", Nn, B(c.ref), 1)
638
- ], 8, In),
639
- t("div", An, [
640
- e.isBlock ? (_(), M(E, {
635
+ class: R({ linked: l.linked })
636
+ }, M(l.linkedEventName), 3),
637
+ t("span", Dn, M(l.ref), 1)
638
+ ], 8, An),
639
+ t("div", In, [
640
+ e.isBlock ? (_(), w(E, {
641
641
  key: 0,
642
- data: c
643
- }, null, 8, ["data"])) : K("", !0),
644
- m(n, {
642
+ data: l
643
+ }, null, 8, ["data"])) : H("", !0),
644
+ p(n, {
645
645
  name: "plugin-icon-page-schema",
646
646
  tips: "定位到代码",
647
647
  placement: "top",
648
- onClick: (U) => e.openCodePanel(c)
648
+ onClick: (D) => e.openCodePanel(l)
649
649
  }, null, 8, ["onClick"]),
650
- m(n, {
650
+ p(n, {
651
651
  name: "setting",
652
652
  tips: "设置",
653
653
  placement: "top",
654
- onClick: (U) => e.openActionDialog(c, !1)
654
+ onClick: (D) => e.openActionDialog(l, !1)
655
655
  }, null, 8, ["onClick"]),
656
- m(n, {
656
+ p(n, {
657
657
  name: "delete",
658
658
  tips: "删除",
659
659
  placement: "top",
660
- onClick: (U) => e.delEvent(c)
660
+ onClick: (D) => e.delEvent(l)
661
661
  }, null, 8, ["onClick"])
662
662
  ])
663
663
  ])
664
664
  ]);
665
665
  }), 128))
666
666
  ], 512), [
667
- [ve, !e.isEmpty]
667
+ [_e, !e.isEmpty]
668
668
  ]),
669
669
  ge(t("div", Pn, [
670
670
  t("div", Bn, [
671
- m(i, {
671
+ p(i, {
672
672
  name: "empty-action",
673
673
  class: "empty-action-icon"
674
674
  })
675
675
  ]),
676
676
  o[4] || (o[4] = t("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
677
677
  ], 512), [
678
- [ve, e.isEmpty]
678
+ [_e, e.isEmpty]
679
679
  ])
680
680
  ]),
681
- m(d, {
681
+ p(a, {
682
682
  eventBinding: e.state.eventBinding
683
683
  }, null, 8, ["eventBinding"]),
684
- m(u, {
684
+ p(s, {
685
685
  visible: e.state.showBindEventDialog,
686
686
  componentEvents: e.renderEventList,
687
- onCloseDialog: o[1] || (o[1] = (c) => e.handleToggleAddEventDialog(!1)),
687
+ onCloseDialog: o[1] || (o[1] = (l) => e.handleToggleAddEventDialog(!1)),
688
688
  onAddEvent: e.handleAddEvent
689
689
  }, null, 8, ["visible", "componentEvents", "onAddEvent"])
690
690
  ], 64);
691
691
  }
692
- const wn = /* @__PURE__ */ J(En, [["render", Mn], ["__scopeId", "data-v-4b6b809f"]]), { DEFAULT_LOOP_NAME: T } = an, { string2Obj: Sn } = ln, On = {
692
+ const wn = /* @__PURE__ */ F(yn, [["render", Mn], ["__scopeId", "data-v-d0cfb0b6"]]), { DEFAULT_LOOP_NAME: j } = an, { string2Obj: Ln } = ln, On = {
693
693
  components: {
694
694
  SwitchConfigurator: nn,
695
695
  TinyTooltip: je,
@@ -699,99 +699,124 @@ const wn = /* @__PURE__ */ J(En, [["render", Mn], ["__scopeId", "data-v-4b6b809f
699
699
  },
700
700
  inheritAttrs: !1,
701
701
  setup() {
702
- const { pageState: p } = Y(), o = R(!1), a = X(() => {
702
+ const { pageState: u } = L(), o = J(!1), r = K(() => {
703
703
  var n;
704
- return ((n = o.value) == null ? void 0 : n.type) === F.JSEXPRESSION;
704
+ return ((n = o.value) == null ? void 0 : n.type) === X.JSEXPRESSION;
705
705
  }), e = () => {
706
- var n, d;
707
- return ((d = (n = D().getSchema()) == null ? void 0 : n.loopArgs) == null ? void 0 : d[1]) || T.INDEX;
708
- }, s = q({
706
+ var n, a;
707
+ return ((a = (n = U().getSchema()) == null ? void 0 : n.loopArgs) == null ? void 0 : a[1]) || j.INDEX;
708
+ }, d = q({
709
709
  loopData: {
710
- type: F.JSEXPRESSION,
710
+ type: X.JSEXPRESSION,
711
711
  value: "[]"
712
712
  },
713
713
  loopItem: "item",
714
714
  loopIndex: "index",
715
- isLoop: X(() => {
715
+ isLoop: K(() => {
716
716
  var n;
717
- return ((n = s.loopData) == null ? void 0 : n.type) === F.JSEXPRESSION;
717
+ return ((n = d.loopData) == null ? void 0 : n.type) === X.JSEXPRESSION;
718
718
  }),
719
719
  loopKey: "",
720
720
  shouldUpdate: !1
721
721
  });
722
- _e(
723
- () => [p == null ? void 0 : p.currentSchema, s.shouldUpdate],
722
+ be(
723
+ () => [u == null ? void 0 : u.currentSchema, d.shouldUpdate],
724
724
  ([n]) => {
725
- var d, u, c, V;
726
- o.value = (n == null ? void 0 : n.condition) === void 0 ? !0 : n == null ? void 0 : n.condition, s.loopData = n == null ? void 0 : n.loop, s.loopItem = ((d = n == null ? void 0 : n.loopArgs) == null ? void 0 : d[0]) || "", s.loopIndex = ((u = n == null ? void 0 : n.loopArgs) == null ? void 0 : u[1]) || "", s.loopKey = ((V = (c = n == null ? void 0 : n.props) == null ? void 0 : c.key) == null ? void 0 : V.value) || "";
725
+ var a, s, l, y;
726
+ o.value = (n == null ? void 0 : n.condition) === void 0 ? !0 : n == null ? void 0 : n.condition, d.loopData = n == null ? void 0 : n.loop, d.loopItem = ((a = n == null ? void 0 : n.loopArgs) == null ? void 0 : a[0]) || "", d.loopIndex = ((s = n == null ? void 0 : n.loopArgs) == null ? void 0 : s[1]) || "", d.loopKey = ((y = (l = n == null ? void 0 : n.props) == null ? void 0 : l.key) == null ? void 0 : y.value) || "";
727
727
  }
728
728
  );
729
- const h = (n = "") => {
729
+ const b = (n = "") => {
730
+ var D;
730
731
  n = n.replace(/\s*/g, "");
731
- const d = D().getSchema();
732
- if (!d)
732
+ const { getSchema: a, setProp: s } = U(), l = a();
733
+ if (!l)
733
734
  return;
734
- const u = Number(n).toString() !== "NaN";
735
- d.props = d.props || {};
736
- const c = d.props;
737
- n && !u && (c.key = {
738
- type: F.JSEXPRESSION,
735
+ const y = Number(n).toString() !== "NaN";
736
+ let C = (D = l.props) == null ? void 0 : D.key;
737
+ n && !y && (C = {
738
+ type: X.JSEXPRESSION,
739
739
  value: n
740
- }), n || (s.isLoop ? c.key = {
741
- type: F.JSEXPRESSION,
740
+ }), n || (d.isLoop ? C = {
741
+ type: X.JSEXPRESSION,
742
742
  value: e()
743
- } : delete c.key);
743
+ } : C = ""), s("key", C);
744
744
  };
745
- _e([() => s.isLoop, () => s.loopIndex], () => {
746
- !s.loopKey && s.isLoop && h(e()), s.isLoop || h("");
745
+ be([() => d.isLoop, () => d.loopIndex], () => {
746
+ !d.loopKey && d.isLoop && b(e()), d.isLoop || b("");
747
747
  });
748
- const b = () => {
748
+ const h = () => {
749
749
  var n;
750
- s.loopData = (n = D().getSchema()) == null ? void 0 : n.loop;
751
- }, f = (n) => {
752
- D().getSchema() && (n === !1 || n != null && n.type ? D().getSchema().condition = n : delete D().getSchema().condition, Y().canvasApi.value.updateRect(), o.value = n);
753
- }, l = (n) => {
754
- D().getSchema().loopArgs ? D().getSchema().loopArgs[1] = n || T.INDEX : D().getSchema().loopArgs = [T.ITEM, n];
750
+ d.loopData = (n = U().getSchema()) == null ? void 0 : n.loop;
751
+ }, v = (n) => {
752
+ const { getSchema: a } = U(), s = a();
753
+ if (!s)
754
+ return;
755
+ const { operateNode: l } = L();
756
+ if (n === !1 || n != null && n.type)
757
+ l({ type: "updateAttributes", id: s.id, value: { condition: n } });
758
+ else {
759
+ const { condition: y, children: C, ...D } = s;
760
+ l({ type: "updateAttributes", id: s.id, value: { ...D }, overwrite: !0 });
761
+ }
762
+ L().canvasApi.value.updateRect(), o.value = n;
763
+ }, c = (n) => {
764
+ const a = U().getSchema();
765
+ let s = a.loopArgs;
766
+ const { operateNode: l } = L();
767
+ s ? s[1] = n || j.INDEX : s = [j.ITEM, n], l({ type: "updateAttributes", id: a.id, value: { loopArgs: s } });
755
768
  };
756
769
  return {
757
770
  condition: o,
758
- setConfig: f,
759
- isBind: a,
760
- state: s,
771
+ setConfig: v,
772
+ isBind: r,
773
+ state: d,
761
774
  setLoop: (n) => {
762
- n ? (D().getSchema().loop = n != null && n.type ? n : Sn(n), l(T.INDEX)) : (h(), delete D().getSchema().loop, delete D().getSchema().loopArgs), s.shouldUpdate = !s.shouldUpdate;
775
+ const { operateNode: a } = L(), { getSchema: s } = U(), l = s();
776
+ if (n) {
777
+ const y = n != null && n.type ? n : Ln(n);
778
+ a({ type: "updateAttributes", id: l.id, value: { loop: y } }), c(j.INDEX);
779
+ } else {
780
+ b();
781
+ const { loop: y, loopArgs: C, children: D, ...W } = l;
782
+ a({ type: "updateAttributes", id: l.id, value: W, overwrite: !0 });
783
+ }
784
+ d.shouldUpdate = !d.shouldUpdate;
763
785
  },
764
786
  setLoopItem: (n) => {
765
- D().getSchema().loopArgs ? D().getSchema().loopArgs[0] = n || T.ITEM : D().getSchema().loopArgs = [n, T.INDEX];
787
+ const a = U().getSchema();
788
+ let s = a.loopArgs;
789
+ const { operateNode: l } = L();
790
+ s ? s[0] = n || j.ITEM : s = [n, j.INDEX], l({ type: "updateAttributes", id: a.id, value: { loopArgs: s } });
766
791
  },
767
- DEFAULT_LOOP_NAME: T,
768
- openEditor: b,
769
- setLoopIndex: l,
770
- setLoopKey: h,
792
+ DEFAULT_LOOP_NAME: j,
793
+ openEditor: h,
794
+ setLoopIndex: c,
795
+ setLoopKey: b,
771
796
  getIndexName: e
772
797
  };
773
798
  }
774
- }, Ln = { class: "advanced-config-container" }, Tn = { class: "advnce-config" }, Un = { class: "advanced-config-form-item" }, jn = ["title"], zn = { class: "advnce-config" }, Rn = { class: "advanced-config-form-item" }, Jn = ["title"], Fn = { class: "advnce-config" }, Xn = { class: "advanced-config-form-item" }, Kn = { class: "advnce-config" }, Hn = { class: "advanced-config-form-item" }, $n = { class: "advnce-config" }, Yn = { class: "advanced-config-form-item" };
775
- function qn(p, o, a, e, s, h) {
776
- var n, d;
777
- const b = y("switch-configurator"), f = y("variable-configurator"), l = y("code-configurator"), i = y("input-configurator"), E = y("tiny-tooltip");
778
- return _(), I("div", Ln, [
799
+ }, Sn = { class: "advanced-config-container" }, Tn = { class: "advnce-config" }, Un = { class: "advanced-config-form-item" }, jn = ["title"], zn = { class: "advnce-config" }, Rn = { class: "advanced-config-form-item" }, Jn = ["title"], Fn = { class: "advnce-config" }, Xn = { class: "advanced-config-form-item" }, Kn = { class: "advnce-config" }, Hn = { class: "advanced-config-form-item" }, $n = { class: "advnce-config" }, Yn = { class: "advanced-config-form-item" };
800
+ function qn(u, o, r, e, d, b) {
801
+ var n, a;
802
+ const h = x("switch-configurator"), v = x("variable-configurator"), c = x("code-configurator"), i = x("input-configurator"), E = x("tiny-tooltip");
803
+ return _(), A("div", Sn, [
779
804
  t("div", Tn, [
780
805
  o[6] || (o[6] = t("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
781
806
  t("div", Un, [
782
- e.isBind ? (_(), I("div", {
807
+ e.isBind ? (_(), A("div", {
783
808
  key: 1,
784
809
  class: "binding-state text-ellipsis-multiple",
785
810
  title: e.condition.value
786
- }, " 已绑定:" + B(e.condition.value), 9, jn)) : (_(), M(b, {
811
+ }, " 已绑定:" + M(e.condition.value), 9, jn)) : (_(), w(h, {
787
812
  key: 0,
788
813
  modelValue: e.condition,
789
814
  "onUpdate:modelValue": e.setConfig
790
815
  }, null, 8, ["modelValue", "onUpdate:modelValue"])),
791
- m(f, {
816
+ p(v, {
792
817
  modelValue: e.condition,
793
818
  "onUpdate:modelValue": [
794
- o[0] || (o[0] = (u) => e.condition = u),
819
+ o[0] || (o[0] = (s) => e.condition = s),
795
820
  e.setConfig
796
821
  ],
797
822
  name: "advance"
@@ -801,24 +826,24 @@ function qn(p, o, a, e, s, h) {
801
826
  t("div", zn, [
802
827
  o[7] || (o[7] = t("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
803
828
  t("div", Rn, [
804
- e.state.isLoop ? (_(), I("div", {
829
+ e.state.isLoop ? (_(), A("div", {
805
830
  key: 1,
806
831
  class: "binding-state text-ellipsis-multiple",
807
832
  title: (n = e.state.loopData) == null ? void 0 : n.value
808
- }, " 已绑定:" + B((d = e.state.loopData) == null ? void 0 : d.value), 9, Jn)) : (_(), M(l, {
833
+ }, " 已绑定:" + M((a = e.state.loopData) == null ? void 0 : a.value), 9, Jn)) : (_(), w(c, {
809
834
  key: 0,
810
835
  modelValue: e.state.loopData,
811
836
  "onUpdate:modelValue": [
812
- o[1] || (o[1] = (u) => e.state.loopData = u),
837
+ o[1] || (o[1] = (s) => e.state.loopData = s),
813
838
  e.setLoop
814
839
  ],
815
840
  "data-type": "JSExpression",
816
841
  onOpen: e.openEditor
817
842
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onOpen"])),
818
- m(f, {
843
+ p(v, {
819
844
  modelValue: e.state.loopData,
820
845
  "onUpdate:modelValue": [
821
- o[2] || (o[2] = (u) => e.state.loopData = u),
846
+ o[2] || (o[2] = (s) => e.state.loopData = s),
822
847
  e.setLoop
823
848
  ],
824
849
  name: "advance"
@@ -828,10 +853,10 @@ function qn(p, o, a, e, s, h) {
828
853
  t("div", Fn, [
829
854
  o[8] || (o[8] = t("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
830
855
  t("div", Xn, [
831
- m(i, {
856
+ p(i, {
832
857
  modelValue: e.state.loopItem,
833
858
  "onUpdate:modelValue": [
834
- o[3] || (o[3] = (u) => e.state.loopItem = u),
859
+ o[3] || (o[3] = (s) => e.state.loopItem = s),
835
860
  e.setLoopItem
836
861
  ],
837
862
  placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.ITEM}`
@@ -841,10 +866,10 @@ function qn(p, o, a, e, s, h) {
841
866
  t("div", Kn, [
842
867
  o[9] || (o[9] = t("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
843
868
  t("div", Hn, [
844
- m(i, {
869
+ p(i, {
845
870
  modelValue: e.state.loopIndex,
846
871
  "onUpdate:modelValue": [
847
- o[4] || (o[4] = (u) => e.state.loopIndex = u),
872
+ o[4] || (o[4] = (s) => e.state.loopIndex = s),
848
873
  e.setLoopIndex
849
874
  ],
850
875
  placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.INDEX}`
@@ -854,12 +879,12 @@ function qn(p, o, a, e, s, h) {
854
879
  t("div", $n, [
855
880
  o[10] || (o[10] = t("label", { class: "text-ellipsis-multiple" }, "key", -1)),
856
881
  t("div", Yn, [
857
- m(E, { content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存" }, {
858
- default: x(() => [
859
- m(i, {
882
+ p(E, { content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存" }, {
883
+ default: k(() => [
884
+ p(i, {
860
885
  modelValue: e.state.loopKey,
861
886
  "onUpdate:modelValue": [
862
- o[5] || (o[5] = (u) => e.state.loopKey = u),
887
+ o[5] || (o[5] = (s) => e.state.loopKey = s),
863
888
  e.setLoopKey
864
889
  ],
865
890
  placeholder: `默认为索引名:${e.getIndexName()}`
@@ -871,30 +896,30 @@ function qn(p, o, a, e, s, h) {
871
896
  ])
872
897
  ]);
873
898
  }
874
- const Zn = /* @__PURE__ */ J(On, [["render", qn], ["__scopeId", "data-v-f59c13c3"]]), Gn = {
899
+ const Zn = /* @__PURE__ */ F(On, [["render", qn], ["__scopeId", "data-v-420d1aa8"]]), Gn = {
875
900
  __name: "Main",
876
- setup(p) {
877
- const o = R(["bindEvent", "advancedConfig"]);
878
- return (a, e) => (_(), M(P(ze), {
901
+ setup(u) {
902
+ const o = J(["bindEvent", "advancedConfig"]);
903
+ return (r, e) => (_(), w(B(ze), {
879
904
  modelValue: o.value,
880
- "onUpdate:modelValue": e[0] || (e[0] = (s) => o.value = s)
905
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => o.value = d)
881
906
  }, {
882
- default: x(() => [
883
- m(P(be), {
907
+ default: k(() => [
908
+ p(B(ye), {
884
909
  title: "事件绑定",
885
910
  name: "bindEvent"
886
911
  }, {
887
- default: x(() => [
888
- m(wn)
912
+ default: k(() => [
913
+ p(wn)
889
914
  ]),
890
915
  _: 1
891
916
  }),
892
- m(P(be), {
917
+ p(B(ye), {
893
918
  title: "高级配置",
894
919
  name: "advancedConfig"
895
920
  }, {
896
- default: x(() => [
897
- m(Zn)
921
+ default: k(() => [
922
+ p(Zn)
898
923
  ]),
899
924
  _: 1
900
925
  })
@@ -902,7 +927,7 @@ const Zn = /* @__PURE__ */ J(On, [["render", qn], ["__scopeId", "data-v-f59c13c3
902
927
  _: 1
903
928
  }, 8, ["modelValue"]));
904
929
  }
905
- }, Ie = "newMethod", Wn = /[^0-9a-zA-Z_$]/, Qn = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, Q = {
930
+ }, De = "newMethod", Wn = /[^0-9a-zA-Z_$]/, Qn = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, ee = {
906
931
  default: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)",
907
932
  exist: "方法名称已存在",
908
933
  ruleInvalid: "请输入有效的方法名,可以由字母、数字、下划线、$ 符号组成,不能以数字开头",
@@ -910,35 +935,35 @@ const Zn = /* @__PURE__ */ J(On, [["render", qn], ["__scopeId", "data-v-f59c13c3
910
935
  }, eo = {
911
936
  components: {
912
937
  MonacoEditor: Ge,
913
- TinyInput: ne,
938
+ TinyInput: oe,
914
939
  TinyCheckbox: Re
915
940
  },
916
941
  props: {
917
942
  dialogVisible: Boolean
918
943
  },
919
944
  setup() {
920
- const { getMethodNameList: p } = Z(G.Page), o = ke("context"), a = {
945
+ const { getMethodNameList: u } = Z(G.Page), o = Ve("context"), r = {
921
946
  language: "json",
922
947
  lineNumbers: !1,
923
948
  minimap: {
924
949
  enabled: !1
925
950
  }
926
- }, e = (l) => {
927
- o.editorContent = l;
928
- }, s = (l) => !l, h = (l) => p == null ? void 0 : p().includes(l), b = (l) => !Qn.test(l);
951
+ }, e = (c) => {
952
+ o.editorContent = c;
953
+ }, d = (c) => !c, b = (c) => u == null ? void 0 : u().includes(c), h = (c) => !Qn.test(c);
929
954
  return {
930
- NEW_METHOD_TYPE: Ie,
955
+ NEW_METHOD_TYPE: De,
931
956
  context: o,
932
- editorOptions: a,
933
- change: (l) => {
957
+ editorOptions: r,
958
+ change: (c) => {
934
959
  const i = [
935
- { validator: s, tip: Q.empty },
936
- { validator: h, tip: Q.exist },
937
- { validator: b, tip: Q.ruleInvalid }
960
+ { validator: d, tip: ee.empty },
961
+ { validator: b, tip: ee.exist },
962
+ { validator: h, tip: ee.ruleInvalid }
938
963
  ];
939
964
  for (let E = 0; E < i.length; E++) {
940
965
  const n = i[E];
941
- if (n.validator(l)) {
966
+ if (n.validator(c)) {
942
967
  o.tipError = !0, o.tip = n.tip;
943
968
  return;
944
969
  }
@@ -955,59 +980,59 @@ const Zn = /* @__PURE__ */ J(On, [["render", qn], ["__scopeId", "data-v-f59c13c3
955
980
  key: 0,
956
981
  class: "params-tip"
957
982
  };
958
- function ro(p, o, a, e, s, h) {
959
- const b = y("tiny-input"), f = y("tiny-checkbox"), l = y("monaco-editor");
960
- return _(), I("div", no, [
983
+ function ro(u, o, r, e, d, b) {
984
+ const h = x("tiny-input"), v = x("tiny-checkbox"), c = x("monaco-editor");
985
+ return _(), A("div", no, [
961
986
  t("div", {
962
- class: z(["content-right-top", { "tip-error": e.context.tipError }])
987
+ class: R(["content-right-top", { "tip-error": e.context.tipError }])
963
988
  }, [
964
989
  o[2] || (o[2] = t("div", { class: "content-right-title" }, "方法名称", -1)),
965
- m(b, {
990
+ p(h, {
966
991
  modelValue: e.context.bindMethodInfo.name,
967
992
  "onUpdate:modelValue": [
968
993
  o[0] || (o[0] = (i) => e.context.bindMethodInfo.name = i),
969
994
  e.change
970
995
  ],
971
996
  disabled: e.context.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
972
- class: z([{ "status-error": e.context.tipError }]),
997
+ class: R([{ "status-error": e.context.tipError }]),
973
998
  placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
974
999
  }, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
975
- t("div", oo, B(e.context.tip), 1)
1000
+ t("div", oo, M(e.context.tip), 1)
976
1001
  ], 2),
977
1002
  t("div", {
978
- class: z(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
1003
+ class: R(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
979
1004
  }, [
980
1005
  t("div", to, [
981
- m(f, {
1006
+ p(v, {
982
1007
  modelValue: e.context.enableExtraParams,
983
1008
  "onUpdate:modelValue": o[1] || (o[1] = (i) => e.context.enableExtraParams = i),
984
1009
  name: "tiny-checkbox"
985
1010
  }, {
986
- default: x(() => o[3] || (o[3] = [
987
- S("扩展参数设置")
1011
+ default: k(() => o[3] || (o[3] = [
1012
+ O("扩展参数设置")
988
1013
  ])),
989
1014
  _: 1
990
1015
  }, 8, ["modelValue"]),
991
1016
  t("div", io, [
992
1017
  o[4] || (o[4] = t("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
993
- S(" 如: " + B(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
1018
+ O(" 如: " + M(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
994
1019
  ])
995
1020
  ]),
996
1021
  t("div", so, [
997
- a.dialogVisible ? (_(), M(l, {
1022
+ r.dialogVisible ? (_(), w(c, {
998
1023
  key: 0,
999
1024
  value: e.context.editorContent,
1000
1025
  options: e.editorOptions,
1001
1026
  onChange: e.editorContentChange,
1002
1027
  class: "monaco-editor"
1003
- }, null, 8, ["value", "options", "onChange"])) : K("", !0),
1004
- e.context.enableExtraParams ? K("", !0) : (_(), I("div", ao))
1028
+ }, null, 8, ["value", "options", "onChange"])) : H("", !0),
1029
+ e.context.enableExtraParams ? H("", !0) : (_(), A("div", ao))
1005
1030
  ]),
1006
- !e.context.isValidParams && e.context.enableExtraParams ? (_(), I("div", lo, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : K("", !0)
1031
+ !e.context.isValidParams && e.context.enableExtraParams ? (_(), A("div", lo, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : H("", !0)
1007
1032
  ], 2)
1008
1033
  ]);
1009
1034
  }
1010
- const co = /* @__PURE__ */ J(eo, [["render", ro], ["__scopeId", "data-v-49127432"]]), mo = {
1035
+ const co = /* @__PURE__ */ F(eo, [["render", ro], ["__scopeId", "data-v-78db58dc"]]), mo = {
1011
1036
  components: {
1012
1037
  TinySearch: Je,
1013
1038
  IconYes: Qe()
@@ -1018,74 +1043,74 @@ const co = /* @__PURE__ */ J(eo, [["render", ro], ["__scopeId", "data-v-49127432
1018
1043
  default: () => ({})
1019
1044
  }
1020
1045
  },
1021
- setup(p) {
1022
- const { getMethodNameList: o } = Z(G.Page), a = R(""), e = R([]), s = ke("context"), h = (f, l) => {
1023
- const i = f.map((d) => {
1024
- var u;
1025
- return Number.parseInt((u = d.match(/\d+$/)) == null ? void 0 : u[0]) || 0;
1026
- }).sort((d, u) => d - u).pop();
1027
- let n = `${(l == null ? void 0 : l.replace(Wn, "_")) || ""}New`;
1046
+ setup(u) {
1047
+ const { getMethodNameList: o } = Z(G.Page), r = J(""), e = J([]), d = Ve("context"), b = (v, c) => {
1048
+ const i = v.map((a) => {
1049
+ var s;
1050
+ return Number.parseInt((s = a.match(/\d+$/)) == null ? void 0 : s[0]) || 0;
1051
+ }).sort((a, s) => a - s).pop();
1052
+ let n = `${(c == null ? void 0 : c.replace(Wn, "_")) || ""}New`;
1028
1053
  return i > -1 && (n += `${i + 1}`), n;
1029
- }, b = (f) => {
1030
- s.bindMethodInfo = f;
1054
+ }, h = (v) => {
1055
+ d.bindMethodInfo = v;
1031
1056
  };
1032
- return xe(() => {
1033
- var d, u;
1034
- const f = (d = p.eventBinding) == null ? void 0 : d.eventName, l = (o == null ? void 0 : o().filter((c) => c.includes(f))) || [], E = {
1057
+ return ke(() => {
1058
+ var a, s;
1059
+ const v = (a = u.eventBinding) == null ? void 0 : a.eventName, c = (o == null ? void 0 : o().filter((l) => l.includes(v))) || [], E = {
1035
1060
  title: "添加新方法",
1036
- name: h(l, f),
1037
- type: Ie
1061
+ name: b(c, v),
1062
+ type: De
1038
1063
  };
1039
- (u = p.eventBinding) != null && u.ref ? b({ name: p.eventBinding.ref }) : b(E);
1040
- const n = (o == null ? void 0 : o().filter((c) => c.includes(a.value)).map((c) => ({ name: c }))) || [];
1064
+ (s = u.eventBinding) != null && s.ref ? h({ name: u.eventBinding.ref }) : h(E);
1065
+ const n = (o == null ? void 0 : o().filter((l) => l.includes(r.value)).map((l) => ({ name: l }))) || [];
1041
1066
  e.value = [E, ...n];
1042
1067
  }), {
1043
- context: s,
1044
- searchValue: a,
1068
+ context: d,
1069
+ searchValue: r,
1045
1070
  filteredMethodList: e,
1046
- selectMethod: b
1071
+ selectMethod: h
1047
1072
  };
1048
1073
  }
1049
- }, po = { class: "dialog-content-left" }, uo = { class: "left-list-wrap" }, fo = { class: "left-action-list" }, go = { class: "action-list-wrap" }, vo = ["onClick"];
1050
- function _o(p, o, a, e, s, h) {
1051
- const b = y("tiny-search"), f = y("icon-yes");
1052
- return _(), I("div", po, [
1074
+ }, po = { class: "dialog-content-left" }, uo = { class: "left-list-wrap" }, vo = { class: "left-action-list" }, fo = { class: "action-list-wrap" }, go = ["onClick"];
1075
+ function _o(u, o, r, e, d, b) {
1076
+ const h = x("tiny-search"), v = x("icon-yes");
1077
+ return _(), A("div", po, [
1053
1078
  o[1] || (o[1] = t("div", { class: "left-title" }, "响应方法", -1)),
1054
1079
  t("div", uo, [
1055
- t("div", fo, [
1056
- m(b, {
1080
+ t("div", vo, [
1081
+ p(h, {
1057
1082
  modelValue: e.searchValue,
1058
- "onUpdate:modelValue": o[0] || (o[0] = (l) => e.searchValue = l),
1083
+ "onUpdate:modelValue": o[0] || (o[0] = (c) => e.searchValue = c),
1059
1084
  placeholder: "搜索"
1060
1085
  }, null, 8, ["modelValue"]),
1061
- t("ul", go, [
1062
- (_(!0), I(H, null, ee(e.filteredMethodList, (l) => (_(), I("li", {
1063
- key: l.name,
1064
- onClick: (i) => e.selectMethod(l)
1086
+ t("ul", fo, [
1087
+ (_(!0), A($, null, ne(e.filteredMethodList, (c) => (_(), A("li", {
1088
+ key: c.name,
1089
+ onClick: (i) => e.selectMethod(c)
1065
1090
  }, [
1066
1091
  t("div", {
1067
- class: z(["action-name", { active: l.name === e.context.bindMethodInfo.name }])
1092
+ class: R(["action-name", { active: c.name === e.context.bindMethodInfo.name }])
1068
1093
  }, [
1069
- S(B(l.title || l.name) + " ", 1),
1070
- l.name === e.context.bindMethodInfo.name ? (_(), M(f, {
1094
+ O(M(c.title || c.name) + " ", 1),
1095
+ c.name === e.context.bindMethodInfo.name ? (_(), w(v, {
1071
1096
  key: 0,
1072
1097
  class: "action-selected-icon"
1073
- })) : K("", !0)
1098
+ })) : H("", !0)
1074
1099
  ], 2)
1075
- ], 8, vo))), 128))
1100
+ ], 8, go))), 128))
1076
1101
  ])
1077
1102
  ])
1078
1103
  ])
1079
1104
  ]);
1080
1105
  }
1081
- const ho = /* @__PURE__ */ J(mo, [["render", _o], ["__scopeId", "data-v-419ba375"]]), Po = {
1082
- ...oe,
1106
+ const bo = /* @__PURE__ */ F(mo, [["render", _o], ["__scopeId", "data-v-419ba375"]]), Po = {
1107
+ ...te,
1083
1108
  entry: Gn,
1084
1109
  options: {
1085
- commonEvents: fn
1110
+ commonEvents: vn
1086
1111
  },
1087
1112
  components: {
1088
- BindEventsDialogSidebar: ho,
1113
+ BindEventsDialogSidebar: bo,
1089
1114
  BindEventsDialogContent: co
1090
1115
  }
1091
1116
  };