@pibit.ai/cure-design-system 0.3.14 → 0.3.16
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/node_modules/@floating-ui/core/dist/floating-ui.core.js +387 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +313 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +132 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +105 -0
- package/dist/patterns/table/TableWrapper.d.ts +1 -3
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +135 -127
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +50 -44
- package/dist/patterns/tree-view/tree-view.d.ts +7 -1
- package/dist/patterns/tree-view/tree-view.d.ts.map +1 -1
- package/dist/patterns/tree-view/tree-view.js +77 -70
- package/dist/primitives/button/button-utility.js +7 -7
- package/dist/primitives/button/button.js +2 -2
- package/dist/styles/components.css +1 -1
- package/dist/styles/theme.css +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { getSideAxis as $, getAlignmentAxis as j, getSide as D, getAlignment as S, evaluate as E, getPaddingObject as H, rectToClientRect as k, getAxisLength as X, placements as V, getAlignmentSides as Y, min as B, max as C, clamp as F, getOppositeAlignmentPlacement as z, getOppositeAxis as I } from "../../utils/dist/floating-ui.utils.js";
|
|
2
|
+
function W(t, e, c) {
|
|
3
|
+
let {
|
|
4
|
+
reference: i,
|
|
5
|
+
floating: n
|
|
6
|
+
} = t;
|
|
7
|
+
const s = $(e), a = j(e), d = X(a), u = D(e), h = s === "y", o = i.x + i.width / 2 - n.width / 2, l = i.y + i.height / 2 - n.height / 2, r = i[d] / 2 - n[d] / 2;
|
|
8
|
+
let m;
|
|
9
|
+
switch (u) {
|
|
10
|
+
case "top":
|
|
11
|
+
m = {
|
|
12
|
+
x: o,
|
|
13
|
+
y: i.y - n.height
|
|
14
|
+
};
|
|
15
|
+
break;
|
|
16
|
+
case "bottom":
|
|
17
|
+
m = {
|
|
18
|
+
x: o,
|
|
19
|
+
y: i.y + i.height
|
|
20
|
+
};
|
|
21
|
+
break;
|
|
22
|
+
case "right":
|
|
23
|
+
m = {
|
|
24
|
+
x: i.x + i.width,
|
|
25
|
+
y: l
|
|
26
|
+
};
|
|
27
|
+
break;
|
|
28
|
+
case "left":
|
|
29
|
+
m = {
|
|
30
|
+
x: i.x - n.width,
|
|
31
|
+
y: l
|
|
32
|
+
};
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
m = {
|
|
36
|
+
x: i.x,
|
|
37
|
+
y: i.y
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
switch (S(e)) {
|
|
41
|
+
case "start":
|
|
42
|
+
m[a] -= r * (c && h ? -1 : 1);
|
|
43
|
+
break;
|
|
44
|
+
case "end":
|
|
45
|
+
m[a] += r * (c && h ? -1 : 1);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return m;
|
|
49
|
+
}
|
|
50
|
+
async function N(t, e) {
|
|
51
|
+
var c;
|
|
52
|
+
e === void 0 && (e = {});
|
|
53
|
+
const {
|
|
54
|
+
x: i,
|
|
55
|
+
y: n,
|
|
56
|
+
platform: s,
|
|
57
|
+
rects: a,
|
|
58
|
+
elements: d,
|
|
59
|
+
strategy: u
|
|
60
|
+
} = t, {
|
|
61
|
+
boundary: h = "clippingAncestors",
|
|
62
|
+
rootBoundary: o = "viewport",
|
|
63
|
+
elementContext: l = "floating",
|
|
64
|
+
altBoundary: r = !1,
|
|
65
|
+
padding: m = 0
|
|
66
|
+
} = E(e, t), f = H(m), p = d[r ? l === "floating" ? "reference" : "floating" : l], g = k(await s.getClippingRect({
|
|
67
|
+
element: (c = await (s.isElement == null ? void 0 : s.isElement(p))) == null || c ? p : p.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
|
|
68
|
+
boundary: h,
|
|
69
|
+
rootBoundary: o,
|
|
70
|
+
strategy: u
|
|
71
|
+
})), w = l === "floating" ? {
|
|
72
|
+
x: i,
|
|
73
|
+
y: n,
|
|
74
|
+
width: a.floating.width,
|
|
75
|
+
height: a.floating.height
|
|
76
|
+
} : a.reference, v = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), y = await (s.isElement == null ? void 0 : s.isElement(v)) ? await (s.getScale == null ? void 0 : s.getScale(v)) || {
|
|
77
|
+
x: 1,
|
|
78
|
+
y: 1
|
|
79
|
+
} : {
|
|
80
|
+
x: 1,
|
|
81
|
+
y: 1
|
|
82
|
+
}, b = k(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
83
|
+
elements: d,
|
|
84
|
+
rect: w,
|
|
85
|
+
offsetParent: v,
|
|
86
|
+
strategy: u
|
|
87
|
+
}) : w);
|
|
88
|
+
return {
|
|
89
|
+
top: (g.top - b.top + f.top) / y.y,
|
|
90
|
+
bottom: (b.bottom - g.bottom + f.bottom) / y.y,
|
|
91
|
+
left: (g.left - b.left + f.left) / y.x,
|
|
92
|
+
right: (b.right - g.right + f.right) / y.x
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const U = 50, Q = async (t, e, c) => {
|
|
96
|
+
const {
|
|
97
|
+
placement: i = "bottom",
|
|
98
|
+
strategy: n = "absolute",
|
|
99
|
+
middleware: s = [],
|
|
100
|
+
platform: a
|
|
101
|
+
} = c, d = a.detectOverflow ? a : {
|
|
102
|
+
...a,
|
|
103
|
+
detectOverflow: N
|
|
104
|
+
}, u = await (a.isRTL == null ? void 0 : a.isRTL(e));
|
|
105
|
+
let h = await a.getElementRects({
|
|
106
|
+
reference: t,
|
|
107
|
+
floating: e,
|
|
108
|
+
strategy: n
|
|
109
|
+
}), {
|
|
110
|
+
x: o,
|
|
111
|
+
y: l
|
|
112
|
+
} = W(h, i, u), r = i, m = 0;
|
|
113
|
+
const f = {};
|
|
114
|
+
for (let x = 0; x < s.length; x++) {
|
|
115
|
+
const p = s[x];
|
|
116
|
+
if (!p)
|
|
117
|
+
continue;
|
|
118
|
+
const {
|
|
119
|
+
name: g,
|
|
120
|
+
fn: w
|
|
121
|
+
} = p, {
|
|
122
|
+
x: v,
|
|
123
|
+
y,
|
|
124
|
+
data: b,
|
|
125
|
+
reset: O
|
|
126
|
+
} = await w({
|
|
127
|
+
x: o,
|
|
128
|
+
y: l,
|
|
129
|
+
initialPlacement: i,
|
|
130
|
+
placement: r,
|
|
131
|
+
strategy: n,
|
|
132
|
+
middlewareData: f,
|
|
133
|
+
rects: h,
|
|
134
|
+
platform: d,
|
|
135
|
+
elements: {
|
|
136
|
+
reference: t,
|
|
137
|
+
floating: e
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
o = v ?? o, l = y ?? l, f[g] = {
|
|
141
|
+
...f[g],
|
|
142
|
+
...b
|
|
143
|
+
}, O && m < U && (m++, typeof O == "object" && (O.placement && (r = O.placement), O.rects && (h = O.rects === !0 ? await a.getElementRects({
|
|
144
|
+
reference: t,
|
|
145
|
+
floating: e,
|
|
146
|
+
strategy: n
|
|
147
|
+
}) : O.rects), {
|
|
148
|
+
x: o,
|
|
149
|
+
y: l
|
|
150
|
+
} = W(h, r, u)), x = -1);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
x: o,
|
|
154
|
+
y: l,
|
|
155
|
+
placement: r,
|
|
156
|
+
strategy: n,
|
|
157
|
+
middlewareData: f
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
function q(t, e, c) {
|
|
161
|
+
return (t ? [...c.filter((n) => S(n) === t), ...c.filter((n) => S(n) !== t)] : c.filter((n) => D(n) === n)).filter((n) => t ? S(n) === t || (e ? z(n) !== n : !1) : !0);
|
|
162
|
+
}
|
|
163
|
+
const Z = function(t) {
|
|
164
|
+
return t === void 0 && (t = {}), {
|
|
165
|
+
name: "autoPlacement",
|
|
166
|
+
options: t,
|
|
167
|
+
async fn(e) {
|
|
168
|
+
var c, i, n;
|
|
169
|
+
const {
|
|
170
|
+
rects: s,
|
|
171
|
+
middlewareData: a,
|
|
172
|
+
placement: d,
|
|
173
|
+
platform: u,
|
|
174
|
+
elements: h
|
|
175
|
+
} = e, {
|
|
176
|
+
crossAxis: o = !1,
|
|
177
|
+
alignment: l,
|
|
178
|
+
allowedPlacements: r = V,
|
|
179
|
+
autoAlignment: m = !0,
|
|
180
|
+
...f
|
|
181
|
+
} = E(t, e), x = l !== void 0 || r === V ? q(l || null, m, r) : r, p = await u.detectOverflow(e, f), g = ((c = a.autoPlacement) == null ? void 0 : c.index) || 0, w = x[g];
|
|
182
|
+
if (w == null)
|
|
183
|
+
return {};
|
|
184
|
+
const v = Y(w, s, await (u.isRTL == null ? void 0 : u.isRTL(h.floating)));
|
|
185
|
+
if (d !== w)
|
|
186
|
+
return {
|
|
187
|
+
reset: {
|
|
188
|
+
placement: x[0]
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const y = [p[D(w)], p[v[0]], p[v[1]]], b = [...((i = a.autoPlacement) == null ? void 0 : i.overflows) || [], {
|
|
192
|
+
placement: w,
|
|
193
|
+
overflows: y
|
|
194
|
+
}], O = x[g + 1];
|
|
195
|
+
if (O)
|
|
196
|
+
return {
|
|
197
|
+
data: {
|
|
198
|
+
index: g + 1,
|
|
199
|
+
overflows: b
|
|
200
|
+
},
|
|
201
|
+
reset: {
|
|
202
|
+
placement: O
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const P = b.map((A) => {
|
|
206
|
+
const R = S(A.placement);
|
|
207
|
+
return [A.placement, R && o ? (
|
|
208
|
+
// Check along the mainAxis and main crossAxis side.
|
|
209
|
+
A.overflows.slice(0, 2).reduce((M, _) => M + _, 0)
|
|
210
|
+
) : (
|
|
211
|
+
// Check only the mainAxis.
|
|
212
|
+
A.overflows[0]
|
|
213
|
+
), A.overflows];
|
|
214
|
+
}).sort((A, R) => A[1] - R[1]), T = ((n = P.filter((A) => A[2].slice(
|
|
215
|
+
0,
|
|
216
|
+
// Aligned placements should not check their opposite crossAxis
|
|
217
|
+
// side.
|
|
218
|
+
S(A[0]) ? 2 : 3
|
|
219
|
+
).every((R) => R <= 0))[0]) == null ? void 0 : n[0]) || P[0][0];
|
|
220
|
+
return T !== d ? {
|
|
221
|
+
data: {
|
|
222
|
+
index: g + 1,
|
|
223
|
+
overflows: b
|
|
224
|
+
},
|
|
225
|
+
reset: {
|
|
226
|
+
placement: T
|
|
227
|
+
}
|
|
228
|
+
} : {};
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}, G = /* @__PURE__ */ new Set(["left", "top"]);
|
|
232
|
+
async function J(t, e) {
|
|
233
|
+
const {
|
|
234
|
+
placement: c,
|
|
235
|
+
platform: i,
|
|
236
|
+
elements: n
|
|
237
|
+
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(n.floating)), a = D(c), d = S(c), u = $(c) === "y", h = G.has(a) ? -1 : 1, o = s && u ? -1 : 1, l = E(e, t);
|
|
238
|
+
let {
|
|
239
|
+
mainAxis: r,
|
|
240
|
+
crossAxis: m,
|
|
241
|
+
alignmentAxis: f
|
|
242
|
+
} = typeof l == "number" ? {
|
|
243
|
+
mainAxis: l,
|
|
244
|
+
crossAxis: 0,
|
|
245
|
+
alignmentAxis: null
|
|
246
|
+
} : {
|
|
247
|
+
mainAxis: l.mainAxis || 0,
|
|
248
|
+
crossAxis: l.crossAxis || 0,
|
|
249
|
+
alignmentAxis: l.alignmentAxis
|
|
250
|
+
};
|
|
251
|
+
return d && typeof f == "number" && (m = d === "end" ? f * -1 : f), u ? {
|
|
252
|
+
x: m * o,
|
|
253
|
+
y: r * h
|
|
254
|
+
} : {
|
|
255
|
+
x: r * h,
|
|
256
|
+
y: m * o
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
const tt = function(t) {
|
|
260
|
+
return t === void 0 && (t = 0), {
|
|
261
|
+
name: "offset",
|
|
262
|
+
options: t,
|
|
263
|
+
async fn(e) {
|
|
264
|
+
var c, i;
|
|
265
|
+
const {
|
|
266
|
+
x: n,
|
|
267
|
+
y: s,
|
|
268
|
+
placement: a,
|
|
269
|
+
middlewareData: d
|
|
270
|
+
} = e, u = await J(e, t);
|
|
271
|
+
return a === ((c = d.offset) == null ? void 0 : c.placement) && (i = d.arrow) != null && i.alignmentOffset ? {} : {
|
|
272
|
+
x: n + u.x,
|
|
273
|
+
y: s + u.y,
|
|
274
|
+
data: {
|
|
275
|
+
...u,
|
|
276
|
+
placement: a
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}, et = function(t) {
|
|
282
|
+
return t === void 0 && (t = {}), {
|
|
283
|
+
name: "shift",
|
|
284
|
+
options: t,
|
|
285
|
+
async fn(e) {
|
|
286
|
+
const {
|
|
287
|
+
x: c,
|
|
288
|
+
y: i,
|
|
289
|
+
placement: n,
|
|
290
|
+
platform: s
|
|
291
|
+
} = e, {
|
|
292
|
+
mainAxis: a = !0,
|
|
293
|
+
crossAxis: d = !1,
|
|
294
|
+
limiter: u = {
|
|
295
|
+
fn: (g) => {
|
|
296
|
+
let {
|
|
297
|
+
x: w,
|
|
298
|
+
y: v
|
|
299
|
+
} = g;
|
|
300
|
+
return {
|
|
301
|
+
x: w,
|
|
302
|
+
y: v
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
...h
|
|
307
|
+
} = E(t, e), o = {
|
|
308
|
+
x: c,
|
|
309
|
+
y: i
|
|
310
|
+
}, l = await s.detectOverflow(e, h), r = $(D(n)), m = I(r);
|
|
311
|
+
let f = o[m], x = o[r];
|
|
312
|
+
if (a) {
|
|
313
|
+
const g = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", v = f + l[g], y = f - l[w];
|
|
314
|
+
f = F(v, f, y);
|
|
315
|
+
}
|
|
316
|
+
if (d) {
|
|
317
|
+
const g = r === "y" ? "top" : "left", w = r === "y" ? "bottom" : "right", v = x + l[g], y = x - l[w];
|
|
318
|
+
x = F(v, x, y);
|
|
319
|
+
}
|
|
320
|
+
const p = u.fn({
|
|
321
|
+
...e,
|
|
322
|
+
[m]: f,
|
|
323
|
+
[r]: x
|
|
324
|
+
});
|
|
325
|
+
return {
|
|
326
|
+
...p,
|
|
327
|
+
data: {
|
|
328
|
+
x: p.x - c,
|
|
329
|
+
y: p.y - i,
|
|
330
|
+
enabled: {
|
|
331
|
+
[m]: a,
|
|
332
|
+
[r]: d
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}, nt = function(t) {
|
|
339
|
+
return t === void 0 && (t = {}), {
|
|
340
|
+
name: "size",
|
|
341
|
+
options: t,
|
|
342
|
+
async fn(e) {
|
|
343
|
+
var c, i;
|
|
344
|
+
const {
|
|
345
|
+
placement: n,
|
|
346
|
+
rects: s,
|
|
347
|
+
platform: a,
|
|
348
|
+
elements: d
|
|
349
|
+
} = e, {
|
|
350
|
+
apply: u = () => {
|
|
351
|
+
},
|
|
352
|
+
...h
|
|
353
|
+
} = E(t, e), o = await a.detectOverflow(e, h), l = D(n), r = S(n), m = $(n) === "y", {
|
|
354
|
+
width: f,
|
|
355
|
+
height: x
|
|
356
|
+
} = s.floating;
|
|
357
|
+
let p, g;
|
|
358
|
+
l === "top" || l === "bottom" ? (p = l, g = r === (await (a.isRTL == null ? void 0 : a.isRTL(d.floating)) ? "start" : "end") ? "left" : "right") : (g = l, p = r === "end" ? "top" : "bottom");
|
|
359
|
+
const w = x - o.top - o.bottom, v = f - o.left - o.right, y = B(x - o[p], w), b = B(f - o[g], v), O = !e.middlewareData.shift;
|
|
360
|
+
let P = y, L = b;
|
|
361
|
+
if ((c = e.middlewareData.shift) != null && c.enabled.x && (L = v), (i = e.middlewareData.shift) != null && i.enabled.y && (P = w), O && !r) {
|
|
362
|
+
const A = C(o.left, 0), R = C(o.right, 0), M = C(o.top, 0), _ = C(o.bottom, 0);
|
|
363
|
+
m ? L = f - 2 * (A !== 0 || R !== 0 ? A + R : C(o.left, o.right)) : P = x - 2 * (M !== 0 || _ !== 0 ? M + _ : C(o.top, o.bottom));
|
|
364
|
+
}
|
|
365
|
+
await u({
|
|
366
|
+
...e,
|
|
367
|
+
availableWidth: L,
|
|
368
|
+
availableHeight: P
|
|
369
|
+
});
|
|
370
|
+
const T = await a.getDimensions(d.floating);
|
|
371
|
+
return f !== T.width || x !== T.height ? {
|
|
372
|
+
reset: {
|
|
373
|
+
rects: !0
|
|
374
|
+
}
|
|
375
|
+
} : {};
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
export {
|
|
380
|
+
Z as autoPlacement,
|
|
381
|
+
Q as computePosition,
|
|
382
|
+
N as detectOverflow,
|
|
383
|
+
tt as offset,
|
|
384
|
+
k as rectToClientRect,
|
|
385
|
+
et as shift,
|
|
386
|
+
nt as size
|
|
387
|
+
};
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { computePosition as Z, offset as tt, autoPlacement as et, size as ot, shift as it } from "../../core/dist/floating-ui.core.js";
|
|
2
|
+
import { createCoords as g, round as W, rectToClientRect as z, max as T, min as A } from "../../utils/dist/floating-ui.utils.js";
|
|
3
|
+
import { isElement as p, getDocumentElement as x, getComputedStyle as y, isHTMLElement as C, getWindow as R, isTopLayer as D, getParentNode as O, isLastTraversableNode as E, isTableElement as nt, isContainingBlock as X, getContainingBlock as st, getNodeName as N, isOverflowElement as H, getNodeScroll as S, getOverflowAncestors as ct, getFrameElement as M, isWebKit as _ } from "../../utils/dist/floating-ui.utils.dom.js";
|
|
4
|
+
function K(t) {
|
|
5
|
+
const e = y(t);
|
|
6
|
+
let i = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
7
|
+
const n = C(t), c = n ? t.offsetWidth : i, s = n ? t.offsetHeight : o, r = W(i) !== c || W(o) !== s;
|
|
8
|
+
return r && (i = c, o = s), {
|
|
9
|
+
width: i,
|
|
10
|
+
height: o,
|
|
11
|
+
$: r
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function j(t) {
|
|
15
|
+
return p(t) ? t : t.contextElement;
|
|
16
|
+
}
|
|
17
|
+
function L(t) {
|
|
18
|
+
const e = j(t);
|
|
19
|
+
if (!C(e))
|
|
20
|
+
return g(1);
|
|
21
|
+
const i = e.getBoundingClientRect(), {
|
|
22
|
+
width: o,
|
|
23
|
+
height: n,
|
|
24
|
+
$: c
|
|
25
|
+
} = K(e);
|
|
26
|
+
let s = (c ? W(i.width) : i.width) / o, r = (c ? W(i.height) : i.height) / n;
|
|
27
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
28
|
+
x: s,
|
|
29
|
+
y: r
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const rt = /* @__PURE__ */ g(0);
|
|
33
|
+
function q(t) {
|
|
34
|
+
const e = R(t);
|
|
35
|
+
return !_() || !e.visualViewport ? rt : {
|
|
36
|
+
x: e.visualViewport.offsetLeft,
|
|
37
|
+
y: e.visualViewport.offsetTop
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function lt(t, e, i) {
|
|
41
|
+
return e === void 0 && (e = !1), !i || e && i !== R(t) ? !1 : e;
|
|
42
|
+
}
|
|
43
|
+
function v(t, e, i, o) {
|
|
44
|
+
e === void 0 && (e = !1), i === void 0 && (i = !1);
|
|
45
|
+
const n = t.getBoundingClientRect(), c = j(t);
|
|
46
|
+
let s = g(1);
|
|
47
|
+
e && (o ? p(o) && (s = L(o)) : s = L(t));
|
|
48
|
+
const r = lt(c, i, o) ? q(c) : g(0);
|
|
49
|
+
let l = (n.left + r.x) / s.x, f = (n.top + r.y) / s.y, u = n.width / s.x, h = n.height / s.y;
|
|
50
|
+
if (c) {
|
|
51
|
+
const d = R(c), a = o && p(o) ? R(o) : o;
|
|
52
|
+
let m = d, w = M(m);
|
|
53
|
+
for (; w && o && a !== m; ) {
|
|
54
|
+
const b = L(w), V = w.getBoundingClientRect(), $ = y(w), U = V.left + (w.clientLeft + parseFloat($.paddingLeft)) * b.x, Y = V.top + (w.clientTop + parseFloat($.paddingTop)) * b.y;
|
|
55
|
+
l *= b.x, f *= b.y, u *= b.x, h *= b.y, l += U, f += Y, m = R(w), w = M(m);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return z({
|
|
59
|
+
width: u,
|
|
60
|
+
height: h,
|
|
61
|
+
x: l,
|
|
62
|
+
y: f
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function B(t, e) {
|
|
66
|
+
const i = S(t).scrollLeft;
|
|
67
|
+
return e ? e.left + i : v(x(t)).left + i;
|
|
68
|
+
}
|
|
69
|
+
function G(t, e) {
|
|
70
|
+
const i = t.getBoundingClientRect(), o = i.left + e.scrollLeft - B(t, i), n = i.top + e.scrollTop;
|
|
71
|
+
return {
|
|
72
|
+
x: o,
|
|
73
|
+
y: n
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function ft(t) {
|
|
77
|
+
let {
|
|
78
|
+
elements: e,
|
|
79
|
+
rect: i,
|
|
80
|
+
offsetParent: o,
|
|
81
|
+
strategy: n
|
|
82
|
+
} = t;
|
|
83
|
+
const c = n === "fixed", s = x(o), r = e ? D(e.floating) : !1;
|
|
84
|
+
if (o === s || r && c)
|
|
85
|
+
return i;
|
|
86
|
+
let l = {
|
|
87
|
+
scrollLeft: 0,
|
|
88
|
+
scrollTop: 0
|
|
89
|
+
}, f = g(1);
|
|
90
|
+
const u = g(0), h = C(o);
|
|
91
|
+
if ((h || !h && !c) && ((N(o) !== "body" || H(s)) && (l = S(o)), h)) {
|
|
92
|
+
const a = v(o);
|
|
93
|
+
f = L(o), u.x = a.x + o.clientLeft, u.y = a.y + o.clientTop;
|
|
94
|
+
}
|
|
95
|
+
const d = s && !h && !c ? G(s, l) : g(0);
|
|
96
|
+
return {
|
|
97
|
+
width: i.width * f.x,
|
|
98
|
+
height: i.height * f.y,
|
|
99
|
+
x: i.x * f.x - l.scrollLeft * f.x + u.x + d.x,
|
|
100
|
+
y: i.y * f.y - l.scrollTop * f.y + u.y + d.y
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function ut(t) {
|
|
104
|
+
return Array.from(t.getClientRects());
|
|
105
|
+
}
|
|
106
|
+
function ht(t) {
|
|
107
|
+
const e = x(t), i = S(t), o = t.ownerDocument.body, n = T(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), c = T(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
108
|
+
let s = -i.scrollLeft + B(t);
|
|
109
|
+
const r = -i.scrollTop;
|
|
110
|
+
return y(o).direction === "rtl" && (s += T(e.clientWidth, o.clientWidth) - n), {
|
|
111
|
+
width: n,
|
|
112
|
+
height: c,
|
|
113
|
+
x: s,
|
|
114
|
+
y: r
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const I = 25;
|
|
118
|
+
function at(t, e) {
|
|
119
|
+
const i = R(t), o = x(t), n = i.visualViewport;
|
|
120
|
+
let c = o.clientWidth, s = o.clientHeight, r = 0, l = 0;
|
|
121
|
+
if (n) {
|
|
122
|
+
c = n.width, s = n.height;
|
|
123
|
+
const u = _();
|
|
124
|
+
(!u || u && e === "fixed") && (r = n.offsetLeft, l = n.offsetTop);
|
|
125
|
+
}
|
|
126
|
+
const f = B(o);
|
|
127
|
+
if (f <= 0) {
|
|
128
|
+
const u = o.ownerDocument, h = u.body, d = getComputedStyle(h), a = u.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, m = Math.abs(o.clientWidth - h.clientWidth - a);
|
|
129
|
+
m <= I && (c -= m);
|
|
130
|
+
} else f <= I && (c += f);
|
|
131
|
+
return {
|
|
132
|
+
width: c,
|
|
133
|
+
height: s,
|
|
134
|
+
x: r,
|
|
135
|
+
y: l
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function dt(t, e) {
|
|
139
|
+
const i = v(t, !0, e === "fixed"), o = i.top + t.clientTop, n = i.left + t.clientLeft, c = C(t) ? L(t) : g(1), s = t.clientWidth * c.x, r = t.clientHeight * c.y, l = n * c.x, f = o * c.y;
|
|
140
|
+
return {
|
|
141
|
+
width: s,
|
|
142
|
+
height: r,
|
|
143
|
+
x: l,
|
|
144
|
+
y: f
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function P(t, e, i) {
|
|
148
|
+
let o;
|
|
149
|
+
if (e === "viewport")
|
|
150
|
+
o = at(t, i);
|
|
151
|
+
else if (e === "document")
|
|
152
|
+
o = ht(x(t));
|
|
153
|
+
else if (p(e))
|
|
154
|
+
o = dt(e, i);
|
|
155
|
+
else {
|
|
156
|
+
const n = q(t);
|
|
157
|
+
o = {
|
|
158
|
+
x: e.x - n.x,
|
|
159
|
+
y: e.y - n.y,
|
|
160
|
+
width: e.width,
|
|
161
|
+
height: e.height
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return z(o);
|
|
165
|
+
}
|
|
166
|
+
function J(t, e) {
|
|
167
|
+
const i = O(t);
|
|
168
|
+
return i === e || !p(i) || E(i) ? !1 : y(i).position === "fixed" || J(i, e);
|
|
169
|
+
}
|
|
170
|
+
function gt(t, e) {
|
|
171
|
+
const i = e.get(t);
|
|
172
|
+
if (i)
|
|
173
|
+
return i;
|
|
174
|
+
let o = ct(t, []).filter((r) => p(r) && N(r) !== "body"), n = null;
|
|
175
|
+
const c = y(t).position === "fixed";
|
|
176
|
+
let s = c ? O(t) : t;
|
|
177
|
+
for (; p(s) && !E(s); ) {
|
|
178
|
+
const r = y(s), l = X(s);
|
|
179
|
+
!l && r.position === "fixed" && (n = null), (c ? !l && !n : !l && r.position === "static" && !!n && (n.position === "absolute" || n.position === "fixed") || H(s) && !l && J(t, s)) ? o = o.filter((u) => u !== s) : n = r, s = O(s);
|
|
180
|
+
}
|
|
181
|
+
return e.set(t, o), o;
|
|
182
|
+
}
|
|
183
|
+
function pt(t) {
|
|
184
|
+
let {
|
|
185
|
+
element: e,
|
|
186
|
+
boundary: i,
|
|
187
|
+
rootBoundary: o,
|
|
188
|
+
strategy: n
|
|
189
|
+
} = t;
|
|
190
|
+
const s = [...i === "clippingAncestors" ? D(e) ? [] : gt(e, this._c) : [].concat(i), o], r = P(e, s[0], n);
|
|
191
|
+
let l = r.top, f = r.right, u = r.bottom, h = r.left;
|
|
192
|
+
for (let d = 1; d < s.length; d++) {
|
|
193
|
+
const a = P(e, s[d], n);
|
|
194
|
+
l = T(a.top, l), f = A(a.right, f), u = A(a.bottom, u), h = T(a.left, h);
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
width: f - h,
|
|
198
|
+
height: u - l,
|
|
199
|
+
x: h,
|
|
200
|
+
y: l
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function yt(t) {
|
|
204
|
+
const {
|
|
205
|
+
width: e,
|
|
206
|
+
height: i
|
|
207
|
+
} = K(t);
|
|
208
|
+
return {
|
|
209
|
+
width: e,
|
|
210
|
+
height: i
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function wt(t, e, i) {
|
|
214
|
+
const o = C(e), n = x(e), c = i === "fixed", s = v(t, !0, c, e);
|
|
215
|
+
let r = {
|
|
216
|
+
scrollLeft: 0,
|
|
217
|
+
scrollTop: 0
|
|
218
|
+
};
|
|
219
|
+
const l = g(0);
|
|
220
|
+
function f() {
|
|
221
|
+
l.x = B(n);
|
|
222
|
+
}
|
|
223
|
+
if (o || !o && !c)
|
|
224
|
+
if ((N(e) !== "body" || H(n)) && (r = S(e)), o) {
|
|
225
|
+
const a = v(e, !0, c, e);
|
|
226
|
+
l.x = a.x + e.clientLeft, l.y = a.y + e.clientTop;
|
|
227
|
+
} else n && f();
|
|
228
|
+
c && !o && n && f();
|
|
229
|
+
const u = n && !o && !c ? G(n, r) : g(0), h = s.left + r.scrollLeft - l.x - u.x, d = s.top + r.scrollTop - l.y - u.y;
|
|
230
|
+
return {
|
|
231
|
+
x: h,
|
|
232
|
+
y: d,
|
|
233
|
+
width: s.width,
|
|
234
|
+
height: s.height
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function F(t) {
|
|
238
|
+
return y(t).position === "static";
|
|
239
|
+
}
|
|
240
|
+
function k(t, e) {
|
|
241
|
+
if (!C(t) || y(t).position === "fixed")
|
|
242
|
+
return null;
|
|
243
|
+
if (e)
|
|
244
|
+
return e(t);
|
|
245
|
+
let i = t.offsetParent;
|
|
246
|
+
return x(t) === i && (i = i.ownerDocument.body), i;
|
|
247
|
+
}
|
|
248
|
+
function Q(t, e) {
|
|
249
|
+
const i = R(t);
|
|
250
|
+
if (D(t))
|
|
251
|
+
return i;
|
|
252
|
+
if (!C(t)) {
|
|
253
|
+
let n = O(t);
|
|
254
|
+
for (; n && !E(n); ) {
|
|
255
|
+
if (p(n) && !F(n))
|
|
256
|
+
return n;
|
|
257
|
+
n = O(n);
|
|
258
|
+
}
|
|
259
|
+
return i;
|
|
260
|
+
}
|
|
261
|
+
let o = k(t, e);
|
|
262
|
+
for (; o && nt(o) && F(o); )
|
|
263
|
+
o = k(o, e);
|
|
264
|
+
return o && E(o) && F(o) && !X(o) ? i : o || st(t) || i;
|
|
265
|
+
}
|
|
266
|
+
const xt = async function(t) {
|
|
267
|
+
const e = this.getOffsetParent || Q, i = this.getDimensions, o = await i(t.floating);
|
|
268
|
+
return {
|
|
269
|
+
reference: wt(t.reference, await e(t.floating), t.strategy),
|
|
270
|
+
floating: {
|
|
271
|
+
x: 0,
|
|
272
|
+
y: 0,
|
|
273
|
+
width: o.width,
|
|
274
|
+
height: o.height
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
function mt(t) {
|
|
279
|
+
return y(t).direction === "rtl";
|
|
280
|
+
}
|
|
281
|
+
const Rt = {
|
|
282
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ft,
|
|
283
|
+
getDocumentElement: x,
|
|
284
|
+
getClippingRect: pt,
|
|
285
|
+
getOffsetParent: Q,
|
|
286
|
+
getElementRects: xt,
|
|
287
|
+
getClientRects: ut,
|
|
288
|
+
getDimensions: yt,
|
|
289
|
+
getScale: L,
|
|
290
|
+
isElement: p,
|
|
291
|
+
isRTL: mt
|
|
292
|
+
}, Tt = tt, Ot = et, vt = it, Wt = ot, Et = (t, e, i) => {
|
|
293
|
+
const o = /* @__PURE__ */ new Map(), n = {
|
|
294
|
+
platform: Rt,
|
|
295
|
+
...i
|
|
296
|
+
}, c = {
|
|
297
|
+
...n.platform,
|
|
298
|
+
_c: o
|
|
299
|
+
};
|
|
300
|
+
return Z(t, e, {
|
|
301
|
+
...n,
|
|
302
|
+
platform: c
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
export {
|
|
306
|
+
Ot as autoPlacement,
|
|
307
|
+
Et as computePosition,
|
|
308
|
+
ct as getOverflowAncestors,
|
|
309
|
+
Tt as offset,
|
|
310
|
+
Rt as platform,
|
|
311
|
+
vt as shift,
|
|
312
|
+
Wt as size
|
|
313
|
+
};
|