@baloise/ds-core 17.4.0-snapshot.1609-d2bcc38d3 → 17.4.0
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/components/all.d.ts +0 -2
- package/components/all.js +0 -3
- package/components/bal-app.js +93 -1
- package/components/bal-checkbox2.js +1 -1
- package/components/bal-close2.js +1 -1
- package/components/bal-date-calendar2.js +1 -1
- package/components/bal-modal.js +1 -1
- package/components/bal-radio2.js +1 -1
- package/components/bal-steps.js +1 -1
- package/components/bal-tabs2.js +1 -1
- package/components/bal-time-input.js +1 -1
- package/components/floating-ui.dom.esm.js +77 -205
- package/components/index.js +314 -7
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/p-00b2c8e27d.entry.js +1 -0
- package/dist/baloise-design-system/{p-9e489928.system.js → p-03470b7c.system.js} +1 -1
- package/dist/baloise-design-system/{p-0b6380a77a.entry.js → p-04e32e17e9.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0a00140ece.system.entry.js → p-0831f02fb0.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-12af198b96.system.entry.js → p-1277f286b7.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-fa246bef.system.js → p-195ee683.system.js} +1 -1
- package/dist/baloise-design-system/{p-4dc30ed346.system.entry.js → p-1cbe7106ba.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e4ff14c5bf.system.entry.js → p-242ac835e0.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-273fb2c2.system.js +1 -1
- package/dist/baloise-design-system/p-31876153a5.entry.js +1 -0
- package/dist/baloise-design-system/p-348f54acd8.entry.js +1 -0
- package/dist/baloise-design-system/{p-13d7688b.js → p-35baa468.js} +1 -1
- package/dist/baloise-design-system/p-36218e79.js +1 -0
- package/dist/baloise-design-system/{p-4affef9b9b.entry.js → p-396641837c.entry.js} +1 -1
- package/dist/baloise-design-system/p-3bc55789.js +1 -0
- package/dist/baloise-design-system/{p-3d5fac87cb.entry.js → p-3c1ea7b3e0.entry.js} +1 -1
- package/dist/baloise-design-system/p-3e039b9b6b.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-f669df60fb.entry.js → p-464f369ad6.entry.js} +1 -1
- package/dist/baloise-design-system/p-51e22c0c.js +1 -0
- package/dist/baloise-design-system/{p-8f2ebeb2.js → p-5940d4c2.js} +1 -1
- package/dist/baloise-design-system/{p-cf570c9464.entry.js → p-6267186e70.entry.js} +1 -1
- package/dist/baloise-design-system/{p-540bfa19.system.js → p-649e542e.system.js} +1 -1
- package/dist/baloise-design-system/{p-b721864305.entry.js → p-6be974c740.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e0c8d647b3.system.entry.js → p-72a32388f4.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-44539ccf68.entry.js → p-75fedb78c3.entry.js} +1 -1
- package/dist/baloise-design-system/{p-deaa160f21.system.entry.js → p-7615b673a0.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-db9f48c0d5.system.entry.js → p-762c8fa651.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6b14f26a4d.system.entry.js → p-78dada2c23.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2d98519440.system.entry.js → p-7dbfc01060.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-7bd7839936.entry.js → p-80bf87ba56.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6e4a8fa7.system.js → p-823eeecd.system.js} +1 -1
- package/dist/baloise-design-system/{p-341c9b6c63.entry.js → p-824353e256.entry.js} +1 -1
- package/dist/baloise-design-system/p-96cdf92a85.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-570a1d673a.entry.js → p-9aa95fbc37.entry.js} +1 -1
- package/dist/baloise-design-system/{p-71162da762.entry.js → p-9b73822c14.entry.js} +1 -1
- package/dist/baloise-design-system/p-9d2037e834.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-8869d8fe38.system.entry.js → p-9eeaac7842.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c08cbae3ec.system.entry.js → p-a3141b6fbf.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-bb308299af.entry.js → p-a857e31d7e.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4440f31c6b.system.entry.js → p-afa8aa0eec.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-525a4b8a95.entry.js → p-ba68f2ce70.entry.js} +1 -1
- package/dist/baloise-design-system/{p-34a93475db.system.entry.js → p-c2f12a9f5c.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-c6f5e9453a.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-3cb3bf6ca0.system.entry.js → p-c70043bd61.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-94b7fba934.entry.js → p-c8fae04995.entry.js} +1 -1
- package/dist/baloise-design-system/p-c991d944.js +1 -1
- package/dist/baloise-design-system/{p-363254ce.system.js → p-ca5cbdaf.system.js} +1 -1
- package/dist/baloise-design-system/{p-d5cb701b.system.js → p-cbef3146.system.js} +1 -1
- package/dist/baloise-design-system/{p-2697b88cca.entry.js → p-ccb73909c6.entry.js} +1 -1
- package/dist/baloise-design-system/p-d404537f.system.js +1 -0
- package/dist/baloise-design-system/{p-b2e3f97a3f.entry.js → p-d860cbbe40.entry.js} +1 -1
- package/dist/baloise-design-system/{p-070b692d.js → p-da6e6695.js} +1 -1
- package/dist/baloise-design-system/p-e2a70f10.system.js +1 -0
- package/dist/baloise-design-system/{p-be02300bdd.entry.js → p-e6b2f1a846.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e562e98c7e.system.entry.js → p-ec4e5d4ecc.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-73fdcff369.entry.js → p-f5a0884f92.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a8eef09399.system.entry.js → p-f7554b087f.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-f8c7a05b49.entry.js +1 -0
- package/dist/baloise-design-system/{p-5514228033.system.entry.js → p-f908b02917.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e63b388285.system.entry.js → p-f9950a0b55.system.entry.js} +1 -1
- package/dist/cjs/{global-872cca8d.js → app-globals-fa3c14cc.js} +4 -2
- package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-checkbox_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-close.cjs.entry.js +1 -1
- package/dist/cjs/bal-date-calendar_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-date.cjs.entry.js +1 -1
- package/dist/cjs/bal-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-logo.cjs.entry.js +3 -3
- package/dist/cjs/bal-modal_3.cjs.entry.js +1 -1
- package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
- package/dist/cjs/bal-popup.cjs.entry.js +1 -1
- package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +4 -4
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
- package/dist/cjs/bal-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/baloise-design-system.cjs.js +2 -3
- package/dist/cjs/{breakpoints.decorator-f4800188.js → breakpoints.decorator-a8a8d834.js} +1 -1
- package/dist/cjs/{breakpoints.subject-3244205b.js → breakpoints.subject-6e379a10.js} +1 -1
- package/dist/cjs/{floating-ui-838f057c.js → floating-ui-3147d2ff.js} +1 -1
- package/dist/cjs/{floating-ui.dom.esm-13e3f667.js → floating-ui.dom.esm-2ece9686.js} +77 -205
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/initialize-3059001f.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/{tokens.esm-b1eb9ac4.js → tokens.esm-793904fc.js} +1 -1
- package/dist/cjs/{window-resize.decorator-6133d79a.js → window-resize.decorator-8ca25081.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/bal-checkbox/radio-checkbox.css +1 -1
- package/dist/collection/components/bal-close/bal-close.css +1 -1
- package/dist/collection/components/bal-date/bal-date-calendar/bal-date-calendar.css +1 -1
- package/dist/collection/components/bal-modal/bal-modal.css +1 -1
- package/dist/collection/components/bal-steps/bal-steps.css +1 -1
- package/dist/collection/components/bal-tabs/bal-tabs.css +1 -1
- package/dist/collection/components/bal-time-input/bal-time-input.css +1 -1
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/esm/{global-181336dc.js → app-globals-5b18a75c.js} +4 -2
- package/dist/esm/bal-carousel_2.entry.js +3 -3
- package/dist/esm/bal-checkbox_2.entry.js +1 -1
- package/dist/esm/bal-close.entry.js +1 -1
- package/dist/esm/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm/bal-date.entry.js +1 -1
- package/dist/esm/bal-dropdown.entry.js +1 -1
- package/dist/esm/bal-hint_5.entry.js +3 -3
- package/dist/esm/bal-list_8.entry.js +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-modal_3.entry.js +1 -1
- package/dist/esm/bal-nav_8.entry.js +3 -3
- package/dist/esm/bal-navbar_5.entry.js +3 -3
- package/dist/esm/bal-pagination.entry.js +3 -3
- package/dist/esm/bal-popup.entry.js +1 -1
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-radio_2.entry.js +1 -1
- package/dist/esm/bal-segment_2.entry.js +4 -4
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +4 -4
- package/dist/esm/bal-tab-item_2.entry.js +4 -4
- package/dist/esm/bal-time-input.entry.js +1 -1
- package/dist/esm/bal-tooltip.entry.js +1 -1
- package/dist/esm/baloise-design-system.js +2 -3
- package/dist/esm/{breakpoints.decorator-43a5539d.js → breakpoints.decorator-a6d3eb5c.js} +1 -1
- package/dist/esm/{breakpoints.subject-41117dc4.js → breakpoints.subject-02e0dc05.js} +1 -1
- package/dist/esm/{floating-ui-d05a7ad6.js → floating-ui-90bc6e58.js} +1 -1
- package/dist/esm/{floating-ui.dom.esm-efb93616.js → floating-ui.dom.esm-8dcdb8d6.js} +77 -205
- package/dist/esm/index.js +3 -3
- package/dist/esm/initialize-66a526c0.js +1 -1
- package/dist/esm/loader.js +2 -3
- package/dist/esm/{tokens.esm-376de6fe.js → tokens.esm-2c058527.js} +1 -1
- package/dist/esm/{window-resize.decorator-66d8fd79.js → window-resize.decorator-37add7cf.js} +1 -1
- package/dist/esm-es5/app-globals-5b18a75c.js +1 -0
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/bal-close.entry.js +1 -1
- package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm-es5/bal-date.entry.js +1 -1
- package/dist/esm-es5/bal-dropdown.entry.js +1 -1
- package/dist/esm-es5/bal-hint_5.entry.js +1 -1
- package/dist/esm-es5/bal-list_8.entry.js +1 -1
- package/dist/esm-es5/bal-logo.entry.js +1 -1
- package/dist/esm-es5/bal-modal_3.entry.js +1 -1
- package/dist/esm-es5/bal-nav_8.entry.js +1 -1
- package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-popup.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-radio_2.entry.js +1 -1
- package/dist/esm-es5/bal-segment_2.entry.js +1 -1
- package/dist/esm-es5/bal-shape.entry.js +1 -1
- package/dist/esm-es5/bal-steps.entry.js +1 -1
- package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
- package/dist/esm-es5/bal-time-input.entry.js +1 -1
- package/dist/esm-es5/bal-tooltip.entry.js +1 -1
- package/dist/esm-es5/baloise-design-system.js +1 -1
- package/dist/esm-es5/breakpoints.decorator-a6d3eb5c.js +1 -0
- package/dist/esm-es5/{breakpoints.subject-41117dc4.js → breakpoints.subject-02e0dc05.js} +1 -1
- package/dist/esm-es5/{floating-ui-d05a7ad6.js → floating-ui-90bc6e58.js} +1 -1
- package/dist/esm-es5/floating-ui.dom.esm-8dcdb8d6.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-66a526c0.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{window-resize.decorator-66d8fd79.js → window-resize.decorator-37add7cf.js} +1 -1
- package/dist/types/components.d.ts +0 -37
- package/package.json +8 -6
- package/components/bal-app2.js +0 -95
- package/components/bal-doc-app.d.ts +0 -11
- package/components/bal-doc-app.js +0 -262
- package/components/initialize.js +0 -312
- package/dist/baloise-design-system/p-07bae1fdcc.system.entry.js +0 -1
- package/dist/baloise-design-system/p-0d5459caac.system.entry.js +0 -1
- package/dist/baloise-design-system/p-10ff0eaf.js +0 -1
- package/dist/baloise-design-system/p-1c8e64e58b.system.entry.js +0 -1
- package/dist/baloise-design-system/p-2724ad9065.entry.js +0 -1
- package/dist/baloise-design-system/p-50f3b012.js +0 -1
- package/dist/baloise-design-system/p-55fc8522eb.system.entry.js +0 -1
- package/dist/baloise-design-system/p-59d9918c.system.js +0 -1
- package/dist/baloise-design-system/p-9fbf3690.system.js +0 -1
- package/dist/baloise-design-system/p-b21f2874.system.js +0 -1
- package/dist/baloise-design-system/p-c017695c41.entry.js +0 -1
- package/dist/baloise-design-system/p-e48a46d6d7.entry.js +0 -1
- package/dist/baloise-design-system/p-e4b50159.js +0 -1
- package/dist/baloise-design-system/p-ec5776f5.js +0 -1
- package/dist/baloise-design-system/p-f1849ab83d.entry.js +0 -1
- package/dist/baloise-design-system/p-f55c127cb5.system.entry.js +0 -1
- package/dist/baloise-design-system/p-ffe0476dde.entry.js +0 -1
- package/dist/cjs/app-globals-44d3a5af.js +0 -7
- package/dist/cjs/bal-doc-app.cjs.entry.js +0 -233
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -247
- package/dist/esm/app-globals-c5ea8144.js +0 -5
- package/dist/esm/bal-doc-app.entry.js +0 -229
- package/dist/esm-es5/app-globals-c5ea8144.js +0 -1
- package/dist/esm-es5/bal-doc-app.entry.js +0 -1
- package/dist/esm-es5/breakpoints.decorator-43a5539d.js +0 -1
- package/dist/esm-es5/floating-ui.dom.esm-efb93616.js +0 -1
- package/dist/esm-es5/global-181336dc.js +0 -1
- package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +0 -82
- /package/dist/baloise-design-system/{p-6e1e6cc5.js → p-25431930.js} +0 -0
- /package/dist/baloise-design-system/{p-b119ef19.system.js → p-80a4075f.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-376de6fe.js → tokens.esm-2c058527.js} +0 -0
|
@@ -117,21 +117,12 @@ function getPaddingObject(padding) {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
function rectToClientRect(rect) {
|
|
120
|
-
const {
|
|
121
|
-
x,
|
|
122
|
-
y,
|
|
123
|
-
width,
|
|
124
|
-
height
|
|
125
|
-
} = rect;
|
|
126
120
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
bottom: y + height,
|
|
133
|
-
x,
|
|
134
|
-
y
|
|
121
|
+
...rect,
|
|
122
|
+
top: rect.y,
|
|
123
|
+
left: rect.x,
|
|
124
|
+
right: rect.x + rect.width,
|
|
125
|
+
bottom: rect.y + rect.height
|
|
135
126
|
};
|
|
136
127
|
}
|
|
137
128
|
|
|
@@ -290,7 +281,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
290
281
|
* - 0 = lies flush with the boundary
|
|
291
282
|
* @see https://floating-ui.com/docs/detectOverflow
|
|
292
283
|
*/
|
|
293
|
-
async function detectOverflow
|
|
284
|
+
async function detectOverflow(state, options) {
|
|
294
285
|
var _await$platform$isEle;
|
|
295
286
|
if (options === void 0) {
|
|
296
287
|
options = {};
|
|
@@ -320,10 +311,9 @@ async function detectOverflow$1(state, options) {
|
|
|
320
311
|
strategy
|
|
321
312
|
}));
|
|
322
313
|
const rect = elementContext === 'floating' ? {
|
|
314
|
+
...rects.floating,
|
|
323
315
|
x,
|
|
324
|
-
y
|
|
325
|
-
width: rects.floating.width,
|
|
326
|
-
height: rects.floating.height
|
|
316
|
+
y
|
|
327
317
|
} : rects.reference;
|
|
328
318
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
329
319
|
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
@@ -468,7 +458,7 @@ const autoPlacement$1 = function (options) {
|
|
|
468
458
|
...detectOverflowOptions
|
|
469
459
|
} = evaluate(options, state);
|
|
470
460
|
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
471
|
-
const overflow = await detectOverflow
|
|
461
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
472
462
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
473
463
|
const currentPlacement = placements$1[currentIndex];
|
|
474
464
|
if (currentPlacement == null) {
|
|
@@ -573,16 +563,14 @@ const flip$1 = function (options) {
|
|
|
573
563
|
return {};
|
|
574
564
|
}
|
|
575
565
|
const side = getSide(placement);
|
|
576
|
-
const initialSideAxis = getSideAxis(initialPlacement);
|
|
577
566
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
578
567
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
579
568
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
580
|
-
|
|
581
|
-
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
569
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
582
570
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
583
571
|
}
|
|
584
572
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
585
|
-
const overflow = await detectOverflow
|
|
573
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
586
574
|
const overflows = [];
|
|
587
575
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
588
576
|
if (checkMainAxis) {
|
|
@@ -624,17 +612,8 @@ const flip$1 = function (options) {
|
|
|
624
612
|
switch (fallbackStrategy) {
|
|
625
613
|
case 'bestFit':
|
|
626
614
|
{
|
|
627
|
-
var _overflowsData$
|
|
628
|
-
const placement = (_overflowsData$
|
|
629
|
-
if (hasFallbackAxisSideDirection) {
|
|
630
|
-
const currentSideAxis = getSideAxis(d.placement);
|
|
631
|
-
return currentSideAxis === initialSideAxis ||
|
|
632
|
-
// Create a bias to the `y` side axis due to horizontal
|
|
633
|
-
// reading directions favoring greater width.
|
|
634
|
-
currentSideAxis === 'y';
|
|
635
|
-
}
|
|
636
|
-
return true;
|
|
637
|
-
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
615
|
+
var _overflowsData$map$so;
|
|
616
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
638
617
|
if (placement) {
|
|
639
618
|
resetPlacement = placement;
|
|
640
619
|
}
|
|
@@ -692,7 +671,7 @@ const hide$1 = function (options) {
|
|
|
692
671
|
switch (strategy) {
|
|
693
672
|
case 'referenceHidden':
|
|
694
673
|
{
|
|
695
|
-
const overflow = await detectOverflow
|
|
674
|
+
const overflow = await detectOverflow(state, {
|
|
696
675
|
...detectOverflowOptions,
|
|
697
676
|
elementContext: 'reference'
|
|
698
677
|
});
|
|
@@ -706,7 +685,7 @@ const hide$1 = function (options) {
|
|
|
706
685
|
}
|
|
707
686
|
case 'escaped':
|
|
708
687
|
{
|
|
709
|
-
const overflow = await detectOverflow
|
|
688
|
+
const overflow = await detectOverflow(state, {
|
|
710
689
|
...detectOverflowOptions,
|
|
711
690
|
altBoundary: true
|
|
712
691
|
});
|
|
@@ -874,8 +853,6 @@ async function convertValueToCoords(state, options) {
|
|
|
874
853
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
875
854
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
876
855
|
const rawValue = evaluate(options, state);
|
|
877
|
-
|
|
878
|
-
// eslint-disable-next-line prefer-const
|
|
879
856
|
let {
|
|
880
857
|
mainAxis,
|
|
881
858
|
crossAxis,
|
|
@@ -885,9 +862,10 @@ async function convertValueToCoords(state, options) {
|
|
|
885
862
|
crossAxis: 0,
|
|
886
863
|
alignmentAxis: null
|
|
887
864
|
} : {
|
|
888
|
-
mainAxis:
|
|
889
|
-
crossAxis:
|
|
890
|
-
alignmentAxis:
|
|
865
|
+
mainAxis: 0,
|
|
866
|
+
crossAxis: 0,
|
|
867
|
+
alignmentAxis: null,
|
|
868
|
+
...rawValue
|
|
891
869
|
};
|
|
892
870
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
893
871
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -908,7 +886,7 @@ async function convertValueToCoords(state, options) {
|
|
|
908
886
|
* object may be passed.
|
|
909
887
|
* @see https://floating-ui.com/docs/offset
|
|
910
888
|
*/
|
|
911
|
-
const offset
|
|
889
|
+
const offset = function (options) {
|
|
912
890
|
if (options === void 0) {
|
|
913
891
|
options = 0;
|
|
914
892
|
}
|
|
@@ -981,7 +959,7 @@ const shift$1 = function (options) {
|
|
|
981
959
|
x,
|
|
982
960
|
y
|
|
983
961
|
};
|
|
984
|
-
const overflow = await detectOverflow
|
|
962
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
985
963
|
const crossAxis = getSideAxis(getSide(placement));
|
|
986
964
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
987
965
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -1009,11 +987,7 @@ const shift$1 = function (options) {
|
|
|
1009
987
|
...limitedCoords,
|
|
1010
988
|
data: {
|
|
1011
989
|
x: limitedCoords.x - x,
|
|
1012
|
-
y: limitedCoords.y - y
|
|
1013
|
-
enabled: {
|
|
1014
|
-
[mainAxis]: checkMainAxis,
|
|
1015
|
-
[crossAxis]: checkCrossAxis
|
|
1016
|
-
}
|
|
990
|
+
y: limitedCoords.y - y
|
|
1017
991
|
}
|
|
1018
992
|
};
|
|
1019
993
|
}
|
|
@@ -1102,7 +1076,6 @@ const size$1 = function (options) {
|
|
|
1102
1076
|
name: 'size',
|
|
1103
1077
|
options,
|
|
1104
1078
|
async fn(state) {
|
|
1105
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
1106
1079
|
const {
|
|
1107
1080
|
placement,
|
|
1108
1081
|
rects,
|
|
@@ -1113,7 +1086,7 @@ const size$1 = function (options) {
|
|
|
1113
1086
|
apply = () => {},
|
|
1114
1087
|
...detectOverflowOptions
|
|
1115
1088
|
} = evaluate(options, state);
|
|
1116
|
-
const overflow = await detectOverflow
|
|
1089
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
1117
1090
|
const side = getSide(placement);
|
|
1118
1091
|
const alignment = getAlignment(placement);
|
|
1119
1092
|
const isYAxis = getSideAxis(placement) === 'y';
|
|
@@ -1130,18 +1103,17 @@ const size$1 = function (options) {
|
|
|
1130
1103
|
widthSide = side;
|
|
1131
1104
|
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
1132
1105
|
}
|
|
1133
|
-
const
|
|
1134
|
-
const
|
|
1135
|
-
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1136
|
-
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1106
|
+
const overflowAvailableHeight = height - overflow[heightSide];
|
|
1107
|
+
const overflowAvailableWidth = width - overflow[widthSide];
|
|
1137
1108
|
const noShift = !state.middlewareData.shift;
|
|
1138
1109
|
let availableHeight = overflowAvailableHeight;
|
|
1139
1110
|
let availableWidth = overflowAvailableWidth;
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1111
|
+
if (isYAxis) {
|
|
1112
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1113
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
1114
|
+
} else {
|
|
1115
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
1116
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
1145
1117
|
}
|
|
1146
1118
|
if (noShift && !alignment) {
|
|
1147
1119
|
const xMin = max(overflow.left, 0);
|
|
@@ -1172,9 +1144,6 @@ const size$1 = function (options) {
|
|
|
1172
1144
|
};
|
|
1173
1145
|
};
|
|
1174
1146
|
|
|
1175
|
-
function hasWindow() {
|
|
1176
|
-
return typeof window !== 'undefined';
|
|
1177
|
-
}
|
|
1178
1147
|
function getNodeName(node) {
|
|
1179
1148
|
if (isNode(node)) {
|
|
1180
1149
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -1193,25 +1162,17 @@ function getDocumentElement(node) {
|
|
|
1193
1162
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
1194
1163
|
}
|
|
1195
1164
|
function isNode(value) {
|
|
1196
|
-
if (!hasWindow()) {
|
|
1197
|
-
return false;
|
|
1198
|
-
}
|
|
1199
1165
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
1200
1166
|
}
|
|
1201
1167
|
function isElement(value) {
|
|
1202
|
-
if (!hasWindow()) {
|
|
1203
|
-
return false;
|
|
1204
|
-
}
|
|
1205
1168
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
1206
1169
|
}
|
|
1207
1170
|
function isHTMLElement(value) {
|
|
1208
|
-
if (!hasWindow()) {
|
|
1209
|
-
return false;
|
|
1210
|
-
}
|
|
1211
1171
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
1212
1172
|
}
|
|
1213
1173
|
function isShadowRoot(value) {
|
|
1214
|
-
|
|
1174
|
+
// Browsers without `ShadowRoot` support.
|
|
1175
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
1215
1176
|
return false;
|
|
1216
1177
|
}
|
|
1217
1178
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
@@ -1228,32 +1189,21 @@ function isOverflowElement(element) {
|
|
|
1228
1189
|
function isTableElement(element) {
|
|
1229
1190
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1230
1191
|
}
|
|
1231
|
-
function
|
|
1232
|
-
return [':popover-open', ':modal'].some(selector => {
|
|
1233
|
-
try {
|
|
1234
|
-
return element.matches(selector);
|
|
1235
|
-
} catch (e) {
|
|
1236
|
-
return false;
|
|
1237
|
-
}
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
function isContainingBlock(elementOrCss) {
|
|
1192
|
+
function isContainingBlock(element) {
|
|
1241
1193
|
const webkit = isWebKit();
|
|
1242
|
-
const css =
|
|
1194
|
+
const css = getComputedStyle(element);
|
|
1243
1195
|
|
|
1244
1196
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1245
|
-
|
|
1246
|
-
return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
1197
|
+
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));
|
|
1247
1198
|
}
|
|
1248
1199
|
function getContainingBlock(element) {
|
|
1249
1200
|
let currentNode = getParentNode(element);
|
|
1250
1201
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1251
1202
|
if (isContainingBlock(currentNode)) {
|
|
1252
1203
|
return currentNode;
|
|
1253
|
-
} else
|
|
1254
|
-
|
|
1204
|
+
} else {
|
|
1205
|
+
currentNode = getParentNode(currentNode);
|
|
1255
1206
|
}
|
|
1256
|
-
currentNode = getParentNode(currentNode);
|
|
1257
1207
|
}
|
|
1258
1208
|
return null;
|
|
1259
1209
|
}
|
|
@@ -1275,8 +1225,8 @@ function getNodeScroll(element) {
|
|
|
1275
1225
|
};
|
|
1276
1226
|
}
|
|
1277
1227
|
return {
|
|
1278
|
-
scrollLeft: element.
|
|
1279
|
-
scrollTop: element.
|
|
1228
|
+
scrollLeft: element.pageXOffset,
|
|
1229
|
+
scrollTop: element.pageYOffset
|
|
1280
1230
|
};
|
|
1281
1231
|
}
|
|
1282
1232
|
function getParentNode(node) {
|
|
@@ -1316,14 +1266,10 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
1316
1266
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1317
1267
|
const win = getWindow(scrollableAncestor);
|
|
1318
1268
|
if (isBody) {
|
|
1319
|
-
|
|
1320
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1269
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
1321
1270
|
}
|
|
1322
1271
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1323
1272
|
}
|
|
1324
|
-
function getFrameElement(win) {
|
|
1325
|
-
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
1326
|
-
}
|
|
1327
1273
|
|
|
1328
1274
|
function getCssDimensions(element) {
|
|
1329
1275
|
const css = getComputedStyle(element);
|
|
@@ -1427,7 +1373,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1427
1373
|
const win = getWindow(domElement);
|
|
1428
1374
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1429
1375
|
let currentWin = win;
|
|
1430
|
-
let currentIFrame =
|
|
1376
|
+
let currentIFrame = currentWin.frameElement;
|
|
1431
1377
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1432
1378
|
const iframeScale = getScale(currentIFrame);
|
|
1433
1379
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
@@ -1441,7 +1387,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1441
1387
|
x += left;
|
|
1442
1388
|
y += top;
|
|
1443
1389
|
currentWin = getWindow(currentIFrame);
|
|
1444
|
-
currentIFrame =
|
|
1390
|
+
currentIFrame = currentWin.frameElement;
|
|
1445
1391
|
}
|
|
1446
1392
|
}
|
|
1447
1393
|
return rectToClientRect({
|
|
@@ -1452,29 +1398,15 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1452
1398
|
});
|
|
1453
1399
|
}
|
|
1454
1400
|
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1466
|
-
if (ignoreScrollbarX === void 0) {
|
|
1467
|
-
ignoreScrollbarX = false;
|
|
1468
|
-
}
|
|
1469
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
1470
|
-
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
|
|
1471
|
-
// RTL <body> scrollbar.
|
|
1472
|
-
getWindowScrollBarX(documentElement, htmlRect));
|
|
1473
|
-
const y = htmlRect.top + scroll.scrollTop;
|
|
1474
|
-
return {
|
|
1475
|
-
x,
|
|
1476
|
-
y
|
|
1477
|
-
};
|
|
1401
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
1402
|
+
function isTopLayer(floating) {
|
|
1403
|
+
return topLayerSelectors.some(selector => {
|
|
1404
|
+
try {
|
|
1405
|
+
return floating.matches(selector);
|
|
1406
|
+
} catch (e) {
|
|
1407
|
+
return false;
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1478
1410
|
}
|
|
1479
1411
|
|
|
1480
1412
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -1508,12 +1440,11 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1508
1440
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1509
1441
|
}
|
|
1510
1442
|
}
|
|
1511
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
1512
1443
|
return {
|
|
1513
1444
|
width: rect.width * scale.x,
|
|
1514
1445
|
height: rect.height * scale.y,
|
|
1515
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x
|
|
1516
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1446
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1447
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1517
1448
|
};
|
|
1518
1449
|
}
|
|
1519
1450
|
|
|
@@ -1521,6 +1452,12 @@ function getClientRects(element) {
|
|
|
1521
1452
|
return Array.from(element.getClientRects());
|
|
1522
1453
|
}
|
|
1523
1454
|
|
|
1455
|
+
function getWindowScrollBarX(element) {
|
|
1456
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1457
|
+
// incorrect for RTL.
|
|
1458
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1524
1461
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
1525
1462
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1526
1463
|
function getDocumentRect(element) {
|
|
@@ -1595,10 +1532,9 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1595
1532
|
} else {
|
|
1596
1533
|
const visualOffsets = getVisualOffsets(element);
|
|
1597
1534
|
rect = {
|
|
1535
|
+
...clippingAncestor,
|
|
1598
1536
|
x: clippingAncestor.x - visualOffsets.x,
|
|
1599
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
1600
|
-
width: clippingAncestor.width,
|
|
1601
|
-
height: clippingAncestor.height
|
|
1537
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
1602
1538
|
};
|
|
1603
1539
|
}
|
|
1604
1540
|
return rectToClientRect(rect);
|
|
@@ -1654,7 +1590,7 @@ function getClippingRect(_ref) {
|
|
|
1654
1590
|
rootBoundary,
|
|
1655
1591
|
strategy
|
|
1656
1592
|
} = _ref;
|
|
1657
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ?
|
|
1593
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1658
1594
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1659
1595
|
const firstClippingAncestor = clippingAncestors[0];
|
|
1660
1596
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -1703,14 +1639,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1703
1639
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1704
1640
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1705
1641
|
} else if (documentElement) {
|
|
1706
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1707
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1708
1642
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
1709
1643
|
}
|
|
1710
1644
|
}
|
|
1711
|
-
const
|
|
1712
|
-
const
|
|
1713
|
-
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1645
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
1646
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
1714
1647
|
return {
|
|
1715
1648
|
x,
|
|
1716
1649
|
y,
|
|
@@ -1719,10 +1652,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1719
1652
|
};
|
|
1720
1653
|
}
|
|
1721
1654
|
|
|
1722
|
-
function isStaticPositioned(element) {
|
|
1723
|
-
return getComputedStyle(element).position === 'static';
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
1655
|
function getTrueOffsetParent(element, polyfill) {
|
|
1727
1656
|
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1728
1657
|
return null;
|
|
@@ -1730,56 +1659,35 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
1730
1659
|
if (polyfill) {
|
|
1731
1660
|
return polyfill(element);
|
|
1732
1661
|
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1736
|
-
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1737
|
-
// be used to perform the correct calculations even if the <html> element is
|
|
1738
|
-
// non-static.
|
|
1739
|
-
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1740
|
-
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1741
|
-
}
|
|
1742
|
-
return rawOffsetParent;
|
|
1662
|
+
return element.offsetParent;
|
|
1743
1663
|
}
|
|
1744
1664
|
|
|
1745
1665
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1746
1666
|
// such as table ancestors and cross browser bugs.
|
|
1747
1667
|
function getOffsetParent(element, polyfill) {
|
|
1748
|
-
const
|
|
1749
|
-
if (isTopLayer(element)) {
|
|
1750
|
-
return
|
|
1751
|
-
}
|
|
1752
|
-
if (!isHTMLElement(element)) {
|
|
1753
|
-
let svgOffsetParent = getParentNode(element);
|
|
1754
|
-
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1755
|
-
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1756
|
-
return svgOffsetParent;
|
|
1757
|
-
}
|
|
1758
|
-
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1759
|
-
}
|
|
1760
|
-
return win;
|
|
1668
|
+
const window = getWindow(element);
|
|
1669
|
+
if (!isHTMLElement(element) || isTopLayer(element)) {
|
|
1670
|
+
return window;
|
|
1761
1671
|
}
|
|
1762
1672
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1763
|
-
while (offsetParent && isTableElement(offsetParent) &&
|
|
1673
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1764
1674
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1765
1675
|
}
|
|
1766
|
-
if (offsetParent &&
|
|
1767
|
-
return
|
|
1676
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1677
|
+
return window;
|
|
1768
1678
|
}
|
|
1769
|
-
return offsetParent || getContainingBlock(element) ||
|
|
1679
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
1770
1680
|
}
|
|
1771
1681
|
|
|
1772
1682
|
const getElementRects = async function (data) {
|
|
1773
1683
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1774
1684
|
const getDimensionsFn = this.getDimensions;
|
|
1775
|
-
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1776
1685
|
return {
|
|
1777
1686
|
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1778
1687
|
floating: {
|
|
1779
1688
|
x: 0,
|
|
1780
1689
|
y: 0,
|
|
1781
|
-
|
|
1782
|
-
height: floatingDimensions.height
|
|
1690
|
+
...(await getDimensionsFn(data.floating))
|
|
1783
1691
|
}
|
|
1784
1692
|
};
|
|
1785
1693
|
};
|
|
@@ -1801,10 +1709,6 @@ const platform = {
|
|
|
1801
1709
|
isRTL
|
|
1802
1710
|
};
|
|
1803
1711
|
|
|
1804
|
-
function rectsAreEqual(a, b) {
|
|
1805
|
-
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
1712
|
// https://samthor.au/2021/observing-dom/
|
|
1809
1713
|
function observeMove(element, onMove) {
|
|
1810
1714
|
let io = null;
|
|
@@ -1824,13 +1728,12 @@ function observeMove(element, onMove) {
|
|
|
1824
1728
|
threshold = 1;
|
|
1825
1729
|
}
|
|
1826
1730
|
cleanup();
|
|
1827
|
-
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1828
1731
|
const {
|
|
1829
1732
|
left,
|
|
1830
1733
|
top,
|
|
1831
1734
|
width,
|
|
1832
1735
|
height
|
|
1833
|
-
} =
|
|
1736
|
+
} = element.getBoundingClientRect();
|
|
1834
1737
|
if (!skip) {
|
|
1835
1738
|
onMove();
|
|
1836
1739
|
}
|
|
@@ -1854,25 +1757,13 @@ function observeMove(element, onMove) {
|
|
|
1854
1757
|
return refresh();
|
|
1855
1758
|
}
|
|
1856
1759
|
if (!ratio) {
|
|
1857
|
-
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1858
|
-
// to prevent an infinite loop of updates.
|
|
1859
1760
|
timeoutId = setTimeout(() => {
|
|
1860
1761
|
refresh(false, 1e-7);
|
|
1861
|
-
},
|
|
1762
|
+
}, 100);
|
|
1862
1763
|
} else {
|
|
1863
1764
|
refresh(false, ratio);
|
|
1864
1765
|
}
|
|
1865
1766
|
}
|
|
1866
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1867
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
1868
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
1869
|
-
// area anymore. This can happen under performance constraints. This may
|
|
1870
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1871
|
-
// work around this, we compare the element's bounding rect now with
|
|
1872
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
1873
|
-
// are not equal then the element moved, so we refresh.
|
|
1874
|
-
refresh();
|
|
1875
|
-
}
|
|
1876
1767
|
isFirstUpdate = false;
|
|
1877
1768
|
}
|
|
1878
1769
|
|
|
@@ -1950,7 +1841,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1950
1841
|
}
|
|
1951
1842
|
function frameLoop() {
|
|
1952
1843
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1953
|
-
if (prevRefRect &&
|
|
1844
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1954
1845
|
update();
|
|
1955
1846
|
}
|
|
1956
1847
|
prevRefRect = nextRefRect;
|
|
@@ -1972,25 +1863,6 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1972
1863
|
};
|
|
1973
1864
|
}
|
|
1974
1865
|
|
|
1975
|
-
/**
|
|
1976
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
1977
|
-
* element is overflowing a given clipping boundary on each side.
|
|
1978
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
1979
|
-
* - negative = how many pixels left before it will overflow
|
|
1980
|
-
* - 0 = lies flush with the boundary
|
|
1981
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
1982
|
-
*/
|
|
1983
|
-
const detectOverflow = detectOverflow$1;
|
|
1984
|
-
|
|
1985
|
-
/**
|
|
1986
|
-
* Modifies the placement by translating the floating element along the
|
|
1987
|
-
* specified axes.
|
|
1988
|
-
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1989
|
-
* object may be passed.
|
|
1990
|
-
* @see https://floating-ui.com/docs/offset
|
|
1991
|
-
*/
|
|
1992
|
-
const offset = offset$1;
|
|
1993
|
-
|
|
1994
1866
|
/**
|
|
1995
1867
|
* Optimizes the visibility of the floating element by choosing the placement
|
|
1996
1868
|
* that has the most space available automatically, without needing to specify a
|