@indico-data/design-system 1.0.56 → 1.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/sdks/prettier/package.json +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/inputs/RadioButtons/RadioButtons.styles.d.ts +1 -1
- package/lib/components/text-truncate/TextTruncate.d.ts +2 -1
- package/lib/index.d.ts +72 -58
- package/lib/index.esm.js +1829 -213
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1828 -211
- package/lib/index.js.map +1 -1
- package/package.json +32 -31
- package/src/components/Tooltip/Tooltip.stories.tsx +107 -0
- package/src/components/Tooltip/Tooltip.styles.ts +76 -0
- package/src/components/Tooltip/Tooltip.tsx +71 -0
- package/src/components/Wizard/Wizard.stories.tsx +1 -1
- package/src/components/index.ts +3 -0
- package/src/components/text-truncate/TextTruncate.tsx +3 -2
- package/src/index.ts +1 -0
- package/lib/components/Navigation/Drawer/constants.d.ts +0 -3
- package/lib/components/containment/Tooltip/Tooltip.d.ts +0 -15
- package/lib/components/containment/Tooltip/Tooltip.stories.d.ts +0 -6
- package/lib/components/containment/Tooltip/Tooltip.styles.d.ts +0 -2
- /package/{lib/components/containment/Tooltip/index.d.ts → src/components/Tooltip/index.ts} +0 -0
package/lib/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import styled, { css, createGlobalStyle, keyframes } from 'styled-components';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { useState, useEffect, useRef, useCallback, useContext, useMemo, createContext, forwardRef, useLayoutEffect } from 'react';
|
|
4
|
+
import React__default, { useState, useEffect, useRef, useCallback, useContext, useMemo, createContext, forwardRef, useLayoutEffect, useImperativeHandle } from 'react';
|
|
5
5
|
import ReactSelect, { components } from 'react-select';
|
|
6
6
|
import { Link, NavLink } from 'react-router-dom';
|
|
7
7
|
import * as ReactDOM from 'react-dom';
|
|
@@ -104,7 +104,7 @@ const round10 = (value, exp) => {
|
|
|
104
104
|
return decimalAdjust('round', value, exp);
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
const clamp = (value, min, max) => {
|
|
107
|
+
const clamp$1 = (value, min, max) => {
|
|
108
108
|
value = value < min ? min : value;
|
|
109
109
|
value = value > max ? max : value;
|
|
110
110
|
return value;
|
|
@@ -117,7 +117,7 @@ const numberWithCommas$1 = (x) => {
|
|
|
117
117
|
const MATH = {
|
|
118
118
|
decimalAdjust,
|
|
119
119
|
round10,
|
|
120
|
-
clamp,
|
|
120
|
+
clamp: clamp$1,
|
|
121
121
|
numberWithCommas: numberWithCommas$1,
|
|
122
122
|
};
|
|
123
123
|
|
|
@@ -1749,7 +1749,7 @@ var classnames = {exports: {}};
|
|
|
1749
1749
|
} (classnames));
|
|
1750
1750
|
|
|
1751
1751
|
var classnamesExports = classnames.exports;
|
|
1752
|
-
var
|
|
1752
|
+
var y = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
1753
1753
|
|
|
1754
1754
|
const StyledSection = styled.article `
|
|
1755
1755
|
position: relative;
|
|
@@ -1760,7 +1760,7 @@ const StyledSection = styled.article `
|
|
|
1760
1760
|
|
|
1761
1761
|
const Section = (props) => {
|
|
1762
1762
|
const { className, style = {}, children, id } = props, restOfProps = __rest$1(props, ["className", "style", "children", "id"]);
|
|
1763
|
-
return (jsx(StyledSection, Object.assign({ className:
|
|
1763
|
+
return (jsx(StyledSection, Object.assign({ className: y('Section', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: children })));
|
|
1764
1764
|
};
|
|
1765
1765
|
|
|
1766
1766
|
const StyledSectionBlock = styled.div `
|
|
@@ -1777,7 +1777,7 @@ const StyledSectionBlock = styled.div `
|
|
|
1777
1777
|
|
|
1778
1778
|
const SectionBlock = (props) => {
|
|
1779
1779
|
const { title, className, children, id, style = {} } = props, restOfProps = __rest$1(props, ["title", "className", "children", "id", "style"]);
|
|
1780
|
-
return (jsxs(StyledSectionBlock, Object.assign({ className:
|
|
1780
|
+
return (jsxs(StyledSectionBlock, Object.assign({ className: y('SectionBlock', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: [title ? (jsx("header", { children: jsx("h3", { children: title }) })) : null, children, jsx("hr", { className: "section-bottom-border" })] })));
|
|
1781
1781
|
};
|
|
1782
1782
|
|
|
1783
1783
|
const sectionSidePadding = '19px';
|
|
@@ -1796,7 +1796,7 @@ const StyledSectionBody = styled.div `
|
|
|
1796
1796
|
|
|
1797
1797
|
const SectionBody = (props) => {
|
|
1798
1798
|
const { className, style = {}, children, id } = props, restOfProps = __rest$1(props, ["className", "style", "children", "id"]);
|
|
1799
|
-
return (jsx(StyledSectionBody, Object.assign({ className:
|
|
1799
|
+
return (jsx(StyledSectionBody, Object.assign({ className: y('SectionBody', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: children })));
|
|
1800
1800
|
};
|
|
1801
1801
|
|
|
1802
1802
|
const StyledSectionHeader = styled.header `
|
|
@@ -1805,7 +1805,7 @@ const StyledSectionHeader = styled.header `
|
|
|
1805
1805
|
|
|
1806
1806
|
const SectionHeader = (props) => {
|
|
1807
1807
|
const { className, style, children, id } = props, restOfProps = __rest$1(props, ["className", "style", "children", "id"]);
|
|
1808
|
-
return (jsx(StyledSectionHeader, Object.assign({ className:
|
|
1808
|
+
return (jsx(StyledSectionHeader, Object.assign({ className: y('SectionHeader', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: children })));
|
|
1809
1809
|
};
|
|
1810
1810
|
SectionHeader.defaultProps = {
|
|
1811
1811
|
className: '',
|
|
@@ -1949,7 +1949,7 @@ const StyledValidationError = styled.div `
|
|
|
1949
1949
|
const BorderSelect = (props) => {
|
|
1950
1950
|
const { className = '', disabled, horizontal, id, initialText, label, onChange, options, style = {}, value, validationErrors, } = props;
|
|
1951
1951
|
const selectId = v4();
|
|
1952
|
-
return (jsxs(StyledSelect$1, { className:
|
|
1952
|
+
return (jsxs(StyledSelect$1, { className: y('Select', { horizontal }, className), "data-cy": props['data-cy'], id: id, style: style, children: [label && jsx("label", { htmlFor: selectId, children: label }), jsxs("div", { className: "select-container", children: [jsxs("select", { onChange: onChange, value: value, disabled: disabled, id: selectId, children: [initialText && (jsx("option", { disabled: true, value: "", children: initialText })), options.map((o) => {
|
|
1953
1953
|
const key = v4();
|
|
1954
1954
|
return (jsx("option", { value: o.value, children: o.name }, key));
|
|
1955
1955
|
})] }), jsx(Icon, { name: "fa-caret-down", className: "selectCaret" })] }), validationErrors ? (jsx(StyledValidationError, { children: validationErrors.map((err, i) => {
|
|
@@ -2030,7 +2030,7 @@ const StyledSelect = styled.div `
|
|
|
2030
2030
|
const Select = (props) => {
|
|
2031
2031
|
const { id, className, disabled, initialText, onChange, options, size = 'medium', style = {}, value, variant, onClick, } = props;
|
|
2032
2032
|
const selectId = v4();
|
|
2033
|
-
return (jsx(StyledSelect, { className: className, "data-cy": props['data-cy'], id: id, style: style, children: jsxs("div", { className:
|
|
2033
|
+
return (jsx(StyledSelect, { className: className, "data-cy": props['data-cy'], id: id, style: style, children: jsxs("div", { className: y('Select__container', size, variant), onClick: (e) => (onClick ? onClick(e) : null), children: [jsxs("select", { onChange: onChange, value: value, disabled: disabled, id: selectId, children: [initialText && (jsx("option", { disabled: true, value: "", children: initialText })), options.map((o) => {
|
|
2034
2034
|
const key = v4();
|
|
2035
2035
|
return (jsx("option", { value: o.value, children: o.name }, key));
|
|
2036
2036
|
})] }), jsx(Icon, { className: "chevron", name: "chevron-down", size: size === 'small' ? [10] : [12] })] }) }));
|
|
@@ -2817,10 +2817,10 @@ const SectionTable = (props) => {
|
|
|
2817
2817
|
}
|
|
2818
2818
|
};
|
|
2819
2819
|
const headers = Object.keys(props.tableObjects[0].content);
|
|
2820
|
-
return (jsxs(StyledSectionTable, { className:
|
|
2820
|
+
return (jsxs(StyledSectionTable, { className: y('SectionTable', props.className, { loading: props.loading }), "data-cy": props['data-cy'], id: props.id, children: [props.sortColumnHandler && props.sortedColumn && (jsx("div", { className: "mobile-sort", children: jsx(BorderSelect, { onChange: (e) => props.sortColumnHandler(e.target.value), value: props.sortedColumn, options: [].concat({ name: 'Choose Sorting Option', value: '' }, headers.map((item) => {
|
|
2821
2821
|
return { name: item, value: item };
|
|
2822
2822
|
})) }) })), jsxs("table", Object.assign({}, props.tableProps, { children: [jsx("thead", { children: jsxs("tr", { children: [props.tableObjects[0].rowAccordionContent ? jsx("th", { className: "action-column" }) : null, headers.map((header, i) => {
|
|
2823
|
-
return (jsxs("th", { className:
|
|
2823
|
+
return (jsxs("th", { className: y({
|
|
2824
2824
|
'not-sortable': props.sortableHeaders && props.sortableHeaders.indexOf(header) === -1,
|
|
2825
2825
|
}), onClick: () => {
|
|
2826
2826
|
if (props.sortColumnHandler) {
|
|
@@ -2834,7 +2834,7 @@ const SectionTable = (props) => {
|
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
2836
2836
|
}, children: [props.headersContent ? props.headersContent[header] : header, ' ', props.sortedColumn === header && (jsx(Icon, { name: `fa-caret-${props.sortDirection}` }))] }, i));
|
|
2837
|
-
})] }) }), jsx("tbody", { className:
|
|
2837
|
+
})] }) }), jsx("tbody", { className: y({ 'SectionTable--tbody-loading': props.loading }), children: props.loading
|
|
2838
2838
|
? Array.from({ length: 5 }, (x, i) => (jsx("tr", { children: props.tableObjects[0].rowAccordionContent ? (jsx("td", { colSpan: headers.length + 1 })) : (jsx("td", { colSpan: headers.length })) }, i)))
|
|
2839
2839
|
: props.tableObjects.map((obj, i) => {
|
|
2840
2840
|
let rowStyle = obj.rowStyleCondition;
|
|
@@ -2842,7 +2842,7 @@ const SectionTable = (props) => {
|
|
|
2842
2842
|
rowStyle = { [rowStyle.className]: rowStyle.condition };
|
|
2843
2843
|
}
|
|
2844
2844
|
if (obj.rowAccordionContent) {
|
|
2845
|
-
return (jsx("tr", Object.assign({ className:
|
|
2845
|
+
return (jsx("tr", Object.assign({ className: y(rowStyle) }, props.rowProps, { children: jsx("td", { colSpan: headers.length + 1, style: { padding: '0' }, className: "outer-hover", children: jsxs("table", { children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { className: "action-column", style: {
|
|
2846
2846
|
padding: '0',
|
|
2847
2847
|
height: '1px',
|
|
2848
2848
|
border: 'none',
|
|
@@ -2861,18 +2861,18 @@ const SectionTable = (props) => {
|
|
|
2861
2861
|
return (jsx("td", Object.assign({ style: {
|
|
2862
2862
|
borderBottom: 'none',
|
|
2863
2863
|
}, "data-heading": headers[i], title: createTitle(obj.content[key]) }, (_a = props === null || props === void 0 ? void 0 : props.headingProps) === null || _a === void 0 ? void 0 : _a[headers === null || headers === void 0 ? void 0 : headers[i]], { children: obj.content[key] }), i));
|
|
2864
|
-
})] }), jsx("tr", { className:
|
|
2864
|
+
})] }), jsx("tr", { className: y('row-option', {
|
|
2865
2865
|
open: openRowOptions.indexOf(obj.id) !== -1,
|
|
2866
2866
|
}), children: jsx("td", { className: "inner-table-cell", colSpan: headers.length + 1, children: obj.rowAccordionContent }) })] })] }) }) }), i));
|
|
2867
2867
|
}
|
|
2868
2868
|
else if (obj.lineItemLink) {
|
|
2869
|
-
return (jsx("tr", Object.assign({ onClick: handleRowClick(obj.lineItemLink), className:
|
|
2869
|
+
return (jsx("tr", Object.assign({ onClick: handleRowClick(obj.lineItemLink), className: y('hover', rowStyle) }, props.rowProps, { children: Object.keys(obj.content).map((key, i) => {
|
|
2870
2870
|
var _a;
|
|
2871
2871
|
return (jsx("td", Object.assign({ "data-heading": headers[i], title: createTitle(obj.content[key]) }, (_a = props === null || props === void 0 ? void 0 : props.headingProps) === null || _a === void 0 ? void 0 : _a[headers === null || headers === void 0 ? void 0 : headers[i]], { children: obj.content[key] }), i));
|
|
2872
2872
|
}) }), i));
|
|
2873
2873
|
}
|
|
2874
2874
|
else {
|
|
2875
|
-
return (jsx("tr", Object.assign({ className:
|
|
2875
|
+
return (jsx("tr", Object.assign({ className: y(rowStyle) }, props.rowProps, { children: Object.keys(obj.content).map((key, i) => {
|
|
2876
2876
|
var _a;
|
|
2877
2877
|
return (jsx("td", Object.assign({ "data-heading": headers[i], title: createTitle(obj.content[key]) }, (_a = props === null || props === void 0 ? void 0 : props.headingProps) === null || _a === void 0 ? void 0 : _a[headers === null || headers === void 0 ? void 0 : headers[i]], { children: obj.content[key] }), i));
|
|
2878
2878
|
}) }), i));
|
|
@@ -3377,7 +3377,7 @@ const StyledButton = styled.button `
|
|
|
3377
3377
|
|
|
3378
3378
|
function Button$1(props) {
|
|
3379
3379
|
const { id, className, busy, children, disabled, onClick, onFocus, role, style, tabindex, type, variant = 'default' } = props, rest = __rest$1(props, ["id", "className", "busy", "children", "disabled", "onClick", "onFocus", "role", "style", "tabindex", "type", "variant"]);
|
|
3380
|
-
return (jsxs(StyledButton, Object.assign({ "aria-disabled": busy, "aria-label": props['aria-label'], "aria-pressed": props['aria-pressed'], "aria-selected": props['aria-selected'], className:
|
|
3380
|
+
return (jsxs(StyledButton, Object.assign({ "aria-disabled": busy, "aria-label": props['aria-label'], "aria-pressed": props['aria-pressed'], "aria-selected": props['aria-selected'], className: y(variant, className, {
|
|
3381
3381
|
blue: variant === 'primary' || variant === 'cta',
|
|
3382
3382
|
busy,
|
|
3383
3383
|
}), "data-cy": props['data-cy'], disabled: disabled, id: id, onClick: busy ? undefined : onClick, onFocus: onFocus, role: role, style: style, tabIndex: tabindex, type: type || 'button' }, rest, { children: [busy && jsx(CircleSpinner, { size: "0.9em", style: { marginRight: '0.5em' } }), children] })));
|
|
@@ -3638,7 +3638,7 @@ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
|
3638
3638
|
// @ts-ignore
|
|
3639
3639
|
return (useCallback)((...args)=>{
|
|
3640
3640
|
const f = ref.current;
|
|
3641
|
-
return f(...args);
|
|
3641
|
+
return f === null || f === void 0 ? void 0 : f(...args);
|
|
3642
3642
|
}, []);
|
|
3643
3643
|
}
|
|
3644
3644
|
|
|
@@ -3649,6 +3649,7 @@ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
|
3649
3649
|
// Store the function in a ref so we can always access the current version
|
|
3650
3650
|
// which has the proper `value` in scope.
|
|
3651
3651
|
let nextRef = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
3652
|
+
if (!effect.current) return;
|
|
3652
3653
|
// Run the generator to the next yield.
|
|
3653
3654
|
let newValue = effect.current.next();
|
|
3654
3655
|
// If the generator is done, reset the effect.
|
|
@@ -3870,7 +3871,7 @@ function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
|
3870
3871
|
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
|
|
3871
3872
|
$7215afc6de606d6b$var$supportsPreventScrollCached = false;
|
|
3872
3873
|
try {
|
|
3873
|
-
|
|
3874
|
+
let focusElem = document.createElement("div");
|
|
3874
3875
|
focusElem.focus({
|
|
3875
3876
|
get preventScroll () {
|
|
3876
3877
|
$7215afc6de606d6b$var$supportsPreventScrollCached = true;
|
|
@@ -3884,9 +3885,9 @@ function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
|
3884
3885
|
return $7215afc6de606d6b$var$supportsPreventScrollCached;
|
|
3885
3886
|
}
|
|
3886
3887
|
function $7215afc6de606d6b$var$getScrollableElements(element) {
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3888
|
+
let parent = element.parentNode;
|
|
3889
|
+
let scrollableElements = [];
|
|
3890
|
+
let rootScrollingElement = document.scrollingElement || document.documentElement;
|
|
3890
3891
|
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
|
|
3891
3892
|
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
|
|
3892
3893
|
element: parent,
|
|
@@ -4021,7 +4022,11 @@ let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
|
|
|
4021
4022
|
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
|
|
4022
4023
|
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
4023
4024
|
if (typeof window === "undefined") return;
|
|
4025
|
+
function isTransitionEvent(event) {
|
|
4026
|
+
return "propertyName" in event;
|
|
4027
|
+
}
|
|
4024
4028
|
let onTransitionStart = (e)=>{
|
|
4029
|
+
if (!isTransitionEvent(e) || !e.target) return;
|
|
4025
4030
|
// Add the transitioning property to the list for this element.
|
|
4026
4031
|
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
|
|
4027
4032
|
if (!transitions) {
|
|
@@ -4030,11 +4035,14 @@ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
|
4030
4035
|
// The transitioncancel event must be registered on the element itself, rather than as a global
|
|
4031
4036
|
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
|
|
4032
4037
|
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
|
|
4033
|
-
e.target.addEventListener("transitioncancel", onTransitionEnd
|
|
4038
|
+
e.target.addEventListener("transitioncancel", onTransitionEnd, {
|
|
4039
|
+
once: true
|
|
4040
|
+
});
|
|
4034
4041
|
}
|
|
4035
4042
|
transitions.add(e.propertyName);
|
|
4036
4043
|
};
|
|
4037
4044
|
let onTransitionEnd = (e)=>{
|
|
4045
|
+
if (!isTransitionEvent(e) || !e.target) return;
|
|
4038
4046
|
// Remove property from list of transitioning properties.
|
|
4039
4047
|
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
|
|
4040
4048
|
if (!properties) return;
|
|
@@ -4173,7 +4181,7 @@ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
|
|
|
4173
4181
|
if (context && context.ref && ref) {
|
|
4174
4182
|
context.ref.current = ref.current;
|
|
4175
4183
|
return ()=>{
|
|
4176
|
-
context.ref.current = null;
|
|
4184
|
+
if (context.ref) context.ref.current = null;
|
|
4177
4185
|
};
|
|
4178
4186
|
}
|
|
4179
4187
|
});
|
|
@@ -4327,6 +4335,7 @@ function _class_private_field_set(receiver, privateMap, value) {
|
|
|
4327
4335
|
|
|
4328
4336
|
|
|
4329
4337
|
|
|
4338
|
+
|
|
4330
4339
|
/*
|
|
4331
4340
|
* Copyright 2020 Adobe. All rights reserved.
|
|
4332
4341
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -4394,7 +4403,6 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
|
4394
4403
|
}
|
|
4395
4404
|
|
|
4396
4405
|
|
|
4397
|
-
|
|
4398
4406
|
/*
|
|
4399
4407
|
* Copyright 2020 Adobe. All rights reserved.
|
|
4400
4408
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -4545,8 +4553,13 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4545
4553
|
state.isPressed = true;
|
|
4546
4554
|
shouldStopPropagation = triggerPressStart(e, "keyboard");
|
|
4547
4555
|
// Focus may move before the key up event, so register the event on the document
|
|
4548
|
-
// instead of the same element where the key down event occurred.
|
|
4549
|
-
|
|
4556
|
+
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
4557
|
+
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
4558
|
+
let originalTarget = e.currentTarget;
|
|
4559
|
+
let pressUp = (e)=>{
|
|
4560
|
+
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && originalTarget.contains(e.target) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard");
|
|
4561
|
+
};
|
|
4562
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), "keyup", ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp), true);
|
|
4550
4563
|
}
|
|
4551
4564
|
if (shouldStopPropagation) e.stopPropagation();
|
|
4552
4565
|
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
|
|
@@ -4559,9 +4572,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4559
4572
|
if (e.metaKey && ($c87311424ea30a05$export$9ac100e40613ea10)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
|
|
4560
4573
|
} else if (e.key === "Meta") state.metaKeyEvents = new Map();
|
|
4561
4574
|
},
|
|
4562
|
-
onKeyUp (e) {
|
|
4563
|
-
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && !e.repeat && e.currentTarget.contains(e.target) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard");
|
|
4564
|
-
},
|
|
4565
4575
|
onClick (e) {
|
|
4566
4576
|
if (e && !e.currentTarget.contains(e.target)) return;
|
|
4567
4577
|
if (e && e.button === 0 && !state.isTriggeringEvent && !($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) {
|
|
@@ -4589,9 +4599,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4589
4599
|
var _state_metaKeyEvents1;
|
|
4590
4600
|
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target, e.key)) e.preventDefault();
|
|
4591
4601
|
let target = e.target;
|
|
4592
|
-
|
|
4602
|
+
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard", state.target.contains(target));
|
|
4593
4603
|
removeAllGlobalListeners();
|
|
4594
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
4595
4604
|
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
4596
4605
|
// This means the link has a role override, and the default browser behavior
|
|
4597
4606
|
// only applies when using the Enter key.
|
|
@@ -5126,7 +5135,7 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
|
5126
5135
|
|
|
5127
5136
|
let $507fabe10e71c6fb$var$currentModality = null;
|
|
5128
5137
|
let $507fabe10e71c6fb$var$changeHandlers = new Set();
|
|
5129
|
-
let $507fabe10e71c6fb$
|
|
5138
|
+
let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
|
|
5130
5139
|
let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
|
|
5131
5140
|
let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
|
|
5132
5141
|
// Only Tab or Esc keys will make focus visible on text input elements
|
|
@@ -5185,39 +5194,82 @@ function $507fabe10e71c6fb$var$handleWindowBlur() {
|
|
|
5185
5194
|
}
|
|
5186
5195
|
/**
|
|
5187
5196
|
* Setup global event listeners to control when keyboard focus style should be visible.
|
|
5188
|
-
*/ function $507fabe10e71c6fb$var$setupGlobalFocusEvents() {
|
|
5189
|
-
if (typeof window === "undefined" || $507fabe10e71c6fb$
|
|
5197
|
+
*/ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
|
|
5198
|
+
if (typeof window === "undefined" || $507fabe10e71c6fb$export$d90243b58daecda7.get(($431fbd86ca7dc216$export$f21a1ffae260145a)(element))) return;
|
|
5199
|
+
const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
|
|
5200
|
+
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
5190
5201
|
// Programmatic focus() calls shouldn't affect the current input modality.
|
|
5191
5202
|
// However, we need to detect other cases when a focus event occurs without
|
|
5192
5203
|
// a preceding user event (e.g. screen reader focus). Overriding the focus
|
|
5193
5204
|
// method on HTMLElement.prototype is a bit hacky, but works.
|
|
5194
|
-
let focus = HTMLElement.prototype.focus;
|
|
5195
|
-
HTMLElement.prototype.focus = function() {
|
|
5205
|
+
let focus = windowObject.HTMLElement.prototype.focus;
|
|
5206
|
+
windowObject.HTMLElement.prototype.focus = function() {
|
|
5196
5207
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
5197
5208
|
focus.apply(this, arguments);
|
|
5198
5209
|
};
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5210
|
+
documentObject.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5211
|
+
documentObject.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5212
|
+
documentObject.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
|
|
5202
5213
|
// Register focus events on the window so they are sure to happen
|
|
5203
5214
|
// before React's event listeners (registered on the document).
|
|
5204
|
-
|
|
5205
|
-
|
|
5215
|
+
windowObject.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
|
|
5216
|
+
windowObject.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
|
|
5206
5217
|
if (typeof PointerEvent !== "undefined") {
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5218
|
+
documentObject.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5219
|
+
documentObject.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5220
|
+
documentObject.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5210
5221
|
} else {
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
}
|
|
5215
|
-
|
|
5222
|
+
documentObject.addEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5223
|
+
documentObject.addEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5224
|
+
documentObject.addEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5225
|
+
}
|
|
5226
|
+
// Add unmount handler
|
|
5227
|
+
windowObject.addEventListener("beforeunload", ()=>{
|
|
5228
|
+
$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
|
|
5229
|
+
}, {
|
|
5230
|
+
once: true
|
|
5231
|
+
});
|
|
5232
|
+
$507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
|
|
5233
|
+
focus: focus
|
|
5234
|
+
});
|
|
5216
5235
|
}
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5236
|
+
const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener)=>{
|
|
5237
|
+
const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
|
|
5238
|
+
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
5239
|
+
if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
|
|
5240
|
+
if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
|
|
5241
|
+
windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
|
|
5242
|
+
documentObject.removeEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5243
|
+
documentObject.removeEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5244
|
+
documentObject.removeEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
|
|
5245
|
+
windowObject.removeEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
|
|
5246
|
+
windowObject.removeEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
|
|
5247
|
+
if (typeof PointerEvent !== "undefined") {
|
|
5248
|
+
documentObject.removeEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5249
|
+
documentObject.removeEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5250
|
+
documentObject.removeEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5251
|
+
} else {
|
|
5252
|
+
documentObject.removeEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5253
|
+
documentObject.removeEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5254
|
+
documentObject.removeEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5255
|
+
}
|
|
5256
|
+
$507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
|
|
5257
|
+
};
|
|
5258
|
+
function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
|
|
5259
|
+
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
5260
|
+
let loadListener;
|
|
5261
|
+
if (documentObject.readyState !== "loading") $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
|
|
5262
|
+
else {
|
|
5263
|
+
loadListener = ()=>{
|
|
5264
|
+
$507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
|
|
5265
|
+
};
|
|
5266
|
+
documentObject.addEventListener("DOMContentLoaded", loadListener);
|
|
5267
|
+
}
|
|
5268
|
+
return ()=>$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
|
|
5220
5269
|
}
|
|
5270
|
+
// Server-side rendering does not have the document object defined
|
|
5271
|
+
// eslint-disable-next-line no-restricted-globals
|
|
5272
|
+
if (typeof document !== "undefined") $507fabe10e71c6fb$export$2f1888112f558a7d();
|
|
5221
5273
|
function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
|
|
5222
5274
|
return $507fabe10e71c6fb$var$currentModality !== "pointer";
|
|
5223
5275
|
}
|
|
@@ -5244,8 +5296,12 @@ const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
|
|
|
5244
5296
|
* focus visible style can be properly set.
|
|
5245
5297
|
*/ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
|
|
5246
5298
|
var _e_target;
|
|
5247
|
-
|
|
5248
|
-
|
|
5299
|
+
const IHTMLInputElement = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
|
|
5300
|
+
const IHTMLTextAreaElement = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
|
|
5301
|
+
const IHTMLElement = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
|
|
5302
|
+
const IKeyboardEvent = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
|
|
5303
|
+
isTextInput = isTextInput || (e === null || e === void 0 ? void 0 : e.target) instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(e === null || e === void 0 ? void 0 : (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.type) || (e === null || e === void 0 ? void 0 : e.target) instanceof IHTMLTextAreaElement || (e === null || e === void 0 ? void 0 : e.target) instanceof IHTMLElement && (e === null || e === void 0 ? void 0 : e.target.isContentEditable);
|
|
5304
|
+
return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
|
|
5249
5305
|
}
|
|
5250
5306
|
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
5251
5307
|
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
|
|
@@ -5951,7 +6007,7 @@ function IconButton(props) {
|
|
|
5951
6007
|
// @ts-ignore
|
|
5952
6008
|
buttonEl);
|
|
5953
6009
|
const { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f();
|
|
5954
|
-
const commonProps = Object.assign(Object.assign(Object.assign({ 'aria-disabled': busy, className:
|
|
6010
|
+
const commonProps = Object.assign(Object.assign(Object.assign({ 'aria-disabled': busy, className: y(iconSide, size, variant, className, {
|
|
5955
6011
|
'focus-visible': isFocusVisible,
|
|
5956
6012
|
busy,
|
|
5957
6013
|
disabled: isLink && isDisabled,
|
|
@@ -5960,7 +6016,7 @@ function IconButton(props) {
|
|
|
5960
6016
|
marginTop: `${adjustAlignment}px`,
|
|
5961
6017
|
marginBottom: `${Math.abs(adjustAlignment)}px`,
|
|
5962
6018
|
marginRight: `${spacings.xs}`,
|
|
5963
|
-
} })) : (jsx(Icon, { className:
|
|
6019
|
+
} })) : (jsx(Icon, { className: y({ 'right-margin': label }), name: iconName }));
|
|
5964
6020
|
const labelElement = label ? (jsx("span", { style: { marginTop: `${adjustAlignment}px` }, children: label })) : null;
|
|
5965
6021
|
if (isLink && !isDisabled) {
|
|
5966
6022
|
return (
|
|
@@ -6043,7 +6099,7 @@ function EditableInput(props) {
|
|
|
6043
6099
|
setInitialValue(editableEl.current.innerText);
|
|
6044
6100
|
}
|
|
6045
6101
|
}, []);
|
|
6046
|
-
return (jsxs(StyledEditableInput, { className:
|
|
6102
|
+
return (jsxs(StyledEditableInput, { className: y('EditableInput-container', id, className), "data-cy": props['data-cy'], id: props.id, children: [jsx("span", { role: "textbox", tabIndex: 0, contentEditable: true, suppressContentEditableWarning: true, ref: editableEl, onKeyDown: handleKeypress, onBlur: handleBlur, children: children }), jsx(Icon, { name: "fa-pencil-alt", className: "pencil-icon" })] }));
|
|
6047
6103
|
}
|
|
6048
6104
|
|
|
6049
6105
|
const inputCommon = css `
|
|
@@ -6225,7 +6281,7 @@ function NumberInput(props) {
|
|
|
6225
6281
|
}, 1000);
|
|
6226
6282
|
return () => clearTimeout(delayDebounceFn);
|
|
6227
6283
|
}, [currentValue]);
|
|
6228
|
-
return (jsxs(StyledNumberField, { className:
|
|
6284
|
+
return (jsxs(StyledNumberField, { className: y(className, {
|
|
6229
6285
|
hiddenLabel,
|
|
6230
6286
|
}), "data-cy": props['data-cy'], id: id, children: [jsx("input", { tabIndex: tabIndex, autoFocus: autoFocus, id: fieldId, type: "number", value: currentValue, disabled: disabled, max: max, min: min, onChange: handleChange, placeholder: placeholder, required: required, step: step, "aria-label": hiddenLabel ? label : '', ref: inputEl }), !hiddenLabel && jsx("label", { htmlFor: fieldId, children: label }), jsxs("div", { className: "spin-buttons", children: [jsx(Button$1, { variant: "no-style", onClick: increment, tabindex: -1, children: jsx(Icon, { name: "fa-caret-up", ariaLabel: "increase" }) }), jsx(Button$1, { variant: "no-style", onClick: decrement, tabindex: -1, children: jsx(Icon, { name: "fa-caret-down", ariaLabel: "decrease" }) })] })] }));
|
|
6231
6287
|
}
|
|
@@ -6279,7 +6335,7 @@ const StyledSearchField = styled.div `
|
|
|
6279
6335
|
const SearchInput = (props) => {
|
|
6280
6336
|
const { id, border, showSearchIcon, showClearInputIcon, className, inputProps, onChange, onClear, onKeyUp, placeholder, value, } = props;
|
|
6281
6337
|
const getId = id ? id : v4();
|
|
6282
|
-
return (jsxs(StyledSearchField, { className:
|
|
6338
|
+
return (jsxs(StyledSearchField, { className: y(className, {
|
|
6283
6339
|
border,
|
|
6284
6340
|
showSearchIcon,
|
|
6285
6341
|
showClearInputIcon,
|
|
@@ -6357,7 +6413,7 @@ function TextInput(props) {
|
|
|
6357
6413
|
const inputId = v4();
|
|
6358
6414
|
const { autoComplete, autoFocus, className, defaultValue, disabled, displayErrors, id, inputProps, label, maxLength, name, onBlur, onChange, onFocus, placeholder, promptProps, required, type = 'text', validationErrors, value, readOnly, } = props;
|
|
6359
6415
|
const errorClass = displayErrors ? 'error' : 'prompt';
|
|
6360
|
-
return (jsxs(StyledTextInput, { className: className, "data-cy": props['data-cy'], id: id, children: [jsx("input", Object.assign({ autoComplete: autoComplete, autoFocus: autoFocus, className:
|
|
6416
|
+
return (jsxs(StyledTextInput, { className: className, "data-cy": props['data-cy'], id: id, children: [jsx("input", Object.assign({ autoComplete: autoComplete, autoFocus: autoFocus, className: y('text-input__input-element', {
|
|
6361
6417
|
filled: (value && value.length > 0) || defaultValue,
|
|
6362
6418
|
}), disabled: disabled, defaultValue: defaultValue, id: inputId, maxLength: maxLength, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyUp: (e) => {
|
|
6363
6419
|
if (e.key === 'Enter') {
|
|
@@ -6365,7 +6421,7 @@ function TextInput(props) {
|
|
|
6365
6421
|
}
|
|
6366
6422
|
}, placeholder: placeholder, required: required, type: type, value: value, readOnly: readOnly }, inputProps)), label ? jsx("label", { htmlFor: inputId, children: label }) : null, (validationErrors || maxLength) && (jsxs(StyledInputInfo, { children: [validationErrors && (jsx("div", { children: validationErrors.map((err, i) => {
|
|
6367
6423
|
return (jsx("p", Object.assign({ className: errorClass }, promptProps, { children: err }), i));
|
|
6368
|
-
}) })), maxLength && (jsxs("div", { className:
|
|
6424
|
+
}) })), maxLength && (jsxs("div", { className: y('count', { isMax: (value === null || value === void 0 ? void 0 : value.length) === maxLength }), children: [(value === null || value === void 0 ? void 0 : value.length) || 0, " / ", maxLength] }))] }))] }));
|
|
6369
6425
|
}
|
|
6370
6426
|
|
|
6371
6427
|
/*
|
|
@@ -7266,7 +7322,7 @@ function RadioGroup$1(props) {
|
|
|
7266
7322
|
};
|
|
7267
7323
|
const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(radioGroupState);
|
|
7268
7324
|
const { radioGroupProps, labelProps } = $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state);
|
|
7269
|
-
return (jsxs(StyledRadioGroup$1, Object.assign({}, radioGroupProps, { className:
|
|
7325
|
+
return (jsxs(StyledRadioGroup$1, Object.assign({}, radioGroupProps, { className: y(className, { horizontal: orientation === 'horizontal' }), "data-cy": props['data-cy'], id: id, children: [label && (jsx("div", Object.assign({ className: "groupLabel" }, labelProps, { children: label }))), jsx(RadioContext.Provider, { value: state, children: children })] })));
|
|
7270
7326
|
}
|
|
7271
7327
|
/**
|
|
7272
7328
|
* A single radio button and its label; no styling is applied, and the native
|
|
@@ -7286,7 +7342,7 @@ function Radio$1(props) {
|
|
|
7286
7342
|
else {
|
|
7287
7343
|
isSelected = state.selectedValue === props.value;
|
|
7288
7344
|
}
|
|
7289
|
-
return (jsxs("label", { className:
|
|
7345
|
+
return (jsxs("label", { className: y(className, {
|
|
7290
7346
|
disabled: isDisabled || state.isDisabled,
|
|
7291
7347
|
selected: isSelected,
|
|
7292
7348
|
focused: isFocusVisible,
|
|
@@ -7954,7 +8010,7 @@ function addYears(date, amount) {
|
|
|
7954
8010
|
* ])
|
|
7955
8011
|
* //=> Sun Jul 02 1995 00:00:00
|
|
7956
8012
|
*/
|
|
7957
|
-
function max$
|
|
8013
|
+
function max$2(dates) {
|
|
7958
8014
|
let result;
|
|
7959
8015
|
dates.forEach(function (dirtyDate) {
|
|
7960
8016
|
const currentDate = toDate(dirtyDate);
|
|
@@ -7995,7 +8051,7 @@ function max$1(dates) {
|
|
|
7995
8051
|
* ])
|
|
7996
8052
|
* //=> Wed Feb 11 1987 00:00:00
|
|
7997
8053
|
*/
|
|
7998
|
-
function min$
|
|
8054
|
+
function min$2(dates) {
|
|
7999
8055
|
let result;
|
|
8000
8056
|
|
|
8001
8057
|
dates.forEach((dirtyDate) => {
|
|
@@ -19360,10 +19416,10 @@ function getNextFocus(focusedDay, options) {
|
|
|
19360
19416
|
};
|
|
19361
19417
|
var newFocusedDay = moveFns[moveBy](focusedDay, direction === 'after' ? 1 : -1);
|
|
19362
19418
|
if (direction === 'before' && fromDate) {
|
|
19363
|
-
newFocusedDay = max$
|
|
19419
|
+
newFocusedDay = max$2([fromDate, newFocusedDay]);
|
|
19364
19420
|
}
|
|
19365
19421
|
else if (direction === 'after' && toDate) {
|
|
19366
|
-
newFocusedDay = min$
|
|
19422
|
+
newFocusedDay = min$2([toDate, newFocusedDay]);
|
|
19367
19423
|
}
|
|
19368
19424
|
var isFocusable = true;
|
|
19369
19425
|
if (modifiers) {
|
|
@@ -20282,11 +20338,11 @@ var write = 'write';
|
|
|
20282
20338
|
var afterWrite = 'afterWrite';
|
|
20283
20339
|
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
20284
20340
|
|
|
20285
|
-
function getNodeName(element) {
|
|
20341
|
+
function getNodeName$1(element) {
|
|
20286
20342
|
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
20287
20343
|
}
|
|
20288
20344
|
|
|
20289
|
-
function getWindow(node) {
|
|
20345
|
+
function getWindow$1(node) {
|
|
20290
20346
|
if (node == null) {
|
|
20291
20347
|
return window;
|
|
20292
20348
|
}
|
|
@@ -20299,23 +20355,23 @@ function getWindow(node) {
|
|
|
20299
20355
|
return node;
|
|
20300
20356
|
}
|
|
20301
20357
|
|
|
20302
|
-
function isElement(node) {
|
|
20303
|
-
var OwnElement = getWindow(node).Element;
|
|
20358
|
+
function isElement$1(node) {
|
|
20359
|
+
var OwnElement = getWindow$1(node).Element;
|
|
20304
20360
|
return node instanceof OwnElement || node instanceof Element;
|
|
20305
20361
|
}
|
|
20306
20362
|
|
|
20307
|
-
function isHTMLElement(node) {
|
|
20308
|
-
var OwnElement = getWindow(node).HTMLElement;
|
|
20363
|
+
function isHTMLElement$1(node) {
|
|
20364
|
+
var OwnElement = getWindow$1(node).HTMLElement;
|
|
20309
20365
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
20310
20366
|
}
|
|
20311
20367
|
|
|
20312
|
-
function isShadowRoot(node) {
|
|
20368
|
+
function isShadowRoot$1(node) {
|
|
20313
20369
|
// IE 11 has no ShadowRoot
|
|
20314
20370
|
if (typeof ShadowRoot === 'undefined') {
|
|
20315
20371
|
return false;
|
|
20316
20372
|
}
|
|
20317
20373
|
|
|
20318
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
|
20374
|
+
var OwnElement = getWindow$1(node).ShadowRoot;
|
|
20319
20375
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
20320
20376
|
}
|
|
20321
20377
|
|
|
@@ -20328,7 +20384,7 @@ function applyStyles(_ref) {
|
|
|
20328
20384
|
var attributes = state.attributes[name] || {};
|
|
20329
20385
|
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
20330
20386
|
|
|
20331
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
20387
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
20332
20388
|
return;
|
|
20333
20389
|
} // Flow doesn't support to extend this property, but it's the most
|
|
20334
20390
|
// effective way to apply styles to an HTMLElement
|
|
@@ -20380,7 +20436,7 @@ function effect$2(_ref2) {
|
|
|
20380
20436
|
return style;
|
|
20381
20437
|
}, {}); // arrow is optional + virtual elements
|
|
20382
20438
|
|
|
20383
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
20439
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
20384
20440
|
return;
|
|
20385
20441
|
}
|
|
20386
20442
|
|
|
@@ -20406,9 +20462,9 @@ function getBasePlacement(placement) {
|
|
|
20406
20462
|
return placement.split('-')[0];
|
|
20407
20463
|
}
|
|
20408
20464
|
|
|
20409
|
-
var max = Math.max;
|
|
20410
|
-
var min = Math.min;
|
|
20411
|
-
var round = Math.round;
|
|
20465
|
+
var max$1 = Math.max;
|
|
20466
|
+
var min$1 = Math.min;
|
|
20467
|
+
var round$1 = Math.round;
|
|
20412
20468
|
|
|
20413
20469
|
function getUAString() {
|
|
20414
20470
|
var uaData = navigator.userAgentData;
|
|
@@ -20426,7 +20482,7 @@ function isLayoutViewport() {
|
|
|
20426
20482
|
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
20427
20483
|
}
|
|
20428
20484
|
|
|
20429
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
20485
|
+
function getBoundingClientRect$1(element, includeScale, isFixedStrategy) {
|
|
20430
20486
|
if (includeScale === void 0) {
|
|
20431
20487
|
includeScale = false;
|
|
20432
20488
|
}
|
|
@@ -20439,12 +20495,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
20439
20495
|
var scaleX = 1;
|
|
20440
20496
|
var scaleY = 1;
|
|
20441
20497
|
|
|
20442
|
-
if (includeScale && isHTMLElement(element)) {
|
|
20443
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
20444
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
20498
|
+
if (includeScale && isHTMLElement$1(element)) {
|
|
20499
|
+
scaleX = element.offsetWidth > 0 ? round$1(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
20500
|
+
scaleY = element.offsetHeight > 0 ? round$1(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
20445
20501
|
}
|
|
20446
20502
|
|
|
20447
|
-
var _ref = isElement(element) ? getWindow(element) : window,
|
|
20503
|
+
var _ref = isElement$1(element) ? getWindow$1(element) : window,
|
|
20448
20504
|
visualViewport = _ref.visualViewport;
|
|
20449
20505
|
|
|
20450
20506
|
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
@@ -20467,7 +20523,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
20467
20523
|
// means it doesn't take into account transforms.
|
|
20468
20524
|
|
|
20469
20525
|
function getLayoutRect(element) {
|
|
20470
|
-
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
20526
|
+
var clientRect = getBoundingClientRect$1(element); // Use the clientRect sizes if it's not been transformed.
|
|
20471
20527
|
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
20472
20528
|
|
|
20473
20529
|
var width = element.offsetWidth;
|
|
@@ -20495,7 +20551,7 @@ function contains(parent, child) {
|
|
|
20495
20551
|
if (parent.contains(child)) {
|
|
20496
20552
|
return true;
|
|
20497
20553
|
} // then fallback to custom implementation with Shadow DOM support
|
|
20498
|
-
else if (rootNode && isShadowRoot(rootNode)) {
|
|
20554
|
+
else if (rootNode && isShadowRoot$1(rootNode)) {
|
|
20499
20555
|
var next = child;
|
|
20500
20556
|
|
|
20501
20557
|
do {
|
|
@@ -20512,22 +20568,22 @@ function contains(parent, child) {
|
|
|
20512
20568
|
return false;
|
|
20513
20569
|
}
|
|
20514
20570
|
|
|
20515
|
-
function getComputedStyle$
|
|
20516
|
-
return getWindow(element).getComputedStyle(element);
|
|
20571
|
+
function getComputedStyle$2(element) {
|
|
20572
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
20517
20573
|
}
|
|
20518
20574
|
|
|
20519
|
-
function isTableElement(element) {
|
|
20520
|
-
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
|
20575
|
+
function isTableElement$1(element) {
|
|
20576
|
+
return ['table', 'td', 'th'].indexOf(getNodeName$1(element)) >= 0;
|
|
20521
20577
|
}
|
|
20522
20578
|
|
|
20523
|
-
function getDocumentElement(element) {
|
|
20579
|
+
function getDocumentElement$1(element) {
|
|
20524
20580
|
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
20525
|
-
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
20581
|
+
return ((isElement$1(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
20526
20582
|
element.document) || window.document).documentElement;
|
|
20527
20583
|
}
|
|
20528
20584
|
|
|
20529
|
-
function getParentNode(element) {
|
|
20530
|
-
if (getNodeName(element) === 'html') {
|
|
20585
|
+
function getParentNode$1(element) {
|
|
20586
|
+
if (getNodeName$1(element) === 'html') {
|
|
20531
20587
|
return element;
|
|
20532
20588
|
}
|
|
20533
20589
|
|
|
@@ -20536,16 +20592,16 @@ function getParentNode(element) {
|
|
|
20536
20592
|
// $FlowFixMe[prop-missing]
|
|
20537
20593
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
20538
20594
|
element.parentNode || ( // DOM Element detected
|
|
20539
|
-
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
20595
|
+
isShadowRoot$1(element) ? element.host : null) || // ShadowRoot detected
|
|
20540
20596
|
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
20541
|
-
getDocumentElement(element) // fallback
|
|
20597
|
+
getDocumentElement$1(element) // fallback
|
|
20542
20598
|
|
|
20543
20599
|
);
|
|
20544
20600
|
}
|
|
20545
20601
|
|
|
20546
|
-
function getTrueOffsetParent(element) {
|
|
20547
|
-
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
20548
|
-
getComputedStyle$
|
|
20602
|
+
function getTrueOffsetParent$1(element) {
|
|
20603
|
+
if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
20604
|
+
getComputedStyle$2(element).position === 'fixed') {
|
|
20549
20605
|
return null;
|
|
20550
20606
|
}
|
|
20551
20607
|
|
|
@@ -20554,27 +20610,27 @@ function getTrueOffsetParent(element) {
|
|
|
20554
20610
|
// return the containing block
|
|
20555
20611
|
|
|
20556
20612
|
|
|
20557
|
-
function getContainingBlock(element) {
|
|
20613
|
+
function getContainingBlock$1(element) {
|
|
20558
20614
|
var isFirefox = /firefox/i.test(getUAString());
|
|
20559
20615
|
var isIE = /Trident/i.test(getUAString());
|
|
20560
20616
|
|
|
20561
|
-
if (isIE && isHTMLElement(element)) {
|
|
20617
|
+
if (isIE && isHTMLElement$1(element)) {
|
|
20562
20618
|
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
20563
|
-
var elementCss = getComputedStyle$
|
|
20619
|
+
var elementCss = getComputedStyle$2(element);
|
|
20564
20620
|
|
|
20565
20621
|
if (elementCss.position === 'fixed') {
|
|
20566
20622
|
return null;
|
|
20567
20623
|
}
|
|
20568
20624
|
}
|
|
20569
20625
|
|
|
20570
|
-
var currentNode = getParentNode(element);
|
|
20626
|
+
var currentNode = getParentNode$1(element);
|
|
20571
20627
|
|
|
20572
|
-
if (isShadowRoot(currentNode)) {
|
|
20628
|
+
if (isShadowRoot$1(currentNode)) {
|
|
20573
20629
|
currentNode = currentNode.host;
|
|
20574
20630
|
}
|
|
20575
20631
|
|
|
20576
|
-
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
20577
|
-
var css = getComputedStyle$
|
|
20632
|
+
while (isHTMLElement$1(currentNode) && ['html', 'body'].indexOf(getNodeName$1(currentNode)) < 0) {
|
|
20633
|
+
var css = getComputedStyle$2(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
20578
20634
|
// create a containing block.
|
|
20579
20635
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
20580
20636
|
|
|
@@ -20590,27 +20646,27 @@ function getContainingBlock(element) {
|
|
|
20590
20646
|
// such as table ancestors and cross browser bugs.
|
|
20591
20647
|
|
|
20592
20648
|
|
|
20593
|
-
function getOffsetParent(element) {
|
|
20594
|
-
var window = getWindow(element);
|
|
20595
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
20649
|
+
function getOffsetParent$1(element) {
|
|
20650
|
+
var window = getWindow$1(element);
|
|
20651
|
+
var offsetParent = getTrueOffsetParent$1(element);
|
|
20596
20652
|
|
|
20597
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$
|
|
20598
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
20653
|
+
while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle$2(offsetParent).position === 'static') {
|
|
20654
|
+
offsetParent = getTrueOffsetParent$1(offsetParent);
|
|
20599
20655
|
}
|
|
20600
20656
|
|
|
20601
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$
|
|
20657
|
+
if (offsetParent && (getNodeName$1(offsetParent) === 'html' || getNodeName$1(offsetParent) === 'body' && getComputedStyle$2(offsetParent).position === 'static')) {
|
|
20602
20658
|
return window;
|
|
20603
20659
|
}
|
|
20604
20660
|
|
|
20605
|
-
return offsetParent || getContainingBlock(element) || window;
|
|
20661
|
+
return offsetParent || getContainingBlock$1(element) || window;
|
|
20606
20662
|
}
|
|
20607
20663
|
|
|
20608
20664
|
function getMainAxisFromPlacement(placement) {
|
|
20609
20665
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
20610
20666
|
}
|
|
20611
20667
|
|
|
20612
|
-
function within(min
|
|
20613
|
-
return max(min
|
|
20668
|
+
function within(min, value, max) {
|
|
20669
|
+
return max$1(min, min$1(value, max));
|
|
20614
20670
|
}
|
|
20615
20671
|
function withinMaxClamp(min, value, max) {
|
|
20616
20672
|
var v = within(min, value, max);
|
|
@@ -20644,7 +20700,7 @@ var toPaddingObject = function toPaddingObject(padding, state) {
|
|
|
20644
20700
|
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
20645
20701
|
};
|
|
20646
20702
|
|
|
20647
|
-
function arrow(_ref) {
|
|
20703
|
+
function arrow$2(_ref) {
|
|
20648
20704
|
var _state$modifiersData$;
|
|
20649
20705
|
|
|
20650
20706
|
var state = _ref.state,
|
|
@@ -20667,7 +20723,7 @@ function arrow(_ref) {
|
|
|
20667
20723
|
var maxProp = axis === 'y' ? bottom : right;
|
|
20668
20724
|
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
20669
20725
|
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
20670
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
20726
|
+
var arrowOffsetParent = getOffsetParent$1(arrowElement);
|
|
20671
20727
|
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
20672
20728
|
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
20673
20729
|
// outside of the popper bounds
|
|
@@ -20708,11 +20764,11 @@ function effect$1(_ref2) {
|
|
|
20708
20764
|
} // eslint-disable-next-line import/no-unused-modules
|
|
20709
20765
|
|
|
20710
20766
|
|
|
20711
|
-
var arrow$
|
|
20767
|
+
var arrow$3 = {
|
|
20712
20768
|
name: 'arrow',
|
|
20713
20769
|
enabled: true,
|
|
20714
20770
|
phase: 'main',
|
|
20715
|
-
fn: arrow,
|
|
20771
|
+
fn: arrow$2,
|
|
20716
20772
|
effect: effect$1,
|
|
20717
20773
|
requires: ['popperOffsets'],
|
|
20718
20774
|
requiresIfExists: ['preventOverflow']
|
|
@@ -20736,8 +20792,8 @@ function roundOffsetsByDPR(_ref, win) {
|
|
|
20736
20792
|
y = _ref.y;
|
|
20737
20793
|
var dpr = win.devicePixelRatio || 1;
|
|
20738
20794
|
return {
|
|
20739
|
-
x: round(x * dpr) / dpr || 0,
|
|
20740
|
-
y: round(y * dpr) / dpr || 0
|
|
20795
|
+
x: round$1(x * dpr) / dpr || 0,
|
|
20796
|
+
y: round$1(y * dpr) / dpr || 0
|
|
20741
20797
|
};
|
|
20742
20798
|
}
|
|
20743
20799
|
|
|
@@ -20776,14 +20832,14 @@ function mapToStyles(_ref2) {
|
|
|
20776
20832
|
var win = window;
|
|
20777
20833
|
|
|
20778
20834
|
if (adaptive) {
|
|
20779
|
-
var offsetParent = getOffsetParent(popper);
|
|
20835
|
+
var offsetParent = getOffsetParent$1(popper);
|
|
20780
20836
|
var heightProp = 'clientHeight';
|
|
20781
20837
|
var widthProp = 'clientWidth';
|
|
20782
20838
|
|
|
20783
|
-
if (offsetParent === getWindow(popper)) {
|
|
20784
|
-
offsetParent = getDocumentElement(popper);
|
|
20839
|
+
if (offsetParent === getWindow$1(popper)) {
|
|
20840
|
+
offsetParent = getDocumentElement$1(popper);
|
|
20785
20841
|
|
|
20786
|
-
if (getComputedStyle$
|
|
20842
|
+
if (getComputedStyle$2(offsetParent).position !== 'static' && position === 'absolute') {
|
|
20787
20843
|
heightProp = 'scrollHeight';
|
|
20788
20844
|
widthProp = 'scrollWidth';
|
|
20789
20845
|
}
|
|
@@ -20816,7 +20872,7 @@ function mapToStyles(_ref2) {
|
|
|
20816
20872
|
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
20817
20873
|
x: x,
|
|
20818
20874
|
y: y
|
|
20819
|
-
}, getWindow(popper)) : {
|
|
20875
|
+
}, getWindow$1(popper)) : {
|
|
20820
20876
|
x: x,
|
|
20821
20877
|
y: y
|
|
20822
20878
|
};
|
|
@@ -20895,7 +20951,7 @@ function effect(_ref) {
|
|
|
20895
20951
|
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
20896
20952
|
_options$resize = options.resize,
|
|
20897
20953
|
resize = _options$resize === void 0 ? true : _options$resize;
|
|
20898
|
-
var window = getWindow(state.elements.popper);
|
|
20954
|
+
var window = getWindow$1(state.elements.popper);
|
|
20899
20955
|
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
20900
20956
|
|
|
20901
20957
|
if (scroll) {
|
|
@@ -20937,7 +20993,7 @@ var hash$1 = {
|
|
|
20937
20993
|
bottom: 'top',
|
|
20938
20994
|
top: 'bottom'
|
|
20939
20995
|
};
|
|
20940
|
-
function getOppositePlacement(placement) {
|
|
20996
|
+
function getOppositePlacement$1(placement) {
|
|
20941
20997
|
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
20942
20998
|
return hash$1[matched];
|
|
20943
20999
|
});
|
|
@@ -20954,7 +21010,7 @@ function getOppositeVariationPlacement(placement) {
|
|
|
20954
21010
|
}
|
|
20955
21011
|
|
|
20956
21012
|
function getWindowScroll(node) {
|
|
20957
|
-
var win = getWindow(node);
|
|
21013
|
+
var win = getWindow$1(node);
|
|
20958
21014
|
var scrollLeft = win.pageXOffset;
|
|
20959
21015
|
var scrollTop = win.pageYOffset;
|
|
20960
21016
|
return {
|
|
@@ -20963,7 +21019,7 @@ function getWindowScroll(node) {
|
|
|
20963
21019
|
};
|
|
20964
21020
|
}
|
|
20965
21021
|
|
|
20966
|
-
function getWindowScrollBarX(element) {
|
|
21022
|
+
function getWindowScrollBarX$1(element) {
|
|
20967
21023
|
// If <html> has a CSS width greater than the viewport, then this will be
|
|
20968
21024
|
// incorrect for RTL.
|
|
20969
21025
|
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
@@ -20971,12 +21027,12 @@ function getWindowScrollBarX(element) {
|
|
|
20971
21027
|
// anyway.
|
|
20972
21028
|
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
20973
21029
|
// this (e.g. Edge 2019, IE11, Safari)
|
|
20974
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
21030
|
+
return getBoundingClientRect$1(getDocumentElement$1(element)).left + getWindowScroll(element).scrollLeft;
|
|
20975
21031
|
}
|
|
20976
21032
|
|
|
20977
|
-
function getViewportRect(element, strategy) {
|
|
20978
|
-
var win = getWindow(element);
|
|
20979
|
-
var html = getDocumentElement(element);
|
|
21033
|
+
function getViewportRect$1(element, strategy) {
|
|
21034
|
+
var win = getWindow$1(element);
|
|
21035
|
+
var html = getDocumentElement$1(element);
|
|
20980
21036
|
var visualViewport = win.visualViewport;
|
|
20981
21037
|
var width = html.clientWidth;
|
|
20982
21038
|
var height = html.clientHeight;
|
|
@@ -20997,26 +21053,26 @@ function getViewportRect(element, strategy) {
|
|
|
20997
21053
|
return {
|
|
20998
21054
|
width: width,
|
|
20999
21055
|
height: height,
|
|
21000
|
-
x: x + getWindowScrollBarX(element),
|
|
21056
|
+
x: x + getWindowScrollBarX$1(element),
|
|
21001
21057
|
y: y
|
|
21002
21058
|
};
|
|
21003
21059
|
}
|
|
21004
21060
|
|
|
21005
21061
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
21006
21062
|
|
|
21007
|
-
function getDocumentRect(element) {
|
|
21063
|
+
function getDocumentRect$1(element) {
|
|
21008
21064
|
var _element$ownerDocumen;
|
|
21009
21065
|
|
|
21010
|
-
var html = getDocumentElement(element);
|
|
21066
|
+
var html = getDocumentElement$1(element);
|
|
21011
21067
|
var winScroll = getWindowScroll(element);
|
|
21012
21068
|
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
21013
|
-
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
21014
|
-
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
21015
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
21069
|
+
var width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
21070
|
+
var height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
21071
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX$1(element);
|
|
21016
21072
|
var y = -winScroll.scrollTop;
|
|
21017
21073
|
|
|
21018
|
-
if (getComputedStyle$
|
|
21019
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
21074
|
+
if (getComputedStyle$2(body || html).direction === 'rtl') {
|
|
21075
|
+
x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
21020
21076
|
}
|
|
21021
21077
|
|
|
21022
21078
|
return {
|
|
@@ -21029,7 +21085,7 @@ function getDocumentRect(element) {
|
|
|
21029
21085
|
|
|
21030
21086
|
function isScrollParent(element) {
|
|
21031
21087
|
// Firefox wants us to check `-x` and `-y` variations as well
|
|
21032
|
-
var _getComputedStyle = getComputedStyle$
|
|
21088
|
+
var _getComputedStyle = getComputedStyle$2(element),
|
|
21033
21089
|
overflow = _getComputedStyle.overflow,
|
|
21034
21090
|
overflowX = _getComputedStyle.overflowX,
|
|
21035
21091
|
overflowY = _getComputedStyle.overflowY;
|
|
@@ -21038,16 +21094,16 @@ function isScrollParent(element) {
|
|
|
21038
21094
|
}
|
|
21039
21095
|
|
|
21040
21096
|
function getScrollParent(node) {
|
|
21041
|
-
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
21097
|
+
if (['html', 'body', '#document'].indexOf(getNodeName$1(node)) >= 0) {
|
|
21042
21098
|
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
21043
21099
|
return node.ownerDocument.body;
|
|
21044
21100
|
}
|
|
21045
21101
|
|
|
21046
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
21102
|
+
if (isHTMLElement$1(node) && isScrollParent(node)) {
|
|
21047
21103
|
return node;
|
|
21048
21104
|
}
|
|
21049
21105
|
|
|
21050
|
-
return getScrollParent(getParentNode(node));
|
|
21106
|
+
return getScrollParent(getParentNode$1(node));
|
|
21051
21107
|
}
|
|
21052
21108
|
|
|
21053
21109
|
/*
|
|
@@ -21066,14 +21122,14 @@ function listScrollParents(element, list) {
|
|
|
21066
21122
|
|
|
21067
21123
|
var scrollParent = getScrollParent(element);
|
|
21068
21124
|
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
21069
|
-
var win = getWindow(scrollParent);
|
|
21125
|
+
var win = getWindow$1(scrollParent);
|
|
21070
21126
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
21071
21127
|
var updatedList = list.concat(target);
|
|
21072
21128
|
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
21073
|
-
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
21129
|
+
updatedList.concat(listScrollParents(getParentNode$1(target)));
|
|
21074
21130
|
}
|
|
21075
21131
|
|
|
21076
|
-
function rectToClientRect(rect) {
|
|
21132
|
+
function rectToClientRect$1(rect) {
|
|
21077
21133
|
return Object.assign({}, rect, {
|
|
21078
21134
|
left: rect.x,
|
|
21079
21135
|
top: rect.y,
|
|
@@ -21082,8 +21138,8 @@ function rectToClientRect(rect) {
|
|
|
21082
21138
|
});
|
|
21083
21139
|
}
|
|
21084
21140
|
|
|
21085
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
21086
|
-
var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
21141
|
+
function getInnerBoundingClientRect$1(element, strategy) {
|
|
21142
|
+
var rect = getBoundingClientRect$1(element, false, strategy === 'fixed');
|
|
21087
21143
|
rect.top = rect.top + element.clientTop;
|
|
21088
21144
|
rect.left = rect.left + element.clientLeft;
|
|
21089
21145
|
rect.bottom = rect.top + element.clientHeight;
|
|
@@ -21096,39 +21152,39 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
21096
21152
|
}
|
|
21097
21153
|
|
|
21098
21154
|
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
21099
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
21155
|
+
return clippingParent === viewport ? rectToClientRect$1(getViewportRect$1(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect$1(clippingParent, strategy) : rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(element)));
|
|
21100
21156
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
21101
21157
|
// clipping (or hiding) overflowing elements with a position different from
|
|
21102
21158
|
// `initial`
|
|
21103
21159
|
|
|
21104
21160
|
|
|
21105
21161
|
function getClippingParents(element) {
|
|
21106
|
-
var clippingParents = listScrollParents(getParentNode(element));
|
|
21107
|
-
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$
|
|
21108
|
-
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
21162
|
+
var clippingParents = listScrollParents(getParentNode$1(element));
|
|
21163
|
+
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$2(element).position) >= 0;
|
|
21164
|
+
var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent$1(element) : element;
|
|
21109
21165
|
|
|
21110
|
-
if (!isElement(clipperElement)) {
|
|
21166
|
+
if (!isElement$1(clipperElement)) {
|
|
21111
21167
|
return [];
|
|
21112
21168
|
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
21113
21169
|
|
|
21114
21170
|
|
|
21115
21171
|
return clippingParents.filter(function (clippingParent) {
|
|
21116
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
21172
|
+
return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName$1(clippingParent) !== 'body';
|
|
21117
21173
|
});
|
|
21118
21174
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
21119
21175
|
// clipping parents
|
|
21120
21176
|
|
|
21121
21177
|
|
|
21122
|
-
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
21178
|
+
function getClippingRect$1(element, boundary, rootBoundary, strategy) {
|
|
21123
21179
|
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
|
21124
21180
|
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
|
21125
21181
|
var firstClippingParent = clippingParents[0];
|
|
21126
21182
|
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
21127
21183
|
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
21128
|
-
accRect.top = max(rect.top, accRect.top);
|
|
21129
|
-
accRect.right = min(rect.right, accRect.right);
|
|
21130
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
21131
|
-
accRect.left = max(rect.left, accRect.left);
|
|
21184
|
+
accRect.top = max$1(rect.top, accRect.top);
|
|
21185
|
+
accRect.right = min$1(rect.right, accRect.right);
|
|
21186
|
+
accRect.bottom = min$1(rect.bottom, accRect.bottom);
|
|
21187
|
+
accRect.left = max$1(rect.left, accRect.left);
|
|
21132
21188
|
return accRect;
|
|
21133
21189
|
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
21134
21190
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
@@ -21203,7 +21259,7 @@ function computeOffsets(_ref) {
|
|
|
21203
21259
|
return offsets;
|
|
21204
21260
|
}
|
|
21205
21261
|
|
|
21206
|
-
function detectOverflow(state, options) {
|
|
21262
|
+
function detectOverflow$1(state, options) {
|
|
21207
21263
|
if (options === void 0) {
|
|
21208
21264
|
options = {};
|
|
21209
21265
|
}
|
|
@@ -21227,15 +21283,15 @@ function detectOverflow(state, options) {
|
|
|
21227
21283
|
var altContext = elementContext === popper ? reference : popper;
|
|
21228
21284
|
var popperRect = state.rects.popper;
|
|
21229
21285
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
21230
|
-
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
21231
|
-
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
21286
|
+
var clippingClientRect = getClippingRect$1(isElement$1(element) ? element : element.contextElement || getDocumentElement$1(state.elements.popper), boundary, rootBoundary, strategy);
|
|
21287
|
+
var referenceClientRect = getBoundingClientRect$1(state.elements.reference);
|
|
21232
21288
|
var popperOffsets = computeOffsets({
|
|
21233
21289
|
reference: referenceClientRect,
|
|
21234
21290
|
element: popperRect,
|
|
21235
21291
|
strategy: 'absolute',
|
|
21236
21292
|
placement: placement
|
|
21237
21293
|
});
|
|
21238
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
21294
|
+
var popperClientRect = rectToClientRect$1(Object.assign({}, popperRect, popperOffsets));
|
|
21239
21295
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
21240
21296
|
// 0 or negative = within the clipping rect
|
|
21241
21297
|
|
|
@@ -21286,7 +21342,7 @@ function computeAutoPlacement(state, options) {
|
|
|
21286
21342
|
|
|
21287
21343
|
|
|
21288
21344
|
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
21289
|
-
acc[placement] = detectOverflow(state, {
|
|
21345
|
+
acc[placement] = detectOverflow$1(state, {
|
|
21290
21346
|
placement: placement,
|
|
21291
21347
|
boundary: boundary,
|
|
21292
21348
|
rootBoundary: rootBoundary,
|
|
@@ -21304,11 +21360,11 @@ function getExpandedFallbackPlacements(placement) {
|
|
|
21304
21360
|
return [];
|
|
21305
21361
|
}
|
|
21306
21362
|
|
|
21307
|
-
var oppositePlacement = getOppositePlacement(placement);
|
|
21363
|
+
var oppositePlacement = getOppositePlacement$1(placement);
|
|
21308
21364
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
21309
21365
|
}
|
|
21310
21366
|
|
|
21311
|
-
function flip(_ref) {
|
|
21367
|
+
function flip$2(_ref) {
|
|
21312
21368
|
var state = _ref.state,
|
|
21313
21369
|
options = _ref.options,
|
|
21314
21370
|
name = _ref.name;
|
|
@@ -21332,7 +21388,7 @@ function flip(_ref) {
|
|
|
21332
21388
|
var preferredPlacement = state.options.placement;
|
|
21333
21389
|
var basePlacement = getBasePlacement(preferredPlacement);
|
|
21334
21390
|
var isBasePlacement = basePlacement === preferredPlacement;
|
|
21335
|
-
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
21391
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement$1(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
21336
21392
|
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
21337
21393
|
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
|
21338
21394
|
placement: placement,
|
|
@@ -21357,7 +21413,7 @@ function flip(_ref) {
|
|
|
21357
21413
|
var isStartVariation = getVariation(placement) === start;
|
|
21358
21414
|
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
21359
21415
|
var len = isVertical ? 'width' : 'height';
|
|
21360
|
-
var overflow = detectOverflow(state, {
|
|
21416
|
+
var overflow = detectOverflow$1(state, {
|
|
21361
21417
|
placement: placement,
|
|
21362
21418
|
boundary: boundary,
|
|
21363
21419
|
rootBoundary: rootBoundary,
|
|
@@ -21367,10 +21423,10 @@ function flip(_ref) {
|
|
|
21367
21423
|
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
21368
21424
|
|
|
21369
21425
|
if (referenceRect[len] > popperRect[len]) {
|
|
21370
|
-
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
21426
|
+
mainVariationSide = getOppositePlacement$1(mainVariationSide);
|
|
21371
21427
|
}
|
|
21372
21428
|
|
|
21373
|
-
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
21429
|
+
var altVariationSide = getOppositePlacement$1(mainVariationSide);
|
|
21374
21430
|
var checks = [];
|
|
21375
21431
|
|
|
21376
21432
|
if (checkMainAxis) {
|
|
@@ -21428,11 +21484,11 @@ function flip(_ref) {
|
|
|
21428
21484
|
} // eslint-disable-next-line import/no-unused-modules
|
|
21429
21485
|
|
|
21430
21486
|
|
|
21431
|
-
var flip$
|
|
21487
|
+
var flip$3 = {
|
|
21432
21488
|
name: 'flip',
|
|
21433
21489
|
enabled: true,
|
|
21434
21490
|
phase: 'main',
|
|
21435
|
-
fn: flip,
|
|
21491
|
+
fn: flip$2,
|
|
21436
21492
|
requiresIfExists: ['offset'],
|
|
21437
21493
|
data: {
|
|
21438
21494
|
_skip: false
|
|
@@ -21467,10 +21523,10 @@ function hide$1(_ref) {
|
|
|
21467
21523
|
var referenceRect = state.rects.reference;
|
|
21468
21524
|
var popperRect = state.rects.popper;
|
|
21469
21525
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
21470
|
-
var referenceOverflow = detectOverflow(state, {
|
|
21526
|
+
var referenceOverflow = detectOverflow$1(state, {
|
|
21471
21527
|
elementContext: 'reference'
|
|
21472
21528
|
});
|
|
21473
|
-
var popperAltOverflow = detectOverflow(state, {
|
|
21529
|
+
var popperAltOverflow = detectOverflow$1(state, {
|
|
21474
21530
|
altBoundary: true
|
|
21475
21531
|
});
|
|
21476
21532
|
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
@@ -21519,7 +21575,7 @@ function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
|
21519
21575
|
};
|
|
21520
21576
|
}
|
|
21521
21577
|
|
|
21522
|
-
function offset(_ref2) {
|
|
21578
|
+
function offset$1(_ref2) {
|
|
21523
21579
|
var state = _ref2.state,
|
|
21524
21580
|
options = _ref2.options,
|
|
21525
21581
|
name = _ref2.name;
|
|
@@ -21542,12 +21598,12 @@ function offset(_ref2) {
|
|
|
21542
21598
|
} // eslint-disable-next-line import/no-unused-modules
|
|
21543
21599
|
|
|
21544
21600
|
|
|
21545
|
-
var offset$
|
|
21601
|
+
var offset$2 = {
|
|
21546
21602
|
name: 'offset',
|
|
21547
21603
|
enabled: true,
|
|
21548
21604
|
phase: 'main',
|
|
21549
21605
|
requires: ['popperOffsets'],
|
|
21550
|
-
fn: offset
|
|
21606
|
+
fn: offset$1
|
|
21551
21607
|
};
|
|
21552
21608
|
|
|
21553
21609
|
function popperOffsets(_ref) {
|
|
@@ -21594,7 +21650,7 @@ function preventOverflow(_ref) {
|
|
|
21594
21650
|
tether = _options$tether === void 0 ? true : _options$tether,
|
|
21595
21651
|
_options$tetherOffset = options.tetherOffset,
|
|
21596
21652
|
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
21597
|
-
var overflow = detectOverflow(state, {
|
|
21653
|
+
var overflow = detectOverflow$1(state, {
|
|
21598
21654
|
boundary: boundary,
|
|
21599
21655
|
rootBoundary: rootBoundary,
|
|
21600
21656
|
padding: padding,
|
|
@@ -21635,8 +21691,8 @@ function preventOverflow(_ref) {
|
|
|
21635
21691
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
21636
21692
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
21637
21693
|
var offset = popperOffsets[mainAxis];
|
|
21638
|
-
var min
|
|
21639
|
-
var max
|
|
21694
|
+
var min = offset + overflow[mainSide];
|
|
21695
|
+
var max = offset - overflow[altSide];
|
|
21640
21696
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
21641
21697
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
21642
21698
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -21658,12 +21714,12 @@ function preventOverflow(_ref) {
|
|
|
21658
21714
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
21659
21715
|
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
21660
21716
|
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
21661
|
-
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
21717
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent$1(state.elements.arrow);
|
|
21662
21718
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
21663
21719
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
21664
21720
|
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
21665
21721
|
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
21666
|
-
var preventedOffset = within(tether ? min(min
|
|
21722
|
+
var preventedOffset = within(tether ? min$1(min, tetherMin) : min, offset, tether ? max$1(max, tetherMax) : max);
|
|
21667
21723
|
popperOffsets[mainAxis] = preventedOffset;
|
|
21668
21724
|
data[mainAxis] = preventedOffset - offset;
|
|
21669
21725
|
}
|
|
@@ -21716,8 +21772,8 @@ function getHTMLElementScroll(element) {
|
|
|
21716
21772
|
};
|
|
21717
21773
|
}
|
|
21718
21774
|
|
|
21719
|
-
function getNodeScroll(node) {
|
|
21720
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
21775
|
+
function getNodeScroll$1(node) {
|
|
21776
|
+
if (node === getWindow$1(node) || !isHTMLElement$1(node)) {
|
|
21721
21777
|
return getWindowScroll(node);
|
|
21722
21778
|
} else {
|
|
21723
21779
|
return getHTMLElementScroll(node);
|
|
@@ -21726,8 +21782,8 @@ function getNodeScroll(node) {
|
|
|
21726
21782
|
|
|
21727
21783
|
function isElementScaled(element) {
|
|
21728
21784
|
var rect = element.getBoundingClientRect();
|
|
21729
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
21730
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
21785
|
+
var scaleX = round$1(rect.width) / element.offsetWidth || 1;
|
|
21786
|
+
var scaleY = round$1(rect.height) / element.offsetHeight || 1;
|
|
21731
21787
|
return scaleX !== 1 || scaleY !== 1;
|
|
21732
21788
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
21733
21789
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -21738,10 +21794,10 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
21738
21794
|
isFixed = false;
|
|
21739
21795
|
}
|
|
21740
21796
|
|
|
21741
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
21742
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
21743
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
21744
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
21797
|
+
var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
|
21798
|
+
var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
|
|
21799
|
+
var documentElement = getDocumentElement$1(offsetParent);
|
|
21800
|
+
var rect = getBoundingClientRect$1(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
21745
21801
|
var scroll = {
|
|
21746
21802
|
scrollLeft: 0,
|
|
21747
21803
|
scrollTop: 0
|
|
@@ -21752,17 +21808,17 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
21752
21808
|
};
|
|
21753
21809
|
|
|
21754
21810
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
21755
|
-
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
21811
|
+
if (getNodeName$1(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
21756
21812
|
isScrollParent(documentElement)) {
|
|
21757
|
-
scroll = getNodeScroll(offsetParent);
|
|
21813
|
+
scroll = getNodeScroll$1(offsetParent);
|
|
21758
21814
|
}
|
|
21759
21815
|
|
|
21760
|
-
if (isHTMLElement(offsetParent)) {
|
|
21761
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
21816
|
+
if (isHTMLElement$1(offsetParent)) {
|
|
21817
|
+
offsets = getBoundingClientRect$1(offsetParent, true);
|
|
21762
21818
|
offsets.x += offsetParent.clientLeft;
|
|
21763
21819
|
offsets.y += offsetParent.clientTop;
|
|
21764
21820
|
} else if (documentElement) {
|
|
21765
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
21821
|
+
offsets.x = getWindowScrollBarX$1(documentElement);
|
|
21766
21822
|
}
|
|
21767
21823
|
}
|
|
21768
21824
|
|
|
@@ -21900,7 +21956,7 @@ function popperGenerator(generatorOptions) {
|
|
|
21900
21956
|
cleanupModifierEffects();
|
|
21901
21957
|
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
21902
21958
|
state.scrollParents = {
|
|
21903
|
-
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
21959
|
+
reference: isElement$1(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
21904
21960
|
popper: listScrollParents(popper)
|
|
21905
21961
|
}; // Orders the modifiers based on their dependencies and `phase`
|
|
21906
21962
|
// properties
|
|
@@ -21934,7 +21990,7 @@ function popperGenerator(generatorOptions) {
|
|
|
21934
21990
|
|
|
21935
21991
|
|
|
21936
21992
|
state.rects = {
|
|
21937
|
-
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
|
21993
|
+
reference: getCompositeRect(reference, getOffsetParent$1(popper), state.options.strategy === 'fixed'),
|
|
21938
21994
|
popper: getLayoutRect(popper)
|
|
21939
21995
|
}; // Modifiers have the ability to reset the current update cycle. The
|
|
21940
21996
|
// most common use case for this is the `flip` modifier changing the
|
|
@@ -22036,7 +22092,7 @@ function popperGenerator(generatorOptions) {
|
|
|
22036
22092
|
};
|
|
22037
22093
|
}
|
|
22038
22094
|
|
|
22039
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$
|
|
22095
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$2, flip$3, preventOverflow$1, arrow$3, hide$2];
|
|
22040
22096
|
var createPopper = /*#__PURE__*/popperGenerator({
|
|
22041
22097
|
defaultModifiers: defaultModifiers
|
|
22042
22098
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
@@ -25527,7 +25583,7 @@ const StyledLoadingAwareContainer = styled.div `
|
|
|
25527
25583
|
*/
|
|
25528
25584
|
function LoadingAwareContainer(props) {
|
|
25529
25585
|
const { children, className, isLoading, style } = props;
|
|
25530
|
-
return (jsxs(StyledLoadingAwareContainer, { className:
|
|
25586
|
+
return (jsxs(StyledLoadingAwareContainer, { className: y({ loading: isLoading }, className), style: style, children: [jsx(StyledStatusContainer, { role: "status", children: isLoading && 'Loading' }), isLoading ? jsx(LoadingIndicator, {}) : jsx(Fragment, { children: children })] }));
|
|
25531
25587
|
}
|
|
25532
25588
|
|
|
25533
25589
|
const StyledWizard = styled.div `
|
|
@@ -25820,7 +25876,7 @@ function WizardWithSidebar(props) {
|
|
|
25820
25876
|
return () => setCurrentStep(steps[0] || '');
|
|
25821
25877
|
}, []);
|
|
25822
25878
|
return (jsxs(StyledWizardWithSidebar, { className: className, "data-cy": props['data-cy'], id: id, backgroundcolor: backgroundColor, color: color, buttoncolor: buttonColor, children: [jsxs("div", { className: "wizard-sidebar", children: [jsxs("h2", { children: [" ", wizardTitle] }), steps.map((step, index) => {
|
|
25823
|
-
return (jsxs("div", { className:
|
|
25879
|
+
return (jsxs("div", { className: y('sidebar-step', {
|
|
25824
25880
|
['current-step']: index === steps.indexOf(currentStep),
|
|
25825
25881
|
['prior-step']: index < steps.indexOf(currentStep),
|
|
25826
25882
|
}), children: [(Object.keys(validationErrors ? validationErrors : []).some((error) => stepSchema[step].inputsRequiringValidation.includes(error)) ||
|
|
@@ -25964,15 +26020,15 @@ const StyledDrawerLinkList = styled.div `
|
|
|
25964
26020
|
|
|
25965
26021
|
const DrawerLinkList = (props) => {
|
|
25966
26022
|
const { className, style = {}, id, listItems, isOpen } = props, restOfProps = __rest$1(props, ["className", "style", "id", "listItems", "isOpen"]);
|
|
25967
|
-
return (jsx(StyledDrawerLinkList, Object.assign({ id: id, "data-cy": props['data-cy'], "data-testid": props['data-testid'], style: style }, restOfProps, { className:
|
|
25968
|
-
return
|
|
26023
|
+
return (jsx(StyledDrawerLinkList, Object.assign({ id: id, "data-cy": props['data-cy'], "data-testid": props['data-testid'], style: style }, restOfProps, { className: y('drawer__content__list', className), children: listItems && (jsx("ul", { className: "drawer__list", children: listItems.map((item) => (jsx(NavLink, { to: item.path, className: ({ isActive, isPending }) => {
|
|
26024
|
+
return y('drawer__list__item', { 'drawer__list__item--active': isActive }, { 'drawer__list__item--pending': isPending });
|
|
25969
26025
|
}, role: "link", "aria-label": item.label, "data-testid": `link-list-item-${item.label}`, children: jsxs("li", { className: "drawer__list__item__link", children: [jsx("span", { className: `drawer__list__item__icon`, children: jsx(Icon, { size: [22], name: item.icon, ariaLabel: `${item.label} icon` }) }), jsx("span", { className: `drawer__list__item__label ${!isOpen ? 'drawer__list__item__label--hidden' : ''}`, "aria-hidden": !isOpen, "data-testid": "list-item-label", children: item.label })] }) }, item.id))) })) })));
|
|
25970
26026
|
};
|
|
25971
26027
|
|
|
25972
26028
|
const Drawer = (props) => {
|
|
25973
26029
|
const { id, className, style = {}, logoText, logoIcon, navigationItems, footerItems, headerComponent, $expandedWidth, $collapsedWidth } = props, restOfProps = __rest$1(props, ["id", "className", "style", "logoText", "logoIcon", "navigationItems", "footerItems", "headerComponent", "$expandedWidth", "$collapsedWidth"]);
|
|
25974
26030
|
const [isOpen, setIsOpen] = React__default.useState(false);
|
|
25975
|
-
const drawerClasses =
|
|
26031
|
+
const drawerClasses = y('drawer', className, {
|
|
25976
26032
|
'drawer--open': isOpen,
|
|
25977
26033
|
'drawer--closed': !isOpen,
|
|
25978
26034
|
});
|
|
@@ -25987,8 +26043,8 @@ const Drawer = (props) => {
|
|
|
25987
26043
|
|
|
25988
26044
|
const StyledTextTruncate = styled.span ``;
|
|
25989
26045
|
|
|
25990
|
-
function TextTruncate({ string, maxChars, children }) {
|
|
25991
|
-
return string.length > maxChars ? (jsxs(StyledTextTruncate, { title: string, children: [`${string.substring(0, maxChars)}...`, children] })) : (jsxs(StyledTextTruncate, { children: [string, children] }));
|
|
26046
|
+
function TextTruncate({ string, maxChars, children, noTitle }) {
|
|
26047
|
+
return string.length > maxChars ? (jsxs(StyledTextTruncate, { title: noTitle ? undefined : string, children: [`${string.substring(0, maxChars)}...`, children] })) : (jsxs(StyledTextTruncate, { children: [string, children] }));
|
|
25992
26048
|
}
|
|
25993
26049
|
|
|
25994
26050
|
const StyledToggle = styled.label `
|
|
@@ -26076,10 +26132,1570 @@ const StyledToggle = styled.label `
|
|
|
26076
26132
|
|
|
26077
26133
|
const Toggle = (props) => {
|
|
26078
26134
|
const { disabled, onChange, value, className, id, checkedIconName, notCheckedIconName, iconSize, } = props;
|
|
26079
|
-
return (jsxs(StyledToggle, { className:
|
|
26135
|
+
return (jsxs(StyledToggle, { className: y(className, {
|
|
26080
26136
|
disabled,
|
|
26081
26137
|
}), "data-cy": props['data-cy'], id: id, children: [jsx("input", { "aria-label": props['aria-label'], type: "checkbox", disabled: disabled, checked: value, onChange: onChange }), jsx("span", { className: "slider round" }), checkedIconName && (jsx(Icon, { name: checkedIconName, size: [iconSize || 5], className: "checked-icon" })), notCheckedIconName && (jsx(Icon, { name: notCheckedIconName, size: [iconSize || 5], className: "not-checked-icon" }))] }));
|
|
26082
26138
|
};
|
|
26083
26139
|
|
|
26084
|
-
|
|
26140
|
+
/**
|
|
26141
|
+
* Custom positioning reference element.
|
|
26142
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
26143
|
+
*/
|
|
26144
|
+
|
|
26145
|
+
const min = Math.min;
|
|
26146
|
+
const max = Math.max;
|
|
26147
|
+
const round = Math.round;
|
|
26148
|
+
const floor = Math.floor;
|
|
26149
|
+
const createCoords = v => ({
|
|
26150
|
+
x: v,
|
|
26151
|
+
y: v
|
|
26152
|
+
});
|
|
26153
|
+
const oppositeSideMap = {
|
|
26154
|
+
left: 'right',
|
|
26155
|
+
right: 'left',
|
|
26156
|
+
bottom: 'top',
|
|
26157
|
+
top: 'bottom'
|
|
26158
|
+
};
|
|
26159
|
+
const oppositeAlignmentMap = {
|
|
26160
|
+
start: 'end',
|
|
26161
|
+
end: 'start'
|
|
26162
|
+
};
|
|
26163
|
+
function clamp(start, value, end) {
|
|
26164
|
+
return max(start, min(value, end));
|
|
26165
|
+
}
|
|
26166
|
+
function evaluate(value, param) {
|
|
26167
|
+
return typeof value === 'function' ? value(param) : value;
|
|
26168
|
+
}
|
|
26169
|
+
function getSide(placement) {
|
|
26170
|
+
return placement.split('-')[0];
|
|
26171
|
+
}
|
|
26172
|
+
function getAlignment(placement) {
|
|
26173
|
+
return placement.split('-')[1];
|
|
26174
|
+
}
|
|
26175
|
+
function getOppositeAxis(axis) {
|
|
26176
|
+
return axis === 'x' ? 'y' : 'x';
|
|
26177
|
+
}
|
|
26178
|
+
function getAxisLength(axis) {
|
|
26179
|
+
return axis === 'y' ? 'height' : 'width';
|
|
26180
|
+
}
|
|
26181
|
+
function getSideAxis(placement) {
|
|
26182
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
26183
|
+
}
|
|
26184
|
+
function getAlignmentAxis(placement) {
|
|
26185
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
26186
|
+
}
|
|
26187
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
26188
|
+
if (rtl === void 0) {
|
|
26189
|
+
rtl = false;
|
|
26190
|
+
}
|
|
26191
|
+
const alignment = getAlignment(placement);
|
|
26192
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
26193
|
+
const length = getAxisLength(alignmentAxis);
|
|
26194
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
26195
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
26196
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
26197
|
+
}
|
|
26198
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
26199
|
+
}
|
|
26200
|
+
function getExpandedPlacements(placement) {
|
|
26201
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
26202
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
26203
|
+
}
|
|
26204
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
26205
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
26206
|
+
}
|
|
26207
|
+
function getSideList(side, isStart, rtl) {
|
|
26208
|
+
const lr = ['left', 'right'];
|
|
26209
|
+
const rl = ['right', 'left'];
|
|
26210
|
+
const tb = ['top', 'bottom'];
|
|
26211
|
+
const bt = ['bottom', 'top'];
|
|
26212
|
+
switch (side) {
|
|
26213
|
+
case 'top':
|
|
26214
|
+
case 'bottom':
|
|
26215
|
+
if (rtl) return isStart ? rl : lr;
|
|
26216
|
+
return isStart ? lr : rl;
|
|
26217
|
+
case 'left':
|
|
26218
|
+
case 'right':
|
|
26219
|
+
return isStart ? tb : bt;
|
|
26220
|
+
default:
|
|
26221
|
+
return [];
|
|
26222
|
+
}
|
|
26223
|
+
}
|
|
26224
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
26225
|
+
const alignment = getAlignment(placement);
|
|
26226
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
26227
|
+
if (alignment) {
|
|
26228
|
+
list = list.map(side => side + "-" + alignment);
|
|
26229
|
+
if (flipAlignment) {
|
|
26230
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
26231
|
+
}
|
|
26232
|
+
}
|
|
26233
|
+
return list;
|
|
26234
|
+
}
|
|
26235
|
+
function getOppositePlacement(placement) {
|
|
26236
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
26237
|
+
}
|
|
26238
|
+
function expandPaddingObject(padding) {
|
|
26239
|
+
return {
|
|
26240
|
+
top: 0,
|
|
26241
|
+
right: 0,
|
|
26242
|
+
bottom: 0,
|
|
26243
|
+
left: 0,
|
|
26244
|
+
...padding
|
|
26245
|
+
};
|
|
26246
|
+
}
|
|
26247
|
+
function getPaddingObject(padding) {
|
|
26248
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
26249
|
+
top: padding,
|
|
26250
|
+
right: padding,
|
|
26251
|
+
bottom: padding,
|
|
26252
|
+
left: padding
|
|
26253
|
+
};
|
|
26254
|
+
}
|
|
26255
|
+
function rectToClientRect(rect) {
|
|
26256
|
+
return {
|
|
26257
|
+
...rect,
|
|
26258
|
+
top: rect.y,
|
|
26259
|
+
left: rect.x,
|
|
26260
|
+
right: rect.x + rect.width,
|
|
26261
|
+
bottom: rect.y + rect.height
|
|
26262
|
+
};
|
|
26263
|
+
}
|
|
26264
|
+
|
|
26265
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
26266
|
+
let {
|
|
26267
|
+
reference,
|
|
26268
|
+
floating
|
|
26269
|
+
} = _ref;
|
|
26270
|
+
const sideAxis = getSideAxis(placement);
|
|
26271
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
26272
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
26273
|
+
const side = getSide(placement);
|
|
26274
|
+
const isVertical = sideAxis === 'y';
|
|
26275
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
26276
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
26277
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
26278
|
+
let coords;
|
|
26279
|
+
switch (side) {
|
|
26280
|
+
case 'top':
|
|
26281
|
+
coords = {
|
|
26282
|
+
x: commonX,
|
|
26283
|
+
y: reference.y - floating.height
|
|
26284
|
+
};
|
|
26285
|
+
break;
|
|
26286
|
+
case 'bottom':
|
|
26287
|
+
coords = {
|
|
26288
|
+
x: commonX,
|
|
26289
|
+
y: reference.y + reference.height
|
|
26290
|
+
};
|
|
26291
|
+
break;
|
|
26292
|
+
case 'right':
|
|
26293
|
+
coords = {
|
|
26294
|
+
x: reference.x + reference.width,
|
|
26295
|
+
y: commonY
|
|
26296
|
+
};
|
|
26297
|
+
break;
|
|
26298
|
+
case 'left':
|
|
26299
|
+
coords = {
|
|
26300
|
+
x: reference.x - floating.width,
|
|
26301
|
+
y: commonY
|
|
26302
|
+
};
|
|
26303
|
+
break;
|
|
26304
|
+
default:
|
|
26305
|
+
coords = {
|
|
26306
|
+
x: reference.x,
|
|
26307
|
+
y: reference.y
|
|
26308
|
+
};
|
|
26309
|
+
}
|
|
26310
|
+
switch (getAlignment(placement)) {
|
|
26311
|
+
case 'start':
|
|
26312
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
26313
|
+
break;
|
|
26314
|
+
case 'end':
|
|
26315
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
26316
|
+
break;
|
|
26317
|
+
}
|
|
26318
|
+
return coords;
|
|
26319
|
+
}
|
|
26320
|
+
|
|
26321
|
+
/**
|
|
26322
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
26323
|
+
* next to a given reference element.
|
|
26324
|
+
*
|
|
26325
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
26326
|
+
* write one for the platform you are using Floating UI with.
|
|
26327
|
+
*/
|
|
26328
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
26329
|
+
const {
|
|
26330
|
+
placement = 'bottom',
|
|
26331
|
+
strategy = 'absolute',
|
|
26332
|
+
middleware = [],
|
|
26333
|
+
platform
|
|
26334
|
+
} = config;
|
|
26335
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
26336
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
26337
|
+
let rects = await platform.getElementRects({
|
|
26338
|
+
reference,
|
|
26339
|
+
floating,
|
|
26340
|
+
strategy
|
|
26341
|
+
});
|
|
26342
|
+
let {
|
|
26343
|
+
x,
|
|
26344
|
+
y
|
|
26345
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
26346
|
+
let statefulPlacement = placement;
|
|
26347
|
+
let middlewareData = {};
|
|
26348
|
+
let resetCount = 0;
|
|
26349
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
26350
|
+
const {
|
|
26351
|
+
name,
|
|
26352
|
+
fn
|
|
26353
|
+
} = validMiddleware[i];
|
|
26354
|
+
const {
|
|
26355
|
+
x: nextX,
|
|
26356
|
+
y: nextY,
|
|
26357
|
+
data,
|
|
26358
|
+
reset
|
|
26359
|
+
} = await fn({
|
|
26360
|
+
x,
|
|
26361
|
+
y,
|
|
26362
|
+
initialPlacement: placement,
|
|
26363
|
+
placement: statefulPlacement,
|
|
26364
|
+
strategy,
|
|
26365
|
+
middlewareData,
|
|
26366
|
+
rects,
|
|
26367
|
+
platform,
|
|
26368
|
+
elements: {
|
|
26369
|
+
reference,
|
|
26370
|
+
floating
|
|
26371
|
+
}
|
|
26372
|
+
});
|
|
26373
|
+
x = nextX != null ? nextX : x;
|
|
26374
|
+
y = nextY != null ? nextY : y;
|
|
26375
|
+
middlewareData = {
|
|
26376
|
+
...middlewareData,
|
|
26377
|
+
[name]: {
|
|
26378
|
+
...middlewareData[name],
|
|
26379
|
+
...data
|
|
26380
|
+
}
|
|
26381
|
+
};
|
|
26382
|
+
if (reset && resetCount <= 50) {
|
|
26383
|
+
resetCount++;
|
|
26384
|
+
if (typeof reset === 'object') {
|
|
26385
|
+
if (reset.placement) {
|
|
26386
|
+
statefulPlacement = reset.placement;
|
|
26387
|
+
}
|
|
26388
|
+
if (reset.rects) {
|
|
26389
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
26390
|
+
reference,
|
|
26391
|
+
floating,
|
|
26392
|
+
strategy
|
|
26393
|
+
}) : reset.rects;
|
|
26394
|
+
}
|
|
26395
|
+
({
|
|
26396
|
+
x,
|
|
26397
|
+
y
|
|
26398
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
26399
|
+
}
|
|
26400
|
+
i = -1;
|
|
26401
|
+
}
|
|
26402
|
+
}
|
|
26403
|
+
return {
|
|
26404
|
+
x,
|
|
26405
|
+
y,
|
|
26406
|
+
placement: statefulPlacement,
|
|
26407
|
+
strategy,
|
|
26408
|
+
middlewareData
|
|
26409
|
+
};
|
|
26410
|
+
};
|
|
26411
|
+
|
|
26412
|
+
/**
|
|
26413
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
26414
|
+
* element is overflowing a given clipping boundary on each side.
|
|
26415
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
26416
|
+
* - negative = how many pixels left before it will overflow
|
|
26417
|
+
* - 0 = lies flush with the boundary
|
|
26418
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
26419
|
+
*/
|
|
26420
|
+
async function detectOverflow(state, options) {
|
|
26421
|
+
var _await$platform$isEle;
|
|
26422
|
+
if (options === void 0) {
|
|
26423
|
+
options = {};
|
|
26424
|
+
}
|
|
26425
|
+
const {
|
|
26426
|
+
x,
|
|
26427
|
+
y,
|
|
26428
|
+
platform,
|
|
26429
|
+
rects,
|
|
26430
|
+
elements,
|
|
26431
|
+
strategy
|
|
26432
|
+
} = state;
|
|
26433
|
+
const {
|
|
26434
|
+
boundary = 'clippingAncestors',
|
|
26435
|
+
rootBoundary = 'viewport',
|
|
26436
|
+
elementContext = 'floating',
|
|
26437
|
+
altBoundary = false,
|
|
26438
|
+
padding = 0
|
|
26439
|
+
} = evaluate(options, state);
|
|
26440
|
+
const paddingObject = getPaddingObject(padding);
|
|
26441
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
26442
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
26443
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
26444
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
26445
|
+
boundary,
|
|
26446
|
+
rootBoundary,
|
|
26447
|
+
strategy
|
|
26448
|
+
}));
|
|
26449
|
+
const rect = elementContext === 'floating' ? {
|
|
26450
|
+
...rects.floating,
|
|
26451
|
+
x,
|
|
26452
|
+
y
|
|
26453
|
+
} : rects.reference;
|
|
26454
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
26455
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
26456
|
+
x: 1,
|
|
26457
|
+
y: 1
|
|
26458
|
+
} : {
|
|
26459
|
+
x: 1,
|
|
26460
|
+
y: 1
|
|
26461
|
+
};
|
|
26462
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
26463
|
+
elements,
|
|
26464
|
+
rect,
|
|
26465
|
+
offsetParent,
|
|
26466
|
+
strategy
|
|
26467
|
+
}) : rect);
|
|
26468
|
+
return {
|
|
26469
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
26470
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
26471
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
26472
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
26473
|
+
};
|
|
26474
|
+
}
|
|
26475
|
+
|
|
26476
|
+
/**
|
|
26477
|
+
* Provides data to position an inner element of the floating element so that it
|
|
26478
|
+
* appears centered to the reference element.
|
|
26479
|
+
* @see https://floating-ui.com/docs/arrow
|
|
26480
|
+
*/
|
|
26481
|
+
const arrow$1 = options => ({
|
|
26482
|
+
name: 'arrow',
|
|
26483
|
+
options,
|
|
26484
|
+
async fn(state) {
|
|
26485
|
+
const {
|
|
26486
|
+
x,
|
|
26487
|
+
y,
|
|
26488
|
+
placement,
|
|
26489
|
+
rects,
|
|
26490
|
+
platform,
|
|
26491
|
+
elements,
|
|
26492
|
+
middlewareData
|
|
26493
|
+
} = state;
|
|
26494
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
26495
|
+
const {
|
|
26496
|
+
element,
|
|
26497
|
+
padding = 0
|
|
26498
|
+
} = evaluate(options, state) || {};
|
|
26499
|
+
if (element == null) {
|
|
26500
|
+
return {};
|
|
26501
|
+
}
|
|
26502
|
+
const paddingObject = getPaddingObject(padding);
|
|
26503
|
+
const coords = {
|
|
26504
|
+
x,
|
|
26505
|
+
y
|
|
26506
|
+
};
|
|
26507
|
+
const axis = getAlignmentAxis(placement);
|
|
26508
|
+
const length = getAxisLength(axis);
|
|
26509
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
26510
|
+
const isYAxis = axis === 'y';
|
|
26511
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
26512
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
26513
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
26514
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
26515
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
26516
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
26517
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
26518
|
+
|
|
26519
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
26520
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
26521
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
26522
|
+
}
|
|
26523
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
26524
|
+
|
|
26525
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
26526
|
+
// centered, modify the padding so that it is centered.
|
|
26527
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
26528
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
26529
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
26530
|
+
|
|
26531
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
26532
|
+
// point is outside the floating element's bounds.
|
|
26533
|
+
const min$1 = minPadding;
|
|
26534
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
26535
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
26536
|
+
const offset = clamp(min$1, center, max);
|
|
26537
|
+
|
|
26538
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
26539
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
26540
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
26541
|
+
// a single reset is performed when this is true.
|
|
26542
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
26543
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
26544
|
+
return {
|
|
26545
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
26546
|
+
data: {
|
|
26547
|
+
[axis]: offset,
|
|
26548
|
+
centerOffset: center - offset - alignmentOffset,
|
|
26549
|
+
...(shouldAddOffset && {
|
|
26550
|
+
alignmentOffset
|
|
26551
|
+
})
|
|
26552
|
+
},
|
|
26553
|
+
reset: shouldAddOffset
|
|
26554
|
+
};
|
|
26555
|
+
}
|
|
26556
|
+
});
|
|
26557
|
+
|
|
26558
|
+
/**
|
|
26559
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
26560
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
26561
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
26562
|
+
* @see https://floating-ui.com/docs/flip
|
|
26563
|
+
*/
|
|
26564
|
+
const flip$1 = function (options) {
|
|
26565
|
+
if (options === void 0) {
|
|
26566
|
+
options = {};
|
|
26567
|
+
}
|
|
26568
|
+
return {
|
|
26569
|
+
name: 'flip',
|
|
26570
|
+
options,
|
|
26571
|
+
async fn(state) {
|
|
26572
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
26573
|
+
const {
|
|
26574
|
+
placement,
|
|
26575
|
+
middlewareData,
|
|
26576
|
+
rects,
|
|
26577
|
+
initialPlacement,
|
|
26578
|
+
platform,
|
|
26579
|
+
elements
|
|
26580
|
+
} = state;
|
|
26581
|
+
const {
|
|
26582
|
+
mainAxis: checkMainAxis = true,
|
|
26583
|
+
crossAxis: checkCrossAxis = true,
|
|
26584
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
26585
|
+
fallbackStrategy = 'bestFit',
|
|
26586
|
+
fallbackAxisSideDirection = 'none',
|
|
26587
|
+
flipAlignment = true,
|
|
26588
|
+
...detectOverflowOptions
|
|
26589
|
+
} = evaluate(options, state);
|
|
26590
|
+
|
|
26591
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
26592
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
26593
|
+
// work.
|
|
26594
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
26595
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
26596
|
+
return {};
|
|
26597
|
+
}
|
|
26598
|
+
const side = getSide(placement);
|
|
26599
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
26600
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
26601
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
26602
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
26603
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
26604
|
+
}
|
|
26605
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
26606
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
26607
|
+
const overflows = [];
|
|
26608
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
26609
|
+
if (checkMainAxis) {
|
|
26610
|
+
overflows.push(overflow[side]);
|
|
26611
|
+
}
|
|
26612
|
+
if (checkCrossAxis) {
|
|
26613
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
26614
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
26615
|
+
}
|
|
26616
|
+
overflowsData = [...overflowsData, {
|
|
26617
|
+
placement,
|
|
26618
|
+
overflows
|
|
26619
|
+
}];
|
|
26620
|
+
|
|
26621
|
+
// One or more sides is overflowing.
|
|
26622
|
+
if (!overflows.every(side => side <= 0)) {
|
|
26623
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
26624
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
26625
|
+
const nextPlacement = placements[nextIndex];
|
|
26626
|
+
if (nextPlacement) {
|
|
26627
|
+
// Try next placement and re-run the lifecycle.
|
|
26628
|
+
return {
|
|
26629
|
+
data: {
|
|
26630
|
+
index: nextIndex,
|
|
26631
|
+
overflows: overflowsData
|
|
26632
|
+
},
|
|
26633
|
+
reset: {
|
|
26634
|
+
placement: nextPlacement
|
|
26635
|
+
}
|
|
26636
|
+
};
|
|
26637
|
+
}
|
|
26638
|
+
|
|
26639
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
26640
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
26641
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
26642
|
+
|
|
26643
|
+
// Otherwise fallback.
|
|
26644
|
+
if (!resetPlacement) {
|
|
26645
|
+
switch (fallbackStrategy) {
|
|
26646
|
+
case 'bestFit':
|
|
26647
|
+
{
|
|
26648
|
+
var _overflowsData$map$so;
|
|
26649
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
26650
|
+
if (placement) {
|
|
26651
|
+
resetPlacement = placement;
|
|
26652
|
+
}
|
|
26653
|
+
break;
|
|
26654
|
+
}
|
|
26655
|
+
case 'initialPlacement':
|
|
26656
|
+
resetPlacement = initialPlacement;
|
|
26657
|
+
break;
|
|
26658
|
+
}
|
|
26659
|
+
}
|
|
26660
|
+
if (placement !== resetPlacement) {
|
|
26661
|
+
return {
|
|
26662
|
+
reset: {
|
|
26663
|
+
placement: resetPlacement
|
|
26664
|
+
}
|
|
26665
|
+
};
|
|
26666
|
+
}
|
|
26667
|
+
}
|
|
26668
|
+
return {};
|
|
26669
|
+
}
|
|
26670
|
+
};
|
|
26671
|
+
};
|
|
26672
|
+
|
|
26673
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
26674
|
+
// Derivable.
|
|
26675
|
+
|
|
26676
|
+
async function convertValueToCoords(state, options) {
|
|
26677
|
+
const {
|
|
26678
|
+
placement,
|
|
26679
|
+
platform,
|
|
26680
|
+
elements
|
|
26681
|
+
} = state;
|
|
26682
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
26683
|
+
const side = getSide(placement);
|
|
26684
|
+
const alignment = getAlignment(placement);
|
|
26685
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
26686
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
26687
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
26688
|
+
const rawValue = evaluate(options, state);
|
|
26689
|
+
let {
|
|
26690
|
+
mainAxis,
|
|
26691
|
+
crossAxis,
|
|
26692
|
+
alignmentAxis
|
|
26693
|
+
} = typeof rawValue === 'number' ? {
|
|
26694
|
+
mainAxis: rawValue,
|
|
26695
|
+
crossAxis: 0,
|
|
26696
|
+
alignmentAxis: null
|
|
26697
|
+
} : {
|
|
26698
|
+
mainAxis: 0,
|
|
26699
|
+
crossAxis: 0,
|
|
26700
|
+
alignmentAxis: null,
|
|
26701
|
+
...rawValue
|
|
26702
|
+
};
|
|
26703
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
26704
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
26705
|
+
}
|
|
26706
|
+
return isVertical ? {
|
|
26707
|
+
x: crossAxis * crossAxisMulti,
|
|
26708
|
+
y: mainAxis * mainAxisMulti
|
|
26709
|
+
} : {
|
|
26710
|
+
x: mainAxis * mainAxisMulti,
|
|
26711
|
+
y: crossAxis * crossAxisMulti
|
|
26712
|
+
};
|
|
26713
|
+
}
|
|
26714
|
+
|
|
26715
|
+
/**
|
|
26716
|
+
* Modifies the placement by translating the floating element along the
|
|
26717
|
+
* specified axes.
|
|
26718
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
26719
|
+
* object may be passed.
|
|
26720
|
+
* @see https://floating-ui.com/docs/offset
|
|
26721
|
+
*/
|
|
26722
|
+
const offset = function (options) {
|
|
26723
|
+
if (options === void 0) {
|
|
26724
|
+
options = 0;
|
|
26725
|
+
}
|
|
26726
|
+
return {
|
|
26727
|
+
name: 'offset',
|
|
26728
|
+
options,
|
|
26729
|
+
async fn(state) {
|
|
26730
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
26731
|
+
const {
|
|
26732
|
+
x,
|
|
26733
|
+
y,
|
|
26734
|
+
placement,
|
|
26735
|
+
middlewareData
|
|
26736
|
+
} = state;
|
|
26737
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
26738
|
+
|
|
26739
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
26740
|
+
// then we don't need to change the positioning coordinates.
|
|
26741
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
26742
|
+
return {};
|
|
26743
|
+
}
|
|
26744
|
+
return {
|
|
26745
|
+
x: x + diffCoords.x,
|
|
26746
|
+
y: y + diffCoords.y,
|
|
26747
|
+
data: {
|
|
26748
|
+
...diffCoords,
|
|
26749
|
+
placement
|
|
26750
|
+
}
|
|
26751
|
+
};
|
|
26752
|
+
}
|
|
26753
|
+
};
|
|
26754
|
+
};
|
|
26755
|
+
|
|
26756
|
+
/**
|
|
26757
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
26758
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
26759
|
+
* @see https://floating-ui.com/docs/shift
|
|
26760
|
+
*/
|
|
26761
|
+
const shift$1 = function (options) {
|
|
26762
|
+
if (options === void 0) {
|
|
26763
|
+
options = {};
|
|
26764
|
+
}
|
|
26765
|
+
return {
|
|
26766
|
+
name: 'shift',
|
|
26767
|
+
options,
|
|
26768
|
+
async fn(state) {
|
|
26769
|
+
const {
|
|
26770
|
+
x,
|
|
26771
|
+
y,
|
|
26772
|
+
placement
|
|
26773
|
+
} = state;
|
|
26774
|
+
const {
|
|
26775
|
+
mainAxis: checkMainAxis = true,
|
|
26776
|
+
crossAxis: checkCrossAxis = false,
|
|
26777
|
+
limiter = {
|
|
26778
|
+
fn: _ref => {
|
|
26779
|
+
let {
|
|
26780
|
+
x,
|
|
26781
|
+
y
|
|
26782
|
+
} = _ref;
|
|
26783
|
+
return {
|
|
26784
|
+
x,
|
|
26785
|
+
y
|
|
26786
|
+
};
|
|
26787
|
+
}
|
|
26788
|
+
},
|
|
26789
|
+
...detectOverflowOptions
|
|
26790
|
+
} = evaluate(options, state);
|
|
26791
|
+
const coords = {
|
|
26792
|
+
x,
|
|
26793
|
+
y
|
|
26794
|
+
};
|
|
26795
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
26796
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
26797
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
26798
|
+
let mainAxisCoord = coords[mainAxis];
|
|
26799
|
+
let crossAxisCoord = coords[crossAxis];
|
|
26800
|
+
if (checkMainAxis) {
|
|
26801
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
26802
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
26803
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
26804
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
26805
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
26806
|
+
}
|
|
26807
|
+
if (checkCrossAxis) {
|
|
26808
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
26809
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
26810
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
26811
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
26812
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
26813
|
+
}
|
|
26814
|
+
const limitedCoords = limiter.fn({
|
|
26815
|
+
...state,
|
|
26816
|
+
[mainAxis]: mainAxisCoord,
|
|
26817
|
+
[crossAxis]: crossAxisCoord
|
|
26818
|
+
});
|
|
26819
|
+
return {
|
|
26820
|
+
...limitedCoords,
|
|
26821
|
+
data: {
|
|
26822
|
+
x: limitedCoords.x - x,
|
|
26823
|
+
y: limitedCoords.y - y
|
|
26824
|
+
}
|
|
26825
|
+
};
|
|
26826
|
+
}
|
|
26827
|
+
};
|
|
26828
|
+
};
|
|
26829
|
+
|
|
26830
|
+
function getNodeName(node) {
|
|
26831
|
+
if (isNode(node)) {
|
|
26832
|
+
return (node.nodeName || '').toLowerCase();
|
|
26833
|
+
}
|
|
26834
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
26835
|
+
// returning `#document` an infinite loop won't occur.
|
|
26836
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
26837
|
+
return '#document';
|
|
26838
|
+
}
|
|
26839
|
+
function getWindow(node) {
|
|
26840
|
+
var _node$ownerDocument;
|
|
26841
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
26842
|
+
}
|
|
26843
|
+
function getDocumentElement(node) {
|
|
26844
|
+
var _ref;
|
|
26845
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
26846
|
+
}
|
|
26847
|
+
function isNode(value) {
|
|
26848
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
26849
|
+
}
|
|
26850
|
+
function isElement(value) {
|
|
26851
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
26852
|
+
}
|
|
26853
|
+
function isHTMLElement(value) {
|
|
26854
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
26855
|
+
}
|
|
26856
|
+
function isShadowRoot(value) {
|
|
26857
|
+
// Browsers without `ShadowRoot` support.
|
|
26858
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
26859
|
+
return false;
|
|
26860
|
+
}
|
|
26861
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
26862
|
+
}
|
|
26863
|
+
function isOverflowElement(element) {
|
|
26864
|
+
const {
|
|
26865
|
+
overflow,
|
|
26866
|
+
overflowX,
|
|
26867
|
+
overflowY,
|
|
26868
|
+
display
|
|
26869
|
+
} = getComputedStyle$1(element);
|
|
26870
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
26871
|
+
}
|
|
26872
|
+
function isTableElement(element) {
|
|
26873
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
26874
|
+
}
|
|
26875
|
+
function isContainingBlock(element) {
|
|
26876
|
+
const webkit = isWebKit();
|
|
26877
|
+
const css = getComputedStyle$1(element);
|
|
26878
|
+
|
|
26879
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
26880
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
26881
|
+
}
|
|
26882
|
+
function getContainingBlock(element) {
|
|
26883
|
+
let currentNode = getParentNode(element);
|
|
26884
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
26885
|
+
if (isContainingBlock(currentNode)) {
|
|
26886
|
+
return currentNode;
|
|
26887
|
+
} else {
|
|
26888
|
+
currentNode = getParentNode(currentNode);
|
|
26889
|
+
}
|
|
26890
|
+
}
|
|
26891
|
+
return null;
|
|
26892
|
+
}
|
|
26893
|
+
function isWebKit() {
|
|
26894
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
26895
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
26896
|
+
}
|
|
26897
|
+
function isLastTraversableNode(node) {
|
|
26898
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
26899
|
+
}
|
|
26900
|
+
function getComputedStyle$1(element) {
|
|
26901
|
+
return getWindow(element).getComputedStyle(element);
|
|
26902
|
+
}
|
|
26903
|
+
function getNodeScroll(element) {
|
|
26904
|
+
if (isElement(element)) {
|
|
26905
|
+
return {
|
|
26906
|
+
scrollLeft: element.scrollLeft,
|
|
26907
|
+
scrollTop: element.scrollTop
|
|
26908
|
+
};
|
|
26909
|
+
}
|
|
26910
|
+
return {
|
|
26911
|
+
scrollLeft: element.pageXOffset,
|
|
26912
|
+
scrollTop: element.pageYOffset
|
|
26913
|
+
};
|
|
26914
|
+
}
|
|
26915
|
+
function getParentNode(node) {
|
|
26916
|
+
if (getNodeName(node) === 'html') {
|
|
26917
|
+
return node;
|
|
26918
|
+
}
|
|
26919
|
+
const result =
|
|
26920
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
26921
|
+
node.assignedSlot ||
|
|
26922
|
+
// DOM Element detected.
|
|
26923
|
+
node.parentNode ||
|
|
26924
|
+
// ShadowRoot detected.
|
|
26925
|
+
isShadowRoot(node) && node.host ||
|
|
26926
|
+
// Fallback.
|
|
26927
|
+
getDocumentElement(node);
|
|
26928
|
+
return isShadowRoot(result) ? result.host : result;
|
|
26929
|
+
}
|
|
26930
|
+
function getNearestOverflowAncestor(node) {
|
|
26931
|
+
const parentNode = getParentNode(node);
|
|
26932
|
+
if (isLastTraversableNode(parentNode)) {
|
|
26933
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
26934
|
+
}
|
|
26935
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
26936
|
+
return parentNode;
|
|
26937
|
+
}
|
|
26938
|
+
return getNearestOverflowAncestor(parentNode);
|
|
26939
|
+
}
|
|
26940
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
26941
|
+
var _node$ownerDocument2;
|
|
26942
|
+
if (list === void 0) {
|
|
26943
|
+
list = [];
|
|
26944
|
+
}
|
|
26945
|
+
if (traverseIframes === void 0) {
|
|
26946
|
+
traverseIframes = true;
|
|
26947
|
+
}
|
|
26948
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
26949
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
26950
|
+
const win = getWindow(scrollableAncestor);
|
|
26951
|
+
if (isBody) {
|
|
26952
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
26953
|
+
}
|
|
26954
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
26955
|
+
}
|
|
26956
|
+
|
|
26957
|
+
function getCssDimensions(element) {
|
|
26958
|
+
const css = getComputedStyle$1(element);
|
|
26959
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
26960
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
26961
|
+
let width = parseFloat(css.width) || 0;
|
|
26962
|
+
let height = parseFloat(css.height) || 0;
|
|
26963
|
+
const hasOffset = isHTMLElement(element);
|
|
26964
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
26965
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
26966
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
26967
|
+
if (shouldFallback) {
|
|
26968
|
+
width = offsetWidth;
|
|
26969
|
+
height = offsetHeight;
|
|
26970
|
+
}
|
|
26971
|
+
return {
|
|
26972
|
+
width,
|
|
26973
|
+
height,
|
|
26974
|
+
$: shouldFallback
|
|
26975
|
+
};
|
|
26976
|
+
}
|
|
26977
|
+
|
|
26978
|
+
function unwrapElement(element) {
|
|
26979
|
+
return !isElement(element) ? element.contextElement : element;
|
|
26980
|
+
}
|
|
26981
|
+
|
|
26982
|
+
function getScale(element) {
|
|
26983
|
+
const domElement = unwrapElement(element);
|
|
26984
|
+
if (!isHTMLElement(domElement)) {
|
|
26985
|
+
return createCoords(1);
|
|
26986
|
+
}
|
|
26987
|
+
const rect = domElement.getBoundingClientRect();
|
|
26988
|
+
const {
|
|
26989
|
+
width,
|
|
26990
|
+
height,
|
|
26991
|
+
$
|
|
26992
|
+
} = getCssDimensions(domElement);
|
|
26993
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
26994
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
26995
|
+
|
|
26996
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
26997
|
+
|
|
26998
|
+
if (!x || !Number.isFinite(x)) {
|
|
26999
|
+
x = 1;
|
|
27000
|
+
}
|
|
27001
|
+
if (!y || !Number.isFinite(y)) {
|
|
27002
|
+
y = 1;
|
|
27003
|
+
}
|
|
27004
|
+
return {
|
|
27005
|
+
x,
|
|
27006
|
+
y
|
|
27007
|
+
};
|
|
27008
|
+
}
|
|
27009
|
+
|
|
27010
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
27011
|
+
function getVisualOffsets(element) {
|
|
27012
|
+
const win = getWindow(element);
|
|
27013
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
27014
|
+
return noOffsets;
|
|
27015
|
+
}
|
|
27016
|
+
return {
|
|
27017
|
+
x: win.visualViewport.offsetLeft,
|
|
27018
|
+
y: win.visualViewport.offsetTop
|
|
27019
|
+
};
|
|
27020
|
+
}
|
|
27021
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
27022
|
+
if (isFixed === void 0) {
|
|
27023
|
+
isFixed = false;
|
|
27024
|
+
}
|
|
27025
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
27026
|
+
return false;
|
|
27027
|
+
}
|
|
27028
|
+
return isFixed;
|
|
27029
|
+
}
|
|
27030
|
+
|
|
27031
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
27032
|
+
if (includeScale === void 0) {
|
|
27033
|
+
includeScale = false;
|
|
27034
|
+
}
|
|
27035
|
+
if (isFixedStrategy === void 0) {
|
|
27036
|
+
isFixedStrategy = false;
|
|
27037
|
+
}
|
|
27038
|
+
const clientRect = element.getBoundingClientRect();
|
|
27039
|
+
const domElement = unwrapElement(element);
|
|
27040
|
+
let scale = createCoords(1);
|
|
27041
|
+
if (includeScale) {
|
|
27042
|
+
if (offsetParent) {
|
|
27043
|
+
if (isElement(offsetParent)) {
|
|
27044
|
+
scale = getScale(offsetParent);
|
|
27045
|
+
}
|
|
27046
|
+
} else {
|
|
27047
|
+
scale = getScale(element);
|
|
27048
|
+
}
|
|
27049
|
+
}
|
|
27050
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
27051
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
27052
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
27053
|
+
let width = clientRect.width / scale.x;
|
|
27054
|
+
let height = clientRect.height / scale.y;
|
|
27055
|
+
if (domElement) {
|
|
27056
|
+
const win = getWindow(domElement);
|
|
27057
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
27058
|
+
let currentWin = win;
|
|
27059
|
+
let currentIFrame = currentWin.frameElement;
|
|
27060
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
27061
|
+
const iframeScale = getScale(currentIFrame);
|
|
27062
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
27063
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
27064
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
27065
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
27066
|
+
x *= iframeScale.x;
|
|
27067
|
+
y *= iframeScale.y;
|
|
27068
|
+
width *= iframeScale.x;
|
|
27069
|
+
height *= iframeScale.y;
|
|
27070
|
+
x += left;
|
|
27071
|
+
y += top;
|
|
27072
|
+
currentWin = getWindow(currentIFrame);
|
|
27073
|
+
currentIFrame = currentWin.frameElement;
|
|
27074
|
+
}
|
|
27075
|
+
}
|
|
27076
|
+
return rectToClientRect({
|
|
27077
|
+
width,
|
|
27078
|
+
height,
|
|
27079
|
+
x,
|
|
27080
|
+
y
|
|
27081
|
+
});
|
|
27082
|
+
}
|
|
27083
|
+
|
|
27084
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
27085
|
+
function isTopLayer(floating) {
|
|
27086
|
+
return topLayerSelectors.some(selector => {
|
|
27087
|
+
try {
|
|
27088
|
+
return floating.matches(selector);
|
|
27089
|
+
} catch (e) {
|
|
27090
|
+
return false;
|
|
27091
|
+
}
|
|
27092
|
+
});
|
|
27093
|
+
}
|
|
27094
|
+
|
|
27095
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
27096
|
+
let {
|
|
27097
|
+
elements,
|
|
27098
|
+
rect,
|
|
27099
|
+
offsetParent,
|
|
27100
|
+
strategy
|
|
27101
|
+
} = _ref;
|
|
27102
|
+
const isFixed = strategy === 'fixed';
|
|
27103
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
27104
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
27105
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
27106
|
+
return rect;
|
|
27107
|
+
}
|
|
27108
|
+
let scroll = {
|
|
27109
|
+
scrollLeft: 0,
|
|
27110
|
+
scrollTop: 0
|
|
27111
|
+
};
|
|
27112
|
+
let scale = createCoords(1);
|
|
27113
|
+
const offsets = createCoords(0);
|
|
27114
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
27115
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
27116
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
27117
|
+
scroll = getNodeScroll(offsetParent);
|
|
27118
|
+
}
|
|
27119
|
+
if (isHTMLElement(offsetParent)) {
|
|
27120
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
27121
|
+
scale = getScale(offsetParent);
|
|
27122
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
27123
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
27124
|
+
}
|
|
27125
|
+
}
|
|
27126
|
+
return {
|
|
27127
|
+
width: rect.width * scale.x,
|
|
27128
|
+
height: rect.height * scale.y,
|
|
27129
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
27130
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
27131
|
+
};
|
|
27132
|
+
}
|
|
27133
|
+
|
|
27134
|
+
function getClientRects(element) {
|
|
27135
|
+
return Array.from(element.getClientRects());
|
|
27136
|
+
}
|
|
27137
|
+
|
|
27138
|
+
function getWindowScrollBarX(element) {
|
|
27139
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
27140
|
+
// incorrect for RTL.
|
|
27141
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
27142
|
+
}
|
|
27143
|
+
|
|
27144
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
27145
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
27146
|
+
function getDocumentRect(element) {
|
|
27147
|
+
const html = getDocumentElement(element);
|
|
27148
|
+
const scroll = getNodeScroll(element);
|
|
27149
|
+
const body = element.ownerDocument.body;
|
|
27150
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
27151
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
27152
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
27153
|
+
const y = -scroll.scrollTop;
|
|
27154
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
27155
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
27156
|
+
}
|
|
27157
|
+
return {
|
|
27158
|
+
width,
|
|
27159
|
+
height,
|
|
27160
|
+
x,
|
|
27161
|
+
y
|
|
27162
|
+
};
|
|
27163
|
+
}
|
|
27164
|
+
|
|
27165
|
+
function getViewportRect(element, strategy) {
|
|
27166
|
+
const win = getWindow(element);
|
|
27167
|
+
const html = getDocumentElement(element);
|
|
27168
|
+
const visualViewport = win.visualViewport;
|
|
27169
|
+
let width = html.clientWidth;
|
|
27170
|
+
let height = html.clientHeight;
|
|
27171
|
+
let x = 0;
|
|
27172
|
+
let y = 0;
|
|
27173
|
+
if (visualViewport) {
|
|
27174
|
+
width = visualViewport.width;
|
|
27175
|
+
height = visualViewport.height;
|
|
27176
|
+
const visualViewportBased = isWebKit();
|
|
27177
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
27178
|
+
x = visualViewport.offsetLeft;
|
|
27179
|
+
y = visualViewport.offsetTop;
|
|
27180
|
+
}
|
|
27181
|
+
}
|
|
27182
|
+
return {
|
|
27183
|
+
width,
|
|
27184
|
+
height,
|
|
27185
|
+
x,
|
|
27186
|
+
y
|
|
27187
|
+
};
|
|
27188
|
+
}
|
|
27189
|
+
|
|
27190
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
27191
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
27192
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
27193
|
+
const top = clientRect.top + element.clientTop;
|
|
27194
|
+
const left = clientRect.left + element.clientLeft;
|
|
27195
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
27196
|
+
const width = element.clientWidth * scale.x;
|
|
27197
|
+
const height = element.clientHeight * scale.y;
|
|
27198
|
+
const x = left * scale.x;
|
|
27199
|
+
const y = top * scale.y;
|
|
27200
|
+
return {
|
|
27201
|
+
width,
|
|
27202
|
+
height,
|
|
27203
|
+
x,
|
|
27204
|
+
y
|
|
27205
|
+
};
|
|
27206
|
+
}
|
|
27207
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
27208
|
+
let rect;
|
|
27209
|
+
if (clippingAncestor === 'viewport') {
|
|
27210
|
+
rect = getViewportRect(element, strategy);
|
|
27211
|
+
} else if (clippingAncestor === 'document') {
|
|
27212
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
27213
|
+
} else if (isElement(clippingAncestor)) {
|
|
27214
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
27215
|
+
} else {
|
|
27216
|
+
const visualOffsets = getVisualOffsets(element);
|
|
27217
|
+
rect = {
|
|
27218
|
+
...clippingAncestor,
|
|
27219
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
27220
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
27221
|
+
};
|
|
27222
|
+
}
|
|
27223
|
+
return rectToClientRect(rect);
|
|
27224
|
+
}
|
|
27225
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
27226
|
+
const parentNode = getParentNode(element);
|
|
27227
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
27228
|
+
return false;
|
|
27229
|
+
}
|
|
27230
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
27231
|
+
}
|
|
27232
|
+
|
|
27233
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
27234
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
27235
|
+
// of the given element up the tree.
|
|
27236
|
+
function getClippingElementAncestors(element, cache) {
|
|
27237
|
+
const cachedResult = cache.get(element);
|
|
27238
|
+
if (cachedResult) {
|
|
27239
|
+
return cachedResult;
|
|
27240
|
+
}
|
|
27241
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
27242
|
+
let currentContainingBlockComputedStyle = null;
|
|
27243
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
27244
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
27245
|
+
|
|
27246
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
27247
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
27248
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
27249
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
27250
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
27251
|
+
currentContainingBlockComputedStyle = null;
|
|
27252
|
+
}
|
|
27253
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
27254
|
+
if (shouldDropCurrentNode) {
|
|
27255
|
+
// Drop non-containing blocks.
|
|
27256
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
27257
|
+
} else {
|
|
27258
|
+
// Record last containing block for next iteration.
|
|
27259
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
27260
|
+
}
|
|
27261
|
+
currentNode = getParentNode(currentNode);
|
|
27262
|
+
}
|
|
27263
|
+
cache.set(element, result);
|
|
27264
|
+
return result;
|
|
27265
|
+
}
|
|
27266
|
+
|
|
27267
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
27268
|
+
// clipping ancestors.
|
|
27269
|
+
function getClippingRect(_ref) {
|
|
27270
|
+
let {
|
|
27271
|
+
element,
|
|
27272
|
+
boundary,
|
|
27273
|
+
rootBoundary,
|
|
27274
|
+
strategy
|
|
27275
|
+
} = _ref;
|
|
27276
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
27277
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
27278
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
27279
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
27280
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
27281
|
+
accRect.top = max(rect.top, accRect.top);
|
|
27282
|
+
accRect.right = min(rect.right, accRect.right);
|
|
27283
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
27284
|
+
accRect.left = max(rect.left, accRect.left);
|
|
27285
|
+
return accRect;
|
|
27286
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
27287
|
+
return {
|
|
27288
|
+
width: clippingRect.right - clippingRect.left,
|
|
27289
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
27290
|
+
x: clippingRect.left,
|
|
27291
|
+
y: clippingRect.top
|
|
27292
|
+
};
|
|
27293
|
+
}
|
|
27294
|
+
|
|
27295
|
+
function getDimensions(element) {
|
|
27296
|
+
const {
|
|
27297
|
+
width,
|
|
27298
|
+
height
|
|
27299
|
+
} = getCssDimensions(element);
|
|
27300
|
+
return {
|
|
27301
|
+
width,
|
|
27302
|
+
height
|
|
27303
|
+
};
|
|
27304
|
+
}
|
|
27305
|
+
|
|
27306
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
27307
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
27308
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
27309
|
+
const isFixed = strategy === 'fixed';
|
|
27310
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
27311
|
+
let scroll = {
|
|
27312
|
+
scrollLeft: 0,
|
|
27313
|
+
scrollTop: 0
|
|
27314
|
+
};
|
|
27315
|
+
const offsets = createCoords(0);
|
|
27316
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
27317
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
27318
|
+
scroll = getNodeScroll(offsetParent);
|
|
27319
|
+
}
|
|
27320
|
+
if (isOffsetParentAnElement) {
|
|
27321
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
27322
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
27323
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
27324
|
+
} else if (documentElement) {
|
|
27325
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
27326
|
+
}
|
|
27327
|
+
}
|
|
27328
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
27329
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
27330
|
+
return {
|
|
27331
|
+
x,
|
|
27332
|
+
y,
|
|
27333
|
+
width: rect.width,
|
|
27334
|
+
height: rect.height
|
|
27335
|
+
};
|
|
27336
|
+
}
|
|
27337
|
+
|
|
27338
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
27339
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
27340
|
+
return null;
|
|
27341
|
+
}
|
|
27342
|
+
if (polyfill) {
|
|
27343
|
+
return polyfill(element);
|
|
27344
|
+
}
|
|
27345
|
+
return element.offsetParent;
|
|
27346
|
+
}
|
|
27347
|
+
|
|
27348
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
27349
|
+
// such as table ancestors and cross browser bugs.
|
|
27350
|
+
function getOffsetParent(element, polyfill) {
|
|
27351
|
+
const window = getWindow(element);
|
|
27352
|
+
if (!isHTMLElement(element) || isTopLayer(element)) {
|
|
27353
|
+
return window;
|
|
27354
|
+
}
|
|
27355
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
27356
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
27357
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
27358
|
+
}
|
|
27359
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
27360
|
+
return window;
|
|
27361
|
+
}
|
|
27362
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
27363
|
+
}
|
|
27364
|
+
|
|
27365
|
+
const getElementRects = async function (data) {
|
|
27366
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
27367
|
+
const getDimensionsFn = this.getDimensions;
|
|
27368
|
+
return {
|
|
27369
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
27370
|
+
floating: {
|
|
27371
|
+
x: 0,
|
|
27372
|
+
y: 0,
|
|
27373
|
+
...(await getDimensionsFn(data.floating))
|
|
27374
|
+
}
|
|
27375
|
+
};
|
|
27376
|
+
};
|
|
27377
|
+
|
|
27378
|
+
function isRTL(element) {
|
|
27379
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
27380
|
+
}
|
|
27381
|
+
|
|
27382
|
+
const platform = {
|
|
27383
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
27384
|
+
getDocumentElement,
|
|
27385
|
+
getClippingRect,
|
|
27386
|
+
getOffsetParent,
|
|
27387
|
+
getElementRects,
|
|
27388
|
+
getClientRects,
|
|
27389
|
+
getDimensions,
|
|
27390
|
+
getScale,
|
|
27391
|
+
isElement,
|
|
27392
|
+
isRTL
|
|
27393
|
+
};
|
|
27394
|
+
|
|
27395
|
+
// https://samthor.au/2021/observing-dom/
|
|
27396
|
+
function observeMove(element, onMove) {
|
|
27397
|
+
let io = null;
|
|
27398
|
+
let timeoutId;
|
|
27399
|
+
const root = getDocumentElement(element);
|
|
27400
|
+
function cleanup() {
|
|
27401
|
+
var _io;
|
|
27402
|
+
clearTimeout(timeoutId);
|
|
27403
|
+
(_io = io) == null || _io.disconnect();
|
|
27404
|
+
io = null;
|
|
27405
|
+
}
|
|
27406
|
+
function refresh(skip, threshold) {
|
|
27407
|
+
if (skip === void 0) {
|
|
27408
|
+
skip = false;
|
|
27409
|
+
}
|
|
27410
|
+
if (threshold === void 0) {
|
|
27411
|
+
threshold = 1;
|
|
27412
|
+
}
|
|
27413
|
+
cleanup();
|
|
27414
|
+
const {
|
|
27415
|
+
left,
|
|
27416
|
+
top,
|
|
27417
|
+
width,
|
|
27418
|
+
height
|
|
27419
|
+
} = element.getBoundingClientRect();
|
|
27420
|
+
if (!skip) {
|
|
27421
|
+
onMove();
|
|
27422
|
+
}
|
|
27423
|
+
if (!width || !height) {
|
|
27424
|
+
return;
|
|
27425
|
+
}
|
|
27426
|
+
const insetTop = floor(top);
|
|
27427
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
27428
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
27429
|
+
const insetLeft = floor(left);
|
|
27430
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
27431
|
+
const options = {
|
|
27432
|
+
rootMargin,
|
|
27433
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
27434
|
+
};
|
|
27435
|
+
let isFirstUpdate = true;
|
|
27436
|
+
function handleObserve(entries) {
|
|
27437
|
+
const ratio = entries[0].intersectionRatio;
|
|
27438
|
+
if (ratio !== threshold) {
|
|
27439
|
+
if (!isFirstUpdate) {
|
|
27440
|
+
return refresh();
|
|
27441
|
+
}
|
|
27442
|
+
if (!ratio) {
|
|
27443
|
+
timeoutId = setTimeout(() => {
|
|
27444
|
+
refresh(false, 1e-7);
|
|
27445
|
+
}, 100);
|
|
27446
|
+
} else {
|
|
27447
|
+
refresh(false, ratio);
|
|
27448
|
+
}
|
|
27449
|
+
}
|
|
27450
|
+
isFirstUpdate = false;
|
|
27451
|
+
}
|
|
27452
|
+
|
|
27453
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
27454
|
+
// error.
|
|
27455
|
+
try {
|
|
27456
|
+
io = new IntersectionObserver(handleObserve, {
|
|
27457
|
+
...options,
|
|
27458
|
+
// Handle <iframe>s
|
|
27459
|
+
root: root.ownerDocument
|
|
27460
|
+
});
|
|
27461
|
+
} catch (e) {
|
|
27462
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
27463
|
+
}
|
|
27464
|
+
io.observe(element);
|
|
27465
|
+
}
|
|
27466
|
+
refresh(true);
|
|
27467
|
+
return cleanup;
|
|
27468
|
+
}
|
|
27469
|
+
|
|
27470
|
+
/**
|
|
27471
|
+
* Automatically updates the position of the floating element when necessary.
|
|
27472
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
27473
|
+
* visible on the screen.
|
|
27474
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
27475
|
+
* removed from the DOM or hidden from the screen.
|
|
27476
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
27477
|
+
*/
|
|
27478
|
+
function autoUpdate(reference, floating, update, options) {
|
|
27479
|
+
if (options === void 0) {
|
|
27480
|
+
options = {};
|
|
27481
|
+
}
|
|
27482
|
+
const {
|
|
27483
|
+
ancestorScroll = true,
|
|
27484
|
+
ancestorResize = true,
|
|
27485
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
27486
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
27487
|
+
animationFrame = false
|
|
27488
|
+
} = options;
|
|
27489
|
+
const referenceEl = unwrapElement(reference);
|
|
27490
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
27491
|
+
ancestors.forEach(ancestor => {
|
|
27492
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
27493
|
+
passive: true
|
|
27494
|
+
});
|
|
27495
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
27496
|
+
});
|
|
27497
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
27498
|
+
let reobserveFrame = -1;
|
|
27499
|
+
let resizeObserver = null;
|
|
27500
|
+
if (elementResize) {
|
|
27501
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
27502
|
+
let [firstEntry] = _ref;
|
|
27503
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
27504
|
+
// Prevent update loops when using the `size` middleware.
|
|
27505
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
27506
|
+
resizeObserver.unobserve(floating);
|
|
27507
|
+
cancelAnimationFrame(reobserveFrame);
|
|
27508
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
27509
|
+
var _resizeObserver;
|
|
27510
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
27511
|
+
});
|
|
27512
|
+
}
|
|
27513
|
+
update();
|
|
27514
|
+
});
|
|
27515
|
+
if (referenceEl && !animationFrame) {
|
|
27516
|
+
resizeObserver.observe(referenceEl);
|
|
27517
|
+
}
|
|
27518
|
+
resizeObserver.observe(floating);
|
|
27519
|
+
}
|
|
27520
|
+
let frameId;
|
|
27521
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
27522
|
+
if (animationFrame) {
|
|
27523
|
+
frameLoop();
|
|
27524
|
+
}
|
|
27525
|
+
function frameLoop() {
|
|
27526
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
27527
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
27528
|
+
update();
|
|
27529
|
+
}
|
|
27530
|
+
prevRefRect = nextRefRect;
|
|
27531
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
27532
|
+
}
|
|
27533
|
+
update();
|
|
27534
|
+
return () => {
|
|
27535
|
+
var _resizeObserver2;
|
|
27536
|
+
ancestors.forEach(ancestor => {
|
|
27537
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
27538
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
27539
|
+
});
|
|
27540
|
+
cleanupIo == null || cleanupIo();
|
|
27541
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
27542
|
+
resizeObserver = null;
|
|
27543
|
+
if (animationFrame) {
|
|
27544
|
+
cancelAnimationFrame(frameId);
|
|
27545
|
+
}
|
|
27546
|
+
};
|
|
27547
|
+
}
|
|
27548
|
+
|
|
27549
|
+
/**
|
|
27550
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
27551
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
27552
|
+
* @see https://floating-ui.com/docs/shift
|
|
27553
|
+
*/
|
|
27554
|
+
const shift = shift$1;
|
|
27555
|
+
|
|
27556
|
+
/**
|
|
27557
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
27558
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
27559
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
27560
|
+
* @see https://floating-ui.com/docs/flip
|
|
27561
|
+
*/
|
|
27562
|
+
const flip = flip$1;
|
|
27563
|
+
|
|
27564
|
+
/**
|
|
27565
|
+
* Provides data to position an inner element of the floating element so that it
|
|
27566
|
+
* appears centered to the reference element.
|
|
27567
|
+
* @see https://floating-ui.com/docs/arrow
|
|
27568
|
+
*/
|
|
27569
|
+
const arrow = arrow$1;
|
|
27570
|
+
|
|
27571
|
+
/**
|
|
27572
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
27573
|
+
* next to a given reference element.
|
|
27574
|
+
*/
|
|
27575
|
+
const computePosition = (reference, floating, options) => {
|
|
27576
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
27577
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
27578
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
27579
|
+
const cache = new Map();
|
|
27580
|
+
const mergedOptions = {
|
|
27581
|
+
platform,
|
|
27582
|
+
...options
|
|
27583
|
+
};
|
|
27584
|
+
const platformWithCache = {
|
|
27585
|
+
...mergedOptions.platform,
|
|
27586
|
+
_c: cache
|
|
27587
|
+
};
|
|
27588
|
+
return computePosition$1(reference, floating, {
|
|
27589
|
+
...mergedOptions,
|
|
27590
|
+
platform: platformWithCache
|
|
27591
|
+
});
|
|
27592
|
+
};
|
|
27593
|
+
|
|
27594
|
+
/*
|
|
27595
|
+
* React Tooltip
|
|
27596
|
+
* {@link https://github.com/ReactTooltip/react-tooltip}
|
|
27597
|
+
* @copyright ReactTooltip Team
|
|
27598
|
+
* @license MIT
|
|
27599
|
+
*/
|
|
27600
|
+
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:!1,base:!1};function S({css:e,id:t=w,type:o="base",ref:r}){var l,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),r||(r={});const{insertAt:c}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===c&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=!0;}const g=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:r="top",offset:l=10,strategy:n="absolute",middlewares:c=[offset(Number(l)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:i})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=c;return o?(s.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:r,strategy:n,middleware:s}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var l,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(l=r.arrow)&&void 0!==l?l:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:s}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_=(e,t,o)=>{let r=null;const l=function(...l){const n=()=>{r=null,o||e.apply(this,l);};o&&!r&&(e.apply(this,l),r=setTimeout(n,t)),o||(r&&clearTimeout(r),r=setTimeout(n,t));};return l.cancel=()=>{r&&(clearTimeout(r),r=null);},l},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,T=(e,t)=>{if(e===t)return !0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>T(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return !1;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),r=Object.keys(t);return o.length===r.length&&o.every((o=>T(e[o],t[o])))},k=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return !1;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},C=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(k(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},L="undefined"!=typeof window?useLayoutEffect:useEffect,R="DEFAULT_TOOLTIP_ID",x={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},N=createContext({getTooltipData:()=>x});function I(e=R){return useContext(N).getTooltipData(e)}var B={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},z={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const D=({forwardRef:t,id:r,className:c,classNameArrow:i,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=!1,positionStrategy:b="absolute",middlewares:S,wrapper:E,delayShow:A=0,delayHide:O=0,float:k=!1,hidden:R=!1,noArrow:x=!1,clickable:N=!1,closeOnEsc:$=!1,closeOnScroll:j=!1,closeOnResize:D=!1,openEvents:q,closeEvents:H,globalCloseEvents:M,imperativeModeOnly:W,style:P,position:V,afterShow:F,afterHide:K,content:U,contentWrapperRef:X,isOpen:Y,defaultIsOpen:G=!1,setIsOpen:Z,activeAnchor:J,setActiveAnchor:Q,border:ee,opacity:te,arrowColor:oe,role:re="tooltip"})=>{var le;const ne=useRef(null),ce=useRef(null),ie=useRef(null),se=useRef(null),ae=useRef(null),[ue,de]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[pe,ve]=useState(!1),[me,fe]=useState(!1),[ye,he]=useState(null),we=useRef(!1),be=useRef(null),{anchorRefs:Se,setActiveAnchor:Ee}=I(r),ge=useRef(!1),[Ae,_e]=useState([]),Oe=useRef(!1),Te=w||h.includes("click"),ke=Te||(null==q?void 0:q.click)||(null==q?void 0:q.dblclick)||(null==q?void 0:q.mousedown),Ce=q?{...q}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!q&&Te&&Object.assign(Ce,{mouseenter:!1,focus:!1,click:!0});const Le=H?{...H}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!H&&Te&&Object.assign(Le,{mouseleave:!1,blur:!1});const Re=M?{...M}:{escape:$||!1,scroll:j||!1,resize:D||!1,clickOutsideAnchor:ke||!1};W&&(Object.assign(Ce,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Le,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Re,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),L((()=>(Oe.current=!0,()=>{Oe.current=!1;})),[]);const xe=e=>{Oe.current&&(e&&fe(!0),setTimeout((()=>{Oe.current&&(null==Z||Z(e),void 0===Y&&ve(e));}),10));};useEffect((()=>{if(void 0===Y)return ()=>null;Y&&fe(!0);const e=setTimeout((()=>{ve(Y);}),10);return ()=>{clearTimeout(e);}}),[Y]),useEffect((()=>{if(pe!==we.current)if(ae.current&&clearTimeout(ae.current),we.current=pe,pe)null==F||F();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,r]=t;return Number(o)*("ms"===r?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ae.current=setTimeout((()=>{fe(!1),he(null),null==K||K();}),e+25);}}),[pe]);const Ne=e=>{de((t=>T(t,e)?t:e));},$e=(e=A)=>{ie.current&&clearTimeout(ie.current),me?xe(!0):ie.current=setTimeout((()=>{xe(!0);}),e);},Ie=(e=O)=>{se.current&&clearTimeout(se.current),se.current=setTimeout((()=>{ge.current||xe(!1);}),e);},je=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return Q(null),void Ee({current:null});A?$e():xe(!0),Q(o),Ee({current:o}),se.current&&clearTimeout(se.current);},Be=()=>{N?Ie(O||100):O?Ie():xe(!1),ie.current&&clearTimeout(ie.current);},ze=({x:e,y:t})=>{var o;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};g({place:null!==(o=null==ye?void 0:ye.place)&&void 0!==o?o:v,offset:m,elementReference:r,tooltipReference:ne.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:ee}).then((e=>{Ne(e);}));},De=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};ze(o),be.current=o;},qe=e=>{var t;if(!pe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=ne.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...Ae].some((e=>null==e?void 0:e.contains(o)))||(xe(!1),ie.current&&clearTimeout(ie.current));},He=_(je,50,!0),Me=_(Be,50,!0),We=e=>{Me.cancel(),He(e);},Pe=()=>{He.cancel(),Me();},Ve=useCallback((()=>{var e,t;const o=null!==(e=null==ye?void 0:ye.position)&&void 0!==e?e:V;o?ze(o):k?be.current&&ze(be.current):(null==J?void 0:J.isConnected)&&g({place:null!==(t=null==ye?void 0:ye.place)&&void 0!==t?t:v,offset:m,elementReference:J,tooltipReference:ne.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:ee}).then((e=>{Oe.current&&Ne(e);}));}),[pe,J,U,P,v,null==ye?void 0:ye.place,m,b,V,null==ye?void 0:ye.position,k]);useEffect((()=>{var e,t;const o=new Set(Se);Ae.forEach((e=>{o.add({current:e});}));const r=document.querySelector(`[id='${d}']`);r&&o.add({current:r});const l=()=>{xe(!1);},n=C(J),c=C(ne.current);Re.scroll&&(window.addEventListener("scroll",l),null==n||n.addEventListener("scroll",l),null==c||c.addEventListener("scroll",l));let i=null;Re.resize?window.addEventListener("resize",l):J&&ne.current&&(i=autoUpdate(J,ne.current,Ve,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const s=e=>{"Escape"===e.key&&xe(!1);};Re.escape&&window.addEventListener("keydown",s),Re.clickOutsideAnchor&&window.addEventListener("click",qe);const a=[],u=e=>{pe&&(null==e?void 0:e.target)===J||je(e);},p=e=>{pe&&(null==e?void 0:e.target)===J&&Be();},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(Ce).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:We}):m.includes(e)&&a.push({event:e,listener:u}));})),Object.entries(Le).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:Pe}):m.includes(e)&&a.push({event:e,listener:p}));})),k&&a.push({event:"pointermove",listener:De});const y=()=>{ge.current=!0;},h=()=>{ge.current=!1,Be();};return N&&!ke&&(null===(e=ne.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=ne.current)||void 0===t||t.addEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t);}));})),()=>{var e,t;Re.scroll&&(window.removeEventListener("scroll",l),null==n||n.removeEventListener("scroll",l),null==c||c.removeEventListener("scroll",l)),Re.resize?window.removeEventListener("resize",l):null==i||i(),Re.clickOutsideAnchor&&window.removeEventListener("click",qe),Re.escape&&window.removeEventListener("keydown",s),N&&!ke&&(null===(e=ne.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=ne.current)||void 0===t||t.removeEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t);}));}));}}),[J,Ve,me,Se,Ae,q,H,M,Te,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ye?void 0:ye.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r}']`);const l=new MutationObserver((e=>{const t=[],l=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===r?t.push(e.target):e.oldValue===r&&l.push(e.target);}if("childList"===e.type){if(J){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{l.push(...t.filter((e=>e.matches(o)))),l.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,J))&&(fe(!1),xe(!1),Q(null),ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current),!0)}));}if(o)try{const r=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...r.filter((e=>e.matches(o)))),t.push(...r.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||l.length)&&_e((e=>[...e.filter((e=>!l.includes(e))),...t]));}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect();}}),[r,p,null==ye?void 0:ye.anchorSelect,J]),useEffect((()=>{Ve();}),[Ve]),useEffect((()=>{if(!(null==X?void 0:X.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ve()));}));return e.observe(X.current),()=>{e.disconnect();}}),[U,null==X?void 0:X.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...Ae,t];J&&o.includes(J)||Q(null!==(e=Ae[0])&&void 0!==e?e:t);}),[d,Ae,J]),useEffect((()=>(G&&xe(!0),()=>{ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current);})),[]),useEffect((()=>{var e;let t=null!==(e=null==ye?void 0:ye.anchorSelect)&&void 0!==e?e:p;if(!t&&r&&(t=`[data-tooltip-id='${r}']`),t)try{const e=Array.from(document.querySelectorAll(t));_e(e);}catch(e){_e([]);}}),[r,p,null==ye?void 0:ye.anchorSelect]),useEffect((()=>{ie.current&&(clearTimeout(ie.current),$e(A));}),[A]);const Fe=null!==(le=null==ye?void 0:ye.content)&&void 0!==le?le:U,Ke=pe&&Object.keys(ue.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}he(null!=e?e:null),(null==e?void 0:e.delay)?$e(e.delay):xe(!0);},close:e=>{(null==e?void 0:e.delay)?Ie(e.delay):xe(!1);},activeAnchor:J,place:ue.place,isOpen:Boolean(me&&!R&&Fe&&Ke)}))),me&&!R&&Fe?React__default.createElement(E,{id:r,role:re,className:y("react-tooltip",B.tooltip,z.tooltip,z[u],c,`react-tooltip__place-${ue.place}`,B[Ke?"show":"closing"],Ke?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B.fixed,N&&B.clickable),onTransitionEnd:e=>{ae.current&&clearTimeout(ae.current),pe||"opacity"!==e.propertyName||(fe(!1),he(null),null==K||K());},style:{...P,...ue.tooltipStyles,opacity:void 0!==te&&Ke?te:void 0},ref:ne},Fe,React__default.createElement(E,{className:y("react-tooltip-arrow",B.arrow,z.arrow,i,x&&B.noArrow),style:{...ue.tooltipArrowStyles,background:oe?`linear-gradient(to right bottom, transparent 50%, ${oe} 50%)`:void 0},ref:ce})):null},q=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),H=React__default.forwardRef((({id:t,anchorId:r,anchorSelect:n,content:c,html:i,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=!1,positionStrategy:S="absolute",middlewares:E,delayShow:g=0,delayHide:_=0,float:O=!1,hidden:T=!1,noArrow:k=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:R=!1,closeOnResize:x=!1,openEvents:N,closeEvents:$,globalCloseEvents:j,imperativeModeOnly:B=!1,style:z,position:H,isOpen:M,defaultIsOpen:W=!1,disableStyleInjection:P=!1,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,role:G="tooltip"},Z)=>{const[J,Q]=useState(c),[ee,te]=useState(i),[oe,re]=useState(v),[le,ne]=useState(p),[ce,ie]=useState(m),[se,ae]=useState(g),[ue,de]=useState(_),[pe,ve]=useState(O),[me,fe]=useState(T),[ye,he]=useState(f),[we,be]=useState(w),[Se,Ee]=useState(S),[ge,Ae]=useState(null),[_e,Oe]=useState(null),Te=useRef(P),{anchorRefs:ke,activeAnchor:Ce}=I(t),Le=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null;}return t}),{}),Re=e=>{const t={place:e=>{var t;re(null!==(t=e)&&void 0!==t?t:v);},content:e=>{Q(null!=e?e:c);},html:e=>{te(null!=e?e:i);},variant:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ie(null===e?m:Number(e));},wrapper:e=>{var t;he(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");be(null!=t?t:w);},"position-strategy":e=>{var t;Ee(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{ae(null===e?g:Number(e));},"delay-hide":e=>{de(null===e?_:Number(e));},float:e=>{ve(null===e?O:"true"===e);},hidden:e=>{fe(null===e?T:"true"===e);},"class-name":e=>{Ae(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o);}));};useEffect((()=>{Q(c);}),[c]),useEffect((()=>{te(i);}),[i]),useEffect((()=>{re(v);}),[v]),useEffect((()=>{ne(p);}),[p]),useEffect((()=>{ie(m);}),[m]),useEffect((()=>{ae(g);}),[g]),useEffect((()=>{de(_);}),[_]),useEffect((()=>{ve(O);}),[O]),useEffect((()=>{fe(T);}),[T]),useEffect((()=>{Ee(S);}),[S]),useEffect((()=>{Te.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(ke);let l=n;if(!l&&t&&(l=`[data-tooltip-id='${t}']`),l)try{document.querySelectorAll(l).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`);}const c=document.querySelector(`[id='${r}']`);if(c&&o.add({current:c}),!o.size)return ()=>null;const i=null!==(e=null!=_e?_e:c)&&void 0!==e?e:Ce.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!i||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=Le(i);Re(o);}));})),a={attributes:!0,childList:!1,subtree:!1};if(i){const e=Le(i);Re(e),s.observe(i,a);}return ()=>{s.disconnect();}}),[ke,Ce,_e,r,n]),useEffect((()=>{(null==z?void 0:z.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==z?void 0:z.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let xe=h;const Ne=useRef(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?React__default.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null;}else J&&(xe=J);ee&&(xe=React__default.createElement(q,{content:ee}));const $e={forwardRef:Z,id:t,anchorId:r,anchorSelect:n,className:y(u,ge),classNameArrow:d,content:xe,contentWrapperRef:Ne,place:oe,variant:le,offset:ce,wrapper:ye,events:we,openOnClick:b,positionStrategy:Se,middlewares:E,delayShow:se,delayHide:ue,float:pe,hidden:me,noArrow:k,clickable:C,closeOnEsc:L,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:j,imperativeModeOnly:B,style:z,position:H,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,activeAnchor:_e,setActiveAnchor:e=>Oe(e),role:G};return React__default.createElement(D,{...$e})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
27601
|
+
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"});}));
|
|
27602
|
+
|
|
27603
|
+
const StyledTooltip = styled.div `
|
|
27604
|
+
display: inline-block;
|
|
27605
|
+
|
|
27606
|
+
i:hover {
|
|
27607
|
+
cursor: pointer;
|
|
27608
|
+
}
|
|
27609
|
+
|
|
27610
|
+
p {
|
|
27611
|
+
line-height: 1.4;
|
|
27612
|
+
font-size: 13px;
|
|
27613
|
+
}
|
|
27614
|
+
|
|
27615
|
+
.tool {
|
|
27616
|
+
background: ${allColors.oxfordBlue} !important;
|
|
27617
|
+
border: 1px solid ${allColors.baliHai} !important;
|
|
27618
|
+
border-radius: 2px !important;
|
|
27619
|
+
padding: 8px 11px !important;
|
|
27620
|
+
opacity: 1 !important;
|
|
27621
|
+
|
|
27622
|
+
&.place-left:after {
|
|
27623
|
+
border-left-color: ${allColors.oxfordBlue} !important;
|
|
27624
|
+
border-top: 5px solid transparent !important;
|
|
27625
|
+
border-bottom: 5px solid transparent !important;
|
|
27626
|
+
right: -6px !important;
|
|
27627
|
+
top: 50% !important;
|
|
27628
|
+
margin-top: -9px !important;
|
|
27629
|
+
}
|
|
27630
|
+
|
|
27631
|
+
&.place-left:before {
|
|
27632
|
+
border-left-color: ${allColors.baliHai} !important;
|
|
27633
|
+
border-left-width: 8px !important;
|
|
27634
|
+
border-left-style: solid !important;
|
|
27635
|
+
margin-top: -10px !important;
|
|
27636
|
+
}
|
|
27637
|
+
|
|
27638
|
+
&.place-right:after {
|
|
27639
|
+
border-right-color: ${allColors.oxfordBlue} !important;
|
|
27640
|
+
border-top: 5px solid transparent !important;
|
|
27641
|
+
border-bottom: 5px solid transparent !important;
|
|
27642
|
+
left: -6px !important;
|
|
27643
|
+
top: 50% !important;
|
|
27644
|
+
margin-top: -9px !important;
|
|
27645
|
+
}
|
|
27646
|
+
|
|
27647
|
+
&.place-right:before {
|
|
27648
|
+
border-right-color: ${allColors.baliHai} !important;
|
|
27649
|
+
border-right-width: 8px !important;
|
|
27650
|
+
border-right-style: solid !important;
|
|
27651
|
+
margin-top: -10px !important;
|
|
27652
|
+
}
|
|
27653
|
+
|
|
27654
|
+
&.place-top:after {
|
|
27655
|
+
border-top-color: ${allColors.oxfordBlue} !important;
|
|
27656
|
+
}
|
|
27657
|
+
|
|
27658
|
+
&.place-top:before {
|
|
27659
|
+
border-top-color: ${allColors.baliHai} !important;
|
|
27660
|
+
border-top-width: 8px !important;
|
|
27661
|
+
border-top-style: solid !important;
|
|
27662
|
+
}
|
|
27663
|
+
|
|
27664
|
+
&.place-bottom:after {
|
|
27665
|
+
border-bottom-color: ${allColors.oxfordBlue} !important;
|
|
27666
|
+
}
|
|
27667
|
+
|
|
27668
|
+
&.place-bottom:before {
|
|
27669
|
+
border-bottom-color: ${allColors.baliHai} !important;
|
|
27670
|
+
border-bottom-width: 8px !important;
|
|
27671
|
+
border-bottom-style: solid !important;
|
|
27672
|
+
}
|
|
27673
|
+
}
|
|
27674
|
+
`;
|
|
27675
|
+
|
|
27676
|
+
var PlacesType;
|
|
27677
|
+
(function (PlacesType) {
|
|
27678
|
+
PlacesType["top"] = "top";
|
|
27679
|
+
PlacesType["top-start"] = "top-start";
|
|
27680
|
+
PlacesType["top-end"] = "top-end";
|
|
27681
|
+
PlacesType["right"] = "right";
|
|
27682
|
+
PlacesType["right-start"] = "right-start";
|
|
27683
|
+
PlacesType["right-end"] = "right-end";
|
|
27684
|
+
PlacesType["bottom"] = "bottom";
|
|
27685
|
+
PlacesType["bottom-start"] = "bottom-start";
|
|
27686
|
+
PlacesType["bottom-end"] = "bottom-end";
|
|
27687
|
+
PlacesType["left"] = "left";
|
|
27688
|
+
PlacesType["left-start"] = "left-start";
|
|
27689
|
+
PlacesType["left-end"] = "left-end";
|
|
27690
|
+
})(PlacesType || (PlacesType = {}));
|
|
27691
|
+
const Tooltip = (props) => {
|
|
27692
|
+
return (jsxs(StyledTooltip, { className: props.className, "data-cy": props['data-cy'], id: props.id,
|
|
27693
|
+
// this was done in a hurry, consider refactor on next pass.
|
|
27694
|
+
style: { display: props.block ? 'block' : 'inline-block' }, children: [props.questionMark && (jsx("i", { style: { color: allColors.curiousBlue }, className: props.questionMarkClassName, "data-tooltip-id": props.for, "data-tooltip-place": props.place || 'top', children: jsx(Icon, { name: "fa-question-circle" }) })), jsx(H, { className: "tool",
|
|
27695
|
+
// globalEventOff={props.clickToShow ? 'click' : ''}
|
|
27696
|
+
// place={(props.place as PlacesType) || 'top'}
|
|
27697
|
+
openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
|
|
27698
|
+
};
|
|
27699
|
+
|
|
27700
|
+
export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$1 as Button, allColors as COLORS, CirclePulse, CircleSpinner, ConfirmModal, DatePicker, Drawer, EditableInput, GlobalStyles, Icon, IconButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio, RadioGroup, RandomLoadingMessage, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, StyledWizard, typography as TYPOGRAPHY, TextInput, TextTruncate, Toggle, Tooltip, Wizard, WizardCard, WizardSection, WizardWithSidebar, color as colorUtils, faIcons, indicons, number as numberUtils, string as stringUtils };
|
|
26085
27701
|
//# sourceMappingURL=index.esm.js.map
|