vrembem 1.37.0 → 1.40.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/dev/scripts.esm.js +176 -89
- package/dev/scripts.esm.js.map +1 -1
- package/dev/scripts.js +176 -89
- package/dev/scripts.js.map +1 -1
- package/dev/scripts.modern.js +172 -89
- package/dev/scripts.modern.js.map +1 -1
- package/dev/scripts.umd.js +176 -89
- package/dev/scripts.umd.js.map +1 -1
- package/dev/styles.css +47 -196
- package/dev/styles.css.map +1 -1
- package/dist/scripts.esm.js +1 -1
- package/dist/scripts.esm.js.map +1 -1
- package/dist/scripts.js +1 -1
- package/dist/scripts.js.map +1 -1
- package/dist/scripts.modern.js +1 -1
- package/dist/scripts.modern.js.map +1 -1
- package/dist/scripts.umd.js +1 -1
- package/dist/scripts.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/index.scss +0 -1
- package/package.json +26 -27
package/dev/scripts.js
CHANGED
|
@@ -351,14 +351,6 @@ var closeTransition = function closeTransition(el, settings) {
|
|
|
351
351
|
});
|
|
352
352
|
};
|
|
353
353
|
|
|
354
|
-
var breakpoints = {
|
|
355
|
-
xs: '480px',
|
|
356
|
-
sm: '620px',
|
|
357
|
-
md: '760px',
|
|
358
|
-
lg: '990px',
|
|
359
|
-
xl: '1380px'
|
|
360
|
-
};
|
|
361
|
-
|
|
362
354
|
var index = {
|
|
363
355
|
__proto__: null,
|
|
364
356
|
setInert: setInert,
|
|
@@ -376,8 +368,7 @@ var index = {
|
|
|
376
368
|
removeClass: removeClass,
|
|
377
369
|
toggleClass: toggleClass,
|
|
378
370
|
openTransition: openTransition,
|
|
379
|
-
closeTransition: closeTransition
|
|
380
|
-
breakpoints: breakpoints
|
|
371
|
+
closeTransition: closeTransition
|
|
381
372
|
};
|
|
382
373
|
|
|
383
374
|
function _extends() {
|
|
@@ -495,7 +486,7 @@ var defaults$2 = {
|
|
|
495
486
|
selectorInert: null,
|
|
496
487
|
selectorOverflow: null,
|
|
497
488
|
// Feature toggles
|
|
498
|
-
breakpoints:
|
|
489
|
+
breakpoints: null,
|
|
499
490
|
customEventPrefix: 'drawer:',
|
|
500
491
|
eventListeners: true,
|
|
501
492
|
stateSave: true,
|
|
@@ -557,6 +548,7 @@ var Breakpoint = /*#__PURE__*/function () {
|
|
|
557
548
|
function Breakpoint(parent) {
|
|
558
549
|
this.mediaQueryLists = [];
|
|
559
550
|
this.parent = parent;
|
|
551
|
+
this.prefix = this.getVariablePrefix();
|
|
560
552
|
this.__check = this.check.bind(this);
|
|
561
553
|
}
|
|
562
554
|
|
|
@@ -569,7 +561,9 @@ var Breakpoint = /*#__PURE__*/function () {
|
|
|
569
561
|
drawers.forEach(function (drawer) {
|
|
570
562
|
var id = drawer.getAttribute("data-" + _this.parent.settings.dataDrawer);
|
|
571
563
|
var key = drawer.getAttribute("data-" + _this.parent.settings.dataBreakpoint);
|
|
572
|
-
|
|
564
|
+
|
|
565
|
+
var bp = _this.getBreakpoint(key);
|
|
566
|
+
|
|
573
567
|
var mql = window.matchMedia('(min-width:' + bp + ')');
|
|
574
568
|
|
|
575
569
|
_this.match(mql, drawer);
|
|
@@ -625,6 +619,25 @@ var Breakpoint = /*#__PURE__*/function () {
|
|
|
625
619
|
}
|
|
626
620
|
};
|
|
627
621
|
|
|
622
|
+
_proto.getBreakpoint = function getBreakpoint(key) {
|
|
623
|
+
var breakpoint = key;
|
|
624
|
+
|
|
625
|
+
if (this.parent.settings.breakpoints && this.parent.settings.breakpoints[key]) {
|
|
626
|
+
breakpoint = this.parent.settings.breakpoints[key];
|
|
627
|
+
} else if (getComputedStyle(document.body).getPropertyValue(this.prefix + key)) {
|
|
628
|
+
breakpoint = getComputedStyle(document.body).getPropertyValue(this.prefix + key);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return breakpoint;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
_proto.getVariablePrefix = function getVariablePrefix() {
|
|
635
|
+
var prefix = '--';
|
|
636
|
+
prefix += getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix');
|
|
637
|
+
prefix += 'breakpoint-';
|
|
638
|
+
return prefix;
|
|
639
|
+
};
|
|
640
|
+
|
|
628
641
|
return Breakpoint;
|
|
629
642
|
}();
|
|
630
643
|
|
|
@@ -1255,7 +1268,12 @@ function hide$2(popover, obj) {
|
|
|
1255
1268
|
var index = obj.collection.findIndex(function (item) {
|
|
1256
1269
|
return item.target === popover.target;
|
|
1257
1270
|
});
|
|
1258
|
-
obj.collection[index].state = 'hide'; //
|
|
1271
|
+
obj.collection[index].state = 'hide'; // Clear the memory if popover trigger matches the ones saved in memory
|
|
1272
|
+
|
|
1273
|
+
if (popover.trigger === obj.memory.trigger) {
|
|
1274
|
+
obj.memory.trigger = null;
|
|
1275
|
+
} // Return the popover
|
|
1276
|
+
|
|
1259
1277
|
|
|
1260
1278
|
return popover;
|
|
1261
1279
|
}
|
|
@@ -1269,7 +1287,9 @@ function hideAll(obj) {
|
|
|
1269
1287
|
return obj.collection;
|
|
1270
1288
|
}
|
|
1271
1289
|
function hideCheck(popover, obj) {
|
|
1272
|
-
//
|
|
1290
|
+
// Only run hideCheck if provided popover is currently open
|
|
1291
|
+
if (popover.state != 'show') return; // Needed to correctly check which element is currently being focused
|
|
1292
|
+
|
|
1273
1293
|
setTimeout(function () {
|
|
1274
1294
|
// Check if trigger or target are being hovered
|
|
1275
1295
|
var isHovered = popover.target.closest(':hover') === popover.target || popover.trigger.closest(':hover') === popover.trigger; // Check if trigger or target are being focused
|
|
@@ -1301,7 +1321,8 @@ function getConfig(el, settings) {
|
|
|
1301
1321
|
|
|
1302
1322
|
for (var prop in config) {
|
|
1303
1323
|
// Get the CSS variable property values
|
|
1304
|
-
var
|
|
1324
|
+
var prefix = getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix');
|
|
1325
|
+
var val = styles.getPropertyValue("--" + prefix + "popover-" + prop).trim(); // If a value was found, replace the default in config obj
|
|
1305
1326
|
|
|
1306
1327
|
if (val) {
|
|
1307
1328
|
config[prop] = val;
|
|
@@ -1438,13 +1459,31 @@ function handlerClick(popover) {
|
|
|
1438
1459
|
if (popover.target.classList.contains(this.settings.stateActive)) {
|
|
1439
1460
|
hide$2(popover, this);
|
|
1440
1461
|
} else {
|
|
1462
|
+
this.memory.trigger = popover.trigger;
|
|
1441
1463
|
show(popover, this);
|
|
1442
1464
|
documentClick(popover, this);
|
|
1443
1465
|
}
|
|
1444
1466
|
}
|
|
1445
1467
|
function handlerKeydown(event) {
|
|
1446
|
-
|
|
1447
|
-
|
|
1468
|
+
var _this = this;
|
|
1469
|
+
|
|
1470
|
+
switch (event.key) {
|
|
1471
|
+
case 'Escape':
|
|
1472
|
+
if (this.memory.trigger) {
|
|
1473
|
+
this.memory.trigger.focus();
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
hideAll(this);
|
|
1477
|
+
return;
|
|
1478
|
+
|
|
1479
|
+
case 'Tab':
|
|
1480
|
+
this.collection.forEach(function (popover) {
|
|
1481
|
+
hideCheck(popover, _this);
|
|
1482
|
+
});
|
|
1483
|
+
return;
|
|
1484
|
+
|
|
1485
|
+
default:
|
|
1486
|
+
return;
|
|
1448
1487
|
}
|
|
1449
1488
|
}
|
|
1450
1489
|
function documentClick(popover, obj) {
|
|
@@ -1622,29 +1661,32 @@ function getBasePlacement(placement) {
|
|
|
1622
1661
|
return placement.split('-')[0];
|
|
1623
1662
|
}
|
|
1624
1663
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1664
|
+
var max = Math.max;
|
|
1665
|
+
var min = Math.min;
|
|
1666
|
+
var round = Math.round;
|
|
1667
|
+
|
|
1668
|
+
function getBoundingClientRect(element, includeScale) {
|
|
1669
|
+
if (includeScale === void 0) {
|
|
1670
|
+
includeScale = false;
|
|
1671
|
+
}
|
|
1628
1672
|
|
|
1629
1673
|
var rect = element.getBoundingClientRect();
|
|
1630
1674
|
var scaleX = 1;
|
|
1631
|
-
var scaleY = 1;
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
// }
|
|
1647
|
-
// }
|
|
1675
|
+
var scaleY = 1;
|
|
1676
|
+
|
|
1677
|
+
if (isHTMLElement(element) && includeScale) {
|
|
1678
|
+
var offsetHeight = element.offsetHeight;
|
|
1679
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
|
1680
|
+
// Fallback to 1 in case both values are `0`
|
|
1681
|
+
|
|
1682
|
+
if (offsetWidth > 0) {
|
|
1683
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
if (offsetHeight > 0) {
|
|
1687
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1648
1690
|
|
|
1649
1691
|
return {
|
|
1650
1692
|
width: rect.width / scaleX,
|
|
@@ -1799,13 +1841,13 @@ function getMainAxisFromPlacement(placement) {
|
|
|
1799
1841
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
1800
1842
|
}
|
|
1801
1843
|
|
|
1802
|
-
var max = Math.max;
|
|
1803
|
-
var min = Math.min;
|
|
1804
|
-
var round = Math.round;
|
|
1805
|
-
|
|
1806
1844
|
function within(min$1, value, max$1) {
|
|
1807
1845
|
return max(min$1, min(value, max$1));
|
|
1808
1846
|
}
|
|
1847
|
+
function withinMaxClamp(min, value, max) {
|
|
1848
|
+
var v = within(min, value, max);
|
|
1849
|
+
return v > max ? max : v;
|
|
1850
|
+
}
|
|
1809
1851
|
|
|
1810
1852
|
function getFreshSideObject() {
|
|
1811
1853
|
return {
|
|
@@ -1928,8 +1970,8 @@ function roundOffsetsByDPR(_ref) {
|
|
|
1928
1970
|
var win = window;
|
|
1929
1971
|
var dpr = win.devicePixelRatio || 1;
|
|
1930
1972
|
return {
|
|
1931
|
-
x: round(
|
|
1932
|
-
y: round(
|
|
1973
|
+
x: round(x * dpr) / dpr || 0,
|
|
1974
|
+
y: round(y * dpr) / dpr || 0
|
|
1933
1975
|
};
|
|
1934
1976
|
}
|
|
1935
1977
|
|
|
@@ -1944,14 +1986,23 @@ function mapToStyles(_ref2) {
|
|
|
1944
1986
|
position = _ref2.position,
|
|
1945
1987
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
1946
1988
|
adaptive = _ref2.adaptive,
|
|
1947
|
-
roundOffsets = _ref2.roundOffsets
|
|
1948
|
-
|
|
1949
|
-
var
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1989
|
+
roundOffsets = _ref2.roundOffsets,
|
|
1990
|
+
isFixed = _ref2.isFixed;
|
|
1991
|
+
var _offsets$x = offsets.x,
|
|
1992
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
1993
|
+
_offsets$y = offsets.y,
|
|
1994
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
1995
|
+
|
|
1996
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
1997
|
+
x: x,
|
|
1998
|
+
y: y
|
|
1999
|
+
}) : {
|
|
2000
|
+
x: x,
|
|
2001
|
+
y: y
|
|
2002
|
+
};
|
|
1954
2003
|
|
|
2004
|
+
x = _ref3.x;
|
|
2005
|
+
y = _ref3.y;
|
|
1955
2006
|
var hasX = offsets.hasOwnProperty('x');
|
|
1956
2007
|
var hasY = offsets.hasOwnProperty('y');
|
|
1957
2008
|
var sideX = left;
|
|
@@ -1976,16 +2027,18 @@ function mapToStyles(_ref2) {
|
|
|
1976
2027
|
offsetParent = offsetParent;
|
|
1977
2028
|
|
|
1978
2029
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
1979
|
-
sideY = bottom;
|
|
1980
|
-
|
|
1981
|
-
|
|
2030
|
+
sideY = bottom;
|
|
2031
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
2032
|
+
offsetParent[heightProp];
|
|
2033
|
+
y -= offsetY - popperRect.height;
|
|
1982
2034
|
y *= gpuAcceleration ? 1 : -1;
|
|
1983
2035
|
}
|
|
1984
2036
|
|
|
1985
2037
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
1986
|
-
sideX = right;
|
|
1987
|
-
|
|
1988
|
-
|
|
2038
|
+
sideX = right;
|
|
2039
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
2040
|
+
offsetParent[widthProp];
|
|
2041
|
+
x -= offsetX - popperRect.width;
|
|
1989
2042
|
x *= gpuAcceleration ? 1 : -1;
|
|
1990
2043
|
}
|
|
1991
2044
|
}
|
|
@@ -1994,6 +2047,17 @@ function mapToStyles(_ref2) {
|
|
|
1994
2047
|
position: position
|
|
1995
2048
|
}, adaptive && unsetSides);
|
|
1996
2049
|
|
|
2050
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
2051
|
+
x: x,
|
|
2052
|
+
y: y
|
|
2053
|
+
}) : {
|
|
2054
|
+
x: x,
|
|
2055
|
+
y: y
|
|
2056
|
+
};
|
|
2057
|
+
|
|
2058
|
+
x = _ref4.x;
|
|
2059
|
+
y = _ref4.y;
|
|
2060
|
+
|
|
1997
2061
|
if (gpuAcceleration) {
|
|
1998
2062
|
var _Object$assign;
|
|
1999
2063
|
|
|
@@ -2003,9 +2067,9 @@ function mapToStyles(_ref2) {
|
|
|
2003
2067
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
2004
2068
|
}
|
|
2005
2069
|
|
|
2006
|
-
function computeStyles(
|
|
2007
|
-
var state =
|
|
2008
|
-
options =
|
|
2070
|
+
function computeStyles(_ref5) {
|
|
2071
|
+
var state = _ref5.state,
|
|
2072
|
+
options = _ref5.options;
|
|
2009
2073
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
2010
2074
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
2011
2075
|
_options$adaptive = options.adaptive,
|
|
@@ -2018,7 +2082,8 @@ function computeStyles(_ref4) {
|
|
|
2018
2082
|
variation: getVariation(state.placement),
|
|
2019
2083
|
popper: state.elements.popper,
|
|
2020
2084
|
popperRect: state.rects.popper,
|
|
2021
|
-
gpuAcceleration: gpuAcceleration
|
|
2085
|
+
gpuAcceleration: gpuAcceleration,
|
|
2086
|
+
isFixed: state.options.strategy === 'fixed'
|
|
2022
2087
|
};
|
|
2023
2088
|
|
|
2024
2089
|
if (state.modifiersData.popperOffsets != null) {
|
|
@@ -2276,7 +2341,7 @@ function getInnerBoundingClientRect(element) {
|
|
|
2276
2341
|
}
|
|
2277
2342
|
|
|
2278
2343
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
2279
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
|
2344
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
2280
2345
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
2281
2346
|
// clipping (or hiding) overflowing elements with a position different from
|
|
2282
2347
|
// `initial`
|
|
@@ -2789,6 +2854,14 @@ function preventOverflow(_ref) {
|
|
|
2789
2854
|
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
2790
2855
|
placement: state.placement
|
|
2791
2856
|
})) : tetherOffset;
|
|
2857
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
2858
|
+
mainAxis: tetherOffsetValue,
|
|
2859
|
+
altAxis: tetherOffsetValue
|
|
2860
|
+
} : Object.assign({
|
|
2861
|
+
mainAxis: 0,
|
|
2862
|
+
altAxis: 0
|
|
2863
|
+
}, tetherOffsetValue);
|
|
2864
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
2792
2865
|
var data = {
|
|
2793
2866
|
x: 0,
|
|
2794
2867
|
y: 0
|
|
@@ -2798,13 +2871,15 @@ function preventOverflow(_ref) {
|
|
|
2798
2871
|
return;
|
|
2799
2872
|
}
|
|
2800
2873
|
|
|
2801
|
-
if (checkMainAxis
|
|
2874
|
+
if (checkMainAxis) {
|
|
2875
|
+
var _offsetModifierState$;
|
|
2876
|
+
|
|
2802
2877
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
2803
2878
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
2804
2879
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
2805
2880
|
var offset = popperOffsets[mainAxis];
|
|
2806
|
-
var min$1 =
|
|
2807
|
-
var max$1 =
|
|
2881
|
+
var min$1 = offset + overflow[mainSide];
|
|
2882
|
+
var max$1 = offset - overflow[altSide];
|
|
2808
2883
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
2809
2884
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
2810
2885
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -2824,36 +2899,45 @@ function preventOverflow(_ref) {
|
|
|
2824
2899
|
// width or height)
|
|
2825
2900
|
|
|
2826
2901
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
2827
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
|
2828
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
|
2902
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
2903
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
2829
2904
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
2830
2905
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
2831
|
-
var offsetModifierValue =
|
|
2832
|
-
var tetherMin =
|
|
2833
|
-
var tetherMax =
|
|
2906
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
2907
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
2908
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
2909
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
2910
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
2911
|
+
data[mainAxis] = preventedOffset - offset;
|
|
2912
|
+
}
|
|
2834
2913
|
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
popperOffsets[mainAxis] = preventedOffset;
|
|
2838
|
-
data[mainAxis] = preventedOffset - offset;
|
|
2839
|
-
}
|
|
2914
|
+
if (checkAltAxis) {
|
|
2915
|
+
var _offsetModifierState$2;
|
|
2840
2916
|
|
|
2841
|
-
|
|
2842
|
-
var _mainSide = mainAxis === 'x' ? top : left;
|
|
2917
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
2843
2918
|
|
|
2844
|
-
|
|
2919
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
2845
2920
|
|
|
2846
|
-
|
|
2921
|
+
var _offset = popperOffsets[altAxis];
|
|
2847
2922
|
|
|
2848
|
-
|
|
2923
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
2849
2924
|
|
|
2850
|
-
|
|
2925
|
+
var _min = _offset + overflow[_mainSide];
|
|
2851
2926
|
|
|
2852
|
-
|
|
2927
|
+
var _max = _offset - overflow[_altSide];
|
|
2853
2928
|
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2929
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
2930
|
+
|
|
2931
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
2932
|
+
|
|
2933
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
2934
|
+
|
|
2935
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
2936
|
+
|
|
2937
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
2938
|
+
|
|
2939
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
2940
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
2857
2941
|
}
|
|
2858
2942
|
|
|
2859
2943
|
state.modifiersData[name] = data;
|
|
@@ -2885,8 +2969,8 @@ function getNodeScroll(node) {
|
|
|
2885
2969
|
|
|
2886
2970
|
function isElementScaled(element) {
|
|
2887
2971
|
var rect = element.getBoundingClientRect();
|
|
2888
|
-
var scaleX = rect.width / element.offsetWidth || 1;
|
|
2889
|
-
var scaleY = rect.height / element.offsetHeight || 1;
|
|
2972
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
2973
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
2890
2974
|
return scaleX !== 1 || scaleY !== 1;
|
|
2891
2975
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
2892
2976
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -2898,9 +2982,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
2898
2982
|
}
|
|
2899
2983
|
|
|
2900
2984
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2901
|
-
isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
2985
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
2902
2986
|
var documentElement = getDocumentElement(offsetParent);
|
|
2903
|
-
var rect = getBoundingClientRect(elementOrVirtualElement);
|
|
2987
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
2904
2988
|
var scroll = {
|
|
2905
2989
|
scrollLeft: 0,
|
|
2906
2990
|
scrollTop: 0
|
|
@@ -2917,7 +3001,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
2917
3001
|
}
|
|
2918
3002
|
|
|
2919
3003
|
if (isHTMLElement(offsetParent)) {
|
|
2920
|
-
offsets = getBoundingClientRect(offsetParent);
|
|
3004
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
2921
3005
|
offsets.x += offsetParent.clientLeft;
|
|
2922
3006
|
offsets.y += offsetParent.clientTop;
|
|
2923
3007
|
} else if (documentElement) {
|
|
@@ -3367,6 +3451,9 @@ var Popover = /*#__PURE__*/function () {
|
|
|
3367
3451
|
this.defaults = defaults;
|
|
3368
3452
|
this.settings = _extends({}, this.defaults, options);
|
|
3369
3453
|
this.collection = [];
|
|
3454
|
+
this.memory = {
|
|
3455
|
+
trigger: null
|
|
3456
|
+
};
|
|
3370
3457
|
this.__handlerKeydown = handlerKeydown.bind(this);
|
|
3371
3458
|
if (this.settings.autoInit) this.init();
|
|
3372
3459
|
}
|