vue-tippy 6.0.0-alpha.4 → 6.0.0-alpha.43
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +1 -1
- package/README.md +105 -2
- package/dist/{vue-tippy.cjs.js → vue-tippy.cjs} +1018 -272
- package/dist/vue-tippy.d.ts +817 -0
- package/dist/{vue-tippy.esm-bundler.js → vue-tippy.esm-browser.js} +1016 -274
- package/dist/{vue-tippy.global.js → vue-tippy.iife.js} +1018 -272
- package/dist/vue-tippy.iife.prod.js +6 -0
- package/dist/{vue-tippy.esm.js → vue-tippy.mjs} +1016 -274
- package/dist/{vue-tippy.cjs.prod.js → vue-tippy.prod.cjs} +1018 -272
- package/index.cjs +7 -0
- package/index.js +7 -0
- package/package.json +38 -9
- package/dist/vue-tippy.global.prod.js +0 -6
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* vue-tippy v6.0.0-alpha.
|
3
|
-
* (c)
|
2
|
+
* vue-tippy v6.0.0-alpha.43
|
3
|
+
* (c) 2021
|
4
4
|
* @license MIT
|
5
5
|
*/
|
6
6
|
var VueTippy = (function (exports, vue) {
|
@@ -42,10 +42,11 @@ var VueTippy = (function (exports, vue) {
|
|
42
42
|
return element ? (element.nodeName || '').toLowerCase() : null;
|
43
43
|
}
|
44
44
|
|
45
|
-
/*:: import type { Window } from '../types'; */
|
46
|
-
|
47
|
-
/*:: declare function getWindow(node: Node | Window): Window; */
|
48
45
|
function getWindow(node) {
|
46
|
+
if (node == null) {
|
47
|
+
return window;
|
48
|
+
}
|
49
|
+
|
49
50
|
if (node.toString() !== '[object Window]') {
|
50
51
|
var ownerDocument = node.ownerDocument;
|
51
52
|
return ownerDocument ? ownerDocument.defaultView || window : window;
|
@@ -54,26 +55,22 @@ var VueTippy = (function (exports, vue) {
|
|
54
55
|
return node;
|
55
56
|
}
|
56
57
|
|
57
|
-
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
|
58
|
-
Element); */
|
59
|
-
|
60
58
|
function isElement(node) {
|
61
59
|
var OwnElement = getWindow(node).Element;
|
62
60
|
return node instanceof OwnElement || node instanceof Element;
|
63
61
|
}
|
64
|
-
/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
|
65
|
-
HTMLElement); */
|
66
|
-
|
67
62
|
|
68
63
|
function isHTMLElement(node) {
|
69
64
|
var OwnElement = getWindow(node).HTMLElement;
|
70
65
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
71
66
|
}
|
72
|
-
/*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof
|
73
|
-
ShadowRoot); */
|
74
|
-
|
75
67
|
|
76
68
|
function isShadowRoot(node) {
|
69
|
+
// IE 11 has no ShadowRoot
|
70
|
+
if (typeof ShadowRoot === 'undefined') {
|
71
|
+
return false;
|
72
|
+
}
|
73
|
+
|
77
74
|
var OwnElement = getWindow(node).ShadowRoot;
|
78
75
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
79
76
|
}
|
@@ -91,7 +88,7 @@ var VueTippy = (function (exports, vue) {
|
|
91
88
|
return;
|
92
89
|
} // Flow doesn't support to extend this property, but it's the most
|
93
90
|
// effective way to apply styles to an HTMLElement
|
94
|
-
// $FlowFixMe
|
91
|
+
// $FlowFixMe[cannot-write]
|
95
92
|
|
96
93
|
|
97
94
|
Object.assign(element.style, style);
|
@@ -122,6 +119,7 @@ var VueTippy = (function (exports, vue) {
|
|
122
119
|
reference: {}
|
123
120
|
};
|
124
121
|
Object.assign(state.elements.popper.style, initialStyles.popper);
|
122
|
+
state.styles = initialStyles;
|
125
123
|
|
126
124
|
if (state.elements.arrow) {
|
127
125
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
@@ -140,10 +138,7 @@ var VueTippy = (function (exports, vue) {
|
|
140
138
|
|
141
139
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
142
140
|
return;
|
143
|
-
}
|
144
|
-
// effective way to apply styles to an HTMLElement
|
145
|
-
// $FlowFixMe
|
146
|
-
|
141
|
+
}
|
147
142
|
|
148
143
|
Object.assign(element.style, style);
|
149
144
|
Object.keys(attributes).forEach(function (attribute) {
|
@@ -167,14 +162,67 @@ var VueTippy = (function (exports, vue) {
|
|
167
162
|
return placement.split('-')[0];
|
168
163
|
}
|
169
164
|
|
170
|
-
|
165
|
+
var max = Math.max;
|
166
|
+
var min = Math.min;
|
167
|
+
var round = Math.round;
|
168
|
+
|
169
|
+
function getBoundingClientRect(element, includeScale) {
|
170
|
+
if (includeScale === void 0) {
|
171
|
+
includeScale = false;
|
172
|
+
}
|
173
|
+
|
174
|
+
var rect = element.getBoundingClientRect();
|
175
|
+
var scaleX = 1;
|
176
|
+
var scaleY = 1;
|
177
|
+
|
178
|
+
if (isHTMLElement(element) && includeScale) {
|
179
|
+
var offsetHeight = element.offsetHeight;
|
180
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
181
|
+
// Fallback to 1 in case both values are `0`
|
182
|
+
|
183
|
+
if (offsetWidth > 0) {
|
184
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
185
|
+
}
|
186
|
+
|
187
|
+
if (offsetHeight > 0) {
|
188
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
return {
|
193
|
+
width: rect.width / scaleX,
|
194
|
+
height: rect.height / scaleY,
|
195
|
+
top: rect.top / scaleY,
|
196
|
+
right: rect.right / scaleX,
|
197
|
+
bottom: rect.bottom / scaleY,
|
198
|
+
left: rect.left / scaleX,
|
199
|
+
x: rect.left / scaleX,
|
200
|
+
y: rect.top / scaleY
|
201
|
+
};
|
202
|
+
}
|
203
|
+
|
171
204
|
// means it doesn't take into account transforms.
|
205
|
+
|
172
206
|
function getLayoutRect(element) {
|
207
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
208
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
209
|
+
|
210
|
+
var width = element.offsetWidth;
|
211
|
+
var height = element.offsetHeight;
|
212
|
+
|
213
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
214
|
+
width = clientRect.width;
|
215
|
+
}
|
216
|
+
|
217
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
218
|
+
height = clientRect.height;
|
219
|
+
}
|
220
|
+
|
173
221
|
return {
|
174
222
|
x: element.offsetLeft,
|
175
223
|
y: element.offsetTop,
|
176
|
-
width:
|
177
|
-
height:
|
224
|
+
width: width,
|
225
|
+
height: height
|
178
226
|
};
|
179
227
|
}
|
180
228
|
|
@@ -190,7 +238,7 @@ var VueTippy = (function (exports, vue) {
|
|
190
238
|
do {
|
191
239
|
if (next && parent.isSameNode(next)) {
|
192
240
|
return true;
|
193
|
-
} // $FlowFixMe: need a better way to handle this...
|
241
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
194
242
|
|
195
243
|
|
196
244
|
next = next.parentNode || next.host;
|
@@ -210,8 +258,9 @@ var VueTippy = (function (exports, vue) {
|
|
210
258
|
}
|
211
259
|
|
212
260
|
function getDocumentElement(element) {
|
213
|
-
// $FlowFixMe: assume body is always available
|
214
|
-
return ((isElement(element) ? element.ownerDocument :
|
261
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
262
|
+
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
263
|
+
element.document) || window.document).documentElement;
|
215
264
|
}
|
216
265
|
|
217
266
|
function getParentNode(element) {
|
@@ -219,12 +268,13 @@ var VueTippy = (function (exports, vue) {
|
|
219
268
|
return element;
|
220
269
|
}
|
221
270
|
|
222
|
-
return (//
|
271
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
272
|
+
// $FlowFixMe[incompatible-return]
|
273
|
+
// $FlowFixMe[prop-missing]
|
223
274
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
224
|
-
element.parentNode || // DOM Element detected
|
225
|
-
|
226
|
-
|
227
|
-
// $FlowFixMe: HTMLElement is a Node
|
275
|
+
element.parentNode || ( // DOM Element detected
|
276
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
277
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
228
278
|
getDocumentElement(element) // fallback
|
229
279
|
|
230
280
|
);
|
@@ -236,29 +286,32 @@ var VueTippy = (function (exports, vue) {
|
|
236
286
|
return null;
|
237
287
|
}
|
238
288
|
|
239
|
-
|
240
|
-
|
241
|
-
if (offsetParent) {
|
242
|
-
var html = getDocumentElement(offsetParent);
|
243
|
-
|
244
|
-
if (getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && getComputedStyle(html).position !== 'static') {
|
245
|
-
return html;
|
246
|
-
}
|
247
|
-
}
|
248
|
-
|
249
|
-
return offsetParent;
|
289
|
+
return element.offsetParent;
|
250
290
|
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
251
291
|
// return the containing block
|
252
292
|
|
253
293
|
|
254
294
|
function getContainingBlock(element) {
|
295
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
|
296
|
+
var isIE = navigator.userAgent.indexOf('Trident') !== -1;
|
297
|
+
|
298
|
+
if (isIE && isHTMLElement(element)) {
|
299
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
300
|
+
var elementCss = getComputedStyle(element);
|
301
|
+
|
302
|
+
if (elementCss.position === 'fixed') {
|
303
|
+
return null;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
255
307
|
var currentNode = getParentNode(element);
|
256
308
|
|
257
309
|
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
258
310
|
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
259
311
|
// create a containing block.
|
312
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
260
313
|
|
261
|
-
if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== '
|
314
|
+
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') {
|
262
315
|
return currentNode;
|
263
316
|
} else {
|
264
317
|
currentNode = currentNode.parentNode;
|
@@ -278,7 +331,7 @@ var VueTippy = (function (exports, vue) {
|
|
278
331
|
offsetParent = getTrueOffsetParent(offsetParent);
|
279
332
|
}
|
280
333
|
|
281
|
-
if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static') {
|
334
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
282
335
|
return window;
|
283
336
|
}
|
284
337
|
|
@@ -289,8 +342,12 @@ var VueTippy = (function (exports, vue) {
|
|
289
342
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
290
343
|
}
|
291
344
|
|
292
|
-
function within(min, value, max) {
|
293
|
-
return
|
345
|
+
function within(min$1, value, max$1) {
|
346
|
+
return max(min$1, min(value, max$1));
|
347
|
+
}
|
348
|
+
function withinMaxClamp(min, value, max) {
|
349
|
+
var v = within(min, value, max);
|
350
|
+
return v > max ? max : v;
|
294
351
|
}
|
295
352
|
|
296
353
|
function getFreshSideObject() {
|
@@ -303,7 +360,7 @@ var VueTippy = (function (exports, vue) {
|
|
303
360
|
}
|
304
361
|
|
305
362
|
function mergePaddingObject(paddingObject) {
|
306
|
-
return Object.assign(
|
363
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
307
364
|
}
|
308
365
|
|
309
366
|
function expandToHashMap(value, keys) {
|
@@ -313,11 +370,19 @@ var VueTippy = (function (exports, vue) {
|
|
313
370
|
}, {});
|
314
371
|
}
|
315
372
|
|
373
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
374
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
375
|
+
placement: state.placement
|
376
|
+
})) : padding;
|
377
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
378
|
+
};
|
379
|
+
|
316
380
|
function arrow(_ref) {
|
317
381
|
var _state$modifiersData$;
|
318
382
|
|
319
383
|
var state = _ref.state,
|
320
|
-
name = _ref.name
|
384
|
+
name = _ref.name,
|
385
|
+
options = _ref.options;
|
321
386
|
var arrowElement = state.elements.arrow;
|
322
387
|
var popperOffsets = state.modifiersData.popperOffsets;
|
323
388
|
var basePlacement = getBasePlacement(state.placement);
|
@@ -329,7 +394,7 @@ var VueTippy = (function (exports, vue) {
|
|
329
394
|
return;
|
330
395
|
}
|
331
396
|
|
332
|
-
var paddingObject =
|
397
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
333
398
|
var arrowRect = getLayoutRect(arrowElement);
|
334
399
|
var minProp = axis === 'y' ? top : left;
|
335
400
|
var maxProp = axis === 'y' ? bottom : right;
|
@@ -351,12 +416,9 @@ var VueTippy = (function (exports, vue) {
|
|
351
416
|
|
352
417
|
function effect$1(_ref2) {
|
353
418
|
var state = _ref2.state,
|
354
|
-
options = _ref2.options
|
355
|
-
name = _ref2.name;
|
419
|
+
options = _ref2.options;
|
356
420
|
var _options$element = options.element,
|
357
|
-
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element
|
358
|
-
_options$padding = options.padding,
|
359
|
-
padding = _options$padding === void 0 ? 0 : _options$padding;
|
421
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
360
422
|
|
361
423
|
if (arrowElement == null) {
|
362
424
|
return;
|
@@ -371,15 +433,21 @@ var VueTippy = (function (exports, vue) {
|
|
371
433
|
}
|
372
434
|
}
|
373
435
|
|
436
|
+
if (process.env.NODE_ENV !== "production") {
|
437
|
+
if (!isHTMLElement(arrowElement)) {
|
438
|
+
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
|
439
|
+
}
|
440
|
+
}
|
441
|
+
|
374
442
|
if (!contains(state.elements.popper, arrowElement)) {
|
443
|
+
if (process.env.NODE_ENV !== "production") {
|
444
|
+
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
|
445
|
+
}
|
375
446
|
|
376
447
|
return;
|
377
448
|
}
|
378
449
|
|
379
450
|
state.elements.arrow = arrowElement;
|
380
|
-
state.modifiersData[name + "#persistent"] = {
|
381
|
-
padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))
|
382
|
-
};
|
383
451
|
} // eslint-disable-next-line import/no-unused-modules
|
384
452
|
|
385
453
|
|
@@ -393,6 +461,10 @@ var VueTippy = (function (exports, vue) {
|
|
393
461
|
requiresIfExists: ['preventOverflow']
|
394
462
|
};
|
395
463
|
|
464
|
+
function getVariation(placement) {
|
465
|
+
return placement.split('-')[1];
|
466
|
+
}
|
467
|
+
|
396
468
|
var unsetSides = {
|
397
469
|
top: 'auto',
|
398
470
|
right: 'auto',
|
@@ -402,14 +474,14 @@ var VueTippy = (function (exports, vue) {
|
|
402
474
|
// Zooming can change the DPR, but it seems to report a value that will
|
403
475
|
// cleanly divide the values into the appropriate subpixels.
|
404
476
|
|
405
|
-
function
|
477
|
+
function roundOffsetsByDPR(_ref) {
|
406
478
|
var x = _ref.x,
|
407
479
|
y = _ref.y;
|
408
480
|
var win = window;
|
409
481
|
var dpr = win.devicePixelRatio || 1;
|
410
482
|
return {
|
411
|
-
x:
|
412
|
-
y:
|
483
|
+
x: round(x * dpr) / dpr || 0,
|
484
|
+
y: round(y * dpr) / dpr || 0
|
413
485
|
};
|
414
486
|
}
|
415
487
|
|
@@ -419,14 +491,19 @@ var VueTippy = (function (exports, vue) {
|
|
419
491
|
var popper = _ref2.popper,
|
420
492
|
popperRect = _ref2.popperRect,
|
421
493
|
placement = _ref2.placement,
|
494
|
+
variation = _ref2.variation,
|
422
495
|
offsets = _ref2.offsets,
|
423
496
|
position = _ref2.position,
|
424
497
|
gpuAcceleration = _ref2.gpuAcceleration,
|
425
|
-
adaptive = _ref2.adaptive
|
498
|
+
adaptive = _ref2.adaptive,
|
499
|
+
roundOffsets = _ref2.roundOffsets,
|
500
|
+
isFixed = _ref2.isFixed;
|
426
501
|
|
427
|
-
var
|
428
|
-
x =
|
429
|
-
|
502
|
+
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
503
|
+
_ref3$x = _ref3.x,
|
504
|
+
x = _ref3$x === void 0 ? 0 : _ref3$x,
|
505
|
+
_ref3$y = _ref3.y,
|
506
|
+
y = _ref3$y === void 0 ? 0 : _ref3$y;
|
430
507
|
|
431
508
|
var hasX = offsets.hasOwnProperty('x');
|
432
509
|
var hasY = offsets.hasOwnProperty('y');
|
@@ -436,23 +513,34 @@ var VueTippy = (function (exports, vue) {
|
|
436
513
|
|
437
514
|
if (adaptive) {
|
438
515
|
var offsetParent = getOffsetParent(popper);
|
516
|
+
var heightProp = 'clientHeight';
|
517
|
+
var widthProp = 'clientWidth';
|
439
518
|
|
440
519
|
if (offsetParent === getWindow(popper)) {
|
441
520
|
offsetParent = getDocumentElement(popper);
|
442
|
-
} // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
443
521
|
|
444
|
-
|
522
|
+
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
523
|
+
heightProp = 'scrollHeight';
|
524
|
+
widthProp = 'scrollWidth';
|
525
|
+
}
|
526
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
527
|
+
|
445
528
|
|
529
|
+
offsetParent = offsetParent;
|
446
530
|
|
447
|
-
if (placement === top) {
|
531
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
448
532
|
sideY = bottom;
|
449
|
-
|
533
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
534
|
+
offsetParent[heightProp];
|
535
|
+
y -= offsetY - popperRect.height;
|
450
536
|
y *= gpuAcceleration ? 1 : -1;
|
451
537
|
}
|
452
538
|
|
453
|
-
if (placement === left) {
|
539
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
454
540
|
sideX = right;
|
455
|
-
|
541
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
542
|
+
offsetParent[widthProp];
|
543
|
+
x -= offsetX - popperRect.width;
|
456
544
|
x *= gpuAcceleration ? 1 : -1;
|
457
545
|
}
|
458
546
|
}
|
@@ -464,44 +552,60 @@ var VueTippy = (function (exports, vue) {
|
|
464
552
|
if (gpuAcceleration) {
|
465
553
|
var _Object$assign;
|
466
554
|
|
467
|
-
return Object.assign(
|
555
|
+
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));
|
468
556
|
}
|
469
557
|
|
470
|
-
return Object.assign(
|
558
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
471
559
|
}
|
472
560
|
|
473
|
-
function computeStyles(
|
474
|
-
var state =
|
475
|
-
options =
|
561
|
+
function computeStyles(_ref4) {
|
562
|
+
var state = _ref4.state,
|
563
|
+
options = _ref4.options;
|
476
564
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
477
565
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
478
566
|
_options$adaptive = options.adaptive,
|
479
|
-
adaptive = _options$adaptive === void 0 ? true : _options$adaptive
|
567
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
568
|
+
_options$roundOffsets = options.roundOffsets,
|
569
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
570
|
+
|
571
|
+
if (process.env.NODE_ENV !== "production") {
|
572
|
+
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
|
573
|
+
|
574
|
+
if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
|
575
|
+
return transitionProperty.indexOf(property) >= 0;
|
576
|
+
})) {
|
577
|
+
console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
|
578
|
+
}
|
579
|
+
}
|
480
580
|
|
481
581
|
var commonStyles = {
|
482
582
|
placement: getBasePlacement(state.placement),
|
583
|
+
variation: getVariation(state.placement),
|
483
584
|
popper: state.elements.popper,
|
484
585
|
popperRect: state.rects.popper,
|
485
|
-
gpuAcceleration: gpuAcceleration
|
586
|
+
gpuAcceleration: gpuAcceleration,
|
587
|
+
isFixed: state.options.strategy === 'fixed'
|
486
588
|
};
|
487
589
|
|
488
590
|
if (state.modifiersData.popperOffsets != null) {
|
489
|
-
state.styles.popper = Object.assign(
|
591
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
490
592
|
offsets: state.modifiersData.popperOffsets,
|
491
593
|
position: state.options.strategy,
|
492
|
-
adaptive: adaptive
|
594
|
+
adaptive: adaptive,
|
595
|
+
roundOffsets: roundOffsets
|
493
596
|
})));
|
494
597
|
}
|
495
598
|
|
496
599
|
if (state.modifiersData.arrow != null) {
|
497
|
-
state.styles.arrow = Object.assign(
|
600
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
498
601
|
offsets: state.modifiersData.arrow,
|
499
602
|
position: 'absolute',
|
500
|
-
adaptive: false
|
603
|
+
adaptive: false,
|
604
|
+
roundOffsets: roundOffsets
|
501
605
|
})));
|
502
606
|
}
|
503
607
|
|
504
|
-
state.attributes.popper = Object.assign(
|
608
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
505
609
|
'data-popper-placement': state.placement
|
506
610
|
});
|
507
611
|
} // eslint-disable-next-line import/no-unused-modules
|
@@ -585,20 +689,6 @@ var VueTippy = (function (exports, vue) {
|
|
585
689
|
});
|
586
690
|
}
|
587
691
|
|
588
|
-
function getBoundingClientRect(element) {
|
589
|
-
var rect = element.getBoundingClientRect();
|
590
|
-
return {
|
591
|
-
width: rect.width,
|
592
|
-
height: rect.height,
|
593
|
-
top: rect.top,
|
594
|
-
right: rect.right,
|
595
|
-
bottom: rect.bottom,
|
596
|
-
left: rect.left,
|
597
|
-
x: rect.left,
|
598
|
-
y: rect.top
|
599
|
-
};
|
600
|
-
}
|
601
|
-
|
602
692
|
function getWindowScroll(node) {
|
603
693
|
var win = getWindow(node);
|
604
694
|
var scrollLeft = win.pageXOffset;
|
@@ -661,16 +751,18 @@ var VueTippy = (function (exports, vue) {
|
|
661
751
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
662
752
|
|
663
753
|
function getDocumentRect(element) {
|
754
|
+
var _element$ownerDocumen;
|
755
|
+
|
664
756
|
var html = getDocumentElement(element);
|
665
757
|
var winScroll = getWindowScroll(element);
|
666
|
-
var body = element.ownerDocument.body;
|
667
|
-
var width =
|
668
|
-
var height =
|
758
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
759
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
760
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
669
761
|
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
670
762
|
var y = -winScroll.scrollTop;
|
671
763
|
|
672
764
|
if (getComputedStyle(body || html).direction === 'rtl') {
|
673
|
-
x +=
|
765
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
674
766
|
}
|
675
767
|
|
676
768
|
return {
|
@@ -693,7 +785,7 @@ var VueTippy = (function (exports, vue) {
|
|
693
785
|
|
694
786
|
function getScrollParent(node) {
|
695
787
|
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
696
|
-
// $FlowFixMe: assume body is always available
|
788
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
697
789
|
return node.ownerDocument.body;
|
698
790
|
}
|
699
791
|
|
@@ -707,26 +799,28 @@ var VueTippy = (function (exports, vue) {
|
|
707
799
|
/*
|
708
800
|
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
709
801
|
until we get to the top window object. This list is what we attach scroll listeners
|
710
|
-
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
802
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
711
803
|
reference element's position.
|
712
804
|
*/
|
713
805
|
|
714
806
|
function listScrollParents(element, list) {
|
807
|
+
var _element$ownerDocumen;
|
808
|
+
|
715
809
|
if (list === void 0) {
|
716
810
|
list = [];
|
717
811
|
}
|
718
812
|
|
719
813
|
var scrollParent = getScrollParent(element);
|
720
|
-
var isBody =
|
814
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
721
815
|
var win = getWindow(scrollParent);
|
722
816
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
723
817
|
var updatedList = list.concat(target);
|
724
|
-
return isBody ? updatedList : // $FlowFixMe: isBody tells us target will be an HTMLElement here
|
818
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
725
819
|
updatedList.concat(listScrollParents(getParentNode(target)));
|
726
820
|
}
|
727
821
|
|
728
822
|
function rectToClientRect(rect) {
|
729
|
-
return Object.assign(
|
823
|
+
return Object.assign({}, rect, {
|
730
824
|
left: rect.x,
|
731
825
|
top: rect.y,
|
732
826
|
right: rect.x + rect.width,
|
@@ -748,7 +842,7 @@ var VueTippy = (function (exports, vue) {
|
|
748
842
|
}
|
749
843
|
|
750
844
|
function getClientRectFromMixedType(element, clippingParent) {
|
751
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
845
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
752
846
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
753
847
|
// clipping (or hiding) overflowing elements with a position different from
|
754
848
|
// `initial`
|
@@ -761,11 +855,11 @@ var VueTippy = (function (exports, vue) {
|
|
761
855
|
|
762
856
|
if (!isElement(clipperElement)) {
|
763
857
|
return [];
|
764
|
-
} // $FlowFixMe: https://github.com/facebook/flow/issues/1414
|
858
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
765
859
|
|
766
860
|
|
767
861
|
return clippingParents.filter(function (clippingParent) {
|
768
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
862
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true);
|
769
863
|
});
|
770
864
|
} // Gets the maximum area that the element is visible in due to any number of
|
771
865
|
// clipping parents
|
@@ -777,10 +871,10 @@ var VueTippy = (function (exports, vue) {
|
|
777
871
|
var firstClippingParent = clippingParents[0];
|
778
872
|
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
779
873
|
var rect = getClientRectFromMixedType(element, clippingParent);
|
780
|
-
accRect.top =
|
781
|
-
accRect.right =
|
782
|
-
accRect.bottom =
|
783
|
-
accRect.left =
|
874
|
+
accRect.top = max(rect.top, accRect.top);
|
875
|
+
accRect.right = min(rect.right, accRect.right);
|
876
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
877
|
+
accRect.left = max(rect.left, accRect.left);
|
784
878
|
return accRect;
|
785
879
|
}, getClientRectFromMixedType(element, firstClippingParent));
|
786
880
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
@@ -790,10 +884,6 @@ var VueTippy = (function (exports, vue) {
|
|
790
884
|
return clippingRect;
|
791
885
|
}
|
792
886
|
|
793
|
-
function getVariation(placement) {
|
794
|
-
return placement.split('-')[1];
|
795
|
-
}
|
796
|
-
|
797
887
|
function computeOffsets(_ref) {
|
798
888
|
var reference = _ref.reference,
|
799
889
|
element = _ref.element,
|
@@ -847,11 +937,11 @@ var VueTippy = (function (exports, vue) {
|
|
847
937
|
|
848
938
|
switch (variation) {
|
849
939
|
case start:
|
850
|
-
offsets[mainAxis] =
|
940
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
851
941
|
break;
|
852
942
|
|
853
943
|
case end:
|
854
|
-
offsets[mainAxis] =
|
944
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
855
945
|
break;
|
856
946
|
}
|
857
947
|
}
|
@@ -879,18 +969,17 @@ var VueTippy = (function (exports, vue) {
|
|
879
969
|
padding = _options$padding === void 0 ? 0 : _options$padding;
|
880
970
|
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
881
971
|
var altContext = elementContext === popper ? reference : popper;
|
882
|
-
var referenceElement = state.elements.reference;
|
883
972
|
var popperRect = state.rects.popper;
|
884
973
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
885
974
|
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
886
|
-
var referenceClientRect = getBoundingClientRect(
|
975
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
887
976
|
var popperOffsets = computeOffsets({
|
888
977
|
reference: referenceClientRect,
|
889
978
|
element: popperRect,
|
890
979
|
strategy: 'absolute',
|
891
980
|
placement: placement
|
892
981
|
});
|
893
|
-
var popperClientRect = rectToClientRect(Object.assign(
|
982
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
894
983
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
895
984
|
// 0 or negative = within the clipping rect
|
896
985
|
|
@@ -914,9 +1003,6 @@ var VueTippy = (function (exports, vue) {
|
|
914
1003
|
return overflowOffsets;
|
915
1004
|
}
|
916
1005
|
|
917
|
-
/*:: type OverflowsMap = { [ComputedPlacement]: number }; */
|
918
|
-
|
919
|
-
/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
|
920
1006
|
function computeAutoPlacement(state, options) {
|
921
1007
|
if (options === void 0) {
|
922
1008
|
options = {};
|
@@ -933,15 +1019,18 @@ var VueTippy = (function (exports, vue) {
|
|
933
1019
|
var variation = getVariation(placement);
|
934
1020
|
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
935
1021
|
return getVariation(placement) === variation;
|
936
|
-
}) : basePlacements;
|
937
|
-
|
1022
|
+
}) : basePlacements;
|
938
1023
|
var allowedPlacements = placements$1.filter(function (placement) {
|
939
1024
|
return allowedAutoPlacements.indexOf(placement) >= 0;
|
940
1025
|
});
|
941
1026
|
|
942
1027
|
if (allowedPlacements.length === 0) {
|
943
1028
|
allowedPlacements = placements$1;
|
944
|
-
|
1029
|
+
|
1030
|
+
if (process.env.NODE_ENV !== "production") {
|
1031
|
+
console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
|
1032
|
+
}
|
1033
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
945
1034
|
|
946
1035
|
|
947
1036
|
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
@@ -1142,7 +1231,7 @@ var VueTippy = (function (exports, vue) {
|
|
1142
1231
|
isReferenceHidden: isReferenceHidden,
|
1143
1232
|
hasPopperEscaped: hasPopperEscaped
|
1144
1233
|
};
|
1145
|
-
state.attributes.popper = Object.assign(
|
1234
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
1146
1235
|
'data-popper-reference-hidden': isReferenceHidden,
|
1147
1236
|
'data-popper-escaped': hasPopperEscaped
|
1148
1237
|
});
|
@@ -1161,7 +1250,7 @@ var VueTippy = (function (exports, vue) {
|
|
1161
1250
|
var basePlacement = getBasePlacement(placement);
|
1162
1251
|
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
1163
1252
|
|
1164
|
-
var _ref = typeof offset === 'function' ? offset(Object.assign(
|
1253
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
1165
1254
|
placement: placement
|
1166
1255
|
})) : offset,
|
1167
1256
|
skidding = _ref[0],
|
@@ -1267,9 +1356,17 @@ var VueTippy = (function (exports, vue) {
|
|
1267
1356
|
var popperOffsets = state.modifiersData.popperOffsets;
|
1268
1357
|
var referenceRect = state.rects.reference;
|
1269
1358
|
var popperRect = state.rects.popper;
|
1270
|
-
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(
|
1359
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
1271
1360
|
placement: state.placement
|
1272
1361
|
})) : tetherOffset;
|
1362
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
1363
|
+
mainAxis: tetherOffsetValue,
|
1364
|
+
altAxis: tetherOffsetValue
|
1365
|
+
} : Object.assign({
|
1366
|
+
mainAxis: 0,
|
1367
|
+
altAxis: 0
|
1368
|
+
}, tetherOffsetValue);
|
1369
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
1273
1370
|
var data = {
|
1274
1371
|
x: 0,
|
1275
1372
|
y: 0
|
@@ -1280,12 +1377,14 @@ var VueTippy = (function (exports, vue) {
|
|
1280
1377
|
}
|
1281
1378
|
|
1282
1379
|
if (checkMainAxis) {
|
1380
|
+
var _offsetModifierState$;
|
1381
|
+
|
1283
1382
|
var mainSide = mainAxis === 'y' ? top : left;
|
1284
1383
|
var altSide = mainAxis === 'y' ? bottom : right;
|
1285
1384
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
1286
1385
|
var offset = popperOffsets[mainAxis];
|
1287
|
-
var min =
|
1288
|
-
var max =
|
1386
|
+
var min$1 = offset + overflow[mainSide];
|
1387
|
+
var max$1 = offset - overflow[altSide];
|
1289
1388
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
1290
1389
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
1291
1390
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
@@ -1305,30 +1404,42 @@ var VueTippy = (function (exports, vue) {
|
|
1305
1404
|
// width or height)
|
1306
1405
|
|
1307
1406
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
1308
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
1309
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
1407
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
1408
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
1310
1409
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
1311
1410
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
1312
|
-
var offsetModifierValue =
|
1313
|
-
var tetherMin =
|
1314
|
-
var tetherMax =
|
1315
|
-
var preventedOffset = within(tether ?
|
1411
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
1412
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
1413
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
1414
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
1316
1415
|
popperOffsets[mainAxis] = preventedOffset;
|
1317
1416
|
data[mainAxis] = preventedOffset - offset;
|
1318
1417
|
}
|
1319
1418
|
|
1320
1419
|
if (checkAltAxis) {
|
1420
|
+
var _offsetModifierState$2;
|
1421
|
+
|
1321
1422
|
var _mainSide = mainAxis === 'x' ? top : left;
|
1322
1423
|
|
1323
1424
|
var _altSide = mainAxis === 'x' ? bottom : right;
|
1324
1425
|
|
1325
1426
|
var _offset = popperOffsets[altAxis];
|
1326
1427
|
|
1428
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
1429
|
+
|
1327
1430
|
var _min = _offset + overflow[_mainSide];
|
1328
1431
|
|
1329
1432
|
var _max = _offset - overflow[_altSide];
|
1330
1433
|
|
1331
|
-
var
|
1434
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
1435
|
+
|
1436
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
1437
|
+
|
1438
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
1439
|
+
|
1440
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
1441
|
+
|
1442
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
1332
1443
|
|
1333
1444
|
popperOffsets[altAxis] = _preventedOffset;
|
1334
1445
|
data[altAxis] = _preventedOffset - _offset;
|
@@ -1361,16 +1472,24 @@ var VueTippy = (function (exports, vue) {
|
|
1361
1472
|
}
|
1362
1473
|
}
|
1363
1474
|
|
1475
|
+
function isElementScaled(element) {
|
1476
|
+
var rect = element.getBoundingClientRect();
|
1477
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
1478
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
1479
|
+
return scaleX !== 1 || scaleY !== 1;
|
1480
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
1364
1481
|
// Composite means it takes into account transforms as well as layout.
|
1365
1482
|
|
1483
|
+
|
1366
1484
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
1367
1485
|
if (isFixed === void 0) {
|
1368
1486
|
isFixed = false;
|
1369
1487
|
}
|
1370
1488
|
|
1371
|
-
var documentElement = getDocumentElement(offsetParent);
|
1372
|
-
var rect = getBoundingClientRect(elementOrVirtualElement);
|
1373
1489
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
1490
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
1491
|
+
var documentElement = getDocumentElement(offsetParent);
|
1492
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
1374
1493
|
var scroll = {
|
1375
1494
|
scrollLeft: 0,
|
1376
1495
|
scrollTop: 0
|
@@ -1387,7 +1506,7 @@ var VueTippy = (function (exports, vue) {
|
|
1387
1506
|
}
|
1388
1507
|
|
1389
1508
|
if (isHTMLElement(offsetParent)) {
|
1390
|
-
offsets = getBoundingClientRect(offsetParent);
|
1509
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
1391
1510
|
offsets.x += offsetParent.clientLeft;
|
1392
1511
|
offsets.y += offsetParent.clientTop;
|
1393
1512
|
} else if (documentElement) {
|
@@ -1462,12 +1581,114 @@ var VueTippy = (function (exports, vue) {
|
|
1462
1581
|
};
|
1463
1582
|
}
|
1464
1583
|
|
1584
|
+
function format(str) {
|
1585
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1586
|
+
args[_key - 1] = arguments[_key];
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
return [].concat(args).reduce(function (p, c) {
|
1590
|
+
return p.replace(/%s/, c);
|
1591
|
+
}, str);
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
1595
|
+
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
1596
|
+
var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
|
1597
|
+
function validateModifiers(modifiers) {
|
1598
|
+
modifiers.forEach(function (modifier) {
|
1599
|
+
[].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
|
1600
|
+
.filter(function (value, index, self) {
|
1601
|
+
return self.indexOf(value) === index;
|
1602
|
+
}).forEach(function (key) {
|
1603
|
+
switch (key) {
|
1604
|
+
case 'name':
|
1605
|
+
if (typeof modifier.name !== 'string') {
|
1606
|
+
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
|
1607
|
+
}
|
1608
|
+
|
1609
|
+
break;
|
1610
|
+
|
1611
|
+
case 'enabled':
|
1612
|
+
if (typeof modifier.enabled !== 'boolean') {
|
1613
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
|
1614
|
+
}
|
1615
|
+
|
1616
|
+
break;
|
1617
|
+
|
1618
|
+
case 'phase':
|
1619
|
+
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
1620
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
break;
|
1624
|
+
|
1625
|
+
case 'fn':
|
1626
|
+
if (typeof modifier.fn !== 'function') {
|
1627
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
break;
|
1631
|
+
|
1632
|
+
case 'effect':
|
1633
|
+
if (modifier.effect != null && typeof modifier.effect !== 'function') {
|
1634
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1635
|
+
}
|
1636
|
+
|
1637
|
+
break;
|
1638
|
+
|
1639
|
+
case 'requires':
|
1640
|
+
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
1641
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
|
1642
|
+
}
|
1643
|
+
|
1644
|
+
break;
|
1645
|
+
|
1646
|
+
case 'requiresIfExists':
|
1647
|
+
if (!Array.isArray(modifier.requiresIfExists)) {
|
1648
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
break;
|
1652
|
+
|
1653
|
+
case 'options':
|
1654
|
+
case 'data':
|
1655
|
+
break;
|
1656
|
+
|
1657
|
+
default:
|
1658
|
+
console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
|
1659
|
+
return "\"" + s + "\"";
|
1660
|
+
}).join(', ') + "; but \"" + key + "\" was provided.");
|
1661
|
+
}
|
1662
|
+
|
1663
|
+
modifier.requires && modifier.requires.forEach(function (requirement) {
|
1664
|
+
if (modifiers.find(function (mod) {
|
1665
|
+
return mod.name === requirement;
|
1666
|
+
}) == null) {
|
1667
|
+
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
1668
|
+
}
|
1669
|
+
});
|
1670
|
+
});
|
1671
|
+
});
|
1672
|
+
}
|
1673
|
+
|
1674
|
+
function uniqueBy(arr, fn) {
|
1675
|
+
var identifiers = new Set();
|
1676
|
+
return arr.filter(function (item) {
|
1677
|
+
var identifier = fn(item);
|
1678
|
+
|
1679
|
+
if (!identifiers.has(identifier)) {
|
1680
|
+
identifiers.add(identifier);
|
1681
|
+
return true;
|
1682
|
+
}
|
1683
|
+
});
|
1684
|
+
}
|
1685
|
+
|
1465
1686
|
function mergeByName(modifiers) {
|
1466
1687
|
var merged = modifiers.reduce(function (merged, current) {
|
1467
1688
|
var existing = merged[current.name];
|
1468
|
-
merged[current.name] = existing ? Object.assign(
|
1469
|
-
options: Object.assign(
|
1470
|
-
data: Object.assign(
|
1689
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
1690
|
+
options: Object.assign({}, existing.options, current.options),
|
1691
|
+
data: Object.assign({}, existing.data, current.data)
|
1471
1692
|
}) : current;
|
1472
1693
|
return merged;
|
1473
1694
|
}, {}); // IE11 does not support Object.values
|
@@ -1477,6 +1698,8 @@ var VueTippy = (function (exports, vue) {
|
|
1477
1698
|
});
|
1478
1699
|
}
|
1479
1700
|
|
1701
|
+
var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
|
1702
|
+
var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
|
1480
1703
|
var DEFAULT_OPTIONS = {
|
1481
1704
|
placement: 'bottom',
|
1482
1705
|
modifiers: [],
|
@@ -1511,7 +1734,7 @@ var VueTippy = (function (exports, vue) {
|
|
1511
1734
|
var state = {
|
1512
1735
|
placement: 'bottom',
|
1513
1736
|
orderedModifiers: [],
|
1514
|
-
options: Object.assign(
|
1737
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
1515
1738
|
modifiersData: {},
|
1516
1739
|
elements: {
|
1517
1740
|
reference: reference,
|
@@ -1524,9 +1747,10 @@ var VueTippy = (function (exports, vue) {
|
|
1524
1747
|
var isDestroyed = false;
|
1525
1748
|
var instance = {
|
1526
1749
|
state: state,
|
1527
|
-
setOptions: function setOptions(
|
1750
|
+
setOptions: function setOptions(setOptionsAction) {
|
1751
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
1528
1752
|
cleanupModifierEffects();
|
1529
|
-
state.options = Object.assign(
|
1753
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
1530
1754
|
state.scrollParents = {
|
1531
1755
|
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
1532
1756
|
popper: listScrollParents(popper)
|
@@ -1538,6 +1762,40 @@ var VueTippy = (function (exports, vue) {
|
|
1538
1762
|
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
1539
1763
|
return m.enabled;
|
1540
1764
|
}); // Validate the provided modifiers so that the consumer will get warned
|
1765
|
+
// if one of the modifiers is invalid for any reason
|
1766
|
+
|
1767
|
+
if (process.env.NODE_ENV !== "production") {
|
1768
|
+
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
|
1769
|
+
var name = _ref.name;
|
1770
|
+
return name;
|
1771
|
+
});
|
1772
|
+
validateModifiers(modifiers);
|
1773
|
+
|
1774
|
+
if (getBasePlacement(state.options.placement) === auto) {
|
1775
|
+
var flipModifier = state.orderedModifiers.find(function (_ref2) {
|
1776
|
+
var name = _ref2.name;
|
1777
|
+
return name === 'flip';
|
1778
|
+
});
|
1779
|
+
|
1780
|
+
if (!flipModifier) {
|
1781
|
+
console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
|
1782
|
+
}
|
1783
|
+
}
|
1784
|
+
|
1785
|
+
var _getComputedStyle = getComputedStyle(popper),
|
1786
|
+
marginTop = _getComputedStyle.marginTop,
|
1787
|
+
marginRight = _getComputedStyle.marginRight,
|
1788
|
+
marginBottom = _getComputedStyle.marginBottom,
|
1789
|
+
marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
|
1790
|
+
// cause bugs with positioning, so we'll warn the consumer
|
1791
|
+
|
1792
|
+
|
1793
|
+
if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
|
1794
|
+
return parseFloat(margin);
|
1795
|
+
})) {
|
1796
|
+
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
|
1797
|
+
}
|
1798
|
+
}
|
1541
1799
|
|
1542
1800
|
runModifierEffects();
|
1543
1801
|
return instance.update();
|
@@ -1558,6 +1816,9 @@ var VueTippy = (function (exports, vue) {
|
|
1558
1816
|
// anymore
|
1559
1817
|
|
1560
1818
|
if (!areValidElements(reference, popper)) {
|
1819
|
+
if (process.env.NODE_ENV !== "production") {
|
1820
|
+
console.error(INVALID_ELEMENT_ERROR);
|
1821
|
+
}
|
1561
1822
|
|
1562
1823
|
return;
|
1563
1824
|
} // Store the reference and popper rects to be read by modifiers
|
@@ -1581,8 +1842,17 @@ var VueTippy = (function (exports, vue) {
|
|
1581
1842
|
state.orderedModifiers.forEach(function (modifier) {
|
1582
1843
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
1583
1844
|
});
|
1845
|
+
var __debug_loops__ = 0;
|
1584
1846
|
|
1585
1847
|
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
1848
|
+
if (process.env.NODE_ENV !== "production") {
|
1849
|
+
__debug_loops__ += 1;
|
1850
|
+
|
1851
|
+
if (__debug_loops__ > 100) {
|
1852
|
+
console.error(INFINITE_LOOP_ERROR);
|
1853
|
+
break;
|
1854
|
+
}
|
1855
|
+
}
|
1586
1856
|
|
1587
1857
|
if (state.reset === true) {
|
1588
1858
|
state.reset = false;
|
@@ -1621,6 +1891,9 @@ var VueTippy = (function (exports, vue) {
|
|
1621
1891
|
};
|
1622
1892
|
|
1623
1893
|
if (!areValidElements(reference, popper)) {
|
1894
|
+
if (process.env.NODE_ENV !== "production") {
|
1895
|
+
console.error(INVALID_ELEMENT_ERROR);
|
1896
|
+
}
|
1624
1897
|
|
1625
1898
|
return instance;
|
1626
1899
|
}
|
@@ -1674,10 +1947,12 @@ var VueTippy = (function (exports, vue) {
|
|
1674
1947
|
}); // eslint-disable-next-line import/no-unused-modules
|
1675
1948
|
|
1676
1949
|
/**!
|
1677
|
-
* tippy.js v6.
|
1678
|
-
* (c) 2017-
|
1950
|
+
* tippy.js v6.3.7
|
1951
|
+
* (c) 2017-2021 atomiks
|
1679
1952
|
* MIT License
|
1680
1953
|
*/
|
1954
|
+
|
1955
|
+
var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
|
1681
1956
|
var BOX_CLASS = "tippy-box";
|
1682
1957
|
var CONTENT_CLASS = "tippy-content";
|
1683
1958
|
var BACKDROP_CLASS = "tippy-backdrop";
|
@@ -1687,6 +1962,13 @@ var VueTippy = (function (exports, vue) {
|
|
1687
1962
|
passive: true,
|
1688
1963
|
capture: true
|
1689
1964
|
};
|
1965
|
+
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
|
1966
|
+
return document.body;
|
1967
|
+
};
|
1968
|
+
|
1969
|
+
function hasOwnProperty(obj, key) {
|
1970
|
+
return {}.hasOwnProperty.call(obj, key);
|
1971
|
+
}
|
1690
1972
|
function getValueAtIndexOrReturn(value, index, defaultValue) {
|
1691
1973
|
if (Array.isArray(value)) {
|
1692
1974
|
var v = value[index];
|
@@ -1802,10 +2084,13 @@ var VueTippy = (function (exports, vue) {
|
|
1802
2084
|
});
|
1803
2085
|
}
|
1804
2086
|
function getOwnerDocument(elementOrElements) {
|
2087
|
+
var _element$ownerDocumen;
|
2088
|
+
|
1805
2089
|
var _normalizeToArray = normalizeToArray(elementOrElements),
|
1806
|
-
element = _normalizeToArray[0];
|
2090
|
+
element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
|
2091
|
+
|
1807
2092
|
|
1808
|
-
return element
|
2093
|
+
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
1809
2094
|
}
|
1810
2095
|
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
|
1811
2096
|
var clientX = event.clientX,
|
@@ -1841,6 +2126,26 @@ var VueTippy = (function (exports, vue) {
|
|
1841
2126
|
box[method](event, listener);
|
1842
2127
|
});
|
1843
2128
|
}
|
2129
|
+
/**
|
2130
|
+
* Compared to xxx.contains, this function works for dom structures with shadow
|
2131
|
+
* dom
|
2132
|
+
*/
|
2133
|
+
|
2134
|
+
function actualContains(parent, child) {
|
2135
|
+
var target = child;
|
2136
|
+
|
2137
|
+
while (target) {
|
2138
|
+
var _target$getRootNode;
|
2139
|
+
|
2140
|
+
if (parent.contains(target)) {
|
2141
|
+
return true;
|
2142
|
+
}
|
2143
|
+
|
2144
|
+
target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
|
2145
|
+
}
|
2146
|
+
|
2147
|
+
return false;
|
2148
|
+
}
|
1844
2149
|
|
1845
2150
|
var currentInput = {
|
1846
2151
|
isTouch: false
|
@@ -1904,8 +2209,63 @@ var VueTippy = (function (exports, vue) {
|
|
1904
2209
|
}
|
1905
2210
|
|
1906
2211
|
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1907
|
-
var
|
1908
|
-
|
2212
|
+
var isIE11 = isBrowser ? // @ts-ignore
|
2213
|
+
!!window.msCrypto : false;
|
2214
|
+
|
2215
|
+
function createMemoryLeakWarning(method) {
|
2216
|
+
var txt = method === 'destroy' ? 'n already-' : ' ';
|
2217
|
+
return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' ');
|
2218
|
+
}
|
2219
|
+
function clean(value) {
|
2220
|
+
var spacesAndTabs = /[ \t]{2,}/g;
|
2221
|
+
var lineStartWithSpaces = /^[ \t]*/gm;
|
2222
|
+
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
|
2223
|
+
}
|
2224
|
+
|
2225
|
+
function getDevMessage(message) {
|
2226
|
+
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 ");
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
function getFormattedMessage(message) {
|
2230
|
+
return [getDevMessage(message), // title
|
2231
|
+
'color: #00C584; font-size: 1.3em; font-weight: bold;', // message
|
2232
|
+
'line-height: 1.5', // footer
|
2233
|
+
'color: #a6a095;'];
|
2234
|
+
} // Assume warnings and errors never have the same message
|
2235
|
+
|
2236
|
+
var visitedMessages;
|
2237
|
+
|
2238
|
+
if (process.env.NODE_ENV !== "production") {
|
2239
|
+
resetVisitedMessages();
|
2240
|
+
}
|
2241
|
+
|
2242
|
+
function resetVisitedMessages() {
|
2243
|
+
visitedMessages = new Set();
|
2244
|
+
}
|
2245
|
+
function warnWhen(condition, message) {
|
2246
|
+
if (condition && !visitedMessages.has(message)) {
|
2247
|
+
var _console;
|
2248
|
+
|
2249
|
+
visitedMessages.add(message);
|
2250
|
+
|
2251
|
+
(_console = console).warn.apply(_console, getFormattedMessage(message));
|
2252
|
+
}
|
2253
|
+
}
|
2254
|
+
function errorWhen(condition, message) {
|
2255
|
+
if (condition && !visitedMessages.has(message)) {
|
2256
|
+
var _console2;
|
2257
|
+
|
2258
|
+
visitedMessages.add(message);
|
2259
|
+
|
2260
|
+
(_console2 = console).error.apply(_console2, getFormattedMessage(message));
|
2261
|
+
}
|
2262
|
+
}
|
2263
|
+
function validateTargets(targets) {
|
2264
|
+
var didPassFalsyValue = !targets;
|
2265
|
+
var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
|
2266
|
+
errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
|
2267
|
+
errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
|
2268
|
+
}
|
1909
2269
|
|
1910
2270
|
var pluginProps = {
|
1911
2271
|
animateFill: false,
|
@@ -1925,9 +2285,7 @@ var VueTippy = (function (exports, vue) {
|
|
1925
2285
|
zIndex: 9999
|
1926
2286
|
};
|
1927
2287
|
var defaultProps = Object.assign({
|
1928
|
-
appendTo:
|
1929
|
-
return document.body;
|
1930
|
-
},
|
2288
|
+
appendTo: TIPPY_DEFAULT_APPEND_TO,
|
1931
2289
|
aria: {
|
1932
2290
|
content: 'auto',
|
1933
2291
|
expanded: 'auto'
|
@@ -1962,9 +2320,13 @@ var VueTippy = (function (exports, vue) {
|
|
1962
2320
|
touch: true,
|
1963
2321
|
trigger: 'mouseenter focus',
|
1964
2322
|
triggerTarget: null
|
1965
|
-
}, pluginProps,
|
2323
|
+
}, pluginProps, renderProps);
|
1966
2324
|
var defaultKeys = Object.keys(defaultProps);
|
1967
2325
|
var setDefaultProps = function setDefaultProps(partialProps) {
|
2326
|
+
/* istanbul ignore else */
|
2327
|
+
if (process.env.NODE_ENV !== "production") {
|
2328
|
+
validateProps(partialProps, []);
|
2329
|
+
}
|
1968
2330
|
|
1969
2331
|
var keys = Object.keys(partialProps);
|
1970
2332
|
keys.forEach(function (key) {
|
@@ -1978,12 +2340,14 @@ var VueTippy = (function (exports, vue) {
|
|
1978
2340
|
defaultValue = plugin.defaultValue;
|
1979
2341
|
|
1980
2342
|
if (name) {
|
1981
|
-
|
2343
|
+
var _name;
|
2344
|
+
|
2345
|
+
acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
|
1982
2346
|
}
|
1983
2347
|
|
1984
2348
|
return acc;
|
1985
2349
|
}, {});
|
1986
|
-
return Object.assign({}, passedProps,
|
2350
|
+
return Object.assign({}, passedProps, pluginProps);
|
1987
2351
|
}
|
1988
2352
|
function getDataAttributeProps(reference, plugins) {
|
1989
2353
|
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
@@ -2014,13 +2378,36 @@ var VueTippy = (function (exports, vue) {
|
|
2014
2378
|
var out = Object.assign({}, props, {
|
2015
2379
|
content: invokeWithArgsOrReturn(props.content, [reference])
|
2016
2380
|
}, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
|
2017
|
-
out.aria = Object.assign({}, defaultProps.aria,
|
2381
|
+
out.aria = Object.assign({}, defaultProps.aria, out.aria);
|
2018
2382
|
out.aria = {
|
2019
2383
|
expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
|
2020
2384
|
content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
|
2021
2385
|
};
|
2022
2386
|
return out;
|
2023
2387
|
}
|
2388
|
+
function validateProps(partialProps, plugins) {
|
2389
|
+
if (partialProps === void 0) {
|
2390
|
+
partialProps = {};
|
2391
|
+
}
|
2392
|
+
|
2393
|
+
if (plugins === void 0) {
|
2394
|
+
plugins = [];
|
2395
|
+
}
|
2396
|
+
|
2397
|
+
var keys = Object.keys(partialProps);
|
2398
|
+
keys.forEach(function (prop) {
|
2399
|
+
var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));
|
2400
|
+
var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins`
|
2401
|
+
|
2402
|
+
if (didPassUnknownProp) {
|
2403
|
+
didPassUnknownProp = plugins.filter(function (plugin) {
|
2404
|
+
return plugin.name === prop;
|
2405
|
+
}).length === 0;
|
2406
|
+
}
|
2407
|
+
|
2408
|
+
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(' '));
|
2409
|
+
});
|
2410
|
+
}
|
2024
2411
|
|
2025
2412
|
var innerHTML = function innerHTML() {
|
2026
2413
|
return 'innerHTML';
|
@@ -2152,7 +2539,7 @@ var VueTippy = (function (exports, vue) {
|
|
2152
2539
|
|
2153
2540
|
var mountedInstances = [];
|
2154
2541
|
function createTippy(reference, passedProps) {
|
2155
|
-
var props = evaluateProps(reference, Object.assign({}, defaultProps,
|
2542
|
+
var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
|
2156
2543
|
// 🔒 Private members
|
2157
2544
|
// ===========================================================================
|
2158
2545
|
|
@@ -2213,6 +2600,9 @@ var VueTippy = (function (exports, vue) {
|
|
2213
2600
|
/* istanbul ignore if */
|
2214
2601
|
|
2215
2602
|
if (!props.render) {
|
2603
|
+
if (process.env.NODE_ENV !== "production") {
|
2604
|
+
errorWhen(true, 'render() function has not been supplied.');
|
2605
|
+
}
|
2216
2606
|
|
2217
2607
|
return instance;
|
2218
2608
|
} // ===========================================================================
|
@@ -2249,10 +2639,9 @@ var VueTippy = (function (exports, vue) {
|
|
2249
2639
|
instance.clearDelayTimeouts();
|
2250
2640
|
}
|
2251
2641
|
});
|
2252
|
-
popper.addEventListener('mouseleave', function (
|
2642
|
+
popper.addEventListener('mouseleave', function () {
|
2253
2643
|
if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
|
2254
2644
|
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
2255
|
-
debouncedOnMouseMove(event);
|
2256
2645
|
}
|
2257
2646
|
});
|
2258
2647
|
return instance; // ===========================================================================
|
@@ -2272,7 +2661,7 @@ var VueTippy = (function (exports, vue) {
|
|
2272
2661
|
var _instance$props$rende;
|
2273
2662
|
|
2274
2663
|
// @ts-ignore
|
2275
|
-
return !!((_instance$props$rende = instance.props.render)
|
2664
|
+
return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
|
2276
2665
|
}
|
2277
2666
|
|
2278
2667
|
function getCurrentTarget() {
|
@@ -2299,8 +2688,12 @@ var VueTippy = (function (exports, vue) {
|
|
2299
2688
|
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
|
2300
2689
|
}
|
2301
2690
|
|
2302
|
-
function handleStyles() {
|
2303
|
-
|
2691
|
+
function handleStyles(fromHide) {
|
2692
|
+
if (fromHide === void 0) {
|
2693
|
+
fromHide = false;
|
2694
|
+
}
|
2695
|
+
|
2696
|
+
popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
|
2304
2697
|
popper.style.zIndex = "" + instance.props.zIndex;
|
2305
2698
|
}
|
2306
2699
|
|
@@ -2311,7 +2704,7 @@ var VueTippy = (function (exports, vue) {
|
|
2311
2704
|
|
2312
2705
|
pluginsHooks.forEach(function (pluginHooks) {
|
2313
2706
|
if (pluginHooks[hook]) {
|
2314
|
-
pluginHooks[hook].apply(
|
2707
|
+
pluginHooks[hook].apply(pluginHooks, args);
|
2315
2708
|
}
|
2316
2709
|
});
|
2317
2710
|
|
@@ -2377,15 +2770,18 @@ var VueTippy = (function (exports, vue) {
|
|
2377
2770
|
if (didTouchMove || event.type === 'mousedown') {
|
2378
2771
|
return;
|
2379
2772
|
}
|
2380
|
-
}
|
2773
|
+
}
|
2381
2774
|
|
2775
|
+
var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
|
2382
2776
|
|
2383
|
-
if (instance.props.interactive && popper
|
2777
|
+
if (instance.props.interactive && actualContains(popper, actualTarget)) {
|
2384
2778
|
return;
|
2385
2779
|
} // Clicked on the event listeners target
|
2386
2780
|
|
2387
2781
|
|
2388
|
-
if (
|
2782
|
+
if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
|
2783
|
+
return actualContains(el, actualTarget);
|
2784
|
+
})) {
|
2389
2785
|
if (currentInput.isTouch) {
|
2390
2786
|
return;
|
2391
2787
|
}
|
@@ -2513,7 +2909,7 @@ var VueTippy = (function (exports, vue) {
|
|
2513
2909
|
break;
|
2514
2910
|
|
2515
2911
|
case 'focus':
|
2516
|
-
on(
|
2912
|
+
on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
|
2517
2913
|
break;
|
2518
2914
|
|
2519
2915
|
case 'focusin':
|
@@ -2739,7 +3135,7 @@ var VueTippy = (function (exports, vue) {
|
|
2739
3135
|
|
2740
3136
|
var node = getCurrentTarget();
|
2741
3137
|
|
2742
|
-
if (instance.props.interactive && appendTo ===
|
3138
|
+
if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
|
2743
3139
|
parentNode = node.parentNode;
|
2744
3140
|
} else {
|
2745
3141
|
parentNode = invokeWithArgsOrReturn(appendTo, [node]);
|
@@ -2751,7 +3147,14 @@ var VueTippy = (function (exports, vue) {
|
|
2751
3147
|
parentNode.appendChild(popper);
|
2752
3148
|
}
|
2753
3149
|
|
3150
|
+
instance.state.isMounted = true;
|
2754
3151
|
createPopperInstance();
|
3152
|
+
/* istanbul ignore else */
|
3153
|
+
|
3154
|
+
if (process.env.NODE_ENV !== "production") {
|
3155
|
+
// Accessibility check
|
3156
|
+
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(' '));
|
3157
|
+
}
|
2755
3158
|
}
|
2756
3159
|
|
2757
3160
|
function getNestedPopperTree() {
|
@@ -2840,6 +3243,10 @@ var VueTippy = (function (exports, vue) {
|
|
2840
3243
|
}
|
2841
3244
|
|
2842
3245
|
function setProps(partialProps) {
|
3246
|
+
/* istanbul ignore else */
|
3247
|
+
if (process.env.NODE_ENV !== "production") {
|
3248
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
|
3249
|
+
}
|
2843
3250
|
|
2844
3251
|
if (instance.state.isDestroyed) {
|
2845
3252
|
return;
|
@@ -2848,7 +3255,7 @@ var VueTippy = (function (exports, vue) {
|
|
2848
3255
|
invokeHook('onBeforeUpdate', [instance, partialProps]);
|
2849
3256
|
removeListeners();
|
2850
3257
|
var prevProps = instance.props;
|
2851
|
-
var nextProps = evaluateProps(reference, Object.assign({},
|
3258
|
+
var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
|
2852
3259
|
ignoreAttributes: true
|
2853
3260
|
}));
|
2854
3261
|
instance.props = nextProps;
|
@@ -2898,6 +3305,10 @@ var VueTippy = (function (exports, vue) {
|
|
2898
3305
|
}
|
2899
3306
|
|
2900
3307
|
function show() {
|
3308
|
+
/* istanbul ignore else */
|
3309
|
+
if (process.env.NODE_ENV !== "production") {
|
3310
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
|
3311
|
+
} // Early bail-out
|
2901
3312
|
|
2902
3313
|
|
2903
3314
|
var isAlreadyVisible = instance.state.isVisible;
|
@@ -2947,6 +3358,8 @@ var VueTippy = (function (exports, vue) {
|
|
2947
3358
|
}
|
2948
3359
|
|
2949
3360
|
onFirstUpdate = function onFirstUpdate() {
|
3361
|
+
var _instance$popperInsta2;
|
3362
|
+
|
2950
3363
|
if (!instance.state.isVisible || ignoreOnFirstUpdate) {
|
2951
3364
|
return;
|
2952
3365
|
}
|
@@ -2967,8 +3380,10 @@ var VueTippy = (function (exports, vue) {
|
|
2967
3380
|
|
2968
3381
|
handleAriaContentAttribute();
|
2969
3382
|
handleAriaExpandedAttribute();
|
2970
|
-
pushIfUnique(mountedInstances, instance);
|
2971
|
-
|
3383
|
+
pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
|
3384
|
+
// popper has been positioned for the first time
|
3385
|
+
|
3386
|
+
(_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
|
2972
3387
|
invokeHook('onMount', [instance]);
|
2973
3388
|
|
2974
3389
|
if (instance.props.animation && getIsDefaultRenderFn()) {
|
@@ -2983,6 +3398,10 @@ var VueTippy = (function (exports, vue) {
|
|
2983
3398
|
}
|
2984
3399
|
|
2985
3400
|
function hide() {
|
3401
|
+
/* istanbul ignore else */
|
3402
|
+
if (process.env.NODE_ENV !== "production") {
|
3403
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
|
3404
|
+
} // Early bail-out
|
2986
3405
|
|
2987
3406
|
|
2988
3407
|
var isAlreadyHidden = !instance.state.isVisible;
|
@@ -3011,7 +3430,7 @@ var VueTippy = (function (exports, vue) {
|
|
3011
3430
|
|
3012
3431
|
cleanupInteractiveMouseListeners();
|
3013
3432
|
removeDocumentPress();
|
3014
|
-
handleStyles();
|
3433
|
+
handleStyles(true);
|
3015
3434
|
|
3016
3435
|
if (getIsDefaultRenderFn()) {
|
3017
3436
|
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
|
@@ -3037,6 +3456,10 @@ var VueTippy = (function (exports, vue) {
|
|
3037
3456
|
}
|
3038
3457
|
|
3039
3458
|
function hideWithInteractivity(event) {
|
3459
|
+
/* istanbul ignore else */
|
3460
|
+
if (process.env.NODE_ENV !== "production") {
|
3461
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
|
3462
|
+
}
|
3040
3463
|
|
3041
3464
|
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
3042
3465
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
@@ -3044,6 +3467,10 @@ var VueTippy = (function (exports, vue) {
|
|
3044
3467
|
}
|
3045
3468
|
|
3046
3469
|
function unmount() {
|
3470
|
+
/* istanbul ignore else */
|
3471
|
+
if (process.env.NODE_ENV !== "production") {
|
3472
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));
|
3473
|
+
}
|
3047
3474
|
|
3048
3475
|
if (instance.state.isVisible) {
|
3049
3476
|
instance.hide();
|
@@ -3073,6 +3500,10 @@ var VueTippy = (function (exports, vue) {
|
|
3073
3500
|
}
|
3074
3501
|
|
3075
3502
|
function destroy() {
|
3503
|
+
/* istanbul ignore else */
|
3504
|
+
if (process.env.NODE_ENV !== "production") {
|
3505
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
|
3506
|
+
}
|
3076
3507
|
|
3077
3508
|
if (instance.state.isDestroyed) {
|
3078
3509
|
return;
|
@@ -3093,12 +3524,25 @@ var VueTippy = (function (exports, vue) {
|
|
3093
3524
|
}
|
3094
3525
|
|
3095
3526
|
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
|
3527
|
+
/* istanbul ignore else */
|
3528
|
+
|
3529
|
+
if (process.env.NODE_ENV !== "production") {
|
3530
|
+
validateTargets(targets);
|
3531
|
+
validateProps(optionalProps, plugins);
|
3532
|
+
}
|
3096
3533
|
|
3097
3534
|
bindGlobalEventListeners();
|
3098
3535
|
var passedProps = Object.assign({}, optionalProps, {
|
3099
3536
|
plugins: plugins
|
3100
3537
|
});
|
3101
3538
|
var elements = getArrayOfElements(targets);
|
3539
|
+
/* istanbul ignore else */
|
3540
|
+
|
3541
|
+
if (process.env.NODE_ENV !== "production") {
|
3542
|
+
var isSingleContentElement = isElement$1(passedProps.content);
|
3543
|
+
var isMoreThanOneReferenceElement = elements.length > 1;
|
3544
|
+
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(' '));
|
3545
|
+
}
|
3102
3546
|
|
3103
3547
|
var instances = elements.reduce(function (acc, reference) {
|
3104
3548
|
var instance = reference && createTippy(reference, passedProps);
|
@@ -3116,16 +3560,63 @@ var VueTippy = (function (exports, vue) {
|
|
3116
3560
|
tippy.setDefaultProps = setDefaultProps;
|
3117
3561
|
tippy.currentInput = currentInput;
|
3118
3562
|
|
3563
|
+
// every time the popper is destroyed (i.e. a new target), removing the styles
|
3564
|
+
// and causing transitions to break for singletons when the console is open, but
|
3565
|
+
// most notably for non-transform styles being used, `gpuAcceleration: false`.
|
3566
|
+
|
3567
|
+
var applyStylesModifier = Object.assign({}, applyStyles$1, {
|
3568
|
+
effect: function effect(_ref) {
|
3569
|
+
var state = _ref.state;
|
3570
|
+
var initialStyles = {
|
3571
|
+
popper: {
|
3572
|
+
position: state.options.strategy,
|
3573
|
+
left: '0',
|
3574
|
+
top: '0',
|
3575
|
+
margin: '0'
|
3576
|
+
},
|
3577
|
+
arrow: {
|
3578
|
+
position: 'absolute'
|
3579
|
+
},
|
3580
|
+
reference: {}
|
3581
|
+
};
|
3582
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
3583
|
+
state.styles = initialStyles;
|
3584
|
+
|
3585
|
+
if (state.elements.arrow) {
|
3586
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
3587
|
+
} // intentionally return no cleanup function
|
3588
|
+
// return () => { ... }
|
3589
|
+
|
3590
|
+
}
|
3591
|
+
});
|
3592
|
+
|
3119
3593
|
var createSingleton = function createSingleton(tippyInstances, optionalProps) {
|
3594
|
+
var _optionalProps$popper;
|
3595
|
+
|
3120
3596
|
if (optionalProps === void 0) {
|
3121
3597
|
optionalProps = {};
|
3122
3598
|
}
|
3123
3599
|
|
3600
|
+
/* istanbul ignore else */
|
3601
|
+
if (process.env.NODE_ENV !== "production") {
|
3602
|
+
errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));
|
3603
|
+
}
|
3604
|
+
|
3124
3605
|
var individualInstances = tippyInstances;
|
3125
3606
|
var references = [];
|
3607
|
+
var triggerTargets = [];
|
3126
3608
|
var currentTarget;
|
3127
3609
|
var overrides = optionalProps.overrides;
|
3128
3610
|
var interceptSetPropsCleanups = [];
|
3611
|
+
var shownOnCreate = false;
|
3612
|
+
|
3613
|
+
function setTriggerTargets() {
|
3614
|
+
triggerTargets = individualInstances.map(function (instance) {
|
3615
|
+
return normalizeToArray(instance.props.triggerTarget || instance.reference);
|
3616
|
+
}).reduce(function (acc, item) {
|
3617
|
+
return acc.concat(item);
|
3618
|
+
}, []);
|
3619
|
+
}
|
3129
3620
|
|
3130
3621
|
function setReferences() {
|
3131
3622
|
references = individualInstances.map(function (instance) {
|
@@ -3159,42 +3650,123 @@ var VueTippy = (function (exports, vue) {
|
|
3159
3650
|
instance.setProps = originalSetProps;
|
3160
3651
|
};
|
3161
3652
|
});
|
3653
|
+
} // have to pass singleton, as it maybe undefined on first call
|
3654
|
+
|
3655
|
+
|
3656
|
+
function prepareInstance(singleton, target) {
|
3657
|
+
var index = triggerTargets.indexOf(target); // bail-out
|
3658
|
+
|
3659
|
+
if (target === currentTarget) {
|
3660
|
+
return;
|
3661
|
+
}
|
3662
|
+
|
3663
|
+
currentTarget = target;
|
3664
|
+
var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {
|
3665
|
+
acc[prop] = individualInstances[index].props[prop];
|
3666
|
+
return acc;
|
3667
|
+
}, {});
|
3668
|
+
singleton.setProps(Object.assign({}, overrideProps, {
|
3669
|
+
getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {
|
3670
|
+
var _references$index;
|
3671
|
+
|
3672
|
+
return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
|
3673
|
+
}
|
3674
|
+
}));
|
3162
3675
|
}
|
3163
3676
|
|
3164
3677
|
enableInstances(false);
|
3165
3678
|
setReferences();
|
3679
|
+
setTriggerTargets();
|
3166
3680
|
var plugin = {
|
3167
3681
|
fn: function fn() {
|
3168
3682
|
return {
|
3169
3683
|
onDestroy: function onDestroy() {
|
3170
3684
|
enableInstances(true);
|
3171
3685
|
},
|
3172
|
-
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
if (
|
3177
|
-
|
3686
|
+
onHidden: function onHidden() {
|
3687
|
+
currentTarget = null;
|
3688
|
+
},
|
3689
|
+
onClickOutside: function onClickOutside(instance) {
|
3690
|
+
if (instance.props.showOnCreate && !shownOnCreate) {
|
3691
|
+
shownOnCreate = true;
|
3692
|
+
currentTarget = null;
|
3178
3693
|
}
|
3179
|
-
|
3180
|
-
|
3181
|
-
|
3182
|
-
|
3183
|
-
|
3184
|
-
}
|
3185
|
-
|
3186
|
-
|
3187
|
-
|
3188
|
-
}
|
3189
|
-
}));
|
3694
|
+
},
|
3695
|
+
onShow: function onShow(instance) {
|
3696
|
+
if (instance.props.showOnCreate && !shownOnCreate) {
|
3697
|
+
shownOnCreate = true;
|
3698
|
+
prepareInstance(instance, references[0]);
|
3699
|
+
}
|
3700
|
+
},
|
3701
|
+
onTrigger: function onTrigger(instance, event) {
|
3702
|
+
prepareInstance(instance, event.currentTarget);
|
3190
3703
|
}
|
3191
3704
|
};
|
3192
3705
|
}
|
3193
3706
|
};
|
3194
3707
|
var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
|
3195
3708
|
plugins: [plugin].concat(optionalProps.plugins || []),
|
3196
|
-
triggerTarget:
|
3709
|
+
triggerTarget: triggerTargets,
|
3710
|
+
popperOptions: Object.assign({}, optionalProps.popperOptions, {
|
3711
|
+
modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
|
3712
|
+
})
|
3197
3713
|
}));
|
3714
|
+
var originalShow = singleton.show;
|
3715
|
+
|
3716
|
+
singleton.show = function (target) {
|
3717
|
+
originalShow(); // first time, showOnCreate or programmatic call with no params
|
3718
|
+
// default to showing first instance
|
3719
|
+
|
3720
|
+
if (!currentTarget && target == null) {
|
3721
|
+
return prepareInstance(singleton, references[0]);
|
3722
|
+
} // triggered from event (do nothing as prepareInstance already called by onTrigger)
|
3723
|
+
// programmatic call with no params when already visible (do nothing again)
|
3724
|
+
|
3725
|
+
|
3726
|
+
if (currentTarget && target == null) {
|
3727
|
+
return;
|
3728
|
+
} // target is index of instance
|
3729
|
+
|
3730
|
+
|
3731
|
+
if (typeof target === 'number') {
|
3732
|
+
return references[target] && prepareInstance(singleton, references[target]);
|
3733
|
+
} // target is a child tippy instance
|
3734
|
+
|
3735
|
+
|
3736
|
+
if (individualInstances.indexOf(target) >= 0) {
|
3737
|
+
var ref = target.reference;
|
3738
|
+
return prepareInstance(singleton, ref);
|
3739
|
+
} // target is a ReferenceElement
|
3740
|
+
|
3741
|
+
|
3742
|
+
if (references.indexOf(target) >= 0) {
|
3743
|
+
return prepareInstance(singleton, target);
|
3744
|
+
}
|
3745
|
+
};
|
3746
|
+
|
3747
|
+
singleton.showNext = function () {
|
3748
|
+
var first = references[0];
|
3749
|
+
|
3750
|
+
if (!currentTarget) {
|
3751
|
+
return singleton.show(0);
|
3752
|
+
}
|
3753
|
+
|
3754
|
+
var index = references.indexOf(currentTarget);
|
3755
|
+
singleton.show(references[index + 1] || first);
|
3756
|
+
};
|
3757
|
+
|
3758
|
+
singleton.showPrevious = function () {
|
3759
|
+
var last = references[references.length - 1];
|
3760
|
+
|
3761
|
+
if (!currentTarget) {
|
3762
|
+
return singleton.show(last);
|
3763
|
+
}
|
3764
|
+
|
3765
|
+
var index = references.indexOf(currentTarget);
|
3766
|
+
var target = references[index - 1] || last;
|
3767
|
+
singleton.show(target);
|
3768
|
+
};
|
3769
|
+
|
3198
3770
|
var originalSetProps = singleton.setProps;
|
3199
3771
|
|
3200
3772
|
singleton.setProps = function (props) {
|
@@ -3210,9 +3782,10 @@ var VueTippy = (function (exports, vue) {
|
|
3210
3782
|
individualInstances = nextInstances;
|
3211
3783
|
enableInstances(false);
|
3212
3784
|
setReferences();
|
3213
|
-
|
3785
|
+
setTriggerTargets();
|
3786
|
+
interceptSetPropsCleanups = interceptSetProps(singleton);
|
3214
3787
|
singleton.setProps({
|
3215
|
-
triggerTarget:
|
3788
|
+
triggerTarget: triggerTargets
|
3216
3789
|
});
|
3217
3790
|
};
|
3218
3791
|
|
@@ -3227,7 +3800,10 @@ var VueTippy = (function (exports, vue) {
|
|
3227
3800
|
var _instance$props$rende;
|
3228
3801
|
|
3229
3802
|
// @ts-ignore
|
3230
|
-
if (!((_instance$props$rende = instance.props.render)
|
3803
|
+
if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
|
3804
|
+
if (process.env.NODE_ENV !== "production") {
|
3805
|
+
errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');
|
3806
|
+
}
|
3231
3807
|
|
3232
3808
|
return {};
|
3233
3809
|
}
|
@@ -3349,6 +3925,7 @@ var VueTippy = (function (exports, vue) {
|
|
3349
3925
|
|
3350
3926
|
if (isCursorOverReference || !instance.props.interactive) {
|
3351
3927
|
instance.setProps({
|
3928
|
+
// @ts-ignore - unneeded DOMRect properties
|
3352
3929
|
getReferenceClientRect: function getReferenceClientRect() {
|
3353
3930
|
var rect = reference.getBoundingClientRect();
|
3354
3931
|
var x = clientX;
|
@@ -3485,6 +4062,7 @@ var VueTippy = (function (exports, vue) {
|
|
3485
4062
|
var placement;
|
3486
4063
|
var cursorRectIndex = -1;
|
3487
4064
|
var isInternalUpdate = false;
|
4065
|
+
var triedPlacements = [];
|
3488
4066
|
var modifier = {
|
3489
4067
|
name: 'tippyInlinePositioning',
|
3490
4068
|
enabled: true,
|
@@ -3493,8 +4071,14 @@ var VueTippy = (function (exports, vue) {
|
|
3493
4071
|
var state = _ref2.state;
|
3494
4072
|
|
3495
4073
|
if (isEnabled()) {
|
3496
|
-
if (placement !==
|
4074
|
+
if (triedPlacements.indexOf(state.placement) !== -1) {
|
4075
|
+
triedPlacements = [];
|
4076
|
+
}
|
4077
|
+
|
4078
|
+
if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
|
4079
|
+
triedPlacements.push(state.placement);
|
3497
4080
|
instance.setProps({
|
4081
|
+
// @ts-ignore - unneeded DOMRect properties
|
3498
4082
|
getReferenceClientRect: function getReferenceClientRect() {
|
3499
4083
|
return _getReferenceClientRect(state.placement);
|
3500
4084
|
}
|
@@ -3531,10 +4115,11 @@ var VueTippy = (function (exports, vue) {
|
|
3531
4115
|
var cursorRect = rects.find(function (rect) {
|
3532
4116
|
return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;
|
3533
4117
|
});
|
3534
|
-
|
4118
|
+
var index = rects.indexOf(cursorRect);
|
4119
|
+
cursorRectIndex = index > -1 ? index : cursorRectIndex;
|
3535
4120
|
}
|
3536
4121
|
},
|
3537
|
-
|
4122
|
+
onHidden: function onHidden() {
|
3538
4123
|
cursorRectIndex = -1;
|
3539
4124
|
}
|
3540
4125
|
};
|
@@ -3678,7 +4263,15 @@ var VueTippy = (function (exports, vue) {
|
|
3678
4263
|
},
|
3679
4264
|
});
|
3680
4265
|
function useTippy(el, opts = {}, settings = { mount: true }) {
|
4266
|
+
const vm = vue.getCurrentInstance();
|
3681
4267
|
const instance = vue.ref();
|
4268
|
+
const state = vue.ref({
|
4269
|
+
isEnabled: false,
|
4270
|
+
isVisible: false,
|
4271
|
+
isDestroyed: false,
|
4272
|
+
isMounted: false,
|
4273
|
+
isShown: false,
|
4274
|
+
});
|
3682
4275
|
let container = null;
|
3683
4276
|
const getContainer = () => {
|
3684
4277
|
if (container)
|
@@ -3692,11 +4285,18 @@ var VueTippy = (function (exports, vue) {
|
|
3692
4285
|
? content.value
|
3693
4286
|
: content;
|
3694
4287
|
if (vue.isVNode(unwrappedContent)) {
|
4288
|
+
if (vm) {
|
4289
|
+
unwrappedContent.appContext = vm.appContext;
|
4290
|
+
}
|
3695
4291
|
vue.render(unwrappedContent, getContainer());
|
3696
4292
|
newContent = () => getContainer();
|
3697
4293
|
}
|
3698
4294
|
else if (typeof unwrappedContent === 'object') {
|
3699
|
-
vue.
|
4295
|
+
let comp = vue.h(unwrappedContent);
|
4296
|
+
if (vm) {
|
4297
|
+
comp.appContext = vm.appContext;
|
4298
|
+
}
|
4299
|
+
vue.render(comp, getContainer());
|
3700
4300
|
newContent = () => getContainer();
|
3701
4301
|
}
|
3702
4302
|
else {
|
@@ -3707,7 +4307,7 @@ var VueTippy = (function (exports, vue) {
|
|
3707
4307
|
const getProps = (opts) => {
|
3708
4308
|
let options = {};
|
3709
4309
|
if (vue.isRef(opts)) {
|
3710
|
-
options = opts.value;
|
4310
|
+
options = opts.value || {};
|
3711
4311
|
}
|
3712
4312
|
else if (vue.isReactive(opts)) {
|
3713
4313
|
options = { ...opts };
|
@@ -3715,8 +4315,51 @@ var VueTippy = (function (exports, vue) {
|
|
3715
4315
|
else {
|
3716
4316
|
options = { ...opts };
|
3717
4317
|
}
|
3718
|
-
if (options.content)
|
4318
|
+
if (options.content) {
|
3719
4319
|
options.content = getContent(options.content);
|
4320
|
+
}
|
4321
|
+
if (options.triggerTarget) {
|
4322
|
+
options.triggerTarget = vue.isRef(options.triggerTarget)
|
4323
|
+
? options.triggerTarget.value
|
4324
|
+
: options.triggerTarget;
|
4325
|
+
}
|
4326
|
+
if (!options.plugins || !Array.isArray(options.plugins)) {
|
4327
|
+
options.plugins = [];
|
4328
|
+
}
|
4329
|
+
options.plugins = options.plugins.filter((plugin) => plugin.name !== 'vueTippyReactiveState');
|
4330
|
+
options.plugins.push({
|
4331
|
+
name: 'vueTippyReactiveState',
|
4332
|
+
fn: () => {
|
4333
|
+
return {
|
4334
|
+
onCreate() {
|
4335
|
+
state.value.isEnabled = true;
|
4336
|
+
},
|
4337
|
+
onMount() {
|
4338
|
+
state.value.isMounted = true;
|
4339
|
+
},
|
4340
|
+
onShow() {
|
4341
|
+
state.value.isMounted = true;
|
4342
|
+
state.value.isVisible = true;
|
4343
|
+
},
|
4344
|
+
onShown() {
|
4345
|
+
state.value.isShown = true;
|
4346
|
+
},
|
4347
|
+
onHide() {
|
4348
|
+
state.value.isMounted = false;
|
4349
|
+
state.value.isVisible = false;
|
4350
|
+
},
|
4351
|
+
onHidden() {
|
4352
|
+
state.value.isShown = false;
|
4353
|
+
},
|
4354
|
+
onUnmounted() {
|
4355
|
+
state.value.isMounted = false;
|
4356
|
+
},
|
4357
|
+
onDestroy() {
|
4358
|
+
state.value.isDestroyed = true;
|
4359
|
+
},
|
4360
|
+
};
|
4361
|
+
}
|
4362
|
+
});
|
3720
4363
|
return options;
|
3721
4364
|
};
|
3722
4365
|
const refresh = () => {
|
@@ -3755,10 +4398,12 @@ var VueTippy = (function (exports, vue) {
|
|
3755
4398
|
const disable = () => {
|
3756
4399
|
var _a;
|
3757
4400
|
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.disable();
|
4401
|
+
state.value.isEnabled = false;
|
3758
4402
|
};
|
3759
4403
|
const enable = () => {
|
3760
4404
|
var _a;
|
3761
4405
|
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.enable();
|
4406
|
+
state.value.isEnabled = true;
|
3762
4407
|
};
|
3763
4408
|
const unmount = () => {
|
3764
4409
|
var _a;
|
@@ -3789,9 +4434,9 @@ var VueTippy = (function (exports, vue) {
|
|
3789
4434
|
enable,
|
3790
4435
|
unmount,
|
3791
4436
|
mount,
|
4437
|
+
state,
|
3792
4438
|
};
|
3793
4439
|
if (settings.mount) {
|
3794
|
-
const vm = vue.getCurrentInstance();
|
3795
4440
|
if (vm) {
|
3796
4441
|
if (vm.isMounted) {
|
3797
4442
|
mount();
|
@@ -3816,6 +4461,46 @@ var VueTippy = (function (exports, vue) {
|
|
3816
4461
|
return response;
|
3817
4462
|
}
|
3818
4463
|
|
4464
|
+
function useTippyComponent(opts = {}, children) {
|
4465
|
+
const instance = vue.ref();
|
4466
|
+
return {
|
4467
|
+
instance,
|
4468
|
+
TippyComponent: vue.h(TippyComponent, {
|
4469
|
+
...opts,
|
4470
|
+
onVnodeMounted: vnode => {
|
4471
|
+
//@ts-ignore
|
4472
|
+
instance.value = vnode.component.ctx;
|
4473
|
+
},
|
4474
|
+
}, children),
|
4475
|
+
};
|
4476
|
+
}
|
4477
|
+
|
4478
|
+
function useSingleton(instances, optionalProps) {
|
4479
|
+
const singleton = vue.ref();
|
4480
|
+
vue.onMounted(() => {
|
4481
|
+
const pendingTippyInstances = Array.isArray(instances)
|
4482
|
+
? instances.map(i => i.value)
|
4483
|
+
: typeof instances === 'function'
|
4484
|
+
? instances()
|
4485
|
+
: instances.value;
|
4486
|
+
const tippyInstances = pendingTippyInstances
|
4487
|
+
.map((instance) => {
|
4488
|
+
if (instance instanceof Element) {
|
4489
|
+
//@ts-ignore
|
4490
|
+
return instance._tippy;
|
4491
|
+
}
|
4492
|
+
return instance;
|
4493
|
+
})
|
4494
|
+
.filter(Boolean);
|
4495
|
+
singleton.value = createSingleton(tippyInstances, optionalProps
|
4496
|
+
? { allowHTML: true, ...optionalProps }
|
4497
|
+
: { allowHTML: true });
|
4498
|
+
});
|
4499
|
+
return {
|
4500
|
+
singleton,
|
4501
|
+
};
|
4502
|
+
}
|
4503
|
+
|
3819
4504
|
// const pluginProps = [
|
3820
4505
|
// 'animateFill',
|
3821
4506
|
// 'followCursor',
|
@@ -3856,50 +4541,157 @@ var VueTippy = (function (exports, vue) {
|
|
3856
4541
|
};
|
3857
4542
|
}
|
3858
4543
|
});
|
4544
|
+
props['to'] = {};
|
4545
|
+
props['tag'] = {
|
4546
|
+
default: 'span'
|
4547
|
+
};
|
4548
|
+
props['contentTag'] = {
|
4549
|
+
default: 'span'
|
4550
|
+
};
|
4551
|
+
props['contentClass'] = {
|
4552
|
+
default: null
|
4553
|
+
};
|
3859
4554
|
const TippyComponent = vue.defineComponent({
|
3860
4555
|
props,
|
3861
|
-
|
4556
|
+
emits: ['state'],
|
4557
|
+
setup(props, { slots, emit }) {
|
3862
4558
|
const elem = vue.ref();
|
3863
|
-
const
|
3864
|
-
|
4559
|
+
const contentElem = vue.ref();
|
4560
|
+
const mounted = vue.ref(false);
|
4561
|
+
let options = { ...props };
|
4562
|
+
for (const prop of ['to', 'tag', 'contentTag', 'contentClass']) {
|
4563
|
+
if (options.hasOwnProperty(prop)) {
|
4564
|
+
// @ts-ignore
|
4565
|
+
delete options[prop];
|
4566
|
+
}
|
4567
|
+
}
|
4568
|
+
let target = elem;
|
4569
|
+
if (props.to) {
|
4570
|
+
if (typeof Element !== 'undefined' && props.to instanceof Element) {
|
4571
|
+
target = () => props.to;
|
4572
|
+
}
|
4573
|
+
else if (typeof props.to === 'string' || props.to instanceof String) {
|
4574
|
+
target = () => document.querySelector(props.to);
|
4575
|
+
}
|
4576
|
+
}
|
4577
|
+
const tippy = useTippy(target, options);
|
4578
|
+
vue.onMounted(() => {
|
4579
|
+
mounted.value = true;
|
4580
|
+
vue.nextTick(() => {
|
4581
|
+
if (slots.content)
|
4582
|
+
tippy.setContent(() => contentElem.value);
|
4583
|
+
});
|
4584
|
+
});
|
4585
|
+
vue.watch(tippy.state, () => {
|
4586
|
+
emit('state', vue.unref(tippy.state));
|
4587
|
+
}, { immediate: true, deep: true });
|
4588
|
+
return { elem, contentElem, mounted, ...tippy };
|
4589
|
+
},
|
4590
|
+
render() {
|
4591
|
+
let slot = this.$slots.default ? this.$slots.default(this) : [];
|
4592
|
+
return vue.h(this.tag, { ref: 'elem', 'data-v-tippy': '' }, this.$slots.content ? [
|
4593
|
+
slot,
|
4594
|
+
vue.h(this.contentTag, { ref: 'contentElem', style: { display: this.mounted ? 'inherit' : 'none' }, class: this.contentClass }, this.$slots.content(this)),
|
4595
|
+
] : slot);
|
4596
|
+
},
|
4597
|
+
});
|
4598
|
+
|
4599
|
+
const booleanProps$1 = [
|
4600
|
+
'a11y',
|
4601
|
+
'allowHTML',
|
4602
|
+
'arrow',
|
4603
|
+
'flip',
|
4604
|
+
'flipOnUpdate',
|
4605
|
+
'hideOnClick',
|
4606
|
+
'ignoreAttributes',
|
4607
|
+
'inertia',
|
4608
|
+
'interactive',
|
4609
|
+
'lazy',
|
4610
|
+
'multiple',
|
4611
|
+
'showOnInit',
|
4612
|
+
'touch',
|
4613
|
+
'touchHold',
|
4614
|
+
];
|
4615
|
+
let props$1 = {};
|
4616
|
+
Object.keys(tippy.defaultProps).forEach((prop) => {
|
4617
|
+
if (booleanProps$1.includes(prop)) {
|
4618
|
+
props$1[prop] = {
|
4619
|
+
type: Boolean,
|
4620
|
+
default: function () {
|
4621
|
+
return tippy.defaultProps[prop];
|
4622
|
+
},
|
4623
|
+
};
|
4624
|
+
}
|
4625
|
+
else {
|
4626
|
+
props$1[prop] = {
|
4627
|
+
default: function () {
|
4628
|
+
return tippy.defaultProps[prop];
|
4629
|
+
},
|
4630
|
+
};
|
4631
|
+
}
|
4632
|
+
});
|
4633
|
+
const TippySingleton = vue.defineComponent({
|
4634
|
+
props: props$1,
|
4635
|
+
setup(props) {
|
4636
|
+
const instances = vue.ref([]);
|
4637
|
+
const { singleton } = useSingleton(instances, props);
|
4638
|
+
return { instances, singleton };
|
4639
|
+
},
|
4640
|
+
mounted() {
|
4641
|
+
var _a;
|
4642
|
+
const parent = this.$el.parentElement;
|
4643
|
+
const elements = parent.querySelectorAll('[data-v-tippy]');
|
4644
|
+
this.instances = Array.from(elements)
|
4645
|
+
.map((el) => el._tippy)
|
4646
|
+
.filter(Boolean);
|
4647
|
+
(_a = this.singleton) === null || _a === void 0 ? void 0 : _a.setInstances(this.instances);
|
3865
4648
|
},
|
3866
4649
|
render() {
|
3867
4650
|
let slot = this.$slots.default ? this.$slots.default() : [];
|
3868
|
-
return vue.h(
|
4651
|
+
return vue.h(() => slot);
|
3869
4652
|
},
|
3870
4653
|
});
|
3871
4654
|
|
3872
4655
|
const directive = {
|
3873
4656
|
mounted(el, binding, vnode) {
|
3874
|
-
const opts = binding.value || {};
|
3875
|
-
|
4657
|
+
const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
|
4658
|
+
const modifiers = Object.keys(binding.modifiers || {});
|
4659
|
+
const placement = modifiers.find(modifier => modifier !== 'arrow');
|
4660
|
+
const withArrow = modifiers.findIndex(modifier => modifier === 'arrow') !== -1;
|
4661
|
+
if (placement) {
|
4662
|
+
opts.placement = opts.placement || placement;
|
4663
|
+
}
|
4664
|
+
if (withArrow) {
|
4665
|
+
opts.arrow = opts.arrow !== undefined ? opts.arrow : true;
|
4666
|
+
}
|
4667
|
+
if (vnode.props && vnode.props.onTippyShow) {
|
3876
4668
|
opts.onShow = function (...args) {
|
3877
4669
|
var _a;
|
3878
|
-
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.
|
4670
|
+
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShow(...args);
|
3879
4671
|
};
|
3880
4672
|
}
|
3881
|
-
if (vnode.props && vnode.props.
|
4673
|
+
if (vnode.props && vnode.props.onTippyShown) {
|
3882
4674
|
opts.onShown = function (...args) {
|
3883
4675
|
var _a;
|
3884
|
-
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.
|
4676
|
+
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShown(...args);
|
3885
4677
|
};
|
3886
4678
|
}
|
3887
|
-
if (vnode.props && vnode.props.
|
4679
|
+
if (vnode.props && vnode.props.onTippyHidden) {
|
3888
4680
|
opts.onHidden = function (...args) {
|
3889
4681
|
var _a;
|
3890
|
-
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.
|
4682
|
+
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHidden(...args);
|
3891
4683
|
};
|
3892
4684
|
}
|
3893
|
-
if (vnode.props && vnode.props.
|
4685
|
+
if (vnode.props && vnode.props.onTippyHide) {
|
3894
4686
|
opts.onHide = function (...args) {
|
3895
4687
|
var _a;
|
3896
|
-
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.
|
4688
|
+
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHide(...args);
|
3897
4689
|
};
|
3898
4690
|
}
|
3899
|
-
if (vnode.props && vnode.props.
|
4691
|
+
if (vnode.props && vnode.props.onTippyMount) {
|
3900
4692
|
opts.onMount = function (...args) {
|
3901
4693
|
var _a;
|
3902
|
-
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.
|
4694
|
+
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyMount(...args);
|
3903
4695
|
};
|
3904
4696
|
}
|
3905
4697
|
if (el.getAttribute('title') && !opts.content) {
|
@@ -3920,7 +4712,7 @@ var VueTippy = (function (exports, vue) {
|
|
3920
4712
|
}
|
3921
4713
|
},
|
3922
4714
|
updated(el, binding) {
|
3923
|
-
const opts = binding.value || {};
|
4715
|
+
const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
|
3924
4716
|
if (el.getAttribute('title') && !opts.content) {
|
3925
4717
|
opts.content = el.getAttribute('title');
|
3926
4718
|
el.removeAttribute('title');
|
@@ -3942,73 +4734,27 @@ var VueTippy = (function (exports, vue) {
|
|
3942
4734
|
tippy.setDefaultProps(options.defaultProps || {});
|
3943
4735
|
app.directive(options.directive || 'tippy', directive);
|
3944
4736
|
app.component(options.component || 'tippy', TippyComponent);
|
4737
|
+
app.component(options.componentSingleton || 'tippy-singleton', TippySingleton);
|
3945
4738
|
},
|
3946
4739
|
};
|
3947
4740
|
|
3948
|
-
function useSingleton(instances, optionalProps) {
|
3949
|
-
const singleton = vue.ref();
|
3950
|
-
vue.onMounted(() => {
|
3951
|
-
const pendingTippyInstances = Array.isArray(instances)
|
3952
|
-
? instances.map(i => i.value)
|
3953
|
-
: instances.value;
|
3954
|
-
const tippyInstances = pendingTippyInstances
|
3955
|
-
.map((instance) => {
|
3956
|
-
if (instance instanceof Element) {
|
3957
|
-
//@ts-ignore
|
3958
|
-
return instance._tippy;
|
3959
|
-
}
|
3960
|
-
return instance;
|
3961
|
-
})
|
3962
|
-
.filter(Boolean);
|
3963
|
-
singleton.value = createSingleton(tippyInstances, optionalProps);
|
3964
|
-
});
|
3965
|
-
return {
|
3966
|
-
singleton,
|
3967
|
-
};
|
3968
|
-
}
|
3969
|
-
|
3970
|
-
function styleInject(css, ref) {
|
3971
|
-
if ( ref === void 0 ) ref = {};
|
3972
|
-
var insertAt = ref.insertAt;
|
3973
|
-
|
3974
|
-
if (!css || typeof document === 'undefined') { return; }
|
3975
|
-
|
3976
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
3977
|
-
var style = document.createElement('style');
|
3978
|
-
style.type = 'text/css';
|
3979
|
-
|
3980
|
-
if (insertAt === 'top') {
|
3981
|
-
if (head.firstChild) {
|
3982
|
-
head.insertBefore(style, head.firstChild);
|
3983
|
-
} else {
|
3984
|
-
head.appendChild(style);
|
3985
|
-
}
|
3986
|
-
} else {
|
3987
|
-
head.appendChild(style);
|
3988
|
-
}
|
3989
|
-
|
3990
|
-
if (style.styleSheet) {
|
3991
|
-
style.styleSheet.cssText = css;
|
3992
|
-
} else {
|
3993
|
-
style.appendChild(document.createTextNode(css));
|
3994
|
-
}
|
3995
|
-
}
|
3996
|
-
|
3997
|
-
var css_248z = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
|
3998
|
-
styleInject(css_248z);
|
3999
|
-
|
4000
4741
|
const setDefaultProps$1 = tippy.setDefaultProps;
|
4001
4742
|
setDefaultProps$1({
|
4743
|
+
ignoreAttributes: true,
|
4002
4744
|
plugins: [sticky, inlinePositioning, followCursor, animateFill],
|
4003
4745
|
});
|
4004
4746
|
|
4005
4747
|
exports.Tippy = TippyComponent;
|
4748
|
+
exports.TippySingleton = TippySingleton;
|
4006
4749
|
exports.default = plugin;
|
4007
4750
|
exports.directive = directive;
|
4751
|
+
exports.plugin = plugin;
|
4752
|
+
exports.roundArrow = ROUND_ARROW;
|
4008
4753
|
exports.setDefaultProps = setDefaultProps$1;
|
4009
4754
|
exports.tippy = tippy;
|
4010
4755
|
exports.useSingleton = useSingleton;
|
4011
4756
|
exports.useTippy = useTippy;
|
4757
|
+
exports.useTippyComponent = useTippyComponent;
|
4012
4758
|
|
4013
4759
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4014
4760
|
|