Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
position = _ref$position === void 0 ? 'bottom right' : _ref$position,
[54500] Fix | Delete
range = _ref.range,
[54501] Fix | Delete
_ref$focusOnMount = _ref.focusOnMount,
[54502] Fix | Delete
focusOnMount = _ref$focusOnMount === void 0 ? 'firstElement' : _ref$focusOnMount,
[54503] Fix | Delete
anchorRef = _ref.anchorRef,
[54504] Fix | Delete
shouldAnchorIncludePadding = _ref.shouldAnchorIncludePadding,
[54505] Fix | Delete
anchorRect = _ref.anchorRect,
[54506] Fix | Delete
getAnchorRect = _ref.getAnchorRect,
[54507] Fix | Delete
expandOnMobile = _ref.expandOnMobile,
[54508] Fix | Delete
_ref$animate = _ref.animate,
[54509] Fix | Delete
animate = _ref$animate === void 0 ? true : _ref$animate,
[54510] Fix | Delete
onClickOutside = _ref.onClickOutside,
[54511] Fix | Delete
onFocusOutside = _ref.onFocusOutside,
[54512] Fix | Delete
__unstableStickyBoundaryElement = _ref.__unstableStickyBoundaryElement,
[54513] Fix | Delete
_ref$__unstableSlotNa = _ref.__unstableSlotName,
[54514] Fix | Delete
__unstableSlotName = _ref$__unstableSlotNa === void 0 ? SLOT_NAME : _ref$__unstableSlotNa,
[54515] Fix | Delete
__unstableObserveElement = _ref.__unstableObserveElement,
[54516] Fix | Delete
__unstableBoundaryParent = _ref.__unstableBoundaryParent,
[54517] Fix | Delete
__unstableForcePosition = _ref.__unstableForcePosition,
[54518] Fix | Delete
contentProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "isAlternate", "position", "range", "focusOnMount", "anchorRef", "shouldAnchorIncludePadding", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside", "__unstableStickyBoundaryElement", "__unstableSlotName", "__unstableObserveElement", "__unstableBoundaryParent", "__unstableForcePosition"]);
[54519] Fix | Delete
[54520] Fix | Delete
var anchorRefFallback = Object(external_wp_element_["useRef"])(null);
[54521] Fix | Delete
var contentRef = Object(external_wp_element_["useRef"])(null);
[54522] Fix | Delete
var containerRef = Object(external_wp_element_["useRef"])();
[54523] Fix | Delete
var isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<');
[54524] Fix | Delete
[54525] Fix | Delete
var _useState = Object(external_wp_element_["useState"])(),
[54526] Fix | Delete
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
[54527] Fix | Delete
animateOrigin = _useState2[0],
[54528] Fix | Delete
setAnimateOrigin = _useState2[1];
[54529] Fix | Delete
[54530] Fix | Delete
var slot = Object(use_slot["a" /* default */])(__unstableSlotName);
[54531] Fix | Delete
var isExpanded = expandOnMobile && isMobileViewport;
[54532] Fix | Delete
[54533] Fix | Delete
var _useResizeObserver = Object(external_wp_compose_["useResizeObserver"])(),
[54534] Fix | Delete
_useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2),
[54535] Fix | Delete
containerResizeListener = _useResizeObserver2[0],
[54536] Fix | Delete
contentSize = _useResizeObserver2[1];
[54537] Fix | Delete
[54538] Fix | Delete
noArrow = isExpanded || noArrow;
[54539] Fix | Delete
Object(external_wp_element_["useLayoutEffect"])(function () {
[54540] Fix | Delete
if (isExpanded) {
[54541] Fix | Delete
setClass(containerRef.current, 'is-without-arrow', noArrow);
[54542] Fix | Delete
setClass(containerRef.current, 'is-alternate', isAlternate);
[54543] Fix | Delete
setAttribute(containerRef.current, 'data-x-axis');
[54544] Fix | Delete
setAttribute(containerRef.current, 'data-y-axis');
[54545] Fix | Delete
setStyle(containerRef.current, 'top');
[54546] Fix | Delete
setStyle(containerRef.current, 'left');
[54547] Fix | Delete
setStyle(contentRef.current, 'maxHeight');
[54548] Fix | Delete
setStyle(contentRef.current, 'maxWidth');
[54549] Fix | Delete
return;
[54550] Fix | Delete
}
[54551] Fix | Delete
[54552] Fix | Delete
var refresh = function refresh() {
[54553] Fix | Delete
if (!containerRef.current || !contentRef.current) {
[54554] Fix | Delete
return;
[54555] Fix | Delete
}
[54556] Fix | Delete
[54557] Fix | Delete
var anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding);
[54558] Fix | Delete
[54559] Fix | Delete
if (!anchor) {
[54560] Fix | Delete
return;
[54561] Fix | Delete
}
[54562] Fix | Delete
[54563] Fix | Delete
var _containerRef$current = containerRef.current,
[54564] Fix | Delete
offsetParent = _containerRef$current.offsetParent,
[54565] Fix | Delete
ownerDocument = _containerRef$current.ownerDocument;
[54566] Fix | Delete
var relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body,
[54567] Fix | Delete
// subtract the position from the anchor rect. If the position of
[54568] Fix | Delete
// the popover is fixed, the offset parent is null or the body
[54569] Fix | Delete
// element, in which case the position is relative to the viewport.
[54570] Fix | Delete
// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
[54571] Fix | Delete
[54572] Fix | Delete
if (offsetParent && offsetParent !== ownerDocument.body) {
[54573] Fix | Delete
var offsetParentRect = offsetParent.getBoundingClientRect();
[54574] Fix | Delete
relativeOffsetTop = offsetParentRect.top;
[54575] Fix | Delete
anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height);
[54576] Fix | Delete
}
[54577] Fix | Delete
[54578] Fix | Delete
var boundaryElement;
[54579] Fix | Delete
[54580] Fix | Delete
if (__unstableBoundaryParent) {
[54581] Fix | Delete
var _containerRef$current2;
[54582] Fix | Delete
[54583] Fix | Delete
boundaryElement = (_containerRef$current2 = containerRef.current.closest('.popover-slot')) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.parentNode;
[54584] Fix | Delete
}
[54585] Fix | Delete
[54586] Fix | Delete
var usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize;
[54587] Fix | Delete
[54588] Fix | Delete
var _computePopoverPositi = computePopoverPosition(anchor, usedContentSize, position, __unstableStickyBoundaryElement, containerRef.current, relativeOffsetTop, boundaryElement, __unstableForcePosition),
[54589] Fix | Delete
popoverTop = _computePopoverPositi.popoverTop,
[54590] Fix | Delete
popoverLeft = _computePopoverPositi.popoverLeft,
[54591] Fix | Delete
xAxis = _computePopoverPositi.xAxis,
[54592] Fix | Delete
yAxis = _computePopoverPositi.yAxis,
[54593] Fix | Delete
contentHeight = _computePopoverPositi.contentHeight,
[54594] Fix | Delete
contentWidth = _computePopoverPositi.contentWidth;
[54595] Fix | Delete
[54596] Fix | Delete
if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') {
[54597] Fix | Delete
setStyle(containerRef.current, 'top', popoverTop + 'px');
[54598] Fix | Delete
setStyle(containerRef.current, 'left', popoverLeft + 'px');
[54599] Fix | Delete
}
[54600] Fix | Delete
[54601] Fix | Delete
setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle');
[54602] Fix | Delete
setClass(containerRef.current, 'is-alternate', isAlternate);
[54603] Fix | Delete
setAttribute(containerRef.current, 'data-x-axis', xAxis);
[54604] Fix | Delete
setAttribute(containerRef.current, 'data-y-axis', yAxis);
[54605] Fix | Delete
setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
[54606] Fix | Delete
setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
[54607] Fix | Delete
[54608] Fix | Delete
var yAxisMapping = {
[54609] Fix | Delete
top: 'bottom',
[54610] Fix | Delete
bottom: 'top'
[54611] Fix | Delete
};
[54612] Fix | Delete
var xAxisMapping = {
[54613] Fix | Delete
left: 'right',
[54614] Fix | Delete
right: 'left'
[54615] Fix | Delete
};
[54616] Fix | Delete
var animateYAxis = yAxisMapping[yAxis] || 'middle';
[54617] Fix | Delete
var animateXAxis = xAxisMapping[xAxis] || 'center';
[54618] Fix | Delete
setAnimateOrigin(animateXAxis + ' ' + animateYAxis);
[54619] Fix | Delete
};
[54620] Fix | Delete
[54621] Fix | Delete
refresh();
[54622] Fix | Delete
var ownerDocument = containerRef.current.ownerDocument;
[54623] Fix | Delete
var defaultView = ownerDocument.defaultView;
[54624] Fix | Delete
/*
[54625] Fix | Delete
* There are sometimes we need to reposition or resize the popover that
[54626] Fix | Delete
* are not handled by the resize/scroll window events (i.e. CSS changes
[54627] Fix | Delete
* in the layout that changes the position of the anchor).
[54628] Fix | Delete
*
[54629] Fix | Delete
* For these situations, we refresh the popover every 0.5s
[54630] Fix | Delete
*/
[54631] Fix | Delete
[54632] Fix | Delete
var intervalHandle = defaultView.setInterval(refresh, 500);
[54633] Fix | Delete
var rafId;
[54634] Fix | Delete
[54635] Fix | Delete
var refreshOnAnimationFrame = function refreshOnAnimationFrame() {
[54636] Fix | Delete
defaultView.cancelAnimationFrame(rafId);
[54637] Fix | Delete
rafId = defaultView.requestAnimationFrame(refresh);
[54638] Fix | Delete
}; // Sometimes a click trigger a layout change that affects the popover
[54639] Fix | Delete
// position. This is an opportunity to immediately refresh rather than
[54640] Fix | Delete
// at the interval.
[54641] Fix | Delete
[54642] Fix | Delete
[54643] Fix | Delete
defaultView.addEventListener('click', refreshOnAnimationFrame);
[54644] Fix | Delete
defaultView.addEventListener('resize', refresh);
[54645] Fix | Delete
defaultView.addEventListener('scroll', refresh, true);
[54646] Fix | Delete
var anchorDocument = getAnchorDocument(anchorRef); // If the anchor is within an iframe, the popover position also needs
[54647] Fix | Delete
// to refrest when the iframe content is scrolled or resized.
[54648] Fix | Delete
[54649] Fix | Delete
if (anchorDocument && anchorDocument !== ownerDocument) {
[54650] Fix | Delete
anchorDocument.defaultView.addEventListener('resize', refresh);
[54651] Fix | Delete
anchorDocument.defaultView.addEventListener('scroll', refresh, true);
[54652] Fix | Delete
}
[54653] Fix | Delete
[54654] Fix | Delete
var observer;
[54655] Fix | Delete
[54656] Fix | Delete
if (__unstableObserveElement) {
[54657] Fix | Delete
observer = new defaultView.MutationObserver(refresh);
[54658] Fix | Delete
observer.observe(__unstableObserveElement, {
[54659] Fix | Delete
attributes: true
[54660] Fix | Delete
});
[54661] Fix | Delete
}
[54662] Fix | Delete
[54663] Fix | Delete
return function () {
[54664] Fix | Delete
defaultView.clearInterval(intervalHandle);
[54665] Fix | Delete
defaultView.removeEventListener('resize', refresh);
[54666] Fix | Delete
defaultView.removeEventListener('scroll', refresh, true);
[54667] Fix | Delete
defaultView.removeEventListener('click', refreshOnAnimationFrame);
[54668] Fix | Delete
defaultView.cancelAnimationFrame(rafId);
[54669] Fix | Delete
[54670] Fix | Delete
if (anchorDocument && anchorDocument !== ownerDocument) {
[54671] Fix | Delete
anchorDocument.defaultView.removeEventListener('resize', refresh);
[54672] Fix | Delete
anchorDocument.defaultView.removeEventListener('scroll', refresh, true);
[54673] Fix | Delete
}
[54674] Fix | Delete
[54675] Fix | Delete
if (observer) {
[54676] Fix | Delete
observer.disconnect();
[54677] Fix | Delete
}
[54678] Fix | Delete
};
[54679] Fix | Delete
}, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableStickyBoundaryElement, __unstableObserveElement, __unstableBoundaryParent]);
[54680] Fix | Delete
var constrainedTabbingRef = Object(external_wp_compose_["useConstrainedTabbing"])();
[54681] Fix | Delete
var focusReturnRef = Object(external_wp_compose_["useFocusReturn"])();
[54682] Fix | Delete
var focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])(focusOnMount);
[54683] Fix | Delete
var focusOutsideProps = Object(external_wp_compose_["__experimentalUseFocusOutside"])(handleOnFocusOutside);
[54684] Fix | Delete
var allRefs = [containerRef, focusOnMount ? constrainedTabbingRef : null, focusOnMount ? focusReturnRef : null, focusOnMount ? focusOnMountRef : null];
[54685] Fix | Delete
var mergedRefs = Object(external_wp_element_["useCallback"])(Object(react_merge_refs_esm["a" /* default */])(allRefs), allRefs); // Event handlers
[54686] Fix | Delete
[54687] Fix | Delete
var maybeClose = function maybeClose(event) {
[54688] Fix | Delete
// Close on escape
[54689] Fix | Delete
if (event.keyCode === external_wp_keycodes_["ESCAPE"] && onClose) {
[54690] Fix | Delete
event.stopPropagation();
[54691] Fix | Delete
onClose();
[54692] Fix | Delete
} // Preserve original content prop behavior
[54693] Fix | Delete
[54694] Fix | Delete
[54695] Fix | Delete
if (onKeyDown) {
[54696] Fix | Delete
onKeyDown(event);
[54697] Fix | Delete
}
[54698] Fix | Delete
};
[54699] Fix | Delete
/**
[54700] Fix | Delete
* Shims an onFocusOutside callback to be compatible with a deprecated
[54701] Fix | Delete
* onClickOutside prop function, if provided.
[54702] Fix | Delete
*
[54703] Fix | Delete
* @param {FocusEvent} event Focus event from onFocusOutside.
[54704] Fix | Delete
*/
[54705] Fix | Delete
[54706] Fix | Delete
[54707] Fix | Delete
function handleOnFocusOutside(event) {
[54708] Fix | Delete
// Defer to given `onFocusOutside` if specified. Call `onClose` only if
[54709] Fix | Delete
// both `onFocusOutside` and `onClickOutside` are unspecified. Doing so
[54710] Fix | Delete
// assures backwards-compatibility for prior `onClickOutside` default.
[54711] Fix | Delete
if (onFocusOutside) {
[54712] Fix | Delete
onFocusOutside(event);
[54713] Fix | Delete
return;
[54714] Fix | Delete
} else if (!onClickOutside) {
[54715] Fix | Delete
if (onClose) {
[54716] Fix | Delete
onClose();
[54717] Fix | Delete
}
[54718] Fix | Delete
[54719] Fix | Delete
return;
[54720] Fix | Delete
} // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click
[54721] Fix | Delete
// target. MouseEvent constructor is unsupported in Internet Explorer.
[54722] Fix | Delete
[54723] Fix | Delete
[54724] Fix | Delete
var clickEvent;
[54725] Fix | Delete
[54726] Fix | Delete
try {
[54727] Fix | Delete
clickEvent = new window.MouseEvent('click');
[54728] Fix | Delete
} catch (error) {
[54729] Fix | Delete
clickEvent = document.createEvent('MouseEvent');
[54730] Fix | Delete
clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
[54731] Fix | Delete
}
[54732] Fix | Delete
[54733] Fix | Delete
Object.defineProperty(clickEvent, 'target', {
[54734] Fix | Delete
get: function get() {
[54735] Fix | Delete
return event.relatedTarget;
[54736] Fix | Delete
}
[54737] Fix | Delete
});
[54738] Fix | Delete
external_wp_deprecated_default()('Popover onClickOutside prop', {
[54739] Fix | Delete
alternative: 'onFocusOutside'
[54740] Fix | Delete
});
[54741] Fix | Delete
onClickOutside(clickEvent);
[54742] Fix | Delete
}
[54743] Fix | Delete
/** @type {false | string} */
[54744] Fix | Delete
[54745] Fix | Delete
[54746] Fix | Delete
var animateClassName = Boolean(animate && animateOrigin) && Object(build_module_animate["b" /* getAnimateClassName */])({
[54747] Fix | Delete
type: 'appear',
[54748] Fix | Delete
origin: animateOrigin
[54749] Fix | Delete
}); // Disable reason: We care to capture the _bubbled_ events from inputs
[54750] Fix | Delete
// within popover as inferring close intent.
[54751] Fix | Delete
[54752] Fix | Delete
var content = // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
[54753] Fix | Delete
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
[54754] Fix | Delete
Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
[54755] Fix | Delete
className: classnames_default()('components-popover', className, animateClassName, {
[54756] Fix | Delete
'is-expanded': isExpanded,
[54757] Fix | Delete
'is-without-arrow': noArrow,
[54758] Fix | Delete
'is-alternate': isAlternate
[54759] Fix | Delete
})
[54760] Fix | Delete
}, contentProps, {
[54761] Fix | Delete
onKeyDown: maybeClose
[54762] Fix | Delete
}, focusOutsideProps, {
[54763] Fix | Delete
ref: mergedRefs,
[54764] Fix | Delete
tabIndex: "-1"
[54765] Fix | Delete
}), isExpanded && Object(external_wp_element_["createElement"])(scroll_lock["a" /* default */], null), isExpanded && Object(external_wp_element_["createElement"])("div", {
[54766] Fix | Delete
className: "components-popover__header"
[54767] Fix | Delete
}, Object(external_wp_element_["createElement"])("span", {
[54768] Fix | Delete
className: "components-popover__header-title"
[54769] Fix | Delete
}, headerTitle), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[54770] Fix | Delete
className: "components-popover__close",
[54771] Fix | Delete
icon: library_close["a" /* default */],
[54772] Fix | Delete
onClick: onClose
[54773] Fix | Delete
})), Object(external_wp_element_["createElement"])("div", {
[54774] Fix | Delete
ref: contentRef,
[54775] Fix | Delete
className: "components-popover__content"
[54776] Fix | Delete
}, Object(external_wp_element_["createElement"])("div", {
[54777] Fix | Delete
style: {
[54778] Fix | Delete
position: 'relative'
[54779] Fix | Delete
}
[54780] Fix | Delete
}, containerResizeListener, children)));
[54781] Fix | Delete
[54782] Fix | Delete
if (slot.ref) {
[54783] Fix | Delete
content = Object(external_wp_element_["createElement"])(slot_fill["a" /* Fill */], {
[54784] Fix | Delete
name: __unstableSlotName
[54785] Fix | Delete
}, content);
[54786] Fix | Delete
}
[54787] Fix | Delete
[54788] Fix | Delete
if (anchorRef || anchorRect) {
[54789] Fix | Delete
return content;
[54790] Fix | Delete
}
[54791] Fix | Delete
[54792] Fix | Delete
return Object(external_wp_element_["createElement"])("span", {
[54793] Fix | Delete
ref: anchorRefFallback
[54794] Fix | Delete
}, content);
[54795] Fix | Delete
};
[54796] Fix | Delete
[54797] Fix | Delete
var PopoverContainer = popover_Popover;
[54798] Fix | Delete
[54799] Fix | Delete
PopoverContainer.Slot = function (_ref2) {
[54800] Fix | Delete
var _ref2$name = _ref2.name,
[54801] Fix | Delete
name = _ref2$name === void 0 ? SLOT_NAME : _ref2$name;
[54802] Fix | Delete
return Object(external_wp_element_["createElement"])(slot_fill["b" /* Slot */], {
[54803] Fix | Delete
bubblesVirtually: true,
[54804] Fix | Delete
name: name,
[54805] Fix | Delete
className: "popover-slot"
[54806] Fix | Delete
});
[54807] Fix | Delete
};
[54808] Fix | Delete
[54809] Fix | Delete
/* harmony default export */ var popover = __webpack_exports__["a"] = (PopoverContainer);
[54810] Fix | Delete
[54811] Fix | Delete
[54812] Fix | Delete
/***/ }),
[54813] Fix | Delete
[54814] Fix | Delete
/***/ "oZ/g":
[54815] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[54816] Fix | Delete
[54817] Fix | Delete
"use strict";
[54818] Fix | Delete
[54819] Fix | Delete
// EXPORTS
[54820] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ensureFocus; });
[54821] Fix | Delete
[54822] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/getActiveElement.js
[54823] Fix | Delete
var getActiveElement = __webpack_require__("z222");
[54824] Fix | Delete
[54825] Fix | Delete
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/hasFocus.js
[54826] Fix | Delete
[54827] Fix | Delete
[54828] Fix | Delete
[54829] Fix | Delete
/**
[54830] Fix | Delete
* Checks if `element` has focus. Elements that are referenced by
[54831] Fix | Delete
* `aria-activedescendant` are also considered.
[54832] Fix | Delete
*
[54833] Fix | Delete
* @example
[54834] Fix | Delete
* import { hasFocus } from "reakit-utils";
[54835] Fix | Delete
*
[54836] Fix | Delete
* hasFocus(document.getElementById("id"));
[54837] Fix | Delete
*/
[54838] Fix | Delete
[54839] Fix | Delete
function hasFocus(element) {
[54840] Fix | Delete
var activeElement = Object(getActiveElement["a" /* getActiveElement */])(element);
[54841] Fix | Delete
if (!activeElement) return false;
[54842] Fix | Delete
if (activeElement === element) return true;
[54843] Fix | Delete
var activeDescendant = activeElement.getAttribute("aria-activedescendant");
[54844] Fix | Delete
if (!activeDescendant) return false;
[54845] Fix | Delete
return activeDescendant === element.id;
[54846] Fix | Delete
}
[54847] Fix | Delete
[54848] Fix | Delete
[54849] Fix | Delete
[54850] Fix | Delete
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/ensureFocus.js
[54851] Fix | Delete
[54852] Fix | Delete
[54853] Fix | Delete
[54854] Fix | Delete
[54855] Fix | Delete
/**
[54856] Fix | Delete
* Ensures `element` will receive focus if it's not already.
[54857] Fix | Delete
*
[54858] Fix | Delete
* @example
[54859] Fix | Delete
* import { ensureFocus } from "reakit-utils";
[54860] Fix | Delete
*
[54861] Fix | Delete
* ensureFocus(document.activeElement); // does nothing
[54862] Fix | Delete
*
[54863] Fix | Delete
* const element = document.querySelector("input");
[54864] Fix | Delete
*
[54865] Fix | Delete
* ensureFocus(element); // focuses element
[54866] Fix | Delete
* ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump
[54867] Fix | Delete
*
[54868] Fix | Delete
* function isActive(el) {
[54869] Fix | Delete
* return el.dataset.active === "true";
[54870] Fix | Delete
* }
[54871] Fix | Delete
*
[54872] Fix | Delete
* ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing
[54873] Fix | Delete
*
[54874] Fix | Delete
* @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed.
[54875] Fix | Delete
*/
[54876] Fix | Delete
function ensureFocus(element, _temp) {
[54877] Fix | Delete
var _ref = _temp === void 0 ? {} : _temp,
[54878] Fix | Delete
preventScroll = _ref.preventScroll,
[54879] Fix | Delete
_ref$isActive = _ref.isActive,
[54880] Fix | Delete
isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive;
[54881] Fix | Delete
[54882] Fix | Delete
if (isActive(element)) return -1;
[54883] Fix | Delete
element.focus({
[54884] Fix | Delete
preventScroll: preventScroll
[54885] Fix | Delete
});
[54886] Fix | Delete
if (isActive(element)) return -1;
[54887] Fix | Delete
return requestAnimationFrame(function () {
[54888] Fix | Delete
element.focus({
[54889] Fix | Delete
preventScroll: preventScroll
[54890] Fix | Delete
});
[54891] Fix | Delete
});
[54892] Fix | Delete
}
[54893] Fix | Delete
[54894] Fix | Delete
[54895] Fix | Delete
[54896] Fix | Delete
[54897] Fix | Delete
/***/ }),
[54898] Fix | Delete
[54899] Fix | Delete
/***/ "pRvc":
[54900] Fix | Delete
/***/ (function(module, exports, __webpack_require__) {
[54901] Fix | Delete
[54902] Fix | Delete
"use strict";
[54903] Fix | Delete
[54904] Fix | Delete
[54905] Fix | Delete
Object.defineProperty(exports, "__esModule", {
[54906] Fix | Delete
value: true
[54907] Fix | Delete
});
[54908] Fix | Delete
exports['default'] = isSameDay;
[54909] Fix | Delete
[54910] Fix | Delete
var _moment = __webpack_require__("wy2R");
[54911] Fix | Delete
[54912] Fix | Delete
var _moment2 = _interopRequireDefault(_moment);
[54913] Fix | Delete
[54914] Fix | Delete
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
[54915] Fix | Delete
[54916] Fix | Delete
function isSameDay(a, b) {
[54917] Fix | Delete
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
[54918] Fix | Delete
// Compare least significant, most likely to change units first
[54919] Fix | Delete
// Moment's isSame clones moment inputs and is a tad slow
[54920] Fix | Delete
return a.date() === b.date() && a.month() === b.month() && a.year() === b.year();
[54921] Fix | Delete
}
[54922] Fix | Delete
[54923] Fix | Delete
/***/ }),
[54924] Fix | Delete
[54925] Fix | Delete
/***/ "pVnL":
[54926] Fix | Delete
/***/ (function(module, exports) {
[54927] Fix | Delete
[54928] Fix | Delete
function _extends() {
[54929] Fix | Delete
module.exports = _extends = Object.assign || function (target) {
[54930] Fix | Delete
for (var i = 1; i < arguments.length; i++) {
[54931] Fix | Delete
var source = arguments[i];
[54932] Fix | Delete
[54933] Fix | Delete
for (var key in source) {
[54934] Fix | Delete
if (Object.prototype.hasOwnProperty.call(source, key)) {
[54935] Fix | Delete
target[key] = source[key];
[54936] Fix | Delete
}
[54937] Fix | Delete
}
[54938] Fix | Delete
}
[54939] Fix | Delete
[54940] Fix | Delete
return target;
[54941] Fix | Delete
};
[54942] Fix | Delete
[54943] Fix | Delete
return _extends.apply(this, arguments);
[54944] Fix | Delete
}
[54945] Fix | Delete
[54946] Fix | Delete
module.exports = _extends;
[54947] Fix | Delete
[54948] Fix | Delete
/***/ }),
[54949] Fix | Delete
[54950] Fix | Delete
/***/ "pYxT":
[54951] Fix | Delete
/***/ (function(module, exports, __webpack_require__) {
[54952] Fix | Delete
[54953] Fix | Delete
"use strict";
[54954] Fix | Delete
[54955] Fix | Delete
[54956] Fix | Delete
Object.defineProperty(exports, "__esModule", {
[54957] Fix | Delete
value: true
[54958] Fix | Delete
});
[54959] Fix | Delete
exports['default'] = toISODateString;
[54960] Fix | Delete
[54961] Fix | Delete
var _moment = __webpack_require__("wy2R");
[54962] Fix | Delete
[54963] Fix | Delete
var _moment2 = _interopRequireDefault(_moment);
[54964] Fix | Delete
[54965] Fix | Delete
var _toMomentObject = __webpack_require__("WmS1");
[54966] Fix | Delete
[54967] Fix | Delete
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
[54968] Fix | Delete
[54969] Fix | Delete
var _constants = __webpack_require__("Fv1B");
[54970] Fix | Delete
[54971] Fix | Delete
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
[54972] Fix | Delete
[54973] Fix | Delete
function toISODateString(date, currentFormat) {
[54974] Fix | Delete
var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
[54975] Fix | Delete
if (!dateObj) return null;
[54976] Fix | Delete
[54977] Fix | Delete
return dateObj.format(_constants.ISO_FORMAT);
[54978] Fix | Delete
}
[54979] Fix | Delete
[54980] Fix | Delete
/***/ }),
[54981] Fix | Delete
[54982] Fix | Delete
/***/ "pukL":
[54983] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[54984] Fix | Delete
[54985] Fix | Delete
"use strict";
[54986] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isUA; });
[54987] Fix | Delete
/* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("PcbF");
[54988] Fix | Delete
[54989] Fix | Delete
[54990] Fix | Delete
[54991] Fix | Delete
[54992] Fix | Delete
/**
[54993] Fix | Delete
* Checks if a given string exists in the user agent string.
[54994] Fix | Delete
*/
[54995] Fix | Delete
[54996] Fix | Delete
function isUA(string) {
[54997] Fix | Delete
if (!_canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__[/* canUseDOM */ "a"]) return false;
[54998] Fix | Delete
return window.navigator.userAgent.indexOf(string) !== -1;
[54999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function