react-tooltip 5.5.2 → 5.6.0
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/README.md +2 -1
- package/dist/react-tooltip.cjs.js +2244 -1933
- package/dist/react-tooltip.cjs.min.js +3 -3
- package/dist/react-tooltip.d.ts +5 -1
- package/dist/react-tooltip.esm.js +2239 -1934
- package/dist/react-tooltip.esm.min.js +3 -3
- package/dist/react-tooltip.umd.js +2244 -1933
- package/dist/react-tooltip.umd.min.js +3 -3
- package/package.json +1 -1
|
@@ -8,2290 +8,2592 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
function getSide(placement) {
|
|
12
|
+
return placement.split('-')[0];
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the MIT license found in the
|
|
21
|
-
* LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/
|
|
15
|
+
function getAlignment(placement) {
|
|
16
|
+
return placement.split('-')[1];
|
|
17
|
+
}
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
function getMainAxisFromPlacement(placement) {
|
|
20
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
|
|
21
|
+
}
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
function getLengthFromAxis(axis) {
|
|
24
|
+
return axis === 'y' ? 'height' : 'width';
|
|
25
|
+
}
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
28
|
+
let {
|
|
29
|
+
reference,
|
|
30
|
+
floating
|
|
31
|
+
} = _ref;
|
|
32
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
33
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
34
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
|
35
|
+
const length = getLengthFromAxis(mainAxis);
|
|
36
|
+
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
|
37
|
+
const side = getSide(placement);
|
|
38
|
+
const isVertical = mainAxis === 'x';
|
|
39
|
+
let coords;
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
exports.Fragment = 0xeacb;
|
|
39
|
-
var REACT_STRICT_MODE_TYPE = 0xeacc;
|
|
40
|
-
var REACT_PROFILER_TYPE = 0xead2;
|
|
41
|
-
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
42
|
-
var REACT_CONTEXT_TYPE = 0xeace;
|
|
43
|
-
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
44
|
-
var REACT_SUSPENSE_TYPE = 0xead1;
|
|
45
|
-
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
46
|
-
var REACT_MEMO_TYPE = 0xead3;
|
|
47
|
-
var REACT_LAZY_TYPE = 0xead4;
|
|
48
|
-
var REACT_BLOCK_TYPE = 0xead9;
|
|
49
|
-
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
50
|
-
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
51
|
-
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
52
|
-
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
41
|
+
switch (side) {
|
|
42
|
+
case 'top':
|
|
43
|
+
coords = {
|
|
44
|
+
x: commonX,
|
|
45
|
+
y: reference.y - floating.height
|
|
46
|
+
};
|
|
47
|
+
break;
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
61
|
-
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
62
|
-
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
63
|
-
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
64
|
-
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
65
|
-
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
66
|
-
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
67
|
-
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
68
|
-
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
69
|
-
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
70
|
-
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
71
|
-
symbolFor('react.scope');
|
|
72
|
-
symbolFor('react.opaque.id');
|
|
73
|
-
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
74
|
-
symbolFor('react.offscreen');
|
|
75
|
-
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
76
|
-
}
|
|
49
|
+
case 'bottom':
|
|
50
|
+
coords = {
|
|
51
|
+
x: commonX,
|
|
52
|
+
y: reference.y + reference.height
|
|
53
|
+
};
|
|
54
|
+
break;
|
|
77
55
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
56
|
+
case 'right':
|
|
57
|
+
coords = {
|
|
58
|
+
x: reference.x + reference.width,
|
|
59
|
+
y: commonY
|
|
60
|
+
};
|
|
61
|
+
break;
|
|
84
62
|
|
|
85
|
-
|
|
63
|
+
case 'left':
|
|
64
|
+
coords = {
|
|
65
|
+
x: reference.x - floating.width,
|
|
66
|
+
y: commonY
|
|
67
|
+
};
|
|
68
|
+
break;
|
|
86
69
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
70
|
+
default:
|
|
71
|
+
coords = {
|
|
72
|
+
x: reference.x,
|
|
73
|
+
y: reference.y
|
|
74
|
+
};
|
|
75
|
+
}
|
|
90
76
|
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
switch (getAlignment(placement)) {
|
|
78
|
+
case 'start':
|
|
79
|
+
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
80
|
+
break;
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
case 'end':
|
|
83
|
+
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
95
86
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
99
|
-
args[_key2 - 1] = arguments[_key2];
|
|
100
|
-
}
|
|
87
|
+
return coords;
|
|
88
|
+
}
|
|
101
89
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
92
|
+
* next to a reference element when it is given a certain positioning strategy.
|
|
93
|
+
*
|
|
94
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
95
|
+
* write one for the platform you are using Floating UI with.
|
|
96
|
+
*/
|
|
105
97
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
98
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
99
|
+
const {
|
|
100
|
+
placement = 'bottom',
|
|
101
|
+
strategy = 'absolute',
|
|
102
|
+
middleware = [],
|
|
103
|
+
platform
|
|
104
|
+
} = config;
|
|
105
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
106
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
112
107
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
108
|
+
{
|
|
109
|
+
if (platform == null) {
|
|
110
|
+
console.error(['Floating UI: `platform` property was not passed to config. If you', 'want to use Floating UI on the web, install @floating-ui/dom', 'instead of the /core package. Otherwise, you can create your own', '`platform`: https://floating-ui.com/docs/platform'].join(' '));
|
|
111
|
+
}
|
|
118
112
|
|
|
119
|
-
|
|
113
|
+
if (validMiddleware.filter(_ref => {
|
|
114
|
+
let {
|
|
115
|
+
name
|
|
116
|
+
} = _ref;
|
|
117
|
+
return name === 'autoPlacement' || name === 'flip';
|
|
118
|
+
}).length > 1) {
|
|
119
|
+
throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement` middleware', 'detected. This will lead to an infinite loop. Ensure only one of', 'either has been passed to the `middleware` array.'].join(' '));
|
|
120
|
+
}
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
if (!reference || !floating) {
|
|
123
|
+
console.error(['Floating UI: The reference and/or floating element was not defined', 'when `computePosition()` was called. Ensure that both elements have', 'been created and can be measured.'].join(' '));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
let rects = await platform.getElementRects({
|
|
128
|
+
reference,
|
|
129
|
+
floating,
|
|
130
|
+
strategy
|
|
131
|
+
});
|
|
132
|
+
let {
|
|
133
|
+
x,
|
|
134
|
+
y
|
|
135
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
136
|
+
let statefulPlacement = placement;
|
|
137
|
+
let middlewareData = {};
|
|
138
|
+
let resetCount = 0;
|
|
129
139
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
141
|
+
const {
|
|
142
|
+
name,
|
|
143
|
+
fn
|
|
144
|
+
} = validMiddleware[i];
|
|
145
|
+
const {
|
|
146
|
+
x: nextX,
|
|
147
|
+
y: nextY,
|
|
148
|
+
data,
|
|
149
|
+
reset
|
|
150
|
+
} = await fn({
|
|
151
|
+
x,
|
|
152
|
+
y,
|
|
153
|
+
initialPlacement: placement,
|
|
154
|
+
placement: statefulPlacement,
|
|
155
|
+
strategy,
|
|
156
|
+
middlewareData,
|
|
157
|
+
rects,
|
|
158
|
+
platform,
|
|
159
|
+
elements: {
|
|
160
|
+
reference,
|
|
161
|
+
floating
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
x = nextX != null ? nextX : x;
|
|
165
|
+
y = nextY != null ? nextY : y;
|
|
166
|
+
middlewareData = { ...middlewareData,
|
|
167
|
+
[name]: { ...middlewareData[name],
|
|
168
|
+
...data
|
|
169
|
+
}
|
|
170
|
+
};
|
|
133
171
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
172
|
+
{
|
|
173
|
+
if (resetCount > 50) {
|
|
174
|
+
console.warn(['Floating UI: The middleware lifecycle appears to be running in an', 'infinite loop. This is usually caused by a `reset` continually', 'being returned without a break condition.'].join(' '));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
137
177
|
|
|
138
|
-
|
|
178
|
+
if (reset && resetCount <= 50) {
|
|
179
|
+
resetCount++;
|
|
139
180
|
|
|
140
|
-
|
|
181
|
+
if (typeof reset === 'object') {
|
|
182
|
+
if (reset.placement) {
|
|
183
|
+
statefulPlacement = reset.placement;
|
|
184
|
+
}
|
|
141
185
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
186
|
+
if (reset.rects) {
|
|
187
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
188
|
+
reference,
|
|
189
|
+
floating,
|
|
190
|
+
strategy
|
|
191
|
+
}) : reset.rects;
|
|
192
|
+
}
|
|
146
193
|
|
|
194
|
+
({
|
|
195
|
+
x,
|
|
196
|
+
y
|
|
197
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
198
|
+
}
|
|
147
199
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
200
|
+
i = -1;
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
151
204
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
205
|
+
return {
|
|
206
|
+
x,
|
|
207
|
+
y,
|
|
208
|
+
placement: statefulPlacement,
|
|
209
|
+
strategy,
|
|
210
|
+
middlewareData
|
|
211
|
+
};
|
|
212
|
+
};
|
|
157
213
|
|
|
158
|
-
|
|
159
|
-
|
|
214
|
+
function expandPaddingObject(padding) {
|
|
215
|
+
return {
|
|
216
|
+
top: 0,
|
|
217
|
+
right: 0,
|
|
218
|
+
bottom: 0,
|
|
219
|
+
left: 0,
|
|
220
|
+
...padding
|
|
221
|
+
};
|
|
222
|
+
}
|
|
160
223
|
|
|
224
|
+
function getSideObjectFromPadding(padding) {
|
|
225
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
226
|
+
top: padding,
|
|
227
|
+
right: padding,
|
|
228
|
+
bottom: padding,
|
|
229
|
+
left: padding
|
|
230
|
+
};
|
|
231
|
+
}
|
|
161
232
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
233
|
+
function rectToClientRect(rect) {
|
|
234
|
+
return { ...rect,
|
|
235
|
+
top: rect.y,
|
|
236
|
+
left: rect.x,
|
|
237
|
+
right: rect.x + rect.width,
|
|
238
|
+
bottom: rect.y + rect.height
|
|
239
|
+
};
|
|
240
|
+
}
|
|
165
241
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
242
|
+
/**
|
|
243
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
244
|
+
* element is overflowing a given clipping boundary.
|
|
245
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
246
|
+
* - negative = how many pixels left before it will overflow
|
|
247
|
+
* - 0 = lies flush with the boundary
|
|
248
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
249
|
+
*/
|
|
250
|
+
async function detectOverflow(middlewareArguments, options) {
|
|
251
|
+
var _await$platform$isEle;
|
|
169
252
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (/^index\./.test(fileName)) {
|
|
174
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
253
|
+
if (options === void 0) {
|
|
254
|
+
options = {};
|
|
255
|
+
}
|
|
175
256
|
|
|
176
|
-
|
|
177
|
-
|
|
257
|
+
const {
|
|
258
|
+
x,
|
|
259
|
+
y,
|
|
260
|
+
platform,
|
|
261
|
+
rects,
|
|
262
|
+
elements,
|
|
263
|
+
strategy
|
|
264
|
+
} = middlewareArguments;
|
|
265
|
+
const {
|
|
266
|
+
boundary = 'clippingAncestors',
|
|
267
|
+
rootBoundary = 'viewport',
|
|
268
|
+
elementContext = 'floating',
|
|
269
|
+
altBoundary = false,
|
|
270
|
+
padding = 0
|
|
271
|
+
} = options;
|
|
272
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
273
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
274
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
275
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
276
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
277
|
+
boundary,
|
|
278
|
+
rootBoundary,
|
|
279
|
+
strategy
|
|
280
|
+
}));
|
|
281
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
282
|
+
rect: elementContext === 'floating' ? { ...rects.floating,
|
|
283
|
+
x,
|
|
284
|
+
y
|
|
285
|
+
} : rects.reference,
|
|
286
|
+
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
287
|
+
strategy
|
|
288
|
+
}) : rects[elementContext]);
|
|
289
|
+
return {
|
|
290
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
291
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
292
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
293
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
294
|
+
};
|
|
295
|
+
}
|
|
178
296
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
fileName = folderName + '/' + fileName;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
297
|
+
const min$1 = Math.min;
|
|
298
|
+
const max$1 = Math.max;
|
|
186
299
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
300
|
+
function within(min$1$1, value, max$1$1) {
|
|
301
|
+
return max$1(min$1$1, min$1(value, max$1$1));
|
|
302
|
+
}
|
|
191
303
|
|
|
192
|
-
|
|
193
|
-
|
|
304
|
+
/**
|
|
305
|
+
* Positions an inner element of the floating element such that it is centered
|
|
306
|
+
* to the reference element.
|
|
307
|
+
* @see https://floating-ui.com/docs/arrow
|
|
308
|
+
*/
|
|
309
|
+
const arrow = options => ({
|
|
310
|
+
name: 'arrow',
|
|
311
|
+
options,
|
|
194
312
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
313
|
+
async fn(middlewareArguments) {
|
|
314
|
+
// Since `element` is required, we don't Partial<> the type
|
|
315
|
+
const {
|
|
316
|
+
element,
|
|
317
|
+
padding = 0
|
|
318
|
+
} = options != null ? options : {};
|
|
319
|
+
const {
|
|
320
|
+
x,
|
|
321
|
+
y,
|
|
322
|
+
placement,
|
|
323
|
+
rects,
|
|
324
|
+
platform
|
|
325
|
+
} = middlewareArguments;
|
|
199
326
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
327
|
+
if (element == null) {
|
|
328
|
+
{
|
|
329
|
+
console.warn('Floating UI: No `element` was passed to the `arrow` middleware.');
|
|
330
|
+
}
|
|
204
331
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
// Host root, text node or just invalid type.
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
332
|
+
return {};
|
|
333
|
+
}
|
|
210
334
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
335
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
336
|
+
const coords = {
|
|
337
|
+
x,
|
|
338
|
+
y
|
|
339
|
+
};
|
|
340
|
+
const axis = getMainAxisFromPlacement(placement);
|
|
341
|
+
const alignment = getAlignment(placement);
|
|
342
|
+
const length = getLengthFromAxis(axis);
|
|
343
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
344
|
+
const minProp = axis === 'y' ? 'top' : 'left';
|
|
345
|
+
const maxProp = axis === 'y' ? 'bottom' : 'right';
|
|
346
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
347
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
348
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
349
|
+
let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
216
350
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
351
|
+
if (clientSize === 0) {
|
|
352
|
+
clientSize = rects.floating[length];
|
|
353
|
+
}
|
|
220
354
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
355
|
+
const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
|
|
356
|
+
// point is outside the floating element's bounds
|
|
224
357
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
358
|
+
const min = paddingObject[minProp];
|
|
359
|
+
const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
360
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
361
|
+
const offset = within(min, center, max); // Make sure that arrow points at the reference
|
|
228
362
|
|
|
229
|
-
|
|
230
|
-
|
|
363
|
+
const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
|
|
364
|
+
const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
|
|
365
|
+
const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
|
|
366
|
+
return {
|
|
367
|
+
[axis]: coords[axis] - alignmentOffset,
|
|
368
|
+
data: {
|
|
369
|
+
[axis]: offset,
|
|
370
|
+
centerOffset: center - offset
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
}
|
|
231
374
|
|
|
232
|
-
|
|
233
|
-
return "Profiler";
|
|
375
|
+
});
|
|
234
376
|
|
|
235
|
-
|
|
236
|
-
|
|
377
|
+
const hash$1 = {
|
|
378
|
+
left: 'right',
|
|
379
|
+
right: 'left',
|
|
380
|
+
bottom: 'top',
|
|
381
|
+
top: 'bottom'
|
|
382
|
+
};
|
|
383
|
+
function getOppositePlacement(placement) {
|
|
384
|
+
return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
|
|
385
|
+
}
|
|
237
386
|
|
|
238
|
-
|
|
239
|
-
|
|
387
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
388
|
+
if (rtl === void 0) {
|
|
389
|
+
rtl = false;
|
|
390
|
+
}
|
|
240
391
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
392
|
+
const alignment = getAlignment(placement);
|
|
393
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
|
394
|
+
const length = getLengthFromAxis(mainAxis);
|
|
395
|
+
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
244
396
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return 'Context.Consumer';
|
|
397
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
398
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
399
|
+
}
|
|
249
400
|
|
|
250
|
-
|
|
251
|
-
|
|
401
|
+
return {
|
|
402
|
+
main: mainAlignmentSide,
|
|
403
|
+
cross: getOppositePlacement(mainAlignmentSide)
|
|
404
|
+
};
|
|
405
|
+
}
|
|
252
406
|
|
|
253
|
-
|
|
254
|
-
|
|
407
|
+
const hash = {
|
|
408
|
+
start: 'end',
|
|
409
|
+
end: 'start'
|
|
410
|
+
};
|
|
411
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
412
|
+
return placement.replace(/start|end/g, matched => hash[matched]);
|
|
413
|
+
}
|
|
255
414
|
|
|
256
|
-
|
|
257
|
-
|
|
415
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
416
|
+
const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
|
|
258
417
|
|
|
259
|
-
|
|
260
|
-
|
|
418
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
419
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
420
|
+
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
421
|
+
if (alignment) {
|
|
422
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
423
|
+
}
|
|
261
424
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
425
|
+
return true;
|
|
426
|
+
});
|
|
427
|
+
}
|
|
266
428
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
429
|
+
/**
|
|
430
|
+
* Automatically chooses the `placement` which has the most space available.
|
|
431
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
432
|
+
*/
|
|
433
|
+
const autoPlacement = function (options) {
|
|
434
|
+
if (options === void 0) {
|
|
435
|
+
options = {};
|
|
436
|
+
}
|
|
270
437
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
438
|
+
return {
|
|
439
|
+
name: 'autoPlacement',
|
|
440
|
+
options,
|
|
275
441
|
|
|
276
|
-
|
|
277
|
-
|
|
442
|
+
async fn(middlewareArguments) {
|
|
443
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _middlewareData$autoP3, _middlewareData$autoP4, _placementsSortedByLe;
|
|
278
444
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
445
|
+
const {
|
|
446
|
+
x,
|
|
447
|
+
y,
|
|
448
|
+
rects,
|
|
449
|
+
middlewareData,
|
|
450
|
+
placement,
|
|
451
|
+
platform,
|
|
452
|
+
elements
|
|
453
|
+
} = middlewareArguments;
|
|
454
|
+
const {
|
|
455
|
+
alignment = null,
|
|
456
|
+
allowedPlacements = allPlacements,
|
|
457
|
+
autoAlignment = true,
|
|
458
|
+
...detectOverflowOptions
|
|
459
|
+
} = options;
|
|
460
|
+
const placements = getPlacementList(alignment, autoAlignment, allowedPlacements);
|
|
461
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
462
|
+
const currentIndex = (_middlewareData$autoP = (_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.index) != null ? _middlewareData$autoP : 0;
|
|
463
|
+
const currentPlacement = placements[currentIndex];
|
|
282
464
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
}
|
|
465
|
+
if (currentPlacement == null) {
|
|
466
|
+
return {};
|
|
467
|
+
}
|
|
288
468
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
469
|
+
const {
|
|
470
|
+
main,
|
|
471
|
+
cross
|
|
472
|
+
} = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place
|
|
293
473
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
474
|
+
if (placement !== currentPlacement) {
|
|
475
|
+
return {
|
|
476
|
+
x,
|
|
477
|
+
y,
|
|
478
|
+
reset: {
|
|
479
|
+
placement: placements[0]
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
299
483
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
throw err;
|
|
307
|
-
}
|
|
484
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];
|
|
485
|
+
const allOverflows = [...((_middlewareData$autoP3 = (_middlewareData$autoP4 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP4.overflows) != null ? _middlewareData$autoP3 : []), {
|
|
486
|
+
placement: currentPlacement,
|
|
487
|
+
overflows: currentOverflows
|
|
488
|
+
}];
|
|
489
|
+
const nextPlacement = placements[currentIndex + 1]; // There are more placements to check
|
|
308
490
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
491
|
+
if (nextPlacement) {
|
|
492
|
+
return {
|
|
493
|
+
data: {
|
|
494
|
+
index: currentIndex + 1,
|
|
495
|
+
overflows: allOverflows
|
|
496
|
+
},
|
|
497
|
+
reset: {
|
|
498
|
+
placement: nextPlacement
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
}
|
|
313
502
|
|
|
314
|
-
|
|
315
|
-
|
|
503
|
+
const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);
|
|
504
|
+
const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find(_ref => {
|
|
505
|
+
let {
|
|
506
|
+
overflows
|
|
507
|
+
} = _ref;
|
|
508
|
+
return overflows.every(overflow => overflow <= 0);
|
|
509
|
+
})) == null ? void 0 : _placementsSortedByLe.placement;
|
|
510
|
+
const resetPlacement = placementThatFitsOnAllSides != null ? placementThatFitsOnAllSides : placementsSortedByLeastOverflow[0].placement;
|
|
316
511
|
|
|
317
|
-
|
|
512
|
+
if (resetPlacement !== placement) {
|
|
513
|
+
return {
|
|
514
|
+
data: {
|
|
515
|
+
index: currentIndex + 1,
|
|
516
|
+
overflows: allOverflows
|
|
517
|
+
},
|
|
518
|
+
reset: {
|
|
519
|
+
placement: resetPlacement
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
318
523
|
|
|
319
|
-
|
|
320
|
-
|
|
524
|
+
return {};
|
|
525
|
+
}
|
|
321
526
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
// same error.
|
|
325
|
-
loggedTypeFailures[error$1.message] = true;
|
|
326
|
-
setCurrentlyValidatingElement(element);
|
|
527
|
+
};
|
|
528
|
+
};
|
|
327
529
|
|
|
328
|
-
|
|
530
|
+
function getExpandedPlacements(placement) {
|
|
531
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
532
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
533
|
+
}
|
|
329
534
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
535
|
+
/**
|
|
536
|
+
* Changes the placement of the floating element to one that will fit if the
|
|
537
|
+
* initially specified `placement` does not.
|
|
538
|
+
* @see https://floating-ui.com/docs/flip
|
|
539
|
+
*/
|
|
540
|
+
const flip = function (options) {
|
|
541
|
+
if (options === void 0) {
|
|
542
|
+
options = {};
|
|
543
|
+
}
|
|
336
544
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
key: true,
|
|
341
|
-
ref: true,
|
|
342
|
-
__self: true,
|
|
343
|
-
__source: true
|
|
344
|
-
};
|
|
345
|
-
var specialPropKeyWarningShown;
|
|
346
|
-
var specialPropRefWarningShown;
|
|
347
|
-
var didWarnAboutStringRefs;
|
|
545
|
+
return {
|
|
546
|
+
name: 'flip',
|
|
547
|
+
options,
|
|
348
548
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
549
|
+
async fn(middlewareArguments) {
|
|
550
|
+
var _middlewareData$flip;
|
|
352
551
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
552
|
+
const {
|
|
553
|
+
placement,
|
|
554
|
+
middlewareData,
|
|
555
|
+
rects,
|
|
556
|
+
initialPlacement,
|
|
557
|
+
platform,
|
|
558
|
+
elements
|
|
559
|
+
} = middlewareArguments;
|
|
560
|
+
const {
|
|
561
|
+
mainAxis: checkMainAxis = true,
|
|
562
|
+
crossAxis: checkCrossAxis = true,
|
|
563
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
564
|
+
fallbackStrategy = 'bestFit',
|
|
565
|
+
flipAlignment = true,
|
|
566
|
+
...detectOverflowOptions
|
|
567
|
+
} = options;
|
|
568
|
+
const side = getSide(placement);
|
|
569
|
+
const isBasePlacement = side === initialPlacement;
|
|
570
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
571
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
572
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
573
|
+
const overflows = [];
|
|
574
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
357
575
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
}
|
|
576
|
+
if (checkMainAxis) {
|
|
577
|
+
overflows.push(overflow[side]);
|
|
578
|
+
}
|
|
363
579
|
|
|
364
|
-
|
|
365
|
-
|
|
580
|
+
if (checkCrossAxis) {
|
|
581
|
+
const {
|
|
582
|
+
main,
|
|
583
|
+
cross
|
|
584
|
+
} = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
585
|
+
overflows.push(overflow[main], overflow[cross]);
|
|
586
|
+
}
|
|
366
587
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
588
|
+
overflowsData = [...overflowsData, {
|
|
589
|
+
placement,
|
|
590
|
+
overflows
|
|
591
|
+
}]; // One or more sides is overflowing
|
|
371
592
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
593
|
+
if (!overflows.every(side => side <= 0)) {
|
|
594
|
+
var _middlewareData$flip$, _middlewareData$flip2;
|
|
377
595
|
|
|
378
|
-
|
|
379
|
-
|
|
596
|
+
const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
|
|
597
|
+
const nextPlacement = placements[nextIndex];
|
|
380
598
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
599
|
+
if (nextPlacement) {
|
|
600
|
+
// Try next placement and re-run the lifecycle
|
|
601
|
+
return {
|
|
602
|
+
data: {
|
|
603
|
+
index: nextIndex,
|
|
604
|
+
overflows: overflowsData
|
|
605
|
+
},
|
|
606
|
+
reset: {
|
|
607
|
+
placement: nextPlacement
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
}
|
|
385
611
|
|
|
386
|
-
|
|
387
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
388
|
-
|
|
389
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
396
|
-
{
|
|
397
|
-
var warnAboutAccessingKey = function () {
|
|
398
|
-
if (!specialPropKeyWarningShown) {
|
|
399
|
-
specialPropKeyWarningShown = true;
|
|
400
|
-
|
|
401
|
-
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
406
|
-
Object.defineProperty(props, 'key', {
|
|
407
|
-
get: warnAboutAccessingKey,
|
|
408
|
-
configurable: true
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
414
|
-
{
|
|
415
|
-
var warnAboutAccessingRef = function () {
|
|
416
|
-
if (!specialPropRefWarningShown) {
|
|
417
|
-
specialPropRefWarningShown = true;
|
|
418
|
-
|
|
419
|
-
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
420
|
-
}
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
424
|
-
Object.defineProperty(props, 'ref', {
|
|
425
|
-
get: warnAboutAccessingRef,
|
|
426
|
-
configurable: true
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
432
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
433
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
434
|
-
* if something is a React Element.
|
|
435
|
-
*
|
|
436
|
-
* @param {*} type
|
|
437
|
-
* @param {*} props
|
|
438
|
-
* @param {*} key
|
|
439
|
-
* @param {string|object} ref
|
|
440
|
-
* @param {*} owner
|
|
441
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
442
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
443
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
444
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
445
|
-
* change in behavior.
|
|
446
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
447
|
-
* indicating filename, line number, and/or other information.
|
|
448
|
-
* @internal
|
|
449
|
-
*/
|
|
612
|
+
let resetPlacement = 'bottom';
|
|
450
613
|
|
|
614
|
+
switch (fallbackStrategy) {
|
|
615
|
+
case 'bestFit':
|
|
616
|
+
{
|
|
617
|
+
var _overflowsData$map$so;
|
|
451
618
|
|
|
452
|
-
|
|
453
|
-
var element = {
|
|
454
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
455
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
456
|
-
// Built-in properties that belong on the element
|
|
457
|
-
type: type,
|
|
458
|
-
key: key,
|
|
459
|
-
ref: ref,
|
|
460
|
-
props: props,
|
|
461
|
-
// Record the component responsible for creating this element.
|
|
462
|
-
_owner: owner
|
|
463
|
-
};
|
|
619
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
|
464
620
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
469
|
-
// commonly used development environments.
|
|
470
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
471
|
-
// the validation flag non-enumerable (where possible, which should
|
|
472
|
-
// include every environment we run tests in), so the test framework
|
|
473
|
-
// ignores it.
|
|
621
|
+
if (placement) {
|
|
622
|
+
resetPlacement = placement;
|
|
623
|
+
}
|
|
474
624
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
enumerable: false,
|
|
478
|
-
writable: true,
|
|
479
|
-
value: false
|
|
480
|
-
}); // self and source are DEV only properties.
|
|
625
|
+
break;
|
|
626
|
+
}
|
|
481
627
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
value: self
|
|
487
|
-
}); // Two elements created in two different places should be considered
|
|
488
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
628
|
+
case 'initialPlacement':
|
|
629
|
+
resetPlacement = initialPlacement;
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
489
632
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
633
|
+
if (placement !== resetPlacement) {
|
|
634
|
+
return {
|
|
635
|
+
reset: {
|
|
636
|
+
placement: resetPlacement
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
}
|
|
496
641
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
Object.freeze(element);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
642
|
+
return {};
|
|
643
|
+
}
|
|
502
644
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
507
|
-
* @param {*} type
|
|
508
|
-
* @param {object} props
|
|
509
|
-
* @param {string} key
|
|
510
|
-
*/
|
|
645
|
+
};
|
|
646
|
+
};
|
|
511
647
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
648
|
+
async function convertValueToCoords(middlewareArguments, value) {
|
|
649
|
+
const {
|
|
650
|
+
placement,
|
|
651
|
+
platform,
|
|
652
|
+
elements
|
|
653
|
+
} = middlewareArguments;
|
|
654
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
655
|
+
const side = getSide(placement);
|
|
656
|
+
const alignment = getAlignment(placement);
|
|
657
|
+
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
658
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
659
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
660
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
|
|
515
661
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
662
|
+
let {
|
|
663
|
+
mainAxis,
|
|
664
|
+
crossAxis,
|
|
665
|
+
alignmentAxis
|
|
666
|
+
} = typeof rawValue === 'number' ? {
|
|
667
|
+
mainAxis: rawValue,
|
|
668
|
+
crossAxis: 0,
|
|
669
|
+
alignmentAxis: null
|
|
670
|
+
} : {
|
|
671
|
+
mainAxis: 0,
|
|
672
|
+
crossAxis: 0,
|
|
673
|
+
alignmentAxis: null,
|
|
674
|
+
...rawValue
|
|
675
|
+
};
|
|
524
676
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
677
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
678
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
679
|
+
}
|
|
528
680
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
681
|
+
return isVertical ? {
|
|
682
|
+
x: crossAxis * crossAxisMulti,
|
|
683
|
+
y: mainAxis * mainAxisMulti
|
|
684
|
+
} : {
|
|
685
|
+
x: mainAxis * mainAxisMulti,
|
|
686
|
+
y: crossAxis * crossAxisMulti
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Displaces the floating element from its reference element.
|
|
691
|
+
* @see https://floating-ui.com/docs/offset
|
|
692
|
+
*/
|
|
532
693
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
694
|
+
const offset = function (value) {
|
|
695
|
+
if (value === void 0) {
|
|
696
|
+
value = 0;
|
|
697
|
+
}
|
|
537
698
|
|
|
699
|
+
return {
|
|
700
|
+
name: 'offset',
|
|
701
|
+
options: value,
|
|
538
702
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
703
|
+
async fn(middlewareArguments) {
|
|
704
|
+
const {
|
|
705
|
+
x,
|
|
706
|
+
y
|
|
707
|
+
} = middlewareArguments;
|
|
708
|
+
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
|
709
|
+
return {
|
|
710
|
+
x: x + diffCoords.x,
|
|
711
|
+
y: y + diffCoords.y,
|
|
712
|
+
data: diffCoords
|
|
713
|
+
};
|
|
714
|
+
}
|
|
544
715
|
|
|
716
|
+
};
|
|
717
|
+
};
|
|
545
718
|
|
|
546
|
-
|
|
547
|
-
|
|
719
|
+
function getCrossAxis(axis) {
|
|
720
|
+
return axis === 'x' ? 'y' : 'x';
|
|
721
|
+
}
|
|
548
722
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
723
|
+
/**
|
|
724
|
+
* Shifts the floating element in order to keep it in view when it will overflow
|
|
725
|
+
* a clipping boundary.
|
|
726
|
+
* @see https://floating-ui.com/docs/shift
|
|
727
|
+
*/
|
|
728
|
+
const shift = function (options) {
|
|
729
|
+
if (options === void 0) {
|
|
730
|
+
options = {};
|
|
731
|
+
}
|
|
555
732
|
|
|
556
|
-
|
|
557
|
-
|
|
733
|
+
return {
|
|
734
|
+
name: 'shift',
|
|
735
|
+
options,
|
|
558
736
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
737
|
+
async fn(middlewareArguments) {
|
|
738
|
+
const {
|
|
739
|
+
x,
|
|
740
|
+
y,
|
|
741
|
+
placement
|
|
742
|
+
} = middlewareArguments;
|
|
743
|
+
const {
|
|
744
|
+
mainAxis: checkMainAxis = true,
|
|
745
|
+
crossAxis: checkCrossAxis = false,
|
|
746
|
+
limiter = {
|
|
747
|
+
fn: _ref => {
|
|
748
|
+
let {
|
|
749
|
+
x,
|
|
750
|
+
y
|
|
751
|
+
} = _ref;
|
|
752
|
+
return {
|
|
753
|
+
x,
|
|
754
|
+
y
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
...detectOverflowOptions
|
|
759
|
+
} = options;
|
|
760
|
+
const coords = {
|
|
761
|
+
x,
|
|
762
|
+
y
|
|
763
|
+
};
|
|
764
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
765
|
+
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
766
|
+
const crossAxis = getCrossAxis(mainAxis);
|
|
767
|
+
let mainAxisCoord = coords[mainAxis];
|
|
768
|
+
let crossAxisCoord = coords[crossAxis];
|
|
567
769
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
770
|
+
if (checkMainAxis) {
|
|
771
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
772
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
773
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
774
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
775
|
+
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
776
|
+
}
|
|
571
777
|
|
|
572
|
-
|
|
573
|
-
|
|
778
|
+
if (checkCrossAxis) {
|
|
779
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
780
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
781
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
782
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
783
|
+
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
784
|
+
}
|
|
574
785
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
786
|
+
const limitedCoords = limiter.fn({ ...middlewareArguments,
|
|
787
|
+
[mainAxis]: mainAxisCoord,
|
|
788
|
+
[crossAxis]: crossAxisCoord
|
|
789
|
+
});
|
|
790
|
+
return { ...limitedCoords,
|
|
791
|
+
data: {
|
|
792
|
+
x: limitedCoords.x - x,
|
|
793
|
+
y: limitedCoords.y - y
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
578
797
|
|
|
579
|
-
|
|
798
|
+
};
|
|
799
|
+
};
|
|
580
800
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
801
|
+
/**
|
|
802
|
+
* Provides data to change the size of the floating element. For instance,
|
|
803
|
+
* prevent it from overflowing its clipping boundary or match the width of the
|
|
804
|
+
* reference element.
|
|
805
|
+
* @see https://floating-ui.com/docs/size
|
|
806
|
+
*/
|
|
807
|
+
const size = function (options) {
|
|
808
|
+
if (options === void 0) {
|
|
809
|
+
options = {};
|
|
810
|
+
}
|
|
591
811
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}
|
|
596
|
-
}
|
|
812
|
+
return {
|
|
813
|
+
name: 'size',
|
|
814
|
+
options,
|
|
597
815
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
816
|
+
async fn(middlewareArguments) {
|
|
817
|
+
const {
|
|
818
|
+
placement,
|
|
819
|
+
rects,
|
|
820
|
+
platform,
|
|
821
|
+
elements
|
|
822
|
+
} = middlewareArguments;
|
|
823
|
+
const {
|
|
824
|
+
apply = () => {},
|
|
825
|
+
...detectOverflowOptions
|
|
826
|
+
} = options;
|
|
827
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
828
|
+
const side = getSide(placement);
|
|
829
|
+
const alignment = getAlignment(placement);
|
|
830
|
+
let heightSide;
|
|
831
|
+
let widthSide;
|
|
832
|
+
|
|
833
|
+
if (side === 'top' || side === 'bottom') {
|
|
834
|
+
heightSide = side;
|
|
835
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
836
|
+
} else {
|
|
837
|
+
widthSide = side;
|
|
838
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
839
|
+
}
|
|
602
840
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
841
|
+
const xMin = max$1(overflow.left, 0);
|
|
842
|
+
const xMax = max$1(overflow.right, 0);
|
|
843
|
+
const yMin = max$1(overflow.top, 0);
|
|
844
|
+
const yMax = max$1(overflow.bottom, 0);
|
|
845
|
+
const dimensions = {
|
|
846
|
+
availableHeight: rects.floating.height - (['left', 'right'].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$1(overflow.top, overflow.bottom)) : overflow[heightSide]),
|
|
847
|
+
availableWidth: rects.floating.width - (['top', 'bottom'].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$1(overflow.left, overflow.right)) : overflow[widthSide])
|
|
848
|
+
};
|
|
849
|
+
await apply({ ...middlewareArguments,
|
|
850
|
+
...dimensions
|
|
851
|
+
});
|
|
852
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
607
853
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
854
|
+
if (rects.floating.width !== nextDimensions.width || rects.floating.height !== nextDimensions.height) {
|
|
855
|
+
return {
|
|
856
|
+
reset: {
|
|
857
|
+
rects: true
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
}
|
|
611
861
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
if (source !== undefined) {
|
|
615
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
616
|
-
var lineNumber = source.lineNumber;
|
|
617
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
618
|
-
}
|
|
862
|
+
return {};
|
|
863
|
+
}
|
|
619
864
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
625
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
626
|
-
* updates.
|
|
627
|
-
*/
|
|
865
|
+
};
|
|
866
|
+
};
|
|
628
867
|
|
|
868
|
+
/**
|
|
869
|
+
* Provides improved positioning for inline reference elements that can span
|
|
870
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
871
|
+
* @see https://floating-ui.com/docs/inline
|
|
872
|
+
*/
|
|
873
|
+
const inline = function (options) {
|
|
874
|
+
if (options === void 0) {
|
|
875
|
+
options = {};
|
|
876
|
+
}
|
|
629
877
|
|
|
630
|
-
|
|
878
|
+
return {
|
|
879
|
+
name: 'inline',
|
|
880
|
+
options,
|
|
631
881
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
var info = getDeclarationErrorAddendum();
|
|
882
|
+
async fn(middlewareArguments) {
|
|
883
|
+
var _await$platform$getCl;
|
|
635
884
|
|
|
636
|
-
|
|
637
|
-
|
|
885
|
+
const {
|
|
886
|
+
placement,
|
|
887
|
+
elements,
|
|
888
|
+
rects,
|
|
889
|
+
platform,
|
|
890
|
+
strategy
|
|
891
|
+
} = middlewareArguments; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
892
|
+
// ClientRect's bounds, despite the event listener being triggered. A
|
|
893
|
+
// padding of 2 seems to handle this issue.
|
|
638
894
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
895
|
+
const {
|
|
896
|
+
padding = 2,
|
|
897
|
+
x,
|
|
898
|
+
y
|
|
899
|
+
} = options;
|
|
900
|
+
const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
901
|
+
rect: rects.reference,
|
|
902
|
+
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
903
|
+
strategy
|
|
904
|
+
}) : rects.reference);
|
|
905
|
+
const clientRects = (_await$platform$getCl = await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) != null ? _await$platform$getCl : [];
|
|
906
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
907
|
+
|
|
908
|
+
function getBoundingClientRect() {
|
|
909
|
+
// There are two rects and they are disjoined
|
|
910
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
911
|
+
var _clientRects$find;
|
|
912
|
+
|
|
913
|
+
// Find the first rect in which the point is fully inside
|
|
914
|
+
return (_clientRects$find = clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom)) != null ? _clientRects$find : fallback;
|
|
915
|
+
} // There are 2 or more connected rects
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
if (clientRects.length >= 2) {
|
|
919
|
+
if (getMainAxisFromPlacement(placement) === 'x') {
|
|
920
|
+
const firstRect = clientRects[0];
|
|
921
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
922
|
+
const isTop = getSide(placement) === 'top';
|
|
923
|
+
const top = firstRect.top;
|
|
924
|
+
const bottom = lastRect.bottom;
|
|
925
|
+
const left = isTop ? firstRect.left : lastRect.left;
|
|
926
|
+
const right = isTop ? firstRect.right : lastRect.right;
|
|
927
|
+
const width = right - left;
|
|
928
|
+
const height = bottom - top;
|
|
929
|
+
return {
|
|
930
|
+
top,
|
|
931
|
+
bottom,
|
|
932
|
+
left,
|
|
933
|
+
right,
|
|
934
|
+
width,
|
|
935
|
+
height,
|
|
936
|
+
x: left,
|
|
937
|
+
y: top
|
|
938
|
+
};
|
|
939
|
+
}
|
|
643
940
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
941
|
+
const isLeftSide = getSide(placement) === 'left';
|
|
942
|
+
const maxRight = max$1(...clientRects.map(rect => rect.right));
|
|
943
|
+
const minLeft = min$1(...clientRects.map(rect => rect.left));
|
|
944
|
+
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
945
|
+
const top = measureRects[0].top;
|
|
946
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
947
|
+
const left = minLeft;
|
|
948
|
+
const right = maxRight;
|
|
949
|
+
const width = right - left;
|
|
950
|
+
const height = bottom - top;
|
|
951
|
+
return {
|
|
952
|
+
top,
|
|
953
|
+
bottom,
|
|
954
|
+
left,
|
|
955
|
+
right,
|
|
956
|
+
width,
|
|
957
|
+
height,
|
|
958
|
+
x: left,
|
|
959
|
+
y: top
|
|
960
|
+
};
|
|
961
|
+
}
|
|
658
962
|
|
|
963
|
+
return fallback;
|
|
964
|
+
}
|
|
659
965
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
966
|
+
const resetRects = await platform.getElementRects({
|
|
967
|
+
reference: {
|
|
968
|
+
getBoundingClientRect
|
|
969
|
+
},
|
|
970
|
+
floating: elements.floating,
|
|
971
|
+
strategy
|
|
972
|
+
});
|
|
665
973
|
|
|
666
|
-
|
|
667
|
-
|
|
974
|
+
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
975
|
+
return {
|
|
976
|
+
reset: {
|
|
977
|
+
rects: resetRects
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
}
|
|
668
981
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
982
|
+
return {};
|
|
983
|
+
}
|
|
672
984
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
// assigning it a key.
|
|
985
|
+
};
|
|
986
|
+
};
|
|
676
987
|
|
|
677
|
-
|
|
988
|
+
function isWindow(value) {
|
|
989
|
+
return value && value.document && value.location && value.alert && value.setInterval;
|
|
990
|
+
}
|
|
991
|
+
function getWindow(node) {
|
|
992
|
+
if (node == null) {
|
|
993
|
+
return window;
|
|
994
|
+
}
|
|
678
995
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
996
|
+
if (!isWindow(node)) {
|
|
997
|
+
const ownerDocument = node.ownerDocument;
|
|
998
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
999
|
+
}
|
|
683
1000
|
|
|
684
|
-
|
|
1001
|
+
return node;
|
|
1002
|
+
}
|
|
685
1003
|
|
|
686
|
-
|
|
1004
|
+
function getComputedStyle(element) {
|
|
1005
|
+
return getWindow(element).getComputedStyle(element);
|
|
1006
|
+
}
|
|
687
1007
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
* Ensure that every element either is passed in a static location, in an
|
|
693
|
-
* array with an explicit keys property defined, or in an object literal
|
|
694
|
-
* with valid key property.
|
|
695
|
-
*
|
|
696
|
-
* @internal
|
|
697
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
698
|
-
* @param {*} parentType node's parent's type.
|
|
699
|
-
*/
|
|
1008
|
+
function getNodeName(node) {
|
|
1009
|
+
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
|
|
1010
|
+
}
|
|
700
1011
|
|
|
1012
|
+
function getUAString() {
|
|
1013
|
+
const uaData = navigator.userAgentData;
|
|
701
1014
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
return;
|
|
706
|
-
}
|
|
1015
|
+
if (uaData != null && uaData.brands) {
|
|
1016
|
+
return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
1017
|
+
}
|
|
707
1018
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
var child = node[i];
|
|
1019
|
+
return navigator.userAgent;
|
|
1020
|
+
}
|
|
711
1021
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
1022
|
+
function isHTMLElement(value) {
|
|
1023
|
+
return value instanceof getWindow(value).HTMLElement;
|
|
1024
|
+
}
|
|
1025
|
+
function isElement(value) {
|
|
1026
|
+
return value instanceof getWindow(value).Element;
|
|
1027
|
+
}
|
|
1028
|
+
function isNode(value) {
|
|
1029
|
+
return value instanceof getWindow(value).Node;
|
|
1030
|
+
}
|
|
1031
|
+
function isShadowRoot(node) {
|
|
1032
|
+
// Browsers without `ShadowRoot` support
|
|
1033
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
1034
|
+
return false;
|
|
1035
|
+
}
|
|
723
1036
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
1037
|
+
const OwnElement = getWindow(node).ShadowRoot;
|
|
1038
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
1039
|
+
}
|
|
1040
|
+
function isOverflowElement(element) {
|
|
1041
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
1042
|
+
const {
|
|
1043
|
+
overflow,
|
|
1044
|
+
overflowX,
|
|
1045
|
+
overflowY,
|
|
1046
|
+
display
|
|
1047
|
+
} = getComputedStyle(element);
|
|
1048
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
1049
|
+
}
|
|
1050
|
+
function isTableElement(element) {
|
|
1051
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1052
|
+
}
|
|
1053
|
+
function isContainingBlock(element) {
|
|
1054
|
+
// TODO: Try and use feature detection here instead
|
|
1055
|
+
const isFirefox = /firefox/i.test(getUAString());
|
|
1056
|
+
const css = getComputedStyle(element);
|
|
1057
|
+
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter; // This is non-exhaustive but covers the most common CSS properties that
|
|
1058
|
+
// create a containing block.
|
|
1059
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
730
1060
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
1061
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some( // TS 4.1 compat
|
|
1062
|
+
value => {
|
|
1063
|
+
const contain = css.contain;
|
|
1064
|
+
return contain != null ? contain.includes(value) : false;
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
function isLayoutViewport() {
|
|
1068
|
+
// Not Safari
|
|
1069
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
|
|
1070
|
+
// • Always-visible scrollbar or not
|
|
1071
|
+
// • Width of <html>, etc.
|
|
1072
|
+
// const vV = win.visualViewport;
|
|
1073
|
+
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
1074
|
+
}
|
|
1075
|
+
function isLastTraversableNode(node) {
|
|
1076
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
1077
|
+
}
|
|
747
1078
|
|
|
1079
|
+
const min = Math.min;
|
|
1080
|
+
const max = Math.max;
|
|
1081
|
+
const round = Math.round;
|
|
748
1082
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
var type = element.type;
|
|
1083
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
1084
|
+
var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
|
|
752
1085
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
1086
|
+
if (includeScale === void 0) {
|
|
1087
|
+
includeScale = false;
|
|
1088
|
+
}
|
|
756
1089
|
|
|
757
|
-
|
|
1090
|
+
if (isFixedStrategy === void 0) {
|
|
1091
|
+
isFixedStrategy = false;
|
|
1092
|
+
}
|
|
758
1093
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
// Inner props are checked in the reconciler.
|
|
763
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
764
|
-
propTypes = type.propTypes;
|
|
765
|
-
} else {
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
1094
|
+
const clientRect = element.getBoundingClientRect();
|
|
1095
|
+
let scaleX = 1;
|
|
1096
|
+
let scaleY = 1;
|
|
768
1097
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
774
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1098
|
+
if (includeScale && isHTMLElement(element)) {
|
|
1099
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
1100
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
1101
|
+
}
|
|
775
1102
|
|
|
776
|
-
|
|
1103
|
+
const win = isElement(element) ? getWindow(element) : window;
|
|
1104
|
+
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
1105
|
+
const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
|
|
1106
|
+
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
|
1107
|
+
const width = clientRect.width / scaleX;
|
|
1108
|
+
const height = clientRect.height / scaleY;
|
|
1109
|
+
return {
|
|
1110
|
+
width,
|
|
1111
|
+
height,
|
|
1112
|
+
top: y,
|
|
1113
|
+
right: x + width,
|
|
1114
|
+
bottom: y + height,
|
|
1115
|
+
left: x,
|
|
1116
|
+
x,
|
|
1117
|
+
y
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
777
1120
|
|
|
778
|
-
|
|
779
|
-
|
|
1121
|
+
function getDocumentElement(node) {
|
|
1122
|
+
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
|
1123
|
+
}
|
|
780
1124
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
* @param {ReactElement} fragment
|
|
789
|
-
*/
|
|
1125
|
+
function getNodeScroll(element) {
|
|
1126
|
+
if (isElement(element)) {
|
|
1127
|
+
return {
|
|
1128
|
+
scrollLeft: element.scrollLeft,
|
|
1129
|
+
scrollTop: element.scrollTop
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
790
1132
|
|
|
1133
|
+
return {
|
|
1134
|
+
scrollLeft: element.pageXOffset,
|
|
1135
|
+
scrollTop: element.pageYOffset
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
791
1138
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
1139
|
+
function getWindowScrollBarX(element) {
|
|
1140
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1141
|
+
// incorrect for RTL.
|
|
1142
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1143
|
+
}
|
|
795
1144
|
|
|
796
|
-
|
|
797
|
-
|
|
1145
|
+
function isScaled(element) {
|
|
1146
|
+
const rect = getBoundingClientRect(element);
|
|
1147
|
+
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
1148
|
+
}
|
|
798
1149
|
|
|
799
|
-
|
|
800
|
-
|
|
1150
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1151
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1152
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1153
|
+
const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
|
|
1154
|
+
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
1155
|
+
let scroll = {
|
|
1156
|
+
scrollLeft: 0,
|
|
1157
|
+
scrollTop: 0
|
|
1158
|
+
};
|
|
1159
|
+
const offsets = {
|
|
1160
|
+
x: 0,
|
|
1161
|
+
y: 0
|
|
1162
|
+
};
|
|
801
1163
|
|
|
802
|
-
|
|
1164
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1165
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1166
|
+
scroll = getNodeScroll(offsetParent);
|
|
1167
|
+
}
|
|
803
1168
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1169
|
+
if (isHTMLElement(offsetParent)) {
|
|
1170
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1171
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1172
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1173
|
+
} else if (documentElement) {
|
|
1174
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
808
1177
|
|
|
809
|
-
|
|
810
|
-
|
|
1178
|
+
return {
|
|
1179
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1180
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1181
|
+
width: rect.width,
|
|
1182
|
+
height: rect.height
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
811
1185
|
|
|
812
|
-
|
|
1186
|
+
function getParentNode(node) {
|
|
1187
|
+
if (getNodeName(node) === 'html') {
|
|
1188
|
+
return node;
|
|
1189
|
+
}
|
|
813
1190
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
1191
|
+
const result = // Step into the shadow DOM of the parent of a slotted node
|
|
1192
|
+
node.assignedSlot || // DOM Element detected
|
|
1193
|
+
node.parentNode || ( // ShadowRoot detected
|
|
1194
|
+
isShadowRoot(node) ? node.host : null) || // Fallback
|
|
1195
|
+
getDocumentElement(node);
|
|
1196
|
+
return isShadowRoot(result) ? result.host : result;
|
|
1197
|
+
}
|
|
818
1198
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
1199
|
+
function getTrueOffsetParent(element) {
|
|
1200
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1201
|
+
return null;
|
|
1202
|
+
}
|
|
823
1203
|
|
|
824
|
-
|
|
825
|
-
|
|
1204
|
+
return element.offsetParent;
|
|
1205
|
+
}
|
|
826
1206
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
}
|
|
1207
|
+
function getContainingBlock(element) {
|
|
1208
|
+
let currentNode = getParentNode(element);
|
|
830
1209
|
|
|
831
|
-
|
|
1210
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1211
|
+
if (isContainingBlock(currentNode)) {
|
|
1212
|
+
return currentNode;
|
|
1213
|
+
} else {
|
|
1214
|
+
currentNode = getParentNode(currentNode);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
832
1217
|
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
info += getDeclarationErrorAddendum();
|
|
837
|
-
}
|
|
1218
|
+
return null;
|
|
1219
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1220
|
+
// such as table ancestors and cross browser bugs.
|
|
838
1221
|
|
|
839
|
-
var typeString;
|
|
840
1222
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
typeString = 'array';
|
|
845
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
846
|
-
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
847
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
848
|
-
} else {
|
|
849
|
-
typeString = typeof type;
|
|
850
|
-
}
|
|
1223
|
+
function getOffsetParent(element) {
|
|
1224
|
+
const window = getWindow(element);
|
|
1225
|
+
let offsetParent = getTrueOffsetParent(element);
|
|
851
1226
|
|
|
852
|
-
|
|
853
|
-
|
|
1227
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1228
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1229
|
+
}
|
|
854
1230
|
|
|
855
|
-
|
|
856
|
-
|
|
1231
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1232
|
+
return window;
|
|
1233
|
+
}
|
|
857
1234
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
861
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
862
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
863
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
864
|
-
// fixed, the key warnings will appear.)
|
|
1235
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
1236
|
+
}
|
|
865
1237
|
|
|
1238
|
+
function getDimensions(element) {
|
|
1239
|
+
if (isHTMLElement(element)) {
|
|
1240
|
+
return {
|
|
1241
|
+
width: element.offsetWidth,
|
|
1242
|
+
height: element.offsetHeight
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
866
1245
|
|
|
867
|
-
|
|
868
|
-
|
|
1246
|
+
const rect = getBoundingClientRect(element);
|
|
1247
|
+
return {
|
|
1248
|
+
width: rect.width,
|
|
1249
|
+
height: rect.height
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
869
1252
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
1253
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1254
|
+
let {
|
|
1255
|
+
rect,
|
|
1256
|
+
offsetParent,
|
|
1257
|
+
strategy
|
|
1258
|
+
} = _ref;
|
|
1259
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1260
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
876
1261
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
} else {
|
|
881
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
882
|
-
}
|
|
883
|
-
} else {
|
|
884
|
-
validateChildKeys(children, type);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
}
|
|
1262
|
+
if (offsetParent === documentElement) {
|
|
1263
|
+
return rect;
|
|
1264
|
+
}
|
|
888
1265
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
1266
|
+
let scroll = {
|
|
1267
|
+
scrollLeft: 0,
|
|
1268
|
+
scrollTop: 0
|
|
1269
|
+
};
|
|
1270
|
+
const offsets = {
|
|
1271
|
+
x: 0,
|
|
1272
|
+
y: 0
|
|
1273
|
+
};
|
|
894
1274
|
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
// opt-in behavior for better messages but that we won't stop
|
|
900
|
-
// giving you warnings if you use production apis.
|
|
1275
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1276
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1277
|
+
scroll = getNodeScroll(offsetParent);
|
|
1278
|
+
}
|
|
901
1279
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
}
|
|
1280
|
+
if (isHTMLElement(offsetParent)) {
|
|
1281
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1282
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1283
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1284
|
+
} // This doesn't appear to be need to be negated.
|
|
1285
|
+
// else if (documentElement) {
|
|
1286
|
+
// offsets.x = getWindowScrollBarX(documentElement);
|
|
1287
|
+
// }
|
|
912
1288
|
|
|
913
|
-
|
|
914
|
-
// for now we can ship identical prod functions
|
|
1289
|
+
}
|
|
915
1290
|
|
|
916
|
-
|
|
1291
|
+
return { ...rect,
|
|
1292
|
+
x: rect.x - scroll.scrollLeft + offsets.x,
|
|
1293
|
+
y: rect.y - scroll.scrollTop + offsets.y
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
917
1296
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1297
|
+
function getViewportRect(element, strategy) {
|
|
1298
|
+
const win = getWindow(element);
|
|
1299
|
+
const html = getDocumentElement(element);
|
|
1300
|
+
const visualViewport = win.visualViewport;
|
|
1301
|
+
let width = html.clientWidth;
|
|
1302
|
+
let height = html.clientHeight;
|
|
1303
|
+
let x = 0;
|
|
1304
|
+
let y = 0;
|
|
923
1305
|
|
|
924
|
-
|
|
1306
|
+
if (visualViewport) {
|
|
1307
|
+
width = visualViewport.width;
|
|
1308
|
+
height = visualViewport.height;
|
|
1309
|
+
const layoutViewport = isLayoutViewport();
|
|
925
1310
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
1311
|
+
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
1312
|
+
x = visualViewport.offsetLeft;
|
|
1313
|
+
y = visualViewport.offsetTop;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
930
1316
|
|
|
931
|
-
|
|
1317
|
+
return {
|
|
1318
|
+
width,
|
|
1319
|
+
height,
|
|
1320
|
+
x,
|
|
1321
|
+
y
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
932
1324
|
|
|
933
|
-
|
|
934
|
-
Copyright (c) 2018 Jed Watson.
|
|
935
|
-
Licensed under the MIT License (MIT), see
|
|
936
|
-
http://jedwatson.github.io/classnames
|
|
937
|
-
*/
|
|
1325
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
938
1326
|
|
|
939
|
-
|
|
940
|
-
|
|
1327
|
+
function getDocumentRect(element) {
|
|
1328
|
+
var _element$ownerDocumen;
|
|
941
1329
|
|
|
942
|
-
|
|
1330
|
+
const html = getDocumentElement(element);
|
|
1331
|
+
const scroll = getNodeScroll(element);
|
|
1332
|
+
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
1333
|
+
const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
1334
|
+
const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
1335
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1336
|
+
const y = -scroll.scrollTop;
|
|
943
1337
|
|
|
944
|
-
|
|
1338
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
1339
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1340
|
+
}
|
|
945
1341
|
|
|
946
|
-
|
|
947
|
-
|
|
1342
|
+
return {
|
|
1343
|
+
width,
|
|
1344
|
+
height,
|
|
1345
|
+
x,
|
|
1346
|
+
y
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
948
1349
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
if (!arg) continue;
|
|
1350
|
+
function getNearestOverflowAncestor(node) {
|
|
1351
|
+
const parentNode = getParentNode(node);
|
|
952
1352
|
|
|
953
|
-
|
|
1353
|
+
if (isLastTraversableNode(parentNode)) {
|
|
1354
|
+
// @ts-ignore assume body is always available
|
|
1355
|
+
return node.ownerDocument.body;
|
|
1356
|
+
}
|
|
954
1357
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
if (arg.length) {
|
|
959
|
-
var inner = classNames.apply(null, arg);
|
|
960
|
-
if (inner) {
|
|
961
|
-
classes.push(inner);
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
} else if (argType === 'object') {
|
|
965
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
966
|
-
classes.push(arg.toString());
|
|
967
|
-
continue;
|
|
968
|
-
}
|
|
1358
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1359
|
+
return parentNode;
|
|
1360
|
+
}
|
|
969
1361
|
|
|
970
|
-
|
|
971
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
972
|
-
classes.push(key);
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
return classes.join(' ');
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
if (module.exports) {
|
|
982
|
-
classNames.default = classNames;
|
|
983
|
-
module.exports = classNames;
|
|
984
|
-
} else {
|
|
985
|
-
window.classNames = classNames;
|
|
986
|
-
}
|
|
987
|
-
}());
|
|
988
|
-
} (classnames));
|
|
989
|
-
|
|
990
|
-
var classNames = classnames.exports;
|
|
991
|
-
|
|
992
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
993
|
-
/**
|
|
994
|
-
* This function debounce the received function
|
|
995
|
-
* @param { function } func Function to be debounced
|
|
996
|
-
* @param { number } wait Time to wait before execut the function
|
|
997
|
-
* @param { boolean } immediate Param to define if the function will be executed immediately
|
|
998
|
-
*/
|
|
999
|
-
const debounce = (func, wait, immediate) => {
|
|
1000
|
-
let timeout = null;
|
|
1001
|
-
return function debounced(...args) {
|
|
1002
|
-
const later = () => {
|
|
1003
|
-
timeout = null;
|
|
1004
|
-
if (!immediate) {
|
|
1005
|
-
func.apply(this, args);
|
|
1006
|
-
}
|
|
1007
|
-
};
|
|
1008
|
-
if (timeout) {
|
|
1009
|
-
clearTimeout(timeout);
|
|
1010
|
-
}
|
|
1011
|
-
timeout = setTimeout(later, wait);
|
|
1012
|
-
};
|
|
1013
|
-
};
|
|
1014
|
-
|
|
1015
|
-
const TooltipContent = ({ content }) => {
|
|
1016
|
-
return jsxRuntime.exports.jsx("span", { dangerouslySetInnerHTML: { __html: content } });
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
const DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID';
|
|
1020
|
-
const DEFAULT_CONTEXT_DATA = {
|
|
1021
|
-
anchorRefs: new Set(),
|
|
1022
|
-
activeAnchor: { current: null },
|
|
1023
|
-
attach: () => {
|
|
1024
|
-
/* attach anchor element */
|
|
1025
|
-
},
|
|
1026
|
-
detach: () => {
|
|
1027
|
-
/* detach anchor element */
|
|
1028
|
-
},
|
|
1029
|
-
setActiveAnchor: () => {
|
|
1030
|
-
/* set active anchor */
|
|
1031
|
-
},
|
|
1032
|
-
};
|
|
1033
|
-
const DEFAULT_CONTEXT_DATA_WRAPPER = {
|
|
1034
|
-
getTooltipData: () => DEFAULT_CONTEXT_DATA,
|
|
1035
|
-
};
|
|
1036
|
-
const TooltipContext = require$$0.createContext(DEFAULT_CONTEXT_DATA_WRAPPER);
|
|
1037
|
-
const TooltipProvider = ({ children }) => {
|
|
1038
|
-
const [anchorRefMap, setAnchorRefMap] = require$$0.useState({
|
|
1039
|
-
[DEFAULT_TOOLTIP_ID]: new Set(),
|
|
1040
|
-
});
|
|
1041
|
-
const [activeAnchorMap, setActiveAnchorMap] = require$$0.useState({
|
|
1042
|
-
[DEFAULT_TOOLTIP_ID]: { current: null },
|
|
1043
|
-
});
|
|
1044
|
-
const attach = (tooltipId, ...refs) => {
|
|
1045
|
-
setAnchorRefMap((oldMap) => {
|
|
1046
|
-
var _a;
|
|
1047
|
-
const tooltipRefs = (_a = oldMap[tooltipId]) !== null && _a !== void 0 ? _a : new Set();
|
|
1048
|
-
refs.forEach((ref) => tooltipRefs.add(ref));
|
|
1049
|
-
// create new object to trigger re-render
|
|
1050
|
-
return { ...oldMap, [tooltipId]: new Set(tooltipRefs) };
|
|
1051
|
-
});
|
|
1052
|
-
};
|
|
1053
|
-
const detach = (tooltipId, ...refs) => {
|
|
1054
|
-
setAnchorRefMap((oldMap) => {
|
|
1055
|
-
const tooltipRefs = oldMap[tooltipId];
|
|
1056
|
-
if (!tooltipRefs) {
|
|
1057
|
-
// tooltip not found
|
|
1058
|
-
// maybe thow error?
|
|
1059
|
-
return oldMap;
|
|
1060
|
-
}
|
|
1061
|
-
refs.forEach((ref) => tooltipRefs.delete(ref));
|
|
1062
|
-
// create new object to trigger re-render
|
|
1063
|
-
return { ...oldMap };
|
|
1064
|
-
});
|
|
1065
|
-
};
|
|
1066
|
-
const setActiveAnchor = (tooltipId, ref) => {
|
|
1067
|
-
setActiveAnchorMap((oldMap) => {
|
|
1068
|
-
var _a;
|
|
1069
|
-
if (((_a = oldMap[tooltipId]) === null || _a === void 0 ? void 0 : _a.current) === ref.current) {
|
|
1070
|
-
return oldMap;
|
|
1071
|
-
}
|
|
1072
|
-
// create new object to trigger re-render
|
|
1073
|
-
return { ...oldMap, [tooltipId]: ref };
|
|
1074
|
-
});
|
|
1075
|
-
};
|
|
1076
|
-
const getTooltipData = require$$0.useCallback((tooltipId = DEFAULT_TOOLTIP_ID) => {
|
|
1077
|
-
var _a, _b;
|
|
1078
|
-
return ({
|
|
1079
|
-
anchorRefs: (_a = anchorRefMap[tooltipId]) !== null && _a !== void 0 ? _a : new Set(),
|
|
1080
|
-
activeAnchor: (_b = activeAnchorMap[tooltipId]) !== null && _b !== void 0 ? _b : { current: null },
|
|
1081
|
-
attach: (...refs) => attach(tooltipId, ...refs),
|
|
1082
|
-
detach: (...refs) => detach(tooltipId, ...refs),
|
|
1083
|
-
setActiveAnchor: (ref) => setActiveAnchor(tooltipId, ref),
|
|
1084
|
-
});
|
|
1085
|
-
}, [anchorRefMap, activeAnchorMap, attach, detach]);
|
|
1086
|
-
const context = require$$0.useMemo(() => {
|
|
1087
|
-
return {
|
|
1088
|
-
getTooltipData,
|
|
1089
|
-
};
|
|
1090
|
-
}, [getTooltipData]);
|
|
1091
|
-
return jsxRuntime.exports.jsx(TooltipContext.Provider, { value: context, children: children });
|
|
1092
|
-
};
|
|
1093
|
-
function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {
|
|
1094
|
-
return require$$0.useContext(TooltipContext).getTooltipData(tooltipId);
|
|
1362
|
+
return getNearestOverflowAncestor(parentNode);
|
|
1095
1363
|
}
|
|
1096
1364
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
const anchorRef = require$$0.useRef(null);
|
|
1100
|
-
require$$0.useEffect(() => {
|
|
1101
|
-
attach(anchorRef);
|
|
1102
|
-
return () => {
|
|
1103
|
-
detach(anchorRef);
|
|
1104
|
-
};
|
|
1105
|
-
}, []);
|
|
1106
|
-
return (jsxRuntime.exports.jsx("span", { ref: anchorRef, className: classNames('react-tooltip-wrapper', className), "data-tooltip-place": place, "data-tooltip-content": content, "data-tooltip-html": html, "data-tooltip-variant": variant, "data-tooltip-offset": offset, "data-tooltip-wrapper": wrapper, "data-tooltip-events": events, "data-tooltip-position-strategy": positionStrategy, "data-tooltip-delay-show": delayShow, "data-tooltip-delay-hide": delayHide, children: children }));
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
function getSide(placement) {
|
|
1110
|
-
return placement.split('-')[0];
|
|
1111
|
-
}
|
|
1365
|
+
function getOverflowAncestors(node, list) {
|
|
1366
|
+
var _node$ownerDocument;
|
|
1112
1367
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1368
|
+
if (list === void 0) {
|
|
1369
|
+
list = [];
|
|
1370
|
+
}
|
|
1116
1371
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1372
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1373
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
1374
|
+
const win = getWindow(scrollableAncestor);
|
|
1375
|
+
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
1376
|
+
const updatedList = list.concat(target);
|
|
1377
|
+
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
|
1378
|
+
updatedList.concat(getOverflowAncestors(target));
|
|
1119
1379
|
}
|
|
1120
1380
|
|
|
1121
|
-
function
|
|
1122
|
-
|
|
1381
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1382
|
+
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
1383
|
+
const top = clientRect.top + element.clientTop;
|
|
1384
|
+
const left = clientRect.left + element.clientLeft;
|
|
1385
|
+
return {
|
|
1386
|
+
top,
|
|
1387
|
+
left,
|
|
1388
|
+
x: left,
|
|
1389
|
+
y: top,
|
|
1390
|
+
right: left + element.clientWidth,
|
|
1391
|
+
bottom: top + element.clientHeight,
|
|
1392
|
+
width: element.clientWidth,
|
|
1393
|
+
height: element.clientHeight
|
|
1394
|
+
};
|
|
1123
1395
|
}
|
|
1124
1396
|
|
|
1125
|
-
function
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
} = _ref;
|
|
1130
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
1131
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
1132
|
-
const mainAxis = getMainAxisFromPlacement(placement);
|
|
1133
|
-
const length = getLengthFromAxis(mainAxis);
|
|
1134
|
-
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
|
1135
|
-
const side = getSide(placement);
|
|
1136
|
-
const isVertical = mainAxis === 'x';
|
|
1137
|
-
let coords;
|
|
1397
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1398
|
+
if (clippingAncestor === 'viewport') {
|
|
1399
|
+
return rectToClientRect(getViewportRect(element, strategy));
|
|
1400
|
+
}
|
|
1138
1401
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
x: commonX,
|
|
1143
|
-
y: reference.y - floating.height
|
|
1144
|
-
};
|
|
1145
|
-
break;
|
|
1402
|
+
if (isElement(clippingAncestor)) {
|
|
1403
|
+
return getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1404
|
+
}
|
|
1146
1405
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
};
|
|
1152
|
-
break;
|
|
1406
|
+
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1407
|
+
} // A "clipping ancestor" is an overflowable container with the characteristic of
|
|
1408
|
+
// clipping (or hiding) overflowing elements with a position different from
|
|
1409
|
+
// `initial`
|
|
1153
1410
|
|
|
1154
|
-
case 'right':
|
|
1155
|
-
coords = {
|
|
1156
|
-
x: reference.x + reference.width,
|
|
1157
|
-
y: commonY
|
|
1158
|
-
};
|
|
1159
|
-
break;
|
|
1160
1411
|
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
};
|
|
1166
|
-
break;
|
|
1412
|
+
function getClippingElementAncestors(element) {
|
|
1413
|
+
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1414
|
+
let currentNode = element;
|
|
1415
|
+
let currentContainingBlockComputedStyle = null; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1167
1416
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
x: reference.x,
|
|
1171
|
-
y: reference.y
|
|
1172
|
-
};
|
|
1173
|
-
}
|
|
1417
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1418
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
1174
1419
|
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1420
|
+
if (computedStyle.position === 'static' && currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) && !isContainingBlock(currentNode)) {
|
|
1421
|
+
// Drop non-containing blocks
|
|
1422
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1423
|
+
} else {
|
|
1424
|
+
// Record last containing block for next iteration
|
|
1425
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1426
|
+
}
|
|
1179
1427
|
|
|
1180
|
-
|
|
1181
|
-
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
1182
|
-
break;
|
|
1428
|
+
currentNode = getParentNode(currentNode);
|
|
1183
1429
|
}
|
|
1184
1430
|
|
|
1185
|
-
return
|
|
1186
|
-
}
|
|
1431
|
+
return result;
|
|
1432
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
1433
|
+
// clipping ancestors
|
|
1187
1434
|
|
|
1188
|
-
/**
|
|
1189
|
-
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1190
|
-
* next to a reference element when it is given a certain positioning strategy.
|
|
1191
|
-
*
|
|
1192
|
-
* This export does not have any `platform` interface logic. You will need to
|
|
1193
|
-
* write one for the platform you are using Floating UI with.
|
|
1194
|
-
*/
|
|
1195
1435
|
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
} =
|
|
1203
|
-
const
|
|
1204
|
-
const
|
|
1436
|
+
function getClippingRect(_ref) {
|
|
1437
|
+
let {
|
|
1438
|
+
element,
|
|
1439
|
+
boundary,
|
|
1440
|
+
rootBoundary,
|
|
1441
|
+
strategy
|
|
1442
|
+
} = _ref;
|
|
1443
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element) : [].concat(boundary);
|
|
1444
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1445
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1446
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1447
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1448
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1449
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1450
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1451
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1452
|
+
return accRect;
|
|
1453
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1454
|
+
return {
|
|
1455
|
+
width: clippingRect.right - clippingRect.left,
|
|
1456
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1457
|
+
x: clippingRect.left,
|
|
1458
|
+
y: clippingRect.top
|
|
1459
|
+
};
|
|
1460
|
+
}
|
|
1205
1461
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1462
|
+
const platform = {
|
|
1463
|
+
getClippingRect,
|
|
1464
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1465
|
+
isElement,
|
|
1466
|
+
getDimensions,
|
|
1467
|
+
getOffsetParent,
|
|
1468
|
+
getDocumentElement,
|
|
1469
|
+
getElementRects: _ref => {
|
|
1470
|
+
let {
|
|
1471
|
+
reference,
|
|
1472
|
+
floating,
|
|
1473
|
+
strategy
|
|
1474
|
+
} = _ref;
|
|
1475
|
+
return {
|
|
1476
|
+
reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
|
|
1477
|
+
floating: { ...getDimensions(floating),
|
|
1478
|
+
x: 0,
|
|
1479
|
+
y: 0
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
},
|
|
1483
|
+
getClientRects: element => Array.from(element.getClientRects()),
|
|
1484
|
+
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
1485
|
+
};
|
|
1210
1486
|
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
}).length > 1) {
|
|
1217
|
-
throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement` middleware', 'detected. This will lead to an infinite loop. Ensure only one of', 'either has been passed to the `middleware` array.'].join(' '));
|
|
1218
|
-
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1489
|
+
* next to a reference element when it is given a certain CSS positioning
|
|
1490
|
+
* strategy.
|
|
1491
|
+
*/
|
|
1219
1492
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1493
|
+
const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
|
|
1494
|
+
platform,
|
|
1495
|
+
...options
|
|
1496
|
+
});
|
|
1224
1497
|
|
|
1225
|
-
|
|
1226
|
-
reference,
|
|
1227
|
-
floating,
|
|
1228
|
-
strategy
|
|
1229
|
-
});
|
|
1230
|
-
let {
|
|
1231
|
-
x,
|
|
1232
|
-
y
|
|
1233
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
1234
|
-
let statefulPlacement = placement;
|
|
1235
|
-
let middlewareData = {};
|
|
1236
|
-
let resetCount = 0;
|
|
1498
|
+
var jsxRuntime = {exports: {}};
|
|
1237
1499
|
|
|
1238
|
-
|
|
1239
|
-
const {
|
|
1240
|
-
name,
|
|
1241
|
-
fn
|
|
1242
|
-
} = validMiddleware[i];
|
|
1243
|
-
const {
|
|
1244
|
-
x: nextX,
|
|
1245
|
-
y: nextY,
|
|
1246
|
-
data,
|
|
1247
|
-
reset
|
|
1248
|
-
} = await fn({
|
|
1249
|
-
x,
|
|
1250
|
-
y,
|
|
1251
|
-
initialPlacement: placement,
|
|
1252
|
-
placement: statefulPlacement,
|
|
1253
|
-
strategy,
|
|
1254
|
-
middlewareData,
|
|
1255
|
-
rects,
|
|
1256
|
-
platform,
|
|
1257
|
-
elements: {
|
|
1258
|
-
reference,
|
|
1259
|
-
floating
|
|
1260
|
-
}
|
|
1261
|
-
});
|
|
1262
|
-
x = nextX != null ? nextX : x;
|
|
1263
|
-
y = nextY != null ? nextY : y;
|
|
1264
|
-
middlewareData = { ...middlewareData,
|
|
1265
|
-
[name]: { ...middlewareData[name],
|
|
1266
|
-
...data
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1500
|
+
var reactJsxRuntime_development = {};
|
|
1269
1501
|
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1502
|
+
/** @license React v16.14.0
|
|
1503
|
+
* react-jsx-runtime.development.js
|
|
1504
|
+
*
|
|
1505
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1506
|
+
*
|
|
1507
|
+
* This source code is licensed under the MIT license found in the
|
|
1508
|
+
* LICENSE file in the root directory of this source tree.
|
|
1509
|
+
*/
|
|
1275
1510
|
|
|
1276
|
-
|
|
1277
|
-
resetCount++;
|
|
1511
|
+
(function (exports) {
|
|
1278
1512
|
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
statefulPlacement = reset.placement;
|
|
1282
|
-
}
|
|
1513
|
+
{
|
|
1514
|
+
(function() {
|
|
1283
1515
|
|
|
1284
|
-
|
|
1285
|
-
rects = reset.rects === true ? await platform.getElementRects({
|
|
1286
|
-
reference,
|
|
1287
|
-
floating,
|
|
1288
|
-
strategy
|
|
1289
|
-
}) : reset.rects;
|
|
1290
|
-
}
|
|
1516
|
+
var React = require$$0__default["default"];
|
|
1291
1517
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1518
|
+
// ATTENTION
|
|
1519
|
+
// When adding new symbols to this file,
|
|
1520
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
1521
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1522
|
+
// nor polyfill, then a plain number is used for performance.
|
|
1523
|
+
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
1524
|
+
var REACT_PORTAL_TYPE = 0xeaca;
|
|
1525
|
+
exports.Fragment = 0xeacb;
|
|
1526
|
+
var REACT_STRICT_MODE_TYPE = 0xeacc;
|
|
1527
|
+
var REACT_PROFILER_TYPE = 0xead2;
|
|
1528
|
+
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
1529
|
+
var REACT_CONTEXT_TYPE = 0xeace;
|
|
1530
|
+
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
1531
|
+
var REACT_SUSPENSE_TYPE = 0xead1;
|
|
1532
|
+
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
1533
|
+
var REACT_MEMO_TYPE = 0xead3;
|
|
1534
|
+
var REACT_LAZY_TYPE = 0xead4;
|
|
1535
|
+
var REACT_BLOCK_TYPE = 0xead9;
|
|
1536
|
+
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
1537
|
+
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
1538
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
1539
|
+
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
1297
1540
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1541
|
+
if (typeof Symbol === 'function' && Symbol.for) {
|
|
1542
|
+
var symbolFor = Symbol.for;
|
|
1543
|
+
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
1544
|
+
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
1545
|
+
exports.Fragment = symbolFor('react.fragment');
|
|
1546
|
+
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
|
|
1547
|
+
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
1548
|
+
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
1549
|
+
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
1550
|
+
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
1551
|
+
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
1552
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
1553
|
+
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
1554
|
+
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
1555
|
+
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
1556
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
1557
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
1558
|
+
symbolFor('react.scope');
|
|
1559
|
+
symbolFor('react.opaque.id');
|
|
1560
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
1561
|
+
symbolFor('react.offscreen');
|
|
1562
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
1563
|
+
}
|
|
1302
1564
|
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
};
|
|
1310
|
-
};
|
|
1565
|
+
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
1566
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
1567
|
+
function getIteratorFn(maybeIterable) {
|
|
1568
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
1569
|
+
return null;
|
|
1570
|
+
}
|
|
1311
1571
|
|
|
1312
|
-
|
|
1313
|
-
return {
|
|
1314
|
-
top: 0,
|
|
1315
|
-
right: 0,
|
|
1316
|
-
bottom: 0,
|
|
1317
|
-
left: 0,
|
|
1318
|
-
...padding
|
|
1319
|
-
};
|
|
1320
|
-
}
|
|
1572
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
1321
1573
|
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1574
|
+
if (typeof maybeIterator === 'function') {
|
|
1575
|
+
return maybeIterator;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
return null;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1582
|
+
|
|
1583
|
+
function error(format) {
|
|
1584
|
+
{
|
|
1585
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1586
|
+
args[_key2 - 1] = arguments[_key2];
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
printWarning('error', format, args);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
function printWarning(level, format, args) {
|
|
1594
|
+
// When changing this logic, you might want to also
|
|
1595
|
+
// update consoleWithStackDev.www.js as well.
|
|
1596
|
+
{
|
|
1597
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1598
|
+
var stack = '';
|
|
1599
|
+
|
|
1600
|
+
if (currentlyValidatingElement) {
|
|
1601
|
+
var name = getComponentName(currentlyValidatingElement.type);
|
|
1602
|
+
var owner = currentlyValidatingElement._owner;
|
|
1603
|
+
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
stack += ReactDebugCurrentFrame.getStackAddendum();
|
|
1607
|
+
|
|
1608
|
+
if (stack !== '') {
|
|
1609
|
+
format += '%s';
|
|
1610
|
+
args = args.concat([stack]);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
var argsWithFormat = args.map(function (item) {
|
|
1614
|
+
return '' + item;
|
|
1615
|
+
}); // Careful: RN currently depends on this prefix
|
|
1616
|
+
|
|
1617
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
1618
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
1619
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
1620
|
+
|
|
1621
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1626
|
+
|
|
1627
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1628
|
+
|
|
1629
|
+
function isValidElementType(type) {
|
|
1630
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
1631
|
+
return true;
|
|
1632
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1633
|
+
|
|
1634
|
+
|
|
1635
|
+
if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
1636
|
+
return true;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
if (typeof type === 'object' && type !== null) {
|
|
1640
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
1641
|
+
return true;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
return false;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
1650
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
1651
|
+
var sourceInfo = '';
|
|
1652
|
+
|
|
1653
|
+
if (source) {
|
|
1654
|
+
var path = source.fileName;
|
|
1655
|
+
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
1656
|
+
|
|
1657
|
+
{
|
|
1658
|
+
// In DEV, include code for a common special case:
|
|
1659
|
+
// prefer "folder/index.js" instead of just "index.js".
|
|
1660
|
+
if (/^index\./.test(fileName)) {
|
|
1661
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
1662
|
+
|
|
1663
|
+
if (match) {
|
|
1664
|
+
var pathBeforeSlash = match[1];
|
|
1665
|
+
|
|
1666
|
+
if (pathBeforeSlash) {
|
|
1667
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
1668
|
+
fileName = folderName + '/' + fileName;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
1675
|
+
} else if (ownerName) {
|
|
1676
|
+
sourceInfo = ' (created by ' + ownerName + ')';
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
var Resolved = 1;
|
|
1683
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
1684
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
1688
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
1689
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
function getComponentName(type) {
|
|
1693
|
+
if (type == null) {
|
|
1694
|
+
// Host root, text node or just invalid type.
|
|
1695
|
+
return null;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
{
|
|
1699
|
+
if (typeof type.tag === 'number') {
|
|
1700
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
if (typeof type === 'function') {
|
|
1705
|
+
return type.displayName || type.name || null;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
if (typeof type === 'string') {
|
|
1709
|
+
return type;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
switch (type) {
|
|
1713
|
+
case exports.Fragment:
|
|
1714
|
+
return 'Fragment';
|
|
1715
|
+
|
|
1716
|
+
case REACT_PORTAL_TYPE:
|
|
1717
|
+
return 'Portal';
|
|
1718
|
+
|
|
1719
|
+
case REACT_PROFILER_TYPE:
|
|
1720
|
+
return "Profiler";
|
|
1721
|
+
|
|
1722
|
+
case REACT_STRICT_MODE_TYPE:
|
|
1723
|
+
return 'StrictMode';
|
|
1724
|
+
|
|
1725
|
+
case REACT_SUSPENSE_TYPE:
|
|
1726
|
+
return 'Suspense';
|
|
1727
|
+
|
|
1728
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1729
|
+
return 'SuspenseList';
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
if (typeof type === 'object') {
|
|
1733
|
+
switch (type.$$typeof) {
|
|
1734
|
+
case REACT_CONTEXT_TYPE:
|
|
1735
|
+
return 'Context.Consumer';
|
|
1736
|
+
|
|
1737
|
+
case REACT_PROVIDER_TYPE:
|
|
1738
|
+
return 'Context.Provider';
|
|
1739
|
+
|
|
1740
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1741
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
1742
|
+
|
|
1743
|
+
case REACT_MEMO_TYPE:
|
|
1744
|
+
return getComponentName(type.type);
|
|
1330
1745
|
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
top: rect.y,
|
|
1334
|
-
left: rect.x,
|
|
1335
|
-
right: rect.x + rect.width,
|
|
1336
|
-
bottom: rect.y + rect.height
|
|
1337
|
-
};
|
|
1338
|
-
}
|
|
1746
|
+
case REACT_BLOCK_TYPE:
|
|
1747
|
+
return getComponentName(type.render);
|
|
1339
1748
|
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
* - negative = how many pixels left before it will overflow
|
|
1345
|
-
* - 0 = lies flush with the boundary
|
|
1346
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
1347
|
-
*/
|
|
1348
|
-
async function detectOverflow(middlewareArguments, options) {
|
|
1349
|
-
var _await$platform$isEle;
|
|
1749
|
+
case REACT_LAZY_TYPE:
|
|
1750
|
+
{
|
|
1751
|
+
var thenable = type;
|
|
1752
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
1350
1753
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1754
|
+
if (resolvedThenable) {
|
|
1755
|
+
return getComponentName(resolvedThenable);
|
|
1756
|
+
}
|
|
1354
1757
|
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
rects,
|
|
1360
|
-
elements,
|
|
1361
|
-
strategy
|
|
1362
|
-
} = middlewareArguments;
|
|
1363
|
-
const {
|
|
1364
|
-
boundary = 'clippingAncestors',
|
|
1365
|
-
rootBoundary = 'viewport',
|
|
1366
|
-
elementContext = 'floating',
|
|
1367
|
-
altBoundary = false,
|
|
1368
|
-
padding = 0
|
|
1369
|
-
} = options;
|
|
1370
|
-
const paddingObject = getSideObjectFromPadding(padding);
|
|
1371
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
1372
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
1373
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
1374
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
1375
|
-
boundary,
|
|
1376
|
-
rootBoundary,
|
|
1377
|
-
strategy
|
|
1378
|
-
}));
|
|
1379
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1380
|
-
rect: elementContext === 'floating' ? { ...rects.floating,
|
|
1381
|
-
x,
|
|
1382
|
-
y
|
|
1383
|
-
} : rects.reference,
|
|
1384
|
-
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
1385
|
-
strategy
|
|
1386
|
-
}) : rects[elementContext]);
|
|
1387
|
-
return {
|
|
1388
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
1389
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
1390
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
1391
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
1392
|
-
};
|
|
1393
|
-
}
|
|
1758
|
+
break;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1394
1762
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1763
|
+
return null;
|
|
1764
|
+
}
|
|
1397
1765
|
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1766
|
+
var loggedTypeFailures = {};
|
|
1767
|
+
ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1768
|
+
var currentlyValidatingElement = null;
|
|
1401
1769
|
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
const arrow = options => ({
|
|
1408
|
-
name: 'arrow',
|
|
1409
|
-
options,
|
|
1770
|
+
function setCurrentlyValidatingElement(element) {
|
|
1771
|
+
{
|
|
1772
|
+
currentlyValidatingElement = element;
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1410
1775
|
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
padding = 0
|
|
1416
|
-
} = options != null ? options : {};
|
|
1417
|
-
const {
|
|
1418
|
-
x,
|
|
1419
|
-
y,
|
|
1420
|
-
placement,
|
|
1421
|
-
rects,
|
|
1422
|
-
platform
|
|
1423
|
-
} = middlewareArguments;
|
|
1776
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1777
|
+
{
|
|
1778
|
+
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1779
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1424
1780
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1781
|
+
for (var typeSpecName in typeSpecs) {
|
|
1782
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
1783
|
+
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
1784
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
1785
|
+
// After these have been cleaned up, we'll let them throw.
|
|
1429
1786
|
|
|
1430
|
-
|
|
1431
|
-
|
|
1787
|
+
try {
|
|
1788
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
1789
|
+
// behavior as without this statement except with a better message.
|
|
1790
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
1791
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
1792
|
+
err.name = 'Invariant Violation';
|
|
1793
|
+
throw err;
|
|
1794
|
+
}
|
|
1432
1795
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
};
|
|
1438
|
-
const axis = getMainAxisFromPlacement(placement);
|
|
1439
|
-
const alignment = getAlignment(placement);
|
|
1440
|
-
const length = getLengthFromAxis(axis);
|
|
1441
|
-
const arrowDimensions = await platform.getDimensions(element);
|
|
1442
|
-
const minProp = axis === 'y' ? 'top' : 'left';
|
|
1443
|
-
const maxProp = axis === 'y' ? 'bottom' : 'right';
|
|
1444
|
-
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
1445
|
-
const startDiff = coords[axis] - rects.reference[axis];
|
|
1446
|
-
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
1447
|
-
let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
1796
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
1797
|
+
} catch (ex) {
|
|
1798
|
+
error$1 = ex;
|
|
1799
|
+
}
|
|
1448
1800
|
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
}
|
|
1801
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
1802
|
+
setCurrentlyValidatingElement(element);
|
|
1452
1803
|
|
|
1453
|
-
|
|
1454
|
-
// point is outside the floating element's bounds
|
|
1804
|
+
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
1455
1805
|
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
1459
|
-
const offset = within(min, center, max); // Make sure that arrow points at the reference
|
|
1806
|
+
setCurrentlyValidatingElement(null);
|
|
1807
|
+
}
|
|
1460
1808
|
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
data: {
|
|
1467
|
-
[axis]: offset,
|
|
1468
|
-
centerOffset: center - offset
|
|
1469
|
-
}
|
|
1470
|
-
};
|
|
1471
|
-
}
|
|
1809
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1810
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
1811
|
+
// same error.
|
|
1812
|
+
loggedTypeFailures[error$1.message] = true;
|
|
1813
|
+
setCurrentlyValidatingElement(element);
|
|
1472
1814
|
|
|
1473
|
-
|
|
1815
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
1474
1816
|
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1481
|
-
function getOppositePlacement(placement) {
|
|
1482
|
-
return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
|
|
1483
|
-
}
|
|
1817
|
+
setCurrentlyValidatingElement(null);
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1484
1823
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1824
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
1825
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1826
|
+
var RESERVED_PROPS = {
|
|
1827
|
+
key: true,
|
|
1828
|
+
ref: true,
|
|
1829
|
+
__self: true,
|
|
1830
|
+
__source: true
|
|
1831
|
+
};
|
|
1832
|
+
var specialPropKeyWarningShown;
|
|
1833
|
+
var specialPropRefWarningShown;
|
|
1834
|
+
var didWarnAboutStringRefs;
|
|
1489
1835
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
1836
|
+
{
|
|
1837
|
+
didWarnAboutStringRefs = {};
|
|
1838
|
+
}
|
|
1494
1839
|
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1840
|
+
function hasValidRef(config) {
|
|
1841
|
+
{
|
|
1842
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
1843
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
1498
1844
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1845
|
+
if (getter && getter.isReactWarning) {
|
|
1846
|
+
return false;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1504
1850
|
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
end: 'start'
|
|
1508
|
-
};
|
|
1509
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
1510
|
-
return placement.replace(/start|end/g, matched => hash[matched]);
|
|
1511
|
-
}
|
|
1851
|
+
return config.ref !== undefined;
|
|
1852
|
+
}
|
|
1512
1853
|
|
|
1513
|
-
function
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1854
|
+
function hasValidKey(config) {
|
|
1855
|
+
{
|
|
1856
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
1857
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
1858
|
+
|
|
1859
|
+
if (getter && getter.isReactWarning) {
|
|
1860
|
+
return false;
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1517
1864
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
* initially specified `placement` does not.
|
|
1521
|
-
* @see https://floating-ui.com/docs/flip
|
|
1522
|
-
*/
|
|
1523
|
-
const flip = function (options) {
|
|
1524
|
-
if (options === void 0) {
|
|
1525
|
-
options = {};
|
|
1526
|
-
}
|
|
1865
|
+
return config.key !== undefined;
|
|
1866
|
+
}
|
|
1527
1867
|
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1868
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
1869
|
+
{
|
|
1870
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
1871
|
+
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
1531
1872
|
|
|
1532
|
-
|
|
1533
|
-
|
|
1873
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
1874
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
1534
1875
|
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
platform,
|
|
1541
|
-
elements
|
|
1542
|
-
} = middlewareArguments;
|
|
1543
|
-
const {
|
|
1544
|
-
mainAxis: checkMainAxis = true,
|
|
1545
|
-
crossAxis: checkCrossAxis = true,
|
|
1546
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
1547
|
-
fallbackStrategy = 'bestFit',
|
|
1548
|
-
flipAlignment = true,
|
|
1549
|
-
...detectOverflowOptions
|
|
1550
|
-
} = options;
|
|
1551
|
-
const side = getSide(placement);
|
|
1552
|
-
const isBasePlacement = side === initialPlacement;
|
|
1553
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
1554
|
-
const placements = [initialPlacement, ...fallbackPlacements];
|
|
1555
|
-
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
1556
|
-
const overflows = [];
|
|
1557
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
1876
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1558
1881
|
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1882
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
1883
|
+
{
|
|
1884
|
+
var warnAboutAccessingKey = function () {
|
|
1885
|
+
if (!specialPropKeyWarningShown) {
|
|
1886
|
+
specialPropKeyWarningShown = true;
|
|
1562
1887
|
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
cross
|
|
1567
|
-
} = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
1568
|
-
overflows.push(overflow[main], overflow[cross]);
|
|
1569
|
-
}
|
|
1888
|
+
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1570
1891
|
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1892
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
1893
|
+
Object.defineProperty(props, 'key', {
|
|
1894
|
+
get: warnAboutAccessingKey,
|
|
1895
|
+
configurable: true
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1575
1899
|
|
|
1576
|
-
|
|
1577
|
-
|
|
1900
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
1901
|
+
{
|
|
1902
|
+
var warnAboutAccessingRef = function () {
|
|
1903
|
+
if (!specialPropRefWarningShown) {
|
|
1904
|
+
specialPropRefWarningShown = true;
|
|
1578
1905
|
|
|
1579
|
-
|
|
1580
|
-
|
|
1906
|
+
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
1907
|
+
}
|
|
1908
|
+
};
|
|
1581
1909
|
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1910
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
1911
|
+
Object.defineProperty(props, 'ref', {
|
|
1912
|
+
get: warnAboutAccessingRef,
|
|
1913
|
+
configurable: true
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
1919
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
1920
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
1921
|
+
* if something is a React Element.
|
|
1922
|
+
*
|
|
1923
|
+
* @param {*} type
|
|
1924
|
+
* @param {*} props
|
|
1925
|
+
* @param {*} key
|
|
1926
|
+
* @param {string|object} ref
|
|
1927
|
+
* @param {*} owner
|
|
1928
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
1929
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
1930
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
1931
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
1932
|
+
* change in behavior.
|
|
1933
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
1934
|
+
* indicating filename, line number, and/or other information.
|
|
1935
|
+
* @internal
|
|
1936
|
+
*/
|
|
1594
1937
|
|
|
1595
|
-
let resetPlacement = 'bottom';
|
|
1596
1938
|
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1939
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
1940
|
+
var element = {
|
|
1941
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
1942
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1943
|
+
// Built-in properties that belong on the element
|
|
1944
|
+
type: type,
|
|
1945
|
+
key: key,
|
|
1946
|
+
ref: ref,
|
|
1947
|
+
props: props,
|
|
1948
|
+
// Record the component responsible for creating this element.
|
|
1949
|
+
_owner: owner
|
|
1950
|
+
};
|
|
1601
1951
|
|
|
1602
|
-
|
|
1952
|
+
{
|
|
1953
|
+
// The validation flag is currently mutative. We put it on
|
|
1954
|
+
// an external backing store so that we can freeze the whole object.
|
|
1955
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
1956
|
+
// commonly used development environments.
|
|
1957
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
1958
|
+
// the validation flag non-enumerable (where possible, which should
|
|
1959
|
+
// include every environment we run tests in), so the test framework
|
|
1960
|
+
// ignores it.
|
|
1603
1961
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1962
|
+
Object.defineProperty(element._store, 'validated', {
|
|
1963
|
+
configurable: false,
|
|
1964
|
+
enumerable: false,
|
|
1965
|
+
writable: true,
|
|
1966
|
+
value: false
|
|
1967
|
+
}); // self and source are DEV only properties.
|
|
1607
1968
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1969
|
+
Object.defineProperty(element, '_self', {
|
|
1970
|
+
configurable: false,
|
|
1971
|
+
enumerable: false,
|
|
1972
|
+
writable: false,
|
|
1973
|
+
value: self
|
|
1974
|
+
}); // Two elements created in two different places should be considered
|
|
1975
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
1610
1976
|
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1977
|
+
Object.defineProperty(element, '_source', {
|
|
1978
|
+
configurable: false,
|
|
1979
|
+
enumerable: false,
|
|
1980
|
+
writable: false,
|
|
1981
|
+
value: source
|
|
1982
|
+
});
|
|
1615
1983
|
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
};
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1984
|
+
if (Object.freeze) {
|
|
1985
|
+
Object.freeze(element.props);
|
|
1986
|
+
Object.freeze(element);
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1624
1989
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1990
|
+
return element;
|
|
1991
|
+
};
|
|
1992
|
+
/**
|
|
1993
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
1994
|
+
* @param {*} type
|
|
1995
|
+
* @param {object} props
|
|
1996
|
+
* @param {string} key
|
|
1997
|
+
*/
|
|
1627
1998
|
|
|
1628
|
-
|
|
1629
|
-
|
|
1999
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
2000
|
+
{
|
|
2001
|
+
var propName; // Reserved names are extracted
|
|
1630
2002
|
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
const alignment = getAlignment(placement);
|
|
1640
|
-
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
1641
|
-
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
1642
|
-
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1643
|
-
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
|
|
2003
|
+
var props = {};
|
|
2004
|
+
var key = null;
|
|
2005
|
+
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
2006
|
+
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
2007
|
+
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
2008
|
+
// but as an intermediary step, we will use jsxDEV for everything except
|
|
2009
|
+
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
2010
|
+
// key is explicitly declared to be undefined or not.
|
|
1644
2011
|
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
alignmentAxis
|
|
1649
|
-
} = typeof rawValue === 'number' ? {
|
|
1650
|
-
mainAxis: rawValue,
|
|
1651
|
-
crossAxis: 0,
|
|
1652
|
-
alignmentAxis: null
|
|
1653
|
-
} : {
|
|
1654
|
-
mainAxis: 0,
|
|
1655
|
-
crossAxis: 0,
|
|
1656
|
-
alignmentAxis: null,
|
|
1657
|
-
...rawValue
|
|
1658
|
-
};
|
|
2012
|
+
if (maybeKey !== undefined) {
|
|
2013
|
+
key = '' + maybeKey;
|
|
2014
|
+
}
|
|
1659
2015
|
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
2016
|
+
if (hasValidKey(config)) {
|
|
2017
|
+
key = '' + config.key;
|
|
2018
|
+
}
|
|
1663
2019
|
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
x: mainAxis * mainAxisMulti,
|
|
1669
|
-
y: crossAxis * crossAxisMulti
|
|
1670
|
-
};
|
|
1671
|
-
}
|
|
1672
|
-
/**
|
|
1673
|
-
* Displaces the floating element from its reference element.
|
|
1674
|
-
* @see https://floating-ui.com/docs/offset
|
|
1675
|
-
*/
|
|
2020
|
+
if (hasValidRef(config)) {
|
|
2021
|
+
ref = config.ref;
|
|
2022
|
+
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
2023
|
+
} // Remaining properties are added to a new props object
|
|
1676
2024
|
|
|
1677
|
-
const offset = function (value) {
|
|
1678
|
-
if (value === void 0) {
|
|
1679
|
-
value = 0;
|
|
1680
|
-
}
|
|
1681
2025
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
2026
|
+
for (propName in config) {
|
|
2027
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
2028
|
+
props[propName] = config[propName];
|
|
2029
|
+
}
|
|
2030
|
+
} // Resolve default props
|
|
1685
2031
|
|
|
1686
|
-
async fn(middlewareArguments) {
|
|
1687
|
-
const {
|
|
1688
|
-
x,
|
|
1689
|
-
y
|
|
1690
|
-
} = middlewareArguments;
|
|
1691
|
-
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
|
1692
|
-
return {
|
|
1693
|
-
x: x + diffCoords.x,
|
|
1694
|
-
y: y + diffCoords.y,
|
|
1695
|
-
data: diffCoords
|
|
1696
|
-
};
|
|
1697
|
-
}
|
|
1698
2032
|
|
|
1699
|
-
|
|
1700
|
-
|
|
2033
|
+
if (type && type.defaultProps) {
|
|
2034
|
+
var defaultProps = type.defaultProps;
|
|
1701
2035
|
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
2036
|
+
for (propName in defaultProps) {
|
|
2037
|
+
if (props[propName] === undefined) {
|
|
2038
|
+
props[propName] = defaultProps[propName];
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
1705
2042
|
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
* a clipping boundary.
|
|
1709
|
-
* @see https://floating-ui.com/docs/shift
|
|
1710
|
-
*/
|
|
1711
|
-
const shift = function (options) {
|
|
1712
|
-
if (options === void 0) {
|
|
1713
|
-
options = {};
|
|
1714
|
-
}
|
|
2043
|
+
if (key || ref) {
|
|
2044
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
1715
2045
|
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
2046
|
+
if (key) {
|
|
2047
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
2048
|
+
}
|
|
1719
2049
|
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
placement
|
|
1725
|
-
} = middlewareArguments;
|
|
1726
|
-
const {
|
|
1727
|
-
mainAxis: checkMainAxis = true,
|
|
1728
|
-
crossAxis: checkCrossAxis = false,
|
|
1729
|
-
limiter = {
|
|
1730
|
-
fn: _ref => {
|
|
1731
|
-
let {
|
|
1732
|
-
x,
|
|
1733
|
-
y
|
|
1734
|
-
} = _ref;
|
|
1735
|
-
return {
|
|
1736
|
-
x,
|
|
1737
|
-
y
|
|
1738
|
-
};
|
|
1739
|
-
}
|
|
1740
|
-
},
|
|
1741
|
-
...detectOverflowOptions
|
|
1742
|
-
} = options;
|
|
1743
|
-
const coords = {
|
|
1744
|
-
x,
|
|
1745
|
-
y
|
|
1746
|
-
};
|
|
1747
|
-
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
1748
|
-
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
1749
|
-
const crossAxis = getCrossAxis(mainAxis);
|
|
1750
|
-
let mainAxisCoord = coords[mainAxis];
|
|
1751
|
-
let crossAxisCoord = coords[crossAxis];
|
|
2050
|
+
if (ref) {
|
|
2051
|
+
defineRefPropWarningGetter(props, displayName);
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
1752
2054
|
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
const min = mainAxisCoord + overflow[minSide];
|
|
1757
|
-
const max = mainAxisCoord - overflow[maxSide];
|
|
1758
|
-
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
1759
|
-
}
|
|
2055
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
1760
2058
|
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
1764
|
-
const min = crossAxisCoord + overflow[minSide];
|
|
1765
|
-
const max = crossAxisCoord - overflow[maxSide];
|
|
1766
|
-
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
1767
|
-
}
|
|
2059
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
2060
|
+
ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1768
2061
|
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
});
|
|
1773
|
-
return { ...limitedCoords,
|
|
1774
|
-
data: {
|
|
1775
|
-
x: limitedCoords.x - x,
|
|
1776
|
-
y: limitedCoords.y - y
|
|
1777
|
-
}
|
|
1778
|
-
};
|
|
1779
|
-
}
|
|
2062
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
2063
|
+
currentlyValidatingElement = element;
|
|
2064
|
+
}
|
|
1780
2065
|
|
|
1781
|
-
|
|
1782
|
-
};
|
|
2066
|
+
var propTypesMisspellWarningShown;
|
|
1783
2067
|
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
2068
|
+
{
|
|
2069
|
+
propTypesMisspellWarningShown = false;
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* Verifies the object is a ReactElement.
|
|
2073
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
2074
|
+
* @param {?object} object
|
|
2075
|
+
* @return {boolean} True if `object` is a ReactElement.
|
|
2076
|
+
* @final
|
|
2077
|
+
*/
|
|
1791
2078
|
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
2079
|
+
function isValidElement(object) {
|
|
2080
|
+
{
|
|
2081
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
1796
2084
|
|
|
1797
|
-
|
|
1798
|
-
|
|
2085
|
+
function getDeclarationErrorAddendum() {
|
|
2086
|
+
{
|
|
2087
|
+
if (ReactCurrentOwner$1.current) {
|
|
2088
|
+
var name = getComponentName(ReactCurrentOwner$1.current.type);
|
|
1799
2089
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
}
|
|
2090
|
+
if (name) {
|
|
2091
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
1803
2094
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
}
|
|
2095
|
+
return '';
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
1807
2098
|
|
|
1808
|
-
function
|
|
1809
|
-
|
|
2099
|
+
function getSourceInfoErrorAddendum(source) {
|
|
2100
|
+
{
|
|
2101
|
+
if (source !== undefined) {
|
|
2102
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
2103
|
+
var lineNumber = source.lineNumber;
|
|
2104
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
2105
|
+
}
|
|
1810
2106
|
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
2107
|
+
return '';
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
2112
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
2113
|
+
* updates.
|
|
2114
|
+
*/
|
|
1814
2115
|
|
|
1815
|
-
return navigator.userAgent;
|
|
1816
|
-
}
|
|
1817
2116
|
|
|
1818
|
-
|
|
1819
|
-
return value instanceof getWindow(value).HTMLElement;
|
|
1820
|
-
}
|
|
1821
|
-
function isElement(value) {
|
|
1822
|
-
return value instanceof getWindow(value).Element;
|
|
1823
|
-
}
|
|
1824
|
-
function isNode(value) {
|
|
1825
|
-
return value instanceof getWindow(value).Node;
|
|
1826
|
-
}
|
|
1827
|
-
function isShadowRoot(node) {
|
|
1828
|
-
// Browsers without `ShadowRoot` support
|
|
1829
|
-
if (typeof ShadowRoot === 'undefined') {
|
|
1830
|
-
return false;
|
|
1831
|
-
}
|
|
2117
|
+
var ownerHasKeyUseWarning = {};
|
|
1832
2118
|
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
function isOverflowElement(element) {
|
|
1837
|
-
// Firefox wants us to check `-x` and `-y` variations as well
|
|
1838
|
-
const {
|
|
1839
|
-
overflow,
|
|
1840
|
-
overflowX,
|
|
1841
|
-
overflowY,
|
|
1842
|
-
display
|
|
1843
|
-
} = getComputedStyle(element);
|
|
1844
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
1845
|
-
}
|
|
1846
|
-
function isTableElement(element) {
|
|
1847
|
-
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1848
|
-
}
|
|
1849
|
-
function isContainingBlock(element) {
|
|
1850
|
-
// TODO: Try and use feature detection here instead
|
|
1851
|
-
const isFirefox = /firefox/i.test(getUAString());
|
|
1852
|
-
const css = getComputedStyle(element);
|
|
1853
|
-
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter; // This is non-exhaustive but covers the most common CSS properties that
|
|
1854
|
-
// create a containing block.
|
|
1855
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
2119
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
2120
|
+
{
|
|
2121
|
+
var info = getDeclarationErrorAddendum();
|
|
1856
2122
|
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
const contain = css.contain;
|
|
1860
|
-
return contain != null ? contain.includes(value) : false;
|
|
1861
|
-
});
|
|
1862
|
-
}
|
|
1863
|
-
function isLayoutViewport() {
|
|
1864
|
-
// Not Safari
|
|
1865
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
|
|
1866
|
-
// • Always-visible scrollbar or not
|
|
1867
|
-
// • Width of <html>, etc.
|
|
1868
|
-
// const vV = win.visualViewport;
|
|
1869
|
-
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
1870
|
-
}
|
|
1871
|
-
function isLastTraversableNode(node) {
|
|
1872
|
-
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
1873
|
-
}
|
|
2123
|
+
if (!info) {
|
|
2124
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1874
2125
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
2126
|
+
if (parentName) {
|
|
2127
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
1878
2130
|
|
|
1879
|
-
|
|
1880
|
-
|
|
2131
|
+
return info;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Warn if the element doesn't have an explicit key assigned to it.
|
|
2136
|
+
* This element is in an array. The array could grow and shrink or be
|
|
2137
|
+
* reordered. All children that haven't already been validated are required to
|
|
2138
|
+
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
2139
|
+
* will only be shown once.
|
|
2140
|
+
*
|
|
2141
|
+
* @internal
|
|
2142
|
+
* @param {ReactElement} element Element that requires a key.
|
|
2143
|
+
* @param {*} parentType element's parent's type.
|
|
2144
|
+
*/
|
|
1881
2145
|
|
|
1882
|
-
if (includeScale === void 0) {
|
|
1883
|
-
includeScale = false;
|
|
1884
|
-
}
|
|
1885
2146
|
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
2147
|
+
function validateExplicitKey(element, parentType) {
|
|
2148
|
+
{
|
|
2149
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
1889
2152
|
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
let scaleY = 1;
|
|
2153
|
+
element._store.validated = true;
|
|
2154
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1893
2155
|
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
}
|
|
2156
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
2157
|
+
return;
|
|
2158
|
+
}
|
|
1898
2159
|
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
|
1903
|
-
const width = clientRect.width / scaleX;
|
|
1904
|
-
const height = clientRect.height / scaleY;
|
|
1905
|
-
return {
|
|
1906
|
-
width,
|
|
1907
|
-
height,
|
|
1908
|
-
top: y,
|
|
1909
|
-
right: x + width,
|
|
1910
|
-
bottom: y + height,
|
|
1911
|
-
left: x,
|
|
1912
|
-
x,
|
|
1913
|
-
y
|
|
1914
|
-
};
|
|
1915
|
-
}
|
|
2160
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
2161
|
+
// property, it may be the creator of the child that's responsible for
|
|
2162
|
+
// assigning it a key.
|
|
1916
2163
|
|
|
1917
|
-
|
|
1918
|
-
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
|
1919
|
-
}
|
|
2164
|
+
var childOwner = '';
|
|
1920
2165
|
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
scrollTop: element.scrollTop
|
|
1926
|
-
};
|
|
1927
|
-
}
|
|
2166
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
2167
|
+
// Give the component that originally created this child.
|
|
2168
|
+
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
2169
|
+
}
|
|
1928
2170
|
|
|
1929
|
-
|
|
1930
|
-
scrollLeft: element.pageXOffset,
|
|
1931
|
-
scrollTop: element.pageYOffset
|
|
1932
|
-
};
|
|
1933
|
-
}
|
|
2171
|
+
setCurrentlyValidatingElement$1(element);
|
|
1934
2172
|
|
|
1935
|
-
|
|
1936
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1937
|
-
// incorrect for RTL.
|
|
1938
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1939
|
-
}
|
|
2173
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1940
2174
|
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
2175
|
+
setCurrentlyValidatingElement$1(null);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* Ensure that every element either is passed in a static location, in an
|
|
2180
|
+
* array with an explicit keys property defined, or in an object literal
|
|
2181
|
+
* with valid key property.
|
|
2182
|
+
*
|
|
2183
|
+
* @internal
|
|
2184
|
+
* @param {ReactNode} node Statically passed child of any type.
|
|
2185
|
+
* @param {*} parentType node's parent's type.
|
|
2186
|
+
*/
|
|
1945
2187
|
|
|
1946
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1947
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1948
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1949
|
-
const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
|
|
1950
|
-
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
1951
|
-
let scroll = {
|
|
1952
|
-
scrollLeft: 0,
|
|
1953
|
-
scrollTop: 0
|
|
1954
|
-
};
|
|
1955
|
-
const offsets = {
|
|
1956
|
-
x: 0,
|
|
1957
|
-
y: 0
|
|
1958
|
-
};
|
|
1959
2188
|
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
2189
|
+
function validateChildKeys(node, parentType) {
|
|
2190
|
+
{
|
|
2191
|
+
if (typeof node !== 'object') {
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
1964
2194
|
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1969
|
-
} else if (documentElement) {
|
|
1970
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
2195
|
+
if (Array.isArray(node)) {
|
|
2196
|
+
for (var i = 0; i < node.length; i++) {
|
|
2197
|
+
var child = node[i];
|
|
1973
2198
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
2199
|
+
if (isValidElement(child)) {
|
|
2200
|
+
validateExplicitKey(child, parentType);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
} else if (isValidElement(node)) {
|
|
2204
|
+
// This element was passed in a valid location.
|
|
2205
|
+
if (node._store) {
|
|
2206
|
+
node._store.validated = true;
|
|
2207
|
+
}
|
|
2208
|
+
} else if (node) {
|
|
2209
|
+
var iteratorFn = getIteratorFn(node);
|
|
1981
2210
|
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2211
|
+
if (typeof iteratorFn === 'function') {
|
|
2212
|
+
// Entry iterators used to provide implicit keys,
|
|
2213
|
+
// but now we print a separate warning for them later.
|
|
2214
|
+
if (iteratorFn !== node.entries) {
|
|
2215
|
+
var iterator = iteratorFn.call(node);
|
|
2216
|
+
var step;
|
|
1986
2217
|
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
}
|
|
2218
|
+
while (!(step = iterator.next()).done) {
|
|
2219
|
+
if (isValidElement(step.value)) {
|
|
2220
|
+
validateExplicitKey(step.value, parentType);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
2230
|
+
* provided by the type.
|
|
2231
|
+
*
|
|
2232
|
+
* @param {ReactElement} element
|
|
2233
|
+
*/
|
|
1994
2234
|
|
|
1995
|
-
function getTrueOffsetParent(element) {
|
|
1996
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1997
|
-
return null;
|
|
1998
|
-
}
|
|
1999
2235
|
|
|
2000
|
-
|
|
2001
|
-
|
|
2236
|
+
function validatePropTypes(element) {
|
|
2237
|
+
{
|
|
2238
|
+
var type = element.type;
|
|
2002
2239
|
|
|
2003
|
-
|
|
2004
|
-
|
|
2240
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2005
2243
|
|
|
2006
|
-
|
|
2007
|
-
if (isContainingBlock(currentNode)) {
|
|
2008
|
-
return currentNode;
|
|
2009
|
-
} else {
|
|
2010
|
-
currentNode = getParentNode(currentNode);
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2244
|
+
var propTypes;
|
|
2013
2245
|
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
//
|
|
2246
|
+
if (typeof type === 'function') {
|
|
2247
|
+
propTypes = type.propTypes;
|
|
2248
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
2249
|
+
// Inner props are checked in the reconciler.
|
|
2250
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
2251
|
+
propTypes = type.propTypes;
|
|
2252
|
+
} else {
|
|
2253
|
+
return;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
if (propTypes) {
|
|
2257
|
+
// Intentionally inside to avoid triggering lazy initializers:
|
|
2258
|
+
var name = getComponentName(type);
|
|
2259
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2260
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2261
|
+
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
2262
|
+
|
|
2263
|
+
var _name = getComponentName(type);
|
|
2017
2264
|
|
|
2265
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
2266
|
+
}
|
|
2018
2267
|
|
|
2019
|
-
function
|
|
2020
|
-
|
|
2021
|
-
|
|
2268
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
2269
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
2275
|
+
* @param {ReactElement} fragment
|
|
2276
|
+
*/
|
|
2022
2277
|
|
|
2023
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
2024
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
2025
|
-
}
|
|
2026
2278
|
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2279
|
+
function validateFragmentProps(fragment) {
|
|
2280
|
+
{
|
|
2281
|
+
var keys = Object.keys(fragment.props);
|
|
2030
2282
|
|
|
2031
|
-
|
|
2032
|
-
|
|
2283
|
+
for (var i = 0; i < keys.length; i++) {
|
|
2284
|
+
var key = keys[i];
|
|
2033
2285
|
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
return {
|
|
2037
|
-
width: element.offsetWidth,
|
|
2038
|
-
height: element.offsetHeight
|
|
2039
|
-
};
|
|
2040
|
-
}
|
|
2286
|
+
if (key !== 'children' && key !== 'key') {
|
|
2287
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2041
2288
|
|
|
2042
|
-
|
|
2043
|
-
return {
|
|
2044
|
-
width: rect.width,
|
|
2045
|
-
height: rect.height
|
|
2046
|
-
};
|
|
2047
|
-
}
|
|
2289
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
2048
2290
|
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
strategy
|
|
2054
|
-
} = _ref;
|
|
2055
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2056
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
2291
|
+
setCurrentlyValidatingElement$1(null);
|
|
2292
|
+
break;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2057
2295
|
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
}
|
|
2296
|
+
if (fragment.ref !== null) {
|
|
2297
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2061
2298
|
|
|
2062
|
-
|
|
2063
|
-
scrollLeft: 0,
|
|
2064
|
-
scrollTop: 0
|
|
2065
|
-
};
|
|
2066
|
-
const offsets = {
|
|
2067
|
-
x: 0,
|
|
2068
|
-
y: 0
|
|
2069
|
-
};
|
|
2299
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
2070
2300
|
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2301
|
+
setCurrentlyValidatingElement$1(null);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2075
2305
|
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
} // This doesn't appear to be need to be negated.
|
|
2081
|
-
// else if (documentElement) {
|
|
2082
|
-
// offsets.x = getWindowScrollBarX(documentElement);
|
|
2083
|
-
// }
|
|
2306
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
2307
|
+
{
|
|
2308
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2309
|
+
// succeed and there will likely be errors in render.
|
|
2084
2310
|
|
|
2085
|
-
|
|
2311
|
+
if (!validType) {
|
|
2312
|
+
var info = '';
|
|
2086
2313
|
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
};
|
|
2091
|
-
}
|
|
2314
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2315
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
2316
|
+
}
|
|
2092
2317
|
|
|
2093
|
-
|
|
2094
|
-
const win = getWindow(element);
|
|
2095
|
-
const html = getDocumentElement(element);
|
|
2096
|
-
const visualViewport = win.visualViewport;
|
|
2097
|
-
let width = html.clientWidth;
|
|
2098
|
-
let height = html.clientHeight;
|
|
2099
|
-
let x = 0;
|
|
2100
|
-
let y = 0;
|
|
2318
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
2101
2319
|
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2320
|
+
if (sourceInfo) {
|
|
2321
|
+
info += sourceInfo;
|
|
2322
|
+
} else {
|
|
2323
|
+
info += getDeclarationErrorAddendum();
|
|
2324
|
+
}
|
|
2106
2325
|
|
|
2107
|
-
|
|
2108
|
-
x = visualViewport.offsetLeft;
|
|
2109
|
-
y = visualViewport.offsetTop;
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2326
|
+
var typeString;
|
|
2112
2327
|
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2328
|
+
if (type === null) {
|
|
2329
|
+
typeString = 'null';
|
|
2330
|
+
} else if (Array.isArray(type)) {
|
|
2331
|
+
typeString = 'array';
|
|
2332
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2333
|
+
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
2334
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2335
|
+
} else {
|
|
2336
|
+
typeString = typeof type;
|
|
2337
|
+
}
|
|
2120
2338
|
|
|
2121
|
-
|
|
2339
|
+
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
2340
|
+
}
|
|
2122
2341
|
|
|
2123
|
-
|
|
2124
|
-
|
|
2342
|
+
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
2343
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
2125
2344
|
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2345
|
+
if (element == null) {
|
|
2346
|
+
return element;
|
|
2347
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
2348
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
2349
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
2350
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
2351
|
+
// fixed, the key warnings will appear.)
|
|
2133
2352
|
|
|
2134
|
-
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
2135
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
2136
|
-
}
|
|
2137
2353
|
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
height,
|
|
2141
|
-
x,
|
|
2142
|
-
y
|
|
2143
|
-
};
|
|
2144
|
-
}
|
|
2354
|
+
if (validType) {
|
|
2355
|
+
var children = props.children;
|
|
2145
2356
|
|
|
2146
|
-
|
|
2147
|
-
|
|
2357
|
+
if (children !== undefined) {
|
|
2358
|
+
if (isStaticChildren) {
|
|
2359
|
+
if (Array.isArray(children)) {
|
|
2360
|
+
for (var i = 0; i < children.length; i++) {
|
|
2361
|
+
validateChildKeys(children[i], type);
|
|
2362
|
+
}
|
|
2148
2363
|
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2364
|
+
if (Object.freeze) {
|
|
2365
|
+
Object.freeze(children);
|
|
2366
|
+
}
|
|
2367
|
+
} else {
|
|
2368
|
+
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
2369
|
+
}
|
|
2370
|
+
} else {
|
|
2371
|
+
validateChildKeys(children, type);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2153
2375
|
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2376
|
+
if (type === exports.Fragment) {
|
|
2377
|
+
validateFragmentProps(element);
|
|
2378
|
+
} else {
|
|
2379
|
+
validatePropTypes(element);
|
|
2380
|
+
}
|
|
2157
2381
|
|
|
2158
|
-
|
|
2159
|
-
}
|
|
2382
|
+
return element;
|
|
2383
|
+
}
|
|
2384
|
+
} // These two functions exist to still get child warnings in dev
|
|
2385
|
+
// even with the prod transform. This means that jsxDEV is purely
|
|
2386
|
+
// opt-in behavior for better messages but that we won't stop
|
|
2387
|
+
// giving you warnings if you use production apis.
|
|
2160
2388
|
|
|
2161
|
-
function
|
|
2162
|
-
|
|
2389
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
2390
|
+
{
|
|
2391
|
+
return jsxWithValidation(type, props, key, true);
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
2395
|
+
{
|
|
2396
|
+
return jsxWithValidation(type, props, key, false);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2163
2399
|
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
}
|
|
2400
|
+
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
2401
|
+
// for now we can ship identical prod functions
|
|
2167
2402
|
|
|
2168
|
-
|
|
2169
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
2170
|
-
const win = getWindow(scrollableAncestor);
|
|
2171
|
-
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
2172
|
-
const updatedList = list.concat(target);
|
|
2173
|
-
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
|
2174
|
-
updatedList.concat(getOverflowAncestors(target));
|
|
2175
|
-
}
|
|
2403
|
+
var jsxs = jsxWithValidationStatic ;
|
|
2176
2404
|
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
top,
|
|
2183
|
-
left,
|
|
2184
|
-
x: left,
|
|
2185
|
-
y: top,
|
|
2186
|
-
right: left + element.clientWidth,
|
|
2187
|
-
bottom: top + element.clientHeight,
|
|
2188
|
-
width: element.clientWidth,
|
|
2189
|
-
height: element.clientHeight
|
|
2190
|
-
};
|
|
2191
|
-
}
|
|
2405
|
+
exports.jsx = jsx;
|
|
2406
|
+
exports.jsxs = jsxs;
|
|
2407
|
+
})();
|
|
2408
|
+
}
|
|
2409
|
+
} (reactJsxRuntime_development));
|
|
2192
2410
|
|
|
2193
|
-
function
|
|
2194
|
-
if (clippingAncestor === 'viewport') {
|
|
2195
|
-
return rectToClientRect(getViewportRect(element, strategy));
|
|
2196
|
-
}
|
|
2411
|
+
(function (module) {
|
|
2197
2412
|
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2413
|
+
{
|
|
2414
|
+
module.exports = reactJsxRuntime_development;
|
|
2415
|
+
}
|
|
2416
|
+
} (jsxRuntime));
|
|
2201
2417
|
|
|
2202
|
-
|
|
2203
|
-
} // A "clipping ancestor" is an overflowable container with the characteristic of
|
|
2204
|
-
// clipping (or hiding) overflowing elements with a position different from
|
|
2205
|
-
// `initial`
|
|
2418
|
+
var classnames = {exports: {}};
|
|
2206
2419
|
|
|
2420
|
+
/*!
|
|
2421
|
+
Copyright (c) 2018 Jed Watson.
|
|
2422
|
+
Licensed under the MIT License (MIT), see
|
|
2423
|
+
http://jedwatson.github.io/classnames
|
|
2424
|
+
*/
|
|
2207
2425
|
|
|
2208
|
-
function
|
|
2209
|
-
|
|
2210
|
-
let currentNode = element;
|
|
2211
|
-
let currentContainingBlockComputedStyle = null; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
2426
|
+
(function (module) {
|
|
2427
|
+
/* global define */
|
|
2212
2428
|
|
|
2213
|
-
|
|
2214
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
2429
|
+
(function () {
|
|
2215
2430
|
|
|
2216
|
-
|
|
2217
|
-
// Drop non-containing blocks
|
|
2218
|
-
result = result.filter(ancestor => ancestor !== currentNode);
|
|
2219
|
-
} else {
|
|
2220
|
-
// Record last containing block for next iteration
|
|
2221
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
2222
|
-
}
|
|
2431
|
+
var hasOwn = {}.hasOwnProperty;
|
|
2223
2432
|
|
|
2224
|
-
|
|
2225
|
-
|
|
2433
|
+
function classNames() {
|
|
2434
|
+
var classes = [];
|
|
2226
2435
|
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2436
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
2437
|
+
var arg = arguments[i];
|
|
2438
|
+
if (!arg) continue;
|
|
2230
2439
|
|
|
2440
|
+
var argType = typeof arg;
|
|
2231
2441
|
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
2247
|
-
accRect.left = max(rect.left, accRect.left);
|
|
2248
|
-
return accRect;
|
|
2249
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
2250
|
-
return {
|
|
2251
|
-
width: clippingRect.right - clippingRect.left,
|
|
2252
|
-
height: clippingRect.bottom - clippingRect.top,
|
|
2253
|
-
x: clippingRect.left,
|
|
2254
|
-
y: clippingRect.top
|
|
2255
|
-
};
|
|
2256
|
-
}
|
|
2442
|
+
if (argType === 'string' || argType === 'number') {
|
|
2443
|
+
classes.push(arg);
|
|
2444
|
+
} else if (Array.isArray(arg)) {
|
|
2445
|
+
if (arg.length) {
|
|
2446
|
+
var inner = classNames.apply(null, arg);
|
|
2447
|
+
if (inner) {
|
|
2448
|
+
classes.push(inner);
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
} else if (argType === 'object') {
|
|
2452
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
2453
|
+
classes.push(arg.toString());
|
|
2454
|
+
continue;
|
|
2455
|
+
}
|
|
2257
2456
|
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
getClientRects: element => Array.from(element.getClientRects()),
|
|
2280
|
-
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
2281
|
-
};
|
|
2457
|
+
for (var key in arg) {
|
|
2458
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
2459
|
+
classes.push(key);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
return classes.join(' ');
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
if (module.exports) {
|
|
2469
|
+
classNames.default = classNames;
|
|
2470
|
+
module.exports = classNames;
|
|
2471
|
+
} else {
|
|
2472
|
+
window.classNames = classNames;
|
|
2473
|
+
}
|
|
2474
|
+
}());
|
|
2475
|
+
} (classnames));
|
|
2476
|
+
|
|
2477
|
+
var classNames = classnames.exports;
|
|
2282
2478
|
|
|
2479
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2283
2480
|
/**
|
|
2284
|
-
*
|
|
2285
|
-
*
|
|
2286
|
-
*
|
|
2481
|
+
* This function debounce the received function
|
|
2482
|
+
* @param { function } func Function to be debounced
|
|
2483
|
+
* @param { number } wait Time to wait before execut the function
|
|
2484
|
+
* @param { boolean } immediate Param to define if the function will be executed immediately
|
|
2287
2485
|
*/
|
|
2486
|
+
const debounce = (func, wait, immediate) => {
|
|
2487
|
+
let timeout = null;
|
|
2488
|
+
return function debounced(...args) {
|
|
2489
|
+
const later = () => {
|
|
2490
|
+
timeout = null;
|
|
2491
|
+
if (!immediate) {
|
|
2492
|
+
func.apply(this, args);
|
|
2493
|
+
}
|
|
2494
|
+
};
|
|
2495
|
+
if (timeout) {
|
|
2496
|
+
clearTimeout(timeout);
|
|
2497
|
+
}
|
|
2498
|
+
timeout = setTimeout(later, wait);
|
|
2499
|
+
};
|
|
2500
|
+
};
|
|
2288
2501
|
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2502
|
+
const TooltipContent = ({ content }) => {
|
|
2503
|
+
return jsxRuntime.exports.jsx("span", { dangerouslySetInnerHTML: { __html: content } });
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
const DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID';
|
|
2507
|
+
const DEFAULT_CONTEXT_DATA = {
|
|
2508
|
+
anchorRefs: new Set(),
|
|
2509
|
+
activeAnchor: { current: null },
|
|
2510
|
+
attach: () => {
|
|
2511
|
+
/* attach anchor element */
|
|
2512
|
+
},
|
|
2513
|
+
detach: () => {
|
|
2514
|
+
/* detach anchor element */
|
|
2515
|
+
},
|
|
2516
|
+
setActiveAnchor: () => {
|
|
2517
|
+
/* set active anchor */
|
|
2518
|
+
},
|
|
2519
|
+
};
|
|
2520
|
+
const DEFAULT_CONTEXT_DATA_WRAPPER = {
|
|
2521
|
+
getTooltipData: () => DEFAULT_CONTEXT_DATA,
|
|
2522
|
+
};
|
|
2523
|
+
const TooltipContext = require$$0.createContext(DEFAULT_CONTEXT_DATA_WRAPPER);
|
|
2524
|
+
const TooltipProvider = ({ children }) => {
|
|
2525
|
+
const [anchorRefMap, setAnchorRefMap] = require$$0.useState({
|
|
2526
|
+
[DEFAULT_TOOLTIP_ID]: new Set(),
|
|
2527
|
+
});
|
|
2528
|
+
const [activeAnchorMap, setActiveAnchorMap] = require$$0.useState({
|
|
2529
|
+
[DEFAULT_TOOLTIP_ID]: { current: null },
|
|
2530
|
+
});
|
|
2531
|
+
const attach = (tooltipId, ...refs) => {
|
|
2532
|
+
setAnchorRefMap((oldMap) => {
|
|
2533
|
+
var _a;
|
|
2534
|
+
const tooltipRefs = (_a = oldMap[tooltipId]) !== null && _a !== void 0 ? _a : new Set();
|
|
2535
|
+
refs.forEach((ref) => tooltipRefs.add(ref));
|
|
2536
|
+
// create new object to trigger re-render
|
|
2537
|
+
return { ...oldMap, [tooltipId]: new Set(tooltipRefs) };
|
|
2538
|
+
});
|
|
2539
|
+
};
|
|
2540
|
+
const detach = (tooltipId, ...refs) => {
|
|
2541
|
+
setAnchorRefMap((oldMap) => {
|
|
2542
|
+
const tooltipRefs = oldMap[tooltipId];
|
|
2543
|
+
if (!tooltipRefs) {
|
|
2544
|
+
// tooltip not found
|
|
2545
|
+
// maybe thow error?
|
|
2546
|
+
return oldMap;
|
|
2547
|
+
}
|
|
2548
|
+
refs.forEach((ref) => tooltipRefs.delete(ref));
|
|
2549
|
+
// create new object to trigger re-render
|
|
2550
|
+
return { ...oldMap };
|
|
2551
|
+
});
|
|
2552
|
+
};
|
|
2553
|
+
const setActiveAnchor = (tooltipId, ref) => {
|
|
2554
|
+
setActiveAnchorMap((oldMap) => {
|
|
2555
|
+
var _a;
|
|
2556
|
+
if (((_a = oldMap[tooltipId]) === null || _a === void 0 ? void 0 : _a.current) === ref.current) {
|
|
2557
|
+
return oldMap;
|
|
2558
|
+
}
|
|
2559
|
+
// create new object to trigger re-render
|
|
2560
|
+
return { ...oldMap, [tooltipId]: ref };
|
|
2561
|
+
});
|
|
2562
|
+
};
|
|
2563
|
+
const getTooltipData = require$$0.useCallback((tooltipId = DEFAULT_TOOLTIP_ID) => {
|
|
2564
|
+
var _a, _b;
|
|
2565
|
+
return ({
|
|
2566
|
+
anchorRefs: (_a = anchorRefMap[tooltipId]) !== null && _a !== void 0 ? _a : new Set(),
|
|
2567
|
+
activeAnchor: (_b = activeAnchorMap[tooltipId]) !== null && _b !== void 0 ? _b : { current: null },
|
|
2568
|
+
attach: (...refs) => attach(tooltipId, ...refs),
|
|
2569
|
+
detach: (...refs) => detach(tooltipId, ...refs),
|
|
2570
|
+
setActiveAnchor: (ref) => setActiveAnchor(tooltipId, ref),
|
|
2571
|
+
});
|
|
2572
|
+
}, [anchorRefMap, activeAnchorMap, attach, detach]);
|
|
2573
|
+
const context = require$$0.useMemo(() => {
|
|
2574
|
+
return {
|
|
2575
|
+
getTooltipData,
|
|
2576
|
+
};
|
|
2577
|
+
}, [getTooltipData]);
|
|
2578
|
+
return jsxRuntime.exports.jsx(TooltipContext.Provider, { value: context, children: children });
|
|
2579
|
+
};
|
|
2580
|
+
function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {
|
|
2581
|
+
return require$$0.useContext(TooltipContext).getTooltipData(tooltipId);
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
const TooltipWrapper = ({ tooltipId, children, className, place, content, html, variant, offset, wrapper, events, positionStrategy, delayShow, delayHide, }) => {
|
|
2585
|
+
const { attach, detach } = useTooltip(tooltipId);
|
|
2586
|
+
const anchorRef = require$$0.useRef(null);
|
|
2587
|
+
require$$0.useEffect(() => {
|
|
2588
|
+
attach(anchorRef);
|
|
2589
|
+
return () => {
|
|
2590
|
+
detach(anchorRef);
|
|
2591
|
+
};
|
|
2592
|
+
}, []);
|
|
2593
|
+
return (jsxRuntime.exports.jsx("span", { ref: anchorRef, className: classNames('react-tooltip-wrapper', className), "data-tooltip-place": place, "data-tooltip-content": content, "data-tooltip-html": html, "data-tooltip-variant": variant, "data-tooltip-offset": offset, "data-tooltip-wrapper": wrapper, "data-tooltip-events": events, "data-tooltip-position-strategy": positionStrategy, "data-tooltip-delay-show": delayShow, "data-tooltip-delay-hide": delayHide, children: children }));
|
|
2594
|
+
};
|
|
2293
2595
|
|
|
2294
|
-
const computeTooltipPosition = async ({ elementReference = null, tooltipReference = null, tooltipArrowReference = null, place = 'top', offset: offsetValue = 10, strategy = 'absolute', }) => {
|
|
2596
|
+
const computeTooltipPosition = async ({ elementReference = null, tooltipReference = null, tooltipArrowReference = null, place = 'top', offset: offsetValue = 10, strategy = 'absolute', middlewares = [offset(Number(offsetValue)), flip(), shift({ padding: 5 })], }) => {
|
|
2295
2597
|
if (!elementReference) {
|
|
2296
2598
|
// elementReference can be null or undefined and we will not compute the position
|
|
2297
2599
|
// eslint-disable-next-line no-console
|
|
@@ -2301,7 +2603,7 @@ const computeTooltipPosition = async ({ elementReference = null, tooltipReferenc
|
|
|
2301
2603
|
if (tooltipReference === null) {
|
|
2302
2604
|
return { tooltipStyles: {}, tooltipArrowStyles: {} };
|
|
2303
2605
|
}
|
|
2304
|
-
const middleware =
|
|
2606
|
+
const middleware = middlewares;
|
|
2305
2607
|
if (tooltipArrowReference) {
|
|
2306
2608
|
middleware.push(arrow({ element: tooltipArrowReference, padding: 5 }));
|
|
2307
2609
|
return computePosition(elementReference, tooltipReference, {
|
|
@@ -2342,7 +2644,7 @@ var styles = {"tooltip":"styles-module_tooltip__mnnfp","fixed":"styles-module_fi
|
|
|
2342
2644
|
|
|
2343
2645
|
const Tooltip = ({
|
|
2344
2646
|
// props
|
|
2345
|
-
id, className, classNameArrow, variant = 'dark', anchorId, place = 'top', offset = 10, events = ['hover'], positionStrategy = 'absolute', wrapper: WrapperElement = 'div', children = null, delayShow = 0, delayHide = 0, float = false, noArrow = false, clickable = false, style: externalStyles, position, afterShow, afterHide,
|
|
2647
|
+
id, className, classNameArrow, variant = 'dark', anchorId, place = 'top', offset = 10, events = ['hover'], positionStrategy = 'absolute', middlewares, wrapper: WrapperElement = 'div', children = null, delayShow = 0, delayHide = 0, float = false, noArrow = false, clickable = false, style: externalStyles, position, afterShow, afterHide,
|
|
2346
2648
|
// props handled by controller
|
|
2347
2649
|
content, html, isOpen, setIsOpen, }) => {
|
|
2348
2650
|
const tooltipRef = require$$0.useRef(null);
|
|
@@ -2453,6 +2755,7 @@ content, html, isOpen, setIsOpen, }) => {
|
|
|
2453
2755
|
tooltipReference: tooltipRef.current,
|
|
2454
2756
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
2455
2757
|
strategy: positionStrategy,
|
|
2758
|
+
middlewares,
|
|
2456
2759
|
}).then((computedStylesData) => {
|
|
2457
2760
|
setCalculatingPosition(false);
|
|
2458
2761
|
if (Object.keys(computedStylesData.tooltipStyles).length) {
|
|
@@ -2583,6 +2886,7 @@ content, html, isOpen, setIsOpen, }) => {
|
|
|
2583
2886
|
tooltipReference: tooltipRef.current,
|
|
2584
2887
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
2585
2888
|
strategy: positionStrategy,
|
|
2889
|
+
middlewares,
|
|
2586
2890
|
}).then((computedStylesData) => {
|
|
2587
2891
|
if (!mounted) {
|
|
2588
2892
|
// invalidate computed positions after remount
|
|
@@ -2631,7 +2935,7 @@ content, html, isOpen, setIsOpen, }) => {
|
|
|
2631
2935
|
}), style: inlineArrowStyles, ref: tooltipArrowRef })] }));
|
|
2632
2936
|
};
|
|
2633
2937
|
|
|
2634
|
-
const TooltipController = ({ id, anchorId, content, html, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], positionStrategy = 'absolute', delayShow = 0, delayHide = 0, float = false, noArrow = false, clickable = false, style, position, isOpen, setIsOpen, afterShow, afterHide, }) => {
|
|
2938
|
+
const TooltipController = ({ id, anchorId, content, html, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], positionStrategy = 'absolute', middlewares, delayShow = 0, delayHide = 0, float = false, noArrow = false, clickable = false, style, position, isOpen, setIsOpen, afterShow, afterHide, }) => {
|
|
2635
2939
|
const [tooltipContent, setTooltipContent] = require$$0.useState(content);
|
|
2636
2940
|
const [tooltipHtml, setTooltipHtml] = require$$0.useState(html);
|
|
2637
2941
|
const [tooltipPlace, setTooltipPlace] = require$$0.useState(place);
|
|
@@ -2763,6 +3067,7 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
2763
3067
|
wrapper: tooltipWrapper,
|
|
2764
3068
|
events: tooltipEvents,
|
|
2765
3069
|
positionStrategy: tooltipPositionStrategy,
|
|
3070
|
+
middlewares,
|
|
2766
3071
|
delayShow: tooltipDelayShow,
|
|
2767
3072
|
delayHide: tooltipDelayHide,
|
|
2768
3073
|
float: tooltipFloat,
|
|
@@ -2781,3 +3086,9 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
2781
3086
|
exports.Tooltip = TooltipController;
|
|
2782
3087
|
exports.TooltipProvider = TooltipProvider;
|
|
2783
3088
|
exports.TooltipWrapper = TooltipWrapper;
|
|
3089
|
+
exports.autoPlacement = autoPlacement;
|
|
3090
|
+
exports.flip = flip;
|
|
3091
|
+
exports.inline = inline;
|
|
3092
|
+
exports.offset = offset;
|
|
3093
|
+
exports.shift = shift;
|
|
3094
|
+
exports.size = size;
|