@baloise/ds-core 19.9.0 → 19.9.1
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/floating-ui.dom.js +151 -125
- package/components/index.js +1 -1
- package/components/svg.js +1595 -1325
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/{p-79006350e3.system.entry.js → p-00d493e589.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-862bf2c3e6.entry.js → p-01b27feafd.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2333a469fa.entry.js → p-02323ca1fe.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c23854bd63.entry.js → p-0732a81f81.entry.js} +1 -1
- package/dist/baloise-design-system/{p-efd2551aca.entry.js → p-0974dcb139.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b9bbf796f3.system.entry.js → p-0c0190dc67.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-493e239429.entry.js → p-12d43e06d9.entry.js} +1 -1
- package/dist/baloise-design-system/{p-bd5655b6a8.entry.js → p-198c6e75ad.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1ee3f23f54.entry.js → p-1c913d4359.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a7503a0c9d.entry.js → p-1f0f2e599d.entry.js} +1 -1
- package/dist/baloise-design-system/{p-44137a3d17.system.entry.js → p-213c4d93f4.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-7f2e1e1be7.entry.js → p-239ed27774.entry.js} +1 -1
- package/dist/baloise-design-system/{p-5c3f48e883.system.entry.js → p-25dce380f8.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e9095ec856.system.entry.js → p-29defa9270.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-586de1181e.entry.js → p-340cd7b9e8.entry.js} +1 -1
- package/dist/baloise-design-system/p-38d8f6459e.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-c637edb9ea.entry.js → p-3d9d33c487.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b75b727fbc.entry.js → p-3ec4feac2e.entry.js} +1 -1
- package/dist/baloise-design-system/{p-772db94619.system.entry.js → p-3ff089ddd6.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-Dn1vzM6-.js → p-4MIQMEtx.js} +1 -1
- package/dist/baloise-design-system/{p-0556bebe3a.system.entry.js → p-5ed691fea4.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-fb980109e2.system.entry.js → p-6620c99966.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-777471c320.entry.js +1 -0
- package/dist/baloise-design-system/{p-14ae6214c4.system.entry.js → p-78eb8b6cd9.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0077e5a12f.entry.js → p-79d0e94ea1.entry.js} +1 -1
- package/dist/baloise-design-system/p-992840a30d.entry.js +1 -0
- package/dist/baloise-design-system/p-BFRjY4w3.js +1 -1
- package/dist/baloise-design-system/p-BRAmUyPx.system.js +1 -1
- package/dist/baloise-design-system/p-Bk7UdnZ5.system.js +1 -1
- package/dist/baloise-design-system/p-BmOE4zEk.system.js +1 -0
- package/dist/baloise-design-system/{p-TqRS9XF1.system.js → p-Bp0A6Ore.system.js} +1 -1
- package/dist/baloise-design-system/{p-DmVt6SeJ.js → p-BzAHSyRi.js} +1 -1
- package/dist/baloise-design-system/p-C8LDaK6Z.system.js +1 -0
- package/dist/baloise-design-system/p-CAb2C8az.js +1 -0
- package/dist/baloise-design-system/p-Ck7YRry-.system.js +2 -0
- package/dist/baloise-design-system/{p-BDYdAsv_.system.js → p-CkIgsCwS.system.js} +1 -1
- package/dist/baloise-design-system/p-Cr2H7Jt3.js +1 -0
- package/dist/baloise-design-system/p-DojUs2K8.js +2 -0
- package/dist/baloise-design-system/{p-CE3V5D8z.system.js → p-DvahsaGu.system.js} +1 -1
- package/dist/baloise-design-system/{p-bNRkwxp2.system.js → p-G8UK5F7H.system.js} +1 -1
- package/dist/baloise-design-system/p-P4eJh_wN.js +1 -0
- package/dist/baloise-design-system/{p-7cb15b231d.entry.js → p-a1482cbe4a.entry.js} +1 -1
- package/dist/baloise-design-system/p-a9d42c63a1.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-ee0b45ff30.system.entry.js → p-b1877d6778.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-393a31ad6e.system.entry.js → p-bc641f2029.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6191805e40.system.entry.js → p-d41ca5c096.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-bb255885a4.system.entry.js → p-d5de2680ad.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-fec5974e23.entry.js → p-dafa925d2c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-3ed3bfc59a.system.entry.js → p-f22c5ab5ed.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-eb98a3713f.system.entry.js → p-f481d72c52.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8029d2f939.entry.js → p-f4c4d03e6e.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c8491fda99.system.entry.js → p-fc8024a9d7.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a10bc9e5d8.entry.js → p-fc9a46b295.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a3558335f2.system.entry.js → p-fd5d4c0fd7.system.entry.js} +1 -1
- package/dist/cjs/bal-carousel_2.cjs.entry.js +5 -4
- package/dist/cjs/bal-date.cjs.entry.js +1 -1
- package/dist/cjs/bal-dropdown_3.cjs.entry.js +1 -1
- package/dist/cjs/bal-field_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-footer.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-icon.cjs.entry.js +1 -1
- 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-nav_8.cjs.entry.js +5 -4
- 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-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 +3 -3
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/{breakpoints.decorator-DhiWnqha.js → breakpoints.decorator-Cc1aDi12.js} +1 -1
- package/dist/cjs/{breakpoints.subject-DPTVZ3As.js → breakpoints.subject-CEyIkleD.js} +1 -1
- package/dist/cjs/{floating-ui-DyN44UhF.js → floating-ui-BE1Qsw-b.js} +1 -1
- package/dist/cjs/{floating-ui.dom-BPU3HWKX.js → floating-ui.dom-DCg2YBDr.js} +151 -125
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/initialize-BzrcZo6Y.js +1 -1
- package/dist/cjs/svg-qEvvK3mS.js +1607 -0
- package/dist/cjs/{tokens.esm-DM_dMnsW.js → tokens.esm-CO4NpDkI.js} +1 -1
- package/dist/cjs/{window-resize.decorator-oyMA7gDI.js → window-resize.decorator-DiYHzl6q.js} +1 -1
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/esm/bal-carousel_2.entry.js +5 -4
- package/dist/esm/bal-date.entry.js +1 -1
- package/dist/esm/bal-dropdown_3.entry.js +1 -1
- package/dist/esm/bal-field_5.entry.js +3 -3
- package/dist/esm/bal-footer.entry.js +1 -1
- package/dist/esm/bal-hint_5.entry.js +3 -3
- package/dist/esm/bal-icon.entry.js +1 -1
- package/dist/esm/bal-list_8.entry.js +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-nav_8.entry.js +5 -4
- 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-segment_2.entry.js +4 -4
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +3 -3
- package/dist/esm/bal-tab-item_2.entry.js +3 -3
- package/dist/esm/bal-tooltip.entry.js +1 -1
- package/dist/esm/{breakpoints.decorator-C-DmFJbn.js → breakpoints.decorator-CFE2cXqN.js} +1 -1
- package/dist/esm/{breakpoints.subject-Iyftu-nV.js → breakpoints.subject-BtghxYYt.js} +1 -1
- package/dist/esm/{floating-ui-Bx04QSXP.js → floating-ui-gZ7E41T8.js} +1 -1
- package/dist/esm/{floating-ui.dom-DKxvaA1I.js → floating-ui.dom-Cr2H7Jt3.js} +151 -125
- package/dist/esm/index.js +3 -3
- package/dist/esm/initialize-W3od-FM9.js +1 -1
- package/dist/esm/svg-DhNz-XmR.js +1605 -0
- package/dist/esm/{tokens.esm-C9EQ_6RZ.js → tokens.esm-DcKTia-G.js} +1 -1
- package/dist/esm/{window-resize.decorator-BU569j2_.js → window-resize.decorator-DJtj2dCF.js} +1 -1
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-date.entry.js +1 -1
- package/dist/esm-es5/bal-dropdown_3.entry.js +1 -1
- package/dist/esm-es5/bal-field_5.entry.js +1 -1
- package/dist/esm-es5/bal-footer.entry.js +1 -1
- package/dist/esm-es5/bal-hint_5.entry.js +1 -1
- package/dist/esm-es5/bal-icon.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-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-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-tooltip.entry.js +1 -1
- package/dist/esm-es5/{breakpoints.decorator-C-DmFJbn.js → breakpoints.decorator-CFE2cXqN.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-Iyftu-nV.js → breakpoints.subject-BtghxYYt.js} +1 -1
- package/dist/esm-es5/{floating-ui-Bx04QSXP.js → floating-ui-gZ7E41T8.js} +1 -1
- package/dist/esm-es5/floating-ui.dom-Cr2H7Jt3.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-W3od-FM9.js +1 -1
- package/dist/esm-es5/svg-DhNz-XmR.js +2 -0
- package/dist/esm-es5/{window-resize.decorator-BU569j2_.js → window-resize.decorator-DJtj2dCF.js} +1 -1
- package/dist/types/utils/svg.d.ts +1 -1
- package/package.json +9 -9
- package/dist/baloise-design-system/p-37641c340c.entry.js +0 -1
- package/dist/baloise-design-system/p-BIBFYhYa.system.js +0 -1
- package/dist/baloise-design-system/p-BS3tl84b.system.js +0 -3
- package/dist/baloise-design-system/p-CI2FR64u.js +0 -1
- package/dist/baloise-design-system/p-DKxvaA1I.js +0 -1
- package/dist/baloise-design-system/p-DUNB4kTY.js +0 -2
- package/dist/baloise-design-system/p-Dz-E2PRm.system.js +0 -1
- package/dist/baloise-design-system/p-Ere8qsaI.js +0 -1
- package/dist/baloise-design-system/p-a31aacd887.system.entry.js +0 -1
- package/dist/baloise-design-system/p-c1f871bb5b.system.entry.js +0 -1
- package/dist/baloise-design-system/p-dc45f7cf9c.entry.js +0 -1
- package/dist/cjs/svg-Bw61tXih.js +0 -1337
- package/dist/esm/svg-DUNB4kTY.js +0 -1335
- package/dist/esm-es5/floating-ui.dom-DKxvaA1I.js +0 -1
- package/dist/esm-es5/svg-DUNB4kTY.js +0 -2
- /package/dist/baloise-design-system/{p-C9EQ_6RZ.js → p-DcKTia-G.js} +0 -0
- /package/dist/baloise-design-system/{p-dEE6wNs_.system.js → p-q1IO5uRR.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-C9EQ_6RZ.js → tokens.esm-DcKTia-G.js} +0 -0
|
@@ -20,10 +20,6 @@ const oppositeSideMap = {
|
|
|
20
20
|
bottom: 'top',
|
|
21
21
|
top: 'bottom'
|
|
22
22
|
};
|
|
23
|
-
const oppositeAlignmentMap = {
|
|
24
|
-
start: 'end',
|
|
25
|
-
end: 'start'
|
|
26
|
-
};
|
|
27
23
|
function clamp(start, value, end) {
|
|
28
24
|
return max(start, min(value, end));
|
|
29
25
|
}
|
|
@@ -43,7 +39,8 @@ function getAxisLength(axis) {
|
|
|
43
39
|
return axis === 'y' ? 'height' : 'width';
|
|
44
40
|
}
|
|
45
41
|
function getSideAxis(placement) {
|
|
46
|
-
|
|
42
|
+
const firstChar = placement[0];
|
|
43
|
+
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
|
|
47
44
|
}
|
|
48
45
|
function getAlignmentAxis(placement) {
|
|
49
46
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -66,21 +63,21 @@ function getExpandedPlacements(placement) {
|
|
|
66
63
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
67
64
|
}
|
|
68
65
|
function getOppositeAlignmentPlacement(placement) {
|
|
69
|
-
return placement.replace(
|
|
66
|
+
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
|
70
67
|
}
|
|
68
|
+
const lrPlacement = ['left', 'right'];
|
|
69
|
+
const rlPlacement = ['right', 'left'];
|
|
70
|
+
const tbPlacement = ['top', 'bottom'];
|
|
71
|
+
const btPlacement = ['bottom', 'top'];
|
|
71
72
|
function getSideList(side, isStart, rtl) {
|
|
72
|
-
const lr = ['left', 'right'];
|
|
73
|
-
const rl = ['right', 'left'];
|
|
74
|
-
const tb = ['top', 'bottom'];
|
|
75
|
-
const bt = ['bottom', 'top'];
|
|
76
73
|
switch (side) {
|
|
77
74
|
case 'top':
|
|
78
75
|
case 'bottom':
|
|
79
|
-
if (rtl) return isStart ?
|
|
80
|
-
return isStart ?
|
|
76
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
77
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
81
78
|
case 'left':
|
|
82
79
|
case 'right':
|
|
83
|
-
return isStart ?
|
|
80
|
+
return isStart ? tbPlacement : btPlacement;
|
|
84
81
|
default:
|
|
85
82
|
return [];
|
|
86
83
|
}
|
|
@@ -97,7 +94,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
97
94
|
return list;
|
|
98
95
|
}
|
|
99
96
|
function getOppositePlacement(placement) {
|
|
100
|
-
|
|
97
|
+
const side = getSide(placement);
|
|
98
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
101
99
|
}
|
|
102
100
|
function expandPaddingObject(padding) {
|
|
103
101
|
return {
|
|
@@ -191,6 +189,74 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
191
189
|
return coords;
|
|
192
190
|
}
|
|
193
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
194
|
+
* element is overflowing a given clipping boundary on each side.
|
|
195
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
196
|
+
* - negative = how many pixels left before it will overflow
|
|
197
|
+
* - 0 = lies flush with the boundary
|
|
198
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
199
|
+
*/
|
|
200
|
+
async function detectOverflow$1(state, options) {
|
|
201
|
+
var _await$platform$isEle;
|
|
202
|
+
if (options === void 0) {
|
|
203
|
+
options = {};
|
|
204
|
+
}
|
|
205
|
+
const {
|
|
206
|
+
x,
|
|
207
|
+
y,
|
|
208
|
+
platform,
|
|
209
|
+
rects,
|
|
210
|
+
elements,
|
|
211
|
+
strategy
|
|
212
|
+
} = state;
|
|
213
|
+
const {
|
|
214
|
+
boundary = 'clippingAncestors',
|
|
215
|
+
rootBoundary = 'viewport',
|
|
216
|
+
elementContext = 'floating',
|
|
217
|
+
altBoundary = false,
|
|
218
|
+
padding = 0
|
|
219
|
+
} = evaluate(options, state);
|
|
220
|
+
const paddingObject = getPaddingObject(padding);
|
|
221
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
222
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
223
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
224
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
225
|
+
boundary,
|
|
226
|
+
rootBoundary,
|
|
227
|
+
strategy
|
|
228
|
+
}));
|
|
229
|
+
const rect = elementContext === 'floating' ? {
|
|
230
|
+
x,
|
|
231
|
+
y,
|
|
232
|
+
width: rects.floating.width,
|
|
233
|
+
height: rects.floating.height
|
|
234
|
+
} : rects.reference;
|
|
235
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
236
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
237
|
+
x: 1,
|
|
238
|
+
y: 1
|
|
239
|
+
} : {
|
|
240
|
+
x: 1,
|
|
241
|
+
y: 1
|
|
242
|
+
};
|
|
243
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
244
|
+
elements,
|
|
245
|
+
rect,
|
|
246
|
+
offsetParent,
|
|
247
|
+
strategy
|
|
248
|
+
}) : rect);
|
|
249
|
+
return {
|
|
250
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
251
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
252
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
253
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Maximum number of resets that can occur before bailing to avoid infinite reset loops.
|
|
258
|
+
const MAX_RESET_COUNT = 50;
|
|
259
|
+
|
|
194
260
|
/**
|
|
195
261
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
196
262
|
* next to a given reference element.
|
|
@@ -205,7 +271,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
205
271
|
middleware = [],
|
|
206
272
|
platform
|
|
207
273
|
} = config;
|
|
208
|
-
const
|
|
274
|
+
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
275
|
+
...platform,
|
|
276
|
+
detectOverflow: detectOverflow$1
|
|
277
|
+
};
|
|
209
278
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
210
279
|
let rects = await platform.getElementRects({
|
|
211
280
|
reference,
|
|
@@ -217,13 +286,17 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
217
286
|
y
|
|
218
287
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
219
288
|
let statefulPlacement = placement;
|
|
220
|
-
let middlewareData = {};
|
|
221
289
|
let resetCount = 0;
|
|
222
|
-
|
|
290
|
+
const middlewareData = {};
|
|
291
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
292
|
+
const currentMiddleware = middleware[i];
|
|
293
|
+
if (!currentMiddleware) {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
223
296
|
const {
|
|
224
297
|
name,
|
|
225
298
|
fn
|
|
226
|
-
} =
|
|
299
|
+
} = currentMiddleware;
|
|
227
300
|
const {
|
|
228
301
|
x: nextX,
|
|
229
302
|
y: nextY,
|
|
@@ -237,7 +310,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
237
310
|
strategy,
|
|
238
311
|
middlewareData,
|
|
239
312
|
rects,
|
|
240
|
-
platform,
|
|
313
|
+
platform: platformWithDetectOverflow,
|
|
241
314
|
elements: {
|
|
242
315
|
reference,
|
|
243
316
|
floating
|
|
@@ -245,14 +318,11 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
245
318
|
});
|
|
246
319
|
x = nextX != null ? nextX : x;
|
|
247
320
|
y = nextY != null ? nextY : y;
|
|
248
|
-
middlewareData = {
|
|
249
|
-
...middlewareData,
|
|
250
|
-
|
|
251
|
-
...middlewareData[name],
|
|
252
|
-
...data
|
|
253
|
-
}
|
|
321
|
+
middlewareData[name] = {
|
|
322
|
+
...middlewareData[name],
|
|
323
|
+
...data
|
|
254
324
|
};
|
|
255
|
-
if (reset && resetCount
|
|
325
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
256
326
|
resetCount++;
|
|
257
327
|
if (typeof reset === 'object') {
|
|
258
328
|
if (reset.placement) {
|
|
@@ -282,71 +352,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
282
352
|
};
|
|
283
353
|
};
|
|
284
354
|
|
|
285
|
-
/**
|
|
286
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
287
|
-
* element is overflowing a given clipping boundary on each side.
|
|
288
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
289
|
-
* - negative = how many pixels left before it will overflow
|
|
290
|
-
* - 0 = lies flush with the boundary
|
|
291
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
292
|
-
*/
|
|
293
|
-
async function detectOverflow$1(state, options) {
|
|
294
|
-
var _await$platform$isEle;
|
|
295
|
-
if (options === void 0) {
|
|
296
|
-
options = {};
|
|
297
|
-
}
|
|
298
|
-
const {
|
|
299
|
-
x,
|
|
300
|
-
y,
|
|
301
|
-
platform,
|
|
302
|
-
rects,
|
|
303
|
-
elements,
|
|
304
|
-
strategy
|
|
305
|
-
} = state;
|
|
306
|
-
const {
|
|
307
|
-
boundary = 'clippingAncestors',
|
|
308
|
-
rootBoundary = 'viewport',
|
|
309
|
-
elementContext = 'floating',
|
|
310
|
-
altBoundary = false,
|
|
311
|
-
padding = 0
|
|
312
|
-
} = evaluate(options, state);
|
|
313
|
-
const paddingObject = getPaddingObject(padding);
|
|
314
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
315
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
316
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
317
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
318
|
-
boundary,
|
|
319
|
-
rootBoundary,
|
|
320
|
-
strategy
|
|
321
|
-
}));
|
|
322
|
-
const rect = elementContext === 'floating' ? {
|
|
323
|
-
x,
|
|
324
|
-
y,
|
|
325
|
-
width: rects.floating.width,
|
|
326
|
-
height: rects.floating.height
|
|
327
|
-
} : rects.reference;
|
|
328
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
329
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
330
|
-
x: 1,
|
|
331
|
-
y: 1
|
|
332
|
-
} : {
|
|
333
|
-
x: 1,
|
|
334
|
-
y: 1
|
|
335
|
-
};
|
|
336
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
337
|
-
elements,
|
|
338
|
-
rect,
|
|
339
|
-
offsetParent,
|
|
340
|
-
strategy
|
|
341
|
-
}) : rect);
|
|
342
|
-
return {
|
|
343
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
344
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
345
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
346
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
|
|
350
355
|
/**
|
|
351
356
|
* Provides data to position an inner element of the floating element so that it
|
|
352
357
|
* appears centered to the reference element.
|
|
@@ -468,7 +473,7 @@ const autoPlacement$1 = function (options) {
|
|
|
468
473
|
...detectOverflowOptions
|
|
469
474
|
} = evaluate(options, state);
|
|
470
475
|
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
471
|
-
const overflow = await detectOverflow
|
|
476
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
472
477
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
473
478
|
const currentPlacement = placements$1[currentIndex];
|
|
474
479
|
if (currentPlacement == null) {
|
|
@@ -582,7 +587,7 @@ const flip$1 = function (options) {
|
|
|
582
587
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
583
588
|
}
|
|
584
589
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
585
|
-
const overflow = await detectOverflow
|
|
590
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
586
591
|
const overflows = [];
|
|
587
592
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
588
593
|
if (checkMainAxis) {
|
|
@@ -603,16 +608,22 @@ const flip$1 = function (options) {
|
|
|
603
608
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
604
609
|
const nextPlacement = placements[nextIndex];
|
|
605
610
|
if (nextPlacement) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
611
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
612
|
+
if (!ignoreCrossAxisOverflow ||
|
|
613
|
+
// We leave the current main axis only if every placement on that axis
|
|
614
|
+
// overflows the main axis.
|
|
615
|
+
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
616
|
+
// Try next placement and re-run the lifecycle.
|
|
617
|
+
return {
|
|
618
|
+
data: {
|
|
619
|
+
index: nextIndex,
|
|
620
|
+
overflows: overflowsData
|
|
621
|
+
},
|
|
622
|
+
reset: {
|
|
623
|
+
placement: nextPlacement
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
}
|
|
616
627
|
}
|
|
617
628
|
|
|
618
629
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -683,7 +694,8 @@ const hide$1 = function (options) {
|
|
|
683
694
|
options,
|
|
684
695
|
async fn(state) {
|
|
685
696
|
const {
|
|
686
|
-
rects
|
|
697
|
+
rects,
|
|
698
|
+
platform
|
|
687
699
|
} = state;
|
|
688
700
|
const {
|
|
689
701
|
strategy = 'referenceHidden',
|
|
@@ -692,7 +704,7 @@ const hide$1 = function (options) {
|
|
|
692
704
|
switch (strategy) {
|
|
693
705
|
case 'referenceHidden':
|
|
694
706
|
{
|
|
695
|
-
const overflow = await detectOverflow
|
|
707
|
+
const overflow = await platform.detectOverflow(state, {
|
|
696
708
|
...detectOverflowOptions,
|
|
697
709
|
elementContext: 'reference'
|
|
698
710
|
});
|
|
@@ -706,7 +718,7 @@ const hide$1 = function (options) {
|
|
|
706
718
|
}
|
|
707
719
|
case 'escaped':
|
|
708
720
|
{
|
|
709
|
-
const overflow = await detectOverflow
|
|
721
|
+
const overflow = await platform.detectOverflow(state, {
|
|
710
722
|
...detectOverflowOptions,
|
|
711
723
|
altBoundary: true
|
|
712
724
|
});
|
|
@@ -858,6 +870,8 @@ const inline$1 = function (options) {
|
|
|
858
870
|
};
|
|
859
871
|
};
|
|
860
872
|
|
|
873
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
874
|
+
|
|
861
875
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
862
876
|
// Derivable.
|
|
863
877
|
|
|
@@ -871,7 +885,7 @@ async function convertValueToCoords(state, options) {
|
|
|
871
885
|
const side = getSide(placement);
|
|
872
886
|
const alignment = getAlignment(placement);
|
|
873
887
|
const isVertical = getSideAxis(placement) === 'y';
|
|
874
|
-
const mainAxisMulti =
|
|
888
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
875
889
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
876
890
|
const rawValue = evaluate(options, state);
|
|
877
891
|
|
|
@@ -958,7 +972,8 @@ const shift$1 = function (options) {
|
|
|
958
972
|
const {
|
|
959
973
|
x,
|
|
960
974
|
y,
|
|
961
|
-
placement
|
|
975
|
+
placement,
|
|
976
|
+
platform
|
|
962
977
|
} = state;
|
|
963
978
|
const {
|
|
964
979
|
mainAxis: checkMainAxis = true,
|
|
@@ -981,7 +996,7 @@ const shift$1 = function (options) {
|
|
|
981
996
|
x,
|
|
982
997
|
y
|
|
983
998
|
};
|
|
984
|
-
const overflow = await detectOverflow
|
|
999
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
985
1000
|
const crossAxis = getSideAxis(getSide(placement));
|
|
986
1001
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
987
1002
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -1071,7 +1086,7 @@ const limitShift$1 = function (options) {
|
|
|
1071
1086
|
if (checkCrossAxis) {
|
|
1072
1087
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
1073
1088
|
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
1074
|
-
const isOriginSide =
|
|
1089
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
1075
1090
|
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
1076
1091
|
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
1077
1092
|
if (crossAxisCoord < limitMin) {
|
|
@@ -1113,7 +1128,7 @@ const size$1 = function (options) {
|
|
|
1113
1128
|
apply = () => {},
|
|
1114
1129
|
...detectOverflowOptions
|
|
1115
1130
|
} = evaluate(options, state);
|
|
1116
|
-
const overflow = await detectOverflow
|
|
1131
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1117
1132
|
const side = getSide(placement);
|
|
1118
1133
|
const alignment = getAlignment(placement);
|
|
1119
1134
|
const isYAxis = getSideAxis(placement) === 'y';
|
|
@@ -1223,27 +1238,35 @@ function isOverflowElement(element) {
|
|
|
1223
1238
|
overflowY,
|
|
1224
1239
|
display
|
|
1225
1240
|
} = getComputedStyle(element);
|
|
1226
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) &&
|
|
1241
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
|
|
1227
1242
|
}
|
|
1228
1243
|
function isTableElement(element) {
|
|
1229
|
-
return
|
|
1244
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
1230
1245
|
}
|
|
1231
1246
|
function isTopLayer(element) {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
return
|
|
1235
|
-
} catch (e) {
|
|
1236
|
-
return false;
|
|
1247
|
+
try {
|
|
1248
|
+
if (element.matches(':popover-open')) {
|
|
1249
|
+
return true;
|
|
1237
1250
|
}
|
|
1238
|
-
})
|
|
1251
|
+
} catch (_e) {
|
|
1252
|
+
// no-op
|
|
1253
|
+
}
|
|
1254
|
+
try {
|
|
1255
|
+
return element.matches(':modal');
|
|
1256
|
+
} catch (_e) {
|
|
1257
|
+
return false;
|
|
1258
|
+
}
|
|
1239
1259
|
}
|
|
1260
|
+
const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
1261
|
+
const containRe = /paint|layout|strict|content/;
|
|
1262
|
+
const isNotNone = value => !!value && value !== 'none';
|
|
1263
|
+
let isWebKitValue;
|
|
1240
1264
|
function isContainingBlock(elementOrCss) {
|
|
1241
|
-
const webkit = isWebKit();
|
|
1242
1265
|
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
1243
1266
|
|
|
1244
1267
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1245
1268
|
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
1246
|
-
return
|
|
1269
|
+
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
|
|
1247
1270
|
}
|
|
1248
1271
|
function getContainingBlock(element) {
|
|
1249
1272
|
let currentNode = getParentNode(element);
|
|
@@ -1258,11 +1281,13 @@ function getContainingBlock(element) {
|
|
|
1258
1281
|
return null;
|
|
1259
1282
|
}
|
|
1260
1283
|
function isWebKit() {
|
|
1261
|
-
if (
|
|
1262
|
-
|
|
1284
|
+
if (isWebKitValue == null) {
|
|
1285
|
+
isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
|
|
1286
|
+
}
|
|
1287
|
+
return isWebKitValue;
|
|
1263
1288
|
}
|
|
1264
1289
|
function isLastTraversableNode(node) {
|
|
1265
|
-
return
|
|
1290
|
+
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
1266
1291
|
}
|
|
1267
1292
|
function getComputedStyle(element) {
|
|
1268
1293
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -1318,8 +1343,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
1318
1343
|
if (isBody) {
|
|
1319
1344
|
const frameElement = getFrameElement(win);
|
|
1320
1345
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1346
|
+
} else {
|
|
1347
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1321
1348
|
}
|
|
1322
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1323
1349
|
}
|
|
1324
1350
|
function getFrameElement(win) {
|
|
1325
1351
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
package/components/index.js
CHANGED
|
@@ -476,7 +476,7 @@ const tags = [
|
|
|
476
476
|
];
|
|
477
477
|
|
|
478
478
|
// generated by .build/version.js
|
|
479
|
-
const VERSION = '19.9.
|
|
479
|
+
const VERSION = '19.9.1';
|
|
480
480
|
|
|
481
481
|
const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
|
|
482
482
|
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|