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