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

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