Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
// EXTERNAL MODULE: external ["wp","i18n"]
[54000] Fix | Delete
var external_wp_i18n_ = __webpack_require__("l3Sj");
[54001] Fix | Delete
[54002] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js
[54003] Fix | Delete
[54004] Fix | Delete
[54005] Fix | Delete
[54006] Fix | Delete
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[54007] Fix | Delete
[54008] Fix | Delete
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[54009] Fix | Delete
[54010] Fix | Delete
/**
[54011] Fix | Delete
* WordPress dependencies
[54012] Fix | Delete
*/
[54013] Fix | Delete
[54014] Fix | Delete
/**
[54015] Fix | Delete
* Module constants
[54016] Fix | Delete
*/
[54017] Fix | Delete
[54018] Fix | Delete
var HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
[54019] Fix | Delete
[54020] Fix | Delete
/**
[54021] Fix | Delete
* Utility used to compute the popover position over the xAxis
[54022] Fix | Delete
*
[54023] Fix | Delete
* @param {Object} anchorRect Anchor Rect.
[54024] Fix | Delete
* @param {Object} contentSize Content Size.
[54025] Fix | Delete
* @param {string} xAxis Desired xAxis.
[54026] Fix | Delete
* @param {string} corner Desired corner.
[54027] Fix | Delete
* @param {boolean} stickyBoundaryElement The boundary element to use when
[54028] Fix | Delete
* switching between sticky and normal
[54029] Fix | Delete
* position.
[54030] Fix | Delete
* @param {string} chosenYAxis yAxis to be used.
[54031] Fix | Delete
* @param {Element} boundaryElement Boundary element.
[54032] Fix | Delete
* @param {boolean} forcePosition Don't adjust position based on anchor.
[54033] Fix | Delete
*
[54034] Fix | Delete
* @return {Object} Popover xAxis position and constraints.
[54035] Fix | Delete
*/
[54036] Fix | Delete
[54037] Fix | Delete
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition) {
[54038] Fix | Delete
var width = contentSize.width; // Correct xAxis for RTL support
[54039] Fix | Delete
[54040] Fix | Delete
if (xAxis === 'left' && Object(external_wp_i18n_["isRTL"])()) {
[54041] Fix | Delete
xAxis = 'right';
[54042] Fix | Delete
} else if (xAxis === 'right' && Object(external_wp_i18n_["isRTL"])()) {
[54043] Fix | Delete
xAxis = 'left';
[54044] Fix | Delete
}
[54045] Fix | Delete
[54046] Fix | Delete
if (corner === 'left' && Object(external_wp_i18n_["isRTL"])()) {
[54047] Fix | Delete
corner = 'right';
[54048] Fix | Delete
} else if (corner === 'right' && Object(external_wp_i18n_["isRTL"])()) {
[54049] Fix | Delete
corner = 'left';
[54050] Fix | Delete
} // x axis alignment choices
[54051] Fix | Delete
[54052] Fix | Delete
[54053] Fix | Delete
var anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
[54054] Fix | Delete
var centerAlignment = {
[54055] Fix | Delete
popoverLeft: anchorMidPoint,
[54056] Fix | Delete
contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
[54057] Fix | Delete
};
[54058] Fix | Delete
var leftAlignmentX = anchorRect.left;
[54059] Fix | Delete
[54060] Fix | Delete
if (corner === 'right') {
[54061] Fix | Delete
leftAlignmentX = anchorRect.right;
[54062] Fix | Delete
} else if (chosenYAxis !== 'middle') {
[54063] Fix | Delete
leftAlignmentX = anchorMidPoint;
[54064] Fix | Delete
}
[54065] Fix | Delete
[54066] Fix | Delete
var rightAlignmentX = anchorRect.right;
[54067] Fix | Delete
[54068] Fix | Delete
if (corner === 'left') {
[54069] Fix | Delete
rightAlignmentX = anchorRect.left;
[54070] Fix | Delete
} else if (chosenYAxis !== 'middle') {
[54071] Fix | Delete
rightAlignmentX = anchorMidPoint;
[54072] Fix | Delete
}
[54073] Fix | Delete
[54074] Fix | Delete
var leftAlignment = {
[54075] Fix | Delete
popoverLeft: leftAlignmentX,
[54076] Fix | Delete
contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
[54077] Fix | Delete
};
[54078] Fix | Delete
var rightAlignment = {
[54079] Fix | Delete
popoverLeft: rightAlignmentX,
[54080] Fix | Delete
contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
[54081] Fix | Delete
}; // Choosing the x axis
[54082] Fix | Delete
[54083] Fix | Delete
var chosenXAxis = xAxis;
[54084] Fix | Delete
var contentWidth = null;
[54085] Fix | Delete
[54086] Fix | Delete
if (!stickyBoundaryElement && !forcePosition) {
[54087] Fix | Delete
if (xAxis === 'center' && centerAlignment.contentWidth === width) {
[54088] Fix | Delete
chosenXAxis = 'center';
[54089] Fix | Delete
} else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
[54090] Fix | Delete
chosenXAxis = 'left';
[54091] Fix | Delete
} else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
[54092] Fix | Delete
chosenXAxis = 'right';
[54093] Fix | Delete
} else {
[54094] Fix | Delete
chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
[54095] Fix | Delete
var chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width
[54096] Fix | Delete
[54097] Fix | Delete
if (width > window.innerWidth) {
[54098] Fix | Delete
contentWidth = window.innerWidth;
[54099] Fix | Delete
} // If we can't find any alignment options that could fit
[54100] Fix | Delete
// our content, then let's fallback to the center of the viewport.
[54101] Fix | Delete
[54102] Fix | Delete
[54103] Fix | Delete
if (chosenWidth !== width) {
[54104] Fix | Delete
chosenXAxis = 'center';
[54105] Fix | Delete
centerAlignment.popoverLeft = window.innerWidth / 2;
[54106] Fix | Delete
}
[54107] Fix | Delete
}
[54108] Fix | Delete
}
[54109] Fix | Delete
[54110] Fix | Delete
var popoverLeft;
[54111] Fix | Delete
[54112] Fix | Delete
if (chosenXAxis === 'center') {
[54113] Fix | Delete
popoverLeft = centerAlignment.popoverLeft;
[54114] Fix | Delete
} else if (chosenXAxis === 'left') {
[54115] Fix | Delete
popoverLeft = leftAlignment.popoverLeft;
[54116] Fix | Delete
} else {
[54117] Fix | Delete
popoverLeft = rightAlignment.popoverLeft;
[54118] Fix | Delete
}
[54119] Fix | Delete
[54120] Fix | Delete
if (boundaryElement) {
[54121] Fix | Delete
var boundaryRect = boundaryElement.getBoundingClientRect();
[54122] Fix | Delete
popoverLeft = Math.min(popoverLeft, boundaryRect.right - width);
[54123] Fix | Delete
}
[54124] Fix | Delete
[54125] Fix | Delete
return {
[54126] Fix | Delete
xAxis: chosenXAxis,
[54127] Fix | Delete
popoverLeft: popoverLeft,
[54128] Fix | Delete
contentWidth: contentWidth
[54129] Fix | Delete
};
[54130] Fix | Delete
}
[54131] Fix | Delete
/**
[54132] Fix | Delete
* Utility used to compute the popover position over the yAxis
[54133] Fix | Delete
*
[54134] Fix | Delete
* @param {Object} anchorRect Anchor Rect.
[54135] Fix | Delete
* @param {Object} contentSize Content Size.
[54136] Fix | Delete
* @param {string} yAxis Desired yAxis.
[54137] Fix | Delete
* @param {string} corner Desired corner.
[54138] Fix | Delete
* @param {boolean} stickyBoundaryElement The boundary element to use when
[54139] Fix | Delete
* switching between sticky and normal
[54140] Fix | Delete
* position.
[54141] Fix | Delete
* @param {Element} anchorRef The anchor element.
[54142] Fix | Delete
* @param {Element} relativeOffsetTop If applicable, top offset of the
[54143] Fix | Delete
* relative positioned parent container.
[54144] Fix | Delete
* @param {boolean} forcePosition Don't adjust position based on anchor.
[54145] Fix | Delete
*
[54146] Fix | Delete
* @return {Object} Popover xAxis position and constraints.
[54147] Fix | Delete
*/
[54148] Fix | Delete
[54149] Fix | Delete
function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition) {
[54150] Fix | Delete
var height = contentSize.height;
[54151] Fix | Delete
[54152] Fix | Delete
if (stickyBoundaryElement) {
[54153] Fix | Delete
var stickyRect = stickyBoundaryElement.getBoundingClientRect();
[54154] Fix | Delete
var stickyPosition = stickyRect.top + height - relativeOffsetTop;
[54155] Fix | Delete
[54156] Fix | Delete
if (anchorRect.top <= stickyPosition) {
[54157] Fix | Delete
return {
[54158] Fix | Delete
yAxis: yAxis,
[54159] Fix | Delete
popoverTop: Math.min(anchorRect.bottom, stickyPosition)
[54160] Fix | Delete
};
[54161] Fix | Delete
}
[54162] Fix | Delete
} // y axis alignment choices
[54163] Fix | Delete
[54164] Fix | Delete
[54165] Fix | Delete
var anchorMidPoint = anchorRect.top + anchorRect.height / 2;
[54166] Fix | Delete
[54167] Fix | Delete
if (corner === 'bottom') {
[54168] Fix | Delete
anchorMidPoint = anchorRect.bottom;
[54169] Fix | Delete
} else if (corner === 'top') {
[54170] Fix | Delete
anchorMidPoint = anchorRect.top;
[54171] Fix | Delete
}
[54172] Fix | Delete
[54173] Fix | Delete
var middleAlignment = {
[54174] Fix | Delete
popoverTop: anchorMidPoint,
[54175] Fix | Delete
contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
[54176] Fix | Delete
};
[54177] Fix | Delete
var topAlignment = {
[54178] Fix | Delete
popoverTop: anchorRect.top,
[54179] Fix | Delete
contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
[54180] Fix | Delete
};
[54181] Fix | Delete
var bottomAlignment = {
[54182] Fix | Delete
popoverTop: anchorRect.bottom,
[54183] Fix | Delete
contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
[54184] Fix | Delete
}; // Choosing the y axis
[54185] Fix | Delete
[54186] Fix | Delete
var chosenYAxis = yAxis;
[54187] Fix | Delete
var contentHeight = null;
[54188] Fix | Delete
[54189] Fix | Delete
if (!stickyBoundaryElement && !forcePosition) {
[54190] Fix | Delete
if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
[54191] Fix | Delete
chosenYAxis = 'middle';
[54192] Fix | Delete
} else if (yAxis === 'top' && topAlignment.contentHeight === height) {
[54193] Fix | Delete
chosenYAxis = 'top';
[54194] Fix | Delete
} else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
[54195] Fix | Delete
chosenYAxis = 'bottom';
[54196] Fix | Delete
} else {
[54197] Fix | Delete
chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
[54198] Fix | Delete
var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
[54199] Fix | Delete
contentHeight = chosenHeight !== height ? chosenHeight : null;
[54200] Fix | Delete
}
[54201] Fix | Delete
}
[54202] Fix | Delete
[54203] Fix | Delete
var popoverTop;
[54204] Fix | Delete
[54205] Fix | Delete
if (chosenYAxis === 'middle') {
[54206] Fix | Delete
popoverTop = middleAlignment.popoverTop;
[54207] Fix | Delete
} else if (chosenYAxis === 'top') {
[54208] Fix | Delete
popoverTop = topAlignment.popoverTop;
[54209] Fix | Delete
} else {
[54210] Fix | Delete
popoverTop = bottomAlignment.popoverTop;
[54211] Fix | Delete
}
[54212] Fix | Delete
[54213] Fix | Delete
return {
[54214] Fix | Delete
yAxis: chosenYAxis,
[54215] Fix | Delete
popoverTop: popoverTop,
[54216] Fix | Delete
contentHeight: contentHeight
[54217] Fix | Delete
};
[54218] Fix | Delete
}
[54219] Fix | Delete
/**
[54220] Fix | Delete
* Utility used to compute the popover position and the content max width/height
[54221] Fix | Delete
* for a popover given its anchor rect and its content size.
[54222] Fix | Delete
*
[54223] Fix | Delete
* @param {Object} anchorRect Anchor Rect.
[54224] Fix | Delete
* @param {Object} contentSize Content Size.
[54225] Fix | Delete
* @param {string} position Position.
[54226] Fix | Delete
* @param {boolean} stickyBoundaryElement The boundary element to use when
[54227] Fix | Delete
* switching between sticky and normal
[54228] Fix | Delete
* position.
[54229] Fix | Delete
* @param {Element} anchorRef The anchor element.
[54230] Fix | Delete
* @param {number} relativeOffsetTop If applicable, top offset of the
[54231] Fix | Delete
* relative positioned parent container.
[54232] Fix | Delete
* @param {Element} boundaryElement Boundary element.
[54233] Fix | Delete
* @param {boolean} forcePosition Don't adjust position based on anchor.
[54234] Fix | Delete
*
[54235] Fix | Delete
* @return {Object} Popover position and constraints.
[54236] Fix | Delete
*/
[54237] Fix | Delete
[54238] Fix | Delete
function computePopoverPosition(anchorRect, contentSize) {
[54239] Fix | Delete
var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
[54240] Fix | Delete
var stickyBoundaryElement = arguments.length > 3 ? arguments[3] : undefined;
[54241] Fix | Delete
var anchorRef = arguments.length > 4 ? arguments[4] : undefined;
[54242] Fix | Delete
var relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
[54243] Fix | Delete
var boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
[54244] Fix | Delete
var forcePosition = arguments.length > 7 ? arguments[7] : undefined;
[54245] Fix | Delete
[54246] Fix | Delete
var _position$split = position.split(' '),
[54247] Fix | Delete
_position$split2 = Object(slicedToArray["a" /* default */])(_position$split, 3),
[54248] Fix | Delete
yAxis = _position$split2[0],
[54249] Fix | Delete
_position$split2$ = _position$split2[1],
[54250] Fix | Delete
xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$,
[54251] Fix | Delete
corner = _position$split2[2];
[54252] Fix | Delete
[54253] Fix | Delete
var yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition);
[54254] Fix | Delete
var xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition);
[54255] Fix | Delete
return _objectSpread(_objectSpread({}, xAxisPosition), yAxisPosition);
[54256] Fix | Delete
}
[54257] Fix | Delete
[54258] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
[54259] Fix | Delete
var build_module_button = __webpack_require__("kA6J");
[54260] Fix | Delete
[54261] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
[54262] Fix | Delete
var scroll_lock = __webpack_require__("k8OV");
[54263] Fix | Delete
[54264] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
[54265] Fix | Delete
var use_slot = __webpack_require__("+WFq");
[54266] Fix | Delete
[54267] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 6 modules
[54268] Fix | Delete
var slot_fill = __webpack_require__("dSD1");
[54269] Fix | Delete
[54270] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
[54271] Fix | Delete
var build_module_animate = __webpack_require__("L8Kx");
[54272] Fix | Delete
[54273] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js
[54274] Fix | Delete
[54275] Fix | Delete
[54276] Fix | Delete
[54277] Fix | Delete
[54278] Fix | Delete
[54279] Fix | Delete
/**
[54280] Fix | Delete
* External dependencies
[54281] Fix | Delete
*/
[54282] Fix | Delete
[54283] Fix | Delete
[54284] Fix | Delete
/**
[54285] Fix | Delete
* WordPress dependencies
[54286] Fix | Delete
*/
[54287] Fix | Delete
[54288] Fix | Delete
[54289] Fix | Delete
[54290] Fix | Delete
[54291] Fix | Delete
[54292] Fix | Delete
[54293] Fix | Delete
[54294] Fix | Delete
/**
[54295] Fix | Delete
* Internal dependencies
[54296] Fix | Delete
*/
[54297] Fix | Delete
[54298] Fix | Delete
[54299] Fix | Delete
[54300] Fix | Delete
[54301] Fix | Delete
[54302] Fix | Delete
[54303] Fix | Delete
/**
[54304] Fix | Delete
* Name of slot in which popover should fill.
[54305] Fix | Delete
*
[54306] Fix | Delete
* @type {string}
[54307] Fix | Delete
*/
[54308] Fix | Delete
[54309] Fix | Delete
var SLOT_NAME = 'Popover';
[54310] Fix | Delete
[54311] Fix | Delete
function offsetIframe(rect, ownerDocument) {
[54312] Fix | Delete
var defaultView = ownerDocument.defaultView;
[54313] Fix | Delete
var frameElement = defaultView.frameElement;
[54314] Fix | Delete
[54315] Fix | Delete
if (!frameElement) {
[54316] Fix | Delete
return rect;
[54317] Fix | Delete
}
[54318] Fix | Delete
[54319] Fix | Delete
var iframeRect = frameElement.getBoundingClientRect();
[54320] Fix | Delete
return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height);
[54321] Fix | Delete
}
[54322] Fix | Delete
[54323] Fix | Delete
function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) {
[54324] Fix | Delete
var anchorRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
[54325] Fix | Delete
var shouldAnchorIncludePadding = arguments.length > 4 ? arguments[4] : undefined;
[54326] Fix | Delete
[54327] Fix | Delete
if (anchorRect) {
[54328] Fix | Delete
return anchorRect;
[54329] Fix | Delete
}
[54330] Fix | Delete
[54331] Fix | Delete
if (getAnchorRect) {
[54332] Fix | Delete
if (!anchorRefFallback.current) {
[54333] Fix | Delete
return;
[54334] Fix | Delete
}
[54335] Fix | Delete
[54336] Fix | Delete
return getAnchorRect(anchorRefFallback.current);
[54337] Fix | Delete
}
[54338] Fix | Delete
[54339] Fix | Delete
if (anchorRef !== false) {
[54340] Fix | Delete
if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) {
[54341] Fix | Delete
return;
[54342] Fix | Delete
} // Duck-type to check if `anchorRef` is an instance of Range
[54343] Fix | Delete
// `anchorRef instanceof window.Range` checks will break across document boundaries
[54344] Fix | Delete
// such as in an iframe
[54345] Fix | Delete
[54346] Fix | Delete
[54347] Fix | Delete
if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') {
[54348] Fix | Delete
return offsetIframe(Object(external_wp_dom_["getRectangleFromRange"])(anchorRef), anchorRef.endContainer.ownerDocument);
[54349] Fix | Delete
} // Duck-type to check if `anchorRef` is an instance of Element
[54350] Fix | Delete
// `anchorRef instanceof window.Element` checks will break across document boundaries
[54351] Fix | Delete
// such as in an iframe
[54352] Fix | Delete
[54353] Fix | Delete
[54354] Fix | Delete
if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') {
[54355] Fix | Delete
var _rect2 = offsetIframe(anchorRef.getBoundingClientRect(), anchorRef.ownerDocument);
[54356] Fix | Delete
[54357] Fix | Delete
if (shouldAnchorIncludePadding) {
[54358] Fix | Delete
return _rect2;
[54359] Fix | Delete
}
[54360] Fix | Delete
[54361] Fix | Delete
return withoutPadding(_rect2, anchorRef);
[54362] Fix | Delete
}
[54363] Fix | Delete
[54364] Fix | Delete
var top = anchorRef.top,
[54365] Fix | Delete
bottom = anchorRef.bottom;
[54366] Fix | Delete
var topRect = top.getBoundingClientRect();
[54367] Fix | Delete
var bottomRect = bottom.getBoundingClientRect();
[54368] Fix | Delete
[54369] Fix | Delete
var _rect = offsetIframe(new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top), top.ownerDocument);
[54370] Fix | Delete
[54371] Fix | Delete
if (shouldAnchorIncludePadding) {
[54372] Fix | Delete
return _rect;
[54373] Fix | Delete
}
[54374] Fix | Delete
[54375] Fix | Delete
return withoutPadding(_rect, anchorRef);
[54376] Fix | Delete
}
[54377] Fix | Delete
[54378] Fix | Delete
if (!anchorRefFallback.current) {
[54379] Fix | Delete
return;
[54380] Fix | Delete
}
[54381] Fix | Delete
[54382] Fix | Delete
var parentNode = anchorRefFallback.current.parentNode;
[54383] Fix | Delete
var rect = parentNode.getBoundingClientRect();
[54384] Fix | Delete
[54385] Fix | Delete
if (shouldAnchorIncludePadding) {
[54386] Fix | Delete
return rect;
[54387] Fix | Delete
}
[54388] Fix | Delete
[54389] Fix | Delete
return withoutPadding(rect, parentNode);
[54390] Fix | Delete
}
[54391] Fix | Delete
[54392] Fix | Delete
function getComputedStyle(node) {
[54393] Fix | Delete
return node.ownerDocument.defaultView.getComputedStyle(node);
[54394] Fix | Delete
}
[54395] Fix | Delete
[54396] Fix | Delete
function withoutPadding(rect, element) {
[54397] Fix | Delete
var _getComputedStyle = getComputedStyle(element),
[54398] Fix | Delete
paddingTop = _getComputedStyle.paddingTop,
[54399] Fix | Delete
paddingBottom = _getComputedStyle.paddingBottom,
[54400] Fix | Delete
paddingLeft = _getComputedStyle.paddingLeft,
[54401] Fix | Delete
paddingRight = _getComputedStyle.paddingRight;
[54402] Fix | Delete
[54403] Fix | Delete
var top = paddingTop ? parseInt(paddingTop, 10) : 0;
[54404] Fix | Delete
var bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0;
[54405] Fix | Delete
var left = paddingLeft ? parseInt(paddingLeft, 10) : 0;
[54406] Fix | Delete
var right = paddingRight ? parseInt(paddingRight, 10) : 0;
[54407] Fix | Delete
return {
[54408] Fix | Delete
x: rect.left + left,
[54409] Fix | Delete
y: rect.top + top,
[54410] Fix | Delete
width: rect.width - left - right,
[54411] Fix | Delete
height: rect.height - top - bottom,
[54412] Fix | Delete
left: rect.left + left,
[54413] Fix | Delete
right: rect.right - right,
[54414] Fix | Delete
top: rect.top + top,
[54415] Fix | Delete
bottom: rect.bottom - bottom
[54416] Fix | Delete
};
[54417] Fix | Delete
}
[54418] Fix | Delete
/**
[54419] Fix | Delete
* Sets or removes an element attribute.
[54420] Fix | Delete
*
[54421] Fix | Delete
* @param {Element} element The element to modify.
[54422] Fix | Delete
* @param {string} name The attribute name to set or remove.
[54423] Fix | Delete
* @param {?string} value The value to set. A falsy value will remove the
[54424] Fix | Delete
* attribute.
[54425] Fix | Delete
*/
[54426] Fix | Delete
[54427] Fix | Delete
[54428] Fix | Delete
function setAttribute(element, name, value) {
[54429] Fix | Delete
if (!value) {
[54430] Fix | Delete
if (element.hasAttribute(name)) {
[54431] Fix | Delete
element.removeAttribute(name);
[54432] Fix | Delete
}
[54433] Fix | Delete
} else if (element.getAttribute(name) !== value) {
[54434] Fix | Delete
element.setAttribute(name, value);
[54435] Fix | Delete
}
[54436] Fix | Delete
}
[54437] Fix | Delete
/**
[54438] Fix | Delete
* Sets or removes an element style property.
[54439] Fix | Delete
*
[54440] Fix | Delete
* @param {Element} element The element to modify.
[54441] Fix | Delete
* @param {string} property The property to set or remove.
[54442] Fix | Delete
* @param {?string} value The value to set. A falsy value will remove the
[54443] Fix | Delete
* property.
[54444] Fix | Delete
*/
[54445] Fix | Delete
[54446] Fix | Delete
[54447] Fix | Delete
function setStyle(element, property) {
[54448] Fix | Delete
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
[54449] Fix | Delete
[54450] Fix | Delete
if (element.style[property] !== value) {
[54451] Fix | Delete
element.style[property] = value;
[54452] Fix | Delete
}
[54453] Fix | Delete
}
[54454] Fix | Delete
/**
[54455] Fix | Delete
* Sets or removes an element class.
[54456] Fix | Delete
*
[54457] Fix | Delete
* @param {Element} element The element to modify.
[54458] Fix | Delete
* @param {string} name The class to set or remove.
[54459] Fix | Delete
* @param {boolean} toggle True to set the class, false to remove.
[54460] Fix | Delete
*/
[54461] Fix | Delete
[54462] Fix | Delete
[54463] Fix | Delete
function setClass(element, name, toggle) {
[54464] Fix | Delete
if (toggle) {
[54465] Fix | Delete
if (!element.classList.contains(name)) {
[54466] Fix | Delete
element.classList.add(name);
[54467] Fix | Delete
}
[54468] Fix | Delete
} else if (element.classList.contains(name)) {
[54469] Fix | Delete
element.classList.remove(name);
[54470] Fix | Delete
}
[54471] Fix | Delete
}
[54472] Fix | Delete
[54473] Fix | Delete
function getAnchorDocument(anchor) {
[54474] Fix | Delete
if (!anchor) {
[54475] Fix | Delete
return;
[54476] Fix | Delete
}
[54477] Fix | Delete
[54478] Fix | Delete
if (anchor.endContainer) {
[54479] Fix | Delete
return anchor.endContainer.ownerDocument;
[54480] Fix | Delete
}
[54481] Fix | Delete
[54482] Fix | Delete
if (anchor.top) {
[54483] Fix | Delete
return anchor.top.ownerDocument;
[54484] Fix | Delete
}
[54485] Fix | Delete
[54486] Fix | Delete
return anchor.ownerDocument;
[54487] Fix | Delete
}
[54488] Fix | Delete
[54489] Fix | Delete
var popover_Popover = function Popover(_ref) {
[54490] Fix | Delete
var headerTitle = _ref.headerTitle,
[54491] Fix | Delete
onClose = _ref.onClose,
[54492] Fix | Delete
onKeyDown = _ref.onKeyDown,
[54493] Fix | Delete
children = _ref.children,
[54494] Fix | Delete
className = _ref.className,
[54495] Fix | Delete
_ref$noArrow = _ref.noArrow,
[54496] Fix | Delete
noArrow = _ref$noArrow === void 0 ? true : _ref$noArrow,
[54497] Fix | Delete
isAlternate = _ref.isAlternate,
[54498] Fix | Delete
_ref$position = _ref.position,
[54499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function