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