@opentiny/tiny-robot 0.4.2-alpha.8 → 0.5.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/index.d.ts +352 -74
- package/dist/index2.js +12 -12
- package/dist/index5.js +290 -244
- package/dist/index7.js +21 -24
- package/dist/layout/index.js +495 -504
- package/dist/sender/index.js +1031 -1053
- package/dist/sender-compat/index.js +38 -38
- package/dist/style.css +1 -1
- package/dist/suggestion-popover/index.js +2 -4
- package/package.json +3 -3
package/dist/layout/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { toValue as q, shallowRef as
|
|
2
|
-
import { g as V, t as
|
|
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, a as tt, j as Se, n as nt } from "../index4.js";
|
|
3
3
|
import { _ as Y } from "../_plugin-vue_export-helper.js";
|
|
4
|
-
function
|
|
5
|
-
const t = q(e.value) !== void 0, n =
|
|
6
|
-
return
|
|
4
|
+
function ze(e) {
|
|
5
|
+
const t = q(e.value) !== void 0, n = A(q(e.defaultValue));
|
|
6
|
+
return c({
|
|
7
7
|
get() {
|
|
8
8
|
return t ? q(e.value) : n.value;
|
|
9
9
|
},
|
|
@@ -13,73 +13,73 @@ function We(e) {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
const n =
|
|
19
|
-
function
|
|
20
|
-
const h = q(t.buttons) ??
|
|
21
|
-
if (!
|
|
16
|
+
const at = [0];
|
|
17
|
+
function We(e, t) {
|
|
18
|
+
const n = A(null), a = A(null), l = A(null), d = A(null);
|
|
19
|
+
function _(u) {
|
|
20
|
+
const h = q(t.buttons) ?? at, r = u.currentTarget instanceof HTMLElement ? u.currentTarget : null;
|
|
21
|
+
if (!r || n.value || q(t.disabled) || !u.isPrimary || !h.includes(u.button))
|
|
22
22
|
return;
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
n.value =
|
|
23
|
+
const m = t.onStart(u);
|
|
24
|
+
if (m) {
|
|
25
|
+
n.value = m, a.value = u.pointerId, l.value = r, d.value = r.ownerDocument.defaultView;
|
|
26
26
|
try {
|
|
27
|
-
|
|
27
|
+
r.setPointerCapture(u.pointerId);
|
|
28
28
|
} catch {
|
|
29
|
-
|
|
29
|
+
s("manual");
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function g(
|
|
34
|
-
var
|
|
33
|
+
function g(u) {
|
|
34
|
+
var r;
|
|
35
35
|
const h = n.value;
|
|
36
|
-
!h ||
|
|
36
|
+
!h || u.pointerId !== a.value || (r = t.onMove) == null || r.call(t, h, u);
|
|
37
37
|
}
|
|
38
|
-
function u
|
|
38
|
+
function s(u, h) {
|
|
39
39
|
var o;
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
40
|
+
const r = n.value;
|
|
41
|
+
if (!r || h && h.pointerId !== a.value)
|
|
42
42
|
return;
|
|
43
|
-
const
|
|
44
|
-
n.value = null, a.value = null, l.value = null,
|
|
43
|
+
const m = a.value, i = l.value;
|
|
44
|
+
n.value = null, a.value = null, l.value = null, d.value = null, i && m !== null && i.hasPointerCapture(m) && i.releasePointerCapture(m), (o = t.onEnd) == null || o.call(t, r, { reason: u, event: h });
|
|
45
45
|
}
|
|
46
|
-
return V(e, "pointerdown",
|
|
47
|
-
|
|
48
|
-
}), V(
|
|
49
|
-
|
|
50
|
-
}),
|
|
51
|
-
|
|
46
|
+
return V(e, "pointerdown", _), V(d, "pointermove", g), V(d, "pointerup", (u) => {
|
|
47
|
+
s("pointerup", u);
|
|
48
|
+
}), V(d, "pointercancel", (u) => {
|
|
49
|
+
s("pointercancel", u);
|
|
50
|
+
}), Je(() => {
|
|
51
|
+
s("scope-dispose");
|
|
52
52
|
}), {
|
|
53
|
-
isDragging:
|
|
54
|
-
cancel: () =>
|
|
53
|
+
isDragging: c(() => n.value !== null),
|
|
54
|
+
cancel: () => s("manual")
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function ae(e) {
|
|
58
58
|
return e === void 0 ? void 0 : `${e}px`;
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
function
|
|
60
|
+
const it = /^(-?(?:\d+|\d*\.\d+))px$/i, lt = /^0(?:\.0+)?$/i;
|
|
61
|
+
function ot(e, t) {
|
|
62
62
|
if (typeof e == "number" && Number.isFinite(e))
|
|
63
63
|
return e;
|
|
64
64
|
if (typeof e != "string" || !e.trim())
|
|
65
65
|
return t;
|
|
66
66
|
const n = e.trim().toLowerCase();
|
|
67
|
-
if (
|
|
67
|
+
if (lt.test(n))
|
|
68
68
|
return 0;
|
|
69
|
-
const a = n.match(
|
|
69
|
+
const a = n.match(it);
|
|
70
70
|
if (a) {
|
|
71
71
|
const l = Number.parseFloat(a[1]);
|
|
72
72
|
return Number.isFinite(l) ? l : t;
|
|
73
73
|
}
|
|
74
74
|
return t;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function De(e, t) {
|
|
77
77
|
return {
|
|
78
78
|
value: e.getPropertyValue(t),
|
|
79
79
|
priority: e.getPropertyPriority(t)
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Te(e, t, n) {
|
|
83
83
|
if (!n.value) {
|
|
84
84
|
e.removeProperty(t);
|
|
85
85
|
return;
|
|
@@ -87,30 +87,30 @@ function Fe(e, t, n) {
|
|
|
87
87
|
e.setProperty(t, n.value, n.priority);
|
|
88
88
|
}
|
|
89
89
|
function we(e, t) {
|
|
90
|
-
const n = e.style, a =
|
|
90
|
+
const n = e.style, a = De(n, "cursor"), l = De(n, "user-select");
|
|
91
91
|
n.setProperty("cursor", t, "important"), n.setProperty("user-select", "none", "important");
|
|
92
|
-
let
|
|
92
|
+
let d = !1;
|
|
93
93
|
return () => {
|
|
94
|
-
|
|
94
|
+
d || (d = !0, Te(n, "cursor", a), Te(n, "user-select", l));
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
function S(e, t, n) {
|
|
98
98
|
return Math.min(Math.max(e, t), n);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
function
|
|
102
|
-
|
|
100
|
+
const Le = Symbol("LayoutContext");
|
|
101
|
+
function rt(e) {
|
|
102
|
+
ke(Le, e);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
const e =
|
|
104
|
+
function Re() {
|
|
105
|
+
const e = Pe(Le, null);
|
|
106
106
|
if (!e)
|
|
107
107
|
throw new Error("[Layout] useLayoutContext must be used within Layout.");
|
|
108
108
|
return e;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
110
|
+
function st(e) {
|
|
111
|
+
return Re()[e];
|
|
112
112
|
}
|
|
113
|
-
const
|
|
113
|
+
const ut = /* @__PURE__ */ k({
|
|
114
114
|
name: "LayoutAsideResizeTrigger",
|
|
115
115
|
__name: "AsideResizeTrigger",
|
|
116
116
|
props: {
|
|
@@ -122,44 +122,44 @@ const ht = /* @__PURE__ */ k({
|
|
|
122
122
|
},
|
|
123
123
|
emits: ["width-change", "aside-resize-start", "aside-resize-end"],
|
|
124
124
|
setup(e, { emit: t }) {
|
|
125
|
-
const n = e, a = t, l =
|
|
125
|
+
const n = e, a = t, l = A(null), { rootEl: d } = Re(), { isDragging: _ } = We(l, {
|
|
126
126
|
onStart: (i) => {
|
|
127
|
-
const o = n.asideEl,
|
|
128
|
-
if (!o || !
|
|
127
|
+
const o = n.asideEl, W = d.value;
|
|
128
|
+
if (!o || !W)
|
|
129
129
|
return null;
|
|
130
|
-
const D =
|
|
130
|
+
const D = s(W, o), T = W.ownerDocument.body, C = W.ownerDocument.defaultView;
|
|
131
131
|
i.preventDefault();
|
|
132
|
-
const
|
|
132
|
+
const L = u(i, D, C, we(T, "col-resize"));
|
|
133
133
|
return a("aside-resize-start", {
|
|
134
134
|
side: n.side,
|
|
135
|
-
expandedWidth:
|
|
136
|
-
}),
|
|
135
|
+
expandedWidth: L.startWidth
|
|
136
|
+
}), L;
|
|
137
137
|
},
|
|
138
138
|
onMove: (i, o) => {
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const W = h(i, o.clientX);
|
|
140
|
+
r(i, W);
|
|
141
141
|
},
|
|
142
142
|
onEnd: (i) => {
|
|
143
|
-
i.frameId !== null && i.view && (i.view.cancelAnimationFrame(i.frameId), i.frameId = null),
|
|
143
|
+
i.frameId !== null && i.view && (i.view.cancelAnimationFrame(i.frameId), i.frameId = null), m(i), i.releaseBodyInteraction(), a("aside-resize-end", {
|
|
144
144
|
side: n.side,
|
|
145
145
|
expandedWidth: i.currentWidth
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
}), g =
|
|
148
|
+
}), g = c(() => [
|
|
149
149
|
`tr-layout__resize-trigger--${n.side}`,
|
|
150
150
|
{
|
|
151
|
-
"is-dragging":
|
|
151
|
+
"is-dragging": _.value
|
|
152
152
|
}
|
|
153
153
|
]);
|
|
154
|
-
function
|
|
155
|
-
const
|
|
154
|
+
function s(i, o) {
|
|
155
|
+
const W = i.getBoundingClientRect(), D = getComputedStyle(i).getPropertyValue("--tr-layout-main-min-width").trim(), T = ot(D, 320), C = o.getBoundingClientRect().width, L = W.width - T - n.oppositeDockWidth;
|
|
156
156
|
return {
|
|
157
|
-
startWidth:
|
|
157
|
+
startWidth: C,
|
|
158
158
|
minWidth: n.minWidth,
|
|
159
|
-
effectiveMax: Math.max(n.minWidth, Math.min(n.maxWidth,
|
|
159
|
+
effectiveMax: Math.max(n.minWidth, Math.min(n.maxWidth, L))
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function u(i, o, W, D) {
|
|
163
163
|
return {
|
|
164
164
|
side: n.side,
|
|
165
165
|
startX: i.clientX,
|
|
@@ -169,26 +169,26 @@ const ht = /* @__PURE__ */ k({
|
|
|
169
169
|
effectiveMax: o.effectiveMax,
|
|
170
170
|
pendingWidth: null,
|
|
171
171
|
frameId: null,
|
|
172
|
-
view:
|
|
172
|
+
view: W,
|
|
173
173
|
releaseBodyInteraction: D
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
function h(i, o) {
|
|
177
|
-
const
|
|
177
|
+
const W = o - i.startX, D = i.side === "left" ? i.startWidth + W : i.startWidth - W;
|
|
178
178
|
return S(D, i.minWidth, i.effectiveMax);
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function r(i, o) {
|
|
181
181
|
if (o !== i.currentWidth) {
|
|
182
182
|
if (i.pendingWidth = o, i.currentWidth = o, !i.view) {
|
|
183
|
-
|
|
183
|
+
m(i);
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
i.frameId === null && (i.frameId = i.view.requestAnimationFrame(() => {
|
|
187
|
-
i.frameId = null,
|
|
187
|
+
i.frameId = null, m(i);
|
|
188
188
|
}));
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function m(i) {
|
|
192
192
|
if (i.pendingWidth === null)
|
|
193
193
|
return;
|
|
194
194
|
const o = i.pendingWidth;
|
|
@@ -206,7 +206,7 @@ const ht = /* @__PURE__ */ k({
|
|
|
206
206
|
}, null, -1)
|
|
207
207
|
])], 2));
|
|
208
208
|
}
|
|
209
|
-
}),
|
|
209
|
+
}), dt = /* @__PURE__ */ Y(ut, [["__scopeId", "data-v-f60b35e1"]]), ct = ["inert"], gt = { class: "tr-layout__aside-mask" }, ft = { class: "tr-layout__aside-body" }, ht = /* @__PURE__ */ k({
|
|
210
210
|
name: "LayoutAsideContent",
|
|
211
211
|
__name: "AsideContent",
|
|
212
212
|
props: {
|
|
@@ -215,7 +215,7 @@ const ht = /* @__PURE__ */ k({
|
|
|
215
215
|
},
|
|
216
216
|
emits: ["width-change", "aside-resize-start", "aside-resize-end"],
|
|
217
217
|
setup(e, { emit: t }) {
|
|
218
|
-
const n =
|
|
218
|
+
const n = te(null), a = e, l = t, d = c(() => [
|
|
219
219
|
`tr-layout__aside--${a.panel.side}`,
|
|
220
220
|
`tr-layout__aside--effect-${a.panel.collapseEffect.value}`,
|
|
221
221
|
{
|
|
@@ -226,38 +226,38 @@ const ht = /* @__PURE__ */ k({
|
|
|
226
226
|
"tr-layout__aside--hidden": a.panel.isHidden.value
|
|
227
227
|
}
|
|
228
228
|
]);
|
|
229
|
-
return (
|
|
229
|
+
return (_, g) => (E(), I("aside", {
|
|
230
230
|
ref_key: "asideRef",
|
|
231
231
|
ref: n,
|
|
232
|
-
class: K(["tr-layout__aside",
|
|
232
|
+
class: K(["tr-layout__aside", d.value]),
|
|
233
233
|
inert: a.panel.isHidden.value || void 0
|
|
234
234
|
}, [
|
|
235
|
-
e.panel.canResize.value ? (E(),
|
|
235
|
+
e.panel.canResize.value ? (E(), G(dt, {
|
|
236
236
|
key: 0,
|
|
237
237
|
side: e.panel.side,
|
|
238
238
|
"aside-el": n.value,
|
|
239
239
|
"min-width": e.panel.minExpandedWidth.value,
|
|
240
240
|
"max-width": e.panel.maxExpandedWidth.value,
|
|
241
241
|
"opposite-dock-width": e.oppositeDockWidth,
|
|
242
|
-
onWidthChange: g[0] || (g[0] = (
|
|
243
|
-
onAsideResizeStart: g[1] || (g[1] = (
|
|
244
|
-
onAsideResizeEnd: g[2] || (g[2] = (
|
|
242
|
+
onWidthChange: g[0] || (g[0] = (s) => l("width-change", s)),
|
|
243
|
+
onAsideResizeStart: g[1] || (g[1] = (s) => l("aside-resize-start", s)),
|
|
244
|
+
onAsideResizeEnd: g[2] || (g[2] = (s) => l("aside-resize-end", s))
|
|
245
245
|
}, null, 8, ["side", "aside-el", "min-width", "max-width", "opposite-dock-width"])) : N("", !0),
|
|
246
|
-
B("div",
|
|
247
|
-
B("div",
|
|
248
|
-
$(
|
|
246
|
+
B("div", gt, [
|
|
247
|
+
B("div", ft, [
|
|
248
|
+
$(_.$slots, "default", {}, void 0, !0)
|
|
249
249
|
])
|
|
250
250
|
])
|
|
251
|
-
], 10,
|
|
251
|
+
], 10, ct));
|
|
252
252
|
}
|
|
253
|
-
}),
|
|
254
|
-
function
|
|
253
|
+
}), Fe = /* @__PURE__ */ Y(ht, [["__scopeId", "data-v-76a70135"]]), ce = 420, ge = 560, j = 0, vt = j, le = 24, mt = 320, pt = 240;
|
|
254
|
+
function yt(e) {
|
|
255
255
|
return (e == null ? void 0 : e.placement) ?? "center";
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function xt(e) {
|
|
258
258
|
return e !== void 0 && "x" in e && "y" in e;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function _t(e, t, n, a, l) {
|
|
261
261
|
switch (e) {
|
|
262
262
|
case "top-left":
|
|
263
263
|
return {
|
|
@@ -287,13 +287,13 @@ function Et(e, t, n, a, l) {
|
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function He(e) {
|
|
291
291
|
return {
|
|
292
292
|
x: (e == null ? void 0 : e.offsetX) ?? le,
|
|
293
293
|
y: (e == null ? void 0 : e.offsetY) ?? le
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function zt(e, t, n) {
|
|
297
297
|
switch (n) {
|
|
298
298
|
case "top-left":
|
|
299
299
|
return {
|
|
@@ -320,11 +320,11 @@ function St(e, t, n) {
|
|
|
320
320
|
return null;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
const n = e.x + e.width / 2, a = e.y + e.height / 2, l = (t.left + t.right) / 2,
|
|
325
|
-
return `${a <=
|
|
323
|
+
function Wt(e, t) {
|
|
324
|
+
const n = e.x + e.width / 2, a = e.y + e.height / 2, l = (t.left + t.right) / 2, d = (t.top + t.bottom) / 2, _ = n <= l ? "left" : "right";
|
|
325
|
+
return `${a <= d ? "top" : "bottom"}-${_}`;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Oe(e, t, n, a) {
|
|
328
328
|
return {
|
|
329
329
|
x: e,
|
|
330
330
|
y: t,
|
|
@@ -332,7 +332,7 @@ function ke(e, t, n, a) {
|
|
|
332
332
|
height: a
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function wt(e = ce + j * 2, t = ge + j * 2, n = j, a = vt) {
|
|
336
336
|
return {
|
|
337
337
|
left: n,
|
|
338
338
|
top: a,
|
|
@@ -340,102 +340,102 @@ function Tt(e = ce + j * 2, t = ge + j * 2, n = j, a = _t) {
|
|
|
340
340
|
bottom: Math.max(a, t - n)
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
const n = Math.max(1, e.right - e.left), a = Math.max(1, e.bottom - e.top), l = S((t == null ? void 0 : t.minWidth) ??
|
|
343
|
+
function ne(e, t) {
|
|
344
|
+
const n = Math.max(1, e.right - e.left), a = Math.max(1, e.bottom - e.top), l = S((t == null ? void 0 : t.minWidth) ?? mt, 1, n), d = S((t == null ? void 0 : t.minHeight) ?? pt, 1, a);
|
|
345
345
|
return {
|
|
346
346
|
minWidth: l,
|
|
347
347
|
maxWidth: S((t == null ? void 0 : t.maxWidth) ?? n, l, n),
|
|
348
|
-
minHeight:
|
|
349
|
-
maxHeight: S((t == null ? void 0 : t.maxHeight) ?? a,
|
|
348
|
+
minHeight: d,
|
|
349
|
+
maxHeight: S((t == null ? void 0 : t.maxHeight) ?? a, d, a)
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function fe(e, t, n =
|
|
353
|
-
const a = S(e.width, n.minWidth, n.maxWidth), l = S(e.height, n.minHeight, n.maxHeight),
|
|
354
|
-
return
|
|
352
|
+
function fe(e, t, n = ne(t)) {
|
|
353
|
+
const a = S(e.width, n.minWidth, n.maxWidth), l = S(e.height, n.minHeight, n.maxHeight), d = Math.max(t.left, t.right - a), _ = Math.max(t.top, t.bottom - l), g = S(e.x, t.left, d), s = S(e.y, t.top, _);
|
|
354
|
+
return Oe(g, s, a, l);
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const l = e.x + e.width,
|
|
358
|
-
let
|
|
356
|
+
function Rt(e, t, n, a = ne(n)) {
|
|
357
|
+
const l = e.x + e.width, d = e.y + e.height, _ = l - n.left, g = d - n.top;
|
|
358
|
+
let s = e.width, u = e.height, h = e.x, r = e.y;
|
|
359
359
|
if (t.includes("w"))
|
|
360
|
-
if (
|
|
361
|
-
const i = Math.min(a.maxWidth,
|
|
362
|
-
|
|
360
|
+
if (_ >= a.minWidth) {
|
|
361
|
+
const i = Math.min(a.maxWidth, _);
|
|
362
|
+
s = S(e.width, a.minWidth, i), h = l - s;
|
|
363
363
|
} else
|
|
364
|
-
|
|
364
|
+
s = a.minWidth, h = n.left;
|
|
365
365
|
else if (t.includes("e")) {
|
|
366
366
|
const i = Math.min(a.maxWidth, Math.max(a.minWidth, n.right - e.x));
|
|
367
|
-
|
|
367
|
+
s = S(e.width, a.minWidth, i), h = e.x;
|
|
368
368
|
}
|
|
369
369
|
if (t.includes("n"))
|
|
370
370
|
if (g >= a.minHeight) {
|
|
371
371
|
const i = Math.min(a.maxHeight, g);
|
|
372
|
-
|
|
372
|
+
u = S(e.height, a.minHeight, i), r = d - u;
|
|
373
373
|
} else
|
|
374
|
-
|
|
374
|
+
u = a.minHeight, r = n.top;
|
|
375
375
|
else if (t.includes("s")) {
|
|
376
376
|
const i = Math.min(a.maxHeight, Math.max(a.minHeight, n.bottom - e.y));
|
|
377
|
-
|
|
377
|
+
u = S(e.height, a.minHeight, i), r = e.y;
|
|
378
378
|
}
|
|
379
|
-
const
|
|
379
|
+
const m = {
|
|
380
380
|
...e,
|
|
381
381
|
x: h,
|
|
382
|
-
y:
|
|
383
|
-
width:
|
|
384
|
-
height:
|
|
382
|
+
y: r,
|
|
383
|
+
width: s,
|
|
384
|
+
height: u
|
|
385
385
|
};
|
|
386
|
-
return fe(
|
|
386
|
+
return fe(m, n, a);
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
const n =
|
|
390
|
-
return
|
|
388
|
+
function Ce(e, t) {
|
|
389
|
+
const n = ne(e, t), a = S((t == null ? void 0 : t.width) ?? ce, n.minWidth, n.maxWidth), l = S((t == null ? void 0 : t.height) ?? ge, n.minHeight, n.maxHeight), d = yt(t), _ = He(t), g = _t(d, e, a, l, _);
|
|
390
|
+
return Oe(g.x, g.y, a, l);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return e ?
|
|
392
|
+
function Et(e, t) {
|
|
393
|
+
return e ? xt(e) ? fe(e, t) : Ce(t, e) : Ce(t);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
const l =
|
|
395
|
+
function St(e, t, n, a = !0) {
|
|
396
|
+
const l = ne(t, n), d = fe(e, t, l), _ = (n == null ? void 0 : n.placement) ?? "center", s = a && _ === "center" ? Wt(d, t) : _, u = zt(d, t, s), h = He(n);
|
|
397
397
|
return {
|
|
398
|
-
placement:
|
|
399
|
-
offsetX: (
|
|
400
|
-
offsetY: (
|
|
401
|
-
width:
|
|
402
|
-
height:
|
|
398
|
+
placement: s,
|
|
399
|
+
offsetX: (u == null ? void 0 : u.x) ?? h.x,
|
|
400
|
+
offsetY: (u == null ? void 0 : u.y) ?? h.y,
|
|
401
|
+
width: d.width,
|
|
402
|
+
height: d.height
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function Dt(e, t) {
|
|
406
406
|
return (e == null ? void 0 : e.x) === (t == null ? void 0 : t.x) && (e == null ? void 0 : e.y) === (t == null ? void 0 : t.y) && (e == null ? void 0 : e.width) === (t == null ? void 0 : t.width) && (e == null ? void 0 : e.height) === (t == null ? void 0 : t.height);
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Tt(e, t) {
|
|
409
409
|
return {
|
|
410
410
|
...e,
|
|
411
411
|
y: e.y + t,
|
|
412
412
|
height: e.height - t
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Ft(e, t) {
|
|
416
416
|
return {
|
|
417
417
|
...e,
|
|
418
418
|
height: e.height + t
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function Ct(e, t) {
|
|
422
422
|
return {
|
|
423
423
|
...e,
|
|
424
424
|
width: e.width + t
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function At(e, t) {
|
|
428
428
|
return {
|
|
429
429
|
...e,
|
|
430
430
|
x: e.x + t,
|
|
431
431
|
width: e.width - t
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function bt(e) {
|
|
435
435
|
let t = { ...e.startRect };
|
|
436
|
-
return e.handle.includes("n") && (t =
|
|
436
|
+
return e.handle.includes("n") && (t = Tt(t, e.deltaY)), e.handle.includes("s") && (t = Ft(t, e.deltaY)), e.handle.includes("e") && (t = Ct(t, e.deltaX)), e.handle.includes("w") && (t = At(t, e.deltaX)), t;
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const Lt = /* @__PURE__ */ k({
|
|
439
439
|
name: "FloatingDragBar",
|
|
440
440
|
__name: "FloatingDragBar",
|
|
441
441
|
props: {
|
|
@@ -445,32 +445,32 @@ const Pt = /* @__PURE__ */ k({
|
|
|
445
445
|
},
|
|
446
446
|
emits: ["drag-start", "drag", "drag-end"],
|
|
447
447
|
setup(e, { emit: t }) {
|
|
448
|
-
const n = e, a = t, l =
|
|
448
|
+
const n = e, a = t, l = A(null), { rootEl: d } = Re(), _ = c(() => n.canDrag), { isDragging: g } = Qe(d, {
|
|
449
449
|
handle: l,
|
|
450
450
|
initialValue: { x: n.x, y: n.y },
|
|
451
451
|
preventDefault: !0,
|
|
452
452
|
buttons: [0],
|
|
453
|
-
disabled:
|
|
454
|
-
onStart: (
|
|
455
|
-
a("drag-start",
|
|
453
|
+
disabled: c(() => !_.value),
|
|
454
|
+
onStart: (u) => {
|
|
455
|
+
a("drag-start", u);
|
|
456
456
|
},
|
|
457
|
-
onMove: (
|
|
458
|
-
a("drag",
|
|
457
|
+
onMove: (u) => {
|
|
458
|
+
a("drag", u);
|
|
459
459
|
},
|
|
460
|
-
onEnd: (
|
|
461
|
-
a("drag-end",
|
|
460
|
+
onEnd: (u) => {
|
|
461
|
+
a("drag-end", u);
|
|
462
462
|
}
|
|
463
|
-
}),
|
|
464
|
-
"tr-layout__drag-bar--draggable":
|
|
463
|
+
}), s = c(() => ({
|
|
464
|
+
"tr-layout__drag-bar--draggable": _.value,
|
|
465
465
|
"tr-layout__drag-bar--dragging": g.value
|
|
466
466
|
}));
|
|
467
|
-
return (
|
|
467
|
+
return (u, h) => (E(), I("div", {
|
|
468
468
|
ref_key: "dragBarEl",
|
|
469
469
|
ref: l,
|
|
470
|
-
class: K(["tr-layout__drag-bar",
|
|
470
|
+
class: K(["tr-layout__drag-bar", s.value])
|
|
471
471
|
}, null, 2));
|
|
472
472
|
}
|
|
473
|
-
}),
|
|
473
|
+
}), Ht = /* @__PURE__ */ Y(Lt, [["__scopeId", "data-v-8be201e5"]]), Ot = /* @__PURE__ */ k({
|
|
474
474
|
name: "FloatingResizeTrigger",
|
|
475
475
|
__name: "FloatingResizeTrigger",
|
|
476
476
|
props: {
|
|
@@ -487,63 +487,63 @@ const Pt = /* @__PURE__ */ k({
|
|
|
487
487
|
sw: "nesw",
|
|
488
488
|
nw: "nwse",
|
|
489
489
|
se: "nwse"
|
|
490
|
-
}, a = e, l = t,
|
|
490
|
+
}, a = e, l = t, d = A(null), _ = c(() => [
|
|
491
491
|
`tr-layout__floating-resize-trigger--${a.handle}`,
|
|
492
492
|
`tr-layout__floating-resize-trigger--${g(a.handle)}`,
|
|
493
493
|
{
|
|
494
494
|
"is-active": a.active
|
|
495
495
|
}
|
|
496
496
|
]);
|
|
497
|
-
|
|
498
|
-
onStart: (
|
|
499
|
-
const
|
|
500
|
-
if (!
|
|
497
|
+
We(d, {
|
|
498
|
+
onStart: (r) => {
|
|
499
|
+
const m = r.currentTarget instanceof HTMLElement ? r.currentTarget : null;
|
|
500
|
+
if (!m)
|
|
501
501
|
return null;
|
|
502
|
-
|
|
503
|
-
const i =
|
|
504
|
-
startX:
|
|
505
|
-
startY:
|
|
506
|
-
lastPointerX:
|
|
507
|
-
lastPointerY:
|
|
502
|
+
r.preventDefault();
|
|
503
|
+
const i = m.ownerDocument.body, o = {
|
|
504
|
+
startX: r.clientX,
|
|
505
|
+
startY: r.clientY,
|
|
506
|
+
lastPointerX: r.clientX,
|
|
507
|
+
lastPointerY: r.clientY,
|
|
508
508
|
releaseBodyInteraction: we(i, `${g(a.handle)}-resize`)
|
|
509
509
|
};
|
|
510
510
|
return l("resize-start", a.handle), o;
|
|
511
511
|
},
|
|
512
|
-
onMove: (
|
|
513
|
-
|
|
512
|
+
onMove: (r, m) => {
|
|
513
|
+
m.clientX === r.lastPointerX && m.clientY === r.lastPointerY || u(r, m.clientX, m.clientY);
|
|
514
514
|
},
|
|
515
|
-
onEnd: (
|
|
516
|
-
|
|
515
|
+
onEnd: (r) => {
|
|
516
|
+
r.releaseBodyInteraction(), h(r);
|
|
517
517
|
}
|
|
518
518
|
});
|
|
519
|
-
function g(
|
|
520
|
-
return n[
|
|
519
|
+
function g(r) {
|
|
520
|
+
return n[r];
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
const o =
|
|
524
|
-
return [o,
|
|
522
|
+
function s(r, m, i) {
|
|
523
|
+
const o = m - r.startX, W = i - r.startY;
|
|
524
|
+
return [o, W];
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
const [o,
|
|
528
|
-
|
|
526
|
+
function u(r, m, i) {
|
|
527
|
+
const [o, W] = s(r, m, i);
|
|
528
|
+
r.lastPointerX = m, r.lastPointerY = i, l("resize", a.handle, o, W);
|
|
529
529
|
}
|
|
530
|
-
function h(
|
|
531
|
-
const [
|
|
532
|
-
l("resize-end", a.handle,
|
|
530
|
+
function h(r) {
|
|
531
|
+
const [m, i] = s(r, r.lastPointerX, r.lastPointerY);
|
|
532
|
+
l("resize-end", a.handle, m, i);
|
|
533
533
|
}
|
|
534
|
-
return (
|
|
534
|
+
return (r, m) => (E(), I("div", {
|
|
535
535
|
ref_key: "triggerRef",
|
|
536
|
-
ref:
|
|
537
|
-
class: K(["tr-layout__floating-resize-trigger",
|
|
536
|
+
ref: d,
|
|
537
|
+
class: K(["tr-layout__floating-resize-trigger", _.value]),
|
|
538
538
|
"aria-hidden": "true"
|
|
539
|
-
}, [...
|
|
539
|
+
}, [...m[0] || (m[0] = [
|
|
540
540
|
B("span", {
|
|
541
541
|
class: "tr-layout__floating-resize-trigger-indicator",
|
|
542
542
|
"aria-hidden": "true"
|
|
543
543
|
}, null, -1)
|
|
544
544
|
])], 2));
|
|
545
545
|
}
|
|
546
|
-
}),
|
|
546
|
+
}), It = /* @__PURE__ */ Y(Ot, [["__scopeId", "data-v-c9536bd0"]]), kt = /* @__PURE__ */ k({
|
|
547
547
|
name: "FloatingResizeTriggers",
|
|
548
548
|
__name: "FloatingResizeTriggers",
|
|
549
549
|
props: {
|
|
@@ -551,26 +551,26 @@ const Pt = /* @__PURE__ */ k({
|
|
|
551
551
|
},
|
|
552
552
|
emits: ["resize-start", "resize", "resize-end"],
|
|
553
553
|
setup(e, { emit: t }) {
|
|
554
|
-
const n = e, a = t, l =
|
|
555
|
-
function
|
|
556
|
-
l.value =
|
|
554
|
+
const n = e, a = t, l = A(null);
|
|
555
|
+
function d(s) {
|
|
556
|
+
l.value = s, a("resize-start", s);
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
a("resize",
|
|
558
|
+
function _(s, u, h) {
|
|
559
|
+
a("resize", s, u, h);
|
|
560
560
|
}
|
|
561
|
-
function g(
|
|
562
|
-
a("resize-end",
|
|
561
|
+
function g(s, u, h) {
|
|
562
|
+
a("resize-end", s, u, h), l.value = null;
|
|
563
563
|
}
|
|
564
|
-
return (
|
|
564
|
+
return (s, u) => (E(!0), I(Me, null, Ne(n.handles, (h) => (E(), G(It, {
|
|
565
565
|
key: h,
|
|
566
566
|
handle: h,
|
|
567
567
|
active: l.value === h,
|
|
568
|
-
onResizeStart:
|
|
569
|
-
onResize:
|
|
568
|
+
onResizeStart: d,
|
|
569
|
+
onResize: _,
|
|
570
570
|
onResizeEnd: g
|
|
571
571
|
}, null, 8, ["handle", "active"]))), 128));
|
|
572
572
|
}
|
|
573
|
-
}),
|
|
573
|
+
}), Pt = /* @__PURE__ */ k({
|
|
574
574
|
name: "LayoutSurface",
|
|
575
575
|
inheritAttrs: !1,
|
|
576
576
|
__name: "LayoutSurface",
|
|
@@ -581,124 +581,124 @@ const Pt = /* @__PURE__ */ k({
|
|
|
581
581
|
},
|
|
582
582
|
emits: ["update:floatingState", "floating-drag-start", "floating-drag", "floating-drag-end", "floating-resize-start", "floating-resize", "floating-resize-end"],
|
|
583
583
|
setup(e, { expose: t, emit: n }) {
|
|
584
|
-
const a = ["s", "e", "w", "ne", "nw", "se", "sw"], l = e,
|
|
584
|
+
const a = ["s", "e", "w", "ne", "nw", "se", "sw"], l = e, d = n, _ = $e(), g = te(null), { width: s, height: u } = et({
|
|
585
585
|
type: "visual",
|
|
586
586
|
initialWidth: ce + j * 2,
|
|
587
587
|
initialHeight: ge + j * 2
|
|
588
|
-
}), h =
|
|
589
|
-
if (!(!
|
|
588
|
+
}), h = c(() => wt(s.value, u.value)), r = c(() => l.mode === "floating"), m = c(() => {
|
|
589
|
+
if (!(!r.value || !l.floatingState))
|
|
590
590
|
return {
|
|
591
591
|
...l.floatingOptions,
|
|
592
592
|
...l.floatingState
|
|
593
593
|
};
|
|
594
|
-
}), i =
|
|
595
|
-
var
|
|
596
|
-
return ((
|
|
597
|
-
}), D =
|
|
598
|
-
var
|
|
599
|
-
return ((
|
|
600
|
-
}), T =
|
|
594
|
+
}), i = c(() => ne(h.value, m.value)), o = c(() => Et(m.value, h.value)), W = c(() => {
|
|
595
|
+
var f;
|
|
596
|
+
return ((f = m.value) == null ? void 0 : f.draggable) ?? !0;
|
|
597
|
+
}), D = c(() => {
|
|
598
|
+
var f;
|
|
599
|
+
return ((f = m.value) == null ? void 0 : f.resizable) === !0;
|
|
600
|
+
}), T = A(null), C = A(null), L = c(() => T.value !== null), v = c(() => C.value !== null), w = c(() => L.value || v.value), U = c(() => r.value && W.value && !v.value), y = c(() => r.value && W.value), z = c(() => !r.value || !D.value ? [] : a), R = c(() => r.value ? {
|
|
601
601
|
left: `${o.value.x}px`,
|
|
602
602
|
top: `${o.value.y}px`,
|
|
603
603
|
width: `${o.value.width}px`,
|
|
604
604
|
height: `${o.value.height}px`
|
|
605
605
|
} : {});
|
|
606
|
-
function
|
|
607
|
-
return
|
|
606
|
+
function F(f) {
|
|
607
|
+
return St(f, h.value, m.value);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
const
|
|
611
|
-
return
|
|
609
|
+
function H(f) {
|
|
610
|
+
const x = fe(f, h.value, i.value);
|
|
611
|
+
return Dt(o.value, x) || d("update:floatingState", F(x)), x;
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
615
|
-
...
|
|
616
|
-
x:
|
|
617
|
-
y:
|
|
613
|
+
function O(f, x) {
|
|
614
|
+
return H({
|
|
615
|
+
...x,
|
|
616
|
+
x: f.x,
|
|
617
|
+
y: f.y
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
const
|
|
622
|
-
handle:
|
|
623
|
-
deltaX:
|
|
624
|
-
deltaY:
|
|
625
|
-
startRect:
|
|
626
|
-
}),
|
|
627
|
-
return
|
|
620
|
+
function X(f, x, b, M) {
|
|
621
|
+
const ee = bt({
|
|
622
|
+
handle: f,
|
|
623
|
+
deltaX: x,
|
|
624
|
+
deltaY: b,
|
|
625
|
+
startRect: M
|
|
626
|
+
}), Ie = Rt(ee, f, h.value, i.value);
|
|
627
|
+
return H(Ie);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
T.value = o.value,
|
|
629
|
+
function P() {
|
|
630
|
+
T.value = o.value, d("floating-drag-start", F(T.value));
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
const
|
|
634
|
-
|
|
632
|
+
function J(f) {
|
|
633
|
+
const x = T.value ?? o.value, b = O(f, x);
|
|
634
|
+
d("floating-drag", F(b));
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
const
|
|
638
|
-
|
|
636
|
+
function Q(f) {
|
|
637
|
+
const x = T.value ?? o.value, b = O(f, x);
|
|
638
|
+
d("floating-drag-end", F(b)), T.value = null;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
|
|
642
|
-
...
|
|
643
|
-
handle:
|
|
640
|
+
function ve(f) {
|
|
641
|
+
C.value = o.value, d("floating-resize-start", {
|
|
642
|
+
...F(o.value),
|
|
643
|
+
handle: f
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
|
-
function me(
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
...
|
|
650
|
-
handle:
|
|
646
|
+
function me(f, x, b) {
|
|
647
|
+
const M = C.value ?? o.value, ee = X(f, x, b, M);
|
|
648
|
+
d("floating-resize", {
|
|
649
|
+
...F(ee),
|
|
650
|
+
handle: f
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
|
-
function
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
...
|
|
657
|
-
handle:
|
|
658
|
-
}),
|
|
653
|
+
function p(f, x, b) {
|
|
654
|
+
const M = C.value ?? o.value, ee = X(f, x, b, M);
|
|
655
|
+
d("floating-resize-end", {
|
|
656
|
+
...F(ee),
|
|
657
|
+
handle: f
|
|
658
|
+
}), C.value = null;
|
|
659
659
|
}
|
|
660
|
-
return
|
|
661
|
-
[
|
|
660
|
+
return _e(
|
|
661
|
+
[m, s, u],
|
|
662
662
|
() => {
|
|
663
|
-
!
|
|
663
|
+
!r.value || w.value || H(o.value);
|
|
664
664
|
},
|
|
665
665
|
{ immediate: !0 }
|
|
666
666
|
), t({
|
|
667
667
|
rootEl: g
|
|
668
|
-
}), (
|
|
668
|
+
}), (f, x) => (E(), G(Be, {
|
|
669
669
|
to: "body",
|
|
670
|
-
disabled: !
|
|
670
|
+
disabled: !r.value
|
|
671
671
|
}, [
|
|
672
|
-
B("div",
|
|
672
|
+
B("div", Ye({
|
|
673
673
|
ref_key: "rootEl",
|
|
674
674
|
ref: g
|
|
675
|
-
}, Z(
|
|
675
|
+
}, Z(_), {
|
|
676
676
|
class: ["tr-layout", {
|
|
677
|
-
"tr-layout--floating":
|
|
677
|
+
"tr-layout--floating": r.value,
|
|
678
678
|
"tr-layout--no-select": w.value
|
|
679
679
|
}],
|
|
680
|
-
style:
|
|
680
|
+
style: R.value
|
|
681
681
|
}), [
|
|
682
|
-
|
|
682
|
+
y.value ? (E(), G(Ht, {
|
|
683
683
|
key: 0,
|
|
684
684
|
x: o.value.x,
|
|
685
685
|
y: o.value.y,
|
|
686
|
-
"can-drag":
|
|
687
|
-
onDragStart:
|
|
688
|
-
onDrag:
|
|
689
|
-
onDragEnd:
|
|
686
|
+
"can-drag": U.value,
|
|
687
|
+
onDragStart: P,
|
|
688
|
+
onDrag: J,
|
|
689
|
+
onDragEnd: Q
|
|
690
690
|
}, null, 8, ["x", "y", "can-drag"])) : N("", !0),
|
|
691
|
-
$(
|
|
692
|
-
|
|
693
|
-
handles:
|
|
694
|
-
onResizeStart:
|
|
691
|
+
$(f.$slots, "default", {}, void 0, !0),
|
|
692
|
+
Xe(kt, {
|
|
693
|
+
handles: z.value,
|
|
694
|
+
onResizeStart: ve,
|
|
695
695
|
onResize: me,
|
|
696
|
-
onResizeEnd:
|
|
696
|
+
onResizeEnd: p
|
|
697
697
|
}, null, 8, ["handles"])
|
|
698
698
|
], 16)
|
|
699
699
|
], 8, ["disabled"]));
|
|
700
700
|
}
|
|
701
|
-
}),
|
|
701
|
+
}), Mt = /* @__PURE__ */ Y(Pt, [["__scopeId", "data-v-5e892f73"]]), he = {
|
|
702
702
|
left: {
|
|
703
703
|
open: !0,
|
|
704
704
|
minWidth: 200,
|
|
@@ -712,114 +712,114 @@ const Pt = /* @__PURE__ */ k({
|
|
|
712
712
|
maxWidth: 640
|
|
713
713
|
}
|
|
714
714
|
};
|
|
715
|
-
function
|
|
715
|
+
function Nt(e) {
|
|
716
716
|
return he[e].open;
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function $t(e) {
|
|
719
719
|
return he[e].minWidth;
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function Bt(e) {
|
|
722
722
|
return he[e].expandedWidth;
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Yt(e) {
|
|
725
725
|
return he[e].maxWidth;
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function ie(e, t) {
|
|
728
728
|
return typeof e != "number" || !Number.isFinite(e) ? t : Math.max(0, e);
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
const { side: t } = e, n =
|
|
732
|
-
var
|
|
733
|
-
return ((
|
|
734
|
-
}), l =
|
|
735
|
-
var
|
|
736
|
-
return
|
|
737
|
-
}),
|
|
738
|
-
var
|
|
739
|
-
return ((
|
|
740
|
-
}),
|
|
741
|
-
var
|
|
742
|
-
return ((
|
|
743
|
-
}), g =
|
|
730
|
+
function Ae(e) {
|
|
731
|
+
const { side: t } = e, n = c(() => q(e.config)), a = c(() => {
|
|
732
|
+
var v;
|
|
733
|
+
return ((v = n.value) == null ? void 0 : v.mode) ?? "dock";
|
|
734
|
+
}), l = c(() => {
|
|
735
|
+
var v;
|
|
736
|
+
return ie((v = n.value) == null ? void 0 : v.collapsedWidth, 0);
|
|
737
|
+
}), d = c(() => {
|
|
738
|
+
var v;
|
|
739
|
+
return ((v = n.value) == null ? void 0 : v.collapseEffect) ?? "overlay";
|
|
740
|
+
}), _ = c(() => {
|
|
741
|
+
var v;
|
|
742
|
+
return ((v = n.value) == null ? void 0 : v.resizable) ?? !1;
|
|
743
|
+
}), g = c(
|
|
744
744
|
() => {
|
|
745
|
-
var
|
|
746
|
-
return
|
|
745
|
+
var v;
|
|
746
|
+
return ie((v = n.value) == null ? void 0 : v.minExpandedWidth, $t(t));
|
|
747
747
|
}
|
|
748
|
-
),
|
|
748
|
+
), s = c(() => {
|
|
749
749
|
var w;
|
|
750
|
-
const
|
|
750
|
+
const v = ie(
|
|
751
751
|
(w = n.value) == null ? void 0 : w.maxExpandedWidth,
|
|
752
|
-
|
|
752
|
+
Yt(t)
|
|
753
753
|
);
|
|
754
|
-
return Math.max(g.value,
|
|
754
|
+
return Math.max(g.value, v);
|
|
755
755
|
});
|
|
756
|
-
function
|
|
756
|
+
function u(v) {
|
|
757
757
|
return S(
|
|
758
|
-
|
|
758
|
+
ie(v, Bt(t)),
|
|
759
759
|
g.value,
|
|
760
|
-
|
|
760
|
+
s.value
|
|
761
761
|
);
|
|
762
762
|
}
|
|
763
|
-
const h =
|
|
763
|
+
const h = ze({
|
|
764
764
|
value: () => {
|
|
765
|
-
var
|
|
766
|
-
return (
|
|
765
|
+
var v;
|
|
766
|
+
return (v = n.value) == null ? void 0 : v.open;
|
|
767
767
|
},
|
|
768
768
|
defaultValue: () => {
|
|
769
|
-
var
|
|
770
|
-
return ((
|
|
769
|
+
var v;
|
|
770
|
+
return ((v = n.value) == null ? void 0 : v.defaultOpen) ?? Nt(t);
|
|
771
771
|
},
|
|
772
|
-
onChange: (
|
|
772
|
+
onChange: (v) => {
|
|
773
773
|
var w;
|
|
774
|
-
return (w = e.onOpenChange) == null ? void 0 : w.call(e, { side: t, open:
|
|
774
|
+
return (w = e.onOpenChange) == null ? void 0 : w.call(e, { side: t, open: v });
|
|
775
775
|
}
|
|
776
|
-
}),
|
|
776
|
+
}), r = ze({
|
|
777
777
|
value: () => {
|
|
778
|
-
var
|
|
779
|
-
return (
|
|
778
|
+
var v;
|
|
779
|
+
return (v = n.value) == null ? void 0 : v.expandedWidth;
|
|
780
780
|
},
|
|
781
781
|
defaultValue: () => {
|
|
782
|
-
var
|
|
783
|
-
return
|
|
782
|
+
var v;
|
|
783
|
+
return u((v = n.value) == null ? void 0 : v.defaultExpandedWidth);
|
|
784
784
|
},
|
|
785
|
-
onChange: (
|
|
785
|
+
onChange: (v) => {
|
|
786
786
|
var w;
|
|
787
|
-
return (w = e.onExpandedWidthChange) == null ? void 0 : w.call(e, { side: t, expandedWidth:
|
|
787
|
+
return (w = e.onExpandedWidthChange) == null ? void 0 : w.call(e, { side: t, expandedWidth: v });
|
|
788
788
|
}
|
|
789
|
-
}),
|
|
790
|
-
() => i.value && h.value &&
|
|
789
|
+
}), m = c(() => u(r.value)), i = c(() => a.value === "dock"), o = c(() => a.value === "drawer"), W = c(() => i.value && !h.value && l.value > 0), D = c(() => !h.value && !W.value), T = c(
|
|
790
|
+
() => i.value && h.value && _.value && s.value > g.value
|
|
791
791
|
);
|
|
792
|
-
function
|
|
793
|
-
h.value !==
|
|
792
|
+
function C(v) {
|
|
793
|
+
h.value !== v && (h.value = v);
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
const w =
|
|
797
|
-
|
|
795
|
+
function L(v) {
|
|
796
|
+
const w = u(v);
|
|
797
|
+
m.value !== w && (r.value = w);
|
|
798
798
|
}
|
|
799
799
|
return {
|
|
800
800
|
side: t,
|
|
801
|
-
isOpen:
|
|
802
|
-
expandedWidth:
|
|
801
|
+
isOpen: c(() => h.value),
|
|
802
|
+
expandedWidth: m,
|
|
803
803
|
collapsedWidth: l,
|
|
804
|
-
collapseEffect:
|
|
804
|
+
collapseEffect: d,
|
|
805
805
|
minExpandedWidth: g,
|
|
806
|
-
maxExpandedWidth:
|
|
806
|
+
maxExpandedWidth: s,
|
|
807
807
|
isDock: i,
|
|
808
808
|
isDrawer: o,
|
|
809
|
-
isRail:
|
|
809
|
+
isRail: W,
|
|
810
810
|
isHidden: D,
|
|
811
811
|
canResize: T,
|
|
812
|
-
setOpen:
|
|
813
|
-
setExpandedWidth:
|
|
812
|
+
setOpen: C,
|
|
813
|
+
setExpandedWidth: L
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
const t =
|
|
816
|
+
function Xt(e) {
|
|
817
|
+
const t = Ae({
|
|
818
818
|
side: "left",
|
|
819
819
|
config: e.leftConfig,
|
|
820
820
|
onOpenChange: e.onOpenChange,
|
|
821
821
|
onExpandedWidthChange: e.onExpandedWidthChange
|
|
822
|
-
}), n =
|
|
822
|
+
}), n = Ae({
|
|
823
823
|
side: "right",
|
|
824
824
|
config: e.rightConfig,
|
|
825
825
|
onOpenChange: e.onOpenChange,
|
|
@@ -830,10 +830,10 @@ function Zt(e) {
|
|
|
830
830
|
rightAsideState: n
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
|
-
const
|
|
833
|
+
const Vt = {
|
|
834
834
|
left: "left-aside-open-change",
|
|
835
835
|
right: "right-aside-open-change"
|
|
836
|
-
},
|
|
836
|
+
}, Gt = {
|
|
837
837
|
start: {
|
|
838
838
|
generic: "aside-resize-start",
|
|
839
839
|
left: "left-aside-resize-start",
|
|
@@ -850,33 +850,24 @@ const jt = {
|
|
|
850
850
|
right: "right-aside-resize-end"
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
function
|
|
854
|
-
e("aside-open-change", t), e(
|
|
853
|
+
function Ut(e, t) {
|
|
854
|
+
e("aside-open-change", t), e(Vt[t.side], {
|
|
855
855
|
open: t.open
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
858
|
function ye(e, t, n) {
|
|
859
|
-
const a =
|
|
859
|
+
const a = Gt[t];
|
|
860
860
|
e(a.generic, n), e(a[n.side], {
|
|
861
861
|
expandedWidth: n.expandedWidth
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
|
-
|
|
865
|
-
return e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : !0;
|
|
866
|
-
}
|
|
867
|
-
function Pe(e) {
|
|
868
|
-
return Array.isArray(e) ? e.some((t) => Ue(t) ? t.type === qe ? !1 : t.type === Ze ? xe(t.children) : t.type === Le ? Pe(t.children) : !0 : xe(t)) : xe(e);
|
|
869
|
-
}
|
|
870
|
-
function ie(e) {
|
|
871
|
-
return Pe(e == null ? void 0 : e());
|
|
872
|
-
}
|
|
873
|
-
const Qt = { class: "tr-layout__body" }, en = {
|
|
864
|
+
const qt = { class: "tr-layout__body" }, Zt = {
|
|
874
865
|
key: 1,
|
|
875
866
|
class: "tr-layout__header"
|
|
876
|
-
},
|
|
867
|
+
}, jt = { class: "tr-layout__main" }, Kt = {
|
|
877
868
|
key: 2,
|
|
878
869
|
class: "tr-layout__footer"
|
|
879
|
-
},
|
|
870
|
+
}, Jt = /* @__PURE__ */ k({
|
|
880
871
|
name: "Layout",
|
|
881
872
|
__name: "Layout",
|
|
882
873
|
props: {
|
|
@@ -889,76 +880,76 @@ const Qt = { class: "tr-layout__body" }, en = {
|
|
|
889
880
|
},
|
|
890
881
|
emits: ["update:floatingState", "floating-drag-start", "floating-drag", "floating-drag-end", "floating-resize-start", "floating-resize", "floating-resize-end", "aside-open-change", "aside-resize-start", "aside-resize", "aside-resize-end", "left-aside-open-change", "left-aside-resize-start", "left-aside-resize", "left-aside-resize-end", "right-aside-open-change", "right-aside-resize-start", "right-aside-resize", "right-aside-resize-end"],
|
|
891
882
|
setup(e, { emit: t }) {
|
|
892
|
-
const n = e, a = t, l =
|
|
893
|
-
var
|
|
894
|
-
return ((
|
|
895
|
-
}), g =
|
|
896
|
-
function
|
|
897
|
-
|
|
883
|
+
const n = e, a = t, l = Ve(), d = te(null), _ = c(() => {
|
|
884
|
+
var p;
|
|
885
|
+
return ((p = d.value) == null ? void 0 : p.rootEl) ?? null;
|
|
886
|
+
}), g = c(() => !!l["left-aside"]), s = c(() => !!l.header), u = c(() => !!l.footer), h = c(() => !!l["right-aside"]);
|
|
887
|
+
function r(p) {
|
|
888
|
+
Ut(a, p);
|
|
898
889
|
}
|
|
899
|
-
function
|
|
900
|
-
ye(a, "resize",
|
|
890
|
+
function m(p) {
|
|
891
|
+
ye(a, "resize", p);
|
|
901
892
|
}
|
|
902
|
-
const { leftAsideState: i, rightAsideState: o } =
|
|
893
|
+
const { leftAsideState: i, rightAsideState: o } = Xt({
|
|
903
894
|
leftConfig: () => n.leftAside,
|
|
904
895
|
rightConfig: () => n.rightAside,
|
|
905
|
-
onOpenChange:
|
|
906
|
-
onExpandedWidthChange:
|
|
896
|
+
onOpenChange: r,
|
|
897
|
+
onExpandedWidthChange: m
|
|
907
898
|
});
|
|
908
|
-
function
|
|
909
|
-
|
|
899
|
+
function W(p, f, x, b) {
|
|
900
|
+
x && p.isDrawer.value && f.isDrawer.value && f.isOpen.value && b && f.setOpen(!1), p.setOpen(x);
|
|
910
901
|
}
|
|
911
|
-
function D(
|
|
912
|
-
|
|
902
|
+
function D(p, f, x) {
|
|
903
|
+
W(p, f, !p.isOpen.value, x);
|
|
913
904
|
}
|
|
914
905
|
function T() {
|
|
915
906
|
D(i, o, h.value);
|
|
916
907
|
}
|
|
917
|
-
function
|
|
908
|
+
function C() {
|
|
918
909
|
D(o, i, g.value);
|
|
919
910
|
}
|
|
920
|
-
const
|
|
921
|
-
function
|
|
922
|
-
|
|
911
|
+
const L = c(() => g.value && i.isDrawer.value && i.isOpen.value), v = c(() => h.value && o.isDrawer.value && o.isOpen.value), w = c(() => L.value || v.value);
|
|
912
|
+
function U() {
|
|
913
|
+
L.value && i.setOpen(!1), v.value && o.setOpen(!1);
|
|
923
914
|
}
|
|
924
|
-
|
|
925
|
-
rootEl:
|
|
915
|
+
rt({
|
|
916
|
+
rootEl: _,
|
|
926
917
|
left: {
|
|
927
918
|
isOpen: i.isOpen,
|
|
928
919
|
toggle: T
|
|
929
920
|
},
|
|
930
921
|
right: {
|
|
931
922
|
isOpen: o.isOpen,
|
|
932
|
-
toggle:
|
|
923
|
+
toggle: C
|
|
933
924
|
}
|
|
934
925
|
});
|
|
935
|
-
const y =
|
|
936
|
-
function
|
|
937
|
-
y.value = !0, ye(a, "start",
|
|
926
|
+
const y = te(!1);
|
|
927
|
+
function z(p) {
|
|
928
|
+
y.value = !0, ye(a, "start", p);
|
|
938
929
|
}
|
|
939
|
-
function
|
|
940
|
-
y.value = !1, ye(a, "end",
|
|
930
|
+
function R(p) {
|
|
931
|
+
y.value = !1, ye(a, "end", p);
|
|
941
932
|
}
|
|
942
|
-
function
|
|
943
|
-
i.setExpandedWidth(
|
|
933
|
+
function F(p) {
|
|
934
|
+
i.setExpandedWidth(p);
|
|
944
935
|
}
|
|
945
|
-
function H(
|
|
946
|
-
o.setExpandedWidth(
|
|
936
|
+
function H(p) {
|
|
937
|
+
o.setExpandedWidth(p);
|
|
947
938
|
}
|
|
948
|
-
function
|
|
949
|
-
return !
|
|
939
|
+
function O(p, f) {
|
|
940
|
+
return !f || !p.isDock.value || p.isHidden.value ? 0 : p.isRail.value ? p.collapsedWidth.value : p.expandedWidth.value;
|
|
950
941
|
}
|
|
951
|
-
const
|
|
942
|
+
const X = {
|
|
952
943
|
placement: "center",
|
|
953
944
|
offsetX: le,
|
|
954
945
|
offsetY: le,
|
|
955
946
|
width: ce,
|
|
956
947
|
height: ge
|
|
957
|
-
}, P =
|
|
948
|
+
}, P = ze({
|
|
958
949
|
value: () => n.floatingState,
|
|
959
|
-
defaultValue: () => n.defaultFloatingState ??
|
|
960
|
-
onChange: (
|
|
961
|
-
}), J =
|
|
950
|
+
defaultValue: () => n.defaultFloatingState ?? X,
|
|
951
|
+
onChange: (p) => a("update:floatingState", p)
|
|
952
|
+
}), J = c(() => O(i, g.value)), Q = c(() => O(o, h.value)), ve = c(() => ({
|
|
962
953
|
"tr-layout--left-dock": g.value && i.isDock.value,
|
|
963
954
|
"tr-layout--left-drawer": g.value && i.isDrawer.value,
|
|
964
955
|
"tr-layout--left-expanded": g.value && i.isOpen.value,
|
|
@@ -968,60 +959,60 @@ const Qt = { class: "tr-layout__body" }, en = {
|
|
|
968
959
|
"tr-layout--right-expanded": h.value && o.isOpen.value,
|
|
969
960
|
"tr-layout--right-rail": h.value && o.isRail.value,
|
|
970
961
|
"tr-layout--resizing": y.value
|
|
971
|
-
})),
|
|
972
|
-
const
|
|
973
|
-
return
|
|
962
|
+
})), me = c(() => {
|
|
963
|
+
const p = {}, f = ae(i.expandedWidth.value), x = ae(i.collapsedWidth.value), b = ae(o.expandedWidth.value), M = ae(o.collapsedWidth.value);
|
|
964
|
+
return f && (p["--left-dock-width"] = f), x && (p["--left-collapsed-width"] = x), b && (p["--right-dock-width"] = b), M && (p["--right-collapsed-width"] = M), p;
|
|
974
965
|
});
|
|
975
|
-
return (
|
|
966
|
+
return (p, f) => (E(), G(Mt, {
|
|
976
967
|
ref_key: "surfaceRef",
|
|
977
|
-
ref:
|
|
968
|
+
ref: d,
|
|
978
969
|
mode: e.mode,
|
|
979
|
-
class: K(
|
|
980
|
-
style:
|
|
970
|
+
class: K(ve.value),
|
|
971
|
+
style: be(me.value),
|
|
981
972
|
"floating-options": e.floatingOptions,
|
|
982
973
|
"floating-state": Z(P),
|
|
983
|
-
"onUpdate:floatingState":
|
|
984
|
-
onFloatingDragStart:
|
|
985
|
-
onFloatingDrag:
|
|
986
|
-
onFloatingDragEnd:
|
|
987
|
-
onFloatingResizeStart:
|
|
988
|
-
onFloatingResize:
|
|
989
|
-
onFloatingResizeEnd:
|
|
974
|
+
"onUpdate:floatingState": f[0] || (f[0] = (x) => Ge(P) ? P.value = x : null),
|
|
975
|
+
onFloatingDragStart: f[1] || (f[1] = (x) => a("floating-drag-start", x)),
|
|
976
|
+
onFloatingDrag: f[2] || (f[2] = (x) => a("floating-drag", x)),
|
|
977
|
+
onFloatingDragEnd: f[3] || (f[3] = (x) => a("floating-drag-end", x)),
|
|
978
|
+
onFloatingResizeStart: f[4] || (f[4] = (x) => a("floating-resize-start", x)),
|
|
979
|
+
onFloatingResize: f[5] || (f[5] = (x) => a("floating-resize", x)),
|
|
980
|
+
onFloatingResizeEnd: f[6] || (f[6] = (x) => a("floating-resize-end", x))
|
|
990
981
|
}, {
|
|
991
982
|
default: pe(() => [
|
|
992
|
-
B("div",
|
|
993
|
-
g.value ? (E(),
|
|
983
|
+
B("div", qt, [
|
|
984
|
+
g.value ? (E(), G(Fe, {
|
|
994
985
|
key: 0,
|
|
995
986
|
panel: Z(i),
|
|
996
987
|
"opposite-dock-width": Q.value,
|
|
997
|
-
onWidthChange:
|
|
998
|
-
onAsideResizeStart:
|
|
999
|
-
onAsideResizeEnd:
|
|
988
|
+
onWidthChange: F,
|
|
989
|
+
onAsideResizeStart: z,
|
|
990
|
+
onAsideResizeEnd: R
|
|
1000
991
|
}, {
|
|
1001
992
|
default: pe(() => [
|
|
1002
|
-
$(
|
|
993
|
+
$(p.$slots, "left-aside", {}, void 0, !0)
|
|
1003
994
|
]),
|
|
1004
995
|
_: 3
|
|
1005
996
|
}, 8, ["panel", "opposite-dock-width"])) : N("", !0),
|
|
1006
|
-
|
|
1007
|
-
$(
|
|
997
|
+
s.value ? (E(), I("header", Zt, [
|
|
998
|
+
$(p.$slots, "header", {}, void 0, !0)
|
|
1008
999
|
])) : N("", !0),
|
|
1009
|
-
B("main",
|
|
1010
|
-
$(
|
|
1000
|
+
B("main", jt, [
|
|
1001
|
+
$(p.$slots, "main", {}, void 0, !0)
|
|
1011
1002
|
]),
|
|
1012
|
-
|
|
1013
|
-
$(
|
|
1003
|
+
u.value ? (E(), I("footer", Kt, [
|
|
1004
|
+
$(p.$slots, "footer", {}, void 0, !0)
|
|
1014
1005
|
])) : N("", !0),
|
|
1015
|
-
h.value ? (E(),
|
|
1006
|
+
h.value ? (E(), G(Fe, {
|
|
1016
1007
|
key: 3,
|
|
1017
1008
|
panel: Z(o),
|
|
1018
1009
|
"opposite-dock-width": J.value,
|
|
1019
1010
|
onWidthChange: H,
|
|
1020
|
-
onAsideResizeStart:
|
|
1021
|
-
onAsideResizeEnd:
|
|
1011
|
+
onAsideResizeStart: z,
|
|
1012
|
+
onAsideResizeEnd: R
|
|
1022
1013
|
}, {
|
|
1023
1014
|
default: pe(() => [
|
|
1024
|
-
$(
|
|
1015
|
+
$(p.$slots, "right-aside", {}, void 0, !0)
|
|
1025
1016
|
]),
|
|
1026
1017
|
_: 3
|
|
1027
1018
|
}, 8, ["panel", "opposite-dock-width"])) : N("", !0),
|
|
@@ -1029,23 +1020,23 @@ const Qt = { class: "tr-layout__body" }, en = {
|
|
|
1029
1020
|
key: 4,
|
|
1030
1021
|
class: "tr-layout__backdrop",
|
|
1031
1022
|
"aria-hidden": "true",
|
|
1032
|
-
onPointerdown:
|
|
1023
|
+
onPointerdown: U
|
|
1033
1024
|
}, null, 32)) : N("", !0)
|
|
1034
1025
|
])
|
|
1035
1026
|
]),
|
|
1036
1027
|
_: 3
|
|
1037
1028
|
}, 8, ["mode", "class", "style", "floating-options", "floating-state"]));
|
|
1038
1029
|
}
|
|
1039
|
-
}),
|
|
1030
|
+
}), oe = /* @__PURE__ */ Y(Jt, [["__scopeId", "data-v-3177b7c4"]]), Qt = /* @__PURE__ */ k({
|
|
1040
1031
|
name: "LayoutAsideToggle",
|
|
1041
1032
|
__name: "LayoutAsideToggle",
|
|
1042
1033
|
props: {
|
|
1043
1034
|
side: {}
|
|
1044
1035
|
},
|
|
1045
1036
|
setup(e) {
|
|
1046
|
-
const t = e, { isOpen: n, toggle: a } =
|
|
1037
|
+
const t = e, { isOpen: n, toggle: a } = st(t.side), l = c(() => ({
|
|
1047
1038
|
isOpen: n.value
|
|
1048
|
-
})),
|
|
1039
|
+
})), d = {
|
|
1049
1040
|
left: {
|
|
1050
1041
|
expanded: "Collapse navigation",
|
|
1051
1042
|
collapsed: "Expand navigation"
|
|
@@ -1054,61 +1045,61 @@ const Qt = { class: "tr-layout__body" }, en = {
|
|
|
1054
1045
|
expanded: "Hide side panel",
|
|
1055
1046
|
collapsed: "Show side panel"
|
|
1056
1047
|
}
|
|
1057
|
-
},
|
|
1058
|
-
const g =
|
|
1048
|
+
}, _ = c(() => {
|
|
1049
|
+
const g = d[t.side];
|
|
1059
1050
|
return n.value ? g.expanded : g.collapsed;
|
|
1060
1051
|
});
|
|
1061
|
-
return (g,
|
|
1052
|
+
return (g, s) => (E(), I("button", {
|
|
1062
1053
|
class: "tr-layout-aside-toggle",
|
|
1063
1054
|
type: "button",
|
|
1064
|
-
onClick:
|
|
1065
|
-
(...
|
|
1055
|
+
onClick: s[0] || (s[0] = //@ts-ignore
|
|
1056
|
+
(...u) => Z(a) && Z(a)(...u))
|
|
1066
1057
|
}, [
|
|
1067
|
-
$(g.$slots, "default",
|
|
1068
|
-
|
|
1058
|
+
$(g.$slots, "default", Ue(qe(l.value)), () => [
|
|
1059
|
+
Ze(je(_.value), 1)
|
|
1069
1060
|
], !0)
|
|
1070
1061
|
]));
|
|
1071
1062
|
}
|
|
1072
|
-
}),
|
|
1063
|
+
}), re = /* @__PURE__ */ Y(Qt, [["__scopeId", "data-v-f173f270"]]), en = 36, xe = "tr-layout-proxy-scrollbar-target", tn = /* @__PURE__ */ k({
|
|
1073
1064
|
name: "LayoutProxyScrollbar",
|
|
1074
1065
|
__name: "LayoutProxyScrollbar",
|
|
1075
1066
|
props: {
|
|
1076
1067
|
scrollTarget: {}
|
|
1077
1068
|
},
|
|
1078
1069
|
setup(e) {
|
|
1079
|
-
const t = e, n =
|
|
1070
|
+
const t = e, n = te(null), a = A(null), l = A(W()), d = A(!1), _ = A(!1);
|
|
1080
1071
|
let g = null;
|
|
1081
|
-
const
|
|
1082
|
-
disabled:
|
|
1072
|
+
const s = c(() => D(t.scrollTarget)), u = c(() => l.value.isScrollable), { isDragging: h, cancel: r } = We(a, {
|
|
1073
|
+
disabled: c(() => !l.value.isScrollable),
|
|
1083
1074
|
onStart: (y) => {
|
|
1084
|
-
const
|
|
1085
|
-
if (!
|
|
1075
|
+
const z = s.value;
|
|
1076
|
+
if (!z || !l.value.isScrollable)
|
|
1086
1077
|
return null;
|
|
1087
|
-
const
|
|
1088
|
-
return
|
|
1089
|
-
scrollTarget:
|
|
1078
|
+
const R = z.ownerDocument.body;
|
|
1079
|
+
return R ? (y.preventDefault(), {
|
|
1080
|
+
scrollTarget: z,
|
|
1090
1081
|
startY: y.clientY,
|
|
1091
|
-
startScrollTop:
|
|
1092
|
-
releaseBodyInteraction: we(
|
|
1082
|
+
startScrollTop: z.scrollTop,
|
|
1083
|
+
releaseBodyInteraction: we(R, "grabbing")
|
|
1093
1084
|
}) : null;
|
|
1094
1085
|
},
|
|
1095
|
-
onMove: (y,
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1086
|
+
onMove: (y, z) => {
|
|
1087
|
+
const R = l.value;
|
|
1088
|
+
R.isScrollable && (y.scrollTarget.scrollTop = L(y, z.clientY, R), w());
|
|
1098
1089
|
},
|
|
1099
1090
|
onEnd: (y) => {
|
|
1100
1091
|
y.releaseBodyInteraction();
|
|
1101
1092
|
}
|
|
1102
|
-
}),
|
|
1103
|
-
() =>
|
|
1104
|
-
), i =
|
|
1093
|
+
}), m = c(
|
|
1094
|
+
() => u.value && (d.value || _.value || h.value)
|
|
1095
|
+
), i = c(() => ({
|
|
1105
1096
|
height: `${l.value.thumbHeight}px`,
|
|
1106
1097
|
transform: `translateY(${l.value.thumbOffset}px)`
|
|
1107
|
-
})), o =
|
|
1108
|
-
"tr-layout-proxy-scrollbar--visible":
|
|
1098
|
+
})), o = c(() => ({
|
|
1099
|
+
"tr-layout-proxy-scrollbar--visible": m.value,
|
|
1109
1100
|
"tr-layout-proxy-scrollbar--dragging-thumb": h.value
|
|
1110
1101
|
}));
|
|
1111
|
-
function
|
|
1102
|
+
function W() {
|
|
1112
1103
|
return {
|
|
1113
1104
|
clientHeight: 0,
|
|
1114
1105
|
scrollHeight: 0,
|
|
@@ -1120,124 +1111,124 @@ const Qt = { class: "tr-layout__body" }, en = {
|
|
|
1120
1111
|
};
|
|
1121
1112
|
}
|
|
1122
1113
|
function D(y) {
|
|
1123
|
-
const
|
|
1124
|
-
return
|
|
1114
|
+
const z = tt(y);
|
|
1115
|
+
return z instanceof HTMLElement ? z : null;
|
|
1125
1116
|
}
|
|
1126
|
-
function T(y,
|
|
1127
|
-
return y instanceof HTMLElement ? Math.max(y.clientHeight, 0) :
|
|
1117
|
+
function T(y, z) {
|
|
1118
|
+
return y instanceof HTMLElement ? Math.max(y.clientHeight, 0) : z;
|
|
1128
1119
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const
|
|
1131
|
-
if (!(
|
|
1120
|
+
function C(y, z) {
|
|
1121
|
+
const R = y.clientHeight, F = y.scrollHeight, H = y.scrollTop, O = F - R;
|
|
1122
|
+
if (!(O > 1))
|
|
1132
1123
|
return {
|
|
1133
|
-
clientHeight:
|
|
1134
|
-
scrollHeight:
|
|
1124
|
+
clientHeight: R,
|
|
1125
|
+
scrollHeight: F,
|
|
1135
1126
|
scrollTop: H,
|
|
1136
|
-
trackHeight:
|
|
1137
|
-
thumbHeight:
|
|
1127
|
+
trackHeight: z,
|
|
1128
|
+
thumbHeight: z,
|
|
1138
1129
|
thumbOffset: 0,
|
|
1139
1130
|
isScrollable: !1
|
|
1140
1131
|
};
|
|
1141
|
-
const P = S(
|
|
1132
|
+
const P = S(R / F * z, en, z), J = z - P, Q = H / O * J;
|
|
1142
1133
|
return {
|
|
1143
|
-
clientHeight:
|
|
1144
|
-
scrollHeight:
|
|
1134
|
+
clientHeight: R,
|
|
1135
|
+
scrollHeight: F,
|
|
1145
1136
|
scrollTop: H,
|
|
1146
|
-
trackHeight:
|
|
1137
|
+
trackHeight: z,
|
|
1147
1138
|
thumbHeight: P,
|
|
1148
1139
|
thumbOffset: Q,
|
|
1149
1140
|
isScrollable: !0
|
|
1150
1141
|
};
|
|
1151
1142
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const
|
|
1154
|
-
return y.startScrollTop +
|
|
1143
|
+
function L(y, z, R) {
|
|
1144
|
+
const F = z - y.startY, H = R.scrollHeight - R.clientHeight, O = R.trackHeight - R.thumbHeight, X = O > 0 ? H / O : 0;
|
|
1145
|
+
return y.startScrollTop + F * X;
|
|
1155
1146
|
}
|
|
1156
|
-
function
|
|
1147
|
+
function v() {
|
|
1157
1148
|
g = null;
|
|
1158
|
-
const y =
|
|
1149
|
+
const y = s.value;
|
|
1159
1150
|
if (!y) {
|
|
1160
|
-
l.value =
|
|
1151
|
+
l.value = W();
|
|
1161
1152
|
return;
|
|
1162
1153
|
}
|
|
1163
|
-
const
|
|
1164
|
-
l.value =
|
|
1154
|
+
const z = T(n.value, y.clientHeight);
|
|
1155
|
+
l.value = C(y, z);
|
|
1165
1156
|
}
|
|
1166
1157
|
function w() {
|
|
1167
1158
|
if (typeof window > "u") {
|
|
1168
|
-
|
|
1159
|
+
v();
|
|
1169
1160
|
return;
|
|
1170
1161
|
}
|
|
1171
|
-
g === null && (g = window.requestAnimationFrame(
|
|
1162
|
+
g === null && (g = window.requestAnimationFrame(v));
|
|
1172
1163
|
}
|
|
1173
|
-
function
|
|
1174
|
-
|
|
1164
|
+
function U(y) {
|
|
1165
|
+
_.value = y;
|
|
1175
1166
|
}
|
|
1176
|
-
return V(
|
|
1177
|
-
|
|
1178
|
-
}), V(
|
|
1179
|
-
|
|
1180
|
-
}), V(
|
|
1167
|
+
return V(s, "mouseenter", () => {
|
|
1168
|
+
d.value = !0;
|
|
1169
|
+
}), V(s, "mouseleave", () => {
|
|
1170
|
+
d.value = !1;
|
|
1171
|
+
}), V(s, "scroll", () => {
|
|
1181
1172
|
w();
|
|
1182
|
-
}),
|
|
1173
|
+
}), Se(s, () => {
|
|
1183
1174
|
w();
|
|
1184
|
-
}),
|
|
1175
|
+
}), Se(n, () => {
|
|
1185
1176
|
w();
|
|
1186
|
-
}),
|
|
1187
|
-
|
|
1177
|
+
}), nt(
|
|
1178
|
+
s,
|
|
1188
1179
|
() => {
|
|
1189
1180
|
w();
|
|
1190
1181
|
},
|
|
1191
1182
|
{ childList: !0, subtree: !0 }
|
|
1192
|
-
),
|
|
1193
|
-
|
|
1194
|
-
(y,
|
|
1195
|
-
|
|
1183
|
+
), _e(
|
|
1184
|
+
s,
|
|
1185
|
+
(y, z) => {
|
|
1186
|
+
r(), d.value = !1, _.value = !1, z == null || z.classList.remove(xe), y == null || y.classList.add(xe), w();
|
|
1196
1187
|
},
|
|
1197
1188
|
{ immediate: !0 }
|
|
1198
|
-
),
|
|
1189
|
+
), _e(n, () => {
|
|
1199
1190
|
w();
|
|
1200
|
-
}),
|
|
1191
|
+
}), Ke(() => {
|
|
1201
1192
|
var y;
|
|
1202
|
-
g !== null && typeof window < "u" && window.cancelAnimationFrame(g),
|
|
1203
|
-
}), (y,
|
|
1193
|
+
g !== null && typeof window < "u" && window.cancelAnimationFrame(g), r(), (y = s.value) == null || y.classList.remove(xe);
|
|
1194
|
+
}), (y, z) => u.value ? (E(), I("div", {
|
|
1204
1195
|
key: 0,
|
|
1205
1196
|
ref_key: "scrollbarRef",
|
|
1206
1197
|
ref: n,
|
|
1207
1198
|
class: K(["tr-layout-proxy-scrollbar", o.value]),
|
|
1208
1199
|
"aria-hidden": "true",
|
|
1209
|
-
onMouseenter:
|
|
1210
|
-
onMouseleave:
|
|
1200
|
+
onMouseenter: z[0] || (z[0] = (R) => U(!0)),
|
|
1201
|
+
onMouseleave: z[1] || (z[1] = (R) => U(!1))
|
|
1211
1202
|
}, [
|
|
1212
1203
|
B("div", {
|
|
1213
1204
|
ref_key: "thumbRef",
|
|
1214
1205
|
ref: a,
|
|
1215
1206
|
class: "tr-layout-proxy-scrollbar__thumb",
|
|
1216
|
-
style:
|
|
1207
|
+
style: be(i.value)
|
|
1217
1208
|
}, null, 4)
|
|
1218
1209
|
], 34)) : N("", !0);
|
|
1219
1210
|
}
|
|
1220
|
-
}), se = /* @__PURE__ */ Y(
|
|
1211
|
+
}), se = /* @__PURE__ */ Y(tn, [["__scopeId", "data-v-d7c40335"]]);
|
|
1221
1212
|
se.name = "TrLayoutProxyScrollbar";
|
|
1222
|
-
const
|
|
1213
|
+
const nn = function(e) {
|
|
1223
1214
|
e.component(se.name, se);
|
|
1224
1215
|
}, ue = se;
|
|
1225
|
-
ue.install =
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
e.component(
|
|
1229
|
-
}, de =
|
|
1230
|
-
de.install =
|
|
1231
|
-
|
|
1232
|
-
const
|
|
1233
|
-
e.component(
|
|
1234
|
-
},
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1216
|
+
ue.install = nn;
|
|
1217
|
+
re.name = "TrLayoutAsideToggle";
|
|
1218
|
+
const an = function(e) {
|
|
1219
|
+
e.component(re.name, re);
|
|
1220
|
+
}, de = re;
|
|
1221
|
+
de.install = an;
|
|
1222
|
+
oe.name = "TrLayout";
|
|
1223
|
+
const ln = function(e) {
|
|
1224
|
+
e.component(oe.name, oe), e.component(ue.name, ue), e.component(de.name, de);
|
|
1225
|
+
}, Ee = oe;
|
|
1226
|
+
Ee.install = ln;
|
|
1227
|
+
Ee.ProxyScrollbar = ue;
|
|
1228
|
+
Ee.AsideToggle = de;
|
|
1238
1229
|
export {
|
|
1239
|
-
|
|
1230
|
+
Ee as Layout,
|
|
1240
1231
|
de as LayoutAsideToggle,
|
|
1241
1232
|
ue as LayoutProxyScrollbar,
|
|
1242
|
-
|
|
1233
|
+
Ee as default
|
|
1243
1234
|
};
|