@opentiny/tiny-robot 0.3.0-alpha.0 → 0.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-group/index.js +13 -13
- package/dist/bubble/index.js +2141 -1360
- package/dist/close.js +1 -1
- package/dist/container/index.js +7 -7
- package/dist/dropdown-menu/index.js +38 -37
- package/dist/feedback/index.js +46 -45
- package/dist/flow-layout-buttons/index.js +20 -20
- package/dist/history/index.js +34 -35
- package/dist/index.d.ts +329 -290
- package/dist/index.js +62 -59
- package/dist/index2.js +343 -394
- package/dist/index3.js +129 -3717
- package/dist/index4.js +7 -7
- package/dist/index5.js +931 -2011
- package/dist/index6.js +1020 -891
- package/dist/loading.js +4 -0
- package/dist/prompts/index.js +2 -3
- package/dist/question/index.js +59 -59
- package/dist/sender/index.js +1017 -1025
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +95 -95
- package/dist/suggestion-pills/index.js +130 -109
- package/dist/suggestion-popover/index.js +243 -127
- package/dist/tiny-robot-svgs.js +211 -488
- package/dist/utils.js +15 -4
- package/package.json +4 -3
- package/dist/attachments/index.js +0 -602
package/dist/suggestion/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as U, ref as p, computed as P, watch as K, watchEffect as ne, onMounted as Y, onBeforeUnmount as Z, createElementBlock as v, openBlock as g, normalizeClass as j, createElementVNode as u, withDirectives as oe, Fragment as z, renderList as M, createVNode as E, unref as w, toDisplayString as T, vShow as le, nextTick as ie, renderSlot as x, createCommentVNode as N, createBlock as L, normalizeStyle as ae, resolveComponent as ce, withCtx as O } from "vue";
|
|
2
|
+
import { C as Q, x as G, s as re, f as ue, A as ge } from "../tiny-robot-svgs.js";
|
|
3
3
|
function de(l, c = "") {
|
|
4
4
|
const s = document.createElement("div");
|
|
5
5
|
c && (s.className = c), s.style.visibility = "hidden", s.style.position = "absolute", s.style.whiteSpace = "nowrap", s.textContent = l, document.body.appendChild(s);
|
|
6
6
|
const o = s.offsetWidth;
|
|
7
7
|
return document.body.removeChild(s), o;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const F = /* @__PURE__ */ new Map();
|
|
10
10
|
function X(l, c = "") {
|
|
11
11
|
const s = `${l}::${c}`;
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
12
|
+
if (F.has(s))
|
|
13
|
+
return F.get(s);
|
|
14
14
|
const o = de(l, c);
|
|
15
|
-
return
|
|
15
|
+
return F.set(s, o), o;
|
|
16
16
|
}
|
|
17
|
-
const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-suggestions_expanded-wrapper" }, pe = { class: "tr-common-suggestions_expanded-area" },
|
|
17
|
+
const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-suggestions_expanded-wrapper" }, pe = { class: "tr-common-suggestions_expanded-area" }, fe = ["onClick"], he = { class: "tr-common-suggestions_item_icon" }, ye = { class: "tr-common-suggestions_item_text" }, _e = { class: "tr-common-suggestions_container" }, ke = ["onClick"], Ce = { class: "tr-common-suggestions_item_icon" }, xe = { class: "tr-common-suggestions_item_text" }, $e = /* @__PURE__ */ U({
|
|
18
18
|
__name: "SuggestionCapsule",
|
|
19
19
|
props: {
|
|
20
20
|
suggestions: {
|
|
@@ -28,15 +28,15 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["suggestion-click", "show-expand-button"],
|
|
30
30
|
setup(l, { emit: c }) {
|
|
31
|
-
const s = l, o = c, n = p(null),
|
|
32
|
-
if (
|
|
31
|
+
const s = l, o = c, n = p(null), h = p(!1), t = p(!1), m = p([]), a = p([]), f = p(0), S = p(null), R = P(() => {
|
|
32
|
+
if (f.value <= 0 || a.value.length === 0) return [];
|
|
33
33
|
const i = [], d = [...a.value];
|
|
34
34
|
for (; d.length > 0; )
|
|
35
|
-
i.push(d.splice(0,
|
|
35
|
+
i.push(d.splice(0, f.value));
|
|
36
36
|
return i.reverse();
|
|
37
37
|
}), b = async () => {
|
|
38
38
|
if (await ie(), !n.value || s.suggestions.length === 0) {
|
|
39
|
-
|
|
39
|
+
h.value = !1, o("show-expand-button", !1);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
const d = n.value.clientWidth;
|
|
@@ -50,12 +50,12 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
50
50
|
k += I;
|
|
51
51
|
}
|
|
52
52
|
const q = k / B;
|
|
53
|
-
|
|
53
|
+
f.value = Math.max(1, Math.floor(d / q));
|
|
54
54
|
for (let C = 0; C < s.suggestions.length; C++) {
|
|
55
|
-
const I = s.suggestions[C],
|
|
56
|
-
r +
|
|
55
|
+
const I = s.suggestions[C], A = X(I.text, "tr-common-suggestions_item") + _;
|
|
56
|
+
r + A <= d ? (r += A, m.value.push(I)) : a.value.push(I);
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
h.value = a.value.length > 0, o("show-expand-button", h.value);
|
|
59
59
|
}, y = (i) => {
|
|
60
60
|
o("suggestion-click", i);
|
|
61
61
|
};
|
|
@@ -73,7 +73,7 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
73
73
|
}), Z(() => {
|
|
74
74
|
S.value && S.value.disconnect();
|
|
75
75
|
}), (i, d) => (g(), v("div", {
|
|
76
|
-
class:
|
|
76
|
+
class: j(["tr-common-suggestions", { expanded: t.value }]),
|
|
77
77
|
ref_key: "capsuleRef",
|
|
78
78
|
ref: n
|
|
79
79
|
}, [
|
|
@@ -89,11 +89,11 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
89
89
|
class: "tr-common-suggestions_item",
|
|
90
90
|
onClick: (q) => y(k)
|
|
91
91
|
}, [
|
|
92
|
-
u("div",
|
|
93
|
-
E(w(
|
|
92
|
+
u("div", he, [
|
|
93
|
+
E(w(Q))
|
|
94
94
|
]),
|
|
95
95
|
u("div", ye, T(k.text), 1)
|
|
96
|
-
], 8,
|
|
96
|
+
], 8, fe))), 128))
|
|
97
97
|
]))), 128))
|
|
98
98
|
], 512), [
|
|
99
99
|
[le, t.value && a.value.length > 0]
|
|
@@ -106,9 +106,9 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
106
106
|
onClick: (k) => y(r)
|
|
107
107
|
}, [
|
|
108
108
|
u("div", Ce, [
|
|
109
|
-
E(w(
|
|
109
|
+
E(w(Q))
|
|
110
110
|
]),
|
|
111
|
-
u("div",
|
|
111
|
+
u("div", xe, T(r.text), 1)
|
|
112
112
|
], 8, ke))), 128))
|
|
113
113
|
])
|
|
114
114
|
])
|
|
@@ -117,7 +117,7 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
117
117
|
}), be = { class: "tr-suggestion-categories" }, we = ["onClick"], Se = {
|
|
118
118
|
key: 0,
|
|
119
119
|
class: "category-icon"
|
|
120
|
-
}, Ie = /* @__PURE__ */
|
|
120
|
+
}, Ie = /* @__PURE__ */ U({
|
|
121
121
|
__name: "CategoryNav",
|
|
122
122
|
props: {
|
|
123
123
|
categories: {
|
|
@@ -134,13 +134,13 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
134
134
|
const s = c, o = (n) => {
|
|
135
135
|
s("category-select", n);
|
|
136
136
|
};
|
|
137
|
-
return (n,
|
|
137
|
+
return (n, h) => (g(), v("div", be, [
|
|
138
138
|
(g(!0), v(z, null, M(l.categories, (t) => (g(), v("div", {
|
|
139
139
|
key: t.id,
|
|
140
|
-
class:
|
|
140
|
+
class: j(["tr-suggestion-categories-item", { active: l.activeCategory === t.id }]),
|
|
141
141
|
onClick: (m) => o(t.id)
|
|
142
142
|
}, [
|
|
143
|
-
|
|
143
|
+
x(n.$slots, "category-label", { category: t }, () => [
|
|
144
144
|
t.icon ? (g(), v("div", Se, T(t.icon), 1)) : N("", !0),
|
|
145
145
|
u("span", null, T(t.label), 1)
|
|
146
146
|
])
|
|
@@ -175,8 +175,8 @@ function Ee(l, c = {}) {
|
|
|
175
175
|
setTimeout(() => {
|
|
176
176
|
const t = document.querySelector(`.tr-suggestion-list-item:nth-child(${s.value + 1})`), m = t == null ? void 0 : t.closest(".tr-suggestion-content");
|
|
177
177
|
if (t && m) {
|
|
178
|
-
const a = m.getBoundingClientRect(),
|
|
179
|
-
|
|
178
|
+
const a = m.getBoundingClientRect(), f = t.getBoundingClientRect();
|
|
179
|
+
f.bottom > a.bottom ? m.scrollTop += f.bottom - a.bottom : f.top < a.top && (m.scrollTop -= a.top - f.top);
|
|
180
180
|
}
|
|
181
181
|
}, 0);
|
|
182
182
|
};
|
|
@@ -189,16 +189,16 @@ function Ee(l, c = {}) {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header" }, De = { class: "tr-suggestion-header-left" }, Oe = { class: "tr-suggestion-header-icon" }, Re = { class: "tr-suggestion-header-title" },
|
|
192
|
+
const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header" }, De = { class: "tr-suggestion-header-left" }, Oe = { class: "tr-suggestion-header-icon" }, Re = { class: "tr-suggestion-header-title" }, Ae = { class: "close-icon" }, Ve = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "tr-suggestion-loading"
|
|
195
|
-
},
|
|
195
|
+
}, We = { key: 1 }, Ke = ["onClick", "onMouseenter"], ze = { class: "item-content" }, Me = { class: "item-label" }, Ne = {
|
|
196
196
|
key: 0,
|
|
197
197
|
class: "item-description"
|
|
198
198
|
}, qe = {
|
|
199
199
|
key: 2,
|
|
200
200
|
class: "tr-suggestion-empty"
|
|
201
|
-
},
|
|
201
|
+
}, Le = /* @__PURE__ */ U({
|
|
202
202
|
__name: "SuggestionPanel",
|
|
203
203
|
props: {
|
|
204
204
|
items: {
|
|
@@ -224,11 +224,11 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
224
224
|
},
|
|
225
225
|
emits: ["close", "select", "category-select", "item-hover"],
|
|
226
226
|
setup(l, { expose: c, emit: s }) {
|
|
227
|
-
const o = l, n = s,
|
|
227
|
+
const o = l, n = s, h = p(o.items), { handleKeyDown: t, activeIndex: m } = Ee(h, {
|
|
228
228
|
initialIndex: 0,
|
|
229
229
|
onClose: () => n("close"),
|
|
230
230
|
onSelect: (i) => n("select", i)
|
|
231
|
-
}), a = p(o.categories.length > 0 ? o.categories[0].id : ""),
|
|
231
|
+
}), a = p(o.categories.length > 0 ? o.categories[0].id : ""), f = P(() => {
|
|
232
232
|
if (o.categories.length === 0 || !a.value)
|
|
233
233
|
return o.items;
|
|
234
234
|
const i = o.categories.find((d) => d.id === a.value);
|
|
@@ -250,8 +250,8 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
250
250
|
u("div", Be, [
|
|
251
251
|
u("div", De, [
|
|
252
252
|
u("div", Oe, [
|
|
253
|
-
|
|
254
|
-
E(w(
|
|
253
|
+
x(i.$slots, "title-icon", {}, () => [
|
|
254
|
+
E(w(G), { style: { color: "#1476ff", "font-size": "24px" } })
|
|
255
255
|
])
|
|
256
256
|
]),
|
|
257
257
|
u("div", Re, T(l.title), 1)
|
|
@@ -260,12 +260,12 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
260
260
|
class: "tr-suggestion-close-btn",
|
|
261
261
|
onClick: b
|
|
262
262
|
}, [
|
|
263
|
-
u("span",
|
|
263
|
+
u("span", Ae, [
|
|
264
264
|
E(w(re))
|
|
265
265
|
])
|
|
266
266
|
])
|
|
267
267
|
]),
|
|
268
|
-
l.categories.length > 0 ? (g(),
|
|
268
|
+
l.categories.length > 0 ? (g(), L(Ie, {
|
|
269
269
|
key: 0,
|
|
270
270
|
categories: l.categories,
|
|
271
271
|
"active-category": a.value,
|
|
@@ -273,20 +273,20 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
273
273
|
}, null, 8, ["categories", "active-category"])) : N("", !0),
|
|
274
274
|
u("div", {
|
|
275
275
|
class: "tr-suggestion-content",
|
|
276
|
-
style: ae({ "max-height":
|
|
276
|
+
style: ae({ "max-height": f.value.length > l.maxVisibleItems ? `${l.maxVisibleItems * 56}px` : "auto" })
|
|
277
277
|
}, [
|
|
278
|
-
l.loading ? (g(), v("div",
|
|
279
|
-
|
|
278
|
+
l.loading ? (g(), v("div", Ve, [
|
|
279
|
+
x(i.$slots, "loading-indicator", {}, () => [
|
|
280
280
|
d[0] || (d[0] = u("div", { class: "tr-suggestion-loading-spinner" }, null, -1))
|
|
281
281
|
])
|
|
282
|
-
])) :
|
|
283
|
-
(g(!0), v(z, null, M(
|
|
282
|
+
])) : f.value.length > 0 ? (g(), v("ul", We, [
|
|
283
|
+
(g(!0), v(z, null, M(f.value, (r, _) => (g(), v("li", {
|
|
284
284
|
key: r.id,
|
|
285
|
-
class:
|
|
285
|
+
class: j(["tr-suggestion-list-item", { "tr-suggestion-item-active": _ === w(m) }]),
|
|
286
286
|
onClick: (k) => R(r),
|
|
287
287
|
onMouseenter: (k) => y(_)
|
|
288
288
|
}, [
|
|
289
|
-
|
|
289
|
+
x(i.$slots, "item", {
|
|
290
290
|
item: r,
|
|
291
291
|
active: _ === w(m)
|
|
292
292
|
}, () => [
|
|
@@ -297,14 +297,14 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
297
297
|
])
|
|
298
298
|
], 42, Ke))), 128))
|
|
299
299
|
])) : (g(), v("div", qe, [
|
|
300
|
-
|
|
300
|
+
x(i.$slots, "empty", {}, () => [
|
|
301
301
|
d[1] || (d[1] = u("p", null, "无匹配结果", -1))
|
|
302
302
|
])
|
|
303
303
|
]))
|
|
304
304
|
], 4)
|
|
305
305
|
]));
|
|
306
306
|
}
|
|
307
|
-
}),
|
|
307
|
+
}), Pe = (l) => {
|
|
308
308
|
const c = (o) => l.triggerKeys.includes(o);
|
|
309
309
|
return {
|
|
310
310
|
isTriggerKey: c,
|
|
@@ -317,7 +317,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
317
317
|
} : null;
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
|
-
},
|
|
320
|
+
}, He = { class: "tr-suggestion__header" }, H = /* @__PURE__ */ U({
|
|
321
321
|
__name: "index",
|
|
322
322
|
props: {
|
|
323
323
|
triggerKeys: { default: () => ["/"] },
|
|
@@ -334,17 +334,17 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
334
334
|
},
|
|
335
335
|
emits: ["update:open", "select", "close", "trigger", "category-select", "suggestion-select", "update:expanded", "fill-template"],
|
|
336
336
|
setup(l, { expose: c, emit: s }) {
|
|
337
|
-
const o = l, n = s,
|
|
337
|
+
const o = l, n = s, h = p(!1), t = p([]), m = p({
|
|
338
338
|
text: "",
|
|
339
339
|
position: 0
|
|
340
|
-
}), a = p(o.defaultExpanded),
|
|
340
|
+
}), a = p(o.defaultExpanded), f = p(!1), S = () => {
|
|
341
341
|
a.value = !a.value, n("update:expanded", a.value);
|
|
342
342
|
}, R = (e) => {
|
|
343
|
-
|
|
344
|
-
}, b = p(""), y = p(-1), i = p(null), d = p(null), r =
|
|
343
|
+
f.value = e;
|
|
344
|
+
}, b = p(""), y = p(-1), i = p(null), d = p(null), r = P(() => o.open !== void 0 ? o.open : h.value), _ = P(() => {
|
|
345
345
|
if (o.categories.length === 0 || !b.value)
|
|
346
346
|
return t.value;
|
|
347
|
-
const e = o.categories.find((
|
|
347
|
+
const e = o.categories.find(($) => $.id === b.value);
|
|
348
348
|
return e ? e.items : [];
|
|
349
349
|
});
|
|
350
350
|
K(r, (e) => {
|
|
@@ -360,87 +360,87 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
360
360
|
);
|
|
361
361
|
const k = () => {
|
|
362
362
|
t.value = [...o.items];
|
|
363
|
-
}, { detectTrigger: B } =
|
|
363
|
+
}, { detectTrigger: B } = Pe(o), q = (e) => {
|
|
364
364
|
n("suggestion-select", e), n("select", e.value, {
|
|
365
365
|
text: "",
|
|
366
366
|
position: 0
|
|
367
367
|
}), e.template && n("fill-template", e.template);
|
|
368
368
|
}, C = (e) => {
|
|
369
|
-
e === !1 ?
|
|
369
|
+
e === !1 ? V() : (typeof e == "object" && e !== null && (m.value = {
|
|
370
370
|
text: e.text || "",
|
|
371
371
|
position: e.position || 0
|
|
372
|
-
}), k(),
|
|
373
|
-
}, I = (e,
|
|
374
|
-
const
|
|
375
|
-
return
|
|
376
|
-
},
|
|
372
|
+
}), k(), h.value = !0, n("update:open", !0));
|
|
373
|
+
}, I = (e, $) => {
|
|
374
|
+
const W = B(e, $);
|
|
375
|
+
return W ? (m.value = W, C(W), !0) : r.value && $ === "" ? (C(!1), !0) : !1;
|
|
376
|
+
}, A = (e) => {
|
|
377
377
|
if (r.value && d.value) {
|
|
378
378
|
d.value.handleKeyDown(e);
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
|
-
},
|
|
382
|
-
o.open === void 0 && (
|
|
381
|
+
}, V = () => {
|
|
382
|
+
o.open === void 0 && (h.value = !1), n("update:open", !1), n("close");
|
|
383
383
|
}, ee = (e) => {
|
|
384
384
|
b.value = e.id, y.value = 0, n("category-select", e);
|
|
385
|
-
}, te = (e,
|
|
386
|
-
n("select", e.text,
|
|
387
|
-
},
|
|
388
|
-
o.closeOnOutsideClick && r.value && i.value && !i.value.contains(e.target) &&
|
|
385
|
+
}, te = (e, $) => {
|
|
386
|
+
n("select", e.text, $), e.template && n("fill-template", e.template), V();
|
|
387
|
+
}, J = (e) => {
|
|
388
|
+
o.closeOnOutsideClick && r.value && i.value && !i.value.contains(e.target) && V();
|
|
389
389
|
}, se = () => {
|
|
390
|
-
r.value ?
|
|
390
|
+
r.value ? V() : (k(), h.value = !0, n("update:open", !0));
|
|
391
391
|
};
|
|
392
392
|
return Y(() => {
|
|
393
|
-
o.closeOnOutsideClick && document.addEventListener("click",
|
|
393
|
+
o.closeOnOutsideClick && document.addEventListener("click", J);
|
|
394
394
|
}), Z(() => {
|
|
395
|
-
o.closeOnOutsideClick && document.removeEventListener("click",
|
|
395
|
+
o.closeOnOutsideClick && document.removeEventListener("click", J);
|
|
396
396
|
}), c({
|
|
397
397
|
trigger: C,
|
|
398
|
-
keyDown:
|
|
398
|
+
keyDown: A,
|
|
399
399
|
input: I,
|
|
400
400
|
toggleExpand: S
|
|
401
|
-
}), (e,
|
|
402
|
-
const
|
|
401
|
+
}), (e, $) => {
|
|
402
|
+
const W = ce("IconEdit");
|
|
403
403
|
return g(), v("div", {
|
|
404
404
|
ref_key: "rootRef",
|
|
405
405
|
ref: i,
|
|
406
|
-
class:
|
|
406
|
+
class: j(["tr-suggestion", e.className, { "tr-suggestion--dark": e.theme === "dark" }])
|
|
407
407
|
}, [
|
|
408
|
-
u("div",
|
|
408
|
+
u("div", He, [
|
|
409
409
|
u("div", {
|
|
410
410
|
class: "tr-suggestion__trigger",
|
|
411
411
|
onClick: se
|
|
412
412
|
}, [
|
|
413
|
-
E(w(
|
|
413
|
+
E(w(G), { style: { color: "#1476ff" } })
|
|
414
414
|
]),
|
|
415
|
-
E(
|
|
415
|
+
E($e, {
|
|
416
416
|
suggestions: e.items,
|
|
417
417
|
isExpanded: a.value,
|
|
418
418
|
onSuggestionClick: q,
|
|
419
419
|
onShowExpandButton: R
|
|
420
420
|
}, {
|
|
421
421
|
"suggestion-icon": O((D) => [
|
|
422
|
-
|
|
422
|
+
x(e.$slots, "capsule-icon", {
|
|
423
423
|
suggestion: D.suggestion
|
|
424
424
|
}, () => [
|
|
425
|
-
E(
|
|
425
|
+
E(W)
|
|
426
426
|
])
|
|
427
427
|
]),
|
|
428
428
|
_: 3
|
|
429
429
|
}, 8, ["suggestions", "isExpanded"]),
|
|
430
|
-
|
|
430
|
+
f.value ? (g(), v("div", {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "tr-suggestion__expand-button",
|
|
433
433
|
onClick: S
|
|
434
434
|
}, [
|
|
435
|
-
a.value ? (g(),
|
|
435
|
+
a.value ? (g(), L(w(ge), { key: 1 })) : (g(), L(w(ue), { key: 0 }))
|
|
436
436
|
])) : N("", !0)
|
|
437
437
|
]),
|
|
438
|
-
|
|
438
|
+
x(e.$slots, "trigger", {
|
|
439
439
|
onTrigger: C,
|
|
440
|
-
onKeyDown:
|
|
440
|
+
onKeyDown: A,
|
|
441
441
|
onInput: I
|
|
442
442
|
}),
|
|
443
|
-
r.value ? (g(),
|
|
443
|
+
r.value ? (g(), L(Le, {
|
|
444
444
|
key: 0,
|
|
445
445
|
ref_key: "panelRef",
|
|
446
446
|
ref: d,
|
|
@@ -451,34 +451,34 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
451
451
|
title: e.title,
|
|
452
452
|
maxVisibleItems: e.maxVisibleItems,
|
|
453
453
|
triggerContext: m.value,
|
|
454
|
-
onClose:
|
|
454
|
+
onClose: V,
|
|
455
455
|
onSelect: te,
|
|
456
456
|
onCategorySelect: ee
|
|
457
457
|
}, {
|
|
458
458
|
"title-icon": O(() => [
|
|
459
|
-
|
|
460
|
-
E(w(
|
|
459
|
+
x(e.$slots, "title-icon", {}, () => [
|
|
460
|
+
E(w(G), { style: { "font-size": "24px", color: "#1476ff" } })
|
|
461
461
|
])
|
|
462
462
|
]),
|
|
463
463
|
"category-label": O((D) => [
|
|
464
|
-
|
|
464
|
+
x(e.$slots, "category-label", {
|
|
465
465
|
category: D.category
|
|
466
466
|
})
|
|
467
467
|
]),
|
|
468
468
|
item: O((D) => [
|
|
469
|
-
|
|
469
|
+
x(e.$slots, "item", {
|
|
470
470
|
item: D.item,
|
|
471
471
|
active: D.active
|
|
472
472
|
})
|
|
473
473
|
]),
|
|
474
474
|
"loading-indicator": O(() => [
|
|
475
|
-
|
|
476
|
-
|
|
475
|
+
x(e.$slots, "loading-indicator", {}, () => [
|
|
476
|
+
$[0] || ($[0] = u("div", { class: "tr-suggestion__loading-spinner" }, null, -1))
|
|
477
477
|
])
|
|
478
478
|
]),
|
|
479
479
|
empty: O(() => [
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
x(e.$slots, "empty", {}, () => [
|
|
481
|
+
$[1] || ($[1] = u("p", null, "无匹配结果", -1))
|
|
482
482
|
])
|
|
483
483
|
]),
|
|
484
484
|
_: 3
|
|
@@ -487,11 +487,11 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
489
|
});
|
|
490
|
-
|
|
491
|
-
const
|
|
492
|
-
l.component(
|
|
490
|
+
H.name = "TrSuggestion";
|
|
491
|
+
const Ue = function(l) {
|
|
492
|
+
l.component(H.name, H);
|
|
493
493
|
};
|
|
494
|
-
|
|
494
|
+
H.install = Ue;
|
|
495
495
|
export {
|
|
496
|
-
|
|
496
|
+
H as default
|
|
497
497
|
};
|