@pnx-mixtape/mxds 0.0.28 → 0.0.30
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/build/accordion.css +1 -1
- package/dist/build/base.css +1 -1
- package/dist/build/breadcrumb.css +1 -1
- package/dist/build/button.css +1 -1
- package/dist/build/callout.css +1 -1
- package/dist/build/card.css +1 -1
- package/dist/build/carousel.css +1 -1
- package/dist/build/chunks/{DropMenu-LnJEp-sg.js → DropMenu-BckyZaZM.js} +1 -1
- package/dist/build/chunks/{Popover-C4gisyxr.js → Popover-hTv4lVea.js} +2 -2
- package/dist/build/chunks/polyfills-QW1VbwlO.js +562 -0
- package/dist/build/chunks/popover-Dk48Vm_U.js +407 -0
- package/dist/build/constants.css +1 -1
- package/dist/build/container-grid.css +1 -1
- package/dist/build/content-block.css +1 -1
- package/dist/build/dialog.css +1 -1
- package/dist/build/drop-menu.css +1 -1
- package/dist/build/drop-menu.entry.js +2 -2
- package/dist/build/drupal.css +1 -1
- package/dist/build/filters.css +1 -1
- package/dist/build/footer.css +1 -1
- package/dist/build/form.css +1 -1
- package/dist/build/global-alert.css +1 -1
- package/dist/build/grid.css +1 -1
- package/dist/build/header.css +1 -1
- package/dist/build/header.entry.js +524 -379
- package/dist/build/hero-banner.css +1 -1
- package/dist/build/icon.css +1 -1
- package/dist/build/in-page-alert.css +1 -1
- package/dist/build/in-page-navigation.css +1 -1
- package/dist/build/in-page-navigation.entry.js +23 -11
- package/dist/build/link-list.css +1 -1
- package/dist/build/list-item.css +1 -1
- package/dist/build/masthead.css +1 -1
- package/dist/build/navigation.css +1 -1
- package/dist/build/page.css +1 -1
- package/dist/build/pagination.css +1 -1
- package/dist/build/popover.css +1 -1
- package/dist/build/popover.entry.js +1 -1
- package/dist/build/results-bar.css +1 -1
- package/dist/build/section.css +1 -1
- package/dist/build/side-navigation.css +1 -1
- package/dist/build/sidebar.css +1 -1
- package/dist/build/social-links.css +1 -1
- package/dist/build/steps.css +1 -1
- package/dist/build/sticky.css +1 -1
- package/dist/build/tabs.css +1 -1
- package/dist/build/tabs.entry.js +2 -2
- package/dist/build/tag.css +1 -1
- package/dist/build/utilities.css +1 -1
- package/dist/build/utility-list.css +1 -1
- package/package.json +22 -21
- package/src/Atom/Background/_background.css +1 -0
- package/src/Atom/Image/_image.css +1 -0
- package/src/Atom/Media/_media.css +0 -6
- package/src/Atom/Spacing/_mixins.css +22 -0
- package/src/Atom/Spacing/_spacing.css +33 -0
- package/src/Atom/Table/Table.stories.ts +17 -7
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +16 -8
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
- package/src/Atom/Table/_table.css +26 -1
- package/src/Atom/Table/table-responsive.twig +1 -1
- package/src/Atom/Table/table.twig +9 -1
- package/src/Atom/_flow.css +1 -5
- package/src/Component/Card/Card.stories.ts +19 -0
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +40 -9
- package/src/Component/Card/card.css +60 -12
- package/src/Component/Card/card.twig +5 -2
- package/src/Component/Carousel/Elements/Carousel.ts +8 -3
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +52 -52
- package/src/Component/Carousel/carousel.css +14 -35
- package/src/Component/Carousel/carousel.twig +0 -1
- package/src/Component/GlobalAlert/global-alert.css +8 -4
- package/src/Component/InPageAlert/in-page-alert.css +1 -0
- package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +12 -7
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +28 -12
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +30 -49
- package/src/Component/InPageNavigation/in-page-navigation.css +8 -4
- package/src/Component/InPageNavigation/in-page-navigation.twig +9 -6
- package/src/Component/InPageNavigation/twig/content-example.twig +1 -1
- package/src/Component/InPageNavigation/twig/in-page-navigation-selector.twig +4 -0
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +9 -9
- package/src/Component/ListItem/list-item.css +14 -1
- package/src/Component/ListItem/list-item.twig +6 -2
- package/src/Component/Pagination/Pagination.stories.ts +1 -1
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +2 -2
- package/src/Component/ResultsBar/results-bar.css +4 -0
- package/src/Form/FormItem/FormItem.stories.ts +14 -0
- package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +19 -0
- package/src/Form/form.css +11 -3
- package/src/Layout/Grid/Grid.stories.ts +7 -7
- package/src/Layout/Grid/GridItem.stories.ts +1 -2
- package/src/Layout/Section/section.css +8 -0
- package/src/_custom-media.css +2 -0
- package/src/constants.css +16 -4
- package/src/enums.ts +1 -1
- package/src/tokens.js +1 -0
- package/dist/build/chunks/polyfills-Du4RTZDf.js +0 -511
- package/dist/build/chunks/popover-Bd5oQ1Ic.js +0 -407
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
var min = Math.min, max = Math.max, round = Math.round, createCoords = (e) => ({
|
|
2
|
+
x: e,
|
|
3
|
+
y: e
|
|
4
|
+
});
|
|
5
|
+
function evaluate(e, t) {
|
|
6
|
+
return typeof e == "function" ? e(t) : e;
|
|
7
|
+
}
|
|
8
|
+
function getSide(e) {
|
|
9
|
+
return e.split("-")[0];
|
|
10
|
+
}
|
|
11
|
+
function getAlignment(e) {
|
|
12
|
+
return e.split("-")[1];
|
|
13
|
+
}
|
|
14
|
+
function getOppositeAxis(e) {
|
|
15
|
+
return e === "x" ? "y" : "x";
|
|
16
|
+
}
|
|
17
|
+
function getAxisLength(e) {
|
|
18
|
+
return e === "y" ? "height" : "width";
|
|
19
|
+
}
|
|
20
|
+
var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
21
|
+
function getSideAxis(e) {
|
|
22
|
+
return yAxisSides.has(getSide(e)) ? "y" : "x";
|
|
23
|
+
}
|
|
24
|
+
function getAlignmentAxis(e) {
|
|
25
|
+
return getOppositeAxis(getSideAxis(e));
|
|
26
|
+
}
|
|
27
|
+
function expandPaddingObject(e) {
|
|
28
|
+
return {
|
|
29
|
+
top: 0,
|
|
30
|
+
right: 0,
|
|
31
|
+
bottom: 0,
|
|
32
|
+
left: 0,
|
|
33
|
+
...e
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function getPaddingObject(e) {
|
|
37
|
+
return typeof e == "number" ? {
|
|
38
|
+
top: e,
|
|
39
|
+
right: e,
|
|
40
|
+
bottom: e,
|
|
41
|
+
left: e
|
|
42
|
+
} : expandPaddingObject(e);
|
|
43
|
+
}
|
|
44
|
+
function rectToClientRect(e) {
|
|
45
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
46
|
+
return {
|
|
47
|
+
width: r,
|
|
48
|
+
height: i,
|
|
49
|
+
top: n,
|
|
50
|
+
left: t,
|
|
51
|
+
right: t + r,
|
|
52
|
+
bottom: n + i,
|
|
53
|
+
x: t,
|
|
54
|
+
y: n
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function computeCoordsFromPlacement(e, t, n) {
|
|
58
|
+
let { reference: r, floating: i } = e, s = getSideAxis(t), l = getAlignmentAxis(t), f = getAxisLength(l), p = getSide(t), m = s === "y", h = r.x + r.width / 2 - i.width / 2, g = r.y + r.height / 2 - i.height / 2, _ = r[f] / 2 - i[f] / 2, v;
|
|
59
|
+
switch (p) {
|
|
60
|
+
case "top":
|
|
61
|
+
v = {
|
|
62
|
+
x: h,
|
|
63
|
+
y: r.y - i.height
|
|
64
|
+
};
|
|
65
|
+
break;
|
|
66
|
+
case "bottom":
|
|
67
|
+
v = {
|
|
68
|
+
x: h,
|
|
69
|
+
y: r.y + r.height
|
|
70
|
+
};
|
|
71
|
+
break;
|
|
72
|
+
case "right":
|
|
73
|
+
v = {
|
|
74
|
+
x: r.x + r.width,
|
|
75
|
+
y: g
|
|
76
|
+
};
|
|
77
|
+
break;
|
|
78
|
+
case "left":
|
|
79
|
+
v = {
|
|
80
|
+
x: r.x - i.width,
|
|
81
|
+
y: g
|
|
82
|
+
};
|
|
83
|
+
break;
|
|
84
|
+
default: v = {
|
|
85
|
+
x: r.x,
|
|
86
|
+
y: r.y
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
switch (getAlignment(t)) {
|
|
90
|
+
case "start":
|
|
91
|
+
v[l] -= _ * (n && m ? -1 : 1);
|
|
92
|
+
break;
|
|
93
|
+
case "end":
|
|
94
|
+
v[l] += _ * (n && m ? -1 : 1);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
return v;
|
|
98
|
+
}
|
|
99
|
+
async function detectOverflow(e, t) {
|
|
100
|
+
t === void 0 && (t = {});
|
|
101
|
+
let { x: n, y: r, platform: a, rects: o, elements: s, strategy: c } = e, { boundary: l = "clippingAncestors", rootBoundary: u = "viewport", elementContext: d = "floating", altBoundary: f = !1, padding: h = 0 } = evaluate(t, e), g = getPaddingObject(h), _ = s[f ? d === "floating" ? "reference" : "floating" : d], v = rectToClientRect(await a.getClippingRect({
|
|
102
|
+
element: await (a.isElement == null ? void 0 : a.isElement(_)) ?? !0 ? _ : _.contextElement || await (a.getDocumentElement == null ? void 0 : a.getDocumentElement(s.floating)),
|
|
103
|
+
boundary: l,
|
|
104
|
+
rootBoundary: u,
|
|
105
|
+
strategy: c
|
|
106
|
+
})), y = d === "floating" ? {
|
|
107
|
+
x: n,
|
|
108
|
+
y: r,
|
|
109
|
+
width: o.floating.width,
|
|
110
|
+
height: o.floating.height
|
|
111
|
+
} : o.reference, b = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(s.floating)), x = await (a.isElement == null ? void 0 : a.isElement(b)) && await (a.getScale == null ? void 0 : a.getScale(b)) || {
|
|
112
|
+
x: 1,
|
|
113
|
+
y: 1
|
|
114
|
+
}, S = rectToClientRect(a.convertOffsetParentRelativeRectToViewportRelativeRect ? await a.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
115
|
+
elements: s,
|
|
116
|
+
rect: y,
|
|
117
|
+
offsetParent: b,
|
|
118
|
+
strategy: c
|
|
119
|
+
}) : y);
|
|
120
|
+
return {
|
|
121
|
+
top: (v.top - S.top + g.top) / x.y,
|
|
122
|
+
bottom: (S.bottom - v.bottom + g.bottom) / x.y,
|
|
123
|
+
left: (v.left - S.left + g.left) / x.x,
|
|
124
|
+
right: (S.right - v.right + g.right) / x.x
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
var computePosition$1 = async (e, t, n) => {
|
|
128
|
+
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = a.filter(Boolean), c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
129
|
+
reference: e,
|
|
130
|
+
floating: t,
|
|
131
|
+
strategy: i
|
|
132
|
+
}), { x: u, y: d } = computeCoordsFromPlacement(l, r, c), f = r, p = {}, m = 0;
|
|
133
|
+
for (let n = 0; n < s.length; n++) {
|
|
134
|
+
let { name: a, fn: _ } = s[n], { x: v, y, data: b, reset: x } = await _({
|
|
135
|
+
x: u,
|
|
136
|
+
y: d,
|
|
137
|
+
initialPlacement: r,
|
|
138
|
+
placement: f,
|
|
139
|
+
strategy: i,
|
|
140
|
+
middlewareData: p,
|
|
141
|
+
rects: l,
|
|
142
|
+
platform: {
|
|
143
|
+
...o,
|
|
144
|
+
detectOverflow: o.detectOverflow ?? detectOverflow
|
|
145
|
+
},
|
|
146
|
+
elements: {
|
|
147
|
+
reference: e,
|
|
148
|
+
floating: t
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
u = v ?? u, d = y ?? d, p = {
|
|
152
|
+
...p,
|
|
153
|
+
[a]: {
|
|
154
|
+
...p[a],
|
|
155
|
+
...b
|
|
156
|
+
}
|
|
157
|
+
}, x && m <= 50 && (m++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
158
|
+
reference: e,
|
|
159
|
+
floating: t,
|
|
160
|
+
strategy: i
|
|
161
|
+
}) : x.rects), {x: u, y: d} = computeCoordsFromPlacement(l, f, c)), n = -1);
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
x: u,
|
|
165
|
+
y: d,
|
|
166
|
+
placement: f,
|
|
167
|
+
strategy: i,
|
|
168
|
+
middlewareData: p
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
function hasWindow() {
|
|
172
|
+
return typeof window < "u";
|
|
173
|
+
}
|
|
174
|
+
function getNodeName(e) {
|
|
175
|
+
return isNode(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
176
|
+
}
|
|
177
|
+
function getWindow(e) {
|
|
178
|
+
var t;
|
|
179
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
180
|
+
}
|
|
181
|
+
function getDocumentElement(e) {
|
|
182
|
+
return ((isNode(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
183
|
+
}
|
|
184
|
+
function isNode(e) {
|
|
185
|
+
return hasWindow() ? e instanceof Node || e instanceof getWindow(e).Node : !1;
|
|
186
|
+
}
|
|
187
|
+
function isElement(e) {
|
|
188
|
+
return hasWindow() ? e instanceof Element || e instanceof getWindow(e).Element : !1;
|
|
189
|
+
}
|
|
190
|
+
function isHTMLElement(e) {
|
|
191
|
+
return hasWindow() ? e instanceof HTMLElement || e instanceof getWindow(e).HTMLElement : !1;
|
|
192
|
+
}
|
|
193
|
+
function isShadowRoot(e) {
|
|
194
|
+
return !hasWindow() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof getWindow(e).ShadowRoot;
|
|
195
|
+
}
|
|
196
|
+
var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
197
|
+
function isOverflowElement(e) {
|
|
198
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = getComputedStyle$1(e);
|
|
199
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !invalidOverflowDisplayValues.has(i);
|
|
200
|
+
}
|
|
201
|
+
var tableElements = /* @__PURE__ */ new Set([
|
|
202
|
+
"table",
|
|
203
|
+
"td",
|
|
204
|
+
"th"
|
|
205
|
+
]);
|
|
206
|
+
function isTableElement(e) {
|
|
207
|
+
return tableElements.has(getNodeName(e));
|
|
208
|
+
}
|
|
209
|
+
var topLayerSelectors = [":popover-open", ":modal"];
|
|
210
|
+
function isTopLayer(e) {
|
|
211
|
+
return topLayerSelectors.some((t) => {
|
|
212
|
+
try {
|
|
213
|
+
return e.matches(t);
|
|
214
|
+
} catch {
|
|
215
|
+
return !1;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
var transformProperties = [
|
|
220
|
+
"transform",
|
|
221
|
+
"translate",
|
|
222
|
+
"scale",
|
|
223
|
+
"rotate",
|
|
224
|
+
"perspective"
|
|
225
|
+
], willChangeValues = [
|
|
226
|
+
"transform",
|
|
227
|
+
"translate",
|
|
228
|
+
"scale",
|
|
229
|
+
"rotate",
|
|
230
|
+
"perspective",
|
|
231
|
+
"filter"
|
|
232
|
+
], containValues = [
|
|
233
|
+
"paint",
|
|
234
|
+
"layout",
|
|
235
|
+
"strict",
|
|
236
|
+
"content"
|
|
237
|
+
];
|
|
238
|
+
function isContainingBlock(e) {
|
|
239
|
+
let t = isWebKit(), n = isElement(e) ? getComputedStyle$1(e) : e;
|
|
240
|
+
return transformProperties.some((e) => n[e] ? n[e] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || willChangeValues.some((e) => (n.willChange || "").includes(e)) || containValues.some((e) => (n.contain || "").includes(e));
|
|
241
|
+
}
|
|
242
|
+
function getContainingBlock(e) {
|
|
243
|
+
let t = getParentNode(e);
|
|
244
|
+
for (; isHTMLElement(t) && !isLastTraversableNode(t);) {
|
|
245
|
+
if (isContainingBlock(t)) return t;
|
|
246
|
+
if (isTopLayer(t)) return null;
|
|
247
|
+
t = getParentNode(t);
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
function isWebKit() {
|
|
252
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
253
|
+
}
|
|
254
|
+
var lastTraversableNodeNames = /* @__PURE__ */ new Set([
|
|
255
|
+
"html",
|
|
256
|
+
"body",
|
|
257
|
+
"#document"
|
|
258
|
+
]);
|
|
259
|
+
function isLastTraversableNode(e) {
|
|
260
|
+
return lastTraversableNodeNames.has(getNodeName(e));
|
|
261
|
+
}
|
|
262
|
+
function getComputedStyle$1(e) {
|
|
263
|
+
return getWindow(e).getComputedStyle(e);
|
|
264
|
+
}
|
|
265
|
+
function getNodeScroll(e) {
|
|
266
|
+
return isElement(e) ? {
|
|
267
|
+
scrollLeft: e.scrollLeft,
|
|
268
|
+
scrollTop: e.scrollTop
|
|
269
|
+
} : {
|
|
270
|
+
scrollLeft: e.scrollX,
|
|
271
|
+
scrollTop: e.scrollY
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function getParentNode(e) {
|
|
275
|
+
if (getNodeName(e) === "html") return e;
|
|
276
|
+
let t = e.assignedSlot || e.parentNode || isShadowRoot(e) && e.host || getDocumentElement(e);
|
|
277
|
+
return isShadowRoot(t) ? t.host : t;
|
|
278
|
+
}
|
|
279
|
+
function getNearestOverflowAncestor(e) {
|
|
280
|
+
let t = getParentNode(e);
|
|
281
|
+
return isLastTraversableNode(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : isHTMLElement(t) && isOverflowElement(t) ? t : getNearestOverflowAncestor(t);
|
|
282
|
+
}
|
|
283
|
+
function getOverflowAncestors(e, t, n) {
|
|
284
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
285
|
+
let r = getNearestOverflowAncestor(e), i = r === e.ownerDocument?.body, a = getWindow(r);
|
|
286
|
+
if (i) {
|
|
287
|
+
let e = getFrameElement(a);
|
|
288
|
+
return t.concat(a, a.visualViewport || [], isOverflowElement(r) ? r : [], e && n ? getOverflowAncestors(e) : []);
|
|
289
|
+
}
|
|
290
|
+
return t.concat(r, getOverflowAncestors(r, [], n));
|
|
291
|
+
}
|
|
292
|
+
function getFrameElement(e) {
|
|
293
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
294
|
+
}
|
|
295
|
+
function getCssDimensions(e) {
|
|
296
|
+
let t = getComputedStyle$1(e), r = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0, a = isHTMLElement(e), o = a ? e.offsetWidth : r, s = a ? e.offsetHeight : i, c = round(r) !== o || round(i) !== s;
|
|
297
|
+
return c && (r = o, i = s), {
|
|
298
|
+
width: r,
|
|
299
|
+
height: i,
|
|
300
|
+
$: c
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function unwrapElement(e) {
|
|
304
|
+
return isElement(e) ? e : e.contextElement;
|
|
305
|
+
}
|
|
306
|
+
function getScale(e) {
|
|
307
|
+
let t = unwrapElement(e);
|
|
308
|
+
if (!isHTMLElement(t)) return createCoords(1);
|
|
309
|
+
let i = t.getBoundingClientRect(), { width: a, height: o, $: s } = getCssDimensions(t), c = (s ? round(i.width) : i.width) / a, l = (s ? round(i.height) : i.height) / o;
|
|
310
|
+
return (!c || !Number.isFinite(c)) && (c = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
311
|
+
x: c,
|
|
312
|
+
y: l
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
316
|
+
function getVisualOffsets(e) {
|
|
317
|
+
let t = getWindow(e);
|
|
318
|
+
return !isWebKit() || !t.visualViewport ? noOffsets : {
|
|
319
|
+
x: t.visualViewport.offsetLeft,
|
|
320
|
+
y: t.visualViewport.offsetTop
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
function shouldAddVisualOffsets(e, t, n) {
|
|
324
|
+
return t === void 0 && (t = !1), !n || t && n !== getWindow(e) ? !1 : t;
|
|
325
|
+
}
|
|
326
|
+
function getBoundingClientRect(e, t, n, i) {
|
|
327
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
328
|
+
let a = e.getBoundingClientRect(), o = unwrapElement(e), s = createCoords(1);
|
|
329
|
+
t && (i ? isElement(i) && (s = getScale(i)) : s = getScale(e));
|
|
330
|
+
let c = shouldAddVisualOffsets(o, n, i) ? getVisualOffsets(o) : createCoords(0), l = (a.left + c.x) / s.x, u = (a.top + c.y) / s.y, d = a.width / s.x, f = a.height / s.y;
|
|
331
|
+
if (o) {
|
|
332
|
+
let e = getWindow(o), t = i && isElement(i) ? getWindow(i) : i, n = e, r = getFrameElement(n);
|
|
333
|
+
for (; r && i && t !== n;) {
|
|
334
|
+
let e = getScale(r), t = r.getBoundingClientRect(), i = getComputedStyle$1(r), a = t.left + (r.clientLeft + parseFloat(i.paddingLeft)) * e.x, o = t.top + (r.clientTop + parseFloat(i.paddingTop)) * e.y;
|
|
335
|
+
l *= e.x, u *= e.y, d *= e.x, f *= e.y, l += a, u += o, n = getWindow(r), r = getFrameElement(n);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return rectToClientRect({
|
|
339
|
+
width: d,
|
|
340
|
+
height: f,
|
|
341
|
+
x: l,
|
|
342
|
+
y: u
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
function getWindowScrollBarX(e, t) {
|
|
346
|
+
let n = getNodeScroll(e).scrollLeft;
|
|
347
|
+
return t ? t.left + n : getBoundingClientRect(getDocumentElement(e)).left + n;
|
|
348
|
+
}
|
|
349
|
+
function getHTMLOffset(e, t) {
|
|
350
|
+
let n = e.getBoundingClientRect();
|
|
351
|
+
return {
|
|
352
|
+
x: n.left + t.scrollLeft - getWindowScrollBarX(e, n),
|
|
353
|
+
y: n.top + t.scrollTop
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(e) {
|
|
357
|
+
let { elements: t, rect: n, offsetParent: i, strategy: a } = e, o = a === "fixed", s = getDocumentElement(i), c = t ? isTopLayer(t.floating) : !1;
|
|
358
|
+
if (i === s || c && o) return n;
|
|
359
|
+
let l = {
|
|
360
|
+
scrollLeft: 0,
|
|
361
|
+
scrollTop: 0
|
|
362
|
+
}, u = createCoords(1), d = createCoords(0), f = isHTMLElement(i);
|
|
363
|
+
if ((f || !f && !o) && ((getNodeName(i) !== "body" || isOverflowElement(s)) && (l = getNodeScroll(i)), isHTMLElement(i))) {
|
|
364
|
+
let e = getBoundingClientRect(i);
|
|
365
|
+
u = getScale(i), d.x = e.x + i.clientLeft, d.y = e.y + i.clientTop;
|
|
366
|
+
}
|
|
367
|
+
let p = s && !f && !o ? getHTMLOffset(s, l) : createCoords(0);
|
|
368
|
+
return {
|
|
369
|
+
width: n.width * u.x,
|
|
370
|
+
height: n.height * u.y,
|
|
371
|
+
x: n.x * u.x - l.scrollLeft * u.x + d.x + p.x,
|
|
372
|
+
y: n.y * u.y - l.scrollTop * u.y + d.y + p.y
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function getClientRects(e) {
|
|
376
|
+
return Array.from(e.getClientRects());
|
|
377
|
+
}
|
|
378
|
+
function getDocumentRect(e) {
|
|
379
|
+
let n = getDocumentElement(e), r = getNodeScroll(e), i = e.ownerDocument.body, a = max(n.scrollWidth, n.clientWidth, i.scrollWidth, i.clientWidth), o = max(n.scrollHeight, n.clientHeight, i.scrollHeight, i.clientHeight), s = -r.scrollLeft + getWindowScrollBarX(e), c = -r.scrollTop;
|
|
380
|
+
return getComputedStyle$1(i).direction === "rtl" && (s += max(n.clientWidth, i.clientWidth) - a), {
|
|
381
|
+
width: a,
|
|
382
|
+
height: o,
|
|
383
|
+
x: s,
|
|
384
|
+
y: c
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
var SCROLLBAR_MAX = 25;
|
|
388
|
+
function getViewportRect(e, t) {
|
|
389
|
+
let n = getWindow(e), r = getDocumentElement(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
390
|
+
if (i) {
|
|
391
|
+
a = i.width, o = i.height;
|
|
392
|
+
let e = isWebKit();
|
|
393
|
+
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
394
|
+
}
|
|
395
|
+
let l = getWindowScrollBarX(r);
|
|
396
|
+
if (l <= 0) {
|
|
397
|
+
let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
|
|
398
|
+
o <= SCROLLBAR_MAX && (a -= o);
|
|
399
|
+
} else l <= SCROLLBAR_MAX && (a += l);
|
|
400
|
+
return {
|
|
401
|
+
width: a,
|
|
402
|
+
height: o,
|
|
403
|
+
x: s,
|
|
404
|
+
y: c
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
408
|
+
function getInnerBoundingClientRect(e, t) {
|
|
409
|
+
let n = getBoundingClientRect(e, !0, t === "fixed"), i = n.top + e.clientTop, a = n.left + e.clientLeft, o = isHTMLElement(e) ? getScale(e) : createCoords(1);
|
|
410
|
+
return {
|
|
411
|
+
width: e.clientWidth * o.x,
|
|
412
|
+
height: e.clientHeight * o.y,
|
|
413
|
+
x: a * o.x,
|
|
414
|
+
y: i * o.y
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
function getClientRectFromClippingAncestor(e, t, n) {
|
|
418
|
+
let r;
|
|
419
|
+
if (t === "viewport") r = getViewportRect(e, n);
|
|
420
|
+
else if (t === "document") r = getDocumentRect(getDocumentElement(e));
|
|
421
|
+
else if (isElement(t)) r = getInnerBoundingClientRect(t, n);
|
|
422
|
+
else {
|
|
423
|
+
let n = getVisualOffsets(e);
|
|
424
|
+
r = {
|
|
425
|
+
x: t.x - n.x,
|
|
426
|
+
y: t.y - n.y,
|
|
427
|
+
width: t.width,
|
|
428
|
+
height: t.height
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
return rectToClientRect(r);
|
|
432
|
+
}
|
|
433
|
+
function hasFixedPositionAncestor(e, t) {
|
|
434
|
+
let n = getParentNode(e);
|
|
435
|
+
return n === t || !isElement(n) || isLastTraversableNode(n) ? !1 : getComputedStyle$1(n).position === "fixed" || hasFixedPositionAncestor(n, t);
|
|
436
|
+
}
|
|
437
|
+
function getClippingElementAncestors(e, t) {
|
|
438
|
+
let n = t.get(e);
|
|
439
|
+
if (n) return n;
|
|
440
|
+
let r = getOverflowAncestors(e, [], !1).filter((e) => isElement(e) && getNodeName(e) !== "body"), i = null, a = getComputedStyle$1(e).position === "fixed", o = a ? getParentNode(e) : e;
|
|
441
|
+
for (; isElement(o) && !isLastTraversableNode(o);) {
|
|
442
|
+
let t = getComputedStyle$1(o), n = isContainingBlock(o);
|
|
443
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && absoluteOrFixed.has(i.position) || isOverflowElement(o) && !n && hasFixedPositionAncestor(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = getParentNode(o);
|
|
444
|
+
}
|
|
445
|
+
return t.set(e, r), r;
|
|
446
|
+
}
|
|
447
|
+
function getClippingRect(n) {
|
|
448
|
+
let { element: r, boundary: i, rootBoundary: a, strategy: o } = n, s = [...i === "clippingAncestors" ? isTopLayer(r) ? [] : getClippingElementAncestors(r, this._c) : [].concat(i), a], c = s[0], l = s.reduce((n, i) => {
|
|
449
|
+
let a = getClientRectFromClippingAncestor(r, i, o);
|
|
450
|
+
return n.top = max(a.top, n.top), n.right = min(a.right, n.right), n.bottom = min(a.bottom, n.bottom), n.left = max(a.left, n.left), n;
|
|
451
|
+
}, getClientRectFromClippingAncestor(r, c, o));
|
|
452
|
+
return {
|
|
453
|
+
width: l.right - l.left,
|
|
454
|
+
height: l.bottom - l.top,
|
|
455
|
+
x: l.left,
|
|
456
|
+
y: l.top
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function getDimensions(e) {
|
|
460
|
+
let { width: t, height: n } = getCssDimensions(e);
|
|
461
|
+
return {
|
|
462
|
+
width: t,
|
|
463
|
+
height: n
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
function getRectRelativeToOffsetParent(e, t, n) {
|
|
467
|
+
let i = isHTMLElement(t), a = getDocumentElement(t), o = n === "fixed", s = getBoundingClientRect(e, !0, o, t), c = {
|
|
468
|
+
scrollLeft: 0,
|
|
469
|
+
scrollTop: 0
|
|
470
|
+
}, l = createCoords(0);
|
|
471
|
+
function u() {
|
|
472
|
+
l.x = getWindowScrollBarX(a);
|
|
473
|
+
}
|
|
474
|
+
if (i || !i && !o) if ((getNodeName(t) !== "body" || isOverflowElement(a)) && (c = getNodeScroll(t)), i) {
|
|
475
|
+
let e = getBoundingClientRect(t, !0, o, t);
|
|
476
|
+
l.x = e.x + t.clientLeft, l.y = e.y + t.clientTop;
|
|
477
|
+
} else a && u();
|
|
478
|
+
o && !i && a && u();
|
|
479
|
+
let d = a && !i && !o ? getHTMLOffset(a, c) : createCoords(0);
|
|
480
|
+
return {
|
|
481
|
+
x: s.left + c.scrollLeft - l.x - d.x,
|
|
482
|
+
y: s.top + c.scrollTop - l.y - d.y,
|
|
483
|
+
width: s.width,
|
|
484
|
+
height: s.height
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
function isStaticPositioned(e) {
|
|
488
|
+
return getComputedStyle$1(e).position === "static";
|
|
489
|
+
}
|
|
490
|
+
function getTrueOffsetParent(e, t) {
|
|
491
|
+
if (!isHTMLElement(e) || getComputedStyle$1(e).position === "fixed") return null;
|
|
492
|
+
if (t) return t(e);
|
|
493
|
+
let n = e.offsetParent;
|
|
494
|
+
return getDocumentElement(e) === n && (n = n.ownerDocument.body), n;
|
|
495
|
+
}
|
|
496
|
+
function getOffsetParent(e, t) {
|
|
497
|
+
let n = getWindow(e);
|
|
498
|
+
if (isTopLayer(e)) return n;
|
|
499
|
+
if (!isHTMLElement(e)) {
|
|
500
|
+
let t = getParentNode(e);
|
|
501
|
+
for (; t && !isLastTraversableNode(t);) {
|
|
502
|
+
if (isElement(t) && !isStaticPositioned(t)) return t;
|
|
503
|
+
t = getParentNode(t);
|
|
504
|
+
}
|
|
505
|
+
return n;
|
|
506
|
+
}
|
|
507
|
+
let r = getTrueOffsetParent(e, t);
|
|
508
|
+
for (; r && isTableElement(r) && isStaticPositioned(r);) r = getTrueOffsetParent(r, t);
|
|
509
|
+
return r && isLastTraversableNode(r) && isStaticPositioned(r) && !isContainingBlock(r) ? n : r || getContainingBlock(e) || n;
|
|
510
|
+
}
|
|
511
|
+
var getElementRects = async function(e) {
|
|
512
|
+
let t = this.getOffsetParent || getOffsetParent, n = this.getDimensions, r = await n(e.floating);
|
|
513
|
+
return {
|
|
514
|
+
reference: getRectRelativeToOffsetParent(e.reference, await t(e.floating), e.strategy),
|
|
515
|
+
floating: {
|
|
516
|
+
x: 0,
|
|
517
|
+
y: 0,
|
|
518
|
+
width: r.width,
|
|
519
|
+
height: r.height
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
function isRTL(e) {
|
|
524
|
+
return getComputedStyle$1(e).direction === "rtl";
|
|
525
|
+
}
|
|
526
|
+
var platform = {
|
|
527
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
528
|
+
getDocumentElement,
|
|
529
|
+
getClippingRect,
|
|
530
|
+
getOffsetParent,
|
|
531
|
+
getElementRects,
|
|
532
|
+
getClientRects,
|
|
533
|
+
getDimensions,
|
|
534
|
+
getScale,
|
|
535
|
+
isElement,
|
|
536
|
+
isRTL
|
|
537
|
+
}, computePosition = (e, t, n) => {
|
|
538
|
+
let r = /* @__PURE__ */ new Map(), i = {
|
|
539
|
+
platform,
|
|
540
|
+
...n
|
|
541
|
+
}, a = {
|
|
542
|
+
...i.platform,
|
|
543
|
+
_c: r
|
|
544
|
+
};
|
|
545
|
+
return computePosition$1(e, t, {
|
|
546
|
+
...i,
|
|
547
|
+
platform: a
|
|
548
|
+
});
|
|
549
|
+
}, Polyfills = class {
|
|
550
|
+
constructor(e) {
|
|
551
|
+
this.popover = e, this.trigger = document.querySelector(`[popovertarget="${e.getAttribute("id")}"`), this.positionPopover = this.positionPopover.bind(this), this.popover.addEventListener("toggle", this.positionPopover);
|
|
552
|
+
}
|
|
553
|
+
positionPopover = ({ newState: e }) => {
|
|
554
|
+
e === "open" && computePosition(this.trigger, this.popover, { placement: this.placement || "bottom-start" }).then(({ x: e, y: t }) => {
|
|
555
|
+
this.popover.style.insetInlineStart = `${e}px`, this.popover.style.insetBlockStart = `${t}px`;
|
|
556
|
+
});
|
|
557
|
+
};
|
|
558
|
+
get placement() {
|
|
559
|
+
return this.popover.getAttribute("data-placement");
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
export { Polyfills as default };
|