@indico-data/design-system 1.0.55 → 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/Tooltip/Tooltip.d.ts +15 -0
- package/lib/components/Tooltip/Tooltip.stories.d.ts +9 -0
- package/lib/components/Tooltip/Tooltip.styles.d.ts +2 -0
- package/lib/components/Tooltip/index.d.ts +1 -0
- 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 +160 -60
- package/lib/index.esm.js +2030 -213
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +2032 -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/Tooltip/index.ts +1 -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 +3 -0
package/lib/index.js
CHANGED
|
@@ -129,7 +129,7 @@ const round10 = (value, exp) => {
|
|
|
129
129
|
return decimalAdjust('round', value, exp);
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
-
const clamp = (value, min, max) => {
|
|
132
|
+
const clamp$1 = (value, min, max) => {
|
|
133
133
|
value = value < min ? min : value;
|
|
134
134
|
value = value > max ? max : value;
|
|
135
135
|
return value;
|
|
@@ -142,7 +142,7 @@ const numberWithCommas$1 = (x) => {
|
|
|
142
142
|
const MATH = {
|
|
143
143
|
decimalAdjust,
|
|
144
144
|
round10,
|
|
145
|
-
clamp,
|
|
145
|
+
clamp: clamp$1,
|
|
146
146
|
numberWithCommas: numberWithCommas$1,
|
|
147
147
|
};
|
|
148
148
|
|
|
@@ -1774,7 +1774,7 @@ var classnames = {exports: {}};
|
|
|
1774
1774
|
} (classnames));
|
|
1775
1775
|
|
|
1776
1776
|
var classnamesExports = classnames.exports;
|
|
1777
|
-
var
|
|
1777
|
+
var y = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
1778
1778
|
|
|
1779
1779
|
const StyledSection = styled__default.default.article `
|
|
1780
1780
|
position: relative;
|
|
@@ -1785,7 +1785,7 @@ const StyledSection = styled__default.default.article `
|
|
|
1785
1785
|
|
|
1786
1786
|
const Section = (props) => {
|
|
1787
1787
|
const { className, style = {}, children, id } = props, restOfProps = __rest$1(props, ["className", "style", "children", "id"]);
|
|
1788
|
-
return (jsxRuntime$1.jsx(StyledSection, Object.assign({ className:
|
|
1788
|
+
return (jsxRuntime$1.jsx(StyledSection, Object.assign({ className: y('Section', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: children })));
|
|
1789
1789
|
};
|
|
1790
1790
|
|
|
1791
1791
|
const StyledSectionBlock = styled__default.default.div `
|
|
@@ -1802,7 +1802,7 @@ const StyledSectionBlock = styled__default.default.div `
|
|
|
1802
1802
|
|
|
1803
1803
|
const SectionBlock = (props) => {
|
|
1804
1804
|
const { title, className, children, id, style = {} } = props, restOfProps = __rest$1(props, ["title", "className", "children", "id", "style"]);
|
|
1805
|
-
return (jsxRuntime$1.jsxs(StyledSectionBlock, Object.assign({ className:
|
|
1805
|
+
return (jsxRuntime$1.jsxs(StyledSectionBlock, Object.assign({ className: y('SectionBlock', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: [title ? (jsxRuntime$1.jsx("header", { children: jsxRuntime$1.jsx("h3", { children: title }) })) : null, children, jsxRuntime$1.jsx("hr", { className: "section-bottom-border" })] })));
|
|
1806
1806
|
};
|
|
1807
1807
|
|
|
1808
1808
|
const sectionSidePadding = '19px';
|
|
@@ -1821,7 +1821,7 @@ const StyledSectionBody = styled__default.default.div `
|
|
|
1821
1821
|
|
|
1822
1822
|
const SectionBody = (props) => {
|
|
1823
1823
|
const { className, style = {}, children, id } = props, restOfProps = __rest$1(props, ["className", "style", "children", "id"]);
|
|
1824
|
-
return (jsxRuntime$1.jsx(StyledSectionBody, Object.assign({ className:
|
|
1824
|
+
return (jsxRuntime$1.jsx(StyledSectionBody, Object.assign({ className: y('SectionBody', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: children })));
|
|
1825
1825
|
};
|
|
1826
1826
|
|
|
1827
1827
|
const StyledSectionHeader = styled__default.default.header `
|
|
@@ -1830,7 +1830,7 @@ const StyledSectionHeader = styled__default.default.header `
|
|
|
1830
1830
|
|
|
1831
1831
|
const SectionHeader = (props) => {
|
|
1832
1832
|
const { className, style, children, id } = props, restOfProps = __rest$1(props, ["className", "style", "children", "id"]);
|
|
1833
|
-
return (jsxRuntime$1.jsx(StyledSectionHeader, Object.assign({ className:
|
|
1833
|
+
return (jsxRuntime$1.jsx(StyledSectionHeader, Object.assign({ className: y('SectionHeader', className), "data-cy": props['data-cy'], id: id, style: style }, restOfProps, { children: children })));
|
|
1834
1834
|
};
|
|
1835
1835
|
SectionHeader.defaultProps = {
|
|
1836
1836
|
className: '',
|
|
@@ -1974,7 +1974,7 @@ const StyledValidationError = styled__default.default.div `
|
|
|
1974
1974
|
const BorderSelect = (props) => {
|
|
1975
1975
|
const { className = '', disabled, horizontal, id, initialText, label, onChange, options, style = {}, value, validationErrors, } = props;
|
|
1976
1976
|
const selectId = v4();
|
|
1977
|
-
return (jsxRuntime$1.jsxs(StyledSelect$1, { className:
|
|
1977
|
+
return (jsxRuntime$1.jsxs(StyledSelect$1, { className: y('Select', { horizontal }, className), "data-cy": props['data-cy'], id: id, style: style, children: [label && jsxRuntime$1.jsx("label", { htmlFor: selectId, children: label }), jsxRuntime$1.jsxs("div", { className: "select-container", children: [jsxRuntime$1.jsxs("select", { onChange: onChange, value: value, disabled: disabled, id: selectId, children: [initialText && (jsxRuntime$1.jsx("option", { disabled: true, value: "", children: initialText })), options.map((o) => {
|
|
1978
1978
|
const key = v4();
|
|
1979
1979
|
return (jsxRuntime$1.jsx("option", { value: o.value, children: o.name }, key));
|
|
1980
1980
|
})] }), jsxRuntime$1.jsx(Icon, { name: "fa-caret-down", className: "selectCaret" })] }), validationErrors ? (jsxRuntime$1.jsx(StyledValidationError, { children: validationErrors.map((err, i) => {
|
|
@@ -2055,7 +2055,7 @@ const StyledSelect = styled__default.default.div `
|
|
|
2055
2055
|
const Select = (props) => {
|
|
2056
2056
|
const { id, className, disabled, initialText, onChange, options, size = 'medium', style = {}, value, variant, onClick, } = props;
|
|
2057
2057
|
const selectId = v4();
|
|
2058
|
-
return (jsxRuntime$1.jsx(StyledSelect, { className: className, "data-cy": props['data-cy'], id: id, style: style, children: jsxRuntime$1.jsxs("div", { className:
|
|
2058
|
+
return (jsxRuntime$1.jsx(StyledSelect, { className: className, "data-cy": props['data-cy'], id: id, style: style, children: jsxRuntime$1.jsxs("div", { className: y('Select__container', size, variant), onClick: (e) => (onClick ? onClick(e) : null), children: [jsxRuntime$1.jsxs("select", { onChange: onChange, value: value, disabled: disabled, id: selectId, children: [initialText && (jsxRuntime$1.jsx("option", { disabled: true, value: "", children: initialText })), options.map((o) => {
|
|
2059
2059
|
const key = v4();
|
|
2060
2060
|
return (jsxRuntime$1.jsx("option", { value: o.value, children: o.name }, key));
|
|
2061
2061
|
})] }), jsxRuntime$1.jsx(Icon, { className: "chevron", name: "chevron-down", size: size === 'small' ? [10] : [12] })] }) }));
|
|
@@ -2342,6 +2342,42 @@ const SingleCombobox = React__namespace.default.forwardRef((props, ref) => {
|
|
|
2342
2342
|
return jsxRuntime$1.jsx(ComboboxComponent, {});
|
|
2343
2343
|
});
|
|
2344
2344
|
|
|
2345
|
+
const mix = function (color_1, color_2, weight) {
|
|
2346
|
+
function d2h(d) {
|
|
2347
|
+
return d.toString(16);
|
|
2348
|
+
} // convert a decimal value to hex
|
|
2349
|
+
function h2d(h) {
|
|
2350
|
+
return parseInt(h, 16);
|
|
2351
|
+
} // convert a hex value to decimal
|
|
2352
|
+
function s2l(hex) {
|
|
2353
|
+
return `${hex}${hex}`;
|
|
2354
|
+
}
|
|
2355
|
+
weight = typeof weight !== 'undefined' ? weight : 50; // set the weight to 50%, if that argument is omitted
|
|
2356
|
+
color_1 = color_1.replace(/#/g, '');
|
|
2357
|
+
color_2 = color_2.replace(/#/g, '');
|
|
2358
|
+
// check if colors are shorthand or longhand - covert to longhand
|
|
2359
|
+
color_1 = color_1.length === 3 ? s2l(color_1) : color_1;
|
|
2360
|
+
color_2 = color_2.length === 3 ? s2l(color_2) : color_2;
|
|
2361
|
+
let color = '#';
|
|
2362
|
+
for (let i = 0; i <= 5; i += 2) {
|
|
2363
|
+
// loop through each of the 3 hex pairs—red, green, and blue
|
|
2364
|
+
const v1 = h2d(color_1.substr(i, 2)); // extract the current pairs
|
|
2365
|
+
const v2 = h2d(color_2.substr(i, 2));
|
|
2366
|
+
// combine the current pairs from each source color, according to the specified weight
|
|
2367
|
+
let val = d2h(Math.floor(v2 + (v1 - v2) * (weight / 100.0)));
|
|
2368
|
+
while (val.length < 2) {
|
|
2369
|
+
val = '0' + val;
|
|
2370
|
+
} // prepend a '0' if val results in a single digit
|
|
2371
|
+
color += val; // concatenate val to our new color string
|
|
2372
|
+
}
|
|
2373
|
+
return color; // PROFIT!
|
|
2374
|
+
};
|
|
2375
|
+
const shade = (color, percentage) => {
|
|
2376
|
+
return mix('#000000', color, percentage);
|
|
2377
|
+
};
|
|
2378
|
+
const tint = (color, percentage) => {
|
|
2379
|
+
return mix('#ffffff', color, percentage);
|
|
2380
|
+
};
|
|
2345
2381
|
/**
|
|
2346
2382
|
* Converts hex color values to rgb or rgba values if a opacity is supplied
|
|
2347
2383
|
* @param hex
|
|
@@ -2362,7 +2398,120 @@ const hexToRgb = (hex, opacity) => {
|
|
|
2362
2398
|
}
|
|
2363
2399
|
return undefined;
|
|
2364
2400
|
};
|
|
2401
|
+
/**
|
|
2402
|
+
* Takes a 3- or 6-character hex color value, and returns an object containing
|
|
2403
|
+
* its equivalent HSL values.
|
|
2404
|
+
*
|
|
2405
|
+
* @see {@link https://css-tricks.com/converting-color-spaces-in-javascript/}
|
|
2406
|
+
* @see {@link https://gist.github.com/mjackson/5311256}
|
|
2407
|
+
*/
|
|
2408
|
+
function hexToHsl(hexColor) {
|
|
2409
|
+
// convert to 6-character hex string, if necessary
|
|
2410
|
+
const fullHexColor = (() => {
|
|
2411
|
+
if (hexColor.length === 4) {
|
|
2412
|
+
return ('#' +
|
|
2413
|
+
hexColor
|
|
2414
|
+
.replace('#', '')
|
|
2415
|
+
.split('')
|
|
2416
|
+
.reduce((acc, char) => (acc += char + char), ''));
|
|
2417
|
+
}
|
|
2418
|
+
return hexColor;
|
|
2419
|
+
})();
|
|
2420
|
+
const rgbValues = {
|
|
2421
|
+
red: parseInt(fullHexColor.slice(1, 3), 16) / 255,
|
|
2422
|
+
green: parseInt(fullHexColor.slice(3, 5), 16) / 255,
|
|
2423
|
+
blue: parseInt(fullHexColor.slice(-2), 16) / 255,
|
|
2424
|
+
};
|
|
2425
|
+
const allValues = Object.values(rgbValues);
|
|
2426
|
+
const channelMax = Math.max(...allValues);
|
|
2427
|
+
const channelMin = Math.min(...allValues);
|
|
2428
|
+
const channelDelta = channelMax - channelMin;
|
|
2429
|
+
const hslValues = {
|
|
2430
|
+
hue: 0,
|
|
2431
|
+
saturation: 0,
|
|
2432
|
+
lightness: (channelMax + channelMin) / 2,
|
|
2433
|
+
};
|
|
2434
|
+
if (channelDelta !== 0) {
|
|
2435
|
+
// calculate hue
|
|
2436
|
+
if (channelMax === rgbValues.red) {
|
|
2437
|
+
hslValues.hue = ((rgbValues.green - rgbValues.blue) / channelDelta) % 6;
|
|
2438
|
+
}
|
|
2439
|
+
else if (channelMax === rgbValues.green) {
|
|
2440
|
+
hslValues.hue = (rgbValues.blue - rgbValues.red) / channelDelta + 2;
|
|
2441
|
+
}
|
|
2442
|
+
else {
|
|
2443
|
+
hslValues.hue = (rgbValues.red - rgbValues.green) / channelDelta + 4;
|
|
2444
|
+
}
|
|
2445
|
+
// calculate saturation
|
|
2446
|
+
hslValues.saturation = channelDelta / (1 - Math.abs(2 * hslValues.lightness - 1));
|
|
2447
|
+
}
|
|
2448
|
+
hslValues.hue = Math.round(hslValues.hue * 60);
|
|
2449
|
+
hslValues.saturation = +(hslValues.saturation * 100).toFixed(0);
|
|
2450
|
+
hslValues.lightness = +(hslValues.lightness * 100).toFixed(0);
|
|
2451
|
+
// make negative hues positive
|
|
2452
|
+
if (hslValues.hue < 0) {
|
|
2453
|
+
hslValues.hue += 360;
|
|
2454
|
+
}
|
|
2455
|
+
return hslValues;
|
|
2456
|
+
}
|
|
2365
2457
|
|
|
2458
|
+
var color = /*#__PURE__*/Object.freeze({
|
|
2459
|
+
__proto__: null,
|
|
2460
|
+
hexToHsl: hexToHsl,
|
|
2461
|
+
hexToRgb: hexToRgb,
|
|
2462
|
+
mix: mix,
|
|
2463
|
+
shade: shade,
|
|
2464
|
+
tint: tint
|
|
2465
|
+
});
|
|
2466
|
+
|
|
2467
|
+
const camelCaseToUpperUnderscore = (string) => {
|
|
2468
|
+
return string
|
|
2469
|
+
.replace(/([A-Z])/g, function ($1) {
|
|
2470
|
+
return '_' + $1;
|
|
2471
|
+
})
|
|
2472
|
+
.toUpperCase();
|
|
2473
|
+
};
|
|
2474
|
+
const camelCaseToSpaceUpper = (string) => {
|
|
2475
|
+
return (string
|
|
2476
|
+
// insert a space before all caps
|
|
2477
|
+
.replace(/([A-Z])/g, ' $1')
|
|
2478
|
+
// uppercase the first character
|
|
2479
|
+
.replace(/^./, function (str) {
|
|
2480
|
+
return str.toUpperCase();
|
|
2481
|
+
}));
|
|
2482
|
+
};
|
|
2483
|
+
const underscoreToCapitalize = (string) => {
|
|
2484
|
+
return (string
|
|
2485
|
+
// replace all _ with spaces
|
|
2486
|
+
.replace(/_/g, ' ')
|
|
2487
|
+
// uppercase the first character
|
|
2488
|
+
.replace(/^./, function (str) {
|
|
2489
|
+
return str.toUpperCase();
|
|
2490
|
+
}));
|
|
2491
|
+
};
|
|
2492
|
+
const snakeCaseToCamelCase = (string) => {
|
|
2493
|
+
const parts = string.split('_').map((part, i) => {
|
|
2494
|
+
if (i > 0) {
|
|
2495
|
+
return part.replace(/^./, function (str) {
|
|
2496
|
+
return str.toUpperCase();
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
else {
|
|
2500
|
+
return part;
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
return parts.join().replace(/,/g, '');
|
|
2504
|
+
};
|
|
2505
|
+
function capitalize(string) {
|
|
2506
|
+
if (typeof string !== 'string')
|
|
2507
|
+
return '';
|
|
2508
|
+
return string.slice(0, 1).toUpperCase() + string.slice(1).toLowerCase();
|
|
2509
|
+
}
|
|
2510
|
+
function capitalizeFirstOnly(string) {
|
|
2511
|
+
if (typeof string !== 'string')
|
|
2512
|
+
return '';
|
|
2513
|
+
return string.slice(0, 1).toUpperCase() + string.slice(1);
|
|
2514
|
+
}
|
|
2366
2515
|
/**
|
|
2367
2516
|
* Generates a random string of English alphabet characters. Defaults to a length of 8.
|
|
2368
2517
|
*/
|
|
@@ -2374,6 +2523,33 @@ function createRandomString(length) {
|
|
|
2374
2523
|
}
|
|
2375
2524
|
return result;
|
|
2376
2525
|
}
|
|
2526
|
+
const maxLengthWithEllipse = (string, maxLength) => {
|
|
2527
|
+
if (string.length <= maxLength) {
|
|
2528
|
+
return string;
|
|
2529
|
+
}
|
|
2530
|
+
else {
|
|
2531
|
+
return string.slice(0, maxLength - 2).concat('...');
|
|
2532
|
+
}
|
|
2533
|
+
};
|
|
2534
|
+
const maxLengthWithMiddleEllipsis = (string, maxLength) => {
|
|
2535
|
+
const frontSegment = string.slice(0, Math.floor(maxLength / 2) - 2);
|
|
2536
|
+
const endSegmentLength = string.length - (Math.floor(maxLength / 2) - 1);
|
|
2537
|
+
const endSegment = string.slice(endSegmentLength, string.length);
|
|
2538
|
+
return string.length <= maxLength ? string : `${frontSegment}...${endSegment}`;
|
|
2539
|
+
};
|
|
2540
|
+
|
|
2541
|
+
var string = /*#__PURE__*/Object.freeze({
|
|
2542
|
+
__proto__: null,
|
|
2543
|
+
camelCaseToSpaceUpper: camelCaseToSpaceUpper,
|
|
2544
|
+
camelCaseToUpperUnderscore: camelCaseToUpperUnderscore,
|
|
2545
|
+
capitalize: capitalize,
|
|
2546
|
+
capitalizeFirstOnly: capitalizeFirstOnly,
|
|
2547
|
+
createRandomString: createRandomString,
|
|
2548
|
+
maxLengthWithEllipse: maxLengthWithEllipse,
|
|
2549
|
+
maxLengthWithMiddleEllipsis: maxLengthWithMiddleEllipsis,
|
|
2550
|
+
snakeCaseToCamelCase: snakeCaseToCamelCase,
|
|
2551
|
+
underscoreToCapitalize: underscoreToCapitalize
|
|
2552
|
+
});
|
|
2377
2553
|
|
|
2378
2554
|
/**
|
|
2379
2555
|
* Takes a number and formats it nicely.
|
|
@@ -2384,6 +2560,31 @@ function createRandomString(length) {
|
|
|
2384
2560
|
function numberWithCommas(value) {
|
|
2385
2561
|
return new Intl.NumberFormat(navigator.language || 'en-US').format(value);
|
|
2386
2562
|
}
|
|
2563
|
+
/**
|
|
2564
|
+
* Takes a number and returns it, rounded up to the maximum decimal places specified.
|
|
2565
|
+
*
|
|
2566
|
+
* @example maxDecimalPlaces(0.1694915254237288, 2)
|
|
2567
|
+
* // returns 0.17
|
|
2568
|
+
*
|
|
2569
|
+
* @example maxDecimalPlaces(0.1694915254237288, 3)
|
|
2570
|
+
* // returns 0.169
|
|
2571
|
+
*
|
|
2572
|
+
* @example maxDecimalPlaces(12.902, 2)
|
|
2573
|
+
* // returns 12.9
|
|
2574
|
+
*/
|
|
2575
|
+
function maxDecimalPlaces(value, decimalPlaces) {
|
|
2576
|
+
return +value.toFixed(decimalPlaces);
|
|
2577
|
+
}
|
|
2578
|
+
function formatConfidence(confidence) {
|
|
2579
|
+
return Math.min(Math.floor(confidence * 100), 99);
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
var number = /*#__PURE__*/Object.freeze({
|
|
2583
|
+
__proto__: null,
|
|
2584
|
+
formatConfidence: formatConfidence,
|
|
2585
|
+
maxDecimalPlaces: maxDecimalPlaces,
|
|
2586
|
+
numberWithCommas: numberWithCommas
|
|
2587
|
+
});
|
|
2387
2588
|
|
|
2388
2589
|
const cardTableLoading = styled.keyframes `
|
|
2389
2590
|
25% {
|
|
@@ -2641,10 +2842,10 @@ const SectionTable = (props) => {
|
|
|
2641
2842
|
}
|
|
2642
2843
|
};
|
|
2643
2844
|
const headers = Object.keys(props.tableObjects[0].content);
|
|
2644
|
-
return (jsxRuntime$1.jsxs(StyledSectionTable, { className:
|
|
2845
|
+
return (jsxRuntime$1.jsxs(StyledSectionTable, { className: y('SectionTable', props.className, { loading: props.loading }), "data-cy": props['data-cy'], id: props.id, children: [props.sortColumnHandler && props.sortedColumn && (jsxRuntime$1.jsx("div", { className: "mobile-sort", children: jsxRuntime$1.jsx(BorderSelect, { onChange: (e) => props.sortColumnHandler(e.target.value), value: props.sortedColumn, options: [].concat({ name: 'Choose Sorting Option', value: '' }, headers.map((item) => {
|
|
2645
2846
|
return { name: item, value: item };
|
|
2646
2847
|
})) }) })), jsxRuntime$1.jsxs("table", Object.assign({}, props.tableProps, { children: [jsxRuntime$1.jsx("thead", { children: jsxRuntime$1.jsxs("tr", { children: [props.tableObjects[0].rowAccordionContent ? jsxRuntime$1.jsx("th", { className: "action-column" }) : null, headers.map((header, i) => {
|
|
2647
|
-
return (jsxRuntime$1.jsxs("th", { className:
|
|
2848
|
+
return (jsxRuntime$1.jsxs("th", { className: y({
|
|
2648
2849
|
'not-sortable': props.sortableHeaders && props.sortableHeaders.indexOf(header) === -1,
|
|
2649
2850
|
}), onClick: () => {
|
|
2650
2851
|
if (props.sortColumnHandler) {
|
|
@@ -2658,7 +2859,7 @@ const SectionTable = (props) => {
|
|
|
2658
2859
|
}
|
|
2659
2860
|
}
|
|
2660
2861
|
}, children: [props.headersContent ? props.headersContent[header] : header, ' ', props.sortedColumn === header && (jsxRuntime$1.jsx(Icon, { name: `fa-caret-${props.sortDirection}` }))] }, i));
|
|
2661
|
-
})] }) }), jsxRuntime$1.jsx("tbody", { className:
|
|
2862
|
+
})] }) }), jsxRuntime$1.jsx("tbody", { className: y({ 'SectionTable--tbody-loading': props.loading }), children: props.loading
|
|
2662
2863
|
? Array.from({ length: 5 }, (x, i) => (jsxRuntime$1.jsx("tr", { children: props.tableObjects[0].rowAccordionContent ? (jsxRuntime$1.jsx("td", { colSpan: headers.length + 1 })) : (jsxRuntime$1.jsx("td", { colSpan: headers.length })) }, i)))
|
|
2663
2864
|
: props.tableObjects.map((obj, i) => {
|
|
2664
2865
|
let rowStyle = obj.rowStyleCondition;
|
|
@@ -2666,7 +2867,7 @@ const SectionTable = (props) => {
|
|
|
2666
2867
|
rowStyle = { [rowStyle.className]: rowStyle.condition };
|
|
2667
2868
|
}
|
|
2668
2869
|
if (obj.rowAccordionContent) {
|
|
2669
|
-
return (jsxRuntime$1.jsx("tr", Object.assign({ className:
|
|
2870
|
+
return (jsxRuntime$1.jsx("tr", Object.assign({ className: y(rowStyle) }, props.rowProps, { children: jsxRuntime$1.jsx("td", { colSpan: headers.length + 1, style: { padding: '0' }, className: "outer-hover", children: jsxRuntime$1.jsxs("table", { children: [jsxRuntime$1.jsx("thead", { children: jsxRuntime$1.jsxs("tr", { children: [jsxRuntime$1.jsx("th", { className: "action-column", style: {
|
|
2670
2871
|
padding: '0',
|
|
2671
2872
|
height: '1px',
|
|
2672
2873
|
border: 'none',
|
|
@@ -2685,18 +2886,18 @@ const SectionTable = (props) => {
|
|
|
2685
2886
|
return (jsxRuntime$1.jsx("td", Object.assign({ style: {
|
|
2686
2887
|
borderBottom: 'none',
|
|
2687
2888
|
}, "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));
|
|
2688
|
-
})] }), jsxRuntime$1.jsx("tr", { className:
|
|
2889
|
+
})] }), jsxRuntime$1.jsx("tr", { className: y('row-option', {
|
|
2689
2890
|
open: openRowOptions.indexOf(obj.id) !== -1,
|
|
2690
2891
|
}), children: jsxRuntime$1.jsx("td", { className: "inner-table-cell", colSpan: headers.length + 1, children: obj.rowAccordionContent }) })] })] }) }) }), i));
|
|
2691
2892
|
}
|
|
2692
2893
|
else if (obj.lineItemLink) {
|
|
2693
|
-
return (jsxRuntime$1.jsx("tr", Object.assign({ onClick: handleRowClick(obj.lineItemLink), className:
|
|
2894
|
+
return (jsxRuntime$1.jsx("tr", Object.assign({ onClick: handleRowClick(obj.lineItemLink), className: y('hover', rowStyle) }, props.rowProps, { children: Object.keys(obj.content).map((key, i) => {
|
|
2694
2895
|
var _a;
|
|
2695
2896
|
return (jsxRuntime$1.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));
|
|
2696
2897
|
}) }), i));
|
|
2697
2898
|
}
|
|
2698
2899
|
else {
|
|
2699
|
-
return (jsxRuntime$1.jsx("tr", Object.assign({ className:
|
|
2900
|
+
return (jsxRuntime$1.jsx("tr", Object.assign({ className: y(rowStyle) }, props.rowProps, { children: Object.keys(obj.content).map((key, i) => {
|
|
2700
2901
|
var _a;
|
|
2701
2902
|
return (jsxRuntime$1.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));
|
|
2702
2903
|
}) }), i));
|
|
@@ -3201,7 +3402,7 @@ const StyledButton = styled__default.default.button `
|
|
|
3201
3402
|
|
|
3202
3403
|
function Button$1(props) {
|
|
3203
3404
|
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"]);
|
|
3204
|
-
return (jsxRuntime$1.jsxs(StyledButton, Object.assign({ "aria-disabled": busy, "aria-label": props['aria-label'], "aria-pressed": props['aria-pressed'], "aria-selected": props['aria-selected'], className:
|
|
3405
|
+
return (jsxRuntime$1.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, {
|
|
3205
3406
|
blue: variant === 'primary' || variant === 'cta',
|
|
3206
3407
|
busy,
|
|
3207
3408
|
}), "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 && jsxRuntime$1.jsx(CircleSpinner, { size: "0.9em", style: { marginRight: '0.5em' } }), children] })));
|
|
@@ -3462,7 +3663,7 @@ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
|
3462
3663
|
// @ts-ignore
|
|
3463
3664
|
return (React$1.useCallback)((...args)=>{
|
|
3464
3665
|
const f = ref.current;
|
|
3465
|
-
return f(...args);
|
|
3666
|
+
return f === null || f === void 0 ? void 0 : f(...args);
|
|
3466
3667
|
}, []);
|
|
3467
3668
|
}
|
|
3468
3669
|
|
|
@@ -3473,6 +3674,7 @@ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
|
3473
3674
|
// Store the function in a ref so we can always access the current version
|
|
3474
3675
|
// which has the proper `value` in scope.
|
|
3475
3676
|
let nextRef = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
3677
|
+
if (!effect.current) return;
|
|
3476
3678
|
// Run the generator to the next yield.
|
|
3477
3679
|
let newValue = effect.current.next();
|
|
3478
3680
|
// If the generator is done, reset the effect.
|
|
@@ -3694,7 +3896,7 @@ function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
|
3694
3896
|
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
|
|
3695
3897
|
$7215afc6de606d6b$var$supportsPreventScrollCached = false;
|
|
3696
3898
|
try {
|
|
3697
|
-
|
|
3899
|
+
let focusElem = document.createElement("div");
|
|
3698
3900
|
focusElem.focus({
|
|
3699
3901
|
get preventScroll () {
|
|
3700
3902
|
$7215afc6de606d6b$var$supportsPreventScrollCached = true;
|
|
@@ -3708,9 +3910,9 @@ function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
|
3708
3910
|
return $7215afc6de606d6b$var$supportsPreventScrollCached;
|
|
3709
3911
|
}
|
|
3710
3912
|
function $7215afc6de606d6b$var$getScrollableElements(element) {
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3913
|
+
let parent = element.parentNode;
|
|
3914
|
+
let scrollableElements = [];
|
|
3915
|
+
let rootScrollingElement = document.scrollingElement || document.documentElement;
|
|
3714
3916
|
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
|
|
3715
3917
|
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
|
|
3716
3918
|
element: parent,
|
|
@@ -3845,7 +4047,11 @@ let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
|
|
|
3845
4047
|
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
|
|
3846
4048
|
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
3847
4049
|
if (typeof window === "undefined") return;
|
|
4050
|
+
function isTransitionEvent(event) {
|
|
4051
|
+
return "propertyName" in event;
|
|
4052
|
+
}
|
|
3848
4053
|
let onTransitionStart = (e)=>{
|
|
4054
|
+
if (!isTransitionEvent(e) || !e.target) return;
|
|
3849
4055
|
// Add the transitioning property to the list for this element.
|
|
3850
4056
|
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
|
|
3851
4057
|
if (!transitions) {
|
|
@@ -3854,11 +4060,14 @@ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
|
3854
4060
|
// The transitioncancel event must be registered on the element itself, rather than as a global
|
|
3855
4061
|
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
|
|
3856
4062
|
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
|
|
3857
|
-
e.target.addEventListener("transitioncancel", onTransitionEnd
|
|
4063
|
+
e.target.addEventListener("transitioncancel", onTransitionEnd, {
|
|
4064
|
+
once: true
|
|
4065
|
+
});
|
|
3858
4066
|
}
|
|
3859
4067
|
transitions.add(e.propertyName);
|
|
3860
4068
|
};
|
|
3861
4069
|
let onTransitionEnd = (e)=>{
|
|
4070
|
+
if (!isTransitionEvent(e) || !e.target) return;
|
|
3862
4071
|
// Remove property from list of transitioning properties.
|
|
3863
4072
|
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
|
|
3864
4073
|
if (!properties) return;
|
|
@@ -3997,7 +4206,7 @@ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
|
|
|
3997
4206
|
if (context && context.ref && ref) {
|
|
3998
4207
|
context.ref.current = ref.current;
|
|
3999
4208
|
return ()=>{
|
|
4000
|
-
context.ref.current = null;
|
|
4209
|
+
if (context.ref) context.ref.current = null;
|
|
4001
4210
|
};
|
|
4002
4211
|
}
|
|
4003
4212
|
});
|
|
@@ -4151,6 +4360,7 @@ function _class_private_field_set(receiver, privateMap, value) {
|
|
|
4151
4360
|
|
|
4152
4361
|
|
|
4153
4362
|
|
|
4363
|
+
|
|
4154
4364
|
/*
|
|
4155
4365
|
* Copyright 2020 Adobe. All rights reserved.
|
|
4156
4366
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -4218,7 +4428,6 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
|
4218
4428
|
}
|
|
4219
4429
|
|
|
4220
4430
|
|
|
4221
|
-
|
|
4222
4431
|
/*
|
|
4223
4432
|
* Copyright 2020 Adobe. All rights reserved.
|
|
4224
4433
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -4369,8 +4578,13 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4369
4578
|
state.isPressed = true;
|
|
4370
4579
|
shouldStopPropagation = triggerPressStart(e, "keyboard");
|
|
4371
4580
|
// Focus may move before the key up event, so register the event on the document
|
|
4372
|
-
// instead of the same element where the key down event occurred.
|
|
4373
|
-
|
|
4581
|
+
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
4582
|
+
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
4583
|
+
let originalTarget = e.currentTarget;
|
|
4584
|
+
let pressUp = (e)=>{
|
|
4585
|
+
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && originalTarget.contains(e.target) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard");
|
|
4586
|
+
};
|
|
4587
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), "keyup", ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp), true);
|
|
4374
4588
|
}
|
|
4375
4589
|
if (shouldStopPropagation) e.stopPropagation();
|
|
4376
4590
|
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
|
|
@@ -4383,9 +4597,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4383
4597
|
if (e.metaKey && ($c87311424ea30a05$export$9ac100e40613ea10)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
|
|
4384
4598
|
} else if (e.key === "Meta") state.metaKeyEvents = new Map();
|
|
4385
4599
|
},
|
|
4386
|
-
onKeyUp (e) {
|
|
4387
|
-
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");
|
|
4388
|
-
},
|
|
4389
4600
|
onClick (e) {
|
|
4390
4601
|
if (e && !e.currentTarget.contains(e.target)) return;
|
|
4391
4602
|
if (e && e.button === 0 && !state.isTriggeringEvent && !($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) {
|
|
@@ -4413,9 +4624,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4413
4624
|
var _state_metaKeyEvents1;
|
|
4414
4625
|
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target, e.key)) e.preventDefault();
|
|
4415
4626
|
let target = e.target;
|
|
4416
|
-
|
|
4627
|
+
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard", state.target.contains(target));
|
|
4417
4628
|
removeAllGlobalListeners();
|
|
4418
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
4419
4629
|
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
4420
4630
|
// This means the link has a role override, and the default browser behavior
|
|
4421
4631
|
// only applies when using the Enter key.
|
|
@@ -4950,7 +5160,7 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
|
4950
5160
|
|
|
4951
5161
|
let $507fabe10e71c6fb$var$currentModality = null;
|
|
4952
5162
|
let $507fabe10e71c6fb$var$changeHandlers = new Set();
|
|
4953
|
-
let $507fabe10e71c6fb$
|
|
5163
|
+
let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
|
|
4954
5164
|
let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
|
|
4955
5165
|
let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
|
|
4956
5166
|
// Only Tab or Esc keys will make focus visible on text input elements
|
|
@@ -5009,39 +5219,82 @@ function $507fabe10e71c6fb$var$handleWindowBlur() {
|
|
|
5009
5219
|
}
|
|
5010
5220
|
/**
|
|
5011
5221
|
* Setup global event listeners to control when keyboard focus style should be visible.
|
|
5012
|
-
*/ function $507fabe10e71c6fb$var$setupGlobalFocusEvents() {
|
|
5013
|
-
if (typeof window === "undefined" || $507fabe10e71c6fb$
|
|
5222
|
+
*/ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
|
|
5223
|
+
if (typeof window === "undefined" || $507fabe10e71c6fb$export$d90243b58daecda7.get(($431fbd86ca7dc216$export$f21a1ffae260145a)(element))) return;
|
|
5224
|
+
const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
|
|
5225
|
+
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
5014
5226
|
// Programmatic focus() calls shouldn't affect the current input modality.
|
|
5015
5227
|
// However, we need to detect other cases when a focus event occurs without
|
|
5016
5228
|
// a preceding user event (e.g. screen reader focus). Overriding the focus
|
|
5017
5229
|
// method on HTMLElement.prototype is a bit hacky, but works.
|
|
5018
|
-
let focus = HTMLElement.prototype.focus;
|
|
5019
|
-
HTMLElement.prototype.focus = function() {
|
|
5230
|
+
let focus = windowObject.HTMLElement.prototype.focus;
|
|
5231
|
+
windowObject.HTMLElement.prototype.focus = function() {
|
|
5020
5232
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
5021
5233
|
focus.apply(this, arguments);
|
|
5022
5234
|
};
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5235
|
+
documentObject.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5236
|
+
documentObject.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5237
|
+
documentObject.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
|
|
5026
5238
|
// Register focus events on the window so they are sure to happen
|
|
5027
5239
|
// before React's event listeners (registered on the document).
|
|
5028
|
-
|
|
5029
|
-
|
|
5240
|
+
windowObject.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
|
|
5241
|
+
windowObject.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
|
|
5030
5242
|
if (typeof PointerEvent !== "undefined") {
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5243
|
+
documentObject.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5244
|
+
documentObject.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5245
|
+
documentObject.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5034
5246
|
} else {
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
}
|
|
5039
|
-
|
|
5247
|
+
documentObject.addEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5248
|
+
documentObject.addEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5249
|
+
documentObject.addEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5250
|
+
}
|
|
5251
|
+
// Add unmount handler
|
|
5252
|
+
windowObject.addEventListener("beforeunload", ()=>{
|
|
5253
|
+
$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
|
|
5254
|
+
}, {
|
|
5255
|
+
once: true
|
|
5256
|
+
});
|
|
5257
|
+
$507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
|
|
5258
|
+
focus: focus
|
|
5259
|
+
});
|
|
5040
5260
|
}
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5261
|
+
const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener)=>{
|
|
5262
|
+
const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
|
|
5263
|
+
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
5264
|
+
if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
|
|
5265
|
+
if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
|
|
5266
|
+
windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
|
|
5267
|
+
documentObject.removeEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5268
|
+
documentObject.removeEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
|
|
5269
|
+
documentObject.removeEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
|
|
5270
|
+
windowObject.removeEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
|
|
5271
|
+
windowObject.removeEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
|
|
5272
|
+
if (typeof PointerEvent !== "undefined") {
|
|
5273
|
+
documentObject.removeEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5274
|
+
documentObject.removeEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5275
|
+
documentObject.removeEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5276
|
+
} else {
|
|
5277
|
+
documentObject.removeEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5278
|
+
documentObject.removeEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5279
|
+
documentObject.removeEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
|
|
5280
|
+
}
|
|
5281
|
+
$507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
|
|
5282
|
+
};
|
|
5283
|
+
function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
|
|
5284
|
+
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
5285
|
+
let loadListener;
|
|
5286
|
+
if (documentObject.readyState !== "loading") $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
|
|
5287
|
+
else {
|
|
5288
|
+
loadListener = ()=>{
|
|
5289
|
+
$507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
|
|
5290
|
+
};
|
|
5291
|
+
documentObject.addEventListener("DOMContentLoaded", loadListener);
|
|
5292
|
+
}
|
|
5293
|
+
return ()=>$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
|
|
5044
5294
|
}
|
|
5295
|
+
// Server-side rendering does not have the document object defined
|
|
5296
|
+
// eslint-disable-next-line no-restricted-globals
|
|
5297
|
+
if (typeof document !== "undefined") $507fabe10e71c6fb$export$2f1888112f558a7d();
|
|
5045
5298
|
function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
|
|
5046
5299
|
return $507fabe10e71c6fb$var$currentModality !== "pointer";
|
|
5047
5300
|
}
|
|
@@ -5068,8 +5321,12 @@ const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
|
|
|
5068
5321
|
* focus visible style can be properly set.
|
|
5069
5322
|
*/ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
|
|
5070
5323
|
var _e_target;
|
|
5071
|
-
|
|
5072
|
-
|
|
5324
|
+
const IHTMLInputElement = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
|
|
5325
|
+
const IHTMLTextAreaElement = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
|
|
5326
|
+
const IHTMLElement = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
|
|
5327
|
+
const IKeyboardEvent = typeof window !== "undefined" ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
|
|
5328
|
+
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);
|
|
5329
|
+
return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
|
|
5073
5330
|
}
|
|
5074
5331
|
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
5075
5332
|
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
|
|
@@ -5775,7 +6032,7 @@ function IconButton(props) {
|
|
|
5775
6032
|
// @ts-ignore
|
|
5776
6033
|
buttonEl);
|
|
5777
6034
|
const { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f();
|
|
5778
|
-
const commonProps = Object.assign(Object.assign(Object.assign({ 'aria-disabled': busy, className:
|
|
6035
|
+
const commonProps = Object.assign(Object.assign(Object.assign({ 'aria-disabled': busy, className: y(iconSide, size, variant, className, {
|
|
5779
6036
|
'focus-visible': isFocusVisible,
|
|
5780
6037
|
busy,
|
|
5781
6038
|
disabled: isLink && isDisabled,
|
|
@@ -5784,7 +6041,7 @@ function IconButton(props) {
|
|
|
5784
6041
|
marginTop: `${adjustAlignment}px`,
|
|
5785
6042
|
marginBottom: `${Math.abs(adjustAlignment)}px`,
|
|
5786
6043
|
marginRight: `${spacings.xs}`,
|
|
5787
|
-
} })) : (jsxRuntime$1.jsx(Icon, { className:
|
|
6044
|
+
} })) : (jsxRuntime$1.jsx(Icon, { className: y({ 'right-margin': label }), name: iconName }));
|
|
5788
6045
|
const labelElement = label ? (jsxRuntime$1.jsx("span", { style: { marginTop: `${adjustAlignment}px` }, children: label })) : null;
|
|
5789
6046
|
if (isLink && !isDisabled) {
|
|
5790
6047
|
return (
|
|
@@ -5867,7 +6124,7 @@ function EditableInput(props) {
|
|
|
5867
6124
|
setInitialValue(editableEl.current.innerText);
|
|
5868
6125
|
}
|
|
5869
6126
|
}, []);
|
|
5870
|
-
return (jsxRuntime$1.jsxs(StyledEditableInput, { className:
|
|
6127
|
+
return (jsxRuntime$1.jsxs(StyledEditableInput, { className: y('EditableInput-container', id, className), "data-cy": props['data-cy'], id: props.id, children: [jsxRuntime$1.jsx("span", { role: "textbox", tabIndex: 0, contentEditable: true, suppressContentEditableWarning: true, ref: editableEl, onKeyDown: handleKeypress, onBlur: handleBlur, children: children }), jsxRuntime$1.jsx(Icon, { name: "fa-pencil-alt", className: "pencil-icon" })] }));
|
|
5871
6128
|
}
|
|
5872
6129
|
|
|
5873
6130
|
const inputCommon = styled.css `
|
|
@@ -6049,7 +6306,7 @@ function NumberInput(props) {
|
|
|
6049
6306
|
}, 1000);
|
|
6050
6307
|
return () => clearTimeout(delayDebounceFn);
|
|
6051
6308
|
}, [currentValue]);
|
|
6052
|
-
return (jsxRuntime$1.jsxs(StyledNumberField, { className:
|
|
6309
|
+
return (jsxRuntime$1.jsxs(StyledNumberField, { className: y(className, {
|
|
6053
6310
|
hiddenLabel,
|
|
6054
6311
|
}), "data-cy": props['data-cy'], id: id, children: [jsxRuntime$1.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 && jsxRuntime$1.jsx("label", { htmlFor: fieldId, children: label }), jsxRuntime$1.jsxs("div", { className: "spin-buttons", children: [jsxRuntime$1.jsx(Button$1, { variant: "no-style", onClick: increment, tabindex: -1, children: jsxRuntime$1.jsx(Icon, { name: "fa-caret-up", ariaLabel: "increase" }) }), jsxRuntime$1.jsx(Button$1, { variant: "no-style", onClick: decrement, tabindex: -1, children: jsxRuntime$1.jsx(Icon, { name: "fa-caret-down", ariaLabel: "decrease" }) })] })] }));
|
|
6055
6312
|
}
|
|
@@ -6103,7 +6360,7 @@ const StyledSearchField = styled__default.default.div `
|
|
|
6103
6360
|
const SearchInput = (props) => {
|
|
6104
6361
|
const { id, border, showSearchIcon, showClearInputIcon, className, inputProps, onChange, onClear, onKeyUp, placeholder, value, } = props;
|
|
6105
6362
|
const getId = id ? id : v4();
|
|
6106
|
-
return (jsxRuntime$1.jsxs(StyledSearchField, { className:
|
|
6363
|
+
return (jsxRuntime$1.jsxs(StyledSearchField, { className: y(className, {
|
|
6107
6364
|
border,
|
|
6108
6365
|
showSearchIcon,
|
|
6109
6366
|
showClearInputIcon,
|
|
@@ -6181,7 +6438,7 @@ function TextInput(props) {
|
|
|
6181
6438
|
const inputId = v4();
|
|
6182
6439
|
const { autoComplete, autoFocus, className, defaultValue, disabled, displayErrors, id, inputProps, label, maxLength, name, onBlur, onChange, onFocus, placeholder, promptProps, required, type = 'text', validationErrors, value, readOnly, } = props;
|
|
6183
6440
|
const errorClass = displayErrors ? 'error' : 'prompt';
|
|
6184
|
-
return (jsxRuntime$1.jsxs(StyledTextInput, { className: className, "data-cy": props['data-cy'], id: id, children: [jsxRuntime$1.jsx("input", Object.assign({ autoComplete: autoComplete, autoFocus: autoFocus, className:
|
|
6441
|
+
return (jsxRuntime$1.jsxs(StyledTextInput, { className: className, "data-cy": props['data-cy'], id: id, children: [jsxRuntime$1.jsx("input", Object.assign({ autoComplete: autoComplete, autoFocus: autoFocus, className: y('text-input__input-element', {
|
|
6185
6442
|
filled: (value && value.length > 0) || defaultValue,
|
|
6186
6443
|
}), disabled: disabled, defaultValue: defaultValue, id: inputId, maxLength: maxLength, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyUp: (e) => {
|
|
6187
6444
|
if (e.key === 'Enter') {
|
|
@@ -6189,7 +6446,7 @@ function TextInput(props) {
|
|
|
6189
6446
|
}
|
|
6190
6447
|
}, placeholder: placeholder, required: required, type: type, value: value, readOnly: readOnly }, inputProps)), label ? jsxRuntime$1.jsx("label", { htmlFor: inputId, children: label }) : null, (validationErrors || maxLength) && (jsxRuntime$1.jsxs(StyledInputInfo, { children: [validationErrors && (jsxRuntime$1.jsx("div", { children: validationErrors.map((err, i) => {
|
|
6191
6448
|
return (jsxRuntime$1.jsx("p", Object.assign({ className: errorClass }, promptProps, { children: err }), i));
|
|
6192
|
-
}) })), maxLength && (jsxRuntime$1.jsxs("div", { className:
|
|
6449
|
+
}) })), maxLength && (jsxRuntime$1.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] }))] }))] }));
|
|
6193
6450
|
}
|
|
6194
6451
|
|
|
6195
6452
|
/*
|
|
@@ -7090,7 +7347,7 @@ function RadioGroup$1(props) {
|
|
|
7090
7347
|
};
|
|
7091
7348
|
const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(radioGroupState);
|
|
7092
7349
|
const { radioGroupProps, labelProps } = $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state);
|
|
7093
|
-
return (jsxRuntime$1.jsxs(StyledRadioGroup$1, Object.assign({}, radioGroupProps, { className:
|
|
7350
|
+
return (jsxRuntime$1.jsxs(StyledRadioGroup$1, Object.assign({}, radioGroupProps, { className: y(className, { horizontal: orientation === 'horizontal' }), "data-cy": props['data-cy'], id: id, children: [label && (jsxRuntime$1.jsx("div", Object.assign({ className: "groupLabel" }, labelProps, { children: label }))), jsxRuntime$1.jsx(RadioContext.Provider, { value: state, children: children })] })));
|
|
7094
7351
|
}
|
|
7095
7352
|
/**
|
|
7096
7353
|
* A single radio button and its label; no styling is applied, and the native
|
|
@@ -7110,7 +7367,7 @@ function Radio$1(props) {
|
|
|
7110
7367
|
else {
|
|
7111
7368
|
isSelected = state.selectedValue === props.value;
|
|
7112
7369
|
}
|
|
7113
|
-
return (jsxRuntime$1.jsxs("label", { className:
|
|
7370
|
+
return (jsxRuntime$1.jsxs("label", { className: y(className, {
|
|
7114
7371
|
disabled: isDisabled || state.isDisabled,
|
|
7115
7372
|
selected: isSelected,
|
|
7116
7373
|
focused: isFocusVisible,
|
|
@@ -7778,7 +8035,7 @@ function addYears(date, amount) {
|
|
|
7778
8035
|
* ])
|
|
7779
8036
|
* //=> Sun Jul 02 1995 00:00:00
|
|
7780
8037
|
*/
|
|
7781
|
-
function max$
|
|
8038
|
+
function max$2(dates) {
|
|
7782
8039
|
let result;
|
|
7783
8040
|
dates.forEach(function (dirtyDate) {
|
|
7784
8041
|
const currentDate = toDate(dirtyDate);
|
|
@@ -7819,7 +8076,7 @@ function max$1(dates) {
|
|
|
7819
8076
|
* ])
|
|
7820
8077
|
* //=> Wed Feb 11 1987 00:00:00
|
|
7821
8078
|
*/
|
|
7822
|
-
function min$
|
|
8079
|
+
function min$2(dates) {
|
|
7823
8080
|
let result;
|
|
7824
8081
|
|
|
7825
8082
|
dates.forEach((dirtyDate) => {
|
|
@@ -19184,10 +19441,10 @@ function getNextFocus(focusedDay, options) {
|
|
|
19184
19441
|
};
|
|
19185
19442
|
var newFocusedDay = moveFns[moveBy](focusedDay, direction === 'after' ? 1 : -1);
|
|
19186
19443
|
if (direction === 'before' && fromDate) {
|
|
19187
|
-
newFocusedDay = max$
|
|
19444
|
+
newFocusedDay = max$2([fromDate, newFocusedDay]);
|
|
19188
19445
|
}
|
|
19189
19446
|
else if (direction === 'after' && toDate) {
|
|
19190
|
-
newFocusedDay = min$
|
|
19447
|
+
newFocusedDay = min$2([toDate, newFocusedDay]);
|
|
19191
19448
|
}
|
|
19192
19449
|
var isFocusable = true;
|
|
19193
19450
|
if (modifiers) {
|
|
@@ -20106,11 +20363,11 @@ var write = 'write';
|
|
|
20106
20363
|
var afterWrite = 'afterWrite';
|
|
20107
20364
|
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
20108
20365
|
|
|
20109
|
-
function getNodeName(element) {
|
|
20366
|
+
function getNodeName$1(element) {
|
|
20110
20367
|
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
20111
20368
|
}
|
|
20112
20369
|
|
|
20113
|
-
function getWindow(node) {
|
|
20370
|
+
function getWindow$1(node) {
|
|
20114
20371
|
if (node == null) {
|
|
20115
20372
|
return window;
|
|
20116
20373
|
}
|
|
@@ -20123,23 +20380,23 @@ function getWindow(node) {
|
|
|
20123
20380
|
return node;
|
|
20124
20381
|
}
|
|
20125
20382
|
|
|
20126
|
-
function isElement(node) {
|
|
20127
|
-
var OwnElement = getWindow(node).Element;
|
|
20383
|
+
function isElement$1(node) {
|
|
20384
|
+
var OwnElement = getWindow$1(node).Element;
|
|
20128
20385
|
return node instanceof OwnElement || node instanceof Element;
|
|
20129
20386
|
}
|
|
20130
20387
|
|
|
20131
|
-
function isHTMLElement(node) {
|
|
20132
|
-
var OwnElement = getWindow(node).HTMLElement;
|
|
20388
|
+
function isHTMLElement$1(node) {
|
|
20389
|
+
var OwnElement = getWindow$1(node).HTMLElement;
|
|
20133
20390
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
20134
20391
|
}
|
|
20135
20392
|
|
|
20136
|
-
function isShadowRoot(node) {
|
|
20393
|
+
function isShadowRoot$1(node) {
|
|
20137
20394
|
// IE 11 has no ShadowRoot
|
|
20138
20395
|
if (typeof ShadowRoot === 'undefined') {
|
|
20139
20396
|
return false;
|
|
20140
20397
|
}
|
|
20141
20398
|
|
|
20142
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
|
20399
|
+
var OwnElement = getWindow$1(node).ShadowRoot;
|
|
20143
20400
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
20144
20401
|
}
|
|
20145
20402
|
|
|
@@ -20152,7 +20409,7 @@ function applyStyles(_ref) {
|
|
|
20152
20409
|
var attributes = state.attributes[name] || {};
|
|
20153
20410
|
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
20154
20411
|
|
|
20155
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
20412
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
20156
20413
|
return;
|
|
20157
20414
|
} // Flow doesn't support to extend this property, but it's the most
|
|
20158
20415
|
// effective way to apply styles to an HTMLElement
|
|
@@ -20204,7 +20461,7 @@ function effect$2(_ref2) {
|
|
|
20204
20461
|
return style;
|
|
20205
20462
|
}, {}); // arrow is optional + virtual elements
|
|
20206
20463
|
|
|
20207
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
20464
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
20208
20465
|
return;
|
|
20209
20466
|
}
|
|
20210
20467
|
|
|
@@ -20230,9 +20487,9 @@ function getBasePlacement(placement) {
|
|
|
20230
20487
|
return placement.split('-')[0];
|
|
20231
20488
|
}
|
|
20232
20489
|
|
|
20233
|
-
var max = Math.max;
|
|
20234
|
-
var min = Math.min;
|
|
20235
|
-
var round = Math.round;
|
|
20490
|
+
var max$1 = Math.max;
|
|
20491
|
+
var min$1 = Math.min;
|
|
20492
|
+
var round$1 = Math.round;
|
|
20236
20493
|
|
|
20237
20494
|
function getUAString() {
|
|
20238
20495
|
var uaData = navigator.userAgentData;
|
|
@@ -20250,7 +20507,7 @@ function isLayoutViewport() {
|
|
|
20250
20507
|
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
20251
20508
|
}
|
|
20252
20509
|
|
|
20253
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
20510
|
+
function getBoundingClientRect$1(element, includeScale, isFixedStrategy) {
|
|
20254
20511
|
if (includeScale === void 0) {
|
|
20255
20512
|
includeScale = false;
|
|
20256
20513
|
}
|
|
@@ -20263,12 +20520,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
20263
20520
|
var scaleX = 1;
|
|
20264
20521
|
var scaleY = 1;
|
|
20265
20522
|
|
|
20266
|
-
if (includeScale && isHTMLElement(element)) {
|
|
20267
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
20268
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
20523
|
+
if (includeScale && isHTMLElement$1(element)) {
|
|
20524
|
+
scaleX = element.offsetWidth > 0 ? round$1(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
20525
|
+
scaleY = element.offsetHeight > 0 ? round$1(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
20269
20526
|
}
|
|
20270
20527
|
|
|
20271
|
-
var _ref = isElement(element) ? getWindow(element) : window,
|
|
20528
|
+
var _ref = isElement$1(element) ? getWindow$1(element) : window,
|
|
20272
20529
|
visualViewport = _ref.visualViewport;
|
|
20273
20530
|
|
|
20274
20531
|
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
@@ -20291,7 +20548,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
20291
20548
|
// means it doesn't take into account transforms.
|
|
20292
20549
|
|
|
20293
20550
|
function getLayoutRect(element) {
|
|
20294
|
-
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
20551
|
+
var clientRect = getBoundingClientRect$1(element); // Use the clientRect sizes if it's not been transformed.
|
|
20295
20552
|
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
20296
20553
|
|
|
20297
20554
|
var width = element.offsetWidth;
|
|
@@ -20319,7 +20576,7 @@ function contains(parent, child) {
|
|
|
20319
20576
|
if (parent.contains(child)) {
|
|
20320
20577
|
return true;
|
|
20321
20578
|
} // then fallback to custom implementation with Shadow DOM support
|
|
20322
|
-
else if (rootNode && isShadowRoot(rootNode)) {
|
|
20579
|
+
else if (rootNode && isShadowRoot$1(rootNode)) {
|
|
20323
20580
|
var next = child;
|
|
20324
20581
|
|
|
20325
20582
|
do {
|
|
@@ -20336,22 +20593,22 @@ function contains(parent, child) {
|
|
|
20336
20593
|
return false;
|
|
20337
20594
|
}
|
|
20338
20595
|
|
|
20339
|
-
function getComputedStyle$
|
|
20340
|
-
return getWindow(element).getComputedStyle(element);
|
|
20596
|
+
function getComputedStyle$2(element) {
|
|
20597
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
20341
20598
|
}
|
|
20342
20599
|
|
|
20343
|
-
function isTableElement(element) {
|
|
20344
|
-
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
|
20600
|
+
function isTableElement$1(element) {
|
|
20601
|
+
return ['table', 'td', 'th'].indexOf(getNodeName$1(element)) >= 0;
|
|
20345
20602
|
}
|
|
20346
20603
|
|
|
20347
|
-
function getDocumentElement(element) {
|
|
20604
|
+
function getDocumentElement$1(element) {
|
|
20348
20605
|
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
20349
|
-
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
20606
|
+
return ((isElement$1(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
20350
20607
|
element.document) || window.document).documentElement;
|
|
20351
20608
|
}
|
|
20352
20609
|
|
|
20353
|
-
function getParentNode(element) {
|
|
20354
|
-
if (getNodeName(element) === 'html') {
|
|
20610
|
+
function getParentNode$1(element) {
|
|
20611
|
+
if (getNodeName$1(element) === 'html') {
|
|
20355
20612
|
return element;
|
|
20356
20613
|
}
|
|
20357
20614
|
|
|
@@ -20360,16 +20617,16 @@ function getParentNode(element) {
|
|
|
20360
20617
|
// $FlowFixMe[prop-missing]
|
|
20361
20618
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
20362
20619
|
element.parentNode || ( // DOM Element detected
|
|
20363
|
-
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
20620
|
+
isShadowRoot$1(element) ? element.host : null) || // ShadowRoot detected
|
|
20364
20621
|
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
20365
|
-
getDocumentElement(element) // fallback
|
|
20622
|
+
getDocumentElement$1(element) // fallback
|
|
20366
20623
|
|
|
20367
20624
|
);
|
|
20368
20625
|
}
|
|
20369
20626
|
|
|
20370
|
-
function getTrueOffsetParent(element) {
|
|
20371
|
-
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
20372
|
-
getComputedStyle$
|
|
20627
|
+
function getTrueOffsetParent$1(element) {
|
|
20628
|
+
if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
20629
|
+
getComputedStyle$2(element).position === 'fixed') {
|
|
20373
20630
|
return null;
|
|
20374
20631
|
}
|
|
20375
20632
|
|
|
@@ -20378,27 +20635,27 @@ function getTrueOffsetParent(element) {
|
|
|
20378
20635
|
// return the containing block
|
|
20379
20636
|
|
|
20380
20637
|
|
|
20381
|
-
function getContainingBlock(element) {
|
|
20638
|
+
function getContainingBlock$1(element) {
|
|
20382
20639
|
var isFirefox = /firefox/i.test(getUAString());
|
|
20383
20640
|
var isIE = /Trident/i.test(getUAString());
|
|
20384
20641
|
|
|
20385
|
-
if (isIE && isHTMLElement(element)) {
|
|
20642
|
+
if (isIE && isHTMLElement$1(element)) {
|
|
20386
20643
|
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
20387
|
-
var elementCss = getComputedStyle$
|
|
20644
|
+
var elementCss = getComputedStyle$2(element);
|
|
20388
20645
|
|
|
20389
20646
|
if (elementCss.position === 'fixed') {
|
|
20390
20647
|
return null;
|
|
20391
20648
|
}
|
|
20392
20649
|
}
|
|
20393
20650
|
|
|
20394
|
-
var currentNode = getParentNode(element);
|
|
20651
|
+
var currentNode = getParentNode$1(element);
|
|
20395
20652
|
|
|
20396
|
-
if (isShadowRoot(currentNode)) {
|
|
20653
|
+
if (isShadowRoot$1(currentNode)) {
|
|
20397
20654
|
currentNode = currentNode.host;
|
|
20398
20655
|
}
|
|
20399
20656
|
|
|
20400
|
-
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
20401
|
-
var css = getComputedStyle$
|
|
20657
|
+
while (isHTMLElement$1(currentNode) && ['html', 'body'].indexOf(getNodeName$1(currentNode)) < 0) {
|
|
20658
|
+
var css = getComputedStyle$2(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
20402
20659
|
// create a containing block.
|
|
20403
20660
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
20404
20661
|
|
|
@@ -20414,27 +20671,27 @@ function getContainingBlock(element) {
|
|
|
20414
20671
|
// such as table ancestors and cross browser bugs.
|
|
20415
20672
|
|
|
20416
20673
|
|
|
20417
|
-
function getOffsetParent(element) {
|
|
20418
|
-
var window = getWindow(element);
|
|
20419
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
20674
|
+
function getOffsetParent$1(element) {
|
|
20675
|
+
var window = getWindow$1(element);
|
|
20676
|
+
var offsetParent = getTrueOffsetParent$1(element);
|
|
20420
20677
|
|
|
20421
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$
|
|
20422
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
20678
|
+
while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle$2(offsetParent).position === 'static') {
|
|
20679
|
+
offsetParent = getTrueOffsetParent$1(offsetParent);
|
|
20423
20680
|
}
|
|
20424
20681
|
|
|
20425
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$
|
|
20682
|
+
if (offsetParent && (getNodeName$1(offsetParent) === 'html' || getNodeName$1(offsetParent) === 'body' && getComputedStyle$2(offsetParent).position === 'static')) {
|
|
20426
20683
|
return window;
|
|
20427
20684
|
}
|
|
20428
20685
|
|
|
20429
|
-
return offsetParent || getContainingBlock(element) || window;
|
|
20686
|
+
return offsetParent || getContainingBlock$1(element) || window;
|
|
20430
20687
|
}
|
|
20431
20688
|
|
|
20432
20689
|
function getMainAxisFromPlacement(placement) {
|
|
20433
20690
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
20434
20691
|
}
|
|
20435
20692
|
|
|
20436
|
-
function within(min
|
|
20437
|
-
return max(min
|
|
20693
|
+
function within(min, value, max) {
|
|
20694
|
+
return max$1(min, min$1(value, max));
|
|
20438
20695
|
}
|
|
20439
20696
|
function withinMaxClamp(min, value, max) {
|
|
20440
20697
|
var v = within(min, value, max);
|
|
@@ -20468,7 +20725,7 @@ var toPaddingObject = function toPaddingObject(padding, state) {
|
|
|
20468
20725
|
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
20469
20726
|
};
|
|
20470
20727
|
|
|
20471
|
-
function arrow(_ref) {
|
|
20728
|
+
function arrow$2(_ref) {
|
|
20472
20729
|
var _state$modifiersData$;
|
|
20473
20730
|
|
|
20474
20731
|
var state = _ref.state,
|
|
@@ -20491,7 +20748,7 @@ function arrow(_ref) {
|
|
|
20491
20748
|
var maxProp = axis === 'y' ? bottom : right;
|
|
20492
20749
|
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
20493
20750
|
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
20494
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
20751
|
+
var arrowOffsetParent = getOffsetParent$1(arrowElement);
|
|
20495
20752
|
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
20496
20753
|
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
20497
20754
|
// outside of the popper bounds
|
|
@@ -20532,11 +20789,11 @@ function effect$1(_ref2) {
|
|
|
20532
20789
|
} // eslint-disable-next-line import/no-unused-modules
|
|
20533
20790
|
|
|
20534
20791
|
|
|
20535
|
-
var arrow$
|
|
20792
|
+
var arrow$3 = {
|
|
20536
20793
|
name: 'arrow',
|
|
20537
20794
|
enabled: true,
|
|
20538
20795
|
phase: 'main',
|
|
20539
|
-
fn: arrow,
|
|
20796
|
+
fn: arrow$2,
|
|
20540
20797
|
effect: effect$1,
|
|
20541
20798
|
requires: ['popperOffsets'],
|
|
20542
20799
|
requiresIfExists: ['preventOverflow']
|
|
@@ -20560,8 +20817,8 @@ function roundOffsetsByDPR(_ref, win) {
|
|
|
20560
20817
|
y = _ref.y;
|
|
20561
20818
|
var dpr = win.devicePixelRatio || 1;
|
|
20562
20819
|
return {
|
|
20563
|
-
x: round(x * dpr) / dpr || 0,
|
|
20564
|
-
y: round(y * dpr) / dpr || 0
|
|
20820
|
+
x: round$1(x * dpr) / dpr || 0,
|
|
20821
|
+
y: round$1(y * dpr) / dpr || 0
|
|
20565
20822
|
};
|
|
20566
20823
|
}
|
|
20567
20824
|
|
|
@@ -20600,14 +20857,14 @@ function mapToStyles(_ref2) {
|
|
|
20600
20857
|
var win = window;
|
|
20601
20858
|
|
|
20602
20859
|
if (adaptive) {
|
|
20603
|
-
var offsetParent = getOffsetParent(popper);
|
|
20860
|
+
var offsetParent = getOffsetParent$1(popper);
|
|
20604
20861
|
var heightProp = 'clientHeight';
|
|
20605
20862
|
var widthProp = 'clientWidth';
|
|
20606
20863
|
|
|
20607
|
-
if (offsetParent === getWindow(popper)) {
|
|
20608
|
-
offsetParent = getDocumentElement(popper);
|
|
20864
|
+
if (offsetParent === getWindow$1(popper)) {
|
|
20865
|
+
offsetParent = getDocumentElement$1(popper);
|
|
20609
20866
|
|
|
20610
|
-
if (getComputedStyle$
|
|
20867
|
+
if (getComputedStyle$2(offsetParent).position !== 'static' && position === 'absolute') {
|
|
20611
20868
|
heightProp = 'scrollHeight';
|
|
20612
20869
|
widthProp = 'scrollWidth';
|
|
20613
20870
|
}
|
|
@@ -20640,7 +20897,7 @@ function mapToStyles(_ref2) {
|
|
|
20640
20897
|
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
20641
20898
|
x: x,
|
|
20642
20899
|
y: y
|
|
20643
|
-
}, getWindow(popper)) : {
|
|
20900
|
+
}, getWindow$1(popper)) : {
|
|
20644
20901
|
x: x,
|
|
20645
20902
|
y: y
|
|
20646
20903
|
};
|
|
@@ -20719,7 +20976,7 @@ function effect(_ref) {
|
|
|
20719
20976
|
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
20720
20977
|
_options$resize = options.resize,
|
|
20721
20978
|
resize = _options$resize === void 0 ? true : _options$resize;
|
|
20722
|
-
var window = getWindow(state.elements.popper);
|
|
20979
|
+
var window = getWindow$1(state.elements.popper);
|
|
20723
20980
|
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
20724
20981
|
|
|
20725
20982
|
if (scroll) {
|
|
@@ -20761,7 +21018,7 @@ var hash$1 = {
|
|
|
20761
21018
|
bottom: 'top',
|
|
20762
21019
|
top: 'bottom'
|
|
20763
21020
|
};
|
|
20764
|
-
function getOppositePlacement(placement) {
|
|
21021
|
+
function getOppositePlacement$1(placement) {
|
|
20765
21022
|
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
20766
21023
|
return hash$1[matched];
|
|
20767
21024
|
});
|
|
@@ -20778,7 +21035,7 @@ function getOppositeVariationPlacement(placement) {
|
|
|
20778
21035
|
}
|
|
20779
21036
|
|
|
20780
21037
|
function getWindowScroll(node) {
|
|
20781
|
-
var win = getWindow(node);
|
|
21038
|
+
var win = getWindow$1(node);
|
|
20782
21039
|
var scrollLeft = win.pageXOffset;
|
|
20783
21040
|
var scrollTop = win.pageYOffset;
|
|
20784
21041
|
return {
|
|
@@ -20787,7 +21044,7 @@ function getWindowScroll(node) {
|
|
|
20787
21044
|
};
|
|
20788
21045
|
}
|
|
20789
21046
|
|
|
20790
|
-
function getWindowScrollBarX(element) {
|
|
21047
|
+
function getWindowScrollBarX$1(element) {
|
|
20791
21048
|
// If <html> has a CSS width greater than the viewport, then this will be
|
|
20792
21049
|
// incorrect for RTL.
|
|
20793
21050
|
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
@@ -20795,12 +21052,12 @@ function getWindowScrollBarX(element) {
|
|
|
20795
21052
|
// anyway.
|
|
20796
21053
|
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
20797
21054
|
// this (e.g. Edge 2019, IE11, Safari)
|
|
20798
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
21055
|
+
return getBoundingClientRect$1(getDocumentElement$1(element)).left + getWindowScroll(element).scrollLeft;
|
|
20799
21056
|
}
|
|
20800
21057
|
|
|
20801
|
-
function getViewportRect(element, strategy) {
|
|
20802
|
-
var win = getWindow(element);
|
|
20803
|
-
var html = getDocumentElement(element);
|
|
21058
|
+
function getViewportRect$1(element, strategy) {
|
|
21059
|
+
var win = getWindow$1(element);
|
|
21060
|
+
var html = getDocumentElement$1(element);
|
|
20804
21061
|
var visualViewport = win.visualViewport;
|
|
20805
21062
|
var width = html.clientWidth;
|
|
20806
21063
|
var height = html.clientHeight;
|
|
@@ -20821,26 +21078,26 @@ function getViewportRect(element, strategy) {
|
|
|
20821
21078
|
return {
|
|
20822
21079
|
width: width,
|
|
20823
21080
|
height: height,
|
|
20824
|
-
x: x + getWindowScrollBarX(element),
|
|
21081
|
+
x: x + getWindowScrollBarX$1(element),
|
|
20825
21082
|
y: y
|
|
20826
21083
|
};
|
|
20827
21084
|
}
|
|
20828
21085
|
|
|
20829
21086
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
20830
21087
|
|
|
20831
|
-
function getDocumentRect(element) {
|
|
21088
|
+
function getDocumentRect$1(element) {
|
|
20832
21089
|
var _element$ownerDocumen;
|
|
20833
21090
|
|
|
20834
|
-
var html = getDocumentElement(element);
|
|
21091
|
+
var html = getDocumentElement$1(element);
|
|
20835
21092
|
var winScroll = getWindowScroll(element);
|
|
20836
21093
|
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
20837
|
-
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
20838
|
-
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
20839
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
21094
|
+
var width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
21095
|
+
var height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
21096
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX$1(element);
|
|
20840
21097
|
var y = -winScroll.scrollTop;
|
|
20841
21098
|
|
|
20842
|
-
if (getComputedStyle$
|
|
20843
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
21099
|
+
if (getComputedStyle$2(body || html).direction === 'rtl') {
|
|
21100
|
+
x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
20844
21101
|
}
|
|
20845
21102
|
|
|
20846
21103
|
return {
|
|
@@ -20853,7 +21110,7 @@ function getDocumentRect(element) {
|
|
|
20853
21110
|
|
|
20854
21111
|
function isScrollParent(element) {
|
|
20855
21112
|
// Firefox wants us to check `-x` and `-y` variations as well
|
|
20856
|
-
var _getComputedStyle = getComputedStyle$
|
|
21113
|
+
var _getComputedStyle = getComputedStyle$2(element),
|
|
20857
21114
|
overflow = _getComputedStyle.overflow,
|
|
20858
21115
|
overflowX = _getComputedStyle.overflowX,
|
|
20859
21116
|
overflowY = _getComputedStyle.overflowY;
|
|
@@ -20862,16 +21119,16 @@ function isScrollParent(element) {
|
|
|
20862
21119
|
}
|
|
20863
21120
|
|
|
20864
21121
|
function getScrollParent(node) {
|
|
20865
|
-
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
21122
|
+
if (['html', 'body', '#document'].indexOf(getNodeName$1(node)) >= 0) {
|
|
20866
21123
|
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
20867
21124
|
return node.ownerDocument.body;
|
|
20868
21125
|
}
|
|
20869
21126
|
|
|
20870
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
21127
|
+
if (isHTMLElement$1(node) && isScrollParent(node)) {
|
|
20871
21128
|
return node;
|
|
20872
21129
|
}
|
|
20873
21130
|
|
|
20874
|
-
return getScrollParent(getParentNode(node));
|
|
21131
|
+
return getScrollParent(getParentNode$1(node));
|
|
20875
21132
|
}
|
|
20876
21133
|
|
|
20877
21134
|
/*
|
|
@@ -20890,14 +21147,14 @@ function listScrollParents(element, list) {
|
|
|
20890
21147
|
|
|
20891
21148
|
var scrollParent = getScrollParent(element);
|
|
20892
21149
|
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
20893
|
-
var win = getWindow(scrollParent);
|
|
21150
|
+
var win = getWindow$1(scrollParent);
|
|
20894
21151
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
20895
21152
|
var updatedList = list.concat(target);
|
|
20896
21153
|
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
20897
|
-
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
21154
|
+
updatedList.concat(listScrollParents(getParentNode$1(target)));
|
|
20898
21155
|
}
|
|
20899
21156
|
|
|
20900
|
-
function rectToClientRect(rect) {
|
|
21157
|
+
function rectToClientRect$1(rect) {
|
|
20901
21158
|
return Object.assign({}, rect, {
|
|
20902
21159
|
left: rect.x,
|
|
20903
21160
|
top: rect.y,
|
|
@@ -20906,8 +21163,8 @@ function rectToClientRect(rect) {
|
|
|
20906
21163
|
});
|
|
20907
21164
|
}
|
|
20908
21165
|
|
|
20909
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
20910
|
-
var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
21166
|
+
function getInnerBoundingClientRect$1(element, strategy) {
|
|
21167
|
+
var rect = getBoundingClientRect$1(element, false, strategy === 'fixed');
|
|
20911
21168
|
rect.top = rect.top + element.clientTop;
|
|
20912
21169
|
rect.left = rect.left + element.clientLeft;
|
|
20913
21170
|
rect.bottom = rect.top + element.clientHeight;
|
|
@@ -20920,39 +21177,39 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
20920
21177
|
}
|
|
20921
21178
|
|
|
20922
21179
|
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
20923
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
21180
|
+
return clippingParent === viewport ? rectToClientRect$1(getViewportRect$1(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect$1(clippingParent, strategy) : rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(element)));
|
|
20924
21181
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
20925
21182
|
// clipping (or hiding) overflowing elements with a position different from
|
|
20926
21183
|
// `initial`
|
|
20927
21184
|
|
|
20928
21185
|
|
|
20929
21186
|
function getClippingParents(element) {
|
|
20930
|
-
var clippingParents = listScrollParents(getParentNode(element));
|
|
20931
|
-
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$
|
|
20932
|
-
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
21187
|
+
var clippingParents = listScrollParents(getParentNode$1(element));
|
|
21188
|
+
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$2(element).position) >= 0;
|
|
21189
|
+
var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent$1(element) : element;
|
|
20933
21190
|
|
|
20934
|
-
if (!isElement(clipperElement)) {
|
|
21191
|
+
if (!isElement$1(clipperElement)) {
|
|
20935
21192
|
return [];
|
|
20936
21193
|
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
20937
21194
|
|
|
20938
21195
|
|
|
20939
21196
|
return clippingParents.filter(function (clippingParent) {
|
|
20940
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
21197
|
+
return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName$1(clippingParent) !== 'body';
|
|
20941
21198
|
});
|
|
20942
21199
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
20943
21200
|
// clipping parents
|
|
20944
21201
|
|
|
20945
21202
|
|
|
20946
|
-
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
21203
|
+
function getClippingRect$1(element, boundary, rootBoundary, strategy) {
|
|
20947
21204
|
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
|
20948
21205
|
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
|
20949
21206
|
var firstClippingParent = clippingParents[0];
|
|
20950
21207
|
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
20951
21208
|
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
20952
|
-
accRect.top = max(rect.top, accRect.top);
|
|
20953
|
-
accRect.right = min(rect.right, accRect.right);
|
|
20954
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
20955
|
-
accRect.left = max(rect.left, accRect.left);
|
|
21209
|
+
accRect.top = max$1(rect.top, accRect.top);
|
|
21210
|
+
accRect.right = min$1(rect.right, accRect.right);
|
|
21211
|
+
accRect.bottom = min$1(rect.bottom, accRect.bottom);
|
|
21212
|
+
accRect.left = max$1(rect.left, accRect.left);
|
|
20956
21213
|
return accRect;
|
|
20957
21214
|
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
20958
21215
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
@@ -21027,7 +21284,7 @@ function computeOffsets(_ref) {
|
|
|
21027
21284
|
return offsets;
|
|
21028
21285
|
}
|
|
21029
21286
|
|
|
21030
|
-
function detectOverflow(state, options) {
|
|
21287
|
+
function detectOverflow$1(state, options) {
|
|
21031
21288
|
if (options === void 0) {
|
|
21032
21289
|
options = {};
|
|
21033
21290
|
}
|
|
@@ -21051,15 +21308,15 @@ function detectOverflow(state, options) {
|
|
|
21051
21308
|
var altContext = elementContext === popper ? reference : popper;
|
|
21052
21309
|
var popperRect = state.rects.popper;
|
|
21053
21310
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
21054
|
-
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
21055
|
-
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
21311
|
+
var clippingClientRect = getClippingRect$1(isElement$1(element) ? element : element.contextElement || getDocumentElement$1(state.elements.popper), boundary, rootBoundary, strategy);
|
|
21312
|
+
var referenceClientRect = getBoundingClientRect$1(state.elements.reference);
|
|
21056
21313
|
var popperOffsets = computeOffsets({
|
|
21057
21314
|
reference: referenceClientRect,
|
|
21058
21315
|
element: popperRect,
|
|
21059
21316
|
strategy: 'absolute',
|
|
21060
21317
|
placement: placement
|
|
21061
21318
|
});
|
|
21062
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
21319
|
+
var popperClientRect = rectToClientRect$1(Object.assign({}, popperRect, popperOffsets));
|
|
21063
21320
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
21064
21321
|
// 0 or negative = within the clipping rect
|
|
21065
21322
|
|
|
@@ -21110,7 +21367,7 @@ function computeAutoPlacement(state, options) {
|
|
|
21110
21367
|
|
|
21111
21368
|
|
|
21112
21369
|
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
21113
|
-
acc[placement] = detectOverflow(state, {
|
|
21370
|
+
acc[placement] = detectOverflow$1(state, {
|
|
21114
21371
|
placement: placement,
|
|
21115
21372
|
boundary: boundary,
|
|
21116
21373
|
rootBoundary: rootBoundary,
|
|
@@ -21128,11 +21385,11 @@ function getExpandedFallbackPlacements(placement) {
|
|
|
21128
21385
|
return [];
|
|
21129
21386
|
}
|
|
21130
21387
|
|
|
21131
|
-
var oppositePlacement = getOppositePlacement(placement);
|
|
21388
|
+
var oppositePlacement = getOppositePlacement$1(placement);
|
|
21132
21389
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
21133
21390
|
}
|
|
21134
21391
|
|
|
21135
|
-
function flip(_ref) {
|
|
21392
|
+
function flip$2(_ref) {
|
|
21136
21393
|
var state = _ref.state,
|
|
21137
21394
|
options = _ref.options,
|
|
21138
21395
|
name = _ref.name;
|
|
@@ -21156,7 +21413,7 @@ function flip(_ref) {
|
|
|
21156
21413
|
var preferredPlacement = state.options.placement;
|
|
21157
21414
|
var basePlacement = getBasePlacement(preferredPlacement);
|
|
21158
21415
|
var isBasePlacement = basePlacement === preferredPlacement;
|
|
21159
|
-
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
21416
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement$1(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
21160
21417
|
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
21161
21418
|
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
|
21162
21419
|
placement: placement,
|
|
@@ -21181,7 +21438,7 @@ function flip(_ref) {
|
|
|
21181
21438
|
var isStartVariation = getVariation(placement) === start;
|
|
21182
21439
|
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
21183
21440
|
var len = isVertical ? 'width' : 'height';
|
|
21184
|
-
var overflow = detectOverflow(state, {
|
|
21441
|
+
var overflow = detectOverflow$1(state, {
|
|
21185
21442
|
placement: placement,
|
|
21186
21443
|
boundary: boundary,
|
|
21187
21444
|
rootBoundary: rootBoundary,
|
|
@@ -21191,10 +21448,10 @@ function flip(_ref) {
|
|
|
21191
21448
|
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
21192
21449
|
|
|
21193
21450
|
if (referenceRect[len] > popperRect[len]) {
|
|
21194
|
-
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
21451
|
+
mainVariationSide = getOppositePlacement$1(mainVariationSide);
|
|
21195
21452
|
}
|
|
21196
21453
|
|
|
21197
|
-
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
21454
|
+
var altVariationSide = getOppositePlacement$1(mainVariationSide);
|
|
21198
21455
|
var checks = [];
|
|
21199
21456
|
|
|
21200
21457
|
if (checkMainAxis) {
|
|
@@ -21252,11 +21509,11 @@ function flip(_ref) {
|
|
|
21252
21509
|
} // eslint-disable-next-line import/no-unused-modules
|
|
21253
21510
|
|
|
21254
21511
|
|
|
21255
|
-
var flip$
|
|
21512
|
+
var flip$3 = {
|
|
21256
21513
|
name: 'flip',
|
|
21257
21514
|
enabled: true,
|
|
21258
21515
|
phase: 'main',
|
|
21259
|
-
fn: flip,
|
|
21516
|
+
fn: flip$2,
|
|
21260
21517
|
requiresIfExists: ['offset'],
|
|
21261
21518
|
data: {
|
|
21262
21519
|
_skip: false
|
|
@@ -21291,10 +21548,10 @@ function hide$1(_ref) {
|
|
|
21291
21548
|
var referenceRect = state.rects.reference;
|
|
21292
21549
|
var popperRect = state.rects.popper;
|
|
21293
21550
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
21294
|
-
var referenceOverflow = detectOverflow(state, {
|
|
21551
|
+
var referenceOverflow = detectOverflow$1(state, {
|
|
21295
21552
|
elementContext: 'reference'
|
|
21296
21553
|
});
|
|
21297
|
-
var popperAltOverflow = detectOverflow(state, {
|
|
21554
|
+
var popperAltOverflow = detectOverflow$1(state, {
|
|
21298
21555
|
altBoundary: true
|
|
21299
21556
|
});
|
|
21300
21557
|
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
@@ -21343,7 +21600,7 @@ function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
|
21343
21600
|
};
|
|
21344
21601
|
}
|
|
21345
21602
|
|
|
21346
|
-
function offset(_ref2) {
|
|
21603
|
+
function offset$1(_ref2) {
|
|
21347
21604
|
var state = _ref2.state,
|
|
21348
21605
|
options = _ref2.options,
|
|
21349
21606
|
name = _ref2.name;
|
|
@@ -21366,12 +21623,12 @@ function offset(_ref2) {
|
|
|
21366
21623
|
} // eslint-disable-next-line import/no-unused-modules
|
|
21367
21624
|
|
|
21368
21625
|
|
|
21369
|
-
var offset$
|
|
21626
|
+
var offset$2 = {
|
|
21370
21627
|
name: 'offset',
|
|
21371
21628
|
enabled: true,
|
|
21372
21629
|
phase: 'main',
|
|
21373
21630
|
requires: ['popperOffsets'],
|
|
21374
|
-
fn: offset
|
|
21631
|
+
fn: offset$1
|
|
21375
21632
|
};
|
|
21376
21633
|
|
|
21377
21634
|
function popperOffsets(_ref) {
|
|
@@ -21418,7 +21675,7 @@ function preventOverflow(_ref) {
|
|
|
21418
21675
|
tether = _options$tether === void 0 ? true : _options$tether,
|
|
21419
21676
|
_options$tetherOffset = options.tetherOffset,
|
|
21420
21677
|
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
21421
|
-
var overflow = detectOverflow(state, {
|
|
21678
|
+
var overflow = detectOverflow$1(state, {
|
|
21422
21679
|
boundary: boundary,
|
|
21423
21680
|
rootBoundary: rootBoundary,
|
|
21424
21681
|
padding: padding,
|
|
@@ -21459,8 +21716,8 @@ function preventOverflow(_ref) {
|
|
|
21459
21716
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
21460
21717
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
21461
21718
|
var offset = popperOffsets[mainAxis];
|
|
21462
|
-
var min
|
|
21463
|
-
var max
|
|
21719
|
+
var min = offset + overflow[mainSide];
|
|
21720
|
+
var max = offset - overflow[altSide];
|
|
21464
21721
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
21465
21722
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
21466
21723
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -21482,12 +21739,12 @@ function preventOverflow(_ref) {
|
|
|
21482
21739
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
21483
21740
|
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
21484
21741
|
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
21485
|
-
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
21742
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent$1(state.elements.arrow);
|
|
21486
21743
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
21487
21744
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
21488
21745
|
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
21489
21746
|
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
21490
|
-
var preventedOffset = within(tether ? min(min
|
|
21747
|
+
var preventedOffset = within(tether ? min$1(min, tetherMin) : min, offset, tether ? max$1(max, tetherMax) : max);
|
|
21491
21748
|
popperOffsets[mainAxis] = preventedOffset;
|
|
21492
21749
|
data[mainAxis] = preventedOffset - offset;
|
|
21493
21750
|
}
|
|
@@ -21540,8 +21797,8 @@ function getHTMLElementScroll(element) {
|
|
|
21540
21797
|
};
|
|
21541
21798
|
}
|
|
21542
21799
|
|
|
21543
|
-
function getNodeScroll(node) {
|
|
21544
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
21800
|
+
function getNodeScroll$1(node) {
|
|
21801
|
+
if (node === getWindow$1(node) || !isHTMLElement$1(node)) {
|
|
21545
21802
|
return getWindowScroll(node);
|
|
21546
21803
|
} else {
|
|
21547
21804
|
return getHTMLElementScroll(node);
|
|
@@ -21550,8 +21807,8 @@ function getNodeScroll(node) {
|
|
|
21550
21807
|
|
|
21551
21808
|
function isElementScaled(element) {
|
|
21552
21809
|
var rect = element.getBoundingClientRect();
|
|
21553
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
21554
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
21810
|
+
var scaleX = round$1(rect.width) / element.offsetWidth || 1;
|
|
21811
|
+
var scaleY = round$1(rect.height) / element.offsetHeight || 1;
|
|
21555
21812
|
return scaleX !== 1 || scaleY !== 1;
|
|
21556
21813
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
21557
21814
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -21562,10 +21819,10 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
21562
21819
|
isFixed = false;
|
|
21563
21820
|
}
|
|
21564
21821
|
|
|
21565
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
21566
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
21567
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
21568
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
21822
|
+
var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
|
21823
|
+
var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
|
|
21824
|
+
var documentElement = getDocumentElement$1(offsetParent);
|
|
21825
|
+
var rect = getBoundingClientRect$1(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
21569
21826
|
var scroll = {
|
|
21570
21827
|
scrollLeft: 0,
|
|
21571
21828
|
scrollTop: 0
|
|
@@ -21576,17 +21833,17 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
21576
21833
|
};
|
|
21577
21834
|
|
|
21578
21835
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
21579
|
-
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
21836
|
+
if (getNodeName$1(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
21580
21837
|
isScrollParent(documentElement)) {
|
|
21581
|
-
scroll = getNodeScroll(offsetParent);
|
|
21838
|
+
scroll = getNodeScroll$1(offsetParent);
|
|
21582
21839
|
}
|
|
21583
21840
|
|
|
21584
|
-
if (isHTMLElement(offsetParent)) {
|
|
21585
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
21841
|
+
if (isHTMLElement$1(offsetParent)) {
|
|
21842
|
+
offsets = getBoundingClientRect$1(offsetParent, true);
|
|
21586
21843
|
offsets.x += offsetParent.clientLeft;
|
|
21587
21844
|
offsets.y += offsetParent.clientTop;
|
|
21588
21845
|
} else if (documentElement) {
|
|
21589
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
21846
|
+
offsets.x = getWindowScrollBarX$1(documentElement);
|
|
21590
21847
|
}
|
|
21591
21848
|
}
|
|
21592
21849
|
|
|
@@ -21724,7 +21981,7 @@ function popperGenerator(generatorOptions) {
|
|
|
21724
21981
|
cleanupModifierEffects();
|
|
21725
21982
|
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
21726
21983
|
state.scrollParents = {
|
|
21727
|
-
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
21984
|
+
reference: isElement$1(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
21728
21985
|
popper: listScrollParents(popper)
|
|
21729
21986
|
}; // Orders the modifiers based on their dependencies and `phase`
|
|
21730
21987
|
// properties
|
|
@@ -21758,7 +22015,7 @@ function popperGenerator(generatorOptions) {
|
|
|
21758
22015
|
|
|
21759
22016
|
|
|
21760
22017
|
state.rects = {
|
|
21761
|
-
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
|
22018
|
+
reference: getCompositeRect(reference, getOffsetParent$1(popper), state.options.strategy === 'fixed'),
|
|
21762
22019
|
popper: getLayoutRect(popper)
|
|
21763
22020
|
}; // Modifiers have the ability to reset the current update cycle. The
|
|
21764
22021
|
// most common use case for this is the `flip` modifier changing the
|
|
@@ -21860,7 +22117,7 @@ function popperGenerator(generatorOptions) {
|
|
|
21860
22117
|
};
|
|
21861
22118
|
}
|
|
21862
22119
|
|
|
21863
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$
|
|
22120
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$2, flip$3, preventOverflow$1, arrow$3, hide$2];
|
|
21864
22121
|
var createPopper = /*#__PURE__*/popperGenerator({
|
|
21865
22122
|
defaultModifiers: defaultModifiers
|
|
21866
22123
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
@@ -25351,7 +25608,7 @@ const StyledLoadingAwareContainer = styled__default.default.div `
|
|
|
25351
25608
|
*/
|
|
25352
25609
|
function LoadingAwareContainer(props) {
|
|
25353
25610
|
const { children, className, isLoading, style } = props;
|
|
25354
|
-
return (jsxRuntime$1.jsxs(StyledLoadingAwareContainer, { className:
|
|
25611
|
+
return (jsxRuntime$1.jsxs(StyledLoadingAwareContainer, { className: y({ loading: isLoading }, className), style: style, children: [jsxRuntime$1.jsx(StyledStatusContainer, { role: "status", children: isLoading && 'Loading' }), isLoading ? jsxRuntime$1.jsx(LoadingIndicator, {}) : jsxRuntime$1.jsx(jsxRuntime$1.Fragment, { children: children })] }));
|
|
25355
25612
|
}
|
|
25356
25613
|
|
|
25357
25614
|
const StyledWizard = styled__default.default.div `
|
|
@@ -25644,7 +25901,7 @@ function WizardWithSidebar(props) {
|
|
|
25644
25901
|
return () => setCurrentStep(steps[0] || '');
|
|
25645
25902
|
}, []);
|
|
25646
25903
|
return (jsxRuntime$1.jsxs(StyledWizardWithSidebar, { className: className, "data-cy": props['data-cy'], id: id, backgroundcolor: backgroundColor, color: color, buttoncolor: buttonColor, children: [jsxRuntime$1.jsxs("div", { className: "wizard-sidebar", children: [jsxRuntime$1.jsxs("h2", { children: [" ", wizardTitle] }), steps.map((step, index) => {
|
|
25647
|
-
return (jsxRuntime$1.jsxs("div", { className:
|
|
25904
|
+
return (jsxRuntime$1.jsxs("div", { className: y('sidebar-step', {
|
|
25648
25905
|
['current-step']: index === steps.indexOf(currentStep),
|
|
25649
25906
|
['prior-step']: index < steps.indexOf(currentStep),
|
|
25650
25907
|
}), children: [(Object.keys(validationErrors ? validationErrors : []).some((error) => stepSchema[step].inputsRequiringValidation.includes(error)) ||
|
|
@@ -25788,15 +26045,15 @@ const StyledDrawerLinkList = styled__default.default.div `
|
|
|
25788
26045
|
|
|
25789
26046
|
const DrawerLinkList = (props) => {
|
|
25790
26047
|
const { className, style = {}, id, listItems, isOpen } = props, restOfProps = __rest$1(props, ["className", "style", "id", "listItems", "isOpen"]);
|
|
25791
|
-
return (jsxRuntime$1.jsx(StyledDrawerLinkList, Object.assign({ id: id, "data-cy": props['data-cy'], "data-testid": props['data-testid'], style: style }, restOfProps, { className:
|
|
25792
|
-
return
|
|
26048
|
+
return (jsxRuntime$1.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 && (jsxRuntime$1.jsx("ul", { className: "drawer__list", children: listItems.map((item) => (jsxRuntime$1.jsx(reactRouterDom.NavLink, { to: item.path, className: ({ isActive, isPending }) => {
|
|
26049
|
+
return y('drawer__list__item', { 'drawer__list__item--active': isActive }, { 'drawer__list__item--pending': isPending });
|
|
25793
26050
|
}, role: "link", "aria-label": item.label, "data-testid": `link-list-item-${item.label}`, children: jsxRuntime$1.jsxs("li", { className: "drawer__list__item__link", children: [jsxRuntime$1.jsx("span", { className: `drawer__list__item__icon`, children: jsxRuntime$1.jsx(Icon, { size: [22], name: item.icon, ariaLabel: `${item.label} icon` }) }), jsxRuntime$1.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))) })) })));
|
|
25794
26051
|
};
|
|
25795
26052
|
|
|
25796
26053
|
const Drawer = (props) => {
|
|
25797
26054
|
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"]);
|
|
25798
26055
|
const [isOpen, setIsOpen] = React__namespace.default.useState(false);
|
|
25799
|
-
const drawerClasses =
|
|
26056
|
+
const drawerClasses = y('drawer', className, {
|
|
25800
26057
|
'drawer--open': isOpen,
|
|
25801
26058
|
'drawer--closed': !isOpen,
|
|
25802
26059
|
});
|
|
@@ -25811,8 +26068,8 @@ const Drawer = (props) => {
|
|
|
25811
26068
|
|
|
25812
26069
|
const StyledTextTruncate = styled__default.default.span ``;
|
|
25813
26070
|
|
|
25814
|
-
function TextTruncate({ string, maxChars, children }) {
|
|
25815
|
-
return string.length > maxChars ? (jsxRuntime$1.jsxs(StyledTextTruncate, { title: string, children: [`${string.substring(0, maxChars)}...`, children] })) : (jsxRuntime$1.jsxs(StyledTextTruncate, { children: [string, children] }));
|
|
26071
|
+
function TextTruncate({ string, maxChars, children, noTitle }) {
|
|
26072
|
+
return string.length > maxChars ? (jsxRuntime$1.jsxs(StyledTextTruncate, { title: noTitle ? undefined : string, children: [`${string.substring(0, maxChars)}...`, children] })) : (jsxRuntime$1.jsxs(StyledTextTruncate, { children: [string, children] }));
|
|
25816
26073
|
}
|
|
25817
26074
|
|
|
25818
26075
|
const StyledToggle = styled__default.default.label `
|
|
@@ -25900,11 +26157,1571 @@ const StyledToggle = styled__default.default.label `
|
|
|
25900
26157
|
|
|
25901
26158
|
const Toggle = (props) => {
|
|
25902
26159
|
const { disabled, onChange, value, className, id, checkedIconName, notCheckedIconName, iconSize, } = props;
|
|
25903
|
-
return (jsxRuntime$1.jsxs(StyledToggle, { className:
|
|
26160
|
+
return (jsxRuntime$1.jsxs(StyledToggle, { className: y(className, {
|
|
25904
26161
|
disabled,
|
|
25905
26162
|
}), "data-cy": props['data-cy'], id: id, children: [jsxRuntime$1.jsx("input", { "aria-label": props['aria-label'], type: "checkbox", disabled: disabled, checked: value, onChange: onChange }), jsxRuntime$1.jsx("span", { className: "slider round" }), checkedIconName && (jsxRuntime$1.jsx(Icon, { name: checkedIconName, size: [iconSize || 5], className: "checked-icon" })), notCheckedIconName && (jsxRuntime$1.jsx(Icon, { name: notCheckedIconName, size: [iconSize || 5], className: "not-checked-icon" }))] }));
|
|
25906
26163
|
};
|
|
25907
26164
|
|
|
26165
|
+
/**
|
|
26166
|
+
* Custom positioning reference element.
|
|
26167
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
26168
|
+
*/
|
|
26169
|
+
|
|
26170
|
+
const min = Math.min;
|
|
26171
|
+
const max = Math.max;
|
|
26172
|
+
const round = Math.round;
|
|
26173
|
+
const floor = Math.floor;
|
|
26174
|
+
const createCoords = v => ({
|
|
26175
|
+
x: v,
|
|
26176
|
+
y: v
|
|
26177
|
+
});
|
|
26178
|
+
const oppositeSideMap = {
|
|
26179
|
+
left: 'right',
|
|
26180
|
+
right: 'left',
|
|
26181
|
+
bottom: 'top',
|
|
26182
|
+
top: 'bottom'
|
|
26183
|
+
};
|
|
26184
|
+
const oppositeAlignmentMap = {
|
|
26185
|
+
start: 'end',
|
|
26186
|
+
end: 'start'
|
|
26187
|
+
};
|
|
26188
|
+
function clamp(start, value, end) {
|
|
26189
|
+
return max(start, min(value, end));
|
|
26190
|
+
}
|
|
26191
|
+
function evaluate(value, param) {
|
|
26192
|
+
return typeof value === 'function' ? value(param) : value;
|
|
26193
|
+
}
|
|
26194
|
+
function getSide(placement) {
|
|
26195
|
+
return placement.split('-')[0];
|
|
26196
|
+
}
|
|
26197
|
+
function getAlignment(placement) {
|
|
26198
|
+
return placement.split('-')[1];
|
|
26199
|
+
}
|
|
26200
|
+
function getOppositeAxis(axis) {
|
|
26201
|
+
return axis === 'x' ? 'y' : 'x';
|
|
26202
|
+
}
|
|
26203
|
+
function getAxisLength(axis) {
|
|
26204
|
+
return axis === 'y' ? 'height' : 'width';
|
|
26205
|
+
}
|
|
26206
|
+
function getSideAxis(placement) {
|
|
26207
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
26208
|
+
}
|
|
26209
|
+
function getAlignmentAxis(placement) {
|
|
26210
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
26211
|
+
}
|
|
26212
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
26213
|
+
if (rtl === void 0) {
|
|
26214
|
+
rtl = false;
|
|
26215
|
+
}
|
|
26216
|
+
const alignment = getAlignment(placement);
|
|
26217
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
26218
|
+
const length = getAxisLength(alignmentAxis);
|
|
26219
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
26220
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
26221
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
26222
|
+
}
|
|
26223
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
26224
|
+
}
|
|
26225
|
+
function getExpandedPlacements(placement) {
|
|
26226
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
26227
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
26228
|
+
}
|
|
26229
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
26230
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
26231
|
+
}
|
|
26232
|
+
function getSideList(side, isStart, rtl) {
|
|
26233
|
+
const lr = ['left', 'right'];
|
|
26234
|
+
const rl = ['right', 'left'];
|
|
26235
|
+
const tb = ['top', 'bottom'];
|
|
26236
|
+
const bt = ['bottom', 'top'];
|
|
26237
|
+
switch (side) {
|
|
26238
|
+
case 'top':
|
|
26239
|
+
case 'bottom':
|
|
26240
|
+
if (rtl) return isStart ? rl : lr;
|
|
26241
|
+
return isStart ? lr : rl;
|
|
26242
|
+
case 'left':
|
|
26243
|
+
case 'right':
|
|
26244
|
+
return isStart ? tb : bt;
|
|
26245
|
+
default:
|
|
26246
|
+
return [];
|
|
26247
|
+
}
|
|
26248
|
+
}
|
|
26249
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
26250
|
+
const alignment = getAlignment(placement);
|
|
26251
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
26252
|
+
if (alignment) {
|
|
26253
|
+
list = list.map(side => side + "-" + alignment);
|
|
26254
|
+
if (flipAlignment) {
|
|
26255
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
26256
|
+
}
|
|
26257
|
+
}
|
|
26258
|
+
return list;
|
|
26259
|
+
}
|
|
26260
|
+
function getOppositePlacement(placement) {
|
|
26261
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
26262
|
+
}
|
|
26263
|
+
function expandPaddingObject(padding) {
|
|
26264
|
+
return {
|
|
26265
|
+
top: 0,
|
|
26266
|
+
right: 0,
|
|
26267
|
+
bottom: 0,
|
|
26268
|
+
left: 0,
|
|
26269
|
+
...padding
|
|
26270
|
+
};
|
|
26271
|
+
}
|
|
26272
|
+
function getPaddingObject(padding) {
|
|
26273
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
26274
|
+
top: padding,
|
|
26275
|
+
right: padding,
|
|
26276
|
+
bottom: padding,
|
|
26277
|
+
left: padding
|
|
26278
|
+
};
|
|
26279
|
+
}
|
|
26280
|
+
function rectToClientRect(rect) {
|
|
26281
|
+
return {
|
|
26282
|
+
...rect,
|
|
26283
|
+
top: rect.y,
|
|
26284
|
+
left: rect.x,
|
|
26285
|
+
right: rect.x + rect.width,
|
|
26286
|
+
bottom: rect.y + rect.height
|
|
26287
|
+
};
|
|
26288
|
+
}
|
|
26289
|
+
|
|
26290
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
26291
|
+
let {
|
|
26292
|
+
reference,
|
|
26293
|
+
floating
|
|
26294
|
+
} = _ref;
|
|
26295
|
+
const sideAxis = getSideAxis(placement);
|
|
26296
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
26297
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
26298
|
+
const side = getSide(placement);
|
|
26299
|
+
const isVertical = sideAxis === 'y';
|
|
26300
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
26301
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
26302
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
26303
|
+
let coords;
|
|
26304
|
+
switch (side) {
|
|
26305
|
+
case 'top':
|
|
26306
|
+
coords = {
|
|
26307
|
+
x: commonX,
|
|
26308
|
+
y: reference.y - floating.height
|
|
26309
|
+
};
|
|
26310
|
+
break;
|
|
26311
|
+
case 'bottom':
|
|
26312
|
+
coords = {
|
|
26313
|
+
x: commonX,
|
|
26314
|
+
y: reference.y + reference.height
|
|
26315
|
+
};
|
|
26316
|
+
break;
|
|
26317
|
+
case 'right':
|
|
26318
|
+
coords = {
|
|
26319
|
+
x: reference.x + reference.width,
|
|
26320
|
+
y: commonY
|
|
26321
|
+
};
|
|
26322
|
+
break;
|
|
26323
|
+
case 'left':
|
|
26324
|
+
coords = {
|
|
26325
|
+
x: reference.x - floating.width,
|
|
26326
|
+
y: commonY
|
|
26327
|
+
};
|
|
26328
|
+
break;
|
|
26329
|
+
default:
|
|
26330
|
+
coords = {
|
|
26331
|
+
x: reference.x,
|
|
26332
|
+
y: reference.y
|
|
26333
|
+
};
|
|
26334
|
+
}
|
|
26335
|
+
switch (getAlignment(placement)) {
|
|
26336
|
+
case 'start':
|
|
26337
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
26338
|
+
break;
|
|
26339
|
+
case 'end':
|
|
26340
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
26341
|
+
break;
|
|
26342
|
+
}
|
|
26343
|
+
return coords;
|
|
26344
|
+
}
|
|
26345
|
+
|
|
26346
|
+
/**
|
|
26347
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
26348
|
+
* next to a given reference element.
|
|
26349
|
+
*
|
|
26350
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
26351
|
+
* write one for the platform you are using Floating UI with.
|
|
26352
|
+
*/
|
|
26353
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
26354
|
+
const {
|
|
26355
|
+
placement = 'bottom',
|
|
26356
|
+
strategy = 'absolute',
|
|
26357
|
+
middleware = [],
|
|
26358
|
+
platform
|
|
26359
|
+
} = config;
|
|
26360
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
26361
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
26362
|
+
let rects = await platform.getElementRects({
|
|
26363
|
+
reference,
|
|
26364
|
+
floating,
|
|
26365
|
+
strategy
|
|
26366
|
+
});
|
|
26367
|
+
let {
|
|
26368
|
+
x,
|
|
26369
|
+
y
|
|
26370
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
26371
|
+
let statefulPlacement = placement;
|
|
26372
|
+
let middlewareData = {};
|
|
26373
|
+
let resetCount = 0;
|
|
26374
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
26375
|
+
const {
|
|
26376
|
+
name,
|
|
26377
|
+
fn
|
|
26378
|
+
} = validMiddleware[i];
|
|
26379
|
+
const {
|
|
26380
|
+
x: nextX,
|
|
26381
|
+
y: nextY,
|
|
26382
|
+
data,
|
|
26383
|
+
reset
|
|
26384
|
+
} = await fn({
|
|
26385
|
+
x,
|
|
26386
|
+
y,
|
|
26387
|
+
initialPlacement: placement,
|
|
26388
|
+
placement: statefulPlacement,
|
|
26389
|
+
strategy,
|
|
26390
|
+
middlewareData,
|
|
26391
|
+
rects,
|
|
26392
|
+
platform,
|
|
26393
|
+
elements: {
|
|
26394
|
+
reference,
|
|
26395
|
+
floating
|
|
26396
|
+
}
|
|
26397
|
+
});
|
|
26398
|
+
x = nextX != null ? nextX : x;
|
|
26399
|
+
y = nextY != null ? nextY : y;
|
|
26400
|
+
middlewareData = {
|
|
26401
|
+
...middlewareData,
|
|
26402
|
+
[name]: {
|
|
26403
|
+
...middlewareData[name],
|
|
26404
|
+
...data
|
|
26405
|
+
}
|
|
26406
|
+
};
|
|
26407
|
+
if (reset && resetCount <= 50) {
|
|
26408
|
+
resetCount++;
|
|
26409
|
+
if (typeof reset === 'object') {
|
|
26410
|
+
if (reset.placement) {
|
|
26411
|
+
statefulPlacement = reset.placement;
|
|
26412
|
+
}
|
|
26413
|
+
if (reset.rects) {
|
|
26414
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
26415
|
+
reference,
|
|
26416
|
+
floating,
|
|
26417
|
+
strategy
|
|
26418
|
+
}) : reset.rects;
|
|
26419
|
+
}
|
|
26420
|
+
({
|
|
26421
|
+
x,
|
|
26422
|
+
y
|
|
26423
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
26424
|
+
}
|
|
26425
|
+
i = -1;
|
|
26426
|
+
}
|
|
26427
|
+
}
|
|
26428
|
+
return {
|
|
26429
|
+
x,
|
|
26430
|
+
y,
|
|
26431
|
+
placement: statefulPlacement,
|
|
26432
|
+
strategy,
|
|
26433
|
+
middlewareData
|
|
26434
|
+
};
|
|
26435
|
+
};
|
|
26436
|
+
|
|
26437
|
+
/**
|
|
26438
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
26439
|
+
* element is overflowing a given clipping boundary on each side.
|
|
26440
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
26441
|
+
* - negative = how many pixels left before it will overflow
|
|
26442
|
+
* - 0 = lies flush with the boundary
|
|
26443
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
26444
|
+
*/
|
|
26445
|
+
async function detectOverflow(state, options) {
|
|
26446
|
+
var _await$platform$isEle;
|
|
26447
|
+
if (options === void 0) {
|
|
26448
|
+
options = {};
|
|
26449
|
+
}
|
|
26450
|
+
const {
|
|
26451
|
+
x,
|
|
26452
|
+
y,
|
|
26453
|
+
platform,
|
|
26454
|
+
rects,
|
|
26455
|
+
elements,
|
|
26456
|
+
strategy
|
|
26457
|
+
} = state;
|
|
26458
|
+
const {
|
|
26459
|
+
boundary = 'clippingAncestors',
|
|
26460
|
+
rootBoundary = 'viewport',
|
|
26461
|
+
elementContext = 'floating',
|
|
26462
|
+
altBoundary = false,
|
|
26463
|
+
padding = 0
|
|
26464
|
+
} = evaluate(options, state);
|
|
26465
|
+
const paddingObject = getPaddingObject(padding);
|
|
26466
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
26467
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
26468
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
26469
|
+
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))),
|
|
26470
|
+
boundary,
|
|
26471
|
+
rootBoundary,
|
|
26472
|
+
strategy
|
|
26473
|
+
}));
|
|
26474
|
+
const rect = elementContext === 'floating' ? {
|
|
26475
|
+
...rects.floating,
|
|
26476
|
+
x,
|
|
26477
|
+
y
|
|
26478
|
+
} : rects.reference;
|
|
26479
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
26480
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
26481
|
+
x: 1,
|
|
26482
|
+
y: 1
|
|
26483
|
+
} : {
|
|
26484
|
+
x: 1,
|
|
26485
|
+
y: 1
|
|
26486
|
+
};
|
|
26487
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
26488
|
+
elements,
|
|
26489
|
+
rect,
|
|
26490
|
+
offsetParent,
|
|
26491
|
+
strategy
|
|
26492
|
+
}) : rect);
|
|
26493
|
+
return {
|
|
26494
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
26495
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
26496
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
26497
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
26498
|
+
};
|
|
26499
|
+
}
|
|
26500
|
+
|
|
26501
|
+
/**
|
|
26502
|
+
* Provides data to position an inner element of the floating element so that it
|
|
26503
|
+
* appears centered to the reference element.
|
|
26504
|
+
* @see https://floating-ui.com/docs/arrow
|
|
26505
|
+
*/
|
|
26506
|
+
const arrow$1 = options => ({
|
|
26507
|
+
name: 'arrow',
|
|
26508
|
+
options,
|
|
26509
|
+
async fn(state) {
|
|
26510
|
+
const {
|
|
26511
|
+
x,
|
|
26512
|
+
y,
|
|
26513
|
+
placement,
|
|
26514
|
+
rects,
|
|
26515
|
+
platform,
|
|
26516
|
+
elements,
|
|
26517
|
+
middlewareData
|
|
26518
|
+
} = state;
|
|
26519
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
26520
|
+
const {
|
|
26521
|
+
element,
|
|
26522
|
+
padding = 0
|
|
26523
|
+
} = evaluate(options, state) || {};
|
|
26524
|
+
if (element == null) {
|
|
26525
|
+
return {};
|
|
26526
|
+
}
|
|
26527
|
+
const paddingObject = getPaddingObject(padding);
|
|
26528
|
+
const coords = {
|
|
26529
|
+
x,
|
|
26530
|
+
y
|
|
26531
|
+
};
|
|
26532
|
+
const axis = getAlignmentAxis(placement);
|
|
26533
|
+
const length = getAxisLength(axis);
|
|
26534
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
26535
|
+
const isYAxis = axis === 'y';
|
|
26536
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
26537
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
26538
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
26539
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
26540
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
26541
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
26542
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
26543
|
+
|
|
26544
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
26545
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
26546
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
26547
|
+
}
|
|
26548
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
26549
|
+
|
|
26550
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
26551
|
+
// centered, modify the padding so that it is centered.
|
|
26552
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
26553
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
26554
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
26555
|
+
|
|
26556
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
26557
|
+
// point is outside the floating element's bounds.
|
|
26558
|
+
const min$1 = minPadding;
|
|
26559
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
26560
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
26561
|
+
const offset = clamp(min$1, center, max);
|
|
26562
|
+
|
|
26563
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
26564
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
26565
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
26566
|
+
// a single reset is performed when this is true.
|
|
26567
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
26568
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
26569
|
+
return {
|
|
26570
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
26571
|
+
data: {
|
|
26572
|
+
[axis]: offset,
|
|
26573
|
+
centerOffset: center - offset - alignmentOffset,
|
|
26574
|
+
...(shouldAddOffset && {
|
|
26575
|
+
alignmentOffset
|
|
26576
|
+
})
|
|
26577
|
+
},
|
|
26578
|
+
reset: shouldAddOffset
|
|
26579
|
+
};
|
|
26580
|
+
}
|
|
26581
|
+
});
|
|
26582
|
+
|
|
26583
|
+
/**
|
|
26584
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
26585
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
26586
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
26587
|
+
* @see https://floating-ui.com/docs/flip
|
|
26588
|
+
*/
|
|
26589
|
+
const flip$1 = function (options) {
|
|
26590
|
+
if (options === void 0) {
|
|
26591
|
+
options = {};
|
|
26592
|
+
}
|
|
26593
|
+
return {
|
|
26594
|
+
name: 'flip',
|
|
26595
|
+
options,
|
|
26596
|
+
async fn(state) {
|
|
26597
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
26598
|
+
const {
|
|
26599
|
+
placement,
|
|
26600
|
+
middlewareData,
|
|
26601
|
+
rects,
|
|
26602
|
+
initialPlacement,
|
|
26603
|
+
platform,
|
|
26604
|
+
elements
|
|
26605
|
+
} = state;
|
|
26606
|
+
const {
|
|
26607
|
+
mainAxis: checkMainAxis = true,
|
|
26608
|
+
crossAxis: checkCrossAxis = true,
|
|
26609
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
26610
|
+
fallbackStrategy = 'bestFit',
|
|
26611
|
+
fallbackAxisSideDirection = 'none',
|
|
26612
|
+
flipAlignment = true,
|
|
26613
|
+
...detectOverflowOptions
|
|
26614
|
+
} = evaluate(options, state);
|
|
26615
|
+
|
|
26616
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
26617
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
26618
|
+
// work.
|
|
26619
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
26620
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
26621
|
+
return {};
|
|
26622
|
+
}
|
|
26623
|
+
const side = getSide(placement);
|
|
26624
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
26625
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
26626
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
26627
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
26628
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
26629
|
+
}
|
|
26630
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
26631
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
26632
|
+
const overflows = [];
|
|
26633
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
26634
|
+
if (checkMainAxis) {
|
|
26635
|
+
overflows.push(overflow[side]);
|
|
26636
|
+
}
|
|
26637
|
+
if (checkCrossAxis) {
|
|
26638
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
26639
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
26640
|
+
}
|
|
26641
|
+
overflowsData = [...overflowsData, {
|
|
26642
|
+
placement,
|
|
26643
|
+
overflows
|
|
26644
|
+
}];
|
|
26645
|
+
|
|
26646
|
+
// One or more sides is overflowing.
|
|
26647
|
+
if (!overflows.every(side => side <= 0)) {
|
|
26648
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
26649
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
26650
|
+
const nextPlacement = placements[nextIndex];
|
|
26651
|
+
if (nextPlacement) {
|
|
26652
|
+
// Try next placement and re-run the lifecycle.
|
|
26653
|
+
return {
|
|
26654
|
+
data: {
|
|
26655
|
+
index: nextIndex,
|
|
26656
|
+
overflows: overflowsData
|
|
26657
|
+
},
|
|
26658
|
+
reset: {
|
|
26659
|
+
placement: nextPlacement
|
|
26660
|
+
}
|
|
26661
|
+
};
|
|
26662
|
+
}
|
|
26663
|
+
|
|
26664
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
26665
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
26666
|
+
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;
|
|
26667
|
+
|
|
26668
|
+
// Otherwise fallback.
|
|
26669
|
+
if (!resetPlacement) {
|
|
26670
|
+
switch (fallbackStrategy) {
|
|
26671
|
+
case 'bestFit':
|
|
26672
|
+
{
|
|
26673
|
+
var _overflowsData$map$so;
|
|
26674
|
+
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];
|
|
26675
|
+
if (placement) {
|
|
26676
|
+
resetPlacement = placement;
|
|
26677
|
+
}
|
|
26678
|
+
break;
|
|
26679
|
+
}
|
|
26680
|
+
case 'initialPlacement':
|
|
26681
|
+
resetPlacement = initialPlacement;
|
|
26682
|
+
break;
|
|
26683
|
+
}
|
|
26684
|
+
}
|
|
26685
|
+
if (placement !== resetPlacement) {
|
|
26686
|
+
return {
|
|
26687
|
+
reset: {
|
|
26688
|
+
placement: resetPlacement
|
|
26689
|
+
}
|
|
26690
|
+
};
|
|
26691
|
+
}
|
|
26692
|
+
}
|
|
26693
|
+
return {};
|
|
26694
|
+
}
|
|
26695
|
+
};
|
|
26696
|
+
};
|
|
26697
|
+
|
|
26698
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
26699
|
+
// Derivable.
|
|
26700
|
+
|
|
26701
|
+
async function convertValueToCoords(state, options) {
|
|
26702
|
+
const {
|
|
26703
|
+
placement,
|
|
26704
|
+
platform,
|
|
26705
|
+
elements
|
|
26706
|
+
} = state;
|
|
26707
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
26708
|
+
const side = getSide(placement);
|
|
26709
|
+
const alignment = getAlignment(placement);
|
|
26710
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
26711
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
26712
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
26713
|
+
const rawValue = evaluate(options, state);
|
|
26714
|
+
let {
|
|
26715
|
+
mainAxis,
|
|
26716
|
+
crossAxis,
|
|
26717
|
+
alignmentAxis
|
|
26718
|
+
} = typeof rawValue === 'number' ? {
|
|
26719
|
+
mainAxis: rawValue,
|
|
26720
|
+
crossAxis: 0,
|
|
26721
|
+
alignmentAxis: null
|
|
26722
|
+
} : {
|
|
26723
|
+
mainAxis: 0,
|
|
26724
|
+
crossAxis: 0,
|
|
26725
|
+
alignmentAxis: null,
|
|
26726
|
+
...rawValue
|
|
26727
|
+
};
|
|
26728
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
26729
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
26730
|
+
}
|
|
26731
|
+
return isVertical ? {
|
|
26732
|
+
x: crossAxis * crossAxisMulti,
|
|
26733
|
+
y: mainAxis * mainAxisMulti
|
|
26734
|
+
} : {
|
|
26735
|
+
x: mainAxis * mainAxisMulti,
|
|
26736
|
+
y: crossAxis * crossAxisMulti
|
|
26737
|
+
};
|
|
26738
|
+
}
|
|
26739
|
+
|
|
26740
|
+
/**
|
|
26741
|
+
* Modifies the placement by translating the floating element along the
|
|
26742
|
+
* specified axes.
|
|
26743
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
26744
|
+
* object may be passed.
|
|
26745
|
+
* @see https://floating-ui.com/docs/offset
|
|
26746
|
+
*/
|
|
26747
|
+
const offset = function (options) {
|
|
26748
|
+
if (options === void 0) {
|
|
26749
|
+
options = 0;
|
|
26750
|
+
}
|
|
26751
|
+
return {
|
|
26752
|
+
name: 'offset',
|
|
26753
|
+
options,
|
|
26754
|
+
async fn(state) {
|
|
26755
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
26756
|
+
const {
|
|
26757
|
+
x,
|
|
26758
|
+
y,
|
|
26759
|
+
placement,
|
|
26760
|
+
middlewareData
|
|
26761
|
+
} = state;
|
|
26762
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
26763
|
+
|
|
26764
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
26765
|
+
// then we don't need to change the positioning coordinates.
|
|
26766
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
26767
|
+
return {};
|
|
26768
|
+
}
|
|
26769
|
+
return {
|
|
26770
|
+
x: x + diffCoords.x,
|
|
26771
|
+
y: y + diffCoords.y,
|
|
26772
|
+
data: {
|
|
26773
|
+
...diffCoords,
|
|
26774
|
+
placement
|
|
26775
|
+
}
|
|
26776
|
+
};
|
|
26777
|
+
}
|
|
26778
|
+
};
|
|
26779
|
+
};
|
|
26780
|
+
|
|
26781
|
+
/**
|
|
26782
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
26783
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
26784
|
+
* @see https://floating-ui.com/docs/shift
|
|
26785
|
+
*/
|
|
26786
|
+
const shift$1 = function (options) {
|
|
26787
|
+
if (options === void 0) {
|
|
26788
|
+
options = {};
|
|
26789
|
+
}
|
|
26790
|
+
return {
|
|
26791
|
+
name: 'shift',
|
|
26792
|
+
options,
|
|
26793
|
+
async fn(state) {
|
|
26794
|
+
const {
|
|
26795
|
+
x,
|
|
26796
|
+
y,
|
|
26797
|
+
placement
|
|
26798
|
+
} = state;
|
|
26799
|
+
const {
|
|
26800
|
+
mainAxis: checkMainAxis = true,
|
|
26801
|
+
crossAxis: checkCrossAxis = false,
|
|
26802
|
+
limiter = {
|
|
26803
|
+
fn: _ref => {
|
|
26804
|
+
let {
|
|
26805
|
+
x,
|
|
26806
|
+
y
|
|
26807
|
+
} = _ref;
|
|
26808
|
+
return {
|
|
26809
|
+
x,
|
|
26810
|
+
y
|
|
26811
|
+
};
|
|
26812
|
+
}
|
|
26813
|
+
},
|
|
26814
|
+
...detectOverflowOptions
|
|
26815
|
+
} = evaluate(options, state);
|
|
26816
|
+
const coords = {
|
|
26817
|
+
x,
|
|
26818
|
+
y
|
|
26819
|
+
};
|
|
26820
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
26821
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
26822
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
26823
|
+
let mainAxisCoord = coords[mainAxis];
|
|
26824
|
+
let crossAxisCoord = coords[crossAxis];
|
|
26825
|
+
if (checkMainAxis) {
|
|
26826
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
26827
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
26828
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
26829
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
26830
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
26831
|
+
}
|
|
26832
|
+
if (checkCrossAxis) {
|
|
26833
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
26834
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
26835
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
26836
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
26837
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
26838
|
+
}
|
|
26839
|
+
const limitedCoords = limiter.fn({
|
|
26840
|
+
...state,
|
|
26841
|
+
[mainAxis]: mainAxisCoord,
|
|
26842
|
+
[crossAxis]: crossAxisCoord
|
|
26843
|
+
});
|
|
26844
|
+
return {
|
|
26845
|
+
...limitedCoords,
|
|
26846
|
+
data: {
|
|
26847
|
+
x: limitedCoords.x - x,
|
|
26848
|
+
y: limitedCoords.y - y
|
|
26849
|
+
}
|
|
26850
|
+
};
|
|
26851
|
+
}
|
|
26852
|
+
};
|
|
26853
|
+
};
|
|
26854
|
+
|
|
26855
|
+
function getNodeName(node) {
|
|
26856
|
+
if (isNode(node)) {
|
|
26857
|
+
return (node.nodeName || '').toLowerCase();
|
|
26858
|
+
}
|
|
26859
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
26860
|
+
// returning `#document` an infinite loop won't occur.
|
|
26861
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
26862
|
+
return '#document';
|
|
26863
|
+
}
|
|
26864
|
+
function getWindow(node) {
|
|
26865
|
+
var _node$ownerDocument;
|
|
26866
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
26867
|
+
}
|
|
26868
|
+
function getDocumentElement(node) {
|
|
26869
|
+
var _ref;
|
|
26870
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
26871
|
+
}
|
|
26872
|
+
function isNode(value) {
|
|
26873
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
26874
|
+
}
|
|
26875
|
+
function isElement(value) {
|
|
26876
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
26877
|
+
}
|
|
26878
|
+
function isHTMLElement(value) {
|
|
26879
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
26880
|
+
}
|
|
26881
|
+
function isShadowRoot(value) {
|
|
26882
|
+
// Browsers without `ShadowRoot` support.
|
|
26883
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
26884
|
+
return false;
|
|
26885
|
+
}
|
|
26886
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
26887
|
+
}
|
|
26888
|
+
function isOverflowElement(element) {
|
|
26889
|
+
const {
|
|
26890
|
+
overflow,
|
|
26891
|
+
overflowX,
|
|
26892
|
+
overflowY,
|
|
26893
|
+
display
|
|
26894
|
+
} = getComputedStyle$1(element);
|
|
26895
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
26896
|
+
}
|
|
26897
|
+
function isTableElement(element) {
|
|
26898
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
26899
|
+
}
|
|
26900
|
+
function isContainingBlock(element) {
|
|
26901
|
+
const webkit = isWebKit();
|
|
26902
|
+
const css = getComputedStyle$1(element);
|
|
26903
|
+
|
|
26904
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
26905
|
+
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));
|
|
26906
|
+
}
|
|
26907
|
+
function getContainingBlock(element) {
|
|
26908
|
+
let currentNode = getParentNode(element);
|
|
26909
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
26910
|
+
if (isContainingBlock(currentNode)) {
|
|
26911
|
+
return currentNode;
|
|
26912
|
+
} else {
|
|
26913
|
+
currentNode = getParentNode(currentNode);
|
|
26914
|
+
}
|
|
26915
|
+
}
|
|
26916
|
+
return null;
|
|
26917
|
+
}
|
|
26918
|
+
function isWebKit() {
|
|
26919
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
26920
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
26921
|
+
}
|
|
26922
|
+
function isLastTraversableNode(node) {
|
|
26923
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
26924
|
+
}
|
|
26925
|
+
function getComputedStyle$1(element) {
|
|
26926
|
+
return getWindow(element).getComputedStyle(element);
|
|
26927
|
+
}
|
|
26928
|
+
function getNodeScroll(element) {
|
|
26929
|
+
if (isElement(element)) {
|
|
26930
|
+
return {
|
|
26931
|
+
scrollLeft: element.scrollLeft,
|
|
26932
|
+
scrollTop: element.scrollTop
|
|
26933
|
+
};
|
|
26934
|
+
}
|
|
26935
|
+
return {
|
|
26936
|
+
scrollLeft: element.pageXOffset,
|
|
26937
|
+
scrollTop: element.pageYOffset
|
|
26938
|
+
};
|
|
26939
|
+
}
|
|
26940
|
+
function getParentNode(node) {
|
|
26941
|
+
if (getNodeName(node) === 'html') {
|
|
26942
|
+
return node;
|
|
26943
|
+
}
|
|
26944
|
+
const result =
|
|
26945
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
26946
|
+
node.assignedSlot ||
|
|
26947
|
+
// DOM Element detected.
|
|
26948
|
+
node.parentNode ||
|
|
26949
|
+
// ShadowRoot detected.
|
|
26950
|
+
isShadowRoot(node) && node.host ||
|
|
26951
|
+
// Fallback.
|
|
26952
|
+
getDocumentElement(node);
|
|
26953
|
+
return isShadowRoot(result) ? result.host : result;
|
|
26954
|
+
}
|
|
26955
|
+
function getNearestOverflowAncestor(node) {
|
|
26956
|
+
const parentNode = getParentNode(node);
|
|
26957
|
+
if (isLastTraversableNode(parentNode)) {
|
|
26958
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
26959
|
+
}
|
|
26960
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
26961
|
+
return parentNode;
|
|
26962
|
+
}
|
|
26963
|
+
return getNearestOverflowAncestor(parentNode);
|
|
26964
|
+
}
|
|
26965
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
26966
|
+
var _node$ownerDocument2;
|
|
26967
|
+
if (list === void 0) {
|
|
26968
|
+
list = [];
|
|
26969
|
+
}
|
|
26970
|
+
if (traverseIframes === void 0) {
|
|
26971
|
+
traverseIframes = true;
|
|
26972
|
+
}
|
|
26973
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
26974
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
26975
|
+
const win = getWindow(scrollableAncestor);
|
|
26976
|
+
if (isBody) {
|
|
26977
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
26978
|
+
}
|
|
26979
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
26980
|
+
}
|
|
26981
|
+
|
|
26982
|
+
function getCssDimensions(element) {
|
|
26983
|
+
const css = getComputedStyle$1(element);
|
|
26984
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
26985
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
26986
|
+
let width = parseFloat(css.width) || 0;
|
|
26987
|
+
let height = parseFloat(css.height) || 0;
|
|
26988
|
+
const hasOffset = isHTMLElement(element);
|
|
26989
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
26990
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
26991
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
26992
|
+
if (shouldFallback) {
|
|
26993
|
+
width = offsetWidth;
|
|
26994
|
+
height = offsetHeight;
|
|
26995
|
+
}
|
|
26996
|
+
return {
|
|
26997
|
+
width,
|
|
26998
|
+
height,
|
|
26999
|
+
$: shouldFallback
|
|
27000
|
+
};
|
|
27001
|
+
}
|
|
27002
|
+
|
|
27003
|
+
function unwrapElement(element) {
|
|
27004
|
+
return !isElement(element) ? element.contextElement : element;
|
|
27005
|
+
}
|
|
27006
|
+
|
|
27007
|
+
function getScale(element) {
|
|
27008
|
+
const domElement = unwrapElement(element);
|
|
27009
|
+
if (!isHTMLElement(domElement)) {
|
|
27010
|
+
return createCoords(1);
|
|
27011
|
+
}
|
|
27012
|
+
const rect = domElement.getBoundingClientRect();
|
|
27013
|
+
const {
|
|
27014
|
+
width,
|
|
27015
|
+
height,
|
|
27016
|
+
$
|
|
27017
|
+
} = getCssDimensions(domElement);
|
|
27018
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
27019
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
27020
|
+
|
|
27021
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
27022
|
+
|
|
27023
|
+
if (!x || !Number.isFinite(x)) {
|
|
27024
|
+
x = 1;
|
|
27025
|
+
}
|
|
27026
|
+
if (!y || !Number.isFinite(y)) {
|
|
27027
|
+
y = 1;
|
|
27028
|
+
}
|
|
27029
|
+
return {
|
|
27030
|
+
x,
|
|
27031
|
+
y
|
|
27032
|
+
};
|
|
27033
|
+
}
|
|
27034
|
+
|
|
27035
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
27036
|
+
function getVisualOffsets(element) {
|
|
27037
|
+
const win = getWindow(element);
|
|
27038
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
27039
|
+
return noOffsets;
|
|
27040
|
+
}
|
|
27041
|
+
return {
|
|
27042
|
+
x: win.visualViewport.offsetLeft,
|
|
27043
|
+
y: win.visualViewport.offsetTop
|
|
27044
|
+
};
|
|
27045
|
+
}
|
|
27046
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
27047
|
+
if (isFixed === void 0) {
|
|
27048
|
+
isFixed = false;
|
|
27049
|
+
}
|
|
27050
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
27051
|
+
return false;
|
|
27052
|
+
}
|
|
27053
|
+
return isFixed;
|
|
27054
|
+
}
|
|
27055
|
+
|
|
27056
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
27057
|
+
if (includeScale === void 0) {
|
|
27058
|
+
includeScale = false;
|
|
27059
|
+
}
|
|
27060
|
+
if (isFixedStrategy === void 0) {
|
|
27061
|
+
isFixedStrategy = false;
|
|
27062
|
+
}
|
|
27063
|
+
const clientRect = element.getBoundingClientRect();
|
|
27064
|
+
const domElement = unwrapElement(element);
|
|
27065
|
+
let scale = createCoords(1);
|
|
27066
|
+
if (includeScale) {
|
|
27067
|
+
if (offsetParent) {
|
|
27068
|
+
if (isElement(offsetParent)) {
|
|
27069
|
+
scale = getScale(offsetParent);
|
|
27070
|
+
}
|
|
27071
|
+
} else {
|
|
27072
|
+
scale = getScale(element);
|
|
27073
|
+
}
|
|
27074
|
+
}
|
|
27075
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
27076
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
27077
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
27078
|
+
let width = clientRect.width / scale.x;
|
|
27079
|
+
let height = clientRect.height / scale.y;
|
|
27080
|
+
if (domElement) {
|
|
27081
|
+
const win = getWindow(domElement);
|
|
27082
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
27083
|
+
let currentWin = win;
|
|
27084
|
+
let currentIFrame = currentWin.frameElement;
|
|
27085
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
27086
|
+
const iframeScale = getScale(currentIFrame);
|
|
27087
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
27088
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
27089
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
27090
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
27091
|
+
x *= iframeScale.x;
|
|
27092
|
+
y *= iframeScale.y;
|
|
27093
|
+
width *= iframeScale.x;
|
|
27094
|
+
height *= iframeScale.y;
|
|
27095
|
+
x += left;
|
|
27096
|
+
y += top;
|
|
27097
|
+
currentWin = getWindow(currentIFrame);
|
|
27098
|
+
currentIFrame = currentWin.frameElement;
|
|
27099
|
+
}
|
|
27100
|
+
}
|
|
27101
|
+
return rectToClientRect({
|
|
27102
|
+
width,
|
|
27103
|
+
height,
|
|
27104
|
+
x,
|
|
27105
|
+
y
|
|
27106
|
+
});
|
|
27107
|
+
}
|
|
27108
|
+
|
|
27109
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
27110
|
+
function isTopLayer(floating) {
|
|
27111
|
+
return topLayerSelectors.some(selector => {
|
|
27112
|
+
try {
|
|
27113
|
+
return floating.matches(selector);
|
|
27114
|
+
} catch (e) {
|
|
27115
|
+
return false;
|
|
27116
|
+
}
|
|
27117
|
+
});
|
|
27118
|
+
}
|
|
27119
|
+
|
|
27120
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
27121
|
+
let {
|
|
27122
|
+
elements,
|
|
27123
|
+
rect,
|
|
27124
|
+
offsetParent,
|
|
27125
|
+
strategy
|
|
27126
|
+
} = _ref;
|
|
27127
|
+
const isFixed = strategy === 'fixed';
|
|
27128
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
27129
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
27130
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
27131
|
+
return rect;
|
|
27132
|
+
}
|
|
27133
|
+
let scroll = {
|
|
27134
|
+
scrollLeft: 0,
|
|
27135
|
+
scrollTop: 0
|
|
27136
|
+
};
|
|
27137
|
+
let scale = createCoords(1);
|
|
27138
|
+
const offsets = createCoords(0);
|
|
27139
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
27140
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
27141
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
27142
|
+
scroll = getNodeScroll(offsetParent);
|
|
27143
|
+
}
|
|
27144
|
+
if (isHTMLElement(offsetParent)) {
|
|
27145
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
27146
|
+
scale = getScale(offsetParent);
|
|
27147
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
27148
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
27149
|
+
}
|
|
27150
|
+
}
|
|
27151
|
+
return {
|
|
27152
|
+
width: rect.width * scale.x,
|
|
27153
|
+
height: rect.height * scale.y,
|
|
27154
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
27155
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
27156
|
+
};
|
|
27157
|
+
}
|
|
27158
|
+
|
|
27159
|
+
function getClientRects(element) {
|
|
27160
|
+
return Array.from(element.getClientRects());
|
|
27161
|
+
}
|
|
27162
|
+
|
|
27163
|
+
function getWindowScrollBarX(element) {
|
|
27164
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
27165
|
+
// incorrect for RTL.
|
|
27166
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
27167
|
+
}
|
|
27168
|
+
|
|
27169
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
27170
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
27171
|
+
function getDocumentRect(element) {
|
|
27172
|
+
const html = getDocumentElement(element);
|
|
27173
|
+
const scroll = getNodeScroll(element);
|
|
27174
|
+
const body = element.ownerDocument.body;
|
|
27175
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
27176
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
27177
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
27178
|
+
const y = -scroll.scrollTop;
|
|
27179
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
27180
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
27181
|
+
}
|
|
27182
|
+
return {
|
|
27183
|
+
width,
|
|
27184
|
+
height,
|
|
27185
|
+
x,
|
|
27186
|
+
y
|
|
27187
|
+
};
|
|
27188
|
+
}
|
|
27189
|
+
|
|
27190
|
+
function getViewportRect(element, strategy) {
|
|
27191
|
+
const win = getWindow(element);
|
|
27192
|
+
const html = getDocumentElement(element);
|
|
27193
|
+
const visualViewport = win.visualViewport;
|
|
27194
|
+
let width = html.clientWidth;
|
|
27195
|
+
let height = html.clientHeight;
|
|
27196
|
+
let x = 0;
|
|
27197
|
+
let y = 0;
|
|
27198
|
+
if (visualViewport) {
|
|
27199
|
+
width = visualViewport.width;
|
|
27200
|
+
height = visualViewport.height;
|
|
27201
|
+
const visualViewportBased = isWebKit();
|
|
27202
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
27203
|
+
x = visualViewport.offsetLeft;
|
|
27204
|
+
y = visualViewport.offsetTop;
|
|
27205
|
+
}
|
|
27206
|
+
}
|
|
27207
|
+
return {
|
|
27208
|
+
width,
|
|
27209
|
+
height,
|
|
27210
|
+
x,
|
|
27211
|
+
y
|
|
27212
|
+
};
|
|
27213
|
+
}
|
|
27214
|
+
|
|
27215
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
27216
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
27217
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
27218
|
+
const top = clientRect.top + element.clientTop;
|
|
27219
|
+
const left = clientRect.left + element.clientLeft;
|
|
27220
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
27221
|
+
const width = element.clientWidth * scale.x;
|
|
27222
|
+
const height = element.clientHeight * scale.y;
|
|
27223
|
+
const x = left * scale.x;
|
|
27224
|
+
const y = top * scale.y;
|
|
27225
|
+
return {
|
|
27226
|
+
width,
|
|
27227
|
+
height,
|
|
27228
|
+
x,
|
|
27229
|
+
y
|
|
27230
|
+
};
|
|
27231
|
+
}
|
|
27232
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
27233
|
+
let rect;
|
|
27234
|
+
if (clippingAncestor === 'viewport') {
|
|
27235
|
+
rect = getViewportRect(element, strategy);
|
|
27236
|
+
} else if (clippingAncestor === 'document') {
|
|
27237
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
27238
|
+
} else if (isElement(clippingAncestor)) {
|
|
27239
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
27240
|
+
} else {
|
|
27241
|
+
const visualOffsets = getVisualOffsets(element);
|
|
27242
|
+
rect = {
|
|
27243
|
+
...clippingAncestor,
|
|
27244
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
27245
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
27246
|
+
};
|
|
27247
|
+
}
|
|
27248
|
+
return rectToClientRect(rect);
|
|
27249
|
+
}
|
|
27250
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
27251
|
+
const parentNode = getParentNode(element);
|
|
27252
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
27253
|
+
return false;
|
|
27254
|
+
}
|
|
27255
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
27256
|
+
}
|
|
27257
|
+
|
|
27258
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
27259
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
27260
|
+
// of the given element up the tree.
|
|
27261
|
+
function getClippingElementAncestors(element, cache) {
|
|
27262
|
+
const cachedResult = cache.get(element);
|
|
27263
|
+
if (cachedResult) {
|
|
27264
|
+
return cachedResult;
|
|
27265
|
+
}
|
|
27266
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
27267
|
+
let currentContainingBlockComputedStyle = null;
|
|
27268
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
27269
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
27270
|
+
|
|
27271
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
27272
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
27273
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
27274
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
27275
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
27276
|
+
currentContainingBlockComputedStyle = null;
|
|
27277
|
+
}
|
|
27278
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
27279
|
+
if (shouldDropCurrentNode) {
|
|
27280
|
+
// Drop non-containing blocks.
|
|
27281
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
27282
|
+
} else {
|
|
27283
|
+
// Record last containing block for next iteration.
|
|
27284
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
27285
|
+
}
|
|
27286
|
+
currentNode = getParentNode(currentNode);
|
|
27287
|
+
}
|
|
27288
|
+
cache.set(element, result);
|
|
27289
|
+
return result;
|
|
27290
|
+
}
|
|
27291
|
+
|
|
27292
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
27293
|
+
// clipping ancestors.
|
|
27294
|
+
function getClippingRect(_ref) {
|
|
27295
|
+
let {
|
|
27296
|
+
element,
|
|
27297
|
+
boundary,
|
|
27298
|
+
rootBoundary,
|
|
27299
|
+
strategy
|
|
27300
|
+
} = _ref;
|
|
27301
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
27302
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
27303
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
27304
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
27305
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
27306
|
+
accRect.top = max(rect.top, accRect.top);
|
|
27307
|
+
accRect.right = min(rect.right, accRect.right);
|
|
27308
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
27309
|
+
accRect.left = max(rect.left, accRect.left);
|
|
27310
|
+
return accRect;
|
|
27311
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
27312
|
+
return {
|
|
27313
|
+
width: clippingRect.right - clippingRect.left,
|
|
27314
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
27315
|
+
x: clippingRect.left,
|
|
27316
|
+
y: clippingRect.top
|
|
27317
|
+
};
|
|
27318
|
+
}
|
|
27319
|
+
|
|
27320
|
+
function getDimensions(element) {
|
|
27321
|
+
const {
|
|
27322
|
+
width,
|
|
27323
|
+
height
|
|
27324
|
+
} = getCssDimensions(element);
|
|
27325
|
+
return {
|
|
27326
|
+
width,
|
|
27327
|
+
height
|
|
27328
|
+
};
|
|
27329
|
+
}
|
|
27330
|
+
|
|
27331
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
27332
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
27333
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
27334
|
+
const isFixed = strategy === 'fixed';
|
|
27335
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
27336
|
+
let scroll = {
|
|
27337
|
+
scrollLeft: 0,
|
|
27338
|
+
scrollTop: 0
|
|
27339
|
+
};
|
|
27340
|
+
const offsets = createCoords(0);
|
|
27341
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
27342
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
27343
|
+
scroll = getNodeScroll(offsetParent);
|
|
27344
|
+
}
|
|
27345
|
+
if (isOffsetParentAnElement) {
|
|
27346
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
27347
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
27348
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
27349
|
+
} else if (documentElement) {
|
|
27350
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
27351
|
+
}
|
|
27352
|
+
}
|
|
27353
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
27354
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
27355
|
+
return {
|
|
27356
|
+
x,
|
|
27357
|
+
y,
|
|
27358
|
+
width: rect.width,
|
|
27359
|
+
height: rect.height
|
|
27360
|
+
};
|
|
27361
|
+
}
|
|
27362
|
+
|
|
27363
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
27364
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
27365
|
+
return null;
|
|
27366
|
+
}
|
|
27367
|
+
if (polyfill) {
|
|
27368
|
+
return polyfill(element);
|
|
27369
|
+
}
|
|
27370
|
+
return element.offsetParent;
|
|
27371
|
+
}
|
|
27372
|
+
|
|
27373
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
27374
|
+
// such as table ancestors and cross browser bugs.
|
|
27375
|
+
function getOffsetParent(element, polyfill) {
|
|
27376
|
+
const window = getWindow(element);
|
|
27377
|
+
if (!isHTMLElement(element) || isTopLayer(element)) {
|
|
27378
|
+
return window;
|
|
27379
|
+
}
|
|
27380
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
27381
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
27382
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
27383
|
+
}
|
|
27384
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
27385
|
+
return window;
|
|
27386
|
+
}
|
|
27387
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
27388
|
+
}
|
|
27389
|
+
|
|
27390
|
+
const getElementRects = async function (data) {
|
|
27391
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
27392
|
+
const getDimensionsFn = this.getDimensions;
|
|
27393
|
+
return {
|
|
27394
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
27395
|
+
floating: {
|
|
27396
|
+
x: 0,
|
|
27397
|
+
y: 0,
|
|
27398
|
+
...(await getDimensionsFn(data.floating))
|
|
27399
|
+
}
|
|
27400
|
+
};
|
|
27401
|
+
};
|
|
27402
|
+
|
|
27403
|
+
function isRTL(element) {
|
|
27404
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
27405
|
+
}
|
|
27406
|
+
|
|
27407
|
+
const platform = {
|
|
27408
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
27409
|
+
getDocumentElement,
|
|
27410
|
+
getClippingRect,
|
|
27411
|
+
getOffsetParent,
|
|
27412
|
+
getElementRects,
|
|
27413
|
+
getClientRects,
|
|
27414
|
+
getDimensions,
|
|
27415
|
+
getScale,
|
|
27416
|
+
isElement,
|
|
27417
|
+
isRTL
|
|
27418
|
+
};
|
|
27419
|
+
|
|
27420
|
+
// https://samthor.au/2021/observing-dom/
|
|
27421
|
+
function observeMove(element, onMove) {
|
|
27422
|
+
let io = null;
|
|
27423
|
+
let timeoutId;
|
|
27424
|
+
const root = getDocumentElement(element);
|
|
27425
|
+
function cleanup() {
|
|
27426
|
+
var _io;
|
|
27427
|
+
clearTimeout(timeoutId);
|
|
27428
|
+
(_io = io) == null || _io.disconnect();
|
|
27429
|
+
io = null;
|
|
27430
|
+
}
|
|
27431
|
+
function refresh(skip, threshold) {
|
|
27432
|
+
if (skip === void 0) {
|
|
27433
|
+
skip = false;
|
|
27434
|
+
}
|
|
27435
|
+
if (threshold === void 0) {
|
|
27436
|
+
threshold = 1;
|
|
27437
|
+
}
|
|
27438
|
+
cleanup();
|
|
27439
|
+
const {
|
|
27440
|
+
left,
|
|
27441
|
+
top,
|
|
27442
|
+
width,
|
|
27443
|
+
height
|
|
27444
|
+
} = element.getBoundingClientRect();
|
|
27445
|
+
if (!skip) {
|
|
27446
|
+
onMove();
|
|
27447
|
+
}
|
|
27448
|
+
if (!width || !height) {
|
|
27449
|
+
return;
|
|
27450
|
+
}
|
|
27451
|
+
const insetTop = floor(top);
|
|
27452
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
27453
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
27454
|
+
const insetLeft = floor(left);
|
|
27455
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
27456
|
+
const options = {
|
|
27457
|
+
rootMargin,
|
|
27458
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
27459
|
+
};
|
|
27460
|
+
let isFirstUpdate = true;
|
|
27461
|
+
function handleObserve(entries) {
|
|
27462
|
+
const ratio = entries[0].intersectionRatio;
|
|
27463
|
+
if (ratio !== threshold) {
|
|
27464
|
+
if (!isFirstUpdate) {
|
|
27465
|
+
return refresh();
|
|
27466
|
+
}
|
|
27467
|
+
if (!ratio) {
|
|
27468
|
+
timeoutId = setTimeout(() => {
|
|
27469
|
+
refresh(false, 1e-7);
|
|
27470
|
+
}, 100);
|
|
27471
|
+
} else {
|
|
27472
|
+
refresh(false, ratio);
|
|
27473
|
+
}
|
|
27474
|
+
}
|
|
27475
|
+
isFirstUpdate = false;
|
|
27476
|
+
}
|
|
27477
|
+
|
|
27478
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
27479
|
+
// error.
|
|
27480
|
+
try {
|
|
27481
|
+
io = new IntersectionObserver(handleObserve, {
|
|
27482
|
+
...options,
|
|
27483
|
+
// Handle <iframe>s
|
|
27484
|
+
root: root.ownerDocument
|
|
27485
|
+
});
|
|
27486
|
+
} catch (e) {
|
|
27487
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
27488
|
+
}
|
|
27489
|
+
io.observe(element);
|
|
27490
|
+
}
|
|
27491
|
+
refresh(true);
|
|
27492
|
+
return cleanup;
|
|
27493
|
+
}
|
|
27494
|
+
|
|
27495
|
+
/**
|
|
27496
|
+
* Automatically updates the position of the floating element when necessary.
|
|
27497
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
27498
|
+
* visible on the screen.
|
|
27499
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
27500
|
+
* removed from the DOM or hidden from the screen.
|
|
27501
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
27502
|
+
*/
|
|
27503
|
+
function autoUpdate(reference, floating, update, options) {
|
|
27504
|
+
if (options === void 0) {
|
|
27505
|
+
options = {};
|
|
27506
|
+
}
|
|
27507
|
+
const {
|
|
27508
|
+
ancestorScroll = true,
|
|
27509
|
+
ancestorResize = true,
|
|
27510
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
27511
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
27512
|
+
animationFrame = false
|
|
27513
|
+
} = options;
|
|
27514
|
+
const referenceEl = unwrapElement(reference);
|
|
27515
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
27516
|
+
ancestors.forEach(ancestor => {
|
|
27517
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
27518
|
+
passive: true
|
|
27519
|
+
});
|
|
27520
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
27521
|
+
});
|
|
27522
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
27523
|
+
let reobserveFrame = -1;
|
|
27524
|
+
let resizeObserver = null;
|
|
27525
|
+
if (elementResize) {
|
|
27526
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
27527
|
+
let [firstEntry] = _ref;
|
|
27528
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
27529
|
+
// Prevent update loops when using the `size` middleware.
|
|
27530
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
27531
|
+
resizeObserver.unobserve(floating);
|
|
27532
|
+
cancelAnimationFrame(reobserveFrame);
|
|
27533
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
27534
|
+
var _resizeObserver;
|
|
27535
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
27536
|
+
});
|
|
27537
|
+
}
|
|
27538
|
+
update();
|
|
27539
|
+
});
|
|
27540
|
+
if (referenceEl && !animationFrame) {
|
|
27541
|
+
resizeObserver.observe(referenceEl);
|
|
27542
|
+
}
|
|
27543
|
+
resizeObserver.observe(floating);
|
|
27544
|
+
}
|
|
27545
|
+
let frameId;
|
|
27546
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
27547
|
+
if (animationFrame) {
|
|
27548
|
+
frameLoop();
|
|
27549
|
+
}
|
|
27550
|
+
function frameLoop() {
|
|
27551
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
27552
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
27553
|
+
update();
|
|
27554
|
+
}
|
|
27555
|
+
prevRefRect = nextRefRect;
|
|
27556
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
27557
|
+
}
|
|
27558
|
+
update();
|
|
27559
|
+
return () => {
|
|
27560
|
+
var _resizeObserver2;
|
|
27561
|
+
ancestors.forEach(ancestor => {
|
|
27562
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
27563
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
27564
|
+
});
|
|
27565
|
+
cleanupIo == null || cleanupIo();
|
|
27566
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
27567
|
+
resizeObserver = null;
|
|
27568
|
+
if (animationFrame) {
|
|
27569
|
+
cancelAnimationFrame(frameId);
|
|
27570
|
+
}
|
|
27571
|
+
};
|
|
27572
|
+
}
|
|
27573
|
+
|
|
27574
|
+
/**
|
|
27575
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
27576
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
27577
|
+
* @see https://floating-ui.com/docs/shift
|
|
27578
|
+
*/
|
|
27579
|
+
const shift = shift$1;
|
|
27580
|
+
|
|
27581
|
+
/**
|
|
27582
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
27583
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
27584
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
27585
|
+
* @see https://floating-ui.com/docs/flip
|
|
27586
|
+
*/
|
|
27587
|
+
const flip = flip$1;
|
|
27588
|
+
|
|
27589
|
+
/**
|
|
27590
|
+
* Provides data to position an inner element of the floating element so that it
|
|
27591
|
+
* appears centered to the reference element.
|
|
27592
|
+
* @see https://floating-ui.com/docs/arrow
|
|
27593
|
+
*/
|
|
27594
|
+
const arrow = arrow$1;
|
|
27595
|
+
|
|
27596
|
+
/**
|
|
27597
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
27598
|
+
* next to a given reference element.
|
|
27599
|
+
*/
|
|
27600
|
+
const computePosition = (reference, floating, options) => {
|
|
27601
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
27602
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
27603
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
27604
|
+
const cache = new Map();
|
|
27605
|
+
const mergedOptions = {
|
|
27606
|
+
platform,
|
|
27607
|
+
...options
|
|
27608
|
+
};
|
|
27609
|
+
const platformWithCache = {
|
|
27610
|
+
...mergedOptions.platform,
|
|
27611
|
+
_c: cache
|
|
27612
|
+
};
|
|
27613
|
+
return computePosition$1(reference, floating, {
|
|
27614
|
+
...mergedOptions,
|
|
27615
|
+
platform: platformWithCache
|
|
27616
|
+
});
|
|
27617
|
+
};
|
|
27618
|
+
|
|
27619
|
+
/*
|
|
27620
|
+
* React Tooltip
|
|
27621
|
+
* {@link https://github.com/ReactTooltip/react-tooltip}
|
|
27622
|
+
* @copyright ReactTooltip Team
|
|
27623
|
+
* @license MIT
|
|
27624
|
+
*/
|
|
27625
|
+
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?React$1.useLayoutEffect:React$1.useEffect,R="DEFAULT_TOOLTIP_ID",x={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},N=React$1.createContext({getTooltipData:()=>x});function I(e=R){return React$1.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=React$1.useRef(null),ce=React$1.useRef(null),ie=React$1.useRef(null),se=React$1.useRef(null),ae=React$1.useRef(null),[ue,de]=React$1.useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[pe,ve]=React$1.useState(!1),[me,fe]=React$1.useState(!1),[ye,he]=React$1.useState(null),we=React$1.useRef(!1),be=React$1.useRef(null),{anchorRefs:Se,setActiveAnchor:Ee}=I(r),ge=React$1.useRef(!1),[Ae,_e]=React$1.useState([]),Oe=React$1.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));};React$1.useEffect((()=>{if(void 0===Y)return ()=>null;Y&&fe(!0);const e=setTimeout((()=>{ve(Y);}),10);return ()=>{clearTimeout(e);}}),[Y]),React$1.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=React$1.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]);React$1.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]),React$1.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]),React$1.useEffect((()=>{Ve();}),[Ve]),React$1.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]),React$1.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]),React$1.useEffect((()=>(G&&xe(!0),()=>{ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current);})),[]),React$1.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]),React$1.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 React$1.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__namespace.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__namespace.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__namespace.default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),H=React__namespace.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]=React$1.useState(c),[ee,te]=React$1.useState(i),[oe,re]=React$1.useState(v),[le,ne]=React$1.useState(p),[ce,ie]=React$1.useState(m),[se,ae]=React$1.useState(g),[ue,de]=React$1.useState(_),[pe,ve]=React$1.useState(O),[me,fe]=React$1.useState(T),[ye,he]=React$1.useState(f),[we,be]=React$1.useState(w),[Se,Ee]=React$1.useState(S),[ge,Ae]=React$1.useState(null),[_e,Oe]=React$1.useState(null),Te=React$1.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);}));};React$1.useEffect((()=>{Q(c);}),[c]),React$1.useEffect((()=>{te(i);}),[i]),React$1.useEffect((()=>{re(v);}),[v]),React$1.useEffect((()=>{ne(p);}),[p]),React$1.useEffect((()=>{ie(m);}),[m]),React$1.useEffect((()=>{ae(g);}),[g]),React$1.useEffect((()=>{de(_);}),[_]),React$1.useEffect((()=>{ve(O);}),[O]),React$1.useEffect((()=>{fe(T);}),[T]),React$1.useEffect((()=>{Ee(S);}),[S]),React$1.useEffect((()=>{Te.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),React$1.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),React$1.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]),React$1.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=React$1.useRef(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?React__namespace.default.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null;}else J&&(xe=J);ee&&(xe=React__namespace.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__namespace.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:`
|
|
27626
|
+
.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"});}));
|
|
27627
|
+
|
|
27628
|
+
const StyledTooltip = styled__default.default.div `
|
|
27629
|
+
display: inline-block;
|
|
27630
|
+
|
|
27631
|
+
i:hover {
|
|
27632
|
+
cursor: pointer;
|
|
27633
|
+
}
|
|
27634
|
+
|
|
27635
|
+
p {
|
|
27636
|
+
line-height: 1.4;
|
|
27637
|
+
font-size: 13px;
|
|
27638
|
+
}
|
|
27639
|
+
|
|
27640
|
+
.tool {
|
|
27641
|
+
background: ${allColors.oxfordBlue} !important;
|
|
27642
|
+
border: 1px solid ${allColors.baliHai} !important;
|
|
27643
|
+
border-radius: 2px !important;
|
|
27644
|
+
padding: 8px 11px !important;
|
|
27645
|
+
opacity: 1 !important;
|
|
27646
|
+
|
|
27647
|
+
&.place-left:after {
|
|
27648
|
+
border-left-color: ${allColors.oxfordBlue} !important;
|
|
27649
|
+
border-top: 5px solid transparent !important;
|
|
27650
|
+
border-bottom: 5px solid transparent !important;
|
|
27651
|
+
right: -6px !important;
|
|
27652
|
+
top: 50% !important;
|
|
27653
|
+
margin-top: -9px !important;
|
|
27654
|
+
}
|
|
27655
|
+
|
|
27656
|
+
&.place-left:before {
|
|
27657
|
+
border-left-color: ${allColors.baliHai} !important;
|
|
27658
|
+
border-left-width: 8px !important;
|
|
27659
|
+
border-left-style: solid !important;
|
|
27660
|
+
margin-top: -10px !important;
|
|
27661
|
+
}
|
|
27662
|
+
|
|
27663
|
+
&.place-right:after {
|
|
27664
|
+
border-right-color: ${allColors.oxfordBlue} !important;
|
|
27665
|
+
border-top: 5px solid transparent !important;
|
|
27666
|
+
border-bottom: 5px solid transparent !important;
|
|
27667
|
+
left: -6px !important;
|
|
27668
|
+
top: 50% !important;
|
|
27669
|
+
margin-top: -9px !important;
|
|
27670
|
+
}
|
|
27671
|
+
|
|
27672
|
+
&.place-right:before {
|
|
27673
|
+
border-right-color: ${allColors.baliHai} !important;
|
|
27674
|
+
border-right-width: 8px !important;
|
|
27675
|
+
border-right-style: solid !important;
|
|
27676
|
+
margin-top: -10px !important;
|
|
27677
|
+
}
|
|
27678
|
+
|
|
27679
|
+
&.place-top:after {
|
|
27680
|
+
border-top-color: ${allColors.oxfordBlue} !important;
|
|
27681
|
+
}
|
|
27682
|
+
|
|
27683
|
+
&.place-top:before {
|
|
27684
|
+
border-top-color: ${allColors.baliHai} !important;
|
|
27685
|
+
border-top-width: 8px !important;
|
|
27686
|
+
border-top-style: solid !important;
|
|
27687
|
+
}
|
|
27688
|
+
|
|
27689
|
+
&.place-bottom:after {
|
|
27690
|
+
border-bottom-color: ${allColors.oxfordBlue} !important;
|
|
27691
|
+
}
|
|
27692
|
+
|
|
27693
|
+
&.place-bottom:before {
|
|
27694
|
+
border-bottom-color: ${allColors.baliHai} !important;
|
|
27695
|
+
border-bottom-width: 8px !important;
|
|
27696
|
+
border-bottom-style: solid !important;
|
|
27697
|
+
}
|
|
27698
|
+
}
|
|
27699
|
+
`;
|
|
27700
|
+
|
|
27701
|
+
var PlacesType;
|
|
27702
|
+
(function (PlacesType) {
|
|
27703
|
+
PlacesType["top"] = "top";
|
|
27704
|
+
PlacesType["top-start"] = "top-start";
|
|
27705
|
+
PlacesType["top-end"] = "top-end";
|
|
27706
|
+
PlacesType["right"] = "right";
|
|
27707
|
+
PlacesType["right-start"] = "right-start";
|
|
27708
|
+
PlacesType["right-end"] = "right-end";
|
|
27709
|
+
PlacesType["bottom"] = "bottom";
|
|
27710
|
+
PlacesType["bottom-start"] = "bottom-start";
|
|
27711
|
+
PlacesType["bottom-end"] = "bottom-end";
|
|
27712
|
+
PlacesType["left"] = "left";
|
|
27713
|
+
PlacesType["left-start"] = "left-start";
|
|
27714
|
+
PlacesType["left-end"] = "left-end";
|
|
27715
|
+
})(PlacesType || (PlacesType = {}));
|
|
27716
|
+
const Tooltip = (props) => {
|
|
27717
|
+
return (jsxRuntime$1.jsxs(StyledTooltip, { className: props.className, "data-cy": props['data-cy'], id: props.id,
|
|
27718
|
+
// this was done in a hurry, consider refactor on next pass.
|
|
27719
|
+
style: { display: props.block ? 'block' : 'inline-block' }, children: [props.questionMark && (jsxRuntime$1.jsx("i", { style: { color: allColors.curiousBlue }, className: props.questionMarkClassName, "data-tooltip-id": props.for, "data-tooltip-place": props.place || 'top', children: jsxRuntime$1.jsx(Icon, { name: "fa-question-circle" }) })), jsxRuntime$1.jsx(H, { className: "tool",
|
|
27720
|
+
// globalEventOff={props.clickToShow ? 'click' : ''}
|
|
27721
|
+
// place={(props.place as PlacesType) || 'top'}
|
|
27722
|
+
openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
|
|
27723
|
+
};
|
|
27724
|
+
|
|
25908
27725
|
exports.ANIMATION = animation;
|
|
25909
27726
|
exports.AbstractRadio = Radio$1;
|
|
25910
27727
|
exports.AbstractRadioGroup = RadioGroup$1;
|
|
@@ -25954,10 +27771,14 @@ exports.TYPOGRAPHY = typography;
|
|
|
25954
27771
|
exports.TextInput = TextInput;
|
|
25955
27772
|
exports.TextTruncate = TextTruncate;
|
|
25956
27773
|
exports.Toggle = Toggle;
|
|
27774
|
+
exports.Tooltip = Tooltip;
|
|
25957
27775
|
exports.Wizard = Wizard;
|
|
25958
27776
|
exports.WizardCard = WizardCard;
|
|
25959
27777
|
exports.WizardSection = WizardSection;
|
|
25960
27778
|
exports.WizardWithSidebar = WizardWithSidebar;
|
|
27779
|
+
exports.colorUtils = color;
|
|
25961
27780
|
exports.faIcons = faIcons;
|
|
25962
27781
|
exports.indicons = indicons;
|
|
27782
|
+
exports.numberUtils = number;
|
|
27783
|
+
exports.stringUtils = string;
|
|
25963
27784
|
//# sourceMappingURL=index.js.map
|