@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
|
@@ -43,9 +43,8 @@ function getOppositeAxis(axis) {
|
|
|
43
43
|
function getAxisLength(axis) {
|
|
44
44
|
return axis === 'y' ? 'height' : 'width';
|
|
45
45
|
}
|
|
46
|
-
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
47
46
|
function getSideAxis(placement) {
|
|
48
|
-
return
|
|
47
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
49
48
|
}
|
|
50
49
|
function getAlignmentAxis(placement) {
|
|
51
50
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -70,19 +69,19 @@ function getExpandedPlacements(placement) {
|
|
|
70
69
|
function getOppositeAlignmentPlacement(placement) {
|
|
71
70
|
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
72
71
|
}
|
|
73
|
-
const lrPlacement = ['left', 'right'];
|
|
74
|
-
const rlPlacement = ['right', 'left'];
|
|
75
|
-
const tbPlacement = ['top', 'bottom'];
|
|
76
|
-
const btPlacement = ['bottom', 'top'];
|
|
77
72
|
function getSideList(side, isStart, rtl) {
|
|
73
|
+
const lr = ['left', 'right'];
|
|
74
|
+
const rl = ['right', 'left'];
|
|
75
|
+
const tb = ['top', 'bottom'];
|
|
76
|
+
const bt = ['bottom', 'top'];
|
|
78
77
|
switch (side) {
|
|
79
78
|
case 'top':
|
|
80
79
|
case 'bottom':
|
|
81
|
-
if (rtl) return isStart ?
|
|
82
|
-
return isStart ?
|
|
80
|
+
if (rtl) return isStart ? rl : lr;
|
|
81
|
+
return isStart ? lr : rl;
|
|
83
82
|
case 'left':
|
|
84
83
|
case 'right':
|
|
85
|
-
return isStart ?
|
|
84
|
+
return isStart ? tb : bt;
|
|
86
85
|
default:
|
|
87
86
|
return [];
|
|
88
87
|
}
|
|
@@ -420,22 +419,16 @@ const flip$1 = function (options) {
|
|
|
420
419
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
421
420
|
const nextPlacement = placements[nextIndex];
|
|
422
421
|
if (nextPlacement) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
reset: {
|
|
435
|
-
placement: nextPlacement
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
|
-
}
|
|
422
|
+
// Try next placement and re-run the lifecycle.
|
|
423
|
+
return {
|
|
424
|
+
data: {
|
|
425
|
+
index: nextIndex,
|
|
426
|
+
overflows: overflowsData
|
|
427
|
+
},
|
|
428
|
+
reset: {
|
|
429
|
+
placement: nextPlacement
|
|
430
|
+
}
|
|
431
|
+
};
|
|
439
432
|
}
|
|
440
433
|
|
|
441
434
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -481,8 +474,6 @@ const flip$1 = function (options) {
|
|
|
481
474
|
};
|
|
482
475
|
};
|
|
483
476
|
|
|
484
|
-
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
485
|
-
|
|
486
477
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
487
478
|
// Derivable.
|
|
488
479
|
|
|
@@ -496,7 +487,7 @@ async function convertValueToCoords(state, options) {
|
|
|
496
487
|
const side = getSide(placement);
|
|
497
488
|
const alignment = getAlignment(placement);
|
|
498
489
|
const isVertical = getSideAxis(placement) === 'y';
|
|
499
|
-
const mainAxisMulti =
|
|
490
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
500
491
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
501
492
|
const rawValue = evaluate(options, state);
|
|
502
493
|
|
|
@@ -510,9 +501,10 @@ async function convertValueToCoords(state, options) {
|
|
|
510
501
|
crossAxis: 0,
|
|
511
502
|
alignmentAxis: null
|
|
512
503
|
} : {
|
|
513
|
-
mainAxis:
|
|
514
|
-
crossAxis:
|
|
515
|
-
alignmentAxis:
|
|
504
|
+
mainAxis: 0,
|
|
505
|
+
crossAxis: 0,
|
|
506
|
+
alignmentAxis: null,
|
|
507
|
+
...rawValue
|
|
516
508
|
};
|
|
517
509
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
518
510
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -634,11 +626,7 @@ const shift$1 = function (options) {
|
|
|
634
626
|
...limitedCoords,
|
|
635
627
|
data: {
|
|
636
628
|
x: limitedCoords.x - x,
|
|
637
|
-
y: limitedCoords.y - y
|
|
638
|
-
enabled: {
|
|
639
|
-
[mainAxis]: checkMainAxis,
|
|
640
|
-
[crossAxis]: checkCrossAxis
|
|
641
|
-
}
|
|
629
|
+
y: limitedCoords.y - y
|
|
642
630
|
}
|
|
643
631
|
};
|
|
644
632
|
}
|
|
@@ -659,7 +647,6 @@ const size$1 = function (options) {
|
|
|
659
647
|
name: 'size',
|
|
660
648
|
options,
|
|
661
649
|
async fn(state) {
|
|
662
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
663
650
|
const {
|
|
664
651
|
placement,
|
|
665
652
|
rects,
|
|
@@ -694,11 +681,10 @@ const size$1 = function (options) {
|
|
|
694
681
|
const noShift = !state.middlewareData.shift;
|
|
695
682
|
let availableHeight = overflowAvailableHeight;
|
|
696
683
|
let availableWidth = overflowAvailableWidth;
|
|
697
|
-
if (
|
|
698
|
-
availableWidth = maximumClippingWidth;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
availableHeight = maximumClippingHeight;
|
|
684
|
+
if (isYAxis) {
|
|
685
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
686
|
+
} else {
|
|
687
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
702
688
|
}
|
|
703
689
|
if (noShift && !alignment) {
|
|
704
690
|
const xMin = max(overflow.left, 0);
|
|
@@ -729,9 +715,6 @@ const size$1 = function (options) {
|
|
|
729
715
|
};
|
|
730
716
|
};
|
|
731
717
|
|
|
732
|
-
function hasWindow() {
|
|
733
|
-
return typeof window !== 'undefined';
|
|
734
|
-
}
|
|
735
718
|
function getNodeName(node) {
|
|
736
719
|
if (isNode(node)) {
|
|
737
720
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -750,63 +733,48 @@ function getDocumentElement(node) {
|
|
|
750
733
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
751
734
|
}
|
|
752
735
|
function isNode(value) {
|
|
753
|
-
if (!hasWindow()) {
|
|
754
|
-
return false;
|
|
755
|
-
}
|
|
756
736
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
757
737
|
}
|
|
758
738
|
function isElement(value) {
|
|
759
|
-
if (!hasWindow()) {
|
|
760
|
-
return false;
|
|
761
|
-
}
|
|
762
739
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
763
740
|
}
|
|
764
741
|
function isHTMLElement(value) {
|
|
765
|
-
if (!hasWindow()) {
|
|
766
|
-
return false;
|
|
767
|
-
}
|
|
768
742
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
769
743
|
}
|
|
770
744
|
function isShadowRoot(value) {
|
|
771
|
-
|
|
745
|
+
// Browsers without `ShadowRoot` support.
|
|
746
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
772
747
|
return false;
|
|
773
748
|
}
|
|
774
749
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
775
750
|
}
|
|
776
|
-
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
777
751
|
function isOverflowElement(element) {
|
|
778
752
|
const {
|
|
779
753
|
overflow,
|
|
780
754
|
overflowX,
|
|
781
755
|
overflowY,
|
|
782
756
|
display
|
|
783
|
-
} = getComputedStyle
|
|
784
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !
|
|
757
|
+
} = getComputedStyle(element);
|
|
758
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
785
759
|
}
|
|
786
|
-
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
787
760
|
function isTableElement(element) {
|
|
788
|
-
return
|
|
761
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
789
762
|
}
|
|
790
|
-
const topLayerSelectors = [':popover-open', ':modal'];
|
|
791
763
|
function isTopLayer(element) {
|
|
792
|
-
return
|
|
764
|
+
return [':popover-open', ':modal'].some(selector => {
|
|
793
765
|
try {
|
|
794
766
|
return element.matches(selector);
|
|
795
|
-
} catch (
|
|
767
|
+
} catch (e) {
|
|
796
768
|
return false;
|
|
797
769
|
}
|
|
798
770
|
});
|
|
799
771
|
}
|
|
800
|
-
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
801
|
-
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
802
|
-
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
803
772
|
function isContainingBlock(elementOrCss) {
|
|
804
773
|
const webkit = isWebKit();
|
|
805
|
-
const css = isElement(elementOrCss) ? getComputedStyle
|
|
774
|
+
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
806
775
|
|
|
807
776
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
808
|
-
|
|
809
|
-
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));
|
|
777
|
+
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));
|
|
810
778
|
}
|
|
811
779
|
function getContainingBlock(element) {
|
|
812
780
|
let currentNode = getParentNode(element);
|
|
@@ -824,11 +792,10 @@ function isWebKit() {
|
|
|
824
792
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
825
793
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
826
794
|
}
|
|
827
|
-
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
828
795
|
function isLastTraversableNode(node) {
|
|
829
|
-
return
|
|
796
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
830
797
|
}
|
|
831
|
-
function getComputedStyle
|
|
798
|
+
function getComputedStyle(element) {
|
|
832
799
|
return getWindow(element).getComputedStyle(element);
|
|
833
800
|
}
|
|
834
801
|
function getNodeScroll(element) {
|
|
@@ -880,17 +847,13 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
880
847
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
881
848
|
const win = getWindow(scrollableAncestor);
|
|
882
849
|
if (isBody) {
|
|
883
|
-
|
|
884
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
850
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
885
851
|
}
|
|
886
852
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
887
853
|
}
|
|
888
|
-
function getFrameElement(win) {
|
|
889
|
-
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
890
|
-
}
|
|
891
854
|
|
|
892
855
|
function getCssDimensions(element) {
|
|
893
|
-
const css = getComputedStyle
|
|
856
|
+
const css = getComputedStyle(element);
|
|
894
857
|
// In testing environments, the `width` and `height` properties are empty
|
|
895
858
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
896
859
|
let width = parseFloat(css.width) || 0;
|
|
@@ -991,11 +954,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
991
954
|
const win = getWindow(domElement);
|
|
992
955
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
993
956
|
let currentWin = win;
|
|
994
|
-
let currentIFrame =
|
|
957
|
+
let currentIFrame = currentWin.frameElement;
|
|
995
958
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
996
959
|
const iframeScale = getScale(currentIFrame);
|
|
997
960
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
998
|
-
const css = getComputedStyle
|
|
961
|
+
const css = getComputedStyle(currentIFrame);
|
|
999
962
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1000
963
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1001
964
|
x *= iframeScale.x;
|
|
@@ -1005,7 +968,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1005
968
|
x += left;
|
|
1006
969
|
y += top;
|
|
1007
970
|
currentWin = getWindow(currentIFrame);
|
|
1008
|
-
currentIFrame =
|
|
971
|
+
currentIFrame = currentWin.frameElement;
|
|
1009
972
|
}
|
|
1010
973
|
}
|
|
1011
974
|
return rectToClientRect({
|
|
@@ -1016,26 +979,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1016
979
|
});
|
|
1017
980
|
}
|
|
1018
981
|
|
|
1019
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1020
|
-
// incorrect for RTL.
|
|
1021
|
-
function getWindowScrollBarX(element, rect) {
|
|
1022
|
-
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1023
|
-
if (!rect) {
|
|
1024
|
-
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1025
|
-
}
|
|
1026
|
-
return rect.left + leftScroll;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
function getHTMLOffset(documentElement, scroll) {
|
|
1030
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
1031
|
-
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1032
|
-
const y = htmlRect.top + scroll.scrollTop;
|
|
1033
|
-
return {
|
|
1034
|
-
x,
|
|
1035
|
-
y
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
982
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1040
983
|
let {
|
|
1041
984
|
elements,
|
|
@@ -1067,12 +1010,11 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1067
1010
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1068
1011
|
}
|
|
1069
1012
|
}
|
|
1070
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1071
1013
|
return {
|
|
1072
1014
|
width: rect.width * scale.x,
|
|
1073
1015
|
height: rect.height * scale.y,
|
|
1074
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x
|
|
1075
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1016
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1017
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1076
1018
|
};
|
|
1077
1019
|
}
|
|
1078
1020
|
|
|
@@ -1080,6 +1022,12 @@ function getClientRects(element) {
|
|
|
1080
1022
|
return Array.from(element.getClientRects());
|
|
1081
1023
|
}
|
|
1082
1024
|
|
|
1025
|
+
function getWindowScrollBarX(element) {
|
|
1026
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1027
|
+
// incorrect for RTL.
|
|
1028
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1083
1031
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
1084
1032
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1085
1033
|
function getDocumentRect(element) {
|
|
@@ -1090,7 +1038,7 @@ function getDocumentRect(element) {
|
|
|
1090
1038
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1091
1039
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1092
1040
|
const y = -scroll.scrollTop;
|
|
1093
|
-
if (getComputedStyle
|
|
1041
|
+
if (getComputedStyle(body).direction === 'rtl') {
|
|
1094
1042
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1095
1043
|
}
|
|
1096
1044
|
return {
|
|
@@ -1101,10 +1049,6 @@ function getDocumentRect(element) {
|
|
|
1101
1049
|
};
|
|
1102
1050
|
}
|
|
1103
1051
|
|
|
1104
|
-
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
1105
|
-
// calculation is affected by unusual styles.
|
|
1106
|
-
// Most scrollbars leave 15-18px of space.
|
|
1107
|
-
const SCROLLBAR_MAX = 25;
|
|
1108
1052
|
function getViewportRect(element, strategy) {
|
|
1109
1053
|
const win = getWindow(element);
|
|
1110
1054
|
const html = getDocumentElement(element);
|
|
@@ -1122,24 +1066,6 @@ function getViewportRect(element, strategy) {
|
|
|
1122
1066
|
y = visualViewport.offsetTop;
|
|
1123
1067
|
}
|
|
1124
1068
|
}
|
|
1125
|
-
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1126
|
-
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1127
|
-
// visual width of the <html> but this is not considered in the size
|
|
1128
|
-
// of `html.clientWidth`.
|
|
1129
|
-
if (windowScrollbarX <= 0) {
|
|
1130
|
-
const doc = html.ownerDocument;
|
|
1131
|
-
const body = doc.body;
|
|
1132
|
-
const bodyStyles = getComputedStyle(body);
|
|
1133
|
-
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1134
|
-
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1135
|
-
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1136
|
-
width -= clippingStableScrollbarWidth;
|
|
1137
|
-
}
|
|
1138
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1139
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1140
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
1141
|
-
width += windowScrollbarX;
|
|
1142
|
-
}
|
|
1143
1069
|
return {
|
|
1144
1070
|
width,
|
|
1145
1071
|
height,
|
|
@@ -1148,7 +1074,6 @@ function getViewportRect(element, strategy) {
|
|
|
1148
1074
|
};
|
|
1149
1075
|
}
|
|
1150
1076
|
|
|
1151
|
-
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
1152
1077
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1153
1078
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1154
1079
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
@@ -1177,10 +1102,9 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1177
1102
|
} else {
|
|
1178
1103
|
const visualOffsets = getVisualOffsets(element);
|
|
1179
1104
|
rect = {
|
|
1105
|
+
...clippingAncestor,
|
|
1180
1106
|
x: clippingAncestor.x - visualOffsets.x,
|
|
1181
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
1182
|
-
width: clippingAncestor.width,
|
|
1183
|
-
height: clippingAncestor.height
|
|
1107
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
1184
1108
|
};
|
|
1185
1109
|
}
|
|
1186
1110
|
return rectToClientRect(rect);
|
|
@@ -1190,7 +1114,7 @@ function hasFixedPositionAncestor(element, stopNode) {
|
|
|
1190
1114
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1191
1115
|
return false;
|
|
1192
1116
|
}
|
|
1193
|
-
return getComputedStyle
|
|
1117
|
+
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1194
1118
|
}
|
|
1195
1119
|
|
|
1196
1120
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
@@ -1203,17 +1127,17 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1203
1127
|
}
|
|
1204
1128
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1205
1129
|
let currentContainingBlockComputedStyle = null;
|
|
1206
|
-
const elementIsFixed = getComputedStyle
|
|
1130
|
+
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
1207
1131
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1208
1132
|
|
|
1209
1133
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1210
1134
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1211
|
-
const computedStyle = getComputedStyle
|
|
1135
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
1212
1136
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1213
1137
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1214
1138
|
currentContainingBlockComputedStyle = null;
|
|
1215
1139
|
}
|
|
1216
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle &&
|
|
1140
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1217
1141
|
if (shouldDropCurrentNode) {
|
|
1218
1142
|
// Drop non-containing blocks.
|
|
1219
1143
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -1276,12 +1200,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1276
1200
|
scrollTop: 0
|
|
1277
1201
|
};
|
|
1278
1202
|
const offsets = createCoords(0);
|
|
1279
|
-
|
|
1280
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1281
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1282
|
-
function setLeftRTLScrollbarOffset() {
|
|
1283
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1284
|
-
}
|
|
1285
1203
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1286
1204
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1287
1205
|
scroll = getNodeScroll(offsetParent);
|
|
@@ -1291,15 +1209,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1291
1209
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1292
1210
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1293
1211
|
} else if (documentElement) {
|
|
1294
|
-
|
|
1212
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1295
1213
|
}
|
|
1296
1214
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
}
|
|
1300
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1301
|
-
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1302
|
-
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1215
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
1216
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
1303
1217
|
return {
|
|
1304
1218
|
x,
|
|
1305
1219
|
y,
|
|
@@ -1309,26 +1223,17 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1309
1223
|
}
|
|
1310
1224
|
|
|
1311
1225
|
function isStaticPositioned(element) {
|
|
1312
|
-
return getComputedStyle
|
|
1226
|
+
return getComputedStyle(element).position === 'static';
|
|
1313
1227
|
}
|
|
1314
1228
|
|
|
1315
1229
|
function getTrueOffsetParent(element, polyfill) {
|
|
1316
|
-
if (!isHTMLElement(element) || getComputedStyle
|
|
1230
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1317
1231
|
return null;
|
|
1318
1232
|
}
|
|
1319
1233
|
if (polyfill) {
|
|
1320
1234
|
return polyfill(element);
|
|
1321
1235
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1325
|
-
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1326
|
-
// be used to perform the correct calculations even if the <html> element is
|
|
1327
|
-
// non-static.
|
|
1328
|
-
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1329
|
-
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1330
|
-
}
|
|
1331
|
-
return rawOffsetParent;
|
|
1236
|
+
return element.offsetParent;
|
|
1332
1237
|
}
|
|
1333
1238
|
|
|
1334
1239
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
@@ -1374,7 +1279,7 @@ const getElementRects = async function (data) {
|
|
|
1374
1279
|
};
|
|
1375
1280
|
|
|
1376
1281
|
function isRTL(element) {
|
|
1377
|
-
return getComputedStyle
|
|
1282
|
+
return getComputedStyle(element).direction === 'rtl';
|
|
1378
1283
|
}
|
|
1379
1284
|
|
|
1380
1285
|
const platform = {
|
|
@@ -1390,10 +1295,6 @@ const platform = {
|
|
|
1390
1295
|
isRTL
|
|
1391
1296
|
};
|
|
1392
1297
|
|
|
1393
|
-
function rectsAreEqual(a, b) {
|
|
1394
|
-
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
1298
|
// https://samthor.au/2021/observing-dom/
|
|
1398
1299
|
function observeMove(element, onMove) {
|
|
1399
1300
|
let io = null;
|
|
@@ -1413,13 +1314,12 @@ function observeMove(element, onMove) {
|
|
|
1413
1314
|
threshold = 1;
|
|
1414
1315
|
}
|
|
1415
1316
|
cleanup();
|
|
1416
|
-
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1417
1317
|
const {
|
|
1418
1318
|
left,
|
|
1419
1319
|
top,
|
|
1420
1320
|
width,
|
|
1421
1321
|
height
|
|
1422
|
-
} =
|
|
1322
|
+
} = element.getBoundingClientRect();
|
|
1423
1323
|
if (!skip) {
|
|
1424
1324
|
onMove();
|
|
1425
1325
|
}
|
|
@@ -1452,16 +1352,6 @@ function observeMove(element, onMove) {
|
|
|
1452
1352
|
refresh(false, ratio);
|
|
1453
1353
|
}
|
|
1454
1354
|
}
|
|
1455
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1456
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
1457
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
1458
|
-
// area anymore. This can happen under performance constraints. This may
|
|
1459
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1460
|
-
// work around this, we compare the element's bounding rect now with
|
|
1461
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
1462
|
-
// are not equal then the element moved, so we refresh.
|
|
1463
|
-
refresh();
|
|
1464
|
-
}
|
|
1465
1355
|
isFirstUpdate = false;
|
|
1466
1356
|
}
|
|
1467
1357
|
|
|
@@ -1473,7 +1363,7 @@ function observeMove(element, onMove) {
|
|
|
1473
1363
|
// Handle <iframe>s
|
|
1474
1364
|
root: root.ownerDocument
|
|
1475
1365
|
});
|
|
1476
|
-
} catch (
|
|
1366
|
+
} catch (e) {
|
|
1477
1367
|
io = new IntersectionObserver(handleObserve, options);
|
|
1478
1368
|
}
|
|
1479
1369
|
io.observe(element);
|
|
@@ -1539,7 +1429,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1539
1429
|
}
|
|
1540
1430
|
function frameLoop() {
|
|
1541
1431
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1542
|
-
if (prevRefRect &&
|
|
1432
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1543
1433
|
update();
|
|
1544
1434
|
}
|
|
1545
1435
|
prevRefRect = nextRefRect;
|
|
@@ -2142,6 +2032,6 @@ function defineCustomElement() {
|
|
|
2142
2032
|
}
|
|
2143
2033
|
|
|
2144
2034
|
export { CuraSelect as C, defineCustomElement as d };
|
|
2145
|
-
//# sourceMappingURL=p-
|
|
2035
|
+
//# sourceMappingURL=p-Cs5scX1L.js.map
|
|
2146
2036
|
|
|
2147
|
-
//# sourceMappingURL=p-
|
|
2037
|
+
//# sourceMappingURL=p-Cs5scX1L.js.map
|