@opentiny/tiny-robot 0.3.0-alpha.17 → 0.3.0-alpha.19
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 +12 -12
- package/dist/attachments/index.js +221 -221
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +2 -2
- package/dist/container/index.js +27 -27
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +2 -2
- package/dist/feedback/index.js +75 -75
- package/dist/flow-layout-buttons/index.js +18 -18
- package/dist/history/index.js +76 -77
- package/dist/index2.js +680 -608
- package/dist/index3.js +148 -697
- package/dist/mcp-server-picker/index.js +377 -29675
- package/dist/sender/index.js +745 -728
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +19 -19
- package/dist/suggestion-popover/index.js +31 -31
- package/dist/useSlotRefs.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +3 -15
- package/dist/close.js +0 -29
- package/dist/index4.js +0 -161
- 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 -1142
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { e as ce, b as
|
|
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 }, ge = /* @__PURE__ */
|
|
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 v = i, _ =
|
|
12
|
+
const v = i, _ = K(), p = a(() => {
|
|
13
13
|
var o;
|
|
14
14
|
return !!(_.icon || (o = v.item) != null && o.icon);
|
|
15
15
|
}), I = a(() => {
|
|
@@ -28,12 +28,12 @@ const pe = { key: 0 }, ge = /* @__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
|
-
}), h = /* @__PURE__ */
|
|
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 },
|
|
@@ -46,11 +46,11 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ K({
|
|
|
46
46
|
}),
|
|
47
47
|
emits: /* @__PURE__ */ N(["click-outside"], ["update:showAll"]),
|
|
48
48
|
setup(i, { expose: v, emit: _ }) {
|
|
49
|
-
const p = i, I =
|
|
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
51
|
index: t + g.value
|
|
52
|
-
})) : []), E = d([]), P = d([]), V = a(() => E.value.map((e) =>
|
|
53
|
-
const e = f.value, t =
|
|
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
|
$(() => {
|
|
@@ -122,28 +122,28 @@ const pe = { key: 0 }, ge = /* @__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
131
|
D("div", he, [
|
|
132
|
-
|
|
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,13 +153,13 @@ const pe = { key: 0 }, ge = /* @__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);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as z, createElementBlock as m, createCommentVNode as W, openBlock as n, createBlock as L, createElementVNode as v, resolveDynamicComponent as u0, createVNode as $, unref as h, toDisplayString as
|
|
2
|
-
import {
|
|
3
|
-
import { a as m0, h as _0, u as h0, w as C0, e as y0, o as L0 } from "../
|
|
4
|
-
import { u as w0, c as k0, B as M0 } from "../
|
|
1
|
+
import { defineComponent as z, createElementBlock as m, createCommentVNode as W, openBlock as n, createBlock as L, createElementVNode as v, resolveDynamicComponent as u0, createVNode as $, unref as h, toDisplayString as R, renderSlot as g, mergeModels as E, useModel as j, ref as i, computed as p, watch as N, Transition as c0, withCtx as I, normalizeStyle as A, normalizeClass as V, Fragment as p0, renderList as d0, createTextVNode as f0 } from "vue";
|
|
2
|
+
import { IconSparkles as v0, IconClose as g0 } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { a as m0, h as _0, u as h0, w as C0, e as y0, o as L0 } from "../index2.js";
|
|
4
|
+
import { u as w0, c as k0, B as M0 } from "../index3.js";
|
|
5
5
|
import F0 from "../flow-layout-buttons/index.js";
|
|
6
6
|
import T0 from "../icon-button/index.js";
|
|
7
7
|
import { _ as w } from "../_plugin-vue_export-helper.js";
|
|
8
8
|
import { _ as $0 } from "../loading.js";
|
|
9
|
-
import { t as
|
|
10
|
-
const
|
|
9
|
+
import { t as S } from "../utils.js";
|
|
10
|
+
const I0 = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "tr-question-popover__backdrop"
|
|
13
13
|
}, q0 = /* @__PURE__ */ z({
|
|
@@ -16,12 +16,12 @@ const x0 = {
|
|
|
16
16
|
show: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
setup(s) {
|
|
19
|
-
return (t, C) => t.show ? (n(), m("div",
|
|
19
|
+
return (t, C) => t.show ? (n(), m("div", I0)) : W("", !0);
|
|
20
20
|
}
|
|
21
|
-
}),
|
|
21
|
+
}), x0 = /* @__PURE__ */ w(q0, [["__scopeId", "data-v-50205eaf"]]), B0 = { class: "tr-question__header" }, S0 = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "tr-question__header-icon"
|
|
24
|
-
},
|
|
24
|
+
}, R0 = { class: "tr-question__header-title" }, b0 = /* @__PURE__ */ z({
|
|
25
25
|
__name: "Header",
|
|
26
26
|
props: {
|
|
27
27
|
icon: {},
|
|
@@ -29,11 +29,11 @@ const x0 = {
|
|
|
29
29
|
},
|
|
30
30
|
setup(s) {
|
|
31
31
|
const t = s;
|
|
32
|
-
return (C, o) => (n(), m("div",
|
|
33
|
-
t.icon ? (n(), L(u0(t.icon), { key: 0 })) : (n(), m("span",
|
|
32
|
+
return (C, o) => (n(), m("div", B0, [
|
|
33
|
+
t.icon ? (n(), L(u0(t.icon), { key: 0 })) : (n(), m("span", S0, [
|
|
34
34
|
$(h(v0), { style: { color: "#1476ff" } })
|
|
35
35
|
])),
|
|
36
|
-
v("h3",
|
|
36
|
+
v("h3", R0, R(t.title), 1)
|
|
37
37
|
]));
|
|
38
38
|
}
|
|
39
39
|
}), z0 = /* @__PURE__ */ w(b0, [["__scopeId", "data-v-76bef623"]]), Z0 = {}, G0 = { class: "tr-question__loading-wrapper" };
|
|
@@ -77,9 +77,9 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
77
77
|
emits: ["update:show"],
|
|
78
78
|
setup(s) {
|
|
79
79
|
const t = s, C = j(s, "show"), o = i(t.show), k = p(() => t.trigger), { x: u, y: d, width: _, height: M } = m0(k), Z = p(() => t.trigger ? {
|
|
80
|
-
left:
|
|
81
|
-
top: t.placement === "top" ?
|
|
82
|
-
width:
|
|
80
|
+
left: S(u.value),
|
|
81
|
+
top: t.placement === "top" ? S(d.value) : S(d.value + M.value),
|
|
82
|
+
width: S(_.value)
|
|
83
83
|
} : {});
|
|
84
84
|
let f;
|
|
85
85
|
N(
|
|
@@ -99,7 +99,7 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
99
99
|
(c = k.value) != null && c.contains(r.relatedTarget) || (C.value = !1);
|
|
100
100
|
};
|
|
101
101
|
return (r, c) => (n(), L(c0, { name: "tr-tooltip" }, {
|
|
102
|
-
default:
|
|
102
|
+
default: I(() => [
|
|
103
103
|
o.value ? (n(), m("div", {
|
|
104
104
|
key: 0,
|
|
105
105
|
class: V(["tr-tooltip", `placement-${t.placement}`]),
|
|
@@ -108,7 +108,7 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
108
108
|
onMouseleave: y
|
|
109
109
|
}, [
|
|
110
110
|
c[0] || (c[0] = v("div", { class: "tr-tooltip-arrow" }, null, -1)),
|
|
111
|
-
v("span", U0,
|
|
111
|
+
v("span", U0, R(t.content), 1)
|
|
112
112
|
], 38)) : W("", !0)
|
|
113
113
|
]),
|
|
114
114
|
_: 1
|
|
@@ -180,11 +180,11 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
180
180
|
leading: !0,
|
|
181
181
|
trailing: !0
|
|
182
182
|
});
|
|
183
|
-
const
|
|
184
|
-
|
|
183
|
+
const x = i([]), K = p(() => x.value.at(0)), X = (e, l) => {
|
|
184
|
+
x.value[l] = e;
|
|
185
185
|
}, O = i([]), Y = () => {
|
|
186
|
-
O.value =
|
|
187
|
-
}, U = i(null), H = i(null),
|
|
186
|
+
O.value = x.value.map((e) => e ? e.scrollWidth > e.clientWidth : !1);
|
|
187
|
+
}, U = i(null), H = i(null), B = i(!1), Q = i(""), {
|
|
188
188
|
width: e0
|
|
189
189
|
} = y0(K);
|
|
190
190
|
N(e0, () => {
|
|
@@ -199,7 +199,7 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
199
199
|
} : {}), o0 = w0(r, o.appendTo);
|
|
200
200
|
k0(() => ({
|
|
201
201
|
to: o0.value
|
|
202
|
-
}), () => $(
|
|
202
|
+
}), () => $(x0, {
|
|
203
203
|
show: u.value && q.value
|
|
204
204
|
}, null));
|
|
205
205
|
const P = () => {
|
|
@@ -220,10 +220,10 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
220
220
|
const l = o.data.find((a) => a.group === e);
|
|
221
221
|
l && d("group-click", l);
|
|
222
222
|
}, a0 = (e, l) => {
|
|
223
|
-
H.value =
|
|
223
|
+
H.value = x.value[l], B.value = !0, Q.value = e.text;
|
|
224
224
|
}, i0 = (e) => {
|
|
225
225
|
var l;
|
|
226
|
-
((l = U.value) == null ? void 0 : l.$el).contains(e.relatedTarget) || (
|
|
226
|
+
((l = U.value) == null ? void 0 : l.$el).contains(e.relatedTarget) || (B.value = !1);
|
|
227
227
|
};
|
|
228
228
|
return t({
|
|
229
229
|
update: () => {
|
|
@@ -249,19 +249,19 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
249
249
|
onClick: l0
|
|
250
250
|
}
|
|
251
251
|
}, {
|
|
252
|
-
trigger:
|
|
253
|
-
content:
|
|
252
|
+
trigger: I(() => [g(e.$slots, "trigger", {}, void 0, !0)]),
|
|
253
|
+
content: I(() => [g(e.$slots, "header", {}, () => [$(z0, {
|
|
254
254
|
icon: o.icon,
|
|
255
255
|
title: o.title
|
|
256
256
|
}, null, 8, ["icon", "title"])], !0), o.loading ? (n(), L(P0, {
|
|
257
257
|
key: 0
|
|
258
258
|
}, {
|
|
259
|
-
default:
|
|
259
|
+
default: I(() => [g(e.$slots, "loading", {}, void 0, !0)]),
|
|
260
260
|
_: 3
|
|
261
261
|
})) : o.data.length === 0 ? (n(), L(D0, {
|
|
262
262
|
key: 1
|
|
263
263
|
}, {
|
|
264
|
-
default:
|
|
264
|
+
default: I(() => [g(e.$slots, "empty", {}, void 0, !0)]),
|
|
265
265
|
_: 3
|
|
266
266
|
})) : g(e.$slots, "body", {
|
|
267
267
|
key: 2
|
|
@@ -290,11 +290,11 @@ const D0 = /* @__PURE__ */ w(N0, [["render", W0], ["__scopeId", "data-v-a33638dd
|
|
|
290
290
|
onMouseleave: (T) => O.value[F] && i0(T)
|
|
291
291
|
}, [g(e.$slots, "item", {
|
|
292
292
|
item: a
|
|
293
|
-
}, () => [v("span", null,
|
|
293
|
+
}, () => [v("span", null, R(F + 1) + ". ", 1), f0(R(a.text), 1)], !0)], 40, j0))), 128))], 2)], !0), $(Q0, {
|
|
294
294
|
ref_key: "tooltipRef",
|
|
295
295
|
ref: U,
|
|
296
|
-
show:
|
|
297
|
-
"onUpdate:show": l[1] || (l[1] = (a) =>
|
|
296
|
+
show: B.value,
|
|
297
|
+
"onUpdate:show": l[1] || (l[1] = (a) => B.value = a),
|
|
298
298
|
content: Q.value,
|
|
299
299
|
trigger: H.value,
|
|
300
300
|
disabled: G.value,
|
package/dist/useSlotRefs.js
CHANGED
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-robot",
|
|
3
|
-
"version": "0.3.0-alpha.
|
|
3
|
+
"version": "0.3.0-alpha.19",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,25 +20,13 @@
|
|
|
20
20
|
"vue": "^3.3.11"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opentiny/tiny-robot-svgs": "0.3.0-alpha.
|
|
23
|
+
"@opentiny/tiny-robot-svgs": "0.3.0-alpha.19",
|
|
24
24
|
"@opentiny/vue": "^3.21.0",
|
|
25
|
-
"@opentiny/vue-button": "^3.21.0",
|
|
26
|
-
"@opentiny/vue-icon": "^3.22.0",
|
|
27
|
-
"@opentiny/vue-input": "^3.21.0",
|
|
28
|
-
"@opentiny/vue-option": "^3.21.0",
|
|
29
|
-
"@opentiny/vue-popconfirm": "^3.21.0",
|
|
30
|
-
"@opentiny/vue-radio-group": "^3.21.0",
|
|
31
|
-
"@opentiny/vue-select": "^3.21.0",
|
|
32
|
-
"@opentiny/vue-switch": "^3.21.0",
|
|
33
|
-
"@opentiny/vue-tab-item": "^3.21.0",
|
|
34
|
-
"@opentiny/vue-tabs": "^3.21.0",
|
|
35
|
-
"@opentiny/vue-tooltip": "^3.22.0",
|
|
36
25
|
"@vueuse/core": "^13.1.0",
|
|
37
26
|
"dompurify": "^3.2.6",
|
|
38
27
|
"markdown-it": "^14.1.0"
|
|
39
28
|
},
|
|
40
29
|
"devDependencies": {
|
|
41
|
-
"@opentiny/vue-vite-import": "^1.3.0",
|
|
42
30
|
"@types/dom-speech-recognition": "^0.0.6",
|
|
43
31
|
"@types/lodash-es": "^4.17.12",
|
|
44
32
|
"@types/markdown-it": "^14.1.2",
|
|
@@ -52,5 +40,5 @@
|
|
|
52
40
|
"vue": "^3.3.11",
|
|
53
41
|
"vue-tsc": "^2.2.8"
|
|
54
42
|
},
|
|
55
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "6bc75d6fda380f9867352b91e6717c06ccafcefb"
|
|
56
44
|
}
|
package/dist/close.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { s as o } from "./index7.js";
|
|
2
|
-
import { createElementBlock as n, openBlock as r, createElementVNode as t } from "vue";
|
|
3
|
-
var c = {
|
|
4
|
-
viewBox: "0 0 16 16",
|
|
5
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
6
|
-
}, a = /* @__PURE__ */ t(
|
|
7
|
-
"path",
|
|
8
|
-
{
|
|
9
|
-
d: "M12.49 3.3a.5.5 0 0 1 .05.62L8.58 7.89l3.91 3.88c.21.19.23.48.05.71-.17.19-.49.24-.71.06L7.88 8.58 4 12.49c-.18.17-.5.18-.68.01a.496.496 0 0 1-.08-.67l3.93-3.94L3.29 4a.524.524 0 0 1 .04-.71c.17-.14.42-.16.58-.05l3.97 3.93 3.9-3.87c.18-.22.51-.22.71 0Z",
|
|
10
|
-
"fill-rule": "evenodd"
|
|
11
|
-
},
|
|
12
|
-
null,
|
|
13
|
-
-1
|
|
14
|
-
/* HOISTED */
|
|
15
|
-
), l = [a];
|
|
16
|
-
function i(e, d) {
|
|
17
|
-
return r(), n("svg", c, [].concat(l));
|
|
18
|
-
}
|
|
19
|
-
var s = {
|
|
20
|
-
render: i
|
|
21
|
-
}, _ = function() {
|
|
22
|
-
return o({
|
|
23
|
-
name: "IconClose",
|
|
24
|
-
component: s
|
|
25
|
-
})();
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
_ as i
|
|
29
|
-
};
|
package/dist/index4.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { onMounted as U, nextTick as B, h as C, defineComponent as g, render as R, onBeforeUnmount as D, Teleport as W, computed as h, ref as E, createBlock as F, openBlock as _, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, createCommentVNode as J, renderSlot as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
|
|
2
|
-
import { b as oe, a as re, e as ne } from "./index3.js";
|
|
3
|
-
import { t as u } from "./utils.js";
|
|
4
|
-
import { _ as N } from "./_plugin-vue_export-helper.js";
|
|
5
|
-
import { u as se } from "./useSlotRefs.js";
|
|
6
|
-
const pe = g({
|
|
7
|
-
setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
|
|
8
|
-
props: ["propsFactory", "vnodeFactory"]
|
|
9
|
-
});
|
|
10
|
-
function ae(r, n) {
|
|
11
|
-
let e = null, t = null, s = !1;
|
|
12
|
-
U(() => {
|
|
13
|
-
B(() => {
|
|
14
|
-
s || (t = document.createElement("div"), e = C(pe, { propsFactory: r, vnodeFactory: n }), R(e, t));
|
|
15
|
-
});
|
|
16
|
-
}), D(() => {
|
|
17
|
-
s = !0, B(() => {
|
|
18
|
-
t && (R(null, t), t.remove(), e = null, t = null);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function ce(r, n) {
|
|
23
|
-
return h(() => {
|
|
24
|
-
var v;
|
|
25
|
-
if (n instanceof HTMLElement)
|
|
26
|
-
return n;
|
|
27
|
-
const e = n, t = oe(r), s = (v = t == null ? void 0 : t.getRootNode) == null ? void 0 : v.call(t), i = s instanceof ShadowRoot, d = i ? s : document.body;
|
|
28
|
-
if (e) {
|
|
29
|
-
if (!i && e === "body")
|
|
30
|
-
return document.body;
|
|
31
|
-
const f = d.querySelector(e);
|
|
32
|
-
if (f instanceof Node) return f;
|
|
33
|
-
}
|
|
34
|
-
return d;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const ie = /* @__PURE__ */ g({
|
|
38
|
-
__name: "Popper",
|
|
39
|
-
props: {
|
|
40
|
-
show: { type: Boolean },
|
|
41
|
-
transitionProps: {}
|
|
42
|
-
},
|
|
43
|
-
setup(r, { expose: n }) {
|
|
44
|
-
const e = E(null);
|
|
45
|
-
return n({
|
|
46
|
-
popperRef: e
|
|
47
|
-
}), (t, s) => (_(), F(j, q(L(t.transitionProps)), {
|
|
48
|
-
default: Z(() => [
|
|
49
|
-
t.show ? (_(), G("div", {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: "tr-base-popper",
|
|
52
|
-
ref_key: "popperRef",
|
|
53
|
-
ref: e
|
|
54
|
-
}, [
|
|
55
|
-
K(t.$slots, "default", {}, void 0, !0)
|
|
56
|
-
], 512)) : J("", !0)
|
|
57
|
-
]),
|
|
58
|
-
_: 3
|
|
59
|
-
}, 16));
|
|
60
|
-
}
|
|
61
|
-
}), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ g({
|
|
62
|
-
inheritAttrs: !1,
|
|
63
|
-
__name: "index",
|
|
64
|
-
props: {
|
|
65
|
-
appendTo: {},
|
|
66
|
-
offset: {},
|
|
67
|
-
placement: {
|
|
68
|
-
default: "top-center"
|
|
69
|
-
},
|
|
70
|
-
preventOverflow: {
|
|
71
|
-
type: Boolean
|
|
72
|
-
},
|
|
73
|
-
show: {
|
|
74
|
-
type: Boolean
|
|
75
|
-
},
|
|
76
|
-
transitionProps: {},
|
|
77
|
-
triggerEvents: {}
|
|
78
|
-
},
|
|
79
|
-
setup(r, {
|
|
80
|
-
expose: n
|
|
81
|
-
}) {
|
|
82
|
-
const e = r, t = Q(), {
|
|
83
|
-
vnodes: s,
|
|
84
|
-
ref: i,
|
|
85
|
-
setRef: d
|
|
86
|
-
} = se(t.trigger), v = (o = {}) => {
|
|
87
|
-
const p = {};
|
|
88
|
-
for (const [c, a] of Object.entries(o))
|
|
89
|
-
/^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
|
|
90
|
-
return p;
|
|
91
|
-
}, f = E(null), b = h(() => {
|
|
92
|
-
var o;
|
|
93
|
-
return ((o = f.value) == null ? void 0 : o.popperRef) || null;
|
|
94
|
-
}), m = h(() => {
|
|
95
|
-
var o, p;
|
|
96
|
-
return typeof e.offset == "number" ? {
|
|
97
|
-
mainAxis: e.offset,
|
|
98
|
-
crossAxis: 0
|
|
99
|
-
} : {
|
|
100
|
-
mainAxis: ((o = e.offset) == null ? void 0 : o.mainAxis) ?? 0,
|
|
101
|
-
crossAxis: ((p = e.offset) == null ? void 0 : p.crossAxis) ?? 0
|
|
102
|
-
};
|
|
103
|
-
}), {
|
|
104
|
-
top: $,
|
|
105
|
-
bottom: O,
|
|
106
|
-
left: w,
|
|
107
|
-
right: V,
|
|
108
|
-
width: z,
|
|
109
|
-
update: A
|
|
110
|
-
} = re(i), {
|
|
111
|
-
width: y,
|
|
112
|
-
height: P
|
|
113
|
-
} = ne(b, void 0, {
|
|
114
|
-
box: "border-box"
|
|
115
|
-
}), H = h(() => {
|
|
116
|
-
const {
|
|
117
|
-
placement: o,
|
|
118
|
-
preventOverflow: p
|
|
119
|
-
} = e, c = {}, a = (l, x) => {
|
|
120
|
-
if (!p) {
|
|
121
|
-
c[l] = x;
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const T = u(l === "top" ? P.value : y.value);
|
|
125
|
-
l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${x}, calc(var(--tr-base-popper-max-bottom) - ${T}))` : l === "left" && (c[l] = `clamp(var(--tr-base-popper-min-left), ${x}, calc(var(--tr-base-popper-max-right) - ${T}))`);
|
|
126
|
-
};
|
|
127
|
-
return o.includes("top") && a("top", u($.value - P.value - m.value.mainAxis)), o.includes("bottom") && a("top", u(O.value + m.value.mainAxis)), o.includes("left") && a("left", u(w.value + m.value.crossAxis)), o.includes("right") && a("left", u(V.value - y.value + m.value.crossAxis)), o.includes("center") && a("left", u(w.value + z.value / 2 - y.value / 2 + m.value.crossAxis)), c;
|
|
128
|
-
});
|
|
129
|
-
X(() => e.show, (o) => {
|
|
130
|
-
o && A();
|
|
131
|
-
}, {
|
|
132
|
-
flush: "post"
|
|
133
|
-
});
|
|
134
|
-
const I = ce(i, e.appendTo), M = Y();
|
|
135
|
-
return ae(() => ({
|
|
136
|
-
to: I.value
|
|
137
|
-
}), () => te(le, k({
|
|
138
|
-
ref: f,
|
|
139
|
-
show: e.show,
|
|
140
|
-
transitionProps: e.transitionProps,
|
|
141
|
-
style: H.value
|
|
142
|
-
}, M), {
|
|
143
|
-
default: () => {
|
|
144
|
-
var o;
|
|
145
|
-
return [(o = t.content) == null ? void 0 : o.call(t)];
|
|
146
|
-
}
|
|
147
|
-
})), n({
|
|
148
|
-
triggerRef: i,
|
|
149
|
-
popperRef: b,
|
|
150
|
-
update: A
|
|
151
|
-
}), (o, p) => (_(), F(ee(S(s)[0]), k({
|
|
152
|
-
ref: S(d)
|
|
153
|
-
}, v(e.triggerEvents)), null, 16));
|
|
154
|
-
}
|
|
155
|
-
}), fe = /* @__PURE__ */ N(ue, [["__scopeId", "data-v-f1e25842"]]);
|
|
156
|
-
fe.name = "TrBasePopper";
|
|
157
|
-
export {
|
|
158
|
-
fe as B,
|
|
159
|
-
ae as c,
|
|
160
|
-
ce as u
|
|
161
|
-
};
|