wj-elements 0.1.0 → 0.1.2
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/dark.css +1 -1
- package/dist/light.css +1 -1
- package/dist/{localize-7fxVJArK.js → localize-DVuO3S17.js} +1 -1
- package/dist/{popup.element-BXak-Fgc.js → popup.element-Dj9j__Dh.js} +329 -350
- package/dist/styles.css +1 -1
- package/dist/wje-accordion-item.js +88 -0
- package/dist/wje-accordion.js +79 -0
- package/dist/wje-animation.js +10 -11
- package/dist/wje-avatar.js +31 -29
- package/dist/wje-badge.js +7 -7
- package/dist/wje-breadcrumb.js +11 -11
- package/dist/wje-button.js +22 -29
- package/dist/wje-carousel.js +8 -9
- package/dist/wje-checkbox.js +81 -23
- package/dist/wje-dialog.js +53 -25
- package/dist/wje-dropdown.js +36 -23
- package/dist/wje-element.js +100 -89
- package/dist/wje-file-upload-item.js +3 -4
- package/dist/wje-file-upload.js +40 -43
- package/dist/wje-format-digital.js +1 -1
- package/dist/wje-icon-picker.js +1 -1
- package/dist/wje-icon.js +115 -3
- package/dist/wje-img-comparer.js +1 -2
- package/dist/wje-infinite-scroll.js +71 -41
- package/dist/wje-inline-edit.js +1 -2
- package/dist/wje-input-file.js +26 -18
- package/dist/wje-input.js +1 -1
- package/dist/wje-master.js +323 -168
- package/dist/wje-menu-item.js +33 -31
- package/dist/wje-menu.js +7 -7
- package/dist/wje-option.js +97 -3
- package/dist/wje-options.js +1 -1
- package/dist/wje-popup.js +1 -1
- package/dist/wje-progress-bar.js +5 -5
- package/dist/wje-radio-group.js +1 -1
- package/dist/wje-radio.js +1 -1
- package/dist/wje-relative-time.js +4 -13
- package/dist/wje-select.js +9 -10
- package/dist/wje-slider.js +40 -79
- package/dist/wje-tab.js +9 -9
- package/dist/wje-toast.js +16 -16
- package/dist/wje-toggle.js +39 -15
- package/dist/wje-tooltip.js +47 -23
- package/package.json +2 -1
- package/dist/custom-elements.json +0 -12216
- package/dist/icon.element-DOiXP3pi.js +0 -115
- package/dist/option.element-CpeafIM-.js +0 -98
- package/dist/styles-4vJ2wdTZ.js +0 -4
- package/dist/web-types.json +0 -2756
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var ut = (t, e, n) => (
|
|
4
|
-
import
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var Lt = (t, e, n) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var ut = (t, e, n) => (Lt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import Tt, { event as U } from "./wje-element.js";
|
|
5
5
|
const N = Math.min, R = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
|
|
6
6
|
x: t,
|
|
7
7
|
y: t
|
|
8
|
-
}),
|
|
8
|
+
}), Pt = {
|
|
9
9
|
left: "right",
|
|
10
10
|
right: "left",
|
|
11
11
|
bottom: "top",
|
|
12
12
|
top: "bottom"
|
|
13
|
-
},
|
|
13
|
+
}, St = {
|
|
14
14
|
start: "end",
|
|
15
15
|
end: "start"
|
|
16
16
|
};
|
|
17
|
-
function
|
|
17
|
+
function Dt(t, e, n) {
|
|
18
18
|
return R(t, N(e, n));
|
|
19
19
|
}
|
|
20
20
|
function K(t, e) {
|
|
@@ -23,10 +23,10 @@ function K(t, e) {
|
|
|
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 rt(t) {
|
|
@@ -35,21 +35,21 @@ function rt(t) {
|
|
|
35
35
|
function nt(t) {
|
|
36
36
|
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function ct(t) {
|
|
39
|
+
return kt(nt(t));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Ht(t, e, n) {
|
|
42
42
|
n === void 0 && (n = !1);
|
|
43
|
-
const o =
|
|
43
|
+
const o = _(t), i = ct(t), s = rt(i);
|
|
44
44
|
let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
45
45
|
return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Wt(t) {
|
|
48
48
|
const e = tt(t);
|
|
49
49
|
return [st(t), e, st(e)];
|
|
50
50
|
}
|
|
51
51
|
function st(t) {
|
|
52
|
-
return t.replace(/start|end/g, (e) =>
|
|
52
|
+
return t.replace(/start|end/g, (e) => St[e]);
|
|
53
53
|
}
|
|
54
54
|
function Mt(t, e, n) {
|
|
55
55
|
const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
@@ -64,15 +64,15 @@ function Mt(t, e, n) {
|
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const i =
|
|
67
|
+
function Ft(t, e, n, o) {
|
|
68
|
+
const i = _(t);
|
|
69
69
|
let s = Mt(j(t), n === "start", o);
|
|
70
70
|
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(st)))), 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) => Pt[e]);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Nt(t) {
|
|
76
76
|
return {
|
|
77
77
|
top: 0,
|
|
78
78
|
right: 0,
|
|
@@ -82,7 +82,7 @@ function Bt(t) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
function gt(t) {
|
|
85
|
-
return typeof t != "number" ?
|
|
85
|
+
return typeof t != "number" ? Nt(t) : {
|
|
86
86
|
top: t,
|
|
87
87
|
right: t,
|
|
88
88
|
bottom: t,
|
|
@@ -103,31 +103,31 @@ function ht(t, e, n) {
|
|
|
103
103
|
reference: o,
|
|
104
104
|
floating: i
|
|
105
105
|
} = t;
|
|
106
|
-
const s = nt(e), r =
|
|
106
|
+
const s = nt(e), r = ct(e), l = rt(r), c = j(e), a = s === "y", d = o.x + o.width / 2 - i.width / 2, h = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
|
|
107
107
|
let f;
|
|
108
|
-
switch (
|
|
108
|
+
switch (c) {
|
|
109
109
|
case "top":
|
|
110
110
|
f = {
|
|
111
|
-
x:
|
|
111
|
+
x: d,
|
|
112
112
|
y: o.y - i.height
|
|
113
113
|
};
|
|
114
114
|
break;
|
|
115
115
|
case "bottom":
|
|
116
116
|
f = {
|
|
117
|
-
x:
|
|
117
|
+
x: d,
|
|
118
118
|
y: o.y + o.height
|
|
119
119
|
};
|
|
120
120
|
break;
|
|
121
121
|
case "right":
|
|
122
122
|
f = {
|
|
123
123
|
x: o.x + o.width,
|
|
124
|
-
y:
|
|
124
|
+
y: h
|
|
125
125
|
};
|
|
126
126
|
break;
|
|
127
127
|
case "left":
|
|
128
128
|
f = {
|
|
129
129
|
x: o.x - i.width,
|
|
130
|
-
y:
|
|
130
|
+
y: h
|
|
131
131
|
};
|
|
132
132
|
break;
|
|
133
133
|
default:
|
|
@@ -136,7 +136,7 @@ function ht(t, e, n) {
|
|
|
136
136
|
y: o.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;
|
|
@@ -146,33 +146,33 @@ function ht(t, e, n) {
|
|
|
146
146
|
}
|
|
147
147
|
return f;
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const Bt = async (t, e, n) => {
|
|
150
150
|
const {
|
|
151
151
|
placement: o = "bottom",
|
|
152
152
|
strategy: i = "absolute",
|
|
153
153
|
middleware: s = [],
|
|
154
154
|
platform: r
|
|
155
|
-
} = n,
|
|
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
159
|
strategy: i
|
|
160
160
|
}), {
|
|
161
|
-
x:
|
|
162
|
-
y:
|
|
163
|
-
} = ht(a, o,
|
|
164
|
-
for (let m = 0; m <
|
|
161
|
+
x: d,
|
|
162
|
+
y: h
|
|
163
|
+
} = ht(a, o, c), p = o, f = {}, u = 0;
|
|
164
|
+
for (let m = 0; m < l.length; m++) {
|
|
165
165
|
const {
|
|
166
166
|
name: w,
|
|
167
167
|
fn: g
|
|
168
|
-
} =
|
|
169
|
-
x
|
|
170
|
-
y
|
|
171
|
-
data:
|
|
172
|
-
reset:
|
|
168
|
+
} = l[m], {
|
|
169
|
+
x,
|
|
170
|
+
y,
|
|
171
|
+
data: A,
|
|
172
|
+
reset: v
|
|
173
173
|
} = await g({
|
|
174
|
-
x:
|
|
175
|
-
y:
|
|
174
|
+
x: d,
|
|
175
|
+
y: h,
|
|
176
176
|
initialPlacement: o,
|
|
177
177
|
placement: p,
|
|
178
178
|
strategy: i,
|
|
@@ -184,24 +184,27 @@ const Vt = async (t, e, n) => {
|
|
|
184
184
|
floating: e
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
|
|
187
|
+
if (d = x ?? d, h = y ?? h, f = {
|
|
188
188
|
...f,
|
|
189
189
|
[w]: {
|
|
190
190
|
...f[w],
|
|
191
|
-
...
|
|
191
|
+
...A
|
|
192
192
|
}
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
193
|
+
}, v && u <= 50) {
|
|
194
|
+
u++, typeof v == "object" && (v.placement && (p = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
|
|
195
|
+
reference: t,
|
|
196
|
+
floating: e,
|
|
197
|
+
strategy: i
|
|
198
|
+
}) : v.rects), {
|
|
199
|
+
x: d,
|
|
200
|
+
y: h
|
|
201
|
+
} = ht(a, p, c)), m = -1;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
201
204
|
}
|
|
202
205
|
return {
|
|
203
|
-
x:
|
|
204
|
-
y:
|
|
206
|
+
x: d,
|
|
207
|
+
y: h,
|
|
205
208
|
placement: p,
|
|
206
209
|
strategy: i,
|
|
207
210
|
middlewareData: f
|
|
@@ -215,43 +218,42 @@ async function wt(t, e) {
|
|
|
215
218
|
y: i,
|
|
216
219
|
platform: s,
|
|
217
220
|
rects: r,
|
|
218
|
-
elements:
|
|
219
|
-
strategy:
|
|
221
|
+
elements: l,
|
|
222
|
+
strategy: c
|
|
220
223
|
} = t, {
|
|
221
224
|
boundary: a = "clippingAncestors",
|
|
222
|
-
rootBoundary:
|
|
223
|
-
elementContext:
|
|
225
|
+
rootBoundary: d = "viewport",
|
|
226
|
+
elementContext: h = "floating",
|
|
224
227
|
altBoundary: p = !1,
|
|
225
228
|
padding: f = 0
|
|
226
|
-
} = K(e, t),
|
|
227
|
-
element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(
|
|
229
|
+
} = K(e, t), u = gt(f), w = l[p ? h === "floating" ? "reference" : "floating" : h], g = et(await s.getClippingRect({
|
|
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)),
|
|
228
231
|
boundary: a,
|
|
229
|
-
rootBoundary:
|
|
230
|
-
strategy:
|
|
231
|
-
})),
|
|
232
|
+
rootBoundary: d,
|
|
233
|
+
strategy: c
|
|
234
|
+
})), x = h === "floating" ? {
|
|
232
235
|
...r.floating,
|
|
233
236
|
x: o,
|
|
234
237
|
y: i
|
|
235
|
-
} : r.reference,
|
|
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)) || {
|
|
236
239
|
x: 1,
|
|
237
240
|
y: 1
|
|
238
241
|
} : {
|
|
239
242
|
x: 1,
|
|
240
243
|
y: 1
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}) : v);
|
|
244
|
+
}, v = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
245
|
+
rect: x,
|
|
246
|
+
offsetParent: y,
|
|
247
|
+
strategy: c
|
|
248
|
+
}) : x);
|
|
247
249
|
return {
|
|
248
|
-
top: (g.top -
|
|
249
|
-
bottom: (
|
|
250
|
-
left: (g.left -
|
|
251
|
-
right: (
|
|
250
|
+
top: (g.top - v.top + u.top) / A.y,
|
|
251
|
+
bottom: (v.bottom - g.bottom + u.bottom) / A.y,
|
|
252
|
+
left: (g.left - v.left + u.left) / A.x,
|
|
253
|
+
right: (v.right - g.right + u.right) / A.x
|
|
252
254
|
};
|
|
253
255
|
}
|
|
254
|
-
const
|
|
256
|
+
const Vt = (t) => ({
|
|
255
257
|
name: "arrow",
|
|
256
258
|
options: t,
|
|
257
259
|
async fn(e) {
|
|
@@ -261,34 +263,34 @@ const jt = (t) => ({
|
|
|
261
263
|
placement: i,
|
|
262
264
|
rects: s,
|
|
263
265
|
platform: r,
|
|
264
|
-
elements:
|
|
265
|
-
middlewareData:
|
|
266
|
+
elements: l,
|
|
267
|
+
middlewareData: c
|
|
266
268
|
} = e, {
|
|
267
269
|
element: a,
|
|
268
|
-
padding:
|
|
270
|
+
padding: d = 0
|
|
269
271
|
} = K(t, e) || {};
|
|
270
272
|
if (a == null)
|
|
271
273
|
return {};
|
|
272
|
-
const
|
|
274
|
+
const h = gt(d), p = {
|
|
273
275
|
x: n,
|
|
274
276
|
y: o
|
|
275
|
-
}, f =
|
|
276
|
-
let E =
|
|
277
|
-
(!E || !await (r.isElement == null ? void 0 : r.isElement(
|
|
278
|
-
const P =
|
|
277
|
+
}, f = ct(i), u = rt(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 P = A / 2 - v / 2, F = E / 2 - m[u] / 2 - 1, Y = N(h[g], F), X = N(h[x], F), L = Y, q = E - m[u] - X, C = E / 2 - m[u] / 2 + P, S = Dt(L, C, q), D = !c.arrow && _(i) != null && C != S && s.reference[u] / 2 - (C < L ? Y : X) - m[u] / 2 < 0, H = D ? C < L ? C - L : C - q : 0;
|
|
279
281
|
return {
|
|
280
|
-
[f]: p[f] +
|
|
282
|
+
[f]: p[f] + H,
|
|
281
283
|
data: {
|
|
282
284
|
[f]: S,
|
|
283
|
-
centerOffset: C - S -
|
|
285
|
+
centerOffset: C - S - H,
|
|
284
286
|
...D && {
|
|
285
|
-
alignmentOffset:
|
|
287
|
+
alignmentOffset: H
|
|
286
288
|
}
|
|
287
289
|
},
|
|
288
290
|
reset: D
|
|
289
291
|
};
|
|
290
292
|
}
|
|
291
|
-
}),
|
|
293
|
+
}), jt = function(t) {
|
|
292
294
|
return t === void 0 && (t = {}), {
|
|
293
295
|
name: "flip",
|
|
294
296
|
options: t,
|
|
@@ -298,34 +300,34 @@ const jt = (t) => ({
|
|
|
298
300
|
placement: i,
|
|
299
301
|
middlewareData: s,
|
|
300
302
|
rects: r,
|
|
301
|
-
initialPlacement:
|
|
302
|
-
platform:
|
|
303
|
+
initialPlacement: l,
|
|
304
|
+
platform: c,
|
|
303
305
|
elements: a
|
|
304
306
|
} = e, {
|
|
305
|
-
mainAxis:
|
|
306
|
-
crossAxis:
|
|
307
|
+
mainAxis: d = !0,
|
|
308
|
+
crossAxis: h = !0,
|
|
307
309
|
fallbackPlacements: p,
|
|
308
310
|
fallbackStrategy: f = "bestFit",
|
|
309
|
-
fallbackAxisSideDirection:
|
|
311
|
+
fallbackAxisSideDirection: u = "none",
|
|
310
312
|
flipAlignment: m = !0,
|
|
311
313
|
...w
|
|
312
314
|
} = K(t, e);
|
|
313
315
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
314
316
|
return {};
|
|
315
|
-
const g = j(i),
|
|
316
|
-
!p &&
|
|
317
|
-
const
|
|
317
|
+
const g = j(i), 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(...Ft(l, m, u, y));
|
|
319
|
+
const v = [l, ...A], b = await wt(e, w), E = [];
|
|
318
320
|
let P = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
319
|
-
if (
|
|
320
|
-
const L =
|
|
321
|
-
E.push(
|
|
321
|
+
if (d && E.push(b[g]), h) {
|
|
322
|
+
const L = Ht(i, r, y);
|
|
323
|
+
E.push(b[L[0]], b[L[1]]);
|
|
322
324
|
}
|
|
323
325
|
if (P = [...P, {
|
|
324
326
|
placement: i,
|
|
325
327
|
overflows: E
|
|
326
328
|
}], !E.every((L) => L <= 0)) {
|
|
327
|
-
var
|
|
328
|
-
const L = (((
|
|
329
|
+
var F, Y;
|
|
330
|
+
const L = (((F = s.flip) == null ? void 0 : F.index) || 0) + 1, q = v[L];
|
|
329
331
|
if (q)
|
|
330
332
|
return {
|
|
331
333
|
data: {
|
|
@@ -341,12 +343,12 @@ const jt = (t) => ({
|
|
|
341
343
|
switch (f) {
|
|
342
344
|
case "bestFit": {
|
|
343
345
|
var X;
|
|
344
|
-
const S = (X = P.map((D) => [D.placement, D.overflows.filter((
|
|
346
|
+
const S = (X = P.map((D) => [D.placement, D.overflows.filter((H) => H > 0).reduce((H, Rt) => H + Rt, 0)]).sort((D, H) => D[1] - H[1])[0]) == null ? void 0 : X[0];
|
|
345
347
|
S && (C = S);
|
|
346
348
|
break;
|
|
347
349
|
}
|
|
348
350
|
case "initialPlacement":
|
|
349
|
-
C =
|
|
351
|
+
C = l;
|
|
350
352
|
break;
|
|
351
353
|
}
|
|
352
354
|
if (i !== C)
|
|
@@ -360,53 +362,47 @@ const jt = (t) => ({
|
|
|
360
362
|
}
|
|
361
363
|
};
|
|
362
364
|
};
|
|
363
|
-
async function
|
|
365
|
+
async function zt(t, e) {
|
|
364
366
|
const {
|
|
365
367
|
placement: n,
|
|
366
368
|
platform: o,
|
|
367
369
|
elements: i
|
|
368
|
-
} = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = j(n),
|
|
370
|
+
} = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = j(n), l = _(n), c = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, h = K(e, t);
|
|
369
371
|
let {
|
|
370
372
|
mainAxis: p,
|
|
371
373
|
crossAxis: f,
|
|
372
|
-
alignmentAxis:
|
|
373
|
-
} = typeof
|
|
374
|
-
mainAxis:
|
|
374
|
+
alignmentAxis: u
|
|
375
|
+
} = typeof h == "number" ? {
|
|
376
|
+
mainAxis: h,
|
|
375
377
|
crossAxis: 0,
|
|
376
378
|
alignmentAxis: null
|
|
377
379
|
} : {
|
|
378
380
|
mainAxis: 0,
|
|
379
381
|
crossAxis: 0,
|
|
380
382
|
alignmentAxis: null,
|
|
381
|
-
...
|
|
383
|
+
...h
|
|
382
384
|
};
|
|
383
|
-
return
|
|
384
|
-
x: f *
|
|
385
|
+
return l && typeof u == "number" && (f = l === "end" ? u * -1 : u), c ? {
|
|
386
|
+
x: f * d,
|
|
385
387
|
y: p * a
|
|
386
388
|
} : {
|
|
387
389
|
x: p * a,
|
|
388
|
-
y: f *
|
|
390
|
+
y: f * d
|
|
389
391
|
};
|
|
390
392
|
}
|
|
391
|
-
const
|
|
393
|
+
const $t = function(t) {
|
|
392
394
|
return t === void 0 && (t = 0), {
|
|
393
395
|
name: "offset",
|
|
394
396
|
options: t,
|
|
395
397
|
async fn(e) {
|
|
396
|
-
var n, o;
|
|
397
398
|
const {
|
|
398
|
-
x:
|
|
399
|
-
y:
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
y: s + l.y,
|
|
406
|
-
data: {
|
|
407
|
-
...l,
|
|
408
|
-
placement: r
|
|
409
|
-
}
|
|
399
|
+
x: n,
|
|
400
|
+
y: o
|
|
401
|
+
} = e, i = await zt(e, t);
|
|
402
|
+
return {
|
|
403
|
+
x: n + i.x,
|
|
404
|
+
y: o + i.y,
|
|
405
|
+
data: i
|
|
410
406
|
};
|
|
411
407
|
}
|
|
412
408
|
};
|
|
@@ -423,33 +419,33 @@ const _t = function(t) {
|
|
|
423
419
|
} = e, {
|
|
424
420
|
apply: r = () => {
|
|
425
421
|
},
|
|
426
|
-
...
|
|
427
|
-
} = K(t, e),
|
|
422
|
+
...l
|
|
423
|
+
} = K(t, e), c = await wt(e, l), a = j(n), d = _(n), h = nt(n) === "y", {
|
|
428
424
|
width: p,
|
|
429
425
|
height: f
|
|
430
426
|
} = o.floating;
|
|
431
|
-
let
|
|
432
|
-
a === "top" || a === "bottom" ? (
|
|
433
|
-
const w = f -
|
|
434
|
-
let
|
|
435
|
-
if (
|
|
436
|
-
const
|
|
437
|
-
|
|
427
|
+
let u, m;
|
|
428
|
+
a === "top" || a === "bottom" ? (u = a, m = d === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, u = d === "end" ? "top" : "bottom");
|
|
429
|
+
const w = f - c[u], g = p - c[m], x = !e.middlewareData.shift;
|
|
430
|
+
let y = w, A = g;
|
|
431
|
+
if (h) {
|
|
432
|
+
const b = p - c.left - c.right;
|
|
433
|
+
A = d || x ? N(g, b) : b;
|
|
438
434
|
} else {
|
|
439
|
-
const
|
|
440
|
-
|
|
435
|
+
const b = f - c.top - c.bottom;
|
|
436
|
+
y = d || x ? N(w, b) : b;
|
|
441
437
|
}
|
|
442
|
-
if (
|
|
443
|
-
const
|
|
444
|
-
|
|
438
|
+
if (x && !d) {
|
|
439
|
+
const b = R(c.left, 0), E = R(c.right, 0), P = R(c.top, 0), F = R(c.bottom, 0);
|
|
440
|
+
h ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : R(c.left, c.right)) : y = f - 2 * (P !== 0 || F !== 0 ? P + F : R(c.top, c.bottom));
|
|
445
441
|
}
|
|
446
442
|
await r({
|
|
447
443
|
...e,
|
|
448
|
-
availableWidth:
|
|
449
|
-
availableHeight:
|
|
444
|
+
availableWidth: A,
|
|
445
|
+
availableHeight: y
|
|
450
446
|
});
|
|
451
|
-
const
|
|
452
|
-
return p !==
|
|
447
|
+
const v = await i.getDimensions(s.floating);
|
|
448
|
+
return p !== v.width || f !== v.height ? {
|
|
453
449
|
reset: {
|
|
454
450
|
rects: !0
|
|
455
451
|
}
|
|
@@ -464,14 +460,14 @@ function O(t) {
|
|
|
464
460
|
var e;
|
|
465
461
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
466
462
|
}
|
|
467
|
-
function
|
|
463
|
+
function M(t) {
|
|
468
464
|
var e;
|
|
469
465
|
return (e = (vt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
470
466
|
}
|
|
471
467
|
function vt(t) {
|
|
472
468
|
return t instanceof Node || t instanceof O(t).Node;
|
|
473
469
|
}
|
|
474
|
-
function
|
|
470
|
+
function W(t) {
|
|
475
471
|
return t instanceof Element || t instanceof O(t).Element;
|
|
476
472
|
}
|
|
477
473
|
function k(t) {
|
|
@@ -489,19 +485,19 @@ function G(t) {
|
|
|
489
485
|
} = T(t);
|
|
490
486
|
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
|
|
491
487
|
}
|
|
492
|
-
function
|
|
488
|
+
function _t(t) {
|
|
493
489
|
return ["table", "td", "th"].includes(V(t));
|
|
494
490
|
}
|
|
495
|
-
function
|
|
491
|
+
function lt(t) {
|
|
496
492
|
const e = at(), n = T(t);
|
|
497
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((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
|
|
498
494
|
}
|
|
499
|
-
function
|
|
500
|
-
let e =
|
|
495
|
+
function Yt(t) {
|
|
496
|
+
let e = I(t);
|
|
501
497
|
for (; k(e) && !ot(e); ) {
|
|
502
|
-
if (
|
|
498
|
+
if (lt(e))
|
|
503
499
|
return e;
|
|
504
|
-
e =
|
|
500
|
+
e = I(e);
|
|
505
501
|
}
|
|
506
502
|
return null;
|
|
507
503
|
}
|
|
@@ -515,7 +511,7 @@ function T(t) {
|
|
|
515
511
|
return O(t).getComputedStyle(t);
|
|
516
512
|
}
|
|
517
513
|
function it(t) {
|
|
518
|
-
return
|
|
514
|
+
return W(t) ? {
|
|
519
515
|
scrollLeft: t.scrollLeft,
|
|
520
516
|
scrollTop: t.scrollTop
|
|
521
517
|
} : {
|
|
@@ -523,7 +519,7 @@ function it(t) {
|
|
|
523
519
|
scrollTop: t.pageYOffset
|
|
524
520
|
};
|
|
525
521
|
}
|
|
526
|
-
function
|
|
522
|
+
function I(t) {
|
|
527
523
|
if (V(t) === "html")
|
|
528
524
|
return t;
|
|
529
525
|
const e = (
|
|
@@ -531,12 +527,12 @@ function _(t) {
|
|
|
531
527
|
t.assignedSlot || // DOM Element detected.
|
|
532
528
|
t.parentNode || // ShadowRoot detected.
|
|
533
529
|
dt(t) && t.host || // Fallback.
|
|
534
|
-
|
|
530
|
+
M(t)
|
|
535
531
|
);
|
|
536
532
|
return dt(e) ? e.host : e;
|
|
537
533
|
}
|
|
538
534
|
function xt(t) {
|
|
539
|
-
const e =
|
|
535
|
+
const e = I(t);
|
|
540
536
|
return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && G(e) ? e : xt(e);
|
|
541
537
|
}
|
|
542
538
|
function J(t, e, n) {
|
|
@@ -548,15 +544,15 @@ function J(t, e, n) {
|
|
|
548
544
|
function yt(t) {
|
|
549
545
|
const e = T(t);
|
|
550
546
|
let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
551
|
-
const i = k(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o,
|
|
552
|
-
return
|
|
547
|
+
const i = k(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o, l = Z(n) !== s || Z(o) !== r;
|
|
548
|
+
return l && (n = s, o = r), {
|
|
553
549
|
width: n,
|
|
554
550
|
height: o,
|
|
555
|
-
$:
|
|
551
|
+
$: l
|
|
556
552
|
};
|
|
557
553
|
}
|
|
558
554
|
function ft(t) {
|
|
559
|
-
return
|
|
555
|
+
return W(t) ? t : t.contextElement;
|
|
560
556
|
}
|
|
561
557
|
function $(t) {
|
|
562
558
|
const e = ft(t);
|
|
@@ -567,130 +563,119 @@ function $(t) {
|
|
|
567
563
|
height: i,
|
|
568
564
|
$: s
|
|
569
565
|
} = yt(e);
|
|
570
|
-
let r = (s ? Z(n.width) : n.width) / o,
|
|
571
|
-
return (!r || !Number.isFinite(r)) && (r = 1), (!
|
|
566
|
+
let r = (s ? Z(n.width) : n.width) / o, l = (s ? Z(n.height) : n.height) / i;
|
|
567
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
572
568
|
x: r,
|
|
573
|
-
y:
|
|
569
|
+
y: l
|
|
574
570
|
};
|
|
575
571
|
}
|
|
576
|
-
const
|
|
572
|
+
const Xt = /* @__PURE__ */ B(0);
|
|
577
573
|
function bt(t) {
|
|
578
574
|
const e = O(t);
|
|
579
|
-
return !at() || !e.visualViewport ?
|
|
575
|
+
return !at() || !e.visualViewport ? Xt : {
|
|
580
576
|
x: e.visualViewport.offsetLeft,
|
|
581
577
|
y: e.visualViewport.offsetTop
|
|
582
578
|
};
|
|
583
579
|
}
|
|
584
|
-
function
|
|
580
|
+
function qt(t, e, n) {
|
|
585
581
|
return e === void 0 && (e = !1), !n || e && n !== O(t) ? !1 : e;
|
|
586
582
|
}
|
|
587
583
|
function z(t, e, n, o) {
|
|
588
584
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
589
585
|
const i = t.getBoundingClientRect(), s = ft(t);
|
|
590
586
|
let r = B(1);
|
|
591
|
-
e && (o ?
|
|
592
|
-
const
|
|
593
|
-
let
|
|
587
|
+
e && (o ? W(o) && (r = $(o)) : r = $(t));
|
|
588
|
+
const l = qt(s, n, o) ? bt(s) : B(0);
|
|
589
|
+
let c = (i.left + l.x) / r.x, a = (i.top + l.y) / r.y, d = i.width / r.x, h = i.height / r.y;
|
|
594
590
|
if (s) {
|
|
595
|
-
const p = O(s), f = o &&
|
|
596
|
-
let
|
|
597
|
-
for (;
|
|
598
|
-
const
|
|
599
|
-
|
|
591
|
+
const p = O(s), f = o && W(o) ? O(o) : o;
|
|
592
|
+
let u = p.frameElement;
|
|
593
|
+
for (; u && o && f !== p; ) {
|
|
594
|
+
const m = $(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 = O(u).frameElement;
|
|
600
596
|
}
|
|
601
597
|
}
|
|
602
598
|
return et({
|
|
603
|
-
width:
|
|
604
|
-
height:
|
|
605
|
-
x:
|
|
599
|
+
width: d,
|
|
600
|
+
height: h,
|
|
601
|
+
x: c,
|
|
606
602
|
y: a
|
|
607
603
|
});
|
|
608
604
|
}
|
|
609
|
-
|
|
610
|
-
function At(t) {
|
|
611
|
-
return Jt.some((e) => {
|
|
612
|
-
try {
|
|
613
|
-
return t.matches(e);
|
|
614
|
-
} catch {
|
|
615
|
-
return !1;
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
function Kt(t) {
|
|
605
|
+
function Ut(t) {
|
|
620
606
|
let {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
strategy: i
|
|
607
|
+
rect: e,
|
|
608
|
+
offsetParent: n,
|
|
609
|
+
strategy: o
|
|
625
610
|
} = t;
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
return
|
|
629
|
-
let
|
|
611
|
+
const i = k(n), s = M(n);
|
|
612
|
+
if (n === s)
|
|
613
|
+
return e;
|
|
614
|
+
let r = {
|
|
630
615
|
scrollLeft: 0,
|
|
631
616
|
scrollTop: 0
|
|
632
|
-
},
|
|
633
|
-
const
|
|
634
|
-
if ((
|
|
635
|
-
const
|
|
636
|
-
|
|
617
|
+
}, l = B(1);
|
|
618
|
+
const c = B(0);
|
|
619
|
+
if ((i || !i && o !== "fixed") && ((V(n) !== "body" || G(s)) && (r = it(n)), k(n))) {
|
|
620
|
+
const a = z(n);
|
|
621
|
+
l = $(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
|
|
637
622
|
}
|
|
638
623
|
return {
|
|
639
|
-
width:
|
|
640
|
-
height:
|
|
641
|
-
x:
|
|
642
|
-
y:
|
|
624
|
+
width: e.width * l.x,
|
|
625
|
+
height: e.height * l.y,
|
|
626
|
+
x: e.x * l.x - r.scrollLeft * l.x + c.x,
|
|
627
|
+
y: e.y * l.y - r.scrollTop * l.y + c.y
|
|
643
628
|
};
|
|
644
629
|
}
|
|
645
|
-
function
|
|
630
|
+
function Jt(t) {
|
|
646
631
|
return Array.from(t.getClientRects());
|
|
647
632
|
}
|
|
648
|
-
function
|
|
649
|
-
return z(
|
|
633
|
+
function At(t) {
|
|
634
|
+
return z(M(t)).left + it(t).scrollLeft;
|
|
650
635
|
}
|
|
651
|
-
function
|
|
652
|
-
const e =
|
|
653
|
-
let r = -n.scrollLeft +
|
|
654
|
-
const
|
|
636
|
+
function Kt(t) {
|
|
637
|
+
const e = M(t), n = it(t), o = t.ownerDocument.body, i = R(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = R(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
638
|
+
let r = -n.scrollLeft + At(t);
|
|
639
|
+
const l = -n.scrollTop;
|
|
655
640
|
return T(o).direction === "rtl" && (r += R(e.clientWidth, o.clientWidth) - i), {
|
|
656
641
|
width: i,
|
|
657
642
|
height: s,
|
|
658
643
|
x: r,
|
|
659
|
-
y:
|
|
644
|
+
y: l
|
|
660
645
|
};
|
|
661
646
|
}
|
|
662
|
-
function
|
|
663
|
-
const n = O(t), o =
|
|
664
|
-
let s = o.clientWidth, r = o.clientHeight,
|
|
647
|
+
function Gt(t, e) {
|
|
648
|
+
const n = O(t), o = M(t), i = n.visualViewport;
|
|
649
|
+
let s = o.clientWidth, r = o.clientHeight, l = 0, c = 0;
|
|
665
650
|
if (i) {
|
|
666
651
|
s = i.width, r = i.height;
|
|
667
652
|
const a = at();
|
|
668
|
-
(!a || a && e === "fixed") && (
|
|
653
|
+
(!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
|
|
669
654
|
}
|
|
670
655
|
return {
|
|
671
656
|
width: s,
|
|
672
657
|
height: r,
|
|
673
|
-
x:
|
|
674
|
-
y:
|
|
658
|
+
x: l,
|
|
659
|
+
y: c
|
|
675
660
|
};
|
|
676
661
|
}
|
|
677
|
-
function
|
|
678
|
-
const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ? $(t) : B(1), r = t.clientWidth * s.x,
|
|
662
|
+
function Qt(t, e) {
|
|
663
|
+
const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ? $(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = i * s.x, a = o * s.y;
|
|
679
664
|
return {
|
|
680
665
|
width: r,
|
|
681
|
-
height:
|
|
682
|
-
x:
|
|
666
|
+
height: l,
|
|
667
|
+
x: c,
|
|
683
668
|
y: a
|
|
684
669
|
};
|
|
685
670
|
}
|
|
686
671
|
function pt(t, e, n) {
|
|
687
672
|
let o;
|
|
688
673
|
if (e === "viewport")
|
|
689
|
-
o =
|
|
674
|
+
o = Gt(t, n);
|
|
690
675
|
else if (e === "document")
|
|
691
|
-
o =
|
|
692
|
-
else if (
|
|
693
|
-
o =
|
|
676
|
+
o = Kt(M(t));
|
|
677
|
+
else if (W(e))
|
|
678
|
+
o = Qt(e, n);
|
|
694
679
|
else {
|
|
695
680
|
const i = bt(t);
|
|
696
681
|
o = {
|
|
@@ -701,68 +686,60 @@ function pt(t, e, n) {
|
|
|
701
686
|
}
|
|
702
687
|
return et(o);
|
|
703
688
|
}
|
|
704
|
-
function
|
|
705
|
-
const n =
|
|
706
|
-
return n === e || !
|
|
689
|
+
function Et(t, e) {
|
|
690
|
+
const n = I(t);
|
|
691
|
+
return n === e || !W(n) || ot(n) ? !1 : T(n).position === "fixed" || Et(n, e);
|
|
707
692
|
}
|
|
708
|
-
function
|
|
693
|
+
function Zt(t, e) {
|
|
709
694
|
const n = e.get(t);
|
|
710
695
|
if (n)
|
|
711
696
|
return n;
|
|
712
|
-
let o = J(t, [], !1).filter((
|
|
697
|
+
let o = J(t, [], !1).filter((l) => W(l) && V(l) !== "body"), i = null;
|
|
713
698
|
const s = T(t).position === "fixed";
|
|
714
|
-
let r = s ?
|
|
715
|
-
for (;
|
|
716
|
-
const
|
|
717
|
-
!
|
|
699
|
+
let r = s ? I(t) : t;
|
|
700
|
+
for (; W(r) && !ot(r); ) {
|
|
701
|
+
const l = T(r), c = lt(r);
|
|
702
|
+
!c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || G(r) && !c && Et(t, r)) ? o = o.filter((d) => d !== r) : i = l, r = I(r);
|
|
718
703
|
}
|
|
719
704
|
return e.set(t, o), o;
|
|
720
705
|
}
|
|
721
|
-
function
|
|
706
|
+
function te(t) {
|
|
722
707
|
let {
|
|
723
708
|
element: e,
|
|
724
709
|
boundary: n,
|
|
725
710
|
rootBoundary: o,
|
|
726
711
|
strategy: i
|
|
727
712
|
} = t;
|
|
728
|
-
const r = [...n === "clippingAncestors" ?
|
|
729
|
-
const
|
|
730
|
-
return a.top = R(
|
|
731
|
-
}, pt(e,
|
|
713
|
+
const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n), o], l = r[0], c = r.reduce((a, d) => {
|
|
714
|
+
const h = pt(e, d, i);
|
|
715
|
+
return a.top = R(h.top, a.top), a.right = N(h.right, a.right), a.bottom = N(h.bottom, a.bottom), a.left = R(h.left, a.left), a;
|
|
716
|
+
}, pt(e, l, i));
|
|
732
717
|
return {
|
|
733
|
-
width:
|
|
734
|
-
height:
|
|
735
|
-
x:
|
|
736
|
-
y:
|
|
718
|
+
width: c.right - c.left,
|
|
719
|
+
height: c.bottom - c.top,
|
|
720
|
+
x: c.left,
|
|
721
|
+
y: c.top
|
|
737
722
|
};
|
|
738
723
|
}
|
|
739
|
-
function
|
|
740
|
-
|
|
741
|
-
width: e,
|
|
742
|
-
height: n
|
|
743
|
-
} = yt(t);
|
|
744
|
-
return {
|
|
745
|
-
width: e,
|
|
746
|
-
height: n
|
|
747
|
-
};
|
|
724
|
+
function ee(t) {
|
|
725
|
+
return yt(t);
|
|
748
726
|
}
|
|
749
|
-
function
|
|
750
|
-
const o = k(e), i =
|
|
751
|
-
let
|
|
727
|
+
function ne(t, e, n) {
|
|
728
|
+
const o = k(e), i = M(e), s = n === "fixed", r = z(t, !0, s, e);
|
|
729
|
+
let l = {
|
|
752
730
|
scrollLeft: 0,
|
|
753
731
|
scrollTop: 0
|
|
754
732
|
};
|
|
755
|
-
const
|
|
733
|
+
const c = B(0);
|
|
756
734
|
if (o || !o && !s)
|
|
757
|
-
if ((V(e) !== "body" || G(i)) && (
|
|
758
|
-
const
|
|
759
|
-
|
|
735
|
+
if ((V(e) !== "body" || G(i)) && (l = it(e)), o) {
|
|
736
|
+
const a = z(e, !0, s, e);
|
|
737
|
+
c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
|
|
760
738
|
} else
|
|
761
|
-
i && (
|
|
762
|
-
const a = r.left + c.scrollLeft - l.x, h = r.top + c.scrollTop - l.y;
|
|
739
|
+
i && (c.x = At(i));
|
|
763
740
|
return {
|
|
764
|
-
x:
|
|
765
|
-
y:
|
|
741
|
+
x: r.left + l.scrollLeft - c.x,
|
|
742
|
+
y: r.top + l.scrollTop - c.y,
|
|
766
743
|
width: r.width,
|
|
767
744
|
height: r.height
|
|
768
745
|
};
|
|
@@ -770,137 +747,139 @@ function ie(t, e, n) {
|
|
|
770
747
|
function mt(t, e) {
|
|
771
748
|
return !k(t) || T(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
|
772
749
|
}
|
|
773
|
-
function
|
|
750
|
+
function Ct(t, e) {
|
|
774
751
|
const n = O(t);
|
|
775
|
-
if (!k(t)
|
|
752
|
+
if (!k(t))
|
|
776
753
|
return n;
|
|
777
754
|
let o = mt(t, e);
|
|
778
|
-
for (; o &&
|
|
755
|
+
for (; o && _t(o) && T(o).position === "static"; )
|
|
779
756
|
o = mt(o, e);
|
|
780
|
-
return o && (V(o) === "html" || V(o) === "body" && T(o).position === "static" && !
|
|
757
|
+
return o && (V(o) === "html" || V(o) === "body" && T(o).position === "static" && !lt(o)) ? n : o || Yt(t) || n;
|
|
781
758
|
}
|
|
782
|
-
const
|
|
783
|
-
|
|
759
|
+
const oe = async function(t) {
|
|
760
|
+
let {
|
|
761
|
+
reference: e,
|
|
762
|
+
floating: n,
|
|
763
|
+
strategy: o
|
|
764
|
+
} = t;
|
|
765
|
+
const i = this.getOffsetParent || Ct, s = this.getDimensions;
|
|
784
766
|
return {
|
|
785
|
-
reference:
|
|
767
|
+
reference: ne(e, await i(n), o),
|
|
786
768
|
floating: {
|
|
787
769
|
x: 0,
|
|
788
770
|
y: 0,
|
|
789
|
-
...await n
|
|
771
|
+
...await s(n)
|
|
790
772
|
}
|
|
791
773
|
};
|
|
792
774
|
};
|
|
793
|
-
function
|
|
775
|
+
function ie(t) {
|
|
794
776
|
return T(t).direction === "rtl";
|
|
795
777
|
}
|
|
796
|
-
const
|
|
797
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
798
|
-
getDocumentElement:
|
|
799
|
-
getClippingRect:
|
|
800
|
-
getOffsetParent:
|
|
801
|
-
getElementRects:
|
|
802
|
-
getClientRects:
|
|
803
|
-
getDimensions:
|
|
778
|
+
const se = {
|
|
779
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ut,
|
|
780
|
+
getDocumentElement: M,
|
|
781
|
+
getClippingRect: te,
|
|
782
|
+
getOffsetParent: Ct,
|
|
783
|
+
getElementRects: oe,
|
|
784
|
+
getClientRects: Jt,
|
|
785
|
+
getDimensions: ee,
|
|
804
786
|
getScale: $,
|
|
805
|
-
isElement:
|
|
806
|
-
isRTL:
|
|
787
|
+
isElement: W,
|
|
788
|
+
isRTL: ie
|
|
807
789
|
};
|
|
808
|
-
function
|
|
790
|
+
function re(t, e) {
|
|
809
791
|
let n = null, o;
|
|
810
|
-
const i =
|
|
792
|
+
const i = M(t);
|
|
811
793
|
function s() {
|
|
812
|
-
|
|
813
|
-
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
794
|
+
clearTimeout(o), n && n.disconnect(), n = null;
|
|
814
795
|
}
|
|
815
|
-
function r(
|
|
816
|
-
|
|
796
|
+
function r(l, c) {
|
|
797
|
+
l === void 0 && (l = !1), c === void 0 && (c = 1), s();
|
|
817
798
|
const {
|
|
818
799
|
left: a,
|
|
819
|
-
top:
|
|
820
|
-
width:
|
|
800
|
+
top: d,
|
|
801
|
+
width: h,
|
|
821
802
|
height: p
|
|
822
803
|
} = t.getBoundingClientRect();
|
|
823
|
-
if (
|
|
804
|
+
if (l || e(), !h || !p)
|
|
824
805
|
return;
|
|
825
|
-
const f = Q(
|
|
826
|
-
rootMargin: -f + "px " + -
|
|
827
|
-
threshold: R(0, N(1,
|
|
806
|
+
const f = Q(d), u = Q(i.clientWidth - (a + h)), m = Q(i.clientHeight - (d + p)), w = Q(a), x = {
|
|
807
|
+
rootMargin: -f + "px " + -u + "px " + -m + "px " + -w + "px",
|
|
808
|
+
threshold: R(0, N(1, c)) || 1
|
|
828
809
|
};
|
|
829
|
-
let
|
|
830
|
-
function
|
|
831
|
-
const
|
|
832
|
-
if (
|
|
833
|
-
if (!
|
|
810
|
+
let y = !0;
|
|
811
|
+
function A(v) {
|
|
812
|
+
const b = v[0].intersectionRatio;
|
|
813
|
+
if (b !== c) {
|
|
814
|
+
if (!y)
|
|
834
815
|
return r();
|
|
835
|
-
|
|
816
|
+
b ? r(!1, b) : o = setTimeout(() => {
|
|
836
817
|
r(!1, 1e-7);
|
|
837
818
|
}, 100);
|
|
838
819
|
}
|
|
839
|
-
|
|
820
|
+
y = !1;
|
|
840
821
|
}
|
|
841
822
|
try {
|
|
842
|
-
n = new IntersectionObserver(
|
|
843
|
-
...
|
|
823
|
+
n = new IntersectionObserver(A, {
|
|
824
|
+
...x,
|
|
844
825
|
// Handle <iframe>s
|
|
845
826
|
root: i.ownerDocument
|
|
846
827
|
});
|
|
847
828
|
} catch {
|
|
848
|
-
n = new IntersectionObserver(
|
|
829
|
+
n = new IntersectionObserver(A, x);
|
|
849
830
|
}
|
|
850
831
|
n.observe(t);
|
|
851
832
|
}
|
|
852
833
|
return r(!0), s;
|
|
853
834
|
}
|
|
854
|
-
function
|
|
835
|
+
function ce(t, e, n, o) {
|
|
855
836
|
o === void 0 && (o = {});
|
|
856
837
|
const {
|
|
857
838
|
ancestorScroll: i = !0,
|
|
858
839
|
ancestorResize: s = !0,
|
|
859
840
|
elementResize: r = typeof ResizeObserver == "function",
|
|
860
|
-
layoutShift:
|
|
861
|
-
animationFrame:
|
|
862
|
-
} = o, a = ft(t),
|
|
863
|
-
|
|
841
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
842
|
+
animationFrame: c = !1
|
|
843
|
+
} = o, a = ft(t), d = i || s ? [...a ? J(a) : [], ...J(e)] : [];
|
|
844
|
+
d.forEach((g) => {
|
|
864
845
|
i && g.addEventListener("scroll", n, {
|
|
865
846
|
passive: !0
|
|
866
847
|
}), s && g.addEventListener("resize", n);
|
|
867
848
|
});
|
|
868
|
-
const
|
|
849
|
+
const h = a && l ? re(a, n) : null;
|
|
869
850
|
let p = -1, f = null;
|
|
870
851
|
r && (f = new ResizeObserver((g) => {
|
|
871
|
-
let [
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
(x = f) == null || x.observe(e);
|
|
852
|
+
let [x] = g;
|
|
853
|
+
x && x.target === a && f && (f.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
854
|
+
f && f.observe(e);
|
|
875
855
|
})), n();
|
|
876
|
-
}), a && !
|
|
877
|
-
let
|
|
878
|
-
|
|
856
|
+
}), a && !c && f.observe(a), f.observe(e));
|
|
857
|
+
let u, m = c ? z(t) : null;
|
|
858
|
+
c && w();
|
|
879
859
|
function w() {
|
|
880
860
|
const g = z(t);
|
|
881
|
-
m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g,
|
|
861
|
+
m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g, u = requestAnimationFrame(w);
|
|
882
862
|
}
|
|
883
863
|
return n(), () => {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
}), u == null || u(), (g = f) == null || g.disconnect(), f = null, l && cancelAnimationFrame(d);
|
|
864
|
+
d.forEach((g) => {
|
|
865
|
+
i && g.removeEventListener("scroll", n), s && g.removeEventListener("resize", n);
|
|
866
|
+
}), h && h(), f && f.disconnect(), f = null, c && cancelAnimationFrame(u);
|
|
888
867
|
};
|
|
889
868
|
}
|
|
890
|
-
const
|
|
869
|
+
const le = (t, e, n) => {
|
|
891
870
|
const o = /* @__PURE__ */ new Map(), i = {
|
|
892
|
-
platform:
|
|
871
|
+
platform: se,
|
|
893
872
|
...n
|
|
894
873
|
}, s = {
|
|
895
874
|
...i.platform,
|
|
896
875
|
_c: o
|
|
897
876
|
};
|
|
898
|
-
return
|
|
877
|
+
return Bt(t, e, {
|
|
899
878
|
...i,
|
|
900
879
|
platform: s
|
|
901
880
|
});
|
|
902
|
-
},
|
|
903
|
-
class
|
|
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}";
|
|
882
|
+
class he extends Tt {
|
|
904
883
|
/**
|
|
905
884
|
* Creates an instance of Popup.
|
|
906
885
|
*
|
|
@@ -934,7 +913,7 @@ class we extends Pt {
|
|
|
934
913
|
* @returns {CSSStyleSheet}
|
|
935
914
|
*/
|
|
936
915
|
static get cssStyleSheet() {
|
|
937
|
-
return
|
|
916
|
+
return ae;
|
|
938
917
|
}
|
|
939
918
|
/**
|
|
940
919
|
* Returns the list of attributes to observe for changes.
|
|
@@ -972,12 +951,12 @@ class we extends Pt {
|
|
|
972
951
|
draw(n, o, i) {
|
|
973
952
|
let s = document.createDocumentFragment(), r = document.createElement("slot");
|
|
974
953
|
r.setAttribute("name", "anchor");
|
|
975
|
-
let
|
|
976
|
-
|
|
977
|
-
let
|
|
978
|
-
|
|
954
|
+
let l = document.createElement("slot");
|
|
955
|
+
l.setAttribute("name", "arrow");
|
|
956
|
+
let c = document.createElement("div");
|
|
957
|
+
c.setAttribute("part", "native"), c.classList.add("native-popup");
|
|
979
958
|
let a = document.createElement("slot");
|
|
980
|
-
return
|
|
959
|
+
return c.appendChild(a), c.appendChild(l), s.appendChild(r), s.appendChild(c), this.slotAnchor = r, this.slotArrow = l, this.native = c, s;
|
|
981
960
|
}
|
|
982
961
|
afterDraw(n, o, i) {
|
|
983
962
|
this.setAnchor();
|
|
@@ -992,7 +971,7 @@ class we extends Pt {
|
|
|
992
971
|
this.anchorEl = n.getElementById(this.anchor);
|
|
993
972
|
} else
|
|
994
973
|
this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: !0 })[0]);
|
|
995
|
-
U.addListener(this.anchorEl, "click", null, (n) => {
|
|
974
|
+
this.manual || U.addListener(this.anchorEl, "click", null, (n) => {
|
|
996
975
|
this.hasAttribute("disabled") || this.showHide();
|
|
997
976
|
}, { stopPropagation: !0 }), document.addEventListener("click", (n) => {
|
|
998
977
|
n.composedPath().some((i) => i === this) || this.hasAttribute("active") && this.removeAttribute("active");
|
|
@@ -1011,39 +990,39 @@ class we extends Pt {
|
|
|
1011
990
|
reposition() {
|
|
1012
991
|
const n = [];
|
|
1013
992
|
this.offsetCalc = +this.offset || 0, this.slotArrow instanceof HTMLSlotElement && (this.arrow = this.slotArrow.assignedElements({ flatten: !0 })[0], this.arrow && (n.push(
|
|
1014
|
-
|
|
993
|
+
Vt({
|
|
1015
994
|
element: this.arrow
|
|
1016
995
|
})
|
|
1017
996
|
), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset)), n.push(
|
|
1018
|
-
|
|
997
|
+
$t(this.offsetCalc)
|
|
1019
998
|
), n.push(
|
|
1020
|
-
|
|
999
|
+
jt()
|
|
1021
1000
|
), this.hasAttribute("size") && n.push(
|
|
1022
|
-
|
|
1001
|
+
It({
|
|
1023
1002
|
apply({ availableWidth: o, availableHeight: i, elements: s }) {
|
|
1024
1003
|
Object.assign(s.floating.style, {
|
|
1025
1004
|
width: `${s.reference.offsetWidth}px`
|
|
1026
1005
|
});
|
|
1027
1006
|
}
|
|
1028
1007
|
})
|
|
1029
|
-
),
|
|
1008
|
+
), le(this.anchorEl, this.native, {
|
|
1030
1009
|
placement: this.placement || "bottom",
|
|
1031
1010
|
strategy: "fixed",
|
|
1032
1011
|
middleware: n
|
|
1033
|
-
}).then(({ x: o, y: i, middlewareData: s, placement: r, strategy:
|
|
1034
|
-
if (this.native.style.setProperty("--wje-popup-left", o + "px"), this.native.style.setProperty("--wje-popup-top", i + "px"), this.native.style.position =
|
|
1035
|
-
const
|
|
1012
|
+
}).then(({ x: o, y: i, middlewareData: s, placement: r, strategy: l }) => {
|
|
1013
|
+
if (this.native.style.setProperty("--wje-popup-left", o + "px"), this.native.style.setProperty("--wje-popup-top", i + "px"), this.native.style.position = l, this.arrow) {
|
|
1014
|
+
const c = {
|
|
1036
1015
|
top: "bottom",
|
|
1037
1016
|
right: "left",
|
|
1038
1017
|
bottom: "top",
|
|
1039
1018
|
left: "right"
|
|
1040
|
-
}[
|
|
1019
|
+
}[r];
|
|
1041
1020
|
if (s.arrow) {
|
|
1042
|
-
const { x: h, y:
|
|
1021
|
+
const { width: a, height: d } = this.native.getBoundingClientRect(), { x: h, y: p } = s.arrow;
|
|
1043
1022
|
Object.assign(this.arrow.style, {
|
|
1044
|
-
left: h != null ? `${
|
|
1045
|
-
top:
|
|
1046
|
-
[
|
|
1023
|
+
left: h != null ? `${a / 2 - this.arrow.offsetWidth / 2}px` : "",
|
|
1024
|
+
top: p != null ? `${d / 2 - this.arrow.offsetHeight / 2}px` : "",
|
|
1025
|
+
[c]: `${-this.arrow.offsetHeight / 2}px`
|
|
1047
1026
|
});
|
|
1048
1027
|
}
|
|
1049
1028
|
}
|
|
@@ -1059,9 +1038,9 @@ class we extends Pt {
|
|
|
1059
1038
|
* Sets up auto update for repositioning.
|
|
1060
1039
|
*/
|
|
1061
1040
|
show() {
|
|
1062
|
-
U.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), this.cleanup =
|
|
1041
|
+
U.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), this.cleanup = ce(this.anchorEl, this.native, () => {
|
|
1063
1042
|
this.reposition();
|
|
1064
|
-
});
|
|
1043
|
+
}), this.hasAttribute("active") || this.setAttribute("active", "");
|
|
1065
1044
|
}
|
|
1066
1045
|
/**
|
|
1067
1046
|
* Hides the popup.
|
|
@@ -1069,7 +1048,7 @@ class we extends Pt {
|
|
|
1069
1048
|
* Cleans up the auto update for repositioning.
|
|
1070
1049
|
*/
|
|
1071
1050
|
hide() {
|
|
1072
|
-
U.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), this.cleanup, this.cleanup = void 0;
|
|
1051
|
+
U.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), this.removeAttribute("active"), this.cleanup, this.cleanup = void 0;
|
|
1073
1052
|
}
|
|
1074
1053
|
/**
|
|
1075
1054
|
* Removes the active attribute when the popup is hidden.
|
|
@@ -1085,5 +1064,5 @@ class we extends Pt {
|
|
|
1085
1064
|
}
|
|
1086
1065
|
}
|
|
1087
1066
|
export {
|
|
1088
|
-
|
|
1067
|
+
he as P
|
|
1089
1068
|
};
|