@opentiny/tiny-robot 0.5.2-alpha.15 → 0.5.2-alpha.17

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/index7.js CHANGED
@@ -1,53 +1,53 @@
1
- import { onMounted as ne, onBeforeUnmount as oe, ref as y, defineComponent as P, openBlock as l, createElementBlock as u, createElementVNode as w, createVNode as T, unref as n, toDisplayString as B, useModel as W, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, mergeModels as j, nextTick as se, normalizeClass as U, createCommentVNode as G, renderSlot as q, withDirectives as A, withKeys as F, isRef as re, withModifiers as J, vModelText as le, vShow as ue } from "vue";
2
- import { IconEmptySearch as ae, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMore as pe } from "@opentiny/tiny-robot-svgs";
3
- import { _ as z } from "./_plugin-vue_export-helper.js";
4
- import { o as Z, d as ve, c as ge, b as _e } from "./index4.js";
5
- import { t as O } from "./utils.js";
6
- const D = y(!1);
7
- let b = 0, $;
8
- function ye() {
9
- const s = window.matchMedia("(hover: none) and (pointer: coarse)"), m = () => {
10
- D.value = s.matches;
1
+ import { onMounted as de, onBeforeUnmount as fe, ref as L, defineComponent as z, openBlock as c, createElementBlock as v, createElementVNode as R, createVNode as P, unref as i, toDisplayString as H, useModel as Y, watch as J, Fragment as B, renderList as F, createBlock as j, resolveDynamicComponent as se, mergeModels as Z, nextTick as K, shallowRef as re, computed as E, normalizeClass as N, createCommentVNode as A, renderSlot as ee, withDirectives as te, withKeys as b, isRef as me, withModifiers as ne, vModelText as pe, vShow as ve } from "vue";
2
+ import { IconEmptySearch as ye, IconEditPen as ge, IconDelete as he, IconCheck as _e, IconClose as ke, IconMore as Ce } from "@opentiny/tiny-robot-svgs";
3
+ import { _ as Q } from "./_plugin-vue_export-helper.js";
4
+ import { a as we, c as Ie, o as xe, f as Le, s as Ee } from "./floating-ui.dom.js";
5
+ import { o as le } from "./index4.js";
6
+ const S = L(!1);
7
+ let G = 0, U;
8
+ function Re() {
9
+ const u = window.matchMedia("(hover: none) and (pointer: coarse)"), g = () => {
10
+ S.value = u.matches;
11
11
  };
12
- m(), s.addEventListener("change", m);
13
- const t = (c) => {
14
- D.value = c.pointerType !== "mouse";
12
+ g(), u.addEventListener("change", g);
13
+ const d = (a) => {
14
+ S.value = a.pointerType !== "mouse";
15
15
  };
16
- return window.addEventListener("pointerdown", t, !0), () => {
17
- s.removeEventListener("change", m), window.removeEventListener("pointerdown", t, !0);
16
+ return window.addEventListener("pointerdown", d, !0), () => {
17
+ u.removeEventListener("change", g), window.removeEventListener("pointerdown", d, !0);
18
18
  };
19
19
  }
20
- function he() {
21
- $ == null || $(), $ = void 0;
20
+ function Te() {
21
+ U == null || U(), U = void 0;
22
22
  }
23
- function Ce() {
23
+ function Me() {
24
24
  return typeof window > "u" ? {
25
- isTouchDevice: D
26
- } : (ne(() => {
27
- b++, b === 1 && ($ = ye());
28
- }), oe(() => {
29
- b = Math.max(0, b - 1), b === 0 && he();
25
+ isTouchDevice: S
26
+ } : (de(() => {
27
+ G++, G === 1 && (U = Re());
28
+ }), fe(() => {
29
+ G = Math.max(0, G - 1), G === 0 && Te();
30
30
  }), {
31
- isTouchDevice: D
31
+ isTouchDevice: S
32
32
  });
33
33
  }
34
- const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon" }, Ee = { class: "tr-history__empty-text" }, we = /* @__PURE__ */ P({
34
+ const be = { class: "tr-history__empty" }, De = { class: "tr-history__empty-icon" }, $e = { class: "tr-history__empty-text" }, Oe = /* @__PURE__ */ z({
35
35
  __name: "Empty",
36
36
  props: {
37
37
  text: { default: "暂无内容" }
38
38
  },
39
- setup(s) {
40
- const m = s;
41
- return (t, c) => (l(), u("div", ke, [
42
- w("span", Le, [
43
- T(n(ae))
39
+ setup(u) {
40
+ const g = u;
41
+ return (d, a) => (c(), v("div", be, [
42
+ R("span", De, [
43
+ P(i(ye))
44
44
  ]),
45
- w("span", Ee, B(m.text), 1)
45
+ R("span", $e, H(g.text), 1)
46
46
  ]));
47
47
  }
48
- }), Re = /* @__PURE__ */ z(we, [["__scopeId", "data-v-d0340c39"]]), Ie = ["onClick"], Q = 4, xe = /* @__PURE__ */ P({
48
+ }), Ge = /* @__PURE__ */ Q(Oe, [["__scopeId", "data-v-d0340c39"]]), Pe = ["onClick"], Ue = 4, Ae = /* @__PURE__ */ z({
49
49
  __name: "MenuList",
50
- props: /* @__PURE__ */ j({
50
+ props: /* @__PURE__ */ Z({
51
51
  items: {},
52
52
  menuListGap: { default: 8 }
53
53
  }, {
@@ -56,85 +56,151 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
56
56
  data: { default: null },
57
57
  dataModifiers: {}
58
58
  }),
59
- emits: /* @__PURE__ */ j(["item-click"], ["update:trigger", "update:data"]),
60
- setup(s, { emit: m }) {
61
- const t = W(s, "trigger"), c = W(s, "data"), h = s, C = m, E = y(null);
62
- Z(
63
- E,
59
+ emits: /* @__PURE__ */ Z(["item-click"], ["update:trigger", "update:data"]),
60
+ setup(u, { expose: g, emit: d }) {
61
+ const a = Y(u, "trigger"), k = Y(u, "data"), h = u, T = d, _ = L(null);
62
+ le(
63
+ _,
64
64
  () => {
65
- t.value = null, c.value = null;
65
+ a.value = null, k.value = null;
66
66
  },
67
67
  {
68
- ignore: [t]
68
+ ignore: [a]
69
69
  }
70
+ ), J(
71
+ [a, _, () => h.menuListGap],
72
+ ([o, t], s, w) => {
73
+ if (!o || !t) return;
74
+ let f = !0;
75
+ const x = we(o, t, async () => {
76
+ const { x: p, y: O } = await Ie(o, t, {
77
+ placement: "bottom-start",
78
+ strategy: "fixed",
79
+ middleware: [
80
+ xe(h.menuListGap),
81
+ Le({ fallbackPlacements: ["top-start"] }),
82
+ Ee({ padding: Ue })
83
+ ]
84
+ });
85
+ !f || a.value !== o || _.value !== t || Object.assign(t.style, {
86
+ left: `${p}px`,
87
+ top: `${O}px`
88
+ });
89
+ });
90
+ w(() => {
91
+ f = !1, x();
92
+ });
93
+ },
94
+ { flush: "post" }
70
95
  );
71
- const { top: p, bottom: x, left: _ } = ve(t), { width: M, height: k } = ge(E, void 0, { box: "border-box" }), { height: R } = _e(), o = I(() => {
72
- const L = {
73
- left: `min(${O(_.value)}, calc(100% - ${O(M.value + Q)}))`
74
- }, g = x.value + h.menuListGap;
75
- return g + k.value + Q > R.value ? L.bottom = `calc(100% - ${O(p.value - h.menuListGap)})` : L.top = O(g), L;
76
- }), v = (L) => {
77
- C("item-click", L), t.value = null, c.value = null;
96
+ const M = (o) => {
97
+ T("item-click", o), a.value = null, k.value = null;
98
+ }, y = () => {
99
+ var o;
100
+ return Array.from(((o = _.value) == null ? void 0 : o.querySelectorAll('[role="menuitem"]')) || []);
101
+ }, D = () => {
102
+ var o;
103
+ return (o = y()[0]) == null ? void 0 : o.focus();
104
+ }, I = () => {
105
+ var o;
106
+ return (o = y().at(-1)) == null ? void 0 : o.focus();
107
+ }, $ = () => {
108
+ const o = a.value;
109
+ a.value = null, k.value = null, K(() => o == null ? void 0 : o.focus());
110
+ }, C = (o) => {
111
+ var f, x;
112
+ if (o.key === "Tab") {
113
+ a.value = null, k.value = null;
114
+ return;
115
+ }
116
+ const t = y(), s = t.indexOf(document.activeElement);
117
+ if (o.key === "Escape") {
118
+ o.preventDefault(), $();
119
+ return;
120
+ }
121
+ if (o.key === "Enter" || o.key === " ") {
122
+ o.preventDefault(), (f = t[s]) == null || f.click();
123
+ return;
124
+ }
125
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(o.key) || t.length === 0) return;
126
+ o.preventDefault();
127
+ let w = s;
128
+ o.key === "Home" && (w = 0), o.key === "End" && (w = t.length - 1), o.key === "ArrowDown" && (w = s < t.length - 1 ? s + 1 : 0), o.key === "ArrowUp" && (w = s > 0 ? s - 1 : t.length - 1), (x = t[w]) == null || x.focus();
78
129
  };
79
- return (L, g) => (l(), u("ul", {
130
+ return g({ focusFirstItem: D, focusLastItem: I }), (o, t) => (c(), v("ul", {
80
131
  class: "tr-history__menu-list",
81
132
  ref_key: "menuRef",
82
- ref: E,
83
- style: ie(o.value)
133
+ ref: _,
134
+ role: "menu",
135
+ onKeydown: C
84
136
  }, [
85
- (l(!0), u(S, null, V(h.items, (a) => (l(), u("li", {
137
+ (c(!0), v(B, null, F(h.items, (s) => (c(), v("li", {
86
138
  class: "tr-history__menu-list__item",
87
- key: a.id,
88
- onClick: (K) => v(a)
139
+ key: s.id,
140
+ role: "menuitem",
141
+ tabindex: "-1",
142
+ onClick: (w) => M(s)
89
143
  }, [
90
- (l(), H(Y(a.icon))),
91
- w("span", null, B(a.text), 1)
92
- ], 8, Ie))), 128))
93
- ], 4));
144
+ (c(), j(se(s.icon))),
145
+ R("span", null, H(s.text), 1)
146
+ ], 8, Pe))), 128))
147
+ ], 544));
94
148
  }
95
- }), Me = /* @__PURE__ */ z(xe, [["__scopeId", "data-v-89fdb41c"]]), be = ({
96
- renameControlOnClickOutside: s,
97
- onItemTitleChange: m
149
+ }), Be = /* @__PURE__ */ Q(Ae, [["__scopeId", "data-v-2ae68124"]]), He = ({
150
+ renameControlOnClickOutside: u,
151
+ onItemTitleChange: g,
152
+ resolveItem: d
98
153
  }) => {
99
- const t = y(void 0), c = y(null), h = I(() => {
100
- var o;
101
- return (o = c.value) == null ? void 0 : o.at(0);
102
- }), C = y(null), E = I(() => {
103
- var o;
104
- return (o = C.value) == null ? void 0 : o.at(0);
105
- }), p = y(null), x = I(() => {
106
- var o;
107
- return (o = p.value) == null ? void 0 : o.at(0);
108
- }), _ = y(""), M = (o) => {
109
- t.value = o, _.value = o.title, se(() => {
110
- const v = h.value;
111
- v && (v.focus(), v.select());
154
+ const a = re(void 0), k = E(() => {
155
+ const t = a.value;
156
+ if (t)
157
+ return d ? d(t) : t;
158
+ }), h = L(null), T = E(() => {
159
+ var t;
160
+ return (t = h.value) == null ? void 0 : t.at(0);
161
+ }), _ = L(null), M = E(() => {
162
+ var t;
163
+ return (t = _.value) == null ? void 0 : t.at(0);
164
+ }), y = L(null), D = E(() => {
165
+ var t;
166
+ return (t = y.value) == null ? void 0 : t.at(0);
167
+ }), I = L(""), $ = (t) => {
168
+ a.value = t, I.value = t.title, K(() => {
169
+ const s = T.value;
170
+ s && (s.focus(), s.select());
112
171
  });
113
- }, k = () => {
114
- t.value = void 0, _.value = "";
115
- }, R = () => {
116
- t.value && m(_.value, t.value), t.value = void 0, _.value = "";
172
+ }, C = () => {
173
+ a.value = void 0, I.value = "";
174
+ }, o = () => {
175
+ const t = k.value;
176
+ t && g(I.value, t), C();
117
177
  };
118
- return (s === "confirm" || s === "cancel") && Z(
119
- h,
178
+ return J(
179
+ k,
180
+ (t, s) => {
181
+ s && !t && C();
182
+ },
183
+ { flush: "sync" }
184
+ ), (u === "confirm" || u === "cancel") && le(
185
+ T,
120
186
  () => {
121
- s === "confirm" ? R() : k();
187
+ u === "confirm" ? o() : C();
122
188
  },
123
- { ignore: [E, x] }
189
+ { ignore: [M, D] }
124
190
  ), {
125
- editingItem: t,
126
- editorRefList: c,
127
- editorConfirmRefList: C,
128
- editorCancelRefList: p,
129
- editorValue: _,
130
- handleEdit: M,
131
- handleEditCancel: k,
132
- handleEditConfirm: R
191
+ editingItem: k,
192
+ editorRefList: h,
193
+ editorConfirmRefList: _,
194
+ editorCancelRefList: y,
195
+ editorValue: I,
196
+ handleEdit: $,
197
+ handleEditCancel: C,
198
+ handleEditConfirm: o
133
199
  };
134
- }, X = Symbol("NO_GROUP"), Te = {
200
+ }, oe = Symbol("NO_GROUP"), Ke = {
135
201
  key: 0,
136
202
  class: "tr-history__group-title"
137
- }, $e = { class: "tr-history__group-items" }, Ge = ["onClick"], Oe = ["title"], Se = ["onClick"], Be = /* @__PURE__ */ P({
203
+ }, Se = { class: "tr-history__group-items" }, Ve = ["onClick"], Ne = ["title"], Fe = ["aria-label", "aria-expanded", "onClick", "onKeydown"], je = /* @__PURE__ */ z({
138
204
  __name: "index",
139
205
  props: {
140
206
  data: {},
@@ -142,157 +208,201 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
142
208
  showRenameControls: { type: Boolean, default: !1 },
143
209
  renameControlOnClickOutside: { default: "confirm" },
144
210
  menuItems: { default: () => [
145
- { id: "rename", text: "重命名", icon: ce },
146
- { id: "delete", text: "删除", icon: de }
211
+ { id: "rename", text: "重命名", icon: ge },
212
+ { id: "delete", text: "删除", icon: he }
147
213
  ] },
148
214
  menuListGap: { default: 8 }
149
215
  },
150
216
  emits: ["item-click", "item-title-change", "item-action"],
151
- setup(s, { emit: m }) {
152
- const t = s, c = m, h = (i) => {
153
- var f;
154
- const e = typeof ((f = i[0]) == null ? void 0 : f.group);
155
- return e === "string" || e === "symbol";
156
- }, C = I(() => {
157
- const i = t.data;
158
- return h(i) ? i : [{ group: X, items: i }];
159
- }), E = I(() => C.value.length === 0 || C.value.every((i) => i.items.length === 0)), {
160
- editingItem: p,
161
- editorRefList: x,
162
- editorConfirmRefList: _,
163
- editorCancelRefList: M,
164
- editorValue: k,
165
- handleEdit: R,
166
- handleEditCancel: o,
167
- handleEditConfirm: v
168
- } = be({
169
- renameControlOnClickOutside: t.renameControlOnClickOutside,
170
- onItemTitleChange: (i, e) => {
171
- c("item-title-change", i, e);
217
+ setup(u, { emit: g }) {
218
+ const d = u, a = g, k = (e) => {
219
+ var l;
220
+ const n = typeof ((l = e[0]) == null ? void 0 : l.group);
221
+ return n === "string" || n === "symbol";
222
+ }, h = E(() => {
223
+ const e = d.data;
224
+ return k(e) ? e : [{ group: oe, items: e }];
225
+ }), T = E(() => h.value.length === 0 || h.value.every((e) => e.items.length === 0)), _ = E(() => h.value.flatMap((e) => e.items)), M = (e) => e.id ? _.value.find((n) => n.id === e.id) : _.value.find((n) => n === e), {
226
+ editingItem: y,
227
+ editorRefList: D,
228
+ editorConfirmRefList: I,
229
+ editorCancelRefList: $,
230
+ editorValue: C,
231
+ handleEdit: o,
232
+ handleEditCancel: t,
233
+ handleEditConfirm: s
234
+ } = He({
235
+ renameControlOnClickOutside: d.renameControlOnClickOutside,
236
+ onItemTitleChange: (e, n) => {
237
+ a("item-title-change", e, n);
238
+ },
239
+ resolveItem: M
240
+ }), { isTouchDevice: w } = Me(), f = L(null), x = re(null), p = E({
241
+ get: () => {
242
+ const e = x.value;
243
+ return e ? M(e) ?? null : null;
244
+ },
245
+ set: (e) => {
246
+ x.value = e;
172
247
  }
173
- }), { isTouchDevice: L } = Ce(), g = y(null), a = y(null), K = (i, e) => {
174
- if (i.currentTarget instanceof HTMLButtonElement) {
175
- if (a.value === e) {
176
- g.value = null, a.value = null;
248
+ }), O = L(null), W = (e) => {
249
+ K(() => {
250
+ var n, l;
251
+ e === "first" ? (n = O.value) == null || n.focusFirstItem() : (l = O.value) == null || l.focusLastItem();
252
+ });
253
+ }, ie = (e, n) => {
254
+ if (e.currentTarget instanceof HTMLButtonElement) {
255
+ if (p.value === n) {
256
+ f.value = null, p.value = null;
177
257
  return;
178
258
  }
179
- g.value = i.currentTarget, a.value = e;
259
+ f.value = e.currentTarget, p.value = n, e.detail === 0 && W("first");
180
260
  } else
181
- g.value = null, a.value = null;
182
- }, ee = (i) => {
183
- const e = a.value;
184
- e && (i.id === "rename" && R(e), c("item-action", i, e));
261
+ f.value = null, p.value = null;
262
+ }, X = (e, n, l) => {
263
+ e.preventDefault(), e.stopPropagation(), e.currentTarget instanceof HTMLButtonElement && (f.value = e.currentTarget, p.value = n, W(l));
264
+ }, V = () => {
265
+ f.value = null, p.value = null;
266
+ };
267
+ J(
268
+ p,
269
+ (e) => {
270
+ !e && x.value && V();
271
+ },
272
+ { flush: "sync" }
273
+ );
274
+ const ae = (e) => {
275
+ f.value && (e.preventDefault(), e.stopPropagation(), V());
276
+ }, ue = (e) => {
277
+ const n = p.value, l = f.value;
278
+ n && (e.id === "rename" ? o(n) : K(() => l == null ? void 0 : l.focus()), a("item-action", e, n));
185
279
  };
186
- return (i, e) => (l(), u("div", {
187
- class: U(["tr-history", { "touch-device": n(L) }])
280
+ return (e, n) => (c(), v("div", {
281
+ class: N(["tr-history", { "touch-device": i(w) }])
188
282
  }, [
189
- E.value ? (l(), H(Re, { key: 1 })) : (l(), u(S, { key: 0 }, [
190
- (l(!0), u(S, null, V(C.value, (f) => (l(), u("div", {
283
+ T.value ? (c(), j(Ge, { key: 1 })) : (c(), v(B, { key: 0 }, [
284
+ (c(!0), v(B, null, F(h.value, (l) => (c(), v("div", {
191
285
  class: "tr-history__group",
192
- key: f.group
286
+ key: l.group
193
287
  }, [
194
- f.group !== n(X) ? (l(), u("div", Te, B(f.group), 1)) : G("", !0),
195
- w("div", $e, [
196
- (l(!0), u(S, null, V(f.items, (r, te) => (l(), u("div", {
197
- class: U(["tr-history__item", {
198
- selected: r.id && r.id === t.selected,
199
- editing: n(p) === r,
200
- active: a.value === r
288
+ l.group !== i(oe) ? (c(), v("div", Ke, H(l.group), 1)) : A("", !0),
289
+ R("div", Se, [
290
+ (c(!0), v(B, null, F(l.items, (r, ce) => (c(), v("div", {
291
+ class: N(["tr-history__item", {
292
+ selected: r.id && r.id === d.selected,
293
+ editing: i(y) === r,
294
+ active: p.value === r
201
295
  }]),
202
- key: r.id || te,
203
- onClick: (d) => c("item-click", r)
296
+ key: r.id || ce,
297
+ onClick: (m) => a("item-click", r)
204
298
  }, [
205
- q(i.$slots, "item-prefix", { item: r }, void 0, !0),
206
- r.icon ? (l(), H(Y(r.icon), { key: 0 })) : G("", !0),
207
- n(p) === r ? A((l(), u("input", {
299
+ ee(e.$slots, "item-prefix", { item: r }, void 0, !0),
300
+ r.icon ? (c(), j(se(r.icon), { key: 0 })) : A("", !0),
301
+ i(y) === r ? te((c(), v("input", {
208
302
  key: 1,
209
303
  class: "tr-history__item-editor",
210
304
  type: "text",
211
- onClick: e[0] || (e[0] = J(() => {
305
+ onClick: n[0] || (n[0] = ne(() => {
212
306
  }, ["stop"])),
213
307
  ref_for: !0,
214
308
  ref_key: "editorRefList",
215
- ref: x,
216
- "onUpdate:modelValue": e[1] || (e[1] = (d) => re(k) ? k.value = d : null),
309
+ ref: D,
310
+ "onUpdate:modelValue": n[1] || (n[1] = (m) => me(C) ? C.value = m : null),
217
311
  onKeydown: [
218
- e[2] || (e[2] = F(
312
+ n[2] || (n[2] = b(
219
313
  //@ts-ignore
220
- (...d) => n(v) && n(v)(...d),
314
+ (...m) => i(s) && i(s)(...m),
221
315
  ["enter"]
222
316
  )),
223
- e[3] || (e[3] = F(
317
+ n[3] || (n[3] = b(
224
318
  //@ts-ignore
225
- (...d) => n(o) && n(o)(...d),
319
+ (...m) => i(t) && i(t)(...m),
226
320
  ["escape"]
227
321
  ))
228
322
  ]
229
323
  }, null, 544)), [
230
- [le, n(k)]
231
- ]) : q(i.$slots, "item-title", { item: r }, () => [
232
- w("span", {
324
+ [pe, i(C)]
325
+ ]) : ee(e.$slots, "item-title", { item: r }, () => [
326
+ R("span", {
233
327
  class: "text",
234
328
  title: r.title
235
- }, B(r.title), 9, Oe)
329
+ }, H(r.title), 9, Ne)
236
330
  ], !0, 2),
237
- w("span", {
331
+ R("span", {
238
332
  class: "tr-history__item-actions",
239
- onClick: e[6] || (e[6] = J(() => {
333
+ onClick: n[6] || (n[6] = ne(() => {
240
334
  }, ["stop"]))
241
335
  }, [
242
- t.showRenameControls && n(p) === r ? (l(), u("button", {
336
+ d.showRenameControls && i(y) === r ? (c(), v("button", {
243
337
  key: 0,
244
338
  class: "editor-confirm",
245
339
  ref_for: !0,
246
340
  ref_key: "editorConfirmRefList",
247
- ref: _,
248
- onClick: e[4] || (e[4] = //@ts-ignore
249
- (...d) => n(v) && n(v)(...d))
341
+ ref: I,
342
+ type: "button",
343
+ "aria-label": "确认重命名",
344
+ onClick: n[4] || (n[4] = //@ts-ignore
345
+ (...m) => i(s) && i(s)(...m))
250
346
  }, [
251
- T(n(me))
252
- ], 512)) : G("", !0),
253
- t.showRenameControls && n(p) === r ? (l(), u("button", {
347
+ P(i(_e))
348
+ ], 512)) : A("", !0),
349
+ d.showRenameControls && i(y) === r ? (c(), v("button", {
254
350
  key: 1,
255
351
  class: "editor-cancel",
256
352
  ref_for: !0,
257
353
  ref_key: "editorCancelRefList",
258
- ref: M,
259
- onClick: e[5] || (e[5] = //@ts-ignore
260
- (...d) => n(o) && n(o)(...d))
354
+ ref: $,
355
+ type: "button",
356
+ "aria-label": "取消重命名",
357
+ onClick: n[5] || (n[5] = //@ts-ignore
358
+ (...m) => i(t) && i(t)(...m))
261
359
  }, [
262
- T(n(fe))
263
- ], 512)) : G("", !0),
264
- w("button", {
265
- class: U(["menu", { hidden: n(p) === r }]),
266
- onClick: (d) => K(d, r)
360
+ P(i(ke))
361
+ ], 512)) : A("", !0),
362
+ R("button", {
363
+ class: N(["menu", { hidden: i(y) === r }]),
364
+ type: "button",
365
+ "aria-label": `${r.title} 更多操作`,
366
+ "aria-haspopup": "menu",
367
+ "aria-expanded": p.value === r,
368
+ onClick: (m) => ie(m, r),
369
+ onKeydown: [
370
+ b((m) => X(m, r, "first"), ["down"]),
371
+ b((m) => X(m, r, "last"), ["up"]),
372
+ b(ae, ["escape"]),
373
+ b(V, ["tab"])
374
+ ]
267
375
  }, [
268
- T(n(pe))
269
- ], 10, Se)
376
+ P(i(Ce))
377
+ ], 42, Fe)
270
378
  ])
271
- ], 10, Ge))), 128))
379
+ ], 10, Ve))), 128))
272
380
  ])
273
381
  ]))), 128)),
274
- A(T(Me, {
275
- trigger: g.value,
276
- "onUpdate:trigger": e[7] || (e[7] = (f) => g.value = f),
277
- data: a.value,
278
- "onUpdate:data": e[8] || (e[8] = (f) => a.value = f),
279
- items: t.menuItems,
280
- "menu-list-gap": t.menuListGap,
281
- onItemClick: ee
382
+ te(P(Be, {
383
+ ref_key: "menuListRef",
384
+ ref: O,
385
+ trigger: f.value,
386
+ "onUpdate:trigger": n[7] || (n[7] = (l) => f.value = l),
387
+ data: p.value,
388
+ "onUpdate:data": n[8] || (n[8] = (l) => p.value = l),
389
+ items: d.menuItems,
390
+ "menu-list-gap": d.menuListGap,
391
+ onItemClick: ue
282
392
  }, null, 8, ["trigger", "data", "items", "menu-list-gap"]), [
283
- [ue, g.value]
393
+ [ve, f.value]
284
394
  ])
285
395
  ], 64))
286
396
  ], 2));
287
397
  }
288
- }), N = /* @__PURE__ */ z(Be, [["__scopeId", "data-v-125148d2"]]), De = function(s) {
289
- s.component(N.name, N);
398
+ }), q = /* @__PURE__ */ Q(je, [["__scopeId", "data-v-85a4fc3d"]]), qe = function(u) {
399
+ u.component(q.name, q);
290
400
  };
291
- Object.assign(N, {
401
+ Object.assign(q, {
292
402
  name: "TrHistory",
293
- install: De
403
+ install: qe
294
404
  });
295
405
  export {
296
- N as H,
297
- Ce as u
406
+ q as H,
407
+ Me as u
298
408
  };