@rededor/cura 2.0.0-alpha.4 → 2.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cura-accordion_21.cjs.entry.js +69 -179
- package/dist/cjs/cura-accordion_21.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +4 -3
- package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.entry.cjs.js.map +1 -1
- package/dist/cjs/index-BK9MSAiE.js.map +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js +4 -3
- package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
- package/dist/components/cura-alert.js +4 -3
- package/dist/components/cura-alert.js.map +1 -1
- package/dist/components/cura-calendar.js +1 -1
- package/dist/components/cura-input-date.js +2 -2
- package/dist/components/cura-select.js +1 -1
- package/dist/components/{p-CvdWbsfO.js → p-Cs5scX1L.js} +71 -181
- package/dist/components/p-Cs5scX1L.js.map +1 -0
- package/dist/components/p-D1cPOZpG.js.map +1 -1
- package/dist/components/{p-DETZu2ie.js → p-D6PpdPRJ.js} +3 -3
- package/dist/components/{p-DETZu2ie.js.map → p-D6PpdPRJ.js.map} +1 -1
- package/dist/cura/cura-alert.entry.esm.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/{p-2ab58335.entry.js → p-6dfc7c02.entry.js} +2 -2
- package/dist/cura/p-6dfc7c02.entry.js.map +1 -0
- package/dist/cura/p-PPMZr_VE.js.map +1 -1
- package/dist/cura/p-bdfe9af2.entry.js +2 -0
- package/dist/cura/p-bdfe9af2.entry.js.map +1 -0
- package/dist/esm/cura-accordion_21.entry.js +69 -179
- package/dist/esm/cura-accordion_21.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +4 -3
- package/dist/esm/cura-alert.entry.js.map +1 -1
- package/dist/esm/index-OdKytJIH.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/p-CvdWbsfO.js.map +0 -1
- package/dist/cura/p-2ab58335.entry.js.map +0 -1
- package/dist/cura/p-6feba852.entry.js +0 -2
- package/dist/cura/p-6feba852.entry.js.map +0 -1
|
@@ -5567,9 +5567,8 @@ function getOppositeAxis(axis) {
|
|
|
5567
5567
|
function getAxisLength(axis) {
|
|
5568
5568
|
return axis === 'y' ? 'height' : 'width';
|
|
5569
5569
|
}
|
|
5570
|
-
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
5571
5570
|
function getSideAxis(placement) {
|
|
5572
|
-
return
|
|
5571
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
5573
5572
|
}
|
|
5574
5573
|
function getAlignmentAxis(placement) {
|
|
5575
5574
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -5594,19 +5593,19 @@ function getExpandedPlacements(placement) {
|
|
|
5594
5593
|
function getOppositeAlignmentPlacement(placement) {
|
|
5595
5594
|
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
5596
5595
|
}
|
|
5597
|
-
const lrPlacement = ['left', 'right'];
|
|
5598
|
-
const rlPlacement = ['right', 'left'];
|
|
5599
|
-
const tbPlacement = ['top', 'bottom'];
|
|
5600
|
-
const btPlacement = ['bottom', 'top'];
|
|
5601
5596
|
function getSideList(side, isStart, rtl) {
|
|
5597
|
+
const lr = ['left', 'right'];
|
|
5598
|
+
const rl = ['right', 'left'];
|
|
5599
|
+
const tb = ['top', 'bottom'];
|
|
5600
|
+
const bt = ['bottom', 'top'];
|
|
5602
5601
|
switch (side) {
|
|
5603
5602
|
case 'top':
|
|
5604
5603
|
case 'bottom':
|
|
5605
|
-
if (rtl) return isStart ?
|
|
5606
|
-
return isStart ?
|
|
5604
|
+
if (rtl) return isStart ? rl : lr;
|
|
5605
|
+
return isStart ? lr : rl;
|
|
5607
5606
|
case 'left':
|
|
5608
5607
|
case 'right':
|
|
5609
|
-
return isStart ?
|
|
5608
|
+
return isStart ? tb : bt;
|
|
5610
5609
|
default:
|
|
5611
5610
|
return [];
|
|
5612
5611
|
}
|
|
@@ -5944,22 +5943,16 @@ const flip$1 = function (options) {
|
|
|
5944
5943
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
5945
5944
|
const nextPlacement = placements[nextIndex];
|
|
5946
5945
|
if (nextPlacement) {
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
},
|
|
5958
|
-
reset: {
|
|
5959
|
-
placement: nextPlacement
|
|
5960
|
-
}
|
|
5961
|
-
};
|
|
5962
|
-
}
|
|
5946
|
+
// Try next placement and re-run the lifecycle.
|
|
5947
|
+
return {
|
|
5948
|
+
data: {
|
|
5949
|
+
index: nextIndex,
|
|
5950
|
+
overflows: overflowsData
|
|
5951
|
+
},
|
|
5952
|
+
reset: {
|
|
5953
|
+
placement: nextPlacement
|
|
5954
|
+
}
|
|
5955
|
+
};
|
|
5963
5956
|
}
|
|
5964
5957
|
|
|
5965
5958
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -6005,8 +5998,6 @@ const flip$1 = function (options) {
|
|
|
6005
5998
|
};
|
|
6006
5999
|
};
|
|
6007
6000
|
|
|
6008
|
-
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
6009
|
-
|
|
6010
6001
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
6011
6002
|
// Derivable.
|
|
6012
6003
|
|
|
@@ -6020,7 +6011,7 @@ async function convertValueToCoords(state, options) {
|
|
|
6020
6011
|
const side = getSide(placement);
|
|
6021
6012
|
const alignment = getAlignment(placement);
|
|
6022
6013
|
const isVertical = getSideAxis(placement) === 'y';
|
|
6023
|
-
const mainAxisMulti =
|
|
6014
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
6024
6015
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
6025
6016
|
const rawValue = evaluate(options, state);
|
|
6026
6017
|
|
|
@@ -6034,9 +6025,10 @@ async function convertValueToCoords(state, options) {
|
|
|
6034
6025
|
crossAxis: 0,
|
|
6035
6026
|
alignmentAxis: null
|
|
6036
6027
|
} : {
|
|
6037
|
-
mainAxis:
|
|
6038
|
-
crossAxis:
|
|
6039
|
-
alignmentAxis:
|
|
6028
|
+
mainAxis: 0,
|
|
6029
|
+
crossAxis: 0,
|
|
6030
|
+
alignmentAxis: null,
|
|
6031
|
+
...rawValue
|
|
6040
6032
|
};
|
|
6041
6033
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
6042
6034
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -6158,11 +6150,7 @@ const shift$1 = function (options) {
|
|
|
6158
6150
|
...limitedCoords,
|
|
6159
6151
|
data: {
|
|
6160
6152
|
x: limitedCoords.x - x,
|
|
6161
|
-
y: limitedCoords.y - y
|
|
6162
|
-
enabled: {
|
|
6163
|
-
[mainAxis]: checkMainAxis,
|
|
6164
|
-
[crossAxis]: checkCrossAxis
|
|
6165
|
-
}
|
|
6153
|
+
y: limitedCoords.y - y
|
|
6166
6154
|
}
|
|
6167
6155
|
};
|
|
6168
6156
|
}
|
|
@@ -6183,7 +6171,6 @@ const size$1 = function (options) {
|
|
|
6183
6171
|
name: 'size',
|
|
6184
6172
|
options,
|
|
6185
6173
|
async fn(state) {
|
|
6186
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
6187
6174
|
const {
|
|
6188
6175
|
placement,
|
|
6189
6176
|
rects,
|
|
@@ -6218,11 +6205,10 @@ const size$1 = function (options) {
|
|
|
6218
6205
|
const noShift = !state.middlewareData.shift;
|
|
6219
6206
|
let availableHeight = overflowAvailableHeight;
|
|
6220
6207
|
let availableWidth = overflowAvailableWidth;
|
|
6221
|
-
if (
|
|
6222
|
-
availableWidth = maximumClippingWidth;
|
|
6223
|
-
}
|
|
6224
|
-
|
|
6225
|
-
availableHeight = maximumClippingHeight;
|
|
6208
|
+
if (isYAxis) {
|
|
6209
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
6210
|
+
} else {
|
|
6211
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
6226
6212
|
}
|
|
6227
6213
|
if (noShift && !alignment) {
|
|
6228
6214
|
const xMin = max(overflow.left, 0);
|
|
@@ -6253,9 +6239,6 @@ const size$1 = function (options) {
|
|
|
6253
6239
|
};
|
|
6254
6240
|
};
|
|
6255
6241
|
|
|
6256
|
-
function hasWindow() {
|
|
6257
|
-
return typeof window !== 'undefined';
|
|
6258
|
-
}
|
|
6259
6242
|
function getNodeName(node) {
|
|
6260
6243
|
if (isNode(node)) {
|
|
6261
6244
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -6274,63 +6257,48 @@ function getDocumentElement(node) {
|
|
|
6274
6257
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
6275
6258
|
}
|
|
6276
6259
|
function isNode(value) {
|
|
6277
|
-
if (!hasWindow()) {
|
|
6278
|
-
return false;
|
|
6279
|
-
}
|
|
6280
6260
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
6281
6261
|
}
|
|
6282
6262
|
function isElement(value) {
|
|
6283
|
-
if (!hasWindow()) {
|
|
6284
|
-
return false;
|
|
6285
|
-
}
|
|
6286
6263
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
6287
6264
|
}
|
|
6288
6265
|
function isHTMLElement(value) {
|
|
6289
|
-
if (!hasWindow()) {
|
|
6290
|
-
return false;
|
|
6291
|
-
}
|
|
6292
6266
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
6293
6267
|
}
|
|
6294
6268
|
function isShadowRoot(value) {
|
|
6295
|
-
|
|
6269
|
+
// Browsers without `ShadowRoot` support.
|
|
6270
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
6296
6271
|
return false;
|
|
6297
6272
|
}
|
|
6298
6273
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
6299
6274
|
}
|
|
6300
|
-
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
6301
6275
|
function isOverflowElement(element) {
|
|
6302
6276
|
const {
|
|
6303
6277
|
overflow,
|
|
6304
6278
|
overflowX,
|
|
6305
6279
|
overflowY,
|
|
6306
6280
|
display
|
|
6307
|
-
} = getComputedStyle
|
|
6308
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !
|
|
6281
|
+
} = getComputedStyle(element);
|
|
6282
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
6309
6283
|
}
|
|
6310
|
-
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
6311
6284
|
function isTableElement(element) {
|
|
6312
|
-
return
|
|
6285
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
6313
6286
|
}
|
|
6314
|
-
const topLayerSelectors = [':popover-open', ':modal'];
|
|
6315
6287
|
function isTopLayer(element) {
|
|
6316
|
-
return
|
|
6288
|
+
return [':popover-open', ':modal'].some(selector => {
|
|
6317
6289
|
try {
|
|
6318
6290
|
return element.matches(selector);
|
|
6319
|
-
} catch (
|
|
6291
|
+
} catch (e) {
|
|
6320
6292
|
return false;
|
|
6321
6293
|
}
|
|
6322
6294
|
});
|
|
6323
6295
|
}
|
|
6324
|
-
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
6325
|
-
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
6326
|
-
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
6327
6296
|
function isContainingBlock(elementOrCss) {
|
|
6328
6297
|
const webkit = isWebKit();
|
|
6329
|
-
const css = isElement(elementOrCss) ? getComputedStyle
|
|
6298
|
+
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
6330
6299
|
|
|
6331
6300
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
6332
|
-
|
|
6333
|
-
return transformProperties.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) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
|
|
6301
|
+
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));
|
|
6334
6302
|
}
|
|
6335
6303
|
function getContainingBlock(element) {
|
|
6336
6304
|
let currentNode = getParentNode(element);
|
|
@@ -6348,11 +6316,10 @@ function isWebKit() {
|
|
|
6348
6316
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
6349
6317
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
6350
6318
|
}
|
|
6351
|
-
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
6352
6319
|
function isLastTraversableNode(node) {
|
|
6353
|
-
return
|
|
6320
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
6354
6321
|
}
|
|
6355
|
-
function getComputedStyle
|
|
6322
|
+
function getComputedStyle(element) {
|
|
6356
6323
|
return getWindow(element).getComputedStyle(element);
|
|
6357
6324
|
}
|
|
6358
6325
|
function getNodeScroll(element) {
|
|
@@ -6404,17 +6371,13 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
6404
6371
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
6405
6372
|
const win = getWindow(scrollableAncestor);
|
|
6406
6373
|
if (isBody) {
|
|
6407
|
-
|
|
6408
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
6374
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
6409
6375
|
}
|
|
6410
6376
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
6411
6377
|
}
|
|
6412
|
-
function getFrameElement(win) {
|
|
6413
|
-
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
6414
|
-
}
|
|
6415
6378
|
|
|
6416
6379
|
function getCssDimensions(element) {
|
|
6417
|
-
const css = getComputedStyle
|
|
6380
|
+
const css = getComputedStyle(element);
|
|
6418
6381
|
// In testing environments, the `width` and `height` properties are empty
|
|
6419
6382
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
6420
6383
|
let width = parseFloat(css.width) || 0;
|
|
@@ -6515,11 +6478,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
6515
6478
|
const win = getWindow(domElement);
|
|
6516
6479
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
6517
6480
|
let currentWin = win;
|
|
6518
|
-
let currentIFrame =
|
|
6481
|
+
let currentIFrame = currentWin.frameElement;
|
|
6519
6482
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
6520
6483
|
const iframeScale = getScale(currentIFrame);
|
|
6521
6484
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
6522
|
-
const css = getComputedStyle
|
|
6485
|
+
const css = getComputedStyle(currentIFrame);
|
|
6523
6486
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
6524
6487
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
6525
6488
|
x *= iframeScale.x;
|
|
@@ -6529,7 +6492,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
6529
6492
|
x += left;
|
|
6530
6493
|
y += top;
|
|
6531
6494
|
currentWin = getWindow(currentIFrame);
|
|
6532
|
-
currentIFrame =
|
|
6495
|
+
currentIFrame = currentWin.frameElement;
|
|
6533
6496
|
}
|
|
6534
6497
|
}
|
|
6535
6498
|
return rectToClientRect({
|
|
@@ -6540,26 +6503,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
6540
6503
|
});
|
|
6541
6504
|
}
|
|
6542
6505
|
|
|
6543
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
6544
|
-
// incorrect for RTL.
|
|
6545
|
-
function getWindowScrollBarX(element, rect) {
|
|
6546
|
-
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
6547
|
-
if (!rect) {
|
|
6548
|
-
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
6549
|
-
}
|
|
6550
|
-
return rect.left + leftScroll;
|
|
6551
|
-
}
|
|
6552
|
-
|
|
6553
|
-
function getHTMLOffset(documentElement, scroll) {
|
|
6554
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
6555
|
-
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
6556
|
-
const y = htmlRect.top + scroll.scrollTop;
|
|
6557
|
-
return {
|
|
6558
|
-
x,
|
|
6559
|
-
y
|
|
6560
|
-
};
|
|
6561
|
-
}
|
|
6562
|
-
|
|
6563
6506
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
6564
6507
|
let {
|
|
6565
6508
|
elements,
|
|
@@ -6591,12 +6534,11 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
6591
6534
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
6592
6535
|
}
|
|
6593
6536
|
}
|
|
6594
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
6595
6537
|
return {
|
|
6596
6538
|
width: rect.width * scale.x,
|
|
6597
6539
|
height: rect.height * scale.y,
|
|
6598
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x
|
|
6599
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
6540
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
6541
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
6600
6542
|
};
|
|
6601
6543
|
}
|
|
6602
6544
|
|
|
@@ -6604,6 +6546,12 @@ function getClientRects(element) {
|
|
|
6604
6546
|
return Array.from(element.getClientRects());
|
|
6605
6547
|
}
|
|
6606
6548
|
|
|
6549
|
+
function getWindowScrollBarX(element) {
|
|
6550
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
6551
|
+
// incorrect for RTL.
|
|
6552
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
6553
|
+
}
|
|
6554
|
+
|
|
6607
6555
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
6608
6556
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
6609
6557
|
function getDocumentRect(element) {
|
|
@@ -6614,7 +6562,7 @@ function getDocumentRect(element) {
|
|
|
6614
6562
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
6615
6563
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
6616
6564
|
const y = -scroll.scrollTop;
|
|
6617
|
-
if (getComputedStyle
|
|
6565
|
+
if (getComputedStyle(body).direction === 'rtl') {
|
|
6618
6566
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
6619
6567
|
}
|
|
6620
6568
|
return {
|
|
@@ -6625,10 +6573,6 @@ function getDocumentRect(element) {
|
|
|
6625
6573
|
};
|
|
6626
6574
|
}
|
|
6627
6575
|
|
|
6628
|
-
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
6629
|
-
// calculation is affected by unusual styles.
|
|
6630
|
-
// Most scrollbars leave 15-18px of space.
|
|
6631
|
-
const SCROLLBAR_MAX = 25;
|
|
6632
6576
|
function getViewportRect(element, strategy) {
|
|
6633
6577
|
const win = getWindow(element);
|
|
6634
6578
|
const html = getDocumentElement(element);
|
|
@@ -6646,24 +6590,6 @@ function getViewportRect(element, strategy) {
|
|
|
6646
6590
|
y = visualViewport.offsetTop;
|
|
6647
6591
|
}
|
|
6648
6592
|
}
|
|
6649
|
-
const windowScrollbarX = getWindowScrollBarX(html);
|
|
6650
|
-
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
6651
|
-
// visual width of the <html> but this is not considered in the size
|
|
6652
|
-
// of `html.clientWidth`.
|
|
6653
|
-
if (windowScrollbarX <= 0) {
|
|
6654
|
-
const doc = html.ownerDocument;
|
|
6655
|
-
const body = doc.body;
|
|
6656
|
-
const bodyStyles = getComputedStyle(body);
|
|
6657
|
-
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
6658
|
-
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
6659
|
-
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
6660
|
-
width -= clippingStableScrollbarWidth;
|
|
6661
|
-
}
|
|
6662
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
6663
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
6664
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
6665
|
-
width += windowScrollbarX;
|
|
6666
|
-
}
|
|
6667
6593
|
return {
|
|
6668
6594
|
width,
|
|
6669
6595
|
height,
|
|
@@ -6672,7 +6598,6 @@ function getViewportRect(element, strategy) {
|
|
|
6672
6598
|
};
|
|
6673
6599
|
}
|
|
6674
6600
|
|
|
6675
|
-
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
6676
6601
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
6677
6602
|
function getInnerBoundingClientRect(element, strategy) {
|
|
6678
6603
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
@@ -6701,10 +6626,9 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
6701
6626
|
} else {
|
|
6702
6627
|
const visualOffsets = getVisualOffsets(element);
|
|
6703
6628
|
rect = {
|
|
6629
|
+
...clippingAncestor,
|
|
6704
6630
|
x: clippingAncestor.x - visualOffsets.x,
|
|
6705
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
6706
|
-
width: clippingAncestor.width,
|
|
6707
|
-
height: clippingAncestor.height
|
|
6631
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
6708
6632
|
};
|
|
6709
6633
|
}
|
|
6710
6634
|
return rectToClientRect(rect);
|
|
@@ -6714,7 +6638,7 @@ function hasFixedPositionAncestor(element, stopNode) {
|
|
|
6714
6638
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
6715
6639
|
return false;
|
|
6716
6640
|
}
|
|
6717
|
-
return getComputedStyle
|
|
6641
|
+
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
6718
6642
|
}
|
|
6719
6643
|
|
|
6720
6644
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
@@ -6727,17 +6651,17 @@ function getClippingElementAncestors(element, cache) {
|
|
|
6727
6651
|
}
|
|
6728
6652
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
6729
6653
|
let currentContainingBlockComputedStyle = null;
|
|
6730
|
-
const elementIsFixed = getComputedStyle
|
|
6654
|
+
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
6731
6655
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
6732
6656
|
|
|
6733
6657
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
6734
6658
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
6735
|
-
const computedStyle = getComputedStyle
|
|
6659
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
6736
6660
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
6737
6661
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
6738
6662
|
currentContainingBlockComputedStyle = null;
|
|
6739
6663
|
}
|
|
6740
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle &&
|
|
6664
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
6741
6665
|
if (shouldDropCurrentNode) {
|
|
6742
6666
|
// Drop non-containing blocks.
|
|
6743
6667
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -6800,12 +6724,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
6800
6724
|
scrollTop: 0
|
|
6801
6725
|
};
|
|
6802
6726
|
const offsets = createCoords(0);
|
|
6803
|
-
|
|
6804
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
6805
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
6806
|
-
function setLeftRTLScrollbarOffset() {
|
|
6807
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
6808
|
-
}
|
|
6809
6727
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
6810
6728
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
6811
6729
|
scroll = getNodeScroll(offsetParent);
|
|
@@ -6815,15 +6733,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
6815
6733
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
6816
6734
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
6817
6735
|
} else if (documentElement) {
|
|
6818
|
-
|
|
6736
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
6819
6737
|
}
|
|
6820
6738
|
}
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
}
|
|
6824
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
6825
|
-
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
6826
|
-
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
6739
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
6740
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
6827
6741
|
return {
|
|
6828
6742
|
x,
|
|
6829
6743
|
y,
|
|
@@ -6833,26 +6747,17 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
6833
6747
|
}
|
|
6834
6748
|
|
|
6835
6749
|
function isStaticPositioned(element) {
|
|
6836
|
-
return getComputedStyle
|
|
6750
|
+
return getComputedStyle(element).position === 'static';
|
|
6837
6751
|
}
|
|
6838
6752
|
|
|
6839
6753
|
function getTrueOffsetParent(element, polyfill) {
|
|
6840
|
-
if (!isHTMLElement(element) || getComputedStyle
|
|
6754
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
6841
6755
|
return null;
|
|
6842
6756
|
}
|
|
6843
6757
|
if (polyfill) {
|
|
6844
6758
|
return polyfill(element);
|
|
6845
6759
|
}
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
6849
|
-
// while Chrome and Safari return the <body> element. The <body> element must
|
|
6850
|
-
// be used to perform the correct calculations even if the <html> element is
|
|
6851
|
-
// non-static.
|
|
6852
|
-
if (getDocumentElement(element) === rawOffsetParent) {
|
|
6853
|
-
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
6854
|
-
}
|
|
6855
|
-
return rawOffsetParent;
|
|
6760
|
+
return element.offsetParent;
|
|
6856
6761
|
}
|
|
6857
6762
|
|
|
6858
6763
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
@@ -6898,7 +6803,7 @@ const getElementRects = async function (data) {
|
|
|
6898
6803
|
};
|
|
6899
6804
|
|
|
6900
6805
|
function isRTL(element) {
|
|
6901
|
-
return getComputedStyle
|
|
6806
|
+
return getComputedStyle(element).direction === 'rtl';
|
|
6902
6807
|
}
|
|
6903
6808
|
|
|
6904
6809
|
const platform = {
|
|
@@ -6914,10 +6819,6 @@ const platform = {
|
|
|
6914
6819
|
isRTL
|
|
6915
6820
|
};
|
|
6916
6821
|
|
|
6917
|
-
function rectsAreEqual(a, b) {
|
|
6918
|
-
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
6919
|
-
}
|
|
6920
|
-
|
|
6921
6822
|
// https://samthor.au/2021/observing-dom/
|
|
6922
6823
|
function observeMove(element, onMove) {
|
|
6923
6824
|
let io = null;
|
|
@@ -6937,13 +6838,12 @@ function observeMove(element, onMove) {
|
|
|
6937
6838
|
threshold = 1;
|
|
6938
6839
|
}
|
|
6939
6840
|
cleanup();
|
|
6940
|
-
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
6941
6841
|
const {
|
|
6942
6842
|
left,
|
|
6943
6843
|
top,
|
|
6944
6844
|
width,
|
|
6945
6845
|
height
|
|
6946
|
-
} =
|
|
6846
|
+
} = element.getBoundingClientRect();
|
|
6947
6847
|
if (!skip) {
|
|
6948
6848
|
onMove();
|
|
6949
6849
|
}
|
|
@@ -6976,16 +6876,6 @@ function observeMove(element, onMove) {
|
|
|
6976
6876
|
refresh(false, ratio);
|
|
6977
6877
|
}
|
|
6978
6878
|
}
|
|
6979
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
6980
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
6981
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
6982
|
-
// area anymore. This can happen under performance constraints. This may
|
|
6983
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
6984
|
-
// work around this, we compare the element's bounding rect now with
|
|
6985
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
6986
|
-
// are not equal then the element moved, so we refresh.
|
|
6987
|
-
refresh();
|
|
6988
|
-
}
|
|
6989
6879
|
isFirstUpdate = false;
|
|
6990
6880
|
}
|
|
6991
6881
|
|
|
@@ -6997,7 +6887,7 @@ function observeMove(element, onMove) {
|
|
|
6997
6887
|
// Handle <iframe>s
|
|
6998
6888
|
root: root.ownerDocument
|
|
6999
6889
|
});
|
|
7000
|
-
} catch (
|
|
6890
|
+
} catch (e) {
|
|
7001
6891
|
io = new IntersectionObserver(handleObserve, options);
|
|
7002
6892
|
}
|
|
7003
6893
|
io.observe(element);
|
|
@@ -7063,7 +6953,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
7063
6953
|
}
|
|
7064
6954
|
function frameLoop() {
|
|
7065
6955
|
const nextRefRect = getBoundingClientRect(reference);
|
|
7066
|
-
if (prevRefRect &&
|
|
6956
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
7067
6957
|
update();
|
|
7068
6958
|
}
|
|
7069
6959
|
prevRefRect = nextRefRect;
|