@opentiny/tiny-robot 0.3.0-alpha.2 → 0.3.0-alpha.3
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 +16 -16
- package/dist/bubble/index.js +855 -852
- package/dist/container/index.js +10 -10
- package/dist/feedback/index.js +43 -43
- package/dist/flow-layout-buttons/index.js +10 -10
- package/dist/history/index.js +39 -39
- package/dist/question/index.js +66 -66
- package/dist/sender/index.js +130 -130
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +58 -58
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +25 -25
- package/dist/tiny-robot-svgs.js +172 -172
- package/package.json +3 -3
package/dist/suggestion/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as U, ref as p, computed as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as U, ref as p, computed as q, 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 $, createCommentVNode as N, createBlock as P, normalizeStyle as ae, resolveComponent as ce, withCtx as O } from "vue";
|
|
2
|
+
import { L as Q, P as G, f as re, l as ue, n 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);
|
|
@@ -14,7 +14,7 @@ function X(l, c = "") {
|
|
|
14
14
|
const o = de(l, c);
|
|
15
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" }, 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" },
|
|
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" }, $e = { class: "tr-common-suggestions_item_text" }, xe = /* @__PURE__ */ U({
|
|
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), h = p(!1), t = p(!1), m = p([]), a = p([]), f = p(0), S = p(null), R =
|
|
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 = q(() => {
|
|
32
32
|
if (f.value <= 0 || a.value.length === 0) return [];
|
|
33
33
|
const i = [], d = [...a.value];
|
|
34
34
|
for (; d.length > 0; )
|
|
@@ -49,11 +49,11 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
49
49
|
const I = X(s.suggestions[C].text, "tr-common-suggestions_item") + _;
|
|
50
50
|
k += I;
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
f.value = Math.max(1, Math.floor(d /
|
|
52
|
+
const L = k / B;
|
|
53
|
+
f.value = Math.max(1, Math.floor(d / L));
|
|
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], V = X(I.text, "tr-common-suggestions_item") + _;
|
|
56
|
+
r + V <= d ? (r += V, 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) => {
|
|
@@ -87,7 +87,7 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
87
87
|
(g(!0), v(z, null, M(r, (k, B) => (g(), v("div", {
|
|
88
88
|
key: `hidden-${k.id}-${B}`,
|
|
89
89
|
class: "tr-common-suggestions_item",
|
|
90
|
-
onClick: (
|
|
90
|
+
onClick: (L) => y(k)
|
|
91
91
|
}, [
|
|
92
92
|
u("div", he, [
|
|
93
93
|
E(w(Q))
|
|
@@ -108,7 +108,7 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
108
108
|
u("div", Ce, [
|
|
109
109
|
E(w(Q))
|
|
110
110
|
]),
|
|
111
|
-
u("div",
|
|
111
|
+
u("div", $e, T(r.text), 1)
|
|
112
112
|
], 8, ke))), 128))
|
|
113
113
|
])
|
|
114
114
|
])
|
|
@@ -140,7 +140,7 @@ const ve = { class: "tr-common-suggestions_content" }, me = { class: "tr-common-
|
|
|
140
140
|
class: j(["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 }, () => [
|
|
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
|
])
|
|
@@ -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" }, Ve = { class: "close-icon" }, We = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "tr-suggestion-loading"
|
|
195
|
-
},
|
|
195
|
+
}, Ae = { 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
|
+
}, Le = {
|
|
199
199
|
key: 2,
|
|
200
200
|
class: "tr-suggestion-empty"
|
|
201
|
-
},
|
|
201
|
+
}, Pe = /* @__PURE__ */ U({
|
|
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 : ""), f =
|
|
231
|
+
}), a = p(o.categories.length > 0 ? o.categories[0].id : ""), f = q(() => {
|
|
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,7 +250,7 @@ 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
|
-
|
|
253
|
+
$(i.$slots, "title-icon", {}, () => [
|
|
254
254
|
E(w(G), { style: { color: "#1476ff", "font-size": "24px" } })
|
|
255
255
|
])
|
|
256
256
|
]),
|
|
@@ -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", Ve, [
|
|
264
264
|
E(w(re))
|
|
265
265
|
])
|
|
266
266
|
])
|
|
267
267
|
]),
|
|
268
|
-
l.categories.length > 0 ? (g(),
|
|
268
|
+
l.categories.length > 0 ? (g(), P(Ie, {
|
|
269
269
|
key: 0,
|
|
270
270
|
categories: l.categories,
|
|
271
271
|
"active-category": a.value,
|
|
@@ -275,18 +275,18 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
275
275
|
class: "tr-suggestion-content",
|
|
276
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", We, [
|
|
279
|
+
$(i.$slots, "loading-indicator", {}, () => [
|
|
280
280
|
d[0] || (d[0] = u("div", { class: "tr-suggestion-loading-spinner" }, null, -1))
|
|
281
281
|
])
|
|
282
|
-
])) : f.value.length > 0 ? (g(), v("ul",
|
|
282
|
+
])) : f.value.length > 0 ? (g(), v("ul", Ae, [
|
|
283
283
|
(g(!0), v(z, null, M(f.value, (r, _) => (g(), v("li", {
|
|
284
284
|
key: r.id,
|
|
285
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
|
+
$(i.$slots, "item", {
|
|
290
290
|
item: r,
|
|
291
291
|
active: _ === w(m)
|
|
292
292
|
}, () => [
|
|
@@ -296,15 +296,15 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
296
296
|
])
|
|
297
297
|
])
|
|
298
298
|
], 42, Ke))), 128))
|
|
299
|
-
])) : (g(), v("div",
|
|
300
|
-
|
|
299
|
+
])) : (g(), v("div", Le, [
|
|
300
|
+
$(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
|
+
}), qe = (l) => {
|
|
308
308
|
const c = (o) => l.triggerKeys.includes(o);
|
|
309
309
|
return {
|
|
310
310
|
isTriggerKey: c,
|
|
@@ -341,10 +341,10 @@ 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
|
f.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 = q(() => o.open !== void 0 ? o.open : h.value), _ = q(() => {
|
|
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((x) => x.id === b.value);
|
|
348
348
|
return e ? e.items : [];
|
|
349
349
|
});
|
|
350
350
|
K(r, (e) => {
|
|
@@ -360,34 +360,34 @@ 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 } = qe(o), L = (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 ? W() : (typeof e == "object" && e !== null && (m.value = {
|
|
370
370
|
text: e.text || "",
|
|
371
371
|
position: e.position || 0
|
|
372
372
|
}), k(), h.value = !0, n("update:open", !0));
|
|
373
|
-
}, I = (e,
|
|
374
|
-
const
|
|
375
|
-
return
|
|
376
|
-
},
|
|
373
|
+
}, I = (e, x) => {
|
|
374
|
+
const A = B(e, x);
|
|
375
|
+
return A ? (m.value = A, C(A), !0) : r.value && x === "" ? (C(!1), !0) : !1;
|
|
376
|
+
}, V = (e) => {
|
|
377
377
|
if (r.value && d.value) {
|
|
378
378
|
d.value.handleKeyDown(e);
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
|
-
},
|
|
381
|
+
}, W = () => {
|
|
382
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,
|
|
385
|
+
}, te = (e, x) => {
|
|
386
|
+
n("select", e.text, x), e.template && n("fill-template", e.template), W();
|
|
387
387
|
}, J = (e) => {
|
|
388
|
-
o.closeOnOutsideClick && r.value && i.value && !i.value.contains(e.target) &&
|
|
388
|
+
o.closeOnOutsideClick && r.value && i.value && !i.value.contains(e.target) && W();
|
|
389
389
|
}, se = () => {
|
|
390
|
-
r.value ?
|
|
390
|
+
r.value ? W() : (k(), h.value = !0, n("update:open", !0));
|
|
391
391
|
};
|
|
392
392
|
return Y(() => {
|
|
393
393
|
o.closeOnOutsideClick && document.addEventListener("click", J);
|
|
@@ -395,11 +395,11 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
395
395
|
o.closeOnOutsideClick && document.removeEventListener("click", J);
|
|
396
396
|
}), c({
|
|
397
397
|
trigger: C,
|
|
398
|
-
keyDown:
|
|
398
|
+
keyDown: V,
|
|
399
399
|
input: I,
|
|
400
400
|
toggleExpand: S
|
|
401
|
-
}), (e,
|
|
402
|
-
const
|
|
401
|
+
}), (e, x) => {
|
|
402
|
+
const A = ce("IconEdit");
|
|
403
403
|
return g(), v("div", {
|
|
404
404
|
ref_key: "rootRef",
|
|
405
405
|
ref: i,
|
|
@@ -412,17 +412,17 @@ const Te = { class: "tr-suggestion-panel" }, Be = { class: "tr-suggestion-header
|
|
|
412
412
|
}, [
|
|
413
413
|
E(w(G), { style: { color: "#1476ff" } })
|
|
414
414
|
]),
|
|
415
|
-
E(
|
|
415
|
+
E(xe, {
|
|
416
416
|
suggestions: e.items,
|
|
417
417
|
isExpanded: a.value,
|
|
418
|
-
onSuggestionClick:
|
|
418
|
+
onSuggestionClick: L,
|
|
419
419
|
onShowExpandButton: R
|
|
420
420
|
}, {
|
|
421
421
|
"suggestion-icon": O((D) => [
|
|
422
|
-
|
|
422
|
+
$(e.$slots, "capsule-icon", {
|
|
423
423
|
suggestion: D.suggestion
|
|
424
424
|
}, () => [
|
|
425
|
-
E(
|
|
425
|
+
E(A)
|
|
426
426
|
])
|
|
427
427
|
]),
|
|
428
428
|
_: 3
|
|
@@ -432,15 +432,15 @@ 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(), P(w(ge), { key: 1 })) : (g(), P(w(ue), { key: 0 }))
|
|
436
436
|
])) : N("", !0)
|
|
437
437
|
]),
|
|
438
|
-
|
|
438
|
+
$(e.$slots, "trigger", {
|
|
439
439
|
onTrigger: C,
|
|
440
|
-
onKeyDown:
|
|
440
|
+
onKeyDown: V,
|
|
441
441
|
onInput: I
|
|
442
442
|
}),
|
|
443
|
-
r.value ? (g(),
|
|
443
|
+
r.value ? (g(), P(Pe, {
|
|
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: W,
|
|
455
455
|
onSelect: te,
|
|
456
456
|
onCategorySelect: ee
|
|
457
457
|
}, {
|
|
458
458
|
"title-icon": O(() => [
|
|
459
|
-
|
|
459
|
+
$(e.$slots, "title-icon", {}, () => [
|
|
460
460
|
E(w(G), { style: { "font-size": "24px", color: "#1476ff" } })
|
|
461
461
|
])
|
|
462
462
|
]),
|
|
463
463
|
"category-label": O((D) => [
|
|
464
|
-
|
|
464
|
+
$(e.$slots, "category-label", {
|
|
465
465
|
category: D.category
|
|
466
466
|
})
|
|
467
467
|
]),
|
|
468
468
|
item: O((D) => [
|
|
469
|
-
|
|
469
|
+
$(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
|
+
$(e.$slots, "loading-indicator", {}, () => [
|
|
476
|
+
x[0] || (x[0] = u("div", { class: "tr-suggestion__loading-spinner" }, null, -1))
|
|
477
477
|
])
|
|
478
478
|
]),
|
|
479
479
|
empty: O(() => [
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
$(e.$slots, "empty", {}, () => [
|
|
481
|
+
x[1] || (x[1] = u("p", null, "无匹配结果", -1))
|
|
482
482
|
])
|
|
483
483
|
]),
|
|
484
484
|
_: 3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as T, useSlots as H, computed as k, createElementBlock as f, openBlock as n, normalizeClass as A, renderSlot as $, createBlock as v, resolveDynamicComponent as N, createCommentVNode as b, toDisplayString as j, unref as h, mergeProps as D, createSlots as q, withCtx as B, createVNode as I, renderList as M, normalizeStyle as O, mergeModels as E, ref as P, useModel as J, watch as K, createElementVNode as R, Fragment as z, Transition as Q, nextTick as U } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { l as X } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { b as Y, w as Z, o as x } from "../index2.js";
|
|
4
4
|
import ee from "../dropdown-menu/index.js";
|
|
5
5
|
import te from "../suggestion-popover/index.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as V, createElementBlock as p, openBlock as s, createBlock as F, createElementVNode as g, createVNode as $, resolveDynamicComponent as p0, unref as a, toDisplayString as Z, renderSlot as T, mergeModels as W, useModel as Q, ref as c, computed as m, watch as B, Transition as j, withCtx as R, createCommentVNode as z, normalizeStyle as H, normalizeClass as N, useCssVars as f0, useAttrs as v0, Fragment as P, renderList as g0, createTextVNode as m0 } from "vue";
|
|
2
2
|
import { c as J, d as _0, u as h0, b as C0, o as y0 } from "../index2.js";
|
|
3
3
|
import L0 from "../flow-layout-buttons/index.js";
|
|
4
4
|
import { t as d } from "../utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { P as w0, f as k0 } from "../tiny-robot-svgs.js";
|
|
6
6
|
import M0 from "../icon-button/index.js";
|
|
7
7
|
import { _ as q } from "../_plugin-vue_export-helper.js";
|
|
8
8
|
import { _ as x0 } from "../loading.js";
|
|
9
9
|
const F0 = { class: "tr-question__header" }, $0 = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "tr-question__header-icon"
|
|
12
|
-
}, T0 = { class: "tr-question__header-title" }, q0 = /* @__PURE__ */
|
|
12
|
+
}, T0 = { class: "tr-question__header-title" }, q0 = /* @__PURE__ */ V({
|
|
13
13
|
__name: "Header",
|
|
14
14
|
props: {
|
|
15
15
|
icon: {},
|
|
@@ -58,9 +58,9 @@ function O0(n, o) {
|
|
|
58
58
|
], !0)
|
|
59
59
|
]);
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const P0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181"]]), W0 = { class: "tr-tooltip-content" }, H0 = /* @__PURE__ */ V({
|
|
62
62
|
__name: "Tooltip",
|
|
63
|
-
props: /* @__PURE__ */
|
|
63
|
+
props: /* @__PURE__ */ W({
|
|
64
64
|
show: { type: Boolean },
|
|
65
65
|
content: {},
|
|
66
66
|
trigger: {},
|
|
@@ -100,24 +100,24 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
100
100
|
default: R(() => [
|
|
101
101
|
f.value ? (s(), p("div", {
|
|
102
102
|
key: 0,
|
|
103
|
-
class:
|
|
103
|
+
class: N(["tr-tooltip", `placement-${o.placement}`]),
|
|
104
104
|
role: "tooltip",
|
|
105
|
-
style:
|
|
105
|
+
style: H(k.value),
|
|
106
106
|
onMouseleave: b
|
|
107
107
|
}, [
|
|
108
108
|
u[0] || (u[0] = g("div", { class: "tr-tooltip-arrow" }, null, -1)),
|
|
109
|
-
g("span",
|
|
109
|
+
g("span", W0, Z(o.content), 1)
|
|
110
110
|
], 38)) : z("", !0)
|
|
111
111
|
]),
|
|
112
112
|
_: 1
|
|
113
113
|
}));
|
|
114
114
|
}
|
|
115
|
-
}),
|
|
115
|
+
}), N0 = /* @__PURE__ */ q(H0, [["__scopeId", "data-v-2d58fbb9"]]), V0 = {
|
|
116
116
|
key: 0,
|
|
117
117
|
class: "tr-question-popover__backdrop"
|
|
118
|
-
},
|
|
118
|
+
}, E0 = ["onClick", "onMouseenter", "onMouseleave"], D0 = /* @__PURE__ */ V({
|
|
119
119
|
__name: "index",
|
|
120
|
-
props: /* @__PURE__ */
|
|
120
|
+
props: /* @__PURE__ */ W({
|
|
121
121
|
data: {},
|
|
122
122
|
title: { default: "热门问题" },
|
|
123
123
|
icon: {},
|
|
@@ -133,7 +133,7 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
133
133
|
selectedGroup: {},
|
|
134
134
|
selectedGroupModifiers: {}
|
|
135
135
|
}),
|
|
136
|
-
emits: /* @__PURE__ */
|
|
136
|
+
emits: /* @__PURE__ */ W(["item-click", "group-click", "open", "close"], ["update:selectedGroup"]),
|
|
137
137
|
setup(n, { emit: o }) {
|
|
138
138
|
f0((e) => ({
|
|
139
139
|
"193dab18": a(d)(t.popoverHeight),
|
|
@@ -159,7 +159,7 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
159
159
|
}), b = m(() => k.value ? t.data.map((e) => ({
|
|
160
160
|
...e,
|
|
161
161
|
id: e.group
|
|
162
|
-
})) : []), i = c(null), u = c(null), { x: K, y: X, update: e0 } = J(i), y = _0("(max-width: 767px)"),
|
|
162
|
+
})) : []), i = c(null), u = c(null), { x: K, y: X, update: e0 } = J(i), y = _0("(max-width: 767px)"), E = c(null), { isScrolling: D } = h0(E, { throttle: 100 }), I = c([]), t0 = m(() => I.value.at(0)), o0 = (e, l) => {
|
|
163
163
|
I.value[l] = e;
|
|
164
164
|
}, O = c([]), l0 = () => {
|
|
165
165
|
O.value = I.value.map((e) => e ? e.scrollWidth > e.clientWidth : !1);
|
|
@@ -197,23 +197,23 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
197
197
|
var l;
|
|
198
198
|
((l = U.value) == null ? void 0 : l.$el).contains(e.relatedTarget) || (S.value = !1);
|
|
199
199
|
};
|
|
200
|
-
return (e, l) => (s(), p(
|
|
200
|
+
return (e, l) => (s(), p(P, null, [
|
|
201
201
|
g("div", {
|
|
202
|
-
class:
|
|
203
|
-
style:
|
|
202
|
+
class: N(["tr-question-popover__wrapper", a(f).class]),
|
|
203
|
+
style: H(L.value),
|
|
204
204
|
ref_key: "popoverTriggerRef",
|
|
205
205
|
ref: i,
|
|
206
206
|
onClick: n0
|
|
207
207
|
}, [
|
|
208
208
|
T(e.$slots, "default", {}, void 0, !0)
|
|
209
209
|
], 6),
|
|
210
|
-
r.value && a(y) ? (s(), p("div",
|
|
210
|
+
r.value && a(y) ? (s(), p("div", V0)) : z("", !0),
|
|
211
211
|
$(j, { name: "tr-question-popover" }, {
|
|
212
212
|
default: R(() => [
|
|
213
213
|
r.value ? (s(), p("div", {
|
|
214
214
|
key: 0,
|
|
215
215
|
class: "tr-question-popover",
|
|
216
|
-
style:
|
|
216
|
+
style: H(a0.value),
|
|
217
217
|
ref_key: "popoverRef",
|
|
218
218
|
ref: u
|
|
219
219
|
}, [
|
|
@@ -227,12 +227,12 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
227
227
|
T(e.$slots, "loading", {}, void 0, !0)
|
|
228
228
|
]),
|
|
229
229
|
_: 3
|
|
230
|
-
})) : t.data.length === 0 ? (s(), F(
|
|
230
|
+
})) : t.data.length === 0 ? (s(), F(P0, { key: 1 }, {
|
|
231
231
|
default: R(() => [
|
|
232
232
|
T(e.$slots, "empty", {}, void 0, !0)
|
|
233
233
|
]),
|
|
234
234
|
_: 3
|
|
235
|
-
})) : (s(), p(
|
|
235
|
+
})) : (s(), p(P, { key: 2 }, [
|
|
236
236
|
b.value.length > 0 ? (s(), F(a(L0), {
|
|
237
237
|
key: 0,
|
|
238
238
|
class: "tr-question__group",
|
|
@@ -244,11 +244,11 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
244
244
|
onItemClick: u0
|
|
245
245
|
}, null, 8, ["items", "selected", "show-more-trigger"])) : z("", !0),
|
|
246
246
|
g("ul", {
|
|
247
|
-
class:
|
|
247
|
+
class: N(["tr-question__list", { scrolling: a(D) }]),
|
|
248
248
|
ref_key: "listRef",
|
|
249
|
-
ref:
|
|
249
|
+
ref: E
|
|
250
250
|
}, [
|
|
251
|
-
(s(!0), p(
|
|
251
|
+
(s(!0), p(P, null, g0(h.value, (v, M) => (s(), p("li", {
|
|
252
252
|
class: "tr-question__list-item",
|
|
253
253
|
key: v.id,
|
|
254
254
|
ref_for: !0,
|
|
@@ -259,10 +259,10 @@ const W0 = /* @__PURE__ */ q(B0, [["render", O0], ["__scopeId", "data-v-b7a7a181
|
|
|
259
259
|
}, [
|
|
260
260
|
g("span", null, Z(M + 1) + ". ", 1),
|
|
261
261
|
m0(Z(v.text), 1)
|
|
262
|
-
], 40,
|
|
262
|
+
], 40, E0))), 128))
|
|
263
263
|
], 2)
|
|
264
264
|
], 64)),
|
|
265
|
-
$(
|
|
265
|
+
$(N0, {
|
|
266
266
|
ref_key: "tooltipRef",
|
|
267
267
|
ref: U,
|
|
268
268
|
show: S.value,
|