@lukso/web-components 1.49.2 → 1.50.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/dist/components/index.cjs +7 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/lukso-button/index.cjs +1 -1
- package/dist/components/lukso-button/index.js +1 -1
- package/dist/components/lukso-card/index.cjs +2 -2
- package/dist/components/lukso-card/index.js +2 -2
- package/dist/components/lukso-checkbox/index.cjs +1 -1
- package/dist/components/lukso-checkbox/index.js +1 -1
- package/dist/components/lukso-footer/index.cjs +1 -1
- package/dist/components/lukso-footer/index.js +1 -1
- package/dist/components/lukso-icon/index.cjs +2 -2
- package/dist/components/lukso-icon/index.js +2 -2
- package/dist/components/lukso-input/index.cjs +1 -1
- package/dist/components/lukso-input/index.js +1 -1
- package/dist/components/lukso-modal/index.cjs +1 -1
- package/dist/components/lukso-modal/index.js +1 -1
- package/dist/components/lukso-navbar/index.cjs +2 -2
- package/dist/components/lukso-navbar/index.js +2 -2
- package/dist/components/lukso-profile/index.cjs +2 -2
- package/dist/components/lukso-profile/index.js +2 -2
- package/dist/components/lukso-progress/index.cjs +2 -2
- package/dist/components/lukso-progress/index.js +2 -2
- package/dist/components/lukso-sanitize/index.cjs +1 -1
- package/dist/components/lukso-sanitize/index.js +1 -1
- package/dist/components/lukso-search/index.cjs +2 -2
- package/dist/components/lukso-search/index.js +2 -2
- package/dist/components/lukso-select/index.cjs +4 -4
- package/dist/components/lukso-select/index.js +4 -4
- package/dist/components/lukso-share/index.cjs +1 -1
- package/dist/components/lukso-share/index.js +1 -1
- package/dist/components/lukso-switch/index.cjs +2 -2
- package/dist/components/lukso-switch/index.js +2 -2
- package/dist/components/lukso-tag/index.cjs +2 -2
- package/dist/components/lukso-tag/index.js +2 -2
- package/dist/components/lukso-terms/index.cjs +2 -2
- package/dist/components/lukso-terms/index.js +2 -2
- package/dist/components/lukso-test/index.cjs +1 -1
- package/dist/components/lukso-test/index.js +1 -1
- package/dist/components/lukso-tooltip/index.cjs +3613 -0
- package/dist/components/lukso-tooltip/index.d.ts +35 -0
- package/dist/components/lukso-tooltip/index.d.ts.map +1 -0
- package/dist/components/lukso-tooltip/index.js +3611 -0
- package/dist/components/lukso-tooltip/lukso-tooltip.stories.d.ts +27 -0
- package/dist/components/lukso-tooltip/lukso-tooltip.stories.d.ts.map +1 -0
- package/dist/components/lukso-username/index.cjs +1 -1
- package/dist/components/lukso-username/index.js +1 -1
- package/dist/components/lukso-wizard/index.cjs +1 -1
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/index-a134c0a6.js +39 -0
- package/dist/index-ae293272.cjs +46 -0
- package/dist/index.cjs +7 -2
- package/dist/index.js +3 -2
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{style-map-ea2513e4.cjs → style-map-761568c8.cjs} +1 -1
- package/dist/{style-map-b2a337a1.js → style-map-f7c09fa5.js} +1 -1
- package/package.json +8 -2
- package/dist/index-c04e4744.cjs +0 -46
- package/dist/index-cfea1b58.js +0 -39
|
@@ -0,0 +1,3613 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-ae293272.cjs');
|
|
6
|
+
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
|
+
const state = require('../../state-f73a8b4f.cjs');
|
|
8
|
+
const index = require('../../index-e9668573.cjs');
|
|
9
|
+
require('../../directive-8278ab14.cjs');
|
|
10
|
+
|
|
11
|
+
var top = 'top';
|
|
12
|
+
var bottom = 'bottom';
|
|
13
|
+
var right = 'right';
|
|
14
|
+
var left = 'left';
|
|
15
|
+
var auto = 'auto';
|
|
16
|
+
var basePlacements = [top, bottom, right, left];
|
|
17
|
+
var start = 'start';
|
|
18
|
+
var end = 'end';
|
|
19
|
+
var clippingParents = 'clippingParents';
|
|
20
|
+
var viewport = 'viewport';
|
|
21
|
+
var popper = 'popper';
|
|
22
|
+
var reference = 'reference';
|
|
23
|
+
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
|
|
24
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
25
|
+
}, []);
|
|
26
|
+
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
|
27
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
28
|
+
}, []); // modifiers that need to read the DOM
|
|
29
|
+
|
|
30
|
+
var beforeRead = 'beforeRead';
|
|
31
|
+
var read = 'read';
|
|
32
|
+
var afterRead = 'afterRead'; // pure-logic modifiers
|
|
33
|
+
|
|
34
|
+
var beforeMain = 'beforeMain';
|
|
35
|
+
var main = 'main';
|
|
36
|
+
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
|
37
|
+
|
|
38
|
+
var beforeWrite = 'beforeWrite';
|
|
39
|
+
var write = 'write';
|
|
40
|
+
var afterWrite = 'afterWrite';
|
|
41
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
42
|
+
|
|
43
|
+
function getNodeName(element) {
|
|
44
|
+
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getWindow(node) {
|
|
48
|
+
if (node == null) {
|
|
49
|
+
return window;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (node.toString() !== '[object Window]') {
|
|
53
|
+
var ownerDocument = node.ownerDocument;
|
|
54
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return node;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isElement$1(node) {
|
|
61
|
+
var OwnElement = getWindow(node).Element;
|
|
62
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isHTMLElement(node) {
|
|
66
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
67
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isShadowRoot(node) {
|
|
71
|
+
// IE 11 has no ShadowRoot
|
|
72
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
77
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// and applies them to the HTMLElements such as popper and arrow
|
|
81
|
+
|
|
82
|
+
function applyStyles(_ref) {
|
|
83
|
+
var state = _ref.state;
|
|
84
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
85
|
+
var style = state.styles[name] || {};
|
|
86
|
+
var attributes = state.attributes[name] || {};
|
|
87
|
+
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
88
|
+
|
|
89
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
90
|
+
return;
|
|
91
|
+
} // Flow doesn't support to extend this property, but it's the most
|
|
92
|
+
// effective way to apply styles to an HTMLElement
|
|
93
|
+
// $FlowFixMe[cannot-write]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
Object.assign(element.style, style);
|
|
97
|
+
Object.keys(attributes).forEach(function (name) {
|
|
98
|
+
var value = attributes[name];
|
|
99
|
+
|
|
100
|
+
if (value === false) {
|
|
101
|
+
element.removeAttribute(name);
|
|
102
|
+
} else {
|
|
103
|
+
element.setAttribute(name, value === true ? '' : value);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function effect$2(_ref2) {
|
|
110
|
+
var state = _ref2.state;
|
|
111
|
+
var initialStyles = {
|
|
112
|
+
popper: {
|
|
113
|
+
position: state.options.strategy,
|
|
114
|
+
left: '0',
|
|
115
|
+
top: '0',
|
|
116
|
+
margin: '0'
|
|
117
|
+
},
|
|
118
|
+
arrow: {
|
|
119
|
+
position: 'absolute'
|
|
120
|
+
},
|
|
121
|
+
reference: {}
|
|
122
|
+
};
|
|
123
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
124
|
+
state.styles = initialStyles;
|
|
125
|
+
|
|
126
|
+
if (state.elements.arrow) {
|
|
127
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return function () {
|
|
131
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
132
|
+
var element = state.elements[name];
|
|
133
|
+
var attributes = state.attributes[name] || {};
|
|
134
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
|
135
|
+
|
|
136
|
+
var style = styleProperties.reduce(function (style, property) {
|
|
137
|
+
style[property] = '';
|
|
138
|
+
return style;
|
|
139
|
+
}, {}); // arrow is optional + virtual elements
|
|
140
|
+
|
|
141
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
Object.assign(element.style, style);
|
|
146
|
+
Object.keys(attributes).forEach(function (attribute) {
|
|
147
|
+
element.removeAttribute(attribute);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
const applyStyles$1 = {
|
|
155
|
+
name: 'applyStyles',
|
|
156
|
+
enabled: true,
|
|
157
|
+
phase: 'write',
|
|
158
|
+
fn: applyStyles,
|
|
159
|
+
effect: effect$2,
|
|
160
|
+
requires: ['computeStyles']
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
function getBasePlacement$1(placement) {
|
|
164
|
+
return placement.split('-')[0];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var max = Math.max;
|
|
168
|
+
var min = Math.min;
|
|
169
|
+
var round = Math.round;
|
|
170
|
+
|
|
171
|
+
function getUAString() {
|
|
172
|
+
var uaData = navigator.userAgentData;
|
|
173
|
+
|
|
174
|
+
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
175
|
+
return uaData.brands.map(function (item) {
|
|
176
|
+
return item.brand + "/" + item.version;
|
|
177
|
+
}).join(' ');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return navigator.userAgent;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function isLayoutViewport() {
|
|
184
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
188
|
+
if (includeScale === void 0) {
|
|
189
|
+
includeScale = false;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (isFixedStrategy === void 0) {
|
|
193
|
+
isFixedStrategy = false;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var clientRect = element.getBoundingClientRect();
|
|
197
|
+
var scaleX = 1;
|
|
198
|
+
var scaleY = 1;
|
|
199
|
+
|
|
200
|
+
if (includeScale && isHTMLElement(element)) {
|
|
201
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
202
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
var _ref = isElement$1(element) ? getWindow(element) : window,
|
|
206
|
+
visualViewport = _ref.visualViewport;
|
|
207
|
+
|
|
208
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
209
|
+
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
210
|
+
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
211
|
+
var width = clientRect.width / scaleX;
|
|
212
|
+
var height = clientRect.height / scaleY;
|
|
213
|
+
return {
|
|
214
|
+
width: width,
|
|
215
|
+
height: height,
|
|
216
|
+
top: y,
|
|
217
|
+
right: x + width,
|
|
218
|
+
bottom: y + height,
|
|
219
|
+
left: x,
|
|
220
|
+
x: x,
|
|
221
|
+
y: y
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// means it doesn't take into account transforms.
|
|
226
|
+
|
|
227
|
+
function getLayoutRect(element) {
|
|
228
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
229
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
230
|
+
|
|
231
|
+
var width = element.offsetWidth;
|
|
232
|
+
var height = element.offsetHeight;
|
|
233
|
+
|
|
234
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
235
|
+
width = clientRect.width;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
239
|
+
height = clientRect.height;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return {
|
|
243
|
+
x: element.offsetLeft,
|
|
244
|
+
y: element.offsetTop,
|
|
245
|
+
width: width,
|
|
246
|
+
height: height
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function contains(parent, child) {
|
|
251
|
+
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
|
252
|
+
|
|
253
|
+
if (parent.contains(child)) {
|
|
254
|
+
return true;
|
|
255
|
+
} // then fallback to custom implementation with Shadow DOM support
|
|
256
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
257
|
+
var next = child;
|
|
258
|
+
|
|
259
|
+
do {
|
|
260
|
+
if (next && parent.isSameNode(next)) {
|
|
261
|
+
return true;
|
|
262
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
next = next.parentNode || next.host;
|
|
266
|
+
} while (next);
|
|
267
|
+
} // Give up, the result is false
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function getComputedStyle(element) {
|
|
274
|
+
return getWindow(element).getComputedStyle(element);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function isTableElement(element) {
|
|
278
|
+
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function getDocumentElement(element) {
|
|
282
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
283
|
+
return ((isElement$1(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
284
|
+
element.document) || window.document).documentElement;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function getParentNode(element) {
|
|
288
|
+
if (getNodeName(element) === 'html') {
|
|
289
|
+
return element;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
293
|
+
// $FlowFixMe[incompatible-return]
|
|
294
|
+
// $FlowFixMe[prop-missing]
|
|
295
|
+
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
296
|
+
element.parentNode || ( // DOM Element detected
|
|
297
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
298
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
299
|
+
getDocumentElement(element) // fallback
|
|
300
|
+
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function getTrueOffsetParent(element) {
|
|
305
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
306
|
+
getComputedStyle(element).position === 'fixed') {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return element.offsetParent;
|
|
311
|
+
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
|
312
|
+
// return the containing block
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
function getContainingBlock(element) {
|
|
316
|
+
var isFirefox = /firefox/i.test(getUAString());
|
|
317
|
+
var isIE = /Trident/i.test(getUAString());
|
|
318
|
+
|
|
319
|
+
if (isIE && isHTMLElement(element)) {
|
|
320
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
321
|
+
var elementCss = getComputedStyle(element);
|
|
322
|
+
|
|
323
|
+
if (elementCss.position === 'fixed') {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
var currentNode = getParentNode(element);
|
|
329
|
+
|
|
330
|
+
if (isShadowRoot(currentNode)) {
|
|
331
|
+
currentNode = currentNode.host;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
335
|
+
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
336
|
+
// create a containing block.
|
|
337
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
338
|
+
|
|
339
|
+
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
|
340
|
+
return currentNode;
|
|
341
|
+
} else {
|
|
342
|
+
currentNode = currentNode.parentNode;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return null;
|
|
347
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
348
|
+
// such as table ancestors and cross browser bugs.
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
function getOffsetParent(element) {
|
|
352
|
+
var window = getWindow(element);
|
|
353
|
+
var offsetParent = getTrueOffsetParent(element);
|
|
354
|
+
|
|
355
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
356
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
|
360
|
+
return window;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function getMainAxisFromPlacement(placement) {
|
|
367
|
+
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function within(min$1, value, max$1) {
|
|
371
|
+
return max(min$1, min(value, max$1));
|
|
372
|
+
}
|
|
373
|
+
function withinMaxClamp(min, value, max) {
|
|
374
|
+
var v = within(min, value, max);
|
|
375
|
+
return v > max ? max : v;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function getFreshSideObject() {
|
|
379
|
+
return {
|
|
380
|
+
top: 0,
|
|
381
|
+
right: 0,
|
|
382
|
+
bottom: 0,
|
|
383
|
+
left: 0
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function mergePaddingObject(paddingObject) {
|
|
388
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function expandToHashMap(value, keys) {
|
|
392
|
+
return keys.reduce(function (hashMap, key) {
|
|
393
|
+
hashMap[key] = value;
|
|
394
|
+
return hashMap;
|
|
395
|
+
}, {});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
399
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
400
|
+
placement: state.placement
|
|
401
|
+
})) : padding;
|
|
402
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
function arrow(_ref) {
|
|
406
|
+
var _state$modifiersData$;
|
|
407
|
+
|
|
408
|
+
var state = _ref.state,
|
|
409
|
+
name = _ref.name,
|
|
410
|
+
options = _ref.options;
|
|
411
|
+
var arrowElement = state.elements.arrow;
|
|
412
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
413
|
+
var basePlacement = getBasePlacement$1(state.placement);
|
|
414
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
|
415
|
+
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
416
|
+
var len = isVertical ? 'height' : 'width';
|
|
417
|
+
|
|
418
|
+
if (!arrowElement || !popperOffsets) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
423
|
+
var arrowRect = getLayoutRect(arrowElement);
|
|
424
|
+
var minProp = axis === 'y' ? top : left;
|
|
425
|
+
var maxProp = axis === 'y' ? bottom : right;
|
|
426
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
427
|
+
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
428
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
429
|
+
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
430
|
+
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
431
|
+
// outside of the popper bounds
|
|
432
|
+
|
|
433
|
+
var min = paddingObject[minProp];
|
|
434
|
+
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
435
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
436
|
+
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
|
437
|
+
|
|
438
|
+
var axisProp = axis;
|
|
439
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function effect$1(_ref2) {
|
|
443
|
+
var state = _ref2.state,
|
|
444
|
+
options = _ref2.options;
|
|
445
|
+
var _options$element = options.element,
|
|
446
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
447
|
+
|
|
448
|
+
if (arrowElement == null) {
|
|
449
|
+
return;
|
|
450
|
+
} // CSS selector
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
if (typeof arrowElement === 'string') {
|
|
454
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
455
|
+
|
|
456
|
+
if (!arrowElement) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
state.elements.arrow = arrowElement;
|
|
466
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
const arrow$1 = {
|
|
470
|
+
name: 'arrow',
|
|
471
|
+
enabled: true,
|
|
472
|
+
phase: 'main',
|
|
473
|
+
fn: arrow,
|
|
474
|
+
effect: effect$1,
|
|
475
|
+
requires: ['popperOffsets'],
|
|
476
|
+
requiresIfExists: ['preventOverflow']
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
function getVariation(placement) {
|
|
480
|
+
return placement.split('-')[1];
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var unsetSides = {
|
|
484
|
+
top: 'auto',
|
|
485
|
+
right: 'auto',
|
|
486
|
+
bottom: 'auto',
|
|
487
|
+
left: 'auto'
|
|
488
|
+
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
|
489
|
+
// Zooming can change the DPR, but it seems to report a value that will
|
|
490
|
+
// cleanly divide the values into the appropriate subpixels.
|
|
491
|
+
|
|
492
|
+
function roundOffsetsByDPR(_ref, win) {
|
|
493
|
+
var x = _ref.x,
|
|
494
|
+
y = _ref.y;
|
|
495
|
+
var dpr = win.devicePixelRatio || 1;
|
|
496
|
+
return {
|
|
497
|
+
x: round(x * dpr) / dpr || 0,
|
|
498
|
+
y: round(y * dpr) / dpr || 0
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function mapToStyles(_ref2) {
|
|
503
|
+
var _Object$assign2;
|
|
504
|
+
|
|
505
|
+
var popper = _ref2.popper,
|
|
506
|
+
popperRect = _ref2.popperRect,
|
|
507
|
+
placement = _ref2.placement,
|
|
508
|
+
variation = _ref2.variation,
|
|
509
|
+
offsets = _ref2.offsets,
|
|
510
|
+
position = _ref2.position,
|
|
511
|
+
gpuAcceleration = _ref2.gpuAcceleration,
|
|
512
|
+
adaptive = _ref2.adaptive,
|
|
513
|
+
roundOffsets = _ref2.roundOffsets,
|
|
514
|
+
isFixed = _ref2.isFixed;
|
|
515
|
+
var _offsets$x = offsets.x,
|
|
516
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
517
|
+
_offsets$y = offsets.y,
|
|
518
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
519
|
+
|
|
520
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
521
|
+
x: x,
|
|
522
|
+
y: y
|
|
523
|
+
}) : {
|
|
524
|
+
x: x,
|
|
525
|
+
y: y
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
x = _ref3.x;
|
|
529
|
+
y = _ref3.y;
|
|
530
|
+
var hasX = offsets.hasOwnProperty('x');
|
|
531
|
+
var hasY = offsets.hasOwnProperty('y');
|
|
532
|
+
var sideX = left;
|
|
533
|
+
var sideY = top;
|
|
534
|
+
var win = window;
|
|
535
|
+
|
|
536
|
+
if (adaptive) {
|
|
537
|
+
var offsetParent = getOffsetParent(popper);
|
|
538
|
+
var heightProp = 'clientHeight';
|
|
539
|
+
var widthProp = 'clientWidth';
|
|
540
|
+
|
|
541
|
+
if (offsetParent === getWindow(popper)) {
|
|
542
|
+
offsetParent = getDocumentElement(popper);
|
|
543
|
+
|
|
544
|
+
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
|
545
|
+
heightProp = 'scrollHeight';
|
|
546
|
+
widthProp = 'scrollWidth';
|
|
547
|
+
}
|
|
548
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
offsetParent = offsetParent;
|
|
552
|
+
|
|
553
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
554
|
+
sideY = bottom;
|
|
555
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
556
|
+
offsetParent[heightProp];
|
|
557
|
+
y -= offsetY - popperRect.height;
|
|
558
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
562
|
+
sideX = right;
|
|
563
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
564
|
+
offsetParent[widthProp];
|
|
565
|
+
x -= offsetX - popperRect.width;
|
|
566
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
var commonStyles = Object.assign({
|
|
571
|
+
position: position
|
|
572
|
+
}, adaptive && unsetSides);
|
|
573
|
+
|
|
574
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
575
|
+
x: x,
|
|
576
|
+
y: y
|
|
577
|
+
}, getWindow(popper)) : {
|
|
578
|
+
x: x,
|
|
579
|
+
y: y
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
x = _ref4.x;
|
|
583
|
+
y = _ref4.y;
|
|
584
|
+
|
|
585
|
+
if (gpuAcceleration) {
|
|
586
|
+
var _Object$assign;
|
|
587
|
+
|
|
588
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function computeStyles(_ref5) {
|
|
595
|
+
var state = _ref5.state,
|
|
596
|
+
options = _ref5.options;
|
|
597
|
+
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
598
|
+
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
599
|
+
_options$adaptive = options.adaptive,
|
|
600
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
601
|
+
_options$roundOffsets = options.roundOffsets,
|
|
602
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
603
|
+
var commonStyles = {
|
|
604
|
+
placement: getBasePlacement$1(state.placement),
|
|
605
|
+
variation: getVariation(state.placement),
|
|
606
|
+
popper: state.elements.popper,
|
|
607
|
+
popperRect: state.rects.popper,
|
|
608
|
+
gpuAcceleration: gpuAcceleration,
|
|
609
|
+
isFixed: state.options.strategy === 'fixed'
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
613
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
614
|
+
offsets: state.modifiersData.popperOffsets,
|
|
615
|
+
position: state.options.strategy,
|
|
616
|
+
adaptive: adaptive,
|
|
617
|
+
roundOffsets: roundOffsets
|
|
618
|
+
})));
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if (state.modifiersData.arrow != null) {
|
|
622
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
623
|
+
offsets: state.modifiersData.arrow,
|
|
624
|
+
position: 'absolute',
|
|
625
|
+
adaptive: false,
|
|
626
|
+
roundOffsets: roundOffsets
|
|
627
|
+
})));
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
631
|
+
'data-popper-placement': state.placement
|
|
632
|
+
});
|
|
633
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
const computeStyles$1 = {
|
|
637
|
+
name: 'computeStyles',
|
|
638
|
+
enabled: true,
|
|
639
|
+
phase: 'beforeWrite',
|
|
640
|
+
fn: computeStyles,
|
|
641
|
+
data: {}
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
var passive = {
|
|
645
|
+
passive: true
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
function effect(_ref) {
|
|
649
|
+
var state = _ref.state,
|
|
650
|
+
instance = _ref.instance,
|
|
651
|
+
options = _ref.options;
|
|
652
|
+
var _options$scroll = options.scroll,
|
|
653
|
+
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
654
|
+
_options$resize = options.resize,
|
|
655
|
+
resize = _options$resize === void 0 ? true : _options$resize;
|
|
656
|
+
var window = getWindow(state.elements.popper);
|
|
657
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
658
|
+
|
|
659
|
+
if (scroll) {
|
|
660
|
+
scrollParents.forEach(function (scrollParent) {
|
|
661
|
+
scrollParent.addEventListener('scroll', instance.update, passive);
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (resize) {
|
|
666
|
+
window.addEventListener('resize', instance.update, passive);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return function () {
|
|
670
|
+
if (scroll) {
|
|
671
|
+
scrollParents.forEach(function (scrollParent) {
|
|
672
|
+
scrollParent.removeEventListener('scroll', instance.update, passive);
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (resize) {
|
|
677
|
+
window.removeEventListener('resize', instance.update, passive);
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
const eventListeners = {
|
|
684
|
+
name: 'eventListeners',
|
|
685
|
+
enabled: true,
|
|
686
|
+
phase: 'write',
|
|
687
|
+
fn: function fn() {},
|
|
688
|
+
effect: effect,
|
|
689
|
+
data: {}
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
var hash$1 = {
|
|
693
|
+
left: 'right',
|
|
694
|
+
right: 'left',
|
|
695
|
+
bottom: 'top',
|
|
696
|
+
top: 'bottom'
|
|
697
|
+
};
|
|
698
|
+
function getOppositePlacement(placement) {
|
|
699
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
700
|
+
return hash$1[matched];
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
var hash = {
|
|
705
|
+
start: 'end',
|
|
706
|
+
end: 'start'
|
|
707
|
+
};
|
|
708
|
+
function getOppositeVariationPlacement(placement) {
|
|
709
|
+
return placement.replace(/start|end/g, function (matched) {
|
|
710
|
+
return hash[matched];
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function getWindowScroll(node) {
|
|
715
|
+
var win = getWindow(node);
|
|
716
|
+
var scrollLeft = win.pageXOffset;
|
|
717
|
+
var scrollTop = win.pageYOffset;
|
|
718
|
+
return {
|
|
719
|
+
scrollLeft: scrollLeft,
|
|
720
|
+
scrollTop: scrollTop
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
function getWindowScrollBarX(element) {
|
|
725
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
726
|
+
// incorrect for RTL.
|
|
727
|
+
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
728
|
+
// it's not an issue. I don't think anyone ever specifies width on <html>
|
|
729
|
+
// anyway.
|
|
730
|
+
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
731
|
+
// this (e.g. Edge 2019, IE11, Safari)
|
|
732
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
function getViewportRect(element, strategy) {
|
|
736
|
+
var win = getWindow(element);
|
|
737
|
+
var html = getDocumentElement(element);
|
|
738
|
+
var visualViewport = win.visualViewport;
|
|
739
|
+
var width = html.clientWidth;
|
|
740
|
+
var height = html.clientHeight;
|
|
741
|
+
var x = 0;
|
|
742
|
+
var y = 0;
|
|
743
|
+
|
|
744
|
+
if (visualViewport) {
|
|
745
|
+
width = visualViewport.width;
|
|
746
|
+
height = visualViewport.height;
|
|
747
|
+
var layoutViewport = isLayoutViewport();
|
|
748
|
+
|
|
749
|
+
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
750
|
+
x = visualViewport.offsetLeft;
|
|
751
|
+
y = visualViewport.offsetTop;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return {
|
|
756
|
+
width: width,
|
|
757
|
+
height: height,
|
|
758
|
+
x: x + getWindowScrollBarX(element),
|
|
759
|
+
y: y
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
764
|
+
|
|
765
|
+
function getDocumentRect(element) {
|
|
766
|
+
var _element$ownerDocumen;
|
|
767
|
+
|
|
768
|
+
var html = getDocumentElement(element);
|
|
769
|
+
var winScroll = getWindowScroll(element);
|
|
770
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
771
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
772
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
773
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
774
|
+
var y = -winScroll.scrollTop;
|
|
775
|
+
|
|
776
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
777
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
return {
|
|
781
|
+
width: width,
|
|
782
|
+
height: height,
|
|
783
|
+
x: x,
|
|
784
|
+
y: y
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
function isScrollParent(element) {
|
|
789
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
790
|
+
var _getComputedStyle = getComputedStyle(element),
|
|
791
|
+
overflow = _getComputedStyle.overflow,
|
|
792
|
+
overflowX = _getComputedStyle.overflowX,
|
|
793
|
+
overflowY = _getComputedStyle.overflowY;
|
|
794
|
+
|
|
795
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function getScrollParent(node) {
|
|
799
|
+
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
800
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
801
|
+
return node.ownerDocument.body;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
805
|
+
return node;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
return getScrollParent(getParentNode(node));
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/*
|
|
812
|
+
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
813
|
+
until we get to the top window object. This list is what we attach scroll listeners
|
|
814
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
815
|
+
reference element's position.
|
|
816
|
+
*/
|
|
817
|
+
|
|
818
|
+
function listScrollParents(element, list) {
|
|
819
|
+
var _element$ownerDocumen;
|
|
820
|
+
|
|
821
|
+
if (list === void 0) {
|
|
822
|
+
list = [];
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
var scrollParent = getScrollParent(element);
|
|
826
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
827
|
+
var win = getWindow(scrollParent);
|
|
828
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
829
|
+
var updatedList = list.concat(target);
|
|
830
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
831
|
+
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
function rectToClientRect(rect) {
|
|
835
|
+
return Object.assign({}, rect, {
|
|
836
|
+
left: rect.x,
|
|
837
|
+
top: rect.y,
|
|
838
|
+
right: rect.x + rect.width,
|
|
839
|
+
bottom: rect.y + rect.height
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
844
|
+
var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
845
|
+
rect.top = rect.top + element.clientTop;
|
|
846
|
+
rect.left = rect.left + element.clientLeft;
|
|
847
|
+
rect.bottom = rect.top + element.clientHeight;
|
|
848
|
+
rect.right = rect.left + element.clientWidth;
|
|
849
|
+
rect.width = element.clientWidth;
|
|
850
|
+
rect.height = element.clientHeight;
|
|
851
|
+
rect.x = rect.left;
|
|
852
|
+
rect.y = rect.top;
|
|
853
|
+
return rect;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
857
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
858
|
+
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
859
|
+
// clipping (or hiding) overflowing elements with a position different from
|
|
860
|
+
// `initial`
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
function getClippingParents(element) {
|
|
864
|
+
var clippingParents = listScrollParents(getParentNode(element));
|
|
865
|
+
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
|
866
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
867
|
+
|
|
868
|
+
if (!isElement$1(clipperElement)) {
|
|
869
|
+
return [];
|
|
870
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
return clippingParents.filter(function (clippingParent) {
|
|
874
|
+
return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
875
|
+
});
|
|
876
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
877
|
+
// clipping parents
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
881
|
+
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
|
882
|
+
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
|
883
|
+
var firstClippingParent = clippingParents[0];
|
|
884
|
+
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
885
|
+
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
886
|
+
accRect.top = max(rect.top, accRect.top);
|
|
887
|
+
accRect.right = min(rect.right, accRect.right);
|
|
888
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
889
|
+
accRect.left = max(rect.left, accRect.left);
|
|
890
|
+
return accRect;
|
|
891
|
+
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
892
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
893
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
894
|
+
clippingRect.x = clippingRect.left;
|
|
895
|
+
clippingRect.y = clippingRect.top;
|
|
896
|
+
return clippingRect;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
function computeOffsets(_ref) {
|
|
900
|
+
var reference = _ref.reference,
|
|
901
|
+
element = _ref.element,
|
|
902
|
+
placement = _ref.placement;
|
|
903
|
+
var basePlacement = placement ? getBasePlacement$1(placement) : null;
|
|
904
|
+
var variation = placement ? getVariation(placement) : null;
|
|
905
|
+
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
906
|
+
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
907
|
+
var offsets;
|
|
908
|
+
|
|
909
|
+
switch (basePlacement) {
|
|
910
|
+
case top:
|
|
911
|
+
offsets = {
|
|
912
|
+
x: commonX,
|
|
913
|
+
y: reference.y - element.height
|
|
914
|
+
};
|
|
915
|
+
break;
|
|
916
|
+
|
|
917
|
+
case bottom:
|
|
918
|
+
offsets = {
|
|
919
|
+
x: commonX,
|
|
920
|
+
y: reference.y + reference.height
|
|
921
|
+
};
|
|
922
|
+
break;
|
|
923
|
+
|
|
924
|
+
case right:
|
|
925
|
+
offsets = {
|
|
926
|
+
x: reference.x + reference.width,
|
|
927
|
+
y: commonY
|
|
928
|
+
};
|
|
929
|
+
break;
|
|
930
|
+
|
|
931
|
+
case left:
|
|
932
|
+
offsets = {
|
|
933
|
+
x: reference.x - element.width,
|
|
934
|
+
y: commonY
|
|
935
|
+
};
|
|
936
|
+
break;
|
|
937
|
+
|
|
938
|
+
default:
|
|
939
|
+
offsets = {
|
|
940
|
+
x: reference.x,
|
|
941
|
+
y: reference.y
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
946
|
+
|
|
947
|
+
if (mainAxis != null) {
|
|
948
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
949
|
+
|
|
950
|
+
switch (variation) {
|
|
951
|
+
case start:
|
|
952
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
953
|
+
break;
|
|
954
|
+
|
|
955
|
+
case end:
|
|
956
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
957
|
+
break;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
return offsets;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function detectOverflow(state, options) {
|
|
965
|
+
if (options === void 0) {
|
|
966
|
+
options = {};
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
var _options = options,
|
|
970
|
+
_options$placement = _options.placement,
|
|
971
|
+
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
|
972
|
+
_options$strategy = _options.strategy,
|
|
973
|
+
strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
|
|
974
|
+
_options$boundary = _options.boundary,
|
|
975
|
+
boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
|
976
|
+
_options$rootBoundary = _options.rootBoundary,
|
|
977
|
+
rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
|
978
|
+
_options$elementConte = _options.elementContext,
|
|
979
|
+
elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
|
980
|
+
_options$altBoundary = _options.altBoundary,
|
|
981
|
+
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
|
982
|
+
_options$padding = _options.padding,
|
|
983
|
+
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
984
|
+
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
985
|
+
var altContext = elementContext === popper ? reference : popper;
|
|
986
|
+
var popperRect = state.rects.popper;
|
|
987
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
988
|
+
var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
989
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
990
|
+
var popperOffsets = computeOffsets({
|
|
991
|
+
reference: referenceClientRect,
|
|
992
|
+
element: popperRect,
|
|
993
|
+
strategy: 'absolute',
|
|
994
|
+
placement: placement
|
|
995
|
+
});
|
|
996
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
997
|
+
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
998
|
+
// 0 or negative = within the clipping rect
|
|
999
|
+
|
|
1000
|
+
var overflowOffsets = {
|
|
1001
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
1002
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
1003
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
1004
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
1005
|
+
};
|
|
1006
|
+
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
|
1007
|
+
|
|
1008
|
+
if (elementContext === popper && offsetData) {
|
|
1009
|
+
var offset = offsetData[placement];
|
|
1010
|
+
Object.keys(overflowOffsets).forEach(function (key) {
|
|
1011
|
+
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
1012
|
+
var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
|
1013
|
+
overflowOffsets[key] += offset[axis] * multiply;
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
return overflowOffsets;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
function computeAutoPlacement(state, options) {
|
|
1021
|
+
if (options === void 0) {
|
|
1022
|
+
options = {};
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
var _options = options,
|
|
1026
|
+
placement = _options.placement,
|
|
1027
|
+
boundary = _options.boundary,
|
|
1028
|
+
rootBoundary = _options.rootBoundary,
|
|
1029
|
+
padding = _options.padding,
|
|
1030
|
+
flipVariations = _options.flipVariations,
|
|
1031
|
+
_options$allowedAutoP = _options.allowedAutoPlacements,
|
|
1032
|
+
allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
1033
|
+
var variation = getVariation(placement);
|
|
1034
|
+
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
|
1035
|
+
return getVariation(placement) === variation;
|
|
1036
|
+
}) : basePlacements;
|
|
1037
|
+
var allowedPlacements = placements$1.filter(function (placement) {
|
|
1038
|
+
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
1039
|
+
});
|
|
1040
|
+
|
|
1041
|
+
if (allowedPlacements.length === 0) {
|
|
1042
|
+
allowedPlacements = placements$1;
|
|
1043
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
1047
|
+
acc[placement] = detectOverflow(state, {
|
|
1048
|
+
placement: placement,
|
|
1049
|
+
boundary: boundary,
|
|
1050
|
+
rootBoundary: rootBoundary,
|
|
1051
|
+
padding: padding
|
|
1052
|
+
})[getBasePlacement$1(placement)];
|
|
1053
|
+
return acc;
|
|
1054
|
+
}, {});
|
|
1055
|
+
return Object.keys(overflows).sort(function (a, b) {
|
|
1056
|
+
return overflows[a] - overflows[b];
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
function getExpandedFallbackPlacements(placement) {
|
|
1061
|
+
if (getBasePlacement$1(placement) === auto) {
|
|
1062
|
+
return [];
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
var oppositePlacement = getOppositePlacement(placement);
|
|
1066
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
function flip(_ref) {
|
|
1070
|
+
var state = _ref.state,
|
|
1071
|
+
options = _ref.options,
|
|
1072
|
+
name = _ref.name;
|
|
1073
|
+
|
|
1074
|
+
if (state.modifiersData[name]._skip) {
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
var _options$mainAxis = options.mainAxis,
|
|
1079
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
1080
|
+
_options$altAxis = options.altAxis,
|
|
1081
|
+
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
|
1082
|
+
specifiedFallbackPlacements = options.fallbackPlacements,
|
|
1083
|
+
padding = options.padding,
|
|
1084
|
+
boundary = options.boundary,
|
|
1085
|
+
rootBoundary = options.rootBoundary,
|
|
1086
|
+
altBoundary = options.altBoundary,
|
|
1087
|
+
_options$flipVariatio = options.flipVariations,
|
|
1088
|
+
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
|
1089
|
+
allowedAutoPlacements = options.allowedAutoPlacements;
|
|
1090
|
+
var preferredPlacement = state.options.placement;
|
|
1091
|
+
var basePlacement = getBasePlacement$1(preferredPlacement);
|
|
1092
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
|
1093
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
1094
|
+
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
1095
|
+
return acc.concat(getBasePlacement$1(placement) === auto ? computeAutoPlacement(state, {
|
|
1096
|
+
placement: placement,
|
|
1097
|
+
boundary: boundary,
|
|
1098
|
+
rootBoundary: rootBoundary,
|
|
1099
|
+
padding: padding,
|
|
1100
|
+
flipVariations: flipVariations,
|
|
1101
|
+
allowedAutoPlacements: allowedAutoPlacements
|
|
1102
|
+
}) : placement);
|
|
1103
|
+
}, []);
|
|
1104
|
+
var referenceRect = state.rects.reference;
|
|
1105
|
+
var popperRect = state.rects.popper;
|
|
1106
|
+
var checksMap = new Map();
|
|
1107
|
+
var makeFallbackChecks = true;
|
|
1108
|
+
var firstFittingPlacement = placements[0];
|
|
1109
|
+
|
|
1110
|
+
for (var i = 0; i < placements.length; i++) {
|
|
1111
|
+
var placement = placements[i];
|
|
1112
|
+
|
|
1113
|
+
var _basePlacement = getBasePlacement$1(placement);
|
|
1114
|
+
|
|
1115
|
+
var isStartVariation = getVariation(placement) === start;
|
|
1116
|
+
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
1117
|
+
var len = isVertical ? 'width' : 'height';
|
|
1118
|
+
var overflow = detectOverflow(state, {
|
|
1119
|
+
placement: placement,
|
|
1120
|
+
boundary: boundary,
|
|
1121
|
+
rootBoundary: rootBoundary,
|
|
1122
|
+
altBoundary: altBoundary,
|
|
1123
|
+
padding: padding
|
|
1124
|
+
});
|
|
1125
|
+
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
1126
|
+
|
|
1127
|
+
if (referenceRect[len] > popperRect[len]) {
|
|
1128
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
1132
|
+
var checks = [];
|
|
1133
|
+
|
|
1134
|
+
if (checkMainAxis) {
|
|
1135
|
+
checks.push(overflow[_basePlacement] <= 0);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
if (checkAltAxis) {
|
|
1139
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
if (checks.every(function (check) {
|
|
1143
|
+
return check;
|
|
1144
|
+
})) {
|
|
1145
|
+
firstFittingPlacement = placement;
|
|
1146
|
+
makeFallbackChecks = false;
|
|
1147
|
+
break;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
checksMap.set(placement, checks);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
if (makeFallbackChecks) {
|
|
1154
|
+
// `2` may be desired in some cases – research later
|
|
1155
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
|
1156
|
+
|
|
1157
|
+
var _loop = function _loop(_i) {
|
|
1158
|
+
var fittingPlacement = placements.find(function (placement) {
|
|
1159
|
+
var checks = checksMap.get(placement);
|
|
1160
|
+
|
|
1161
|
+
if (checks) {
|
|
1162
|
+
return checks.slice(0, _i).every(function (check) {
|
|
1163
|
+
return check;
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
if (fittingPlacement) {
|
|
1169
|
+
firstFittingPlacement = fittingPlacement;
|
|
1170
|
+
return "break";
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
1175
|
+
var _ret = _loop(_i);
|
|
1176
|
+
|
|
1177
|
+
if (_ret === "break") break;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
if (state.placement !== firstFittingPlacement) {
|
|
1182
|
+
state.modifiersData[name]._skip = true;
|
|
1183
|
+
state.placement = firstFittingPlacement;
|
|
1184
|
+
state.reset = true;
|
|
1185
|
+
}
|
|
1186
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
const flip$1 = {
|
|
1190
|
+
name: 'flip',
|
|
1191
|
+
enabled: true,
|
|
1192
|
+
phase: 'main',
|
|
1193
|
+
fn: flip,
|
|
1194
|
+
requiresIfExists: ['offset'],
|
|
1195
|
+
data: {
|
|
1196
|
+
_skip: false
|
|
1197
|
+
}
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
1201
|
+
if (preventedOffsets === void 0) {
|
|
1202
|
+
preventedOffsets = {
|
|
1203
|
+
x: 0,
|
|
1204
|
+
y: 0
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
return {
|
|
1209
|
+
top: overflow.top - rect.height - preventedOffsets.y,
|
|
1210
|
+
right: overflow.right - rect.width + preventedOffsets.x,
|
|
1211
|
+
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
1212
|
+
left: overflow.left - rect.width - preventedOffsets.x
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
function isAnySideFullyClipped(overflow) {
|
|
1217
|
+
return [top, right, bottom, left].some(function (side) {
|
|
1218
|
+
return overflow[side] >= 0;
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
function hide(_ref) {
|
|
1223
|
+
var state = _ref.state,
|
|
1224
|
+
name = _ref.name;
|
|
1225
|
+
var referenceRect = state.rects.reference;
|
|
1226
|
+
var popperRect = state.rects.popper;
|
|
1227
|
+
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
1228
|
+
var referenceOverflow = detectOverflow(state, {
|
|
1229
|
+
elementContext: 'reference'
|
|
1230
|
+
});
|
|
1231
|
+
var popperAltOverflow = detectOverflow(state, {
|
|
1232
|
+
altBoundary: true
|
|
1233
|
+
});
|
|
1234
|
+
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
1235
|
+
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
1236
|
+
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
1237
|
+
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
1238
|
+
state.modifiersData[name] = {
|
|
1239
|
+
referenceClippingOffsets: referenceClippingOffsets,
|
|
1240
|
+
popperEscapeOffsets: popperEscapeOffsets,
|
|
1241
|
+
isReferenceHidden: isReferenceHidden,
|
|
1242
|
+
hasPopperEscaped: hasPopperEscaped
|
|
1243
|
+
};
|
|
1244
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
1245
|
+
'data-popper-reference-hidden': isReferenceHidden,
|
|
1246
|
+
'data-popper-escaped': hasPopperEscaped
|
|
1247
|
+
});
|
|
1248
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
const hide$1 = {
|
|
1252
|
+
name: 'hide',
|
|
1253
|
+
enabled: true,
|
|
1254
|
+
phase: 'main',
|
|
1255
|
+
requiresIfExists: ['preventOverflow'],
|
|
1256
|
+
fn: hide
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
1260
|
+
var basePlacement = getBasePlacement$1(placement);
|
|
1261
|
+
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
1262
|
+
|
|
1263
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
1264
|
+
placement: placement
|
|
1265
|
+
})) : offset,
|
|
1266
|
+
skidding = _ref[0],
|
|
1267
|
+
distance = _ref[1];
|
|
1268
|
+
|
|
1269
|
+
skidding = skidding || 0;
|
|
1270
|
+
distance = (distance || 0) * invertDistance;
|
|
1271
|
+
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
1272
|
+
x: distance,
|
|
1273
|
+
y: skidding
|
|
1274
|
+
} : {
|
|
1275
|
+
x: skidding,
|
|
1276
|
+
y: distance
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
function offset(_ref2) {
|
|
1281
|
+
var state = _ref2.state,
|
|
1282
|
+
options = _ref2.options,
|
|
1283
|
+
name = _ref2.name;
|
|
1284
|
+
var _options$offset = options.offset,
|
|
1285
|
+
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
1286
|
+
var data = placements.reduce(function (acc, placement) {
|
|
1287
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
|
1288
|
+
return acc;
|
|
1289
|
+
}, {});
|
|
1290
|
+
var _data$state$placement = data[state.placement],
|
|
1291
|
+
x = _data$state$placement.x,
|
|
1292
|
+
y = _data$state$placement.y;
|
|
1293
|
+
|
|
1294
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
1295
|
+
state.modifiersData.popperOffsets.x += x;
|
|
1296
|
+
state.modifiersData.popperOffsets.y += y;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
state.modifiersData[name] = data;
|
|
1300
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
const offset$1 = {
|
|
1304
|
+
name: 'offset',
|
|
1305
|
+
enabled: true,
|
|
1306
|
+
phase: 'main',
|
|
1307
|
+
requires: ['popperOffsets'],
|
|
1308
|
+
fn: offset
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1311
|
+
function popperOffsets(_ref) {
|
|
1312
|
+
var state = _ref.state,
|
|
1313
|
+
name = _ref.name;
|
|
1314
|
+
// Offsets are the actual position the popper needs to have to be
|
|
1315
|
+
// properly positioned near its reference element
|
|
1316
|
+
// This is the most basic placement, and will be adjusted by
|
|
1317
|
+
// the modifiers in the next step
|
|
1318
|
+
state.modifiersData[name] = computeOffsets({
|
|
1319
|
+
reference: state.rects.reference,
|
|
1320
|
+
element: state.rects.popper,
|
|
1321
|
+
strategy: 'absolute',
|
|
1322
|
+
placement: state.placement
|
|
1323
|
+
});
|
|
1324
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
const popperOffsets$1 = {
|
|
1328
|
+
name: 'popperOffsets',
|
|
1329
|
+
enabled: true,
|
|
1330
|
+
phase: 'read',
|
|
1331
|
+
fn: popperOffsets,
|
|
1332
|
+
data: {}
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
function getAltAxis(axis) {
|
|
1336
|
+
return axis === 'x' ? 'y' : 'x';
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
function preventOverflow(_ref) {
|
|
1340
|
+
var state = _ref.state,
|
|
1341
|
+
options = _ref.options,
|
|
1342
|
+
name = _ref.name;
|
|
1343
|
+
var _options$mainAxis = options.mainAxis,
|
|
1344
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
1345
|
+
_options$altAxis = options.altAxis,
|
|
1346
|
+
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
|
1347
|
+
boundary = options.boundary,
|
|
1348
|
+
rootBoundary = options.rootBoundary,
|
|
1349
|
+
altBoundary = options.altBoundary,
|
|
1350
|
+
padding = options.padding,
|
|
1351
|
+
_options$tether = options.tether,
|
|
1352
|
+
tether = _options$tether === void 0 ? true : _options$tether,
|
|
1353
|
+
_options$tetherOffset = options.tetherOffset,
|
|
1354
|
+
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
1355
|
+
var overflow = detectOverflow(state, {
|
|
1356
|
+
boundary: boundary,
|
|
1357
|
+
rootBoundary: rootBoundary,
|
|
1358
|
+
padding: padding,
|
|
1359
|
+
altBoundary: altBoundary
|
|
1360
|
+
});
|
|
1361
|
+
var basePlacement = getBasePlacement$1(state.placement);
|
|
1362
|
+
var variation = getVariation(state.placement);
|
|
1363
|
+
var isBasePlacement = !variation;
|
|
1364
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
1365
|
+
var altAxis = getAltAxis(mainAxis);
|
|
1366
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
1367
|
+
var referenceRect = state.rects.reference;
|
|
1368
|
+
var popperRect = state.rects.popper;
|
|
1369
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
1370
|
+
placement: state.placement
|
|
1371
|
+
})) : tetherOffset;
|
|
1372
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
1373
|
+
mainAxis: tetherOffsetValue,
|
|
1374
|
+
altAxis: tetherOffsetValue
|
|
1375
|
+
} : Object.assign({
|
|
1376
|
+
mainAxis: 0,
|
|
1377
|
+
altAxis: 0
|
|
1378
|
+
}, tetherOffsetValue);
|
|
1379
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
1380
|
+
var data = {
|
|
1381
|
+
x: 0,
|
|
1382
|
+
y: 0
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
if (!popperOffsets) {
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
if (checkMainAxis) {
|
|
1390
|
+
var _offsetModifierState$;
|
|
1391
|
+
|
|
1392
|
+
var mainSide = mainAxis === 'y' ? top : left;
|
|
1393
|
+
var altSide = mainAxis === 'y' ? bottom : right;
|
|
1394
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
1395
|
+
var offset = popperOffsets[mainAxis];
|
|
1396
|
+
var min$1 = offset + overflow[mainSide];
|
|
1397
|
+
var max$1 = offset - overflow[altSide];
|
|
1398
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1399
|
+
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
1400
|
+
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
1401
|
+
// outside the reference bounds
|
|
1402
|
+
|
|
1403
|
+
var arrowElement = state.elements.arrow;
|
|
1404
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
1405
|
+
width: 0,
|
|
1406
|
+
height: 0
|
|
1407
|
+
};
|
|
1408
|
+
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
|
1409
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
1410
|
+
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
|
1411
|
+
// to include its full size in the calculation. If the reference is small
|
|
1412
|
+
// and near the edge of a boundary, the popper can overflow even if the
|
|
1413
|
+
// reference is not overflowing as well (e.g. virtual elements with no
|
|
1414
|
+
// width or height)
|
|
1415
|
+
|
|
1416
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
1417
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
1418
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
1419
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
1420
|
+
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
1421
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
1422
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
1423
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
1424
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
1425
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
1426
|
+
data[mainAxis] = preventedOffset - offset;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
if (checkAltAxis) {
|
|
1430
|
+
var _offsetModifierState$2;
|
|
1431
|
+
|
|
1432
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
1433
|
+
|
|
1434
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
1435
|
+
|
|
1436
|
+
var _offset = popperOffsets[altAxis];
|
|
1437
|
+
|
|
1438
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
1439
|
+
|
|
1440
|
+
var _min = _offset + overflow[_mainSide];
|
|
1441
|
+
|
|
1442
|
+
var _max = _offset - overflow[_altSide];
|
|
1443
|
+
|
|
1444
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
1445
|
+
|
|
1446
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
1447
|
+
|
|
1448
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
1449
|
+
|
|
1450
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
1451
|
+
|
|
1452
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
1453
|
+
|
|
1454
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
1455
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
state.modifiersData[name] = data;
|
|
1459
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
const preventOverflow$1 = {
|
|
1463
|
+
name: 'preventOverflow',
|
|
1464
|
+
enabled: true,
|
|
1465
|
+
phase: 'main',
|
|
1466
|
+
fn: preventOverflow,
|
|
1467
|
+
requiresIfExists: ['offset']
|
|
1468
|
+
};
|
|
1469
|
+
|
|
1470
|
+
function getHTMLElementScroll(element) {
|
|
1471
|
+
return {
|
|
1472
|
+
scrollLeft: element.scrollLeft,
|
|
1473
|
+
scrollTop: element.scrollTop
|
|
1474
|
+
};
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
function getNodeScroll(node) {
|
|
1478
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
1479
|
+
return getWindowScroll(node);
|
|
1480
|
+
} else {
|
|
1481
|
+
return getHTMLElementScroll(node);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
function isElementScaled(element) {
|
|
1486
|
+
var rect = element.getBoundingClientRect();
|
|
1487
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
1488
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
1489
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
1490
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
|
1491
|
+
// Composite means it takes into account transforms as well as layout.
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
1495
|
+
if (isFixed === void 0) {
|
|
1496
|
+
isFixed = false;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1500
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
1501
|
+
var documentElement = getDocumentElement(offsetParent);
|
|
1502
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
1503
|
+
var scroll = {
|
|
1504
|
+
scrollLeft: 0,
|
|
1505
|
+
scrollTop: 0
|
|
1506
|
+
};
|
|
1507
|
+
var offsets = {
|
|
1508
|
+
x: 0,
|
|
1509
|
+
y: 0
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1513
|
+
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
1514
|
+
isScrollParent(documentElement)) {
|
|
1515
|
+
scroll = getNodeScroll(offsetParent);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
if (isHTMLElement(offsetParent)) {
|
|
1519
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
1520
|
+
offsets.x += offsetParent.clientLeft;
|
|
1521
|
+
offsets.y += offsetParent.clientTop;
|
|
1522
|
+
} else if (documentElement) {
|
|
1523
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
return {
|
|
1528
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1529
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1530
|
+
width: rect.width,
|
|
1531
|
+
height: rect.height
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
function order(modifiers) {
|
|
1536
|
+
var map = new Map();
|
|
1537
|
+
var visited = new Set();
|
|
1538
|
+
var result = [];
|
|
1539
|
+
modifiers.forEach(function (modifier) {
|
|
1540
|
+
map.set(modifier.name, modifier);
|
|
1541
|
+
}); // On visiting object, check for its dependencies and visit them recursively
|
|
1542
|
+
|
|
1543
|
+
function sort(modifier) {
|
|
1544
|
+
visited.add(modifier.name);
|
|
1545
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
1546
|
+
requires.forEach(function (dep) {
|
|
1547
|
+
if (!visited.has(dep)) {
|
|
1548
|
+
var depModifier = map.get(dep);
|
|
1549
|
+
|
|
1550
|
+
if (depModifier) {
|
|
1551
|
+
sort(depModifier);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
result.push(modifier);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
modifiers.forEach(function (modifier) {
|
|
1559
|
+
if (!visited.has(modifier.name)) {
|
|
1560
|
+
// check for visited object
|
|
1561
|
+
sort(modifier);
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
return result;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
function orderModifiers(modifiers) {
|
|
1568
|
+
// order based on dependencies
|
|
1569
|
+
var orderedModifiers = order(modifiers); // order based on phase
|
|
1570
|
+
|
|
1571
|
+
return modifierPhases.reduce(function (acc, phase) {
|
|
1572
|
+
return acc.concat(orderedModifiers.filter(function (modifier) {
|
|
1573
|
+
return modifier.phase === phase;
|
|
1574
|
+
}));
|
|
1575
|
+
}, []);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
function debounce$1(fn) {
|
|
1579
|
+
var pending;
|
|
1580
|
+
return function () {
|
|
1581
|
+
if (!pending) {
|
|
1582
|
+
pending = new Promise(function (resolve) {
|
|
1583
|
+
Promise.resolve().then(function () {
|
|
1584
|
+
pending = undefined;
|
|
1585
|
+
resolve(fn());
|
|
1586
|
+
});
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
return pending;
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
function mergeByName(modifiers) {
|
|
1595
|
+
var merged = modifiers.reduce(function (merged, current) {
|
|
1596
|
+
var existing = merged[current.name];
|
|
1597
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
|
1598
|
+
options: Object.assign({}, existing.options, current.options),
|
|
1599
|
+
data: Object.assign({}, existing.data, current.data)
|
|
1600
|
+
}) : current;
|
|
1601
|
+
return merged;
|
|
1602
|
+
}, {}); // IE11 does not support Object.values
|
|
1603
|
+
|
|
1604
|
+
return Object.keys(merged).map(function (key) {
|
|
1605
|
+
return merged[key];
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
var DEFAULT_OPTIONS = {
|
|
1610
|
+
placement: 'bottom',
|
|
1611
|
+
modifiers: [],
|
|
1612
|
+
strategy: 'absolute'
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
function areValidElements() {
|
|
1616
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1617
|
+
args[_key] = arguments[_key];
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
return !args.some(function (element) {
|
|
1621
|
+
return !(element && typeof element.getBoundingClientRect === 'function');
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
function popperGenerator(generatorOptions) {
|
|
1626
|
+
if (generatorOptions === void 0) {
|
|
1627
|
+
generatorOptions = {};
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
var _generatorOptions = generatorOptions,
|
|
1631
|
+
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
|
1632
|
+
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
|
1633
|
+
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
|
1634
|
+
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
1635
|
+
return function createPopper(reference, popper, options) {
|
|
1636
|
+
if (options === void 0) {
|
|
1637
|
+
options = defaultOptions;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
var state = {
|
|
1641
|
+
placement: 'bottom',
|
|
1642
|
+
orderedModifiers: [],
|
|
1643
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
1644
|
+
modifiersData: {},
|
|
1645
|
+
elements: {
|
|
1646
|
+
reference: reference,
|
|
1647
|
+
popper: popper
|
|
1648
|
+
},
|
|
1649
|
+
attributes: {},
|
|
1650
|
+
styles: {}
|
|
1651
|
+
};
|
|
1652
|
+
var effectCleanupFns = [];
|
|
1653
|
+
var isDestroyed = false;
|
|
1654
|
+
var instance = {
|
|
1655
|
+
state: state,
|
|
1656
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
1657
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
|
1658
|
+
cleanupModifierEffects();
|
|
1659
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
1660
|
+
state.scrollParents = {
|
|
1661
|
+
reference: isElement$1(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
1662
|
+
popper: listScrollParents(popper)
|
|
1663
|
+
}; // Orders the modifiers based on their dependencies and `phase`
|
|
1664
|
+
// properties
|
|
1665
|
+
|
|
1666
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
|
1667
|
+
|
|
1668
|
+
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
|
1669
|
+
return m.enabled;
|
|
1670
|
+
});
|
|
1671
|
+
runModifierEffects();
|
|
1672
|
+
return instance.update();
|
|
1673
|
+
},
|
|
1674
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
1675
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
1676
|
+
// logic.
|
|
1677
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
1678
|
+
// prefer the async Popper#update method
|
|
1679
|
+
forceUpdate: function forceUpdate() {
|
|
1680
|
+
if (isDestroyed) {
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
var _state$elements = state.elements,
|
|
1685
|
+
reference = _state$elements.reference,
|
|
1686
|
+
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
|
1687
|
+
// anymore
|
|
1688
|
+
|
|
1689
|
+
if (!areValidElements(reference, popper)) {
|
|
1690
|
+
return;
|
|
1691
|
+
} // Store the reference and popper rects to be read by modifiers
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
state.rects = {
|
|
1695
|
+
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
|
1696
|
+
popper: getLayoutRect(popper)
|
|
1697
|
+
}; // Modifiers have the ability to reset the current update cycle. The
|
|
1698
|
+
// most common use case for this is the `flip` modifier changing the
|
|
1699
|
+
// placement, which then needs to re-run all the modifiers, because the
|
|
1700
|
+
// logic was previously ran for the previous placement and is therefore
|
|
1701
|
+
// stale/incorrect
|
|
1702
|
+
|
|
1703
|
+
state.reset = false;
|
|
1704
|
+
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
|
1705
|
+
// is filled with the initial data specified by the modifier. This means
|
|
1706
|
+
// it doesn't persist and is fresh on each update.
|
|
1707
|
+
// To ensure persistent data, use `${name}#persistent`
|
|
1708
|
+
|
|
1709
|
+
state.orderedModifiers.forEach(function (modifier) {
|
|
1710
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
1711
|
+
});
|
|
1712
|
+
|
|
1713
|
+
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
1714
|
+
if (state.reset === true) {
|
|
1715
|
+
state.reset = false;
|
|
1716
|
+
index = -1;
|
|
1717
|
+
continue;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
var _state$orderedModifie = state.orderedModifiers[index],
|
|
1721
|
+
fn = _state$orderedModifie.fn,
|
|
1722
|
+
_state$orderedModifie2 = _state$orderedModifie.options,
|
|
1723
|
+
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
|
1724
|
+
name = _state$orderedModifie.name;
|
|
1725
|
+
|
|
1726
|
+
if (typeof fn === 'function') {
|
|
1727
|
+
state = fn({
|
|
1728
|
+
state: state,
|
|
1729
|
+
options: _options,
|
|
1730
|
+
name: name,
|
|
1731
|
+
instance: instance
|
|
1732
|
+
}) || state;
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
1737
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
1738
|
+
update: debounce$1(function () {
|
|
1739
|
+
return new Promise(function (resolve) {
|
|
1740
|
+
instance.forceUpdate();
|
|
1741
|
+
resolve(state);
|
|
1742
|
+
});
|
|
1743
|
+
}),
|
|
1744
|
+
destroy: function destroy() {
|
|
1745
|
+
cleanupModifierEffects();
|
|
1746
|
+
isDestroyed = true;
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
if (!areValidElements(reference, popper)) {
|
|
1751
|
+
return instance;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
instance.setOptions(options).then(function (state) {
|
|
1755
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
|
1756
|
+
options.onFirstUpdate(state);
|
|
1757
|
+
}
|
|
1758
|
+
}); // Modifiers have the ability to execute arbitrary code before the first
|
|
1759
|
+
// update cycle runs. They will be executed in the same order as the update
|
|
1760
|
+
// cycle. This is useful when a modifier adds some persistent data that
|
|
1761
|
+
// other modifiers need to use, but the modifier is run after the dependent
|
|
1762
|
+
// one.
|
|
1763
|
+
|
|
1764
|
+
function runModifierEffects() {
|
|
1765
|
+
state.orderedModifiers.forEach(function (_ref) {
|
|
1766
|
+
var name = _ref.name,
|
|
1767
|
+
_ref$options = _ref.options,
|
|
1768
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
1769
|
+
effect = _ref.effect;
|
|
1770
|
+
|
|
1771
|
+
if (typeof effect === 'function') {
|
|
1772
|
+
var cleanupFn = effect({
|
|
1773
|
+
state: state,
|
|
1774
|
+
name: name,
|
|
1775
|
+
instance: instance,
|
|
1776
|
+
options: options
|
|
1777
|
+
});
|
|
1778
|
+
|
|
1779
|
+
var noopFn = function noopFn() {};
|
|
1780
|
+
|
|
1781
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
|
1782
|
+
}
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
function cleanupModifierEffects() {
|
|
1787
|
+
effectCleanupFns.forEach(function (fn) {
|
|
1788
|
+
return fn();
|
|
1789
|
+
});
|
|
1790
|
+
effectCleanupFns = [];
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
return instance;
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
1798
|
+
var createPopper = /*#__PURE__*/popperGenerator({
|
|
1799
|
+
defaultModifiers: defaultModifiers
|
|
1800
|
+
}); // eslint-disable-next-line import/no-unused-modules
|
|
1801
|
+
|
|
1802
|
+
/**!
|
|
1803
|
+
* tippy.js v6.3.7
|
|
1804
|
+
* (c) 2017-2021 atomiks
|
|
1805
|
+
* MIT License
|
|
1806
|
+
*/
|
|
1807
|
+
var BOX_CLASS = "tippy-box";
|
|
1808
|
+
var CONTENT_CLASS = "tippy-content";
|
|
1809
|
+
var BACKDROP_CLASS = "tippy-backdrop";
|
|
1810
|
+
var ARROW_CLASS = "tippy-arrow";
|
|
1811
|
+
var SVG_ARROW_CLASS = "tippy-svg-arrow";
|
|
1812
|
+
var TOUCH_OPTIONS = {
|
|
1813
|
+
passive: true,
|
|
1814
|
+
capture: true
|
|
1815
|
+
};
|
|
1816
|
+
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
|
|
1817
|
+
return document.body;
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
function hasOwnProperty(obj, key) {
|
|
1821
|
+
return {}.hasOwnProperty.call(obj, key);
|
|
1822
|
+
}
|
|
1823
|
+
function getValueAtIndexOrReturn(value, index, defaultValue) {
|
|
1824
|
+
if (Array.isArray(value)) {
|
|
1825
|
+
var v = value[index];
|
|
1826
|
+
return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
return value;
|
|
1830
|
+
}
|
|
1831
|
+
function isType(value, type) {
|
|
1832
|
+
var str = {}.toString.call(value);
|
|
1833
|
+
return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1;
|
|
1834
|
+
}
|
|
1835
|
+
function invokeWithArgsOrReturn(value, args) {
|
|
1836
|
+
return typeof value === 'function' ? value.apply(void 0, args) : value;
|
|
1837
|
+
}
|
|
1838
|
+
function debounce(fn, ms) {
|
|
1839
|
+
// Avoid wrapping in `setTimeout` if ms is 0 anyway
|
|
1840
|
+
if (ms === 0) {
|
|
1841
|
+
return fn;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
var timeout;
|
|
1845
|
+
return function (arg) {
|
|
1846
|
+
clearTimeout(timeout);
|
|
1847
|
+
timeout = setTimeout(function () {
|
|
1848
|
+
fn(arg);
|
|
1849
|
+
}, ms);
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
function removeProperties(obj, keys) {
|
|
1853
|
+
var clone = Object.assign({}, obj);
|
|
1854
|
+
keys.forEach(function (key) {
|
|
1855
|
+
delete clone[key];
|
|
1856
|
+
});
|
|
1857
|
+
return clone;
|
|
1858
|
+
}
|
|
1859
|
+
function splitBySpaces(value) {
|
|
1860
|
+
return value.split(/\s+/).filter(Boolean);
|
|
1861
|
+
}
|
|
1862
|
+
function normalizeToArray(value) {
|
|
1863
|
+
return [].concat(value);
|
|
1864
|
+
}
|
|
1865
|
+
function pushIfUnique(arr, value) {
|
|
1866
|
+
if (arr.indexOf(value) === -1) {
|
|
1867
|
+
arr.push(value);
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
function unique(arr) {
|
|
1871
|
+
return arr.filter(function (item, index) {
|
|
1872
|
+
return arr.indexOf(item) === index;
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
function getBasePlacement(placement) {
|
|
1876
|
+
return placement.split('-')[0];
|
|
1877
|
+
}
|
|
1878
|
+
function arrayFrom(value) {
|
|
1879
|
+
return [].slice.call(value);
|
|
1880
|
+
}
|
|
1881
|
+
function removeUndefinedProps(obj) {
|
|
1882
|
+
return Object.keys(obj).reduce(function (acc, key) {
|
|
1883
|
+
if (obj[key] !== undefined) {
|
|
1884
|
+
acc[key] = obj[key];
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
return acc;
|
|
1888
|
+
}, {});
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
function div() {
|
|
1892
|
+
return document.createElement('div');
|
|
1893
|
+
}
|
|
1894
|
+
function isElement(value) {
|
|
1895
|
+
return ['Element', 'Fragment'].some(function (type) {
|
|
1896
|
+
return isType(value, type);
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
function isNodeList(value) {
|
|
1900
|
+
return isType(value, 'NodeList');
|
|
1901
|
+
}
|
|
1902
|
+
function isMouseEvent(value) {
|
|
1903
|
+
return isType(value, 'MouseEvent');
|
|
1904
|
+
}
|
|
1905
|
+
function isReferenceElement(value) {
|
|
1906
|
+
return !!(value && value._tippy && value._tippy.reference === value);
|
|
1907
|
+
}
|
|
1908
|
+
function getArrayOfElements(value) {
|
|
1909
|
+
if (isElement(value)) {
|
|
1910
|
+
return [value];
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
if (isNodeList(value)) {
|
|
1914
|
+
return arrayFrom(value);
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
if (Array.isArray(value)) {
|
|
1918
|
+
return value;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
return arrayFrom(document.querySelectorAll(value));
|
|
1922
|
+
}
|
|
1923
|
+
function setTransitionDuration(els, value) {
|
|
1924
|
+
els.forEach(function (el) {
|
|
1925
|
+
if (el) {
|
|
1926
|
+
el.style.transitionDuration = value + "ms";
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
}
|
|
1930
|
+
function setVisibilityState(els, state) {
|
|
1931
|
+
els.forEach(function (el) {
|
|
1932
|
+
if (el) {
|
|
1933
|
+
el.setAttribute('data-state', state);
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
function getOwnerDocument(elementOrElements) {
|
|
1938
|
+
var _element$ownerDocumen;
|
|
1939
|
+
|
|
1940
|
+
var _normalizeToArray = normalizeToArray(elementOrElements),
|
|
1941
|
+
element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
|
|
1942
|
+
|
|
1943
|
+
|
|
1944
|
+
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
|
1945
|
+
}
|
|
1946
|
+
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
|
|
1947
|
+
var clientX = event.clientX,
|
|
1948
|
+
clientY = event.clientY;
|
|
1949
|
+
return popperTreeData.every(function (_ref) {
|
|
1950
|
+
var popperRect = _ref.popperRect,
|
|
1951
|
+
popperState = _ref.popperState,
|
|
1952
|
+
props = _ref.props;
|
|
1953
|
+
var interactiveBorder = props.interactiveBorder;
|
|
1954
|
+
var basePlacement = getBasePlacement(popperState.placement);
|
|
1955
|
+
var offsetData = popperState.modifiersData.offset;
|
|
1956
|
+
|
|
1957
|
+
if (!offsetData) {
|
|
1958
|
+
return true;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;
|
|
1962
|
+
var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;
|
|
1963
|
+
var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;
|
|
1964
|
+
var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;
|
|
1965
|
+
var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
|
|
1966
|
+
var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
|
|
1967
|
+
var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
|
|
1968
|
+
var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
|
|
1969
|
+
return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
function updateTransitionEndListener(box, action, listener) {
|
|
1973
|
+
var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire
|
|
1974
|
+
// `webkitTransitionEnd`...
|
|
1975
|
+
|
|
1976
|
+
['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
|
|
1977
|
+
box[method](event, listener);
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* Compared to xxx.contains, this function works for dom structures with shadow
|
|
1982
|
+
* dom
|
|
1983
|
+
*/
|
|
1984
|
+
|
|
1985
|
+
function actualContains(parent, child) {
|
|
1986
|
+
var target = child;
|
|
1987
|
+
|
|
1988
|
+
while (target) {
|
|
1989
|
+
var _target$getRootNode;
|
|
1990
|
+
|
|
1991
|
+
if (parent.contains(target)) {
|
|
1992
|
+
return true;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
return false;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
var currentInput = {
|
|
2002
|
+
isTouch: false
|
|
2003
|
+
};
|
|
2004
|
+
var lastMouseMoveTime = 0;
|
|
2005
|
+
/**
|
|
2006
|
+
* When a `touchstart` event is fired, it's assumed the user is using touch
|
|
2007
|
+
* input. We'll bind a `mousemove` event listener to listen for mouse input in
|
|
2008
|
+
* the future. This way, the `isTouch` property is fully dynamic and will handle
|
|
2009
|
+
* hybrid devices that use a mix of touch + mouse input.
|
|
2010
|
+
*/
|
|
2011
|
+
|
|
2012
|
+
function onDocumentTouchStart() {
|
|
2013
|
+
if (currentInput.isTouch) {
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
currentInput.isTouch = true;
|
|
2018
|
+
|
|
2019
|
+
if (window.performance) {
|
|
2020
|
+
document.addEventListener('mousemove', onDocumentMouseMove);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* When two `mousemove` event are fired consecutively within 20ms, it's assumed
|
|
2025
|
+
* the user is using mouse input again. `mousemove` can fire on touch devices as
|
|
2026
|
+
* well, but very rarely that quickly.
|
|
2027
|
+
*/
|
|
2028
|
+
|
|
2029
|
+
function onDocumentMouseMove() {
|
|
2030
|
+
var now = performance.now();
|
|
2031
|
+
|
|
2032
|
+
if (now - lastMouseMoveTime < 20) {
|
|
2033
|
+
currentInput.isTouch = false;
|
|
2034
|
+
document.removeEventListener('mousemove', onDocumentMouseMove);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
lastMouseMoveTime = now;
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* When an element is in focus and has a tippy, leaving the tab/window and
|
|
2041
|
+
* returning causes it to show again. For mouse users this is unexpected, but
|
|
2042
|
+
* for keyboard use it makes sense.
|
|
2043
|
+
* TODO: find a better technique to solve this problem
|
|
2044
|
+
*/
|
|
2045
|
+
|
|
2046
|
+
function onWindowBlur() {
|
|
2047
|
+
var activeElement = document.activeElement;
|
|
2048
|
+
|
|
2049
|
+
if (isReferenceElement(activeElement)) {
|
|
2050
|
+
var instance = activeElement._tippy;
|
|
2051
|
+
|
|
2052
|
+
if (activeElement.blur && !instance.state.isVisible) {
|
|
2053
|
+
activeElement.blur();
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
function bindGlobalEventListeners() {
|
|
2058
|
+
document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);
|
|
2059
|
+
window.addEventListener('blur', onWindowBlur);
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
2063
|
+
var isIE11 = isBrowser ? // @ts-ignore
|
|
2064
|
+
!!window.msCrypto : false;
|
|
2065
|
+
|
|
2066
|
+
function createMemoryLeakWarning(method) {
|
|
2067
|
+
var txt = method === 'destroy' ? 'n already-' : ' ';
|
|
2068
|
+
return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' ');
|
|
2069
|
+
}
|
|
2070
|
+
function clean(value) {
|
|
2071
|
+
var spacesAndTabs = /[ \t]{2,}/g;
|
|
2072
|
+
var lineStartWithSpaces = /^[ \t]*/gm;
|
|
2073
|
+
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
function getDevMessage(message) {
|
|
2077
|
+
return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n ");
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
function getFormattedMessage(message) {
|
|
2081
|
+
return [getDevMessage(message), // title
|
|
2082
|
+
'color: #00C584; font-size: 1.3em; font-weight: bold;', // message
|
|
2083
|
+
'line-height: 1.5', // footer
|
|
2084
|
+
'color: #a6a095;'];
|
|
2085
|
+
} // Assume warnings and errors never have the same message
|
|
2086
|
+
|
|
2087
|
+
var visitedMessages;
|
|
2088
|
+
|
|
2089
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2090
|
+
resetVisitedMessages();
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
function resetVisitedMessages() {
|
|
2094
|
+
visitedMessages = new Set();
|
|
2095
|
+
}
|
|
2096
|
+
function warnWhen(condition, message) {
|
|
2097
|
+
if (condition && !visitedMessages.has(message)) {
|
|
2098
|
+
var _console;
|
|
2099
|
+
|
|
2100
|
+
visitedMessages.add(message);
|
|
2101
|
+
|
|
2102
|
+
(_console = console).warn.apply(_console, getFormattedMessage(message));
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
function errorWhen(condition, message) {
|
|
2106
|
+
if (condition && !visitedMessages.has(message)) {
|
|
2107
|
+
var _console2;
|
|
2108
|
+
|
|
2109
|
+
visitedMessages.add(message);
|
|
2110
|
+
|
|
2111
|
+
(_console2 = console).error.apply(_console2, getFormattedMessage(message));
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
function validateTargets(targets) {
|
|
2115
|
+
var didPassFalsyValue = !targets;
|
|
2116
|
+
var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
|
|
2117
|
+
errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
|
|
2118
|
+
errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
var pluginProps = {
|
|
2122
|
+
animateFill: false,
|
|
2123
|
+
followCursor: false,
|
|
2124
|
+
inlinePositioning: false,
|
|
2125
|
+
sticky: false
|
|
2126
|
+
};
|
|
2127
|
+
var renderProps = {
|
|
2128
|
+
allowHTML: false,
|
|
2129
|
+
animation: 'fade',
|
|
2130
|
+
arrow: true,
|
|
2131
|
+
content: '',
|
|
2132
|
+
inertia: false,
|
|
2133
|
+
maxWidth: 350,
|
|
2134
|
+
role: 'tooltip',
|
|
2135
|
+
theme: '',
|
|
2136
|
+
zIndex: 9999
|
|
2137
|
+
};
|
|
2138
|
+
var defaultProps = Object.assign({
|
|
2139
|
+
appendTo: TIPPY_DEFAULT_APPEND_TO,
|
|
2140
|
+
aria: {
|
|
2141
|
+
content: 'auto',
|
|
2142
|
+
expanded: 'auto'
|
|
2143
|
+
},
|
|
2144
|
+
delay: 0,
|
|
2145
|
+
duration: [300, 250],
|
|
2146
|
+
getReferenceClientRect: null,
|
|
2147
|
+
hideOnClick: true,
|
|
2148
|
+
ignoreAttributes: false,
|
|
2149
|
+
interactive: false,
|
|
2150
|
+
interactiveBorder: 2,
|
|
2151
|
+
interactiveDebounce: 0,
|
|
2152
|
+
moveTransition: '',
|
|
2153
|
+
offset: [0, 10],
|
|
2154
|
+
onAfterUpdate: function onAfterUpdate() {},
|
|
2155
|
+
onBeforeUpdate: function onBeforeUpdate() {},
|
|
2156
|
+
onCreate: function onCreate() {},
|
|
2157
|
+
onDestroy: function onDestroy() {},
|
|
2158
|
+
onHidden: function onHidden() {},
|
|
2159
|
+
onHide: function onHide() {},
|
|
2160
|
+
onMount: function onMount() {},
|
|
2161
|
+
onShow: function onShow() {},
|
|
2162
|
+
onShown: function onShown() {},
|
|
2163
|
+
onTrigger: function onTrigger() {},
|
|
2164
|
+
onUntrigger: function onUntrigger() {},
|
|
2165
|
+
onClickOutside: function onClickOutside() {},
|
|
2166
|
+
placement: 'top',
|
|
2167
|
+
plugins: [],
|
|
2168
|
+
popperOptions: {},
|
|
2169
|
+
render: null,
|
|
2170
|
+
showOnCreate: false,
|
|
2171
|
+
touch: true,
|
|
2172
|
+
trigger: 'mouseenter focus',
|
|
2173
|
+
triggerTarget: null
|
|
2174
|
+
}, pluginProps, renderProps);
|
|
2175
|
+
var defaultKeys = Object.keys(defaultProps);
|
|
2176
|
+
var setDefaultProps = function setDefaultProps(partialProps) {
|
|
2177
|
+
/* istanbul ignore else */
|
|
2178
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2179
|
+
validateProps(partialProps, []);
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
var keys = Object.keys(partialProps);
|
|
2183
|
+
keys.forEach(function (key) {
|
|
2184
|
+
defaultProps[key] = partialProps[key];
|
|
2185
|
+
});
|
|
2186
|
+
};
|
|
2187
|
+
function getExtendedPassedProps(passedProps) {
|
|
2188
|
+
var plugins = passedProps.plugins || [];
|
|
2189
|
+
var pluginProps = plugins.reduce(function (acc, plugin) {
|
|
2190
|
+
var name = plugin.name,
|
|
2191
|
+
defaultValue = plugin.defaultValue;
|
|
2192
|
+
|
|
2193
|
+
if (name) {
|
|
2194
|
+
var _name;
|
|
2195
|
+
|
|
2196
|
+
acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
return acc;
|
|
2200
|
+
}, {});
|
|
2201
|
+
return Object.assign({}, passedProps, pluginProps);
|
|
2202
|
+
}
|
|
2203
|
+
function getDataAttributeProps(reference, plugins) {
|
|
2204
|
+
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
|
2205
|
+
plugins: plugins
|
|
2206
|
+
}))) : defaultKeys;
|
|
2207
|
+
var props = propKeys.reduce(function (acc, key) {
|
|
2208
|
+
var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim();
|
|
2209
|
+
|
|
2210
|
+
if (!valueAsString) {
|
|
2211
|
+
return acc;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
if (key === 'content') {
|
|
2215
|
+
acc[key] = valueAsString;
|
|
2216
|
+
} else {
|
|
2217
|
+
try {
|
|
2218
|
+
acc[key] = JSON.parse(valueAsString);
|
|
2219
|
+
} catch (e) {
|
|
2220
|
+
acc[key] = valueAsString;
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
return acc;
|
|
2225
|
+
}, {});
|
|
2226
|
+
return props;
|
|
2227
|
+
}
|
|
2228
|
+
function evaluateProps(reference, props) {
|
|
2229
|
+
var out = Object.assign({}, props, {
|
|
2230
|
+
content: invokeWithArgsOrReturn(props.content, [reference])
|
|
2231
|
+
}, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
|
|
2232
|
+
out.aria = Object.assign({}, defaultProps.aria, out.aria);
|
|
2233
|
+
out.aria = {
|
|
2234
|
+
expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
|
|
2235
|
+
content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
|
|
2236
|
+
};
|
|
2237
|
+
return out;
|
|
2238
|
+
}
|
|
2239
|
+
function validateProps(partialProps, plugins) {
|
|
2240
|
+
if (partialProps === void 0) {
|
|
2241
|
+
partialProps = {};
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
if (plugins === void 0) {
|
|
2245
|
+
plugins = [];
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
var keys = Object.keys(partialProps);
|
|
2249
|
+
keys.forEach(function (prop) {
|
|
2250
|
+
var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));
|
|
2251
|
+
var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins`
|
|
2252
|
+
|
|
2253
|
+
if (didPassUnknownProp) {
|
|
2254
|
+
didPassUnknownProp = plugins.filter(function (plugin) {
|
|
2255
|
+
return plugin.name === prop;
|
|
2256
|
+
}).length === 0;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", 'a plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));
|
|
2260
|
+
});
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
var innerHTML = function innerHTML() {
|
|
2264
|
+
return 'innerHTML';
|
|
2265
|
+
};
|
|
2266
|
+
|
|
2267
|
+
function dangerouslySetInnerHTML(element, html) {
|
|
2268
|
+
element[innerHTML()] = html;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
function createArrowElement(value) {
|
|
2272
|
+
var arrow = div();
|
|
2273
|
+
|
|
2274
|
+
if (value === true) {
|
|
2275
|
+
arrow.className = ARROW_CLASS;
|
|
2276
|
+
} else {
|
|
2277
|
+
arrow.className = SVG_ARROW_CLASS;
|
|
2278
|
+
|
|
2279
|
+
if (isElement(value)) {
|
|
2280
|
+
arrow.appendChild(value);
|
|
2281
|
+
} else {
|
|
2282
|
+
dangerouslySetInnerHTML(arrow, value);
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
return arrow;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
function setContent(content, props) {
|
|
2290
|
+
if (isElement(props.content)) {
|
|
2291
|
+
dangerouslySetInnerHTML(content, '');
|
|
2292
|
+
content.appendChild(props.content);
|
|
2293
|
+
} else if (typeof props.content !== 'function') {
|
|
2294
|
+
if (props.allowHTML) {
|
|
2295
|
+
dangerouslySetInnerHTML(content, props.content);
|
|
2296
|
+
} else {
|
|
2297
|
+
content.textContent = props.content;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
function getChildren(popper) {
|
|
2302
|
+
var box = popper.firstElementChild;
|
|
2303
|
+
var boxChildren = arrayFrom(box.children);
|
|
2304
|
+
return {
|
|
2305
|
+
box: box,
|
|
2306
|
+
content: boxChildren.find(function (node) {
|
|
2307
|
+
return node.classList.contains(CONTENT_CLASS);
|
|
2308
|
+
}),
|
|
2309
|
+
arrow: boxChildren.find(function (node) {
|
|
2310
|
+
return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);
|
|
2311
|
+
}),
|
|
2312
|
+
backdrop: boxChildren.find(function (node) {
|
|
2313
|
+
return node.classList.contains(BACKDROP_CLASS);
|
|
2314
|
+
})
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
function render(instance) {
|
|
2318
|
+
var popper = div();
|
|
2319
|
+
var box = div();
|
|
2320
|
+
box.className = BOX_CLASS;
|
|
2321
|
+
box.setAttribute('data-state', 'hidden');
|
|
2322
|
+
box.setAttribute('tabindex', '-1');
|
|
2323
|
+
var content = div();
|
|
2324
|
+
content.className = CONTENT_CLASS;
|
|
2325
|
+
content.setAttribute('data-state', 'hidden');
|
|
2326
|
+
setContent(content, instance.props);
|
|
2327
|
+
popper.appendChild(box);
|
|
2328
|
+
box.appendChild(content);
|
|
2329
|
+
onUpdate(instance.props, instance.props);
|
|
2330
|
+
|
|
2331
|
+
function onUpdate(prevProps, nextProps) {
|
|
2332
|
+
var _getChildren = getChildren(popper),
|
|
2333
|
+
box = _getChildren.box,
|
|
2334
|
+
content = _getChildren.content,
|
|
2335
|
+
arrow = _getChildren.arrow;
|
|
2336
|
+
|
|
2337
|
+
if (nextProps.theme) {
|
|
2338
|
+
box.setAttribute('data-theme', nextProps.theme);
|
|
2339
|
+
} else {
|
|
2340
|
+
box.removeAttribute('data-theme');
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
if (typeof nextProps.animation === 'string') {
|
|
2344
|
+
box.setAttribute('data-animation', nextProps.animation);
|
|
2345
|
+
} else {
|
|
2346
|
+
box.removeAttribute('data-animation');
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
if (nextProps.inertia) {
|
|
2350
|
+
box.setAttribute('data-inertia', '');
|
|
2351
|
+
} else {
|
|
2352
|
+
box.removeAttribute('data-inertia');
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth;
|
|
2356
|
+
|
|
2357
|
+
if (nextProps.role) {
|
|
2358
|
+
box.setAttribute('role', nextProps.role);
|
|
2359
|
+
} else {
|
|
2360
|
+
box.removeAttribute('role');
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
|
|
2364
|
+
setContent(content, instance.props);
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
if (nextProps.arrow) {
|
|
2368
|
+
if (!arrow) {
|
|
2369
|
+
box.appendChild(createArrowElement(nextProps.arrow));
|
|
2370
|
+
} else if (prevProps.arrow !== nextProps.arrow) {
|
|
2371
|
+
box.removeChild(arrow);
|
|
2372
|
+
box.appendChild(createArrowElement(nextProps.arrow));
|
|
2373
|
+
}
|
|
2374
|
+
} else if (arrow) {
|
|
2375
|
+
box.removeChild(arrow);
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
return {
|
|
2380
|
+
popper: popper,
|
|
2381
|
+
onUpdate: onUpdate
|
|
2382
|
+
};
|
|
2383
|
+
} // Runtime check to identify if the render function is the default one; this
|
|
2384
|
+
// way we can apply default CSS transitions logic and it can be tree-shaken away
|
|
2385
|
+
|
|
2386
|
+
render.$$tippy = true;
|
|
2387
|
+
|
|
2388
|
+
var idCounter = 1;
|
|
2389
|
+
var mouseMoveListeners = []; // Used by `hideAll()`
|
|
2390
|
+
|
|
2391
|
+
var mountedInstances = [];
|
|
2392
|
+
function createTippy(reference, passedProps) {
|
|
2393
|
+
var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
|
|
2394
|
+
// 🔒 Private members
|
|
2395
|
+
// ===========================================================================
|
|
2396
|
+
|
|
2397
|
+
var showTimeout;
|
|
2398
|
+
var hideTimeout;
|
|
2399
|
+
var scheduleHideAnimationFrame;
|
|
2400
|
+
var isVisibleFromClick = false;
|
|
2401
|
+
var didHideDueToDocumentMouseDown = false;
|
|
2402
|
+
var didTouchMove = false;
|
|
2403
|
+
var ignoreOnFirstUpdate = false;
|
|
2404
|
+
var lastTriggerEvent;
|
|
2405
|
+
var currentTransitionEndListener;
|
|
2406
|
+
var onFirstUpdate;
|
|
2407
|
+
var listeners = [];
|
|
2408
|
+
var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);
|
|
2409
|
+
var currentTarget; // ===========================================================================
|
|
2410
|
+
// 🔑 Public members
|
|
2411
|
+
// ===========================================================================
|
|
2412
|
+
|
|
2413
|
+
var id = idCounter++;
|
|
2414
|
+
var popperInstance = null;
|
|
2415
|
+
var plugins = unique(props.plugins);
|
|
2416
|
+
var state = {
|
|
2417
|
+
// Is the instance currently enabled?
|
|
2418
|
+
isEnabled: true,
|
|
2419
|
+
// Is the tippy currently showing and not transitioning out?
|
|
2420
|
+
isVisible: false,
|
|
2421
|
+
// Has the instance been destroyed?
|
|
2422
|
+
isDestroyed: false,
|
|
2423
|
+
// Is the tippy currently mounted to the DOM?
|
|
2424
|
+
isMounted: false,
|
|
2425
|
+
// Has the tippy finished transitioning in?
|
|
2426
|
+
isShown: false
|
|
2427
|
+
};
|
|
2428
|
+
var instance = {
|
|
2429
|
+
// properties
|
|
2430
|
+
id: id,
|
|
2431
|
+
reference: reference,
|
|
2432
|
+
popper: div(),
|
|
2433
|
+
popperInstance: popperInstance,
|
|
2434
|
+
props: props,
|
|
2435
|
+
state: state,
|
|
2436
|
+
plugins: plugins,
|
|
2437
|
+
// methods
|
|
2438
|
+
clearDelayTimeouts: clearDelayTimeouts,
|
|
2439
|
+
setProps: setProps,
|
|
2440
|
+
setContent: setContent,
|
|
2441
|
+
show: show,
|
|
2442
|
+
hide: hide,
|
|
2443
|
+
hideWithInteractivity: hideWithInteractivity,
|
|
2444
|
+
enable: enable,
|
|
2445
|
+
disable: disable,
|
|
2446
|
+
unmount: unmount,
|
|
2447
|
+
destroy: destroy
|
|
2448
|
+
}; // TODO: Investigate why this early return causes a TDZ error in the tests —
|
|
2449
|
+
// it doesn't seem to happen in the browser
|
|
2450
|
+
|
|
2451
|
+
/* istanbul ignore if */
|
|
2452
|
+
|
|
2453
|
+
if (!props.render) {
|
|
2454
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2455
|
+
errorWhen(true, 'render() function has not been supplied.');
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
return instance;
|
|
2459
|
+
} // ===========================================================================
|
|
2460
|
+
// Initial mutations
|
|
2461
|
+
// ===========================================================================
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
var _props$render = props.render(instance),
|
|
2465
|
+
popper = _props$render.popper,
|
|
2466
|
+
onUpdate = _props$render.onUpdate;
|
|
2467
|
+
|
|
2468
|
+
popper.setAttribute('data-tippy-root', '');
|
|
2469
|
+
popper.id = "tippy-" + instance.id;
|
|
2470
|
+
instance.popper = popper;
|
|
2471
|
+
reference._tippy = instance;
|
|
2472
|
+
popper._tippy = instance;
|
|
2473
|
+
var pluginsHooks = plugins.map(function (plugin) {
|
|
2474
|
+
return plugin.fn(instance);
|
|
2475
|
+
});
|
|
2476
|
+
var hasAriaExpanded = reference.hasAttribute('aria-expanded');
|
|
2477
|
+
addListeners();
|
|
2478
|
+
handleAriaExpandedAttribute();
|
|
2479
|
+
handleStyles();
|
|
2480
|
+
invokeHook('onCreate', [instance]);
|
|
2481
|
+
|
|
2482
|
+
if (props.showOnCreate) {
|
|
2483
|
+
scheduleShow();
|
|
2484
|
+
} // Prevent a tippy with a delay from hiding if the cursor left then returned
|
|
2485
|
+
// before it started hiding
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
popper.addEventListener('mouseenter', function () {
|
|
2489
|
+
if (instance.props.interactive && instance.state.isVisible) {
|
|
2490
|
+
instance.clearDelayTimeouts();
|
|
2491
|
+
}
|
|
2492
|
+
});
|
|
2493
|
+
popper.addEventListener('mouseleave', function () {
|
|
2494
|
+
if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
|
|
2495
|
+
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
|
2496
|
+
}
|
|
2497
|
+
});
|
|
2498
|
+
return instance; // ===========================================================================
|
|
2499
|
+
// 🔒 Private methods
|
|
2500
|
+
// ===========================================================================
|
|
2501
|
+
|
|
2502
|
+
function getNormalizedTouchSettings() {
|
|
2503
|
+
var touch = instance.props.touch;
|
|
2504
|
+
return Array.isArray(touch) ? touch : [touch, 0];
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
function getIsCustomTouchBehavior() {
|
|
2508
|
+
return getNormalizedTouchSettings()[0] === 'hold';
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
function getIsDefaultRenderFn() {
|
|
2512
|
+
var _instance$props$rende;
|
|
2513
|
+
|
|
2514
|
+
// @ts-ignore
|
|
2515
|
+
return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
function getCurrentTarget() {
|
|
2519
|
+
return currentTarget || reference;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
function getDocument() {
|
|
2523
|
+
var parent = getCurrentTarget().parentNode;
|
|
2524
|
+
return parent ? getOwnerDocument(parent) : document;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
function getDefaultTemplateChildren() {
|
|
2528
|
+
return getChildren(popper);
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
function getDelay(isShow) {
|
|
2532
|
+
// For touch or keyboard input, force `0` delay for UX reasons
|
|
2533
|
+
// Also if the instance is mounted but not visible (transitioning out),
|
|
2534
|
+
// ignore delay
|
|
2535
|
+
if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {
|
|
2536
|
+
return 0;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
function handleStyles(fromHide) {
|
|
2543
|
+
if (fromHide === void 0) {
|
|
2544
|
+
fromHide = false;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
|
|
2548
|
+
popper.style.zIndex = "" + instance.props.zIndex;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
function invokeHook(hook, args, shouldInvokePropsHook) {
|
|
2552
|
+
if (shouldInvokePropsHook === void 0) {
|
|
2553
|
+
shouldInvokePropsHook = true;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
pluginsHooks.forEach(function (pluginHooks) {
|
|
2557
|
+
if (pluginHooks[hook]) {
|
|
2558
|
+
pluginHooks[hook].apply(pluginHooks, args);
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2561
|
+
|
|
2562
|
+
if (shouldInvokePropsHook) {
|
|
2563
|
+
var _instance$props;
|
|
2564
|
+
|
|
2565
|
+
(_instance$props = instance.props)[hook].apply(_instance$props, args);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
function handleAriaContentAttribute() {
|
|
2570
|
+
var aria = instance.props.aria;
|
|
2571
|
+
|
|
2572
|
+
if (!aria.content) {
|
|
2573
|
+
return;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
var attr = "aria-" + aria.content;
|
|
2577
|
+
var id = popper.id;
|
|
2578
|
+
var nodes = normalizeToArray(instance.props.triggerTarget || reference);
|
|
2579
|
+
nodes.forEach(function (node) {
|
|
2580
|
+
var currentValue = node.getAttribute(attr);
|
|
2581
|
+
|
|
2582
|
+
if (instance.state.isVisible) {
|
|
2583
|
+
node.setAttribute(attr, currentValue ? currentValue + " " + id : id);
|
|
2584
|
+
} else {
|
|
2585
|
+
var nextValue = currentValue && currentValue.replace(id, '').trim();
|
|
2586
|
+
|
|
2587
|
+
if (nextValue) {
|
|
2588
|
+
node.setAttribute(attr, nextValue);
|
|
2589
|
+
} else {
|
|
2590
|
+
node.removeAttribute(attr);
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
});
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
function handleAriaExpandedAttribute() {
|
|
2597
|
+
if (hasAriaExpanded || !instance.props.aria.expanded) {
|
|
2598
|
+
return;
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
var nodes = normalizeToArray(instance.props.triggerTarget || reference);
|
|
2602
|
+
nodes.forEach(function (node) {
|
|
2603
|
+
if (instance.props.interactive) {
|
|
2604
|
+
node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');
|
|
2605
|
+
} else {
|
|
2606
|
+
node.removeAttribute('aria-expanded');
|
|
2607
|
+
}
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
function cleanupInteractiveMouseListeners() {
|
|
2612
|
+
getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
|
|
2613
|
+
mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
|
|
2614
|
+
return listener !== debouncedOnMouseMove;
|
|
2615
|
+
});
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
function onDocumentPress(event) {
|
|
2619
|
+
// Moved finger to scroll instead of an intentional tap outside
|
|
2620
|
+
if (currentInput.isTouch) {
|
|
2621
|
+
if (didTouchMove || event.type === 'mousedown') {
|
|
2622
|
+
return;
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
|
|
2627
|
+
|
|
2628
|
+
if (instance.props.interactive && actualContains(popper, actualTarget)) {
|
|
2629
|
+
return;
|
|
2630
|
+
} // Clicked on the event listeners target
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
|
|
2634
|
+
return actualContains(el, actualTarget);
|
|
2635
|
+
})) {
|
|
2636
|
+
if (currentInput.isTouch) {
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {
|
|
2641
|
+
return;
|
|
2642
|
+
}
|
|
2643
|
+
} else {
|
|
2644
|
+
invokeHook('onClickOutside', [instance, event]);
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
if (instance.props.hideOnClick === true) {
|
|
2648
|
+
instance.clearDelayTimeouts();
|
|
2649
|
+
instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
|
|
2650
|
+
// currentTarget. This lets a tippy with `focus` trigger know that it
|
|
2651
|
+
// should not show
|
|
2652
|
+
|
|
2653
|
+
didHideDueToDocumentMouseDown = true;
|
|
2654
|
+
setTimeout(function () {
|
|
2655
|
+
didHideDueToDocumentMouseDown = false;
|
|
2656
|
+
}); // The listener gets added in `scheduleShow()`, but this may be hiding it
|
|
2657
|
+
// before it shows, and hide()'s early bail-out behavior can prevent it
|
|
2658
|
+
// from being cleaned up
|
|
2659
|
+
|
|
2660
|
+
if (!instance.state.isMounted) {
|
|
2661
|
+
removeDocumentPress();
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
function onTouchMove() {
|
|
2667
|
+
didTouchMove = true;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
function onTouchStart() {
|
|
2671
|
+
didTouchMove = false;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
function addDocumentPress() {
|
|
2675
|
+
var doc = getDocument();
|
|
2676
|
+
doc.addEventListener('mousedown', onDocumentPress, true);
|
|
2677
|
+
doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
|
|
2678
|
+
doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
|
|
2679
|
+
doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
function removeDocumentPress() {
|
|
2683
|
+
var doc = getDocument();
|
|
2684
|
+
doc.removeEventListener('mousedown', onDocumentPress, true);
|
|
2685
|
+
doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
|
|
2686
|
+
doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
|
|
2687
|
+
doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
function onTransitionedOut(duration, callback) {
|
|
2691
|
+
onTransitionEnd(duration, function () {
|
|
2692
|
+
if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
|
|
2693
|
+
callback();
|
|
2694
|
+
}
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
function onTransitionedIn(duration, callback) {
|
|
2699
|
+
onTransitionEnd(duration, callback);
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
function onTransitionEnd(duration, callback) {
|
|
2703
|
+
var box = getDefaultTemplateChildren().box;
|
|
2704
|
+
|
|
2705
|
+
function listener(event) {
|
|
2706
|
+
if (event.target === box) {
|
|
2707
|
+
updateTransitionEndListener(box, 'remove', listener);
|
|
2708
|
+
callback();
|
|
2709
|
+
}
|
|
2710
|
+
} // Make callback synchronous if duration is 0
|
|
2711
|
+
// `transitionend` won't fire otherwise
|
|
2712
|
+
|
|
2713
|
+
|
|
2714
|
+
if (duration === 0) {
|
|
2715
|
+
return callback();
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
updateTransitionEndListener(box, 'remove', currentTransitionEndListener);
|
|
2719
|
+
updateTransitionEndListener(box, 'add', listener);
|
|
2720
|
+
currentTransitionEndListener = listener;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
function on(eventType, handler, options) {
|
|
2724
|
+
if (options === void 0) {
|
|
2725
|
+
options = false;
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
var nodes = normalizeToArray(instance.props.triggerTarget || reference);
|
|
2729
|
+
nodes.forEach(function (node) {
|
|
2730
|
+
node.addEventListener(eventType, handler, options);
|
|
2731
|
+
listeners.push({
|
|
2732
|
+
node: node,
|
|
2733
|
+
eventType: eventType,
|
|
2734
|
+
handler: handler,
|
|
2735
|
+
options: options
|
|
2736
|
+
});
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
function addListeners() {
|
|
2741
|
+
if (getIsCustomTouchBehavior()) {
|
|
2742
|
+
on('touchstart', onTrigger, {
|
|
2743
|
+
passive: true
|
|
2744
|
+
});
|
|
2745
|
+
on('touchend', onMouseLeave, {
|
|
2746
|
+
passive: true
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
splitBySpaces(instance.props.trigger).forEach(function (eventType) {
|
|
2751
|
+
if (eventType === 'manual') {
|
|
2752
|
+
return;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
on(eventType, onTrigger);
|
|
2756
|
+
|
|
2757
|
+
switch (eventType) {
|
|
2758
|
+
case 'mouseenter':
|
|
2759
|
+
on('mouseleave', onMouseLeave);
|
|
2760
|
+
break;
|
|
2761
|
+
|
|
2762
|
+
case 'focus':
|
|
2763
|
+
on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
|
|
2764
|
+
break;
|
|
2765
|
+
|
|
2766
|
+
case 'focusin':
|
|
2767
|
+
on('focusout', onBlurOrFocusOut);
|
|
2768
|
+
break;
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
function removeListeners() {
|
|
2774
|
+
listeners.forEach(function (_ref) {
|
|
2775
|
+
var node = _ref.node,
|
|
2776
|
+
eventType = _ref.eventType,
|
|
2777
|
+
handler = _ref.handler,
|
|
2778
|
+
options = _ref.options;
|
|
2779
|
+
node.removeEventListener(eventType, handler, options);
|
|
2780
|
+
});
|
|
2781
|
+
listeners = [];
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
function onTrigger(event) {
|
|
2785
|
+
var _lastTriggerEvent;
|
|
2786
|
+
|
|
2787
|
+
var shouldScheduleClickHide = false;
|
|
2788
|
+
|
|
2789
|
+
if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
|
|
2790
|
+
return;
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';
|
|
2794
|
+
lastTriggerEvent = event;
|
|
2795
|
+
currentTarget = event.currentTarget;
|
|
2796
|
+
handleAriaExpandedAttribute();
|
|
2797
|
+
|
|
2798
|
+
if (!instance.state.isVisible && isMouseEvent(event)) {
|
|
2799
|
+
// If scrolling, `mouseenter` events can be fired if the cursor lands
|
|
2800
|
+
// over a new target, but `mousemove` events don't get fired. This
|
|
2801
|
+
// causes interactive tooltips to get stuck open until the cursor is
|
|
2802
|
+
// moved
|
|
2803
|
+
mouseMoveListeners.forEach(function (listener) {
|
|
2804
|
+
return listener(event);
|
|
2805
|
+
});
|
|
2806
|
+
} // Toggle show/hide when clicking click-triggered tooltips
|
|
2807
|
+
|
|
2808
|
+
|
|
2809
|
+
if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
|
2810
|
+
shouldScheduleClickHide = true;
|
|
2811
|
+
} else {
|
|
2812
|
+
scheduleShow(event);
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
if (event.type === 'click') {
|
|
2816
|
+
isVisibleFromClick = !shouldScheduleClickHide;
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
if (shouldScheduleClickHide && !wasFocused) {
|
|
2820
|
+
scheduleHide(event);
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
function onMouseMove(event) {
|
|
2825
|
+
var target = event.target;
|
|
2826
|
+
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);
|
|
2827
|
+
|
|
2828
|
+
if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
|
|
2829
|
+
return;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) {
|
|
2833
|
+
var _instance$popperInsta;
|
|
2834
|
+
|
|
2835
|
+
var instance = popper._tippy;
|
|
2836
|
+
var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;
|
|
2837
|
+
|
|
2838
|
+
if (state) {
|
|
2839
|
+
return {
|
|
2840
|
+
popperRect: popper.getBoundingClientRect(),
|
|
2841
|
+
popperState: state,
|
|
2842
|
+
props: props
|
|
2843
|
+
};
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
return null;
|
|
2847
|
+
}).filter(Boolean);
|
|
2848
|
+
|
|
2849
|
+
if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
|
|
2850
|
+
cleanupInteractiveMouseListeners();
|
|
2851
|
+
scheduleHide(event);
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
function onMouseLeave(event) {
|
|
2856
|
+
var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;
|
|
2857
|
+
|
|
2858
|
+
if (shouldBail) {
|
|
2859
|
+
return;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
if (instance.props.interactive) {
|
|
2863
|
+
instance.hideWithInteractivity(event);
|
|
2864
|
+
return;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
scheduleHide(event);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
function onBlurOrFocusOut(event) {
|
|
2871
|
+
if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {
|
|
2872
|
+
return;
|
|
2873
|
+
} // If focus was moved to within the popper
|
|
2874
|
+
|
|
2875
|
+
|
|
2876
|
+
if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
scheduleHide(event);
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2883
|
+
function isEventListenerStopped(event) {
|
|
2884
|
+
return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
function createPopperInstance() {
|
|
2888
|
+
destroyPopperInstance();
|
|
2889
|
+
var _instance$props2 = instance.props,
|
|
2890
|
+
popperOptions = _instance$props2.popperOptions,
|
|
2891
|
+
placement = _instance$props2.placement,
|
|
2892
|
+
offset = _instance$props2.offset,
|
|
2893
|
+
getReferenceClientRect = _instance$props2.getReferenceClientRect,
|
|
2894
|
+
moveTransition = _instance$props2.moveTransition;
|
|
2895
|
+
var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;
|
|
2896
|
+
var computedReference = getReferenceClientRect ? {
|
|
2897
|
+
getBoundingClientRect: getReferenceClientRect,
|
|
2898
|
+
contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
|
|
2899
|
+
} : reference;
|
|
2900
|
+
var tippyModifier = {
|
|
2901
|
+
name: '$$tippy',
|
|
2902
|
+
enabled: true,
|
|
2903
|
+
phase: 'beforeWrite',
|
|
2904
|
+
requires: ['computeStyles'],
|
|
2905
|
+
fn: function fn(_ref2) {
|
|
2906
|
+
var state = _ref2.state;
|
|
2907
|
+
|
|
2908
|
+
if (getIsDefaultRenderFn()) {
|
|
2909
|
+
var _getDefaultTemplateCh = getDefaultTemplateChildren(),
|
|
2910
|
+
box = _getDefaultTemplateCh.box;
|
|
2911
|
+
|
|
2912
|
+
['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {
|
|
2913
|
+
if (attr === 'placement') {
|
|
2914
|
+
box.setAttribute('data-placement', state.placement);
|
|
2915
|
+
} else {
|
|
2916
|
+
if (state.attributes.popper["data-popper-" + attr]) {
|
|
2917
|
+
box.setAttribute("data-" + attr, '');
|
|
2918
|
+
} else {
|
|
2919
|
+
box.removeAttribute("data-" + attr);
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
});
|
|
2923
|
+
state.attributes.popper = {};
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
};
|
|
2927
|
+
var modifiers = [{
|
|
2928
|
+
name: 'offset',
|
|
2929
|
+
options: {
|
|
2930
|
+
offset: offset
|
|
2931
|
+
}
|
|
2932
|
+
}, {
|
|
2933
|
+
name: 'preventOverflow',
|
|
2934
|
+
options: {
|
|
2935
|
+
padding: {
|
|
2936
|
+
top: 2,
|
|
2937
|
+
bottom: 2,
|
|
2938
|
+
left: 5,
|
|
2939
|
+
right: 5
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
}, {
|
|
2943
|
+
name: 'flip',
|
|
2944
|
+
options: {
|
|
2945
|
+
padding: 5
|
|
2946
|
+
}
|
|
2947
|
+
}, {
|
|
2948
|
+
name: 'computeStyles',
|
|
2949
|
+
options: {
|
|
2950
|
+
adaptive: !moveTransition
|
|
2951
|
+
}
|
|
2952
|
+
}, tippyModifier];
|
|
2953
|
+
|
|
2954
|
+
if (getIsDefaultRenderFn() && arrow) {
|
|
2955
|
+
modifiers.push({
|
|
2956
|
+
name: 'arrow',
|
|
2957
|
+
options: {
|
|
2958
|
+
element: arrow,
|
|
2959
|
+
padding: 3
|
|
2960
|
+
}
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
|
|
2965
|
+
instance.popperInstance = createPopper(computedReference, popper, Object.assign({}, popperOptions, {
|
|
2966
|
+
placement: placement,
|
|
2967
|
+
onFirstUpdate: onFirstUpdate,
|
|
2968
|
+
modifiers: modifiers
|
|
2969
|
+
}));
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
function destroyPopperInstance() {
|
|
2973
|
+
if (instance.popperInstance) {
|
|
2974
|
+
instance.popperInstance.destroy();
|
|
2975
|
+
instance.popperInstance = null;
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
function mount() {
|
|
2980
|
+
var appendTo = instance.props.appendTo;
|
|
2981
|
+
var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so
|
|
2982
|
+
// it's directly after the reference element so the elements inside the
|
|
2983
|
+
// tippy can be tabbed to
|
|
2984
|
+
// If there are clipping issues, the user can specify a different appendTo
|
|
2985
|
+
// and ensure focus management is handled correctly manually
|
|
2986
|
+
|
|
2987
|
+
var node = getCurrentTarget();
|
|
2988
|
+
|
|
2989
|
+
if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
|
|
2990
|
+
parentNode = node.parentNode;
|
|
2991
|
+
} else {
|
|
2992
|
+
parentNode = invokeWithArgsOrReturn(appendTo, [node]);
|
|
2993
|
+
} // The popper element needs to exist on the DOM before its position can be
|
|
2994
|
+
// updated as Popper needs to read its dimensions
|
|
2995
|
+
|
|
2996
|
+
|
|
2997
|
+
if (!parentNode.contains(popper)) {
|
|
2998
|
+
parentNode.appendChild(popper);
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
instance.state.isMounted = true;
|
|
3002
|
+
createPopperInstance();
|
|
3003
|
+
/* istanbul ignore else */
|
|
3004
|
+
|
|
3005
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3006
|
+
// Accessibility check
|
|
3007
|
+
warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard', 'navigation because it is not directly after the reference element', 'in the DOM source order.', '\n\n', 'Using a wrapper <div> or <span> tag around the reference element', 'solves this by creating a new parentNode context.', '\n\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle', 'keyboard navigation.', '\n\n', 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
function getNestedPopperTree() {
|
|
3012
|
+
return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
function scheduleShow(event) {
|
|
3016
|
+
instance.clearDelayTimeouts();
|
|
3017
|
+
|
|
3018
|
+
if (event) {
|
|
3019
|
+
invokeHook('onTrigger', [instance, event]);
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
addDocumentPress();
|
|
3023
|
+
var delay = getDelay(true);
|
|
3024
|
+
|
|
3025
|
+
var _getNormalizedTouchSe = getNormalizedTouchSettings(),
|
|
3026
|
+
touchValue = _getNormalizedTouchSe[0],
|
|
3027
|
+
touchDelay = _getNormalizedTouchSe[1];
|
|
3028
|
+
|
|
3029
|
+
if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {
|
|
3030
|
+
delay = touchDelay;
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3033
|
+
if (delay) {
|
|
3034
|
+
showTimeout = setTimeout(function () {
|
|
3035
|
+
instance.show();
|
|
3036
|
+
}, delay);
|
|
3037
|
+
} else {
|
|
3038
|
+
instance.show();
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
function scheduleHide(event) {
|
|
3043
|
+
instance.clearDelayTimeouts();
|
|
3044
|
+
invokeHook('onUntrigger', [instance, event]);
|
|
3045
|
+
|
|
3046
|
+
if (!instance.state.isVisible) {
|
|
3047
|
+
removeDocumentPress();
|
|
3048
|
+
return;
|
|
3049
|
+
} // For interactive tippies, scheduleHide is added to a document.body handler
|
|
3050
|
+
// from onMouseLeave so must intercept scheduled hides from mousemove/leave
|
|
3051
|
+
// events when trigger contains mouseenter and click, and the tip is
|
|
3052
|
+
// currently shown as a result of a click.
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {
|
|
3056
|
+
return;
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
var delay = getDelay(false);
|
|
3060
|
+
|
|
3061
|
+
if (delay) {
|
|
3062
|
+
hideTimeout = setTimeout(function () {
|
|
3063
|
+
if (instance.state.isVisible) {
|
|
3064
|
+
instance.hide();
|
|
3065
|
+
}
|
|
3066
|
+
}, delay);
|
|
3067
|
+
} else {
|
|
3068
|
+
// Fixes a `transitionend` problem when it fires 1 frame too
|
|
3069
|
+
// late sometimes, we don't want hide() to be called.
|
|
3070
|
+
scheduleHideAnimationFrame = requestAnimationFrame(function () {
|
|
3071
|
+
instance.hide();
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
} // ===========================================================================
|
|
3075
|
+
// 🔑 Public methods
|
|
3076
|
+
// ===========================================================================
|
|
3077
|
+
|
|
3078
|
+
|
|
3079
|
+
function enable() {
|
|
3080
|
+
instance.state.isEnabled = true;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
function disable() {
|
|
3084
|
+
// Disabling the instance should also hide it
|
|
3085
|
+
// https://github.com/atomiks/tippy.js-react/issues/106
|
|
3086
|
+
instance.hide();
|
|
3087
|
+
instance.state.isEnabled = false;
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
function clearDelayTimeouts() {
|
|
3091
|
+
clearTimeout(showTimeout);
|
|
3092
|
+
clearTimeout(hideTimeout);
|
|
3093
|
+
cancelAnimationFrame(scheduleHideAnimationFrame);
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
function setProps(partialProps) {
|
|
3097
|
+
/* istanbul ignore else */
|
|
3098
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3099
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
if (instance.state.isDestroyed) {
|
|
3103
|
+
return;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
invokeHook('onBeforeUpdate', [instance, partialProps]);
|
|
3107
|
+
removeListeners();
|
|
3108
|
+
var prevProps = instance.props;
|
|
3109
|
+
var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
|
|
3110
|
+
ignoreAttributes: true
|
|
3111
|
+
}));
|
|
3112
|
+
instance.props = nextProps;
|
|
3113
|
+
addListeners();
|
|
3114
|
+
|
|
3115
|
+
if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
|
|
3116
|
+
cleanupInteractiveMouseListeners();
|
|
3117
|
+
debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
|
|
3118
|
+
} // Ensure stale aria-expanded attributes are removed
|
|
3119
|
+
|
|
3120
|
+
|
|
3121
|
+
if (prevProps.triggerTarget && !nextProps.triggerTarget) {
|
|
3122
|
+
normalizeToArray(prevProps.triggerTarget).forEach(function (node) {
|
|
3123
|
+
node.removeAttribute('aria-expanded');
|
|
3124
|
+
});
|
|
3125
|
+
} else if (nextProps.triggerTarget) {
|
|
3126
|
+
reference.removeAttribute('aria-expanded');
|
|
3127
|
+
}
|
|
3128
|
+
|
|
3129
|
+
handleAriaExpandedAttribute();
|
|
3130
|
+
handleStyles();
|
|
3131
|
+
|
|
3132
|
+
if (onUpdate) {
|
|
3133
|
+
onUpdate(prevProps, nextProps);
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
if (instance.popperInstance) {
|
|
3137
|
+
createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,
|
|
3138
|
+
// and the nested ones get re-rendered first.
|
|
3139
|
+
// https://github.com/atomiks/tippyjs-react/issues/177
|
|
3140
|
+
// TODO: find a cleaner / more efficient solution(!)
|
|
3141
|
+
|
|
3142
|
+
getNestedPopperTree().forEach(function (nestedPopper) {
|
|
3143
|
+
// React (and other UI libs likely) requires a rAF wrapper as it flushes
|
|
3144
|
+
// its work in one
|
|
3145
|
+
requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
invokeHook('onAfterUpdate', [instance, partialProps]);
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
function setContent(content) {
|
|
3153
|
+
instance.setProps({
|
|
3154
|
+
content: content
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
function show() {
|
|
3159
|
+
/* istanbul ignore else */
|
|
3160
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3161
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
|
|
3162
|
+
} // Early bail-out
|
|
3163
|
+
|
|
3164
|
+
|
|
3165
|
+
var isAlreadyVisible = instance.state.isVisible;
|
|
3166
|
+
var isDestroyed = instance.state.isDestroyed;
|
|
3167
|
+
var isDisabled = !instance.state.isEnabled;
|
|
3168
|
+
var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
|
|
3169
|
+
var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
|
|
3170
|
+
|
|
3171
|
+
if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
|
|
3172
|
+
return;
|
|
3173
|
+
} // Normalize `disabled` behavior across browsers.
|
|
3174
|
+
// Firefox allows events on disabled elements, but Chrome doesn't.
|
|
3175
|
+
// Using a wrapper element (i.e. <span>) is recommended.
|
|
3176
|
+
|
|
3177
|
+
|
|
3178
|
+
if (getCurrentTarget().hasAttribute('disabled')) {
|
|
3179
|
+
return;
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
invokeHook('onShow', [instance], false);
|
|
3183
|
+
|
|
3184
|
+
if (instance.props.onShow(instance) === false) {
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
instance.state.isVisible = true;
|
|
3189
|
+
|
|
3190
|
+
if (getIsDefaultRenderFn()) {
|
|
3191
|
+
popper.style.visibility = 'visible';
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3194
|
+
handleStyles();
|
|
3195
|
+
addDocumentPress();
|
|
3196
|
+
|
|
3197
|
+
if (!instance.state.isMounted) {
|
|
3198
|
+
popper.style.transition = 'none';
|
|
3199
|
+
} // If flipping to the opposite side after hiding at least once, the
|
|
3200
|
+
// animation will use the wrong placement without resetting the duration
|
|
3201
|
+
|
|
3202
|
+
|
|
3203
|
+
if (getIsDefaultRenderFn()) {
|
|
3204
|
+
var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),
|
|
3205
|
+
box = _getDefaultTemplateCh2.box,
|
|
3206
|
+
content = _getDefaultTemplateCh2.content;
|
|
3207
|
+
|
|
3208
|
+
setTransitionDuration([box, content], 0);
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
onFirstUpdate = function onFirstUpdate() {
|
|
3212
|
+
var _instance$popperInsta2;
|
|
3213
|
+
|
|
3214
|
+
if (!instance.state.isVisible || ignoreOnFirstUpdate) {
|
|
3215
|
+
return;
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
ignoreOnFirstUpdate = true; // reflow
|
|
3219
|
+
|
|
3220
|
+
void popper.offsetHeight;
|
|
3221
|
+
popper.style.transition = instance.props.moveTransition;
|
|
3222
|
+
|
|
3223
|
+
if (getIsDefaultRenderFn() && instance.props.animation) {
|
|
3224
|
+
var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),
|
|
3225
|
+
_box = _getDefaultTemplateCh3.box,
|
|
3226
|
+
_content = _getDefaultTemplateCh3.content;
|
|
3227
|
+
|
|
3228
|
+
setTransitionDuration([_box, _content], duration);
|
|
3229
|
+
setVisibilityState([_box, _content], 'visible');
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
handleAriaContentAttribute();
|
|
3233
|
+
handleAriaExpandedAttribute();
|
|
3234
|
+
pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
|
|
3235
|
+
// popper has been positioned for the first time
|
|
3236
|
+
|
|
3237
|
+
(_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
|
|
3238
|
+
invokeHook('onMount', [instance]);
|
|
3239
|
+
|
|
3240
|
+
if (instance.props.animation && getIsDefaultRenderFn()) {
|
|
3241
|
+
onTransitionedIn(duration, function () {
|
|
3242
|
+
instance.state.isShown = true;
|
|
3243
|
+
invokeHook('onShown', [instance]);
|
|
3244
|
+
});
|
|
3245
|
+
}
|
|
3246
|
+
};
|
|
3247
|
+
|
|
3248
|
+
mount();
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
function hide() {
|
|
3252
|
+
/* istanbul ignore else */
|
|
3253
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3254
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
|
|
3255
|
+
} // Early bail-out
|
|
3256
|
+
|
|
3257
|
+
|
|
3258
|
+
var isAlreadyHidden = !instance.state.isVisible;
|
|
3259
|
+
var isDestroyed = instance.state.isDestroyed;
|
|
3260
|
+
var isDisabled = !instance.state.isEnabled;
|
|
3261
|
+
var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
|
|
3262
|
+
|
|
3263
|
+
if (isAlreadyHidden || isDestroyed || isDisabled) {
|
|
3264
|
+
return;
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3267
|
+
invokeHook('onHide', [instance], false);
|
|
3268
|
+
|
|
3269
|
+
if (instance.props.onHide(instance) === false) {
|
|
3270
|
+
return;
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
instance.state.isVisible = false;
|
|
3274
|
+
instance.state.isShown = false;
|
|
3275
|
+
ignoreOnFirstUpdate = false;
|
|
3276
|
+
isVisibleFromClick = false;
|
|
3277
|
+
|
|
3278
|
+
if (getIsDefaultRenderFn()) {
|
|
3279
|
+
popper.style.visibility = 'hidden';
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
cleanupInteractiveMouseListeners();
|
|
3283
|
+
removeDocumentPress();
|
|
3284
|
+
handleStyles(true);
|
|
3285
|
+
|
|
3286
|
+
if (getIsDefaultRenderFn()) {
|
|
3287
|
+
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
|
|
3288
|
+
box = _getDefaultTemplateCh4.box,
|
|
3289
|
+
content = _getDefaultTemplateCh4.content;
|
|
3290
|
+
|
|
3291
|
+
if (instance.props.animation) {
|
|
3292
|
+
setTransitionDuration([box, content], duration);
|
|
3293
|
+
setVisibilityState([box, content], 'hidden');
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
handleAriaContentAttribute();
|
|
3298
|
+
handleAriaExpandedAttribute();
|
|
3299
|
+
|
|
3300
|
+
if (instance.props.animation) {
|
|
3301
|
+
if (getIsDefaultRenderFn()) {
|
|
3302
|
+
onTransitionedOut(duration, instance.unmount);
|
|
3303
|
+
}
|
|
3304
|
+
} else {
|
|
3305
|
+
instance.unmount();
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
function hideWithInteractivity(event) {
|
|
3310
|
+
/* istanbul ignore else */
|
|
3311
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3312
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
|
|
3313
|
+
}
|
|
3314
|
+
|
|
3315
|
+
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
|
3316
|
+
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
|
3317
|
+
debouncedOnMouseMove(event);
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
function unmount() {
|
|
3321
|
+
/* istanbul ignore else */
|
|
3322
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3323
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
if (instance.state.isVisible) {
|
|
3327
|
+
instance.hide();
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
if (!instance.state.isMounted) {
|
|
3331
|
+
return;
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper
|
|
3335
|
+
// tree by default. This seems mainly for interactive tippies, but we should
|
|
3336
|
+
// find a workaround if possible
|
|
3337
|
+
|
|
3338
|
+
getNestedPopperTree().forEach(function (nestedPopper) {
|
|
3339
|
+
nestedPopper._tippy.unmount();
|
|
3340
|
+
});
|
|
3341
|
+
|
|
3342
|
+
if (popper.parentNode) {
|
|
3343
|
+
popper.parentNode.removeChild(popper);
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
mountedInstances = mountedInstances.filter(function (i) {
|
|
3347
|
+
return i !== instance;
|
|
3348
|
+
});
|
|
3349
|
+
instance.state.isMounted = false;
|
|
3350
|
+
invokeHook('onHidden', [instance]);
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
function destroy() {
|
|
3354
|
+
/* istanbul ignore else */
|
|
3355
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3356
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
if (instance.state.isDestroyed) {
|
|
3360
|
+
return;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
instance.clearDelayTimeouts();
|
|
3364
|
+
instance.unmount();
|
|
3365
|
+
removeListeners();
|
|
3366
|
+
delete reference._tippy;
|
|
3367
|
+
instance.state.isDestroyed = true;
|
|
3368
|
+
invokeHook('onDestroy', [instance]);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
function tippy(targets, optionalProps) {
|
|
3373
|
+
if (optionalProps === void 0) {
|
|
3374
|
+
optionalProps = {};
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
|
|
3378
|
+
/* istanbul ignore else */
|
|
3379
|
+
|
|
3380
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3381
|
+
validateTargets(targets);
|
|
3382
|
+
validateProps(optionalProps, plugins);
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
bindGlobalEventListeners();
|
|
3386
|
+
var passedProps = Object.assign({}, optionalProps, {
|
|
3387
|
+
plugins: plugins
|
|
3388
|
+
});
|
|
3389
|
+
var elements = getArrayOfElements(targets);
|
|
3390
|
+
/* istanbul ignore else */
|
|
3391
|
+
|
|
3392
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3393
|
+
var isSingleContentElement = isElement(passedProps.content);
|
|
3394
|
+
var isMoreThanOneReferenceElement = elements.length > 1;
|
|
3395
|
+
warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than', 'one tippy instance was created by this invocation. This means the', 'content element will only be appended to the last tippy instance.', '\n\n', 'Instead, pass the .innerHTML of the element, or use a function that', 'returns a cloned version of the element instead.', '\n\n', '1) content: element.innerHTML\n', '2) content: () => element.cloneNode(true)'].join(' '));
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
var instances = elements.reduce(function (acc, reference) {
|
|
3399
|
+
var instance = reference && createTippy(reference, passedProps);
|
|
3400
|
+
|
|
3401
|
+
if (instance) {
|
|
3402
|
+
acc.push(instance);
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
return acc;
|
|
3406
|
+
}, []);
|
|
3407
|
+
return isElement(targets) ? instances[0] : instances;
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
tippy.defaultProps = defaultProps;
|
|
3411
|
+
tippy.setDefaultProps = setDefaultProps;
|
|
3412
|
+
tippy.currentInput = currentInput;
|
|
3413
|
+
|
|
3414
|
+
// every time the popper is destroyed (i.e. a new target), removing the styles
|
|
3415
|
+
// and causing transitions to break for singletons when the console is open, but
|
|
3416
|
+
// most notably for non-transform styles being used, `gpuAcceleration: false`.
|
|
3417
|
+
|
|
3418
|
+
Object.assign({}, applyStyles$1, {
|
|
3419
|
+
effect: function effect(_ref) {
|
|
3420
|
+
var state = _ref.state;
|
|
3421
|
+
var initialStyles = {
|
|
3422
|
+
popper: {
|
|
3423
|
+
position: state.options.strategy,
|
|
3424
|
+
left: '0',
|
|
3425
|
+
top: '0',
|
|
3426
|
+
margin: '0'
|
|
3427
|
+
},
|
|
3428
|
+
arrow: {
|
|
3429
|
+
position: 'absolute'
|
|
3430
|
+
},
|
|
3431
|
+
reference: {}
|
|
3432
|
+
};
|
|
3433
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
3434
|
+
state.styles = initialStyles;
|
|
3435
|
+
|
|
3436
|
+
if (state.elements.arrow) {
|
|
3437
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
3438
|
+
} // intentionally return no cleanup function
|
|
3439
|
+
// return () => { ... }
|
|
3440
|
+
|
|
3441
|
+
}
|
|
3442
|
+
});
|
|
3443
|
+
|
|
3444
|
+
tippy.setDefaultProps({
|
|
3445
|
+
render: render
|
|
3446
|
+
});
|
|
3447
|
+
|
|
3448
|
+
const style = ":host {\n display: flex;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n\n.tippy-arrow::before {\n content: \"\";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n\n.tippy-box[data-placement^=top] > .tippy-arrow::before {\n border-top-color: initial;\n transform-origin: center top;\n}\n\n.tippy-box[data-placement^=bottom] > .tippy-arrow::before {\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n\n.tippy-box[data-placement^=left] > .tippy-arrow::before {\n border-left-color: initial;\n transform-origin: center left;\n}\n\n.tippy-box[data-placement^=right] > .tippy-arrow::before {\n border-right-color: initial;\n transform-origin: center right;\n}\n\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n\n.tippy-arrow {\n width: 16px;\n height: 16px;\n}\n\n.size-medium {\n border-radius: 4px;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 10px;\n font-weight: 600;\n font-style: normal;\n line-height: 12px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.size-medium[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.size-medium[data-placement^=top] > .tippy-arrow::before {\n bottom: -6px;\n left: 2px;\n border-width: 6px 6px 0;\n}\n.size-medium[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.size-medium[data-placement^=bottom] > .tippy-arrow::before {\n top: -6px;\n left: 2px;\n border-width: 0 6px 6px;\n}\n.size-medium[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.size-medium[data-placement^=left] > .tippy-arrow::before {\n border-width: 6px 0 6px 6px;\n right: -6px;\n top: 2px;\n}\n.size-medium[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.size-medium[data-placement^=right] > .tippy-arrow::before {\n left: -6px;\n top: 2px;\n border-width: 6px 6px 6px 0;\n}\n\n.size-large {\n border-radius: 8px;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: 20px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.size-large[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.size-large[data-placement^=top] > .tippy-arrow::before {\n bottom: -8px;\n left: 0;\n border-width: 8px 8px 0;\n}\n.size-large[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.size-large[data-placement^=bottom] > .tippy-arrow::before {\n top: -8px;\n left: 0;\n border-width: 0 8px 8px;\n}\n.size-large[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.size-large[data-placement^=left] > .tippy-arrow::before {\n border-width: 8px 0 8px 8px;\n right: -8px;\n}\n.size-large[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.size-large[data-placement^=right] > .tippy-arrow::before {\n left: -8px;\n border-width: 8px 8px 8px 0;\n}\n\n.variant-dark {\n --tw-bg-opacity: 1;\n background-color: rgb(54 80 99 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n.variant-dark[data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n.variant-dark[data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n.variant-dark[data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n.variant-dark[data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n.variant-dark > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(54 80 99 / var(--tw-bg-opacity));\n}\n.variant-dark > .tippy-svg-arrow {\n fill: #365063;\n}\n\n.variant-light {\n --tw-bg-opacity: 1;\n background-color: rgb(245 248 250 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(36 53 66 / var(--tw-text-opacity));\n}\n.variant-light[data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n.variant-light[data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n.variant-light[data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n.variant-light[data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n.variant-light > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(245 248 250 / var(--tw-bg-opacity));\n}\n.variant-light > .tippy-svg-arrow {\n fill: #f5f8fa;\n}\n\n.variant-success {\n --tw-bg-opacity: 1;\n background-color: rgb(71 205 104 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n.variant-success[data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n.variant-success[data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n.variant-success[data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n.variant-success[data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n.variant-success > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(71 205 104 / var(--tw-bg-opacity));\n}\n.variant-success > .tippy-svg-arrow {\n fill: #47cd68;\n}\n\n.variant-danger {\n --tw-bg-opacity: 1;\n background-color: rgb(233 99 99 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n.variant-danger[data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n.variant-danger[data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n.variant-danger[data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n.variant-danger[data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n.variant-danger > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(233 99 99 / var(--tw-bg-opacity));\n}\n.variant-danger > .tippy-svg-arrow {\n fill: #e96363;\n}\n\n.tippy-box[data-theme~=dark-medium] {\n border-radius: 4px;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 10px;\n font-weight: 600;\n font-style: normal;\n line-height: 12px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=top] > .tippy-arrow::before {\n bottom: -6px;\n left: 2px;\n border-width: 6px 6px 0;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=bottom] > .tippy-arrow::before {\n top: -6px;\n left: 2px;\n border-width: 0 6px 6px;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=left] > .tippy-arrow::before {\n border-width: 6px 0 6px 6px;\n right: -6px;\n top: 2px;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=right] > .tippy-arrow::before {\n left: -6px;\n top: 2px;\n border-width: 6px 6px 6px 0;\n}\n\n.tippy-box[data-theme~=dark-medium] {\n --tw-bg-opacity: 1;\n background-color: rgb(54 80 99 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-medium][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-medium] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(54 80 99 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=dark-medium] > .tippy-svg-arrow {\n fill: #365063;\n}\n\n.tippy-box[data-theme~=dark-large] {\n border-radius: 8px;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: 20px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=top] > .tippy-arrow::before {\n bottom: -8px;\n left: 0;\n border-width: 8px 8px 0;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=bottom] > .tippy-arrow::before {\n top: -8px;\n left: 0;\n border-width: 0 8px 8px;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=left] > .tippy-arrow::before {\n border-width: 8px 0 8px 8px;\n right: -8px;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=right] > .tippy-arrow::before {\n left: -8px;\n border-width: 8px 8px 8px 0;\n}\n\n.tippy-box[data-theme~=dark-large] {\n --tw-bg-opacity: 1;\n background-color: rgb(54 80 99 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-large][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(54 80 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=dark-large] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(54 80 99 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=dark-large] > .tippy-svg-arrow {\n fill: #365063;\n}\n\n.tippy-box[data-theme~=light-medium] {\n border-radius: 4px;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 10px;\n font-weight: 600;\n font-style: normal;\n line-height: 12px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=top] > .tippy-arrow::before {\n bottom: -6px;\n left: 2px;\n border-width: 6px 6px 0;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=bottom] > .tippy-arrow::before {\n top: -6px;\n left: 2px;\n border-width: 0 6px 6px;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=left] > .tippy-arrow::before {\n border-width: 6px 0 6px 6px;\n right: -6px;\n top: 2px;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=right] > .tippy-arrow::before {\n left: -6px;\n top: 2px;\n border-width: 6px 6px 6px 0;\n}\n\n.tippy-box[data-theme~=light-medium] {\n --tw-bg-opacity: 1;\n background-color: rgb(245 248 250 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(36 53 66 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-medium][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-medium] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(245 248 250 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=light-medium] > .tippy-svg-arrow {\n fill: #f5f8fa;\n}\n\n.tippy-box[data-theme~=light-large] {\n border-radius: 8px;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: 20px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=top] > .tippy-arrow::before {\n bottom: -8px;\n left: 0;\n border-width: 8px 8px 0;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=bottom] > .tippy-arrow::before {\n top: -8px;\n left: 0;\n border-width: 0 8px 8px;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=left] > .tippy-arrow::before {\n border-width: 8px 0 8px 8px;\n right: -8px;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=right] > .tippy-arrow::before {\n left: -8px;\n border-width: 8px 8px 8px 0;\n}\n\n.tippy-box[data-theme~=light-large] {\n --tw-bg-opacity: 1;\n background-color: rgb(245 248 250 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(36 53 66 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-large][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(245 248 250 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=light-large] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(245 248 250 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=light-large] > .tippy-svg-arrow {\n fill: #f5f8fa;\n}\n\n.tippy-box[data-theme~=success-medium] {\n border-radius: 4px;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 10px;\n font-weight: 600;\n font-style: normal;\n line-height: 12px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=top] > .tippy-arrow::before {\n bottom: -6px;\n left: 2px;\n border-width: 6px 6px 0;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=bottom] > .tippy-arrow::before {\n top: -6px;\n left: 2px;\n border-width: 0 6px 6px;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=left] > .tippy-arrow::before {\n border-width: 6px 0 6px 6px;\n right: -6px;\n top: 2px;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=right] > .tippy-arrow::before {\n left: -6px;\n top: 2px;\n border-width: 6px 6px 6px 0;\n}\n\n.tippy-box[data-theme~=success-medium] {\n --tw-bg-opacity: 1;\n background-color: rgb(71 205 104 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-medium][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-medium] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(71 205 104 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=success-medium] > .tippy-svg-arrow {\n fill: #47cd68;\n}\n\n.tippy-box[data-theme~=success-large] {\n border-radius: 8px;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: 20px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=top] > .tippy-arrow::before {\n bottom: -8px;\n left: 0;\n border-width: 8px 8px 0;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=bottom] > .tippy-arrow::before {\n top: -8px;\n left: 0;\n border-width: 0 8px 8px;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=left] > .tippy-arrow::before {\n border-width: 8px 0 8px 8px;\n right: -8px;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=right] > .tippy-arrow::before {\n left: -8px;\n border-width: 8px 8px 8px 0;\n}\n\n.tippy-box[data-theme~=success-large] {\n --tw-bg-opacity: 1;\n background-color: rgb(71 205 104 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-large][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(71 205 104 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=success-large] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(71 205 104 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=success-large] > .tippy-svg-arrow {\n fill: #47cd68;\n}\n\n.tippy-box[data-theme~=danger-medium] {\n border-radius: 4px;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 10px;\n font-weight: 600;\n font-style: normal;\n line-height: 12px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=top] > .tippy-arrow::before {\n bottom: -6px;\n left: 2px;\n border-width: 6px 6px 0;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=bottom] > .tippy-arrow::before {\n top: -6px;\n left: 2px;\n border-width: 0 6px 6px;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=left] > .tippy-arrow::before {\n border-width: 6px 0 6px 6px;\n right: -6px;\n top: 2px;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=right] > .tippy-arrow::before {\n left: -6px;\n top: 2px;\n border-width: 6px 6px 6px 0;\n}\n\n.tippy-box[data-theme~=danger-medium] {\n --tw-bg-opacity: 1;\n background-color: rgb(233 99 99 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-medium][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-medium] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(233 99 99 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=danger-medium] > .tippy-svg-arrow {\n fill: #e96363;\n}\n\n.tippy-box[data-theme~=danger-large] {\n border-radius: 8px;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-family: Inter, sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: 20px;\n --tw-shadow: 0px 18px 7px rgba(63, 93, 116, 0.02), 0px 10px 6px rgba(63, 93, 116, 0.08), 0px 4px 4px rgba(63, 93, 116, 0.13), 0px 1px 2px rgba(63, 93, 116, 0.15), 0px 0px 0px rgba(63, 93, 116, 0.16);\n --tw-shadow-colored: 0px 18px 7px var(--tw-shadow-color), 0px 10px 6px var(--tw-shadow-color), 0px 4px 4px var(--tw-shadow-color), 0px 1px 2px var(--tw-shadow-color), 0px 0px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=top] > .tippy-arrow::before {\n bottom: -8px;\n left: 0;\n border-width: 8px 8px 0;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=bottom] > .tippy-arrow::before {\n top: -8px;\n left: 0;\n border-width: 0 8px 8px;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=left] > .tippy-arrow::before {\n border-width: 8px 0 8px 8px;\n right: -8px;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=right] > .tippy-arrow::before {\n left: -8px;\n border-width: 8px 8px 8px 0;\n}\n\n.tippy-box[data-theme~=danger-large] {\n --tw-bg-opacity: 1;\n background-color: rgb(233 99 99 / var(--tw-bg-opacity));\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=top] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-top-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=bottom] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=left] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-left-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-large][data-placement^=right] .tippy-arrow::before {\n --tw-border-opacity: 1;\n border-right-color: rgb(233 99 99 / var(--tw-border-opacity));\n}\n\n.tippy-box[data-theme~=danger-large] > .tippy-backdrop {\n --tw-bg-opacity: 1;\n background-color: rgb(233 99 99 / var(--tw-bg-opacity));\n}\n\n.tippy-box[data-theme~=danger-large] > .tippy-svg-arrow {\n fill: #e96363;\n}";
|
|
3449
|
+
|
|
3450
|
+
var __defProp = Object.defineProperty;
|
|
3451
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3452
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
3453
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
3454
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
3455
|
+
if (decorator = decorators[i])
|
|
3456
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3457
|
+
if (kind && result)
|
|
3458
|
+
__defProp(target, key, result);
|
|
3459
|
+
return result;
|
|
3460
|
+
};
|
|
3461
|
+
exports.LuksoTooltip = class LuksoTooltip extends shared_tailwindElement_index.TailwindStyledElement(style) {
|
|
3462
|
+
constructor() {
|
|
3463
|
+
super(...arguments);
|
|
3464
|
+
this.variant = "dark";
|
|
3465
|
+
this.size = "medium";
|
|
3466
|
+
this.placement = "top";
|
|
3467
|
+
this.trigger = "mouseenter";
|
|
3468
|
+
this.text = "";
|
|
3469
|
+
this.maxWidth = 300;
|
|
3470
|
+
this.show = false;
|
|
3471
|
+
this.hideOnClick = "true";
|
|
3472
|
+
this.isClipboardCopy = false;
|
|
3473
|
+
this.copyText = "";
|
|
3474
|
+
this.copyValue = "";
|
|
3475
|
+
this.offset = 10;
|
|
3476
|
+
this.showCopy = false;
|
|
3477
|
+
this.defaultTooltipStyles = "bg-neutral-20 p-4 hidden";
|
|
3478
|
+
this.tooltipInstance = void 0;
|
|
3479
|
+
}
|
|
3480
|
+
hideOnClickCheck() {
|
|
3481
|
+
if (this.hideOnClick === "toggle") {
|
|
3482
|
+
return this.hideOnClick;
|
|
3483
|
+
}
|
|
3484
|
+
if (this.hideOnClick === "true") {
|
|
3485
|
+
return true;
|
|
3486
|
+
}
|
|
3487
|
+
if (this.hideOnClick === "false") {
|
|
3488
|
+
return false;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
initTooltip() {
|
|
3492
|
+
const trigger = this.shadowRoot.getElementById("trigger");
|
|
3493
|
+
const tooltip = this.shadowRoot.getElementById("tooltip");
|
|
3494
|
+
if (this.tooltipInstance) {
|
|
3495
|
+
this.tooltipInstance.destroy();
|
|
3496
|
+
this.tooltipInstance = void 0;
|
|
3497
|
+
}
|
|
3498
|
+
if (!this.text) {
|
|
3499
|
+
return;
|
|
3500
|
+
}
|
|
3501
|
+
this.tooltipInstance = tippy(trigger, {
|
|
3502
|
+
content: tooltip.innerHTML,
|
|
3503
|
+
allowHTML: true,
|
|
3504
|
+
arrow: true,
|
|
3505
|
+
animation: "fade",
|
|
3506
|
+
interactive: true,
|
|
3507
|
+
trigger: this.trigger,
|
|
3508
|
+
placement: this.placement,
|
|
3509
|
+
maxWidth: this.maxWidth,
|
|
3510
|
+
theme: `${this.variant}-${this.size}`,
|
|
3511
|
+
offset: [0, this.offset],
|
|
3512
|
+
hideOnClick: this.hideOnClickCheck()
|
|
3513
|
+
});
|
|
3514
|
+
}
|
|
3515
|
+
handleClick() {
|
|
3516
|
+
if (!this.isClipboardCopy || !this.copyText || !this.copyValue) {
|
|
3517
|
+
return;
|
|
3518
|
+
}
|
|
3519
|
+
this.showCopy = true;
|
|
3520
|
+
navigator.clipboard.writeText(this.copyValue);
|
|
3521
|
+
setTimeout(() => {
|
|
3522
|
+
this.showCopy = false;
|
|
3523
|
+
}, 1e3);
|
|
3524
|
+
}
|
|
3525
|
+
async willUpdate(changedProperties) {
|
|
3526
|
+
await this.updateComplete;
|
|
3527
|
+
if (changedProperties.has("show") && this.trigger === "manual") {
|
|
3528
|
+
if (this.show) {
|
|
3529
|
+
!!!this.tooltipInstance && this.initTooltip();
|
|
3530
|
+
this.tooltipInstance.show();
|
|
3531
|
+
} else {
|
|
3532
|
+
this.tooltipInstance?.hide();
|
|
3533
|
+
}
|
|
3534
|
+
return;
|
|
3535
|
+
}
|
|
3536
|
+
this.initTooltip();
|
|
3537
|
+
}
|
|
3538
|
+
render() {
|
|
3539
|
+
return shared_tailwindElement_index.x`
|
|
3540
|
+
<div
|
|
3541
|
+
id="tooltip"
|
|
3542
|
+
role="tooltip"
|
|
3543
|
+
class=${index.customClassMap({
|
|
3544
|
+
[this.defaultTooltipStyles]: true
|
|
3545
|
+
})}
|
|
3546
|
+
>
|
|
3547
|
+
${this.text}
|
|
3548
|
+
</div>
|
|
3549
|
+
${this.isClipboardCopy ? shared_tailwindElement_index.x`<lukso-tooltip
|
|
3550
|
+
variant=${this.variant}
|
|
3551
|
+
size=${this.size}
|
|
3552
|
+
placement=${this.placement}
|
|
3553
|
+
max-width=${this.maxWidth}
|
|
3554
|
+
offset=${this.offset}
|
|
3555
|
+
trigger="manual"
|
|
3556
|
+
?show=${this.showCopy ? true : void 0}
|
|
3557
|
+
text=${this.copyText}
|
|
3558
|
+
>
|
|
3559
|
+
<div id="trigger" class="cursor-pointer" @click=${this.handleClick}>
|
|
3560
|
+
<slot></slot>
|
|
3561
|
+
</div>
|
|
3562
|
+
</lukso-tooltip>` : shared_tailwindElement_index.x`<div
|
|
3563
|
+
id="trigger"
|
|
3564
|
+
class="cursor-pointer"
|
|
3565
|
+
@click=${this.handleClick}
|
|
3566
|
+
>
|
|
3567
|
+
<slot></slot>
|
|
3568
|
+
</div>`}
|
|
3569
|
+
`;
|
|
3570
|
+
}
|
|
3571
|
+
};
|
|
3572
|
+
__decorateClass([
|
|
3573
|
+
queryAssignedElements.n({ type: String })
|
|
3574
|
+
], exports.LuksoTooltip.prototype, "variant", 2);
|
|
3575
|
+
__decorateClass([
|
|
3576
|
+
queryAssignedElements.n({ type: String })
|
|
3577
|
+
], exports.LuksoTooltip.prototype, "size", 2);
|
|
3578
|
+
__decorateClass([
|
|
3579
|
+
queryAssignedElements.n({ type: String })
|
|
3580
|
+
], exports.LuksoTooltip.prototype, "placement", 2);
|
|
3581
|
+
__decorateClass([
|
|
3582
|
+
queryAssignedElements.n({ type: String })
|
|
3583
|
+
], exports.LuksoTooltip.prototype, "trigger", 2);
|
|
3584
|
+
__decorateClass([
|
|
3585
|
+
queryAssignedElements.n({ type: String })
|
|
3586
|
+
], exports.LuksoTooltip.prototype, "text", 2);
|
|
3587
|
+
__decorateClass([
|
|
3588
|
+
queryAssignedElements.n({ type: Number, attribute: "max-width" })
|
|
3589
|
+
], exports.LuksoTooltip.prototype, "maxWidth", 2);
|
|
3590
|
+
__decorateClass([
|
|
3591
|
+
queryAssignedElements.n({ type: Boolean })
|
|
3592
|
+
], exports.LuksoTooltip.prototype, "show", 2);
|
|
3593
|
+
__decorateClass([
|
|
3594
|
+
queryAssignedElements.n({ type: String, attribute: "hide-on-click" })
|
|
3595
|
+
], exports.LuksoTooltip.prototype, "hideOnClick", 2);
|
|
3596
|
+
__decorateClass([
|
|
3597
|
+
queryAssignedElements.n({ type: Boolean, attribute: "is-clipboard-copy" })
|
|
3598
|
+
], exports.LuksoTooltip.prototype, "isClipboardCopy", 2);
|
|
3599
|
+
__decorateClass([
|
|
3600
|
+
queryAssignedElements.n({ type: String, attribute: "copy-text" })
|
|
3601
|
+
], exports.LuksoTooltip.prototype, "copyText", 2);
|
|
3602
|
+
__decorateClass([
|
|
3603
|
+
queryAssignedElements.n({ type: String, attribute: "copy-value" })
|
|
3604
|
+
], exports.LuksoTooltip.prototype, "copyValue", 2);
|
|
3605
|
+
__decorateClass([
|
|
3606
|
+
queryAssignedElements.n({ type: Number })
|
|
3607
|
+
], exports.LuksoTooltip.prototype, "offset", 2);
|
|
3608
|
+
__decorateClass([
|
|
3609
|
+
state.t()
|
|
3610
|
+
], exports.LuksoTooltip.prototype, "showCopy", 2);
|
|
3611
|
+
exports.LuksoTooltip = __decorateClass([
|
|
3612
|
+
queryAssignedElements.e("lukso-tooltip")
|
|
3613
|
+
], exports.LuksoTooltip);
|