irie 0.0.8__py3-none-any.whl → 0.0.10__py3-none-any.whl
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.
- irie/apps/inventory/migrations/0002_alter_asset_bridge_sensors_and_more.py +24 -0
- irie/apps/inventory/models.py +2 -2
- irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-base.js +1069 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-base.js.flow +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-lite.js +1378 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-lite.js.flow +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper.js +1927 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper.js.flow +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/createPopper.js +258 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/contains.js +23 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getBoundingClientRect.js +28 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getClippingRect.js +70 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getCompositeRect.js +57 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getComputedStyle.js +4 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getDocumentElement.js +6 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getDocumentRect.js +29 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getHTMLElementScroll.js +6 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getLayoutRect.js +25 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getNodeName.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getNodeScroll.js +11 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getOffsetParent.js +64 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getParentNode.js +19 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getScrollParent.js +16 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getViewportRect.js +40 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getWindow.js +12 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getWindowScroll.js +10 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getWindowScrollBarX.js +13 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/instanceOf.js +23 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/isScrollParent.js +10 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/isTableElement.js +4 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/listScrollParents.js +26 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/enums.js +31 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/index.js +8 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/applyStyles.js +84 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/arrow.js +101 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/computeStyles.js +155 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/eventListeners.js +49 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/flip.js +147 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/hide.js +61 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/index.js +9 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/offset.js +53 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/popperOffsets.js +25 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/preventOverflow.js +123 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/popper-base.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/popper-lite.js +11 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/popper.js +20 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/types.js +0 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/computeAutoPlacement.js +47 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/computeOffsets.js +70 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/debounce.js +15 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/detectOverflow.js +64 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/expandToHashMap.js +6 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/format.js +9 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getAltAxis.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getAltLen.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getBasePlacement.js +4 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getFreshSideObject.js +8 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getMainAxisFromPlacement.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getOppositePlacement.js +11 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getOppositeVariationPlacement.js +9 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getVariation.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/math.js +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/mergeByName.js +14 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/mergePaddingObject.js +4 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/orderModifiers.js +44 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/rectToClientRect.js +8 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/uniqueBy.js +11 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/validateModifiers.js +76 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/within.js +4 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-base.min.js +6 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-base.min.js.flow +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-lite.min.js +6 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-lite.min.js.flow +3 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper.min.js +6 -0
- irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper.min.js.flow +3 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-grid.min.css +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-grid.rtl.min.css +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-reboot.min.css +7 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-reboot.rtl.min.css +7 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-utilities.min.css +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-utilities.rtl.min.css +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap.min.css +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap.rtl.min.css +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/js/bootstrap.bundle.min.js +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/js/bootstrap.esm.min.js +6 -0
- irie/apps/static/assets/vendor/bootstrap/dist/js/bootstrap.min.js +6 -0
- irie/apps/static/assets/vendor/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.css +34 -0
- irie/apps/static/assets/vendor/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.min.js +7 -0
- irie/apps/static/assets/vendor/notyf/notyf.es.js +441 -0
- irie/apps/static/assets/vendor/notyf/notyf.min.css +1 -0
- irie/apps/static/assets/vendor/notyf/notyf.min.js +1 -0
- irie/apps/static/assets/vendor/notyf/notyf.umd.js +449 -0
- irie/apps/static/assets/vendor/nouislider/distribute/nouislider.min.css +1 -0
- irie/apps/static/assets/vendor/nouislider/distribute/nouislider.min.js +1 -0
- irie/apps/static/assets/vendor/nouislider/distribute/nouislider.min.mjs +1 -0
- irie/apps/static/assets/vendor/nouislider/distribute/nouislider.mjs +2238 -0
- irie/apps/static/assets/vendor/onscreen/dist/index.js +21 -0
- irie/apps/static/assets/vendor/onscreen/dist/on-screen.es6.js +404 -0
- irie/apps/static/assets/vendor/onscreen/dist/on-screen.umd.min.js +1 -0
- irie/apps/static/assets/vendor/simplebar/dist/simplebar-core.esm.js +889 -0
- irie/apps/static/assets/vendor/simplebar/dist/simplebar.esm.js +994 -0
- irie/apps/static/assets/vendor/simplebar/dist/simplebar.min.css +1 -0
- irie/apps/static/assets/vendor/simplebar/dist/simplebar.min.js +10 -0
- irie/apps/static/assets/vendor/simplebar/dist/simplebar.umd.js +127 -0
- irie/apps/static/assets/vendor/smooth-scroll/dist/smooth-scroll.min.js +2 -0
- irie/apps/static/assets/vendor/smooth-scroll/dist/smooth-scroll.polyfills.min.js +2 -0
- irie/apps/static/assets/vendor/sweetalert2/dist/sweetalert2.all.min.js +2 -0
- irie/apps/static/assets/vendor/sweetalert2/dist/sweetalert2.min.css +1 -0
- irie/apps/static/assets/vendor/sweetalert2/dist/sweetalert2.min.js +1 -0
- irie/apps/static/assets/vendor/waypoints/lib/jquery.waypoints.min.js +7 -0
- irie/apps/static/assets/vendor/waypoints/lib/noframework.waypoints.min.js +7 -0
- irie/apps/static/assets/vendor/waypoints/lib/shortcuts/infinite.min.js +7 -0
- irie/apps/static/assets/vendor/waypoints/lib/shortcuts/inview.min.js +7 -0
- irie/apps/static/assets/vendor/waypoints/lib/shortcuts/sticky.min.js +7 -0
- irie/apps/static/assets/vendor/waypoints/lib/waypoints.debug.js +46 -0
- irie/apps/static/assets/vendor/waypoints/lib/zepto.waypoints.min.js +7 -0
- irie/apps/static/assets/vendor/waypoints/licenses.txt +23 -0
- irie/apps/static/assets/vendor/waypoints/testem.json +24 -0
- irie/core/settings.py +4 -2
- irie/init/hayward.zip +0 -0
- {irie-0.0.8.dist-info → irie-0.0.10.dist-info}/METADATA +1 -1
- {irie-0.0.8.dist-info → irie-0.0.10.dist-info}/RECORD +125 -7
- {irie-0.0.8.dist-info → irie-0.0.10.dist-info}/WHEEL +0 -0
- {irie-0.0.8.dist-info → irie-0.0.10.dist-info}/entry_points.txt +0 -0
- {irie-0.0.8.dist-info → irie-0.0.10.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import getOppositePlacement from "../utils/getOppositePlacement.js";
|
|
2
|
+
import getBasePlacement from "../utils/getBasePlacement.js";
|
|
3
|
+
import getOppositeVariationPlacement from "../utils/getOppositeVariationPlacement.js";
|
|
4
|
+
import detectOverflow from "../utils/detectOverflow.js";
|
|
5
|
+
import computeAutoPlacement from "../utils/computeAutoPlacement.js";
|
|
6
|
+
import { bottom, top, start, right, left, auto } from "../enums.js";
|
|
7
|
+
import getVariation from "../utils/getVariation.js"; // eslint-disable-next-line import/no-unused-modules
|
|
8
|
+
|
|
9
|
+
function getExpandedFallbackPlacements(placement) {
|
|
10
|
+
if (getBasePlacement(placement) === auto) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var oppositePlacement = getOppositePlacement(placement);
|
|
15
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function flip(_ref) {
|
|
19
|
+
var state = _ref.state,
|
|
20
|
+
options = _ref.options,
|
|
21
|
+
name = _ref.name;
|
|
22
|
+
|
|
23
|
+
if (state.modifiersData[name]._skip) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var _options$mainAxis = options.mainAxis,
|
|
28
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
29
|
+
_options$altAxis = options.altAxis,
|
|
30
|
+
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
|
31
|
+
specifiedFallbackPlacements = options.fallbackPlacements,
|
|
32
|
+
padding = options.padding,
|
|
33
|
+
boundary = options.boundary,
|
|
34
|
+
rootBoundary = options.rootBoundary,
|
|
35
|
+
altBoundary = options.altBoundary,
|
|
36
|
+
_options$flipVariatio = options.flipVariations,
|
|
37
|
+
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
|
38
|
+
allowedAutoPlacements = options.allowedAutoPlacements;
|
|
39
|
+
var preferredPlacement = state.options.placement;
|
|
40
|
+
var basePlacement = getBasePlacement(preferredPlacement);
|
|
41
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
|
42
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
43
|
+
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
44
|
+
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
|
45
|
+
placement: placement,
|
|
46
|
+
boundary: boundary,
|
|
47
|
+
rootBoundary: rootBoundary,
|
|
48
|
+
padding: padding,
|
|
49
|
+
flipVariations: flipVariations,
|
|
50
|
+
allowedAutoPlacements: allowedAutoPlacements
|
|
51
|
+
}) : placement);
|
|
52
|
+
}, []);
|
|
53
|
+
var referenceRect = state.rects.reference;
|
|
54
|
+
var popperRect = state.rects.popper;
|
|
55
|
+
var checksMap = new Map();
|
|
56
|
+
var makeFallbackChecks = true;
|
|
57
|
+
var firstFittingPlacement = placements[0];
|
|
58
|
+
|
|
59
|
+
for (var i = 0; i < placements.length; i++) {
|
|
60
|
+
var placement = placements[i];
|
|
61
|
+
|
|
62
|
+
var _basePlacement = getBasePlacement(placement);
|
|
63
|
+
|
|
64
|
+
var isStartVariation = getVariation(placement) === start;
|
|
65
|
+
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
66
|
+
var len = isVertical ? 'width' : 'height';
|
|
67
|
+
var overflow = detectOverflow(state, {
|
|
68
|
+
placement: placement,
|
|
69
|
+
boundary: boundary,
|
|
70
|
+
rootBoundary: rootBoundary,
|
|
71
|
+
altBoundary: altBoundary,
|
|
72
|
+
padding: padding
|
|
73
|
+
});
|
|
74
|
+
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
75
|
+
|
|
76
|
+
if (referenceRect[len] > popperRect[len]) {
|
|
77
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
81
|
+
var checks = [];
|
|
82
|
+
|
|
83
|
+
if (checkMainAxis) {
|
|
84
|
+
checks.push(overflow[_basePlacement] <= 0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (checkAltAxis) {
|
|
88
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (checks.every(function (check) {
|
|
92
|
+
return check;
|
|
93
|
+
})) {
|
|
94
|
+
firstFittingPlacement = placement;
|
|
95
|
+
makeFallbackChecks = false;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
checksMap.set(placement, checks);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (makeFallbackChecks) {
|
|
103
|
+
// `2` may be desired in some cases – research later
|
|
104
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
|
105
|
+
|
|
106
|
+
var _loop = function _loop(_i) {
|
|
107
|
+
var fittingPlacement = placements.find(function (placement) {
|
|
108
|
+
var checks = checksMap.get(placement);
|
|
109
|
+
|
|
110
|
+
if (checks) {
|
|
111
|
+
return checks.slice(0, _i).every(function (check) {
|
|
112
|
+
return check;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (fittingPlacement) {
|
|
118
|
+
firstFittingPlacement = fittingPlacement;
|
|
119
|
+
return "break";
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
124
|
+
var _ret = _loop(_i);
|
|
125
|
+
|
|
126
|
+
if (_ret === "break") break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (state.placement !== firstFittingPlacement) {
|
|
131
|
+
state.modifiersData[name]._skip = true;
|
|
132
|
+
state.placement = firstFittingPlacement;
|
|
133
|
+
state.reset = true;
|
|
134
|
+
}
|
|
135
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
export default {
|
|
139
|
+
name: 'flip',
|
|
140
|
+
enabled: true,
|
|
141
|
+
phase: 'main',
|
|
142
|
+
fn: flip,
|
|
143
|
+
requiresIfExists: ['offset'],
|
|
144
|
+
data: {
|
|
145
|
+
_skip: false
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { top, bottom, left, right } from "../enums.js";
|
|
2
|
+
import detectOverflow from "../utils/detectOverflow.js";
|
|
3
|
+
|
|
4
|
+
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
5
|
+
if (preventedOffsets === void 0) {
|
|
6
|
+
preventedOffsets = {
|
|
7
|
+
x: 0,
|
|
8
|
+
y: 0
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
top: overflow.top - rect.height - preventedOffsets.y,
|
|
14
|
+
right: overflow.right - rect.width + preventedOffsets.x,
|
|
15
|
+
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
16
|
+
left: overflow.left - rect.width - preventedOffsets.x
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function isAnySideFullyClipped(overflow) {
|
|
21
|
+
return [top, right, bottom, left].some(function (side) {
|
|
22
|
+
return overflow[side] >= 0;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function hide(_ref) {
|
|
27
|
+
var state = _ref.state,
|
|
28
|
+
name = _ref.name;
|
|
29
|
+
var referenceRect = state.rects.reference;
|
|
30
|
+
var popperRect = state.rects.popper;
|
|
31
|
+
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
32
|
+
var referenceOverflow = detectOverflow(state, {
|
|
33
|
+
elementContext: 'reference'
|
|
34
|
+
});
|
|
35
|
+
var popperAltOverflow = detectOverflow(state, {
|
|
36
|
+
altBoundary: true
|
|
37
|
+
});
|
|
38
|
+
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
39
|
+
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
40
|
+
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
41
|
+
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
42
|
+
state.modifiersData[name] = {
|
|
43
|
+
referenceClippingOffsets: referenceClippingOffsets,
|
|
44
|
+
popperEscapeOffsets: popperEscapeOffsets,
|
|
45
|
+
isReferenceHidden: isReferenceHidden,
|
|
46
|
+
hasPopperEscaped: hasPopperEscaped
|
|
47
|
+
};
|
|
48
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
49
|
+
'data-popper-reference-hidden': isReferenceHidden,
|
|
50
|
+
'data-popper-escaped': hasPopperEscaped
|
|
51
|
+
});
|
|
52
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
name: 'hide',
|
|
57
|
+
enabled: true,
|
|
58
|
+
phase: 'main',
|
|
59
|
+
requiresIfExists: ['preventOverflow'],
|
|
60
|
+
fn: hide
|
|
61
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as applyStyles } from "./applyStyles.js";
|
|
2
|
+
export { default as arrow } from "./arrow.js";
|
|
3
|
+
export { default as computeStyles } from "./computeStyles.js";
|
|
4
|
+
export { default as eventListeners } from "./eventListeners.js";
|
|
5
|
+
export { default as flip } from "./flip.js";
|
|
6
|
+
export { default as hide } from "./hide.js";
|
|
7
|
+
export { default as offset } from "./offset.js";
|
|
8
|
+
export { default as popperOffsets } from "./popperOffsets.js";
|
|
9
|
+
export { default as preventOverflow } from "./preventOverflow.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import getBasePlacement from "../utils/getBasePlacement.js";
|
|
2
|
+
import { top, left, right, placements } from "../enums.js";
|
|
3
|
+
export function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
4
|
+
var basePlacement = getBasePlacement(placement);
|
|
5
|
+
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
6
|
+
|
|
7
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
8
|
+
placement: placement
|
|
9
|
+
})) : offset,
|
|
10
|
+
skidding = _ref[0],
|
|
11
|
+
distance = _ref[1];
|
|
12
|
+
|
|
13
|
+
skidding = skidding || 0;
|
|
14
|
+
distance = (distance || 0) * invertDistance;
|
|
15
|
+
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
16
|
+
x: distance,
|
|
17
|
+
y: skidding
|
|
18
|
+
} : {
|
|
19
|
+
x: skidding,
|
|
20
|
+
y: distance
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function offset(_ref2) {
|
|
25
|
+
var state = _ref2.state,
|
|
26
|
+
options = _ref2.options,
|
|
27
|
+
name = _ref2.name;
|
|
28
|
+
var _options$offset = options.offset,
|
|
29
|
+
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
30
|
+
var data = placements.reduce(function (acc, placement) {
|
|
31
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
|
32
|
+
return acc;
|
|
33
|
+
}, {});
|
|
34
|
+
var _data$state$placement = data[state.placement],
|
|
35
|
+
x = _data$state$placement.x,
|
|
36
|
+
y = _data$state$placement.y;
|
|
37
|
+
|
|
38
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
39
|
+
state.modifiersData.popperOffsets.x += x;
|
|
40
|
+
state.modifiersData.popperOffsets.y += y;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
state.modifiersData[name] = data;
|
|
44
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: 'offset',
|
|
49
|
+
enabled: true,
|
|
50
|
+
phase: 'main',
|
|
51
|
+
requires: ['popperOffsets'],
|
|
52
|
+
fn: offset
|
|
53
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import computeOffsets from "../utils/computeOffsets.js";
|
|
2
|
+
|
|
3
|
+
function popperOffsets(_ref) {
|
|
4
|
+
var state = _ref.state,
|
|
5
|
+
name = _ref.name;
|
|
6
|
+
// Offsets are the actual position the popper needs to have to be
|
|
7
|
+
// properly positioned near its reference element
|
|
8
|
+
// This is the most basic placement, and will be adjusted by
|
|
9
|
+
// the modifiers in the next step
|
|
10
|
+
state.modifiersData[name] = computeOffsets({
|
|
11
|
+
reference: state.rects.reference,
|
|
12
|
+
element: state.rects.popper,
|
|
13
|
+
strategy: 'absolute',
|
|
14
|
+
placement: state.placement
|
|
15
|
+
});
|
|
16
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'popperOffsets',
|
|
21
|
+
enabled: true,
|
|
22
|
+
phase: 'read',
|
|
23
|
+
fn: popperOffsets,
|
|
24
|
+
data: {}
|
|
25
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { top, left, right, bottom, start } from "../enums.js";
|
|
2
|
+
import getBasePlacement from "../utils/getBasePlacement.js";
|
|
3
|
+
import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js";
|
|
4
|
+
import getAltAxis from "../utils/getAltAxis.js";
|
|
5
|
+
import within from "../utils/within.js";
|
|
6
|
+
import getLayoutRect from "../dom-utils/getLayoutRect.js";
|
|
7
|
+
import getOffsetParent from "../dom-utils/getOffsetParent.js";
|
|
8
|
+
import detectOverflow from "../utils/detectOverflow.js";
|
|
9
|
+
import getVariation from "../utils/getVariation.js";
|
|
10
|
+
import getFreshSideObject from "../utils/getFreshSideObject.js";
|
|
11
|
+
import { max as mathMax, min as mathMin } from "../utils/math.js";
|
|
12
|
+
|
|
13
|
+
function preventOverflow(_ref) {
|
|
14
|
+
var state = _ref.state,
|
|
15
|
+
options = _ref.options,
|
|
16
|
+
name = _ref.name;
|
|
17
|
+
var _options$mainAxis = options.mainAxis,
|
|
18
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
19
|
+
_options$altAxis = options.altAxis,
|
|
20
|
+
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
|
21
|
+
boundary = options.boundary,
|
|
22
|
+
rootBoundary = options.rootBoundary,
|
|
23
|
+
altBoundary = options.altBoundary,
|
|
24
|
+
padding = options.padding,
|
|
25
|
+
_options$tether = options.tether,
|
|
26
|
+
tether = _options$tether === void 0 ? true : _options$tether,
|
|
27
|
+
_options$tetherOffset = options.tetherOffset,
|
|
28
|
+
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
29
|
+
var overflow = detectOverflow(state, {
|
|
30
|
+
boundary: boundary,
|
|
31
|
+
rootBoundary: rootBoundary,
|
|
32
|
+
padding: padding,
|
|
33
|
+
altBoundary: altBoundary
|
|
34
|
+
});
|
|
35
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
36
|
+
var variation = getVariation(state.placement);
|
|
37
|
+
var isBasePlacement = !variation;
|
|
38
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
39
|
+
var altAxis = getAltAxis(mainAxis);
|
|
40
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
41
|
+
var referenceRect = state.rects.reference;
|
|
42
|
+
var popperRect = state.rects.popper;
|
|
43
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
44
|
+
placement: state.placement
|
|
45
|
+
})) : tetherOffset;
|
|
46
|
+
var data = {
|
|
47
|
+
x: 0,
|
|
48
|
+
y: 0
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
if (!popperOffsets) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (checkMainAxis || checkAltAxis) {
|
|
56
|
+
var mainSide = mainAxis === 'y' ? top : left;
|
|
57
|
+
var altSide = mainAxis === 'y' ? bottom : right;
|
|
58
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
59
|
+
var offset = popperOffsets[mainAxis];
|
|
60
|
+
var min = popperOffsets[mainAxis] + overflow[mainSide];
|
|
61
|
+
var max = popperOffsets[mainAxis] - overflow[altSide];
|
|
62
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
63
|
+
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
64
|
+
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
65
|
+
// outside the reference bounds
|
|
66
|
+
|
|
67
|
+
var arrowElement = state.elements.arrow;
|
|
68
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
69
|
+
width: 0,
|
|
70
|
+
height: 0
|
|
71
|
+
};
|
|
72
|
+
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
|
73
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
74
|
+
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
|
75
|
+
// to include its full size in the calculation. If the reference is small
|
|
76
|
+
// and near the edge of a boundary, the popper can overflow even if the
|
|
77
|
+
// reference is not overflowing as well (e.g. virtual elements with no
|
|
78
|
+
// width or height)
|
|
79
|
+
|
|
80
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
81
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
|
|
82
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
|
|
83
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
84
|
+
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
85
|
+
var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
|
|
86
|
+
var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
|
|
87
|
+
var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
|
|
88
|
+
|
|
89
|
+
if (checkMainAxis) {
|
|
90
|
+
var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);
|
|
91
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
92
|
+
data[mainAxis] = preventedOffset - offset;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (checkAltAxis) {
|
|
96
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
97
|
+
|
|
98
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
99
|
+
|
|
100
|
+
var _offset = popperOffsets[altAxis];
|
|
101
|
+
|
|
102
|
+
var _min = _offset + overflow[_mainSide];
|
|
103
|
+
|
|
104
|
+
var _max = _offset - overflow[_altSide];
|
|
105
|
+
|
|
106
|
+
var _preventedOffset = within(tether ? mathMin(_min, tetherMin) : _min, _offset, tether ? mathMax(_max, tetherMax) : _max);
|
|
107
|
+
|
|
108
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
109
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
state.modifiersData[name] = data;
|
|
114
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export default {
|
|
118
|
+
name: 'preventOverflow',
|
|
119
|
+
enabled: true,
|
|
120
|
+
phase: 'main',
|
|
121
|
+
fn: preventOverflow,
|
|
122
|
+
requiresIfExists: ['offset']
|
|
123
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { popperGenerator, detectOverflow } from "./createPopper.js";
|
|
2
|
+
import eventListeners from "./modifiers/eventListeners.js";
|
|
3
|
+
import popperOffsets from "./modifiers/popperOffsets.js";
|
|
4
|
+
import computeStyles from "./modifiers/computeStyles.js";
|
|
5
|
+
import applyStyles from "./modifiers/applyStyles.js";
|
|
6
|
+
var defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];
|
|
7
|
+
var createPopper = /*#__PURE__*/popperGenerator({
|
|
8
|
+
defaultModifiers: defaultModifiers
|
|
9
|
+
}); // eslint-disable-next-line import/no-unused-modules
|
|
10
|
+
|
|
11
|
+
export { createPopper, popperGenerator, defaultModifiers, detectOverflow };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { popperGenerator, detectOverflow } from "./createPopper.js";
|
|
2
|
+
import eventListeners from "./modifiers/eventListeners.js";
|
|
3
|
+
import popperOffsets from "./modifiers/popperOffsets.js";
|
|
4
|
+
import computeStyles from "./modifiers/computeStyles.js";
|
|
5
|
+
import applyStyles from "./modifiers/applyStyles.js";
|
|
6
|
+
import offset from "./modifiers/offset.js";
|
|
7
|
+
import flip from "./modifiers/flip.js";
|
|
8
|
+
import preventOverflow from "./modifiers/preventOverflow.js";
|
|
9
|
+
import arrow from "./modifiers/arrow.js";
|
|
10
|
+
import hide from "./modifiers/hide.js";
|
|
11
|
+
var defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];
|
|
12
|
+
var createPopper = /*#__PURE__*/popperGenerator({
|
|
13
|
+
defaultModifiers: defaultModifiers
|
|
14
|
+
}); // eslint-disable-next-line import/no-unused-modules
|
|
15
|
+
|
|
16
|
+
export { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules
|
|
17
|
+
|
|
18
|
+
export { createPopper as createPopperLite } from "./popper-lite.js"; // eslint-disable-next-line import/no-unused-modules
|
|
19
|
+
|
|
20
|
+
export * from "./modifiers/index.js";
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import getVariation from "./getVariation.js";
|
|
2
|
+
import { variationPlacements, basePlacements, placements as allPlacements } from "../enums.js";
|
|
3
|
+
import detectOverflow from "./detectOverflow.js";
|
|
4
|
+
import getBasePlacement from "./getBasePlacement.js";
|
|
5
|
+
export default function computeAutoPlacement(state, options) {
|
|
6
|
+
if (options === void 0) {
|
|
7
|
+
options = {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
var _options = options,
|
|
11
|
+
placement = _options.placement,
|
|
12
|
+
boundary = _options.boundary,
|
|
13
|
+
rootBoundary = _options.rootBoundary,
|
|
14
|
+
padding = _options.padding,
|
|
15
|
+
flipVariations = _options.flipVariations,
|
|
16
|
+
_options$allowedAutoP = _options.allowedAutoPlacements,
|
|
17
|
+
allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;
|
|
18
|
+
var variation = getVariation(placement);
|
|
19
|
+
var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
|
20
|
+
return getVariation(placement) === variation;
|
|
21
|
+
}) : basePlacements;
|
|
22
|
+
var allowedPlacements = placements.filter(function (placement) {
|
|
23
|
+
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (allowedPlacements.length === 0) {
|
|
27
|
+
allowedPlacements = placements;
|
|
28
|
+
|
|
29
|
+
if (false) {
|
|
30
|
+
console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
|
|
31
|
+
}
|
|
32
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
36
|
+
acc[placement] = detectOverflow(state, {
|
|
37
|
+
placement: placement,
|
|
38
|
+
boundary: boundary,
|
|
39
|
+
rootBoundary: rootBoundary,
|
|
40
|
+
padding: padding
|
|
41
|
+
})[getBasePlacement(placement)];
|
|
42
|
+
return acc;
|
|
43
|
+
}, {});
|
|
44
|
+
return Object.keys(overflows).sort(function (a, b) {
|
|
45
|
+
return overflows[a] - overflows[b];
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import getBasePlacement from "./getBasePlacement.js";
|
|
2
|
+
import getVariation from "./getVariation.js";
|
|
3
|
+
import getMainAxisFromPlacement from "./getMainAxisFromPlacement.js";
|
|
4
|
+
import { top, right, bottom, left, start, end } from "../enums.js";
|
|
5
|
+
export default function computeOffsets(_ref) {
|
|
6
|
+
var reference = _ref.reference,
|
|
7
|
+
element = _ref.element,
|
|
8
|
+
placement = _ref.placement;
|
|
9
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
10
|
+
var variation = placement ? getVariation(placement) : null;
|
|
11
|
+
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
12
|
+
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
13
|
+
var offsets;
|
|
14
|
+
|
|
15
|
+
switch (basePlacement) {
|
|
16
|
+
case top:
|
|
17
|
+
offsets = {
|
|
18
|
+
x: commonX,
|
|
19
|
+
y: reference.y - element.height
|
|
20
|
+
};
|
|
21
|
+
break;
|
|
22
|
+
|
|
23
|
+
case bottom:
|
|
24
|
+
offsets = {
|
|
25
|
+
x: commonX,
|
|
26
|
+
y: reference.y + reference.height
|
|
27
|
+
};
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case right:
|
|
31
|
+
offsets = {
|
|
32
|
+
x: reference.x + reference.width,
|
|
33
|
+
y: commonY
|
|
34
|
+
};
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case left:
|
|
38
|
+
offsets = {
|
|
39
|
+
x: reference.x - element.width,
|
|
40
|
+
y: commonY
|
|
41
|
+
};
|
|
42
|
+
break;
|
|
43
|
+
|
|
44
|
+
default:
|
|
45
|
+
offsets = {
|
|
46
|
+
x: reference.x,
|
|
47
|
+
y: reference.y
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
52
|
+
|
|
53
|
+
if (mainAxis != null) {
|
|
54
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
55
|
+
|
|
56
|
+
switch (variation) {
|
|
57
|
+
case start:
|
|
58
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case end:
|
|
62
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
63
|
+
break;
|
|
64
|
+
|
|
65
|
+
default:
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return offsets;
|
|
70
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function debounce(fn) {
|
|
2
|
+
var pending;
|
|
3
|
+
return function () {
|
|
4
|
+
if (!pending) {
|
|
5
|
+
pending = new Promise(function (resolve) {
|
|
6
|
+
Promise.resolve().then(function () {
|
|
7
|
+
pending = undefined;
|
|
8
|
+
resolve(fn());
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return pending;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import getBoundingClientRect from "../dom-utils/getBoundingClientRect.js";
|
|
2
|
+
import getClippingRect from "../dom-utils/getClippingRect.js";
|
|
3
|
+
import getDocumentElement from "../dom-utils/getDocumentElement.js";
|
|
4
|
+
import computeOffsets from "./computeOffsets.js";
|
|
5
|
+
import rectToClientRect from "./rectToClientRect.js";
|
|
6
|
+
import { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from "../enums.js";
|
|
7
|
+
import { isElement } from "../dom-utils/instanceOf.js";
|
|
8
|
+
import mergePaddingObject from "./mergePaddingObject.js";
|
|
9
|
+
import expandToHashMap from "./expandToHashMap.js"; // eslint-disable-next-line import/no-unused-modules
|
|
10
|
+
|
|
11
|
+
export default function detectOverflow(state, options) {
|
|
12
|
+
if (options === void 0) {
|
|
13
|
+
options = {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var _options = options,
|
|
17
|
+
_options$placement = _options.placement,
|
|
18
|
+
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
|
19
|
+
_options$boundary = _options.boundary,
|
|
20
|
+
boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
|
21
|
+
_options$rootBoundary = _options.rootBoundary,
|
|
22
|
+
rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
|
23
|
+
_options$elementConte = _options.elementContext,
|
|
24
|
+
elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
|
25
|
+
_options$altBoundary = _options.altBoundary,
|
|
26
|
+
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
|
27
|
+
_options$padding = _options.padding,
|
|
28
|
+
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
29
|
+
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
30
|
+
var altContext = elementContext === popper ? reference : popper;
|
|
31
|
+
var referenceElement = state.elements.reference;
|
|
32
|
+
var popperRect = state.rects.popper;
|
|
33
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
34
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
35
|
+
var referenceClientRect = getBoundingClientRect(referenceElement);
|
|
36
|
+
var popperOffsets = computeOffsets({
|
|
37
|
+
reference: referenceClientRect,
|
|
38
|
+
element: popperRect,
|
|
39
|
+
strategy: 'absolute',
|
|
40
|
+
placement: placement
|
|
41
|
+
});
|
|
42
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
43
|
+
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
44
|
+
// 0 or negative = within the clipping rect
|
|
45
|
+
|
|
46
|
+
var overflowOffsets = {
|
|
47
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
48
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
49
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
50
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
51
|
+
};
|
|
52
|
+
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
|
53
|
+
|
|
54
|
+
if (elementContext === popper && offsetData) {
|
|
55
|
+
var offset = offsetData[placement];
|
|
56
|
+
Object.keys(overflowOffsets).forEach(function (key) {
|
|
57
|
+
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
58
|
+
var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
|
59
|
+
overflowOffsets[key] += offset[axis] * multiply;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return overflowOffsets;
|
|
64
|
+
}
|