wj-elements 0.1.55 → 0.1.56
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/README.md +1 -1
- package/dist/{popup.element-CWsSOxs2.js → popup.element-B5H6XOX0.js} +277 -292
- package/dist/wje-accordion-item.js +10 -10
- package/dist/wje-dropdown.js +11 -7
- package/dist/wje-icon-picker.js +1 -1
- package/dist/wje-master.js +1 -1
- package/dist/wje-popup.js +1 -1
- package/dist/wje-select.js +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var st = (t, e, n) => (
|
|
4
|
-
import Tt, { event as
|
|
5
|
-
const
|
|
1
|
+
var Lt = Object.defineProperty;
|
|
2
|
+
var Ot = (t, e, n) => e in t ? Lt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var st = (t, e, n) => (Ot(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import Tt, { event as G } from "./wje-element.js";
|
|
5
|
+
const F = Math.min, C = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
|
|
6
6
|
x: t,
|
|
7
7
|
y: t
|
|
8
|
-
}),
|
|
8
|
+
}), St = {
|
|
9
9
|
left: "right",
|
|
10
10
|
right: "left",
|
|
11
11
|
bottom: "top",
|
|
12
12
|
top: "bottom"
|
|
13
|
-
},
|
|
13
|
+
}, Pt = {
|
|
14
14
|
start: "end",
|
|
15
15
|
end: "start"
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function Dt(t, e, n) {
|
|
18
|
+
return C(t, F(e, n));
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function J(t, e) {
|
|
21
21
|
return typeof t == "function" ? t(e) : t;
|
|
22
22
|
}
|
|
23
23
|
function j(t) {
|
|
24
24
|
return t.split("-")[0];
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function $(t) {
|
|
27
27
|
return t.split("-")[1];
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function kt(t) {
|
|
30
30
|
return t === "x" ? "y" : "x";
|
|
31
31
|
}
|
|
32
32
|
function ct(t) {
|
|
@@ -36,12 +36,12 @@ function nt(t) {
|
|
|
36
36
|
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
37
37
|
}
|
|
38
38
|
function lt(t) {
|
|
39
|
-
return
|
|
39
|
+
return kt(nt(t));
|
|
40
40
|
}
|
|
41
41
|
function Ht(t, e, n) {
|
|
42
42
|
n === void 0 && (n = !1);
|
|
43
|
-
const
|
|
44
|
-
let r =
|
|
43
|
+
const i = $(t), o = lt(t), s = ct(o);
|
|
44
|
+
let r = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
45
45
|
return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
|
|
46
46
|
}
|
|
47
47
|
function Wt(t) {
|
|
@@ -49,14 +49,14 @@ function Wt(t) {
|
|
|
49
49
|
return [rt(t), e, rt(e)];
|
|
50
50
|
}
|
|
51
51
|
function rt(t) {
|
|
52
|
-
return t.replace(/start|end/g, (e) =>
|
|
52
|
+
return t.replace(/start|end/g, (e) => Pt[e]);
|
|
53
53
|
}
|
|
54
54
|
function Mt(t, e, n) {
|
|
55
|
-
const
|
|
55
|
+
const i = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
56
56
|
switch (t) {
|
|
57
57
|
case "top":
|
|
58
58
|
case "bottom":
|
|
59
|
-
return n ? e ?
|
|
59
|
+
return n ? e ? o : i : e ? i : o;
|
|
60
60
|
case "left":
|
|
61
61
|
case "right":
|
|
62
62
|
return e ? s : r;
|
|
@@ -64,15 +64,15 @@ function Mt(t, e, n) {
|
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
let s = Mt(j(t), n === "start",
|
|
70
|
-
return
|
|
67
|
+
function Nt(t, e, n, i) {
|
|
68
|
+
const o = $(t);
|
|
69
|
+
let s = Mt(j(t), n === "start", i);
|
|
70
|
+
return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(rt)))), s;
|
|
71
71
|
}
|
|
72
72
|
function tt(t) {
|
|
73
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
73
|
+
return t.replace(/left|right|bottom|top/g, (e) => St[e]);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Ft(t) {
|
|
76
76
|
return {
|
|
77
77
|
top: 0,
|
|
78
78
|
right: 0,
|
|
@@ -82,7 +82,7 @@ function Nt(t) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
function gt(t) {
|
|
85
|
-
return typeof t != "number" ?
|
|
85
|
+
return typeof t != "number" ? Ft(t) : {
|
|
86
86
|
top: t,
|
|
87
87
|
right: t,
|
|
88
88
|
bottom: t,
|
|
@@ -100,43 +100,43 @@ function et(t) {
|
|
|
100
100
|
}
|
|
101
101
|
function ht(t, e, n) {
|
|
102
102
|
let {
|
|
103
|
-
reference:
|
|
104
|
-
floating:
|
|
103
|
+
reference: i,
|
|
104
|
+
floating: o
|
|
105
105
|
} = t;
|
|
106
|
-
const s = nt(e), r = lt(e), l = ct(r), c = j(e), a = s === "y", d =
|
|
106
|
+
const s = nt(e), r = lt(e), l = ct(r), c = j(e), a = s === "y", d = i.x + i.width / 2 - o.width / 2, h = i.y + i.height / 2 - o.height / 2, p = i[l] / 2 - o[l] / 2;
|
|
107
107
|
let f;
|
|
108
108
|
switch (c) {
|
|
109
109
|
case "top":
|
|
110
110
|
f = {
|
|
111
111
|
x: d,
|
|
112
|
-
y:
|
|
112
|
+
y: i.y - o.height
|
|
113
113
|
};
|
|
114
114
|
break;
|
|
115
115
|
case "bottom":
|
|
116
116
|
f = {
|
|
117
117
|
x: d,
|
|
118
|
-
y:
|
|
118
|
+
y: i.y + i.height
|
|
119
119
|
};
|
|
120
120
|
break;
|
|
121
121
|
case "right":
|
|
122
122
|
f = {
|
|
123
|
-
x:
|
|
123
|
+
x: i.x + i.width,
|
|
124
124
|
y: h
|
|
125
125
|
};
|
|
126
126
|
break;
|
|
127
127
|
case "left":
|
|
128
128
|
f = {
|
|
129
|
-
x:
|
|
129
|
+
x: i.x - o.width,
|
|
130
130
|
y: h
|
|
131
131
|
};
|
|
132
132
|
break;
|
|
133
133
|
default:
|
|
134
134
|
f = {
|
|
135
|
-
x:
|
|
136
|
-
y:
|
|
135
|
+
x: i.x,
|
|
136
|
+
y: i.y
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
switch (
|
|
139
|
+
switch ($(e)) {
|
|
140
140
|
case "start":
|
|
141
141
|
f[r] -= p * (n && a ? -1 : 1);
|
|
142
142
|
break;
|
|
@@ -148,34 +148,34 @@ function ht(t, e, n) {
|
|
|
148
148
|
}
|
|
149
149
|
const Bt = async (t, e, n) => {
|
|
150
150
|
const {
|
|
151
|
-
placement:
|
|
152
|
-
strategy:
|
|
151
|
+
placement: i = "bottom",
|
|
152
|
+
strategy: o = "absolute",
|
|
153
153
|
middleware: s = [],
|
|
154
154
|
platform: r
|
|
155
155
|
} = n, l = s.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
156
156
|
let a = await r.getElementRects({
|
|
157
157
|
reference: t,
|
|
158
158
|
floating: e,
|
|
159
|
-
strategy:
|
|
159
|
+
strategy: o
|
|
160
160
|
}), {
|
|
161
161
|
x: d,
|
|
162
162
|
y: h
|
|
163
|
-
} = ht(a,
|
|
163
|
+
} = ht(a, i, c), p = i, f = {}, u = 0;
|
|
164
164
|
for (let m = 0; m < l.length; m++) {
|
|
165
165
|
const {
|
|
166
166
|
name: w,
|
|
167
167
|
fn: g
|
|
168
168
|
} = l[m], {
|
|
169
169
|
x,
|
|
170
|
-
y
|
|
170
|
+
y,
|
|
171
171
|
data: A,
|
|
172
172
|
reset: v
|
|
173
173
|
} = await g({
|
|
174
174
|
x: d,
|
|
175
175
|
y: h,
|
|
176
|
-
initialPlacement:
|
|
176
|
+
initialPlacement: i,
|
|
177
177
|
placement: p,
|
|
178
|
-
strategy:
|
|
178
|
+
strategy: o,
|
|
179
179
|
middlewareData: f,
|
|
180
180
|
rects: a,
|
|
181
181
|
platform: r,
|
|
@@ -184,7 +184,7 @@ const Bt = async (t, e, n) => {
|
|
|
184
184
|
floating: e
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
if (d = x ?? d, h =
|
|
187
|
+
if (d = x ?? d, h = y ?? h, f = {
|
|
188
188
|
...f,
|
|
189
189
|
[w]: {
|
|
190
190
|
...f[w],
|
|
@@ -194,7 +194,7 @@ const Bt = async (t, e, n) => {
|
|
|
194
194
|
u++, typeof v == "object" && (v.placement && (p = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
|
|
195
195
|
reference: t,
|
|
196
196
|
floating: e,
|
|
197
|
-
strategy:
|
|
197
|
+
strategy: o
|
|
198
198
|
}) : v.rects), {
|
|
199
199
|
x: d,
|
|
200
200
|
y: h
|
|
@@ -206,7 +206,7 @@ const Bt = async (t, e, n) => {
|
|
|
206
206
|
x: d,
|
|
207
207
|
y: h,
|
|
208
208
|
placement: p,
|
|
209
|
-
strategy:
|
|
209
|
+
strategy: o,
|
|
210
210
|
middlewareData: f
|
|
211
211
|
};
|
|
212
212
|
};
|
|
@@ -214,8 +214,8 @@ async function wt(t, e) {
|
|
|
214
214
|
var n;
|
|
215
215
|
e === void 0 && (e = {});
|
|
216
216
|
const {
|
|
217
|
-
x:
|
|
218
|
-
y:
|
|
217
|
+
x: i,
|
|
218
|
+
y: o,
|
|
219
219
|
platform: s,
|
|
220
220
|
rects: r,
|
|
221
221
|
elements: l,
|
|
@@ -226,16 +226,16 @@ async function wt(t, e) {
|
|
|
226
226
|
elementContext: h = "floating",
|
|
227
227
|
altBoundary: p = !1,
|
|
228
228
|
padding: f = 0
|
|
229
|
-
} =
|
|
229
|
+
} = J(e, t), u = gt(f), w = l[p ? h === "floating" ? "reference" : "floating" : h], g = et(await s.getClippingRect({
|
|
230
230
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
231
231
|
boundary: a,
|
|
232
232
|
rootBoundary: d,
|
|
233
233
|
strategy: c
|
|
234
234
|
})), x = h === "floating" ? {
|
|
235
235
|
...r.floating,
|
|
236
|
-
x:
|
|
237
|
-
y:
|
|
238
|
-
} : r.reference,
|
|
236
|
+
x: i,
|
|
237
|
+
y: o
|
|
238
|
+
} : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), A = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
|
|
239
239
|
x: 1,
|
|
240
240
|
y: 1
|
|
241
241
|
} : {
|
|
@@ -243,7 +243,7 @@ async function wt(t, e) {
|
|
|
243
243
|
y: 1
|
|
244
244
|
}, v = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
245
245
|
rect: x,
|
|
246
|
-
offsetParent:
|
|
246
|
+
offsetParent: y,
|
|
247
247
|
strategy: c
|
|
248
248
|
}) : x);
|
|
249
249
|
return {
|
|
@@ -259,8 +259,8 @@ const Vt = (t) => ({
|
|
|
259
259
|
async fn(e) {
|
|
260
260
|
const {
|
|
261
261
|
x: n,
|
|
262
|
-
y:
|
|
263
|
-
placement:
|
|
262
|
+
y: i,
|
|
263
|
+
placement: o,
|
|
264
264
|
rects: s,
|
|
265
265
|
platform: r,
|
|
266
266
|
elements: l,
|
|
@@ -268,26 +268,26 @@ const Vt = (t) => ({
|
|
|
268
268
|
} = e, {
|
|
269
269
|
element: a,
|
|
270
270
|
padding: d = 0
|
|
271
|
-
} =
|
|
271
|
+
} = J(t, e) || {};
|
|
272
272
|
if (a == null)
|
|
273
273
|
return {};
|
|
274
274
|
const h = gt(d), p = {
|
|
275
275
|
x: n,
|
|
276
|
-
y:
|
|
277
|
-
}, f = lt(
|
|
278
|
-
let E =
|
|
279
|
-
(!E || !await (r.isElement == null ? void 0 : r.isElement(
|
|
280
|
-
const
|
|
276
|
+
y: i
|
|
277
|
+
}, f = lt(o), u = ct(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", A = s.reference[u] + s.reference[f] - p[f] - s.floating[u], v = p[f] - s.reference[f], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
|
|
278
|
+
let E = b ? b[y] : 0;
|
|
279
|
+
(!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = l.floating[y] || s.floating[u]);
|
|
280
|
+
const S = A / 2 - v / 2, N = E / 2 - m[u] / 2 - 1, Y = F(h[g], N), X = F(h[x], N), O = Y, q = E - m[u] - X, R = E / 2 - m[u] / 2 + S, P = Dt(O, R, q), D = !c.arrow && $(o) != null && R != P && s.reference[u] / 2 - (R < O ? Y : X) - m[u] / 2 < 0, H = D ? R < O ? R - O : R - q : 0;
|
|
281
281
|
return {
|
|
282
282
|
[f]: p[f] + H,
|
|
283
283
|
data: {
|
|
284
|
-
[f]:
|
|
285
|
-
centerOffset:
|
|
286
|
-
...
|
|
284
|
+
[f]: P,
|
|
285
|
+
centerOffset: R - P - H,
|
|
286
|
+
...D && {
|
|
287
287
|
alignmentOffset: H
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
|
-
reset:
|
|
290
|
+
reset: D
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
293
|
}), jt = function(t) {
|
|
@@ -295,9 +295,9 @@ const Vt = (t) => ({
|
|
|
295
295
|
name: "flip",
|
|
296
296
|
options: t,
|
|
297
297
|
async fn(e) {
|
|
298
|
-
var n,
|
|
298
|
+
var n, i;
|
|
299
299
|
const {
|
|
300
|
-
placement:
|
|
300
|
+
placement: o,
|
|
301
301
|
middlewareData: s,
|
|
302
302
|
rects: r,
|
|
303
303
|
initialPlacement: l,
|
|
@@ -311,50 +311,50 @@ const Vt = (t) => ({
|
|
|
311
311
|
fallbackAxisSideDirection: u = "none",
|
|
312
312
|
flipAlignment: m = !0,
|
|
313
313
|
...w
|
|
314
|
-
} =
|
|
314
|
+
} = J(t, e);
|
|
315
315
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
316
316
|
return {};
|
|
317
|
-
const g = j(
|
|
318
|
-
!p && u !== "none" && A.push(...
|
|
319
|
-
const v = [l, ...A],
|
|
320
|
-
let
|
|
321
|
-
if (d && E.push(
|
|
322
|
-
const
|
|
323
|
-
E.push(
|
|
317
|
+
const g = j(o), x = j(l) === l, y = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = p || (x || !m ? [tt(l)] : Wt(l));
|
|
318
|
+
!p && u !== "none" && A.push(...Nt(l, m, u, y));
|
|
319
|
+
const v = [l, ...A], b = await wt(e, w), E = [];
|
|
320
|
+
let S = ((i = s.flip) == null ? void 0 : i.overflows) || [];
|
|
321
|
+
if (d && E.push(b[g]), h) {
|
|
322
|
+
const O = Ht(o, r, y);
|
|
323
|
+
E.push(b[O[0]], b[O[1]]);
|
|
324
324
|
}
|
|
325
|
-
if (
|
|
326
|
-
placement:
|
|
325
|
+
if (S = [...S, {
|
|
326
|
+
placement: o,
|
|
327
327
|
overflows: E
|
|
328
|
-
}], !E.every((
|
|
329
|
-
var
|
|
330
|
-
const
|
|
328
|
+
}], !E.every((O) => O <= 0)) {
|
|
329
|
+
var N, Y;
|
|
330
|
+
const O = (((N = s.flip) == null ? void 0 : N.index) || 0) + 1, q = v[O];
|
|
331
331
|
if (q)
|
|
332
332
|
return {
|
|
333
333
|
data: {
|
|
334
|
-
index:
|
|
335
|
-
overflows:
|
|
334
|
+
index: O,
|
|
335
|
+
overflows: S
|
|
336
336
|
},
|
|
337
337
|
reset: {
|
|
338
338
|
placement: q
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
|
-
let
|
|
342
|
-
if (!
|
|
341
|
+
let R = (Y = S.filter((P) => P.overflows[0] <= 0).sort((P, D) => P.overflows[1] - D.overflows[1])[0]) == null ? void 0 : Y.placement;
|
|
342
|
+
if (!R)
|
|
343
343
|
switch (f) {
|
|
344
344
|
case "bestFit": {
|
|
345
345
|
var X;
|
|
346
|
-
const
|
|
347
|
-
|
|
346
|
+
const P = (X = S.map((D) => [D.placement, D.overflows.filter((H) => H > 0).reduce((H, Ct) => H + Ct, 0)]).sort((D, H) => D[1] - H[1])[0]) == null ? void 0 : X[0];
|
|
347
|
+
P && (R = P);
|
|
348
348
|
break;
|
|
349
349
|
}
|
|
350
350
|
case "initialPlacement":
|
|
351
|
-
|
|
351
|
+
R = l;
|
|
352
352
|
break;
|
|
353
353
|
}
|
|
354
|
-
if (
|
|
354
|
+
if (o !== R)
|
|
355
355
|
return {
|
|
356
356
|
reset: {
|
|
357
|
-
placement:
|
|
357
|
+
placement: R
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
}
|
|
@@ -362,12 +362,12 @@ const Vt = (t) => ({
|
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
364
|
};
|
|
365
|
-
async function
|
|
365
|
+
async function _t(t, e) {
|
|
366
366
|
const {
|
|
367
367
|
placement: n,
|
|
368
|
-
platform:
|
|
369
|
-
elements:
|
|
370
|
-
} = t, s = await (
|
|
368
|
+
platform: i,
|
|
369
|
+
elements: o
|
|
370
|
+
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r = j(n), l = $(n), c = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, h = J(e, t);
|
|
371
371
|
let {
|
|
372
372
|
mainAxis: p,
|
|
373
373
|
crossAxis: f,
|
|
@@ -390,61 +390,61 @@ async function zt(t, e) {
|
|
|
390
390
|
y: f * d
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
const
|
|
393
|
+
const It = function(t) {
|
|
394
394
|
return t === void 0 && (t = 0), {
|
|
395
395
|
name: "offset",
|
|
396
396
|
options: t,
|
|
397
397
|
async fn(e) {
|
|
398
398
|
const {
|
|
399
399
|
x: n,
|
|
400
|
-
y:
|
|
401
|
-
} = e,
|
|
400
|
+
y: i
|
|
401
|
+
} = e, o = await _t(e, t);
|
|
402
402
|
return {
|
|
403
|
-
x: n +
|
|
404
|
-
y:
|
|
405
|
-
data:
|
|
403
|
+
x: n + o.x,
|
|
404
|
+
y: i + o.y,
|
|
405
|
+
data: o
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
};
|
|
409
|
-
},
|
|
409
|
+
}, zt = function(t) {
|
|
410
410
|
return t === void 0 && (t = {}), {
|
|
411
411
|
name: "size",
|
|
412
412
|
options: t,
|
|
413
413
|
async fn(e) {
|
|
414
414
|
const {
|
|
415
415
|
placement: n,
|
|
416
|
-
rects:
|
|
417
|
-
platform:
|
|
416
|
+
rects: i,
|
|
417
|
+
platform: o,
|
|
418
418
|
elements: s
|
|
419
419
|
} = e, {
|
|
420
420
|
apply: r = () => {
|
|
421
421
|
},
|
|
422
422
|
...l
|
|
423
|
-
} =
|
|
423
|
+
} = J(t, e), c = await wt(e, l), a = j(n), d = $(n), h = nt(n) === "y", {
|
|
424
424
|
width: p,
|
|
425
425
|
height: f
|
|
426
|
-
} =
|
|
426
|
+
} = i.floating;
|
|
427
427
|
let u, m;
|
|
428
|
-
a === "top" || a === "bottom" ? (u = a, m = d === (await (
|
|
428
|
+
a === "top" || a === "bottom" ? (u = a, m = d === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, u = d === "end" ? "top" : "bottom");
|
|
429
429
|
const w = f - c[u], g = p - c[m], x = !e.middlewareData.shift;
|
|
430
|
-
let
|
|
430
|
+
let y = w, A = g;
|
|
431
431
|
if (h) {
|
|
432
|
-
const
|
|
433
|
-
A = d || x ?
|
|
432
|
+
const b = p - c.left - c.right;
|
|
433
|
+
A = d || x ? F(g, b) : b;
|
|
434
434
|
} else {
|
|
435
|
-
const
|
|
436
|
-
|
|
435
|
+
const b = f - c.top - c.bottom;
|
|
436
|
+
y = d || x ? F(w, b) : b;
|
|
437
437
|
}
|
|
438
438
|
if (x && !d) {
|
|
439
|
-
const
|
|
440
|
-
h ? A = p - 2 * (
|
|
439
|
+
const b = C(c.left, 0), E = C(c.right, 0), S = C(c.top, 0), N = C(c.bottom, 0);
|
|
440
|
+
h ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : C(c.left, c.right)) : y = f - 2 * (S !== 0 || N !== 0 ? S + N : C(c.top, c.bottom));
|
|
441
441
|
}
|
|
442
442
|
await r({
|
|
443
443
|
...e,
|
|
444
444
|
availableWidth: A,
|
|
445
|
-
availableHeight:
|
|
445
|
+
availableHeight: y
|
|
446
446
|
});
|
|
447
|
-
const v = await
|
|
447
|
+
const v = await o.getDimensions(s.floating);
|
|
448
448
|
return p !== v.width || f !== v.height ? {
|
|
449
449
|
reset: {
|
|
450
450
|
rects: !0
|
|
@@ -456,7 +456,7 @@ const $t = function(t) {
|
|
|
456
456
|
function V(t) {
|
|
457
457
|
return vt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function L(t) {
|
|
460
460
|
var e;
|
|
461
461
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
462
462
|
}
|
|
@@ -465,52 +465,52 @@ function M(t) {
|
|
|
465
465
|
return (e = (vt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
466
466
|
}
|
|
467
467
|
function vt(t) {
|
|
468
|
-
return t instanceof Node || t instanceof
|
|
468
|
+
return t instanceof Node || t instanceof L(t).Node;
|
|
469
469
|
}
|
|
470
470
|
function W(t) {
|
|
471
|
-
return t instanceof Element || t instanceof
|
|
471
|
+
return t instanceof Element || t instanceof L(t).Element;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
return t instanceof HTMLElement || t instanceof
|
|
473
|
+
function k(t) {
|
|
474
|
+
return t instanceof HTMLElement || t instanceof L(t).HTMLElement;
|
|
475
475
|
}
|
|
476
476
|
function dt(t) {
|
|
477
|
-
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof
|
|
477
|
+
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof L(t).ShadowRoot;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function K(t) {
|
|
480
480
|
const {
|
|
481
481
|
overflow: e,
|
|
482
482
|
overflowX: n,
|
|
483
|
-
overflowY:
|
|
484
|
-
display:
|
|
483
|
+
overflowY: i,
|
|
484
|
+
display: o
|
|
485
485
|
} = T(t);
|
|
486
|
-
return /auto|scroll|overlay|hidden|clip/.test(e +
|
|
486
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !["inline", "contents"].includes(o);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function $t(t) {
|
|
489
489
|
return ["table", "td", "th"].includes(V(t));
|
|
490
490
|
}
|
|
491
491
|
function at(t) {
|
|
492
492
|
const e = ft(), n = T(t);
|
|
493
|
-
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((
|
|
493
|
+
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
|
|
494
494
|
}
|
|
495
495
|
function Yt(t) {
|
|
496
|
-
let e =
|
|
497
|
-
for (;
|
|
496
|
+
let e = z(t);
|
|
497
|
+
for (; k(e) && !it(e); ) {
|
|
498
498
|
if (at(e))
|
|
499
499
|
return e;
|
|
500
|
-
e =
|
|
500
|
+
e = z(e);
|
|
501
501
|
}
|
|
502
502
|
return null;
|
|
503
503
|
}
|
|
504
504
|
function ft() {
|
|
505
505
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function it(t) {
|
|
508
508
|
return ["html", "body", "#document"].includes(V(t));
|
|
509
509
|
}
|
|
510
510
|
function T(t) {
|
|
511
|
-
return
|
|
511
|
+
return L(t).getComputedStyle(t);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ot(t) {
|
|
514
514
|
return W(t) ? {
|
|
515
515
|
scrollLeft: t.scrollLeft,
|
|
516
516
|
scrollTop: t.scrollTop
|
|
@@ -519,7 +519,7 @@ function it(t) {
|
|
|
519
519
|
scrollTop: t.pageYOffset
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function z(t) {
|
|
523
523
|
if (V(t) === "html")
|
|
524
524
|
return t;
|
|
525
525
|
const e = (
|
|
@@ -532,67 +532,67 @@ function _(t) {
|
|
|
532
532
|
return dt(e) ? e.host : e;
|
|
533
533
|
}
|
|
534
534
|
function xt(t) {
|
|
535
|
-
const e =
|
|
536
|
-
return
|
|
535
|
+
const e = z(t);
|
|
536
|
+
return it(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && K(e) ? e : xt(e);
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
var
|
|
538
|
+
function U(t, e, n) {
|
|
539
|
+
var i;
|
|
540
540
|
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
541
|
-
const
|
|
542
|
-
return s ? e.concat(r, r.visualViewport || [],
|
|
541
|
+
const o = xt(t), s = o === ((i = t.ownerDocument) == null ? void 0 : i.body), r = L(o);
|
|
542
|
+
return s ? e.concat(r, r.visualViewport || [], K(o) ? o : [], r.frameElement && n ? U(r.frameElement) : []) : e.concat(o, U(o, [], n));
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function yt(t) {
|
|
545
545
|
const e = T(t);
|
|
546
|
-
let n = parseFloat(e.width) || 0,
|
|
547
|
-
const
|
|
548
|
-
return l && (n = s,
|
|
546
|
+
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
547
|
+
const o = k(t), s = o ? t.offsetWidth : n, r = o ? t.offsetHeight : i, l = Z(n) !== s || Z(i) !== r;
|
|
548
|
+
return l && (n = s, i = r), {
|
|
549
549
|
width: n,
|
|
550
|
-
height:
|
|
550
|
+
height: i,
|
|
551
551
|
$: l
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
554
|
function ut(t) {
|
|
555
555
|
return W(t) ? t : t.contextElement;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function I(t) {
|
|
558
558
|
const e = ut(t);
|
|
559
|
-
if (!
|
|
559
|
+
if (!k(e))
|
|
560
560
|
return B(1);
|
|
561
561
|
const n = e.getBoundingClientRect(), {
|
|
562
|
-
width:
|
|
563
|
-
height:
|
|
562
|
+
width: i,
|
|
563
|
+
height: o,
|
|
564
564
|
$: s
|
|
565
|
-
} =
|
|
566
|
-
let r = (s ? Z(n.width) : n.width) /
|
|
565
|
+
} = yt(e);
|
|
566
|
+
let r = (s ? Z(n.width) : n.width) / i, l = (s ? Z(n.height) : n.height) / o;
|
|
567
567
|
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
568
568
|
x: r,
|
|
569
569
|
y: l
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
572
|
const Xt = /* @__PURE__ */ B(0);
|
|
573
|
-
function
|
|
574
|
-
const e =
|
|
573
|
+
function bt(t) {
|
|
574
|
+
const e = L(t);
|
|
575
575
|
return !ft() || !e.visualViewport ? Xt : {
|
|
576
576
|
x: e.visualViewport.offsetLeft,
|
|
577
577
|
y: e.visualViewport.offsetTop
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
580
|
function qt(t, e, n) {
|
|
581
|
-
return e === void 0 && (e = !1), !n || e && n !==
|
|
581
|
+
return e === void 0 && (e = !1), !n || e && n !== L(t) ? !1 : e;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function _(t, e, n, i) {
|
|
584
584
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
585
|
-
const
|
|
585
|
+
const o = t.getBoundingClientRect(), s = ut(t);
|
|
586
586
|
let r = B(1);
|
|
587
|
-
e && (
|
|
588
|
-
const l = qt(s, n,
|
|
589
|
-
let c = (
|
|
587
|
+
e && (i ? W(i) && (r = I(i)) : r = I(t));
|
|
588
|
+
const l = qt(s, n, i) ? bt(s) : B(0);
|
|
589
|
+
let c = (o.left + l.x) / r.x, a = (o.top + l.y) / r.y, d = o.width / r.x, h = o.height / r.y;
|
|
590
590
|
if (s) {
|
|
591
|
-
const p =
|
|
591
|
+
const p = L(s), f = i && W(i) ? L(i) : i;
|
|
592
592
|
let u = p.frameElement;
|
|
593
|
-
for (; u &&
|
|
594
|
-
const m =
|
|
595
|
-
c *= m.x, a *= m.y, d *= m.x, h *= m.y, c += x, a +=
|
|
593
|
+
for (; u && i && f !== p; ) {
|
|
594
|
+
const m = I(u), w = u.getBoundingClientRect(), g = T(u), x = w.left + (u.clientLeft + parseFloat(g.paddingLeft)) * m.x, y = w.top + (u.clientTop + parseFloat(g.paddingTop)) * m.y;
|
|
595
|
+
c *= m.x, a *= m.y, d *= m.x, h *= m.y, c += x, a += y, u = L(u).frameElement;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
return et({
|
|
@@ -602,13 +602,13 @@ function z(t, e, n, o) {
|
|
|
602
602
|
y: a
|
|
603
603
|
});
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Gt(t) {
|
|
606
606
|
let {
|
|
607
607
|
rect: e,
|
|
608
608
|
offsetParent: n,
|
|
609
|
-
strategy:
|
|
609
|
+
strategy: i
|
|
610
610
|
} = t;
|
|
611
|
-
const
|
|
611
|
+
const o = k(n), s = M(n);
|
|
612
612
|
if (n === s)
|
|
613
613
|
return e;
|
|
614
614
|
let r = {
|
|
@@ -616,9 +616,9 @@ function Ut(t) {
|
|
|
616
616
|
scrollTop: 0
|
|
617
617
|
}, l = B(1);
|
|
618
618
|
const c = B(0);
|
|
619
|
-
if ((
|
|
620
|
-
const a =
|
|
621
|
-
l =
|
|
619
|
+
if ((o || !o && i !== "fixed") && ((V(n) !== "body" || K(s)) && (r = ot(n)), k(n))) {
|
|
620
|
+
const a = _(n);
|
|
621
|
+
l = I(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
|
|
622
622
|
}
|
|
623
623
|
return {
|
|
624
624
|
width: e.width * l.x,
|
|
@@ -627,30 +627,30 @@ function Ut(t) {
|
|
|
627
627
|
y: e.y * l.y - r.scrollTop * l.y + c.y
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Ut(t) {
|
|
631
631
|
return Array.from(t.getClientRects());
|
|
632
632
|
}
|
|
633
633
|
function At(t) {
|
|
634
|
-
return
|
|
634
|
+
return _(M(t)).left + ot(t).scrollLeft;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
const e = M(t), n =
|
|
636
|
+
function Jt(t) {
|
|
637
|
+
const e = M(t), n = ot(t), i = t.ownerDocument.body, o = C(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = C(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
638
638
|
let r = -n.scrollLeft + At(t);
|
|
639
639
|
const l = -n.scrollTop;
|
|
640
|
-
return T(
|
|
641
|
-
width:
|
|
640
|
+
return T(i).direction === "rtl" && (r += C(e.clientWidth, i.clientWidth) - o), {
|
|
641
|
+
width: o,
|
|
642
642
|
height: s,
|
|
643
643
|
x: r,
|
|
644
644
|
y: l
|
|
645
645
|
};
|
|
646
646
|
}
|
|
647
|
-
function
|
|
648
|
-
const n =
|
|
649
|
-
let s =
|
|
650
|
-
if (
|
|
651
|
-
s =
|
|
647
|
+
function Kt(t, e) {
|
|
648
|
+
const n = L(t), i = M(t), o = n.visualViewport;
|
|
649
|
+
let s = i.clientWidth, r = i.clientHeight, l = 0, c = 0;
|
|
650
|
+
if (o) {
|
|
651
|
+
s = o.width, r = o.height;
|
|
652
652
|
const a = ft();
|
|
653
|
-
(!a || a && e === "fixed") && (l =
|
|
653
|
+
(!a || a && e === "fixed") && (l = o.offsetLeft, c = o.offsetTop);
|
|
654
654
|
}
|
|
655
655
|
return {
|
|
656
656
|
width: s,
|
|
@@ -660,7 +660,7 @@ function Gt(t, e) {
|
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
662
|
function Qt(t, e) {
|
|
663
|
-
const n =
|
|
663
|
+
const n = _(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, s = k(t) ? I(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = o * s.x, a = i * s.y;
|
|
664
664
|
return {
|
|
665
665
|
width: r,
|
|
666
666
|
height: l,
|
|
@@ -669,51 +669,51 @@ function Qt(t, e) {
|
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
671
|
function pt(t, e, n) {
|
|
672
|
-
let
|
|
672
|
+
let i;
|
|
673
673
|
if (e === "viewport")
|
|
674
|
-
|
|
674
|
+
i = Kt(t, n);
|
|
675
675
|
else if (e === "document")
|
|
676
|
-
|
|
676
|
+
i = Jt(M(t));
|
|
677
677
|
else if (W(e))
|
|
678
|
-
|
|
678
|
+
i = Qt(e, n);
|
|
679
679
|
else {
|
|
680
|
-
const
|
|
681
|
-
|
|
680
|
+
const o = bt(t);
|
|
681
|
+
i = {
|
|
682
682
|
...e,
|
|
683
|
-
x: e.x -
|
|
684
|
-
y: e.y -
|
|
683
|
+
x: e.x - o.x,
|
|
684
|
+
y: e.y - o.y
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
return et(
|
|
687
|
+
return et(i);
|
|
688
688
|
}
|
|
689
689
|
function Et(t, e) {
|
|
690
|
-
const n =
|
|
691
|
-
return n === e || !W(n) ||
|
|
690
|
+
const n = z(t);
|
|
691
|
+
return n === e || !W(n) || it(n) ? !1 : T(n).position === "fixed" || Et(n, e);
|
|
692
692
|
}
|
|
693
693
|
function Zt(t, e) {
|
|
694
694
|
const n = e.get(t);
|
|
695
695
|
if (n)
|
|
696
696
|
return n;
|
|
697
|
-
let
|
|
697
|
+
let i = U(t, [], !1).filter((l) => W(l) && V(l) !== "body"), o = null;
|
|
698
698
|
const s = T(t).position === "fixed";
|
|
699
|
-
let r = s ?
|
|
700
|
-
for (; W(r) && !
|
|
699
|
+
let r = s ? z(t) : t;
|
|
700
|
+
for (; W(r) && !it(r); ) {
|
|
701
701
|
const l = T(r), c = at(r);
|
|
702
|
-
!c && l.position === "fixed" && (
|
|
702
|
+
!c && l.position === "fixed" && (o = null), (s ? !c && !o : !c && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || K(r) && !c && Et(t, r)) ? i = i.filter((d) => d !== r) : o = l, r = z(r);
|
|
703
703
|
}
|
|
704
|
-
return e.set(t,
|
|
704
|
+
return e.set(t, i), i;
|
|
705
705
|
}
|
|
706
706
|
function te(t) {
|
|
707
707
|
let {
|
|
708
708
|
element: e,
|
|
709
709
|
boundary: n,
|
|
710
|
-
rootBoundary:
|
|
711
|
-
strategy:
|
|
710
|
+
rootBoundary: i,
|
|
711
|
+
strategy: o
|
|
712
712
|
} = t;
|
|
713
|
-
const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n),
|
|
714
|
-
const h = pt(e, d,
|
|
715
|
-
return a.top =
|
|
716
|
-
}, pt(e, l,
|
|
713
|
+
const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n), i], l = r[0], c = r.reduce((a, d) => {
|
|
714
|
+
const h = pt(e, d, o);
|
|
715
|
+
return a.top = C(h.top, a.top), a.right = F(h.right, a.right), a.bottom = F(h.bottom, a.bottom), a.left = C(h.left, a.left), a;
|
|
716
|
+
}, pt(e, l, o));
|
|
717
717
|
return {
|
|
718
718
|
width: c.right - c.left,
|
|
719
719
|
height: c.bottom - c.top,
|
|
@@ -722,21 +722,21 @@ function te(t) {
|
|
|
722
722
|
};
|
|
723
723
|
}
|
|
724
724
|
function ee(t) {
|
|
725
|
-
return
|
|
725
|
+
return yt(t);
|
|
726
726
|
}
|
|
727
727
|
function ne(t, e, n) {
|
|
728
|
-
const
|
|
728
|
+
const i = k(e), o = M(e), s = n === "fixed", r = _(t, !0, s, e);
|
|
729
729
|
let l = {
|
|
730
730
|
scrollLeft: 0,
|
|
731
731
|
scrollTop: 0
|
|
732
732
|
};
|
|
733
733
|
const c = B(0);
|
|
734
|
-
if (
|
|
735
|
-
if ((V(e) !== "body" ||
|
|
736
|
-
const a =
|
|
734
|
+
if (i || !i && !s)
|
|
735
|
+
if ((V(e) !== "body" || K(o)) && (l = ot(e)), i) {
|
|
736
|
+
const a = _(e, !0, s, e);
|
|
737
737
|
c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
|
|
738
738
|
} else
|
|
739
|
-
|
|
739
|
+
o && (c.x = At(o));
|
|
740
740
|
return {
|
|
741
741
|
x: r.left + l.scrollLeft - c.x,
|
|
742
742
|
y: r.top + l.scrollTop - c.y,
|
|
@@ -745,26 +745,26 @@ function ne(t, e, n) {
|
|
|
745
745
|
};
|
|
746
746
|
}
|
|
747
747
|
function mt(t, e) {
|
|
748
|
-
return !
|
|
748
|
+
return !k(t) || T(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
const n =
|
|
752
|
-
if (!
|
|
750
|
+
function Rt(t, e) {
|
|
751
|
+
const n = L(t);
|
|
752
|
+
if (!k(t))
|
|
753
753
|
return n;
|
|
754
|
-
let
|
|
755
|
-
for (;
|
|
756
|
-
|
|
757
|
-
return
|
|
754
|
+
let i = mt(t, e);
|
|
755
|
+
for (; i && $t(i) && T(i).position === "static"; )
|
|
756
|
+
i = mt(i, e);
|
|
757
|
+
return i && (V(i) === "html" || V(i) === "body" && T(i).position === "static" && !at(i)) ? n : i || Yt(t) || n;
|
|
758
758
|
}
|
|
759
|
-
const
|
|
759
|
+
const ie = async function(t) {
|
|
760
760
|
let {
|
|
761
761
|
reference: e,
|
|
762
762
|
floating: n,
|
|
763
|
-
strategy:
|
|
763
|
+
strategy: i
|
|
764
764
|
} = t;
|
|
765
|
-
const
|
|
765
|
+
const o = this.getOffsetParent || Rt, s = this.getDimensions;
|
|
766
766
|
return {
|
|
767
|
-
reference: ne(e, await
|
|
767
|
+
reference: ne(e, await o(n), i),
|
|
768
768
|
floating: {
|
|
769
769
|
x: 0,
|
|
770
770
|
y: 0,
|
|
@@ -772,26 +772,26 @@ const oe = async function(t) {
|
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
774
|
};
|
|
775
|
-
function
|
|
775
|
+
function oe(t) {
|
|
776
776
|
return T(t).direction === "rtl";
|
|
777
777
|
}
|
|
778
778
|
const se = {
|
|
779
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
779
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Gt,
|
|
780
780
|
getDocumentElement: M,
|
|
781
781
|
getClippingRect: te,
|
|
782
|
-
getOffsetParent:
|
|
783
|
-
getElementRects:
|
|
784
|
-
getClientRects:
|
|
782
|
+
getOffsetParent: Rt,
|
|
783
|
+
getElementRects: ie,
|
|
784
|
+
getClientRects: Ut,
|
|
785
785
|
getDimensions: ee,
|
|
786
|
-
getScale:
|
|
786
|
+
getScale: I,
|
|
787
787
|
isElement: W,
|
|
788
|
-
isRTL:
|
|
788
|
+
isRTL: oe
|
|
789
789
|
};
|
|
790
790
|
function re(t, e) {
|
|
791
|
-
let n = null,
|
|
792
|
-
const
|
|
791
|
+
let n = null, i;
|
|
792
|
+
const o = M(t);
|
|
793
793
|
function s() {
|
|
794
|
-
clearTimeout(
|
|
794
|
+
clearTimeout(i), n && n.disconnect(), n = null;
|
|
795
795
|
}
|
|
796
796
|
function r(l, c) {
|
|
797
797
|
l === void 0 && (l = !1), c === void 0 && (c = 1), s();
|
|
@@ -803,27 +803,27 @@ function re(t, e) {
|
|
|
803
803
|
} = t.getBoundingClientRect();
|
|
804
804
|
if (l || e(), !h || !p)
|
|
805
805
|
return;
|
|
806
|
-
const f = Q(d), u = Q(
|
|
806
|
+
const f = Q(d), u = Q(o.clientWidth - (a + h)), m = Q(o.clientHeight - (d + p)), w = Q(a), x = {
|
|
807
807
|
rootMargin: -f + "px " + -u + "px " + -m + "px " + -w + "px",
|
|
808
|
-
threshold:
|
|
808
|
+
threshold: C(0, F(1, c)) || 1
|
|
809
809
|
};
|
|
810
|
-
let
|
|
810
|
+
let y = !0;
|
|
811
811
|
function A(v) {
|
|
812
|
-
const
|
|
813
|
-
if (
|
|
814
|
-
if (!
|
|
812
|
+
const b = v[0].intersectionRatio;
|
|
813
|
+
if (b !== c) {
|
|
814
|
+
if (!y)
|
|
815
815
|
return r();
|
|
816
|
-
|
|
816
|
+
b ? r(!1, b) : i = setTimeout(() => {
|
|
817
817
|
r(!1, 1e-7);
|
|
818
818
|
}, 100);
|
|
819
819
|
}
|
|
820
|
-
|
|
820
|
+
y = !1;
|
|
821
821
|
}
|
|
822
822
|
try {
|
|
823
823
|
n = new IntersectionObserver(A, {
|
|
824
824
|
...x,
|
|
825
825
|
// Handle <iframe>s
|
|
826
|
-
root:
|
|
826
|
+
root: o.ownerDocument
|
|
827
827
|
});
|
|
828
828
|
} catch {
|
|
829
829
|
n = new IntersectionObserver(A, x);
|
|
@@ -832,17 +832,17 @@ function re(t, e) {
|
|
|
832
832
|
}
|
|
833
833
|
return r(!0), s;
|
|
834
834
|
}
|
|
835
|
-
function ce(t, e, n,
|
|
836
|
-
|
|
835
|
+
function ce(t, e, n, i) {
|
|
836
|
+
i === void 0 && (i = {});
|
|
837
837
|
const {
|
|
838
|
-
ancestorScroll:
|
|
838
|
+
ancestorScroll: o = !0,
|
|
839
839
|
ancestorResize: s = !0,
|
|
840
840
|
elementResize: r = typeof ResizeObserver == "function",
|
|
841
841
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
842
842
|
animationFrame: c = !1
|
|
843
|
-
} =
|
|
843
|
+
} = i, a = ut(t), d = o || s ? [...a ? U(a) : [], ...U(e)] : [];
|
|
844
844
|
d.forEach((g) => {
|
|
845
|
-
|
|
845
|
+
o && g.addEventListener("scroll", n, {
|
|
846
846
|
passive: !0
|
|
847
847
|
}), s && g.addEventListener("resize", n);
|
|
848
848
|
});
|
|
@@ -854,28 +854,28 @@ function ce(t, e, n, o) {
|
|
|
854
854
|
f && f.observe(e);
|
|
855
855
|
})), n();
|
|
856
856
|
}), a && !c && f.observe(a), f.observe(e));
|
|
857
|
-
let u, m = c ?
|
|
857
|
+
let u, m = c ? _(t) : null;
|
|
858
858
|
c && w();
|
|
859
859
|
function w() {
|
|
860
|
-
const g =
|
|
860
|
+
const g = _(t);
|
|
861
861
|
m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g, u = requestAnimationFrame(w);
|
|
862
862
|
}
|
|
863
863
|
return n(), () => {
|
|
864
864
|
d.forEach((g) => {
|
|
865
|
-
|
|
865
|
+
o && g.removeEventListener("scroll", n), s && g.removeEventListener("resize", n);
|
|
866
866
|
}), h && h(), f && f.disconnect(), f = null, c && cancelAnimationFrame(u);
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
869
|
const le = (t, e, n) => {
|
|
870
|
-
const
|
|
870
|
+
const i = /* @__PURE__ */ new Map(), o = {
|
|
871
871
|
platform: se,
|
|
872
872
|
...n
|
|
873
873
|
}, s = {
|
|
874
|
-
...
|
|
875
|
-
_c:
|
|
874
|
+
...o.platform,
|
|
875
|
+
_c: i
|
|
876
876
|
};
|
|
877
877
|
return Bt(t, e, {
|
|
878
|
-
...
|
|
878
|
+
...o,
|
|
879
879
|
platform: s
|
|
880
880
|
});
|
|
881
881
|
}, ae = ":host{--wje-popup-top: auto;--wje-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wje-popup-left);top:var(--wje-popup-top)}.native-popup:not(.popup-active){display:none}";
|
|
@@ -889,9 +889,12 @@ class he extends Tt {
|
|
|
889
889
|
super();
|
|
890
890
|
st(this, "className", "Popup");
|
|
891
891
|
st(this, "clickHandler", (n) => {
|
|
892
|
-
n.composedPath().some((
|
|
892
|
+
n.composedPath().some((o) => o === this) || this.hasAttribute("active") && this.removeAttribute("active");
|
|
893
893
|
});
|
|
894
|
-
this._manual = !1
|
|
894
|
+
this._manual = !1, this._stageList = {
|
|
895
|
+
IDLE: "IDLE",
|
|
896
|
+
PROCESSING: "PROCESSING"
|
|
897
|
+
}, this._stage = this._stageList.IDLE;
|
|
895
898
|
}
|
|
896
899
|
/**
|
|
897
900
|
* Sets the manual property of the popup.
|
|
@@ -918,33 +921,19 @@ class he extends Tt {
|
|
|
918
921
|
static get cssStyleSheet() {
|
|
919
922
|
return ae;
|
|
920
923
|
}
|
|
921
|
-
/**
|
|
922
|
-
* Returns the list of attributes to observe for changes.
|
|
923
|
-
*
|
|
924
|
-
* @static
|
|
925
|
-
* @returns {Array<string>}
|
|
926
|
-
*/
|
|
927
|
-
static get observedAttributes() {
|
|
928
|
-
return ["active"];
|
|
929
|
-
}
|
|
930
924
|
/**
|
|
931
925
|
* Sets up the attributes for the component.
|
|
932
926
|
*/
|
|
933
927
|
setupAttributes() {
|
|
934
928
|
this.isShadowRoot = "open";
|
|
935
929
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
* @param {string} name - The name of the attribute.
|
|
940
|
-
* @param {string} old - The old value of the attribute.
|
|
941
|
-
* @param {string} newName - The new value of the attribute.
|
|
942
|
-
*/
|
|
943
|
-
attributeChangedCallback(n, o, i) {
|
|
944
|
-
n === "active" && (this.hasAttribute(n) ? this.show() : this.hide());
|
|
930
|
+
afterDisconnect() {
|
|
931
|
+
var n;
|
|
932
|
+
G.removeElement(this.anchorEl), document.removeEventListener("click", this.clickHandler, { capture: !0 }), (n = this.cleanup) == null || n.call(this);
|
|
945
933
|
}
|
|
946
|
-
beforeDraw(n,
|
|
947
|
-
|
|
934
|
+
beforeDraw(n, i, o) {
|
|
935
|
+
var s;
|
|
936
|
+
this._stage = this._stageList.PROCESSING, document.removeEventListener("click", this.clickHandler, { capture: !0 }), (s = this.cleanup) == null || s.call(this);
|
|
948
937
|
}
|
|
949
938
|
/**
|
|
950
939
|
* Draws the component.
|
|
@@ -954,7 +943,7 @@ class he extends Tt {
|
|
|
954
943
|
* @param {Object} params - The parameters for drawing.
|
|
955
944
|
* @returns {DocumentFragment}
|
|
956
945
|
*/
|
|
957
|
-
draw(n,
|
|
946
|
+
draw(n, i, o) {
|
|
958
947
|
let s = document.createDocumentFragment(), r = document.createElement("slot");
|
|
959
948
|
r.setAttribute("name", "anchor");
|
|
960
949
|
let l = document.createElement("slot");
|
|
@@ -964,8 +953,8 @@ class he extends Tt {
|
|
|
964
953
|
let a = document.createElement("slot");
|
|
965
954
|
return c.appendChild(a), c.appendChild(l), s.appendChild(r), s.appendChild(c), this.slotAnchor = r, this.slotArrow = l, this.native = c, s;
|
|
966
955
|
}
|
|
967
|
-
afterDraw(n,
|
|
968
|
-
this.setAnchor();
|
|
956
|
+
afterDraw(n, i, o) {
|
|
957
|
+
this.setAnchor(), this._stage = this._stageList.IDLE;
|
|
969
958
|
}
|
|
970
959
|
/**
|
|
971
960
|
* Sets the anchor for the popup.
|
|
@@ -977,9 +966,9 @@ class he extends Tt {
|
|
|
977
966
|
this.anchorEl = n.querySelector("#" + this.anchor);
|
|
978
967
|
} else
|
|
979
968
|
this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: !0 })[0]);
|
|
980
|
-
this.manual &&
|
|
969
|
+
this.manual && G.addListener(this.anchorEl, "click", null, (n) => {
|
|
981
970
|
this.hasAttribute("disabled") || this.showHide();
|
|
982
|
-
}, { stopPropagation: !0 }), document.addEventListener("click", this.clickHandler, { capture: !0 });
|
|
971
|
+
}, { stopPropagation: !0 }), document.removeEventListener("click", this.clickHandler, { capture: !0 }), document.addEventListener("click", this.clickHandler, { capture: !0 });
|
|
983
972
|
}
|
|
984
973
|
/**
|
|
985
974
|
* Toggles the active attribute of the popup.
|
|
@@ -998,12 +987,12 @@ class he extends Tt {
|
|
|
998
987
|
element: this.arrow
|
|
999
988
|
})
|
|
1000
989
|
), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset)), n.push(
|
|
1001
|
-
|
|
990
|
+
It(this.offsetCalc)
|
|
1002
991
|
), n.push(
|
|
1003
992
|
jt()
|
|
1004
993
|
), this.hasAttribute("size") && n.push(
|
|
1005
|
-
|
|
1006
|
-
apply({ availableWidth:
|
|
994
|
+
zt({
|
|
995
|
+
apply({ availableWidth: i, availableHeight: o, elements: s }) {
|
|
1007
996
|
Object.assign(s.floating.style, {
|
|
1008
997
|
width: `${s.reference.offsetWidth}px`
|
|
1009
998
|
});
|
|
@@ -1013,8 +1002,8 @@ class he extends Tt {
|
|
|
1013
1002
|
placement: this.placement || "bottom",
|
|
1014
1003
|
strategy: "fixed",
|
|
1015
1004
|
middleware: n
|
|
1016
|
-
}).then(({ x:
|
|
1017
|
-
if (this.native.style.setProperty("--wje-popup-left",
|
|
1005
|
+
}).then(({ x: i, y: o, middlewareData: s, placement: r, strategy: l }) => {
|
|
1006
|
+
if (this.native.style.setProperty("--wje-popup-left", i + "px"), this.native.style.setProperty("--wje-popup-top", o + "px"), this.native.style.position = l, this.arrow) {
|
|
1018
1007
|
const c = {
|
|
1019
1008
|
top: "bottom",
|
|
1020
1009
|
right: "left",
|
|
@@ -1030,7 +1019,7 @@ class he extends Tt {
|
|
|
1030
1019
|
});
|
|
1031
1020
|
}
|
|
1032
1021
|
}
|
|
1033
|
-
}),
|
|
1022
|
+
}), G.dispatchCustomEvent(this, "wje-popup:reposition", {
|
|
1034
1023
|
data: { top: "bottom", right: "left", bottom: "top", left: "right" },
|
|
1035
1024
|
context: this,
|
|
1036
1025
|
event: this
|
|
@@ -1042,7 +1031,8 @@ class he extends Tt {
|
|
|
1042
1031
|
* Sets up auto update for repositioning.
|
|
1043
1032
|
*/
|
|
1044
1033
|
show() {
|
|
1045
|
-
|
|
1034
|
+
var n;
|
|
1035
|
+
G.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), (n = this.cleanup) == null || n.call(this), this.cleanup = ce(this.anchorEl, this.native, () => {
|
|
1046
1036
|
this.reposition();
|
|
1047
1037
|
}), this.hasAttribute("active") || this.setAttribute("active", "");
|
|
1048
1038
|
}
|
|
@@ -1052,7 +1042,8 @@ class he extends Tt {
|
|
|
1052
1042
|
* Cleans up the auto update for repositioning.
|
|
1053
1043
|
*/
|
|
1054
1044
|
hide() {
|
|
1055
|
-
|
|
1045
|
+
var n;
|
|
1046
|
+
G.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), (n = this.cleanup) == null || n.call(this), this.cleanup = void 0, this.hasAttribute("active") && this.removeAttribute("active");
|
|
1056
1047
|
}
|
|
1057
1048
|
/**
|
|
1058
1049
|
* Removes the active attribute when the popup is hidden.
|
|
@@ -1060,12 +1051,6 @@ class he extends Tt {
|
|
|
1060
1051
|
onHide() {
|
|
1061
1052
|
this.removeAttribute("active");
|
|
1062
1053
|
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Adds event listeners after the component is drawn.
|
|
1065
|
-
*/
|
|
1066
|
-
disconnectedCallback() {
|
|
1067
|
-
U.removeElement(this.anchorEl);
|
|
1068
|
-
}
|
|
1069
1054
|
}
|
|
1070
1055
|
export {
|
|
1071
1056
|
he as P
|