@opentiny/tiny-robot 0.3.0-alpha.8 → 0.3.0-rc.0
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 +19 -19
- package/dist/attachments/index.js +266 -266
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +1460 -1435
- package/dist/container/index.js +35 -35
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +123 -51
- package/dist/feedback/index.js +72 -72
- package/dist/flow-layout-buttons/index.js +15 -15
- package/dist/history/index.js +72 -73
- package/dist/index.d.ts +210 -202
- package/dist/index.js +98 -98
- package/dist/index2.js +680 -608
- package/dist/index3.js +148 -675
- package/dist/mcp-server-picker/index.js +572 -29518
- package/dist/no-data.js +4 -0
- package/dist/sender/index.js +883 -815
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +31 -31
- package/dist/suggestion-popover/index.js +169 -162
- package/dist/useSlotRefs.js +13 -13
- package/dist/utils.js +8 -2
- package/package.json +4 -14
- package/dist/close.js +0 -29
- package/dist/index4.js +0 -146
- package/dist/index5.js +0 -316
- package/dist/index6.js +0 -2352
- package/dist/index7.js +0 -6654
- package/dist/question/index.js +0 -429
- package/dist/suggestion/index.js +0 -497
- package/dist/tiny-robot-svgs.js +0 -1139
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { e as ce,
|
|
1
|
+
import { defineComponent as J, useSlots as K, computed as a, createElementBlock as m, openBlock as r, normalizeClass as w, renderSlot as H, createBlock as S, resolveDynamicComponent as b, createCommentVNode as A, 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 U, createVNode as j, Transition as se, withCtx as re, unref as ae } from "vue";
|
|
2
|
+
import { IconArrowUp as ie } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { e as ce, b as q, f as ue, o as fe, g as de } from "../index2.js";
|
|
4
4
|
import { u as me } from "../useSlotRefs.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
const pe = { key: 0 },
|
|
5
|
+
import { _ as Q } from "../_plugin-vue_export-helper.js";
|
|
6
|
+
const pe = { key: 0 }, ge = /* @__PURE__ */ J({
|
|
7
7
|
__name: "PillButton",
|
|
8
8
|
props: {
|
|
9
9
|
item: {}
|
|
10
10
|
},
|
|
11
11
|
setup(i) {
|
|
12
|
-
const
|
|
12
|
+
const v = i, _ = K(), p = a(() => {
|
|
13
13
|
var o;
|
|
14
|
-
return !!(_.icon || (o =
|
|
14
|
+
return !!(_.icon || (o = v.item) != null && o.icon);
|
|
15
15
|
}), I = a(() => {
|
|
16
16
|
var o;
|
|
17
|
-
return !!(_.default || (o =
|
|
17
|
+
return !!(_.default || (o = v.item) != null && o.text);
|
|
18
18
|
}), x = a(() => p.value && !I.value);
|
|
19
19
|
return (o, u) => (r(), m("button", {
|
|
20
20
|
class: w(["tr-suggestion-pills__item", { "only-icon": x.value }])
|
|
@@ -28,12 +28,12 @@ const pe = { key: 0 }, ve = /* @__PURE__ */ K({
|
|
|
28
28
|
H(o.$slots, "default", {}, () => {
|
|
29
29
|
var c;
|
|
30
30
|
return [
|
|
31
|
-
(c = o.item) != null && c.text ? (r(), m("span", pe, ne(o.item.text), 1)) :
|
|
31
|
+
(c = o.item) != null && c.text ? (r(), m("span", pe, ne(o.item.text), 1)) : A("", !0)
|
|
32
32
|
];
|
|
33
33
|
}, !0)
|
|
34
34
|
], 2));
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), h = /* @__PURE__ */ Q(ge, [["__scopeId", "data-v-5c433c31"]]), he = { class: "tr-suggestion-pills__more-wrapper" }, ve = /* @__PURE__ */ J({
|
|
37
37
|
__name: "index",
|
|
38
38
|
props: /* @__PURE__ */ N({
|
|
39
39
|
showAll: { type: Boolean },
|
|
@@ -45,12 +45,12 @@ const pe = { key: 0 }, ve = /* @__PURE__ */ K({
|
|
|
45
45
|
showAllModifiers: {}
|
|
46
46
|
}),
|
|
47
47
|
emits: /* @__PURE__ */ N(["click-outside"], ["update:showAll"]),
|
|
48
|
-
setup(i, { expose:
|
|
49
|
-
const p = i, I =
|
|
48
|
+
setup(i, { expose: v, emit: _ }) {
|
|
49
|
+
const p = i, I = K(), x = _, { vnodes: o } = me(I.default, !0), u = le(i, "showAll"), c = d(null), f = d(null), M = d(null), { width: W } = ce(f), C = d(0), B = a(() => p.overflowMode === "expand" && W.value < C.value), g = d(-1), X = a(() => B.value && u.value ? o.value.slice(0, g.value) : o.value), T = a(() => B.value && u.value ? o.value.slice(g.value).map((e, t) => ({
|
|
50
50
|
vnode: e,
|
|
51
|
-
index: t +
|
|
52
|
-
})) : []), E = d([]), P = d([]), V = a(() => E.value.map((e) =>
|
|
53
|
-
const e = f.value, t =
|
|
51
|
+
index: t + g.value
|
|
52
|
+
})) : []), E = d([]), P = d([]), V = a(() => E.value.map((e) => q(e)).filter((e) => e instanceof Element)), Y = a(() => P.value.map((e) => q(e)).filter((e) => e instanceof Element)), L = () => {
|
|
53
|
+
const e = f.value, t = M.value;
|
|
54
54
|
return Array.from((e == null ? void 0 : e.children) || []).concat(Array.from((t == null ? void 0 : t.children) || []));
|
|
55
55
|
}, O = () => {
|
|
56
56
|
$(() => {
|
|
@@ -58,11 +58,11 @@ const pe = { key: 0 }, ve = /* @__PURE__ */ K({
|
|
|
58
58
|
if (!e)
|
|
59
59
|
return;
|
|
60
60
|
const t = L(), n = parseFloat(getComputedStyle(e).rowGap) || 0;
|
|
61
|
-
|
|
61
|
+
g.value = -1;
|
|
62
62
|
let l = 0;
|
|
63
63
|
for (let s = 0; s < t.length; s++)
|
|
64
64
|
if (l += t[s].offsetWidth, s > 0 && (l += n), l > e.clientWidth) {
|
|
65
|
-
|
|
65
|
+
g.value = s;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
});
|
|
@@ -109,7 +109,7 @@ const pe = { key: 0 }, ve = /* @__PURE__ */ K({
|
|
|
109
109
|
{
|
|
110
110
|
immediate: !0
|
|
111
111
|
}
|
|
112
|
-
),
|
|
112
|
+
), v({
|
|
113
113
|
children: a(() => V.value.concat(Y.value))
|
|
114
114
|
}), (e, t) => (r(), m("div", {
|
|
115
115
|
class: "tr-suggestion-pills__wrapper",
|
|
@@ -122,28 +122,28 @@ const pe = { key: 0 }, ve = /* @__PURE__ */ K({
|
|
|
122
122
|
ref: f
|
|
123
123
|
}, [
|
|
124
124
|
(r(!0), m(z, null, G(X.value, (n, l) => (r(), S(b(n), {
|
|
125
|
-
key:
|
|
125
|
+
key: U(n) ? n.key : l,
|
|
126
126
|
ref_for: !0,
|
|
127
127
|
ref_key: "staticMaybeItemRefs",
|
|
128
128
|
ref: E
|
|
129
129
|
}))), 128))
|
|
130
130
|
], 2),
|
|
131
|
-
D("div",
|
|
132
|
-
|
|
131
|
+
D("div", he, [
|
|
132
|
+
j(se, { name: "tr-suggestion-pills__more" }, {
|
|
133
133
|
default: re(() => [
|
|
134
134
|
T.value.length ? (r(), m("div", {
|
|
135
135
|
key: 0,
|
|
136
136
|
class: "tr-suggestion-pills__more",
|
|
137
137
|
ref_key: "floatingItemsRef",
|
|
138
|
-
ref:
|
|
138
|
+
ref: M
|
|
139
139
|
}, [
|
|
140
140
|
(r(!0), m(z, null, G(T.value, ({ vnode: n, index: l }) => (r(), S(b(n), {
|
|
141
|
-
key:
|
|
141
|
+
key: U(n) ? n.key : l,
|
|
142
142
|
ref_for: !0,
|
|
143
143
|
ref_key: "floatingMaybeItemRefs",
|
|
144
144
|
ref: P
|
|
145
145
|
}))), 128))
|
|
146
|
-
], 512)) :
|
|
146
|
+
], 512)) : A("", !0)
|
|
147
147
|
]),
|
|
148
148
|
_: 1
|
|
149
149
|
})
|
|
@@ -153,24 +153,24 @@ const pe = { key: 0 }, ve = /* @__PURE__ */ K({
|
|
|
153
153
|
class: w(["tr-suggestion-pills__expand", { "show-on-hover": p.showAllButtonOn === "hover" }]),
|
|
154
154
|
onClick: Z
|
|
155
155
|
}, [
|
|
156
|
-
|
|
156
|
+
j(ae(ie), {
|
|
157
157
|
class: w(["tr-suggestion-pills__expand-icon", { rotate: u.value }])
|
|
158
158
|
}, null, 8, ["class"])
|
|
159
|
-
], 2)) :
|
|
159
|
+
], 2)) : A("", !0)
|
|
160
160
|
], 512));
|
|
161
161
|
}
|
|
162
|
-
}), k = /* @__PURE__ */
|
|
162
|
+
}), k = /* @__PURE__ */ Q(ve, [["__scopeId", "data-v-ebbd7a00"]]);
|
|
163
163
|
k.name = "TrSuggestionPills";
|
|
164
164
|
const _e = function(i) {
|
|
165
165
|
i.component(k.name, k);
|
|
166
166
|
};
|
|
167
167
|
k.install = _e;
|
|
168
|
-
|
|
168
|
+
h.name = "TrSuggestionPillButton";
|
|
169
169
|
const ye = function(i) {
|
|
170
|
-
i.component(
|
|
170
|
+
i.component(h.name, h);
|
|
171
171
|
};
|
|
172
|
-
|
|
173
|
-
const Re =
|
|
172
|
+
h.install = ye;
|
|
173
|
+
const Re = h;
|
|
174
174
|
export {
|
|
175
175
|
Re as SuggestionPillButton,
|
|
176
176
|
k as default
|
|
@@ -1,68 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { u as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { defineComponent as z, createElementBlock as g, createCommentVNode as U, openBlock as n, createBlock as k, createElementVNode as v, resolveDynamicComponent as ue, createVNode as M, unref as h, toDisplayString as O, renderSlot as m, mergeModels as V, useModel as A, ref as i, computed as p, watch as W, Transition as ce, withCtx as S, normalizeStyle as J, normalizeClass as D, Fragment as pe, renderList as de, createTextVNode as fe } from "vue";
|
|
2
|
+
import { IconSparkles as ve, IconClose as me } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { a as ge, h as _e, u as he, w as ye, e as we, o as ke } from "../index2.js";
|
|
4
|
+
import { u as Te, c as $e, B as Ce } from "../index3.js";
|
|
5
|
+
import Ie from "../flow-layout-buttons/index.js";
|
|
6
|
+
import qe from "../icon-button/index.js";
|
|
7
|
+
import { _ as T } from "../_plugin-vue_export-helper.js";
|
|
8
|
+
import { _ as Me } from "../loading.js";
|
|
9
|
+
import { _ as Se } from "../no-data.js";
|
|
10
|
+
import { t as G } from "../utils.js";
|
|
11
|
+
const Be = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "tr-question-popover__backdrop"
|
|
13
|
-
},
|
|
14
|
+
}, Re = /* @__PURE__ */ z({
|
|
14
15
|
__name: "Backdrop",
|
|
15
16
|
props: {
|
|
16
17
|
show: { type: Boolean }
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
return (t,
|
|
19
|
+
setup(l) {
|
|
20
|
+
return (t, y) => t.show ? (n(), g("div", Be)) : U("", !0);
|
|
20
21
|
}
|
|
21
|
-
}),
|
|
22
|
+
}), be = /* @__PURE__ */ T(Re, [["__scopeId", "data-v-50205eaf"]]), Ge = { class: "tr-question__header" }, Oe = {
|
|
22
23
|
key: 1,
|
|
23
24
|
class: "tr-question__header-icon"
|
|
24
|
-
},
|
|
25
|
+
}, xe = { class: "tr-question__header-title" }, ze = /* @__PURE__ */ z({
|
|
25
26
|
__name: "Header",
|
|
26
27
|
props: {
|
|
27
28
|
icon: {},
|
|
28
29
|
title: {}
|
|
29
30
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const t =
|
|
32
|
-
return (
|
|
33
|
-
t.icon ? (
|
|
34
|
-
|
|
31
|
+
setup(l) {
|
|
32
|
+
const t = l;
|
|
33
|
+
return (y, o) => (n(), g("div", Ge, [
|
|
34
|
+
t.icon ? (n(), k(ue(t.icon), { key: 0 })) : (n(), g("span", Oe, [
|
|
35
|
+
M(h(ve), { style: { color: "#1476ff" } })
|
|
35
36
|
])),
|
|
36
|
-
v("h3",
|
|
37
|
+
v("h3", xe, O(t.title), 1)
|
|
37
38
|
]));
|
|
38
39
|
}
|
|
39
|
-
}),
|
|
40
|
-
function
|
|
41
|
-
return
|
|
42
|
-
|
|
40
|
+
}), Ee = /* @__PURE__ */ T(ze, [["__scopeId", "data-v-76bef623"]]), Le = {}, Ne = { class: "tr-question__loading-wrapper" };
|
|
41
|
+
function Pe(l, t) {
|
|
42
|
+
return n(), g("div", Ne, [
|
|
43
|
+
m(l.$slots, "default", {}, () => [
|
|
43
44
|
t[0] || (t[0] = v("img", {
|
|
44
45
|
class: "tr-question__loading",
|
|
45
|
-
src:
|
|
46
|
+
src: Me
|
|
46
47
|
}, null, -1)),
|
|
47
48
|
t[1] || (t[1] = v("span", { class: "tr-question__loading-text" }, "正在加载", -1))
|
|
48
49
|
], !0)
|
|
49
50
|
]);
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
53
|
-
return
|
|
54
|
-
|
|
52
|
+
const Ve = /* @__PURE__ */ T(Le, [["render", Pe], ["__scopeId", "data-v-5cdf0688"]]), We = {}, De = { class: "tr-question__no-data-wrapper" };
|
|
53
|
+
function Ue(l, t) {
|
|
54
|
+
return n(), g("div", De, [
|
|
55
|
+
m(l.$slots, "default", {}, () => [
|
|
55
56
|
t[0] || (t[0] = v("img", {
|
|
56
57
|
class: "tr-question__no-data",
|
|
57
|
-
src:
|
|
58
|
+
src: Se
|
|
58
59
|
}, null, -1)),
|
|
59
60
|
t[1] || (t[1] = v("span", { class: "tr-question__no-data-text" }, "暂时没有内容", -1))
|
|
60
61
|
], !0)
|
|
61
62
|
]);
|
|
62
63
|
}
|
|
63
|
-
const
|
|
64
|
+
const Fe = /* @__PURE__ */ T(We, [["render", Ue], ["__scopeId", "data-v-a33638dd"]]), He = { class: "tr-tooltip-content" }, Qe = /* @__PURE__ */ z({
|
|
64
65
|
__name: "Tooltip",
|
|
65
|
-
props: /* @__PURE__ */
|
|
66
|
+
props: /* @__PURE__ */ V({
|
|
66
67
|
show: { type: Boolean },
|
|
67
68
|
content: {},
|
|
68
69
|
trigger: {},
|
|
@@ -75,48 +76,48 @@ const D0 = /* @__PURE__ */ L(U0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
75
76
|
showModifiers: {}
|
|
76
77
|
}),
|
|
77
78
|
emits: ["update:show"],
|
|
78
|
-
setup(
|
|
79
|
-
const t =
|
|
80
|
-
left:
|
|
81
|
-
top: t.placement === "top" ?
|
|
82
|
-
width:
|
|
79
|
+
setup(l) {
|
|
80
|
+
const t = l, y = A(l, "show"), o = i(t.show), $ = p(() => t.trigger), { x: u, y: d, width: _, height: C } = ge($), E = p(() => t.trigger ? {
|
|
81
|
+
left: G(u.value),
|
|
82
|
+
top: t.placement === "top" ? G(d.value) : G(d.value + C.value),
|
|
83
|
+
width: G(_.value)
|
|
83
84
|
} : {});
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
() =>
|
|
87
|
-
(
|
|
88
|
-
const
|
|
89
|
-
|
|
85
|
+
let f;
|
|
86
|
+
W(
|
|
87
|
+
() => y.value,
|
|
88
|
+
(r) => {
|
|
89
|
+
const c = r ? t.delayOpen : t.delayClose;
|
|
90
|
+
f && (clearTimeout(f), f = void 0, r || (o.value = !1)), c ? f = setTimeout(() => o.value = r || !1, c) : o.value = r || !1;
|
|
90
91
|
}
|
|
91
|
-
),
|
|
92
|
+
), W(
|
|
92
93
|
() => t.disabled,
|
|
93
|
-
(
|
|
94
|
-
|
|
94
|
+
(r) => {
|
|
95
|
+
r && (f && clearTimeout(f), o.value = !1);
|
|
95
96
|
}
|
|
96
97
|
);
|
|
97
|
-
const
|
|
98
|
-
var
|
|
99
|
-
(
|
|
98
|
+
const w = (r) => {
|
|
99
|
+
var c;
|
|
100
|
+
(c = $.value) != null && c.contains(r.relatedTarget) || (y.value = !1);
|
|
100
101
|
};
|
|
101
|
-
return (
|
|
102
|
-
default:
|
|
103
|
-
|
|
102
|
+
return (r, c) => (n(), k(ce, { name: "tr-tooltip" }, {
|
|
103
|
+
default: S(() => [
|
|
104
|
+
o.value ? (n(), g("div", {
|
|
104
105
|
key: 0,
|
|
105
|
-
class:
|
|
106
|
+
class: D(["tr-tooltip", `placement-${t.placement}`]),
|
|
106
107
|
role: "tooltip",
|
|
107
|
-
style:
|
|
108
|
-
onMouseleave:
|
|
108
|
+
style: J(E.value),
|
|
109
|
+
onMouseleave: w
|
|
109
110
|
}, [
|
|
110
|
-
|
|
111
|
-
v("span",
|
|
111
|
+
c[0] || (c[0] = v("div", { class: "tr-tooltip-arrow" }, null, -1)),
|
|
112
|
+
v("span", He, O(t.content), 1)
|
|
112
113
|
], 38)) : U("", !0)
|
|
113
114
|
]),
|
|
114
115
|
_: 1
|
|
115
116
|
}));
|
|
116
117
|
}
|
|
117
|
-
}),
|
|
118
|
+
}), je = /* @__PURE__ */ T(Qe, [["__scopeId", "data-v-72e44084"]]), Ae = ["onClick", "onMouseenter", "onMouseleave"], Je = /* @__PURE__ */ z({
|
|
118
119
|
__name: "index",
|
|
119
|
-
props: /* @__PURE__ */
|
|
120
|
+
props: /* @__PURE__ */ V({
|
|
120
121
|
appendTo: {},
|
|
121
122
|
data: {},
|
|
122
123
|
title: {
|
|
@@ -143,174 +144,180 @@ const D0 = /* @__PURE__ */ L(U0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
143
144
|
selectedGroup: {},
|
|
144
145
|
selectedGroupModifiers: {}
|
|
145
146
|
}),
|
|
146
|
-
emits: /* @__PURE__ */
|
|
147
|
-
setup(
|
|
148
|
-
|
|
147
|
+
emits: /* @__PURE__ */ V(["item-click", "group-click", "open", "close", "click-outside"], ["update:selectedGroup"]),
|
|
148
|
+
setup(l, {
|
|
149
|
+
expose: t,
|
|
150
|
+
emit: y
|
|
149
151
|
}) {
|
|
150
|
-
const o =
|
|
151
|
-
get: () => o.trigger === "manual" ? o.show :
|
|
152
|
+
const o = l, $ = i(!1), u = p({
|
|
153
|
+
get: () => o.trigger === "manual" ? o.show : $.value,
|
|
152
154
|
set: (e) => {
|
|
153
|
-
o.trigger !== "manual" && (
|
|
155
|
+
o.trigger !== "manual" && ($.value = e);
|
|
154
156
|
}
|
|
155
|
-
}),
|
|
157
|
+
}), d = y, _ = A(l, "selectedGroup"), C = p(() => {
|
|
156
158
|
var e;
|
|
157
159
|
return typeof ((e = o.data.at(0)) == null ? void 0 : e.group) == "string";
|
|
158
160
|
});
|
|
159
|
-
!
|
|
160
|
-
const
|
|
161
|
+
!_.value && C.value && o.data.length && (_.value = o.data[0].group);
|
|
162
|
+
const E = p(() => {
|
|
161
163
|
var e;
|
|
162
|
-
return
|
|
163
|
-
}),
|
|
164
|
+
return C.value ? ((e = o.data.find((s) => s.group === _.value)) == null ? void 0 : e.items) || [] : o.data;
|
|
165
|
+
}), f = p(() => C.value ? o.data.map((e) => ({
|
|
164
166
|
...e,
|
|
165
167
|
id: e.group
|
|
166
|
-
})) : []),
|
|
168
|
+
})) : []), w = i(null), r = p(() => {
|
|
167
169
|
var e;
|
|
168
|
-
return (e =
|
|
169
|
-
}),
|
|
170
|
+
return (e = w.value) == null ? void 0 : e.triggerRef;
|
|
171
|
+
}), c = p(() => {
|
|
170
172
|
var e;
|
|
171
|
-
return (e =
|
|
172
|
-
}),
|
|
173
|
-
isScrolling:
|
|
174
|
-
} =
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
return (e = w.value) == null ? void 0 : e.popperRef;
|
|
174
|
+
}), B = _e("(max-width: 767px)"), F = i(null), L = i(!1), {
|
|
175
|
+
isScrolling: K
|
|
176
|
+
} = he(F);
|
|
177
|
+
ye(K, (e) => {
|
|
178
|
+
L.value = e;
|
|
177
179
|
}, {
|
|
178
180
|
throttle: 100,
|
|
179
181
|
leading: !0,
|
|
180
182
|
trailing: !0
|
|
181
183
|
});
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
width:
|
|
188
|
-
} =
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
const R = i([]), X = p(() => R.value.at(0)), Y = (e, s) => {
|
|
185
|
+
R.value[s] = e;
|
|
186
|
+
}, N = i([]), Z = () => {
|
|
187
|
+
N.value = R.value.map((e) => e ? e.scrollWidth > e.clientWidth : !1);
|
|
188
|
+
}, H = i(null), Q = i(null), b = i(!1), j = i(""), {
|
|
189
|
+
width: ee
|
|
190
|
+
} = we(X);
|
|
191
|
+
W(ee, () => {
|
|
192
|
+
Z();
|
|
191
193
|
});
|
|
192
|
-
const
|
|
194
|
+
const te = p(() => B.value ? {
|
|
193
195
|
left: 0,
|
|
194
196
|
right: 0,
|
|
195
197
|
bottom: 0,
|
|
196
198
|
top: "unset",
|
|
197
|
-
minWidth: "
|
|
198
|
-
} : {}),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
show:
|
|
199
|
+
minWidth: "100%"
|
|
200
|
+
} : {}), oe = Te(r, o.appendTo);
|
|
201
|
+
$e(() => ({
|
|
202
|
+
to: oe.value
|
|
203
|
+
}), () => M(be, {
|
|
204
|
+
show: u.value && B.value
|
|
203
205
|
}, null));
|
|
204
|
-
const
|
|
205
|
-
o.trigger === "click" && (
|
|
206
|
+
const P = () => {
|
|
207
|
+
o.trigger === "click" && (u.value ? d("open") : d("close"));
|
|
206
208
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
ke(c, (e) => {
|
|
210
|
+
d("click-outside", e), u.value = !1, P();
|
|
209
211
|
}, {
|
|
210
|
-
ignore: [
|
|
212
|
+
ignore: [r]
|
|
211
213
|
});
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
var
|
|
225
|
-
((
|
|
214
|
+
const se = () => {
|
|
215
|
+
u.value = !u.value, P();
|
|
216
|
+
}, le = () => {
|
|
217
|
+
u.value = !1, d("close");
|
|
218
|
+
}, ne = (e) => {
|
|
219
|
+
d("item-click", e), u.value = !1, P();
|
|
220
|
+
}, re = (e) => {
|
|
221
|
+
const s = o.data.find((a) => a.group === e);
|
|
222
|
+
s && d("group-click", s);
|
|
223
|
+
}, ae = (e, s) => {
|
|
224
|
+
Q.value = R.value[s], b.value = !0, j.value = e.text;
|
|
225
|
+
}, ie = (e) => {
|
|
226
|
+
var s;
|
|
227
|
+
((s = H.value) == null ? void 0 : s.$el).contains(e.relatedTarget) || (b.value = !1);
|
|
226
228
|
};
|
|
227
|
-
return (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
return t({
|
|
230
|
+
update: () => {
|
|
231
|
+
var e;
|
|
232
|
+
(e = w.value) == null || e.update();
|
|
233
|
+
}
|
|
234
|
+
}), (e, s) => (n(), k(h(Ce), {
|
|
235
|
+
show: u.value,
|
|
236
|
+
class: D(["tr-question-popover", {
|
|
237
|
+
mobile: h(B)
|
|
231
238
|
}]),
|
|
232
|
-
style:
|
|
239
|
+
style: J(te.value),
|
|
233
240
|
ref_key: "basePopperRef",
|
|
234
|
-
ref:
|
|
241
|
+
ref: w,
|
|
235
242
|
placement: "top-left",
|
|
236
243
|
"append-to": o.appendTo,
|
|
237
244
|
offset: o.topOffset,
|
|
238
245
|
"transition-props": {
|
|
239
|
-
name:
|
|
246
|
+
name: h(B) ? "tr-question-popover-mobile" : "tr-question-popover"
|
|
240
247
|
},
|
|
241
248
|
"prevent-overflow": !0,
|
|
242
249
|
"trigger-events": {
|
|
243
|
-
onClick:
|
|
250
|
+
onClick: se
|
|
244
251
|
}
|
|
245
252
|
}, {
|
|
246
|
-
trigger:
|
|
247
|
-
content:
|
|
253
|
+
trigger: S(() => [m(e.$slots, "trigger", {}, void 0, !0)]),
|
|
254
|
+
content: S(() => [m(e.$slots, "header", {}, () => [M(Ee, {
|
|
248
255
|
icon: o.icon,
|
|
249
256
|
title: o.title
|
|
250
|
-
}, null, 8, ["icon", "title"])], !0), o.loading ? (
|
|
257
|
+
}, null, 8, ["icon", "title"])], !0), o.loading ? (n(), k(Ve, {
|
|
251
258
|
key: 0
|
|
252
259
|
}, {
|
|
253
|
-
default:
|
|
260
|
+
default: S(() => [m(e.$slots, "loading", {}, void 0, !0)]),
|
|
254
261
|
_: 3
|
|
255
|
-
})) : o.data.length === 0 ? (
|
|
262
|
+
})) : o.data.length === 0 ? (n(), k(Fe, {
|
|
256
263
|
key: 1
|
|
257
264
|
}, {
|
|
258
|
-
default:
|
|
265
|
+
default: S(() => [m(e.$slots, "empty", {}, void 0, !0)]),
|
|
259
266
|
_: 3
|
|
260
|
-
})) :
|
|
267
|
+
})) : m(e.$slots, "body", {
|
|
261
268
|
key: 2
|
|
262
|
-
}, () => [
|
|
269
|
+
}, () => [f.value.length > 0 ? (n(), k(h(Ie), {
|
|
263
270
|
key: 0,
|
|
264
271
|
class: "tr-question__group",
|
|
265
|
-
items:
|
|
266
|
-
selected:
|
|
267
|
-
"onUpdate:selected":
|
|
272
|
+
items: f.value,
|
|
273
|
+
selected: _.value,
|
|
274
|
+
"onUpdate:selected": s[0] || (s[0] = (a) => _.value = a),
|
|
268
275
|
"lines-limit": 2,
|
|
269
276
|
"show-more-trigger": o.groupShowMoreTrigger,
|
|
270
|
-
onItemClick:
|
|
277
|
+
onItemClick: re
|
|
271
278
|
}, null, 8, ["items", "selected", "show-more-trigger"])) : U("", !0), v("ul", {
|
|
272
|
-
class:
|
|
273
|
-
scrolling:
|
|
279
|
+
class: D(["tr-question__list", {
|
|
280
|
+
scrolling: L.value
|
|
274
281
|
}]),
|
|
275
282
|
ref_key: "listRef",
|
|
276
|
-
ref:
|
|
277
|
-
}, [(
|
|
283
|
+
ref: F
|
|
284
|
+
}, [(n(!0), g(pe, null, de(E.value, (a, I) => (n(), g("li", {
|
|
278
285
|
class: "tr-question__list-item",
|
|
279
|
-
key:
|
|
286
|
+
key: a.id,
|
|
280
287
|
ref_for: !0,
|
|
281
|
-
ref: (
|
|
282
|
-
onClick: (
|
|
283
|
-
onMouseenter: (
|
|
284
|
-
onMouseleave: (
|
|
285
|
-
}, [
|
|
286
|
-
item:
|
|
287
|
-
}, () => [v("span", null,
|
|
288
|
+
ref: (q) => Y(q, I),
|
|
289
|
+
onClick: (q) => ne(a),
|
|
290
|
+
onMouseenter: (q) => N.value[I] && ae(a, I),
|
|
291
|
+
onMouseleave: (q) => N.value[I] && ie(q)
|
|
292
|
+
}, [m(e.$slots, "item", {
|
|
293
|
+
item: a
|
|
294
|
+
}, () => [v("span", null, O(I + 1) + ". ", 1), fe(O(a.text), 1)], !0)], 40, Ae))), 128))], 2)], !0), M(je, {
|
|
288
295
|
ref_key: "tooltipRef",
|
|
289
|
-
ref:
|
|
290
|
-
show:
|
|
291
|
-
"onUpdate:show":
|
|
292
|
-
content:
|
|
293
|
-
trigger:
|
|
294
|
-
disabled:
|
|
296
|
+
ref: H,
|
|
297
|
+
show: b.value,
|
|
298
|
+
"onUpdate:show": s[1] || (s[1] = (a) => b.value = a),
|
|
299
|
+
content: j.value,
|
|
300
|
+
trigger: Q.value,
|
|
301
|
+
disabled: L.value,
|
|
295
302
|
placement: "top",
|
|
296
303
|
"delay-open": 300,
|
|
297
304
|
"delay-close": 300
|
|
298
|
-
}, null, 8, ["show", "content", "trigger", "disabled"]),
|
|
305
|
+
}, null, 8, ["show", "content", "trigger", "disabled"]), M(h(qe), {
|
|
299
306
|
class: "tr-question-popover__close",
|
|
300
|
-
icon:
|
|
307
|
+
icon: h(me),
|
|
301
308
|
size: "32",
|
|
302
309
|
"svg-size": "20",
|
|
303
|
-
onClick:
|
|
310
|
+
onClick: le
|
|
304
311
|
}, null, 8, ["icon"])]),
|
|
305
312
|
_: 3
|
|
306
313
|
}, 8, ["show", "class", "style", "append-to", "offset", "transition-props", "trigger-events"]));
|
|
307
314
|
}
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
|
|
315
|
+
}), x = /* @__PURE__ */ T(Je, [["__scopeId", "data-v-8cc35579"]]);
|
|
316
|
+
x.name = "TrSuggestionPopover";
|
|
317
|
+
const Ke = function(l) {
|
|
318
|
+
l.component(x.name, x);
|
|
312
319
|
};
|
|
313
|
-
|
|
320
|
+
x.install = Ke;
|
|
314
321
|
export {
|
|
315
|
-
|
|
322
|
+
x as default
|
|
316
323
|
};
|