Initial commit
This commit is contained in:
84
wwwroot/lib/popper.js/esm/modifiers/applyStyles.js
Normal file
84
wwwroot/lib/popper.js/esm/modifiers/applyStyles.js
Normal file
@@ -0,0 +1,84 @@
|
||||
import getNodeName from "../dom-utils/getNodeName.js";
|
||||
import { isHTMLElement } from "../dom-utils/instanceOf.js"; // This modifier takes the styles prepared by the `computeStyles` modifier
|
||||
// and applies them to the HTMLElements such as popper and arrow
|
||||
|
||||
function applyStyles(_ref) {
|
||||
var state = _ref.state;
|
||||
Object.keys(state.elements).forEach(function (name) {
|
||||
var style = state.styles[name] || {};
|
||||
var attributes = state.attributes[name] || {};
|
||||
var element = state.elements[name]; // arrow is optional + virtual elements
|
||||
|
||||
if (!isHTMLElement(element) || !getNodeName(element)) {
|
||||
return;
|
||||
} // Flow doesn't support to extend this property, but it's the most
|
||||
// effective way to apply styles to an HTMLElement
|
||||
// $FlowFixMe[cannot-write]
|
||||
|
||||
|
||||
Object.assign(element.style, style);
|
||||
Object.keys(attributes).forEach(function (name) {
|
||||
var value = attributes[name];
|
||||
|
||||
if (value === false) {
|
||||
element.removeAttribute(name);
|
||||
} else {
|
||||
element.setAttribute(name, value === true ? '' : value);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function effect(_ref2) {
|
||||
var state = _ref2.state;
|
||||
var initialStyles = {
|
||||
popper: {
|
||||
position: state.options.strategy,
|
||||
left: '0',
|
||||
top: '0',
|
||||
margin: '0'
|
||||
},
|
||||
arrow: {
|
||||
position: 'absolute'
|
||||
},
|
||||
reference: {}
|
||||
};
|
||||
Object.assign(state.elements.popper.style, initialStyles.popper);
|
||||
state.styles = initialStyles;
|
||||
|
||||
if (state.elements.arrow) {
|
||||
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
||||
}
|
||||
|
||||
return function () {
|
||||
Object.keys(state.elements).forEach(function (name) {
|
||||
var element = state.elements[name];
|
||||
var attributes = state.attributes[name] || {};
|
||||
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
||||
|
||||
var style = styleProperties.reduce(function (style, property) {
|
||||
style[property] = '';
|
||||
return style;
|
||||
}, {}); // arrow is optional + virtual elements
|
||||
|
||||
if (!isHTMLElement(element) || !getNodeName(element)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object.assign(element.style, style);
|
||||
Object.keys(attributes).forEach(function (attribute) {
|
||||
element.removeAttribute(attribute);
|
||||
});
|
||||
});
|
||||
};
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'applyStyles',
|
||||
enabled: true,
|
||||
phase: 'write',
|
||||
fn: applyStyles,
|
||||
effect: effect,
|
||||
requires: ['computeStyles']
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/applyStyles.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/applyStyles.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import getNodeName from"../dom-utils/getNodeName.js";import{isHTMLElement}from"../dom-utils/instanceOf.js";function applyStyles(e){var n=e.state;Object.keys(n.elements).forEach(function(e){var t=n.styles[e]||{},s=n.attributes[e]||{},r=n.elements[e];isHTMLElement(r)&&getNodeName(r)&&(Object.assign(r.style,t),Object.keys(s).forEach(function(e){var t=s[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})}function effect(e){var r=e.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow),function(){Object.keys(r.elements).forEach(function(e){var t=r.elements[e],s=r.attributes[e]||{},e=Object.keys((r.styles.hasOwnProperty(e)?r.styles:n)[e]).reduce(function(e,t){return e[t]="",e},{});isHTMLElement(t)&&getNodeName(t)&&(Object.assign(t.style,e),Object.keys(s).forEach(function(e){t.removeAttribute(e)}))})}}export default{name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect,requires:["computeStyles"]};
|
||||
101
wwwroot/lib/popper.js/esm/modifiers/arrow.js
Normal file
101
wwwroot/lib/popper.js/esm/modifiers/arrow.js
Normal file
@@ -0,0 +1,101 @@
|
||||
import getBasePlacement from "../utils/getBasePlacement.js";
|
||||
import getLayoutRect from "../dom-utils/getLayoutRect.js";
|
||||
import contains from "../dom-utils/contains.js";
|
||||
import getOffsetParent from "../dom-utils/getOffsetParent.js";
|
||||
import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js";
|
||||
import { within } from "../utils/within.js";
|
||||
import mergePaddingObject from "../utils/mergePaddingObject.js";
|
||||
import expandToHashMap from "../utils/expandToHashMap.js";
|
||||
import { left, right, basePlacements, top, bottom } from "../enums.js";
|
||||
import { isHTMLElement } from "../dom-utils/instanceOf.js"; // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
var toPaddingObject = function toPaddingObject(padding, state) {
|
||||
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
||||
placement: state.placement
|
||||
})) : padding;
|
||||
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
||||
};
|
||||
|
||||
function arrow(_ref) {
|
||||
var _state$modifiersData$;
|
||||
|
||||
var state = _ref.state,
|
||||
name = _ref.name,
|
||||
options = _ref.options;
|
||||
var arrowElement = state.elements.arrow;
|
||||
var popperOffsets = state.modifiersData.popperOffsets;
|
||||
var basePlacement = getBasePlacement(state.placement);
|
||||
var axis = getMainAxisFromPlacement(basePlacement);
|
||||
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
||||
var len = isVertical ? 'height' : 'width';
|
||||
|
||||
if (!arrowElement || !popperOffsets) {
|
||||
return;
|
||||
}
|
||||
|
||||
var paddingObject = toPaddingObject(options.padding, state);
|
||||
var arrowRect = getLayoutRect(arrowElement);
|
||||
var minProp = axis === 'y' ? top : left;
|
||||
var maxProp = axis === 'y' ? bottom : right;
|
||||
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
||||
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
||||
var arrowOffsetParent = getOffsetParent(arrowElement);
|
||||
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
||||
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
||||
// outside of the popper bounds
|
||||
|
||||
var min = paddingObject[minProp];
|
||||
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
||||
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
||||
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
||||
|
||||
var axisProp = axis;
|
||||
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
||||
}
|
||||
|
||||
function effect(_ref2) {
|
||||
var state = _ref2.state,
|
||||
options = _ref2.options;
|
||||
var _options$element = options.element,
|
||||
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
||||
|
||||
if (arrowElement == null) {
|
||||
return;
|
||||
} // CSS selector
|
||||
|
||||
|
||||
if (typeof arrowElement === 'string') {
|
||||
arrowElement = state.elements.popper.querySelector(arrowElement);
|
||||
|
||||
if (!arrowElement) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (false) {
|
||||
if (!isHTMLElement(arrowElement)) {
|
||||
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(' '));
|
||||
}
|
||||
}
|
||||
|
||||
if (!contains(state.elements.popper, arrowElement)) {
|
||||
if (false) {
|
||||
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
state.elements.arrow = arrowElement;
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'arrow',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
fn: arrow,
|
||||
effect: effect,
|
||||
requires: ['popperOffsets'],
|
||||
requiresIfExists: ['preventOverflow']
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/arrow.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/arrow.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import getBasePlacement from"../utils/getBasePlacement.js";import getLayoutRect from"../dom-utils/getLayoutRect.js";import contains from"../dom-utils/contains.js";import getOffsetParent from"../dom-utils/getOffsetParent.js";import getMainAxisFromPlacement from"../utils/getMainAxisFromPlacement.js";import{within}from"../utils/within.js";import mergePaddingObject from"../utils/mergePaddingObject.js";import expandToHashMap from"../utils/expandToHashMap.js";import{left,right,basePlacements,top,bottom}from"../enums.js";import{isHTMLElement}from"../dom-utils/instanceOf.js";var toPaddingObject=function(e,t){return e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e,mergePaddingObject("number"!=typeof e?e:expandToHashMap(e,basePlacements))};function arrow(e){var t,r,o,n,i=e.state,s=e.name,e=e.options,a=i.elements.arrow,m=i.modifiersData.popperOffsets,f=getBasePlacement(i.placement),p=getMainAxisFromPlacement(f),f=0<=[left,right].indexOf(f)?"height":"width";a&&m&&(e=toPaddingObject(e.padding,i),t=getLayoutRect(a),o="y"===p?top:left,n="y"===p?bottom:right,r=i.rects.reference[f]+i.rects.reference[p]-m[p]-i.rects.popper[f],m=m[p]-i.rects.reference[p],a=(a=getOffsetParent(a))?"y"===p?a.clientHeight||0:a.clientWidth||0:0,o=e[o],e=a-t[f]-e[n],n=a/2-t[f]/2+(r/2-m/2),a=within(o,n,e),i.modifiersData[s]=((t={})[p]=a,t.centerOffset=a-n,t))}function effect(e){var t=e.state,e=e.options.element,e=void 0===e?"[data-popper-arrow]":e;null!=e&&("string"!=typeof e||(e=t.elements.popper.querySelector(e)))&&contains(t.elements.popper,e)&&(t.elements.arrow=e)}export default{name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};
|
||||
181
wwwroot/lib/popper.js/esm/modifiers/computeStyles.js
Normal file
181
wwwroot/lib/popper.js/esm/modifiers/computeStyles.js
Normal file
@@ -0,0 +1,181 @@
|
||||
import { top, left, right, bottom, end } from "../enums.js";
|
||||
import getOffsetParent from "../dom-utils/getOffsetParent.js";
|
||||
import getWindow from "../dom-utils/getWindow.js";
|
||||
import getDocumentElement from "../dom-utils/getDocumentElement.js";
|
||||
import getComputedStyle from "../dom-utils/getComputedStyle.js";
|
||||
import getBasePlacement from "../utils/getBasePlacement.js";
|
||||
import getVariation from "../utils/getVariation.js";
|
||||
import { round } from "../utils/math.js"; // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
var unsetSides = {
|
||||
top: 'auto',
|
||||
right: 'auto',
|
||||
bottom: 'auto',
|
||||
left: 'auto'
|
||||
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
||||
// Zooming can change the DPR, but it seems to report a value that will
|
||||
// cleanly divide the values into the appropriate subpixels.
|
||||
|
||||
function roundOffsetsByDPR(_ref) {
|
||||
var x = _ref.x,
|
||||
y = _ref.y;
|
||||
var win = window;
|
||||
var dpr = win.devicePixelRatio || 1;
|
||||
return {
|
||||
x: round(x * dpr) / dpr || 0,
|
||||
y: round(y * dpr) / dpr || 0
|
||||
};
|
||||
}
|
||||
|
||||
export function mapToStyles(_ref2) {
|
||||
var _Object$assign2;
|
||||
|
||||
var popper = _ref2.popper,
|
||||
popperRect = _ref2.popperRect,
|
||||
placement = _ref2.placement,
|
||||
variation = _ref2.variation,
|
||||
offsets = _ref2.offsets,
|
||||
position = _ref2.position,
|
||||
gpuAcceleration = _ref2.gpuAcceleration,
|
||||
adaptive = _ref2.adaptive,
|
||||
roundOffsets = _ref2.roundOffsets,
|
||||
isFixed = _ref2.isFixed;
|
||||
var _offsets$x = offsets.x,
|
||||
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
||||
_offsets$y = offsets.y,
|
||||
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
||||
|
||||
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
||||
x: x,
|
||||
y: y
|
||||
}) : {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
|
||||
x = _ref3.x;
|
||||
y = _ref3.y;
|
||||
var hasX = offsets.hasOwnProperty('x');
|
||||
var hasY = offsets.hasOwnProperty('y');
|
||||
var sideX = left;
|
||||
var sideY = top;
|
||||
var win = window;
|
||||
|
||||
if (adaptive) {
|
||||
var offsetParent = getOffsetParent(popper);
|
||||
var heightProp = 'clientHeight';
|
||||
var widthProp = 'clientWidth';
|
||||
|
||||
if (offsetParent === getWindow(popper)) {
|
||||
offsetParent = getDocumentElement(popper);
|
||||
|
||||
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
||||
heightProp = 'scrollHeight';
|
||||
widthProp = 'scrollWidth';
|
||||
}
|
||||
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
||||
|
||||
|
||||
offsetParent = offsetParent;
|
||||
|
||||
if (placement === top || (placement === left || placement === right) && variation === end) {
|
||||
sideY = bottom;
|
||||
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
||||
offsetParent[heightProp];
|
||||
y -= offsetY - popperRect.height;
|
||||
y *= gpuAcceleration ? 1 : -1;
|
||||
}
|
||||
|
||||
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
||||
sideX = right;
|
||||
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
||||
offsetParent[widthProp];
|
||||
x -= offsetX - popperRect.width;
|
||||
x *= gpuAcceleration ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
var commonStyles = Object.assign({
|
||||
position: position
|
||||
}, adaptive && unsetSides);
|
||||
|
||||
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
||||
x: x,
|
||||
y: y
|
||||
}) : {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
|
||||
x = _ref4.x;
|
||||
y = _ref4.y;
|
||||
|
||||
if (gpuAcceleration) {
|
||||
var _Object$assign;
|
||||
|
||||
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
||||
}
|
||||
|
||||
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
||||
}
|
||||
|
||||
function computeStyles(_ref5) {
|
||||
var state = _ref5.state,
|
||||
options = _ref5.options;
|
||||
var _options$gpuAccelerat = options.gpuAcceleration,
|
||||
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
||||
_options$adaptive = options.adaptive,
|
||||
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
||||
_options$roundOffsets = options.roundOffsets,
|
||||
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
||||
|
||||
if (false) {
|
||||
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
|
||||
|
||||
if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
|
||||
return transitionProperty.indexOf(property) >= 0;
|
||||
})) {
|
||||
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(' '));
|
||||
}
|
||||
}
|
||||
|
||||
var commonStyles = {
|
||||
placement: getBasePlacement(state.placement),
|
||||
variation: getVariation(state.placement),
|
||||
popper: state.elements.popper,
|
||||
popperRect: state.rects.popper,
|
||||
gpuAcceleration: gpuAcceleration,
|
||||
isFixed: state.options.strategy === 'fixed'
|
||||
};
|
||||
|
||||
if (state.modifiersData.popperOffsets != null) {
|
||||
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
||||
offsets: state.modifiersData.popperOffsets,
|
||||
position: state.options.strategy,
|
||||
adaptive: adaptive,
|
||||
roundOffsets: roundOffsets
|
||||
})));
|
||||
}
|
||||
|
||||
if (state.modifiersData.arrow != null) {
|
||||
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
||||
offsets: state.modifiersData.arrow,
|
||||
position: 'absolute',
|
||||
adaptive: false,
|
||||
roundOffsets: roundOffsets
|
||||
})));
|
||||
}
|
||||
|
||||
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
||||
'data-popper-placement': state.placement
|
||||
});
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'computeStyles',
|
||||
enabled: true,
|
||||
phase: 'beforeWrite',
|
||||
fn: computeStyles,
|
||||
data: {}
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/computeStyles.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/computeStyles.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{top,left,right,bottom,end}from"../enums.js";import getOffsetParent from"../dom-utils/getOffsetParent.js";import getWindow from"../dom-utils/getWindow.js";import getDocumentElement from"../dom-utils/getDocumentElement.js";import getComputedStyle from"../dom-utils/getComputedStyle.js";import getBasePlacement from"../utils/getBasePlacement.js";import getVariation from"../utils/getVariation.js";import{round}from"../utils/math.js";var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t){var e=t.x,t=t.y,o=window.devicePixelRatio||1;return{x:round(e*o)/o||0,y:round(t*o)/o||0}}function mapToStyles(t){var e,o,s=t.popper,i=t.popperRect,a=t.placement,p=t.variation,r=t.offsets,n=t.position,l=t.gpuAcceleration,m=t.adaptive,f=t.roundOffsets,t=t.isFixed,d=r.x,d=void 0===d?0:d,u=r.y,u=void 0===u?0:u,c="function"==typeof f?f({x:d,y:u}):{x:d,y:u},c=(d=c.x,u=c.y,r.hasOwnProperty("x")),r=r.hasOwnProperty("y"),g=left,y=top,x=window,s=(m&&(v="clientHeight",o="clientWidth",(e=getOffsetParent(s))===getWindow(s)&&(e=getDocumentElement(s),"static"!==getComputedStyle(e).position&&"absolute"===n&&(v="scrollHeight",o="scrollWidth")),a!==top&&(a!==left&&a!==right||p!==end)||(y=bottom,u=(u-((t&&e===x&&x.visualViewport?x.visualViewport.height:e[v])-i.height))*(l?1:-1)),a!==left&&(a!==top&&a!==bottom||p!==end)||(g=right,d=(d-((t&&e===x&&x.visualViewport?x.visualViewport.width:e[o])-i.width))*(l?1:-1))),Object.assign({position:n},m&&unsetSides)),v=!0===f?roundOffsetsByDPR({x:d,y:u}):{x:d,y:u};return d=v.x,u=v.y,l?Object.assign({},s,((a={})[y]=r?"0":"",a[g]=c?"0":"",a.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+u+"px)":"translate3d("+d+"px, "+u+"px, 0)",a)):Object.assign({},s,((p={})[y]=r?u+"px":"",p[g]=c?d+"px":"",p.transform="",p))}function computeStyles(t){var e=t.state,t=t.options,o=t.gpuAcceleration,o=void 0===o||o,s=t.adaptive,s=void 0===s||s,t=t.roundOffsets,t=void 0===t||t,o={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},o,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:t})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},o,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:t})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}export default{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};export{mapToStyles};
|
||||
49
wwwroot/lib/popper.js/esm/modifiers/eventListeners.js
Normal file
49
wwwroot/lib/popper.js/esm/modifiers/eventListeners.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import getWindow from "../dom-utils/getWindow.js"; // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
var passive = {
|
||||
passive: true
|
||||
};
|
||||
|
||||
function effect(_ref) {
|
||||
var state = _ref.state,
|
||||
instance = _ref.instance,
|
||||
options = _ref.options;
|
||||
var _options$scroll = options.scroll,
|
||||
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
||||
_options$resize = options.resize,
|
||||
resize = _options$resize === void 0 ? true : _options$resize;
|
||||
var window = getWindow(state.elements.popper);
|
||||
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
||||
|
||||
if (scroll) {
|
||||
scrollParents.forEach(function (scrollParent) {
|
||||
scrollParent.addEventListener('scroll', instance.update, passive);
|
||||
});
|
||||
}
|
||||
|
||||
if (resize) {
|
||||
window.addEventListener('resize', instance.update, passive);
|
||||
}
|
||||
|
||||
return function () {
|
||||
if (scroll) {
|
||||
scrollParents.forEach(function (scrollParent) {
|
||||
scrollParent.removeEventListener('scroll', instance.update, passive);
|
||||
});
|
||||
}
|
||||
|
||||
if (resize) {
|
||||
window.removeEventListener('resize', instance.update, passive);
|
||||
}
|
||||
};
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'eventListeners',
|
||||
enabled: true,
|
||||
phase: 'write',
|
||||
fn: function fn() {},
|
||||
effect: effect,
|
||||
data: {}
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/eventListeners.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/eventListeners.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import getWindow from"../dom-utils/getWindow.js";var passive={passive:!0};function effect(e){var t=e.state,n=e.instance,e=e.options,s=e.scroll,r=void 0===s||s,s=e.resize,i=void 0===s||s,o=getWindow(t.elements.popper),a=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&a.forEach(function(e){e.addEventListener("scroll",n.update,passive)}),i&&o.addEventListener("resize",n.update,passive),function(){r&&a.forEach(function(e){e.removeEventListener("scroll",n.update,passive)}),i&&o.removeEventListener("resize",n.update,passive)}}export default{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:effect,data:{}};
|
||||
147
wwwroot/lib/popper.js/esm/modifiers/flip.js
Normal file
147
wwwroot/lib/popper.js/esm/modifiers/flip.js
Normal file
@@ -0,0 +1,147 @@
|
||||
import getOppositePlacement from "../utils/getOppositePlacement.js";
|
||||
import getBasePlacement from "../utils/getBasePlacement.js";
|
||||
import getOppositeVariationPlacement from "../utils/getOppositeVariationPlacement.js";
|
||||
import detectOverflow from "../utils/detectOverflow.js";
|
||||
import computeAutoPlacement from "../utils/computeAutoPlacement.js";
|
||||
import { bottom, top, start, right, left, auto } from "../enums.js";
|
||||
import getVariation from "../utils/getVariation.js"; // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
function getExpandedFallbackPlacements(placement) {
|
||||
if (getBasePlacement(placement) === auto) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var oppositePlacement = getOppositePlacement(placement);
|
||||
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
||||
}
|
||||
|
||||
function flip(_ref) {
|
||||
var state = _ref.state,
|
||||
options = _ref.options,
|
||||
name = _ref.name;
|
||||
|
||||
if (state.modifiersData[name]._skip) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _options$mainAxis = options.mainAxis,
|
||||
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
||||
_options$altAxis = options.altAxis,
|
||||
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
||||
specifiedFallbackPlacements = options.fallbackPlacements,
|
||||
padding = options.padding,
|
||||
boundary = options.boundary,
|
||||
rootBoundary = options.rootBoundary,
|
||||
altBoundary = options.altBoundary,
|
||||
_options$flipVariatio = options.flipVariations,
|
||||
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
||||
allowedAutoPlacements = options.allowedAutoPlacements;
|
||||
var preferredPlacement = state.options.placement;
|
||||
var basePlacement = getBasePlacement(preferredPlacement);
|
||||
var isBasePlacement = basePlacement === preferredPlacement;
|
||||
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
||||
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
||||
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
||||
placement: placement,
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
padding: padding,
|
||||
flipVariations: flipVariations,
|
||||
allowedAutoPlacements: allowedAutoPlacements
|
||||
}) : placement);
|
||||
}, []);
|
||||
var referenceRect = state.rects.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var checksMap = new Map();
|
||||
var makeFallbackChecks = true;
|
||||
var firstFittingPlacement = placements[0];
|
||||
|
||||
for (var i = 0; i < placements.length; i++) {
|
||||
var placement = placements[i];
|
||||
|
||||
var _basePlacement = getBasePlacement(placement);
|
||||
|
||||
var isStartVariation = getVariation(placement) === start;
|
||||
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
||||
var len = isVertical ? 'width' : 'height';
|
||||
var overflow = detectOverflow(state, {
|
||||
placement: placement,
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
altBoundary: altBoundary,
|
||||
padding: padding
|
||||
});
|
||||
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
||||
|
||||
if (referenceRect[len] > popperRect[len]) {
|
||||
mainVariationSide = getOppositePlacement(mainVariationSide);
|
||||
}
|
||||
|
||||
var altVariationSide = getOppositePlacement(mainVariationSide);
|
||||
var checks = [];
|
||||
|
||||
if (checkMainAxis) {
|
||||
checks.push(overflow[_basePlacement] <= 0);
|
||||
}
|
||||
|
||||
if (checkAltAxis) {
|
||||
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
||||
}
|
||||
|
||||
if (checks.every(function (check) {
|
||||
return check;
|
||||
})) {
|
||||
firstFittingPlacement = placement;
|
||||
makeFallbackChecks = false;
|
||||
break;
|
||||
}
|
||||
|
||||
checksMap.set(placement, checks);
|
||||
}
|
||||
|
||||
if (makeFallbackChecks) {
|
||||
// `2` may be desired in some cases – research later
|
||||
var numberOfChecks = flipVariations ? 3 : 1;
|
||||
|
||||
var _loop = function _loop(_i) {
|
||||
var fittingPlacement = placements.find(function (placement) {
|
||||
var checks = checksMap.get(placement);
|
||||
|
||||
if (checks) {
|
||||
return checks.slice(0, _i).every(function (check) {
|
||||
return check;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (fittingPlacement) {
|
||||
firstFittingPlacement = fittingPlacement;
|
||||
return "break";
|
||||
}
|
||||
};
|
||||
|
||||
for (var _i = numberOfChecks; _i > 0; _i--) {
|
||||
var _ret = _loop(_i);
|
||||
|
||||
if (_ret === "break") break;
|
||||
}
|
||||
}
|
||||
|
||||
if (state.placement !== firstFittingPlacement) {
|
||||
state.modifiersData[name]._skip = true;
|
||||
state.placement = firstFittingPlacement;
|
||||
state.reset = true;
|
||||
}
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'flip',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
fn: flip,
|
||||
requiresIfExists: ['offset'],
|
||||
data: {
|
||||
_skip: false
|
||||
}
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/flip.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/flip.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import getOppositePlacement from"../utils/getOppositePlacement.js";import getBasePlacement from"../utils/getBasePlacement.js";import getOppositeVariationPlacement from"../utils/getOppositeVariationPlacement.js";import detectOverflow from"../utils/detectOverflow.js";import computeAutoPlacement from"../utils/computeAutoPlacement.js";import{bottom,top,start,right,left,auto}from"../enums.js";import getVariation from"../utils/getVariation.js";function getExpandedFallbackPlacements(e){if(getBasePlacement(e)===auto)return[];var t=getOppositePlacement(e);return[getOppositeVariationPlacement(e),t,getOppositeVariationPlacement(t)]}function flip(e){var a=e.state,t=e.options,e=e.name;if(!a.modifiersData[e]._skip){for(var o=t.mainAxis,i=void 0===o||o,o=t.altAxis,n=void 0===o||o,o=t.fallbackPlacements,r=t.padding,l=t.boundary,p=t.rootBoundary,s=t.altBoundary,m=t.flipVariations,c=void 0===m||m,u=t.allowedAutoPlacements,m=a.options.placement,t=getBasePlacement(m),o=o||(t===m||!c?[getOppositePlacement(m)]:getExpandedFallbackPlacements(m)),f=[m].concat(o).reduce(function(e,t){return e.concat(getBasePlacement(t)===auto?computeAutoPlacement(a,{placement:t,boundary:l,rootBoundary:p,padding:r,flipVariations:c,allowedAutoPlacements:u}):t)},[]),d=a.rects.reference,g=a.rects.popper,P=new Map,b=!0,v=f[0],O=0;O<f.length;O++){var B=f[O],k=getBasePlacement(B),y=getVariation(B)===start,h=0<=[top,bottom].indexOf(k),V=h?"width":"height",j=detectOverflow(a,{placement:B,boundary:l,rootBoundary:p,altBoundary:s,padding:r}),h=h?y?right:left:y?bottom:top,y=(d[V]>g[V]&&(h=getOppositePlacement(h)),getOppositePlacement(h)),V=[];if(i&&V.push(j[k]<=0),n&&V.push(j[h]<=0,j[y]<=0),V.every(function(e){return e})){v=B,b=!1;break}P.set(B,V)}if(b)for(var w=c?3:1;0<w;w--)if("break"===function(t){var e=f.find(function(e){e=P.get(e);if(e)return e.slice(0,t).every(function(e){return e})});if(e)return v=e,"break"}(w))break;a.placement!==v&&(a.modifiersData[e]._skip=!0,a.placement=v,a.reset=!0)}}export default{name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};
|
||||
61
wwwroot/lib/popper.js/esm/modifiers/hide.js
Normal file
61
wwwroot/lib/popper.js/esm/modifiers/hide.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import { top, bottom, left, right } from "../enums.js";
|
||||
import detectOverflow from "../utils/detectOverflow.js";
|
||||
|
||||
function getSideOffsets(overflow, rect, preventedOffsets) {
|
||||
if (preventedOffsets === void 0) {
|
||||
preventedOffsets = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
top: overflow.top - rect.height - preventedOffsets.y,
|
||||
right: overflow.right - rect.width + preventedOffsets.x,
|
||||
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
||||
left: overflow.left - rect.width - preventedOffsets.x
|
||||
};
|
||||
}
|
||||
|
||||
function isAnySideFullyClipped(overflow) {
|
||||
return [top, right, bottom, left].some(function (side) {
|
||||
return overflow[side] >= 0;
|
||||
});
|
||||
}
|
||||
|
||||
function hide(_ref) {
|
||||
var state = _ref.state,
|
||||
name = _ref.name;
|
||||
var referenceRect = state.rects.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var preventedOffsets = state.modifiersData.preventOverflow;
|
||||
var referenceOverflow = detectOverflow(state, {
|
||||
elementContext: 'reference'
|
||||
});
|
||||
var popperAltOverflow = detectOverflow(state, {
|
||||
altBoundary: true
|
||||
});
|
||||
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
||||
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
||||
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
||||
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
||||
state.modifiersData[name] = {
|
||||
referenceClippingOffsets: referenceClippingOffsets,
|
||||
popperEscapeOffsets: popperEscapeOffsets,
|
||||
isReferenceHidden: isReferenceHidden,
|
||||
hasPopperEscaped: hasPopperEscaped
|
||||
};
|
||||
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
||||
'data-popper-reference-hidden': isReferenceHidden,
|
||||
'data-popper-escaped': hasPopperEscaped
|
||||
});
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'hide',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
requiresIfExists: ['preventOverflow'],
|
||||
fn: hide
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/hide.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/hide.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{top,bottom,left,right}from"../enums.js";import detectOverflow from"../utils/detectOverflow.js";function getSideOffsets(e,t,r){return{top:e.top-t.height-(r=void 0===r?{x:0,y:0}:r).y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function isAnySideFullyClipped(t){return[top,right,bottom,left].some(function(e){return 0<=t[e]})}function hide(e){var t=e.state,e=e.name,r=t.rects.reference,i=t.rects.popper,p=t.modifiersData.preventOverflow,o=detectOverflow(t,{elementContext:"reference"}),f=detectOverflow(t,{altBoundary:!0}),o=getSideOffsets(o,r),r=getSideOffsets(f,i,p),f=isAnySideFullyClipped(o),i=isAnySideFullyClipped(r);t.modifiersData[e]={referenceClippingOffsets:o,popperEscapeOffsets:r,isReferenceHidden:f,hasPopperEscaped:i},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":i})}export default{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};
|
||||
9
wwwroot/lib/popper.js/esm/modifiers/index.js
Normal file
9
wwwroot/lib/popper.js/esm/modifiers/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
export { default as applyStyles } from "./applyStyles.js";
|
||||
export { default as arrow } from "./arrow.js";
|
||||
export { default as computeStyles } from "./computeStyles.js";
|
||||
export { default as eventListeners } from "./eventListeners.js";
|
||||
export { default as flip } from "./flip.js";
|
||||
export { default as hide } from "./hide.js";
|
||||
export { default as offset } from "./offset.js";
|
||||
export { default as popperOffsets } from "./popperOffsets.js";
|
||||
export { default as preventOverflow } from "./preventOverflow.js";
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/index.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/index.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export{default as applyStyles}from"./applyStyles.js";export{default as arrow}from"./arrow.js";export{default as computeStyles}from"./computeStyles.js";export{default as eventListeners}from"./eventListeners.js";export{default as flip}from"./flip.js";export{default as hide}from"./hide.js";export{default as offset}from"./offset.js";export{default as popperOffsets}from"./popperOffsets.js";export{default as preventOverflow}from"./preventOverflow.js";
|
||||
54
wwwroot/lib/popper.js/esm/modifiers/offset.js
Normal file
54
wwwroot/lib/popper.js/esm/modifiers/offset.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import getBasePlacement from "../utils/getBasePlacement.js";
|
||||
import { top, left, right, placements } from "../enums.js"; // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
export function distanceAndSkiddingToXY(placement, rects, offset) {
|
||||
var basePlacement = getBasePlacement(placement);
|
||||
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
||||
|
||||
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
||||
placement: placement
|
||||
})) : offset,
|
||||
skidding = _ref[0],
|
||||
distance = _ref[1];
|
||||
|
||||
skidding = skidding || 0;
|
||||
distance = (distance || 0) * invertDistance;
|
||||
return [left, right].indexOf(basePlacement) >= 0 ? {
|
||||
x: distance,
|
||||
y: skidding
|
||||
} : {
|
||||
x: skidding,
|
||||
y: distance
|
||||
};
|
||||
}
|
||||
|
||||
function offset(_ref2) {
|
||||
var state = _ref2.state,
|
||||
options = _ref2.options,
|
||||
name = _ref2.name;
|
||||
var _options$offset = options.offset,
|
||||
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
||||
var data = placements.reduce(function (acc, placement) {
|
||||
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
||||
return acc;
|
||||
}, {});
|
||||
var _data$state$placement = data[state.placement],
|
||||
x = _data$state$placement.x,
|
||||
y = _data$state$placement.y;
|
||||
|
||||
if (state.modifiersData.popperOffsets != null) {
|
||||
state.modifiersData.popperOffsets.x += x;
|
||||
state.modifiersData.popperOffsets.y += y;
|
||||
}
|
||||
|
||||
state.modifiersData[name] = data;
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'offset',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
requires: ['popperOffsets'],
|
||||
fn: offset
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/offset.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/offset.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import getBasePlacement from"../utils/getBasePlacement.js";import{top,left,right,placements}from"../enums.js";function distanceAndSkiddingToXY(e,t,n){var s=getBasePlacement(e),f=0<=[left,top].indexOf(s)?-1:1,t="function"==typeof n?n(Object.assign({},t,{placement:e})):n,e=t[0]||0,n=(t[1]||0)*f;return 0<=[left,right].indexOf(s)?{x:n,y:e}:{x:e,y:n}}function offset(e){var n=e.state,t=e.options,e=e.name,t=t.offset,s=void 0===t?[0,0]:t,t=placements.reduce(function(e,t){return e[t]=distanceAndSkiddingToXY(t,n.rects,s),e},{}),f=t[n.placement],i=f.x,f=f.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=i,n.modifiersData.popperOffsets.y+=f),n.modifiersData[e]=t}export default{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};export{distanceAndSkiddingToXY};
|
||||
25
wwwroot/lib/popper.js/esm/modifiers/popperOffsets.js
Normal file
25
wwwroot/lib/popper.js/esm/modifiers/popperOffsets.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import computeOffsets from "../utils/computeOffsets.js";
|
||||
|
||||
function popperOffsets(_ref) {
|
||||
var state = _ref.state,
|
||||
name = _ref.name;
|
||||
// Offsets are the actual position the popper needs to have to be
|
||||
// properly positioned near its reference element
|
||||
// This is the most basic placement, and will be adjusted by
|
||||
// the modifiers in the next step
|
||||
state.modifiersData[name] = computeOffsets({
|
||||
reference: state.rects.reference,
|
||||
element: state.rects.popper,
|
||||
strategy: 'absolute',
|
||||
placement: state.placement
|
||||
});
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'popperOffsets',
|
||||
enabled: true,
|
||||
phase: 'read',
|
||||
fn: popperOffsets,
|
||||
data: {}
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/popperOffsets.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/popperOffsets.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import computeOffsets from"../utils/computeOffsets.js";function popperOffsets(e){var t=e.state,e=e.name;t.modifiersData[e]=computeOffsets({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}export default{name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};
|
||||
142
wwwroot/lib/popper.js/esm/modifiers/preventOverflow.js
Normal file
142
wwwroot/lib/popper.js/esm/modifiers/preventOverflow.js
Normal file
@@ -0,0 +1,142 @@
|
||||
import { top, left, right, bottom, start } from "../enums.js";
|
||||
import getBasePlacement from "../utils/getBasePlacement.js";
|
||||
import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js";
|
||||
import getAltAxis from "../utils/getAltAxis.js";
|
||||
import { within, withinMaxClamp } from "../utils/within.js";
|
||||
import getLayoutRect from "../dom-utils/getLayoutRect.js";
|
||||
import getOffsetParent from "../dom-utils/getOffsetParent.js";
|
||||
import detectOverflow from "../utils/detectOverflow.js";
|
||||
import getVariation from "../utils/getVariation.js";
|
||||
import getFreshSideObject from "../utils/getFreshSideObject.js";
|
||||
import { min as mathMin, max as mathMax } from "../utils/math.js";
|
||||
|
||||
function preventOverflow(_ref) {
|
||||
var state = _ref.state,
|
||||
options = _ref.options,
|
||||
name = _ref.name;
|
||||
var _options$mainAxis = options.mainAxis,
|
||||
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
||||
_options$altAxis = options.altAxis,
|
||||
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
||||
boundary = options.boundary,
|
||||
rootBoundary = options.rootBoundary,
|
||||
altBoundary = options.altBoundary,
|
||||
padding = options.padding,
|
||||
_options$tether = options.tether,
|
||||
tether = _options$tether === void 0 ? true : _options$tether,
|
||||
_options$tetherOffset = options.tetherOffset,
|
||||
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
||||
var overflow = detectOverflow(state, {
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
padding: padding,
|
||||
altBoundary: altBoundary
|
||||
});
|
||||
var basePlacement = getBasePlacement(state.placement);
|
||||
var variation = getVariation(state.placement);
|
||||
var isBasePlacement = !variation;
|
||||
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
||||
var altAxis = getAltAxis(mainAxis);
|
||||
var popperOffsets = state.modifiersData.popperOffsets;
|
||||
var referenceRect = state.rects.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
||||
placement: state.placement
|
||||
})) : tetherOffset;
|
||||
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
||||
mainAxis: tetherOffsetValue,
|
||||
altAxis: tetherOffsetValue
|
||||
} : Object.assign({
|
||||
mainAxis: 0,
|
||||
altAxis: 0
|
||||
}, tetherOffsetValue);
|
||||
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
||||
var data = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
|
||||
if (!popperOffsets) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkMainAxis) {
|
||||
var _offsetModifierState$;
|
||||
|
||||
var mainSide = mainAxis === 'y' ? top : left;
|
||||
var altSide = mainAxis === 'y' ? bottom : right;
|
||||
var len = mainAxis === 'y' ? 'height' : 'width';
|
||||
var offset = popperOffsets[mainAxis];
|
||||
var min = offset + overflow[mainSide];
|
||||
var max = offset - overflow[altSide];
|
||||
var additive = tether ? -popperRect[len] / 2 : 0;
|
||||
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
||||
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
||||
// outside the reference bounds
|
||||
|
||||
var arrowElement = state.elements.arrow;
|
||||
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
||||
width: 0,
|
||||
height: 0
|
||||
};
|
||||
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
||||
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
||||
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
||||
// to include its full size in the calculation. If the reference is small
|
||||
// and near the edge of a boundary, the popper can overflow even if the
|
||||
// reference is not overflowing as well (e.g. virtual elements with no
|
||||
// width or height)
|
||||
|
||||
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
||||
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
||||
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
||||
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
||||
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
||||
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
||||
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
||||
var tetherMax = offset + maxOffset - offsetModifierValue;
|
||||
var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);
|
||||
popperOffsets[mainAxis] = preventedOffset;
|
||||
data[mainAxis] = preventedOffset - offset;
|
||||
}
|
||||
|
||||
if (checkAltAxis) {
|
||||
var _offsetModifierState$2;
|
||||
|
||||
var _mainSide = mainAxis === 'x' ? top : left;
|
||||
|
||||
var _altSide = mainAxis === 'x' ? bottom : right;
|
||||
|
||||
var _offset = popperOffsets[altAxis];
|
||||
|
||||
var _len = altAxis === 'y' ? 'height' : 'width';
|
||||
|
||||
var _min = _offset + overflow[_mainSide];
|
||||
|
||||
var _max = _offset - overflow[_altSide];
|
||||
|
||||
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
||||
|
||||
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
||||
|
||||
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
||||
|
||||
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
||||
|
||||
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
||||
|
||||
popperOffsets[altAxis] = _preventedOffset;
|
||||
data[altAxis] = _preventedOffset - _offset;
|
||||
}
|
||||
|
||||
state.modifiersData[name] = data;
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
export default {
|
||||
name: 'preventOverflow',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
fn: preventOverflow,
|
||||
requiresIfExists: ['offset']
|
||||
};
|
||||
1
wwwroot/lib/popper.js/esm/modifiers/preventOverflow.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/modifiers/preventOverflow.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{top,left,right,bottom,start}from"../enums.js";import getBasePlacement from"../utils/getBasePlacement.js";import getMainAxisFromPlacement from"../utils/getMainAxisFromPlacement.js";import getAltAxis from"../utils/getAltAxis.js";import{within,withinMaxClamp}from"../utils/within.js";import getLayoutRect from"../dom-utils/getLayoutRect.js";import getOffsetParent from"../dom-utils/getOffsetParent.js";import detectOverflow from"../utils/detectOverflow.js";import getVariation from"../utils/getVariation.js";import getFreshSideObject from"../utils/getFreshSideObject.js";import{min as mathMin,max as mathMax}from"../utils/math.js";function preventOverflow(t){var e,i,a,o,r,s,n,m,l,f=t.state,p=t.options,t=t.name,d=p.mainAxis,d=void 0===d||d,g=p.altAxis,g=void 0!==g&&g,c=p.boundary,h=p.rootBoundary,u=p.altBoundary,x=p.padding,w=p.tether,w=void 0===w||w,p=p.tetherOffset,p=void 0===p?0:p,c=detectOverflow(f,{boundary:c,rootBoundary:h,padding:x,altBoundary:u}),h=getBasePlacement(f.placement),x=getVariation(f.placement),u=!x,A=getMainAxisFromPlacement(h),y=getAltAxis(A),O=f.modifiersData.popperOffsets,j=f.rects.reference,v=f.rects.popper,p="function"==typeof p?p(Object.assign({},f.rects,{placement:f.placement})):p,p="number"==typeof p?{mainAxis:p,altAxis:p}:Object.assign({mainAxis:0,altAxis:0},p),b=f.modifiersData.offset?f.modifiersData.offset[f.placement]:null,M={x:0,y:0};O&&(d&&(d="y"===A?"height":"width",m=(e=O[A])+c[o="y"===A?top:left],l=e-c[i="y"===A?bottom:right],a=w?-v[d]/2:0,s=(x===start?j:v)[d],x=x===start?-v[d]:-j[d],n=f.elements.arrow,n=w&&n?getLayoutRect(n):{width:0,height:0},o=(r=f.modifiersData["arrow#persistent"]?f.modifiersData["arrow#persistent"].padding:getFreshSideObject())[o],r=r[i],i=within(0,j[d],n[d]),n=u?j[d]/2-a-i-o-p.mainAxis:s-i-o-p.mainAxis,s=u?-j[d]/2+a+i+r+p.mainAxis:x+i+r+p.mainAxis,u=(o=f.elements.arrow&&getOffsetParent(f.elements.arrow))?"y"===A?o.clientTop||0:o.clientLeft||0:0,x=e+s-(a=null!=(d=null==b?void 0:b[A])?d:0),i=within(w?mathMin(m,e+n-a-u):m,e,w?mathMax(l,x):l),O[A]=i,M[A]=i-e),g&&(r="y"===y?"height":"width",s=(o=O[y])+c["x"===A?top:left],d=o-c["x"===A?bottom:right],n=-1!==[top,left].indexOf(h),u=null!=(a=null==b?void 0:b[y])?a:0,m=n?s:o-j[r]-v[r]-u+p.altAxis,x=n?o+j[r]+v[r]-u-p.altAxis:d,l=w&&n?withinMaxClamp(m,o,x):within(w?m:s,o,w?x:d),O[y]=l,M[y]=l-o),f.modifiersData[t]=M)}export default{name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};
|
||||
Reference in New Issue
Block a user