tttb 0.1.6
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.
Potentially problematic release.
This version of tttb might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components.js +36 -0
- package/dist/directives.js +16 -0
- package/dist/hooks.js +1 -0
- package/dist/icons/brands.js +554 -0
- package/dist/icons/regular.js +278 -0
- package/dist/icons/solid.js +1989 -0
- package/dist/index.js +84 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +393 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +399 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +129 -0
- package/dist/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +130 -0
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +3074 -0
- package/dist/node_modules/@fortawesome/free-brands-svg-icons/index.js +3156 -0
- package/dist/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +9602 -0
- package/dist/node_modules/@fortawesome/vue-fontawesome/index.es.js +487 -0
- package/dist/node_modules/gsap/CSSPlugin.js +424 -0
- package/dist/node_modules/gsap/gsap-core.js +1645 -0
- package/dist/node_modules/gsap/index.js +13 -0
- package/dist/src/components/Button/index.js +6 -0
- package/dist/src/components/Button/index.vue.js +74 -0
- package/dist/src/components/Checkbox/index.js +6 -0
- package/dist/src/components/Checkbox/index.vue.js +43 -0
- package/dist/src/components/Dialog/DialogItem.vue.js +80 -0
- package/dist/src/components/Dialog/DialogPrompt.vue.js +60 -0
- package/dist/src/components/Dialog/index.js +6 -0
- package/dist/src/components/Dialog/index.vue.js +77 -0
- package/dist/src/components/Icon/index.js +6 -0
- package/dist/src/components/Icon/index.vue.js +17 -0
- package/dist/src/components/Icon/props.js +31 -0
- package/dist/src/components/Loading/index.js +6 -0
- package/dist/src/components/Loading/index.vue.js +45 -0
- package/dist/src/components/Message/index.js +6 -0
- package/dist/src/components/Message/index.vue.js +86 -0
- package/dist/src/components/Modal/index.js +6 -0
- package/dist/src/components/Modal/index.vue.js +53 -0
- package/dist/src/components/Nav/index.js +6 -0
- package/dist/src/components/Nav/index.vue.js +87 -0
- package/dist/src/components/Pagination/index.js +6 -0
- package/dist/src/components/Pagination/index.vue.js +165 -0
- package/dist/src/components/Popconfirm/index.js +6 -0
- package/dist/src/components/Popconfirm/index.vue.js +118 -0
- package/dist/src/components/Popover/index.js +6 -0
- package/dist/src/components/Popover/index.vue.js +34 -0
- package/dist/src/components/Switch/index.js +6 -0
- package/dist/src/components/Switch/index.vue.js +80 -0
- package/dist/src/components/Table/index.js +6 -0
- package/dist/src/components/Table/index.vue.js +42 -0
- package/dist/src/components/Timer/index.js +6 -0
- package/dist/src/components/Timer/index.vue.js +30 -0
- package/dist/src/components/Tooltip/TooltipContent.vue.js +25 -0
- package/dist/src/components/Tooltip/TooltipItem.vue.js +51 -0
- package/dist/src/components/Tooltip/TooltipLayer.vue.js +41 -0
- package/dist/src/components/Tooltip/constants.js +19 -0
- package/dist/src/components/Tooltip/index.js +6 -0
- package/dist/src/components/Tooltip/index.vue.js +49 -0
- package/dist/src/components/Tooltip/manager.js +102 -0
- package/dist/src/components/Tooltip/props.js +28 -0
- package/dist/src/components/Tooltip/useTooltip.js +38 -0
- package/dist/src/components/Warn/index.js +6 -0
- package/dist/src/components/Warn/index.vue.js +24 -0
- package/dist/src/components/Watermark/index.js +6 -0
- package/dist/src/components/Watermark/index.vue.js +69 -0
- package/dist/src/components/Watermark/useWatermarkBg.js +11 -0
- package/dist/src/components/helpers.js +21 -0
- package/dist/src/directives/vDelayIn.js +86 -0
- package/dist/src/directives/vLazy.js +63 -0
- package/dist/src/directives/vLoading.js +47 -0
- package/dist/src/directives/vRipple.js +78 -0
- package/dist/src/directives/vSlideIn.js +39 -0
- package/dist/src/directives/vTextJump.js +33 -0
- package/dist/src/directives/vTooltip.js +38 -0
- package/dist/src/utils/dialog.js +41 -0
- package/dist/src/utils/localStorage.js +25 -0
- package/dist/src/utils/msg.js +21 -0
- package/dist/src/utils/tools.js +70 -0
- package/dist/tttb.css +1 -0
- package/dist/utils.js +22 -0
- package/package.json +59 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import * as t from "./components.js";
|
|
3
|
+
import * as a from "./directives.js";
|
|
4
|
+
import { dialog as p } from "./src/utils/dialog.js";
|
|
5
|
+
import { localStorage as u } from "./src/utils/localStorage.js";
|
|
6
|
+
import { msg as i } from "./src/utils/msg.js";
|
|
7
|
+
import { chance as c, debounce as v, deepClone as g, getId as b, getRandomInt as h, getRandomStr as I, isMobile as T, isObject as P, isPromise as S, omit as j, pick as k, shuffleArray as y, throttleFirst as L } from "./src/utils/tools.js";
|
|
8
|
+
import { default as O } from "./src/components/Button/index.js";
|
|
9
|
+
import { default as C } from "./src/components/Checkbox/index.js";
|
|
10
|
+
import { default as E } from "./src/components/Dialog/index.js";
|
|
11
|
+
import { default as w } from "./src/components/Icon/index.js";
|
|
12
|
+
import { default as A } from "./src/components/Loading/index.js";
|
|
13
|
+
import { default as F } from "./src/components/Message/index.js";
|
|
14
|
+
import { default as N } from "./src/components/Modal/index.js";
|
|
15
|
+
import { default as G } from "./src/components/Nav/index.js";
|
|
16
|
+
import { default as K } from "./src/components/Pagination/index.js";
|
|
17
|
+
import { default as U } from "./src/components/Popconfirm/index.js";
|
|
18
|
+
import { default as X } from "./src/components/Popover/index.js";
|
|
19
|
+
import { default as Z } from "./src/components/Switch/index.js";
|
|
20
|
+
import { default as $ } from "./src/components/Table/index.js";
|
|
21
|
+
import { default as eo } from "./src/components/Timer/index.js";
|
|
22
|
+
import { default as ao } from "./src/components/Tooltip/index.js";
|
|
23
|
+
import { default as fo } from "./src/components/Warn/index.js";
|
|
24
|
+
import { default as mo } from "./src/components/Watermark/index.js";
|
|
25
|
+
import { default as po } from "./src/directives/vDelayIn.js";
|
|
26
|
+
import { default as xo } from "./src/directives/vLazy.js";
|
|
27
|
+
import { default as no } from "./src/directives/vLoading.js";
|
|
28
|
+
import { default as vo } from "./src/directives/vRipple.js";
|
|
29
|
+
import { default as bo } from "./src/directives/vSlideIn.js";
|
|
30
|
+
import { default as Io } from "./src/directives/vTextJump.js";
|
|
31
|
+
import { default as Po } from "./src/directives/vTooltip.js";
|
|
32
|
+
const r = (e) => {
|
|
33
|
+
Object.values(t).forEach((o) => {
|
|
34
|
+
e.component(o.name, o);
|
|
35
|
+
}), Object.values(a).forEach((o) => {
|
|
36
|
+
e.directive(o.name, o);
|
|
37
|
+
});
|
|
38
|
+
}, l = {
|
|
39
|
+
install: r
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
O as Button,
|
|
43
|
+
C as Checkbox,
|
|
44
|
+
E as Dialog,
|
|
45
|
+
w as Icon,
|
|
46
|
+
A as Loading,
|
|
47
|
+
F as Message,
|
|
48
|
+
N as Modal,
|
|
49
|
+
G as Nav,
|
|
50
|
+
K as Pagination,
|
|
51
|
+
U as Popconfirm,
|
|
52
|
+
X as Popover,
|
|
53
|
+
Z as Switch,
|
|
54
|
+
$ as Table,
|
|
55
|
+
eo as Timer,
|
|
56
|
+
ao as Tooltip,
|
|
57
|
+
fo as Warn,
|
|
58
|
+
mo as Watermark,
|
|
59
|
+
c as chance,
|
|
60
|
+
v as debounce,
|
|
61
|
+
g as deepClone,
|
|
62
|
+
l as default,
|
|
63
|
+
p as dialog,
|
|
64
|
+
b as getId,
|
|
65
|
+
h as getRandomInt,
|
|
66
|
+
I as getRandomStr,
|
|
67
|
+
r as install,
|
|
68
|
+
T as isMobile,
|
|
69
|
+
P as isObject,
|
|
70
|
+
S as isPromise,
|
|
71
|
+
u as localStorage,
|
|
72
|
+
i as msg,
|
|
73
|
+
j as omit,
|
|
74
|
+
k as pick,
|
|
75
|
+
y as shuffleArray,
|
|
76
|
+
L as throttleFirst,
|
|
77
|
+
po as vDelayIn,
|
|
78
|
+
xo as vLazy,
|
|
79
|
+
no as vLoading,
|
|
80
|
+
vo as vRipple,
|
|
81
|
+
bo as vSlideIn,
|
|
82
|
+
Io as vTextJump,
|
|
83
|
+
Po as vTooltip
|
|
84
|
+
};
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { evaluate as Y, getSide as B, getSideAxis as V, getOppositePlacement as J, getExpandedPlacements as K, getOppositeAxisPlacements as N, getAlignmentSides as Q, clamp as $, getAlignment as X, getOppositeAxis as U, getPaddingObject as W, getAlignmentAxis as _, getAxisLength as q, min as z, rectToClientRect as H } from "../../utils/dist/floating-ui.utils.js";
|
|
2
|
+
function I(a, i, m) {
|
|
3
|
+
let {
|
|
4
|
+
reference: n,
|
|
5
|
+
floating: r
|
|
6
|
+
} = a;
|
|
7
|
+
const t = V(i), o = _(i), s = q(o), d = B(i), g = t === "y", x = n.x + n.width / 2 - r.width / 2, l = n.y + n.height / 2 - r.height / 2, f = n[s] / 2 - r[s] / 2;
|
|
8
|
+
let e;
|
|
9
|
+
switch (d) {
|
|
10
|
+
case "top":
|
|
11
|
+
e = {
|
|
12
|
+
x,
|
|
13
|
+
y: n.y - r.height
|
|
14
|
+
};
|
|
15
|
+
break;
|
|
16
|
+
case "bottom":
|
|
17
|
+
e = {
|
|
18
|
+
x,
|
|
19
|
+
y: n.y + n.height
|
|
20
|
+
};
|
|
21
|
+
break;
|
|
22
|
+
case "right":
|
|
23
|
+
e = {
|
|
24
|
+
x: n.x + n.width,
|
|
25
|
+
y: l
|
|
26
|
+
};
|
|
27
|
+
break;
|
|
28
|
+
case "left":
|
|
29
|
+
e = {
|
|
30
|
+
x: n.x - r.width,
|
|
31
|
+
y: l
|
|
32
|
+
};
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
e = {
|
|
36
|
+
x: n.x,
|
|
37
|
+
y: n.y
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
switch (X(i)) {
|
|
41
|
+
case "start":
|
|
42
|
+
e[o] -= f * (m && g ? -1 : 1);
|
|
43
|
+
break;
|
|
44
|
+
case "end":
|
|
45
|
+
e[o] += f * (m && g ? -1 : 1);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return e;
|
|
49
|
+
}
|
|
50
|
+
async function Z(a, i) {
|
|
51
|
+
var m;
|
|
52
|
+
i === void 0 && (i = {});
|
|
53
|
+
const {
|
|
54
|
+
x: n,
|
|
55
|
+
y: r,
|
|
56
|
+
platform: t,
|
|
57
|
+
rects: o,
|
|
58
|
+
elements: s,
|
|
59
|
+
strategy: d
|
|
60
|
+
} = a, {
|
|
61
|
+
boundary: g = "clippingAncestors",
|
|
62
|
+
rootBoundary: x = "viewport",
|
|
63
|
+
elementContext: l = "floating",
|
|
64
|
+
altBoundary: f = !1,
|
|
65
|
+
padding: e = 0
|
|
66
|
+
} = Y(i, a), c = W(e), u = s[f ? l === "floating" ? "reference" : "floating" : l], p = H(await t.getClippingRect({
|
|
67
|
+
element: (m = await (t.isElement == null ? void 0 : t.isElement(u))) == null || m ? u : u.contextElement || await (t.getDocumentElement == null ? void 0 : t.getDocumentElement(s.floating)),
|
|
68
|
+
boundary: g,
|
|
69
|
+
rootBoundary: x,
|
|
70
|
+
strategy: d
|
|
71
|
+
})), y = l === "floating" ? {
|
|
72
|
+
x: n,
|
|
73
|
+
y: r,
|
|
74
|
+
width: o.floating.width,
|
|
75
|
+
height: o.floating.height
|
|
76
|
+
} : o.reference, v = await (t.getOffsetParent == null ? void 0 : t.getOffsetParent(s.floating)), h = await (t.isElement == null ? void 0 : t.isElement(v)) ? await (t.getScale == null ? void 0 : t.getScale(v)) || {
|
|
77
|
+
x: 1,
|
|
78
|
+
y: 1
|
|
79
|
+
} : {
|
|
80
|
+
x: 1,
|
|
81
|
+
y: 1
|
|
82
|
+
}, P = H(t.convertOffsetParentRelativeRectToViewportRelativeRect ? await t.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
83
|
+
elements: s,
|
|
84
|
+
rect: y,
|
|
85
|
+
offsetParent: v,
|
|
86
|
+
strategy: d
|
|
87
|
+
}) : y);
|
|
88
|
+
return {
|
|
89
|
+
top: (p.top - P.top + c.top) / h.y,
|
|
90
|
+
bottom: (P.bottom - p.bottom + c.bottom) / h.y,
|
|
91
|
+
left: (p.left - P.left + c.left) / h.x,
|
|
92
|
+
right: (P.right - p.right + c.right) / h.x
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const ie = async (a, i, m) => {
|
|
96
|
+
const {
|
|
97
|
+
placement: n = "bottom",
|
|
98
|
+
strategy: r = "absolute",
|
|
99
|
+
middleware: t = [],
|
|
100
|
+
platform: o
|
|
101
|
+
} = m, s = t.filter(Boolean), d = await (o.isRTL == null ? void 0 : o.isRTL(i));
|
|
102
|
+
let g = await o.getElementRects({
|
|
103
|
+
reference: a,
|
|
104
|
+
floating: i,
|
|
105
|
+
strategy: r
|
|
106
|
+
}), {
|
|
107
|
+
x,
|
|
108
|
+
y: l
|
|
109
|
+
} = I(g, n, d), f = n, e = {}, c = 0;
|
|
110
|
+
for (let u = 0; u < s.length; u++) {
|
|
111
|
+
var w;
|
|
112
|
+
const {
|
|
113
|
+
name: p,
|
|
114
|
+
fn: y
|
|
115
|
+
} = s[u], {
|
|
116
|
+
x: v,
|
|
117
|
+
y: h,
|
|
118
|
+
data: P,
|
|
119
|
+
reset: b
|
|
120
|
+
} = await y({
|
|
121
|
+
x,
|
|
122
|
+
y: l,
|
|
123
|
+
initialPlacement: n,
|
|
124
|
+
placement: f,
|
|
125
|
+
strategy: r,
|
|
126
|
+
middlewareData: e,
|
|
127
|
+
rects: g,
|
|
128
|
+
platform: {
|
|
129
|
+
...o,
|
|
130
|
+
detectOverflow: (w = o.detectOverflow) != null ? w : Z
|
|
131
|
+
},
|
|
132
|
+
elements: {
|
|
133
|
+
reference: a,
|
|
134
|
+
floating: i
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
x = v ?? x, l = h ?? l, e = {
|
|
138
|
+
...e,
|
|
139
|
+
[p]: {
|
|
140
|
+
...e[p],
|
|
141
|
+
...P
|
|
142
|
+
}
|
|
143
|
+
}, b && c <= 50 && (c++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (g = b.rects === !0 ? await o.getElementRects({
|
|
144
|
+
reference: a,
|
|
145
|
+
floating: i,
|
|
146
|
+
strategy: r
|
|
147
|
+
}) : b.rects), {
|
|
148
|
+
x,
|
|
149
|
+
y: l
|
|
150
|
+
} = I(g, f, d)), u = -1);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
x,
|
|
154
|
+
y: l,
|
|
155
|
+
placement: f,
|
|
156
|
+
strategy: r,
|
|
157
|
+
middlewareData: e
|
|
158
|
+
};
|
|
159
|
+
}, oe = (a) => ({
|
|
160
|
+
name: "arrow",
|
|
161
|
+
options: a,
|
|
162
|
+
async fn(i) {
|
|
163
|
+
const {
|
|
164
|
+
x: m,
|
|
165
|
+
y: n,
|
|
166
|
+
placement: r,
|
|
167
|
+
rects: t,
|
|
168
|
+
platform: o,
|
|
169
|
+
elements: s,
|
|
170
|
+
middlewareData: d
|
|
171
|
+
} = i, {
|
|
172
|
+
element: g,
|
|
173
|
+
padding: x = 0
|
|
174
|
+
} = Y(a, i) || {};
|
|
175
|
+
if (g == null)
|
|
176
|
+
return {};
|
|
177
|
+
const l = W(x), f = {
|
|
178
|
+
x: m,
|
|
179
|
+
y: n
|
|
180
|
+
}, e = _(r), c = q(e), w = await o.getDimensions(g), u = e === "y", p = u ? "top" : "left", y = u ? "bottom" : "right", v = u ? "clientHeight" : "clientWidth", h = t.reference[c] + t.reference[e] - f[e] - t.floating[c], P = f[e] - t.reference[e], b = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(g));
|
|
181
|
+
let D = b ? b[v] : 0;
|
|
182
|
+
(!D || !await (o.isElement == null ? void 0 : o.isElement(b))) && (D = s.floating[v] || t.floating[c]);
|
|
183
|
+
const F = h / 2 - P / 2, E = D / 2 - w[c] / 2 - 1, k = z(l[p], E), M = z(l[y], E), T = k, j = D - w[c] - M, A = D / 2 - w[c] / 2 + F, L = $(T, A, j), C = !d.arrow && X(r) != null && A !== L && t.reference[c] / 2 - (A < T ? k : M) - w[c] / 2 < 0, O = C ? A < T ? A - T : A - j : 0;
|
|
184
|
+
return {
|
|
185
|
+
[e]: f[e] + O,
|
|
186
|
+
data: {
|
|
187
|
+
[e]: L,
|
|
188
|
+
centerOffset: A - L - O,
|
|
189
|
+
...C && {
|
|
190
|
+
alignmentOffset: O
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
reset: C
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}), se = function(a) {
|
|
197
|
+
return a === void 0 && (a = {}), {
|
|
198
|
+
name: "flip",
|
|
199
|
+
options: a,
|
|
200
|
+
async fn(i) {
|
|
201
|
+
var m, n;
|
|
202
|
+
const {
|
|
203
|
+
placement: r,
|
|
204
|
+
middlewareData: t,
|
|
205
|
+
rects: o,
|
|
206
|
+
initialPlacement: s,
|
|
207
|
+
platform: d,
|
|
208
|
+
elements: g
|
|
209
|
+
} = i, {
|
|
210
|
+
mainAxis: x = !0,
|
|
211
|
+
crossAxis: l = !0,
|
|
212
|
+
fallbackPlacements: f,
|
|
213
|
+
fallbackStrategy: e = "bestFit",
|
|
214
|
+
fallbackAxisSideDirection: c = "none",
|
|
215
|
+
flipAlignment: w = !0,
|
|
216
|
+
...u
|
|
217
|
+
} = Y(a, i);
|
|
218
|
+
if ((m = t.arrow) != null && m.alignmentOffset)
|
|
219
|
+
return {};
|
|
220
|
+
const p = B(r), y = V(s), v = B(s) === s, h = await (d.isRTL == null ? void 0 : d.isRTL(g.floating)), P = f || (v || !w ? [J(s)] : K(s)), b = c !== "none";
|
|
221
|
+
!f && b && P.push(...N(s, w, c, h));
|
|
222
|
+
const D = [s, ...P], F = await d.detectOverflow(i, u), E = [];
|
|
223
|
+
let k = ((n = t.flip) == null ? void 0 : n.overflows) || [];
|
|
224
|
+
if (x && E.push(F[p]), l) {
|
|
225
|
+
const A = Q(r, o, h);
|
|
226
|
+
E.push(F[A[0]], F[A[1]]);
|
|
227
|
+
}
|
|
228
|
+
if (k = [...k, {
|
|
229
|
+
placement: r,
|
|
230
|
+
overflows: E
|
|
231
|
+
}], !E.every((A) => A <= 0)) {
|
|
232
|
+
var M, T;
|
|
233
|
+
const A = (((M = t.flip) == null ? void 0 : M.index) || 0) + 1, L = D[A];
|
|
234
|
+
if (L && (!(l === "alignment" ? y !== V(L) : !1) || // We leave the current main axis only if every placement on that axis
|
|
235
|
+
// overflows the main axis.
|
|
236
|
+
k.every((R) => V(R.placement) === y ? R.overflows[0] > 0 : !0)))
|
|
237
|
+
return {
|
|
238
|
+
data: {
|
|
239
|
+
index: A,
|
|
240
|
+
overflows: k
|
|
241
|
+
},
|
|
242
|
+
reset: {
|
|
243
|
+
placement: L
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
let C = (T = k.filter((O) => O.overflows[0] <= 0).sort((O, R) => O.overflows[1] - R.overflows[1])[0]) == null ? void 0 : T.placement;
|
|
247
|
+
if (!C)
|
|
248
|
+
switch (e) {
|
|
249
|
+
case "bestFit": {
|
|
250
|
+
var j;
|
|
251
|
+
const O = (j = k.filter((R) => {
|
|
252
|
+
if (b) {
|
|
253
|
+
const S = V(R.placement);
|
|
254
|
+
return S === y || // Create a bias to the `y` side axis due to horizontal
|
|
255
|
+
// reading directions favoring greater width.
|
|
256
|
+
S === "y";
|
|
257
|
+
}
|
|
258
|
+
return !0;
|
|
259
|
+
}).map((R) => [R.placement, R.overflows.filter((S) => S > 0).reduce((S, G) => S + G, 0)]).sort((R, S) => R[1] - S[1])[0]) == null ? void 0 : j[0];
|
|
260
|
+
O && (C = O);
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
case "initialPlacement":
|
|
264
|
+
C = s;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
if (r !== C)
|
|
268
|
+
return {
|
|
269
|
+
reset: {
|
|
270
|
+
placement: C
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
return {};
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}, ee = /* @__PURE__ */ new Set(["left", "top"]);
|
|
278
|
+
async function te(a, i) {
|
|
279
|
+
const {
|
|
280
|
+
placement: m,
|
|
281
|
+
platform: n,
|
|
282
|
+
elements: r
|
|
283
|
+
} = a, t = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), o = B(m), s = X(m), d = V(m) === "y", g = ee.has(o) ? -1 : 1, x = t && d ? -1 : 1, l = Y(i, a);
|
|
284
|
+
let {
|
|
285
|
+
mainAxis: f,
|
|
286
|
+
crossAxis: e,
|
|
287
|
+
alignmentAxis: c
|
|
288
|
+
} = typeof l == "number" ? {
|
|
289
|
+
mainAxis: l,
|
|
290
|
+
crossAxis: 0,
|
|
291
|
+
alignmentAxis: null
|
|
292
|
+
} : {
|
|
293
|
+
mainAxis: l.mainAxis || 0,
|
|
294
|
+
crossAxis: l.crossAxis || 0,
|
|
295
|
+
alignmentAxis: l.alignmentAxis
|
|
296
|
+
};
|
|
297
|
+
return s && typeof c == "number" && (e = s === "end" ? c * -1 : c), d ? {
|
|
298
|
+
x: e * x,
|
|
299
|
+
y: f * g
|
|
300
|
+
} : {
|
|
301
|
+
x: f * g,
|
|
302
|
+
y: e * x
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
const ae = function(a) {
|
|
306
|
+
return a === void 0 && (a = 0), {
|
|
307
|
+
name: "offset",
|
|
308
|
+
options: a,
|
|
309
|
+
async fn(i) {
|
|
310
|
+
var m, n;
|
|
311
|
+
const {
|
|
312
|
+
x: r,
|
|
313
|
+
y: t,
|
|
314
|
+
placement: o,
|
|
315
|
+
middlewareData: s
|
|
316
|
+
} = i, d = await te(i, a);
|
|
317
|
+
return o === ((m = s.offset) == null ? void 0 : m.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
318
|
+
x: r + d.x,
|
|
319
|
+
y: t + d.y,
|
|
320
|
+
data: {
|
|
321
|
+
...d,
|
|
322
|
+
placement: o
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}, le = function(a) {
|
|
328
|
+
return a === void 0 && (a = {}), {
|
|
329
|
+
name: "shift",
|
|
330
|
+
options: a,
|
|
331
|
+
async fn(i) {
|
|
332
|
+
const {
|
|
333
|
+
x: m,
|
|
334
|
+
y: n,
|
|
335
|
+
placement: r,
|
|
336
|
+
platform: t
|
|
337
|
+
} = i, {
|
|
338
|
+
mainAxis: o = !0,
|
|
339
|
+
crossAxis: s = !1,
|
|
340
|
+
limiter: d = {
|
|
341
|
+
fn: (p) => {
|
|
342
|
+
let {
|
|
343
|
+
x: y,
|
|
344
|
+
y: v
|
|
345
|
+
} = p;
|
|
346
|
+
return {
|
|
347
|
+
x: y,
|
|
348
|
+
y: v
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
...g
|
|
353
|
+
} = Y(a, i), x = {
|
|
354
|
+
x: m,
|
|
355
|
+
y: n
|
|
356
|
+
}, l = await t.detectOverflow(i, g), f = V(B(r)), e = U(f);
|
|
357
|
+
let c = x[e], w = x[f];
|
|
358
|
+
if (o) {
|
|
359
|
+
const p = e === "y" ? "top" : "left", y = e === "y" ? "bottom" : "right", v = c + l[p], h = c - l[y];
|
|
360
|
+
c = $(v, c, h);
|
|
361
|
+
}
|
|
362
|
+
if (s) {
|
|
363
|
+
const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", v = w + l[p], h = w - l[y];
|
|
364
|
+
w = $(v, w, h);
|
|
365
|
+
}
|
|
366
|
+
const u = d.fn({
|
|
367
|
+
...i,
|
|
368
|
+
[e]: c,
|
|
369
|
+
[f]: w
|
|
370
|
+
});
|
|
371
|
+
return {
|
|
372
|
+
...u,
|
|
373
|
+
data: {
|
|
374
|
+
x: u.x - m,
|
|
375
|
+
y: u.y - n,
|
|
376
|
+
enabled: {
|
|
377
|
+
[e]: o,
|
|
378
|
+
[f]: s
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
export {
|
|
386
|
+
oe as arrow,
|
|
387
|
+
ie as computePosition,
|
|
388
|
+
Z as detectOverflow,
|
|
389
|
+
se as flip,
|
|
390
|
+
ae as offset,
|
|
391
|
+
H as rectToClientRect,
|
|
392
|
+
le as shift
|
|
393
|
+
};
|