irie 0.0.9__py3-none-any.whl → 0.0.11__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.
Potentially problematic release.
This version of irie might be problematic. Click here for more details.
- irie/apps/inventory/views.py +4 -1
- 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/init/hayward.zip +0 -0
- {irie-0.0.9.dist-info → irie-0.0.11.dist-info}/METADATA +1 -1
- {irie-0.0.9.dist-info → irie-0.0.11.dist-info}/RECORD +123 -6
- {irie-0.0.9.dist-info → irie-0.0.11.dist-info}/WHEEL +0 -0
- {irie-0.0.9.dist-info → irie-0.0.11.dist-info}/entry_points.txt +0 -0
- {irie-0.0.9.dist-info → irie-0.0.11.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import getWindow from "./getWindow.js";
|
|
2
|
+
import getDocumentElement from "./getDocumentElement.js";
|
|
3
|
+
import getWindowScrollBarX from "./getWindowScrollBarX.js";
|
|
4
|
+
export default function getViewportRect(element) {
|
|
5
|
+
var win = getWindow(element);
|
|
6
|
+
var html = getDocumentElement(element);
|
|
7
|
+
var visualViewport = win.visualViewport;
|
|
8
|
+
var width = html.clientWidth;
|
|
9
|
+
var height = html.clientHeight;
|
|
10
|
+
var x = 0;
|
|
11
|
+
var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
|
|
12
|
+
// can be obscured underneath it.
|
|
13
|
+
// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
|
|
14
|
+
// if it isn't open, so if this isn't available, the popper will be detected
|
|
15
|
+
// to overflow the bottom of the screen too early.
|
|
16
|
+
|
|
17
|
+
if (visualViewport) {
|
|
18
|
+
width = visualViewport.width;
|
|
19
|
+
height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
|
|
20
|
+
// In Chrome, it returns a value very close to 0 (+/-) but contains rounding
|
|
21
|
+
// errors due to floating point numbers, so we need to check precision.
|
|
22
|
+
// Safari returns a number <= 0, usually < -1 when pinch-zoomed
|
|
23
|
+
// Feature detection fails in mobile emulation mode in Chrome.
|
|
24
|
+
// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
|
|
25
|
+
// 0.001
|
|
26
|
+
// Fallback here: "Not Safari" userAgent
|
|
27
|
+
|
|
28
|
+
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
29
|
+
x = visualViewport.offsetLeft;
|
|
30
|
+
y = visualViewport.offsetTop;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
width: width,
|
|
36
|
+
height: height,
|
|
37
|
+
x: x + getWindowScrollBarX(element),
|
|
38
|
+
y: y
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function getWindow(node) {
|
|
2
|
+
if (node == null) {
|
|
3
|
+
return window;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (node.toString() !== '[object Window]') {
|
|
7
|
+
var ownerDocument = node.ownerDocument;
|
|
8
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return node;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import getBoundingClientRect from "./getBoundingClientRect.js";
|
|
2
|
+
import getDocumentElement from "./getDocumentElement.js";
|
|
3
|
+
import getWindowScroll from "./getWindowScroll.js";
|
|
4
|
+
export default function getWindowScrollBarX(element) {
|
|
5
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
6
|
+
// incorrect for RTL.
|
|
7
|
+
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
8
|
+
// it's not an issue. I don't think anyone ever specifies width on <html>
|
|
9
|
+
// anyway.
|
|
10
|
+
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
11
|
+
// this (e.g. Edge 2019, IE11, Safari)
|
|
12
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import getWindow from "./getWindow.js";
|
|
2
|
+
|
|
3
|
+
function isElement(node) {
|
|
4
|
+
var OwnElement = getWindow(node).Element;
|
|
5
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function isHTMLElement(node) {
|
|
9
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
10
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function isShadowRoot(node) {
|
|
14
|
+
// IE 11 has no ShadowRoot
|
|
15
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
20
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { isElement, isHTMLElement, isShadowRoot };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import getComputedStyle from "./getComputedStyle.js";
|
|
2
|
+
export default function isScrollParent(element) {
|
|
3
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
4
|
+
var _getComputedStyle = getComputedStyle(element),
|
|
5
|
+
overflow = _getComputedStyle.overflow,
|
|
6
|
+
overflowX = _getComputedStyle.overflowX,
|
|
7
|
+
overflowY = _getComputedStyle.overflowY;
|
|
8
|
+
|
|
9
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import getScrollParent from "./getScrollParent.js";
|
|
2
|
+
import getParentNode from "./getParentNode.js";
|
|
3
|
+
import getWindow from "./getWindow.js";
|
|
4
|
+
import isScrollParent from "./isScrollParent.js";
|
|
5
|
+
/*
|
|
6
|
+
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
7
|
+
until we get to the top window object. This list is what we attach scroll listeners
|
|
8
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
9
|
+
reference element's position.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export default function listScrollParents(element, list) {
|
|
13
|
+
var _element$ownerDocumen;
|
|
14
|
+
|
|
15
|
+
if (list === void 0) {
|
|
16
|
+
list = [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var scrollParent = getScrollParent(element);
|
|
20
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
21
|
+
var win = getWindow(scrollParent);
|
|
22
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
23
|
+
var updatedList = list.concat(target);
|
|
24
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
25
|
+
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export var top = 'top';
|
|
2
|
+
export var bottom = 'bottom';
|
|
3
|
+
export var right = 'right';
|
|
4
|
+
export var left = 'left';
|
|
5
|
+
export var auto = 'auto';
|
|
6
|
+
export var basePlacements = [top, bottom, right, left];
|
|
7
|
+
export var start = 'start';
|
|
8
|
+
export var end = 'end';
|
|
9
|
+
export var clippingParents = 'clippingParents';
|
|
10
|
+
export var viewport = 'viewport';
|
|
11
|
+
export var popper = 'popper';
|
|
12
|
+
export var reference = 'reference';
|
|
13
|
+
export var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
|
|
14
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
15
|
+
}, []);
|
|
16
|
+
export var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
|
17
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
18
|
+
}, []); // modifiers that need to read the DOM
|
|
19
|
+
|
|
20
|
+
export var beforeRead = 'beforeRead';
|
|
21
|
+
export var read = 'read';
|
|
22
|
+
export var afterRead = 'afterRead'; // pure-logic modifiers
|
|
23
|
+
|
|
24
|
+
export var beforeMain = 'beforeMain';
|
|
25
|
+
export var main = 'main';
|
|
26
|
+
export var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
|
27
|
+
|
|
28
|
+
export var beforeWrite = 'beforeWrite';
|
|
29
|
+
export var write = 'write';
|
|
30
|
+
export var afterWrite = 'afterWrite';
|
|
31
|
+
export var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./enums.js";
|
|
2
|
+
export * from "./modifiers/index.js"; // eslint-disable-next-line import/no-unused-modules
|
|
3
|
+
|
|
4
|
+
export { popperGenerator, detectOverflow, createPopper as createPopperBase } from "./createPopper.js"; // eslint-disable-next-line import/no-unused-modules
|
|
5
|
+
|
|
6
|
+
export { createPopper } from "./popper.js"; // eslint-disable-next-line import/no-unused-modules
|
|
7
|
+
|
|
8
|
+
export { createPopper as createPopperLite } from "./popper-lite.js";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import getNodeName from "../dom-utils/getNodeName.js";
|
|
2
|
+
import { isHTMLElement } from "../dom-utils/instanceOf.js"; // This modifier takes the styles prepared by the `computeStyles` modifier
|
|
3
|
+
// and applies them to the HTMLElements such as popper and arrow
|
|
4
|
+
|
|
5
|
+
function applyStyles(_ref) {
|
|
6
|
+
var state = _ref.state;
|
|
7
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
8
|
+
var style = state.styles[name] || {};
|
|
9
|
+
var attributes = state.attributes[name] || {};
|
|
10
|
+
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
11
|
+
|
|
12
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
13
|
+
return;
|
|
14
|
+
} // Flow doesn't support to extend this property, but it's the most
|
|
15
|
+
// effective way to apply styles to an HTMLElement
|
|
16
|
+
// $FlowFixMe[cannot-write]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Object.assign(element.style, style);
|
|
20
|
+
Object.keys(attributes).forEach(function (name) {
|
|
21
|
+
var value = attributes[name];
|
|
22
|
+
|
|
23
|
+
if (value === false) {
|
|
24
|
+
element.removeAttribute(name);
|
|
25
|
+
} else {
|
|
26
|
+
element.setAttribute(name, value === true ? '' : value);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function effect(_ref2) {
|
|
33
|
+
var state = _ref2.state;
|
|
34
|
+
var initialStyles = {
|
|
35
|
+
popper: {
|
|
36
|
+
position: state.options.strategy,
|
|
37
|
+
left: '0',
|
|
38
|
+
top: '0',
|
|
39
|
+
margin: '0'
|
|
40
|
+
},
|
|
41
|
+
arrow: {
|
|
42
|
+
position: 'absolute'
|
|
43
|
+
},
|
|
44
|
+
reference: {}
|
|
45
|
+
};
|
|
46
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
47
|
+
state.styles = initialStyles;
|
|
48
|
+
|
|
49
|
+
if (state.elements.arrow) {
|
|
50
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return function () {
|
|
54
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
55
|
+
var element = state.elements[name];
|
|
56
|
+
var attributes = state.attributes[name] || {};
|
|
57
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
|
58
|
+
|
|
59
|
+
var style = styleProperties.reduce(function (style, property) {
|
|
60
|
+
style[property] = '';
|
|
61
|
+
return style;
|
|
62
|
+
}, {}); // arrow is optional + virtual elements
|
|
63
|
+
|
|
64
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Object.assign(element.style, style);
|
|
69
|
+
Object.keys(attributes).forEach(function (attribute) {
|
|
70
|
+
element.removeAttribute(attribute);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
name: 'applyStyles',
|
|
79
|
+
enabled: true,
|
|
80
|
+
phase: 'write',
|
|
81
|
+
fn: applyStyles,
|
|
82
|
+
effect: effect,
|
|
83
|
+
requires: ['computeStyles']
|
|
84
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import getBasePlacement from "../utils/getBasePlacement.js";
|
|
2
|
+
import getLayoutRect from "../dom-utils/getLayoutRect.js";
|
|
3
|
+
import contains from "../dom-utils/contains.js";
|
|
4
|
+
import getOffsetParent from "../dom-utils/getOffsetParent.js";
|
|
5
|
+
import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js";
|
|
6
|
+
import within from "../utils/within.js";
|
|
7
|
+
import mergePaddingObject from "../utils/mergePaddingObject.js";
|
|
8
|
+
import expandToHashMap from "../utils/expandToHashMap.js";
|
|
9
|
+
import { left, right, basePlacements, top, bottom } from "../enums.js";
|
|
10
|
+
import { isHTMLElement } from "../dom-utils/instanceOf.js"; // eslint-disable-next-line import/no-unused-modules
|
|
11
|
+
|
|
12
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
13
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
14
|
+
placement: state.placement
|
|
15
|
+
})) : padding;
|
|
16
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function arrow(_ref) {
|
|
20
|
+
var _state$modifiersData$;
|
|
21
|
+
|
|
22
|
+
var state = _ref.state,
|
|
23
|
+
name = _ref.name,
|
|
24
|
+
options = _ref.options;
|
|
25
|
+
var arrowElement = state.elements.arrow;
|
|
26
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
27
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
28
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
|
29
|
+
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
30
|
+
var len = isVertical ? 'height' : 'width';
|
|
31
|
+
|
|
32
|
+
if (!arrowElement || !popperOffsets) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
37
|
+
var arrowRect = getLayoutRect(arrowElement);
|
|
38
|
+
var minProp = axis === 'y' ? top : left;
|
|
39
|
+
var maxProp = axis === 'y' ? bottom : right;
|
|
40
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
41
|
+
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
42
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
43
|
+
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
44
|
+
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
45
|
+
// outside of the popper bounds
|
|
46
|
+
|
|
47
|
+
var min = paddingObject[minProp];
|
|
48
|
+
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
49
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
50
|
+
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
|
51
|
+
|
|
52
|
+
var axisProp = axis;
|
|
53
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function effect(_ref2) {
|
|
57
|
+
var state = _ref2.state,
|
|
58
|
+
options = _ref2.options;
|
|
59
|
+
var _options$element = options.element,
|
|
60
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
61
|
+
|
|
62
|
+
if (arrowElement == null) {
|
|
63
|
+
return;
|
|
64
|
+
} // CSS selector
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if (typeof arrowElement === 'string') {
|
|
68
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
69
|
+
|
|
70
|
+
if (!arrowElement) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (false) {
|
|
76
|
+
if (!isHTMLElement(arrowElement)) {
|
|
77
|
+
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
|
82
|
+
if (false) {
|
|
83
|
+
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
state.elements.arrow = arrowElement;
|
|
90
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
name: 'arrow',
|
|
95
|
+
enabled: true,
|
|
96
|
+
phase: 'main',
|
|
97
|
+
fn: arrow,
|
|
98
|
+
effect: effect,
|
|
99
|
+
requires: ['popperOffsets'],
|
|
100
|
+
requiresIfExists: ['preventOverflow']
|
|
101
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { top, left, right, bottom } from "../enums.js";
|
|
2
|
+
import getOffsetParent from "../dom-utils/getOffsetParent.js";
|
|
3
|
+
import getWindow from "../dom-utils/getWindow.js";
|
|
4
|
+
import getDocumentElement from "../dom-utils/getDocumentElement.js";
|
|
5
|
+
import getComputedStyle from "../dom-utils/getComputedStyle.js";
|
|
6
|
+
import getBasePlacement from "../utils/getBasePlacement.js";
|
|
7
|
+
import { round } from "../utils/math.js"; // eslint-disable-next-line import/no-unused-modules
|
|
8
|
+
|
|
9
|
+
var unsetSides = {
|
|
10
|
+
top: 'auto',
|
|
11
|
+
right: 'auto',
|
|
12
|
+
bottom: 'auto',
|
|
13
|
+
left: 'auto'
|
|
14
|
+
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
|
15
|
+
// Zooming can change the DPR, but it seems to report a value that will
|
|
16
|
+
// cleanly divide the values into the appropriate subpixels.
|
|
17
|
+
|
|
18
|
+
function roundOffsetsByDPR(_ref) {
|
|
19
|
+
var x = _ref.x,
|
|
20
|
+
y = _ref.y;
|
|
21
|
+
var win = window;
|
|
22
|
+
var dpr = win.devicePixelRatio || 1;
|
|
23
|
+
return {
|
|
24
|
+
x: round(round(x * dpr) / dpr) || 0,
|
|
25
|
+
y: round(round(y * dpr) / dpr) || 0
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function mapToStyles(_ref2) {
|
|
30
|
+
var _Object$assign2;
|
|
31
|
+
|
|
32
|
+
var popper = _ref2.popper,
|
|
33
|
+
popperRect = _ref2.popperRect,
|
|
34
|
+
placement = _ref2.placement,
|
|
35
|
+
offsets = _ref2.offsets,
|
|
36
|
+
position = _ref2.position,
|
|
37
|
+
gpuAcceleration = _ref2.gpuAcceleration,
|
|
38
|
+
adaptive = _ref2.adaptive,
|
|
39
|
+
roundOffsets = _ref2.roundOffsets;
|
|
40
|
+
|
|
41
|
+
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
|
42
|
+
_ref3$x = _ref3.x,
|
|
43
|
+
x = _ref3$x === void 0 ? 0 : _ref3$x,
|
|
44
|
+
_ref3$y = _ref3.y,
|
|
45
|
+
y = _ref3$y === void 0 ? 0 : _ref3$y;
|
|
46
|
+
|
|
47
|
+
var hasX = offsets.hasOwnProperty('x');
|
|
48
|
+
var hasY = offsets.hasOwnProperty('y');
|
|
49
|
+
var sideX = left;
|
|
50
|
+
var sideY = top;
|
|
51
|
+
var win = window;
|
|
52
|
+
|
|
53
|
+
if (adaptive) {
|
|
54
|
+
var offsetParent = getOffsetParent(popper);
|
|
55
|
+
var heightProp = 'clientHeight';
|
|
56
|
+
var widthProp = 'clientWidth';
|
|
57
|
+
|
|
58
|
+
if (offsetParent === getWindow(popper)) {
|
|
59
|
+
offsetParent = getDocumentElement(popper);
|
|
60
|
+
|
|
61
|
+
if (getComputedStyle(offsetParent).position !== 'static') {
|
|
62
|
+
heightProp = 'scrollHeight';
|
|
63
|
+
widthProp = 'scrollWidth';
|
|
64
|
+
}
|
|
65
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
offsetParent = offsetParent;
|
|
69
|
+
|
|
70
|
+
if (placement === top) {
|
|
71
|
+
sideY = bottom; // $FlowFixMe[prop-missing]
|
|
72
|
+
|
|
73
|
+
y -= offsetParent[heightProp] - popperRect.height;
|
|
74
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (placement === left) {
|
|
78
|
+
sideX = right; // $FlowFixMe[prop-missing]
|
|
79
|
+
|
|
80
|
+
x -= offsetParent[widthProp] - popperRect.width;
|
|
81
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var commonStyles = Object.assign({
|
|
86
|
+
position: position
|
|
87
|
+
}, adaptive && unsetSides);
|
|
88
|
+
|
|
89
|
+
if (gpuAcceleration) {
|
|
90
|
+
var _Object$assign;
|
|
91
|
+
|
|
92
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function computeStyles(_ref4) {
|
|
99
|
+
var state = _ref4.state,
|
|
100
|
+
options = _ref4.options;
|
|
101
|
+
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
102
|
+
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
103
|
+
_options$adaptive = options.adaptive,
|
|
104
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
105
|
+
_options$roundOffsets = options.roundOffsets,
|
|
106
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
107
|
+
|
|
108
|
+
if (false) {
|
|
109
|
+
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
|
|
110
|
+
|
|
111
|
+
if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
|
|
112
|
+
return transitionProperty.indexOf(property) >= 0;
|
|
113
|
+
})) {
|
|
114
|
+
console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var commonStyles = {
|
|
119
|
+
placement: getBasePlacement(state.placement),
|
|
120
|
+
popper: state.elements.popper,
|
|
121
|
+
popperRect: state.rects.popper,
|
|
122
|
+
gpuAcceleration: gpuAcceleration
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
126
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
127
|
+
offsets: state.modifiersData.popperOffsets,
|
|
128
|
+
position: state.options.strategy,
|
|
129
|
+
adaptive: adaptive,
|
|
130
|
+
roundOffsets: roundOffsets
|
|
131
|
+
})));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (state.modifiersData.arrow != null) {
|
|
135
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
136
|
+
offsets: state.modifiersData.arrow,
|
|
137
|
+
position: 'absolute',
|
|
138
|
+
adaptive: false,
|
|
139
|
+
roundOffsets: roundOffsets
|
|
140
|
+
})));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
144
|
+
'data-popper-placement': state.placement
|
|
145
|
+
});
|
|
146
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
export default {
|
|
150
|
+
name: 'computeStyles',
|
|
151
|
+
enabled: true,
|
|
152
|
+
phase: 'beforeWrite',
|
|
153
|
+
fn: computeStyles,
|
|
154
|
+
data: {}
|
|
155
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import getWindow from "../dom-utils/getWindow.js"; // eslint-disable-next-line import/no-unused-modules
|
|
2
|
+
|
|
3
|
+
var passive = {
|
|
4
|
+
passive: true
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
function effect(_ref) {
|
|
8
|
+
var state = _ref.state,
|
|
9
|
+
instance = _ref.instance,
|
|
10
|
+
options = _ref.options;
|
|
11
|
+
var _options$scroll = options.scroll,
|
|
12
|
+
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
13
|
+
_options$resize = options.resize,
|
|
14
|
+
resize = _options$resize === void 0 ? true : _options$resize;
|
|
15
|
+
var window = getWindow(state.elements.popper);
|
|
16
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
17
|
+
|
|
18
|
+
if (scroll) {
|
|
19
|
+
scrollParents.forEach(function (scrollParent) {
|
|
20
|
+
scrollParent.addEventListener('scroll', instance.update, passive);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (resize) {
|
|
25
|
+
window.addEventListener('resize', instance.update, passive);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return function () {
|
|
29
|
+
if (scroll) {
|
|
30
|
+
scrollParents.forEach(function (scrollParent) {
|
|
31
|
+
scrollParent.removeEventListener('scroll', instance.update, passive);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (resize) {
|
|
36
|
+
window.removeEventListener('resize', instance.update, passive);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'eventListeners',
|
|
44
|
+
enabled: true,
|
|
45
|
+
phase: 'write',
|
|
46
|
+
fn: function fn() {},
|
|
47
|
+
effect: effect,
|
|
48
|
+
data: {}
|
|
49
|
+
};
|