@opentiny/tiny-robot 0.5.2-alpha.10 → 0.5.2-alpha.15
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/dropdown-menu/index.js +1 -1
- package/dist/extension-manager/index.js +473 -0
- package/dist/floating-ui.dom.js +970 -0
- package/dist/index.d.ts +556 -141
- package/dist/index.js +104 -93
- package/dist/index4.js +2 -2
- package/dist/index6.js +1 -1
- package/dist/index8.js +87 -102
- package/dist/layout/index.js +1 -1
- package/dist/model-selector/index.js +1009 -0
- package/dist/sender/index.js +1127 -2060
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +37 -36
- package/dist/useSlotRefs.js +1 -1
- package/dist/useTeleportTarget.js +25 -0
- package/dist/utils.js +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { B
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
1
|
+
import x from "./attachments/index.js";
|
|
2
|
+
import { B, a as E, b as F } from "./index6.js";
|
|
3
|
+
import { c as je, d as He, u as $e, e as We, f as we, g as ke, h as Ne, i as Ve, j as Ge, k as Ie } from "./index6.js";
|
|
4
|
+
import b from "./container/index.js";
|
|
5
5
|
import C from "./anchor/index.js";
|
|
6
6
|
import z from "./conversations/index.js";
|
|
7
7
|
import y from "./drag-overlay/index.js";
|
|
8
8
|
import L from "./dropdown-menu/index.js";
|
|
9
9
|
import P from "./feedback/index.js";
|
|
10
10
|
import { H as A } from "./index7.js";
|
|
11
|
-
import { u as
|
|
12
|
-
import
|
|
13
|
-
import { Layout as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import w from "./sender
|
|
17
|
-
import k
|
|
18
|
-
import V from "./suggestion-
|
|
11
|
+
import { u as Ke } from "./index7.js";
|
|
12
|
+
import M from "./icon-button/index.js";
|
|
13
|
+
import { Layout as O, LayoutProxyScrollbar as R, LayoutAsideToggle as j } from "./layout/index.js";
|
|
14
|
+
import H from "./model-selector/index.js";
|
|
15
|
+
import { Prompt as $, Prompts as W } from "./prompts/index.js";
|
|
16
|
+
import w from "./sender/index.js";
|
|
17
|
+
import k from "./sender-compat/index.js";
|
|
18
|
+
import N, { SuggestionPillButton as V } from "./suggestion-pills/index.js";
|
|
19
|
+
import G from "./suggestion-popover/index.js";
|
|
19
20
|
import I from "./theme-provider/index.js";
|
|
20
|
-
import { useTheme as
|
|
21
|
+
import { useTheme as Ye } from "./theme-provider/index.js";
|
|
21
22
|
import U from "./welcome/index.js";
|
|
22
23
|
import K from "./mcp-server-picker/index.js";
|
|
23
24
|
import X from "./mcp-add-form/index.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
25
|
+
import { ExtensionCard as Y, ExtensionCardGrid as q } from "./extension-manager/index.js";
|
|
26
|
+
import { u as Je } from "./useSenderContentRegistration.js";
|
|
27
|
+
import { A as J, S as Q, _ as Z, W as ee, D as re } from "./index2.js";
|
|
28
|
+
import { a as Ze, u as er } from "./index2.js";
|
|
29
|
+
import { _ as oe, V as te } from "./index3.js";
|
|
28
30
|
var u = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(u || {});
|
|
29
|
-
function
|
|
31
|
+
function ae(e, r) {
|
|
30
32
|
if (!r) return !0;
|
|
31
33
|
const t = r.split(",").map((o) => o.trim());
|
|
32
34
|
return t.includes("*") ? !0 : t.some((o) => {
|
|
@@ -42,12 +44,12 @@ function re(e, r) {
|
|
|
42
44
|
function v(e, r) {
|
|
43
45
|
return e.size <= r;
|
|
44
46
|
}
|
|
45
|
-
function
|
|
47
|
+
function ne(e, r) {
|
|
46
48
|
return e.length <= r;
|
|
47
49
|
}
|
|
48
|
-
function
|
|
50
|
+
function se(e, r) {
|
|
49
51
|
const { accept: t, multiple: o, maxSize: n, maxFiles: l } = r, a = [], s = [];
|
|
50
|
-
if (!
|
|
52
|
+
if (!ne(e, l))
|
|
51
53
|
return {
|
|
52
54
|
acceptedFiles: a,
|
|
53
55
|
rejectedFiles: Array.from(e),
|
|
@@ -57,7 +59,7 @@ function te(e, r) {
|
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
if (e.forEach((i) => {
|
|
60
|
-
|
|
62
|
+
ae(i, t) && v(i, n) ? a.push(i) : s.push(i);
|
|
61
63
|
}), !o && a.length > 1)
|
|
62
64
|
return {
|
|
63
65
|
acceptedFiles: [],
|
|
@@ -88,7 +90,7 @@ function T(e) {
|
|
|
88
90
|
disabled: e.disabled || !1
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
|
-
const
|
|
93
|
+
const Ae = {
|
|
92
94
|
/**
|
|
93
95
|
* 挂载指令
|
|
94
96
|
* @param el 元素
|
|
@@ -128,13 +130,13 @@ const Ce = {
|
|
|
128
130
|
a.preventDefault(), t = 0, n(!1, null);
|
|
129
131
|
const s = (p = a.dataTransfer) == null ? void 0 : p.files, { onDrop: i, onError: d, accept: m, multiple: c, maxSize: g, maxFiles: D } = e.__vDropzoneOptions__;
|
|
130
132
|
if (s && s.length > 0) {
|
|
131
|
-
const h = Array.from(s), { acceptedFiles: f, rejectedFiles:
|
|
133
|
+
const h = Array.from(s), { acceptedFiles: f, rejectedFiles: S, rejectionReason: _ } = se(h, {
|
|
132
134
|
accept: m,
|
|
133
135
|
multiple: c,
|
|
134
136
|
maxSize: g,
|
|
135
137
|
maxFiles: D
|
|
136
138
|
});
|
|
137
|
-
_ && d({ files:
|
|
139
|
+
_ && d({ files: S, ..._ }), f.length > 0 && i(f);
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
};
|
|
@@ -150,130 +152,139 @@ const Ce = {
|
|
|
150
152
|
unmounted(e) {
|
|
151
153
|
e.__vDropzoneHandlers__ && (e.removeEventListener("dragenter", e.__vDropzoneHandlers__.handleDragEnter), e.removeEventListener("dragover", e.__vDropzoneHandlers__.handleDragOver), e.removeEventListener("dragleave", e.__vDropzoneHandlers__.handleDragLeave), e.removeEventListener("drop", e.__vDropzoneHandlers__.handleDrop), delete e.__vDropzoneHandlers__), delete e.__vDropzoneOptions__;
|
|
152
154
|
}
|
|
153
|
-
},
|
|
154
|
-
S,
|
|
155
|
-
F,
|
|
156
|
-
b,
|
|
155
|
+
}, ie = [
|
|
157
156
|
x,
|
|
157
|
+
B,
|
|
158
158
|
E,
|
|
159
|
+
F,
|
|
160
|
+
b,
|
|
159
161
|
C,
|
|
160
162
|
z,
|
|
161
163
|
y,
|
|
162
164
|
L,
|
|
163
165
|
P,
|
|
164
166
|
A,
|
|
165
|
-
O,
|
|
166
167
|
M,
|
|
168
|
+
O,
|
|
167
169
|
R,
|
|
168
170
|
j,
|
|
169
171
|
H,
|
|
170
|
-
W,
|
|
171
172
|
$,
|
|
173
|
+
W,
|
|
172
174
|
w,
|
|
173
175
|
k,
|
|
174
176
|
N,
|
|
175
177
|
V,
|
|
178
|
+
G,
|
|
176
179
|
I,
|
|
177
180
|
U,
|
|
178
181
|
K,
|
|
179
182
|
X,
|
|
180
183
|
Y,
|
|
181
184
|
q,
|
|
182
|
-
|
|
185
|
+
J,
|
|
186
|
+
Q,
|
|
183
187
|
Z,
|
|
188
|
+
oe,
|
|
189
|
+
te,
|
|
184
190
|
ee,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
], ze = {
|
|
191
|
+
re
|
|
192
|
+
], Me = {
|
|
188
193
|
install(e) {
|
|
189
|
-
|
|
194
|
+
ie.forEach((r) => {
|
|
190
195
|
const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
191
196
|
e.component(`Tr${t}`, r);
|
|
192
197
|
});
|
|
193
198
|
}
|
|
194
199
|
};
|
|
195
200
|
export {
|
|
196
|
-
|
|
201
|
+
J as ActionButton,
|
|
197
202
|
C as Anchor,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
x as Attachments,
|
|
204
|
+
B as Bubble,
|
|
205
|
+
E as BubbleList,
|
|
206
|
+
F as BubbleProvider,
|
|
207
|
+
je as BubbleRendererMatchPriority,
|
|
208
|
+
He as BubbleRenderers,
|
|
209
|
+
Z as ClearButton,
|
|
210
|
+
b as Container,
|
|
206
211
|
z as Conversations,
|
|
207
|
-
|
|
212
|
+
re as DefaultActionButtons,
|
|
208
213
|
y as DragOverlay,
|
|
209
214
|
L as DropdownMenu,
|
|
215
|
+
Y as ExtensionCard,
|
|
216
|
+
q as ExtensionCardGrid,
|
|
210
217
|
P as Feedback,
|
|
211
218
|
A as History,
|
|
212
|
-
|
|
213
|
-
|
|
219
|
+
M as IconButton,
|
|
220
|
+
O as Layout,
|
|
214
221
|
j as LayoutAsideToggle,
|
|
215
222
|
R as LayoutProxyScrollbar,
|
|
216
223
|
X as McpAddForm,
|
|
217
224
|
K as McpServerPicker,
|
|
218
|
-
H as
|
|
225
|
+
H as ModelSelector,
|
|
226
|
+
$ as Prompt,
|
|
219
227
|
W as Prompts,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
Ze as SENDER_CONTEXT_KEY,
|
|
229
|
+
w as Sender,
|
|
230
|
+
k as SenderCompat,
|
|
231
|
+
Q as SubmitButton,
|
|
232
|
+
V as SuggestionPillButton,
|
|
233
|
+
N as SuggestionPills,
|
|
234
|
+
G as SuggestionPopover,
|
|
227
235
|
I as ThemeProvider,
|
|
228
|
-
|
|
236
|
+
J as TrActionButton,
|
|
229
237
|
C as TrAnchor,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
238
|
+
x as TrAttachments,
|
|
239
|
+
B as TrBubble,
|
|
240
|
+
E as TrBubbleList,
|
|
241
|
+
F as TrBubbleProvider,
|
|
242
|
+
Z as TrClearButton,
|
|
243
|
+
b as TrContainer,
|
|
236
244
|
z as TrConversations,
|
|
237
|
-
|
|
245
|
+
re as TrDefaultActionButtons,
|
|
238
246
|
y as TrDragOverlay,
|
|
239
247
|
L as TrDropdownMenu,
|
|
248
|
+
Y as TrExtensionCard,
|
|
249
|
+
q as TrExtensionCardGrid,
|
|
240
250
|
P as TrFeedback,
|
|
241
251
|
A as TrHistory,
|
|
242
|
-
|
|
243
|
-
|
|
252
|
+
M as TrIconButton,
|
|
253
|
+
O as TrLayout,
|
|
244
254
|
j as TrLayoutAsideToggle,
|
|
245
255
|
R as TrLayoutProxyScrollbar,
|
|
246
256
|
X as TrMcpAddForm,
|
|
247
257
|
K as TrMcpServerPicker,
|
|
248
|
-
H as
|
|
258
|
+
H as TrModelSelector,
|
|
259
|
+
$ as TrPrompt,
|
|
249
260
|
W as TrPrompts,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
261
|
+
w as TrSender,
|
|
262
|
+
k as TrSenderCompat,
|
|
263
|
+
Q as TrSubmitButton,
|
|
264
|
+
V as TrSuggestionPillButton,
|
|
265
|
+
N as TrSuggestionPills,
|
|
266
|
+
G as TrSuggestionPopover,
|
|
256
267
|
I as TrThemeProvider,
|
|
257
|
-
|
|
258
|
-
|
|
268
|
+
oe as TrUploadButton,
|
|
269
|
+
te as TrVoiceButton,
|
|
259
270
|
U as TrWelcome,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
271
|
+
ee as TrWordCounter,
|
|
272
|
+
oe as UploadButton,
|
|
273
|
+
te as VoiceButton,
|
|
263
274
|
U as Welcome,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
275
|
+
ee as WordCounter,
|
|
276
|
+
Me as default,
|
|
277
|
+
$e as useAutoScroll,
|
|
278
|
+
We as useBubbleBoxRenderer,
|
|
279
|
+
we as useBubbleContentRenderer,
|
|
280
|
+
ke as useBubbleEventFn,
|
|
281
|
+
Ne as useBubbleStateChangeFn,
|
|
282
|
+
Ve as useMessageContent,
|
|
283
|
+
Ge as useOmitMessageFields,
|
|
284
|
+
Je as useSenderContentRegistration,
|
|
285
|
+
er as useSenderContext,
|
|
286
|
+
Ye as useTheme,
|
|
287
|
+
Ie as useToolCall,
|
|
288
|
+
Ke as useTouchDevice,
|
|
289
|
+
Ae as vDropzone
|
|
279
290
|
};
|
package/dist/index4.js
CHANGED
|
@@ -814,7 +814,7 @@ function lt(e = {}) {
|
|
|
814
814
|
return { width: r, height: s };
|
|
815
815
|
}
|
|
816
816
|
export {
|
|
817
|
-
|
|
817
|
+
rt as a,
|
|
818
818
|
lt as b,
|
|
819
819
|
tt as c,
|
|
820
820
|
et as d,
|
|
@@ -831,6 +831,6 @@ export {
|
|
|
831
831
|
Je as o,
|
|
832
832
|
Ke as p,
|
|
833
833
|
B as t,
|
|
834
|
-
|
|
834
|
+
x as u,
|
|
835
835
|
qe as w
|
|
836
836
|
};
|
package/dist/index6.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as M, watch as U, toValue as k, onMounted as xe, onUnmounted as We, nextTick as te, defineComponent as I, openBlock as v, createElementBlock as E, renderSlot as C, computed as x, unref as R, normalizeClass as G, createVNode as V, onBeforeUnmount as Ve, Fragment as D, createElementVNode as B, mergeProps as w, toDisplayString as z, withDirectives as Q, vShow as ee, createBlock as A, resolveDynamicComponent as J, normalizeProps as P, guardReactiveProps as H, createCommentVNode as ae, watchEffect as ne, useCssModule as ze, renderList as W, markRaw as F, inject as T, provide as L, reactive as Xe, readonly as qe, withCtx as $ } from "vue";
|
|
2
2
|
import { _ as O } from "./_plugin-vue_export-helper.js";
|
|
3
3
|
import { IconLoading as Be, IconAtom as Ze, IconArrowDown as Re, IconPlugin as me, IconError as Qe, IconCancelled as et } from "@opentiny/tiny-robot-svgs";
|
|
4
|
-
import { l as tt, w as nt, g as ot,
|
|
4
|
+
import { l as tt, w as nt, g as ot, u as st } from "./index4.js";
|
|
5
5
|
function _e(t, e) {
|
|
6
6
|
const n = U(t, (o, l) => {
|
|
7
7
|
l === !0 && o === !1 && (e(), n());
|
package/dist/index8.js
CHANGED
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { _ as
|
|
1
|
+
import { onMounted as W, nextTick as P, h as k, render as B, onBeforeUnmount as j, defineComponent as h, Teleport as D, ref as E, openBlock as x, createBlock as C, Transition as M, normalizeProps as Z, guardReactiveProps as q, withCtx as G, createElementBlock as J, renderSlot as K, createCommentVNode as L, useSlots as Q, computed as d, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as T, mergeProps as R, createVNode as te } from "vue";
|
|
2
|
+
import { d as oe, c as re } from "./index4.js";
|
|
3
|
+
import { t as l } from "./utils.js";
|
|
4
|
+
import { _ as F } from "./_plugin-vue_export-helper.js";
|
|
5
5
|
import { u as se } from "./useSlotRefs.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { u as ne } from "./useTeleportTarget.js";
|
|
7
|
+
const pe = h({
|
|
8
|
+
setup: (r) => () => k(D, r.propsFactory(), r.vnodeFactory()),
|
|
8
9
|
props: ["propsFactory", "vnodeFactory"]
|
|
9
10
|
});
|
|
10
|
-
function ae(r,
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
function ae(r, i) {
|
|
12
|
+
let t = null, o = null, c = !1;
|
|
13
|
+
W(() => {
|
|
14
|
+
P(() => {
|
|
15
|
+
c || (o = document.createElement("div"), t = k(pe, { propsFactory: r, vnodeFactory: i }), B(t, o));
|
|
15
16
|
});
|
|
16
|
-
}),
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
}), j(() => {
|
|
18
|
+
c = !0, P(() => {
|
|
19
|
+
o && (B(null, o), o.remove(), t = null, o = null);
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
|
-
|
|
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__ */ _({
|
|
23
|
+
const le = /* @__PURE__ */ h({
|
|
38
24
|
__name: "Popper",
|
|
39
25
|
props: {
|
|
40
26
|
show: { type: Boolean },
|
|
41
27
|
transitionProps: {}
|
|
42
28
|
},
|
|
43
|
-
setup(r, { expose:
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
popperRef:
|
|
47
|
-
}), (
|
|
48
|
-
default:
|
|
49
|
-
r.show ? (
|
|
29
|
+
setup(r, { expose: i }) {
|
|
30
|
+
const t = E(null);
|
|
31
|
+
return i({
|
|
32
|
+
popperRef: t
|
|
33
|
+
}), (o, c) => (x(), C(M, Z(q(r.transitionProps)), {
|
|
34
|
+
default: G(() => [
|
|
35
|
+
r.show ? (x(), J("div", {
|
|
50
36
|
key: 0,
|
|
51
37
|
class: "tr-base-popper",
|
|
52
38
|
ref_key: "popperRef",
|
|
53
|
-
ref:
|
|
39
|
+
ref: t
|
|
54
40
|
}, [
|
|
55
|
-
|
|
56
|
-
], 512)) :
|
|
41
|
+
K(o.$slots, "default", {}, void 0, !0)
|
|
42
|
+
], 512)) : L("", !0)
|
|
57
43
|
]),
|
|
58
44
|
_: 3
|
|
59
45
|
}, 16));
|
|
60
46
|
}
|
|
61
|
-
}),
|
|
47
|
+
}), ie = /* @__PURE__ */ F(le, [["__scopeId", "data-v-25c13ab7"]]), ce = /* @__PURE__ */ h({
|
|
62
48
|
inheritAttrs: !1,
|
|
63
49
|
__name: "index",
|
|
64
50
|
props: {
|
|
@@ -77,85 +63,84 @@ const ie = /* @__PURE__ */ _({
|
|
|
77
63
|
triggerEvents: {}
|
|
78
64
|
},
|
|
79
65
|
setup(r, {
|
|
80
|
-
expose:
|
|
66
|
+
expose: i
|
|
81
67
|
}) {
|
|
82
|
-
const
|
|
83
|
-
vnodes:
|
|
84
|
-
ref:
|
|
85
|
-
setRef:
|
|
86
|
-
} = se(
|
|
87
|
-
const
|
|
88
|
-
for (const [
|
|
89
|
-
/^on[A-Z]/.test(
|
|
90
|
-
return
|
|
91
|
-
},
|
|
92
|
-
var
|
|
93
|
-
return ((
|
|
94
|
-
}),
|
|
95
|
-
var
|
|
96
|
-
return typeof
|
|
97
|
-
mainAxis:
|
|
68
|
+
const t = r, o = Q(), {
|
|
69
|
+
vnodes: c,
|
|
70
|
+
ref: f,
|
|
71
|
+
setRef: $
|
|
72
|
+
} = se(o.trigger), S = (e = {}) => {
|
|
73
|
+
const s = {};
|
|
74
|
+
for (const [p, n] of Object.entries(e))
|
|
75
|
+
/^on[A-Z]/.test(p) && typeof n == "function" && (s[p] = n);
|
|
76
|
+
return s;
|
|
77
|
+
}, g = E(null), y = d(() => {
|
|
78
|
+
var e;
|
|
79
|
+
return ((e = g.value) == null ? void 0 : e.popperRef) || null;
|
|
80
|
+
}), u = d(() => {
|
|
81
|
+
var e, s;
|
|
82
|
+
return typeof t.offset == "number" ? {
|
|
83
|
+
mainAxis: t.offset,
|
|
98
84
|
crossAxis: 0
|
|
99
85
|
} : {
|
|
100
|
-
mainAxis: ((
|
|
101
|
-
crossAxis: ((
|
|
86
|
+
mainAxis: ((e = t.offset) == null ? void 0 : e.mainAxis) ?? 0,
|
|
87
|
+
crossAxis: ((s = t.offset) == null ? void 0 : s.crossAxis) ?? 0
|
|
102
88
|
};
|
|
103
89
|
}), {
|
|
104
|
-
top:
|
|
90
|
+
top: V,
|
|
105
91
|
bottom: O,
|
|
106
|
-
left:
|
|
107
|
-
right:
|
|
108
|
-
width:
|
|
109
|
-
update:
|
|
110
|
-
} =
|
|
111
|
-
width:
|
|
112
|
-
height:
|
|
113
|
-
} =
|
|
92
|
+
left: _,
|
|
93
|
+
right: z,
|
|
94
|
+
width: I,
|
|
95
|
+
update: b
|
|
96
|
+
} = oe(f), {
|
|
97
|
+
width: m,
|
|
98
|
+
height: A
|
|
99
|
+
} = re(y, void 0, {
|
|
114
100
|
box: "border-box"
|
|
115
|
-
}),
|
|
101
|
+
}), N = d(() => {
|
|
116
102
|
const {
|
|
117
|
-
placement:
|
|
118
|
-
preventOverflow:
|
|
119
|
-
} =
|
|
120
|
-
if (!
|
|
121
|
-
|
|
103
|
+
placement: e,
|
|
104
|
+
preventOverflow: s
|
|
105
|
+
} = t, p = {}, n = (a, v) => {
|
|
106
|
+
if (!s) {
|
|
107
|
+
p[a] = v;
|
|
122
108
|
return;
|
|
123
109
|
}
|
|
124
|
-
const
|
|
125
|
-
|
|
110
|
+
const w = l(a === "top" ? A.value : m.value);
|
|
111
|
+
a === "top" ? p[a] = `clamp(var(--tr-base-popper-min-top), ${v}, calc(var(--tr-base-popper-max-bottom) - ${w}))` : a === "left" && (p[a] = `clamp(var(--tr-base-popper-min-left), ${v}, calc(var(--tr-base-popper-max-right) - ${w}))`);
|
|
126
112
|
};
|
|
127
|
-
return
|
|
113
|
+
return e.includes("top") && n("top", l(V.value - A.value - u.value.mainAxis)), e.includes("bottom") && n("top", l(O.value + u.value.mainAxis)), e.includes("left") && n("left", l(_.value + u.value.crossAxis)), e.includes("right") && n("left", l(z.value - m.value + u.value.crossAxis)), e.includes("center") && n("left", l(_.value + I.value / 2 - m.value / 2 + u.value.crossAxis)), p;
|
|
128
114
|
});
|
|
129
|
-
X(() =>
|
|
130
|
-
|
|
115
|
+
X(() => t.show, (e) => {
|
|
116
|
+
e && b();
|
|
131
117
|
}, {
|
|
132
118
|
flush: "post"
|
|
133
119
|
});
|
|
134
|
-
const
|
|
120
|
+
const U = ne(f, t.appendTo), H = Y();
|
|
135
121
|
return ae(() => ({
|
|
136
|
-
to:
|
|
137
|
-
}), () => te(
|
|
138
|
-
ref:
|
|
139
|
-
show:
|
|
140
|
-
transitionProps:
|
|
141
|
-
style:
|
|
142
|
-
},
|
|
122
|
+
to: U.value
|
|
123
|
+
}), () => te(ie, R({
|
|
124
|
+
ref: g,
|
|
125
|
+
show: t.show,
|
|
126
|
+
transitionProps: t.transitionProps,
|
|
127
|
+
style: N.value
|
|
128
|
+
}, H), {
|
|
143
129
|
default: () => {
|
|
144
|
-
var
|
|
145
|
-
return [(
|
|
130
|
+
var e;
|
|
131
|
+
return [(e = o.content) == null ? void 0 : e.call(o)];
|
|
146
132
|
}
|
|
147
|
-
})),
|
|
148
|
-
triggerRef:
|
|
149
|
-
popperRef:
|
|
150
|
-
update:
|
|
151
|
-
}), (
|
|
152
|
-
ref:
|
|
153
|
-
},
|
|
133
|
+
})), i({
|
|
134
|
+
triggerRef: f,
|
|
135
|
+
popperRef: y,
|
|
136
|
+
update: b
|
|
137
|
+
}), (e, s) => (x(), C(ee(T(c)[0]), R({
|
|
138
|
+
ref: T($)
|
|
139
|
+
}, S(t.triggerEvents)), null, 16));
|
|
154
140
|
}
|
|
155
|
-
}),
|
|
156
|
-
|
|
141
|
+
}), ue = /* @__PURE__ */ F(ce, [["__scopeId", "data-v-f1e25842"]]);
|
|
142
|
+
ue.name = "TrBasePopper";
|
|
157
143
|
export {
|
|
158
|
-
|
|
159
|
-
ae as c
|
|
160
|
-
ce as u
|
|
144
|
+
ue as B,
|
|
145
|
+
ae as c
|
|
161
146
|
};
|
package/dist/layout/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toValue as q, shallowRef as A, computed as c, provide as ke, inject as Pe, defineComponent as k, openBlock as E, createElementBlock as I, normalizeClass as K, createElementVNode as B, ref as te, createBlock as G, createCommentVNode as N, renderSlot as $, Fragment as Me, renderList as Ne, useAttrs as $e, watch as _e, Teleport as Be, mergeProps as Ye, unref as Z, createVNode as Xe, useSlots as Ve, isRef as Ge, normalizeStyle as be, withCtx as pe, normalizeProps as Ue, guardReactiveProps as qe, createTextVNode as Ze, toDisplayString as je, onBeforeUnmount as Ke } from "vue";
|
|
2
|
-
import { g as V, t as Je, m as Qe, b as et,
|
|
2
|
+
import { g as V, t as Je, m as Qe, b as et, u as tt, j as Se, n as nt } from "../index4.js";
|
|
3
3
|
import { _ as Y } from "../_plugin-vue_export-helper.js";
|
|
4
4
|
function ze(e) {
|
|
5
5
|
const t = q(e.value) !== void 0, n = A(q(e.defaultValue));
|