wj-elements 0.0.3 → 0.0.5
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/router-links-e0087f84.js +146 -0
- package/dist/style.css +2 -2365
- package/dist/wj-aside.js +18 -22
- package/dist/wj-avatar.js +32 -49
- package/dist/wj-badge.js +18 -22
- package/dist/wj-breadcrumb.js +53 -103
- package/dist/wj-breadcrumbs.js +21 -36
- package/dist/wj-button-group.js +24 -36
- package/dist/wj-button.js +37 -80
- package/dist/wj-card-content.js +16 -18
- package/dist/wj-card-controls.js +16 -18
- package/dist/wj-card-header.js +16 -20
- package/dist/wj-card-subtitle.js +17 -19
- package/dist/wj-card-title.js +16 -18
- package/dist/wj-card.js +16 -20
- package/dist/wj-checkbox.js +24 -46
- package/dist/wj-chip.js +21 -39
- package/dist/wj-col.js +18 -32
- package/dist/wj-color-picker.js +503 -868
- package/dist/wj-container.js +18 -20
- package/dist/wj-copy-button.js +66 -112
- package/dist/wj-dialog.js +43 -67
- package/dist/wj-divider.js +16 -20
- package/dist/wj-dropdown.js +22 -31
- package/dist/wj-element.js +241 -416
- package/dist/wj-footer.js +16 -18
- package/dist/wj-form.js +16 -18
- package/dist/wj-grid.js +17 -21
- package/dist/wj-header.js +18 -22
- package/dist/wj-icon-picker.js +66 -107
- package/dist/wj-icon.js +67 -142
- package/dist/wj-img-comparer.js +43 -72
- package/dist/wj-img.js +21 -31
- package/dist/wj-infinite-scroll.js +49 -84
- package/dist/wj-input.js +67 -146
- package/dist/wj-item.js +19 -34
- package/dist/wj-label.js +19 -21
- package/dist/wj-list.js +17 -20
- package/dist/wj-main.js +16 -18
- package/dist/wj-master.js +331 -462
- package/dist/wj-menu-button.js +18 -21
- package/dist/wj-menu-item.js +67 -144
- package/dist/wj-menu-label.js +17 -21
- package/dist/wj-menu.js +20 -24
- package/dist/wj-popup.js +714 -1140
- package/dist/wj-progress-bar.js +42 -100
- package/dist/wj-radio-group.js +27 -38
- package/dist/wj-radio.js +24 -46
- package/dist/wj-route.js +8 -11
- package/dist/wj-router-link.js +19 -22
- package/dist/wj-router-outlet.js +71 -135
- package/dist/wj-routerx.js +641 -1121
- package/dist/wj-row.js +20 -22
- package/dist/wj-slider.js +55 -97
- package/dist/wj-split-view.js +45 -81
- package/dist/wj-store.js +110 -195
- package/dist/wj-textarea.js +39 -86
- package/dist/wj-thumbnail.js +17 -19
- package/dist/wj-toast.js +34 -88
- package/dist/wj-toggle.js +24 -42
- package/dist/wj-toolbar-action.js +16 -27
- package/dist/wj-toolbar.js +21 -26
- package/dist/wj-tooltip.js +27 -41
- package/dist/wj-visually-hidden.js +16 -18
- package/package.json +1 -1
- package/dist/router-links-26e4a166.js +0 -204
package/dist/wj-popup.js
CHANGED
|
@@ -1,1278 +1,902 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import WJElement, { event } from "./wj-element.js";
|
|
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 G } from "./wj-element.js";
|
|
8
5
|
import "./wj-store.js";
|
|
9
|
-
const min = Math.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const createCoords = (v) => ({
|
|
14
|
-
x: v,
|
|
15
|
-
y: v
|
|
16
|
-
});
|
|
17
|
-
const oppositeSideMap = {
|
|
6
|
+
const N = Math.min, R = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
|
|
7
|
+
x: t,
|
|
8
|
+
y: t
|
|
9
|
+
}), Pt = {
|
|
18
10
|
left: "right",
|
|
19
11
|
right: "left",
|
|
20
12
|
bottom: "top",
|
|
21
13
|
top: "bottom"
|
|
22
|
-
}
|
|
23
|
-
const oppositeAlignmentMap = {
|
|
14
|
+
}, St = {
|
|
24
15
|
start: "end",
|
|
25
16
|
end: "start"
|
|
26
17
|
};
|
|
27
|
-
function
|
|
28
|
-
return
|
|
18
|
+
function Dt(t, e, n) {
|
|
19
|
+
return R(t, N(e, n));
|
|
29
20
|
}
|
|
30
|
-
function
|
|
31
|
-
return typeof
|
|
21
|
+
function U(t, e) {
|
|
22
|
+
return typeof t == "function" ? t(e) : t;
|
|
32
23
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
24
|
+
function j(t) {
|
|
25
|
+
return t.split("-")[0];
|
|
35
26
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
27
|
+
function _(t) {
|
|
28
|
+
return t.split("-")[1];
|
|
38
29
|
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
30
|
+
function kt(t) {
|
|
31
|
+
return t === "x" ? "y" : "x";
|
|
41
32
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
33
|
+
function rt(t) {
|
|
34
|
+
return t === "y" ? "height" : "width";
|
|
44
35
|
}
|
|
45
|
-
function
|
|
46
|
-
return ["top", "bottom"].includes(
|
|
36
|
+
function nt(t) {
|
|
37
|
+
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
47
38
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
39
|
+
function ct(t) {
|
|
40
|
+
return kt(nt(t));
|
|
50
41
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
57
|
-
const length = getAxisLength(alignmentAxis);
|
|
58
|
-
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
59
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
60
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
61
|
-
}
|
|
62
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
42
|
+
function Wt(t, e, n) {
|
|
43
|
+
n === void 0 && (n = !1);
|
|
44
|
+
const o = _(t), i = ct(t), s = rt(i);
|
|
45
|
+
let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
46
|
+
return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
|
|
63
47
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
return [
|
|
48
|
+
function Mt(t) {
|
|
49
|
+
const e = tt(t);
|
|
50
|
+
return [st(t), e, st(e)];
|
|
67
51
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
52
|
+
function st(t) {
|
|
53
|
+
return t.replace(/start|end/g, (e) => St[e]);
|
|
70
54
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const tb = ["top", "bottom"];
|
|
75
|
-
const bt = ["bottom", "top"];
|
|
76
|
-
switch (side) {
|
|
55
|
+
function Ft(t, e, n) {
|
|
56
|
+
const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
57
|
+
switch (t) {
|
|
77
58
|
case "top":
|
|
78
59
|
case "bottom":
|
|
79
|
-
|
|
80
|
-
return isStart ? rl : lr;
|
|
81
|
-
return isStart ? lr : rl;
|
|
60
|
+
return n ? e ? i : o : e ? o : i;
|
|
82
61
|
case "left":
|
|
83
62
|
case "right":
|
|
84
|
-
return
|
|
63
|
+
return e ? s : r;
|
|
85
64
|
default:
|
|
86
65
|
return [];
|
|
87
66
|
}
|
|
88
67
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
list = list.map((side) => side + "-" + alignment);
|
|
94
|
-
if (flipAlignment) {
|
|
95
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return list;
|
|
68
|
+
function Ht(t, e, n, o) {
|
|
69
|
+
const i = _(t);
|
|
70
|
+
let s = Ft(j(t), n === "start", o);
|
|
71
|
+
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(st)))), s;
|
|
99
72
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
73
|
+
function tt(t) {
|
|
74
|
+
return t.replace(/left|right|bottom|top/g, (e) => Pt[e]);
|
|
102
75
|
}
|
|
103
|
-
function
|
|
76
|
+
function Nt(t) {
|
|
104
77
|
return {
|
|
105
78
|
top: 0,
|
|
106
79
|
right: 0,
|
|
107
80
|
bottom: 0,
|
|
108
81
|
left: 0,
|
|
109
|
-
...
|
|
82
|
+
...t
|
|
110
83
|
};
|
|
111
84
|
}
|
|
112
|
-
function
|
|
113
|
-
return typeof
|
|
114
|
-
top:
|
|
115
|
-
right:
|
|
116
|
-
bottom:
|
|
117
|
-
left:
|
|
85
|
+
function gt(t) {
|
|
86
|
+
return typeof t != "number" ? Nt(t) : {
|
|
87
|
+
top: t,
|
|
88
|
+
right: t,
|
|
89
|
+
bottom: t,
|
|
90
|
+
left: t
|
|
118
91
|
};
|
|
119
92
|
}
|
|
120
|
-
function
|
|
93
|
+
function et(t) {
|
|
121
94
|
return {
|
|
122
|
-
...
|
|
123
|
-
top:
|
|
124
|
-
left:
|
|
125
|
-
right:
|
|
126
|
-
bottom:
|
|
95
|
+
...t,
|
|
96
|
+
top: t.y,
|
|
97
|
+
left: t.x,
|
|
98
|
+
right: t.x + t.width,
|
|
99
|
+
bottom: t.y + t.height
|
|
127
100
|
};
|
|
128
101
|
}
|
|
129
|
-
function
|
|
102
|
+
function ht(t, e, n) {
|
|
130
103
|
let {
|
|
131
|
-
reference,
|
|
132
|
-
floating
|
|
133
|
-
} =
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const side = getSide(placement);
|
|
138
|
-
const isVertical = sideAxis === "y";
|
|
139
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
140
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
141
|
-
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
142
|
-
let coords;
|
|
143
|
-
switch (side) {
|
|
104
|
+
reference: o,
|
|
105
|
+
floating: i
|
|
106
|
+
} = t;
|
|
107
|
+
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, u = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
|
|
108
|
+
let f;
|
|
109
|
+
switch (c) {
|
|
144
110
|
case "top":
|
|
145
|
-
|
|
146
|
-
x:
|
|
147
|
-
y:
|
|
111
|
+
f = {
|
|
112
|
+
x: d,
|
|
113
|
+
y: o.y - i.height
|
|
148
114
|
};
|
|
149
115
|
break;
|
|
150
116
|
case "bottom":
|
|
151
|
-
|
|
152
|
-
x:
|
|
153
|
-
y:
|
|
117
|
+
f = {
|
|
118
|
+
x: d,
|
|
119
|
+
y: o.y + o.height
|
|
154
120
|
};
|
|
155
121
|
break;
|
|
156
122
|
case "right":
|
|
157
|
-
|
|
158
|
-
x:
|
|
159
|
-
y:
|
|
123
|
+
f = {
|
|
124
|
+
x: o.x + o.width,
|
|
125
|
+
y: u
|
|
160
126
|
};
|
|
161
127
|
break;
|
|
162
128
|
case "left":
|
|
163
|
-
|
|
164
|
-
x:
|
|
165
|
-
y:
|
|
129
|
+
f = {
|
|
130
|
+
x: o.x - i.width,
|
|
131
|
+
y: u
|
|
166
132
|
};
|
|
167
133
|
break;
|
|
168
134
|
default:
|
|
169
|
-
|
|
170
|
-
x:
|
|
171
|
-
y:
|
|
135
|
+
f = {
|
|
136
|
+
x: o.x,
|
|
137
|
+
y: o.y
|
|
172
138
|
};
|
|
173
139
|
}
|
|
174
|
-
switch (
|
|
140
|
+
switch (_(e)) {
|
|
175
141
|
case "start":
|
|
176
|
-
|
|
142
|
+
f[r] -= p * (n && a ? -1 : 1);
|
|
177
143
|
break;
|
|
178
144
|
case "end":
|
|
179
|
-
|
|
145
|
+
f[r] += p * (n && a ? -1 : 1);
|
|
180
146
|
break;
|
|
181
147
|
}
|
|
182
|
-
return
|
|
148
|
+
return f;
|
|
183
149
|
}
|
|
184
|
-
const
|
|
150
|
+
const Bt = async (t, e, n) => {
|
|
185
151
|
const {
|
|
186
|
-
placement = "bottom",
|
|
187
|
-
strategy = "absolute",
|
|
188
|
-
middleware = [],
|
|
189
|
-
platform:
|
|
190
|
-
} =
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
y
|
|
201
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
202
|
-
let statefulPlacement = placement;
|
|
203
|
-
let middlewareData = {};
|
|
204
|
-
let resetCount = 0;
|
|
205
|
-
for (let i = 0; i < validMiddleware.length; i++) {
|
|
206
|
-
const {
|
|
207
|
-
name,
|
|
208
|
-
fn
|
|
209
|
-
} = validMiddleware[i];
|
|
152
|
+
placement: o = "bottom",
|
|
153
|
+
strategy: i = "absolute",
|
|
154
|
+
middleware: s = [],
|
|
155
|
+
platform: r
|
|
156
|
+
} = n, l = s.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
157
|
+
let a = await r.getElementRects({
|
|
158
|
+
reference: t,
|
|
159
|
+
floating: e,
|
|
160
|
+
strategy: i
|
|
161
|
+
}), {
|
|
162
|
+
x: d,
|
|
163
|
+
y: u
|
|
164
|
+
} = ht(a, o, c), p = o, f = {}, h = 0;
|
|
165
|
+
for (let m = 0; m < l.length; m++) {
|
|
210
166
|
const {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
} = await fn({
|
|
216
|
-
x,
|
|
167
|
+
name: w,
|
|
168
|
+
fn: g
|
|
169
|
+
} = l[m], {
|
|
170
|
+
x: v,
|
|
217
171
|
y,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
172
|
+
data: A,
|
|
173
|
+
reset: x
|
|
174
|
+
} = await g({
|
|
175
|
+
x: d,
|
|
176
|
+
y: u,
|
|
177
|
+
initialPlacement: o,
|
|
178
|
+
placement: p,
|
|
179
|
+
strategy: i,
|
|
180
|
+
middlewareData: f,
|
|
181
|
+
rects: a,
|
|
182
|
+
platform: r,
|
|
224
183
|
elements: {
|
|
225
|
-
reference,
|
|
226
|
-
floating
|
|
184
|
+
reference: t,
|
|
185
|
+
floating: e
|
|
227
186
|
}
|
|
228
187
|
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
...middlewareData[name],
|
|
235
|
-
...data
|
|
188
|
+
if (d = v ?? d, u = y ?? u, f = {
|
|
189
|
+
...f,
|
|
190
|
+
[w]: {
|
|
191
|
+
...f[w],
|
|
192
|
+
...A
|
|
236
193
|
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
reference,
|
|
247
|
-
floating,
|
|
248
|
-
strategy
|
|
249
|
-
}) : reset.rects;
|
|
250
|
-
}
|
|
251
|
-
({
|
|
252
|
-
x,
|
|
253
|
-
y
|
|
254
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
255
|
-
}
|
|
256
|
-
i = -1;
|
|
194
|
+
}, x && h <= 50) {
|
|
195
|
+
h++, typeof x == "object" && (x.placement && (p = x.placement), x.rects && (a = x.rects === !0 ? await r.getElementRects({
|
|
196
|
+
reference: t,
|
|
197
|
+
floating: e,
|
|
198
|
+
strategy: i
|
|
199
|
+
}) : x.rects), {
|
|
200
|
+
x: d,
|
|
201
|
+
y: u
|
|
202
|
+
} = ht(a, p, c)), m = -1;
|
|
257
203
|
continue;
|
|
258
204
|
}
|
|
259
205
|
}
|
|
260
206
|
return {
|
|
261
|
-
x,
|
|
262
|
-
y,
|
|
263
|
-
placement:
|
|
264
|
-
strategy,
|
|
265
|
-
middlewareData
|
|
207
|
+
x: d,
|
|
208
|
+
y: u,
|
|
209
|
+
placement: p,
|
|
210
|
+
strategy: i,
|
|
211
|
+
middlewareData: f
|
|
266
212
|
};
|
|
267
213
|
};
|
|
268
|
-
async function
|
|
269
|
-
var
|
|
270
|
-
|
|
271
|
-
options = {};
|
|
272
|
-
}
|
|
214
|
+
async function wt(t, e) {
|
|
215
|
+
var n;
|
|
216
|
+
e === void 0 && (e = {});
|
|
273
217
|
const {
|
|
274
|
-
x,
|
|
275
|
-
y,
|
|
276
|
-
platform:
|
|
277
|
-
rects,
|
|
278
|
-
elements,
|
|
279
|
-
strategy
|
|
280
|
-
} =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}));
|
|
297
|
-
const rect = elementContext === "floating" ? {
|
|
298
|
-
...rects.floating,
|
|
299
|
-
x,
|
|
300
|
-
y
|
|
301
|
-
} : rects.reference;
|
|
302
|
-
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
303
|
-
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
218
|
+
x: o,
|
|
219
|
+
y: i,
|
|
220
|
+
platform: s,
|
|
221
|
+
rects: r,
|
|
222
|
+
elements: l,
|
|
223
|
+
strategy: c
|
|
224
|
+
} = t, {
|
|
225
|
+
boundary: a = "clippingAncestors",
|
|
226
|
+
rootBoundary: d = "viewport",
|
|
227
|
+
elementContext: u = "floating",
|
|
228
|
+
altBoundary: p = !1,
|
|
229
|
+
padding: f = 0
|
|
230
|
+
} = U(e, t), h = gt(f), w = l[p ? u === "floating" ? "reference" : "floating" : u], g = et(await s.getClippingRect({
|
|
231
|
+
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)),
|
|
232
|
+
boundary: a,
|
|
233
|
+
rootBoundary: d,
|
|
234
|
+
strategy: c
|
|
235
|
+
})), v = u === "floating" ? {
|
|
236
|
+
...r.floating,
|
|
237
|
+
x: o,
|
|
238
|
+
y: i
|
|
239
|
+
} : 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)) || {
|
|
304
240
|
x: 1,
|
|
305
241
|
y: 1
|
|
306
242
|
} : {
|
|
307
243
|
x: 1,
|
|
308
244
|
y: 1
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}) : rect);
|
|
245
|
+
}, x = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
246
|
+
rect: v,
|
|
247
|
+
offsetParent: y,
|
|
248
|
+
strategy: c
|
|
249
|
+
}) : v);
|
|
315
250
|
return {
|
|
316
|
-
top: (
|
|
317
|
-
bottom: (
|
|
318
|
-
left: (
|
|
319
|
-
right: (
|
|
251
|
+
top: (g.top - x.top + h.top) / A.y,
|
|
252
|
+
bottom: (x.bottom - g.bottom + h.bottom) / A.y,
|
|
253
|
+
left: (g.left - x.left + h.left) / A.x,
|
|
254
|
+
right: (x.right - g.right + h.right) / A.x
|
|
320
255
|
};
|
|
321
256
|
}
|
|
322
|
-
const
|
|
257
|
+
const Vt = (t) => ({
|
|
323
258
|
name: "arrow",
|
|
324
|
-
options,
|
|
325
|
-
async fn(
|
|
326
|
-
const {
|
|
327
|
-
x,
|
|
328
|
-
y,
|
|
329
|
-
placement,
|
|
330
|
-
rects,
|
|
331
|
-
platform: platform2,
|
|
332
|
-
elements,
|
|
333
|
-
middlewareData
|
|
334
|
-
} = state;
|
|
259
|
+
options: t,
|
|
260
|
+
async fn(e) {
|
|
335
261
|
const {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
262
|
+
x: n,
|
|
263
|
+
y: o,
|
|
264
|
+
placement: i,
|
|
265
|
+
rects: s,
|
|
266
|
+
platform: r,
|
|
267
|
+
elements: l,
|
|
268
|
+
middlewareData: c
|
|
269
|
+
} = e, {
|
|
270
|
+
element: a,
|
|
271
|
+
padding: d = 0
|
|
272
|
+
} = U(t, e) || {};
|
|
273
|
+
if (a == null)
|
|
340
274
|
return {};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
const length = getAxisLength(axis);
|
|
349
|
-
const arrowDimensions = await platform2.getDimensions(element);
|
|
350
|
-
const isYAxis = axis === "y";
|
|
351
|
-
const minProp = isYAxis ? "top" : "left";
|
|
352
|
-
const maxProp = isYAxis ? "bottom" : "right";
|
|
353
|
-
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
354
|
-
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
355
|
-
const startDiff = coords[axis] - rects.reference[axis];
|
|
356
|
-
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
357
|
-
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
358
|
-
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
|
|
359
|
-
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
360
|
-
}
|
|
361
|
-
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
362
|
-
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
363
|
-
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
364
|
-
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
365
|
-
const min$1 = minPadding;
|
|
366
|
-
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
367
|
-
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
368
|
-
const offset2 = clamp(min$1, center, max2);
|
|
369
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
370
|
-
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
275
|
+
const u = gt(d), p = {
|
|
276
|
+
x: n,
|
|
277
|
+
y: o
|
|
278
|
+
}, f = ct(i), h = rt(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", v = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", A = s.reference[h] + s.reference[f] - p[f] - s.floating[h], x = p[f] - s.reference[f], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
|
|
279
|
+
let E = b ? b[y] : 0;
|
|
280
|
+
(!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = l.floating[y] || s.floating[h]);
|
|
281
|
+
const P = A / 2 - x / 2, H = E / 2 - m[h] / 2 - 1, Y = N(u[g], H), X = N(u[v], H), L = Y, q = E - m[h] - X, C = E / 2 - m[h] / 2 + P, S = Dt(L, C, q), D = !c.arrow && _(i) != null && C != S && s.reference[h] / 2 - (C < L ? Y : X) - m[h] / 2 < 0, W = D ? C < L ? C - L : C - q : 0;
|
|
371
282
|
return {
|
|
372
|
-
[
|
|
283
|
+
[f]: p[f] + W,
|
|
373
284
|
data: {
|
|
374
|
-
[
|
|
375
|
-
centerOffset:
|
|
376
|
-
...
|
|
377
|
-
alignmentOffset
|
|
285
|
+
[f]: S,
|
|
286
|
+
centerOffset: C - S - W,
|
|
287
|
+
...D && {
|
|
288
|
+
alignmentOffset: W
|
|
378
289
|
}
|
|
379
290
|
},
|
|
380
|
-
reset:
|
|
291
|
+
reset: D
|
|
381
292
|
};
|
|
382
293
|
}
|
|
383
|
-
})
|
|
384
|
-
|
|
385
|
-
if (options === void 0) {
|
|
386
|
-
options = {};
|
|
387
|
-
}
|
|
388
|
-
return {
|
|
294
|
+
}), jt = function(t) {
|
|
295
|
+
return t === void 0 && (t = {}), {
|
|
389
296
|
name: "flip",
|
|
390
|
-
options,
|
|
391
|
-
async fn(
|
|
392
|
-
var
|
|
297
|
+
options: t,
|
|
298
|
+
async fn(e) {
|
|
299
|
+
var n, o;
|
|
393
300
|
const {
|
|
394
|
-
placement,
|
|
395
|
-
middlewareData,
|
|
396
|
-
rects,
|
|
397
|
-
initialPlacement,
|
|
398
|
-
platform:
|
|
399
|
-
elements
|
|
400
|
-
} =
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
301
|
+
placement: i,
|
|
302
|
+
middlewareData: s,
|
|
303
|
+
rects: r,
|
|
304
|
+
initialPlacement: l,
|
|
305
|
+
platform: c,
|
|
306
|
+
elements: a
|
|
307
|
+
} = e, {
|
|
308
|
+
mainAxis: d = !0,
|
|
309
|
+
crossAxis: u = !0,
|
|
310
|
+
fallbackPlacements: p,
|
|
311
|
+
fallbackStrategy: f = "bestFit",
|
|
312
|
+
fallbackAxisSideDirection: h = "none",
|
|
313
|
+
flipAlignment: m = !0,
|
|
314
|
+
...w
|
|
315
|
+
} = U(t, e);
|
|
316
|
+
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
411
317
|
return {};
|
|
318
|
+
const g = j(i), v = j(l) === l, y = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = p || (v || !m ? [tt(l)] : Mt(l));
|
|
319
|
+
!p && h !== "none" && A.push(...Ht(l, m, h, y));
|
|
320
|
+
const x = [l, ...A], b = await wt(e, w), E = [];
|
|
321
|
+
let P = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
322
|
+
if (d && E.push(b[g]), u) {
|
|
323
|
+
const L = Wt(i, r, y);
|
|
324
|
+
E.push(b[L[0]], b[L[1]]);
|
|
412
325
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
const placements = [initialPlacement, ...fallbackPlacements];
|
|
421
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
422
|
-
const overflows = [];
|
|
423
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
424
|
-
if (checkMainAxis) {
|
|
425
|
-
overflows.push(overflow[side]);
|
|
426
|
-
}
|
|
427
|
-
if (checkCrossAxis) {
|
|
428
|
-
const sides = getAlignmentSides(placement, rects, rtl);
|
|
429
|
-
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
430
|
-
}
|
|
431
|
-
overflowsData = [...overflowsData, {
|
|
432
|
-
placement,
|
|
433
|
-
overflows
|
|
434
|
-
}];
|
|
435
|
-
if (!overflows.every((side2) => side2 <= 0)) {
|
|
436
|
-
var _middlewareData$flip2, _overflowsData$filter;
|
|
437
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
438
|
-
const nextPlacement = placements[nextIndex];
|
|
439
|
-
if (nextPlacement) {
|
|
326
|
+
if (P = [...P, {
|
|
327
|
+
placement: i,
|
|
328
|
+
overflows: E
|
|
329
|
+
}], !E.every((L) => L <= 0)) {
|
|
330
|
+
var H, Y;
|
|
331
|
+
const L = (((H = s.flip) == null ? void 0 : H.index) || 0) + 1, q = x[L];
|
|
332
|
+
if (q)
|
|
440
333
|
return {
|
|
441
334
|
data: {
|
|
442
|
-
index:
|
|
443
|
-
overflows:
|
|
335
|
+
index: L,
|
|
336
|
+
overflows: P
|
|
444
337
|
},
|
|
445
338
|
reset: {
|
|
446
|
-
placement:
|
|
339
|
+
placement: q
|
|
447
340
|
}
|
|
448
341
|
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
switch (fallbackStrategy) {
|
|
342
|
+
let C = (Y = P.filter((S) => S.overflows[0] <= 0).sort((S, D) => S.overflows[1] - D.overflows[1])[0]) == null ? void 0 : Y.placement;
|
|
343
|
+
if (!C)
|
|
344
|
+
switch (f) {
|
|
453
345
|
case "bestFit": {
|
|
454
|
-
var
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
resetPlacement = placement2;
|
|
458
|
-
}
|
|
346
|
+
var X;
|
|
347
|
+
const S = (X = P.map((D) => [D.placement, D.overflows.filter((W) => W > 0).reduce((W, Rt) => W + Rt, 0)]).sort((D, W) => D[1] - W[1])[0]) == null ? void 0 : X[0];
|
|
348
|
+
S && (C = S);
|
|
459
349
|
break;
|
|
460
350
|
}
|
|
461
351
|
case "initialPlacement":
|
|
462
|
-
|
|
352
|
+
C = l;
|
|
463
353
|
break;
|
|
464
354
|
}
|
|
465
|
-
|
|
466
|
-
if (placement !== resetPlacement) {
|
|
355
|
+
if (i !== C)
|
|
467
356
|
return {
|
|
468
357
|
reset: {
|
|
469
|
-
placement:
|
|
358
|
+
placement: C
|
|
470
359
|
}
|
|
471
360
|
};
|
|
472
|
-
}
|
|
473
361
|
}
|
|
474
362
|
return {};
|
|
475
363
|
}
|
|
476
364
|
};
|
|
477
365
|
};
|
|
478
|
-
async function
|
|
366
|
+
async function zt(t, e) {
|
|
479
367
|
const {
|
|
480
|
-
placement,
|
|
481
|
-
platform:
|
|
482
|
-
elements
|
|
483
|
-
} =
|
|
484
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
485
|
-
const side = getSide(placement);
|
|
486
|
-
const alignment = getAlignment(placement);
|
|
487
|
-
const isVertical = getSideAxis(placement) === "y";
|
|
488
|
-
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
489
|
-
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
490
|
-
const rawValue = evaluate(options, state);
|
|
368
|
+
placement: n,
|
|
369
|
+
platform: o,
|
|
370
|
+
elements: i
|
|
371
|
+
} = 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, u = U(e, t);
|
|
491
372
|
let {
|
|
492
|
-
mainAxis,
|
|
493
|
-
crossAxis,
|
|
494
|
-
alignmentAxis
|
|
495
|
-
} = typeof
|
|
496
|
-
mainAxis:
|
|
373
|
+
mainAxis: p,
|
|
374
|
+
crossAxis: f,
|
|
375
|
+
alignmentAxis: h
|
|
376
|
+
} = typeof u == "number" ? {
|
|
377
|
+
mainAxis: u,
|
|
497
378
|
crossAxis: 0,
|
|
498
379
|
alignmentAxis: null
|
|
499
380
|
} : {
|
|
500
381
|
mainAxis: 0,
|
|
501
382
|
crossAxis: 0,
|
|
502
383
|
alignmentAxis: null,
|
|
503
|
-
...
|
|
384
|
+
...u
|
|
504
385
|
};
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
return isVertical ? {
|
|
509
|
-
x: crossAxis * crossAxisMulti,
|
|
510
|
-
y: mainAxis * mainAxisMulti
|
|
386
|
+
return l && typeof h == "number" && (f = l === "end" ? h * -1 : h), c ? {
|
|
387
|
+
x: f * d,
|
|
388
|
+
y: p * a
|
|
511
389
|
} : {
|
|
512
|
-
x:
|
|
513
|
-
y:
|
|
390
|
+
x: p * a,
|
|
391
|
+
y: f * d
|
|
514
392
|
};
|
|
515
393
|
}
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
options = 0;
|
|
519
|
-
}
|
|
520
|
-
return {
|
|
394
|
+
const It = function(t) {
|
|
395
|
+
return t === void 0 && (t = 0), {
|
|
521
396
|
name: "offset",
|
|
522
|
-
options,
|
|
523
|
-
async fn(
|
|
397
|
+
options: t,
|
|
398
|
+
async fn(e) {
|
|
524
399
|
const {
|
|
525
|
-
x,
|
|
526
|
-
y
|
|
527
|
-
} =
|
|
528
|
-
const diffCoords = await convertValueToCoords(state, options);
|
|
400
|
+
x: n,
|
|
401
|
+
y: o
|
|
402
|
+
} = e, i = await zt(e, t);
|
|
529
403
|
return {
|
|
530
|
-
x:
|
|
531
|
-
y:
|
|
532
|
-
data:
|
|
404
|
+
x: n + i.x,
|
|
405
|
+
y: o + i.y,
|
|
406
|
+
data: i
|
|
533
407
|
};
|
|
534
408
|
}
|
|
535
409
|
};
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
if (options === void 0) {
|
|
539
|
-
options = {};
|
|
540
|
-
}
|
|
541
|
-
return {
|
|
410
|
+
}, $t = function(t) {
|
|
411
|
+
return t === void 0 && (t = {}), {
|
|
542
412
|
name: "size",
|
|
543
|
-
options,
|
|
544
|
-
async fn(
|
|
545
|
-
const {
|
|
546
|
-
placement,
|
|
547
|
-
rects,
|
|
548
|
-
platform: platform2,
|
|
549
|
-
elements
|
|
550
|
-
} = state;
|
|
413
|
+
options: t,
|
|
414
|
+
async fn(e) {
|
|
551
415
|
const {
|
|
552
|
-
|
|
416
|
+
placement: n,
|
|
417
|
+
rects: o,
|
|
418
|
+
platform: i,
|
|
419
|
+
elements: s
|
|
420
|
+
} = e, {
|
|
421
|
+
apply: r = () => {
|
|
553
422
|
},
|
|
554
|
-
...
|
|
555
|
-
} =
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
if (side === "top" || side === "bottom") {
|
|
567
|
-
heightSide = side;
|
|
568
|
-
widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
423
|
+
...l
|
|
424
|
+
} = U(t, e), c = await wt(e, l), a = j(n), d = _(n), u = nt(n) === "y", {
|
|
425
|
+
width: p,
|
|
426
|
+
height: f
|
|
427
|
+
} = o.floating;
|
|
428
|
+
let h, m;
|
|
429
|
+
a === "top" || a === "bottom" ? (h = a, m = d === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, h = d === "end" ? "top" : "bottom");
|
|
430
|
+
const w = f - c[h], g = p - c[m], v = !e.middlewareData.shift;
|
|
431
|
+
let y = w, A = g;
|
|
432
|
+
if (u) {
|
|
433
|
+
const b = p - c.left - c.right;
|
|
434
|
+
A = d || v ? N(g, b) : b;
|
|
569
435
|
} else {
|
|
570
|
-
|
|
571
|
-
|
|
436
|
+
const b = f - c.top - c.bottom;
|
|
437
|
+
y = d || v ? N(w, b) : b;
|
|
572
438
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
let availableHeight = overflowAvailableHeight;
|
|
577
|
-
let availableWidth = overflowAvailableWidth;
|
|
578
|
-
if (isYAxis) {
|
|
579
|
-
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
580
|
-
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
581
|
-
} else {
|
|
582
|
-
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
583
|
-
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
439
|
+
if (v && !d) {
|
|
440
|
+
const b = R(c.left, 0), E = R(c.right, 0), P = R(c.top, 0), H = R(c.bottom, 0);
|
|
441
|
+
u ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : R(c.left, c.right)) : y = f - 2 * (P !== 0 || H !== 0 ? P + H : R(c.top, c.bottom));
|
|
584
442
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
const yMax = max(overflow.bottom, 0);
|
|
590
|
-
if (isYAxis) {
|
|
591
|
-
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
592
|
-
} else {
|
|
593
|
-
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
await apply({
|
|
597
|
-
...state,
|
|
598
|
-
availableWidth,
|
|
599
|
-
availableHeight
|
|
443
|
+
await r({
|
|
444
|
+
...e,
|
|
445
|
+
availableWidth: A,
|
|
446
|
+
availableHeight: y
|
|
600
447
|
});
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
return {};
|
|
448
|
+
const x = await i.getDimensions(s.floating);
|
|
449
|
+
return p !== x.width || f !== x.height ? {
|
|
450
|
+
reset: {
|
|
451
|
+
rects: !0
|
|
452
|
+
}
|
|
453
|
+
} : {};
|
|
610
454
|
}
|
|
611
455
|
};
|
|
612
456
|
};
|
|
613
|
-
function
|
|
614
|
-
|
|
615
|
-
return (node.nodeName || "").toLowerCase();
|
|
616
|
-
}
|
|
617
|
-
return "#document";
|
|
457
|
+
function V(t) {
|
|
458
|
+
return xt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
618
459
|
}
|
|
619
|
-
function
|
|
620
|
-
var
|
|
621
|
-
return (
|
|
460
|
+
function O(t) {
|
|
461
|
+
var e;
|
|
462
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
622
463
|
}
|
|
623
|
-
function
|
|
624
|
-
var
|
|
625
|
-
return (
|
|
464
|
+
function F(t) {
|
|
465
|
+
var e;
|
|
466
|
+
return (e = (xt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
626
467
|
}
|
|
627
|
-
function
|
|
628
|
-
return
|
|
468
|
+
function xt(t) {
|
|
469
|
+
return t instanceof Node || t instanceof O(t).Node;
|
|
629
470
|
}
|
|
630
|
-
function
|
|
631
|
-
return
|
|
471
|
+
function M(t) {
|
|
472
|
+
return t instanceof Element || t instanceof O(t).Element;
|
|
632
473
|
}
|
|
633
|
-
function
|
|
634
|
-
return
|
|
474
|
+
function k(t) {
|
|
475
|
+
return t instanceof HTMLElement || t instanceof O(t).HTMLElement;
|
|
635
476
|
}
|
|
636
|
-
function
|
|
637
|
-
|
|
638
|
-
return false;
|
|
639
|
-
}
|
|
640
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
477
|
+
function dt(t) {
|
|
478
|
+
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof O(t).ShadowRoot;
|
|
641
479
|
}
|
|
642
|
-
function
|
|
480
|
+
function J(t) {
|
|
643
481
|
const {
|
|
644
|
-
overflow,
|
|
645
|
-
overflowX,
|
|
646
|
-
overflowY,
|
|
647
|
-
display
|
|
648
|
-
} =
|
|
649
|
-
return /auto|scroll|overlay|hidden|clip/.test(
|
|
650
|
-
}
|
|
651
|
-
function
|
|
652
|
-
return ["table", "td", "th"].includes(
|
|
653
|
-
}
|
|
654
|
-
function
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
} else {
|
|
665
|
-
currentNode = getParentNode(currentNode);
|
|
666
|
-
}
|
|
482
|
+
overflow: e,
|
|
483
|
+
overflowX: n,
|
|
484
|
+
overflowY: o,
|
|
485
|
+
display: i
|
|
486
|
+
} = T(t);
|
|
487
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
|
|
488
|
+
}
|
|
489
|
+
function _t(t) {
|
|
490
|
+
return ["table", "td", "th"].includes(V(t));
|
|
491
|
+
}
|
|
492
|
+
function lt(t) {
|
|
493
|
+
const e = at(), n = T(t);
|
|
494
|
+
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));
|
|
495
|
+
}
|
|
496
|
+
function Yt(t) {
|
|
497
|
+
let e = $(t);
|
|
498
|
+
for (; k(e) && !ot(e); ) {
|
|
499
|
+
if (lt(e))
|
|
500
|
+
return e;
|
|
501
|
+
e = $(e);
|
|
667
502
|
}
|
|
668
503
|
return null;
|
|
669
504
|
}
|
|
670
|
-
function
|
|
671
|
-
|
|
672
|
-
return false;
|
|
673
|
-
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
505
|
+
function at() {
|
|
506
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
674
507
|
}
|
|
675
|
-
function
|
|
676
|
-
return ["html", "body", "#document"].includes(
|
|
508
|
+
function ot(t) {
|
|
509
|
+
return ["html", "body", "#document"].includes(V(t));
|
|
677
510
|
}
|
|
678
|
-
function
|
|
679
|
-
return
|
|
511
|
+
function T(t) {
|
|
512
|
+
return O(t).getComputedStyle(t);
|
|
680
513
|
}
|
|
681
|
-
function
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
return {
|
|
689
|
-
scrollLeft: element.pageXOffset,
|
|
690
|
-
scrollTop: element.pageYOffset
|
|
514
|
+
function it(t) {
|
|
515
|
+
return M(t) ? {
|
|
516
|
+
scrollLeft: t.scrollLeft,
|
|
517
|
+
scrollTop: t.scrollTop
|
|
518
|
+
} : {
|
|
519
|
+
scrollLeft: t.pageXOffset,
|
|
520
|
+
scrollTop: t.pageYOffset
|
|
691
521
|
};
|
|
692
522
|
}
|
|
693
|
-
function
|
|
694
|
-
if (
|
|
695
|
-
return
|
|
696
|
-
|
|
697
|
-
const result = (
|
|
523
|
+
function $(t) {
|
|
524
|
+
if (V(t) === "html")
|
|
525
|
+
return t;
|
|
526
|
+
const e = (
|
|
698
527
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
528
|
+
t.assignedSlot || // DOM Element detected.
|
|
529
|
+
t.parentNode || // ShadowRoot detected.
|
|
530
|
+
dt(t) && t.host || // Fallback.
|
|
531
|
+
F(t)
|
|
703
532
|
);
|
|
704
|
-
return
|
|
705
|
-
}
|
|
706
|
-
function
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
return
|
|
715
|
-
}
|
|
716
|
-
function
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
725
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
726
|
-
const win = getWindow(scrollableAncestor);
|
|
727
|
-
if (isBody) {
|
|
728
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
729
|
-
}
|
|
730
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
731
|
-
}
|
|
732
|
-
function getCssDimensions(element) {
|
|
733
|
-
const css = getComputedStyle(element);
|
|
734
|
-
let width = parseFloat(css.width) || 0;
|
|
735
|
-
let height = parseFloat(css.height) || 0;
|
|
736
|
-
const hasOffset = isHTMLElement(element);
|
|
737
|
-
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
738
|
-
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
739
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
740
|
-
if (shouldFallback) {
|
|
741
|
-
width = offsetWidth;
|
|
742
|
-
height = offsetHeight;
|
|
743
|
-
}
|
|
744
|
-
return {
|
|
745
|
-
width,
|
|
746
|
-
height,
|
|
747
|
-
$: shouldFallback
|
|
533
|
+
return dt(e) ? e.host : e;
|
|
534
|
+
}
|
|
535
|
+
function vt(t) {
|
|
536
|
+
const e = $(t);
|
|
537
|
+
return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && J(e) ? e : vt(e);
|
|
538
|
+
}
|
|
539
|
+
function K(t, e, n) {
|
|
540
|
+
var o;
|
|
541
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
542
|
+
const i = vt(t), s = i === ((o = t.ownerDocument) == null ? void 0 : o.body), r = O(i);
|
|
543
|
+
return s ? e.concat(r, r.visualViewport || [], J(i) ? i : [], r.frameElement && n ? K(r.frameElement) : []) : e.concat(i, K(i, [], n));
|
|
544
|
+
}
|
|
545
|
+
function yt(t) {
|
|
546
|
+
const e = T(t);
|
|
547
|
+
let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
548
|
+
const i = k(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o, l = Z(n) !== s || Z(o) !== r;
|
|
549
|
+
return l && (n = s, o = r), {
|
|
550
|
+
width: n,
|
|
551
|
+
height: o,
|
|
552
|
+
$: l
|
|
748
553
|
};
|
|
749
554
|
}
|
|
750
|
-
function
|
|
751
|
-
return
|
|
752
|
-
}
|
|
753
|
-
function
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
756
|
-
return
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
if (!x || !Number.isFinite(x)) {
|
|
767
|
-
x = 1;
|
|
768
|
-
}
|
|
769
|
-
if (!y || !Number.isFinite(y)) {
|
|
770
|
-
y = 1;
|
|
771
|
-
}
|
|
772
|
-
return {
|
|
773
|
-
x,
|
|
774
|
-
y
|
|
555
|
+
function ft(t) {
|
|
556
|
+
return M(t) ? t : t.contextElement;
|
|
557
|
+
}
|
|
558
|
+
function I(t) {
|
|
559
|
+
const e = ft(t);
|
|
560
|
+
if (!k(e))
|
|
561
|
+
return B(1);
|
|
562
|
+
const n = e.getBoundingClientRect(), {
|
|
563
|
+
width: o,
|
|
564
|
+
height: i,
|
|
565
|
+
$: s
|
|
566
|
+
} = yt(e);
|
|
567
|
+
let r = (s ? Z(n.width) : n.width) / o, l = (s ? Z(n.height) : n.height) / i;
|
|
568
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
569
|
+
x: r,
|
|
570
|
+
y: l
|
|
775
571
|
};
|
|
776
572
|
}
|
|
777
|
-
const
|
|
778
|
-
function
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
return {
|
|
784
|
-
x: win.visualViewport.offsetLeft,
|
|
785
|
-
y: win.visualViewport.offsetTop
|
|
573
|
+
const Xt = /* @__PURE__ */ B(0);
|
|
574
|
+
function bt(t) {
|
|
575
|
+
const e = O(t);
|
|
576
|
+
return !at() || !e.visualViewport ? Xt : {
|
|
577
|
+
x: e.visualViewport.offsetLeft,
|
|
578
|
+
y: e.visualViewport.offsetTop
|
|
786
579
|
};
|
|
787
580
|
}
|
|
788
|
-
function
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}
|
|
812
|
-
} else {
|
|
813
|
-
scale = getScale(element);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
817
|
-
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
818
|
-
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
819
|
-
let width = clientRect.width / scale.x;
|
|
820
|
-
let height = clientRect.height / scale.y;
|
|
821
|
-
if (domElement) {
|
|
822
|
-
const win = getWindow(domElement);
|
|
823
|
-
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
824
|
-
let currentIFrame = win.frameElement;
|
|
825
|
-
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
826
|
-
const iframeScale = getScale(currentIFrame);
|
|
827
|
-
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
828
|
-
const css = getComputedStyle(currentIFrame);
|
|
829
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
830
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
831
|
-
x *= iframeScale.x;
|
|
832
|
-
y *= iframeScale.y;
|
|
833
|
-
width *= iframeScale.x;
|
|
834
|
-
height *= iframeScale.y;
|
|
835
|
-
x += left;
|
|
836
|
-
y += top;
|
|
837
|
-
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
return rectToClientRect({
|
|
841
|
-
width,
|
|
842
|
-
height,
|
|
843
|
-
x,
|
|
844
|
-
y
|
|
581
|
+
function qt(t, e, n) {
|
|
582
|
+
return e === void 0 && (e = !1), !n || e && n !== O(t) ? !1 : e;
|
|
583
|
+
}
|
|
584
|
+
function z(t, e, n, o) {
|
|
585
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
586
|
+
const i = t.getBoundingClientRect(), s = ft(t);
|
|
587
|
+
let r = B(1);
|
|
588
|
+
e && (o ? M(o) && (r = I(o)) : r = I(t));
|
|
589
|
+
const l = qt(s, n, o) ? bt(s) : B(0);
|
|
590
|
+
let c = (i.left + l.x) / r.x, a = (i.top + l.y) / r.y, d = i.width / r.x, u = i.height / r.y;
|
|
591
|
+
if (s) {
|
|
592
|
+
const p = O(s), f = o && M(o) ? O(o) : o;
|
|
593
|
+
let h = p.frameElement;
|
|
594
|
+
for (; h && o && f !== p; ) {
|
|
595
|
+
const m = I(h), w = h.getBoundingClientRect(), g = T(h), v = w.left + (h.clientLeft + parseFloat(g.paddingLeft)) * m.x, y = w.top + (h.clientTop + parseFloat(g.paddingTop)) * m.y;
|
|
596
|
+
c *= m.x, a *= m.y, d *= m.x, u *= m.y, c += v, a += y, h = O(h).frameElement;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return et({
|
|
600
|
+
width: d,
|
|
601
|
+
height: u,
|
|
602
|
+
x: c,
|
|
603
|
+
y: a
|
|
845
604
|
});
|
|
846
605
|
}
|
|
847
|
-
function
|
|
606
|
+
function Kt(t) {
|
|
848
607
|
let {
|
|
849
|
-
rect,
|
|
850
|
-
offsetParent,
|
|
851
|
-
strategy
|
|
852
|
-
} =
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}
|
|
858
|
-
let scroll = {
|
|
608
|
+
rect: e,
|
|
609
|
+
offsetParent: n,
|
|
610
|
+
strategy: o
|
|
611
|
+
} = t;
|
|
612
|
+
const i = k(n), s = F(n);
|
|
613
|
+
if (n === s)
|
|
614
|
+
return e;
|
|
615
|
+
let r = {
|
|
859
616
|
scrollLeft: 0,
|
|
860
617
|
scrollTop: 0
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
scroll = getNodeScroll(offsetParent);
|
|
867
|
-
}
|
|
868
|
-
if (isHTMLElement(offsetParent)) {
|
|
869
|
-
const offsetRect = getBoundingClientRect(offsetParent);
|
|
870
|
-
scale = getScale(offsetParent);
|
|
871
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
872
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
873
|
-
}
|
|
618
|
+
}, l = B(1);
|
|
619
|
+
const c = B(0);
|
|
620
|
+
if ((i || !i && o !== "fixed") && ((V(n) !== "body" || J(s)) && (r = it(n)), k(n))) {
|
|
621
|
+
const a = z(n);
|
|
622
|
+
l = I(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
|
|
874
623
|
}
|
|
875
624
|
return {
|
|
876
|
-
width:
|
|
877
|
-
height:
|
|
878
|
-
x:
|
|
879
|
-
y:
|
|
625
|
+
width: e.width * l.x,
|
|
626
|
+
height: e.height * l.y,
|
|
627
|
+
x: e.x * l.x - r.scrollLeft * l.x + c.x,
|
|
628
|
+
y: e.y * l.y - r.scrollTop * l.y + c.y
|
|
880
629
|
};
|
|
881
630
|
}
|
|
882
|
-
function
|
|
883
|
-
return Array.from(
|
|
884
|
-
}
|
|
885
|
-
function
|
|
886
|
-
return
|
|
887
|
-
}
|
|
888
|
-
function
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
x += max(html.clientWidth, body.clientWidth) - width;
|
|
898
|
-
}
|
|
899
|
-
return {
|
|
900
|
-
width,
|
|
901
|
-
height,
|
|
902
|
-
x,
|
|
903
|
-
y
|
|
631
|
+
function Ut(t) {
|
|
632
|
+
return Array.from(t.getClientRects());
|
|
633
|
+
}
|
|
634
|
+
function At(t) {
|
|
635
|
+
return z(F(t)).left + it(t).scrollLeft;
|
|
636
|
+
}
|
|
637
|
+
function Jt(t) {
|
|
638
|
+
const e = F(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);
|
|
639
|
+
let r = -n.scrollLeft + At(t);
|
|
640
|
+
const l = -n.scrollTop;
|
|
641
|
+
return T(o).direction === "rtl" && (r += R(e.clientWidth, o.clientWidth) - i), {
|
|
642
|
+
width: i,
|
|
643
|
+
height: s,
|
|
644
|
+
x: r,
|
|
645
|
+
y: l
|
|
904
646
|
};
|
|
905
647
|
}
|
|
906
|
-
function
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
let y = 0;
|
|
914
|
-
if (visualViewport) {
|
|
915
|
-
width = visualViewport.width;
|
|
916
|
-
height = visualViewport.height;
|
|
917
|
-
const visualViewportBased = isWebKit();
|
|
918
|
-
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
919
|
-
x = visualViewport.offsetLeft;
|
|
920
|
-
y = visualViewport.offsetTop;
|
|
921
|
-
}
|
|
648
|
+
function Gt(t, e) {
|
|
649
|
+
const n = O(t), o = F(t), i = n.visualViewport;
|
|
650
|
+
let s = o.clientWidth, r = o.clientHeight, l = 0, c = 0;
|
|
651
|
+
if (i) {
|
|
652
|
+
s = i.width, r = i.height;
|
|
653
|
+
const a = at();
|
|
654
|
+
(!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
|
|
922
655
|
}
|
|
923
656
|
return {
|
|
924
|
-
width,
|
|
925
|
-
height,
|
|
926
|
-
x,
|
|
927
|
-
y
|
|
657
|
+
width: s,
|
|
658
|
+
height: r,
|
|
659
|
+
x: l,
|
|
660
|
+
y: c
|
|
928
661
|
};
|
|
929
662
|
}
|
|
930
|
-
function
|
|
931
|
-
const
|
|
932
|
-
const top = clientRect.top + element.clientTop;
|
|
933
|
-
const left = clientRect.left + element.clientLeft;
|
|
934
|
-
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
935
|
-
const width = element.clientWidth * scale.x;
|
|
936
|
-
const height = element.clientHeight * scale.y;
|
|
937
|
-
const x = left * scale.x;
|
|
938
|
-
const y = top * scale.y;
|
|
663
|
+
function Qt(t, e) {
|
|
664
|
+
const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ? I(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = i * s.x, a = o * s.y;
|
|
939
665
|
return {
|
|
940
|
-
width,
|
|
941
|
-
height,
|
|
942
|
-
x,
|
|
943
|
-
y
|
|
666
|
+
width: r,
|
|
667
|
+
height: l,
|
|
668
|
+
x: c,
|
|
669
|
+
y: a
|
|
944
670
|
};
|
|
945
671
|
}
|
|
946
|
-
function
|
|
947
|
-
let
|
|
948
|
-
if (
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
...
|
|
958
|
-
x:
|
|
959
|
-
y:
|
|
672
|
+
function pt(t, e, n) {
|
|
673
|
+
let o;
|
|
674
|
+
if (e === "viewport")
|
|
675
|
+
o = Gt(t, n);
|
|
676
|
+
else if (e === "document")
|
|
677
|
+
o = Jt(F(t));
|
|
678
|
+
else if (M(e))
|
|
679
|
+
o = Qt(e, n);
|
|
680
|
+
else {
|
|
681
|
+
const i = bt(t);
|
|
682
|
+
o = {
|
|
683
|
+
...e,
|
|
684
|
+
x: e.x - i.x,
|
|
685
|
+
y: e.y - i.y
|
|
960
686
|
};
|
|
961
687
|
}
|
|
962
|
-
return
|
|
688
|
+
return et(o);
|
|
963
689
|
}
|
|
964
|
-
function
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
return false;
|
|
968
|
-
}
|
|
969
|
-
return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
690
|
+
function Et(t, e) {
|
|
691
|
+
const n = $(t);
|
|
692
|
+
return n === e || !M(n) || ot(n) ? !1 : T(n).position === "fixed" || Et(n, e);
|
|
970
693
|
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
if (
|
|
974
|
-
return
|
|
694
|
+
function Zt(t, e) {
|
|
695
|
+
const n = e.get(t);
|
|
696
|
+
if (n)
|
|
697
|
+
return n;
|
|
698
|
+
let o = K(t, [], !1).filter((l) => M(l) && V(l) !== "body"), i = null;
|
|
699
|
+
const s = T(t).position === "fixed";
|
|
700
|
+
let r = s ? $(t) : t;
|
|
701
|
+
for (; M(r) && !ot(r); ) {
|
|
702
|
+
const l = T(r), c = lt(r);
|
|
703
|
+
!c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || J(r) && !c && Et(t, r)) ? o = o.filter((d) => d !== r) : i = l, r = $(r);
|
|
975
704
|
}
|
|
976
|
-
|
|
977
|
-
let currentContainingBlockComputedStyle = null;
|
|
978
|
-
const elementIsFixed = getComputedStyle(element).position === "fixed";
|
|
979
|
-
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
980
|
-
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
981
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
982
|
-
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
983
|
-
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
984
|
-
currentContainingBlockComputedStyle = null;
|
|
985
|
-
}
|
|
986
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
987
|
-
if (shouldDropCurrentNode) {
|
|
988
|
-
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
989
|
-
} else {
|
|
990
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
991
|
-
}
|
|
992
|
-
currentNode = getParentNode(currentNode);
|
|
993
|
-
}
|
|
994
|
-
cache.set(element, result);
|
|
995
|
-
return result;
|
|
705
|
+
return e.set(t, o), o;
|
|
996
706
|
}
|
|
997
|
-
function
|
|
707
|
+
function te(t) {
|
|
998
708
|
let {
|
|
999
|
-
element,
|
|
1000
|
-
boundary,
|
|
1001
|
-
rootBoundary,
|
|
1002
|
-
strategy
|
|
1003
|
-
} =
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1009
|
-
accRect.top = max(rect.top, accRect.top);
|
|
1010
|
-
accRect.right = min(rect.right, accRect.right);
|
|
1011
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1012
|
-
accRect.left = max(rect.left, accRect.left);
|
|
1013
|
-
return accRect;
|
|
1014
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
709
|
+
element: e,
|
|
710
|
+
boundary: n,
|
|
711
|
+
rootBoundary: o,
|
|
712
|
+
strategy: i
|
|
713
|
+
} = t;
|
|
714
|
+
const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n), o], l = r[0], c = r.reduce((a, d) => {
|
|
715
|
+
const u = pt(e, d, i);
|
|
716
|
+
return a.top = R(u.top, a.top), a.right = N(u.right, a.right), a.bottom = N(u.bottom, a.bottom), a.left = R(u.left, a.left), a;
|
|
717
|
+
}, pt(e, l, i));
|
|
1015
718
|
return {
|
|
1016
|
-
width:
|
|
1017
|
-
height:
|
|
1018
|
-
x:
|
|
1019
|
-
y:
|
|
719
|
+
width: c.right - c.left,
|
|
720
|
+
height: c.bottom - c.top,
|
|
721
|
+
x: c.left,
|
|
722
|
+
y: c.top
|
|
1020
723
|
};
|
|
1021
724
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
725
|
+
function ee(t) {
|
|
726
|
+
return yt(t);
|
|
1024
727
|
}
|
|
1025
|
-
function
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
const isFixed = strategy === "fixed";
|
|
1029
|
-
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1030
|
-
let scroll = {
|
|
728
|
+
function ne(t, e, n) {
|
|
729
|
+
const o = k(e), i = F(e), s = n === "fixed", r = z(t, !0, s, e);
|
|
730
|
+
let l = {
|
|
1031
731
|
scrollLeft: 0,
|
|
1032
732
|
scrollTop: 0
|
|
1033
733
|
};
|
|
1034
|
-
const
|
|
1035
|
-
if (
|
|
1036
|
-
if (
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1042
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1043
|
-
} else if (documentElement) {
|
|
1044
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
734
|
+
const c = B(0);
|
|
735
|
+
if (o || !o && !s)
|
|
736
|
+
if ((V(e) !== "body" || J(i)) && (l = it(e)), o) {
|
|
737
|
+
const a = z(e, !0, s, e);
|
|
738
|
+
c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
|
|
739
|
+
} else
|
|
740
|
+
i && (c.x = At(i));
|
|
1047
741
|
return {
|
|
1048
|
-
x:
|
|
1049
|
-
y:
|
|
1050
|
-
width:
|
|
1051
|
-
height:
|
|
742
|
+
x: r.left + l.scrollLeft - c.x,
|
|
743
|
+
y: r.top + l.scrollTop - c.y,
|
|
744
|
+
width: r.width,
|
|
745
|
+
height: r.height
|
|
1052
746
|
};
|
|
1053
747
|
}
|
|
1054
|
-
function
|
|
1055
|
-
|
|
1056
|
-
return null;
|
|
1057
|
-
}
|
|
1058
|
-
if (polyfill) {
|
|
1059
|
-
return polyfill(element);
|
|
1060
|
-
}
|
|
1061
|
-
return element.offsetParent;
|
|
748
|
+
function mt(t, e) {
|
|
749
|
+
return !k(t) || T(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
|
1062
750
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const
|
|
1065
|
-
if (!
|
|
1066
|
-
return
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
}
|
|
1072
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
1073
|
-
return window2;
|
|
1074
|
-
}
|
|
1075
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
751
|
+
function Ct(t, e) {
|
|
752
|
+
const n = O(t);
|
|
753
|
+
if (!k(t))
|
|
754
|
+
return n;
|
|
755
|
+
let o = mt(t, e);
|
|
756
|
+
for (; o && _t(o) && T(o).position === "static"; )
|
|
757
|
+
o = mt(o, e);
|
|
758
|
+
return o && (V(o) === "html" || V(o) === "body" && T(o).position === "static" && !lt(o)) ? n : o || Yt(t) || n;
|
|
1076
759
|
}
|
|
1077
|
-
const
|
|
760
|
+
const oe = async function(t) {
|
|
1078
761
|
let {
|
|
1079
|
-
reference,
|
|
1080
|
-
floating,
|
|
1081
|
-
strategy
|
|
1082
|
-
} =
|
|
1083
|
-
const
|
|
1084
|
-
const getDimensionsFn = this.getDimensions;
|
|
762
|
+
reference: e,
|
|
763
|
+
floating: n,
|
|
764
|
+
strategy: o
|
|
765
|
+
} = t;
|
|
766
|
+
const i = this.getOffsetParent || Ct, s = this.getDimensions;
|
|
1085
767
|
return {
|
|
1086
|
-
reference:
|
|
768
|
+
reference: ne(e, await i(n), o),
|
|
1087
769
|
floating: {
|
|
1088
770
|
x: 0,
|
|
1089
771
|
y: 0,
|
|
1090
|
-
...await
|
|
772
|
+
...await s(n)
|
|
1091
773
|
}
|
|
1092
774
|
};
|
|
1093
775
|
};
|
|
1094
|
-
function
|
|
1095
|
-
return
|
|
1096
|
-
}
|
|
1097
|
-
const
|
|
1098
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1099
|
-
getDocumentElement,
|
|
1100
|
-
getClippingRect,
|
|
1101
|
-
getOffsetParent,
|
|
1102
|
-
getElementRects,
|
|
1103
|
-
getClientRects,
|
|
1104
|
-
getDimensions,
|
|
1105
|
-
getScale,
|
|
1106
|
-
isElement,
|
|
1107
|
-
isRTL
|
|
776
|
+
function ie(t) {
|
|
777
|
+
return T(t).direction === "rtl";
|
|
778
|
+
}
|
|
779
|
+
const se = {
|
|
780
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Kt,
|
|
781
|
+
getDocumentElement: F,
|
|
782
|
+
getClippingRect: te,
|
|
783
|
+
getOffsetParent: Ct,
|
|
784
|
+
getElementRects: oe,
|
|
785
|
+
getClientRects: Ut,
|
|
786
|
+
getDimensions: ee,
|
|
787
|
+
getScale: I,
|
|
788
|
+
isElement: M,
|
|
789
|
+
isRTL: ie
|
|
1108
790
|
};
|
|
1109
|
-
function
|
|
1110
|
-
let
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
}
|
|
1118
|
-
function refresh(skip, threshold) {
|
|
1119
|
-
if (skip === void 0) {
|
|
1120
|
-
skip = false;
|
|
1121
|
-
}
|
|
1122
|
-
if (threshold === void 0) {
|
|
1123
|
-
threshold = 1;
|
|
1124
|
-
}
|
|
1125
|
-
cleanup();
|
|
791
|
+
function re(t, e) {
|
|
792
|
+
let n = null, o;
|
|
793
|
+
const i = F(t);
|
|
794
|
+
function s() {
|
|
795
|
+
clearTimeout(o), n && n.disconnect(), n = null;
|
|
796
|
+
}
|
|
797
|
+
function r(l, c) {
|
|
798
|
+
l === void 0 && (l = !1), c === void 0 && (c = 1), s();
|
|
1126
799
|
const {
|
|
1127
|
-
left,
|
|
1128
|
-
top,
|
|
1129
|
-
width,
|
|
1130
|
-
height
|
|
1131
|
-
} =
|
|
1132
|
-
if (!
|
|
1133
|
-
onMove();
|
|
1134
|
-
}
|
|
1135
|
-
if (!width || !height) {
|
|
800
|
+
left: a,
|
|
801
|
+
top: d,
|
|
802
|
+
width: u,
|
|
803
|
+
height: p
|
|
804
|
+
} = t.getBoundingClientRect();
|
|
805
|
+
if (l || e(), !u || !p)
|
|
1136
806
|
return;
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1141
|
-
const insetLeft = floor(left);
|
|
1142
|
-
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1143
|
-
const options = {
|
|
1144
|
-
rootMargin,
|
|
1145
|
-
threshold: max(0, min(1, threshold)) || 1
|
|
807
|
+
const f = Q(d), h = Q(i.clientWidth - (a + u)), m = Q(i.clientHeight - (d + p)), w = Q(a), v = {
|
|
808
|
+
rootMargin: -f + "px " + -h + "px " + -m + "px " + -w + "px",
|
|
809
|
+
threshold: R(0, N(1, c)) || 1
|
|
1146
810
|
};
|
|
1147
|
-
let
|
|
1148
|
-
function
|
|
1149
|
-
const
|
|
1150
|
-
if (
|
|
1151
|
-
if (!
|
|
1152
|
-
return
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
refresh(false, 1e-7);
|
|
1157
|
-
}, 100);
|
|
1158
|
-
} else {
|
|
1159
|
-
refresh(false, ratio);
|
|
1160
|
-
}
|
|
811
|
+
let y = !0;
|
|
812
|
+
function A(x) {
|
|
813
|
+
const b = x[0].intersectionRatio;
|
|
814
|
+
if (b !== c) {
|
|
815
|
+
if (!y)
|
|
816
|
+
return r();
|
|
817
|
+
b ? r(!1, b) : o = setTimeout(() => {
|
|
818
|
+
r(!1, 1e-7);
|
|
819
|
+
}, 100);
|
|
1161
820
|
}
|
|
1162
|
-
|
|
821
|
+
y = !1;
|
|
1163
822
|
}
|
|
1164
823
|
try {
|
|
1165
|
-
|
|
1166
|
-
...
|
|
824
|
+
n = new IntersectionObserver(A, {
|
|
825
|
+
...v,
|
|
1167
826
|
// Handle <iframe>s
|
|
1168
|
-
root:
|
|
827
|
+
root: i.ownerDocument
|
|
1169
828
|
});
|
|
1170
|
-
} catch
|
|
1171
|
-
|
|
829
|
+
} catch {
|
|
830
|
+
n = new IntersectionObserver(A, v);
|
|
1172
831
|
}
|
|
1173
|
-
|
|
832
|
+
n.observe(t);
|
|
1174
833
|
}
|
|
1175
|
-
|
|
1176
|
-
return cleanup;
|
|
834
|
+
return r(!0), s;
|
|
1177
835
|
}
|
|
1178
|
-
function
|
|
1179
|
-
|
|
1180
|
-
options = {};
|
|
1181
|
-
}
|
|
836
|
+
function ce(t, e, n, o) {
|
|
837
|
+
o === void 0 && (o = {});
|
|
1182
838
|
const {
|
|
1183
|
-
ancestorScroll =
|
|
1184
|
-
ancestorResize =
|
|
1185
|
-
elementResize = typeof ResizeObserver
|
|
1186
|
-
layoutShift = typeof IntersectionObserver
|
|
1187
|
-
animationFrame =
|
|
1188
|
-
} =
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
passive: true
|
|
1194
|
-
});
|
|
1195
|
-
ancestorResize && ancestor.addEventListener("resize", update);
|
|
839
|
+
ancestorScroll: i = !0,
|
|
840
|
+
ancestorResize: s = !0,
|
|
841
|
+
elementResize: r = typeof ResizeObserver == "function",
|
|
842
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
843
|
+
animationFrame: c = !1
|
|
844
|
+
} = o, a = ft(t), d = i || s ? [...a ? K(a) : [], ...K(e)] : [];
|
|
845
|
+
d.forEach((g) => {
|
|
846
|
+
i && g.addEventListener("scroll", n, {
|
|
847
|
+
passive: !0
|
|
848
|
+
}), s && g.addEventListener("resize", n);
|
|
1196
849
|
});
|
|
1197
|
-
const
|
|
1198
|
-
let
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}
|
|
1215
|
-
resizeObserver.observe(floating);
|
|
1216
|
-
}
|
|
1217
|
-
let frameId;
|
|
1218
|
-
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1219
|
-
if (animationFrame) {
|
|
1220
|
-
frameLoop();
|
|
1221
|
-
}
|
|
1222
|
-
function frameLoop() {
|
|
1223
|
-
const nextRefRect = getBoundingClientRect(reference);
|
|
1224
|
-
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1225
|
-
update();
|
|
1226
|
-
}
|
|
1227
|
-
prevRefRect = nextRefRect;
|
|
1228
|
-
frameId = requestAnimationFrame(frameLoop);
|
|
1229
|
-
}
|
|
1230
|
-
update();
|
|
1231
|
-
return () => {
|
|
1232
|
-
ancestors.forEach((ancestor) => {
|
|
1233
|
-
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
1234
|
-
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
1235
|
-
});
|
|
1236
|
-
cleanupIo && cleanupIo();
|
|
1237
|
-
resizeObserver && resizeObserver.disconnect();
|
|
1238
|
-
resizeObserver = null;
|
|
1239
|
-
if (animationFrame) {
|
|
1240
|
-
cancelAnimationFrame(frameId);
|
|
1241
|
-
}
|
|
850
|
+
const u = a && l ? re(a, n) : null;
|
|
851
|
+
let p = -1, f = null;
|
|
852
|
+
r && (f = new ResizeObserver((g) => {
|
|
853
|
+
let [v] = g;
|
|
854
|
+
v && v.target === a && f && (f.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
855
|
+
f && f.observe(e);
|
|
856
|
+
})), n();
|
|
857
|
+
}), a && !c && f.observe(a), f.observe(e));
|
|
858
|
+
let h, m = c ? z(t) : null;
|
|
859
|
+
c && w();
|
|
860
|
+
function w() {
|
|
861
|
+
const g = z(t);
|
|
862
|
+
m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g, h = requestAnimationFrame(w);
|
|
863
|
+
}
|
|
864
|
+
return n(), () => {
|
|
865
|
+
d.forEach((g) => {
|
|
866
|
+
i && g.removeEventListener("scroll", n), s && g.removeEventListener("resize", n);
|
|
867
|
+
}), u && u(), f && f.disconnect(), f = null, c && cancelAnimationFrame(h);
|
|
1242
868
|
};
|
|
1243
869
|
}
|
|
1244
|
-
const
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
...mergedOptions.platform,
|
|
1252
|
-
_c: cache
|
|
870
|
+
const le = (t, e, n) => {
|
|
871
|
+
const o = /* @__PURE__ */ new Map(), i = {
|
|
872
|
+
platform: se,
|
|
873
|
+
...n
|
|
874
|
+
}, s = {
|
|
875
|
+
...i.platform,
|
|
876
|
+
_c: o
|
|
1253
877
|
};
|
|
1254
|
-
return
|
|
1255
|
-
...
|
|
1256
|
-
platform:
|
|
878
|
+
return Bt(t, e, {
|
|
879
|
+
...i,
|
|
880
|
+
platform: s
|
|
1257
881
|
});
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
|
|
882
|
+
}, ae = `/*!
|
|
883
|
+
* direction.scss
|
|
884
|
+
*/:host{--wj-popup-top: auto;--wj-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wj-popup-left);top:var(--wj-popup-top)}.native-popup:not(.popup-active){display:none}
|
|
885
|
+
`;
|
|
886
|
+
class fe extends Tt {
|
|
1261
887
|
constructor() {
|
|
1262
888
|
super();
|
|
1263
|
-
|
|
1264
|
-
this._manual =
|
|
889
|
+
ut(this, "className", "Popup");
|
|
890
|
+
this._manual = !1;
|
|
1265
891
|
}
|
|
1266
|
-
set manual(
|
|
1267
|
-
this._manual =
|
|
892
|
+
set manual(n) {
|
|
893
|
+
this._manual = n;
|
|
1268
894
|
}
|
|
1269
895
|
get manual() {
|
|
1270
|
-
|
|
1271
|
-
this._manual = true;
|
|
1272
|
-
return this._manual;
|
|
896
|
+
return this.hasAttribute("manual") && (this._manual = !0), this._manual;
|
|
1273
897
|
}
|
|
1274
898
|
static get cssStyleSheet() {
|
|
1275
|
-
return
|
|
899
|
+
return ae;
|
|
1276
900
|
}
|
|
1277
901
|
static get observedAttributes() {
|
|
1278
902
|
return ["active"];
|
|
@@ -1280,145 +904,95 @@ class Popup extends WJElement {
|
|
|
1280
904
|
setupAttributes() {
|
|
1281
905
|
this.isShadowRoot = "open";
|
|
1282
906
|
}
|
|
1283
|
-
attributeChangedCallback(
|
|
1284
|
-
|
|
1285
|
-
if (this.hasAttribute(name)) {
|
|
1286
|
-
this.show();
|
|
1287
|
-
} else {
|
|
1288
|
-
this.hide();
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
907
|
+
attributeChangedCallback(n, o, i) {
|
|
908
|
+
n === "active" && (this.hasAttribute(n) ? this.show() : this.hide());
|
|
1291
909
|
}
|
|
1292
|
-
draw(
|
|
1293
|
-
let
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
let slot = document.createElement("slot");
|
|
1302
|
-
native.appendChild(slot);
|
|
1303
|
-
native.appendChild(slotArrow);
|
|
1304
|
-
fragment.appendChild(slotAnchor);
|
|
1305
|
-
fragment.appendChild(native);
|
|
1306
|
-
this.slotAnchor = slotAnchor;
|
|
1307
|
-
this.slotArrow = slotArrow;
|
|
1308
|
-
this.native = native;
|
|
1309
|
-
return fragment;
|
|
910
|
+
draw(n, o, i) {
|
|
911
|
+
let s = document.createDocumentFragment(), r = document.createElement("slot");
|
|
912
|
+
r.setAttribute("name", "anchor");
|
|
913
|
+
let l = document.createElement("slot");
|
|
914
|
+
l.setAttribute("name", "arrow");
|
|
915
|
+
let c = document.createElement("div");
|
|
916
|
+
c.setAttribute("part", "native"), c.classList.add("native-popup");
|
|
917
|
+
let a = document.createElement("slot");
|
|
918
|
+
return c.appendChild(a), c.appendChild(l), s.appendChild(r), s.appendChild(c), this.slotAnchor = r, this.slotArrow = l, this.native = c, s;
|
|
1310
919
|
}
|
|
1311
|
-
afterDraw(
|
|
920
|
+
afterDraw(n, o, i) {
|
|
1312
921
|
this.setAnchor();
|
|
1313
922
|
}
|
|
1314
923
|
setAnchor() {
|
|
1315
|
-
if (this.slotAnchor && typeof this.anchor
|
|
1316
|
-
const
|
|
1317
|
-
this.anchorEl =
|
|
1318
|
-
} else
|
|
1319
|
-
this.anchorEl = this.slotAnchor.assignedElements({ flatten:
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
return;
|
|
1325
|
-
this.showHide();
|
|
1326
|
-
}, { stopPropagation: true });
|
|
1327
|
-
document.addEventListener("click", (e) => {
|
|
1328
|
-
let clickToHost = e.composedPath().some((el) => el === this);
|
|
1329
|
-
if (!clickToHost) {
|
|
1330
|
-
if (this.hasAttribute("active"))
|
|
1331
|
-
this.removeAttribute("active");
|
|
1332
|
-
}
|
|
924
|
+
if (this.slotAnchor && typeof this.anchor == "string") {
|
|
925
|
+
const n = this.getRootNode();
|
|
926
|
+
this.anchorEl = n.getElementById(this.anchor);
|
|
927
|
+
} else
|
|
928
|
+
this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: !0 })[0]);
|
|
929
|
+
G.addListener(this.anchorEl, "click", null, (n) => {
|
|
930
|
+
console.log("som CLICK"), !this.hasAttribute("disabled") && this.showHide();
|
|
931
|
+
}, { stopPropagation: !0 }), document.addEventListener("click", (n) => {
|
|
932
|
+
n.composedPath().some((i) => i === this) || this.hasAttribute("active") && this.removeAttribute("active");
|
|
1333
933
|
});
|
|
1334
934
|
}
|
|
1335
935
|
showHide() {
|
|
1336
|
-
|
|
1337
|
-
this.removeAttribute("active");
|
|
1338
|
-
} else {
|
|
1339
|
-
this.setAttribute("active", "");
|
|
1340
|
-
event.addListener(this, "click", "wj:popup-show");
|
|
1341
|
-
}
|
|
936
|
+
this.hasAttribute("active") ? this.removeAttribute("active") : (this.setAttribute("active", ""), G.addListener(this, "click", "wj:popup-show"));
|
|
1342
937
|
}
|
|
1343
938
|
reposition() {
|
|
1344
|
-
const
|
|
1345
|
-
this.offsetCalc = +this.offset || 0
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
);
|
|
1363
|
-
if (this.hasAttribute("size")) {
|
|
1364
|
-
middleware.push(
|
|
1365
|
-
size({
|
|
1366
|
-
apply({ availableWidth, availableHeight, elements }) {
|
|
1367
|
-
Object.assign(elements.floating.style, {
|
|
1368
|
-
width: `${elements.reference.offsetWidth}px`
|
|
1369
|
-
});
|
|
1370
|
-
}
|
|
1371
|
-
})
|
|
1372
|
-
);
|
|
1373
|
-
}
|
|
1374
|
-
computePosition(this.anchorEl, this.native, {
|
|
939
|
+
const n = [];
|
|
940
|
+
this.offsetCalc = +this.offset || 0, this.slotArrow instanceof HTMLSlotElement && (this.arrow = this.slotArrow.assignedElements({ flatten: !0 })[0], this.arrow && (n.push(
|
|
941
|
+
Vt({
|
|
942
|
+
element: this.arrow
|
|
943
|
+
})
|
|
944
|
+
), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset)), n.push(
|
|
945
|
+
It(this.offsetCalc)
|
|
946
|
+
), n.push(
|
|
947
|
+
jt()
|
|
948
|
+
), this.hasAttribute("size") && n.push(
|
|
949
|
+
$t({
|
|
950
|
+
apply({ availableWidth: o, availableHeight: i, elements: s }) {
|
|
951
|
+
Object.assign(s.floating.style, {
|
|
952
|
+
width: `${s.reference.offsetWidth}px`
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
})
|
|
956
|
+
), le(this.anchorEl, this.native, {
|
|
1375
957
|
placement: this.placement || "bottom",
|
|
1376
958
|
strategy: "fixed",
|
|
1377
|
-
middleware
|
|
1378
|
-
}).then(({ x, y, middlewareData, placement, strategy }) => {
|
|
1379
|
-
this.native.style.setProperty("--wj-popup-left",
|
|
1380
|
-
|
|
1381
|
-
this.native.style.position = strategy;
|
|
1382
|
-
if (this.arrow) {
|
|
1383
|
-
const side = this.placement.split("-")[0];
|
|
1384
|
-
const staticSide = {
|
|
959
|
+
middleware: n
|
|
960
|
+
}).then(({ x: o, y: i, middlewareData: s, placement: r, strategy: l }) => {
|
|
961
|
+
if (this.native.style.setProperty("--wj-popup-left", o + "px"), this.native.style.setProperty("--wj-popup-top", i + "px"), this.native.style.position = l, this.arrow) {
|
|
962
|
+
const c = this.placement.split("-")[0], a = {
|
|
1385
963
|
top: "bottom",
|
|
1386
964
|
right: "left",
|
|
1387
965
|
bottom: "top",
|
|
1388
966
|
left: "right"
|
|
1389
|
-
}[
|
|
1390
|
-
if (
|
|
1391
|
-
const { x:
|
|
967
|
+
}[c];
|
|
968
|
+
if (s.arrow) {
|
|
969
|
+
const { x: d, y: u } = s.arrow;
|
|
1392
970
|
Object.assign(this.arrow.style, {
|
|
1393
|
-
left:
|
|
1394
|
-
top:
|
|
1395
|
-
[
|
|
971
|
+
left: d != null ? `${d}px` : "",
|
|
972
|
+
top: u != null ? `${u}px` : "",
|
|
973
|
+
[a]: `${-this.arrow.offsetWidth / 2}px`
|
|
1396
974
|
});
|
|
1397
975
|
}
|
|
1398
976
|
}
|
|
1399
|
-
})
|
|
1400
|
-
event.dispatchCustomEvent(this, "wj-popup:reposition", {
|
|
977
|
+
}), G.dispatchCustomEvent(this, "wj-popup:reposition", {
|
|
1401
978
|
data: { top: "bottom", right: "left", bottom: "top", left: "right" },
|
|
1402
979
|
context: this,
|
|
1403
980
|
event: this
|
|
1404
981
|
});
|
|
1405
982
|
}
|
|
1406
983
|
show() {
|
|
1407
|
-
this.native.classList.add("popup-active")
|
|
1408
|
-
this.cleanup = autoUpdate(this.anchorEl, this.native, () => {
|
|
984
|
+
this.native.classList.add("popup-active"), this.cleanup = ce(this.anchorEl, this.native, () => {
|
|
1409
985
|
this.reposition();
|
|
1410
986
|
});
|
|
1411
987
|
}
|
|
1412
988
|
hide() {
|
|
1413
|
-
this.native.classList.remove("popup-active");
|
|
1414
|
-
this.cleanup();
|
|
1415
|
-
this.cleanup = void 0;
|
|
989
|
+
this.native.classList.remove("popup-active"), this.cleanup(), this.cleanup = void 0;
|
|
1416
990
|
}
|
|
1417
991
|
disconnectedCallback() {
|
|
1418
|
-
|
|
992
|
+
G.removeElement(this.anchorEl);
|
|
1419
993
|
}
|
|
1420
994
|
}
|
|
1421
|
-
customElements.get("wj-popup") || window.customElements.define("wj-popup",
|
|
995
|
+
customElements.get("wj-popup") || window.customElements.define("wj-popup", fe);
|
|
1422
996
|
export {
|
|
1423
|
-
Popup
|
|
997
|
+
fe as Popup
|
|
1424
998
|
};
|