@pnx-mixtape/mxds 0.0.2 → 0.0.3

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.
Files changed (183) hide show
  1. package/README.md +13 -13
  2. package/dist/build/accordion.css +1 -108
  3. package/dist/build/accordion.entry.js +1 -0
  4. package/dist/build/base.css +1 -1000
  5. package/dist/build/breadcrumb.css +1 -47
  6. package/dist/build/button.css +1 -126
  7. package/dist/build/callout.css +1 -11
  8. package/dist/build/card.css +1 -135
  9. package/dist/build/chunks/disclosure-widget-CfhDmuvA.js +1 -0
  10. package/dist/build/chunks/keyboard-Cs0cduxq.js +1 -0
  11. package/dist/build/chunks/polyfills-DUM8gN-6.js +1 -0
  12. package/dist/build/chunks/popover-BGbvrIUp.js +1 -0
  13. package/dist/build/chunks/utilities-Bzel_okZ.js +2 -0
  14. package/dist/build/constants.css +1 -120
  15. package/dist/build/container-grid.css +1 -207
  16. package/dist/build/content-block.css +1 -23
  17. package/dist/build/dialog.css +1 -98
  18. package/dist/build/dialog.entry.js +1 -0
  19. package/dist/build/drop-menu.css +1 -78
  20. package/dist/build/drop-menu.entry.js +1 -0
  21. package/dist/build/drupal.css +1 -74
  22. package/dist/build/footer-menu.css +1 -32
  23. package/dist/build/footer.css +1 -61
  24. package/dist/build/form.css +1 -589
  25. package/dist/build/grid.css +1 -200
  26. package/dist/build/header.css +1 -131
  27. package/dist/build/header.entry.js +1 -0
  28. package/dist/build/hero-banner.css +1 -62
  29. package/dist/build/icon.css +1 -399
  30. package/dist/build/in-page-alert.css +1 -94
  31. package/dist/build/in-page-alert.entry.js +1 -0
  32. package/dist/build/in-page-navigation.css +1 -17
  33. package/dist/build/in-page-navigation.entry.js +1 -0
  34. package/dist/build/index.css +1 -4980
  35. package/dist/build/link-list.css +1 -72
  36. package/dist/build/masthead.css +1 -39
  37. package/dist/build/nav-list.css +1 -29
  38. package/dist/build/navigation.css +1 -371
  39. package/dist/build/navigation.entry.js +1 -0
  40. package/dist/build/page.css +1 -184
  41. package/dist/build/pagination.css +1 -123
  42. package/dist/build/section.css +1 -160
  43. package/dist/build/sidebar.css +1 -105
  44. package/dist/build/sticky.css +1 -47
  45. package/dist/build/sticky.entry.js +1 -0
  46. package/dist/build/tabs.css +1 -106
  47. package/dist/build/tabs.entry.js +1 -0
  48. package/dist/build/tag.css +1 -67
  49. package/dist/build/tiles.css +1 -61
  50. package/dist/build/utilities.css +1 -175
  51. package/package.json +4 -3
  52. package/src/Atom/Background/_background.css +1 -22
  53. package/src/Atom/Blockquote/_blockquote.css +1 -1
  54. package/src/Atom/Button/README.md +3 -3
  55. package/src/Atom/Button/_buttons-styles.css +1 -1
  56. package/src/Atom/Button/_buttons.css +1 -1
  57. package/src/Atom/Heading/_headings.css +1 -1
  58. package/src/Atom/Icon/README.md +1 -1
  59. package/src/Atom/Icon/_extended-set.css +1 -1
  60. package/src/Atom/Icon/_icon.css +5 -5
  61. package/src/Atom/Image/_image.css +1 -1
  62. package/src/Atom/Link/_links.css +1 -1
  63. package/src/Atom/Media/_media.css +1 -1
  64. package/src/Atom/Media/media.twig +1 -5
  65. package/src/Atom/NavList/nav-list.css +1 -1
  66. package/src/Atom/README.md +1 -1
  67. package/src/Atom/Spacing/_spacing.css +1 -1
  68. package/src/Atom/Table/_table.css +1 -1
  69. package/src/Atom/Text/_text-align.css +1 -1
  70. package/src/Atom/Text/_text-sizes.css +1 -1
  71. package/src/Atom/Video/_video.css +1 -1
  72. package/src/Atom/Video/video.twig +10 -4
  73. package/src/Atom/_animated.css +1 -1
  74. package/src/Atom/_flow-legacy.css +1 -1
  75. package/src/Atom/_flow.css +1 -1
  76. package/src/Atom/_generic.css +1 -1
  77. package/src/Atom/_hr.css +1 -1
  78. package/src/Atom/base.css +2 -2
  79. package/src/Component/Accordion/README.md +7 -17
  80. package/src/Component/Accordion/accordion.css +2 -2
  81. package/src/Component/Accordion/accordion.entry.js +2 -0
  82. package/src/Component/Breadcrumb/breadcrumb.css +1 -1
  83. package/src/Component/Callout/callout.css +1 -1
  84. package/src/Component/Card/README.md +7 -13
  85. package/src/Component/Card/card.css +3 -3
  86. package/src/Component/ContentBlock/README.md +7 -13
  87. package/src/Component/ContentBlock/content-block.css +2 -2
  88. package/src/Component/Dialog/README.md +15 -49
  89. package/src/Component/Dialog/dialog.css +3 -3
  90. package/src/Component/Dialog/dialog.entry.js +1 -0
  91. package/src/Component/DropMenu/README.md +19 -4
  92. package/src/Component/DropMenu/drop-menu.css +1 -1
  93. package/src/Component/DropMenu/drop-menu.entry.js +1 -0
  94. package/src/Component/HeroBanner/hero-banner.css +1 -1
  95. package/src/Component/HeroBanner/hero-banner.twig +1 -0
  96. package/src/Component/InPageAlert/README.md +4 -4
  97. package/src/Component/InPageAlert/in-page-alert.css +2 -2
  98. package/src/Component/InPageAlert/in-page-alert.entry.js +1 -0
  99. package/src/Component/InPageNavigation/README.md +10 -15
  100. package/src/Component/InPageNavigation/in-page-navigation.css +2 -2
  101. package/src/Component/InPageNavigation/in-page-navigation.entry.js +1 -0
  102. package/src/Component/LinkList/README.md +3 -3
  103. package/src/Component/LinkList/link-list.css +1 -1
  104. package/src/Component/Navigation/README.md +16 -7
  105. package/src/Component/Navigation/_navigation-collapsible.css +1 -1
  106. package/src/Component/Navigation/_navigation-dropdown.css +1 -1
  107. package/src/Component/Navigation/_navigation-mega.css +1 -1
  108. package/src/Component/Navigation/_navigation.css +1 -1
  109. package/src/Component/Navigation/navigation.entry.js +1 -0
  110. package/src/Component/Pagination/README.md +3 -3
  111. package/src/Component/Pagination/pagination.css +1 -1
  112. package/src/Component/Sticky/README.md +12 -5
  113. package/src/Component/Sticky/sticky.css +2 -2
  114. package/src/Component/Sticky/sticky.entry.js +1 -0
  115. package/src/Component/Tabs/README.md +12 -4
  116. package/src/Component/Tabs/tabs.css +2 -2
  117. package/src/Component/Tabs/tabs.entry.js +1 -0
  118. package/src/Component/Tag/README.md +2 -2
  119. package/src/Component/Tag/tag.css +1 -1
  120. package/src/Component/Tile/tiles.css +1 -1
  121. package/src/Form/README.md +2 -2
  122. package/src/Form/form.css +12 -12
  123. package/src/Layout/Footer/FooterMenu/footer-menu.css +1 -1
  124. package/src/Layout/Footer/footer.css +1 -1
  125. package/src/Layout/Grid/container-grid.css +2 -2
  126. package/src/Layout/Grid/grid.css +2 -2
  127. package/src/Layout/Header/_header.css +1 -1
  128. package/src/Layout/Header/_toggles.css +1 -1
  129. package/src/Layout/Header/header.entry.js +1 -0
  130. package/src/Layout/Masthead/masthead.css +5 -5
  131. package/src/Layout/Masthead/masthead.twig +2 -2
  132. package/src/Layout/Page/README.md +2 -2
  133. package/src/Layout/Page/page.css +2 -2
  134. package/src/Layout/README.md +3 -2
  135. package/src/Layout/Section/section.css +4 -4
  136. package/src/Layout/Sidebar/sidebar.css +1 -1
  137. package/src/Utility/Drupal/README.md +1 -1
  138. package/src/Utility/README.md +1 -1
  139. package/src/Utility/_layout-utils.css +1 -1
  140. package/src/Utility/utilities.css +3 -3
  141. package/dist/build/Accordion.js +0 -61
  142. package/dist/build/Accordion.js.map +0 -1
  143. package/dist/build/AccordionDiv.js +0 -62
  144. package/dist/build/AccordionDiv.js.map +0 -1
  145. package/dist/build/AccordionGroup.js +0 -85
  146. package/dist/build/AccordionGroup.js.map +0 -1
  147. package/dist/build/AccordionMobile.js +0 -31
  148. package/dist/build/AccordionMobile.js.map +0 -1
  149. package/dist/build/Dialog.js +0 -116
  150. package/dist/build/Dialog.js.map +0 -1
  151. package/dist/build/DropMenu.js +0 -132
  152. package/dist/build/DropMenu.js.map +0 -1
  153. package/dist/build/GlobalToggle.js +0 -103
  154. package/dist/build/GlobalToggle.js.map +0 -1
  155. package/dist/build/InPageAlert.js +0 -61
  156. package/dist/build/InPageAlert.js.map +0 -1
  157. package/dist/build/InPageNavigation.js +0 -92
  158. package/dist/build/InPageNavigation.js.map +0 -1
  159. package/dist/build/Navigation.js +0 -126
  160. package/dist/build/Navigation.js.map +0 -1
  161. package/dist/build/Sticky.js +0 -63
  162. package/dist/build/Sticky.js.map +0 -1
  163. package/dist/build/Tabs.js +0 -164
  164. package/dist/build/Tabs.js.map +0 -1
  165. package/dist/build/breakpoint-loader.js +0 -52
  166. package/dist/build/breakpoint-loader.js.map +0 -1
  167. package/dist/build/chunks/js.cookie-CiMiGxWx.js +0 -101
  168. package/dist/build/chunks/js.cookie-CiMiGxWx.js.map +0 -1
  169. package/dist/build/chunks/polyfills-CJ5uTmUJ.js +0 -749
  170. package/dist/build/chunks/polyfills-CJ5uTmUJ.js.map +0 -1
  171. package/dist/build/chunks/popover-wbPSyFRj.js +0 -654
  172. package/dist/build/chunks/popover-wbPSyFRj.js.map +0 -1
  173. package/dist/build/chunks/utilities-BIk0P2KX.js +0 -61
  174. package/dist/build/chunks/utilities-BIk0P2KX.js.map +0 -1
  175. package/dist/build/cookie-compliance.js +0 -122
  176. package/dist/build/cookie-compliance.js.map +0 -1
  177. package/dist/build/disclosure-widget.js +0 -124
  178. package/dist/build/disclosure-widget.js.map +0 -1
  179. package/dist/build/io-loader.js +0 -44
  180. package/dist/build/io-loader.js.map +0 -1
  181. package/dist/build/keyboard.js +0 -101
  182. package/dist/build/keyboard.js.map +0 -1
  183. package/src/index.css +0 -27
@@ -1,749 +0,0 @@
1
- const min = Math.min;
2
- const max = Math.max;
3
- const round = Math.round;
4
- const createCoords = (v) => ({
5
- x: v,
6
- y: v
7
- });
8
- function getSide(placement) {
9
- return placement.split("-")[0];
10
- }
11
- function getAlignment(placement) {
12
- return placement.split("-")[1];
13
- }
14
- function getOppositeAxis(axis) {
15
- return axis === "x" ? "y" : "x";
16
- }
17
- function getAxisLength(axis) {
18
- return axis === "y" ? "height" : "width";
19
- }
20
- function getSideAxis(placement) {
21
- return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
22
- }
23
- function getAlignmentAxis(placement) {
24
- return getOppositeAxis(getSideAxis(placement));
25
- }
26
- function rectToClientRect(rect) {
27
- const {
28
- x,
29
- y,
30
- width,
31
- height
32
- } = rect;
33
- return {
34
- width,
35
- height,
36
- top: y,
37
- left: x,
38
- right: x + width,
39
- bottom: y + height,
40
- x,
41
- y
42
- };
43
- }
44
- function computeCoordsFromPlacement(_ref, placement, rtl) {
45
- let {
46
- reference,
47
- floating
48
- } = _ref;
49
- const sideAxis = getSideAxis(placement);
50
- const alignmentAxis = getAlignmentAxis(placement);
51
- const alignLength = getAxisLength(alignmentAxis);
52
- const side = getSide(placement);
53
- const isVertical = sideAxis === "y";
54
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
55
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
56
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
57
- let coords;
58
- switch (side) {
59
- case "top":
60
- coords = {
61
- x: commonX,
62
- y: reference.y - floating.height
63
- };
64
- break;
65
- case "bottom":
66
- coords = {
67
- x: commonX,
68
- y: reference.y + reference.height
69
- };
70
- break;
71
- case "right":
72
- coords = {
73
- x: reference.x + reference.width,
74
- y: commonY
75
- };
76
- break;
77
- case "left":
78
- coords = {
79
- x: reference.x - floating.width,
80
- y: commonY
81
- };
82
- break;
83
- default:
84
- coords = {
85
- x: reference.x,
86
- y: reference.y
87
- };
88
- }
89
- switch (getAlignment(placement)) {
90
- case "start":
91
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
92
- break;
93
- case "end":
94
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
95
- break;
96
- }
97
- return coords;
98
- }
99
- const computePosition$1 = async (reference, floating, config) => {
100
- const {
101
- placement = "bottom",
102
- strategy = "absolute",
103
- middleware = [],
104
- platform: platform2
105
- } = config;
106
- const validMiddleware = middleware.filter(Boolean);
107
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
108
- let rects = await platform2.getElementRects({
109
- reference,
110
- floating,
111
- strategy
112
- });
113
- let {
114
- x,
115
- y
116
- } = computeCoordsFromPlacement(rects, placement, rtl);
117
- let statefulPlacement = placement;
118
- let middlewareData = {};
119
- let resetCount = 0;
120
- for (let i = 0; i < validMiddleware.length; i++) {
121
- const {
122
- name,
123
- fn
124
- } = validMiddleware[i];
125
- const {
126
- x: nextX,
127
- y: nextY,
128
- data,
129
- reset
130
- } = await fn({
131
- x,
132
- y,
133
- initialPlacement: placement,
134
- placement: statefulPlacement,
135
- strategy,
136
- middlewareData,
137
- rects,
138
- platform: platform2,
139
- elements: {
140
- reference,
141
- floating
142
- }
143
- });
144
- x = nextX != null ? nextX : x;
145
- y = nextY != null ? nextY : y;
146
- middlewareData = {
147
- ...middlewareData,
148
- [name]: {
149
- ...middlewareData[name],
150
- ...data
151
- }
152
- };
153
- if (reset && resetCount <= 50) {
154
- resetCount++;
155
- if (typeof reset === "object") {
156
- if (reset.placement) {
157
- statefulPlacement = reset.placement;
158
- }
159
- if (reset.rects) {
160
- rects = reset.rects === true ? await platform2.getElementRects({
161
- reference,
162
- floating,
163
- strategy
164
- }) : reset.rects;
165
- }
166
- ({
167
- x,
168
- y
169
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
170
- }
171
- i = -1;
172
- }
173
- }
174
- return {
175
- x,
176
- y,
177
- placement: statefulPlacement,
178
- strategy,
179
- middlewareData
180
- };
181
- };
182
- function getNodeName(node) {
183
- if (isNode(node)) {
184
- return (node.nodeName || "").toLowerCase();
185
- }
186
- return "#document";
187
- }
188
- function getWindow(node) {
189
- var _node$ownerDocument;
190
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
191
- }
192
- function getDocumentElement(node) {
193
- var _ref;
194
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
195
- }
196
- function isNode(value) {
197
- return value instanceof Node || value instanceof getWindow(value).Node;
198
- }
199
- function isElement(value) {
200
- return value instanceof Element || value instanceof getWindow(value).Element;
201
- }
202
- function isHTMLElement(value) {
203
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
204
- }
205
- function isShadowRoot(value) {
206
- if (typeof ShadowRoot === "undefined") {
207
- return false;
208
- }
209
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
210
- }
211
- function isOverflowElement(element) {
212
- const {
213
- overflow,
214
- overflowX,
215
- overflowY,
216
- display
217
- } = getComputedStyle(element);
218
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
219
- }
220
- function isTableElement(element) {
221
- return ["table", "td", "th"].includes(getNodeName(element));
222
- }
223
- function isTopLayer(element) {
224
- return [":popover-open", ":modal"].some((selector) => {
225
- try {
226
- return element.matches(selector);
227
- } catch (e) {
228
- return false;
229
- }
230
- });
231
- }
232
- function isContainingBlock(elementOrCss) {
233
- const webkit = isWebKit();
234
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
235
- return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
236
- }
237
- function getContainingBlock(element) {
238
- let currentNode = getParentNode(element);
239
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
240
- if (isContainingBlock(currentNode)) {
241
- return currentNode;
242
- } else if (isTopLayer(currentNode)) {
243
- return null;
244
- }
245
- currentNode = getParentNode(currentNode);
246
- }
247
- return null;
248
- }
249
- function isWebKit() {
250
- if (typeof CSS === "undefined" || !CSS.supports) return false;
251
- return CSS.supports("-webkit-backdrop-filter", "none");
252
- }
253
- function isLastTraversableNode(node) {
254
- return ["html", "body", "#document"].includes(getNodeName(node));
255
- }
256
- function getComputedStyle(element) {
257
- return getWindow(element).getComputedStyle(element);
258
- }
259
- function getNodeScroll(element) {
260
- if (isElement(element)) {
261
- return {
262
- scrollLeft: element.scrollLeft,
263
- scrollTop: element.scrollTop
264
- };
265
- }
266
- return {
267
- scrollLeft: element.scrollX,
268
- scrollTop: element.scrollY
269
- };
270
- }
271
- function getParentNode(node) {
272
- if (getNodeName(node) === "html") {
273
- return node;
274
- }
275
- const result = (
276
- // Step into the shadow DOM of the parent of a slotted node.
277
- node.assignedSlot || // DOM Element detected.
278
- node.parentNode || // ShadowRoot detected.
279
- isShadowRoot(node) && node.host || // Fallback.
280
- getDocumentElement(node)
281
- );
282
- return isShadowRoot(result) ? result.host : result;
283
- }
284
- function getNearestOverflowAncestor(node) {
285
- const parentNode = getParentNode(node);
286
- if (isLastTraversableNode(parentNode)) {
287
- return node.ownerDocument ? node.ownerDocument.body : node.body;
288
- }
289
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
290
- return parentNode;
291
- }
292
- return getNearestOverflowAncestor(parentNode);
293
- }
294
- function getOverflowAncestors(node, list, traverseIframes) {
295
- var _node$ownerDocument2;
296
- if (list === void 0) {
297
- list = [];
298
- }
299
- if (traverseIframes === void 0) {
300
- traverseIframes = true;
301
- }
302
- const scrollableAncestor = getNearestOverflowAncestor(node);
303
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
304
- const win = getWindow(scrollableAncestor);
305
- if (isBody) {
306
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
307
- }
308
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
309
- }
310
- function getCssDimensions(element) {
311
- const css = getComputedStyle(element);
312
- let width = parseFloat(css.width) || 0;
313
- let height = parseFloat(css.height) || 0;
314
- const hasOffset = isHTMLElement(element);
315
- const offsetWidth = hasOffset ? element.offsetWidth : width;
316
- const offsetHeight = hasOffset ? element.offsetHeight : height;
317
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
318
- if (shouldFallback) {
319
- width = offsetWidth;
320
- height = offsetHeight;
321
- }
322
- return {
323
- width,
324
- height,
325
- $: shouldFallback
326
- };
327
- }
328
- function unwrapElement(element) {
329
- return !isElement(element) ? element.contextElement : element;
330
- }
331
- function getScale(element) {
332
- const domElement = unwrapElement(element);
333
- if (!isHTMLElement(domElement)) {
334
- return createCoords(1);
335
- }
336
- const rect = domElement.getBoundingClientRect();
337
- const {
338
- width,
339
- height,
340
- $
341
- } = getCssDimensions(domElement);
342
- let x = ($ ? round(rect.width) : rect.width) / width;
343
- let y = ($ ? round(rect.height) : rect.height) / height;
344
- if (!x || !Number.isFinite(x)) {
345
- x = 1;
346
- }
347
- if (!y || !Number.isFinite(y)) {
348
- y = 1;
349
- }
350
- return {
351
- x,
352
- y
353
- };
354
- }
355
- const noOffsets = /* @__PURE__ */ createCoords(0);
356
- function getVisualOffsets(element) {
357
- const win = getWindow(element);
358
- if (!isWebKit() || !win.visualViewport) {
359
- return noOffsets;
360
- }
361
- return {
362
- x: win.visualViewport.offsetLeft,
363
- y: win.visualViewport.offsetTop
364
- };
365
- }
366
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
367
- if (isFixed === void 0) {
368
- isFixed = false;
369
- }
370
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
371
- return false;
372
- }
373
- return isFixed;
374
- }
375
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
376
- if (includeScale === void 0) {
377
- includeScale = false;
378
- }
379
- if (isFixedStrategy === void 0) {
380
- isFixedStrategy = false;
381
- }
382
- const clientRect = element.getBoundingClientRect();
383
- const domElement = unwrapElement(element);
384
- let scale = createCoords(1);
385
- if (includeScale) {
386
- if (offsetParent) {
387
- if (isElement(offsetParent)) {
388
- scale = getScale(offsetParent);
389
- }
390
- } else {
391
- scale = getScale(element);
392
- }
393
- }
394
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
395
- let x = (clientRect.left + visualOffsets.x) / scale.x;
396
- let y = (clientRect.top + visualOffsets.y) / scale.y;
397
- let width = clientRect.width / scale.x;
398
- let height = clientRect.height / scale.y;
399
- if (domElement) {
400
- const win = getWindow(domElement);
401
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
402
- let currentWin = win;
403
- let currentIFrame = currentWin.frameElement;
404
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
405
- const iframeScale = getScale(currentIFrame);
406
- const iframeRect = currentIFrame.getBoundingClientRect();
407
- const css = getComputedStyle(currentIFrame);
408
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
409
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
410
- x *= iframeScale.x;
411
- y *= iframeScale.y;
412
- width *= iframeScale.x;
413
- height *= iframeScale.y;
414
- x += left;
415
- y += top;
416
- currentWin = getWindow(currentIFrame);
417
- currentIFrame = currentWin.frameElement;
418
- }
419
- }
420
- return rectToClientRect({
421
- width,
422
- height,
423
- x,
424
- y
425
- });
426
- }
427
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
428
- let {
429
- elements,
430
- rect,
431
- offsetParent,
432
- strategy
433
- } = _ref;
434
- const isFixed = strategy === "fixed";
435
- const documentElement = getDocumentElement(offsetParent);
436
- const topLayer = elements ? isTopLayer(elements.floating) : false;
437
- if (offsetParent === documentElement || topLayer && isFixed) {
438
- return rect;
439
- }
440
- let scroll = {
441
- scrollLeft: 0,
442
- scrollTop: 0
443
- };
444
- let scale = createCoords(1);
445
- const offsets = createCoords(0);
446
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
447
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
448
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
449
- scroll = getNodeScroll(offsetParent);
450
- }
451
- if (isHTMLElement(offsetParent)) {
452
- const offsetRect = getBoundingClientRect(offsetParent);
453
- scale = getScale(offsetParent);
454
- offsets.x = offsetRect.x + offsetParent.clientLeft;
455
- offsets.y = offsetRect.y + offsetParent.clientTop;
456
- }
457
- }
458
- return {
459
- width: rect.width * scale.x,
460
- height: rect.height * scale.y,
461
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
462
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
463
- };
464
- }
465
- function getClientRects(element) {
466
- return Array.from(element.getClientRects());
467
- }
468
- function getWindowScrollBarX(element) {
469
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
470
- }
471
- function getDocumentRect(element) {
472
- const html = getDocumentElement(element);
473
- const scroll = getNodeScroll(element);
474
- const body = element.ownerDocument.body;
475
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
476
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
477
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
478
- const y = -scroll.scrollTop;
479
- if (getComputedStyle(body).direction === "rtl") {
480
- x += max(html.clientWidth, body.clientWidth) - width;
481
- }
482
- return {
483
- width,
484
- height,
485
- x,
486
- y
487
- };
488
- }
489
- function getViewportRect(element, strategy) {
490
- const win = getWindow(element);
491
- const html = getDocumentElement(element);
492
- const visualViewport = win.visualViewport;
493
- let width = html.clientWidth;
494
- let height = html.clientHeight;
495
- let x = 0;
496
- let y = 0;
497
- if (visualViewport) {
498
- width = visualViewport.width;
499
- height = visualViewport.height;
500
- const visualViewportBased = isWebKit();
501
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
502
- x = visualViewport.offsetLeft;
503
- y = visualViewport.offsetTop;
504
- }
505
- }
506
- return {
507
- width,
508
- height,
509
- x,
510
- y
511
- };
512
- }
513
- function getInnerBoundingClientRect(element, strategy) {
514
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
515
- const top = clientRect.top + element.clientTop;
516
- const left = clientRect.left + element.clientLeft;
517
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
518
- const width = element.clientWidth * scale.x;
519
- const height = element.clientHeight * scale.y;
520
- const x = left * scale.x;
521
- const y = top * scale.y;
522
- return {
523
- width,
524
- height,
525
- x,
526
- y
527
- };
528
- }
529
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
530
- let rect;
531
- if (clippingAncestor === "viewport") {
532
- rect = getViewportRect(element, strategy);
533
- } else if (clippingAncestor === "document") {
534
- rect = getDocumentRect(getDocumentElement(element));
535
- } else if (isElement(clippingAncestor)) {
536
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
537
- } else {
538
- const visualOffsets = getVisualOffsets(element);
539
- rect = {
540
- ...clippingAncestor,
541
- x: clippingAncestor.x - visualOffsets.x,
542
- y: clippingAncestor.y - visualOffsets.y
543
- };
544
- }
545
- return rectToClientRect(rect);
546
- }
547
- function hasFixedPositionAncestor(element, stopNode) {
548
- const parentNode = getParentNode(element);
549
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
550
- return false;
551
- }
552
- return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
553
- }
554
- function getClippingElementAncestors(element, cache) {
555
- const cachedResult = cache.get(element);
556
- if (cachedResult) {
557
- return cachedResult;
558
- }
559
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
560
- let currentContainingBlockComputedStyle = null;
561
- const elementIsFixed = getComputedStyle(element).position === "fixed";
562
- let currentNode = elementIsFixed ? getParentNode(element) : element;
563
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
564
- const computedStyle = getComputedStyle(currentNode);
565
- const currentNodeIsContaining = isContainingBlock(currentNode);
566
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
567
- currentContainingBlockComputedStyle = null;
568
- }
569
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
570
- if (shouldDropCurrentNode) {
571
- result = result.filter((ancestor) => ancestor !== currentNode);
572
- } else {
573
- currentContainingBlockComputedStyle = computedStyle;
574
- }
575
- currentNode = getParentNode(currentNode);
576
- }
577
- cache.set(element, result);
578
- return result;
579
- }
580
- function getClippingRect(_ref) {
581
- let {
582
- element,
583
- boundary,
584
- rootBoundary,
585
- strategy
586
- } = _ref;
587
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
588
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
589
- const firstClippingAncestor = clippingAncestors[0];
590
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
591
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
592
- accRect.top = max(rect.top, accRect.top);
593
- accRect.right = min(rect.right, accRect.right);
594
- accRect.bottom = min(rect.bottom, accRect.bottom);
595
- accRect.left = max(rect.left, accRect.left);
596
- return accRect;
597
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
598
- return {
599
- width: clippingRect.right - clippingRect.left,
600
- height: clippingRect.bottom - clippingRect.top,
601
- x: clippingRect.left,
602
- y: clippingRect.top
603
- };
604
- }
605
- function getDimensions(element) {
606
- const {
607
- width,
608
- height
609
- } = getCssDimensions(element);
610
- return {
611
- width,
612
- height
613
- };
614
- }
615
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
616
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
617
- const documentElement = getDocumentElement(offsetParent);
618
- const isFixed = strategy === "fixed";
619
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
620
- let scroll = {
621
- scrollLeft: 0,
622
- scrollTop: 0
623
- };
624
- const offsets = createCoords(0);
625
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
626
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
627
- scroll = getNodeScroll(offsetParent);
628
- }
629
- if (isOffsetParentAnElement) {
630
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
631
- offsets.x = offsetRect.x + offsetParent.clientLeft;
632
- offsets.y = offsetRect.y + offsetParent.clientTop;
633
- } else if (documentElement) {
634
- offsets.x = getWindowScrollBarX(documentElement);
635
- }
636
- }
637
- const x = rect.left + scroll.scrollLeft - offsets.x;
638
- const y = rect.top + scroll.scrollTop - offsets.y;
639
- return {
640
- x,
641
- y,
642
- width: rect.width,
643
- height: rect.height
644
- };
645
- }
646
- function isStaticPositioned(element) {
647
- return getComputedStyle(element).position === "static";
648
- }
649
- function getTrueOffsetParent(element, polyfill) {
650
- if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
651
- return null;
652
- }
653
- if (polyfill) {
654
- return polyfill(element);
655
- }
656
- return element.offsetParent;
657
- }
658
- function getOffsetParent(element, polyfill) {
659
- const win = getWindow(element);
660
- if (isTopLayer(element)) {
661
- return win;
662
- }
663
- if (!isHTMLElement(element)) {
664
- let svgOffsetParent = getParentNode(element);
665
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
666
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
667
- return svgOffsetParent;
668
- }
669
- svgOffsetParent = getParentNode(svgOffsetParent);
670
- }
671
- return win;
672
- }
673
- let offsetParent = getTrueOffsetParent(element, polyfill);
674
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
675
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
676
- }
677
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
678
- return win;
679
- }
680
- return offsetParent || getContainingBlock(element) || win;
681
- }
682
- const getElementRects = async function(data) {
683
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
684
- const getDimensionsFn = this.getDimensions;
685
- const floatingDimensions = await getDimensionsFn(data.floating);
686
- return {
687
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
688
- floating: {
689
- x: 0,
690
- y: 0,
691
- width: floatingDimensions.width,
692
- height: floatingDimensions.height
693
- }
694
- };
695
- };
696
- function isRTL(element) {
697
- return getComputedStyle(element).direction === "rtl";
698
- }
699
- const platform = {
700
- convertOffsetParentRelativeRectToViewportRelativeRect,
701
- getDocumentElement,
702
- getClippingRect,
703
- getOffsetParent,
704
- getElementRects,
705
- getClientRects,
706
- getDimensions,
707
- getScale,
708
- isElement,
709
- isRTL
710
- };
711
- const computePosition = (reference, floating, options) => {
712
- const cache = /* @__PURE__ */ new Map();
713
- const mergedOptions = {
714
- platform,
715
- ...options
716
- };
717
- const platformWithCache = {
718
- ...mergedOptions.platform,
719
- _c: cache
720
- };
721
- return computePosition$1(reference, floating, {
722
- ...mergedOptions,
723
- platform: platformWithCache
724
- });
725
- };
726
- class Polyfills {
727
- constructor(popover) {
728
- this.popover = popover;
729
- this.trigger = document.querySelector(
730
- `[popovertarget="${popover.getAttribute("id")}"`
731
- );
732
- this.positionPopover = this.positionPopover.bind(this);
733
- this.popover.addEventListener("toggle", this.positionPopover);
734
- }
735
- positionPopover = ({ newState }) => {
736
- if (newState === "open") {
737
- computePosition(this.trigger, this.popover, {
738
- placement: "bottom-start"
739
- }).then(({ x, y }) => {
740
- this.popover.style.insetInlineStart = `${x}px`;
741
- this.popover.style.insetBlockStart = `${y}px`;
742
- });
743
- }
744
- };
745
- }
746
- export {
747
- Polyfills as default
748
- };
749
- //# sourceMappingURL=polyfills-CJ5uTmUJ.js.map