@opentiny/tiny-robot 0.3.0-rc.5 → 0.3.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/attachments/index.js +216 -216
- package/dist/bubble/index.js +1070 -1040
- package/dist/drag-overlay/index.js +15 -15
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +66 -3
- package/dist/index2.js +144 -138
- package/dist/index4.js +16 -16
- package/dist/mcp-server-picker/index.js +149 -149
- package/dist/prompts/index.js +5 -5
- package/dist/sender/index.js +1054 -930
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +38 -38
- package/dist/suggestion-popover/index.js +13 -13
- package/package.json +3 -3
package/dist/index2.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { IconEmptySearch as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { o as
|
|
5
|
-
import { t as
|
|
6
|
-
const D =
|
|
7
|
-
let T = 0,
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
D.value =
|
|
1
|
+
import { ref as _, onMounted as ne, onBeforeUnmount as oe, defineComponent as P, createElementBlock as a, openBlock as r, createElementVNode as w, createVNode as $, unref as n, toDisplayString as B, mergeModels as W, useModel as j, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, nextTick as se, normalizeClass as U, withDirectives as q, createCommentVNode as G, renderSlot as A, withKeys as F, withModifiers as J, isRef as le, vModelText as re, vShow as ae } from "vue";
|
|
2
|
+
import { IconEmptySearch as ue, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMenu2 as pe } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { _ as z } from "./_plugin-vue_export-helper.js";
|
|
4
|
+
import { o as Z, a as ve, d as ge, c as ye } from "./index3.js";
|
|
5
|
+
import { t as O } from "./utils.js";
|
|
6
|
+
const D = _(!1);
|
|
7
|
+
let T = 0, b;
|
|
8
|
+
function _e() {
|
|
9
|
+
const s = window.matchMedia("(hover: none) and (pointer: coarse)"), m = () => {
|
|
10
|
+
D.value = s.matches;
|
|
11
11
|
};
|
|
12
|
-
m(),
|
|
12
|
+
m(), s.addEventListener("change", m);
|
|
13
13
|
const t = (c) => {
|
|
14
14
|
D.value = c.pointerType !== "mouse";
|
|
15
15
|
};
|
|
16
16
|
return window.addEventListener("pointerdown", t, !0), () => {
|
|
17
|
-
|
|
17
|
+
s.removeEventListener("change", m), window.removeEventListener("pointerdown", t, !0);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function ye() {
|
|
21
|
-
$ == null || $(), $ = void 0;
|
|
22
|
-
}
|
|
23
20
|
function he() {
|
|
21
|
+
b == null || b(), b = void 0;
|
|
22
|
+
}
|
|
23
|
+
function Ce() {
|
|
24
24
|
return typeof window > "u" ? {
|
|
25
25
|
isTouchDevice: D
|
|
26
|
-
} : (
|
|
27
|
-
T++, T === 1 && (
|
|
28
|
-
}),
|
|
29
|
-
T = Math.max(0, T - 1), T === 0 &&
|
|
26
|
+
} : (ne(() => {
|
|
27
|
+
T++, T === 1 && (b = _e());
|
|
28
|
+
}), oe(() => {
|
|
29
|
+
T = Math.max(0, T - 1), T === 0 && he();
|
|
30
30
|
}), {
|
|
31
31
|
isTouchDevice: D
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon" }, Ee = { class: "tr-history__empty-text" }, we = /* @__PURE__ */ P({
|
|
35
35
|
__name: "Empty",
|
|
36
36
|
props: {
|
|
37
37
|
text: { default: "暂无内容" }
|
|
38
38
|
},
|
|
39
|
-
setup(
|
|
40
|
-
const m =
|
|
41
|
-
return (t, c) => (
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
setup(s) {
|
|
40
|
+
const m = s;
|
|
41
|
+
return (t, c) => (r(), a("div", ke, [
|
|
42
|
+
w("span", Le, [
|
|
43
|
+
$(n(ue))
|
|
44
44
|
]),
|
|
45
|
-
|
|
45
|
+
w("span", Ee, B(m.text), 1)
|
|
46
46
|
]));
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
48
|
+
}), Re = /* @__PURE__ */ z(we, [["__scopeId", "data-v-d0340c39"]]), Ie = ["onClick"], Q = 4, xe = /* @__PURE__ */ P({
|
|
49
49
|
__name: "MenuList",
|
|
50
|
-
props: /* @__PURE__ */
|
|
50
|
+
props: /* @__PURE__ */ W({
|
|
51
51
|
items: {},
|
|
52
52
|
menuListGap: { default: 8 }
|
|
53
53
|
}, {
|
|
@@ -56,10 +56,10 @@ const Ce = { class: "tr-history__empty" }, ke = { class: "tr-history__empty-icon
|
|
|
56
56
|
data: { default: null },
|
|
57
57
|
dataModifiers: {}
|
|
58
58
|
}),
|
|
59
|
-
emits: /* @__PURE__ */
|
|
60
|
-
setup(
|
|
61
|
-
const t =
|
|
62
|
-
|
|
59
|
+
emits: /* @__PURE__ */ W(["item-click"], ["update:trigger", "update:data"]),
|
|
60
|
+
setup(s, { emit: m }) {
|
|
61
|
+
const t = j(s, "trigger"), c = j(s, "data"), h = s, C = m, E = _(null);
|
|
62
|
+
Z(
|
|
63
63
|
E,
|
|
64
64
|
() => {
|
|
65
65
|
t.value = null, c.value = null;
|
|
@@ -68,73 +68,73 @@ const Ce = { class: "tr-history__empty" }, ke = { class: "tr-history__empty-icon
|
|
|
68
68
|
ignore: [t]
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
const { top: p, bottom:
|
|
71
|
+
const { top: p, bottom: x, left: y } = ve(t), { width: M, height: k } = ge(E, void 0, { box: "border-box" }), { height: R } = ye(), o = I(() => {
|
|
72
72
|
const L = {
|
|
73
|
-
left: `min(${
|
|
74
|
-
},
|
|
75
|
-
return
|
|
73
|
+
left: `min(${O(y.value)}, calc(100% - ${O(M.value + Q)}))`
|
|
74
|
+
}, g = x.value + h.menuListGap;
|
|
75
|
+
return g + k.value + Q > R.value ? L.bottom = `calc(100% - ${O(p.value - h.menuListGap)})` : L.top = O(g), L;
|
|
76
76
|
}), v = (L) => {
|
|
77
77
|
C("item-click", L), t.value = null, c.value = null;
|
|
78
78
|
};
|
|
79
|
-
return (L,
|
|
79
|
+
return (L, g) => (r(), a("ul", {
|
|
80
80
|
class: "tr-history__menu-list",
|
|
81
81
|
ref_key: "menuRef",
|
|
82
82
|
ref: E,
|
|
83
|
-
style:
|
|
83
|
+
style: ie(o.value)
|
|
84
84
|
}, [
|
|
85
|
-
(
|
|
85
|
+
(r(!0), a(S, null, V(h.items, (u) => (r(), a("li", {
|
|
86
86
|
class: "tr-history__menu-list__item",
|
|
87
|
-
key:
|
|
88
|
-
onClick: (
|
|
87
|
+
key: u.id,
|
|
88
|
+
onClick: (K) => v(u)
|
|
89
89
|
}, [
|
|
90
|
-
(
|
|
91
|
-
|
|
92
|
-
], 8,
|
|
90
|
+
(r(), H(Y(u.icon))),
|
|
91
|
+
w("span", null, B(u.text), 1)
|
|
92
|
+
], 8, Ie))), 128))
|
|
93
93
|
], 4));
|
|
94
94
|
}
|
|
95
|
-
}),
|
|
96
|
-
renameControlOnClickOutside:
|
|
95
|
+
}), Me = /* @__PURE__ */ z(xe, [["__scopeId", "data-v-89fdb41c"]]), Te = ({
|
|
96
|
+
renameControlOnClickOutside: s,
|
|
97
97
|
onItemTitleChange: m
|
|
98
98
|
}) => {
|
|
99
|
-
const t =
|
|
99
|
+
const t = _(void 0), c = _(null), h = I(() => {
|
|
100
100
|
var o;
|
|
101
101
|
return (o = c.value) == null ? void 0 : o.at(0);
|
|
102
|
-
}), C =
|
|
102
|
+
}), C = _(null), E = I(() => {
|
|
103
103
|
var o;
|
|
104
104
|
return (o = C.value) == null ? void 0 : o.at(0);
|
|
105
|
-
}), p =
|
|
105
|
+
}), p = _(null), x = I(() => {
|
|
106
106
|
var o;
|
|
107
107
|
return (o = p.value) == null ? void 0 : o.at(0);
|
|
108
|
-
}),
|
|
109
|
-
t.value = o,
|
|
108
|
+
}), y = _(""), M = (o) => {
|
|
109
|
+
t.value = o, y.value = o.title, se(() => {
|
|
110
110
|
const v = h.value;
|
|
111
111
|
v && (v.focus(), v.select());
|
|
112
112
|
});
|
|
113
113
|
}, k = () => {
|
|
114
|
-
t.value = void 0,
|
|
115
|
-
},
|
|
116
|
-
t.value && m(
|
|
114
|
+
t.value = void 0, y.value = "";
|
|
115
|
+
}, R = () => {
|
|
116
|
+
t.value && m(y.value, t.value), t.value = void 0, y.value = "";
|
|
117
117
|
};
|
|
118
|
-
return (
|
|
118
|
+
return (s === "confirm" || s === "cancel") && Z(
|
|
119
119
|
h,
|
|
120
120
|
() => {
|
|
121
|
-
|
|
121
|
+
s === "confirm" ? R() : k();
|
|
122
122
|
},
|
|
123
|
-
{ ignore: [E,
|
|
123
|
+
{ ignore: [E, x] }
|
|
124
124
|
), {
|
|
125
125
|
editingItem: t,
|
|
126
126
|
editorRefList: c,
|
|
127
127
|
editorConfirmRefList: C,
|
|
128
128
|
editorCancelRefList: p,
|
|
129
|
-
editorValue:
|
|
129
|
+
editorValue: y,
|
|
130
130
|
handleEdit: M,
|
|
131
131
|
handleEditCancel: k,
|
|
132
|
-
handleEditConfirm:
|
|
132
|
+
handleEditConfirm: R
|
|
133
133
|
};
|
|
134
|
-
},
|
|
134
|
+
}, X = Symbol("NO_GROUP"), $e = {
|
|
135
135
|
key: 0,
|
|
136
136
|
class: "tr-history__group-title"
|
|
137
|
-
}, be = { class: "tr-history__group-items" },
|
|
137
|
+
}, be = { class: "tr-history__group-items" }, Ge = ["onClick"], Oe = ["title"], Se = ["onClick"], Be = /* @__PURE__ */ P({
|
|
138
138
|
__name: "index",
|
|
139
139
|
props: {
|
|
140
140
|
data: {},
|
|
@@ -142,112 +142,118 @@ const Ce = { class: "tr-history__empty" }, ke = { class: "tr-history__empty-icon
|
|
|
142
142
|
showRenameControls: { type: Boolean, default: !1 },
|
|
143
143
|
renameControlOnClickOutside: { default: "confirm" },
|
|
144
144
|
menuItems: { default: () => [
|
|
145
|
-
{ id: "rename", text: "重命名", icon:
|
|
146
|
-
{ id: "delete", text: "删除", icon:
|
|
145
|
+
{ id: "rename", text: "重命名", icon: ce },
|
|
146
|
+
{ id: "delete", text: "删除", icon: de }
|
|
147
147
|
] },
|
|
148
148
|
menuListGap: { default: 8 }
|
|
149
149
|
},
|
|
150
150
|
emits: ["item-click", "item-title-change", "item-action"],
|
|
151
|
-
setup(
|
|
152
|
-
const t =
|
|
151
|
+
setup(s, { emit: m }) {
|
|
152
|
+
const t = s, c = m, h = (i) => {
|
|
153
153
|
var f;
|
|
154
|
-
const e = typeof ((f =
|
|
154
|
+
const e = typeof ((f = i[0]) == null ? void 0 : f.group);
|
|
155
155
|
return e === "string" || e === "symbol";
|
|
156
|
-
}, C =
|
|
157
|
-
const
|
|
158
|
-
return h(
|
|
159
|
-
}), E =
|
|
156
|
+
}, C = I(() => {
|
|
157
|
+
const i = t.data;
|
|
158
|
+
return h(i) ? i : [{ group: X, items: i }];
|
|
159
|
+
}), E = I(() => C.value.length === 0 || C.value.every((i) => i.items.length === 0)), {
|
|
160
160
|
editingItem: p,
|
|
161
|
-
editorRefList:
|
|
162
|
-
editorConfirmRefList:
|
|
161
|
+
editorRefList: x,
|
|
162
|
+
editorConfirmRefList: y,
|
|
163
163
|
editorCancelRefList: M,
|
|
164
164
|
editorValue: k,
|
|
165
|
-
handleEdit:
|
|
165
|
+
handleEdit: R,
|
|
166
166
|
handleEditCancel: o,
|
|
167
167
|
handleEditConfirm: v
|
|
168
|
-
} =
|
|
168
|
+
} = Te({
|
|
169
169
|
renameControlOnClickOutside: t.renameControlOnClickOutside,
|
|
170
|
-
onItemTitleChange: (
|
|
171
|
-
c("item-title-change",
|
|
170
|
+
onItemTitleChange: (i, e) => {
|
|
171
|
+
c("item-title-change", i, e);
|
|
172
172
|
}
|
|
173
|
-
}), { isTouchDevice: L } =
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
|
|
173
|
+
}), { isTouchDevice: L } = Ce(), g = _(null), u = _(null), K = (i, e) => {
|
|
174
|
+
if (i.currentTarget instanceof HTMLButtonElement) {
|
|
175
|
+
if (u.value === e) {
|
|
176
|
+
g.value = null, u.value = null;
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
g.value = i.currentTarget, u.value = e;
|
|
180
180
|
} else
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
const e =
|
|
184
|
-
e && (
|
|
181
|
+
g.value = null, u.value = null;
|
|
182
|
+
}, ee = (i) => {
|
|
183
|
+
const e = u.value;
|
|
184
|
+
e && (i.id === "rename" && R(e), c("item-action", i, e));
|
|
185
185
|
};
|
|
186
|
-
return (
|
|
187
|
-
class:
|
|
186
|
+
return (i, e) => (r(), a("div", {
|
|
187
|
+
class: U(["tr-history", { "touch-device": n(L) }])
|
|
188
188
|
}, [
|
|
189
|
-
E.value ? (
|
|
190
|
-
(
|
|
189
|
+
E.value ? (r(), H(Re, { key: 1 })) : (r(), a(S, { key: 0 }, [
|
|
190
|
+
(r(!0), a(S, null, V(C.value, (f) => (r(), a("div", {
|
|
191
191
|
class: "tr-history__group",
|
|
192
192
|
key: f.group
|
|
193
193
|
}, [
|
|
194
|
-
f.group !== n(
|
|
195
|
-
|
|
196
|
-
(
|
|
197
|
-
class:
|
|
198
|
-
selected:
|
|
199
|
-
editing: n(p) ===
|
|
200
|
-
active:
|
|
194
|
+
f.group !== n(X) ? (r(), a("div", $e, B(f.group), 1)) : G("", !0),
|
|
195
|
+
w("div", be, [
|
|
196
|
+
(r(!0), a(S, null, V(f.items, (l, te) => (r(), a("div", {
|
|
197
|
+
class: U(["tr-history__item", {
|
|
198
|
+
selected: l.id && l.id === t.selected,
|
|
199
|
+
editing: n(p) === l,
|
|
200
|
+
active: u.value === l
|
|
201
201
|
}]),
|
|
202
|
-
key:
|
|
203
|
-
onClick: (d) => c("item-click",
|
|
202
|
+
key: l.id || te,
|
|
203
|
+
onClick: (d) => c("item-click", l)
|
|
204
204
|
}, [
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
A(i.$slots, "item-prefix", { item: l }, void 0, !0),
|
|
206
|
+
l.icon ? (r(), H(Y(l.icon), { key: 0 })) : G("", !0),
|
|
207
|
+
n(p) === l ? q((r(), a("input", {
|
|
208
|
+
key: 1,
|
|
207
209
|
class: "tr-history__item-editor",
|
|
208
210
|
type: "text",
|
|
209
|
-
onClick: e[0] || (e[0] =
|
|
211
|
+
onClick: e[0] || (e[0] = J(() => {
|
|
210
212
|
}, ["stop"])),
|
|
211
213
|
ref_for: !0,
|
|
212
214
|
ref_key: "editorRefList",
|
|
213
|
-
ref:
|
|
214
|
-
"onUpdate:modelValue": e[1] || (e[1] = (d) =>
|
|
215
|
+
ref: x,
|
|
216
|
+
"onUpdate:modelValue": e[1] || (e[1] = (d) => le(k) ? k.value = d : null),
|
|
215
217
|
onKeydown: [
|
|
216
|
-
e[2] || (e[2] =
|
|
218
|
+
e[2] || (e[2] = F(
|
|
217
219
|
//@ts-ignore
|
|
218
220
|
(...d) => n(v) && n(v)(...d),
|
|
219
221
|
["enter"]
|
|
220
222
|
)),
|
|
221
|
-
e[3] || (e[3] =
|
|
223
|
+
e[3] || (e[3] = F(
|
|
222
224
|
//@ts-ignore
|
|
223
225
|
(...d) => n(o) && n(o)(...d),
|
|
224
226
|
["escape"]
|
|
225
227
|
))
|
|
226
228
|
]
|
|
227
229
|
}, null, 544)), [
|
|
228
|
-
[
|
|
229
|
-
]) : (
|
|
230
|
-
key:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
[re, n(k)]
|
|
231
|
+
]) : A(i.$slots, "item-title", {
|
|
232
|
+
key: 2,
|
|
233
|
+
item: l
|
|
234
|
+
}, () => [
|
|
235
|
+
w("span", {
|
|
236
|
+
class: "text",
|
|
237
|
+
title: l.title
|
|
238
|
+
}, B(l.title), 9, Oe)
|
|
239
|
+
], !0),
|
|
240
|
+
w("span", {
|
|
235
241
|
class: "tr-history__item-actions",
|
|
236
|
-
onClick: e[6] || (e[6] =
|
|
242
|
+
onClick: e[6] || (e[6] = J(() => {
|
|
237
243
|
}, ["stop"]))
|
|
238
244
|
}, [
|
|
239
|
-
t.showRenameControls && n(p) ===
|
|
245
|
+
t.showRenameControls && n(p) === l ? (r(), a("button", {
|
|
240
246
|
key: 0,
|
|
241
247
|
class: "editor-confirm",
|
|
242
248
|
ref_for: !0,
|
|
243
249
|
ref_key: "editorConfirmRefList",
|
|
244
|
-
ref:
|
|
250
|
+
ref: y,
|
|
245
251
|
onClick: e[4] || (e[4] = //@ts-ignore
|
|
246
252
|
(...d) => n(v) && n(v)(...d))
|
|
247
253
|
}, [
|
|
248
|
-
|
|
249
|
-
], 512)) :
|
|
250
|
-
t.showRenameControls && n(p) ===
|
|
254
|
+
$(n(me))
|
|
255
|
+
], 512)) : G("", !0),
|
|
256
|
+
t.showRenameControls && n(p) === l ? (r(), a("button", {
|
|
251
257
|
key: 1,
|
|
252
258
|
class: "editor-cancel",
|
|
253
259
|
ref_for: !0,
|
|
@@ -256,40 +262,40 @@ const Ce = { class: "tr-history__empty" }, ke = { class: "tr-history__empty-icon
|
|
|
256
262
|
onClick: e[5] || (e[5] = //@ts-ignore
|
|
257
263
|
(...d) => n(o) && n(o)(...d))
|
|
258
264
|
}, [
|
|
259
|
-
|
|
260
|
-
], 512)) :
|
|
261
|
-
|
|
262
|
-
class:
|
|
263
|
-
onClick: (d) =>
|
|
265
|
+
$(n(fe))
|
|
266
|
+
], 512)) : G("", !0),
|
|
267
|
+
w("button", {
|
|
268
|
+
class: U(["menu", { hidden: n(p) === l }]),
|
|
269
|
+
onClick: (d) => K(d, l)
|
|
264
270
|
}, [
|
|
265
|
-
|
|
266
|
-
], 10,
|
|
271
|
+
$(n(pe))
|
|
272
|
+
], 10, Se)
|
|
267
273
|
])
|
|
268
|
-
], 10,
|
|
274
|
+
], 10, Ge))), 128))
|
|
269
275
|
])
|
|
270
276
|
]))), 128)),
|
|
271
|
-
|
|
272
|
-
trigger:
|
|
273
|
-
"onUpdate:trigger": e[7] || (e[7] = (f) =>
|
|
274
|
-
data:
|
|
275
|
-
"onUpdate:data": e[8] || (e[8] = (f) =>
|
|
277
|
+
q($(Me, {
|
|
278
|
+
trigger: g.value,
|
|
279
|
+
"onUpdate:trigger": e[7] || (e[7] = (f) => g.value = f),
|
|
280
|
+
data: u.value,
|
|
281
|
+
"onUpdate:data": e[8] || (e[8] = (f) => u.value = f),
|
|
276
282
|
items: t.menuItems,
|
|
277
283
|
"menu-list-gap": t.menuListGap,
|
|
278
|
-
onItemClick:
|
|
284
|
+
onItemClick: ee
|
|
279
285
|
}, null, 8, ["trigger", "data", "items", "menu-list-gap"]), [
|
|
280
|
-
[
|
|
286
|
+
[ae, g.value]
|
|
281
287
|
])
|
|
282
288
|
], 64))
|
|
283
289
|
], 2));
|
|
284
290
|
}
|
|
285
|
-
}),
|
|
286
|
-
|
|
291
|
+
}), N = /* @__PURE__ */ z(Be, [["__scopeId", "data-v-97a7e8a2"]]), De = function(s) {
|
|
292
|
+
s.component(N.name, N);
|
|
287
293
|
};
|
|
288
|
-
Object.assign(
|
|
294
|
+
Object.assign(N, {
|
|
289
295
|
name: "TrHistory",
|
|
290
296
|
install: De
|
|
291
297
|
});
|
|
292
298
|
export {
|
|
293
|
-
H,
|
|
294
|
-
|
|
299
|
+
N as H,
|
|
300
|
+
Ce as u
|
|
295
301
|
};
|
package/dist/index4.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { onMounted as U, nextTick as B, h as C, defineComponent as
|
|
1
|
+
import { onMounted as U, nextTick as B, h as C, defineComponent as b, render as R, onBeforeUnmount as D, Teleport as W, computed as h, ref as E, createBlock as F, openBlock as g, 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
2
|
import { b as oe, a as re, d as ne } from "./index3.js";
|
|
3
3
|
import { t as u } from "./utils.js";
|
|
4
4
|
import { _ as N } from "./_plugin-vue_export-helper.js";
|
|
5
5
|
import { u as se } from "./useSlotRefs.js";
|
|
6
|
-
const pe =
|
|
6
|
+
const pe = b({
|
|
7
7
|
setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
|
|
8
8
|
props: ["propsFactory", "vnodeFactory"]
|
|
9
9
|
});
|
|
@@ -34,7 +34,7 @@ function ce(r, n) {
|
|
|
34
34
|
return d;
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
const ie = /* @__PURE__ */
|
|
37
|
+
const ie = /* @__PURE__ */ b({
|
|
38
38
|
__name: "Popper",
|
|
39
39
|
props: {
|
|
40
40
|
show: { type: Boolean },
|
|
@@ -44,9 +44,9 @@ const ie = /* @__PURE__ */ g({
|
|
|
44
44
|
const e = E(null);
|
|
45
45
|
return n({
|
|
46
46
|
popperRef: e
|
|
47
|
-
}), (t, s) => (
|
|
47
|
+
}), (t, s) => (g(), F(j, q(L(r.transitionProps)), {
|
|
48
48
|
default: Z(() => [
|
|
49
|
-
|
|
49
|
+
r.show ? (g(), G("div", {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "tr-base-popper",
|
|
52
52
|
ref_key: "popperRef",
|
|
@@ -58,7 +58,7 @@ const ie = /* @__PURE__ */ g({
|
|
|
58
58
|
_: 3
|
|
59
59
|
}, 16));
|
|
60
60
|
}
|
|
61
|
-
}), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */
|
|
61
|
+
}), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ b({
|
|
62
62
|
inheritAttrs: !1,
|
|
63
63
|
__name: "index",
|
|
64
64
|
props: {
|
|
@@ -88,7 +88,7 @@ const ie = /* @__PURE__ */ g({
|
|
|
88
88
|
for (const [c, a] of Object.entries(o))
|
|
89
89
|
/^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
|
|
90
90
|
return p;
|
|
91
|
-
}, f = E(null),
|
|
91
|
+
}, f = E(null), _ = h(() => {
|
|
92
92
|
var o;
|
|
93
93
|
return ((o = f.value) == null ? void 0 : o.popperRef) || null;
|
|
94
94
|
}), m = h(() => {
|
|
@@ -108,23 +108,23 @@ const ie = /* @__PURE__ */ g({
|
|
|
108
108
|
width: z,
|
|
109
109
|
update: A
|
|
110
110
|
} = re(i), {
|
|
111
|
-
width:
|
|
111
|
+
width: x,
|
|
112
112
|
height: P
|
|
113
|
-
} = ne(
|
|
113
|
+
} = ne(_, void 0, {
|
|
114
114
|
box: "border-box"
|
|
115
115
|
}), H = h(() => {
|
|
116
116
|
const {
|
|
117
117
|
placement: o,
|
|
118
118
|
preventOverflow: p
|
|
119
|
-
} = e, c = {}, a = (l,
|
|
119
|
+
} = e, c = {}, a = (l, y) => {
|
|
120
120
|
if (!p) {
|
|
121
|
-
c[l] =
|
|
121
|
+
c[l] = y;
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
const T = u(l === "top" ? P.value :
|
|
125
|
-
l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${
|
|
124
|
+
const T = u(l === "top" ? P.value : x.value);
|
|
125
|
+
l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${y}, calc(var(--tr-base-popper-max-bottom) - ${T}))` : l === "left" && (c[l] = `clamp(var(--tr-base-popper-min-left), ${y}, calc(var(--tr-base-popper-max-right) - ${T}))`);
|
|
126
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 -
|
|
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 - x.value + m.value.crossAxis)), o.includes("center") && a("left", u(w.value + z.value / 2 - x.value / 2 + m.value.crossAxis)), c;
|
|
128
128
|
});
|
|
129
129
|
X(() => e.show, (o) => {
|
|
130
130
|
o && A();
|
|
@@ -146,9 +146,9 @@ const ie = /* @__PURE__ */ g({
|
|
|
146
146
|
}
|
|
147
147
|
})), n({
|
|
148
148
|
triggerRef: i,
|
|
149
|
-
popperRef:
|
|
149
|
+
popperRef: _,
|
|
150
150
|
update: A
|
|
151
|
-
}), (o, p) => (
|
|
151
|
+
}), (o, p) => (g(), F(ee(S(s)[0]), k({
|
|
152
152
|
ref: S(d)
|
|
153
153
|
}, v(e.triggerEvents)), null, 16));
|
|
154
154
|
}
|