storybook 10.1.0-alpha.10 → 10.1.0-alpha.12
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/_browser-chunks/Color-FTG7SQDA.js +1097 -0
- package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
- package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
- package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
- package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
- package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
- package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
- package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-74YHFU5B.js} +44 -109
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
- package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
- package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
- package/dist/_browser-chunks/chunk-BE2DAXKJ.js +2966 -0
- package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
- package/dist/_browser-chunks/chunk-EBHB6RPS.js +61 -0
- package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
- package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
- package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
- package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
- package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
- package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
- package/dist/_browser-chunks/{chunk-QMY4G4R2.js → chunk-L4RMQ7D7.js} +17 -64
- package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
- package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
- package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
- package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
- package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
- package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
- package/dist/_browser-chunks/chunk-WXP2XJ3O.js +950 -0
- package/dist/_browser-chunks/chunk-X3DUQ5RA.js +47 -0
- package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
- package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
- package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
- package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
- package/dist/_browser-chunks/{syntaxhighlighter-RJZASWHL.js → syntaxhighlighter-WKBQ5RC7.js} +704 -1848
- package/dist/_node-chunks/{builder-manager-HA7CYFCK.js → builder-manager-YUOHSIUB.js} +475 -1013
- package/dist/_node-chunks/camelcase-JREIL7NV.js +18 -0
- package/dist/_node-chunks/{chunk-RMHAL25C.js → chunk-2D2IODUU.js} +88 -228
- package/dist/_node-chunks/chunk-2DMESZFJ.js +943 -0
- package/dist/_node-chunks/chunk-4FT2DHGE.js +3009 -0
- package/dist/_node-chunks/chunk-5HV3B5OP.js +45571 -0
- package/dist/_node-chunks/{chunk-OVXB5GGT.js → chunk-5KLIDWFN.js} +292 -688
- package/dist/_node-chunks/chunk-A4APXFQ2.js +759 -0
- package/dist/_node-chunks/chunk-B6JWY6PC.js +37 -0
- package/dist/_node-chunks/chunk-CZ5GHJCC.js +603 -0
- package/dist/_node-chunks/chunk-DUXPWBOK.js +61 -0
- package/dist/_node-chunks/chunk-DWXTZT3D.js +58 -0
- package/dist/_node-chunks/chunk-E5FJS66Z.js +20 -0
- package/dist/_node-chunks/chunk-EZWWR7AR.js +936 -0
- package/dist/_node-chunks/chunk-FDXFVHIL.js +1114 -0
- package/dist/_node-chunks/{chunk-F3XOPI6H.js → chunk-FZLRAH4N.js} +469 -983
- package/dist/_node-chunks/chunk-HZG65SU3.js +34 -0
- package/dist/_node-chunks/chunk-IXVYNBMD.js +18 -0
- package/dist/_node-chunks/chunk-JARUEMEP.js +4523 -0
- package/dist/_node-chunks/chunk-LIH7MTP7.js +3214 -0
- package/dist/_node-chunks/chunk-N5GIRUP5.js +1047 -0
- package/dist/_node-chunks/{chunk-X4XU27M6.js → chunk-NAOYEL54.js} +15 -24
- package/dist/_node-chunks/chunk-O5DA7YLO.js +3171 -0
- package/dist/_node-chunks/chunk-OP3INKUD.js +54 -0
- package/dist/_node-chunks/chunk-QCO2ZM7F.js +209 -0
- package/dist/_node-chunks/chunk-QYQIZBS6.js +26 -0
- package/dist/_node-chunks/chunk-SEMIAAWG.js +1564 -0
- package/dist/_node-chunks/chunk-TS2UUH2J.js +301 -0
- package/dist/_node-chunks/chunk-WA6KZQZ2.js +119 -0
- package/dist/_node-chunks/{chunk-ZHSCUGNP.js → chunk-WFLWJO24.js} +3799 -7849
- package/dist/_node-chunks/chunk-WUXQMQCB.js +72 -0
- package/dist/_node-chunks/{chunk-VPR5IBMG.js → chunk-XXPJ7XR3.js} +8 -10
- package/dist/_node-chunks/chunk-Y4E6IGQF.js +61 -0
- package/dist/_node-chunks/chunk-ZL3AFKRX.js +1029 -0
- package/dist/_node-chunks/chunk-ZXSD6L3S.js +756 -0
- package/dist/_node-chunks/dist-DS2B5A3J.js +121 -0
- package/dist/_node-chunks/globby-6THB7HVX.js +3452 -0
- package/dist/_node-chunks/lib-5NKX4YGG.js +366 -0
- package/dist/_node-chunks/mdx-N42X6CFJ-ZLT3QOFF.js +14329 -0
- package/dist/_node-chunks/p-limit-PDMWNG7W.js +116 -0
- package/dist/_node-chunks/plugin-6XMWOGPO.js +123 -0
- package/dist/_node-chunks/{plugin-6ZPCS4LI.js → plugin-LTOXVT6A.js} +36 -56
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +46582 -0
- package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +92 -0
- package/dist/actions/decorator.js +21 -42
- package/dist/actions/index.js +3 -3
- package/dist/babel/index.d.ts +671 -335
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +592 -1546
- package/dist/bin/dispatcher.js +26 -37
- package/dist/bin/loader.js +23 -34
- package/dist/channels/index.js +98 -234
- package/dist/cli/index.js +1951 -5308
- package/dist/client-logger/index.js +31 -61
- package/dist/common/index.js +20 -20
- package/dist/components/index.js +4211 -8586
- package/dist/core-events/index.js +2 -66
- package/dist/core-server/index.js +3054 -7290
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +1806 -3427
- package/dist/core-server/presets/common-override-preset.js +31 -60
- package/dist/core-server/presets/common-preset.js +434 -924
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +15 -19
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +12 -17
- package/dist/csf/index.js +534 -1179
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -6
- package/dist/highlight/index.js +2 -2
- package/dist/instrumenter/index.js +199 -415
- package/dist/manager/globals-runtime.js +24150 -47364
- package/dist/manager/globals.js +2 -3
- package/dist/manager/runtime.js +3961 -8373
- package/dist/manager-api/index.js +1231 -2425
- package/dist/manager-errors.d.ts +3 -0
- package/dist/manager-errors.js +3 -3
- package/dist/node-logger/index.js +1253 -2601
- package/dist/preview/globals.js +2 -3
- package/dist/preview/runtime.js +10364 -21990
- package/dist/preview-api/index.d.ts +67 -68
- package/dist/preview-api/index.js +13 -13
- package/dist/preview-errors.d.ts +3 -0
- package/dist/preview-errors.js +4 -4
- package/dist/router/index.js +347 -899
- package/dist/server-errors.d.ts +3 -0
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.js +24 -24
- package/dist/test/index.js +5860 -11645
- package/dist/theming/create.js +4 -4
- package/dist/theming/index.d.ts +3363 -2597
- package/dist/theming/index.js +490 -1086
- package/dist/types/index.js +2 -11
- package/dist/viewport/index.js +3 -3
- package/package.json +5 -5
- package/dist/_browser-chunks/Color-FQNEU7YS.js +0 -1695
- package/dist/_browser-chunks/WithTooltip-6NHN2GXF.js +0 -2343
- package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
- package/dist/_browser-chunks/chunk-AW46NMGV.js +0 -1308
- package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
- package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
- package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
- package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
- package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
- package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
- package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
- package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
- package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
- package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
- package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
- package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
- package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
- package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
- package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
- package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
- package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
- package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
- package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
- package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
- package/dist/_node-chunks/camelcase-QALD4XFE.js +0 -18
- package/dist/_node-chunks/chunk-2XY53ALL.js +0 -420
- package/dist/_node-chunks/chunk-3CBQMG2A.js +0 -6712
- package/dist/_node-chunks/chunk-3WDAPZYQ.js +0 -28
- package/dist/_node-chunks/chunk-4ZB555EJ.js +0 -697
- package/dist/_node-chunks/chunk-52DXKXY3.js +0 -4272
- package/dist/_node-chunks/chunk-5OVB4A6F.js +0 -69
- package/dist/_node-chunks/chunk-AGHGNXGH.js +0 -18
- package/dist/_node-chunks/chunk-B23X5ZCK.js +0 -1531
- package/dist/_node-chunks/chunk-B2DAHWJK.js +0 -220
- package/dist/_node-chunks/chunk-CC4PW5MJ.js +0 -34
- package/dist/_node-chunks/chunk-D7NIZELR.js +0 -2256
- package/dist/_node-chunks/chunk-DO5Q3H4L.js +0 -1250
- package/dist/_node-chunks/chunk-ECK7WVFX.js +0 -304
- package/dist/_node-chunks/chunk-EUH3NHXA.js +0 -79
- package/dist/_node-chunks/chunk-FOQHPHCV.js +0 -1657
- package/dist/_node-chunks/chunk-G6EL47NS.js +0 -111
- package/dist/_node-chunks/chunk-GFLS4TJB.js +0 -90
- package/dist/_node-chunks/chunk-J3XZKWHE.js +0 -1586
- package/dist/_node-chunks/chunk-LE63EHJ5.js +0 -1518
- package/dist/_node-chunks/chunk-M47XA42S.js +0 -4741
- package/dist/_node-chunks/chunk-OOI74AL3.js +0 -61
- package/dist/_node-chunks/chunk-PRJHT3GJ.js +0 -61
- package/dist/_node-chunks/chunk-Q52PVUSU.js +0 -101
- package/dist/_node-chunks/chunk-SDCF5RNN.js +0 -1198
- package/dist/_node-chunks/chunk-UJ5SJ23M.js +0 -5029
- package/dist/_node-chunks/chunk-UPHK4ETU.js +0 -64658
- package/dist/_node-chunks/chunk-V7VURIPB.js +0 -1544
- package/dist/_node-chunks/dist-6TXHNR5C.js +0 -175
- package/dist/_node-chunks/globby-PBTV6PX6.js +0 -5222
- package/dist/_node-chunks/lib-4RTDZVGX.js +0 -518
- package/dist/_node-chunks/mdx-N42X6CFJ-COWEH7KR.js +0 -22017
- package/dist/_node-chunks/p-limit-PBVZQOFY.js +0 -168
- package/dist/_node-chunks/plugin-EOZKYZAG.js +0 -159
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-35HMSMR5.js +0 -69102
- package/dist/_node-chunks/webpack-mock-plugin-GT3MA5E2.js +0 -124
|
@@ -1,2343 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
_objectWithoutPropertiesLoose
|
|
3
|
-
} from "./chunk-VAMFPZY3.js";
|
|
4
|
-
import {
|
|
5
|
-
_extends
|
|
6
|
-
} from "./chunk-MH6AXFXB.js";
|
|
7
|
-
import {
|
|
8
|
-
require_memoizerific
|
|
9
|
-
} from "./chunk-NVV6MIOE.js";
|
|
10
|
-
import {
|
|
11
|
-
__commonJS,
|
|
12
|
-
__name,
|
|
13
|
-
__toESM
|
|
14
|
-
} from "./chunk-MM7DTO55.js";
|
|
15
|
-
|
|
16
|
-
// ../node_modules/react-fast-compare/index.js
|
|
17
|
-
var require_react_fast_compare = __commonJS({
|
|
18
|
-
"../node_modules/react-fast-compare/index.js"(exports, module) {
|
|
19
|
-
var hasElementType = typeof Element !== "undefined";
|
|
20
|
-
var hasMap = typeof Map === "function";
|
|
21
|
-
var hasSet = typeof Set === "function";
|
|
22
|
-
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
|
|
23
|
-
function equal(a, b) {
|
|
24
|
-
if (a === b) return true;
|
|
25
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
26
|
-
if (a.constructor !== b.constructor) return false;
|
|
27
|
-
var length, i, keys;
|
|
28
|
-
if (Array.isArray(a)) {
|
|
29
|
-
length = a.length;
|
|
30
|
-
if (length != b.length) return false;
|
|
31
|
-
for (i = length; i-- !== 0; )
|
|
32
|
-
if (!equal(a[i], b[i])) return false;
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
var it;
|
|
36
|
-
if (hasMap && a instanceof Map && b instanceof Map) {
|
|
37
|
-
if (a.size !== b.size) return false;
|
|
38
|
-
it = a.entries();
|
|
39
|
-
while (!(i = it.next()).done)
|
|
40
|
-
if (!b.has(i.value[0])) return false;
|
|
41
|
-
it = a.entries();
|
|
42
|
-
while (!(i = it.next()).done)
|
|
43
|
-
if (!equal(i.value[1], b.get(i.value[0]))) return false;
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
if (hasSet && a instanceof Set && b instanceof Set) {
|
|
47
|
-
if (a.size !== b.size) return false;
|
|
48
|
-
it = a.entries();
|
|
49
|
-
while (!(i = it.next()).done)
|
|
50
|
-
if (!b.has(i.value[0])) return false;
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
54
|
-
length = a.length;
|
|
55
|
-
if (length != b.length) return false;
|
|
56
|
-
for (i = length; i-- !== 0; )
|
|
57
|
-
if (a[i] !== b[i]) return false;
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
61
|
-
if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === "function" && typeof b.valueOf === "function") return a.valueOf() === b.valueOf();
|
|
62
|
-
if (a.toString !== Object.prototype.toString && typeof a.toString === "function" && typeof b.toString === "function") return a.toString() === b.toString();
|
|
63
|
-
keys = Object.keys(a);
|
|
64
|
-
length = keys.length;
|
|
65
|
-
if (length !== Object.keys(b).length) return false;
|
|
66
|
-
for (i = length; i-- !== 0; )
|
|
67
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
68
|
-
if (hasElementType && a instanceof Element) return false;
|
|
69
|
-
for (i = length; i-- !== 0; ) {
|
|
70
|
-
if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a.$$typeof) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
if (!equal(a[keys[i]], b[keys[i]])) return false;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
return a !== a && b !== b;
|
|
78
|
-
}
|
|
79
|
-
__name(equal, "equal");
|
|
80
|
-
module.exports = /* @__PURE__ */ __name(function isEqual2(a, b) {
|
|
81
|
-
try {
|
|
82
|
-
return equal(a, b);
|
|
83
|
-
} catch (error) {
|
|
84
|
-
if ((error.message || "").match(/stack|recursion/i)) {
|
|
85
|
-
console.warn("react-fast-compare cannot handle circular refs");
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
throw error;
|
|
89
|
-
}
|
|
90
|
-
}, "isEqual");
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// ../node_modules/warning/warning.js
|
|
95
|
-
var require_warning = __commonJS({
|
|
96
|
-
"../node_modules/warning/warning.js"(exports, module) {
|
|
97
|
-
"use strict";
|
|
98
|
-
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
99
|
-
var warning2 = /* @__PURE__ */ __name(function() {
|
|
100
|
-
}, "warning");
|
|
101
|
-
if (__DEV__) {
|
|
102
|
-
printWarning = /* @__PURE__ */ __name(function printWarning2(format, args) {
|
|
103
|
-
var len = arguments.length;
|
|
104
|
-
args = new Array(len > 1 ? len - 1 : 0);
|
|
105
|
-
for (var key = 1; key < len; key++) {
|
|
106
|
-
args[key - 1] = arguments[key];
|
|
107
|
-
}
|
|
108
|
-
var argIndex = 0;
|
|
109
|
-
var message = "Warning: " + format.replace(/%s/g, function() {
|
|
110
|
-
return args[argIndex++];
|
|
111
|
-
});
|
|
112
|
-
if (typeof console !== "undefined") {
|
|
113
|
-
console.error(message);
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
throw new Error(message);
|
|
117
|
-
} catch (x) {
|
|
118
|
-
}
|
|
119
|
-
}, "printWarning");
|
|
120
|
-
warning2 = /* @__PURE__ */ __name(function(condition, format, args) {
|
|
121
|
-
var len = arguments.length;
|
|
122
|
-
args = new Array(len > 2 ? len - 2 : 0);
|
|
123
|
-
for (var key = 2; key < len; key++) {
|
|
124
|
-
args[key - 2] = arguments[key];
|
|
125
|
-
}
|
|
126
|
-
if (format === void 0) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
if (!condition) {
|
|
132
|
-
printWarning.apply(null, [format].concat(args));
|
|
133
|
-
}
|
|
134
|
-
}, "warning");
|
|
135
|
-
}
|
|
136
|
-
var printWarning;
|
|
137
|
-
module.exports = warning2;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// src/components/components/tooltip/WithTooltip.tsx
|
|
142
|
-
var import_memoizerific = __toESM(require_memoizerific(), 1);
|
|
143
|
-
import React7, { useCallback as useCallback4, useEffect as useEffect6, useState as useState5 } from "react";
|
|
144
|
-
import ReactDOM2 from "react-dom";
|
|
145
|
-
import { deprecate } from "storybook/internal/client-logger";
|
|
146
|
-
import { global } from "@storybook/global";
|
|
147
|
-
|
|
148
|
-
// ../node_modules/react-popper-tooltip/dist/esm/react-popper-tooltip.js
|
|
149
|
-
import * as React6 from "react";
|
|
150
|
-
|
|
151
|
-
// ../node_modules/react-popper/lib/esm/Popper.js
|
|
152
|
-
import * as React4 from "react";
|
|
153
|
-
|
|
154
|
-
// ../node_modules/react-popper/lib/esm/Manager.js
|
|
155
|
-
import * as React from "react";
|
|
156
|
-
var ManagerReferenceNodeContext = React.createContext();
|
|
157
|
-
var ManagerReferenceNodeSetterContext = React.createContext();
|
|
158
|
-
|
|
159
|
-
// ../node_modules/react-popper/lib/esm/utils.js
|
|
160
|
-
import * as React2 from "react";
|
|
161
|
-
var fromEntries = /* @__PURE__ */ __name(function fromEntries2(entries) {
|
|
162
|
-
return entries.reduce(function(acc, _ref) {
|
|
163
|
-
var key = _ref[0], value = _ref[1];
|
|
164
|
-
acc[key] = value;
|
|
165
|
-
return acc;
|
|
166
|
-
}, {});
|
|
167
|
-
}, "fromEntries");
|
|
168
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" && window.document && window.document.createElement ? React2.useLayoutEffect : React2.useEffect;
|
|
169
|
-
|
|
170
|
-
// ../node_modules/react-popper/lib/esm/usePopper.js
|
|
171
|
-
import * as React3 from "react";
|
|
172
|
-
import * as ReactDOM from "react-dom";
|
|
173
|
-
|
|
174
|
-
// ../node_modules/@popperjs/core/lib/enums.js
|
|
175
|
-
var top = "top";
|
|
176
|
-
var bottom = "bottom";
|
|
177
|
-
var right = "right";
|
|
178
|
-
var left = "left";
|
|
179
|
-
var auto = "auto";
|
|
180
|
-
var basePlacements = [top, bottom, right, left];
|
|
181
|
-
var start = "start";
|
|
182
|
-
var end = "end";
|
|
183
|
-
var clippingParents = "clippingParents";
|
|
184
|
-
var viewport = "viewport";
|
|
185
|
-
var popper = "popper";
|
|
186
|
-
var reference = "reference";
|
|
187
|
-
var variationPlacements = basePlacements.reduce(function(acc, placement) {
|
|
188
|
-
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
189
|
-
}, []);
|
|
190
|
-
var placements = [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
191
|
-
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
192
|
-
}, []);
|
|
193
|
-
var beforeRead = "beforeRead";
|
|
194
|
-
var read = "read";
|
|
195
|
-
var afterRead = "afterRead";
|
|
196
|
-
var beforeMain = "beforeMain";
|
|
197
|
-
var main = "main";
|
|
198
|
-
var afterMain = "afterMain";
|
|
199
|
-
var beforeWrite = "beforeWrite";
|
|
200
|
-
var write = "write";
|
|
201
|
-
var afterWrite = "afterWrite";
|
|
202
|
-
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
203
|
-
|
|
204
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
|
|
205
|
-
function getNodeName(element) {
|
|
206
|
-
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
207
|
-
}
|
|
208
|
-
__name(getNodeName, "getNodeName");
|
|
209
|
-
|
|
210
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getWindow.js
|
|
211
|
-
function getWindow(node) {
|
|
212
|
-
if (node == null) {
|
|
213
|
-
return window;
|
|
214
|
-
}
|
|
215
|
-
if (node.toString() !== "[object Window]") {
|
|
216
|
-
var ownerDocument = node.ownerDocument;
|
|
217
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
218
|
-
}
|
|
219
|
-
return node;
|
|
220
|
-
}
|
|
221
|
-
__name(getWindow, "getWindow");
|
|
222
|
-
|
|
223
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
|
|
224
|
-
function isElement(node) {
|
|
225
|
-
var OwnElement = getWindow(node).Element;
|
|
226
|
-
return node instanceof OwnElement || node instanceof Element;
|
|
227
|
-
}
|
|
228
|
-
__name(isElement, "isElement");
|
|
229
|
-
function isHTMLElement(node) {
|
|
230
|
-
var OwnElement = getWindow(node).HTMLElement;
|
|
231
|
-
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
232
|
-
}
|
|
233
|
-
__name(isHTMLElement, "isHTMLElement");
|
|
234
|
-
function isShadowRoot(node) {
|
|
235
|
-
if (typeof ShadowRoot === "undefined") {
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
|
239
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
240
|
-
}
|
|
241
|
-
__name(isShadowRoot, "isShadowRoot");
|
|
242
|
-
|
|
243
|
-
// ../node_modules/@popperjs/core/lib/modifiers/applyStyles.js
|
|
244
|
-
function applyStyles(_ref) {
|
|
245
|
-
var state = _ref.state;
|
|
246
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
247
|
-
var style = state.styles[name] || {};
|
|
248
|
-
var attributes = state.attributes[name] || {};
|
|
249
|
-
var element = state.elements[name];
|
|
250
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
Object.assign(element.style, style);
|
|
254
|
-
Object.keys(attributes).forEach(function(name2) {
|
|
255
|
-
var value = attributes[name2];
|
|
256
|
-
if (value === false) {
|
|
257
|
-
element.removeAttribute(name2);
|
|
258
|
-
} else {
|
|
259
|
-
element.setAttribute(name2, value === true ? "" : value);
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
__name(applyStyles, "applyStyles");
|
|
265
|
-
function effect(_ref2) {
|
|
266
|
-
var state = _ref2.state;
|
|
267
|
-
var initialStyles = {
|
|
268
|
-
popper: {
|
|
269
|
-
position: state.options.strategy,
|
|
270
|
-
left: "0",
|
|
271
|
-
top: "0",
|
|
272
|
-
margin: "0"
|
|
273
|
-
},
|
|
274
|
-
arrow: {
|
|
275
|
-
position: "absolute"
|
|
276
|
-
},
|
|
277
|
-
reference: {}
|
|
278
|
-
};
|
|
279
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
280
|
-
state.styles = initialStyles;
|
|
281
|
-
if (state.elements.arrow) {
|
|
282
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
283
|
-
}
|
|
284
|
-
return function() {
|
|
285
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
286
|
-
var element = state.elements[name];
|
|
287
|
-
var attributes = state.attributes[name] || {};
|
|
288
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
289
|
-
var style = styleProperties.reduce(function(style2, property) {
|
|
290
|
-
style2[property] = "";
|
|
291
|
-
return style2;
|
|
292
|
-
}, {});
|
|
293
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
Object.assign(element.style, style);
|
|
297
|
-
Object.keys(attributes).forEach(function(attribute) {
|
|
298
|
-
element.removeAttribute(attribute);
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
__name(effect, "effect");
|
|
304
|
-
var applyStyles_default = {
|
|
305
|
-
name: "applyStyles",
|
|
306
|
-
enabled: true,
|
|
307
|
-
phase: "write",
|
|
308
|
-
fn: applyStyles,
|
|
309
|
-
effect,
|
|
310
|
-
requires: ["computeStyles"]
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
// ../node_modules/@popperjs/core/lib/utils/getBasePlacement.js
|
|
314
|
-
function getBasePlacement(placement) {
|
|
315
|
-
return placement.split("-")[0];
|
|
316
|
-
}
|
|
317
|
-
__name(getBasePlacement, "getBasePlacement");
|
|
318
|
-
|
|
319
|
-
// ../node_modules/@popperjs/core/lib/utils/math.js
|
|
320
|
-
var max = Math.max;
|
|
321
|
-
var min = Math.min;
|
|
322
|
-
var round = Math.round;
|
|
323
|
-
|
|
324
|
-
// ../node_modules/@popperjs/core/lib/utils/userAgent.js
|
|
325
|
-
function getUAString() {
|
|
326
|
-
var uaData = navigator.userAgentData;
|
|
327
|
-
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
328
|
-
return uaData.brands.map(function(item) {
|
|
329
|
-
return item.brand + "/" + item.version;
|
|
330
|
-
}).join(" ");
|
|
331
|
-
}
|
|
332
|
-
return navigator.userAgent;
|
|
333
|
-
}
|
|
334
|
-
__name(getUAString, "getUAString");
|
|
335
|
-
|
|
336
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
|
|
337
|
-
function isLayoutViewport() {
|
|
338
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
339
|
-
}
|
|
340
|
-
__name(isLayoutViewport, "isLayoutViewport");
|
|
341
|
-
|
|
342
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
|
|
343
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
344
|
-
if (includeScale === void 0) {
|
|
345
|
-
includeScale = false;
|
|
346
|
-
}
|
|
347
|
-
if (isFixedStrategy === void 0) {
|
|
348
|
-
isFixedStrategy = false;
|
|
349
|
-
}
|
|
350
|
-
var clientRect = element.getBoundingClientRect();
|
|
351
|
-
var scaleX = 1;
|
|
352
|
-
var scaleY = 1;
|
|
353
|
-
if (includeScale && isHTMLElement(element)) {
|
|
354
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
355
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
356
|
-
}
|
|
357
|
-
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
358
|
-
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
359
|
-
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
360
|
-
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
361
|
-
var width = clientRect.width / scaleX;
|
|
362
|
-
var height = clientRect.height / scaleY;
|
|
363
|
-
return {
|
|
364
|
-
width,
|
|
365
|
-
height,
|
|
366
|
-
top: y,
|
|
367
|
-
right: x + width,
|
|
368
|
-
bottom: y + height,
|
|
369
|
-
left: x,
|
|
370
|
-
x,
|
|
371
|
-
y
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
__name(getBoundingClientRect, "getBoundingClientRect");
|
|
375
|
-
|
|
376
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
|
|
377
|
-
function getLayoutRect(element) {
|
|
378
|
-
var clientRect = getBoundingClientRect(element);
|
|
379
|
-
var width = element.offsetWidth;
|
|
380
|
-
var height = element.offsetHeight;
|
|
381
|
-
if (Math.abs(clientRect.width - width) <= 1) {
|
|
382
|
-
width = clientRect.width;
|
|
383
|
-
}
|
|
384
|
-
if (Math.abs(clientRect.height - height) <= 1) {
|
|
385
|
-
height = clientRect.height;
|
|
386
|
-
}
|
|
387
|
-
return {
|
|
388
|
-
x: element.offsetLeft,
|
|
389
|
-
y: element.offsetTop,
|
|
390
|
-
width,
|
|
391
|
-
height
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
__name(getLayoutRect, "getLayoutRect");
|
|
395
|
-
|
|
396
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/contains.js
|
|
397
|
-
function contains(parent, child) {
|
|
398
|
-
var rootNode = child.getRootNode && child.getRootNode();
|
|
399
|
-
if (parent.contains(child)) {
|
|
400
|
-
return true;
|
|
401
|
-
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
402
|
-
var next = child;
|
|
403
|
-
do {
|
|
404
|
-
if (next && parent.isSameNode(next)) {
|
|
405
|
-
return true;
|
|
406
|
-
}
|
|
407
|
-
next = next.parentNode || next.host;
|
|
408
|
-
} while (next);
|
|
409
|
-
}
|
|
410
|
-
return false;
|
|
411
|
-
}
|
|
412
|
-
__name(contains, "contains");
|
|
413
|
-
|
|
414
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
|
|
415
|
-
function getComputedStyle(element) {
|
|
416
|
-
return getWindow(element).getComputedStyle(element);
|
|
417
|
-
}
|
|
418
|
-
__name(getComputedStyle, "getComputedStyle");
|
|
419
|
-
|
|
420
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
|
|
421
|
-
function isTableElement(element) {
|
|
422
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
423
|
-
}
|
|
424
|
-
__name(isTableElement, "isTableElement");
|
|
425
|
-
|
|
426
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
|
|
427
|
-
function getDocumentElement(element) {
|
|
428
|
-
return ((isElement(element) ? element.ownerDocument : (
|
|
429
|
-
// $FlowFixMe[prop-missing]
|
|
430
|
-
element.document
|
|
431
|
-
)) || window.document).documentElement;
|
|
432
|
-
}
|
|
433
|
-
__name(getDocumentElement, "getDocumentElement");
|
|
434
|
-
|
|
435
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
|
|
436
|
-
function getParentNode(element) {
|
|
437
|
-
if (getNodeName(element) === "html") {
|
|
438
|
-
return element;
|
|
439
|
-
}
|
|
440
|
-
return (
|
|
441
|
-
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
442
|
-
// $FlowFixMe[incompatible-return]
|
|
443
|
-
// $FlowFixMe[prop-missing]
|
|
444
|
-
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
445
|
-
element.parentNode || // DOM Element detected
|
|
446
|
-
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
447
|
-
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
448
|
-
getDocumentElement(element)
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
__name(getParentNode, "getParentNode");
|
|
452
|
-
|
|
453
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
|
|
454
|
-
function getTrueOffsetParent(element) {
|
|
455
|
-
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
456
|
-
getComputedStyle(element).position === "fixed") {
|
|
457
|
-
return null;
|
|
458
|
-
}
|
|
459
|
-
return element.offsetParent;
|
|
460
|
-
}
|
|
461
|
-
__name(getTrueOffsetParent, "getTrueOffsetParent");
|
|
462
|
-
function getContainingBlock(element) {
|
|
463
|
-
var isFirefox = /firefox/i.test(getUAString());
|
|
464
|
-
var isIE = /Trident/i.test(getUAString());
|
|
465
|
-
if (isIE && isHTMLElement(element)) {
|
|
466
|
-
var elementCss = getComputedStyle(element);
|
|
467
|
-
if (elementCss.position === "fixed") {
|
|
468
|
-
return null;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
var currentNode = getParentNode(element);
|
|
472
|
-
if (isShadowRoot(currentNode)) {
|
|
473
|
-
currentNode = currentNode.host;
|
|
474
|
-
}
|
|
475
|
-
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
476
|
-
var css = getComputedStyle(currentNode);
|
|
477
|
-
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
|
478
|
-
return currentNode;
|
|
479
|
-
} else {
|
|
480
|
-
currentNode = currentNode.parentNode;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
return null;
|
|
484
|
-
}
|
|
485
|
-
__name(getContainingBlock, "getContainingBlock");
|
|
486
|
-
function getOffsetParent(element) {
|
|
487
|
-
var window2 = getWindow(element);
|
|
488
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
489
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
490
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
491
|
-
}
|
|
492
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
|
493
|
-
return window2;
|
|
494
|
-
}
|
|
495
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
496
|
-
}
|
|
497
|
-
__name(getOffsetParent, "getOffsetParent");
|
|
498
|
-
|
|
499
|
-
// ../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
|
|
500
|
-
function getMainAxisFromPlacement(placement) {
|
|
501
|
-
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
502
|
-
}
|
|
503
|
-
__name(getMainAxisFromPlacement, "getMainAxisFromPlacement");
|
|
504
|
-
|
|
505
|
-
// ../node_modules/@popperjs/core/lib/utils/within.js
|
|
506
|
-
function within(min2, value, max2) {
|
|
507
|
-
return max(min2, min(value, max2));
|
|
508
|
-
}
|
|
509
|
-
__name(within, "within");
|
|
510
|
-
function withinMaxClamp(min2, value, max2) {
|
|
511
|
-
var v = within(min2, value, max2);
|
|
512
|
-
return v > max2 ? max2 : v;
|
|
513
|
-
}
|
|
514
|
-
__name(withinMaxClamp, "withinMaxClamp");
|
|
515
|
-
|
|
516
|
-
// ../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
|
|
517
|
-
function getFreshSideObject() {
|
|
518
|
-
return {
|
|
519
|
-
top: 0,
|
|
520
|
-
right: 0,
|
|
521
|
-
bottom: 0,
|
|
522
|
-
left: 0
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
__name(getFreshSideObject, "getFreshSideObject");
|
|
526
|
-
|
|
527
|
-
// ../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
|
|
528
|
-
function mergePaddingObject(paddingObject) {
|
|
529
|
-
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
530
|
-
}
|
|
531
|
-
__name(mergePaddingObject, "mergePaddingObject");
|
|
532
|
-
|
|
533
|
-
// ../node_modules/@popperjs/core/lib/utils/expandToHashMap.js
|
|
534
|
-
function expandToHashMap(value, keys) {
|
|
535
|
-
return keys.reduce(function(hashMap, key) {
|
|
536
|
-
hashMap[key] = value;
|
|
537
|
-
return hashMap;
|
|
538
|
-
}, {});
|
|
539
|
-
}
|
|
540
|
-
__name(expandToHashMap, "expandToHashMap");
|
|
541
|
-
|
|
542
|
-
// ../node_modules/@popperjs/core/lib/modifiers/arrow.js
|
|
543
|
-
var toPaddingObject = /* @__PURE__ */ __name(function toPaddingObject2(padding, state) {
|
|
544
|
-
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
|
|
545
|
-
placement: state.placement
|
|
546
|
-
})) : padding;
|
|
547
|
-
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
548
|
-
}, "toPaddingObject");
|
|
549
|
-
function arrow(_ref) {
|
|
550
|
-
var _state$modifiersData$;
|
|
551
|
-
var state = _ref.state, name = _ref.name, options = _ref.options;
|
|
552
|
-
var arrowElement = state.elements.arrow;
|
|
553
|
-
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
554
|
-
var basePlacement = getBasePlacement(state.placement);
|
|
555
|
-
var axis = getMainAxisFromPlacement(basePlacement);
|
|
556
|
-
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
557
|
-
var len = isVertical ? "height" : "width";
|
|
558
|
-
if (!arrowElement || !popperOffsets2) {
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
var paddingObject = toPaddingObject(options.padding, state);
|
|
562
|
-
var arrowRect = getLayoutRect(arrowElement);
|
|
563
|
-
var minProp = axis === "y" ? top : left;
|
|
564
|
-
var maxProp = axis === "y" ? bottom : right;
|
|
565
|
-
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
|
566
|
-
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
|
567
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
568
|
-
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
569
|
-
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
570
|
-
var min2 = paddingObject[minProp];
|
|
571
|
-
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
572
|
-
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
573
|
-
var offset2 = within(min2, center, max2);
|
|
574
|
-
var axisProp = axis;
|
|
575
|
-
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
|
576
|
-
}
|
|
577
|
-
__name(arrow, "arrow");
|
|
578
|
-
function effect2(_ref2) {
|
|
579
|
-
var state = _ref2.state, options = _ref2.options;
|
|
580
|
-
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
|
581
|
-
if (arrowElement == null) {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
if (typeof arrowElement === "string") {
|
|
585
|
-
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
586
|
-
if (!arrowElement) {
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
if (!contains(state.elements.popper, arrowElement)) {
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
state.elements.arrow = arrowElement;
|
|
594
|
-
}
|
|
595
|
-
__name(effect2, "effect");
|
|
596
|
-
var arrow_default = {
|
|
597
|
-
name: "arrow",
|
|
598
|
-
enabled: true,
|
|
599
|
-
phase: "main",
|
|
600
|
-
fn: arrow,
|
|
601
|
-
effect: effect2,
|
|
602
|
-
requires: ["popperOffsets"],
|
|
603
|
-
requiresIfExists: ["preventOverflow"]
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
// ../node_modules/@popperjs/core/lib/utils/getVariation.js
|
|
607
|
-
function getVariation(placement) {
|
|
608
|
-
return placement.split("-")[1];
|
|
609
|
-
}
|
|
610
|
-
__name(getVariation, "getVariation");
|
|
611
|
-
|
|
612
|
-
// ../node_modules/@popperjs/core/lib/modifiers/computeStyles.js
|
|
613
|
-
var unsetSides = {
|
|
614
|
-
top: "auto",
|
|
615
|
-
right: "auto",
|
|
616
|
-
bottom: "auto",
|
|
617
|
-
left: "auto"
|
|
618
|
-
};
|
|
619
|
-
function roundOffsetsByDPR(_ref, win) {
|
|
620
|
-
var x = _ref.x, y = _ref.y;
|
|
621
|
-
var dpr = win.devicePixelRatio || 1;
|
|
622
|
-
return {
|
|
623
|
-
x: round(x * dpr) / dpr || 0,
|
|
624
|
-
y: round(y * dpr) / dpr || 0
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
__name(roundOffsetsByDPR, "roundOffsetsByDPR");
|
|
628
|
-
function mapToStyles(_ref2) {
|
|
629
|
-
var _Object$assign2;
|
|
630
|
-
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
|
631
|
-
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
632
|
-
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
633
|
-
x,
|
|
634
|
-
y
|
|
635
|
-
}) : {
|
|
636
|
-
x,
|
|
637
|
-
y
|
|
638
|
-
};
|
|
639
|
-
x = _ref3.x;
|
|
640
|
-
y = _ref3.y;
|
|
641
|
-
var hasX = offsets.hasOwnProperty("x");
|
|
642
|
-
var hasY = offsets.hasOwnProperty("y");
|
|
643
|
-
var sideX = left;
|
|
644
|
-
var sideY = top;
|
|
645
|
-
var win = window;
|
|
646
|
-
if (adaptive) {
|
|
647
|
-
var offsetParent = getOffsetParent(popper2);
|
|
648
|
-
var heightProp = "clientHeight";
|
|
649
|
-
var widthProp = "clientWidth";
|
|
650
|
-
if (offsetParent === getWindow(popper2)) {
|
|
651
|
-
offsetParent = getDocumentElement(popper2);
|
|
652
|
-
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
|
653
|
-
heightProp = "scrollHeight";
|
|
654
|
-
widthProp = "scrollWidth";
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
offsetParent = offsetParent;
|
|
658
|
-
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
659
|
-
sideY = bottom;
|
|
660
|
-
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
|
|
661
|
-
// $FlowFixMe[prop-missing]
|
|
662
|
-
offsetParent[heightProp]
|
|
663
|
-
);
|
|
664
|
-
y -= offsetY - popperRect.height;
|
|
665
|
-
y *= gpuAcceleration ? 1 : -1;
|
|
666
|
-
}
|
|
667
|
-
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
668
|
-
sideX = right;
|
|
669
|
-
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
|
|
670
|
-
// $FlowFixMe[prop-missing]
|
|
671
|
-
offsetParent[widthProp]
|
|
672
|
-
);
|
|
673
|
-
x -= offsetX - popperRect.width;
|
|
674
|
-
x *= gpuAcceleration ? 1 : -1;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
var commonStyles = Object.assign({
|
|
678
|
-
position
|
|
679
|
-
}, adaptive && unsetSides);
|
|
680
|
-
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
681
|
-
x,
|
|
682
|
-
y
|
|
683
|
-
}, getWindow(popper2)) : {
|
|
684
|
-
x,
|
|
685
|
-
y
|
|
686
|
-
};
|
|
687
|
-
x = _ref4.x;
|
|
688
|
-
y = _ref4.y;
|
|
689
|
-
if (gpuAcceleration) {
|
|
690
|
-
var _Object$assign;
|
|
691
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
692
|
-
}
|
|
693
|
-
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
694
|
-
}
|
|
695
|
-
__name(mapToStyles, "mapToStyles");
|
|
696
|
-
function computeStyles(_ref5) {
|
|
697
|
-
var state = _ref5.state, options = _ref5.options;
|
|
698
|
-
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
699
|
-
var commonStyles = {
|
|
700
|
-
placement: getBasePlacement(state.placement),
|
|
701
|
-
variation: getVariation(state.placement),
|
|
702
|
-
popper: state.elements.popper,
|
|
703
|
-
popperRect: state.rects.popper,
|
|
704
|
-
gpuAcceleration,
|
|
705
|
-
isFixed: state.options.strategy === "fixed"
|
|
706
|
-
};
|
|
707
|
-
if (state.modifiersData.popperOffsets != null) {
|
|
708
|
-
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
709
|
-
offsets: state.modifiersData.popperOffsets,
|
|
710
|
-
position: state.options.strategy,
|
|
711
|
-
adaptive,
|
|
712
|
-
roundOffsets
|
|
713
|
-
})));
|
|
714
|
-
}
|
|
715
|
-
if (state.modifiersData.arrow != null) {
|
|
716
|
-
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
717
|
-
offsets: state.modifiersData.arrow,
|
|
718
|
-
position: "absolute",
|
|
719
|
-
adaptive: false,
|
|
720
|
-
roundOffsets
|
|
721
|
-
})));
|
|
722
|
-
}
|
|
723
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
724
|
-
"data-popper-placement": state.placement
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
__name(computeStyles, "computeStyles");
|
|
728
|
-
var computeStyles_default = {
|
|
729
|
-
name: "computeStyles",
|
|
730
|
-
enabled: true,
|
|
731
|
-
phase: "beforeWrite",
|
|
732
|
-
fn: computeStyles,
|
|
733
|
-
data: {}
|
|
734
|
-
};
|
|
735
|
-
|
|
736
|
-
// ../node_modules/@popperjs/core/lib/modifiers/eventListeners.js
|
|
737
|
-
var passive = {
|
|
738
|
-
passive: true
|
|
739
|
-
};
|
|
740
|
-
function effect3(_ref) {
|
|
741
|
-
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
742
|
-
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
743
|
-
var window2 = getWindow(state.elements.popper);
|
|
744
|
-
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
745
|
-
if (scroll) {
|
|
746
|
-
scrollParents.forEach(function(scrollParent) {
|
|
747
|
-
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
if (resize) {
|
|
751
|
-
window2.addEventListener("resize", instance.update, passive);
|
|
752
|
-
}
|
|
753
|
-
return function() {
|
|
754
|
-
if (scroll) {
|
|
755
|
-
scrollParents.forEach(function(scrollParent) {
|
|
756
|
-
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
if (resize) {
|
|
760
|
-
window2.removeEventListener("resize", instance.update, passive);
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
__name(effect3, "effect");
|
|
765
|
-
var eventListeners_default = {
|
|
766
|
-
name: "eventListeners",
|
|
767
|
-
enabled: true,
|
|
768
|
-
phase: "write",
|
|
769
|
-
fn: /* @__PURE__ */ __name(function fn() {
|
|
770
|
-
}, "fn"),
|
|
771
|
-
effect: effect3,
|
|
772
|
-
data: {}
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
// ../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
|
|
776
|
-
var hash = {
|
|
777
|
-
left: "right",
|
|
778
|
-
right: "left",
|
|
779
|
-
bottom: "top",
|
|
780
|
-
top: "bottom"
|
|
781
|
-
};
|
|
782
|
-
function getOppositePlacement(placement) {
|
|
783
|
-
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
784
|
-
return hash[matched];
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
__name(getOppositePlacement, "getOppositePlacement");
|
|
788
|
-
|
|
789
|
-
// ../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
|
|
790
|
-
var hash2 = {
|
|
791
|
-
start: "end",
|
|
792
|
-
end: "start"
|
|
793
|
-
};
|
|
794
|
-
function getOppositeVariationPlacement(placement) {
|
|
795
|
-
return placement.replace(/start|end/g, function(matched) {
|
|
796
|
-
return hash2[matched];
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
__name(getOppositeVariationPlacement, "getOppositeVariationPlacement");
|
|
800
|
-
|
|
801
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
|
|
802
|
-
function getWindowScroll(node) {
|
|
803
|
-
var win = getWindow(node);
|
|
804
|
-
var scrollLeft = win.pageXOffset;
|
|
805
|
-
var scrollTop = win.pageYOffset;
|
|
806
|
-
return {
|
|
807
|
-
scrollLeft,
|
|
808
|
-
scrollTop
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
__name(getWindowScroll, "getWindowScroll");
|
|
812
|
-
|
|
813
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
|
|
814
|
-
function getWindowScrollBarX(element) {
|
|
815
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
816
|
-
}
|
|
817
|
-
__name(getWindowScrollBarX, "getWindowScrollBarX");
|
|
818
|
-
|
|
819
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
|
|
820
|
-
function getViewportRect(element, strategy) {
|
|
821
|
-
var win = getWindow(element);
|
|
822
|
-
var html = getDocumentElement(element);
|
|
823
|
-
var visualViewport = win.visualViewport;
|
|
824
|
-
var width = html.clientWidth;
|
|
825
|
-
var height = html.clientHeight;
|
|
826
|
-
var x = 0;
|
|
827
|
-
var y = 0;
|
|
828
|
-
if (visualViewport) {
|
|
829
|
-
width = visualViewport.width;
|
|
830
|
-
height = visualViewport.height;
|
|
831
|
-
var layoutViewport = isLayoutViewport();
|
|
832
|
-
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
833
|
-
x = visualViewport.offsetLeft;
|
|
834
|
-
y = visualViewport.offsetTop;
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
return {
|
|
838
|
-
width,
|
|
839
|
-
height,
|
|
840
|
-
x: x + getWindowScrollBarX(element),
|
|
841
|
-
y
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
__name(getViewportRect, "getViewportRect");
|
|
845
|
-
|
|
846
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
|
|
847
|
-
function getDocumentRect(element) {
|
|
848
|
-
var _element$ownerDocumen;
|
|
849
|
-
var html = getDocumentElement(element);
|
|
850
|
-
var winScroll = getWindowScroll(element);
|
|
851
|
-
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
852
|
-
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
853
|
-
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
854
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
855
|
-
var y = -winScroll.scrollTop;
|
|
856
|
-
if (getComputedStyle(body || html).direction === "rtl") {
|
|
857
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
858
|
-
}
|
|
859
|
-
return {
|
|
860
|
-
width,
|
|
861
|
-
height,
|
|
862
|
-
x,
|
|
863
|
-
y
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
__name(getDocumentRect, "getDocumentRect");
|
|
867
|
-
|
|
868
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
|
|
869
|
-
function isScrollParent(element) {
|
|
870
|
-
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
871
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
872
|
-
}
|
|
873
|
-
__name(isScrollParent, "isScrollParent");
|
|
874
|
-
|
|
875
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
|
|
876
|
-
function getScrollParent(node) {
|
|
877
|
-
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
878
|
-
return node.ownerDocument.body;
|
|
879
|
-
}
|
|
880
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
881
|
-
return node;
|
|
882
|
-
}
|
|
883
|
-
return getScrollParent(getParentNode(node));
|
|
884
|
-
}
|
|
885
|
-
__name(getScrollParent, "getScrollParent");
|
|
886
|
-
|
|
887
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
|
|
888
|
-
function listScrollParents(element, list) {
|
|
889
|
-
var _element$ownerDocumen;
|
|
890
|
-
if (list === void 0) {
|
|
891
|
-
list = [];
|
|
892
|
-
}
|
|
893
|
-
var scrollParent = getScrollParent(element);
|
|
894
|
-
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
895
|
-
var win = getWindow(scrollParent);
|
|
896
|
-
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
897
|
-
var updatedList = list.concat(target);
|
|
898
|
-
return isBody ? updatedList : (
|
|
899
|
-
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
900
|
-
updatedList.concat(listScrollParents(getParentNode(target)))
|
|
901
|
-
);
|
|
902
|
-
}
|
|
903
|
-
__name(listScrollParents, "listScrollParents");
|
|
904
|
-
|
|
905
|
-
// ../node_modules/@popperjs/core/lib/utils/rectToClientRect.js
|
|
906
|
-
function rectToClientRect(rect) {
|
|
907
|
-
return Object.assign({}, rect, {
|
|
908
|
-
left: rect.x,
|
|
909
|
-
top: rect.y,
|
|
910
|
-
right: rect.x + rect.width,
|
|
911
|
-
bottom: rect.y + rect.height
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
__name(rectToClientRect, "rectToClientRect");
|
|
915
|
-
|
|
916
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
|
|
917
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
918
|
-
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
919
|
-
rect.top = rect.top + element.clientTop;
|
|
920
|
-
rect.left = rect.left + element.clientLeft;
|
|
921
|
-
rect.bottom = rect.top + element.clientHeight;
|
|
922
|
-
rect.right = rect.left + element.clientWidth;
|
|
923
|
-
rect.width = element.clientWidth;
|
|
924
|
-
rect.height = element.clientHeight;
|
|
925
|
-
rect.x = rect.left;
|
|
926
|
-
rect.y = rect.top;
|
|
927
|
-
return rect;
|
|
928
|
-
}
|
|
929
|
-
__name(getInnerBoundingClientRect, "getInnerBoundingClientRect");
|
|
930
|
-
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
931
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
932
|
-
}
|
|
933
|
-
__name(getClientRectFromMixedType, "getClientRectFromMixedType");
|
|
934
|
-
function getClippingParents(element) {
|
|
935
|
-
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
936
|
-
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
|
|
937
|
-
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
938
|
-
if (!isElement(clipperElement)) {
|
|
939
|
-
return [];
|
|
940
|
-
}
|
|
941
|
-
return clippingParents2.filter(function(clippingParent) {
|
|
942
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
__name(getClippingParents, "getClippingParents");
|
|
946
|
-
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
947
|
-
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
948
|
-
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
949
|
-
var firstClippingParent = clippingParents2[0];
|
|
950
|
-
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
951
|
-
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
952
|
-
accRect.top = max(rect.top, accRect.top);
|
|
953
|
-
accRect.right = min(rect.right, accRect.right);
|
|
954
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
955
|
-
accRect.left = max(rect.left, accRect.left);
|
|
956
|
-
return accRect;
|
|
957
|
-
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
958
|
-
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
959
|
-
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
960
|
-
clippingRect.x = clippingRect.left;
|
|
961
|
-
clippingRect.y = clippingRect.top;
|
|
962
|
-
return clippingRect;
|
|
963
|
-
}
|
|
964
|
-
__name(getClippingRect, "getClippingRect");
|
|
965
|
-
|
|
966
|
-
// ../node_modules/@popperjs/core/lib/utils/computeOffsets.js
|
|
967
|
-
function computeOffsets(_ref) {
|
|
968
|
-
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
969
|
-
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
970
|
-
var variation = placement ? getVariation(placement) : null;
|
|
971
|
-
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
|
972
|
-
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
|
973
|
-
var offsets;
|
|
974
|
-
switch (basePlacement) {
|
|
975
|
-
case top:
|
|
976
|
-
offsets = {
|
|
977
|
-
x: commonX,
|
|
978
|
-
y: reference2.y - element.height
|
|
979
|
-
};
|
|
980
|
-
break;
|
|
981
|
-
case bottom:
|
|
982
|
-
offsets = {
|
|
983
|
-
x: commonX,
|
|
984
|
-
y: reference2.y + reference2.height
|
|
985
|
-
};
|
|
986
|
-
break;
|
|
987
|
-
case right:
|
|
988
|
-
offsets = {
|
|
989
|
-
x: reference2.x + reference2.width,
|
|
990
|
-
y: commonY
|
|
991
|
-
};
|
|
992
|
-
break;
|
|
993
|
-
case left:
|
|
994
|
-
offsets = {
|
|
995
|
-
x: reference2.x - element.width,
|
|
996
|
-
y: commonY
|
|
997
|
-
};
|
|
998
|
-
break;
|
|
999
|
-
default:
|
|
1000
|
-
offsets = {
|
|
1001
|
-
x: reference2.x,
|
|
1002
|
-
y: reference2.y
|
|
1003
|
-
};
|
|
1004
|
-
}
|
|
1005
|
-
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
1006
|
-
if (mainAxis != null) {
|
|
1007
|
-
var len = mainAxis === "y" ? "height" : "width";
|
|
1008
|
-
switch (variation) {
|
|
1009
|
-
case start:
|
|
1010
|
-
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
|
1011
|
-
break;
|
|
1012
|
-
case end:
|
|
1013
|
-
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
|
1014
|
-
break;
|
|
1015
|
-
default:
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
return offsets;
|
|
1019
|
-
}
|
|
1020
|
-
__name(computeOffsets, "computeOffsets");
|
|
1021
|
-
|
|
1022
|
-
// ../node_modules/@popperjs/core/lib/utils/detectOverflow.js
|
|
1023
|
-
function detectOverflow(state, options) {
|
|
1024
|
-
if (options === void 0) {
|
|
1025
|
-
options = {};
|
|
1026
|
-
}
|
|
1027
|
-
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
1028
|
-
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
1029
|
-
var altContext = elementContext === popper ? reference : popper;
|
|
1030
|
-
var popperRect = state.rects.popper;
|
|
1031
|
-
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
1032
|
-
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
1033
|
-
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
1034
|
-
var popperOffsets2 = computeOffsets({
|
|
1035
|
-
reference: referenceClientRect,
|
|
1036
|
-
element: popperRect,
|
|
1037
|
-
strategy: "absolute",
|
|
1038
|
-
placement
|
|
1039
|
-
});
|
|
1040
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
1041
|
-
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
1042
|
-
var overflowOffsets = {
|
|
1043
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
1044
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
1045
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
1046
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
1047
|
-
};
|
|
1048
|
-
var offsetData = state.modifiersData.offset;
|
|
1049
|
-
if (elementContext === popper && offsetData) {
|
|
1050
|
-
var offset2 = offsetData[placement];
|
|
1051
|
-
Object.keys(overflowOffsets).forEach(function(key) {
|
|
1052
|
-
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
1053
|
-
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
|
|
1054
|
-
overflowOffsets[key] += offset2[axis] * multiply;
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
return overflowOffsets;
|
|
1058
|
-
}
|
|
1059
|
-
__name(detectOverflow, "detectOverflow");
|
|
1060
|
-
|
|
1061
|
-
// ../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
|
|
1062
|
-
function computeAutoPlacement(state, options) {
|
|
1063
|
-
if (options === void 0) {
|
|
1064
|
-
options = {};
|
|
1065
|
-
}
|
|
1066
|
-
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
1067
|
-
var variation = getVariation(placement);
|
|
1068
|
-
var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
1069
|
-
return getVariation(placement2) === variation;
|
|
1070
|
-
}) : basePlacements;
|
|
1071
|
-
var allowedPlacements = placements2.filter(function(placement2) {
|
|
1072
|
-
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
1073
|
-
});
|
|
1074
|
-
if (allowedPlacements.length === 0) {
|
|
1075
|
-
allowedPlacements = placements2;
|
|
1076
|
-
}
|
|
1077
|
-
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
1078
|
-
acc[placement2] = detectOverflow(state, {
|
|
1079
|
-
placement: placement2,
|
|
1080
|
-
boundary,
|
|
1081
|
-
rootBoundary,
|
|
1082
|
-
padding
|
|
1083
|
-
})[getBasePlacement(placement2)];
|
|
1084
|
-
return acc;
|
|
1085
|
-
}, {});
|
|
1086
|
-
return Object.keys(overflows).sort(function(a, b) {
|
|
1087
|
-
return overflows[a] - overflows[b];
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
__name(computeAutoPlacement, "computeAutoPlacement");
|
|
1091
|
-
|
|
1092
|
-
// ../node_modules/@popperjs/core/lib/modifiers/flip.js
|
|
1093
|
-
function getExpandedFallbackPlacements(placement) {
|
|
1094
|
-
if (getBasePlacement(placement) === auto) {
|
|
1095
|
-
return [];
|
|
1096
|
-
}
|
|
1097
|
-
var oppositePlacement = getOppositePlacement(placement);
|
|
1098
|
-
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
1099
|
-
}
|
|
1100
|
-
__name(getExpandedFallbackPlacements, "getExpandedFallbackPlacements");
|
|
1101
|
-
function flip(_ref) {
|
|
1102
|
-
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
1103
|
-
if (state.modifiersData[name]._skip) {
|
|
1104
|
-
return;
|
|
1105
|
-
}
|
|
1106
|
-
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
|
1107
|
-
var preferredPlacement = state.options.placement;
|
|
1108
|
-
var basePlacement = getBasePlacement(preferredPlacement);
|
|
1109
|
-
var isBasePlacement = basePlacement === preferredPlacement;
|
|
1110
|
-
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
1111
|
-
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
|
1112
|
-
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
|
1113
|
-
placement: placement2,
|
|
1114
|
-
boundary,
|
|
1115
|
-
rootBoundary,
|
|
1116
|
-
padding,
|
|
1117
|
-
flipVariations,
|
|
1118
|
-
allowedAutoPlacements
|
|
1119
|
-
}) : placement2);
|
|
1120
|
-
}, []);
|
|
1121
|
-
var referenceRect = state.rects.reference;
|
|
1122
|
-
var popperRect = state.rects.popper;
|
|
1123
|
-
var checksMap = /* @__PURE__ */ new Map();
|
|
1124
|
-
var makeFallbackChecks = true;
|
|
1125
|
-
var firstFittingPlacement = placements2[0];
|
|
1126
|
-
for (var i = 0; i < placements2.length; i++) {
|
|
1127
|
-
var placement = placements2[i];
|
|
1128
|
-
var _basePlacement = getBasePlacement(placement);
|
|
1129
|
-
var isStartVariation = getVariation(placement) === start;
|
|
1130
|
-
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
1131
|
-
var len = isVertical ? "width" : "height";
|
|
1132
|
-
var overflow = detectOverflow(state, {
|
|
1133
|
-
placement,
|
|
1134
|
-
boundary,
|
|
1135
|
-
rootBoundary,
|
|
1136
|
-
altBoundary,
|
|
1137
|
-
padding
|
|
1138
|
-
});
|
|
1139
|
-
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
1140
|
-
if (referenceRect[len] > popperRect[len]) {
|
|
1141
|
-
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
1142
|
-
}
|
|
1143
|
-
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
1144
|
-
var checks = [];
|
|
1145
|
-
if (checkMainAxis) {
|
|
1146
|
-
checks.push(overflow[_basePlacement] <= 0);
|
|
1147
|
-
}
|
|
1148
|
-
if (checkAltAxis) {
|
|
1149
|
-
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
1150
|
-
}
|
|
1151
|
-
if (checks.every(function(check) {
|
|
1152
|
-
return check;
|
|
1153
|
-
})) {
|
|
1154
|
-
firstFittingPlacement = placement;
|
|
1155
|
-
makeFallbackChecks = false;
|
|
1156
|
-
break;
|
|
1157
|
-
}
|
|
1158
|
-
checksMap.set(placement, checks);
|
|
1159
|
-
}
|
|
1160
|
-
if (makeFallbackChecks) {
|
|
1161
|
-
var numberOfChecks = flipVariations ? 3 : 1;
|
|
1162
|
-
var _loop = /* @__PURE__ */ __name(function _loop2(_i2) {
|
|
1163
|
-
var fittingPlacement = placements2.find(function(placement2) {
|
|
1164
|
-
var checks2 = checksMap.get(placement2);
|
|
1165
|
-
if (checks2) {
|
|
1166
|
-
return checks2.slice(0, _i2).every(function(check) {
|
|
1167
|
-
return check;
|
|
1168
|
-
});
|
|
1169
|
-
}
|
|
1170
|
-
});
|
|
1171
|
-
if (fittingPlacement) {
|
|
1172
|
-
firstFittingPlacement = fittingPlacement;
|
|
1173
|
-
return "break";
|
|
1174
|
-
}
|
|
1175
|
-
}, "_loop");
|
|
1176
|
-
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
1177
|
-
var _ret = _loop(_i);
|
|
1178
|
-
if (_ret === "break") break;
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
if (state.placement !== firstFittingPlacement) {
|
|
1182
|
-
state.modifiersData[name]._skip = true;
|
|
1183
|
-
state.placement = firstFittingPlacement;
|
|
1184
|
-
state.reset = true;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
__name(flip, "flip");
|
|
1188
|
-
var flip_default = {
|
|
1189
|
-
name: "flip",
|
|
1190
|
-
enabled: true,
|
|
1191
|
-
phase: "main",
|
|
1192
|
-
fn: flip,
|
|
1193
|
-
requiresIfExists: ["offset"],
|
|
1194
|
-
data: {
|
|
1195
|
-
_skip: false
|
|
1196
|
-
}
|
|
1197
|
-
};
|
|
1198
|
-
|
|
1199
|
-
// ../node_modules/@popperjs/core/lib/modifiers/hide.js
|
|
1200
|
-
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
1201
|
-
if (preventedOffsets === void 0) {
|
|
1202
|
-
preventedOffsets = {
|
|
1203
|
-
x: 0,
|
|
1204
|
-
y: 0
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
return {
|
|
1208
|
-
top: overflow.top - rect.height - preventedOffsets.y,
|
|
1209
|
-
right: overflow.right - rect.width + preventedOffsets.x,
|
|
1210
|
-
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
1211
|
-
left: overflow.left - rect.width - preventedOffsets.x
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
__name(getSideOffsets, "getSideOffsets");
|
|
1215
|
-
function isAnySideFullyClipped(overflow) {
|
|
1216
|
-
return [top, right, bottom, left].some(function(side) {
|
|
1217
|
-
return overflow[side] >= 0;
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
__name(isAnySideFullyClipped, "isAnySideFullyClipped");
|
|
1221
|
-
function hide(_ref) {
|
|
1222
|
-
var state = _ref.state, name = _ref.name;
|
|
1223
|
-
var referenceRect = state.rects.reference;
|
|
1224
|
-
var popperRect = state.rects.popper;
|
|
1225
|
-
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
1226
|
-
var referenceOverflow = detectOverflow(state, {
|
|
1227
|
-
elementContext: "reference"
|
|
1228
|
-
});
|
|
1229
|
-
var popperAltOverflow = detectOverflow(state, {
|
|
1230
|
-
altBoundary: true
|
|
1231
|
-
});
|
|
1232
|
-
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
1233
|
-
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
1234
|
-
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
1235
|
-
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
1236
|
-
state.modifiersData[name] = {
|
|
1237
|
-
referenceClippingOffsets,
|
|
1238
|
-
popperEscapeOffsets,
|
|
1239
|
-
isReferenceHidden,
|
|
1240
|
-
hasPopperEscaped
|
|
1241
|
-
};
|
|
1242
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
1243
|
-
"data-popper-reference-hidden": isReferenceHidden,
|
|
1244
|
-
"data-popper-escaped": hasPopperEscaped
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
__name(hide, "hide");
|
|
1248
|
-
var hide_default = {
|
|
1249
|
-
name: "hide",
|
|
1250
|
-
enabled: true,
|
|
1251
|
-
phase: "main",
|
|
1252
|
-
requiresIfExists: ["preventOverflow"],
|
|
1253
|
-
fn: hide
|
|
1254
|
-
};
|
|
1255
|
-
|
|
1256
|
-
// ../node_modules/@popperjs/core/lib/modifiers/offset.js
|
|
1257
|
-
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
1258
|
-
var basePlacement = getBasePlacement(placement);
|
|
1259
|
-
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
1260
|
-
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
|
1261
|
-
placement
|
|
1262
|
-
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
|
1263
|
-
skidding = skidding || 0;
|
|
1264
|
-
distance = (distance || 0) * invertDistance;
|
|
1265
|
-
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
1266
|
-
x: distance,
|
|
1267
|
-
y: skidding
|
|
1268
|
-
} : {
|
|
1269
|
-
x: skidding,
|
|
1270
|
-
y: distance
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
|
-
__name(distanceAndSkiddingToXY, "distanceAndSkiddingToXY");
|
|
1274
|
-
function offset(_ref2) {
|
|
1275
|
-
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
1276
|
-
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
1277
|
-
var data = placements.reduce(function(acc, placement) {
|
|
1278
|
-
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
|
1279
|
-
return acc;
|
|
1280
|
-
}, {});
|
|
1281
|
-
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
|
1282
|
-
if (state.modifiersData.popperOffsets != null) {
|
|
1283
|
-
state.modifiersData.popperOffsets.x += x;
|
|
1284
|
-
state.modifiersData.popperOffsets.y += y;
|
|
1285
|
-
}
|
|
1286
|
-
state.modifiersData[name] = data;
|
|
1287
|
-
}
|
|
1288
|
-
__name(offset, "offset");
|
|
1289
|
-
var offset_default = {
|
|
1290
|
-
name: "offset",
|
|
1291
|
-
enabled: true,
|
|
1292
|
-
phase: "main",
|
|
1293
|
-
requires: ["popperOffsets"],
|
|
1294
|
-
fn: offset
|
|
1295
|
-
};
|
|
1296
|
-
|
|
1297
|
-
// ../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
|
|
1298
|
-
function popperOffsets(_ref) {
|
|
1299
|
-
var state = _ref.state, name = _ref.name;
|
|
1300
|
-
state.modifiersData[name] = computeOffsets({
|
|
1301
|
-
reference: state.rects.reference,
|
|
1302
|
-
element: state.rects.popper,
|
|
1303
|
-
strategy: "absolute",
|
|
1304
|
-
placement: state.placement
|
|
1305
|
-
});
|
|
1306
|
-
}
|
|
1307
|
-
__name(popperOffsets, "popperOffsets");
|
|
1308
|
-
var popperOffsets_default = {
|
|
1309
|
-
name: "popperOffsets",
|
|
1310
|
-
enabled: true,
|
|
1311
|
-
phase: "read",
|
|
1312
|
-
fn: popperOffsets,
|
|
1313
|
-
data: {}
|
|
1314
|
-
};
|
|
1315
|
-
|
|
1316
|
-
// ../node_modules/@popperjs/core/lib/utils/getAltAxis.js
|
|
1317
|
-
function getAltAxis(axis) {
|
|
1318
|
-
return axis === "x" ? "y" : "x";
|
|
1319
|
-
}
|
|
1320
|
-
__name(getAltAxis, "getAltAxis");
|
|
1321
|
-
|
|
1322
|
-
// ../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
|
|
1323
|
-
function preventOverflow(_ref) {
|
|
1324
|
-
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
1325
|
-
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
1326
|
-
var overflow = detectOverflow(state, {
|
|
1327
|
-
boundary,
|
|
1328
|
-
rootBoundary,
|
|
1329
|
-
padding,
|
|
1330
|
-
altBoundary
|
|
1331
|
-
});
|
|
1332
|
-
var basePlacement = getBasePlacement(state.placement);
|
|
1333
|
-
var variation = getVariation(state.placement);
|
|
1334
|
-
var isBasePlacement = !variation;
|
|
1335
|
-
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
1336
|
-
var altAxis = getAltAxis(mainAxis);
|
|
1337
|
-
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
1338
|
-
var referenceRect = state.rects.reference;
|
|
1339
|
-
var popperRect = state.rects.popper;
|
|
1340
|
-
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
|
1341
|
-
placement: state.placement
|
|
1342
|
-
})) : tetherOffset;
|
|
1343
|
-
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
|
1344
|
-
mainAxis: tetherOffsetValue,
|
|
1345
|
-
altAxis: tetherOffsetValue
|
|
1346
|
-
} : Object.assign({
|
|
1347
|
-
mainAxis: 0,
|
|
1348
|
-
altAxis: 0
|
|
1349
|
-
}, tetherOffsetValue);
|
|
1350
|
-
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
1351
|
-
var data = {
|
|
1352
|
-
x: 0,
|
|
1353
|
-
y: 0
|
|
1354
|
-
};
|
|
1355
|
-
if (!popperOffsets2) {
|
|
1356
|
-
return;
|
|
1357
|
-
}
|
|
1358
|
-
if (checkMainAxis) {
|
|
1359
|
-
var _offsetModifierState$;
|
|
1360
|
-
var mainSide = mainAxis === "y" ? top : left;
|
|
1361
|
-
var altSide = mainAxis === "y" ? bottom : right;
|
|
1362
|
-
var len = mainAxis === "y" ? "height" : "width";
|
|
1363
|
-
var offset2 = popperOffsets2[mainAxis];
|
|
1364
|
-
var min2 = offset2 + overflow[mainSide];
|
|
1365
|
-
var max2 = offset2 - overflow[altSide];
|
|
1366
|
-
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1367
|
-
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
1368
|
-
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
1369
|
-
var arrowElement = state.elements.arrow;
|
|
1370
|
-
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
1371
|
-
width: 0,
|
|
1372
|
-
height: 0
|
|
1373
|
-
};
|
|
1374
|
-
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
|
1375
|
-
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
1376
|
-
var arrowPaddingMax = arrowPaddingObject[altSide];
|
|
1377
|
-
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
1378
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
1379
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
1380
|
-
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
1381
|
-
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
1382
|
-
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
1383
|
-
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
1384
|
-
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
1385
|
-
var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2);
|
|
1386
|
-
popperOffsets2[mainAxis] = preventedOffset;
|
|
1387
|
-
data[mainAxis] = preventedOffset - offset2;
|
|
1388
|
-
}
|
|
1389
|
-
if (checkAltAxis) {
|
|
1390
|
-
var _offsetModifierState$2;
|
|
1391
|
-
var _mainSide = mainAxis === "x" ? top : left;
|
|
1392
|
-
var _altSide = mainAxis === "x" ? bottom : right;
|
|
1393
|
-
var _offset = popperOffsets2[altAxis];
|
|
1394
|
-
var _len = altAxis === "y" ? "height" : "width";
|
|
1395
|
-
var _min = _offset + overflow[_mainSide];
|
|
1396
|
-
var _max = _offset - overflow[_altSide];
|
|
1397
|
-
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
1398
|
-
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
1399
|
-
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
1400
|
-
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
1401
|
-
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
1402
|
-
popperOffsets2[altAxis] = _preventedOffset;
|
|
1403
|
-
data[altAxis] = _preventedOffset - _offset;
|
|
1404
|
-
}
|
|
1405
|
-
state.modifiersData[name] = data;
|
|
1406
|
-
}
|
|
1407
|
-
__name(preventOverflow, "preventOverflow");
|
|
1408
|
-
var preventOverflow_default = {
|
|
1409
|
-
name: "preventOverflow",
|
|
1410
|
-
enabled: true,
|
|
1411
|
-
phase: "main",
|
|
1412
|
-
fn: preventOverflow,
|
|
1413
|
-
requiresIfExists: ["offset"]
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
|
|
1417
|
-
function getHTMLElementScroll(element) {
|
|
1418
|
-
return {
|
|
1419
|
-
scrollLeft: element.scrollLeft,
|
|
1420
|
-
scrollTop: element.scrollTop
|
|
1421
|
-
};
|
|
1422
|
-
}
|
|
1423
|
-
__name(getHTMLElementScroll, "getHTMLElementScroll");
|
|
1424
|
-
|
|
1425
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
|
|
1426
|
-
function getNodeScroll(node) {
|
|
1427
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
1428
|
-
return getWindowScroll(node);
|
|
1429
|
-
} else {
|
|
1430
|
-
return getHTMLElementScroll(node);
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
__name(getNodeScroll, "getNodeScroll");
|
|
1434
|
-
|
|
1435
|
-
// ../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
|
|
1436
|
-
function isElementScaled(element) {
|
|
1437
|
-
var rect = element.getBoundingClientRect();
|
|
1438
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
1439
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
1440
|
-
return scaleX !== 1 || scaleY !== 1;
|
|
1441
|
-
}
|
|
1442
|
-
__name(isElementScaled, "isElementScaled");
|
|
1443
|
-
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
1444
|
-
if (isFixed === void 0) {
|
|
1445
|
-
isFixed = false;
|
|
1446
|
-
}
|
|
1447
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1448
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
1449
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
1450
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
1451
|
-
var scroll = {
|
|
1452
|
-
scrollLeft: 0,
|
|
1453
|
-
scrollTop: 0
|
|
1454
|
-
};
|
|
1455
|
-
var offsets = {
|
|
1456
|
-
x: 0,
|
|
1457
|
-
y: 0
|
|
1458
|
-
};
|
|
1459
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1460
|
-
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
1461
|
-
isScrollParent(documentElement)) {
|
|
1462
|
-
scroll = getNodeScroll(offsetParent);
|
|
1463
|
-
}
|
|
1464
|
-
if (isHTMLElement(offsetParent)) {
|
|
1465
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
1466
|
-
offsets.x += offsetParent.clientLeft;
|
|
1467
|
-
offsets.y += offsetParent.clientTop;
|
|
1468
|
-
} else if (documentElement) {
|
|
1469
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
return {
|
|
1473
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1474
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1475
|
-
width: rect.width,
|
|
1476
|
-
height: rect.height
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
__name(getCompositeRect, "getCompositeRect");
|
|
1480
|
-
|
|
1481
|
-
// ../node_modules/@popperjs/core/lib/utils/orderModifiers.js
|
|
1482
|
-
function order(modifiers) {
|
|
1483
|
-
var map = /* @__PURE__ */ new Map();
|
|
1484
|
-
var visited = /* @__PURE__ */ new Set();
|
|
1485
|
-
var result = [];
|
|
1486
|
-
modifiers.forEach(function(modifier) {
|
|
1487
|
-
map.set(modifier.name, modifier);
|
|
1488
|
-
});
|
|
1489
|
-
function sort(modifier) {
|
|
1490
|
-
visited.add(modifier.name);
|
|
1491
|
-
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
1492
|
-
requires.forEach(function(dep) {
|
|
1493
|
-
if (!visited.has(dep)) {
|
|
1494
|
-
var depModifier = map.get(dep);
|
|
1495
|
-
if (depModifier) {
|
|
1496
|
-
sort(depModifier);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
});
|
|
1500
|
-
result.push(modifier);
|
|
1501
|
-
}
|
|
1502
|
-
__name(sort, "sort");
|
|
1503
|
-
modifiers.forEach(function(modifier) {
|
|
1504
|
-
if (!visited.has(modifier.name)) {
|
|
1505
|
-
sort(modifier);
|
|
1506
|
-
}
|
|
1507
|
-
});
|
|
1508
|
-
return result;
|
|
1509
|
-
}
|
|
1510
|
-
__name(order, "order");
|
|
1511
|
-
function orderModifiers(modifiers) {
|
|
1512
|
-
var orderedModifiers = order(modifiers);
|
|
1513
|
-
return modifierPhases.reduce(function(acc, phase) {
|
|
1514
|
-
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
1515
|
-
return modifier.phase === phase;
|
|
1516
|
-
}));
|
|
1517
|
-
}, []);
|
|
1518
|
-
}
|
|
1519
|
-
__name(orderModifiers, "orderModifiers");
|
|
1520
|
-
|
|
1521
|
-
// ../node_modules/@popperjs/core/lib/utils/debounce.js
|
|
1522
|
-
function debounce(fn2) {
|
|
1523
|
-
var pending;
|
|
1524
|
-
return function() {
|
|
1525
|
-
if (!pending) {
|
|
1526
|
-
pending = new Promise(function(resolve) {
|
|
1527
|
-
Promise.resolve().then(function() {
|
|
1528
|
-
pending = void 0;
|
|
1529
|
-
resolve(fn2());
|
|
1530
|
-
});
|
|
1531
|
-
});
|
|
1532
|
-
}
|
|
1533
|
-
return pending;
|
|
1534
|
-
};
|
|
1535
|
-
}
|
|
1536
|
-
__name(debounce, "debounce");
|
|
1537
|
-
|
|
1538
|
-
// ../node_modules/@popperjs/core/lib/utils/mergeByName.js
|
|
1539
|
-
function mergeByName(modifiers) {
|
|
1540
|
-
var merged = modifiers.reduce(function(merged2, current) {
|
|
1541
|
-
var existing = merged2[current.name];
|
|
1542
|
-
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
1543
|
-
options: Object.assign({}, existing.options, current.options),
|
|
1544
|
-
data: Object.assign({}, existing.data, current.data)
|
|
1545
|
-
}) : current;
|
|
1546
|
-
return merged2;
|
|
1547
|
-
}, {});
|
|
1548
|
-
return Object.keys(merged).map(function(key) {
|
|
1549
|
-
return merged[key];
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
__name(mergeByName, "mergeByName");
|
|
1553
|
-
|
|
1554
|
-
// ../node_modules/@popperjs/core/lib/createPopper.js
|
|
1555
|
-
var DEFAULT_OPTIONS = {
|
|
1556
|
-
placement: "bottom",
|
|
1557
|
-
modifiers: [],
|
|
1558
|
-
strategy: "absolute"
|
|
1559
|
-
};
|
|
1560
|
-
function areValidElements() {
|
|
1561
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1562
|
-
args[_key] = arguments[_key];
|
|
1563
|
-
}
|
|
1564
|
-
return !args.some(function(element) {
|
|
1565
|
-
return !(element && typeof element.getBoundingClientRect === "function");
|
|
1566
|
-
});
|
|
1567
|
-
}
|
|
1568
|
-
__name(areValidElements, "areValidElements");
|
|
1569
|
-
function popperGenerator(generatorOptions) {
|
|
1570
|
-
if (generatorOptions === void 0) {
|
|
1571
|
-
generatorOptions = {};
|
|
1572
|
-
}
|
|
1573
|
-
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers3 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
1574
|
-
return /* @__PURE__ */ __name(function createPopper4(reference2, popper2, options) {
|
|
1575
|
-
if (options === void 0) {
|
|
1576
|
-
options = defaultOptions;
|
|
1577
|
-
}
|
|
1578
|
-
var state = {
|
|
1579
|
-
placement: "bottom",
|
|
1580
|
-
orderedModifiers: [],
|
|
1581
|
-
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
1582
|
-
modifiersData: {},
|
|
1583
|
-
elements: {
|
|
1584
|
-
reference: reference2,
|
|
1585
|
-
popper: popper2
|
|
1586
|
-
},
|
|
1587
|
-
attributes: {},
|
|
1588
|
-
styles: {}
|
|
1589
|
-
};
|
|
1590
|
-
var effectCleanupFns = [];
|
|
1591
|
-
var isDestroyed = false;
|
|
1592
|
-
var instance = {
|
|
1593
|
-
state,
|
|
1594
|
-
setOptions: /* @__PURE__ */ __name(function setOptions(setOptionsAction) {
|
|
1595
|
-
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
1596
|
-
cleanupModifierEffects();
|
|
1597
|
-
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
1598
|
-
state.scrollParents = {
|
|
1599
|
-
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
1600
|
-
popper: listScrollParents(popper2)
|
|
1601
|
-
};
|
|
1602
|
-
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers3, state.options.modifiers)));
|
|
1603
|
-
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
|
1604
|
-
return m.enabled;
|
|
1605
|
-
});
|
|
1606
|
-
runModifierEffects();
|
|
1607
|
-
return instance.update();
|
|
1608
|
-
}, "setOptions"),
|
|
1609
|
-
// Sync update – it will always be executed, even if not necessary. This
|
|
1610
|
-
// is useful for low frequency updates where sync behavior simplifies the
|
|
1611
|
-
// logic.
|
|
1612
|
-
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
1613
|
-
// prefer the async Popper#update method
|
|
1614
|
-
forceUpdate: /* @__PURE__ */ __name(function forceUpdate() {
|
|
1615
|
-
if (isDestroyed) {
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
|
1619
|
-
if (!areValidElements(reference3, popper3)) {
|
|
1620
|
-
return;
|
|
1621
|
-
}
|
|
1622
|
-
state.rects = {
|
|
1623
|
-
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
|
1624
|
-
popper: getLayoutRect(popper3)
|
|
1625
|
-
};
|
|
1626
|
-
state.reset = false;
|
|
1627
|
-
state.placement = state.options.placement;
|
|
1628
|
-
state.orderedModifiers.forEach(function(modifier) {
|
|
1629
|
-
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
1630
|
-
});
|
|
1631
|
-
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
1632
|
-
if (state.reset === true) {
|
|
1633
|
-
state.reset = false;
|
|
1634
|
-
index = -1;
|
|
1635
|
-
continue;
|
|
1636
|
-
}
|
|
1637
|
-
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
1638
|
-
if (typeof fn2 === "function") {
|
|
1639
|
-
state = fn2({
|
|
1640
|
-
state,
|
|
1641
|
-
options: _options,
|
|
1642
|
-
name,
|
|
1643
|
-
instance
|
|
1644
|
-
}) || state;
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
}, "forceUpdate"),
|
|
1648
|
-
// Async and optimistically optimized update – it will not be executed if
|
|
1649
|
-
// not necessary (debounced to run at most once-per-tick)
|
|
1650
|
-
update: debounce(function() {
|
|
1651
|
-
return new Promise(function(resolve) {
|
|
1652
|
-
instance.forceUpdate();
|
|
1653
|
-
resolve(state);
|
|
1654
|
-
});
|
|
1655
|
-
}),
|
|
1656
|
-
destroy: /* @__PURE__ */ __name(function destroy() {
|
|
1657
|
-
cleanupModifierEffects();
|
|
1658
|
-
isDestroyed = true;
|
|
1659
|
-
}, "destroy")
|
|
1660
|
-
};
|
|
1661
|
-
if (!areValidElements(reference2, popper2)) {
|
|
1662
|
-
return instance;
|
|
1663
|
-
}
|
|
1664
|
-
instance.setOptions(options).then(function(state2) {
|
|
1665
|
-
if (!isDestroyed && options.onFirstUpdate) {
|
|
1666
|
-
options.onFirstUpdate(state2);
|
|
1667
|
-
}
|
|
1668
|
-
});
|
|
1669
|
-
function runModifierEffects() {
|
|
1670
|
-
state.orderedModifiers.forEach(function(_ref) {
|
|
1671
|
-
var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect4 = _ref.effect;
|
|
1672
|
-
if (typeof effect4 === "function") {
|
|
1673
|
-
var cleanupFn = effect4({
|
|
1674
|
-
state,
|
|
1675
|
-
name,
|
|
1676
|
-
instance,
|
|
1677
|
-
options: options2
|
|
1678
|
-
});
|
|
1679
|
-
var noopFn = /* @__PURE__ */ __name(function noopFn2() {
|
|
1680
|
-
}, "noopFn");
|
|
1681
|
-
effectCleanupFns.push(cleanupFn || noopFn);
|
|
1682
|
-
}
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
__name(runModifierEffects, "runModifierEffects");
|
|
1686
|
-
function cleanupModifierEffects() {
|
|
1687
|
-
effectCleanupFns.forEach(function(fn2) {
|
|
1688
|
-
return fn2();
|
|
1689
|
-
});
|
|
1690
|
-
effectCleanupFns = [];
|
|
1691
|
-
}
|
|
1692
|
-
__name(cleanupModifierEffects, "cleanupModifierEffects");
|
|
1693
|
-
return instance;
|
|
1694
|
-
}, "createPopper");
|
|
1695
|
-
}
|
|
1696
|
-
__name(popperGenerator, "popperGenerator");
|
|
1697
|
-
var createPopper = popperGenerator();
|
|
1698
|
-
|
|
1699
|
-
// ../node_modules/@popperjs/core/lib/popper-lite.js
|
|
1700
|
-
var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default];
|
|
1701
|
-
var createPopper2 = popperGenerator({
|
|
1702
|
-
defaultModifiers
|
|
1703
|
-
});
|
|
1704
|
-
|
|
1705
|
-
// ../node_modules/@popperjs/core/lib/popper.js
|
|
1706
|
-
var defaultModifiers2 = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default];
|
|
1707
|
-
var createPopper3 = popperGenerator({
|
|
1708
|
-
defaultModifiers: defaultModifiers2
|
|
1709
|
-
});
|
|
1710
|
-
|
|
1711
|
-
// ../node_modules/react-popper/lib/esm/usePopper.js
|
|
1712
|
-
var import_react_fast_compare = __toESM(require_react_fast_compare());
|
|
1713
|
-
var EMPTY_MODIFIERS = [];
|
|
1714
|
-
var usePopper = /* @__PURE__ */ __name(function usePopper2(referenceElement, popperElement, options) {
|
|
1715
|
-
if (options === void 0) {
|
|
1716
|
-
options = {};
|
|
1717
|
-
}
|
|
1718
|
-
var prevOptions = React3.useRef(null);
|
|
1719
|
-
var optionsWithDefaults = {
|
|
1720
|
-
onFirstUpdate: options.onFirstUpdate,
|
|
1721
|
-
placement: options.placement || "bottom",
|
|
1722
|
-
strategy: options.strategy || "absolute",
|
|
1723
|
-
modifiers: options.modifiers || EMPTY_MODIFIERS
|
|
1724
|
-
};
|
|
1725
|
-
var _React$useState = React3.useState({
|
|
1726
|
-
styles: {
|
|
1727
|
-
popper: {
|
|
1728
|
-
position: optionsWithDefaults.strategy,
|
|
1729
|
-
left: "0",
|
|
1730
|
-
top: "0"
|
|
1731
|
-
},
|
|
1732
|
-
arrow: {
|
|
1733
|
-
position: "absolute"
|
|
1734
|
-
}
|
|
1735
|
-
},
|
|
1736
|
-
attributes: {}
|
|
1737
|
-
}), state = _React$useState[0], setState = _React$useState[1];
|
|
1738
|
-
var updateStateModifier = React3.useMemo(function() {
|
|
1739
|
-
return {
|
|
1740
|
-
name: "updateState",
|
|
1741
|
-
enabled: true,
|
|
1742
|
-
phase: "write",
|
|
1743
|
-
fn: /* @__PURE__ */ __name(function fn2(_ref) {
|
|
1744
|
-
var state2 = _ref.state;
|
|
1745
|
-
var elements = Object.keys(state2.elements);
|
|
1746
|
-
ReactDOM.flushSync(function() {
|
|
1747
|
-
setState({
|
|
1748
|
-
styles: fromEntries(elements.map(function(element) {
|
|
1749
|
-
return [element, state2.styles[element] || {}];
|
|
1750
|
-
})),
|
|
1751
|
-
attributes: fromEntries(elements.map(function(element) {
|
|
1752
|
-
return [element, state2.attributes[element]];
|
|
1753
|
-
}))
|
|
1754
|
-
});
|
|
1755
|
-
});
|
|
1756
|
-
}, "fn"),
|
|
1757
|
-
requires: ["computeStyles"]
|
|
1758
|
-
};
|
|
1759
|
-
}, []);
|
|
1760
|
-
var popperOptions = React3.useMemo(function() {
|
|
1761
|
-
var newOptions = {
|
|
1762
|
-
onFirstUpdate: optionsWithDefaults.onFirstUpdate,
|
|
1763
|
-
placement: optionsWithDefaults.placement,
|
|
1764
|
-
strategy: optionsWithDefaults.strategy,
|
|
1765
|
-
modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
|
|
1766
|
-
name: "applyStyles",
|
|
1767
|
-
enabled: false
|
|
1768
|
-
}])
|
|
1769
|
-
};
|
|
1770
|
-
if ((0, import_react_fast_compare.default)(prevOptions.current, newOptions)) {
|
|
1771
|
-
return prevOptions.current || newOptions;
|
|
1772
|
-
} else {
|
|
1773
|
-
prevOptions.current = newOptions;
|
|
1774
|
-
return newOptions;
|
|
1775
|
-
}
|
|
1776
|
-
}, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
|
|
1777
|
-
var popperInstanceRef = React3.useRef();
|
|
1778
|
-
useIsomorphicLayoutEffect(function() {
|
|
1779
|
-
if (popperInstanceRef.current) {
|
|
1780
|
-
popperInstanceRef.current.setOptions(popperOptions);
|
|
1781
|
-
}
|
|
1782
|
-
}, [popperOptions]);
|
|
1783
|
-
useIsomorphicLayoutEffect(function() {
|
|
1784
|
-
if (referenceElement == null || popperElement == null) {
|
|
1785
|
-
return;
|
|
1786
|
-
}
|
|
1787
|
-
var createPopper4 = options.createPopper || createPopper3;
|
|
1788
|
-
var popperInstance = createPopper4(referenceElement, popperElement, popperOptions);
|
|
1789
|
-
popperInstanceRef.current = popperInstance;
|
|
1790
|
-
return function() {
|
|
1791
|
-
popperInstance.destroy();
|
|
1792
|
-
popperInstanceRef.current = null;
|
|
1793
|
-
};
|
|
1794
|
-
}, [referenceElement, popperElement, options.createPopper]);
|
|
1795
|
-
return {
|
|
1796
|
-
state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
|
|
1797
|
-
styles: state.styles,
|
|
1798
|
-
attributes: state.attributes,
|
|
1799
|
-
update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
|
|
1800
|
-
forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
|
|
1801
|
-
};
|
|
1802
|
-
}, "usePopper");
|
|
1803
|
-
|
|
1804
|
-
// ../node_modules/react-popper/lib/esm/Reference.js
|
|
1805
|
-
var import_warning = __toESM(require_warning());
|
|
1806
|
-
import * as React5 from "react";
|
|
1807
|
-
|
|
1808
|
-
// ../node_modules/react-popper-tooltip/dist/esm/react-popper-tooltip.js
|
|
1809
|
-
function useGetLatest(val) {
|
|
1810
|
-
var ref = React6.useRef(val);
|
|
1811
|
-
ref.current = val;
|
|
1812
|
-
return React6.useCallback(function() {
|
|
1813
|
-
return ref.current;
|
|
1814
|
-
}, []);
|
|
1815
|
-
}
|
|
1816
|
-
__name(useGetLatest, "useGetLatest");
|
|
1817
|
-
var noop = /* @__PURE__ */ __name(function noop2() {
|
|
1818
|
-
}, "noop");
|
|
1819
|
-
function useControlledState(_ref) {
|
|
1820
|
-
var initial = _ref.initial, value = _ref.value, _ref$onChange = _ref.onChange, onChange = _ref$onChange === void 0 ? noop : _ref$onChange;
|
|
1821
|
-
if (initial === void 0 && value === void 0) {
|
|
1822
|
-
throw new TypeError('Either "value" or "initial" variable must be set. Now both are undefined');
|
|
1823
|
-
}
|
|
1824
|
-
var _React$useState = React6.useState(initial), state = _React$useState[0], setState = _React$useState[1];
|
|
1825
|
-
var getLatest = useGetLatest(state);
|
|
1826
|
-
var set = React6.useCallback(function(updater) {
|
|
1827
|
-
var state2 = getLatest();
|
|
1828
|
-
var updatedState = typeof updater === "function" ? updater(state2) : updater;
|
|
1829
|
-
if (typeof updatedState.persist === "function") updatedState.persist();
|
|
1830
|
-
setState(updatedState);
|
|
1831
|
-
if (typeof onChange === "function") onChange(updatedState);
|
|
1832
|
-
}, [getLatest, onChange]);
|
|
1833
|
-
var isControlled = value !== void 0;
|
|
1834
|
-
return [isControlled ? value : state, isControlled ? onChange : set];
|
|
1835
|
-
}
|
|
1836
|
-
__name(useControlledState, "useControlledState");
|
|
1837
|
-
function generateBoundingClientRect(x, y) {
|
|
1838
|
-
if (x === void 0) {
|
|
1839
|
-
x = 0;
|
|
1840
|
-
}
|
|
1841
|
-
if (y === void 0) {
|
|
1842
|
-
y = 0;
|
|
1843
|
-
}
|
|
1844
|
-
return function() {
|
|
1845
|
-
return {
|
|
1846
|
-
width: 0,
|
|
1847
|
-
height: 0,
|
|
1848
|
-
top: y,
|
|
1849
|
-
right: x,
|
|
1850
|
-
bottom: y,
|
|
1851
|
-
left: x,
|
|
1852
|
-
x: 0,
|
|
1853
|
-
y: 0,
|
|
1854
|
-
toJSON: /* @__PURE__ */ __name(function toJSON() {
|
|
1855
|
-
return null;
|
|
1856
|
-
}, "toJSON")
|
|
1857
|
-
};
|
|
1858
|
-
};
|
|
1859
|
-
}
|
|
1860
|
-
__name(generateBoundingClientRect, "generateBoundingClientRect");
|
|
1861
|
-
var _excluded = ["styles", "attributes"];
|
|
1862
|
-
var virtualElement = {
|
|
1863
|
-
getBoundingClientRect: generateBoundingClientRect()
|
|
1864
|
-
};
|
|
1865
|
-
var defaultConfig = {
|
|
1866
|
-
closeOnOutsideClick: true,
|
|
1867
|
-
closeOnTriggerHidden: false,
|
|
1868
|
-
defaultVisible: false,
|
|
1869
|
-
delayHide: 0,
|
|
1870
|
-
delayShow: 0,
|
|
1871
|
-
followCursor: false,
|
|
1872
|
-
interactive: false,
|
|
1873
|
-
mutationObserverOptions: {
|
|
1874
|
-
attributes: true,
|
|
1875
|
-
childList: true,
|
|
1876
|
-
subtree: true
|
|
1877
|
-
},
|
|
1878
|
-
offset: [0, 6],
|
|
1879
|
-
trigger: "hover"
|
|
1880
|
-
};
|
|
1881
|
-
function usePopperTooltip(config, popperOptions) {
|
|
1882
|
-
var _popperProps$state, _popperProps$state$mo, _popperProps$state$mo2;
|
|
1883
|
-
if (config === void 0) {
|
|
1884
|
-
config = {};
|
|
1885
|
-
}
|
|
1886
|
-
if (popperOptions === void 0) {
|
|
1887
|
-
popperOptions = {};
|
|
1888
|
-
}
|
|
1889
|
-
var finalConfig = Object.keys(defaultConfig).reduce(function(config2, key) {
|
|
1890
|
-
var _extends2;
|
|
1891
|
-
return _extends({}, config2, (_extends2 = {}, _extends2[key] = config2[key] !== void 0 ? config2[key] : defaultConfig[key], _extends2));
|
|
1892
|
-
}, config);
|
|
1893
|
-
var defaultModifiers3 = React6.useMemo(
|
|
1894
|
-
function() {
|
|
1895
|
-
return [{
|
|
1896
|
-
name: "offset",
|
|
1897
|
-
options: {
|
|
1898
|
-
offset: finalConfig.offset
|
|
1899
|
-
}
|
|
1900
|
-
}];
|
|
1901
|
-
},
|
|
1902
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1903
|
-
Array.isArray(finalConfig.offset) ? finalConfig.offset : []
|
|
1904
|
-
);
|
|
1905
|
-
var finalPopperOptions = _extends({}, popperOptions, {
|
|
1906
|
-
placement: popperOptions.placement || finalConfig.placement,
|
|
1907
|
-
modifiers: popperOptions.modifiers || defaultModifiers3
|
|
1908
|
-
});
|
|
1909
|
-
var _React$useState = React6.useState(null), triggerRef = _React$useState[0], setTriggerRef = _React$useState[1];
|
|
1910
|
-
var _React$useState2 = React6.useState(null), tooltipRef = _React$useState2[0], setTooltipRef = _React$useState2[1];
|
|
1911
|
-
var _useControlledState = useControlledState({
|
|
1912
|
-
initial: finalConfig.defaultVisible,
|
|
1913
|
-
value: finalConfig.visible,
|
|
1914
|
-
onChange: finalConfig.onVisibleChange
|
|
1915
|
-
}), visible = _useControlledState[0], setVisible = _useControlledState[1];
|
|
1916
|
-
var timer = React6.useRef();
|
|
1917
|
-
React6.useEffect(function() {
|
|
1918
|
-
return function() {
|
|
1919
|
-
return clearTimeout(timer.current);
|
|
1920
|
-
};
|
|
1921
|
-
}, []);
|
|
1922
|
-
var _usePopper = usePopper(finalConfig.followCursor ? virtualElement : triggerRef, tooltipRef, finalPopperOptions), styles = _usePopper.styles, attributes = _usePopper.attributes, popperProps = _objectWithoutPropertiesLoose(_usePopper, _excluded);
|
|
1923
|
-
var update = popperProps.update;
|
|
1924
|
-
var getLatest = useGetLatest({
|
|
1925
|
-
visible,
|
|
1926
|
-
triggerRef,
|
|
1927
|
-
tooltipRef,
|
|
1928
|
-
finalConfig
|
|
1929
|
-
});
|
|
1930
|
-
var isTriggeredBy = React6.useCallback(
|
|
1931
|
-
function(trigger) {
|
|
1932
|
-
return Array.isArray(finalConfig.trigger) ? finalConfig.trigger.includes(trigger) : finalConfig.trigger === trigger;
|
|
1933
|
-
},
|
|
1934
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1935
|
-
Array.isArray(finalConfig.trigger) ? finalConfig.trigger : [finalConfig.trigger]
|
|
1936
|
-
);
|
|
1937
|
-
var hideTooltip = React6.useCallback(function() {
|
|
1938
|
-
clearTimeout(timer.current);
|
|
1939
|
-
timer.current = window.setTimeout(function() {
|
|
1940
|
-
return setVisible(false);
|
|
1941
|
-
}, finalConfig.delayHide);
|
|
1942
|
-
}, [finalConfig.delayHide, setVisible]);
|
|
1943
|
-
var showTooltip = React6.useCallback(function() {
|
|
1944
|
-
clearTimeout(timer.current);
|
|
1945
|
-
timer.current = window.setTimeout(function() {
|
|
1946
|
-
return setVisible(true);
|
|
1947
|
-
}, finalConfig.delayShow);
|
|
1948
|
-
}, [finalConfig.delayShow, setVisible]);
|
|
1949
|
-
var toggleTooltip = React6.useCallback(function() {
|
|
1950
|
-
if (getLatest().visible) {
|
|
1951
|
-
hideTooltip();
|
|
1952
|
-
} else {
|
|
1953
|
-
showTooltip();
|
|
1954
|
-
}
|
|
1955
|
-
}, [getLatest, hideTooltip, showTooltip]);
|
|
1956
|
-
React6.useEffect(function() {
|
|
1957
|
-
if (!getLatest().finalConfig.closeOnOutsideClick) return;
|
|
1958
|
-
var handleClickOutside = /* @__PURE__ */ __name(function handleClickOutside2(event) {
|
|
1959
|
-
var _event$composedPath;
|
|
1960
|
-
var _getLatest = getLatest(), tooltipRef2 = _getLatest.tooltipRef, triggerRef2 = _getLatest.triggerRef;
|
|
1961
|
-
var target = (event.composedPath == null ? void 0 : (_event$composedPath = event.composedPath()) == null ? void 0 : _event$composedPath[0]) || event.target;
|
|
1962
|
-
if (target instanceof Node) {
|
|
1963
|
-
if (tooltipRef2 != null && triggerRef2 != null && !tooltipRef2.contains(target) && !triggerRef2.contains(target)) {
|
|
1964
|
-
hideTooltip();
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
}, "handleClickOutside");
|
|
1968
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
1969
|
-
return function() {
|
|
1970
|
-
return document.removeEventListener("mousedown", handleClickOutside);
|
|
1971
|
-
};
|
|
1972
|
-
}, [getLatest, hideTooltip]);
|
|
1973
|
-
React6.useEffect(function() {
|
|
1974
|
-
if (triggerRef == null || !isTriggeredBy("click")) return;
|
|
1975
|
-
triggerRef.addEventListener("click", toggleTooltip);
|
|
1976
|
-
return function() {
|
|
1977
|
-
return triggerRef.removeEventListener("click", toggleTooltip);
|
|
1978
|
-
};
|
|
1979
|
-
}, [triggerRef, isTriggeredBy, toggleTooltip]);
|
|
1980
|
-
React6.useEffect(function() {
|
|
1981
|
-
if (triggerRef == null || !isTriggeredBy("double-click")) return;
|
|
1982
|
-
triggerRef.addEventListener("dblclick", toggleTooltip);
|
|
1983
|
-
return function() {
|
|
1984
|
-
return triggerRef.removeEventListener("dblclick", toggleTooltip);
|
|
1985
|
-
};
|
|
1986
|
-
}, [triggerRef, isTriggeredBy, toggleTooltip]);
|
|
1987
|
-
React6.useEffect(function() {
|
|
1988
|
-
if (triggerRef == null || !isTriggeredBy("right-click")) return;
|
|
1989
|
-
var preventDefaultAndToggle = /* @__PURE__ */ __name(function preventDefaultAndToggle2(event) {
|
|
1990
|
-
event.preventDefault();
|
|
1991
|
-
toggleTooltip();
|
|
1992
|
-
}, "preventDefaultAndToggle");
|
|
1993
|
-
triggerRef.addEventListener("contextmenu", preventDefaultAndToggle);
|
|
1994
|
-
return function() {
|
|
1995
|
-
return triggerRef.removeEventListener("contextmenu", preventDefaultAndToggle);
|
|
1996
|
-
};
|
|
1997
|
-
}, [triggerRef, isTriggeredBy, toggleTooltip]);
|
|
1998
|
-
React6.useEffect(function() {
|
|
1999
|
-
if (triggerRef == null || !isTriggeredBy("focus")) return;
|
|
2000
|
-
triggerRef.addEventListener("focus", showTooltip);
|
|
2001
|
-
triggerRef.addEventListener("blur", hideTooltip);
|
|
2002
|
-
return function() {
|
|
2003
|
-
triggerRef.removeEventListener("focus", showTooltip);
|
|
2004
|
-
triggerRef.removeEventListener("blur", hideTooltip);
|
|
2005
|
-
};
|
|
2006
|
-
}, [triggerRef, isTriggeredBy, showTooltip, hideTooltip]);
|
|
2007
|
-
React6.useEffect(function() {
|
|
2008
|
-
if (triggerRef == null || !isTriggeredBy("hover")) return;
|
|
2009
|
-
triggerRef.addEventListener("mouseenter", showTooltip);
|
|
2010
|
-
triggerRef.addEventListener("mouseleave", hideTooltip);
|
|
2011
|
-
return function() {
|
|
2012
|
-
triggerRef.removeEventListener("mouseenter", showTooltip);
|
|
2013
|
-
triggerRef.removeEventListener("mouseleave", hideTooltip);
|
|
2014
|
-
};
|
|
2015
|
-
}, [triggerRef, isTriggeredBy, showTooltip, hideTooltip]);
|
|
2016
|
-
React6.useEffect(function() {
|
|
2017
|
-
if (tooltipRef == null || !isTriggeredBy("hover") || !getLatest().finalConfig.interactive) return;
|
|
2018
|
-
tooltipRef.addEventListener("mouseenter", showTooltip);
|
|
2019
|
-
tooltipRef.addEventListener("mouseleave", hideTooltip);
|
|
2020
|
-
return function() {
|
|
2021
|
-
tooltipRef.removeEventListener("mouseenter", showTooltip);
|
|
2022
|
-
tooltipRef.removeEventListener("mouseleave", hideTooltip);
|
|
2023
|
-
};
|
|
2024
|
-
}, [tooltipRef, isTriggeredBy, showTooltip, hideTooltip, getLatest]);
|
|
2025
|
-
var isReferenceHidden = popperProps == null ? void 0 : (_popperProps$state = popperProps.state) == null ? void 0 : (_popperProps$state$mo = _popperProps$state.modifiersData) == null ? void 0 : (_popperProps$state$mo2 = _popperProps$state$mo.hide) == null ? void 0 : _popperProps$state$mo2.isReferenceHidden;
|
|
2026
|
-
React6.useEffect(function() {
|
|
2027
|
-
if (finalConfig.closeOnTriggerHidden && isReferenceHidden) hideTooltip();
|
|
2028
|
-
}, [finalConfig.closeOnTriggerHidden, hideTooltip, isReferenceHidden]);
|
|
2029
|
-
React6.useEffect(function() {
|
|
2030
|
-
if (!finalConfig.followCursor || triggerRef == null) return;
|
|
2031
|
-
function setMousePosition(_ref) {
|
|
2032
|
-
var clientX = _ref.clientX, clientY = _ref.clientY;
|
|
2033
|
-
virtualElement.getBoundingClientRect = generateBoundingClientRect(clientX, clientY);
|
|
2034
|
-
update == null ? void 0 : update();
|
|
2035
|
-
}
|
|
2036
|
-
__name(setMousePosition, "setMousePosition");
|
|
2037
|
-
triggerRef.addEventListener("mousemove", setMousePosition);
|
|
2038
|
-
return function() {
|
|
2039
|
-
return triggerRef.removeEventListener("mousemove", setMousePosition);
|
|
2040
|
-
};
|
|
2041
|
-
}, [finalConfig.followCursor, triggerRef, update]);
|
|
2042
|
-
React6.useEffect(function() {
|
|
2043
|
-
if (tooltipRef == null || update == null || finalConfig.mutationObserverOptions == null) return;
|
|
2044
|
-
var observer = new MutationObserver(update);
|
|
2045
|
-
observer.observe(tooltipRef, finalConfig.mutationObserverOptions);
|
|
2046
|
-
return function() {
|
|
2047
|
-
return observer.disconnect();
|
|
2048
|
-
};
|
|
2049
|
-
}, [finalConfig.mutationObserverOptions, tooltipRef, update]);
|
|
2050
|
-
var getTooltipProps = /* @__PURE__ */ __name(function getTooltipProps2(args) {
|
|
2051
|
-
if (args === void 0) {
|
|
2052
|
-
args = {};
|
|
2053
|
-
}
|
|
2054
|
-
return _extends({}, args, {
|
|
2055
|
-
style: _extends({}, args.style, styles.popper)
|
|
2056
|
-
}, attributes.popper, {
|
|
2057
|
-
"data-popper-interactive": finalConfig.interactive
|
|
2058
|
-
});
|
|
2059
|
-
}, "getTooltipProps");
|
|
2060
|
-
var getArrowProps = /* @__PURE__ */ __name(function getArrowProps2(args) {
|
|
2061
|
-
if (args === void 0) {
|
|
2062
|
-
args = {};
|
|
2063
|
-
}
|
|
2064
|
-
return _extends({}, args, attributes.arrow, {
|
|
2065
|
-
style: _extends({}, args.style, styles.arrow),
|
|
2066
|
-
"data-popper-arrow": true
|
|
2067
|
-
});
|
|
2068
|
-
}, "getArrowProps");
|
|
2069
|
-
return _extends({
|
|
2070
|
-
getArrowProps,
|
|
2071
|
-
getTooltipProps,
|
|
2072
|
-
setTooltipRef,
|
|
2073
|
-
setTriggerRef,
|
|
2074
|
-
tooltipRef,
|
|
2075
|
-
triggerRef,
|
|
2076
|
-
visible
|
|
2077
|
-
}, popperProps);
|
|
2078
|
-
}
|
|
2079
|
-
__name(usePopperTooltip, "usePopperTooltip");
|
|
2080
|
-
|
|
2081
|
-
// src/components/components/tooltip/WithTooltip.tsx
|
|
2082
|
-
import { lighten, styled } from "storybook/theming";
|
|
2083
|
-
var { document: document2 } = global;
|
|
2084
|
-
var match = (0, import_memoizerific.default)(1e3)(
|
|
2085
|
-
(requests, actual, value, fallback = 0) => actual.split("-")[0] === requests ? value : fallback
|
|
2086
|
-
);
|
|
2087
|
-
var ArrowSpacing = 8;
|
|
2088
|
-
var Arrow = styled.div(
|
|
2089
|
-
{
|
|
2090
|
-
position: "absolute",
|
|
2091
|
-
borderStyle: "solid"
|
|
2092
|
-
},
|
|
2093
|
-
({ placement }) => {
|
|
2094
|
-
let x = 0;
|
|
2095
|
-
let y = 0;
|
|
2096
|
-
switch (true) {
|
|
2097
|
-
case (placement.startsWith("left") || placement.startsWith("right")): {
|
|
2098
|
-
y = 8;
|
|
2099
|
-
break;
|
|
2100
|
-
}
|
|
2101
|
-
case (placement.startsWith("top") || placement.startsWith("bottom")): {
|
|
2102
|
-
x = 8;
|
|
2103
|
-
break;
|
|
2104
|
-
}
|
|
2105
|
-
default: {
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
const transform = `translate3d(${x}px, ${y}px, 0px)`;
|
|
2109
|
-
return { transform };
|
|
2110
|
-
},
|
|
2111
|
-
({ theme, color, placement }) => ({
|
|
2112
|
-
bottom: `${match("top", placement, `${ArrowSpacing * -1}px`, "auto")}`,
|
|
2113
|
-
top: `${match("bottom", placement, `${ArrowSpacing * -1}px`, "auto")}`,
|
|
2114
|
-
right: `${match("left", placement, `${ArrowSpacing * -1}px`, "auto")}`,
|
|
2115
|
-
left: `${match("right", placement, `${ArrowSpacing * -1}px`, "auto")}`,
|
|
2116
|
-
borderBottomWidth: `${match("top", placement, "0", ArrowSpacing)}px`,
|
|
2117
|
-
borderTopWidth: `${match("bottom", placement, "0", ArrowSpacing)}px`,
|
|
2118
|
-
borderRightWidth: `${match("left", placement, "0", ArrowSpacing)}px`,
|
|
2119
|
-
borderLeftWidth: `${match("right", placement, "0", ArrowSpacing)}px`,
|
|
2120
|
-
borderTopColor: match(
|
|
2121
|
-
"top",
|
|
2122
|
-
placement,
|
|
2123
|
-
theme.color[color] || color || theme.base === "light" ? lighten(theme.background.app) : theme.background.app,
|
|
2124
|
-
"transparent"
|
|
2125
|
-
),
|
|
2126
|
-
borderBottomColor: match(
|
|
2127
|
-
"bottom",
|
|
2128
|
-
placement,
|
|
2129
|
-
theme.color[color] || color || theme.base === "light" ? lighten(theme.background.app) : theme.background.app,
|
|
2130
|
-
"transparent"
|
|
2131
|
-
),
|
|
2132
|
-
borderLeftColor: match(
|
|
2133
|
-
"left",
|
|
2134
|
-
placement,
|
|
2135
|
-
theme.color[color] || color || theme.base === "light" ? lighten(theme.background.app) : theme.background.app,
|
|
2136
|
-
"transparent"
|
|
2137
|
-
),
|
|
2138
|
-
borderRightColor: match(
|
|
2139
|
-
"right",
|
|
2140
|
-
placement,
|
|
2141
|
-
theme.color[color] || color || theme.base === "light" ? lighten(theme.background.app) : theme.background.app,
|
|
2142
|
-
"transparent"
|
|
2143
|
-
)
|
|
2144
|
-
})
|
|
2145
|
-
);
|
|
2146
|
-
var Wrapper = styled.div(
|
|
2147
|
-
({ hidden }) => ({
|
|
2148
|
-
display: hidden ? "none" : "inline-block",
|
|
2149
|
-
zIndex: 2147483647,
|
|
2150
|
-
colorScheme: "light dark"
|
|
2151
|
-
}),
|
|
2152
|
-
({ theme, color, hasChrome }) => hasChrome ? {
|
|
2153
|
-
background: color && theme.color[color] || color || theme.base === "light" ? lighten(theme.background.app) : theme.background.app,
|
|
2154
|
-
filter: `
|
|
2155
|
-
drop-shadow(0px 5px 5px rgba(0,0,0,0.05))
|
|
2156
|
-
drop-shadow(0 1px 3px rgba(0,0,0,0.1))
|
|
2157
|
-
`,
|
|
2158
|
-
borderRadius: theme.appBorderRadius + 2,
|
|
2159
|
-
fontSize: theme.typography.size.s1
|
|
2160
|
-
} : {}
|
|
2161
|
-
);
|
|
2162
|
-
var Tooltip = React7.forwardRef(
|
|
2163
|
-
({
|
|
2164
|
-
placement = "top",
|
|
2165
|
-
hasChrome = true,
|
|
2166
|
-
children,
|
|
2167
|
-
arrowProps = {},
|
|
2168
|
-
tooltipRef,
|
|
2169
|
-
color,
|
|
2170
|
-
withArrows,
|
|
2171
|
-
...props
|
|
2172
|
-
}, ref) => {
|
|
2173
|
-
return React7.createElement(Wrapper, { "data-testid": "tooltip", hasChrome, ref, ...props, color }, hasChrome && withArrows && React7.createElement(Arrow, { placement, ...arrowProps, color }), children);
|
|
2174
|
-
}
|
|
2175
|
-
);
|
|
2176
|
-
Tooltip.displayName = "Tooltip";
|
|
2177
|
-
var TargetContainer = styled.div`
|
|
2178
|
-
display: inline-block;
|
|
2179
|
-
cursor: ${(props) => props.trigger === "hover" || props.trigger?.includes("hover") ? "default" : "pointer"};
|
|
2180
|
-
`;
|
|
2181
|
-
var TargetSvgContainer = styled.g`
|
|
2182
|
-
cursor: ${(props) => props.trigger === "hover" || props.trigger?.includes("hover") ? "default" : "pointer"};
|
|
2183
|
-
`;
|
|
2184
|
-
var WithTooltipPure = /* @__PURE__ */ __name(({
|
|
2185
|
-
svg = false,
|
|
2186
|
-
trigger = "click",
|
|
2187
|
-
closeOnOutsideClick = false,
|
|
2188
|
-
placement = "top",
|
|
2189
|
-
modifiers = [
|
|
2190
|
-
{
|
|
2191
|
-
name: "preventOverflow",
|
|
2192
|
-
options: {
|
|
2193
|
-
padding: 8
|
|
2194
|
-
}
|
|
2195
|
-
},
|
|
2196
|
-
{
|
|
2197
|
-
name: "offset",
|
|
2198
|
-
options: {
|
|
2199
|
-
offset: [8, 8]
|
|
2200
|
-
}
|
|
2201
|
-
},
|
|
2202
|
-
{
|
|
2203
|
-
name: "arrow",
|
|
2204
|
-
options: {
|
|
2205
|
-
padding: 8
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
],
|
|
2209
|
-
hasChrome = true,
|
|
2210
|
-
defaultVisible = false,
|
|
2211
|
-
withArrows,
|
|
2212
|
-
offset: offset2,
|
|
2213
|
-
tooltip,
|
|
2214
|
-
children,
|
|
2215
|
-
closeOnTriggerHidden,
|
|
2216
|
-
mutationObserverOptions,
|
|
2217
|
-
delayHide = trigger === "hover" ? 200 : 0,
|
|
2218
|
-
visible,
|
|
2219
|
-
interactive,
|
|
2220
|
-
delayShow = trigger === "hover" ? 400 : 0,
|
|
2221
|
-
strategy,
|
|
2222
|
-
followCursor,
|
|
2223
|
-
onVisibleChange,
|
|
2224
|
-
portalContainer,
|
|
2225
|
-
...props
|
|
2226
|
-
}) => {
|
|
2227
|
-
const Container = svg ? TargetSvgContainer : TargetContainer;
|
|
2228
|
-
const {
|
|
2229
|
-
getArrowProps,
|
|
2230
|
-
getTooltipProps,
|
|
2231
|
-
setTooltipRef,
|
|
2232
|
-
setTriggerRef,
|
|
2233
|
-
visible: isVisible,
|
|
2234
|
-
state
|
|
2235
|
-
} = usePopperTooltip(
|
|
2236
|
-
{
|
|
2237
|
-
trigger,
|
|
2238
|
-
placement,
|
|
2239
|
-
defaultVisible,
|
|
2240
|
-
delayHide,
|
|
2241
|
-
interactive,
|
|
2242
|
-
closeOnOutsideClick,
|
|
2243
|
-
closeOnTriggerHidden,
|
|
2244
|
-
onVisibleChange,
|
|
2245
|
-
delayShow,
|
|
2246
|
-
followCursor,
|
|
2247
|
-
mutationObserverOptions,
|
|
2248
|
-
visible,
|
|
2249
|
-
offset: offset2
|
|
2250
|
-
},
|
|
2251
|
-
{
|
|
2252
|
-
modifiers,
|
|
2253
|
-
strategy
|
|
2254
|
-
}
|
|
2255
|
-
);
|
|
2256
|
-
const portalTarget = (typeof portalContainer === "string" ? document2.querySelector(portalContainer) : portalContainer) || document2.body;
|
|
2257
|
-
const tooltipComponent = isVisible ? React7.createElement(
|
|
2258
|
-
Tooltip,
|
|
2259
|
-
{
|
|
2260
|
-
placement: state?.placement,
|
|
2261
|
-
ref: setTooltipRef,
|
|
2262
|
-
hasChrome,
|
|
2263
|
-
arrowProps: getArrowProps(),
|
|
2264
|
-
withArrows,
|
|
2265
|
-
...getTooltipProps()
|
|
2266
|
-
},
|
|
2267
|
-
typeof tooltip === "function" ? tooltip({ onHide: /* @__PURE__ */ __name(() => onVisibleChange(false), "onHide") }) : tooltip
|
|
2268
|
-
) : null;
|
|
2269
|
-
return React7.createElement(React7.Fragment, null, React7.createElement(Container, { trigger, ref: setTriggerRef, ...props }, children), isVisible && ReactDOM2.createPortal(tooltipComponent, portalTarget));
|
|
2270
|
-
}, "WithTooltipPure");
|
|
2271
|
-
var WithToolTipState = /* @__PURE__ */ __name(({
|
|
2272
|
-
startOpen = false,
|
|
2273
|
-
onVisibleChange: onChange,
|
|
2274
|
-
...rest
|
|
2275
|
-
}) => {
|
|
2276
|
-
const [tooltipShown, setTooltipShown] = useState5(startOpen);
|
|
2277
|
-
const onVisibilityChange = useCallback4(
|
|
2278
|
-
(visibility) => {
|
|
2279
|
-
if (onChange && onChange(visibility) === false) {
|
|
2280
|
-
return;
|
|
2281
|
-
}
|
|
2282
|
-
setTooltipShown(visibility);
|
|
2283
|
-
},
|
|
2284
|
-
[onChange]
|
|
2285
|
-
);
|
|
2286
|
-
useEffect6(() => {
|
|
2287
|
-
const hide2 = /* @__PURE__ */ __name(() => onVisibilityChange(false), "hide");
|
|
2288
|
-
const handleKeyDown = /* @__PURE__ */ __name((e) => {
|
|
2289
|
-
if (e.key === "Escape") {
|
|
2290
|
-
hide2();
|
|
2291
|
-
}
|
|
2292
|
-
}, "handleKeyDown");
|
|
2293
|
-
document2.addEventListener("keydown", handleKeyDown, false);
|
|
2294
|
-
const iframes = Array.from(document2.getElementsByTagName("iframe"));
|
|
2295
|
-
const unbinders = [];
|
|
2296
|
-
iframes.forEach((iframe) => {
|
|
2297
|
-
const bind = /* @__PURE__ */ __name(() => {
|
|
2298
|
-
try {
|
|
2299
|
-
if (iframe.contentWindow.document) {
|
|
2300
|
-
iframe.contentWindow.document.addEventListener("click", hide2);
|
|
2301
|
-
unbinders.push(() => {
|
|
2302
|
-
try {
|
|
2303
|
-
iframe.contentWindow.document.removeEventListener("click", hide2);
|
|
2304
|
-
} catch (e) {
|
|
2305
|
-
}
|
|
2306
|
-
});
|
|
2307
|
-
}
|
|
2308
|
-
} catch (e) {
|
|
2309
|
-
}
|
|
2310
|
-
}, "bind");
|
|
2311
|
-
bind();
|
|
2312
|
-
iframe.addEventListener("load", bind);
|
|
2313
|
-
unbinders.push(() => {
|
|
2314
|
-
iframe.removeEventListener("load", bind);
|
|
2315
|
-
});
|
|
2316
|
-
});
|
|
2317
|
-
return () => {
|
|
2318
|
-
document2.removeEventListener("keydown", handleKeyDown);
|
|
2319
|
-
unbinders.forEach((unbind) => {
|
|
2320
|
-
unbind();
|
|
2321
|
-
});
|
|
2322
|
-
};
|
|
2323
|
-
});
|
|
2324
|
-
return React7.createElement(WithTooltipPure, { ...rest, visible: tooltipShown, onVisibleChange: onVisibilityChange });
|
|
2325
|
-
}, "WithToolTipState");
|
|
2326
|
-
var DeprecatedPure = /* @__PURE__ */ __name((props) => {
|
|
2327
|
-
deprecate(
|
|
2328
|
-
"WithTooltipPure is deprecated and will be removed in Storybook 11. Please use WithTooltip instead."
|
|
2329
|
-
);
|
|
2330
|
-
return React7.createElement(WithTooltipPure, { ...props });
|
|
2331
|
-
}, "DeprecatedPure");
|
|
2332
|
-
var DeprecatedState = /* @__PURE__ */ __name((props) => {
|
|
2333
|
-
deprecate(
|
|
2334
|
-
"WithToolTipState is deprecated and will be removed in Storybook 11. Please use WithTooltip instead."
|
|
2335
|
-
);
|
|
2336
|
-
return React7.createElement(WithToolTipState, { ...props });
|
|
2337
|
-
}, "DeprecatedState");
|
|
2338
|
-
export {
|
|
2339
|
-
Tooltip,
|
|
2340
|
-
DeprecatedState as WithToolTipState,
|
|
2341
|
-
WithToolTipState as WithTooltip,
|
|
2342
|
-
DeprecatedPure as WithTooltipPure
|
|
2343
|
-
};
|