@opentiny/tiny-robot 0.3.0-alpha.0 → 0.3.0-alpha.10
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 +44 -41
- package/dist/attachments/index.js +472 -548
- package/dist/base-popper/index.js +4 -0
- package/dist/bubble/index.js +3 -4
- package/dist/close.js +1 -1
- package/dist/container/index.js +9 -9
- package/dist/drag-overlay/index.js +57 -0
- package/dist/dropdown-menu/index.js +84 -63
- package/dist/feedback/index.js +39 -38
- package/dist/flow-layout-buttons/index.js +29 -26
- package/dist/history/index.js +36 -37
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +950 -885
- package/dist/index.js +196 -74
- package/dist/index2.js +608 -574
- package/dist/index3.js +626 -3833
- package/dist/index4.js +136 -622
- package/dist/index5.js +251 -3173
- package/dist/index6.js +2072 -4539
- package/dist/index7.js +4749 -0
- package/dist/prompts/index.js +2 -3
- package/dist/question/index.js +83 -83
- package/dist/sender/index.js +1106 -1209
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +27 -27
- package/dist/suggestion-pills/index.js +140 -143
- package/dist/suggestion-popover/index.js +292 -146
- package/dist/tiny-robot-svgs.js +319 -271
- package/dist/useSlotRefs.js +36 -0
- package/package.json +3 -3
package/dist/suggestion/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as H, 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 X, 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 $, createCommentVNode as N, createBlock as L, normalizeStyle as ae, resolveComponent as ce, withCtx as O } from "vue";
|
|
2
|
+
import { e as J, X as F, U as re, V as ue, W 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);
|
|
@@ -7,14 +7,14 @@ function de(l, c = "") {
|
|
|
7
7
|
return document.body.removeChild(s), o;
|
|
8
8
|
}
|
|
9
9
|
const j = /* @__PURE__ */ new Map();
|
|
10
|
-
function
|
|
10
|
+
function Q(l, c = "") {
|
|
11
11
|
const s = `${l}::${c}`;
|
|
12
12
|
if (j.has(s))
|
|
13
13
|
return j.get(s);
|
|
14
14
|
const o = de(l, c);
|
|
15
15
|
return j.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" }, he = ["onClick"], fe = { 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" }, $e = { class: "tr-common-suggestions_item_text" }, xe = /* @__PURE__ */
|
|
17
|
+
const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-suggestions_expanded-wrapper" }, pe = { class: "tr-common-suggestions_expanded-area" }, he = ["onClick"], fe = { 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" }, $e = { class: "tr-common-suggestions_item_text" }, xe = /* @__PURE__ */ H({
|
|
18
18
|
__name: "SuggestionCapsule",
|
|
19
19
|
props: {
|
|
20
20
|
suggestions: {
|
|
@@ -28,7 +28,7 @@ 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), f = p(!1), t = p(!1), m = p([]), a = p([]), h = p(0), S = p(null), R =
|
|
31
|
+
const s = l, o = c, n = p(null), f = p(!1), t = p(!1), m = p([]), a = p([]), h = p(0), S = p(null), R = P(() => {
|
|
32
32
|
if (h.value <= 0 || a.value.length === 0) return [];
|
|
33
33
|
const i = [], d = [...a.value];
|
|
34
34
|
for (; d.length > 0; )
|
|
@@ -46,13 +46,13 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
46
46
|
let k = 0;
|
|
47
47
|
const B = Math.min(3, s.suggestions.length);
|
|
48
48
|
for (let C = 0; C < B; C++) {
|
|
49
|
-
const I =
|
|
49
|
+
const I = Q(s.suggestions[C].text, "tr-common-suggestions_item") + _;
|
|
50
50
|
k += I;
|
|
51
51
|
}
|
|
52
52
|
const q = k / B;
|
|
53
53
|
h.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], V =
|
|
55
|
+
const I = s.suggestions[C], V = Q(I.text, "tr-common-suggestions_item") + _;
|
|
56
56
|
r + V <= d ? (r += V, m.value.push(I)) : a.value.push(I);
|
|
57
57
|
}
|
|
58
58
|
f.value = a.value.length > 0, o("show-expand-button", f.value);
|
|
@@ -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: X(["tr-common-suggestions", { expanded: t.value }]),
|
|
77
77
|
ref_key: "capsuleRef",
|
|
78
78
|
ref: n
|
|
79
79
|
}, [
|
|
@@ -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__ */ H({
|
|
121
121
|
__name: "CategoryNav",
|
|
122
122
|
props: {
|
|
123
123
|
categories: {
|
|
@@ -137,7 +137,7 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
137
137
|
return (n, f) => (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: X(["tr-suggestion-categories-item", { active: l.activeCategory === t.id }]),
|
|
141
141
|
onClick: (m) => o(t.id)
|
|
142
142
|
}, [
|
|
143
143
|
$(n.$slots, "category-label", { category: t }, () => [
|
|
@@ -198,7 +198,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
198
198
|
}, qe = {
|
|
199
199
|
key: 2,
|
|
200
200
|
class: "tr-suggestion-empty"
|
|
201
|
-
},
|
|
201
|
+
}, Le = /* @__PURE__ */ H({
|
|
202
202
|
__name: "SuggestionPanel",
|
|
203
203
|
props: {
|
|
204
204
|
items: {
|
|
@@ -228,7 +228,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
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 : ""), h =
|
|
231
|
+
}), a = p(o.categories.length > 0 ? o.categories[0].id : ""), h = 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);
|
|
@@ -265,7 +265,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
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,
|
|
@@ -282,7 +282,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
282
282
|
])) : h.value.length > 0 ? (g(), v("ul", Ae, [
|
|
283
283
|
(g(!0), v(z, null, M(h.value, (r, _) => (g(), v("li", {
|
|
284
284
|
key: r.id,
|
|
285
|
-
class:
|
|
285
|
+
class: X(["tr-suggestion-list-item", { "tr-suggestion-item-active": _ === w(m) }]),
|
|
286
286
|
onClick: (k) => R(r),
|
|
287
287
|
onMouseenter: (k) => y(_)
|
|
288
288
|
}, [
|
|
@@ -304,7 +304,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
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
|
+
}, Ue = { class: "tr-suggestion__header" }, U = /* @__PURE__ */ H({
|
|
321
321
|
__name: "index",
|
|
322
322
|
props: {
|
|
323
323
|
triggerKeys: { default: () => ["/"] },
|
|
@@ -341,7 +341,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
341
341
|
a.value = !a.value, n("update:expanded", a.value);
|
|
342
342
|
}, R = (e) => {
|
|
343
343
|
h.value = e;
|
|
344
|
-
}, b = p(""), y = p(-1), i = p(null), d = p(null), r =
|
|
344
|
+
}, b = p(""), y = p(-1), i = p(null), d = p(null), r = P(() => o.open !== void 0 ? o.open : f.value), _ = P(() => {
|
|
345
345
|
if (o.categories.length === 0 || !b.value)
|
|
346
346
|
return t.value;
|
|
347
347
|
const e = o.categories.find((x) => x.id === b.value);
|
|
@@ -360,7 +360,7 @@ 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
|
|
@@ -403,9 +403,9 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
403
403
|
return g(), v("div", {
|
|
404
404
|
ref_key: "rootRef",
|
|
405
405
|
ref: i,
|
|
406
|
-
class:
|
|
406
|
+
class: X(["tr-suggestion", e.className, { "tr-suggestion--dark": e.theme === "dark" }])
|
|
407
407
|
}, [
|
|
408
|
-
u("div",
|
|
408
|
+
u("div", Ue, [
|
|
409
409
|
u("div", {
|
|
410
410
|
class: "tr-suggestion__trigger",
|
|
411
411
|
onClick: se
|
|
@@ -432,7 +432,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
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
|
$(e.$slots, "trigger", {
|
|
@@ -440,7 +440,7 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
440
440
|
onKeyDown: V,
|
|
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,
|
|
@@ -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
|
+
U.name = "TrSuggestion";
|
|
491
|
+
const He = function(l) {
|
|
492
|
+
l.component(U.name, U);
|
|
493
493
|
};
|
|
494
|
-
|
|
494
|
+
U.install = He;
|
|
495
495
|
export {
|
|
496
|
-
|
|
496
|
+
U as default
|
|
497
497
|
};
|
|
@@ -1,180 +1,177 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const te = { key: 0 }, ne = /* @__PURE__ */ A({
|
|
1
|
+
import { defineComponent as K, useSlots as Q, computed as a, createElementBlock as m, openBlock as r, normalizeClass as w, renderSlot as H, createBlock as S, resolveDynamicComponent as b, createCommentVNode as M, toDisplayString as ne, mergeModels as N, useModel as le, ref as d, watch as R, nextTick as $, createElementVNode as D, Fragment as z, renderList as G, isVNode as j, createVNode as q, Transition as se, withCtx as re, unref as ae } from "vue";
|
|
2
|
+
import { V as ie } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { e as ce, f as J, w as ue, o as fe, g as de } from "../index3.js";
|
|
4
|
+
import { u as me } from "../useSlotRefs.js";
|
|
5
|
+
import { _ as U } from "../_plugin-vue_export-helper.js";
|
|
6
|
+
const pe = { key: 0 }, ge = /* @__PURE__ */ K({
|
|
8
7
|
__name: "PillButton",
|
|
9
8
|
props: {
|
|
10
9
|
item: {}
|
|
11
10
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
var
|
|
15
|
-
return !!(
|
|
16
|
-
}),
|
|
17
|
-
var
|
|
18
|
-
return !!(
|
|
19
|
-
}),
|
|
20
|
-
return (
|
|
21
|
-
class:
|
|
11
|
+
setup(i) {
|
|
12
|
+
const v = i, _ = Q(), p = a(() => {
|
|
13
|
+
var o;
|
|
14
|
+
return !!(_.icon || (o = v.item) != null && o.icon);
|
|
15
|
+
}), I = a(() => {
|
|
16
|
+
var o;
|
|
17
|
+
return !!(_.default || (o = v.item) != null && o.text);
|
|
18
|
+
}), x = a(() => p.value && !I.value);
|
|
19
|
+
return (o, u) => (r(), m("button", {
|
|
20
|
+
class: w(["tr-suggestion-pills__item", { "only-icon": x.value }])
|
|
22
21
|
}, [
|
|
23
|
-
|
|
24
|
-
var
|
|
22
|
+
H(o.$slots, "icon", {}, () => {
|
|
23
|
+
var c;
|
|
25
24
|
return [
|
|
26
|
-
(
|
|
25
|
+
(r(), S(b((c = o.item) == null ? void 0 : c.icon), { class: "tr-suggestion-pills__item_icon" }))
|
|
27
26
|
];
|
|
28
27
|
}, !0),
|
|
29
|
-
|
|
30
|
-
var
|
|
28
|
+
H(o.$slots, "default", {}, () => {
|
|
29
|
+
var c;
|
|
31
30
|
return [
|
|
32
|
-
(
|
|
31
|
+
(c = o.item) != null && c.text ? (r(), m("span", pe, ne(o.item.text), 1)) : M("", !0)
|
|
33
32
|
];
|
|
34
33
|
}, !0)
|
|
35
34
|
], 2));
|
|
36
35
|
}
|
|
37
|
-
}),
|
|
38
|
-
__name: "PillButtonWrapper",
|
|
39
|
-
props: {
|
|
40
|
-
item: {}
|
|
41
|
-
},
|
|
42
|
-
emits: ["click"],
|
|
43
|
-
setup(a, { emit: k }) {
|
|
44
|
-
const s = k;
|
|
45
|
-
return (e, i) => {
|
|
46
|
-
var p, t, u, o, h, _;
|
|
47
|
-
return ((p = e.item.action) == null ? void 0 : p.type) === "popover" ? (n(), c(g(ee), T({ key: 0 }, e.item.action.props, {
|
|
48
|
-
onItemClick: (t = e.item.action.events) == null ? void 0 : t.itemClick,
|
|
49
|
-
onGroupClick: (u = e.item.action.events) == null ? void 0 : u.groupClick,
|
|
50
|
-
onClose: (o = e.item.action.events) == null ? void 0 : o.close
|
|
51
|
-
}), j({
|
|
52
|
-
default: w(() => [
|
|
53
|
-
$(m, {
|
|
54
|
-
item: e.item,
|
|
55
|
-
onClick: i[0] || (i[0] = (v) => s("click", e.item))
|
|
56
|
-
}, null, 8, ["item"])
|
|
57
|
-
]),
|
|
58
|
-
_: 2
|
|
59
|
-
}, [
|
|
60
|
-
P(e.item.action.slots, (v, C) => ({
|
|
61
|
-
name: C,
|
|
62
|
-
fn: w(() => [
|
|
63
|
-
(n(), c(N(v)))
|
|
64
|
-
])
|
|
65
|
-
}))
|
|
66
|
-
]), 1040, ["onItemClick", "onGroupClick", "onClose"])) : ((h = e.item.action) == null ? void 0 : h.type) === "menu" ? (n(), c(g(x), T({ key: 1 }, e.item.action.props, {
|
|
67
|
-
onItemClick: (_ = e.item.action.events) == null ? void 0 : _.itemClick
|
|
68
|
-
}), {
|
|
69
|
-
default: w(() => [
|
|
70
|
-
$(m, {
|
|
71
|
-
item: e.item,
|
|
72
|
-
onClick: i[1] || (i[1] = (v) => s("click", e.item))
|
|
73
|
-
}, null, 8, ["item"])
|
|
74
|
-
]),
|
|
75
|
-
_: 1
|
|
76
|
-
}, 16, ["onItemClick"])) : (n(), c(m, {
|
|
77
|
-
key: 2,
|
|
78
|
-
item: e.item,
|
|
79
|
-
onClick: i[2] || (i[2] = (v) => s("click", e.item))
|
|
80
|
-
}, null, 8, ["item"]));
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}), oe = { class: "tr-suggestion-pills__wrapper" }, ie = { class: "tr-suggestion-pills__more-wrapper" }, le = {
|
|
84
|
-
key: 0,
|
|
85
|
-
class: "tr-suggestion-pills__more"
|
|
86
|
-
}, se = /* @__PURE__ */ A({
|
|
36
|
+
}), h = /* @__PURE__ */ U(ge, [["__scopeId", "data-v-5c433c31"]]), he = { class: "tr-suggestion-pills__more-wrapper" }, ve = /* @__PURE__ */ K({
|
|
87
37
|
__name: "index",
|
|
88
|
-
props: /* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
|
|
38
|
+
props: /* @__PURE__ */ N({
|
|
39
|
+
showAll: { type: Boolean },
|
|
40
|
+
showAllButtonOn: { default: "hover" },
|
|
41
|
+
overflowMode: { default: "expand" },
|
|
42
|
+
autoScrollOn: {}
|
|
91
43
|
}, {
|
|
92
44
|
showAll: { type: Boolean, default: !1 },
|
|
93
45
|
showAllModifiers: {}
|
|
94
46
|
}),
|
|
95
|
-
emits: /* @__PURE__ */
|
|
96
|
-
setup(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
47
|
+
emits: /* @__PURE__ */ N(["click-outside"], ["update:showAll"]),
|
|
48
|
+
setup(i, { expose: v, emit: _ }) {
|
|
49
|
+
const p = i, I = Q(), x = _, { vnodes: o } = me(I.default, !0), u = le(i, "showAll"), c = d(null), f = d(null), A = d(null), { width: W } = ce(f), V = d(0), B = a(() => p.overflowMode === "expand" && W.value < V.value), g = d(-1), X = a(() => B.value && u.value ? o.value.slice(0, g.value) : o.value), C = a(() => B.value && u.value ? o.value.slice(g.value).map((e, t) => ({
|
|
50
|
+
vnode: e,
|
|
51
|
+
index: t + g.value
|
|
52
|
+
})) : []), T = d([]), E = d([]), P = a(() => T.value.map((e) => J(e)).filter((e) => e instanceof Element)), Y = a(() => E.value.map((e) => J(e)).filter((e) => e instanceof Element)), L = () => {
|
|
53
|
+
const e = f.value, t = A.value;
|
|
54
|
+
return Array.from((e == null ? void 0 : e.children) || []).concat(Array.from((t == null ? void 0 : t.children) || []));
|
|
55
|
+
}, O = () => {
|
|
56
|
+
$(() => {
|
|
57
|
+
const e = f.value;
|
|
58
|
+
if (!e)
|
|
104
59
|
return;
|
|
105
|
-
const
|
|
106
|
-
|
|
60
|
+
const t = L(), n = parseFloat(getComputedStyle(e).rowGap) || 0;
|
|
61
|
+
g.value = -1;
|
|
62
|
+
let l = 0;
|
|
63
|
+
for (let s = 0; s < t.length; s++)
|
|
64
|
+
if (l += t[s].offsetWidth, s > 0 && (l += n), l > e.clientWidth) {
|
|
65
|
+
g.value = s;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
107
68
|
});
|
|
108
69
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
70
|
+
R(
|
|
71
|
+
o,
|
|
72
|
+
() => {
|
|
73
|
+
$(() => {
|
|
74
|
+
if (!f.value)
|
|
75
|
+
return;
|
|
76
|
+
const e = L(), t = parseFloat(getComputedStyle(f.value).rowGap) || 0;
|
|
77
|
+
V.value = e.reduce((n, l, s) => n + l.offsetWidth + (s > 0 ? t : 0), 0);
|
|
78
|
+
});
|
|
116
79
|
},
|
|
117
|
-
{
|
|
118
|
-
);
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
80
|
+
{ immediate: !0 }
|
|
81
|
+
), R(o, O), ue(W, O, { debounce: 100 });
|
|
82
|
+
const Z = () => {
|
|
83
|
+
u.value = !u.value;
|
|
84
|
+
};
|
|
85
|
+
fe(c, (e) => {
|
|
86
|
+
u.value && x("click-outside", e);
|
|
87
|
+
});
|
|
88
|
+
const ee = (e) => {
|
|
89
|
+
const t = f.value;
|
|
90
|
+
if (!t)
|
|
122
91
|
return;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
92
|
+
const n = e.offsetLeft, l = n + e.offsetWidth, s = t.scrollLeft, F = t.clientWidth, te = n < s, oe = l > s + F;
|
|
93
|
+
te ? t.scrollTo({
|
|
94
|
+
left: n,
|
|
95
|
+
behavior: "smooth"
|
|
96
|
+
}) : oe && t.scrollTo({
|
|
97
|
+
left: l - F,
|
|
98
|
+
behavior: "smooth"
|
|
99
|
+
});
|
|
127
100
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
101
|
+
let y = null;
|
|
102
|
+
return R(
|
|
103
|
+
() => p.autoScrollOn,
|
|
104
|
+
(e) => {
|
|
105
|
+
y && (y(), y = null), e && (y = de(P, e, (t) => {
|
|
106
|
+
t.currentTarget && ee(t.currentTarget);
|
|
107
|
+
}));
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
immediate: !0
|
|
111
|
+
}
|
|
112
|
+
), v({
|
|
113
|
+
children: a(() => P.value.concat(Y.value))
|
|
114
|
+
}), (e, t) => (r(), m("div", {
|
|
115
|
+
class: "tr-suggestion-pills__wrapper",
|
|
116
|
+
ref_key: "containerWrapperRef",
|
|
117
|
+
ref: c
|
|
118
|
+
}, [
|
|
119
|
+
D("div", {
|
|
120
|
+
class: w(["tr-suggestion-pills__container", { "overflow-scroll": p.overflowMode === "scroll" }]),
|
|
131
121
|
ref_key: "containerRef",
|
|
132
|
-
ref:
|
|
122
|
+
ref: f
|
|
133
123
|
}, [
|
|
134
|
-
|
|
135
|
-
(n
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
124
|
+
(r(!0), m(z, null, G(X.value, (n, l) => (r(), S(b(n), {
|
|
125
|
+
key: j(n) ? n.key : l,
|
|
126
|
+
ref_for: !0,
|
|
127
|
+
ref_key: "staticMaybeItemRefs",
|
|
128
|
+
ref: T
|
|
129
|
+
}))), 128))
|
|
130
|
+
], 2),
|
|
131
|
+
D("div", he, [
|
|
132
|
+
q(se, { name: "tr-suggestion-pills__more" }, {
|
|
133
|
+
default: re(() => [
|
|
134
|
+
C.value.length ? (r(), m("div", {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "tr-suggestion-pills__more",
|
|
137
|
+
ref_key: "floatingItemsRef",
|
|
138
|
+
ref: A
|
|
139
|
+
}, [
|
|
140
|
+
(r(!0), m(z, null, G(C.value, ({ vnode: n, index: l }) => (r(), S(b(n), {
|
|
141
|
+
key: j(n) ? n.key : l,
|
|
142
|
+
ref_for: !0,
|
|
143
|
+
ref_key: "floatingMaybeItemRefs",
|
|
144
|
+
ref: E
|
|
145
|
+
}))), 128))
|
|
146
|
+
], 512)) : M("", !0)
|
|
152
147
|
]),
|
|
153
148
|
_: 1
|
|
154
149
|
})
|
|
155
150
|
]),
|
|
156
|
-
|
|
151
|
+
B.value ? (r(), m("button", {
|
|
157
152
|
key: 0,
|
|
158
|
-
class: "tr-suggestion-pills__expand",
|
|
159
|
-
onClick:
|
|
153
|
+
class: w(["tr-suggestion-pills__expand", { "show-on-hover": p.showAllButtonOn === "hover" }]),
|
|
154
|
+
onClick: Z
|
|
160
155
|
}, [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
156
|
+
q(ae(ie), {
|
|
157
|
+
class: w(["tr-suggestion-pills__expand-icon", { rotate: u.value }])
|
|
158
|
+
}, null, 8, ["class"])
|
|
159
|
+
], 2)) : M("", !0)
|
|
160
|
+
], 512));
|
|
164
161
|
}
|
|
165
|
-
}),
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
162
|
+
}), k = /* @__PURE__ */ U(ve, [["__scopeId", "data-v-ebbd7a00"]]);
|
|
163
|
+
k.name = "TrSuggestionPills";
|
|
164
|
+
const _e = function(i) {
|
|
165
|
+
i.component(k.name, k);
|
|
169
166
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
167
|
+
k.install = _e;
|
|
168
|
+
h.name = "TrSuggestionPillButton";
|
|
169
|
+
const ye = function(i) {
|
|
170
|
+
i.component(h.name, h);
|
|
174
171
|
};
|
|
175
|
-
|
|
176
|
-
const
|
|
172
|
+
h.install = ye;
|
|
173
|
+
const Re = h;
|
|
177
174
|
export {
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
Re as SuggestionPillButton,
|
|
176
|
+
k as default
|
|
180
177
|
};
|