@opentiny/tiny-engine-setting-events 1.0.3 → 2.0.0-alpha.1

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