@copart/ops-tool-kit 1.10.0-alpha.22 → 1.10.0-alpha.24
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/dist/ops-tool-kit.js +2564 -112
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +3 -2
package/dist/ops-tool-kit.js
CHANGED
|
@@ -33,7 +33,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
33
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
34
34
|
|
|
35
35
|
const name$f = "@copart/ops-tool-kit";
|
|
36
|
-
const version$5 = "1.10.0-alpha.
|
|
36
|
+
const version$5 = "1.10.0-alpha.24";
|
|
37
37
|
const main$1 = "dist/ops-tool-kit.js";
|
|
38
38
|
const style = "dist/ops-tool-kit.css";
|
|
39
39
|
const files = [
|
|
@@ -113,7 +113,8 @@ const dependencies$1 = {
|
|
|
113
113
|
"storage-changed": "^2.0.0",
|
|
114
114
|
warning: "^4.0.1",
|
|
115
115
|
"@wordpress/block-library": "5.0.1",
|
|
116
|
-
websocket: "^1.0.34"
|
|
116
|
+
websocket: "^1.0.34",
|
|
117
|
+
"react-tooltip": "^5.20.0"
|
|
117
118
|
};
|
|
118
119
|
const jest = {
|
|
119
120
|
setupTestFrameworkScriptFile: "./jest/setup.js",
|
|
@@ -3940,32 +3941,32 @@ var runtime = createCommonjsModule(function (module) {
|
|
|
3940
3941
|
|
|
3941
3942
|
// This method of obtaining a reference to the global object needs to be
|
|
3942
3943
|
// kept identical to the way it is obtained in runtime.js
|
|
3943
|
-
var g$
|
|
3944
|
+
var g$2 = (function() {
|
|
3944
3945
|
return this || (typeof self === "object" && self);
|
|
3945
3946
|
})() || Function("return this")();
|
|
3946
3947
|
|
|
3947
3948
|
// Use `getOwnPropertyNames` because not all browsers support calling
|
|
3948
3949
|
// `hasOwnProperty` on the global `self` object in a worker. See #183.
|
|
3949
|
-
var hadRuntime = g$
|
|
3950
|
-
Object.getOwnPropertyNames(g$
|
|
3950
|
+
var hadRuntime = g$2.regeneratorRuntime &&
|
|
3951
|
+
Object.getOwnPropertyNames(g$2).indexOf("regeneratorRuntime") >= 0;
|
|
3951
3952
|
|
|
3952
3953
|
// Save the old regeneratorRuntime in case it needs to be restored later.
|
|
3953
|
-
var oldRuntime = hadRuntime && g$
|
|
3954
|
+
var oldRuntime = hadRuntime && g$2.regeneratorRuntime;
|
|
3954
3955
|
|
|
3955
3956
|
// Force reevalutation of runtime.js.
|
|
3956
|
-
g$
|
|
3957
|
+
g$2.regeneratorRuntime = undefined;
|
|
3957
3958
|
|
|
3958
3959
|
var runtimeModule = runtime;
|
|
3959
3960
|
|
|
3960
3961
|
if (hadRuntime) {
|
|
3961
3962
|
// Restore the original runtime.
|
|
3962
|
-
g$
|
|
3963
|
+
g$2.regeneratorRuntime = oldRuntime;
|
|
3963
3964
|
} else {
|
|
3964
3965
|
// Remove the global property added by runtime.js.
|
|
3965
3966
|
try {
|
|
3966
|
-
delete g$
|
|
3967
|
+
delete g$2.regeneratorRuntime;
|
|
3967
3968
|
} catch(e) {
|
|
3968
|
-
g$
|
|
3969
|
+
g$2.regeneratorRuntime = undefined;
|
|
3969
3970
|
}
|
|
3970
3971
|
}
|
|
3971
3972
|
|
|
@@ -4602,13 +4603,13 @@ function nonStandardBrowserEnv() {
|
|
|
4602
4603
|
|
|
4603
4604
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
4604
4605
|
|
|
4605
|
-
function E() {
|
|
4606
|
+
function E$1() {
|
|
4606
4607
|
this.message = 'String contains an invalid character';
|
|
4607
4608
|
}
|
|
4608
4609
|
|
|
4609
|
-
E.prototype = new Error();
|
|
4610
|
-
E.prototype.code = 5;
|
|
4611
|
-
E.prototype.name = 'InvalidCharacterError';
|
|
4610
|
+
E$1.prototype = new Error();
|
|
4611
|
+
E$1.prototype.code = 5;
|
|
4612
|
+
E$1.prototype.name = 'InvalidCharacterError';
|
|
4612
4613
|
|
|
4613
4614
|
function btoa$2(input) {
|
|
4614
4615
|
var str = String(input);
|
|
@@ -4623,7 +4624,7 @@ function btoa$2(input) {
|
|
|
4623
4624
|
charCode = str.charCodeAt(idx += 3 / 4);
|
|
4624
4625
|
|
|
4625
4626
|
if (charCode > 0xFF) {
|
|
4626
|
-
throw new E();
|
|
4627
|
+
throw new E$1();
|
|
4627
4628
|
}
|
|
4628
4629
|
|
|
4629
4630
|
block = block << 8 | charCode;
|
|
@@ -10442,7 +10443,7 @@ var flatten$1 = flatten;
|
|
|
10442
10443
|
* @symb R.flip(f)(a, b, c) = f(b, a, c)
|
|
10443
10444
|
*/
|
|
10444
10445
|
|
|
10445
|
-
var flip =
|
|
10446
|
+
var flip$1 =
|
|
10446
10447
|
/*#__PURE__*/
|
|
10447
10448
|
_curry1(function flip(fn) {
|
|
10448
10449
|
return curryN$1(fn.length, function (a, b) {
|
|
@@ -10453,7 +10454,7 @@ _curry1(function flip(fn) {
|
|
|
10453
10454
|
});
|
|
10454
10455
|
});
|
|
10455
10456
|
|
|
10456
|
-
var flip$
|
|
10457
|
+
var flip$2 = flip$1;
|
|
10457
10458
|
|
|
10458
10459
|
/**
|
|
10459
10460
|
* Iterate over an input `object`, calling a provided function `fn` for each
|
|
@@ -17194,7 +17195,7 @@ try {
|
|
|
17194
17195
|
*/
|
|
17195
17196
|
|
|
17196
17197
|
|
|
17197
|
-
function getWindow(rootElement) {
|
|
17198
|
+
function getWindow$1(rootElement) {
|
|
17198
17199
|
if (_isSSR || typeof _window === 'undefined') {
|
|
17199
17200
|
return undefined;
|
|
17200
17201
|
} else {
|
|
@@ -17351,7 +17352,7 @@ function () {
|
|
|
17351
17352
|
var _this = this;
|
|
17352
17353
|
|
|
17353
17354
|
var immediateId = 0;
|
|
17354
|
-
var win = getWindow(targetElement);
|
|
17355
|
+
var win = getWindow$1(targetElement);
|
|
17355
17356
|
|
|
17356
17357
|
if (!this._isDisposed) {
|
|
17357
17358
|
if (!this._immediateIds) {
|
|
@@ -17390,7 +17391,7 @@ function () {
|
|
|
17390
17391
|
|
|
17391
17392
|
|
|
17392
17393
|
Async.prototype.clearImmediate = function (id, targetElement) {
|
|
17393
|
-
var win = getWindow(targetElement);
|
|
17394
|
+
var win = getWindow$1(targetElement);
|
|
17394
17395
|
|
|
17395
17396
|
if (this._immediateIds && this._immediateIds[id]) {
|
|
17396
17397
|
/* tslint:disable:ban-native-functions */
|
|
@@ -17682,7 +17683,7 @@ function () {
|
|
|
17682
17683
|
var _this = this;
|
|
17683
17684
|
|
|
17684
17685
|
var animationFrameId = 0;
|
|
17685
|
-
var win = getWindow(targetElement);
|
|
17686
|
+
var win = getWindow$1(targetElement);
|
|
17686
17687
|
|
|
17687
17688
|
if (!this._isDisposed) {
|
|
17688
17689
|
if (!this._animationFrameIds) {
|
|
@@ -17714,7 +17715,7 @@ function () {
|
|
|
17714
17715
|
};
|
|
17715
17716
|
|
|
17716
17717
|
Async.prototype.cancelAnimationFrame = function (id, targetElement) {
|
|
17717
|
-
var win = getWindow(targetElement);
|
|
17718
|
+
var win = getWindow$1(targetElement);
|
|
17718
17719
|
|
|
17719
17720
|
if (this._animationFrameIds && this._animationFrameIds[id]) {
|
|
17720
17721
|
/* tslint:disable:ban-native-functions */
|
|
@@ -18208,7 +18209,7 @@ function findScrollableParent(startingElement) {
|
|
|
18208
18209
|
|
|
18209
18210
|
if (!el || el === doc.body) {
|
|
18210
18211
|
// tslint:disable-next-line:no-any
|
|
18211
|
-
el = getWindow(startingElement);
|
|
18212
|
+
el = getWindow$1(startingElement);
|
|
18212
18213
|
}
|
|
18213
18214
|
|
|
18214
18215
|
return el;
|
|
@@ -18428,7 +18429,7 @@ function () {
|
|
|
18428
18429
|
function _getGlobalSettings() {
|
|
18429
18430
|
var _a;
|
|
18430
18431
|
|
|
18431
|
-
var win = getWindow();
|
|
18432
|
+
var win = getWindow$1();
|
|
18432
18433
|
var globalObj = win || {};
|
|
18433
18434
|
|
|
18434
18435
|
if (!globalObj[GLOBAL_SETTINGS_PROP_NAME]) {
|
|
@@ -19026,7 +19027,7 @@ function classNamesFunction(options) {
|
|
|
19026
19027
|
}
|
|
19027
19028
|
|
|
19028
19029
|
if (styleCalcCount > (options.cacheSize || MAX_CACHE_COUNT)) {
|
|
19029
|
-
var win = getWindow();
|
|
19030
|
+
var win = getWindow$1();
|
|
19030
19031
|
|
|
19031
19032
|
if ((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.FabricConfig) === null || _b === void 0 ? void 0 : _b.enableClassNameCacheFullWarning) {
|
|
19032
19033
|
console.warn("Styles are being recalculated too frequently. Cache miss rate is " + styleCalcCount + "/" + getClassNamesCount + "."); // tslint:disable-next-line:no-console
|
|
@@ -19850,7 +19851,7 @@ function focusAsync(element) {
|
|
|
19850
19851
|
}
|
|
19851
19852
|
|
|
19852
19853
|
targetToFocusOnNextRepaint = element;
|
|
19853
|
-
var win = getWindow(element);
|
|
19854
|
+
var win = getWindow$1(element);
|
|
19854
19855
|
|
|
19855
19856
|
if (win) {
|
|
19856
19857
|
// element.focus() is a no-op if the element is no longer in the DOM, meaning this is always safe
|
|
@@ -19911,7 +19912,7 @@ function getElementIndexPath(fromElement, toElement) {
|
|
|
19911
19912
|
var CURRENT_ID_PROPERTY = '__currentId__';
|
|
19912
19913
|
var DEFAULT_ID_STRING = 'id__'; // tslint:disable-next-line:no-any
|
|
19913
19914
|
|
|
19914
|
-
var _global = getWindow() || {};
|
|
19915
|
+
var _global = getWindow$1() || {};
|
|
19915
19916
|
|
|
19916
19917
|
if (_global[CURRENT_ID_PROPERTY] === undefined) {
|
|
19917
19918
|
_global[CURRENT_ID_PROPERTY] = 0;
|
|
@@ -20191,7 +20192,7 @@ var IsFocusHiddenClassName = 'ms-Fabric--isFocusHidden';
|
|
|
20191
20192
|
*/
|
|
20192
20193
|
|
|
20193
20194
|
function setFocusVisibility(enabled, target) {
|
|
20194
|
-
var win = target ? getWindow(target) : getWindow();
|
|
20195
|
+
var win = target ? getWindow$1(target) : getWindow$1();
|
|
20195
20196
|
|
|
20196
20197
|
if (win) {
|
|
20197
20198
|
var classList = win.document.body.classList;
|
|
@@ -20240,7 +20241,7 @@ function setMountCounters(key, delta) {
|
|
|
20240
20241
|
function useFocusRects(rootRef) {
|
|
20241
20242
|
var _a;
|
|
20242
20243
|
|
|
20243
|
-
var win = getWindow((_a = rootRef) === null || _a === void 0 ? void 0 : _a.current);
|
|
20244
|
+
var win = getWindow$1((_a = rootRef) === null || _a === void 0 ? void 0 : _a.current);
|
|
20244
20245
|
React__namespace.useEffect(function () {
|
|
20245
20246
|
var _a;
|
|
20246
20247
|
|
|
@@ -20309,7 +20310,7 @@ function getItem$1(key) {
|
|
|
20309
20310
|
var result = null;
|
|
20310
20311
|
|
|
20311
20312
|
try {
|
|
20312
|
-
var win = getWindow();
|
|
20313
|
+
var win = getWindow$1();
|
|
20313
20314
|
result = win ? win.localStorage.getItem(key) : null;
|
|
20314
20315
|
} catch (e) {
|
|
20315
20316
|
/* Eat the exception */
|
|
@@ -21043,7 +21044,7 @@ function _getFontBaseUrl() {
|
|
|
21043
21044
|
var _a, _b, _c; // tslint:disable-next-line:no-any
|
|
21044
21045
|
|
|
21045
21046
|
|
|
21046
|
-
var fabricConfig = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.FabricConfig;
|
|
21047
|
+
var fabricConfig = (_a = getWindow$1()) === null || _a === void 0 ? void 0 : _a.FabricConfig;
|
|
21047
21048
|
return _c = (_b = fabricConfig) === null || _b === void 0 ? void 0 : _b.fontBaseUrl, _c !== null && _c !== void 0 ? _c : DefaultBaseUrl;
|
|
21048
21049
|
}
|
|
21049
21050
|
/**
|
|
@@ -21211,7 +21212,7 @@ var _theme = createTheme({
|
|
|
21211
21212
|
var ThemeSettingName = 'theme';
|
|
21212
21213
|
|
|
21213
21214
|
if (!Customizations.getSettings([ThemeSettingName]).theme) {
|
|
21214
|
-
var win = getWindow(); // tslint:disable-line:no-any
|
|
21215
|
+
var win = getWindow$1(); // tslint:disable-line:no-any
|
|
21215
21216
|
|
|
21216
21217
|
if ((_c = (_b = win) === null || _b === void 0 ? void 0 : _b.FabricConfig) === null || _c === void 0 ? void 0 : _c.theme) {
|
|
21217
21218
|
_theme = createTheme(win.FabricConfig.theme);
|
|
@@ -22255,7 +22256,7 @@ function (_super) {
|
|
|
22255
22256
|
if (this._root.current) {
|
|
22256
22257
|
this._disposables.push(on(this._root.current, 'focus', this._onFocus, true), on(this._root.current, 'blur', this._onBlur, true));
|
|
22257
22258
|
|
|
22258
|
-
var currentWindow = getWindow(this._root.current);
|
|
22259
|
+
var currentWindow = getWindow$1(this._root.current);
|
|
22259
22260
|
|
|
22260
22261
|
if (currentWindow) {
|
|
22261
22262
|
this._disposables.push(on(currentWindow, 'keydown', this._onKeyDown));
|
|
@@ -22818,23 +22819,23 @@ function (_super) {
|
|
|
22818
22819
|
if (typeof target === 'string') {
|
|
22819
22820
|
var currentDoc = getDocument(currentElement);
|
|
22820
22821
|
this._target = currentDoc ? currentDoc.querySelector(target) : null;
|
|
22821
|
-
this._targetWindow = getWindow(currentElement);
|
|
22822
|
+
this._targetWindow = getWindow$1(currentElement);
|
|
22822
22823
|
} else if (!!target.stopPropagation) {
|
|
22823
|
-
this._targetWindow = getWindow(target.target);
|
|
22824
|
+
this._targetWindow = getWindow$1(target.target);
|
|
22824
22825
|
this._target = target;
|
|
22825
22826
|
} else if (!!target.getBoundingClientRect) {
|
|
22826
22827
|
var targetElement = target;
|
|
22827
|
-
this._targetWindow = getWindow(targetElement);
|
|
22828
|
+
this._targetWindow = getWindow$1(targetElement);
|
|
22828
22829
|
this._target = target;
|
|
22829
22830
|
} else if (target.current !== undefined) {
|
|
22830
22831
|
this._target = target.current;
|
|
22831
|
-
this._targetWindow = getWindow(this._target); // HTMLImgElements can have x and y values. The check for it being a point must go last.
|
|
22832
|
+
this._targetWindow = getWindow$1(this._target); // HTMLImgElements can have x and y values. The check for it being a point must go last.
|
|
22832
22833
|
} else {
|
|
22833
|
-
this._targetWindow = getWindow(currentElement);
|
|
22834
|
+
this._targetWindow = getWindow$1(currentElement);
|
|
22834
22835
|
this._target = target;
|
|
22835
22836
|
}
|
|
22836
22837
|
} else {
|
|
22837
|
-
this._targetWindow = getWindow(currentElement);
|
|
22838
|
+
this._targetWindow = getWindow$1(currentElement);
|
|
22838
22839
|
}
|
|
22839
22840
|
};
|
|
22840
22841
|
|
|
@@ -23910,7 +23911,7 @@ function (_super) {
|
|
|
23910
23911
|
_allInstances[this._id] = this;
|
|
23911
23912
|
|
|
23912
23913
|
if (root) {
|
|
23913
|
-
this._windowElement = getWindow(root);
|
|
23914
|
+
this._windowElement = getWindow$1(root);
|
|
23914
23915
|
var parentElement = getParent(root, ALLOW_VIRTUAL_ELEMENTS);
|
|
23915
23916
|
|
|
23916
23917
|
while (parentElement && parentElement !== this._getDocument().body && parentElement.nodeType === 1) {
|
|
@@ -27687,8 +27688,6 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
27687
27688
|
};
|
|
27688
27689
|
|
|
27689
27690
|
var getArticles = function getArticles(type) {
|
|
27690
|
-
console.log('+++getArticles type=', type);
|
|
27691
|
-
|
|
27692
27691
|
switch (type) {
|
|
27693
27692
|
case contentType.RECOMMENDED_HELP_RESOURCES.type:
|
|
27694
27693
|
return getRecommendedHelpArticles(helpContent);
|
|
@@ -30465,7 +30464,7 @@ function () {
|
|
|
30465
30464
|
}();
|
|
30466
30465
|
|
|
30467
30466
|
var filterRoles = function filterRoles(roles, invalidCodes) {
|
|
30468
|
-
return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$
|
|
30467
|
+
return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$2(includes$1)(invalidCodes), prop$1('countryCode'))))(roles);
|
|
30469
30468
|
};
|
|
30470
30469
|
|
|
30471
30470
|
var SettingsView =
|
|
@@ -37391,8 +37390,8 @@ var Banner = function Banner(props) {
|
|
|
37391
37390
|
dangerouslySetInnerHTML: {
|
|
37392
37391
|
__html: SanitizeNotificationContent(content)
|
|
37393
37392
|
}
|
|
37394
|
-
}),
|
|
37395
|
-
href: feedUrl,
|
|
37393
|
+
}), (feedUrl || link) && React__default["default"].createElement("a", {
|
|
37394
|
+
href: feedUrl || link,
|
|
37396
37395
|
target: "_blank",
|
|
37397
37396
|
className: "utilities_ops-announcements_Banner--feedUrl"
|
|
37398
37397
|
}, React__default["default"].createElement(coreComponents.Icon, {
|
|
@@ -37486,8 +37485,8 @@ var Banner = function Banner(props) {
|
|
|
37486
37485
|
dangerouslySetInnerHTML: {
|
|
37487
37486
|
__html: SanitizeNotificationContent(content)
|
|
37488
37487
|
}
|
|
37489
|
-
}),
|
|
37490
|
-
href: feedUrl,
|
|
37488
|
+
}), (feedUrl || link) && React__default["default"].createElement("a", {
|
|
37489
|
+
href: feedUrl || link,
|
|
37491
37490
|
target: "_blank",
|
|
37492
37491
|
className: "utilities_ops-announcements_Banner--feedUrl"
|
|
37493
37492
|
}, React__default["default"].createElement(coreComponents.Icon, {
|
|
@@ -38433,27 +38432,27 @@ styleInject(css_248z$5);
|
|
|
38433
38432
|
* LICENSE file in the root directory of this source tree.
|
|
38434
38433
|
*/
|
|
38435
38434
|
|
|
38436
|
-
var b = "function" === typeof Symbol && Symbol.for,
|
|
38437
|
-
c = b ? Symbol.for("react.element") : 60103,
|
|
38438
|
-
d = b ? Symbol.for("react.portal") : 60106,
|
|
38439
|
-
e = b ? Symbol.for("react.fragment") : 60107,
|
|
38440
|
-
f = b ? Symbol.for("react.strict_mode") : 60108,
|
|
38441
|
-
g = b ? Symbol.for("react.profiler") : 60114,
|
|
38442
|
-
h = b ? Symbol.for("react.provider") : 60109,
|
|
38443
|
-
k = b ? Symbol.for("react.context") : 60110,
|
|
38444
|
-
l = b ? Symbol.for("react.async_mode") : 60111,
|
|
38445
|
-
m = b ? Symbol.for("react.concurrent_mode") : 60111,
|
|
38446
|
-
n = b ? Symbol.for("react.forward_ref") : 60112,
|
|
38447
|
-
p = b ? Symbol.for("react.suspense") : 60113,
|
|
38448
|
-
q = b ? Symbol.for("react.suspense_list") : 60120,
|
|
38449
|
-
r = b ? Symbol.for("react.memo") : 60115,
|
|
38450
|
-
t = b ? Symbol.for("react.lazy") : 60116,
|
|
38451
|
-
v = b ? Symbol.for("react.block") : 60121,
|
|
38452
|
-
w = b ? Symbol.for("react.fundamental") : 60117,
|
|
38453
|
-
x = b ? Symbol.for("react.responder") : 60118,
|
|
38454
|
-
y = b ? Symbol.for("react.scope") : 60119;
|
|
38455
|
-
|
|
38456
|
-
function z(a) {
|
|
38435
|
+
var b$1 = "function" === typeof Symbol && Symbol.for,
|
|
38436
|
+
c = b$1 ? Symbol.for("react.element") : 60103,
|
|
38437
|
+
d = b$1 ? Symbol.for("react.portal") : 60106,
|
|
38438
|
+
e = b$1 ? Symbol.for("react.fragment") : 60107,
|
|
38439
|
+
f$1 = b$1 ? Symbol.for("react.strict_mode") : 60108,
|
|
38440
|
+
g$1 = b$1 ? Symbol.for("react.profiler") : 60114,
|
|
38441
|
+
h$1 = b$1 ? Symbol.for("react.provider") : 60109,
|
|
38442
|
+
k$1 = b$1 ? Symbol.for("react.context") : 60110,
|
|
38443
|
+
l = b$1 ? Symbol.for("react.async_mode") : 60111,
|
|
38444
|
+
m = b$1 ? Symbol.for("react.concurrent_mode") : 60111,
|
|
38445
|
+
n = b$1 ? Symbol.for("react.forward_ref") : 60112,
|
|
38446
|
+
p = b$1 ? Symbol.for("react.suspense") : 60113,
|
|
38447
|
+
q$1 = b$1 ? Symbol.for("react.suspense_list") : 60120,
|
|
38448
|
+
r = b$1 ? Symbol.for("react.memo") : 60115,
|
|
38449
|
+
t = b$1 ? Symbol.for("react.lazy") : 60116,
|
|
38450
|
+
v = b$1 ? Symbol.for("react.block") : 60121,
|
|
38451
|
+
w$1 = b$1 ? Symbol.for("react.fundamental") : 60117,
|
|
38452
|
+
x$1 = b$1 ? Symbol.for("react.responder") : 60118,
|
|
38453
|
+
y = b$1 ? Symbol.for("react.scope") : 60119;
|
|
38454
|
+
|
|
38455
|
+
function z$1(a) {
|
|
38457
38456
|
if ("object" === typeof a && null !== a) {
|
|
38458
38457
|
var u = a.$$typeof;
|
|
38459
38458
|
|
|
@@ -38463,18 +38462,18 @@ function z(a) {
|
|
|
38463
38462
|
case l:
|
|
38464
38463
|
case m:
|
|
38465
38464
|
case e:
|
|
38466
|
-
case g:
|
|
38467
|
-
case f:
|
|
38465
|
+
case g$1:
|
|
38466
|
+
case f$1:
|
|
38468
38467
|
case p:
|
|
38469
38468
|
return a;
|
|
38470
38469
|
|
|
38471
38470
|
default:
|
|
38472
38471
|
switch (a = a && a.$$typeof, a) {
|
|
38473
|
-
case k:
|
|
38472
|
+
case k$1:
|
|
38474
38473
|
case n:
|
|
38475
38474
|
case t:
|
|
38476
38475
|
case r:
|
|
38477
|
-
case h:
|
|
38476
|
+
case h$1:
|
|
38478
38477
|
return a;
|
|
38479
38478
|
|
|
38480
38479
|
default:
|
|
@@ -38489,79 +38488,79 @@ function z(a) {
|
|
|
38489
38488
|
}
|
|
38490
38489
|
}
|
|
38491
38490
|
|
|
38492
|
-
function A(a) {
|
|
38493
|
-
return z(a) === m;
|
|
38491
|
+
function A$1(a) {
|
|
38492
|
+
return z$1(a) === m;
|
|
38494
38493
|
}
|
|
38495
38494
|
|
|
38496
38495
|
var AsyncMode = l;
|
|
38497
38496
|
var ConcurrentMode = m;
|
|
38498
|
-
var ContextConsumer = k;
|
|
38499
|
-
var ContextProvider = h;
|
|
38497
|
+
var ContextConsumer = k$1;
|
|
38498
|
+
var ContextProvider = h$1;
|
|
38500
38499
|
var Element$1 = c;
|
|
38501
38500
|
var ForwardRef = n;
|
|
38502
38501
|
var Fragment = e;
|
|
38503
38502
|
var Lazy = t;
|
|
38504
38503
|
var Memo = r;
|
|
38505
38504
|
var Portal = d;
|
|
38506
|
-
var Profiler = g;
|
|
38507
|
-
var StrictMode = f;
|
|
38505
|
+
var Profiler = g$1;
|
|
38506
|
+
var StrictMode = f$1;
|
|
38508
38507
|
var Suspense = p;
|
|
38509
38508
|
|
|
38510
38509
|
var isAsyncMode = function (a) {
|
|
38511
|
-
return A(a) || z(a) === l;
|
|
38510
|
+
return A$1(a) || z$1(a) === l;
|
|
38512
38511
|
};
|
|
38513
38512
|
|
|
38514
|
-
var isConcurrentMode = A;
|
|
38513
|
+
var isConcurrentMode = A$1;
|
|
38515
38514
|
|
|
38516
38515
|
var isContextConsumer = function (a) {
|
|
38517
|
-
return z(a) === k;
|
|
38516
|
+
return z$1(a) === k$1;
|
|
38518
38517
|
};
|
|
38519
38518
|
|
|
38520
38519
|
var isContextProvider = function (a) {
|
|
38521
|
-
return z(a) === h;
|
|
38520
|
+
return z$1(a) === h$1;
|
|
38522
38521
|
};
|
|
38523
38522
|
|
|
38524
|
-
var isElement = function (a) {
|
|
38523
|
+
var isElement$1 = function (a) {
|
|
38525
38524
|
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
38526
38525
|
};
|
|
38527
38526
|
|
|
38528
38527
|
var isForwardRef = function (a) {
|
|
38529
|
-
return z(a) === n;
|
|
38528
|
+
return z$1(a) === n;
|
|
38530
38529
|
};
|
|
38531
38530
|
|
|
38532
38531
|
var isFragment = function (a) {
|
|
38533
|
-
return z(a) === e;
|
|
38532
|
+
return z$1(a) === e;
|
|
38534
38533
|
};
|
|
38535
38534
|
|
|
38536
38535
|
var isLazy = function (a) {
|
|
38537
|
-
return z(a) === t;
|
|
38536
|
+
return z$1(a) === t;
|
|
38538
38537
|
};
|
|
38539
38538
|
|
|
38540
38539
|
var isMemo = function (a) {
|
|
38541
|
-
return z(a) === r;
|
|
38540
|
+
return z$1(a) === r;
|
|
38542
38541
|
};
|
|
38543
38542
|
|
|
38544
38543
|
var isPortal = function (a) {
|
|
38545
|
-
return z(a) === d;
|
|
38544
|
+
return z$1(a) === d;
|
|
38546
38545
|
};
|
|
38547
38546
|
|
|
38548
38547
|
var isProfiler = function (a) {
|
|
38549
|
-
return z(a) === g;
|
|
38548
|
+
return z$1(a) === g$1;
|
|
38550
38549
|
};
|
|
38551
38550
|
|
|
38552
38551
|
var isStrictMode = function (a) {
|
|
38553
|
-
return z(a) === f;
|
|
38552
|
+
return z$1(a) === f$1;
|
|
38554
38553
|
};
|
|
38555
38554
|
|
|
38556
38555
|
var isSuspense = function (a) {
|
|
38557
|
-
return z(a) === p;
|
|
38556
|
+
return z$1(a) === p;
|
|
38558
38557
|
};
|
|
38559
38558
|
|
|
38560
38559
|
var isValidElementType = function (a) {
|
|
38561
|
-
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
38560
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g$1 || a === f$1 || a === p || a === q$1 || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h$1 || a.$$typeof === k$1 || a.$$typeof === n || a.$$typeof === w$1 || a.$$typeof === x$1 || a.$$typeof === y || a.$$typeof === v);
|
|
38562
38561
|
};
|
|
38563
38562
|
|
|
38564
|
-
var typeOf = z;
|
|
38563
|
+
var typeOf = z$1;
|
|
38565
38564
|
|
|
38566
38565
|
var reactIs_production_min = {
|
|
38567
38566
|
AsyncMode: AsyncMode,
|
|
@@ -38581,7 +38580,7 @@ var reactIs_production_min = {
|
|
|
38581
38580
|
isConcurrentMode: isConcurrentMode,
|
|
38582
38581
|
isContextConsumer: isContextConsumer,
|
|
38583
38582
|
isContextProvider: isContextProvider,
|
|
38584
|
-
isElement: isElement,
|
|
38583
|
+
isElement: isElement$1,
|
|
38585
38584
|
isForwardRef: isForwardRef,
|
|
38586
38585
|
isFragment: isFragment,
|
|
38587
38586
|
isLazy: isLazy,
|
|
@@ -42967,20 +42966,26 @@ AutoRefresh.defaultProps = {
|
|
|
42967
42966
|
version: ''
|
|
42968
42967
|
};
|
|
42969
42968
|
|
|
42970
|
-
var css_248z = ".utilities_ContextualHelp_ContextualHelp--snippet {\r\n padding:
|
|
42969
|
+
var css_248z = ".utilities_ContextualHelp_ContextualHelp--snippetContainer .utilities_ContextualHelp_ContextualHelp--snippet {\r\n padding: 5px;\r\n background-color: #fff;\r\n opacity: 1;\r\n z-index: 999;\r\n box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2);\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--snippetContainer .utilities_ContextualHelp_ContextualHelp--snippet .utilities_ContextualHelp_ContextualHelp--snippet-arrow {\r\n box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2);\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--title {\r\n font-size: 24px;\r\n color: #1d5ab9;\r\n font-weight: 600;\r\n margin-bottom: 5px;\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--linkedArticle {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n color: #1d5ab9;\r\n border-top: 3px solid #ccc;\r\n margin-top: 10px;\r\n font-size: 14px;\r\n padding-top: 10px;\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--linkedArticle p {\r\n cursor: pointer;\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--linkedArticle p i {\r\n font-size: 10px;\r\n color: #1d5ab9;\r\n position: relative;\r\n top: -3px;\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--linkedArticle.utilities_ContextualHelp_ContextualHelp--noLink {\r\n justify-content: flex-end;\r\n}\r\n.utilities_ContextualHelp_ContextualHelp--snippetContainer .utilities_ContextualHelp_ContextualHelp--snippetArticle {\r\n background-color: #fff;\r\n opacity: 1;\r\n z-index: 999;\r\n max-width: 400px;\r\n min-width: 250px;\r\n /* max-height: 500px; */\r\n min-height: 200px;\r\n overflow: auto;\r\n padding: 15px;\r\n}\r\n";
|
|
42971
42970
|
styleInject(css_248z);
|
|
42972
42971
|
|
|
42973
42972
|
var _styleModuleImportMap = {
|
|
42974
42973
|
"./ContextualHelp.css": {
|
|
42974
|
+
"snippetContainer": "utilities_ContextualHelp_ContextualHelp--snippetContainer",
|
|
42975
42975
|
"snippet": "utilities_ContextualHelp_ContextualHelp--snippet",
|
|
42976
|
+
"snippet-arrow": "utilities_ContextualHelp_ContextualHelp--snippet-arrow",
|
|
42976
42977
|
"title": "utilities_ContextualHelp_ContextualHelp--title",
|
|
42977
42978
|
"linkedArticle": "utilities_ContextualHelp_ContextualHelp--linkedArticle",
|
|
42978
|
-
"noLink": "utilities_ContextualHelp_ContextualHelp--noLink"
|
|
42979
|
+
"noLink": "utilities_ContextualHelp_ContextualHelp--noLink",
|
|
42980
|
+
"snippetArticle": "utilities_ContextualHelp_ContextualHelp--snippetArticle"
|
|
42979
42981
|
}
|
|
42980
42982
|
};
|
|
42981
42983
|
|
|
42982
42984
|
function Snippet(_ref) {
|
|
42983
|
-
var article = _ref.article
|
|
42985
|
+
var article = _ref.article,
|
|
42986
|
+
setTooltipStyles = _ref.setTooltipStyles,
|
|
42987
|
+
isMihelpEnabled = _ref.isMihelpEnabled,
|
|
42988
|
+
articleRef = _ref.articleRef;
|
|
42984
42989
|
|
|
42985
42990
|
var OpenLinkedArticle = function OpenLinkedArticle() {
|
|
42986
42991
|
var _article$linkedArticl;
|
|
@@ -42999,8 +43004,20 @@ function Snippet(_ref) {
|
|
|
42999
43004
|
});
|
|
43000
43005
|
};
|
|
43001
43006
|
|
|
43002
|
-
|
|
43003
|
-
|
|
43007
|
+
React.useEffect(function () {
|
|
43008
|
+
setTooltipStyles();
|
|
43009
|
+
}, []);
|
|
43010
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, !isMihelpEnabled ? React__default["default"].createElement("h3", {
|
|
43011
|
+
style: {
|
|
43012
|
+
color: 'rgba(224, 26, 26, 0.8)'
|
|
43013
|
+
}
|
|
43014
|
+
}, "Mihelp is not enabled for this app") : !article || !(article === null || article === void 0 ? void 0 : article.id) ? React__default["default"].createElement("h3", {
|
|
43015
|
+
style: {
|
|
43016
|
+
color: 'rgba(224, 26, 26, 0.8)'
|
|
43017
|
+
}
|
|
43018
|
+
}, "Article Not Found") : React__default["default"].createElement("div", {
|
|
43019
|
+
className: "utilities_ContextualHelp_ContextualHelp--snippetArticle",
|
|
43020
|
+
ref: articleRef
|
|
43004
43021
|
}, React__default["default"].createElement("div", {
|
|
43005
43022
|
className: "utilities_ContextualHelp_ContextualHelp--title"
|
|
43006
43023
|
}, React__default["default"].createElement("span", {
|
|
@@ -43027,11 +43044,2416 @@ function Snippet(_ref) {
|
|
|
43027
43044
|
color: '#1d5ab9',
|
|
43028
43045
|
cursor: 'pointer'
|
|
43029
43046
|
}
|
|
43030
|
-
}))));
|
|
43047
|
+
})))));
|
|
43048
|
+
}
|
|
43049
|
+
|
|
43050
|
+
const min = Math.min;
|
|
43051
|
+
const max = Math.max;
|
|
43052
|
+
const round = Math.round;
|
|
43053
|
+
const floor = Math.floor;
|
|
43054
|
+
|
|
43055
|
+
const createCoords = v => ({
|
|
43056
|
+
x: v,
|
|
43057
|
+
y: v
|
|
43058
|
+
});
|
|
43059
|
+
|
|
43060
|
+
const oppositeSideMap = {
|
|
43061
|
+
left: 'right',
|
|
43062
|
+
right: 'left',
|
|
43063
|
+
bottom: 'top',
|
|
43064
|
+
top: 'bottom'
|
|
43065
|
+
};
|
|
43066
|
+
const oppositeAlignmentMap = {
|
|
43067
|
+
start: 'end',
|
|
43068
|
+
end: 'start'
|
|
43069
|
+
};
|
|
43070
|
+
|
|
43071
|
+
function clamp(start, value, end) {
|
|
43072
|
+
return max(start, min(value, end));
|
|
43073
|
+
}
|
|
43074
|
+
|
|
43075
|
+
function evaluate(value, param) {
|
|
43076
|
+
return typeof value === 'function' ? value(param) : value;
|
|
43077
|
+
}
|
|
43078
|
+
|
|
43079
|
+
function getSide(placement) {
|
|
43080
|
+
return placement.split('-')[0];
|
|
43081
|
+
}
|
|
43082
|
+
|
|
43083
|
+
function getAlignment(placement) {
|
|
43084
|
+
return placement.split('-')[1];
|
|
43085
|
+
}
|
|
43086
|
+
|
|
43087
|
+
function getOppositeAxis(axis) {
|
|
43088
|
+
return axis === 'x' ? 'y' : 'x';
|
|
43089
|
+
}
|
|
43090
|
+
|
|
43091
|
+
function getAxisLength(axis) {
|
|
43092
|
+
return axis === 'y' ? 'height' : 'width';
|
|
43093
|
+
}
|
|
43094
|
+
|
|
43095
|
+
function getSideAxis(placement) {
|
|
43096
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
43097
|
+
}
|
|
43098
|
+
|
|
43099
|
+
function getAlignmentAxis(placement) {
|
|
43100
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
43101
|
+
}
|
|
43102
|
+
|
|
43103
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
43104
|
+
if (rtl === void 0) {
|
|
43105
|
+
rtl = false;
|
|
43106
|
+
}
|
|
43107
|
+
|
|
43108
|
+
const alignment = getAlignment(placement);
|
|
43109
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
43110
|
+
const length = getAxisLength(alignmentAxis);
|
|
43111
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
43112
|
+
|
|
43113
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
43114
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
43115
|
+
}
|
|
43116
|
+
|
|
43117
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
43118
|
+
}
|
|
43119
|
+
|
|
43120
|
+
function getExpandedPlacements(placement) {
|
|
43121
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
43122
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
43123
|
+
}
|
|
43124
|
+
|
|
43125
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
43126
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
43127
|
+
}
|
|
43128
|
+
|
|
43129
|
+
function getSideList(side, isStart, rtl) {
|
|
43130
|
+
const lr = ['left', 'right'];
|
|
43131
|
+
const rl = ['right', 'left'];
|
|
43132
|
+
const tb = ['top', 'bottom'];
|
|
43133
|
+
const bt = ['bottom', 'top'];
|
|
43134
|
+
|
|
43135
|
+
switch (side) {
|
|
43136
|
+
case 'top':
|
|
43137
|
+
case 'bottom':
|
|
43138
|
+
if (rtl) return isStart ? rl : lr;
|
|
43139
|
+
return isStart ? lr : rl;
|
|
43140
|
+
|
|
43141
|
+
case 'left':
|
|
43142
|
+
case 'right':
|
|
43143
|
+
return isStart ? tb : bt;
|
|
43144
|
+
|
|
43145
|
+
default:
|
|
43146
|
+
return [];
|
|
43147
|
+
}
|
|
43148
|
+
}
|
|
43149
|
+
|
|
43150
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
43151
|
+
const alignment = getAlignment(placement);
|
|
43152
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
43153
|
+
|
|
43154
|
+
if (alignment) {
|
|
43155
|
+
list = list.map(side => side + "-" + alignment);
|
|
43156
|
+
|
|
43157
|
+
if (flipAlignment) {
|
|
43158
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
43159
|
+
}
|
|
43160
|
+
}
|
|
43161
|
+
|
|
43162
|
+
return list;
|
|
43163
|
+
}
|
|
43164
|
+
|
|
43165
|
+
function getOppositePlacement(placement) {
|
|
43166
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
43167
|
+
}
|
|
43168
|
+
|
|
43169
|
+
function expandPaddingObject(padding) {
|
|
43170
|
+
return {
|
|
43171
|
+
top: 0,
|
|
43172
|
+
right: 0,
|
|
43173
|
+
bottom: 0,
|
|
43174
|
+
left: 0,
|
|
43175
|
+
...padding
|
|
43176
|
+
};
|
|
43177
|
+
}
|
|
43178
|
+
|
|
43179
|
+
function getPaddingObject(padding) {
|
|
43180
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
43181
|
+
top: padding,
|
|
43182
|
+
right: padding,
|
|
43183
|
+
bottom: padding,
|
|
43184
|
+
left: padding
|
|
43185
|
+
};
|
|
43186
|
+
}
|
|
43187
|
+
|
|
43188
|
+
function rectToClientRect(rect) {
|
|
43189
|
+
return { ...rect,
|
|
43190
|
+
top: rect.y,
|
|
43191
|
+
left: rect.x,
|
|
43192
|
+
right: rect.x + rect.width,
|
|
43193
|
+
bottom: rect.y + rect.height
|
|
43194
|
+
};
|
|
43195
|
+
}
|
|
43196
|
+
|
|
43197
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
43198
|
+
let {
|
|
43199
|
+
reference,
|
|
43200
|
+
floating
|
|
43201
|
+
} = _ref;
|
|
43202
|
+
const sideAxis = getSideAxis(placement);
|
|
43203
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
43204
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
43205
|
+
const side = getSide(placement);
|
|
43206
|
+
const isVertical = sideAxis === 'y';
|
|
43207
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
43208
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
43209
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
43210
|
+
let coords;
|
|
43211
|
+
|
|
43212
|
+
switch (side) {
|
|
43213
|
+
case 'top':
|
|
43214
|
+
coords = {
|
|
43215
|
+
x: commonX,
|
|
43216
|
+
y: reference.y - floating.height
|
|
43217
|
+
};
|
|
43218
|
+
break;
|
|
43219
|
+
|
|
43220
|
+
case 'bottom':
|
|
43221
|
+
coords = {
|
|
43222
|
+
x: commonX,
|
|
43223
|
+
y: reference.y + reference.height
|
|
43224
|
+
};
|
|
43225
|
+
break;
|
|
43226
|
+
|
|
43227
|
+
case 'right':
|
|
43228
|
+
coords = {
|
|
43229
|
+
x: reference.x + reference.width,
|
|
43230
|
+
y: commonY
|
|
43231
|
+
};
|
|
43232
|
+
break;
|
|
43233
|
+
|
|
43234
|
+
case 'left':
|
|
43235
|
+
coords = {
|
|
43236
|
+
x: reference.x - floating.width,
|
|
43237
|
+
y: commonY
|
|
43238
|
+
};
|
|
43239
|
+
break;
|
|
43240
|
+
|
|
43241
|
+
default:
|
|
43242
|
+
coords = {
|
|
43243
|
+
x: reference.x,
|
|
43244
|
+
y: reference.y
|
|
43245
|
+
};
|
|
43246
|
+
}
|
|
43247
|
+
|
|
43248
|
+
switch (getAlignment(placement)) {
|
|
43249
|
+
case 'start':
|
|
43250
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
43251
|
+
break;
|
|
43252
|
+
|
|
43253
|
+
case 'end':
|
|
43254
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
43255
|
+
break;
|
|
43256
|
+
}
|
|
43257
|
+
|
|
43258
|
+
return coords;
|
|
43259
|
+
}
|
|
43260
|
+
/**
|
|
43261
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
43262
|
+
* next to a reference element when it is given a certain positioning strategy.
|
|
43263
|
+
*
|
|
43264
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
43265
|
+
* write one for the platform you are using Floating UI with.
|
|
43266
|
+
*/
|
|
43267
|
+
|
|
43268
|
+
|
|
43269
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
43270
|
+
const {
|
|
43271
|
+
placement = 'bottom',
|
|
43272
|
+
strategy = 'absolute',
|
|
43273
|
+
middleware = [],
|
|
43274
|
+
platform
|
|
43275
|
+
} = config;
|
|
43276
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
43277
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
43278
|
+
let rects = await platform.getElementRects({
|
|
43279
|
+
reference,
|
|
43280
|
+
floating,
|
|
43281
|
+
strategy
|
|
43282
|
+
});
|
|
43283
|
+
let {
|
|
43284
|
+
x,
|
|
43285
|
+
y
|
|
43286
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
43287
|
+
let statefulPlacement = placement;
|
|
43288
|
+
let middlewareData = {};
|
|
43289
|
+
let resetCount = 0;
|
|
43290
|
+
|
|
43291
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
43292
|
+
const {
|
|
43293
|
+
name,
|
|
43294
|
+
fn
|
|
43295
|
+
} = validMiddleware[i];
|
|
43296
|
+
const {
|
|
43297
|
+
x: nextX,
|
|
43298
|
+
y: nextY,
|
|
43299
|
+
data,
|
|
43300
|
+
reset
|
|
43301
|
+
} = await fn({
|
|
43302
|
+
x,
|
|
43303
|
+
y,
|
|
43304
|
+
initialPlacement: placement,
|
|
43305
|
+
placement: statefulPlacement,
|
|
43306
|
+
strategy,
|
|
43307
|
+
middlewareData,
|
|
43308
|
+
rects,
|
|
43309
|
+
platform,
|
|
43310
|
+
elements: {
|
|
43311
|
+
reference,
|
|
43312
|
+
floating
|
|
43313
|
+
}
|
|
43314
|
+
});
|
|
43315
|
+
x = nextX != null ? nextX : x;
|
|
43316
|
+
y = nextY != null ? nextY : y;
|
|
43317
|
+
middlewareData = { ...middlewareData,
|
|
43318
|
+
[name]: { ...middlewareData[name],
|
|
43319
|
+
...data
|
|
43320
|
+
}
|
|
43321
|
+
};
|
|
43322
|
+
|
|
43323
|
+
if (reset && resetCount <= 50) {
|
|
43324
|
+
resetCount++;
|
|
43325
|
+
|
|
43326
|
+
if (typeof reset === 'object') {
|
|
43327
|
+
if (reset.placement) {
|
|
43328
|
+
statefulPlacement = reset.placement;
|
|
43329
|
+
}
|
|
43330
|
+
|
|
43331
|
+
if (reset.rects) {
|
|
43332
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
43333
|
+
reference,
|
|
43334
|
+
floating,
|
|
43335
|
+
strategy
|
|
43336
|
+
}) : reset.rects;
|
|
43337
|
+
}
|
|
43338
|
+
|
|
43339
|
+
({
|
|
43340
|
+
x,
|
|
43341
|
+
y
|
|
43342
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
43343
|
+
}
|
|
43344
|
+
|
|
43345
|
+
i = -1;
|
|
43346
|
+
continue;
|
|
43347
|
+
}
|
|
43348
|
+
}
|
|
43349
|
+
|
|
43350
|
+
return {
|
|
43351
|
+
x,
|
|
43352
|
+
y,
|
|
43353
|
+
placement: statefulPlacement,
|
|
43354
|
+
strategy,
|
|
43355
|
+
middlewareData
|
|
43356
|
+
};
|
|
43357
|
+
};
|
|
43358
|
+
/**
|
|
43359
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
43360
|
+
* element is overflowing a given clipping boundary on each side.
|
|
43361
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
43362
|
+
* - negative = how many pixels left before it will overflow
|
|
43363
|
+
* - 0 = lies flush with the boundary
|
|
43364
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
43365
|
+
*/
|
|
43366
|
+
|
|
43367
|
+
|
|
43368
|
+
async function detectOverflow(state, options) {
|
|
43369
|
+
var _await$platform$isEle;
|
|
43370
|
+
|
|
43371
|
+
if (options === void 0) {
|
|
43372
|
+
options = {};
|
|
43373
|
+
}
|
|
43374
|
+
|
|
43375
|
+
const {
|
|
43376
|
+
x,
|
|
43377
|
+
y,
|
|
43378
|
+
platform,
|
|
43379
|
+
rects,
|
|
43380
|
+
elements,
|
|
43381
|
+
strategy
|
|
43382
|
+
} = state;
|
|
43383
|
+
const {
|
|
43384
|
+
boundary = 'clippingAncestors',
|
|
43385
|
+
rootBoundary = 'viewport',
|
|
43386
|
+
elementContext = 'floating',
|
|
43387
|
+
altBoundary = false,
|
|
43388
|
+
padding = 0
|
|
43389
|
+
} = evaluate(options, state);
|
|
43390
|
+
const paddingObject = getPaddingObject(padding);
|
|
43391
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
43392
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
43393
|
+
const clippingClientRect = rectToClientRect((await platform.getClippingRect({
|
|
43394
|
+
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))),
|
|
43395
|
+
boundary,
|
|
43396
|
+
rootBoundary,
|
|
43397
|
+
strategy
|
|
43398
|
+
})));
|
|
43399
|
+
const rect = elementContext === 'floating' ? { ...rects.floating,
|
|
43400
|
+
x,
|
|
43401
|
+
y
|
|
43402
|
+
} : rects.reference;
|
|
43403
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
43404
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
43405
|
+
x: 1,
|
|
43406
|
+
y: 1
|
|
43407
|
+
} : {
|
|
43408
|
+
x: 1,
|
|
43409
|
+
y: 1
|
|
43410
|
+
};
|
|
43411
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
43412
|
+
rect,
|
|
43413
|
+
offsetParent,
|
|
43414
|
+
strategy
|
|
43415
|
+
}) : rect);
|
|
43416
|
+
return {
|
|
43417
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
43418
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
43419
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
43420
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
43421
|
+
};
|
|
43422
|
+
}
|
|
43423
|
+
/**
|
|
43424
|
+
* Provides data to position an inner element of the floating element so that it
|
|
43425
|
+
* appears centered to the reference element.
|
|
43426
|
+
* @see https://floating-ui.com/docs/arrow
|
|
43427
|
+
*/
|
|
43428
|
+
|
|
43429
|
+
|
|
43430
|
+
const arrow = options => ({
|
|
43431
|
+
name: 'arrow',
|
|
43432
|
+
options,
|
|
43433
|
+
|
|
43434
|
+
async fn(state) {
|
|
43435
|
+
const {
|
|
43436
|
+
x,
|
|
43437
|
+
y,
|
|
43438
|
+
placement,
|
|
43439
|
+
rects,
|
|
43440
|
+
platform,
|
|
43441
|
+
elements
|
|
43442
|
+
} = state; // Since `element` is required, we don't Partial<> the type.
|
|
43443
|
+
|
|
43444
|
+
const {
|
|
43445
|
+
element,
|
|
43446
|
+
padding = 0
|
|
43447
|
+
} = evaluate(options, state) || {};
|
|
43448
|
+
|
|
43449
|
+
if (element == null) {
|
|
43450
|
+
return {};
|
|
43451
|
+
}
|
|
43452
|
+
|
|
43453
|
+
const paddingObject = getPaddingObject(padding);
|
|
43454
|
+
const coords = {
|
|
43455
|
+
x,
|
|
43456
|
+
y
|
|
43457
|
+
};
|
|
43458
|
+
const axis = getAlignmentAxis(placement);
|
|
43459
|
+
const length = getAxisLength(axis);
|
|
43460
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
43461
|
+
const isYAxis = axis === 'y';
|
|
43462
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
43463
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
43464
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
43465
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
43466
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
43467
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
43468
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; // DOM platform can return `window` as the `offsetParent`.
|
|
43469
|
+
|
|
43470
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
43471
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
43472
|
+
}
|
|
43473
|
+
|
|
43474
|
+
const centerToReference = endDiff / 2 - startDiff / 2; // If the padding is large enough that it causes the arrow to no longer be
|
|
43475
|
+
// centered, modify the padding so that it is centered.
|
|
43476
|
+
|
|
43477
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
43478
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
43479
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); // Make sure the arrow doesn't overflow the floating element if the center
|
|
43480
|
+
// point is outside the floating element's bounds.
|
|
43481
|
+
|
|
43482
|
+
const min$1 = minPadding;
|
|
43483
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
43484
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
43485
|
+
const offset = clamp(min$1, center, max); // If the reference is small enough that the arrow's padding causes it to
|
|
43486
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
43487
|
+
// floating element itself. This stops `shift()` from taking action, but can
|
|
43488
|
+
// be worked around by calling it again after the `arrow()` if desired.
|
|
43489
|
+
|
|
43490
|
+
const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
43491
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? min$1 - center : max - center : 0;
|
|
43492
|
+
return {
|
|
43493
|
+
[axis]: coords[axis] - alignmentOffset,
|
|
43494
|
+
data: {
|
|
43495
|
+
[axis]: offset,
|
|
43496
|
+
centerOffset: center - offset + alignmentOffset
|
|
43497
|
+
}
|
|
43498
|
+
};
|
|
43499
|
+
}
|
|
43500
|
+
|
|
43501
|
+
});
|
|
43502
|
+
/**
|
|
43503
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
43504
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
43505
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
43506
|
+
* @see https://floating-ui.com/docs/flip
|
|
43507
|
+
*/
|
|
43508
|
+
|
|
43509
|
+
|
|
43510
|
+
const flip = function (options) {
|
|
43511
|
+
if (options === void 0) {
|
|
43512
|
+
options = {};
|
|
43513
|
+
}
|
|
43514
|
+
|
|
43515
|
+
return {
|
|
43516
|
+
name: 'flip',
|
|
43517
|
+
options,
|
|
43518
|
+
|
|
43519
|
+
async fn(state) {
|
|
43520
|
+
var _middlewareData$flip;
|
|
43521
|
+
|
|
43522
|
+
const {
|
|
43523
|
+
placement,
|
|
43524
|
+
middlewareData,
|
|
43525
|
+
rects,
|
|
43526
|
+
initialPlacement,
|
|
43527
|
+
platform,
|
|
43528
|
+
elements
|
|
43529
|
+
} = state;
|
|
43530
|
+
const {
|
|
43531
|
+
mainAxis: checkMainAxis = true,
|
|
43532
|
+
crossAxis: checkCrossAxis = true,
|
|
43533
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
43534
|
+
fallbackStrategy = 'bestFit',
|
|
43535
|
+
fallbackAxisSideDirection = 'none',
|
|
43536
|
+
flipAlignment = true,
|
|
43537
|
+
...detectOverflowOptions
|
|
43538
|
+
} = evaluate(options, state);
|
|
43539
|
+
const side = getSide(placement);
|
|
43540
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
43541
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
43542
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
43543
|
+
|
|
43544
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
43545
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
43546
|
+
}
|
|
43547
|
+
|
|
43548
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
43549
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
43550
|
+
const overflows = [];
|
|
43551
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
43552
|
+
|
|
43553
|
+
if (checkMainAxis) {
|
|
43554
|
+
overflows.push(overflow[side]);
|
|
43555
|
+
}
|
|
43556
|
+
|
|
43557
|
+
if (checkCrossAxis) {
|
|
43558
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
43559
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
43560
|
+
}
|
|
43561
|
+
|
|
43562
|
+
overflowsData = [...overflowsData, {
|
|
43563
|
+
placement,
|
|
43564
|
+
overflows
|
|
43565
|
+
}]; // One or more sides is overflowing.
|
|
43566
|
+
|
|
43567
|
+
if (!overflows.every(side => side <= 0)) {
|
|
43568
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
43569
|
+
|
|
43570
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
43571
|
+
const nextPlacement = placements[nextIndex];
|
|
43572
|
+
|
|
43573
|
+
if (nextPlacement) {
|
|
43574
|
+
// Try next placement and re-run the lifecycle.
|
|
43575
|
+
return {
|
|
43576
|
+
data: {
|
|
43577
|
+
index: nextIndex,
|
|
43578
|
+
overflows: overflowsData
|
|
43579
|
+
},
|
|
43580
|
+
reset: {
|
|
43581
|
+
placement: nextPlacement
|
|
43582
|
+
}
|
|
43583
|
+
};
|
|
43584
|
+
} // First, find the candidates that fit on the mainAxis side of overflow,
|
|
43585
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
43586
|
+
|
|
43587
|
+
|
|
43588
|
+
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; // Otherwise fallback.
|
|
43589
|
+
|
|
43590
|
+
if (!resetPlacement) {
|
|
43591
|
+
switch (fallbackStrategy) {
|
|
43592
|
+
case 'bestFit':
|
|
43593
|
+
{
|
|
43594
|
+
var _overflowsData$map$so;
|
|
43595
|
+
|
|
43596
|
+
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];
|
|
43597
|
+
|
|
43598
|
+
if (placement) {
|
|
43599
|
+
resetPlacement = placement;
|
|
43600
|
+
}
|
|
43601
|
+
|
|
43602
|
+
break;
|
|
43603
|
+
}
|
|
43604
|
+
|
|
43605
|
+
case 'initialPlacement':
|
|
43606
|
+
resetPlacement = initialPlacement;
|
|
43607
|
+
break;
|
|
43608
|
+
}
|
|
43609
|
+
}
|
|
43610
|
+
|
|
43611
|
+
if (placement !== resetPlacement) {
|
|
43612
|
+
return {
|
|
43613
|
+
reset: {
|
|
43614
|
+
placement: resetPlacement
|
|
43615
|
+
}
|
|
43616
|
+
};
|
|
43617
|
+
}
|
|
43618
|
+
}
|
|
43619
|
+
|
|
43620
|
+
return {};
|
|
43621
|
+
}
|
|
43622
|
+
|
|
43623
|
+
};
|
|
43624
|
+
};
|
|
43625
|
+
// Derivable.
|
|
43626
|
+
|
|
43627
|
+
|
|
43628
|
+
async function convertValueToCoords(state, options) {
|
|
43629
|
+
const {
|
|
43630
|
+
placement,
|
|
43631
|
+
platform,
|
|
43632
|
+
elements
|
|
43633
|
+
} = state;
|
|
43634
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
43635
|
+
const side = getSide(placement);
|
|
43636
|
+
const alignment = getAlignment(placement);
|
|
43637
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
43638
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
43639
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
43640
|
+
const rawValue = evaluate(options, state); // eslint-disable-next-line prefer-const
|
|
43641
|
+
|
|
43642
|
+
let {
|
|
43643
|
+
mainAxis,
|
|
43644
|
+
crossAxis,
|
|
43645
|
+
alignmentAxis
|
|
43646
|
+
} = typeof rawValue === 'number' ? {
|
|
43647
|
+
mainAxis: rawValue,
|
|
43648
|
+
crossAxis: 0,
|
|
43649
|
+
alignmentAxis: null
|
|
43650
|
+
} : {
|
|
43651
|
+
mainAxis: 0,
|
|
43652
|
+
crossAxis: 0,
|
|
43653
|
+
alignmentAxis: null,
|
|
43654
|
+
...rawValue
|
|
43655
|
+
};
|
|
43656
|
+
|
|
43657
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
43658
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
43659
|
+
}
|
|
43660
|
+
|
|
43661
|
+
return isVertical ? {
|
|
43662
|
+
x: crossAxis * crossAxisMulti,
|
|
43663
|
+
y: mainAxis * mainAxisMulti
|
|
43664
|
+
} : {
|
|
43665
|
+
x: mainAxis * mainAxisMulti,
|
|
43666
|
+
y: crossAxis * crossAxisMulti
|
|
43667
|
+
};
|
|
43668
|
+
}
|
|
43669
|
+
/**
|
|
43670
|
+
* Modifies the placement by translating the floating element along the
|
|
43671
|
+
* specified axes.
|
|
43672
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
43673
|
+
* object may be passed.
|
|
43674
|
+
* @see https://floating-ui.com/docs/offset
|
|
43675
|
+
*/
|
|
43676
|
+
|
|
43677
|
+
|
|
43678
|
+
const offset = function (options) {
|
|
43679
|
+
if (options === void 0) {
|
|
43680
|
+
options = 0;
|
|
43681
|
+
}
|
|
43682
|
+
|
|
43683
|
+
return {
|
|
43684
|
+
name: 'offset',
|
|
43685
|
+
options,
|
|
43686
|
+
|
|
43687
|
+
async fn(state) {
|
|
43688
|
+
const {
|
|
43689
|
+
x,
|
|
43690
|
+
y
|
|
43691
|
+
} = state;
|
|
43692
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
43693
|
+
return {
|
|
43694
|
+
x: x + diffCoords.x,
|
|
43695
|
+
y: y + diffCoords.y,
|
|
43696
|
+
data: diffCoords
|
|
43697
|
+
};
|
|
43698
|
+
}
|
|
43699
|
+
|
|
43700
|
+
};
|
|
43701
|
+
};
|
|
43702
|
+
/**
|
|
43703
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
43704
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
43705
|
+
* @see https://floating-ui.com/docs/shift
|
|
43706
|
+
*/
|
|
43707
|
+
|
|
43708
|
+
|
|
43709
|
+
const shift = function (options) {
|
|
43710
|
+
if (options === void 0) {
|
|
43711
|
+
options = {};
|
|
43712
|
+
}
|
|
43713
|
+
|
|
43714
|
+
return {
|
|
43715
|
+
name: 'shift',
|
|
43716
|
+
options,
|
|
43717
|
+
|
|
43718
|
+
async fn(state) {
|
|
43719
|
+
const {
|
|
43720
|
+
x,
|
|
43721
|
+
y,
|
|
43722
|
+
placement
|
|
43723
|
+
} = state;
|
|
43724
|
+
const {
|
|
43725
|
+
mainAxis: checkMainAxis = true,
|
|
43726
|
+
crossAxis: checkCrossAxis = false,
|
|
43727
|
+
limiter = {
|
|
43728
|
+
fn: _ref => {
|
|
43729
|
+
let {
|
|
43730
|
+
x,
|
|
43731
|
+
y
|
|
43732
|
+
} = _ref;
|
|
43733
|
+
return {
|
|
43734
|
+
x,
|
|
43735
|
+
y
|
|
43736
|
+
};
|
|
43737
|
+
}
|
|
43738
|
+
},
|
|
43739
|
+
...detectOverflowOptions
|
|
43740
|
+
} = evaluate(options, state);
|
|
43741
|
+
const coords = {
|
|
43742
|
+
x,
|
|
43743
|
+
y
|
|
43744
|
+
};
|
|
43745
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
43746
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
43747
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
43748
|
+
let mainAxisCoord = coords[mainAxis];
|
|
43749
|
+
let crossAxisCoord = coords[crossAxis];
|
|
43750
|
+
|
|
43751
|
+
if (checkMainAxis) {
|
|
43752
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
43753
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
43754
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
43755
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
43756
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
43757
|
+
}
|
|
43758
|
+
|
|
43759
|
+
if (checkCrossAxis) {
|
|
43760
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
43761
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
43762
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
43763
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
43764
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
43765
|
+
}
|
|
43766
|
+
|
|
43767
|
+
const limitedCoords = limiter.fn({ ...state,
|
|
43768
|
+
[mainAxis]: mainAxisCoord,
|
|
43769
|
+
[crossAxis]: crossAxisCoord
|
|
43770
|
+
});
|
|
43771
|
+
return { ...limitedCoords,
|
|
43772
|
+
data: {
|
|
43773
|
+
x: limitedCoords.x - x,
|
|
43774
|
+
y: limitedCoords.y - y
|
|
43775
|
+
}
|
|
43776
|
+
};
|
|
43777
|
+
}
|
|
43778
|
+
|
|
43779
|
+
};
|
|
43780
|
+
};
|
|
43781
|
+
|
|
43782
|
+
function getNodeName(node) {
|
|
43783
|
+
if (isNode$1(node)) {
|
|
43784
|
+
return (node.nodeName || '').toLowerCase();
|
|
43785
|
+
} // Mocked nodes in testing environments may not be instances of Node. By
|
|
43786
|
+
// returning `#document` an infinite loop won't occur.
|
|
43787
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
43788
|
+
|
|
43789
|
+
|
|
43790
|
+
return '#document';
|
|
43791
|
+
}
|
|
43792
|
+
|
|
43793
|
+
function getWindow(node) {
|
|
43794
|
+
var _node$ownerDocument;
|
|
43795
|
+
|
|
43796
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
43797
|
+
}
|
|
43798
|
+
|
|
43799
|
+
function getDocumentElement(node) {
|
|
43800
|
+
var _ref;
|
|
43801
|
+
|
|
43802
|
+
return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
43803
|
+
}
|
|
43804
|
+
|
|
43805
|
+
function isNode$1(value) {
|
|
43806
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
43807
|
+
}
|
|
43808
|
+
|
|
43809
|
+
function isElement(value) {
|
|
43810
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
43811
|
+
}
|
|
43812
|
+
|
|
43813
|
+
function isHTMLElement(value) {
|
|
43814
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
43815
|
+
}
|
|
43816
|
+
|
|
43817
|
+
function isShadowRoot(value) {
|
|
43818
|
+
// Browsers without `ShadowRoot` support.
|
|
43819
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
43820
|
+
return false;
|
|
43821
|
+
}
|
|
43822
|
+
|
|
43823
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
43824
|
+
}
|
|
43825
|
+
|
|
43826
|
+
function isOverflowElement(element) {
|
|
43827
|
+
const {
|
|
43828
|
+
overflow,
|
|
43829
|
+
overflowX,
|
|
43830
|
+
overflowY,
|
|
43831
|
+
display
|
|
43832
|
+
} = getComputedStyle$1(element);
|
|
43833
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
43834
|
+
}
|
|
43835
|
+
|
|
43836
|
+
function isTableElement(element) {
|
|
43837
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
43838
|
+
}
|
|
43839
|
+
|
|
43840
|
+
function isContainingBlock(element) {
|
|
43841
|
+
const webkit = isWebKit();
|
|
43842
|
+
const css = getComputedStyle$1(element); // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
43843
|
+
|
|
43844
|
+
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));
|
|
43845
|
+
}
|
|
43846
|
+
|
|
43847
|
+
function getContainingBlock(element) {
|
|
43848
|
+
let currentNode = getParentNode(element);
|
|
43849
|
+
|
|
43850
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
43851
|
+
if (isContainingBlock(currentNode)) {
|
|
43852
|
+
return currentNode;
|
|
43853
|
+
} else {
|
|
43854
|
+
currentNode = getParentNode(currentNode);
|
|
43855
|
+
}
|
|
43856
|
+
}
|
|
43857
|
+
|
|
43858
|
+
return null;
|
|
43859
|
+
}
|
|
43860
|
+
|
|
43861
|
+
function isWebKit() {
|
|
43862
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
43863
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
43864
|
+
}
|
|
43865
|
+
|
|
43866
|
+
function isLastTraversableNode(node) {
|
|
43867
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
43868
|
+
}
|
|
43869
|
+
|
|
43870
|
+
function getComputedStyle$1(element) {
|
|
43871
|
+
return getWindow(element).getComputedStyle(element);
|
|
43872
|
+
}
|
|
43873
|
+
|
|
43874
|
+
function getNodeScroll(element) {
|
|
43875
|
+
if (isElement(element)) {
|
|
43876
|
+
return {
|
|
43877
|
+
scrollLeft: element.scrollLeft,
|
|
43878
|
+
scrollTop: element.scrollTop
|
|
43879
|
+
};
|
|
43880
|
+
}
|
|
43881
|
+
|
|
43882
|
+
return {
|
|
43883
|
+
scrollLeft: element.pageXOffset,
|
|
43884
|
+
scrollTop: element.pageYOffset
|
|
43885
|
+
};
|
|
43886
|
+
}
|
|
43887
|
+
|
|
43888
|
+
function getParentNode(node) {
|
|
43889
|
+
if (getNodeName(node) === 'html') {
|
|
43890
|
+
return node;
|
|
43891
|
+
}
|
|
43892
|
+
|
|
43893
|
+
const result = // Step into the shadow DOM of the parent of a slotted node.
|
|
43894
|
+
node.assignedSlot || // DOM Element detected.
|
|
43895
|
+
node.parentNode || // ShadowRoot detected.
|
|
43896
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
43897
|
+
getDocumentElement(node);
|
|
43898
|
+
return isShadowRoot(result) ? result.host : result;
|
|
43899
|
+
}
|
|
43900
|
+
|
|
43901
|
+
function getNearestOverflowAncestor(node) {
|
|
43902
|
+
const parentNode = getParentNode(node);
|
|
43903
|
+
|
|
43904
|
+
if (isLastTraversableNode(parentNode)) {
|
|
43905
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
43906
|
+
}
|
|
43907
|
+
|
|
43908
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
43909
|
+
return parentNode;
|
|
43910
|
+
}
|
|
43911
|
+
|
|
43912
|
+
return getNearestOverflowAncestor(parentNode);
|
|
43913
|
+
}
|
|
43914
|
+
|
|
43915
|
+
function getOverflowAncestors(node, list) {
|
|
43916
|
+
var _node$ownerDocument2;
|
|
43917
|
+
|
|
43918
|
+
if (list === void 0) {
|
|
43919
|
+
list = [];
|
|
43920
|
+
}
|
|
43921
|
+
|
|
43922
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
43923
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
43924
|
+
const win = getWindow(scrollableAncestor);
|
|
43925
|
+
|
|
43926
|
+
if (isBody) {
|
|
43927
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
|
|
43928
|
+
}
|
|
43929
|
+
|
|
43930
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
43931
|
+
}
|
|
43932
|
+
|
|
43933
|
+
function getCssDimensions(element) {
|
|
43934
|
+
const css = getComputedStyle$1(element); // In testing environments, the `width` and `height` properties are empty
|
|
43935
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
43936
|
+
|
|
43937
|
+
let width = parseFloat(css.width) || 0;
|
|
43938
|
+
let height = parseFloat(css.height) || 0;
|
|
43939
|
+
const hasOffset = isHTMLElement(element);
|
|
43940
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
43941
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
43942
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
43943
|
+
|
|
43944
|
+
if (shouldFallback) {
|
|
43945
|
+
width = offsetWidth;
|
|
43946
|
+
height = offsetHeight;
|
|
43947
|
+
}
|
|
43948
|
+
|
|
43949
|
+
return {
|
|
43950
|
+
width,
|
|
43951
|
+
height,
|
|
43952
|
+
$: shouldFallback
|
|
43953
|
+
};
|
|
43954
|
+
}
|
|
43955
|
+
|
|
43956
|
+
function unwrapElement(element) {
|
|
43957
|
+
return !isElement(element) ? element.contextElement : element;
|
|
43958
|
+
}
|
|
43959
|
+
|
|
43960
|
+
function getScale(element) {
|
|
43961
|
+
const domElement = unwrapElement(element);
|
|
43962
|
+
|
|
43963
|
+
if (!isHTMLElement(domElement)) {
|
|
43964
|
+
return createCoords(1);
|
|
43965
|
+
}
|
|
43966
|
+
|
|
43967
|
+
const rect = domElement.getBoundingClientRect();
|
|
43968
|
+
const {
|
|
43969
|
+
width,
|
|
43970
|
+
height,
|
|
43971
|
+
$
|
|
43972
|
+
} = getCssDimensions(domElement);
|
|
43973
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
43974
|
+
let y = ($ ? round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1.
|
|
43975
|
+
|
|
43976
|
+
if (!x || !Number.isFinite(x)) {
|
|
43977
|
+
x = 1;
|
|
43978
|
+
}
|
|
43979
|
+
|
|
43980
|
+
if (!y || !Number.isFinite(y)) {
|
|
43981
|
+
y = 1;
|
|
43982
|
+
}
|
|
43983
|
+
|
|
43984
|
+
return {
|
|
43985
|
+
x,
|
|
43986
|
+
y
|
|
43987
|
+
};
|
|
43988
|
+
}
|
|
43989
|
+
|
|
43990
|
+
const noOffsets =
|
|
43991
|
+
/*#__PURE__*/
|
|
43992
|
+
createCoords(0);
|
|
43993
|
+
|
|
43994
|
+
function getVisualOffsets(element) {
|
|
43995
|
+
const win = getWindow(element);
|
|
43996
|
+
|
|
43997
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
43998
|
+
return noOffsets;
|
|
43999
|
+
}
|
|
44000
|
+
|
|
44001
|
+
return {
|
|
44002
|
+
x: win.visualViewport.offsetLeft,
|
|
44003
|
+
y: win.visualViewport.offsetTop
|
|
44004
|
+
};
|
|
44005
|
+
}
|
|
44006
|
+
|
|
44007
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
44008
|
+
if (isFixed === void 0) {
|
|
44009
|
+
isFixed = false;
|
|
44010
|
+
}
|
|
44011
|
+
|
|
44012
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
44013
|
+
return false;
|
|
44014
|
+
}
|
|
44015
|
+
|
|
44016
|
+
return isFixed;
|
|
44017
|
+
}
|
|
44018
|
+
|
|
44019
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
44020
|
+
if (includeScale === void 0) {
|
|
44021
|
+
includeScale = false;
|
|
44022
|
+
}
|
|
44023
|
+
|
|
44024
|
+
if (isFixedStrategy === void 0) {
|
|
44025
|
+
isFixedStrategy = false;
|
|
44026
|
+
}
|
|
44027
|
+
|
|
44028
|
+
const clientRect = element.getBoundingClientRect();
|
|
44029
|
+
const domElement = unwrapElement(element);
|
|
44030
|
+
let scale = createCoords(1);
|
|
44031
|
+
|
|
44032
|
+
if (includeScale) {
|
|
44033
|
+
if (offsetParent) {
|
|
44034
|
+
if (isElement(offsetParent)) {
|
|
44035
|
+
scale = getScale(offsetParent);
|
|
44036
|
+
}
|
|
44037
|
+
} else {
|
|
44038
|
+
scale = getScale(element);
|
|
44039
|
+
}
|
|
44040
|
+
}
|
|
44041
|
+
|
|
44042
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
44043
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
44044
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
44045
|
+
let width = clientRect.width / scale.x;
|
|
44046
|
+
let height = clientRect.height / scale.y;
|
|
44047
|
+
|
|
44048
|
+
if (domElement) {
|
|
44049
|
+
const win = getWindow(domElement);
|
|
44050
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
44051
|
+
let currentIFrame = win.frameElement;
|
|
44052
|
+
|
|
44053
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
44054
|
+
const iframeScale = getScale(currentIFrame);
|
|
44055
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
44056
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
44057
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
44058
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
44059
|
+
x *= iframeScale.x;
|
|
44060
|
+
y *= iframeScale.y;
|
|
44061
|
+
width *= iframeScale.x;
|
|
44062
|
+
height *= iframeScale.y;
|
|
44063
|
+
x += left;
|
|
44064
|
+
y += top;
|
|
44065
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
44066
|
+
}
|
|
44067
|
+
}
|
|
44068
|
+
|
|
44069
|
+
return rectToClientRect({
|
|
44070
|
+
width,
|
|
44071
|
+
height,
|
|
44072
|
+
x,
|
|
44073
|
+
y
|
|
44074
|
+
});
|
|
44075
|
+
}
|
|
44076
|
+
|
|
44077
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
44078
|
+
let {
|
|
44079
|
+
rect,
|
|
44080
|
+
offsetParent,
|
|
44081
|
+
strategy
|
|
44082
|
+
} = _ref;
|
|
44083
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
44084
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
44085
|
+
|
|
44086
|
+
if (offsetParent === documentElement) {
|
|
44087
|
+
return rect;
|
|
44088
|
+
}
|
|
44089
|
+
|
|
44090
|
+
let scroll = {
|
|
44091
|
+
scrollLeft: 0,
|
|
44092
|
+
scrollTop: 0
|
|
44093
|
+
};
|
|
44094
|
+
let scale = createCoords(1);
|
|
44095
|
+
const offsets = createCoords(0);
|
|
44096
|
+
|
|
44097
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
44098
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
44099
|
+
scroll = getNodeScroll(offsetParent);
|
|
44100
|
+
}
|
|
44101
|
+
|
|
44102
|
+
if (isHTMLElement(offsetParent)) {
|
|
44103
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
44104
|
+
scale = getScale(offsetParent);
|
|
44105
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
44106
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
44107
|
+
}
|
|
44108
|
+
}
|
|
44109
|
+
|
|
44110
|
+
return {
|
|
44111
|
+
width: rect.width * scale.x,
|
|
44112
|
+
height: rect.height * scale.y,
|
|
44113
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
44114
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
44115
|
+
};
|
|
44116
|
+
}
|
|
44117
|
+
|
|
44118
|
+
function getClientRects(element) {
|
|
44119
|
+
return Array.from(element.getClientRects());
|
|
44120
|
+
}
|
|
44121
|
+
|
|
44122
|
+
function getWindowScrollBarX(element) {
|
|
44123
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
44124
|
+
// incorrect for RTL.
|
|
44125
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
44126
|
+
} // Gets the entire size of the scrollable document area, even extending outside
|
|
44127
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
44128
|
+
|
|
44129
|
+
|
|
44130
|
+
function getDocumentRect(element) {
|
|
44131
|
+
const html = getDocumentElement(element);
|
|
44132
|
+
const scroll = getNodeScroll(element);
|
|
44133
|
+
const body = element.ownerDocument.body;
|
|
44134
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
44135
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
44136
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
44137
|
+
const y = -scroll.scrollTop;
|
|
44138
|
+
|
|
44139
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
44140
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
44141
|
+
}
|
|
44142
|
+
|
|
44143
|
+
return {
|
|
44144
|
+
width,
|
|
44145
|
+
height,
|
|
44146
|
+
x,
|
|
44147
|
+
y
|
|
44148
|
+
};
|
|
44149
|
+
}
|
|
44150
|
+
|
|
44151
|
+
function getViewportRect(element, strategy) {
|
|
44152
|
+
const win = getWindow(element);
|
|
44153
|
+
const html = getDocumentElement(element);
|
|
44154
|
+
const visualViewport = win.visualViewport;
|
|
44155
|
+
let width = html.clientWidth;
|
|
44156
|
+
let height = html.clientHeight;
|
|
44157
|
+
let x = 0;
|
|
44158
|
+
let y = 0;
|
|
44159
|
+
|
|
44160
|
+
if (visualViewport) {
|
|
44161
|
+
width = visualViewport.width;
|
|
44162
|
+
height = visualViewport.height;
|
|
44163
|
+
const visualViewportBased = isWebKit();
|
|
44164
|
+
|
|
44165
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
44166
|
+
x = visualViewport.offsetLeft;
|
|
44167
|
+
y = visualViewport.offsetTop;
|
|
44168
|
+
}
|
|
44169
|
+
}
|
|
44170
|
+
|
|
44171
|
+
return {
|
|
44172
|
+
width,
|
|
44173
|
+
height,
|
|
44174
|
+
x,
|
|
44175
|
+
y
|
|
44176
|
+
};
|
|
44177
|
+
} // Returns the inner client rect, subtracting scrollbars if present.
|
|
44178
|
+
|
|
44179
|
+
|
|
44180
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
44181
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
44182
|
+
const top = clientRect.top + element.clientTop;
|
|
44183
|
+
const left = clientRect.left + element.clientLeft;
|
|
44184
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
44185
|
+
const width = element.clientWidth * scale.x;
|
|
44186
|
+
const height = element.clientHeight * scale.y;
|
|
44187
|
+
const x = left * scale.x;
|
|
44188
|
+
const y = top * scale.y;
|
|
44189
|
+
return {
|
|
44190
|
+
width,
|
|
44191
|
+
height,
|
|
44192
|
+
x,
|
|
44193
|
+
y
|
|
44194
|
+
};
|
|
44195
|
+
}
|
|
44196
|
+
|
|
44197
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
44198
|
+
let rect;
|
|
44199
|
+
|
|
44200
|
+
if (clippingAncestor === 'viewport') {
|
|
44201
|
+
rect = getViewportRect(element, strategy);
|
|
44202
|
+
} else if (clippingAncestor === 'document') {
|
|
44203
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
44204
|
+
} else if (isElement(clippingAncestor)) {
|
|
44205
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
44206
|
+
} else {
|
|
44207
|
+
const visualOffsets = getVisualOffsets(element);
|
|
44208
|
+
rect = { ...clippingAncestor,
|
|
44209
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
44210
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
44211
|
+
};
|
|
44212
|
+
}
|
|
44213
|
+
|
|
44214
|
+
return rectToClientRect(rect);
|
|
44215
|
+
}
|
|
44216
|
+
|
|
44217
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
44218
|
+
const parentNode = getParentNode(element);
|
|
44219
|
+
|
|
44220
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
44221
|
+
return false;
|
|
44222
|
+
}
|
|
44223
|
+
|
|
44224
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
44225
|
+
} // A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
44226
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
44227
|
+
// of the given element up the tree.
|
|
44228
|
+
|
|
44229
|
+
|
|
44230
|
+
function getClippingElementAncestors(element, cache) {
|
|
44231
|
+
const cachedResult = cache.get(element);
|
|
44232
|
+
|
|
44233
|
+
if (cachedResult) {
|
|
44234
|
+
return cachedResult;
|
|
44235
|
+
}
|
|
44236
|
+
|
|
44237
|
+
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
44238
|
+
let currentContainingBlockComputedStyle = null;
|
|
44239
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
44240
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
44241
|
+
|
|
44242
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
44243
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
44244
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
44245
|
+
|
|
44246
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
44247
|
+
currentContainingBlockComputedStyle = null;
|
|
44248
|
+
}
|
|
44249
|
+
|
|
44250
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
44251
|
+
|
|
44252
|
+
if (shouldDropCurrentNode) {
|
|
44253
|
+
// Drop non-containing blocks.
|
|
44254
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
44255
|
+
} else {
|
|
44256
|
+
// Record last containing block for next iteration.
|
|
44257
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
44258
|
+
}
|
|
44259
|
+
|
|
44260
|
+
currentNode = getParentNode(currentNode);
|
|
44261
|
+
}
|
|
44262
|
+
|
|
44263
|
+
cache.set(element, result);
|
|
44264
|
+
return result;
|
|
44265
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
44266
|
+
// clipping ancestors.
|
|
44267
|
+
|
|
44268
|
+
|
|
44269
|
+
function getClippingRect(_ref) {
|
|
44270
|
+
let {
|
|
44271
|
+
element,
|
|
44272
|
+
boundary,
|
|
44273
|
+
rootBoundary,
|
|
44274
|
+
strategy
|
|
44275
|
+
} = _ref;
|
|
44276
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
44277
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
44278
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
44279
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
44280
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
44281
|
+
accRect.top = max(rect.top, accRect.top);
|
|
44282
|
+
accRect.right = min(rect.right, accRect.right);
|
|
44283
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
44284
|
+
accRect.left = max(rect.left, accRect.left);
|
|
44285
|
+
return accRect;
|
|
44286
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
44287
|
+
return {
|
|
44288
|
+
width: clippingRect.right - clippingRect.left,
|
|
44289
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
44290
|
+
x: clippingRect.left,
|
|
44291
|
+
y: clippingRect.top
|
|
44292
|
+
};
|
|
44293
|
+
}
|
|
44294
|
+
|
|
44295
|
+
function getDimensions(element) {
|
|
44296
|
+
return getCssDimensions(element);
|
|
44297
|
+
}
|
|
44298
|
+
|
|
44299
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
44300
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
44301
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
44302
|
+
const isFixed = strategy === 'fixed';
|
|
44303
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
44304
|
+
let scroll = {
|
|
44305
|
+
scrollLeft: 0,
|
|
44306
|
+
scrollTop: 0
|
|
44307
|
+
};
|
|
44308
|
+
const offsets = createCoords(0);
|
|
44309
|
+
|
|
44310
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
44311
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
44312
|
+
scroll = getNodeScroll(offsetParent);
|
|
44313
|
+
}
|
|
44314
|
+
|
|
44315
|
+
if (isOffsetParentAnElement) {
|
|
44316
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
44317
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
44318
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
44319
|
+
} else if (documentElement) {
|
|
44320
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
44321
|
+
}
|
|
44322
|
+
}
|
|
44323
|
+
|
|
44324
|
+
return {
|
|
44325
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
44326
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
44327
|
+
width: rect.width,
|
|
44328
|
+
height: rect.height
|
|
44329
|
+
};
|
|
44330
|
+
}
|
|
44331
|
+
|
|
44332
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
44333
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
44334
|
+
return null;
|
|
44335
|
+
}
|
|
44336
|
+
|
|
44337
|
+
if (polyfill) {
|
|
44338
|
+
return polyfill(element);
|
|
44339
|
+
}
|
|
44340
|
+
|
|
44341
|
+
return element.offsetParent;
|
|
44342
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
44343
|
+
// such as table ancestors and cross browser bugs.
|
|
44344
|
+
|
|
44345
|
+
|
|
44346
|
+
function getOffsetParent(element, polyfill) {
|
|
44347
|
+
const window = getWindow(element);
|
|
44348
|
+
|
|
44349
|
+
if (!isHTMLElement(element)) {
|
|
44350
|
+
return window;
|
|
44351
|
+
}
|
|
44352
|
+
|
|
44353
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
44354
|
+
|
|
44355
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
44356
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
44357
|
+
}
|
|
44358
|
+
|
|
44359
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
44360
|
+
return window;
|
|
44361
|
+
}
|
|
44362
|
+
|
|
44363
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
44364
|
+
}
|
|
44365
|
+
|
|
44366
|
+
const getElementRects = async function (_ref) {
|
|
44367
|
+
let {
|
|
44368
|
+
reference,
|
|
44369
|
+
floating,
|
|
44370
|
+
strategy
|
|
44371
|
+
} = _ref;
|
|
44372
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
44373
|
+
const getDimensionsFn = this.getDimensions;
|
|
44374
|
+
return {
|
|
44375
|
+
reference: getRectRelativeToOffsetParent(reference, (await getOffsetParentFn(floating)), strategy),
|
|
44376
|
+
floating: {
|
|
44377
|
+
x: 0,
|
|
44378
|
+
y: 0,
|
|
44379
|
+
...(await getDimensionsFn(floating))
|
|
44380
|
+
}
|
|
44381
|
+
};
|
|
44382
|
+
};
|
|
44383
|
+
|
|
44384
|
+
function isRTL(element) {
|
|
44385
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
44386
|
+
}
|
|
44387
|
+
|
|
44388
|
+
const platform = {
|
|
44389
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
44390
|
+
getDocumentElement,
|
|
44391
|
+
getClippingRect,
|
|
44392
|
+
getOffsetParent,
|
|
44393
|
+
getElementRects,
|
|
44394
|
+
getClientRects,
|
|
44395
|
+
getDimensions,
|
|
44396
|
+
getScale,
|
|
44397
|
+
isElement,
|
|
44398
|
+
isRTL
|
|
44399
|
+
}; // https://samthor.au/2021/observing-dom/
|
|
44400
|
+
|
|
44401
|
+
function observeMove(element, onMove) {
|
|
44402
|
+
let io = null;
|
|
44403
|
+
let timeoutId;
|
|
44404
|
+
const root = getDocumentElement(element);
|
|
44405
|
+
|
|
44406
|
+
function cleanup() {
|
|
44407
|
+
clearTimeout(timeoutId);
|
|
44408
|
+
io && io.disconnect();
|
|
44409
|
+
io = null;
|
|
44410
|
+
}
|
|
44411
|
+
|
|
44412
|
+
function refresh(skip, threshold) {
|
|
44413
|
+
if (skip === void 0) {
|
|
44414
|
+
skip = false;
|
|
44415
|
+
}
|
|
44416
|
+
|
|
44417
|
+
if (threshold === void 0) {
|
|
44418
|
+
threshold = 1;
|
|
44419
|
+
}
|
|
44420
|
+
|
|
44421
|
+
cleanup();
|
|
44422
|
+
const {
|
|
44423
|
+
left,
|
|
44424
|
+
top,
|
|
44425
|
+
width,
|
|
44426
|
+
height
|
|
44427
|
+
} = element.getBoundingClientRect();
|
|
44428
|
+
|
|
44429
|
+
if (!skip) {
|
|
44430
|
+
onMove();
|
|
44431
|
+
}
|
|
44432
|
+
|
|
44433
|
+
if (!width || !height) {
|
|
44434
|
+
return;
|
|
44435
|
+
}
|
|
44436
|
+
|
|
44437
|
+
const insetTop = floor(top);
|
|
44438
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
44439
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
44440
|
+
const insetLeft = floor(left);
|
|
44441
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
44442
|
+
const options = {
|
|
44443
|
+
rootMargin,
|
|
44444
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
44445
|
+
};
|
|
44446
|
+
let isFirstUpdate = true;
|
|
44447
|
+
|
|
44448
|
+
function handleObserve(entries) {
|
|
44449
|
+
const ratio = entries[0].intersectionRatio;
|
|
44450
|
+
|
|
44451
|
+
if (ratio !== threshold) {
|
|
44452
|
+
if (!isFirstUpdate) {
|
|
44453
|
+
return refresh();
|
|
44454
|
+
}
|
|
44455
|
+
|
|
44456
|
+
if (!ratio) {
|
|
44457
|
+
timeoutId = setTimeout(() => {
|
|
44458
|
+
refresh(false, 1e-7);
|
|
44459
|
+
}, 100);
|
|
44460
|
+
} else {
|
|
44461
|
+
refresh(false, ratio);
|
|
44462
|
+
}
|
|
44463
|
+
}
|
|
44464
|
+
|
|
44465
|
+
isFirstUpdate = false;
|
|
44466
|
+
} // Older browsers don't support a `document` as the root and will throw an
|
|
44467
|
+
// error.
|
|
44468
|
+
|
|
44469
|
+
|
|
44470
|
+
try {
|
|
44471
|
+
io = new IntersectionObserver(handleObserve, { ...options,
|
|
44472
|
+
// Handle <iframe>s
|
|
44473
|
+
root: root.ownerDocument
|
|
44474
|
+
});
|
|
44475
|
+
} catch (e) {
|
|
44476
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
44477
|
+
}
|
|
44478
|
+
|
|
44479
|
+
io.observe(element);
|
|
44480
|
+
}
|
|
44481
|
+
|
|
44482
|
+
refresh(true);
|
|
44483
|
+
return cleanup;
|
|
44484
|
+
}
|
|
44485
|
+
/**
|
|
44486
|
+
* Automatically updates the position of the floating element when necessary.
|
|
44487
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
44488
|
+
* visible on the screen.
|
|
44489
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
44490
|
+
* removed from the DOM or hidden from the screen.
|
|
44491
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
44492
|
+
*/
|
|
44493
|
+
|
|
44494
|
+
|
|
44495
|
+
function autoUpdate(reference, floating, update, options) {
|
|
44496
|
+
if (options === void 0) {
|
|
44497
|
+
options = {};
|
|
44498
|
+
}
|
|
44499
|
+
|
|
44500
|
+
const {
|
|
44501
|
+
ancestorScroll = true,
|
|
44502
|
+
ancestorResize = true,
|
|
44503
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
44504
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
44505
|
+
animationFrame = false
|
|
44506
|
+
} = options;
|
|
44507
|
+
const referenceEl = unwrapElement(reference);
|
|
44508
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
44509
|
+
ancestors.forEach(ancestor => {
|
|
44510
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
44511
|
+
passive: true
|
|
44512
|
+
});
|
|
44513
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
44514
|
+
});
|
|
44515
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
44516
|
+
let reobserveFrame = -1;
|
|
44517
|
+
let resizeObserver = null;
|
|
44518
|
+
|
|
44519
|
+
if (elementResize) {
|
|
44520
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
44521
|
+
let [firstEntry] = _ref;
|
|
44522
|
+
|
|
44523
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
44524
|
+
// Prevent update loops when using the `size` middleware.
|
|
44525
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
44526
|
+
resizeObserver.unobserve(floating);
|
|
44527
|
+
cancelAnimationFrame(reobserveFrame);
|
|
44528
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
44529
|
+
resizeObserver && resizeObserver.observe(floating);
|
|
44530
|
+
});
|
|
44531
|
+
}
|
|
44532
|
+
|
|
44533
|
+
update();
|
|
44534
|
+
});
|
|
44535
|
+
|
|
44536
|
+
if (referenceEl && !animationFrame) {
|
|
44537
|
+
resizeObserver.observe(referenceEl);
|
|
44538
|
+
}
|
|
44539
|
+
|
|
44540
|
+
resizeObserver.observe(floating);
|
|
44541
|
+
}
|
|
44542
|
+
|
|
44543
|
+
let frameId;
|
|
44544
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
44545
|
+
|
|
44546
|
+
if (animationFrame) {
|
|
44547
|
+
frameLoop();
|
|
44548
|
+
}
|
|
44549
|
+
|
|
44550
|
+
function frameLoop() {
|
|
44551
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
44552
|
+
|
|
44553
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
44554
|
+
update();
|
|
44555
|
+
}
|
|
44556
|
+
|
|
44557
|
+
prevRefRect = nextRefRect;
|
|
44558
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
44559
|
+
}
|
|
44560
|
+
|
|
44561
|
+
update();
|
|
44562
|
+
return () => {
|
|
44563
|
+
ancestors.forEach(ancestor => {
|
|
44564
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
44565
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
44566
|
+
});
|
|
44567
|
+
cleanupIo && cleanupIo();
|
|
44568
|
+
resizeObserver && resizeObserver.disconnect();
|
|
44569
|
+
resizeObserver = null;
|
|
44570
|
+
|
|
44571
|
+
if (animationFrame) {
|
|
44572
|
+
cancelAnimationFrame(frameId);
|
|
44573
|
+
}
|
|
44574
|
+
};
|
|
44575
|
+
}
|
|
44576
|
+
/**
|
|
44577
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
44578
|
+
* next to a reference element when it is given a certain CSS positioning
|
|
44579
|
+
* strategy.
|
|
44580
|
+
*/
|
|
44581
|
+
|
|
44582
|
+
|
|
44583
|
+
const computePosition = (reference, floating, options) => {
|
|
44584
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
44585
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
44586
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
44587
|
+
const cache = new Map();
|
|
44588
|
+
const mergedOptions = {
|
|
44589
|
+
platform,
|
|
44590
|
+
...options
|
|
44591
|
+
};
|
|
44592
|
+
const platformWithCache = { ...mergedOptions.platform,
|
|
44593
|
+
_c: cache
|
|
44594
|
+
};
|
|
44595
|
+
return computePosition$1(reference, floating, { ...mergedOptions,
|
|
44596
|
+
platform: platformWithCache
|
|
44597
|
+
});
|
|
44598
|
+
};
|
|
44599
|
+
|
|
44600
|
+
var classnames = createCommonjsModule(function (module) {
|
|
44601
|
+
/*!
|
|
44602
|
+
Copyright (c) 2018 Jed Watson.
|
|
44603
|
+
Licensed under the MIT License (MIT), see
|
|
44604
|
+
http://jedwatson.github.io/classnames
|
|
44605
|
+
*/
|
|
44606
|
+
|
|
44607
|
+
/* global define */
|
|
44608
|
+
(function () {
|
|
44609
|
+
|
|
44610
|
+
var hasOwn = {}.hasOwnProperty;
|
|
44611
|
+
|
|
44612
|
+
function classNames() {
|
|
44613
|
+
var classes = [];
|
|
44614
|
+
|
|
44615
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
44616
|
+
var arg = arguments[i];
|
|
44617
|
+
if (!arg) continue;
|
|
44618
|
+
var argType = typeof arg;
|
|
44619
|
+
|
|
44620
|
+
if (argType === 'string' || argType === 'number') {
|
|
44621
|
+
classes.push(arg);
|
|
44622
|
+
} else if (Array.isArray(arg)) {
|
|
44623
|
+
if (arg.length) {
|
|
44624
|
+
var inner = classNames.apply(null, arg);
|
|
44625
|
+
|
|
44626
|
+
if (inner) {
|
|
44627
|
+
classes.push(inner);
|
|
44628
|
+
}
|
|
44629
|
+
}
|
|
44630
|
+
} else if (argType === 'object') {
|
|
44631
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
44632
|
+
classes.push(arg.toString());
|
|
44633
|
+
continue;
|
|
44634
|
+
}
|
|
44635
|
+
|
|
44636
|
+
for (var key in arg) {
|
|
44637
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
44638
|
+
classes.push(key);
|
|
44639
|
+
}
|
|
44640
|
+
}
|
|
44641
|
+
}
|
|
44642
|
+
}
|
|
44643
|
+
|
|
44644
|
+
return classes.join(' ');
|
|
44645
|
+
}
|
|
44646
|
+
|
|
44647
|
+
if (module.exports) {
|
|
44648
|
+
classNames.default = classNames;
|
|
44649
|
+
module.exports = classNames;
|
|
44650
|
+
} else {
|
|
44651
|
+
window.classNames = classNames;
|
|
44652
|
+
}
|
|
44653
|
+
})();
|
|
44654
|
+
});
|
|
44655
|
+
|
|
44656
|
+
/*
|
|
44657
|
+
* React Tooltip
|
|
44658
|
+
* {@link https://github.com/ReactTooltip/react-tooltip}
|
|
44659
|
+
* @copyright ReactTooltip Team
|
|
44660
|
+
* @license MIT
|
|
44661
|
+
*/
|
|
44662
|
+
const f = "react-tooltip-core-styles",
|
|
44663
|
+
h = "react-tooltip-base-styles",
|
|
44664
|
+
w = {
|
|
44665
|
+
core: !1,
|
|
44666
|
+
base: !1
|
|
44667
|
+
};
|
|
44668
|
+
|
|
44669
|
+
function b({
|
|
44670
|
+
css: e,
|
|
44671
|
+
id: t = h,
|
|
44672
|
+
type: r = "base",
|
|
44673
|
+
ref: o
|
|
44674
|
+
}) {
|
|
44675
|
+
var n, l;
|
|
44676
|
+
if (!e || "undefined" == typeof document || w[r]) return;
|
|
44677
|
+
if ("core" === r && "undefined" != typeof process && (null === (n = null === process || void 0 === process ? void 0 : process.env) || void 0 === n ? void 0 : n.REACT_TOOLTIP_DISABLE_CORE_STYLES)) return;
|
|
44678
|
+
if ("base" !== r && "undefined" != typeof process && (null === (l = null === process || void 0 === process ? void 0 : process.env) || void 0 === l ? void 0 : l.REACT_TOOLTIP_DISABLE_BASE_STYLES)) return;
|
|
44679
|
+
"core" === r && (t = f), o || (o = {});
|
|
44680
|
+
const {
|
|
44681
|
+
insertAt: i
|
|
44682
|
+
} = o;
|
|
44683
|
+
if (document.getElementById(t)) return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);
|
|
44684
|
+
const c = document.head || document.getElementsByTagName("head")[0],
|
|
44685
|
+
s = document.createElement("style");
|
|
44686
|
+
s.id = t, s.type = "text/css", "top" === i && c.firstChild ? c.insertBefore(s, c.firstChild) : c.appendChild(s), s.styleSheet ? s.styleSheet.cssText = e : s.appendChild(document.createTextNode(e)), w[r] = !0;
|
|
44687
|
+
}
|
|
44688
|
+
|
|
44689
|
+
const E = (e, t, r) => {
|
|
44690
|
+
let o = null;
|
|
44691
|
+
return function (...n) {
|
|
44692
|
+
const l = () => {
|
|
44693
|
+
o = null, r || e.apply(this, n);
|
|
44694
|
+
};
|
|
44695
|
+
|
|
44696
|
+
r && !o && (e.apply(this, n), o = setTimeout(l, t)), r || (o && clearTimeout(o), o = setTimeout(l, t));
|
|
44697
|
+
};
|
|
44698
|
+
},
|
|
44699
|
+
_ = "DEFAULT_TOOLTIP_ID",
|
|
44700
|
+
g = {
|
|
44701
|
+
anchorRefs: new Set(),
|
|
44702
|
+
activeAnchor: {
|
|
44703
|
+
current: null
|
|
44704
|
+
},
|
|
44705
|
+
attach: () => {},
|
|
44706
|
+
detach: () => {},
|
|
44707
|
+
setActiveAnchor: () => {}
|
|
44708
|
+
},
|
|
44709
|
+
A = React.createContext({
|
|
44710
|
+
getTooltipData: () => g
|
|
44711
|
+
});
|
|
44712
|
+
|
|
44713
|
+
function L(e = _) {
|
|
44714
|
+
return React.useContext(A).getTooltipData(e);
|
|
43031
44715
|
}
|
|
43032
44716
|
|
|
44717
|
+
const R = "undefined" != typeof window ? React.useLayoutEffect : React.useEffect,
|
|
44718
|
+
N = e => {
|
|
44719
|
+
if (!(e instanceof HTMLElement || e instanceof SVGElement)) return !1;
|
|
44720
|
+
const t = getComputedStyle(e);
|
|
44721
|
+
return ["overflow", "overflow-x", "overflow-y"].some(e => {
|
|
44722
|
+
const r = t.getPropertyValue(e);
|
|
44723
|
+
return "auto" === r || "scroll" === r;
|
|
44724
|
+
});
|
|
44725
|
+
},
|
|
44726
|
+
x = e => {
|
|
44727
|
+
if (!e) return null;
|
|
44728
|
+
let t = e.parentElement;
|
|
44729
|
+
|
|
44730
|
+
for (; t;) {
|
|
44731
|
+
if (N(t)) return t;
|
|
44732
|
+
t = t.parentElement;
|
|
44733
|
+
}
|
|
44734
|
+
|
|
44735
|
+
return document.scrollingElement || document.documentElement;
|
|
44736
|
+
},
|
|
44737
|
+
k = async ({
|
|
44738
|
+
elementReference: e = null,
|
|
44739
|
+
tooltipReference: t = null,
|
|
44740
|
+
tooltipArrowReference: r = null,
|
|
44741
|
+
place: o = "top",
|
|
44742
|
+
offset: n = 10,
|
|
44743
|
+
strategy: l = "absolute",
|
|
44744
|
+
middlewares: i = [offset(Number(n)), flip(), shift({
|
|
44745
|
+
padding: 5
|
|
44746
|
+
})],
|
|
44747
|
+
border: c
|
|
44748
|
+
}) => {
|
|
44749
|
+
if (!e) return {
|
|
44750
|
+
tooltipStyles: {},
|
|
44751
|
+
tooltipArrowStyles: {},
|
|
44752
|
+
place: o
|
|
44753
|
+
};
|
|
44754
|
+
if (null === t) return {
|
|
44755
|
+
tooltipStyles: {},
|
|
44756
|
+
tooltipArrowStyles: {},
|
|
44757
|
+
place: o
|
|
44758
|
+
};
|
|
44759
|
+
const s = i;
|
|
44760
|
+
return r ? (s.push(arrow({
|
|
44761
|
+
element: r,
|
|
44762
|
+
padding: 5
|
|
44763
|
+
})), computePosition(e, t, {
|
|
44764
|
+
placement: o,
|
|
44765
|
+
strategy: l,
|
|
44766
|
+
middleware: s
|
|
44767
|
+
}).then(({
|
|
44768
|
+
x: e,
|
|
44769
|
+
y: t,
|
|
44770
|
+
placement: r,
|
|
44771
|
+
middlewareData: o
|
|
44772
|
+
}) => {
|
|
44773
|
+
var n, l;
|
|
44774
|
+
const i = {
|
|
44775
|
+
left: `${e}px`,
|
|
44776
|
+
top: `${t}px`,
|
|
44777
|
+
border: c
|
|
44778
|
+
},
|
|
44779
|
+
{
|
|
44780
|
+
x: s,
|
|
44781
|
+
y: a
|
|
44782
|
+
} = null !== (n = o.arrow) && void 0 !== n ? n : {
|
|
44783
|
+
x: 0,
|
|
44784
|
+
y: 0
|
|
44785
|
+
},
|
|
44786
|
+
d = null !== (l = {
|
|
44787
|
+
top: "bottom",
|
|
44788
|
+
right: "left",
|
|
44789
|
+
bottom: "top",
|
|
44790
|
+
left: "right"
|
|
44791
|
+
}[r.split("-")[0]]) && void 0 !== l ? l : "bottom",
|
|
44792
|
+
u = c && {
|
|
44793
|
+
top: {
|
|
44794
|
+
borderBottom: c,
|
|
44795
|
+
borderRight: c
|
|
44796
|
+
},
|
|
44797
|
+
right: {
|
|
44798
|
+
borderBottom: c,
|
|
44799
|
+
borderLeft: c
|
|
44800
|
+
},
|
|
44801
|
+
bottom: {
|
|
44802
|
+
borderTop: c,
|
|
44803
|
+
borderLeft: c
|
|
44804
|
+
},
|
|
44805
|
+
left: {
|
|
44806
|
+
borderTop: c,
|
|
44807
|
+
borderRight: c
|
|
44808
|
+
}
|
|
44809
|
+
}[r.split("-")[0]];
|
|
44810
|
+
let p = 0;
|
|
44811
|
+
|
|
44812
|
+
if (c) {
|
|
44813
|
+
const e = `${c}`.match(/(\d+)px/);
|
|
44814
|
+
p = (null == e ? void 0 : e[1]) ? Number(e[1]) : 1;
|
|
44815
|
+
}
|
|
44816
|
+
|
|
44817
|
+
return {
|
|
44818
|
+
tooltipStyles: i,
|
|
44819
|
+
tooltipArrowStyles: {
|
|
44820
|
+
left: null != s ? `${s}px` : "",
|
|
44821
|
+
top: null != a ? `${a}px` : "",
|
|
44822
|
+
right: "",
|
|
44823
|
+
bottom: "",
|
|
44824
|
+
...u,
|
|
44825
|
+
[d]: `-${4 + p}px`
|
|
44826
|
+
},
|
|
44827
|
+
place: r
|
|
44828
|
+
};
|
|
44829
|
+
})) : computePosition(e, t, {
|
|
44830
|
+
placement: "bottom",
|
|
44831
|
+
strategy: l,
|
|
44832
|
+
middleware: s
|
|
44833
|
+
}).then(({
|
|
44834
|
+
x: e,
|
|
44835
|
+
y: t,
|
|
44836
|
+
placement: r
|
|
44837
|
+
}) => ({
|
|
44838
|
+
tooltipStyles: {
|
|
44839
|
+
left: `${e}px`,
|
|
44840
|
+
top: `${t}px`
|
|
44841
|
+
},
|
|
44842
|
+
tooltipArrowStyles: {},
|
|
44843
|
+
place: r
|
|
44844
|
+
}));
|
|
44845
|
+
};
|
|
44846
|
+
|
|
44847
|
+
var $ = "core-styles-module_tooltip__3vRRp",
|
|
44848
|
+
C = "core-styles-module_fixed__pcSol",
|
|
44849
|
+
I = "core-styles-module_arrow__cvMwQ",
|
|
44850
|
+
B = "core-styles-module_noArrow__xock6",
|
|
44851
|
+
j = "core-styles-module_clickable__ZuTTB",
|
|
44852
|
+
D = "core-styles-module_show__Nt9eE",
|
|
44853
|
+
H = {
|
|
44854
|
+
tooltip: "styles-module_tooltip__mnnfp",
|
|
44855
|
+
arrow: "styles-module_arrow__K0L3T",
|
|
44856
|
+
dark: "styles-module_dark__xNqje",
|
|
44857
|
+
light: "styles-module_light__Z6W-X",
|
|
44858
|
+
success: "styles-module_success__A2AKt",
|
|
44859
|
+
warning: "styles-module_warning__SCK0X",
|
|
44860
|
+
error: "styles-module_error__JvumD",
|
|
44861
|
+
info: "styles-module_info__BWdHW"
|
|
44862
|
+
};
|
|
44863
|
+
|
|
44864
|
+
const z = ({
|
|
44865
|
+
id: t,
|
|
44866
|
+
className: n,
|
|
44867
|
+
classNameArrow: l,
|
|
44868
|
+
variant: s = "dark",
|
|
44869
|
+
anchorId: a,
|
|
44870
|
+
anchorSelect: d,
|
|
44871
|
+
place: u = "top",
|
|
44872
|
+
offset: p = 10,
|
|
44873
|
+
events: v = ["hover"],
|
|
44874
|
+
openOnClick: f = !1,
|
|
44875
|
+
positionStrategy: h = "absolute",
|
|
44876
|
+
middlewares: w,
|
|
44877
|
+
wrapper: b,
|
|
44878
|
+
delayShow: S = 0,
|
|
44879
|
+
delayHide: _ = 0,
|
|
44880
|
+
float: g = !1,
|
|
44881
|
+
hidden: A = !1,
|
|
44882
|
+
noArrow: T = !1,
|
|
44883
|
+
clickable: O = !1,
|
|
44884
|
+
closeOnEsc: N = !1,
|
|
44885
|
+
closeOnScroll: z = !1,
|
|
44886
|
+
closeOnResize: q = !1,
|
|
44887
|
+
style: W,
|
|
44888
|
+
position: M,
|
|
44889
|
+
afterShow: P,
|
|
44890
|
+
afterHide: F,
|
|
44891
|
+
content: K,
|
|
44892
|
+
contentWrapperRef: U,
|
|
44893
|
+
isOpen: X,
|
|
44894
|
+
setIsOpen: Y,
|
|
44895
|
+
activeAnchor: V,
|
|
44896
|
+
setActiveAnchor: Z,
|
|
44897
|
+
border: G,
|
|
44898
|
+
opacity: J
|
|
44899
|
+
}) => {
|
|
44900
|
+
const Q = React.useRef(null),
|
|
44901
|
+
ee = React.useRef(null),
|
|
44902
|
+
te = React.useRef(null),
|
|
44903
|
+
re = React.useRef(null),
|
|
44904
|
+
[oe, ne] = React.useState(u),
|
|
44905
|
+
[le, ie] = React.useState({}),
|
|
44906
|
+
[ce, se] = React.useState({}),
|
|
44907
|
+
[ae, de] = React.useState(!1),
|
|
44908
|
+
[ue, pe] = React.useState(!1),
|
|
44909
|
+
ve = React.useRef(!1),
|
|
44910
|
+
me = React.useRef(null),
|
|
44911
|
+
{
|
|
44912
|
+
anchorRefs: ye,
|
|
44913
|
+
setActiveAnchor: fe
|
|
44914
|
+
} = L(t),
|
|
44915
|
+
he = React.useRef(!1),
|
|
44916
|
+
[we, be] = React.useState([]),
|
|
44917
|
+
Se = React.useRef(!1),
|
|
44918
|
+
Ee = f || v.includes("click");
|
|
44919
|
+
R(() => (Se.current = !0, () => {
|
|
44920
|
+
Se.current = !1;
|
|
44921
|
+
}), []), React.useEffect(() => {
|
|
44922
|
+
if (!ae) {
|
|
44923
|
+
const e = setTimeout(() => {
|
|
44924
|
+
pe(!1);
|
|
44925
|
+
}, 150);
|
|
44926
|
+
return () => {
|
|
44927
|
+
clearTimeout(e);
|
|
44928
|
+
};
|
|
44929
|
+
}
|
|
44930
|
+
|
|
44931
|
+
return () => null;
|
|
44932
|
+
}, [ae]);
|
|
44933
|
+
|
|
44934
|
+
const _e = e => {
|
|
44935
|
+
Se.current && (e && pe(!0), setTimeout(() => {
|
|
44936
|
+
Se.current && (null == Y || Y(e), void 0 === X && de(e));
|
|
44937
|
+
}, 10));
|
|
44938
|
+
};
|
|
44939
|
+
|
|
44940
|
+
React.useEffect(() => {
|
|
44941
|
+
if (void 0 === X) return () => null;
|
|
44942
|
+
X && pe(!0);
|
|
44943
|
+
const e = setTimeout(() => {
|
|
44944
|
+
de(X);
|
|
44945
|
+
}, 10);
|
|
44946
|
+
return () => {
|
|
44947
|
+
clearTimeout(e);
|
|
44948
|
+
};
|
|
44949
|
+
}, [X]), React.useEffect(() => {
|
|
44950
|
+
ae !== ve.current && (ve.current = ae, ae ? null == P || P() : null == F || F());
|
|
44951
|
+
}, [ae]);
|
|
44952
|
+
|
|
44953
|
+
const ge = (e = _) => {
|
|
44954
|
+
re.current && clearTimeout(re.current), re.current = setTimeout(() => {
|
|
44955
|
+
he.current || _e(!1);
|
|
44956
|
+
}, e);
|
|
44957
|
+
},
|
|
44958
|
+
Ae = e => {
|
|
44959
|
+
var t;
|
|
44960
|
+
if (!e) return;
|
|
44961
|
+
const r = null !== (t = e.currentTarget) && void 0 !== t ? t : e.target;
|
|
44962
|
+
if (!(null == r ? void 0 : r.isConnected)) return Z(null), void fe({
|
|
44963
|
+
current: null
|
|
44964
|
+
});
|
|
44965
|
+
S ? (te.current && clearTimeout(te.current), te.current = setTimeout(() => {
|
|
44966
|
+
_e(!0);
|
|
44967
|
+
}, S)) : _e(!0), Z(r), fe({
|
|
44968
|
+
current: r
|
|
44969
|
+
}), re.current && clearTimeout(re.current);
|
|
44970
|
+
},
|
|
44971
|
+
Te = () => {
|
|
44972
|
+
O ? ge(_ || 100) : _ ? ge() : _e(!1), te.current && clearTimeout(te.current);
|
|
44973
|
+
},
|
|
44974
|
+
Le = ({
|
|
44975
|
+
x: e,
|
|
44976
|
+
y: t
|
|
44977
|
+
}) => {
|
|
44978
|
+
k({
|
|
44979
|
+
place: u,
|
|
44980
|
+
offset: p,
|
|
44981
|
+
elementReference: {
|
|
44982
|
+
getBoundingClientRect: () => ({
|
|
44983
|
+
x: e,
|
|
44984
|
+
y: t,
|
|
44985
|
+
width: 0,
|
|
44986
|
+
height: 0,
|
|
44987
|
+
top: t,
|
|
44988
|
+
left: e,
|
|
44989
|
+
right: e,
|
|
44990
|
+
bottom: t
|
|
44991
|
+
})
|
|
44992
|
+
},
|
|
44993
|
+
tooltipReference: Q.current,
|
|
44994
|
+
tooltipArrowReference: ee.current,
|
|
44995
|
+
strategy: h,
|
|
44996
|
+
middlewares: w,
|
|
44997
|
+
border: G
|
|
44998
|
+
}).then(e => {
|
|
44999
|
+
Object.keys(e.tooltipStyles).length && ie(e.tooltipStyles), Object.keys(e.tooltipArrowStyles).length && se(e.tooltipArrowStyles), ne(e.place);
|
|
45000
|
+
});
|
|
45001
|
+
},
|
|
45002
|
+
Oe = e => {
|
|
45003
|
+
if (!e) return;
|
|
45004
|
+
const t = e,
|
|
45005
|
+
r = {
|
|
45006
|
+
x: t.clientX,
|
|
45007
|
+
y: t.clientY
|
|
45008
|
+
};
|
|
45009
|
+
Le(r), me.current = r;
|
|
45010
|
+
},
|
|
45011
|
+
Re = e => {
|
|
45012
|
+
Ae(e), _ && ge();
|
|
45013
|
+
},
|
|
45014
|
+
Ne = e => {
|
|
45015
|
+
var t;
|
|
45016
|
+
[document.querySelector(`[id='${a}']`), ...we].some(t => null == t ? void 0 : t.contains(e.target)) || (null === (t = Q.current) || void 0 === t ? void 0 : t.contains(e.target)) || (_e(!1), te.current && clearTimeout(te.current));
|
|
45017
|
+
},
|
|
45018
|
+
xe = E(Ae, 50, !0),
|
|
45019
|
+
ke = E(Te, 50, !0),
|
|
45020
|
+
$e = React.useCallback(() => {
|
|
45021
|
+
M ? Le(M) : g ? me.current && Le(me.current) : k({
|
|
45022
|
+
place: u,
|
|
45023
|
+
offset: p,
|
|
45024
|
+
elementReference: V,
|
|
45025
|
+
tooltipReference: Q.current,
|
|
45026
|
+
tooltipArrowReference: ee.current,
|
|
45027
|
+
strategy: h,
|
|
45028
|
+
middlewares: w,
|
|
45029
|
+
border: G
|
|
45030
|
+
}).then(e => {
|
|
45031
|
+
Se.current && (Object.keys(e.tooltipStyles).length && ie(e.tooltipStyles), Object.keys(e.tooltipArrowStyles).length && se(e.tooltipArrowStyles), ne(e.place));
|
|
45032
|
+
});
|
|
45033
|
+
}, [ae, V, K, W, u, p, h, M, g]);
|
|
45034
|
+
|
|
45035
|
+
React.useEffect(() => {
|
|
45036
|
+
var e, t;
|
|
45037
|
+
const r = new Set(ye);
|
|
45038
|
+
we.forEach(e => {
|
|
45039
|
+
r.add({
|
|
45040
|
+
current: e
|
|
45041
|
+
});
|
|
45042
|
+
});
|
|
45043
|
+
const o = document.querySelector(`[id='${a}']`);
|
|
45044
|
+
o && r.add({
|
|
45045
|
+
current: o
|
|
45046
|
+
});
|
|
45047
|
+
|
|
45048
|
+
const n = () => {
|
|
45049
|
+
_e(!1);
|
|
45050
|
+
},
|
|
45051
|
+
l = x(V),
|
|
45052
|
+
i = x(Q.current);
|
|
45053
|
+
|
|
45054
|
+
z && (window.addEventListener("scroll", n), null == l || l.addEventListener("scroll", n), null == i || i.addEventListener("scroll", n));
|
|
45055
|
+
let c = null;
|
|
45056
|
+
q ? window.addEventListener("resize", n) : V && Q.current && (c = autoUpdate(V, Q.current, $e, {
|
|
45057
|
+
ancestorResize: !0,
|
|
45058
|
+
elementResize: !0,
|
|
45059
|
+
layoutShift: !0
|
|
45060
|
+
}));
|
|
45061
|
+
|
|
45062
|
+
const s = e => {
|
|
45063
|
+
"Escape" === e.key && _e(!1);
|
|
45064
|
+
};
|
|
45065
|
+
|
|
45066
|
+
N && window.addEventListener("keydown", s);
|
|
45067
|
+
const d = [];
|
|
45068
|
+
Ee ? (window.addEventListener("click", Ne), d.push({
|
|
45069
|
+
event: "click",
|
|
45070
|
+
listener: Re
|
|
45071
|
+
})) : (d.push({
|
|
45072
|
+
event: "mouseenter",
|
|
45073
|
+
listener: xe
|
|
45074
|
+
}, {
|
|
45075
|
+
event: "mouseleave",
|
|
45076
|
+
listener: ke
|
|
45077
|
+
}, {
|
|
45078
|
+
event: "focus",
|
|
45079
|
+
listener: xe
|
|
45080
|
+
}, {
|
|
45081
|
+
event: "blur",
|
|
45082
|
+
listener: ke
|
|
45083
|
+
}), g && d.push({
|
|
45084
|
+
event: "mousemove",
|
|
45085
|
+
listener: Oe
|
|
45086
|
+
}));
|
|
45087
|
+
|
|
45088
|
+
const u = () => {
|
|
45089
|
+
he.current = !0;
|
|
45090
|
+
},
|
|
45091
|
+
p = () => {
|
|
45092
|
+
he.current = !1, Te();
|
|
45093
|
+
};
|
|
45094
|
+
|
|
45095
|
+
return O && !Ee && (null === (e = Q.current) || void 0 === e || e.addEventListener("mouseenter", u), null === (t = Q.current) || void 0 === t || t.addEventListener("mouseleave", p)), d.forEach(({
|
|
45096
|
+
event: e,
|
|
45097
|
+
listener: t
|
|
45098
|
+
}) => {
|
|
45099
|
+
r.forEach(r => {
|
|
45100
|
+
var o;
|
|
45101
|
+
null === (o = r.current) || void 0 === o || o.addEventListener(e, t);
|
|
45102
|
+
});
|
|
45103
|
+
}), () => {
|
|
45104
|
+
var e, t;
|
|
45105
|
+
z && (window.removeEventListener("scroll", n), null == l || l.removeEventListener("scroll", n), null == i || i.removeEventListener("scroll", n)), q ? window.removeEventListener("resize", n) : null == c || c(), Ee && window.removeEventListener("click", Ne), N && window.removeEventListener("keydown", s), O && !Ee && (null === (e = Q.current) || void 0 === e || e.removeEventListener("mouseenter", u), null === (t = Q.current) || void 0 === t || t.removeEventListener("mouseleave", p)), d.forEach(({
|
|
45106
|
+
event: e,
|
|
45107
|
+
listener: t
|
|
45108
|
+
}) => {
|
|
45109
|
+
r.forEach(r => {
|
|
45110
|
+
var o;
|
|
45111
|
+
null === (o = r.current) || void 0 === o || o.removeEventListener(e, t);
|
|
45112
|
+
});
|
|
45113
|
+
});
|
|
45114
|
+
};
|
|
45115
|
+
}, [V, $e, ue, ye, we, N, v]), React.useEffect(() => {
|
|
45116
|
+
let e = null != d ? d : "";
|
|
45117
|
+
!e && t && (e = `[data-tooltip-id='${t}']`);
|
|
45118
|
+
const r = new MutationObserver(r => {
|
|
45119
|
+
const o = [];
|
|
45120
|
+
r.forEach(r => {
|
|
45121
|
+
if ("attributes" === r.type && "data-tooltip-id" === r.attributeName) {
|
|
45122
|
+
r.target.getAttribute("data-tooltip-id") === t && o.push(r.target);
|
|
45123
|
+
}
|
|
45124
|
+
|
|
45125
|
+
if ("childList" === r.type && (V && [...r.removedNodes].some(e => {
|
|
45126
|
+
var t;
|
|
45127
|
+
return !!(null === (t = null == e ? void 0 : e.contains) || void 0 === t ? void 0 : t.call(e, V)) && (pe(!1), _e(!1), Z(null), te.current && clearTimeout(te.current), re.current && clearTimeout(re.current), !0);
|
|
45128
|
+
}), e)) try {
|
|
45129
|
+
const t = [...r.addedNodes].filter(e => 1 === e.nodeType);
|
|
45130
|
+
o.push(...t.filter(t => t.matches(e))), o.push(...t.flatMap(t => [...t.querySelectorAll(e)]));
|
|
45131
|
+
} catch (e) {}
|
|
45132
|
+
}), o.length && be(e => [...e, ...o]);
|
|
45133
|
+
});
|
|
45134
|
+
return r.observe(document.body, {
|
|
45135
|
+
childList: !0,
|
|
45136
|
+
subtree: !0,
|
|
45137
|
+
attributes: !0,
|
|
45138
|
+
attributeFilter: ["data-tooltip-id"]
|
|
45139
|
+
}), () => {
|
|
45140
|
+
r.disconnect();
|
|
45141
|
+
};
|
|
45142
|
+
}, [t, d, V]), React.useEffect(() => {
|
|
45143
|
+
$e();
|
|
45144
|
+
}, [$e]), React.useEffect(() => {
|
|
45145
|
+
if (!(null == U ? void 0 : U.current)) return () => null;
|
|
45146
|
+
const e = new ResizeObserver(() => {
|
|
45147
|
+
$e();
|
|
45148
|
+
});
|
|
45149
|
+
return e.observe(U.current), () => {
|
|
45150
|
+
e.disconnect();
|
|
45151
|
+
};
|
|
45152
|
+
}, [K, null == U ? void 0 : U.current]), React.useEffect(() => {
|
|
45153
|
+
var e;
|
|
45154
|
+
const t = document.querySelector(`[id='${a}']`),
|
|
45155
|
+
r = [...we, t];
|
|
45156
|
+
V && r.includes(V) || Z(null !== (e = we[0]) && void 0 !== e ? e : t);
|
|
45157
|
+
}, [a, we, V]), React.useEffect(() => () => {
|
|
45158
|
+
te.current && clearTimeout(te.current), re.current && clearTimeout(re.current);
|
|
45159
|
+
}, []), React.useEffect(() => {
|
|
45160
|
+
let e = d;
|
|
45161
|
+
if (!e && t && (e = `[data-tooltip-id='${t}']`), e) try {
|
|
45162
|
+
const t = Array.from(document.querySelectorAll(e));
|
|
45163
|
+
be(t);
|
|
45164
|
+
} catch (e) {
|
|
45165
|
+
be([]);
|
|
45166
|
+
}
|
|
45167
|
+
}, [t, d]);
|
|
45168
|
+
const Ce = !A && K && ae && Object.keys(le).length > 0;
|
|
45169
|
+
return ue ? React__default["default"].createElement(b, {
|
|
45170
|
+
id: t,
|
|
45171
|
+
role: "tooltip",
|
|
45172
|
+
className: classnames("react-tooltip", $, H.tooltip, H[s], n, `react-tooltip__place-${oe}`, {
|
|
45173
|
+
"react-tooltip__show": Ce,
|
|
45174
|
+
[D]: Ce,
|
|
45175
|
+
[C]: "fixed" === h,
|
|
45176
|
+
[j]: O
|
|
45177
|
+
}),
|
|
45178
|
+
style: { ...W,
|
|
45179
|
+
...le,
|
|
45180
|
+
opacity: void 0 !== J && Ce ? J : void 0
|
|
45181
|
+
},
|
|
45182
|
+
ref: Q
|
|
45183
|
+
}, K, React__default["default"].createElement(b, {
|
|
45184
|
+
className: classnames("react-tooltip-arrow", I, H.arrow, l, {
|
|
45185
|
+
[B]: T
|
|
45186
|
+
}),
|
|
45187
|
+
style: ce,
|
|
45188
|
+
ref: ee
|
|
45189
|
+
})) : null;
|
|
45190
|
+
},
|
|
45191
|
+
q = ({
|
|
45192
|
+
content: t
|
|
45193
|
+
}) => React__default["default"].createElement("span", {
|
|
45194
|
+
dangerouslySetInnerHTML: {
|
|
45195
|
+
__html: t
|
|
45196
|
+
}
|
|
45197
|
+
}),
|
|
45198
|
+
W = ({
|
|
45199
|
+
id: t,
|
|
45200
|
+
anchorId: o,
|
|
45201
|
+
anchorSelect: n,
|
|
45202
|
+
content: l,
|
|
45203
|
+
html: s,
|
|
45204
|
+
render: a,
|
|
45205
|
+
className: d,
|
|
45206
|
+
classNameArrow: u,
|
|
45207
|
+
variant: p = "dark",
|
|
45208
|
+
place: v = "top",
|
|
45209
|
+
offset: m = 10,
|
|
45210
|
+
wrapper: y = "div",
|
|
45211
|
+
children: f = null,
|
|
45212
|
+
events: h = ["hover"],
|
|
45213
|
+
openOnClick: w = !1,
|
|
45214
|
+
positionStrategy: b = "absolute",
|
|
45215
|
+
middlewares: S,
|
|
45216
|
+
delayShow: E = 0,
|
|
45217
|
+
delayHide: _ = 0,
|
|
45218
|
+
float: g = !1,
|
|
45219
|
+
hidden: A = !1,
|
|
45220
|
+
noArrow: T = !1,
|
|
45221
|
+
clickable: O = !1,
|
|
45222
|
+
closeOnEsc: R = !1,
|
|
45223
|
+
closeOnScroll: N = !1,
|
|
45224
|
+
closeOnResize: x = !1,
|
|
45225
|
+
style: k,
|
|
45226
|
+
position: $,
|
|
45227
|
+
isOpen: C,
|
|
45228
|
+
disableStyleInjection: I = !1,
|
|
45229
|
+
border: B,
|
|
45230
|
+
opacity: j,
|
|
45231
|
+
setIsOpen: D,
|
|
45232
|
+
afterShow: H,
|
|
45233
|
+
afterHide: W
|
|
45234
|
+
}) => {
|
|
45235
|
+
const [M, P] = React.useState(l),
|
|
45236
|
+
[F, K] = React.useState(s),
|
|
45237
|
+
[U, X] = React.useState(v),
|
|
45238
|
+
[Y, V] = React.useState(p),
|
|
45239
|
+
[Z, G] = React.useState(m),
|
|
45240
|
+
[J, Q] = React.useState(E),
|
|
45241
|
+
[ee, te] = React.useState(_),
|
|
45242
|
+
[re, oe] = React.useState(g),
|
|
45243
|
+
[ne, le] = React.useState(A),
|
|
45244
|
+
[ie, ce] = React.useState(y),
|
|
45245
|
+
[se, ae] = React.useState(h),
|
|
45246
|
+
[de, ue] = React.useState(b),
|
|
45247
|
+
[pe, ve] = React.useState(null),
|
|
45248
|
+
me = React.useRef(I),
|
|
45249
|
+
{
|
|
45250
|
+
anchorRefs: ye,
|
|
45251
|
+
activeAnchor: fe
|
|
45252
|
+
} = L(t),
|
|
45253
|
+
he = e => null == e ? void 0 : e.getAttributeNames().reduce((t, r) => {
|
|
45254
|
+
var o;
|
|
45255
|
+
|
|
45256
|
+
if (r.startsWith("data-tooltip-")) {
|
|
45257
|
+
t[r.replace(/^data-tooltip-/, "")] = null !== (o = null == e ? void 0 : e.getAttribute(r)) && void 0 !== o ? o : null;
|
|
45258
|
+
}
|
|
45259
|
+
|
|
45260
|
+
return t;
|
|
45261
|
+
}, {}),
|
|
45262
|
+
we = e => {
|
|
45263
|
+
const t = {
|
|
45264
|
+
place: e => {
|
|
45265
|
+
var t;
|
|
45266
|
+
X(null !== (t = e) && void 0 !== t ? t : v);
|
|
45267
|
+
},
|
|
45268
|
+
content: e => {
|
|
45269
|
+
P(null != e ? e : l);
|
|
45270
|
+
},
|
|
45271
|
+
html: e => {
|
|
45272
|
+
K(null != e ? e : s);
|
|
45273
|
+
},
|
|
45274
|
+
variant: e => {
|
|
45275
|
+
var t;
|
|
45276
|
+
V(null !== (t = e) && void 0 !== t ? t : p);
|
|
45277
|
+
},
|
|
45278
|
+
offset: e => {
|
|
45279
|
+
G(null === e ? m : Number(e));
|
|
45280
|
+
},
|
|
45281
|
+
wrapper: e => {
|
|
45282
|
+
var t;
|
|
45283
|
+
ce(null !== (t = e) && void 0 !== t ? t : y);
|
|
45284
|
+
},
|
|
45285
|
+
events: e => {
|
|
45286
|
+
const t = null == e ? void 0 : e.split(" ");
|
|
45287
|
+
ae(null != t ? t : h);
|
|
45288
|
+
},
|
|
45289
|
+
"position-strategy": e => {
|
|
45290
|
+
var t;
|
|
45291
|
+
ue(null !== (t = e) && void 0 !== t ? t : b);
|
|
45292
|
+
},
|
|
45293
|
+
"delay-show": e => {
|
|
45294
|
+
Q(null === e ? E : Number(e));
|
|
45295
|
+
},
|
|
45296
|
+
"delay-hide": e => {
|
|
45297
|
+
te(null === e ? _ : Number(e));
|
|
45298
|
+
},
|
|
45299
|
+
float: e => {
|
|
45300
|
+
oe(null === e ? g : "true" === e);
|
|
45301
|
+
},
|
|
45302
|
+
hidden: e => {
|
|
45303
|
+
le(null === e ? A : "true" === e);
|
|
45304
|
+
}
|
|
45305
|
+
};
|
|
45306
|
+
Object.values(t).forEach(e => e(null)), Object.entries(e).forEach(([e, r]) => {
|
|
45307
|
+
var o;
|
|
45308
|
+
null === (o = t[e]) || void 0 === o || o.call(t, r);
|
|
45309
|
+
});
|
|
45310
|
+
};
|
|
45311
|
+
|
|
45312
|
+
React.useEffect(() => {
|
|
45313
|
+
P(l);
|
|
45314
|
+
}, [l]), React.useEffect(() => {
|
|
45315
|
+
K(s);
|
|
45316
|
+
}, [s]), React.useEffect(() => {
|
|
45317
|
+
X(v);
|
|
45318
|
+
}, [v]), React.useEffect(() => {
|
|
45319
|
+
V(p);
|
|
45320
|
+
}, [p]), React.useEffect(() => {
|
|
45321
|
+
G(m);
|
|
45322
|
+
}, [m]), React.useEffect(() => {
|
|
45323
|
+
Q(E);
|
|
45324
|
+
}, [E]), React.useEffect(() => {
|
|
45325
|
+
te(_);
|
|
45326
|
+
}, [_]), React.useEffect(() => {
|
|
45327
|
+
oe(g);
|
|
45328
|
+
}, [g]), React.useEffect(() => {
|
|
45329
|
+
le(A);
|
|
45330
|
+
}, [A]), React.useEffect(() => {
|
|
45331
|
+
ue(b);
|
|
45332
|
+
}, [b]), React.useEffect(() => {
|
|
45333
|
+
me.current !== I && console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");
|
|
45334
|
+
}, [I]), React.useEffect(() => {
|
|
45335
|
+
"undefined" != typeof window && window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles", {
|
|
45336
|
+
detail: {
|
|
45337
|
+
disableCore: "core" === I,
|
|
45338
|
+
disableBase: I
|
|
45339
|
+
}
|
|
45340
|
+
}));
|
|
45341
|
+
}, []), React.useEffect(() => {
|
|
45342
|
+
var e;
|
|
45343
|
+
const r = new Set(ye);
|
|
45344
|
+
let l = n;
|
|
45345
|
+
if (!l && t && (l = `[data-tooltip-id='${t}']`), l) try {
|
|
45346
|
+
document.querySelectorAll(l).forEach(e => {
|
|
45347
|
+
r.add({
|
|
45348
|
+
current: e
|
|
45349
|
+
});
|
|
45350
|
+
});
|
|
45351
|
+
} catch (e) {
|
|
45352
|
+
console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`);
|
|
45353
|
+
}
|
|
45354
|
+
const i = document.querySelector(`[id='${o}']`);
|
|
45355
|
+
if (i && r.add({
|
|
45356
|
+
current: i
|
|
45357
|
+
}), !r.size) return () => null;
|
|
45358
|
+
const c = null !== (e = null != pe ? pe : i) && void 0 !== e ? e : fe.current,
|
|
45359
|
+
s = new MutationObserver(e => {
|
|
45360
|
+
e.forEach(e => {
|
|
45361
|
+
var t;
|
|
45362
|
+
if (!c || "attributes" !== e.type || !(null === (t = e.attributeName) || void 0 === t ? void 0 : t.startsWith("data-tooltip-"))) return;
|
|
45363
|
+
const r = he(c);
|
|
45364
|
+
we(r);
|
|
45365
|
+
});
|
|
45366
|
+
}),
|
|
45367
|
+
a = {
|
|
45368
|
+
attributes: !0,
|
|
45369
|
+
childList: !1,
|
|
45370
|
+
subtree: !1
|
|
45371
|
+
};
|
|
45372
|
+
|
|
45373
|
+
if (c) {
|
|
45374
|
+
const e = he(c);
|
|
45375
|
+
we(e), s.observe(c, a);
|
|
45376
|
+
}
|
|
45377
|
+
|
|
45378
|
+
return () => {
|
|
45379
|
+
s.disconnect();
|
|
45380
|
+
};
|
|
45381
|
+
}, [ye, fe, pe, o, n]), React.useEffect(() => {
|
|
45382
|
+
(null == k ? void 0 : k.border) && console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."), B && !CSS.supports("border", `${B}`) && console.warn(`[react-tooltip] "${B}" is not a valid \`border\`.`), (null == k ? void 0 : k.opacity) && console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."), j && !CSS.supports("opacity", `${j}`) && console.warn(`[react-tooltip] "${j}" is not a valid \`opacity\`.`);
|
|
45383
|
+
}, []);
|
|
45384
|
+
let be = f;
|
|
45385
|
+
const Se = React.useRef(null);
|
|
45386
|
+
|
|
45387
|
+
if (a) {
|
|
45388
|
+
const t = a({
|
|
45389
|
+
content: null != M ? M : null,
|
|
45390
|
+
activeAnchor: pe
|
|
45391
|
+
});
|
|
45392
|
+
be = t ? React__default["default"].createElement("div", {
|
|
45393
|
+
ref: Se,
|
|
45394
|
+
className: "react-tooltip-content-wrapper"
|
|
45395
|
+
}, t) : null;
|
|
45396
|
+
} else M && (be = M);
|
|
45397
|
+
|
|
45398
|
+
F && (be = React__default["default"].createElement(q, {
|
|
45399
|
+
content: F
|
|
45400
|
+
}));
|
|
45401
|
+
const Ee = {
|
|
45402
|
+
id: t,
|
|
45403
|
+
anchorId: o,
|
|
45404
|
+
anchorSelect: n,
|
|
45405
|
+
className: d,
|
|
45406
|
+
classNameArrow: u,
|
|
45407
|
+
content: be,
|
|
45408
|
+
contentWrapperRef: Se,
|
|
45409
|
+
place: U,
|
|
45410
|
+
variant: Y,
|
|
45411
|
+
offset: Z,
|
|
45412
|
+
wrapper: ie,
|
|
45413
|
+
events: se,
|
|
45414
|
+
openOnClick: w,
|
|
45415
|
+
positionStrategy: de,
|
|
45416
|
+
middlewares: S,
|
|
45417
|
+
delayShow: J,
|
|
45418
|
+
delayHide: ee,
|
|
45419
|
+
float: re,
|
|
45420
|
+
hidden: ne,
|
|
45421
|
+
noArrow: T,
|
|
45422
|
+
clickable: O,
|
|
45423
|
+
closeOnEsc: R,
|
|
45424
|
+
closeOnScroll: N,
|
|
45425
|
+
closeOnResize: x,
|
|
45426
|
+
style: k,
|
|
45427
|
+
position: $,
|
|
45428
|
+
isOpen: C,
|
|
45429
|
+
border: B,
|
|
45430
|
+
opacity: j,
|
|
45431
|
+
setIsOpen: D,
|
|
45432
|
+
afterShow: H,
|
|
45433
|
+
afterHide: W,
|
|
45434
|
+
activeAnchor: pe,
|
|
45435
|
+
setActiveAnchor: e => ve(e)
|
|
45436
|
+
};
|
|
45437
|
+
return React__default["default"].createElement(z, { ...Ee
|
|
45438
|
+
});
|
|
45439
|
+
};
|
|
45440
|
+
|
|
45441
|
+
"undefined" != typeof window && window.addEventListener("react-tooltip-inject-styles", e => {
|
|
45442
|
+
e.detail.disableCore || b({
|
|
45443
|
+
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}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.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{visibility:visible;opacity:var(--rt-opacity)}`,
|
|
45444
|
+
type: "core"
|
|
45445
|
+
}), e.detail.disableBase || b({
|
|
45446
|
+
css: `
|
|
45447
|
+
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.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)}`,
|
|
45448
|
+
type: "base"
|
|
45449
|
+
});
|
|
45450
|
+
});
|
|
45451
|
+
|
|
43033
45452
|
function ContextualHelp(_ref) {
|
|
43034
45453
|
var id = _ref.id;
|
|
45454
|
+
var snippetContainerRef = React.useRef();
|
|
45455
|
+
var snippetRef = React.useRef();
|
|
45456
|
+
var articleRef = React.useRef();
|
|
43035
45457
|
|
|
43036
45458
|
var _useState = React.useState(null),
|
|
43037
45459
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -43053,6 +45475,32 @@ function ContextualHelp(_ref) {
|
|
|
43053
45475
|
isMihelpEnabled && getArticle();
|
|
43054
45476
|
}, []);
|
|
43055
45477
|
|
|
45478
|
+
var setTooltipStyles = function setTooltipStyles() {
|
|
45479
|
+
if (snippetRef.current && snippetContainerRef.current) {
|
|
45480
|
+
var rect = snippetRef.current.getBoundingClientRect();
|
|
45481
|
+
var topSpace = rect.top;
|
|
45482
|
+
var bottomSpace = window.innerHeight - rect.bottom;
|
|
45483
|
+
var maxHeight = Math.max(topSpace, bottomSpace);
|
|
45484
|
+
|
|
45485
|
+
if (articleRef.current) {
|
|
45486
|
+
articleRef.current.style.maxHeight = "".concat(maxHeight - 45, "px");
|
|
45487
|
+
}
|
|
45488
|
+
|
|
45489
|
+
setTimeout(function () {
|
|
45490
|
+
var arrowEl = snippetContainerRef.current.querySelector('.snippet-arrow');
|
|
45491
|
+
var tooltipEl = snippetContainerRef.current.querySelector('.react-tooltip');
|
|
45492
|
+
|
|
45493
|
+
if (tooltipEl.classList.toString().includes('react-tooltip__place-bottom')) {
|
|
45494
|
+
arrowEl.style.borderLeft = '1px solid rgba(0, 0, 0, 0.2)';
|
|
45495
|
+
arrowEl.style.borderTop = '1px solid rgba(0, 0, 0, 0.2)';
|
|
45496
|
+
} else {
|
|
45497
|
+
arrowEl.style.borderRight = '1px solid rgba(0, 0, 0, 0.2)';
|
|
45498
|
+
arrowEl.style.borderBottom = '1px solid rgba(0, 0, 0, 0.2)';
|
|
45499
|
+
}
|
|
45500
|
+
}, 100);
|
|
45501
|
+
}
|
|
45502
|
+
};
|
|
45503
|
+
|
|
43056
45504
|
var getArticle =
|
|
43057
45505
|
/*#__PURE__*/
|
|
43058
45506
|
function () {
|
|
@@ -43099,18 +45547,12 @@ function ContextualHelp(_ref) {
|
|
|
43099
45547
|
};
|
|
43100
45548
|
}();
|
|
43101
45549
|
|
|
43102
|
-
return React__default["default"].createElement("div",
|
|
43103
|
-
|
|
43104
|
-
|
|
43105
|
-
|
|
43106
|
-
|
|
43107
|
-
|
|
43108
|
-
style: {
|
|
43109
|
-
color: 'rgba(224, 26, 26, 0.8)'
|
|
43110
|
-
}
|
|
43111
|
-
}, "Article Not Found") : React__default["default"].createElement(Snippet, {
|
|
43112
|
-
article: article
|
|
43113
|
-
})
|
|
45550
|
+
return React__default["default"].createElement("div", {
|
|
45551
|
+
className: "utilities_ContextualHelp_ContextualHelp--snippetContainer",
|
|
45552
|
+
ref: snippetContainerRef
|
|
45553
|
+
}, React__default["default"].createElement("span", {
|
|
45554
|
+
id: "helpSnippet1",
|
|
45555
|
+
ref: snippetRef
|
|
43114
45556
|
}, React__default["default"].createElement(coreComponents.Icon, {
|
|
43115
45557
|
name: "help",
|
|
43116
45558
|
variant: "material",
|
|
@@ -43119,6 +45561,16 @@ function ContextualHelp(_ref) {
|
|
|
43119
45561
|
color: '#1d5ab9',
|
|
43120
45562
|
cursor: 'default'
|
|
43121
45563
|
}
|
|
45564
|
+
})), React__default["default"].createElement(W, {
|
|
45565
|
+
anchorSelect: "#helpSnippet1",
|
|
45566
|
+
clickable: true,
|
|
45567
|
+
className: "utilities_ContextualHelp_ContextualHelp--snippet",
|
|
45568
|
+
classNameArrow: "snippet-arrow"
|
|
45569
|
+
}, React__default["default"].createElement(Snippet, {
|
|
45570
|
+
article: article,
|
|
45571
|
+
setTooltipStyles: setTooltipStyles,
|
|
45572
|
+
isMihelpEnabled: isMihelpEnabled,
|
|
45573
|
+
articleRef: articleRef
|
|
43122
45574
|
})));
|
|
43123
45575
|
}
|
|
43124
45576
|
|