shepherdjs_rails 2.3.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/shepherdjs_rails/version.rb +1 -1
- data/vendor/assets/javascripts/shepherd.esm.js +755 -827
- data/vendor/assets/javascripts/shepherd.esm.js.map +1 -1
- data/vendor/assets/javascripts/shepherd.js +755 -827
- data/vendor/assets/javascripts/shepherd.js.map +1 -1
- data/vendor/assets/javascripts/shepherd.min.js +1 -1
- data/vendor/assets/javascripts/shepherd.min.js.map +1 -1
- data/vendor/assets/stylesheets/shepherd-theme-dark.css +1 -1
- data/vendor/assets/stylesheets/shepherd-theme-default.css +1 -1
- data/vendor/assets/stylesheets/shepherd-theme-square-dark.css +1 -1
- data/vendor/assets/stylesheets/shepherd-theme-square.css +1 -1
- metadata +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! shepherd.js 2.
|
1
|
+
/*! shepherd.js 2.4.0 */
|
2
2
|
|
3
3
|
(function (global, factory) {
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
@@ -1769,7 +1769,7 @@
|
|
1769
1769
|
|
1770
1770
|
/**!
|
1771
1771
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
1772
|
-
* @version 1.14.
|
1772
|
+
* @version 1.14.7
|
1773
1773
|
* @license
|
1774
1774
|
* Copyright (c) 2016 Federico Zivolo and contributors
|
1775
1775
|
*
|
@@ -2337,7 +2337,11 @@
|
|
2337
2337
|
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
2338
2338
|
return true;
|
2339
2339
|
}
|
2340
|
-
|
2340
|
+
var parentNode = getParentNode(element);
|
2341
|
+
if (!parentNode) {
|
2342
|
+
return false;
|
2343
|
+
}
|
2344
|
+
return isFixed(parentNode);
|
2341
2345
|
}
|
2342
2346
|
|
2343
2347
|
/**
|
@@ -2993,18 +2997,23 @@
|
|
2993
2997
|
var _data$offsets = data.offsets,
|
2994
2998
|
popper = _data$offsets.popper,
|
2995
2999
|
reference = _data$offsets.reference;
|
3000
|
+
var round = Math.round,
|
3001
|
+
floor = Math.floor;
|
2996
3002
|
|
2997
|
-
|
2998
|
-
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
2999
|
-
var isVariation = data.placement.indexOf('-') !== -1;
|
3000
|
-
var sameWidthOddness = reference.width % 2 === popper.width % 2;
|
3001
|
-
var bothOddWidth = reference.width % 2 === 1 && popper.width % 2 === 1;
|
3002
3003
|
var noRound = function noRound(v) {
|
3003
3004
|
return v;
|
3004
3005
|
};
|
3005
3006
|
|
3006
|
-
var
|
3007
|
-
var
|
3007
|
+
var referenceWidth = round(reference.width);
|
3008
|
+
var popperWidth = round(popper.width);
|
3009
|
+
|
3010
|
+
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
3011
|
+
var isVariation = data.placement.indexOf('-') !== -1;
|
3012
|
+
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
3013
|
+
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
3014
|
+
|
3015
|
+
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
|
3016
|
+
var verticalToInteger = !shouldRound ? noRound : round;
|
3008
3017
|
|
3009
3018
|
return {
|
3010
3019
|
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
@@ -4337,23 +4346,37 @@
|
|
4337
4346
|
Popper.placements = placements;
|
4338
4347
|
Popper.Defaults = Defaults;
|
4339
4348
|
|
4340
|
-
|
4341
|
-
*
|
4349
|
+
/**!
|
4350
|
+
* tippy.js v4.0.1
|
4342
4351
|
* (c) 2017-2019 atomiks
|
4343
|
-
* MIT
|
4352
|
+
* MIT License
|
4344
4353
|
*/
|
4345
4354
|
|
4346
|
-
var version = "3.4.1";
|
4355
|
+
var css = ".tippy-iOS{cursor:pointer!important}.tippy-notransition{transition:none}.tippy-popper{transition-timing-function:cubic-bezier(.165,.84,.44,1);max-width:calc(100% - 10px);pointer-events:none;outline:0}.tippy-popper[x-placement^=top] .tippy-backdrop{border-radius:40% 40% 0 0}.tippy-popper[x-placement^=top] .tippy-roundarrow{bottom:-8px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.tippy-popper[x-placement^=top] .tippy-arrow{border-top:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;bottom:-7px;margin:0 6px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-backdrop{-webkit-transform-origin:0 25%;transform-origin:0 25%}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-55%);transform:scale(1) translate(-50%,-55%)}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%,-45%);transform:scale(.2) translate(-50%,-45%);opacity:0}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}.tippy-popper[x-placement^=top] [data-animation=perspective]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(-10px) rotateX(0);transform:perspective(700px) translateY(-10px) rotateX(0)}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateY(0) rotateX(60deg);transform:perspective(700px) translateY(0) rotateX(60deg)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=top] [data-animation=scale]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(-10px) scale(1);transform:translateY(-10px) scale(1)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px) scale(.5);transform:translateY(-10px) scale(.5)}.tippy-popper[x-placement^=bottom] .tippy-backdrop{border-radius:0 0 30% 30%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow{top:-8px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(0);transform:rotate(0)}.tippy-popper[x-placement^=bottom] .tippy-arrow{border-bottom:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;top:-7px;margin:0 6px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-backdrop{-webkit-transform-origin:0 -50%;transform-origin:0 -50%}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-45%);transform:scale(1) translate(-50%,-45%)}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%);transform:scale(.2) translate(-50%);opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(10px) rotateX(0);transform:perspective(700px) translateY(10px) rotateX(0)}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateY(0) rotateX(-60deg);transform:perspective(700px) translateY(0) rotateX(-60deg)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=bottom] [data-animation=scale]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(10px) scale(1);transform:translateY(10px) scale(1)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px) scale(.5);transform:translateY(10px) scale(.5)}.tippy-popper[x-placement^=left] .tippy-backdrop{border-radius:50% 0 0 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow{right:-16px;-webkit-transform-origin:33.33333333% 50%;transform-origin:33.33333333% 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.tippy-popper[x-placement^=left] .tippy-arrow{border-left:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;right:-7px;margin:3px 0;-webkit-transform-origin:0 50%;transform-origin:0 50%}.tippy-popper[x-placement^=left] .tippy-backdrop{-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-75%,-50%);transform:scale(.2) translate(-75%,-50%);opacity:0}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}.tippy-popper[x-placement^=left] [data-animation=perspective]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(-10px) rotateY(0);transform:perspective(700px) translateX(-10px) rotateY(0)}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateX(0) rotateY(-60deg);transform:perspective(700px) translateX(0) rotateY(-60deg)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=left] [data-animation=scale]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(-10px) scale(1);transform:translateX(-10px) scale(1)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px) scale(.5);transform:translateX(-10px) scale(.5)}.tippy-popper[x-placement^=right] .tippy-backdrop{border-radius:0 50% 50% 0}.tippy-popper[x-placement^=right] .tippy-roundarrow{left:-16px;-webkit-transform-origin:66.66666666% 50%;transform-origin:66.66666666% 50%}.tippy-popper[x-placement^=right] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.tippy-popper[x-placement^=right] .tippy-arrow{border-right:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;left:-7px;margin:3px 0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tippy-popper[x-placement^=right] .tippy-backdrop{-webkit-transform-origin:-50% 0;transform-origin:-50% 0}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-25%,-50%);transform:scale(.2) translate(-25%,-50%);opacity:0}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.tippy-popper[x-placement^=right] [data-animation=perspective]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(10px) rotateY(0);transform:perspective(700px) translateX(10px) rotateY(0)}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateX(0) rotateY(60deg);transform:perspective(700px) translateX(0) rotateY(60deg)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=right] [data-animation=scale]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(10px) scale(1);transform:translateX(10px) scale(1)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px) scale(.5);transform:translateX(10px) scale(.5)}.tippy-tooltip{position:relative;color:#fff;border-radius:4px;font-size:.9rem;padding:.3rem .6rem;line-height:1.4;text-align:center;will-change:transform;background-color:#333}.tippy-tooltip[data-size=small]{padding:.2rem .4rem;font-size:.75rem}.tippy-tooltip[data-size=large]{padding:.4rem .8rem;font-size:1rem}.tippy-tooltip[data-animatefill]{overflow:hidden;background-color:transparent}.tippy-tooltip[data-interactive],.tippy-tooltip[data-interactive] path{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-tooltip[data-inertia][data-state=hidden]{transition-timing-function:ease}.tippy-arrow,.tippy-roundarrow{position:absolute;width:0;height:0}.tippy-roundarrow{width:24px;height:8px;fill:#333;pointer-events:none}.tippy-backdrop{position:absolute;will-change:transform;background-color:#333;border-radius:50%;width:calc(110% + 2rem);left:50%;top:50%;z-index:-1;transition:all cubic-bezier(.46,.1,.52,.98);-webkit-backface-visibility:hidden;backface-visibility:hidden}.tippy-backdrop:after{content:\"\";float:left;padding-top:100%}.tippy-backdrop+.tippy-content{transition-property:opacity;will-change:opacity}.tippy-backdrop+.tippy-content[data-state=visible]{opacity:1}.tippy-backdrop+.tippy-content[data-state=hidden]{opacity:0}";
|
4347
4356
|
|
4348
|
-
|
4357
|
+
function _extends$2() {
|
4358
|
+
_extends$2 = Object.assign || function (target) {
|
4359
|
+
for (var i = 1; i < arguments.length; i++) {
|
4360
|
+
var source = arguments[i];
|
4361
|
+
|
4362
|
+
for (var key in source) {
|
4363
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4364
|
+
target[key] = source[key];
|
4365
|
+
}
|
4366
|
+
}
|
4367
|
+
}
|
4349
4368
|
|
4350
|
-
|
4351
|
-
|
4369
|
+
return target;
|
4370
|
+
};
|
4371
|
+
|
4372
|
+
return _extends$2.apply(this, arguments);
|
4373
|
+
}
|
4352
4374
|
|
4375
|
+
var version = "4.0.1";
|
4353
4376
|
|
4354
|
-
var
|
4355
|
-
var
|
4356
|
-
var
|
4377
|
+
var isBrowser$1 = typeof window !== 'undefined';
|
4378
|
+
var isIE$1 = isBrowser$1 && /MSIE |Trident\//.test(navigator.userAgent);
|
4379
|
+
var isIOS = isBrowser$1 && /iPhone|iPad|iPod/.test(navigator.platform) && !window.MSStream;
|
4357
4380
|
|
4358
4381
|
var Defaults$1 = {
|
4359
4382
|
a11y: true,
|
@@ -4365,9 +4388,7 @@
|
|
4365
4388
|
},
|
4366
4389
|
aria: 'describedby',
|
4367
4390
|
arrow: false,
|
4368
|
-
arrowTransform: '',
|
4369
4391
|
arrowType: 'sharp',
|
4370
|
-
autoFocus: true,
|
4371
4392
|
boundary: 'scrollParent',
|
4372
4393
|
content: '',
|
4373
4394
|
delay: [0, 20],
|
@@ -4375,15 +4396,16 @@
|
|
4375
4396
|
duration: [325, 275],
|
4376
4397
|
flip: true,
|
4377
4398
|
flipBehavior: 'flip',
|
4399
|
+
flipOnUpdate: false,
|
4378
4400
|
followCursor: false,
|
4379
4401
|
hideOnClick: true,
|
4402
|
+
ignoreAttributes: false,
|
4380
4403
|
inertia: false,
|
4381
4404
|
interactive: false,
|
4382
4405
|
interactiveBorder: 2,
|
4383
4406
|
interactiveDebounce: 0,
|
4384
4407
|
lazy: true,
|
4385
|
-
|
4386
|
-
maxWidth: '',
|
4408
|
+
maxWidth: 350,
|
4387
4409
|
multiple: false,
|
4388
4410
|
offset: 0,
|
4389
4411
|
onHidden: function onHidden() {},
|
@@ -4391,13 +4413,9 @@
|
|
4391
4413
|
onMount: function onMount() {},
|
4392
4414
|
onShow: function onShow() {},
|
4393
4415
|
onShown: function onShown() {},
|
4394
|
-
|
4395
|
-
performance: false,
|
4396
4416
|
placement: 'top',
|
4397
4417
|
popperOptions: {},
|
4398
|
-
|
4399
|
-
return true;
|
4400
|
-
},
|
4418
|
+
role: 'tooltip',
|
4401
4419
|
showOnInit: false,
|
4402
4420
|
size: 'regular',
|
4403
4421
|
sticky: false,
|
@@ -4406,15 +4424,16 @@
|
|
4406
4424
|
touch: true,
|
4407
4425
|
touchHold: false,
|
4408
4426
|
trigger: 'mouseenter focus',
|
4409
|
-
updateDuration:
|
4427
|
+
updateDuration: 0,
|
4410
4428
|
wait: null,
|
4411
4429
|
zIndex: 9999
|
4412
|
-
|
4413
4430
|
/**
|
4414
4431
|
* If the set() method encounters one of these, the popperInstance must be
|
4415
4432
|
* recreated
|
4416
4433
|
*/
|
4417
|
-
|
4434
|
+
|
4435
|
+
};
|
4436
|
+
var POPPER_INSTANCE_DEPENDENCIES = ['arrow', 'arrowType', 'boundary', 'distance', 'flip', 'flipBehavior', 'flipOnUpdate', 'offset', 'placement', 'popperOptions'];
|
4418
4437
|
|
4419
4438
|
var Selectors = {
|
4420
4439
|
POPPER: '.tippy-popper',
|
@@ -4426,40 +4445,40 @@
|
|
4426
4445
|
};
|
4427
4446
|
|
4428
4447
|
var elementProto = isBrowser$1 ? Element.prototype : {};
|
4429
|
-
|
4430
4448
|
var matches = elementProto.matches || elementProto.matchesSelector || elementProto.webkitMatchesSelector || elementProto.mozMatchesSelector || elementProto.msMatchesSelector;
|
4431
|
-
|
4432
4449
|
/**
|
4433
4450
|
* Ponyfill for Array.from - converts iterable values to an array
|
4434
4451
|
* @param {Array-like} value
|
4435
4452
|
* @return {Array}
|
4436
4453
|
*/
|
4454
|
+
|
4437
4455
|
function arrayFrom(value) {
|
4438
4456
|
return [].slice.call(value);
|
4439
4457
|
}
|
4440
|
-
|
4441
4458
|
/**
|
4442
4459
|
* Ponyfill for Element.prototype.closest
|
4443
4460
|
* @param {Element} element
|
4444
4461
|
* @param {String} parentSelector
|
4445
4462
|
* @return {Element}
|
4446
4463
|
*/
|
4464
|
+
|
4447
4465
|
function closest(element, parentSelector) {
|
4448
4466
|
return (elementProto.closest || function (selector) {
|
4449
4467
|
var el = this;
|
4468
|
+
|
4450
4469
|
while (el) {
|
4451
4470
|
if (matches.call(el, selector)) return el;
|
4452
4471
|
el = el.parentElement;
|
4453
4472
|
}
|
4454
4473
|
}).call(element, parentSelector);
|
4455
4474
|
}
|
4456
|
-
|
4457
4475
|
/**
|
4458
4476
|
* Works like Element.prototype.closest, but uses a callback instead
|
4459
4477
|
* @param {Element} element
|
4460
4478
|
* @param {Function} callback
|
4461
4479
|
* @return {Element}
|
4462
4480
|
*/
|
4481
|
+
|
4463
4482
|
function closestCallback(element, callback) {
|
4464
4483
|
while (element) {
|
4465
4484
|
if (callback(element)) return element;
|
@@ -4467,30 +4486,166 @@
|
|
4467
4486
|
}
|
4468
4487
|
}
|
4469
4488
|
|
4470
|
-
|
4489
|
+
/**
|
4490
|
+
* Determines if a value is a plain object
|
4491
|
+
* @param {any} value
|
4492
|
+
* @return {Boolean}
|
4493
|
+
*/
|
4494
|
+
|
4495
|
+
function isPlainObject$1(value) {
|
4496
|
+
return {}.toString.call(value) === '[object Object]';
|
4497
|
+
}
|
4498
|
+
/**
|
4499
|
+
* Safe .hasOwnProperty check, for prototype-less objects
|
4500
|
+
* @param {Object} obj
|
4501
|
+
* @param {String} key
|
4502
|
+
* @return {Boolean}
|
4503
|
+
*/
|
4504
|
+
|
4505
|
+
function hasOwnProperty$8(obj, key) {
|
4506
|
+
return {}.hasOwnProperty.call(obj, key);
|
4507
|
+
}
|
4508
|
+
/**
|
4509
|
+
* Returns an array of elements based on the value
|
4510
|
+
* @param {any} value
|
4511
|
+
* @return {Array}
|
4512
|
+
*/
|
4513
|
+
|
4514
|
+
function getArrayOfElements(value) {
|
4515
|
+
if (isSingular(value)) {
|
4516
|
+
return [value];
|
4517
|
+
}
|
4518
|
+
|
4519
|
+
if (value instanceof NodeList) {
|
4520
|
+
return arrayFrom(value);
|
4521
|
+
}
|
4522
|
+
|
4523
|
+
if (Array.isArray(value)) {
|
4524
|
+
return value;
|
4525
|
+
}
|
4526
|
+
|
4527
|
+
try {
|
4528
|
+
return arrayFrom(document.querySelectorAll(value));
|
4529
|
+
} catch (e) {
|
4530
|
+
return [];
|
4531
|
+
}
|
4532
|
+
}
|
4533
|
+
/**
|
4534
|
+
* Returns a value at a given index depending on if it's an array or number
|
4535
|
+
* @param {any} value
|
4536
|
+
* @param {Number} index
|
4537
|
+
* @param {any} defaultValue
|
4538
|
+
*/
|
4539
|
+
|
4540
|
+
function getValue$1(value, index, defaultValue) {
|
4541
|
+
if (Array.isArray(value)) {
|
4542
|
+
var v = value[index];
|
4543
|
+
return v == null ? defaultValue : v;
|
4544
|
+
}
|
4545
|
+
|
4546
|
+
return value;
|
4547
|
+
}
|
4548
|
+
/**
|
4549
|
+
* Debounce utility
|
4550
|
+
* @param {Function} fn
|
4551
|
+
* @param {Number} ms
|
4552
|
+
*/
|
4553
|
+
|
4554
|
+
function debounce$1(fn, ms) {
|
4555
|
+
var timeoutId;
|
4556
|
+
return function () {
|
4557
|
+
var _this = this,
|
4558
|
+
_arguments = arguments;
|
4559
|
+
|
4560
|
+
clearTimeout(timeoutId);
|
4561
|
+
timeoutId = setTimeout(function () {
|
4562
|
+
return fn.apply(_this, _arguments);
|
4563
|
+
}, ms);
|
4564
|
+
};
|
4565
|
+
}
|
4566
|
+
/**
|
4567
|
+
* Prevents errors from being thrown while accessing nested modifier objects
|
4568
|
+
* in `popperOptions`
|
4569
|
+
* @param {Object} obj
|
4570
|
+
* @param {String} key
|
4571
|
+
* @return {Object|undefined}
|
4572
|
+
*/
|
4573
|
+
|
4574
|
+
function getModifier(obj, key) {
|
4575
|
+
return obj && obj.modifiers && obj.modifiers[key];
|
4576
|
+
}
|
4577
|
+
/**
|
4578
|
+
* Determines if an array or string includes a value
|
4579
|
+
* @param {Array|String} a
|
4580
|
+
* @param {any} b
|
4581
|
+
* @return {Boolean}
|
4582
|
+
*/
|
4583
|
+
|
4584
|
+
function includes(a, b) {
|
4585
|
+
return a.indexOf(b) > -1;
|
4586
|
+
}
|
4587
|
+
/**
|
4588
|
+
* Determines if the value is singular-like
|
4589
|
+
* @param {any} value
|
4590
|
+
* @return {Boolean}
|
4591
|
+
*/
|
4592
|
+
|
4593
|
+
function isSingular(value) {
|
4594
|
+
return isPlainObject$1(value) || value instanceof Element;
|
4595
|
+
}
|
4596
|
+
/**
|
4597
|
+
* Tricking bundlers, linters, and minifiers
|
4598
|
+
* @return {String}
|
4599
|
+
*/
|
4600
|
+
|
4601
|
+
function innerHTML() {
|
4602
|
+
return 'innerHTML';
|
4603
|
+
}
|
4604
|
+
/**
|
4605
|
+
* Evaluates a function if one, or returns the value
|
4606
|
+
* @param {any} value
|
4607
|
+
* @param {any[]} args
|
4608
|
+
* @return {Boolean}
|
4609
|
+
*/
|
4610
|
+
|
4611
|
+
function evaluateValue(value, args) {
|
4612
|
+
return typeof value === 'function' ? value.apply(null, args) : value;
|
4613
|
+
}
|
4614
|
+
/**
|
4615
|
+
* Sets a popperInstance `flip` modifier's enabled state
|
4616
|
+
* @param {Object[]} modifiers
|
4617
|
+
* @param {any} value
|
4618
|
+
*/
|
4619
|
+
|
4620
|
+
function setFlipModifierEnabled(modifiers, value) {
|
4621
|
+
modifiers.filter(function (m) {
|
4622
|
+
return m.name === 'flip';
|
4623
|
+
})[0].enabled = value;
|
4624
|
+
}
|
4471
4625
|
|
4472
4626
|
/**
|
4473
4627
|
* Returns a new `div` element
|
4474
4628
|
* @return {HTMLDivElement}
|
4475
4629
|
*/
|
4630
|
+
|
4476
4631
|
function div() {
|
4477
4632
|
return document.createElement('div');
|
4478
4633
|
}
|
4479
|
-
|
4480
4634
|
/**
|
4481
4635
|
* Sets the innerHTML of an element while tricking linters & minifiers
|
4482
4636
|
* @param {HTMLElement} el
|
4483
4637
|
* @param {Element|String} html
|
4484
4638
|
*/
|
4639
|
+
|
4485
4640
|
function setInnerHTML(el, html) {
|
4486
|
-
el[
|
4641
|
+
el[innerHTML()] = html instanceof Element ? html[innerHTML()] : html;
|
4487
4642
|
}
|
4488
|
-
|
4489
4643
|
/**
|
4490
4644
|
* Sets the content of a tooltip
|
4491
4645
|
* @param {HTMLElement} contentEl
|
4492
4646
|
* @param {Object} props
|
4493
4647
|
*/
|
4648
|
+
|
4494
4649
|
function setContent(contentEl, props) {
|
4495
4650
|
if (props.content instanceof Element) {
|
4496
4651
|
setInnerHTML(contentEl, '');
|
@@ -4499,11 +4654,11 @@
|
|
4499
4654
|
contentEl[props.allowHTML ? 'innerHTML' : 'textContent'] = props.content;
|
4500
4655
|
}
|
4501
4656
|
}
|
4502
|
-
|
4503
4657
|
/**
|
4504
4658
|
* Returns the child elements of a popper element
|
4505
4659
|
* @param {HTMLElement} popper
|
4506
4660
|
*/
|
4661
|
+
|
4507
4662
|
function getChildren(popper) {
|
4508
4663
|
return {
|
4509
4664
|
tooltip: popper.querySelector(Selectors.TOOLTIP),
|
@@ -4512,105 +4667,107 @@
|
|
4512
4667
|
arrow: popper.querySelector(Selectors.ARROW) || popper.querySelector(Selectors.ROUND_ARROW)
|
4513
4668
|
};
|
4514
4669
|
}
|
4515
|
-
|
4516
4670
|
/**
|
4517
4671
|
* Adds `data-inertia` attribute
|
4518
4672
|
* @param {HTMLElement} tooltip
|
4519
4673
|
*/
|
4674
|
+
|
4520
4675
|
function addInertia(tooltip) {
|
4521
4676
|
tooltip.setAttribute('data-inertia', '');
|
4522
4677
|
}
|
4523
|
-
|
4524
4678
|
/**
|
4525
4679
|
* Removes `data-inertia` attribute
|
4526
4680
|
* @param {HTMLElement} tooltip
|
4527
4681
|
*/
|
4682
|
+
|
4528
4683
|
function removeInertia(tooltip) {
|
4529
4684
|
tooltip.removeAttribute('data-inertia');
|
4530
4685
|
}
|
4531
|
-
|
4532
4686
|
/**
|
4533
4687
|
* Creates an arrow element and returns it
|
4534
4688
|
*/
|
4689
|
+
|
4535
4690
|
function createArrowElement(arrowType) {
|
4536
4691
|
var arrow = div();
|
4692
|
+
|
4537
4693
|
if (arrowType === 'round') {
|
4538
4694
|
arrow.className = 'tippy-roundarrow';
|
4539
4695
|
setInnerHTML(arrow, '<svg viewBox="0 0 24 8" xmlns="http://www.w3.org/2000/svg"><path d="M3 8s2.021-.015 5.253-4.218C9.584 2.051 10.797 1.007 12 1c1.203-.007 2.416 1.035 3.761 2.782C19.012 8.005 21 8 21 8H3z"/></svg>');
|
4540
4696
|
} else {
|
4541
4697
|
arrow.className = 'tippy-arrow';
|
4542
4698
|
}
|
4699
|
+
|
4543
4700
|
return arrow;
|
4544
4701
|
}
|
4545
|
-
|
4546
4702
|
/**
|
4547
4703
|
* Creates a backdrop element and returns it
|
4548
4704
|
*/
|
4705
|
+
|
4549
4706
|
function createBackdropElement() {
|
4550
4707
|
var backdrop = div();
|
4551
4708
|
backdrop.className = 'tippy-backdrop';
|
4552
4709
|
backdrop.setAttribute('data-state', 'hidden');
|
4553
4710
|
return backdrop;
|
4554
4711
|
}
|
4555
|
-
|
4556
4712
|
/**
|
4557
4713
|
* Adds interactive-related attributes
|
4558
4714
|
* @param {HTMLElement} popper
|
4559
4715
|
* @param {HTMLElement} tooltip
|
4560
4716
|
*/
|
4717
|
+
|
4561
4718
|
function addInteractive(popper, tooltip) {
|
4562
4719
|
popper.setAttribute('tabindex', '-1');
|
4563
4720
|
tooltip.setAttribute('data-interactive', '');
|
4564
4721
|
}
|
4565
|
-
|
4566
4722
|
/**
|
4567
4723
|
* Removes interactive-related attributes
|
4568
4724
|
* @param {HTMLElement} popper
|
4569
4725
|
* @param {HTMLElement} tooltip
|
4570
4726
|
*/
|
4727
|
+
|
4571
4728
|
function removeInteractive(popper, tooltip) {
|
4572
4729
|
popper.removeAttribute('tabindex');
|
4573
4730
|
tooltip.removeAttribute('data-interactive');
|
4574
4731
|
}
|
4575
|
-
|
4576
4732
|
/**
|
4577
4733
|
* Applies a transition duration to a list of elements
|
4578
4734
|
* @param {Array} els
|
4579
4735
|
* @param {Number} value
|
4580
4736
|
*/
|
4737
|
+
|
4581
4738
|
function applyTransitionDuration(els, value) {
|
4582
4739
|
els.forEach(function (el) {
|
4583
4740
|
if (el) {
|
4584
|
-
el.style.transitionDuration = value
|
4741
|
+
el.style.transitionDuration = "".concat(value, "ms");
|
4585
4742
|
}
|
4586
4743
|
});
|
4587
4744
|
}
|
4588
|
-
|
4589
4745
|
/**
|
4590
4746
|
* Add/remove transitionend listener from tooltip
|
4591
4747
|
* @param {Element} tooltip
|
4592
4748
|
* @param {String} action
|
4593
4749
|
* @param {Function} listener
|
4594
4750
|
*/
|
4751
|
+
|
4595
4752
|
function toggleTransitionEndListener(tooltip, action, listener) {
|
4596
4753
|
tooltip[action + 'EventListener']('transitionend', listener);
|
4597
4754
|
}
|
4598
|
-
|
4599
4755
|
/**
|
4600
4756
|
* Returns the popper's placement, ignoring shifting (top-start, etc)
|
4601
4757
|
* @param {Element} popper
|
4602
4758
|
* @return {String}
|
4603
4759
|
*/
|
4760
|
+
|
4604
4761
|
function getPopperPlacement(popper) {
|
4605
4762
|
var fullPlacement = popper.getAttribute('x-placement');
|
4606
4763
|
return fullPlacement ? fullPlacement.split('-')[0] : '';
|
4607
4764
|
}
|
4608
|
-
|
4609
4765
|
/**
|
4610
4766
|
* Sets the visibility state to elements so they can begin to transition
|
4611
4767
|
* @param {Array} els
|
4612
4768
|
* @param {String} state
|
4613
4769
|
*/
|
4770
|
+
|
4614
4771
|
function setVisibilityState(els, state) {
|
4615
4772
|
els.forEach(function (el) {
|
4616
4773
|
if (el) {
|
@@ -4618,37 +4775,49 @@
|
|
4618
4775
|
}
|
4619
4776
|
});
|
4620
4777
|
}
|
4621
|
-
|
4622
4778
|
/**
|
4623
4779
|
* Triggers reflow
|
4624
4780
|
* @param {Element} popper
|
4625
4781
|
*/
|
4782
|
+
|
4626
4783
|
function reflow(popper) {
|
4627
4784
|
void popper.offsetHeight;
|
4628
4785
|
}
|
4786
|
+
/**
|
4787
|
+
* Adds/removes theme from tooltip's classList
|
4788
|
+
* @param {HTMLDivElement} tooltip
|
4789
|
+
* @param {String} action
|
4790
|
+
* @param {String} theme
|
4791
|
+
*/
|
4629
4792
|
|
4793
|
+
function toggleTheme(tooltip, action, theme) {
|
4794
|
+
theme.split(' ').forEach(function (themeName) {
|
4795
|
+
tooltip.classList[action](themeName + '-theme');
|
4796
|
+
});
|
4797
|
+
}
|
4630
4798
|
/**
|
4631
4799
|
* Constructs the popper element and returns it
|
4632
4800
|
* @param {Number} id
|
4633
4801
|
* @param {Object} props
|
4634
4802
|
*/
|
4803
|
+
|
4635
4804
|
function createPopperElement(id, props) {
|
4636
4805
|
var popper = div();
|
4637
4806
|
popper.className = 'tippy-popper';
|
4638
|
-
popper.
|
4639
|
-
popper.id = 'tippy-' + id;
|
4807
|
+
popper.id = "tippy-".concat(id);
|
4640
4808
|
popper.style.zIndex = props.zIndex;
|
4641
4809
|
|
4810
|
+
if (props.role) {
|
4811
|
+
popper.setAttribute('role', props.role);
|
4812
|
+
}
|
4813
|
+
|
4642
4814
|
var tooltip = div();
|
4643
4815
|
tooltip.className = 'tippy-tooltip';
|
4644
4816
|
tooltip.style.maxWidth = props.maxWidth + (typeof props.maxWidth === 'number' ? 'px' : '');
|
4645
4817
|
tooltip.setAttribute('data-size', props.size);
|
4646
4818
|
tooltip.setAttribute('data-animation', props.animation);
|
4647
4819
|
tooltip.setAttribute('data-state', 'hidden');
|
4648
|
-
|
4649
|
-
tooltip.classList.add(t + '-theme');
|
4650
|
-
});
|
4651
|
-
|
4820
|
+
toggleTheme(tooltip, 'add', props.theme);
|
4652
4821
|
var content = div();
|
4653
4822
|
content.className = 'tippy-content';
|
4654
4823
|
content.setAttribute('data-state', 'hidden');
|
@@ -4671,27 +4840,17 @@
|
|
4671
4840
|
}
|
4672
4841
|
|
4673
4842
|
setContent(content, props);
|
4674
|
-
|
4675
4843
|
tooltip.appendChild(content);
|
4676
4844
|
popper.appendChild(tooltip);
|
4677
|
-
|
4678
|
-
popper.addEventListener('focusout', function (e) {
|
4679
|
-
if (e.relatedTarget && popper._tippy && !closestCallback(e.relatedTarget, function (el) {
|
4680
|
-
return el === popper;
|
4681
|
-
}) && e.relatedTarget !== popper._tippy.reference && popper._tippy.props.shouldPopperHideOnBlur(e)) {
|
4682
|
-
popper._tippy.hide();
|
4683
|
-
}
|
4684
|
-
});
|
4685
|
-
|
4686
4845
|
return popper;
|
4687
4846
|
}
|
4688
|
-
|
4689
4847
|
/**
|
4690
4848
|
* Updates the popper element based on the new props
|
4691
4849
|
* @param {HTMLElement} popper
|
4692
4850
|
* @param {Object} prevProps
|
4693
4851
|
* @param {Object} nextProps
|
4694
4852
|
*/
|
4853
|
+
|
4695
4854
|
function updatePopperElement(popper, prevProps, nextProps) {
|
4696
4855
|
var _getChildren = getChildren(popper),
|
4697
4856
|
tooltip = _getChildren.tooltip,
|
@@ -4704,56 +4863,57 @@
|
|
4704
4863
|
tooltip.setAttribute('data-animation', nextProps.animation);
|
4705
4864
|
tooltip.style.maxWidth = nextProps.maxWidth + (typeof nextProps.maxWidth === 'number' ? 'px' : '');
|
4706
4865
|
|
4866
|
+
if (nextProps.role) {
|
4867
|
+
popper.setAttribute('role', nextProps.role);
|
4868
|
+
} else {
|
4869
|
+
popper.removeAttribute('role');
|
4870
|
+
}
|
4871
|
+
|
4707
4872
|
if (prevProps.content !== nextProps.content) {
|
4708
4873
|
setContent(content, nextProps);
|
4709
|
-
}
|
4874
|
+
} // animateFill
|
4875
|
+
|
4710
4876
|
|
4711
|
-
// animateFill
|
4712
4877
|
if (!prevProps.animateFill && nextProps.animateFill) {
|
4713
4878
|
tooltip.appendChild(createBackdropElement());
|
4714
4879
|
tooltip.setAttribute('data-animatefill', '');
|
4715
4880
|
} else if (prevProps.animateFill && !nextProps.animateFill) {
|
4716
4881
|
tooltip.removeChild(backdrop);
|
4717
4882
|
tooltip.removeAttribute('data-animatefill');
|
4718
|
-
}
|
4883
|
+
} // arrow
|
4884
|
+
|
4719
4885
|
|
4720
|
-
// arrow
|
4721
4886
|
if (!prevProps.arrow && nextProps.arrow) {
|
4722
4887
|
tooltip.appendChild(createArrowElement(nextProps.arrowType));
|
4723
4888
|
} else if (prevProps.arrow && !nextProps.arrow) {
|
4724
4889
|
tooltip.removeChild(arrow);
|
4725
|
-
}
|
4890
|
+
} // arrowType
|
4891
|
+
|
4726
4892
|
|
4727
|
-
// arrowType
|
4728
4893
|
if (prevProps.arrow && nextProps.arrow && prevProps.arrowType !== nextProps.arrowType) {
|
4729
4894
|
tooltip.replaceChild(createArrowElement(nextProps.arrowType), arrow);
|
4730
|
-
}
|
4895
|
+
} // interactive
|
4896
|
+
|
4731
4897
|
|
4732
|
-
// interactive
|
4733
4898
|
if (!prevProps.interactive && nextProps.interactive) {
|
4734
4899
|
addInteractive(popper, tooltip);
|
4735
4900
|
} else if (prevProps.interactive && !nextProps.interactive) {
|
4736
4901
|
removeInteractive(popper, tooltip);
|
4737
|
-
}
|
4902
|
+
} // inertia
|
4903
|
+
|
4738
4904
|
|
4739
|
-
// inertia
|
4740
4905
|
if (!prevProps.inertia && nextProps.inertia) {
|
4741
4906
|
addInertia(tooltip);
|
4742
4907
|
} else if (prevProps.inertia && !nextProps.inertia) {
|
4743
4908
|
removeInertia(tooltip);
|
4744
|
-
}
|
4909
|
+
} // theme
|
4910
|
+
|
4745
4911
|
|
4746
|
-
// theme
|
4747
4912
|
if (prevProps.theme !== nextProps.theme) {
|
4748
|
-
|
4749
|
-
|
4750
|
-
});
|
4751
|
-
nextProps.theme.split(' ').forEach(function (theme) {
|
4752
|
-
tooltip.classList.add(theme + '-theme');
|
4753
|
-
});
|
4913
|
+
toggleTheme(tooltip, 'remove', prevProps.theme);
|
4914
|
+
toggleTheme(tooltip, 'add', nextProps.theme);
|
4754
4915
|
}
|
4755
4916
|
}
|
4756
|
-
|
4757
4917
|
/**
|
4758
4918
|
* Runs the callback after the popper's position has been updated
|
4759
4919
|
* update() is debounced with Promise.resolve() or setTimeout()
|
@@ -4761,13 +4921,13 @@
|
|
4761
4921
|
* @param {Popper} popperInstance
|
4762
4922
|
* @param {Function} callback
|
4763
4923
|
*/
|
4924
|
+
|
4764
4925
|
function afterPopperPositionUpdates(popperInstance, callback) {
|
4765
4926
|
var popper = popperInstance.popper,
|
4766
4927
|
options = popperInstance.options;
|
4767
4928
|
var onCreate = options.onCreate,
|
4768
4929
|
onUpdate = options.onUpdate;
|
4769
4930
|
|
4770
|
-
|
4771
4931
|
options.onCreate = options.onUpdate = function () {
|
4772
4932
|
reflow(popper);
|
4773
4933
|
callback();
|
@@ -4776,20 +4936,25 @@
|
|
4776
4936
|
options.onUpdate = onUpdate;
|
4777
4937
|
};
|
4778
4938
|
}
|
4779
|
-
|
4780
4939
|
/**
|
4781
|
-
* Hides all visible poppers on the document
|
4782
|
-
* @param {
|
4940
|
+
* Hides all visible poppers on the document
|
4941
|
+
* @param {Object} options
|
4783
4942
|
*/
|
4784
|
-
|
4943
|
+
|
4944
|
+
function hideAll() {
|
4945
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
4946
|
+
checkHideOnClick = _ref.checkHideOnClick,
|
4947
|
+
exclude = _ref.exclude,
|
4948
|
+
duration = _ref.duration;
|
4949
|
+
|
4785
4950
|
arrayFrom(document.querySelectorAll(Selectors.POPPER)).forEach(function (popper) {
|
4786
|
-
var
|
4787
|
-
|
4788
|
-
|
4951
|
+
var instance = popper._tippy;
|
4952
|
+
|
4953
|
+
if (instance && (checkHideOnClick ? instance.props.hideOnClick === true : true) && (!exclude || popper !== exclude.popper)) {
|
4954
|
+
instance.hide(duration);
|
4789
4955
|
}
|
4790
4956
|
});
|
4791
4957
|
}
|
4792
|
-
|
4793
4958
|
/**
|
4794
4959
|
* Determines if the mouse cursor is outside of the popper's interactive border
|
4795
4960
|
* region
|
@@ -4798,6 +4963,7 @@
|
|
4798
4963
|
* @param {MouseEvent} event
|
4799
4964
|
* @param {Object} props
|
4800
4965
|
*/
|
4966
|
+
|
4801
4967
|
function isCursorOutsideInteractiveBorder(popperPlacement, popperRect, event, props) {
|
4802
4968
|
if (!popperPlacement) {
|
4803
4969
|
return true;
|
@@ -4807,155 +4973,29 @@
|
|
4807
4973
|
y = event.clientY;
|
4808
4974
|
var interactiveBorder = props.interactiveBorder,
|
4809
4975
|
distance = props.distance;
|
4810
|
-
|
4811
|
-
|
4812
4976
|
var exceedsTop = popperRect.top - y > (popperPlacement === 'top' ? interactiveBorder + distance : interactiveBorder);
|
4813
|
-
|
4814
4977
|
var exceedsBottom = y - popperRect.bottom > (popperPlacement === 'bottom' ? interactiveBorder + distance : interactiveBorder);
|
4815
|
-
|
4816
4978
|
var exceedsLeft = popperRect.left - x > (popperPlacement === 'left' ? interactiveBorder + distance : interactiveBorder);
|
4817
|
-
|
4818
4979
|
var exceedsRight = x - popperRect.right > (popperPlacement === 'right' ? interactiveBorder + distance : interactiveBorder);
|
4819
|
-
|
4820
4980
|
return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
|
4821
4981
|
}
|
4822
|
-
|
4823
4982
|
/**
|
4824
4983
|
* Returns the distance offset, taking into account the default offset due to
|
4825
4984
|
* the transform: translate() rule in CSS
|
4826
4985
|
* @param {Number} distance
|
4827
4986
|
* @param {Number} defaultDistance
|
4828
4987
|
*/
|
4988
|
+
|
4829
4989
|
function getOffsetDistanceInPx(distance, defaultDistance) {
|
4830
4990
|
return -(distance - defaultDistance) + 'px';
|
4831
4991
|
}
|
4832
4992
|
|
4833
|
-
|
4834
|
-
|
4835
|
-
|
4836
|
-
|
4837
|
-
*/
|
4838
|
-
function isPlainObject$1(value) {
|
4839
|
-
return {}.toString.call(value) === '[object Object]';
|
4840
|
-
}
|
4841
|
-
|
4842
|
-
/**
|
4843
|
-
* Safe .hasOwnProperty check, for prototype-less objects
|
4844
|
-
* @param {Object} obj
|
4845
|
-
* @param {String} key
|
4846
|
-
* @return {Boolean}
|
4847
|
-
*/
|
4848
|
-
function hasOwnProperty$8(obj, key) {
|
4849
|
-
return {}.hasOwnProperty.call(obj, key);
|
4850
|
-
}
|
4851
|
-
|
4852
|
-
/**
|
4853
|
-
* Determines if a value is numeric
|
4854
|
-
* @param {any} value
|
4855
|
-
* @return {Boolean}
|
4856
|
-
*/
|
4857
|
-
function isNumeric$1(value) {
|
4858
|
-
return !isNaN(value) && !isNaN(parseFloat(value));
|
4859
|
-
}
|
4860
|
-
|
4861
|
-
/**
|
4862
|
-
* Returns an array of elements based on the value
|
4863
|
-
* @param {any} value
|
4864
|
-
* @return {Array}
|
4865
|
-
*/
|
4866
|
-
function getArrayOfElements(value) {
|
4867
|
-
if (value instanceof Element || isPlainObject$1(value)) {
|
4868
|
-
return [value];
|
4869
|
-
}
|
4870
|
-
if (value instanceof NodeList) {
|
4871
|
-
return arrayFrom(value);
|
4872
|
-
}
|
4873
|
-
if (Array.isArray(value)) {
|
4874
|
-
return value;
|
4875
|
-
}
|
4876
|
-
|
4877
|
-
try {
|
4878
|
-
return arrayFrom(document.querySelectorAll(value));
|
4879
|
-
} catch (e) {
|
4880
|
-
return [];
|
4881
|
-
}
|
4882
|
-
}
|
4883
|
-
|
4884
|
-
/**
|
4885
|
-
* Returns a value at a given index depending on if it's an array or number
|
4886
|
-
* @param {any} value
|
4887
|
-
* @param {Number} index
|
4888
|
-
* @param {any} defaultValue
|
4889
|
-
*/
|
4890
|
-
function getValue$1(value, index, defaultValue) {
|
4891
|
-
if (Array.isArray(value)) {
|
4892
|
-
var v = value[index];
|
4893
|
-
return v == null ? defaultValue : v;
|
4894
|
-
}
|
4895
|
-
return value;
|
4896
|
-
}
|
4897
|
-
|
4898
|
-
/**
|
4899
|
-
* Focuses an element while preventing a scroll jump if it's not within the
|
4900
|
-
* viewport
|
4901
|
-
* @param {Element} el
|
4902
|
-
*/
|
4903
|
-
function focus(el) {
|
4904
|
-
var x = window.scrollX || window.pageXOffset;
|
4905
|
-
var y = window.scrollY || window.pageYOffset;
|
4906
|
-
el.focus();
|
4907
|
-
scroll(x, y);
|
4908
|
-
}
|
4909
|
-
|
4910
|
-
/**
|
4911
|
-
* Defers a function's execution until the call stack has cleared
|
4912
|
-
* @param {Function} fn
|
4913
|
-
*/
|
4914
|
-
function defer(fn) {
|
4915
|
-
setTimeout(fn, 1);
|
4916
|
-
}
|
4917
|
-
|
4918
|
-
/**
|
4919
|
-
* Debounce utility
|
4920
|
-
* @param {Function} fn
|
4921
|
-
* @param {Number} ms
|
4922
|
-
*/
|
4923
|
-
function debounce$1(fn, ms) {
|
4924
|
-
var timeoutId = void 0;
|
4925
|
-
return function () {
|
4926
|
-
var _this = this,
|
4927
|
-
_arguments = arguments;
|
4928
|
-
|
4929
|
-
clearTimeout(timeoutId);
|
4930
|
-
timeoutId = setTimeout(function () {
|
4931
|
-
return fn.apply(_this, _arguments);
|
4932
|
-
}, ms);
|
4933
|
-
};
|
4934
|
-
}
|
4935
|
-
|
4936
|
-
/**
|
4937
|
-
* Prevents errors from being thrown while accessing nested modifier objects
|
4938
|
-
* in `popperOptions`
|
4939
|
-
* @param {Object} obj
|
4940
|
-
* @param {String} key
|
4941
|
-
* @return {Object|undefined}
|
4942
|
-
*/
|
4943
|
-
function getModifier(obj, key) {
|
4944
|
-
return obj && obj.modifiers && obj.modifiers[key];
|
4945
|
-
}
|
4946
|
-
|
4947
|
-
/**
|
4948
|
-
* Determines if an array or string includes a value
|
4949
|
-
* @param {Array|String} a
|
4950
|
-
* @param {any} b
|
4951
|
-
* @return {Boolean}
|
4952
|
-
*/
|
4953
|
-
function includes(a, b) {
|
4954
|
-
return a.indexOf(b) > -1;
|
4955
|
-
}
|
4993
|
+
var PASSIVE = {
|
4994
|
+
passive: true
|
4995
|
+
};
|
4996
|
+
var PADDING = 3;
|
4956
4997
|
|
4957
4998
|
var isUsingTouch = false;
|
4958
|
-
|
4959
4999
|
function onDocumentTouch() {
|
4960
5000
|
if (isUsingTouch) {
|
4961
5001
|
return;
|
@@ -4971,15 +5011,14 @@
|
|
4971
5011
|
document.addEventListener('mousemove', onDocumentMouseMove);
|
4972
5012
|
}
|
4973
5013
|
}
|
4974
|
-
|
4975
5014
|
var lastMouseMoveTime = 0;
|
4976
5015
|
function onDocumentMouseMove() {
|
4977
|
-
var now = performance.now();
|
5016
|
+
var now = performance.now(); // Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference
|
4978
5017
|
|
4979
|
-
// Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference
|
4980
5018
|
if (now - lastMouseMoveTime < 20) {
|
4981
5019
|
isUsingTouch = false;
|
4982
5020
|
document.removeEventListener('mousemove', onDocumentMouseMove);
|
5021
|
+
|
4983
5022
|
if (!isIOS) {
|
4984
5023
|
document.body.classList.remove('tippy-iOS');
|
4985
5024
|
}
|
@@ -4987,43 +5026,48 @@
|
|
4987
5026
|
|
4988
5027
|
lastMouseMoveTime = now;
|
4989
5028
|
}
|
4990
|
-
|
4991
5029
|
function onDocumentClick(_ref) {
|
4992
5030
|
var target = _ref.target;
|
4993
5031
|
|
4994
5032
|
// Simulated events dispatched on the document
|
4995
5033
|
if (!(target instanceof Element)) {
|
4996
|
-
return
|
4997
|
-
}
|
5034
|
+
return hideAll();
|
5035
|
+
} // Clicked on an interactive popper
|
5036
|
+
|
4998
5037
|
|
4999
|
-
// Clicked on an interactive popper
|
5000
5038
|
var popper = closest(target, Selectors.POPPER);
|
5039
|
+
|
5001
5040
|
if (popper && popper._tippy && popper._tippy.props.interactive) {
|
5002
5041
|
return;
|
5003
|
-
}
|
5042
|
+
} // Clicked on a reference
|
5043
|
+
|
5004
5044
|
|
5005
|
-
// Clicked on a reference
|
5006
5045
|
var reference = closestCallback(target, function (el) {
|
5007
5046
|
return el._tippy && el._tippy.reference === el;
|
5008
5047
|
});
|
5048
|
+
|
5009
5049
|
if (reference) {
|
5010
|
-
var
|
5011
|
-
var isClickTrigger = includes(
|
5050
|
+
var instance = reference._tippy;
|
5051
|
+
var isClickTrigger = includes(instance.props.trigger, 'click');
|
5012
5052
|
|
5013
5053
|
if (isUsingTouch || isClickTrigger) {
|
5014
|
-
return
|
5054
|
+
return hideAll({
|
5055
|
+
exclude: instance,
|
5056
|
+
checkHideOnClick: true
|
5057
|
+
});
|
5015
5058
|
}
|
5016
5059
|
|
5017
|
-
if (
|
5060
|
+
if (instance.props.hideOnClick !== true || isClickTrigger) {
|
5018
5061
|
return;
|
5019
5062
|
}
|
5020
5063
|
|
5021
|
-
|
5064
|
+
instance.clearDelayTimeouts();
|
5022
5065
|
}
|
5023
5066
|
|
5024
|
-
|
5067
|
+
hideAll({
|
5068
|
+
checkHideOnClick: true
|
5069
|
+
});
|
5025
5070
|
}
|
5026
|
-
|
5027
5071
|
function onWindowBlur() {
|
5028
5072
|
var _document = document,
|
5029
5073
|
activeElement = _document.activeElement;
|
@@ -5032,49 +5076,35 @@
|
|
5032
5076
|
activeElement.blur();
|
5033
5077
|
}
|
5034
5078
|
}
|
5035
|
-
|
5036
|
-
function onWindowResize() {
|
5037
|
-
arrayFrom(document.querySelectorAll(Selectors.POPPER)).forEach(function (popper) {
|
5038
|
-
var tippyInstance = popper._tippy;
|
5039
|
-
if (!tippyInstance.props.livePlacement) {
|
5040
|
-
tippyInstance.popperInstance.scheduleUpdate();
|
5041
|
-
}
|
5042
|
-
});
|
5043
|
-
}
|
5044
|
-
|
5045
5079
|
/**
|
5046
5080
|
* Adds the needed global event listeners
|
5047
5081
|
*/
|
5082
|
+
|
5048
5083
|
function bindGlobalEventListeners() {
|
5049
5084
|
document.addEventListener('click', onDocumentClick, true);
|
5050
5085
|
document.addEventListener('touchstart', onDocumentTouch, PASSIVE);
|
5051
5086
|
window.addEventListener('blur', onWindowBlur);
|
5052
|
-
window.addEventListener('resize', onWindowResize);
|
5053
|
-
|
5054
|
-
if (!supportsTouch && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)) {
|
5055
|
-
document.addEventListener('pointerdown', onDocumentTouch);
|
5056
|
-
}
|
5057
5087
|
}
|
5058
5088
|
|
5059
5089
|
var keys$1 = Object.keys(Defaults$1);
|
5060
|
-
|
5061
5090
|
/**
|
5062
5091
|
* Determines if an element can receive focus
|
5063
5092
|
* @param {Element} el
|
5064
5093
|
* @return {Boolean}
|
5065
5094
|
*/
|
5095
|
+
|
5066
5096
|
function canReceiveFocus(el) {
|
5067
5097
|
return el instanceof Element ? matches.call(el, 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]') && !el.hasAttribute('disabled') : true;
|
5068
5098
|
}
|
5069
|
-
|
5070
5099
|
/**
|
5071
5100
|
* Returns an object of optional props from data-tippy-* attributes
|
5072
5101
|
* @param {Element} reference
|
5073
5102
|
* @return {Object}
|
5074
5103
|
*/
|
5104
|
+
|
5075
5105
|
function getDataAttributeOptions(reference) {
|
5076
5106
|
return keys$1.reduce(function (acc, key) {
|
5077
|
-
var valueAsString = (reference.getAttribute(
|
5107
|
+
var valueAsString = (reference.getAttribute("data-tippy-".concat(key)) || '').trim();
|
5078
5108
|
|
5079
5109
|
if (!valueAsString) {
|
5080
5110
|
return acc;
|
@@ -5082,28 +5112,24 @@
|
|
5082
5112
|
|
5083
5113
|
if (key === 'content') {
|
5084
5114
|
acc[key] = valueAsString;
|
5085
|
-
} else if (valueAsString === 'true') {
|
5086
|
-
acc[key] = true;
|
5087
|
-
} else if (valueAsString === 'false') {
|
5088
|
-
acc[key] = false;
|
5089
|
-
} else if (isNumeric$1(valueAsString)) {
|
5090
|
-
acc[key] = Number(valueAsString);
|
5091
|
-
} else if (valueAsString[0] === '[' || valueAsString[0] === '{') {
|
5092
|
-
acc[key] = JSON.parse(valueAsString);
|
5093
5115
|
} else {
|
5094
|
-
|
5116
|
+
try {
|
5117
|
+
acc[key] = JSON.parse(valueAsString);
|
5118
|
+
} catch (e) {
|
5119
|
+
acc[key] = valueAsString;
|
5120
|
+
}
|
5095
5121
|
}
|
5096
5122
|
|
5097
5123
|
return acc;
|
5098
5124
|
}, {});
|
5099
5125
|
}
|
5100
|
-
|
5101
5126
|
/**
|
5102
5127
|
* Polyfills the virtual reference (plain object) with Element.prototype props
|
5103
5128
|
* Mutating because DOM elements are mutated, adds `_tippy` property
|
5104
5129
|
* @param {Object} virtualReference
|
5105
5130
|
* @return {Object}
|
5106
5131
|
*/
|
5132
|
+
|
5107
5133
|
function polyfillElementPrototypeProperties(virtualReference) {
|
5108
5134
|
var polyfills = {
|
5109
5135
|
isVirtual: true,
|
@@ -5122,7 +5148,6 @@
|
|
5122
5148
|
},
|
5123
5149
|
addEventListener: function addEventListener() {},
|
5124
5150
|
removeEventListener: function removeEventListener() {},
|
5125
|
-
|
5126
5151
|
classList: {
|
5127
5152
|
classNames: {},
|
5128
5153
|
add: function add(key) {
|
@@ -5142,161 +5167,42 @@
|
|
5142
5167
|
}
|
5143
5168
|
}
|
5144
5169
|
|
5145
|
-
var _extends$2 = Object.assign || function (target) {
|
5146
|
-
for (var i = 1; i < arguments.length; i++) {
|
5147
|
-
var source = arguments[i];
|
5148
|
-
|
5149
|
-
for (var key in source) {
|
5150
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
5151
|
-
target[key] = source[key];
|
5152
|
-
}
|
5153
|
-
}
|
5154
|
-
}
|
5155
|
-
|
5156
|
-
return target;
|
5157
|
-
};
|
5158
|
-
|
5159
5170
|
/**
|
5160
|
-
* Evaluates the props object
|
5171
|
+
* Evaluates the props object by merging data attributes and
|
5172
|
+
* disabling conflicting options where necessary
|
5161
5173
|
* @param {Element} reference
|
5162
5174
|
* @param {Object} props
|
5163
5175
|
* @return {Object}
|
5164
5176
|
*/
|
5177
|
+
|
5165
5178
|
function evaluateProps(reference, props) {
|
5166
|
-
var out = _extends$2({}, props,
|
5179
|
+
var out = _extends$2({}, props, {
|
5180
|
+
content: evaluateValue(props.content, [reference])
|
5181
|
+
}, props.ignoreAttributes ? {} : getDataAttributeOptions(reference));
|
5167
5182
|
|
5168
5183
|
if (out.arrow) {
|
5169
5184
|
out.animateFill = false;
|
5170
5185
|
}
|
5171
5186
|
|
5172
|
-
if (typeof out.appendTo === 'function') {
|
5173
|
-
out.appendTo = props.appendTo(reference);
|
5174
|
-
}
|
5175
|
-
|
5176
|
-
if (typeof out.content === 'function') {
|
5177
|
-
out.content = props.content(reference);
|
5178
|
-
}
|
5179
|
-
|
5180
5187
|
return out;
|
5181
5188
|
}
|
5182
|
-
|
5183
5189
|
/**
|
5184
5190
|
* Validates an object of options with the valid default props object
|
5185
5191
|
* @param {Object} options
|
5186
5192
|
* @param {Object} defaults
|
5187
5193
|
*/
|
5194
|
+
|
5188
5195
|
function validateOptions() {
|
5189
5196
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5190
|
-
var defaults
|
5191
|
-
|
5197
|
+
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
5192
5198
|
Object.keys(options).forEach(function (option) {
|
5193
|
-
if (!hasOwnProperty$8(defaults
|
5194
|
-
throw new Error(
|
5199
|
+
if (!hasOwnProperty$8(defaults, option)) {
|
5200
|
+
throw new Error("[tippy]: `".concat(option, "` is not a valid option"));
|
5195
5201
|
}
|
5196
5202
|
});
|
5197
5203
|
}
|
5198
5204
|
|
5199
|
-
// =============================================================================
|
5200
|
-
// DEPRECATED
|
5201
|
-
// All of this code (for the `arrowTransform` option) will be removed in v4
|
5202
|
-
// =============================================================================
|
5203
|
-
var TRANSFORM_NUMBER_RE = {
|
5204
|
-
translate: /translateX?Y?\(([^)]+)\)/,
|
5205
|
-
scale: /scaleX?Y?\(([^)]+)\)/
|
5206
|
-
|
5207
|
-
/**
|
5208
|
-
* Transforms the x/y axis based on the placement
|
5209
|
-
*/
|
5210
|
-
};function transformAxisBasedOnPlacement(axis, isVertical) {
|
5211
|
-
return (isVertical ? axis : {
|
5212
|
-
X: 'Y',
|
5213
|
-
Y: 'X'
|
5214
|
-
}[axis]) || '';
|
5215
|
-
}
|
5216
|
-
|
5217
|
-
/**
|
5218
|
-
* Transforms the scale/translate numbers based on the placement
|
5219
|
-
*/
|
5220
|
-
function transformNumbersBasedOnPlacement(type, numbers, isVertical, isReverse) {
|
5221
|
-
/**
|
5222
|
-
* Avoid destructuring because a large boilerplate function is generated
|
5223
|
-
* by Babel
|
5224
|
-
*/
|
5225
|
-
var a = numbers[0];
|
5226
|
-
var b = numbers[1];
|
5227
|
-
|
5228
|
-
if (!a && !b) {
|
5229
|
-
return '';
|
5230
|
-
}
|
5231
|
-
|
5232
|
-
var transforms = {
|
5233
|
-
scale: function () {
|
5234
|
-
if (!b) {
|
5235
|
-
return '' + a;
|
5236
|
-
} else {
|
5237
|
-
return isVertical ? a + ', ' + b : b + ', ' + a;
|
5238
|
-
}
|
5239
|
-
}(),
|
5240
|
-
translate: function () {
|
5241
|
-
if (!b) {
|
5242
|
-
return isReverse ? -a + 'px' : a + 'px';
|
5243
|
-
} else {
|
5244
|
-
if (isVertical) {
|
5245
|
-
return isReverse ? a + 'px, ' + -b + 'px' : a + 'px, ' + b + 'px';
|
5246
|
-
} else {
|
5247
|
-
return isReverse ? -b + 'px, ' + a + 'px' : b + 'px, ' + a + 'px';
|
5248
|
-
}
|
5249
|
-
}
|
5250
|
-
}()
|
5251
|
-
};
|
5252
|
-
|
5253
|
-
return transforms[type];
|
5254
|
-
}
|
5255
|
-
|
5256
|
-
/**
|
5257
|
-
* Returns the axis for a CSS function (translate or scale)
|
5258
|
-
*/
|
5259
|
-
function getTransformAxis(str, cssFunction) {
|
5260
|
-
var match = str.match(new RegExp(cssFunction + '([XY])'));
|
5261
|
-
return match ? match[1] : '';
|
5262
|
-
}
|
5263
|
-
|
5264
|
-
/**
|
5265
|
-
* Returns the numbers given to the CSS function
|
5266
|
-
*/
|
5267
|
-
function getTransformNumbers(str, regex) {
|
5268
|
-
var match = str.match(regex);
|
5269
|
-
return match ? match[1].split(',').map(function (n) {
|
5270
|
-
return parseFloat(n, 10);
|
5271
|
-
}) : [];
|
5272
|
-
}
|
5273
|
-
|
5274
|
-
/**
|
5275
|
-
* Computes the arrow's transform so that it is correct for any placement
|
5276
|
-
*/
|
5277
|
-
function computeArrowTransform(arrow, arrowTransform) {
|
5278
|
-
var placement = getPopperPlacement(closest(arrow, Selectors.POPPER));
|
5279
|
-
var isVertical = includes(['top', 'bottom'], placement);
|
5280
|
-
var isReverse = includes(['right', 'bottom'], placement);
|
5281
|
-
|
5282
|
-
var matches$$1 = {
|
5283
|
-
translate: {
|
5284
|
-
axis: getTransformAxis(arrowTransform, 'translate'),
|
5285
|
-
numbers: getTransformNumbers(arrowTransform, TRANSFORM_NUMBER_RE.translate)
|
5286
|
-
},
|
5287
|
-
scale: {
|
5288
|
-
axis: getTransformAxis(arrowTransform, 'scale'),
|
5289
|
-
numbers: getTransformNumbers(arrowTransform, TRANSFORM_NUMBER_RE.scale)
|
5290
|
-
}
|
5291
|
-
};
|
5292
|
-
|
5293
|
-
var computedTransform = arrowTransform.replace(TRANSFORM_NUMBER_RE.translate, 'translate' + transformAxisBasedOnPlacement(matches$$1.translate.axis, isVertical) + '(' + transformNumbersBasedOnPlacement('translate', matches$$1.translate.numbers, isVertical, isReverse) + ')').replace(TRANSFORM_NUMBER_RE.scale, 'scale' + transformAxisBasedOnPlacement(matches$$1.scale.axis, isVertical) + '(' + transformNumbersBasedOnPlacement('scale', matches$$1.scale.numbers, isVertical, isReverse) + ')');
|
5294
|
-
|
5295
|
-
arrow.style[typeof document.body.style.transform !== 'undefined' ? 'transform' : 'webkitTransform'] = computedTransform;
|
5296
|
-
}
|
5297
|
-
|
5298
5205
|
var idCounter = 1;
|
5299
|
-
|
5300
5206
|
/**
|
5301
5207
|
* Creates and returns a Tippy object. We're using a closure pattern instead of
|
5302
5208
|
* a class so that the exposed object API is clean without private members
|
@@ -5305,69 +5211,56 @@
|
|
5305
5211
|
* @param {Object} collectionProps
|
5306
5212
|
* @return {Object} instance
|
5307
5213
|
*/
|
5214
|
+
|
5308
5215
|
function createTippy(reference, collectionProps) {
|
5309
|
-
var props = evaluateProps(reference, collectionProps);
|
5216
|
+
var props = evaluateProps(reference, collectionProps); // If the reference shouldn't have multiple tippys, return null early
|
5310
5217
|
|
5311
|
-
// If the reference shouldn't have multiple tippys, return null early
|
5312
5218
|
if (!props.multiple && reference._tippy) {
|
5313
5219
|
return null;
|
5314
5220
|
}
|
5315
|
-
|
5316
5221
|
/* ======================= 🔒 Private members 🔒 ======================= */
|
5317
|
-
// The popper element's mutation observer
|
5318
|
-
var popperMutationObserver = null;
|
5319
|
-
|
5320
5222
|
// The last trigger event object that caused the tippy to show
|
5321
|
-
var lastTriggerEvent = {};
|
5322
5223
|
|
5323
|
-
// The last mousemove event object created by the document mousemove event
|
5324
|
-
var lastMouseMoveEvent = null;
|
5325
5224
|
|
5326
|
-
//
|
5327
|
-
|
5225
|
+
var lastTriggerEvent = {}; // The last mousemove event object created by the document mousemove event
|
5226
|
+
|
5227
|
+
var lastMouseMoveEvent = null; // Timeout created by the show delay
|
5228
|
+
|
5229
|
+
var showTimeoutId = 0; // Timeout created by the hide delay
|
5328
5230
|
|
5329
|
-
//
|
5330
|
-
var hideTimeoutId = 0;
|
5231
|
+
var hideTimeoutId = 0; // Flag to determine if the tippy is preparing to show due to the show timeout
|
5331
5232
|
|
5332
|
-
|
5333
|
-
var isPreparingToShow = false;
|
5233
|
+
var isPreparingToShow = false; // The current `transitionend` callback reference
|
5334
5234
|
|
5335
|
-
//
|
5336
|
-
var transitionEndListener = function transitionEndListener() {};
|
5235
|
+
var transitionEndListener = function transitionEndListener() {}; // Array of event listeners currently attached to the reference element
|
5337
5236
|
|
5338
|
-
// Array of event listeners currently attached to the reference element
|
5339
|
-
var listeners = [];
|
5340
5237
|
|
5341
|
-
|
5342
|
-
var referenceJustProgrammaticallyFocused = false;
|
5238
|
+
var listeners = []; // Private onMouseMove handler reference, debounced or not
|
5343
5239
|
|
5344
|
-
|
5345
|
-
var debouncedOnMouseMove = props.interactiveDebounce > 0 ? debounce$1(onMouseMove, props.interactiveDebounce) : onMouseMove;
|
5240
|
+
var debouncedOnMouseMove = props.interactiveDebounce > 0 ? debounce$1(onMouseMove, props.interactiveDebounce) : onMouseMove; // Node the tippy is currently appended to
|
5346
5241
|
|
5242
|
+
var parentNode = null;
|
5347
5243
|
/* ======================= 🔑 Public members 🔑 ======================= */
|
5348
5244
|
// id used for the `aria-describedby` / `aria-labelledby` attribute
|
5349
|
-
var id = idCounter++;
|
5350
5245
|
|
5351
|
-
// Popper element reference
|
5352
|
-
var popper = createPopperElement(id, props);
|
5246
|
+
var id = idCounter++; // Popper element reference
|
5353
5247
|
|
5354
|
-
// Prevent a tippy with a delay from hiding if the cursor left then returned
|
5248
|
+
var popper = createPopperElement(id, props); // Prevent a tippy with a delay from hiding if the cursor left then returned
|
5355
5249
|
// before it started hiding
|
5250
|
+
|
5356
5251
|
popper.addEventListener('mouseenter', function (event) {
|
5357
|
-
if (
|
5252
|
+
if (instance.props.interactive && instance.state.isVisible && lastTriggerEvent.type === 'mouseenter') {
|
5358
5253
|
prepareShow(event);
|
5359
5254
|
}
|
5360
5255
|
});
|
5361
|
-
popper.addEventListener('mouseleave', function (
|
5362
|
-
if (
|
5363
|
-
|
5256
|
+
popper.addEventListener('mouseleave', function () {
|
5257
|
+
if (instance.props.interactive && lastTriggerEvent.type === 'mouseenter') {
|
5258
|
+
document.addEventListener('mousemove', debouncedOnMouseMove);
|
5364
5259
|
}
|
5365
|
-
});
|
5260
|
+
}); // Popper element children: { arrow, backdrop, content, tooltip }
|
5366
5261
|
|
5367
|
-
|
5368
|
-
var popperChildren = getChildren(popper);
|
5262
|
+
var popperChildren = getChildren(popper); // The state of the tippy
|
5369
5263
|
|
5370
|
-
// The state of the tippy
|
5371
5264
|
var state = {
|
5372
5265
|
// If the tippy is currently enabled
|
5373
5266
|
isEnabled: true,
|
@@ -5378,13 +5271,12 @@
|
|
5378
5271
|
// If the tippy is on the DOM (transitioning out or in)
|
5379
5272
|
isMounted: false,
|
5380
5273
|
// show() transition finished
|
5381
|
-
isShown: false
|
5274
|
+
isShown: false // Popper.js instance for the tippy is lazily created
|
5382
5275
|
|
5383
|
-
|
5384
|
-
|
5276
|
+
};
|
5277
|
+
var popperInstance = null; // 🌟 tippy instance
|
5385
5278
|
|
5386
|
-
|
5387
|
-
var tip = {
|
5279
|
+
var instance = {
|
5388
5280
|
// properties
|
5389
5281
|
id: id,
|
5390
5282
|
reference: reference,
|
@@ -5395,7 +5287,7 @@
|
|
5395
5287
|
state: state,
|
5396
5288
|
// methods
|
5397
5289
|
clearDelayTimeouts: clearDelayTimeouts,
|
5398
|
-
set: set
|
5290
|
+
set: set,
|
5399
5291
|
setContent: setContent$$1,
|
5400
5292
|
show: show,
|
5401
5293
|
hide: hide,
|
@@ -5403,95 +5295,64 @@
|
|
5403
5295
|
disable: disable,
|
5404
5296
|
destroy: destroy
|
5405
5297
|
};
|
5406
|
-
|
5407
5298
|
addTriggersToReference();
|
5408
5299
|
|
5409
|
-
reference.addEventListener('click', onReferenceClick);
|
5410
|
-
|
5411
5300
|
if (!props.lazy) {
|
5412
|
-
|
5413
|
-
|
5301
|
+
createPopperInstance();
|
5302
|
+
instance.popperInstance.disableEventListeners();
|
5414
5303
|
}
|
5415
5304
|
|
5416
5305
|
if (props.showOnInit) {
|
5417
5306
|
prepareShow();
|
5418
|
-
}
|
5307
|
+
} // Ensure the reference element can receive focus (and is not a delegate)
|
5308
|
+
|
5419
5309
|
|
5420
|
-
// Ensure the reference element can receive focus (and is not a delegate)
|
5421
5310
|
if (props.a11y && !props.target && !canReceiveFocus(reference)) {
|
5422
5311
|
reference.setAttribute('tabindex', '0');
|
5423
|
-
}
|
5424
|
-
|
5425
|
-
// Install shortcuts
|
5426
|
-
reference._tippy = tip;
|
5427
|
-
popper._tippy = tip;
|
5312
|
+
} // Install shortcuts
|
5428
5313
|
|
5429
|
-
return tip;
|
5430
5314
|
|
5315
|
+
reference._tippy = instance;
|
5316
|
+
popper._tippy = instance;
|
5317
|
+
return instance;
|
5431
5318
|
/* ======================= 🔒 Private methods 🔒 ======================= */
|
5432
|
-
/**
|
5433
|
-
* If the reference was clicked, it also receives focus
|
5434
|
-
*/
|
5435
|
-
function onReferenceClick() {
|
5436
|
-
defer(function () {
|
5437
|
-
referenceJustProgrammaticallyFocused = false;
|
5438
|
-
});
|
5439
|
-
}
|
5440
|
-
|
5441
|
-
/**
|
5442
|
-
* Ensure the popper's position stays correct if its dimensions change. Use
|
5443
|
-
* update() over .scheduleUpdate() so there is no 1 frame flash due to
|
5444
|
-
* async update
|
5445
|
-
*/
|
5446
|
-
function addMutationObserver() {
|
5447
|
-
popperMutationObserver = new MutationObserver(function () {
|
5448
|
-
tip.popperInstance.update();
|
5449
|
-
});
|
5450
|
-
popperMutationObserver.observe(popper, {
|
5451
|
-
childList: true,
|
5452
|
-
subtree: true,
|
5453
|
-
characterData: true
|
5454
|
-
});
|
5455
|
-
}
|
5456
5319
|
|
5457
5320
|
/**
|
5458
5321
|
* Positions the virtual reference near the mouse cursor
|
5459
5322
|
*/
|
5323
|
+
|
5460
5324
|
function positionVirtualReferenceNearCursor(event) {
|
5461
5325
|
var _lastMouseMoveEvent = lastMouseMoveEvent = event,
|
5462
5326
|
clientX = _lastMouseMoveEvent.clientX,
|
5463
5327
|
clientY = _lastMouseMoveEvent.clientY;
|
5464
5328
|
|
5465
|
-
if (!
|
5329
|
+
if (!instance.popperInstance) {
|
5466
5330
|
return;
|
5467
|
-
}
|
5468
|
-
|
5469
|
-
// Ensure virtual reference is padded by 5px to prevent tooltip from
|
5331
|
+
} // Ensure virtual reference is padded to prevent tooltip from
|
5470
5332
|
// overflowing. Maybe Popper.js issue?
|
5471
|
-
|
5472
|
-
|
5333
|
+
|
5334
|
+
|
5335
|
+
var placement = getPopperPlacement(instance.popper);
|
5336
|
+
var padding = instance.popperChildren.arrow ? PADDING + 16 : PADDING;
|
5473
5337
|
var isVerticalPlacement = includes(['top', 'bottom'], placement);
|
5474
|
-
var isHorizontalPlacement = includes(['left', 'right'], placement);
|
5338
|
+
var isHorizontalPlacement = includes(['left', 'right'], placement); // Top / left boundary
|
5475
5339
|
|
5476
|
-
// Top / left boundary
|
5477
5340
|
var x = isVerticalPlacement ? Math.max(padding, clientX) : clientX;
|
5478
|
-
var y = isHorizontalPlacement ? Math.max(padding, clientY) : clientY;
|
5341
|
+
var y = isHorizontalPlacement ? Math.max(padding, clientY) : clientY; // Bottom / right boundary
|
5479
5342
|
|
5480
|
-
// Bottom / right boundary
|
5481
5343
|
if (isVerticalPlacement && x > padding) {
|
5482
5344
|
x = Math.min(clientX, window.innerWidth - padding);
|
5483
5345
|
}
|
5346
|
+
|
5484
5347
|
if (isHorizontalPlacement && y > padding) {
|
5485
5348
|
y = Math.min(clientY, window.innerHeight - padding);
|
5486
5349
|
}
|
5487
5350
|
|
5488
|
-
var rect =
|
5489
|
-
var followCursor =
|
5490
|
-
|
5351
|
+
var rect = instance.reference.getBoundingClientRect();
|
5352
|
+
var followCursor = instance.props.followCursor;
|
5491
5353
|
var isHorizontal = followCursor === 'horizontal';
|
5492
5354
|
var isVertical = followCursor === 'vertical';
|
5493
|
-
|
5494
|
-
tip.popperInstance.reference = {
|
5355
|
+
instance.popperInstance.reference = {
|
5495
5356
|
getBoundingClientRect: function getBoundingClientRect() {
|
5496
5357
|
return {
|
5497
5358
|
width: 0,
|
@@ -5505,59 +5366,63 @@
|
|
5505
5366
|
clientWidth: 0,
|
5506
5367
|
clientHeight: 0
|
5507
5368
|
};
|
5369
|
+
instance.popperInstance.scheduleUpdate();
|
5508
5370
|
|
5509
|
-
|
5510
|
-
|
5511
|
-
if (followCursor === 'initial' && tip.state.isVisible) {
|
5371
|
+
if (followCursor === 'initial' && instance.state.isVisible) {
|
5512
5372
|
removeFollowCursorListener();
|
5513
5373
|
}
|
5514
5374
|
}
|
5515
|
-
|
5516
5375
|
/**
|
5517
5376
|
* Creates the tippy instance for a delegate when it's been triggered
|
5518
5377
|
*/
|
5378
|
+
|
5379
|
+
|
5519
5380
|
function createDelegateChildTippy(event) {
|
5520
|
-
var targetEl = closest(event.target,
|
5381
|
+
var targetEl = closest(event.target, instance.props.target);
|
5382
|
+
|
5521
5383
|
if (targetEl && !targetEl._tippy) {
|
5522
|
-
createTippy(targetEl, _extends$2({},
|
5384
|
+
createTippy(targetEl, _extends$2({}, instance.props, {
|
5385
|
+
content: evaluateValue(collectionProps.content, [targetEl]),
|
5386
|
+
appendTo: collectionProps.appendTo,
|
5523
5387
|
target: '',
|
5524
5388
|
showOnInit: true
|
5525
5389
|
}));
|
5526
5390
|
prepareShow(event);
|
5527
5391
|
}
|
5528
5392
|
}
|
5529
|
-
|
5530
5393
|
/**
|
5531
5394
|
* Setup before show() is invoked (delays, etc.)
|
5532
5395
|
*/
|
5396
|
+
|
5397
|
+
|
5533
5398
|
function prepareShow(event) {
|
5534
5399
|
clearDelayTimeouts();
|
5535
5400
|
|
5536
|
-
if (
|
5401
|
+
if (instance.state.isVisible) {
|
5537
5402
|
return;
|
5538
|
-
}
|
5403
|
+
} // Is a delegate, create an instance for the child target
|
5404
|
+
|
5539
5405
|
|
5540
|
-
|
5541
|
-
if (tip.props.target) {
|
5406
|
+
if (instance.props.target) {
|
5542
5407
|
return createDelegateChildTippy(event);
|
5543
5408
|
}
|
5544
5409
|
|
5545
5410
|
isPreparingToShow = true;
|
5546
5411
|
|
5547
|
-
if (
|
5548
|
-
return
|
5549
|
-
}
|
5550
|
-
|
5551
|
-
// If the tooltip has a delay, we need to be listening to the mousemove as
|
5412
|
+
if (instance.props.wait) {
|
5413
|
+
return instance.props.wait(instance, event);
|
5414
|
+
} // If the tooltip has a delay, we need to be listening to the mousemove as
|
5552
5415
|
// soon as the trigger event is fired, so that it's in the correct position
|
5553
5416
|
// upon mount.
|
5554
5417
|
// Edge case: if the tooltip is still mounted, but then prepareShow() is
|
5555
5418
|
// called, it causes a jump.
|
5556
|
-
|
5419
|
+
|
5420
|
+
|
5421
|
+
if (hasFollowCursorBehavior() && !instance.state.isMounted) {
|
5557
5422
|
document.addEventListener('mousemove', positionVirtualReferenceNearCursor);
|
5558
5423
|
}
|
5559
5424
|
|
5560
|
-
var delay = getValue$1(
|
5425
|
+
var delay = getValue$1(instance.props.delay, 0, Defaults$1.delay);
|
5561
5426
|
|
5562
5427
|
if (delay) {
|
5563
5428
|
showTimeoutId = setTimeout(function () {
|
@@ -5567,24 +5432,24 @@
|
|
5567
5432
|
show();
|
5568
5433
|
}
|
5569
5434
|
}
|
5570
|
-
|
5571
5435
|
/**
|
5572
5436
|
* Setup before hide() is invoked (delays, etc.)
|
5573
5437
|
*/
|
5438
|
+
|
5439
|
+
|
5574
5440
|
function prepareHide() {
|
5575
5441
|
clearDelayTimeouts();
|
5576
5442
|
|
5577
|
-
if (!
|
5443
|
+
if (!instance.state.isVisible) {
|
5578
5444
|
return removeFollowCursorListener();
|
5579
5445
|
}
|
5580
5446
|
|
5581
5447
|
isPreparingToShow = false;
|
5582
|
-
|
5583
|
-
var delay = getValue$1(tip.props.delay, 1, Defaults$1.delay);
|
5448
|
+
var delay = getValue$1(instance.props.delay, 1, Defaults$1.delay);
|
5584
5449
|
|
5585
5450
|
if (delay) {
|
5586
5451
|
hideTimeoutId = setTimeout(function () {
|
5587
|
-
if (
|
5452
|
+
if (instance.state.isVisible) {
|
5588
5453
|
hide();
|
5589
5454
|
}
|
5590
5455
|
}, delay);
|
@@ -5592,74 +5457,83 @@
|
|
5592
5457
|
hide();
|
5593
5458
|
}
|
5594
5459
|
}
|
5595
|
-
|
5596
5460
|
/**
|
5597
5461
|
* Removes the follow cursor listener
|
5598
5462
|
*/
|
5463
|
+
|
5464
|
+
|
5599
5465
|
function removeFollowCursorListener() {
|
5600
5466
|
document.removeEventListener('mousemove', positionVirtualReferenceNearCursor);
|
5601
5467
|
lastMouseMoveEvent = null;
|
5602
5468
|
}
|
5603
|
-
|
5604
5469
|
/**
|
5605
5470
|
* Cleans up old listeners
|
5606
5471
|
*/
|
5472
|
+
|
5473
|
+
|
5607
5474
|
function cleanupOldMouseListeners() {
|
5608
5475
|
document.body.removeEventListener('mouseleave', prepareHide);
|
5609
5476
|
document.removeEventListener('mousemove', debouncedOnMouseMove);
|
5610
5477
|
}
|
5611
|
-
|
5612
5478
|
/**
|
5613
5479
|
* Event listener invoked upon trigger
|
5614
5480
|
*/
|
5481
|
+
|
5482
|
+
|
5615
5483
|
function onTrigger(event) {
|
5616
|
-
if (!
|
5484
|
+
if (!instance.state.isEnabled || isEventListenerStopped(event)) {
|
5617
5485
|
return;
|
5618
5486
|
}
|
5619
5487
|
|
5620
|
-
if (!
|
5621
|
-
lastTriggerEvent = event;
|
5622
|
-
|
5488
|
+
if (!instance.state.isVisible) {
|
5489
|
+
lastTriggerEvent = event; // Use the `mouseenter` event as a "mock" mousemove event for touch
|
5490
|
+
// devices
|
5491
|
+
|
5492
|
+
if (isUsingTouch && includes(event.type, 'mouse')) {
|
5493
|
+
lastMouseMoveEvent = event;
|
5494
|
+
}
|
5495
|
+
} // Toggle show/hide when clicking click-triggered tooltips
|
5623
5496
|
|
5624
|
-
|
5625
|
-
if (event.type === 'click' &&
|
5497
|
+
|
5498
|
+
if (event.type === 'click' && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
5626
5499
|
prepareHide();
|
5627
5500
|
} else {
|
5628
5501
|
prepareShow(event);
|
5629
5502
|
}
|
5630
5503
|
}
|
5631
|
-
|
5632
5504
|
/**
|
5633
5505
|
* Event listener used for interactive tooltips to detect when they should
|
5634
5506
|
* hide
|
5635
5507
|
*/
|
5508
|
+
|
5509
|
+
|
5636
5510
|
function onMouseMove(event) {
|
5637
5511
|
var referenceTheCursorIsOver = closestCallback(event.target, function (el) {
|
5638
5512
|
return el._tippy;
|
5639
5513
|
});
|
5640
|
-
|
5641
|
-
var
|
5642
|
-
var isCursorOverReference = referenceTheCursorIsOver === tip.reference;
|
5514
|
+
var isCursorOverPopper = closest(event.target, Selectors.POPPER) === instance.popper;
|
5515
|
+
var isCursorOverReference = referenceTheCursorIsOver === instance.reference;
|
5643
5516
|
|
5644
5517
|
if (isCursorOverPopper || isCursorOverReference) {
|
5645
5518
|
return;
|
5646
5519
|
}
|
5647
5520
|
|
5648
|
-
if (isCursorOutsideInteractiveBorder(getPopperPlacement(
|
5521
|
+
if (isCursorOutsideInteractiveBorder(getPopperPlacement(instance.popper), instance.popper.getBoundingClientRect(), event, instance.props)) {
|
5649
5522
|
cleanupOldMouseListeners();
|
5650
5523
|
prepareHide();
|
5651
5524
|
}
|
5652
5525
|
}
|
5653
|
-
|
5654
5526
|
/**
|
5655
5527
|
* Event listener invoked upon mouseleave
|
5656
5528
|
*/
|
5529
|
+
|
5530
|
+
|
5657
5531
|
function onMouseLeave(event) {
|
5658
5532
|
if (isEventListenerStopped(event)) {
|
5659
5533
|
return;
|
5660
5534
|
}
|
5661
5535
|
|
5662
|
-
if (
|
5536
|
+
if (instance.props.interactive) {
|
5663
5537
|
document.body.addEventListener('mouseleave', prepareHide);
|
5664
5538
|
document.addEventListener('mousemove', debouncedOnMouseMove);
|
5665
5539
|
return;
|
@@ -5667,140 +5541,148 @@
|
|
5667
5541
|
|
5668
5542
|
prepareHide();
|
5669
5543
|
}
|
5670
|
-
|
5671
5544
|
/**
|
5672
5545
|
* Event listener invoked upon blur
|
5673
5546
|
*/
|
5547
|
+
|
5548
|
+
|
5674
5549
|
function onBlur(event) {
|
5675
|
-
if (event.target !==
|
5550
|
+
if (event.target !== instance.reference) {
|
5676
5551
|
return;
|
5677
5552
|
}
|
5678
5553
|
|
5679
|
-
if (
|
5680
|
-
|
5681
|
-
return;
|
5682
|
-
}
|
5683
|
-
if (closest(event.relatedTarget, Selectors.POPPER)) {
|
5684
|
-
return;
|
5685
|
-
}
|
5554
|
+
if (instance.props.interactive && event.relatedTarget && instance.popper.contains(event.relatedTarget)) {
|
5555
|
+
return;
|
5686
5556
|
}
|
5687
5557
|
|
5688
5558
|
prepareHide();
|
5689
5559
|
}
|
5690
|
-
|
5691
5560
|
/**
|
5692
5561
|
* Event listener invoked when a child target is triggered
|
5693
5562
|
*/
|
5563
|
+
|
5564
|
+
|
5694
5565
|
function onDelegateShow(event) {
|
5695
|
-
if (closest(event.target,
|
5566
|
+
if (closest(event.target, instance.props.target)) {
|
5696
5567
|
prepareShow(event);
|
5697
5568
|
}
|
5698
5569
|
}
|
5699
|
-
|
5700
5570
|
/**
|
5701
5571
|
* Event listener invoked when a child target should hide
|
5702
5572
|
*/
|
5573
|
+
|
5574
|
+
|
5703
5575
|
function onDelegateHide(event) {
|
5704
|
-
if (closest(event.target,
|
5576
|
+
if (closest(event.target, instance.props.target)) {
|
5705
5577
|
prepareHide();
|
5706
5578
|
}
|
5707
5579
|
}
|
5708
|
-
|
5709
5580
|
/**
|
5710
5581
|
* Determines if an event listener should stop further execution due to the
|
5711
5582
|
* `touchHold` option
|
5712
5583
|
*/
|
5584
|
+
|
5585
|
+
|
5713
5586
|
function isEventListenerStopped(event) {
|
5587
|
+
var supportsTouch = 'ontouchstart' in window;
|
5714
5588
|
var isTouchEvent = includes(event.type, 'touch');
|
5715
|
-
var
|
5716
|
-
|
5717
|
-
return caseA || caseB;
|
5589
|
+
var touchHold = instance.props.touchHold;
|
5590
|
+
return supportsTouch && isUsingTouch && touchHold && !isTouchEvent || isUsingTouch && !touchHold && isTouchEvent;
|
5718
5591
|
}
|
5719
|
-
|
5720
5592
|
/**
|
5721
|
-
* Creates the popper instance for the
|
5593
|
+
* Creates the popper instance for the instance
|
5722
5594
|
*/
|
5723
|
-
function createPopperInstance() {
|
5724
|
-
var popperOptions = tip.props.popperOptions;
|
5725
|
-
var _tip$popperChildren = tip.popperChildren,
|
5726
|
-
tooltip = _tip$popperChildren.tooltip,
|
5727
|
-
arrow = _tip$popperChildren.arrow;
|
5728
5595
|
|
5729
5596
|
|
5730
|
-
|
5731
|
-
|
5597
|
+
function createPopperInstance() {
|
5598
|
+
var popperOptions = instance.props.popperOptions;
|
5599
|
+
var _instance$popperChild = instance.popperChildren,
|
5600
|
+
tooltip = _instance$popperChild.tooltip,
|
5601
|
+
arrow = _instance$popperChild.arrow;
|
5602
|
+
instance.popperInstance = new Popper(instance.reference, instance.popper, _extends$2({
|
5603
|
+
placement: instance.props.placement
|
5732
5604
|
}, popperOptions, {
|
5733
5605
|
modifiers: _extends$2({}, popperOptions ? popperOptions.modifiers : {}, {
|
5734
5606
|
preventOverflow: _extends$2({
|
5735
|
-
boundariesElement:
|
5607
|
+
boundariesElement: instance.props.boundary,
|
5608
|
+
padding: PADDING
|
5736
5609
|
}, getModifier(popperOptions, 'preventOverflow')),
|
5737
5610
|
arrow: _extends$2({
|
5738
5611
|
element: arrow,
|
5739
5612
|
enabled: !!arrow
|
5740
5613
|
}, getModifier(popperOptions, 'arrow')),
|
5741
5614
|
flip: _extends$2({
|
5742
|
-
enabled:
|
5743
|
-
|
5744
|
-
|
5615
|
+
enabled: instance.props.flip,
|
5616
|
+
// The tooltip is offset by 10px from the popper in CSS,
|
5617
|
+
// we need to account for its distance
|
5618
|
+
padding: instance.props.distance + PADDING,
|
5619
|
+
behavior: instance.props.flipBehavior
|
5745
5620
|
}, getModifier(popperOptions, 'flip')),
|
5746
5621
|
offset: _extends$2({
|
5747
|
-
offset:
|
5622
|
+
offset: instance.props.offset
|
5748
5623
|
}, getModifier(popperOptions, 'offset'))
|
5749
5624
|
}),
|
5750
5625
|
onCreate: function onCreate() {
|
5751
|
-
tooltip.style[getPopperPlacement(
|
5626
|
+
tooltip.style[getPopperPlacement(instance.popper)] = getOffsetDistanceInPx(instance.props.distance, Defaults$1.distance);
|
5627
|
+
},
|
5628
|
+
onUpdate: function onUpdate(data) {
|
5629
|
+
if (data && !instance.props.flipOnUpdate) {
|
5630
|
+
if (data.flipped) {
|
5631
|
+
instance.popperInstance.options.placement = data.placement;
|
5632
|
+
}
|
5752
5633
|
|
5753
|
-
|
5754
|
-
computeArrowTransform(arrow, tip.props.arrowTransform);
|
5634
|
+
setFlipModifierEnabled(instance.popperInstance.modifiers, false);
|
5755
5635
|
}
|
5756
|
-
|
5757
|
-
onUpdate: function onUpdate() {
|
5636
|
+
|
5758
5637
|
var styles = tooltip.style;
|
5759
5638
|
styles.top = '';
|
5760
5639
|
styles.bottom = '';
|
5761
5640
|
styles.left = '';
|
5762
5641
|
styles.right = '';
|
5763
|
-
styles[getPopperPlacement(
|
5764
|
-
|
5765
|
-
if (arrow && tip.props.arrowTransform) {
|
5766
|
-
computeArrowTransform(arrow, tip.props.arrowTransform);
|
5767
|
-
}
|
5642
|
+
styles[getPopperPlacement(instance.popper)] = getOffsetDistanceInPx(instance.props.distance, Defaults$1.distance);
|
5768
5643
|
}
|
5769
5644
|
}));
|
5770
5645
|
}
|
5771
|
-
|
5772
5646
|
/**
|
5773
5647
|
* Mounts the tooltip to the DOM, callback to show tooltip is run **after**
|
5774
5648
|
* popper's position has updated
|
5775
5649
|
*/
|
5650
|
+
|
5651
|
+
|
5776
5652
|
function mount(callback) {
|
5777
|
-
|
5778
|
-
|
5779
|
-
|
5780
|
-
|
5781
|
-
|
5653
|
+
var shouldEnableListeners = !hasFollowCursorBehavior() && !(instance.props.followCursor === 'initial' && isUsingTouch);
|
5654
|
+
|
5655
|
+
if (!instance.popperInstance) {
|
5656
|
+
createPopperInstance();
|
5657
|
+
|
5658
|
+
if (!shouldEnableListeners) {
|
5659
|
+
instance.popperInstance.disableEventListeners();
|
5782
5660
|
}
|
5783
5661
|
} else {
|
5784
5662
|
if (!hasFollowCursorBehavior()) {
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5663
|
+
instance.popperInstance.scheduleUpdate();
|
5664
|
+
|
5665
|
+
if (shouldEnableListeners) {
|
5666
|
+
instance.popperInstance.enableEventListeners();
|
5788
5667
|
}
|
5789
5668
|
}
|
5790
|
-
}
|
5791
5669
|
|
5792
|
-
|
5670
|
+
setFlipModifierEnabled(instance.popperInstance.modifiers, true);
|
5671
|
+
} // If the instance previously had followCursor behavior, it will be
|
5793
5672
|
// positioned incorrectly if triggered by `focus` afterwards.
|
5794
5673
|
// Update the reference back to the real DOM element
|
5795
|
-
tip.popperInstance.reference = tip.reference;
|
5796
|
-
var arrow = tip.popperChildren.arrow;
|
5797
5674
|
|
5798
5675
|
|
5676
|
+
instance.popperInstance.reference = instance.reference;
|
5677
|
+
var arrow = instance.popperChildren.arrow;
|
5678
|
+
|
5799
5679
|
if (hasFollowCursorBehavior()) {
|
5800
5680
|
if (arrow) {
|
5801
5681
|
arrow.style.margin = '0';
|
5802
5682
|
}
|
5803
|
-
|
5683
|
+
|
5684
|
+
var delay = getValue$1(instance.props.delay, 0, Defaults$1.delay);
|
5685
|
+
|
5804
5686
|
if (lastTriggerEvent.type) {
|
5805
5687
|
positionVirtualReferenceNearCursor(delay && lastMouseMoveEvent ? lastMouseMoveEvent : lastTriggerEvent);
|
5806
5688
|
}
|
@@ -5808,72 +5690,78 @@
|
|
5808
5690
|
arrow.style.margin = '';
|
5809
5691
|
}
|
5810
5692
|
|
5811
|
-
afterPopperPositionUpdates(
|
5693
|
+
afterPopperPositionUpdates(instance.popperInstance, callback);
|
5694
|
+
var appendTo = instance.props.appendTo;
|
5695
|
+
parentNode = appendTo === 'parent' ? instance.reference.parentNode : evaluateValue(appendTo, [instance.reference]);
|
5812
5696
|
|
5813
|
-
if (!
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5697
|
+
if (!parentNode.contains(instance.popper)) {
|
5698
|
+
parentNode.appendChild(instance.popper);
|
5699
|
+
instance.props.onMount(instance);
|
5700
|
+
instance.state.isMounted = true;
|
5817
5701
|
}
|
5818
5702
|
}
|
5819
|
-
|
5820
5703
|
/**
|
5821
5704
|
* Determines if the instance is in `followCursor` mode
|
5822
5705
|
*/
|
5706
|
+
|
5707
|
+
|
5823
5708
|
function hasFollowCursorBehavior() {
|
5824
|
-
return
|
5709
|
+
return instance.props.followCursor && !isUsingTouch && lastTriggerEvent.type !== 'focus';
|
5825
5710
|
}
|
5826
|
-
|
5827
5711
|
/**
|
5828
5712
|
* Updates the tooltip's position on each animation frame + timeout
|
5829
5713
|
*/
|
5714
|
+
|
5715
|
+
|
5830
5716
|
function makeSticky() {
|
5831
|
-
applyTransitionDuration([
|
5717
|
+
applyTransitionDuration([instance.popper], isIE$1 ? 0 : instance.props.updateDuration);
|
5832
5718
|
|
5833
5719
|
var updatePosition = function updatePosition() {
|
5834
|
-
if (
|
5835
|
-
|
5720
|
+
if (instance.popperInstance) {
|
5721
|
+
instance.popperInstance.scheduleUpdate();
|
5836
5722
|
}
|
5837
5723
|
|
5838
|
-
if (
|
5724
|
+
if (instance.state.isMounted) {
|
5839
5725
|
requestAnimationFrame(updatePosition);
|
5840
5726
|
} else {
|
5841
|
-
applyTransitionDuration([
|
5727
|
+
applyTransitionDuration([instance.popper], 0);
|
5842
5728
|
}
|
5843
5729
|
};
|
5844
5730
|
|
5845
5731
|
updatePosition();
|
5846
5732
|
}
|
5847
|
-
|
5848
5733
|
/**
|
5849
5734
|
* Invokes a callback once the tooltip has fully transitioned out
|
5850
5735
|
*/
|
5736
|
+
|
5737
|
+
|
5851
5738
|
function onTransitionedOut(duration, callback) {
|
5852
5739
|
onTransitionEnd(duration, function () {
|
5853
|
-
if (!
|
5740
|
+
if (!instance.state.isVisible && parentNode && parentNode.contains(instance.popper)) {
|
5854
5741
|
callback();
|
5855
5742
|
}
|
5856
5743
|
});
|
5857
5744
|
}
|
5858
|
-
|
5859
5745
|
/**
|
5860
5746
|
* Invokes a callback once the tooltip has fully transitioned in
|
5861
5747
|
*/
|
5748
|
+
|
5749
|
+
|
5862
5750
|
function onTransitionedIn(duration, callback) {
|
5863
5751
|
onTransitionEnd(duration, callback);
|
5864
5752
|
}
|
5865
|
-
|
5866
5753
|
/**
|
5867
5754
|
* Invokes a callback once the tooltip's CSS transition ends
|
5868
5755
|
*/
|
5756
|
+
|
5757
|
+
|
5869
5758
|
function onTransitionEnd(duration, callback) {
|
5870
5759
|
// Make callback synchronous if duration is 0
|
5871
5760
|
if (duration === 0) {
|
5872
5761
|
return callback();
|
5873
5762
|
}
|
5874
5763
|
|
5875
|
-
var tooltip =
|
5876
|
-
|
5764
|
+
var tooltip = instance.popperChildren.tooltip;
|
5877
5765
|
|
5878
5766
|
var listener = function listener(e) {
|
5879
5767
|
if (e.target === tooltip) {
|
@@ -5884,40 +5772,46 @@
|
|
5884
5772
|
|
5885
5773
|
toggleTransitionEndListener(tooltip, 'remove', transitionEndListener);
|
5886
5774
|
toggleTransitionEndListener(tooltip, 'add', listener);
|
5887
|
-
|
5888
5775
|
transitionEndListener = listener;
|
5889
5776
|
}
|
5890
|
-
|
5891
5777
|
/**
|
5892
5778
|
* Adds an event listener to the reference and stores it in `listeners`
|
5893
5779
|
*/
|
5780
|
+
|
5781
|
+
|
5894
5782
|
function on(eventType, handler) {
|
5895
5783
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
5896
|
-
|
5897
|
-
|
5898
|
-
|
5784
|
+
instance.reference.addEventListener(eventType, handler, options);
|
5785
|
+
listeners.push({
|
5786
|
+
eventType: eventType,
|
5787
|
+
handler: handler,
|
5788
|
+
options: options
|
5789
|
+
});
|
5899
5790
|
}
|
5900
|
-
|
5901
5791
|
/**
|
5902
5792
|
* Adds event listeners to the reference based on the `trigger` prop
|
5903
5793
|
*/
|
5794
|
+
|
5795
|
+
|
5904
5796
|
function addTriggersToReference() {
|
5905
|
-
if (
|
5797
|
+
if (instance.props.touchHold && !instance.props.target) {
|
5906
5798
|
on('touchstart', onTrigger, PASSIVE);
|
5907
5799
|
on('touchend', onMouseLeave, PASSIVE);
|
5908
5800
|
}
|
5909
5801
|
|
5910
|
-
|
5802
|
+
instance.props.trigger.trim().split(' ').forEach(function (eventType) {
|
5911
5803
|
if (eventType === 'manual') {
|
5912
5804
|
return;
|
5913
5805
|
}
|
5914
5806
|
|
5915
|
-
if (!
|
5807
|
+
if (!instance.props.target) {
|
5916
5808
|
on(eventType, onTrigger);
|
5809
|
+
|
5917
5810
|
switch (eventType) {
|
5918
5811
|
case 'mouseenter':
|
5919
5812
|
on('mouseleave', onMouseLeave);
|
5920
5813
|
break;
|
5814
|
+
|
5921
5815
|
case 'focus':
|
5922
5816
|
on(isIE$1 ? 'focusout' : 'blur', onBlur);
|
5923
5817
|
break;
|
@@ -5928,10 +5822,12 @@
|
|
5928
5822
|
on('mouseover', onDelegateShow);
|
5929
5823
|
on('mouseout', onDelegateHide);
|
5930
5824
|
break;
|
5825
|
+
|
5931
5826
|
case 'focus':
|
5932
5827
|
on('focusin', onDelegateShow);
|
5933
5828
|
on('focusout', onDelegateHide);
|
5934
5829
|
break;
|
5830
|
+
|
5935
5831
|
case 'click':
|
5936
5832
|
on(eventType, onDelegateShow);
|
5937
5833
|
break;
|
@@ -5939,58 +5835,69 @@
|
|
5939
5835
|
}
|
5940
5836
|
});
|
5941
5837
|
}
|
5942
|
-
|
5943
5838
|
/**
|
5944
5839
|
* Removes event listeners from the reference
|
5945
5840
|
*/
|
5841
|
+
|
5842
|
+
|
5946
5843
|
function removeTriggersFromReference() {
|
5947
5844
|
listeners.forEach(function (_ref) {
|
5948
5845
|
var eventType = _ref.eventType,
|
5949
5846
|
handler = _ref.handler,
|
5950
5847
|
options = _ref.options;
|
5951
|
-
|
5952
|
-
tip.reference.removeEventListener(eventType, handler, options);
|
5848
|
+
instance.reference.removeEventListener(eventType, handler, options);
|
5953
5849
|
});
|
5954
5850
|
listeners = [];
|
5955
5851
|
}
|
5852
|
+
/**
|
5853
|
+
* Returns inner elements used in show/hide methods
|
5854
|
+
*/
|
5855
|
+
|
5956
5856
|
|
5857
|
+
function getInnerElements() {
|
5858
|
+
return [instance.popperChildren.tooltip, instance.popperChildren.backdrop, instance.popperChildren.content];
|
5859
|
+
}
|
5957
5860
|
/* ======================= 🔑 Public methods 🔑 ======================= */
|
5861
|
+
|
5958
5862
|
/**
|
5959
5863
|
* Enables the instance to allow it to show or hide
|
5960
5864
|
*/
|
5865
|
+
|
5866
|
+
|
5961
5867
|
function enable() {
|
5962
|
-
|
5868
|
+
instance.state.isEnabled = true;
|
5963
5869
|
}
|
5964
|
-
|
5965
5870
|
/**
|
5966
5871
|
* Disables the instance to disallow it to show or hide
|
5967
5872
|
*/
|
5873
|
+
|
5874
|
+
|
5968
5875
|
function disable() {
|
5969
|
-
|
5876
|
+
instance.state.isEnabled = false;
|
5970
5877
|
}
|
5971
|
-
|
5972
5878
|
/**
|
5973
5879
|
* Clears pending timeouts related to the `delay` prop if any
|
5974
5880
|
*/
|
5881
|
+
|
5882
|
+
|
5975
5883
|
function clearDelayTimeouts() {
|
5976
5884
|
clearTimeout(showTimeoutId);
|
5977
5885
|
clearTimeout(hideTimeoutId);
|
5978
5886
|
}
|
5979
|
-
|
5980
5887
|
/**
|
5981
5888
|
* Sets new props for the instance and redraws the tooltip
|
5982
5889
|
*/
|
5983
|
-
function set$$1() {
|
5984
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5985
5890
|
|
5986
|
-
validateOptions(options, Defaults$1);
|
5987
5891
|
|
5988
|
-
|
5989
|
-
var
|
5990
|
-
|
5892
|
+
function set() {
|
5893
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5894
|
+
validateOptions(options, Defaults$1);
|
5895
|
+
var prevProps = instance.props;
|
5896
|
+
var nextProps = evaluateProps(instance.reference, _extends$2({}, instance.props, options, {
|
5897
|
+
ignoreAttributes: true
|
5991
5898
|
}));
|
5992
|
-
nextProps.
|
5993
|
-
|
5899
|
+
nextProps.ignoreAttributes = hasOwnProperty$8(options, 'ignoreAttributes') ? options.ignoreAttributes : prevProps.ignoreAttributes;
|
5900
|
+
instance.props = nextProps;
|
5994
5901
|
|
5995
5902
|
if (hasOwnProperty$8(options, 'trigger') || hasOwnProperty$8(options, 'touchHold')) {
|
5996
5903
|
removeTriggersFromReference();
|
@@ -6002,214 +5909,262 @@
|
|
6002
5909
|
debouncedOnMouseMove = debounce$1(onMouseMove, options.interactiveDebounce);
|
6003
5910
|
}
|
6004
5911
|
|
6005
|
-
updatePopperElement(
|
6006
|
-
|
5912
|
+
updatePopperElement(instance.popper, prevProps, nextProps);
|
5913
|
+
instance.popperChildren = getChildren(instance.popper);
|
6007
5914
|
|
6008
|
-
if (
|
6009
|
-
|
6010
|
-
|
6011
|
-
|
6012
|
-
|
6013
|
-
|
6014
|
-
|
6015
|
-
|
6016
|
-
|
6017
|
-
|
5915
|
+
if (instance.popperInstance) {
|
5916
|
+
instance.popperInstance.update();
|
5917
|
+
|
5918
|
+
if (POPPER_INSTANCE_DEPENDENCIES.some(function (prop) {
|
5919
|
+
return hasOwnProperty$8(options, prop);
|
5920
|
+
})) {
|
5921
|
+
instance.popperInstance.destroy();
|
5922
|
+
createPopperInstance();
|
5923
|
+
|
5924
|
+
if (!instance.state.isVisible) {
|
5925
|
+
instance.popperInstance.disableEventListeners();
|
5926
|
+
}
|
5927
|
+
|
5928
|
+
if (instance.props.followCursor && lastMouseMoveEvent) {
|
5929
|
+
positionVirtualReferenceNearCursor(lastMouseMoveEvent);
|
5930
|
+
}
|
6018
5931
|
}
|
6019
5932
|
}
|
6020
5933
|
}
|
6021
|
-
|
6022
5934
|
/**
|
6023
5935
|
* Shortcut for .set({ content: newContent })
|
6024
5936
|
*/
|
5937
|
+
|
5938
|
+
|
6025
5939
|
function setContent$$1(content) {
|
6026
|
-
set
|
5940
|
+
set({
|
5941
|
+
content: content
|
5942
|
+
});
|
6027
5943
|
}
|
6028
|
-
|
6029
5944
|
/**
|
6030
5945
|
* Shows the tooltip
|
6031
5946
|
*/
|
5947
|
+
|
5948
|
+
|
6032
5949
|
function show() {
|
6033
|
-
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue$1(
|
5950
|
+
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue$1(instance.props.duration, 0, Defaults$1.duration[0]);
|
6034
5951
|
|
6035
|
-
if (
|
5952
|
+
if (instance.state.isDestroyed || !instance.state.isEnabled || isUsingTouch && !instance.props.touch) {
|
6036
5953
|
return;
|
6037
|
-
}
|
5954
|
+
} // Destroy tooltip if the reference element is no longer on the DOM
|
5955
|
+
|
6038
5956
|
|
6039
|
-
|
6040
|
-
if (!tip.reference.isVirtual && !document.documentElement.contains(tip.reference)) {
|
5957
|
+
if (!instance.reference.isVirtual && !document.documentElement.contains(instance.reference)) {
|
6041
5958
|
return destroy();
|
6042
|
-
}
|
5959
|
+
} // Do not show tooltip if the reference element has a `disabled` attribute
|
6043
5960
|
|
6044
|
-
// Do not show tooltip if the reference element has a `disabled` attribute
|
6045
|
-
if (tip.reference.hasAttribute('disabled')) {
|
6046
|
-
return;
|
6047
|
-
}
|
6048
5961
|
|
6049
|
-
|
6050
|
-
// reasons
|
6051
|
-
if (referenceJustProgrammaticallyFocused) {
|
6052
|
-
referenceJustProgrammaticallyFocused = false;
|
5962
|
+
if (instance.reference.hasAttribute('disabled')) {
|
6053
5963
|
return;
|
6054
5964
|
}
|
6055
5965
|
|
6056
|
-
if (
|
5966
|
+
if (instance.props.onShow(instance) === false) {
|
6057
5967
|
return;
|
6058
5968
|
}
|
6059
5969
|
|
6060
|
-
|
6061
|
-
|
5970
|
+
instance.popper.style.visibility = 'visible';
|
5971
|
+
instance.state.isVisible = true;
|
5972
|
+
|
5973
|
+
if (instance.props.interactive) {
|
5974
|
+
instance.reference.classList.add('tippy-active');
|
5975
|
+
} // Prevent a transition if the popper is at the opposite placement
|
6062
5976
|
|
6063
|
-
// Prevent a transition if the popper is at the opposite placement
|
6064
|
-
applyTransitionDuration([tip.popper, tip.popperChildren.tooltip, tip.popperChildren.backdrop], 0);
|
6065
5977
|
|
5978
|
+
applyTransitionDuration([instance.popper, instance.popperChildren.tooltip, instance.popperChildren.backdrop], 0);
|
6066
5979
|
mount(function () {
|
6067
|
-
if (!
|
5980
|
+
if (!instance.state.isVisible) {
|
6068
5981
|
return;
|
6069
|
-
}
|
5982
|
+
} // Arrow will sometimes not be positioned correctly. Force another update
|
5983
|
+
|
6070
5984
|
|
6071
|
-
// Arrow will sometimes not be positioned correctly. Force another update
|
6072
5985
|
if (!hasFollowCursorBehavior()) {
|
6073
|
-
|
6074
|
-
}
|
5986
|
+
instance.popperInstance.update();
|
5987
|
+
} // Allow followCursor: 'initial' on touch devices
|
5988
|
+
|
6075
5989
|
|
6076
|
-
|
6077
|
-
|
6078
|
-
tip.popperChildren.content.style.transitionDelay = Math.round(duration / 6) + 'ms';
|
5990
|
+
if (isUsingTouch && instance.props.followCursor === 'initial') {
|
5991
|
+
positionVirtualReferenceNearCursor(lastMouseMoveEvent);
|
6079
5992
|
}
|
6080
5993
|
|
6081
|
-
|
6082
|
-
|
5994
|
+
applyTransitionDuration([instance.popper], props.updateDuration);
|
5995
|
+
applyTransitionDuration(getInnerElements(), duration);
|
5996
|
+
|
5997
|
+
if (instance.popperChildren.backdrop) {
|
5998
|
+
instance.popperChildren.content.style.transitionDelay = Math.round(duration / 12) + 'ms';
|
6083
5999
|
}
|
6084
6000
|
|
6085
|
-
if (
|
6001
|
+
if (instance.props.sticky) {
|
6086
6002
|
makeSticky();
|
6087
6003
|
}
|
6088
6004
|
|
6089
|
-
setVisibilityState(
|
6090
|
-
|
6005
|
+
setVisibilityState(getInnerElements(), 'visible');
|
6091
6006
|
onTransitionedIn(duration, function () {
|
6092
|
-
|
6093
|
-
tip.popperChildren.tooltip.classList.add('tippy-notransition');
|
6094
|
-
}
|
6095
|
-
|
6096
|
-
if (tip.props.autoFocus && tip.props.interactive && includes(['focus', 'click'], lastTriggerEvent.type)) {
|
6097
|
-
focus(tip.popper);
|
6098
|
-
}
|
6007
|
+
instance.popperChildren.tooltip.classList.add('tippy-notransition');
|
6099
6008
|
|
6100
|
-
if (
|
6101
|
-
|
6009
|
+
if (instance.props.aria) {
|
6010
|
+
instance.reference.setAttribute("aria-".concat(instance.props.aria), instance.popper.id);
|
6102
6011
|
}
|
6103
6012
|
|
6104
|
-
|
6105
|
-
|
6013
|
+
instance.props.onShown(instance);
|
6014
|
+
instance.state.isShown = true;
|
6106
6015
|
});
|
6107
6016
|
});
|
6108
6017
|
}
|
6109
|
-
|
6110
6018
|
/**
|
6111
6019
|
* Hides the tooltip
|
6112
6020
|
*/
|
6021
|
+
|
6022
|
+
|
6113
6023
|
function hide() {
|
6114
|
-
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue$1(
|
6024
|
+
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue$1(instance.props.duration, 1, Defaults$1.duration[1]);
|
6115
6025
|
|
6116
|
-
if (
|
6026
|
+
if (instance.state.isDestroyed || !instance.state.isEnabled) {
|
6117
6027
|
return;
|
6118
6028
|
}
|
6119
6029
|
|
6120
|
-
if (
|
6030
|
+
if (instance.props.onHide(instance) === false) {
|
6121
6031
|
return;
|
6122
6032
|
}
|
6123
6033
|
|
6124
|
-
|
6125
|
-
tip.popperChildren.tooltip.classList.remove('tippy-notransition');
|
6126
|
-
}
|
6034
|
+
instance.popperChildren.tooltip.classList.remove('tippy-notransition');
|
6127
6035
|
|
6128
|
-
if (
|
6129
|
-
|
6130
|
-
}
|
6131
|
-
|
6132
|
-
tip.popper.style.visibility = 'hidden';
|
6133
|
-
tip.state.isVisible = false;
|
6134
|
-
tip.state.isShown = false;
|
6135
|
-
|
6136
|
-
applyTransitionDuration([tip.popperChildren.tooltip, tip.popperChildren.backdrop, tip.popperChildren.content], duration);
|
6137
|
-
|
6138
|
-
setVisibilityState([tip.popperChildren.tooltip, tip.popperChildren.backdrop, tip.popperChildren.content], 'hidden');
|
6139
|
-
|
6140
|
-
if (tip.props.autoFocus && tip.props.interactive && !referenceJustProgrammaticallyFocused && includes(['focus', 'click'], lastTriggerEvent.type)) {
|
6141
|
-
if (lastTriggerEvent.type === 'focus') {
|
6142
|
-
referenceJustProgrammaticallyFocused = true;
|
6143
|
-
}
|
6144
|
-
focus(tip.reference);
|
6036
|
+
if (instance.props.interactive) {
|
6037
|
+
instance.reference.classList.remove('tippy-active');
|
6145
6038
|
}
|
6146
6039
|
|
6040
|
+
instance.popper.style.visibility = 'hidden';
|
6041
|
+
instance.state.isVisible = false;
|
6042
|
+
instance.state.isShown = false;
|
6043
|
+
applyTransitionDuration(getInnerElements(), duration);
|
6044
|
+
setVisibilityState(getInnerElements(), 'hidden');
|
6147
6045
|
onTransitionedOut(duration, function () {
|
6148
6046
|
if (!isPreparingToShow) {
|
6149
6047
|
removeFollowCursorListener();
|
6150
6048
|
}
|
6151
6049
|
|
6152
|
-
if (
|
6153
|
-
|
6050
|
+
if (instance.props.aria) {
|
6051
|
+
instance.reference.removeAttribute("aria-".concat(instance.props.aria));
|
6154
6052
|
}
|
6155
6053
|
|
6156
|
-
|
6157
|
-
|
6158
|
-
|
6159
|
-
|
6160
|
-
|
6161
|
-
tip.props.onHidden(tip);
|
6054
|
+
instance.popperInstance.disableEventListeners();
|
6055
|
+
instance.popperInstance.options.placement = instance.props.placement;
|
6056
|
+
parentNode.removeChild(instance.popper);
|
6057
|
+
instance.props.onHidden(instance);
|
6058
|
+
instance.state.isMounted = false;
|
6162
6059
|
});
|
6163
6060
|
}
|
6164
|
-
|
6165
6061
|
/**
|
6166
6062
|
* Destroys the tooltip
|
6167
6063
|
*/
|
6064
|
+
|
6065
|
+
|
6168
6066
|
function destroy(destroyTargetInstances) {
|
6169
|
-
if (
|
6067
|
+
if (instance.state.isDestroyed) {
|
6170
6068
|
return;
|
6171
|
-
}
|
6172
|
-
|
6173
|
-
// If the popper is currently mounted to the DOM, we want to ensure it gets
|
6069
|
+
} // If the popper is currently mounted to the DOM, we want to ensure it gets
|
6174
6070
|
// hidden and unmounted instantly upon destruction
|
6175
|
-
|
6071
|
+
|
6072
|
+
|
6073
|
+
if (instance.state.isMounted) {
|
6176
6074
|
hide(0);
|
6177
6075
|
}
|
6178
6076
|
|
6179
6077
|
removeTriggersFromReference();
|
6078
|
+
delete instance.reference._tippy;
|
6180
6079
|
|
6181
|
-
|
6182
|
-
|
6183
|
-
|
6184
|
-
|
6185
|
-
|
6186
|
-
arrayFrom(tip.reference.querySelectorAll(tip.props.target)).forEach(function (child) {
|
6187
|
-
return child._tippy && child._tippy.destroy();
|
6080
|
+
if (instance.props.target && destroyTargetInstances) {
|
6081
|
+
arrayFrom(instance.reference.querySelectorAll(instance.props.target)).forEach(function (child) {
|
6082
|
+
if (child._tippy) {
|
6083
|
+
child._tippy.destroy();
|
6084
|
+
}
|
6188
6085
|
});
|
6189
6086
|
}
|
6190
6087
|
|
6191
|
-
if (
|
6192
|
-
|
6088
|
+
if (instance.popperInstance) {
|
6089
|
+
instance.popperInstance.destroy();
|
6193
6090
|
}
|
6194
6091
|
|
6195
|
-
|
6196
|
-
|
6197
|
-
|
6092
|
+
instance.state.isDestroyed = true;
|
6093
|
+
}
|
6094
|
+
}
|
6095
|
+
|
6096
|
+
function group(instances) {
|
6097
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
6098
|
+
_ref$delay = _ref.delay,
|
6099
|
+
delay = _ref$delay === void 0 ? instances[0].props.delay : _ref$delay,
|
6100
|
+
_ref$duration = _ref.duration,
|
6101
|
+
duration = _ref$duration === void 0 ? 0 : _ref$duration;
|
6102
|
+
|
6103
|
+
var isAnyTippyOpen = false;
|
6104
|
+
instances.forEach(function (instance) {
|
6105
|
+
instance._originalProps = {
|
6106
|
+
duration: instance.props.duration,
|
6107
|
+
onHide: instance.props.onHide,
|
6108
|
+
onShow: instance.props.onShow,
|
6109
|
+
onShown: instance.props.onShown
|
6110
|
+
};
|
6111
|
+
});
|
6112
|
+
|
6113
|
+
function setIsAnyTippyOpen(value) {
|
6114
|
+
isAnyTippyOpen = value;
|
6115
|
+
updateInstances();
|
6116
|
+
}
|
6117
|
+
|
6118
|
+
function onShow(instance) {
|
6119
|
+
instance._originalProps.onShow(instance);
|
6120
|
+
|
6121
|
+
instances.forEach(function (instance) {
|
6122
|
+
instance.set({
|
6123
|
+
duration: duration
|
6124
|
+
});
|
6125
|
+
instance.hide();
|
6126
|
+
});
|
6127
|
+
setIsAnyTippyOpen(true);
|
6128
|
+
}
|
6129
|
+
|
6130
|
+
function onHide(instance) {
|
6131
|
+
instance._originalProps.onHide(instance);
|
6132
|
+
|
6133
|
+
setIsAnyTippyOpen(false);
|
6134
|
+
}
|
6135
|
+
|
6136
|
+
function onShown(instance) {
|
6137
|
+
instance._originalProps.onShown(instance);
|
6138
|
+
|
6139
|
+
instance.set({
|
6140
|
+
duration: instance._originalProps.duration
|
6141
|
+
});
|
6142
|
+
}
|
6198
6143
|
|
6199
|
-
|
6144
|
+
function updateInstances() {
|
6145
|
+
instances.forEach(function (instance) {
|
6146
|
+
instance.set({
|
6147
|
+
onShow: onShow,
|
6148
|
+
onShown: onShown,
|
6149
|
+
onHide: onHide,
|
6150
|
+
delay: isAnyTippyOpen ? [0, Array.isArray(delay) ? delay[1] : delay] : delay,
|
6151
|
+
duration: isAnyTippyOpen ? duration : instance._originalProps.duration
|
6152
|
+
});
|
6153
|
+
});
|
6200
6154
|
}
|
6155
|
+
|
6156
|
+
updateInstances();
|
6201
6157
|
}
|
6202
6158
|
|
6203
6159
|
var globalEventListenersBound = false;
|
6204
|
-
|
6205
6160
|
/**
|
6206
6161
|
* Exported module
|
6207
6162
|
* @param {String|Element|Element[]|NodeList|Object} targets
|
6208
6163
|
* @param {Object} options
|
6209
|
-
* @param {Boolean} one
|
6210
6164
|
* @return {Object}
|
6211
6165
|
*/
|
6212
|
-
|
6166
|
+
|
6167
|
+
function tippy(targets, options) {
|
6213
6168
|
validateOptions(options, Defaults$1);
|
6214
6169
|
|
6215
6170
|
if (!globalEventListenersBound) {
|
@@ -6217,85 +6172,80 @@
|
|
6217
6172
|
globalEventListenersBound = true;
|
6218
6173
|
}
|
6219
6174
|
|
6220
|
-
var props = _extends$2({}, Defaults$1, options);
|
6175
|
+
var props = _extends$2({}, Defaults$1, options); // If they are specifying a virtual positioning reference, we need to polyfill
|
6176
|
+
// some native DOM props
|
6177
|
+
|
6221
6178
|
|
6222
|
-
/**
|
6223
|
-
* If they are specifying a virtual positioning reference, we need to polyfill
|
6224
|
-
* some native DOM props
|
6225
|
-
*/
|
6226
6179
|
if (isPlainObject$1(targets)) {
|
6227
6180
|
polyfillElementPrototypeProperties(targets);
|
6228
6181
|
}
|
6229
6182
|
|
6230
|
-
var
|
6231
|
-
|
6183
|
+
var instances = getArrayOfElements(targets).reduce(function (acc, reference) {
|
6184
|
+
var instance = reference && createTippy(reference, props);
|
6232
6185
|
|
6233
|
-
|
6234
|
-
|
6235
|
-
if (tip) {
|
6236
|
-
acc.push(tip);
|
6186
|
+
if (instance) {
|
6187
|
+
acc.push(instance);
|
6237
6188
|
}
|
6189
|
+
|
6238
6190
|
return acc;
|
6239
6191
|
}, []);
|
6240
|
-
|
6241
|
-
var collection = {
|
6242
|
-
targets: targets,
|
6243
|
-
props: props,
|
6244
|
-
instances: instances,
|
6245
|
-
destroyAll: function destroyAll() {
|
6246
|
-
collection.instances.forEach(function (instance) {
|
6247
|
-
instance.destroy();
|
6248
|
-
});
|
6249
|
-
collection.instances = [];
|
6250
|
-
}
|
6251
|
-
};
|
6252
|
-
|
6253
|
-
return collection;
|
6192
|
+
return isSingular(targets) ? instances[0] : instances;
|
6254
6193
|
}
|
6255
|
-
|
6256
6194
|
/**
|
6257
6195
|
* Static props
|
6258
6196
|
*/
|
6259
|
-
tippy$1.version = version;
|
6260
|
-
tippy$1.defaults = Defaults$1;
|
6261
6197
|
|
6198
|
+
|
6199
|
+
tippy.version = version;
|
6200
|
+
tippy.defaults = Defaults$1;
|
6262
6201
|
/**
|
6263
6202
|
* Static methods
|
6264
6203
|
*/
|
6265
|
-
|
6266
|
-
|
6267
|
-
};
|
6268
|
-
tippy$1.setDefaults = function (partialDefaults) {
|
6204
|
+
|
6205
|
+
tippy.setDefaults = function (partialDefaults) {
|
6269
6206
|
Object.keys(partialDefaults).forEach(function (key) {
|
6270
6207
|
Defaults$1[key] = partialDefaults[key];
|
6271
6208
|
});
|
6272
6209
|
};
|
6273
|
-
tippy$1.disableAnimations = function () {
|
6274
|
-
tippy$1.setDefaults({
|
6275
|
-
duration: 0,
|
6276
|
-
updateDuration: 0,
|
6277
|
-
animateFill: false
|
6278
|
-
});
|
6279
|
-
};
|
6280
|
-
tippy$1.hideAllPoppers = hideAllPoppers;
|
6281
|
-
// noop: deprecated static method as capture phase is now default
|
6282
|
-
tippy$1.useCapture = function () {};
|
6283
6210
|
|
6211
|
+
tippy.hideAll = hideAll;
|
6212
|
+
tippy.group = group;
|
6284
6213
|
/**
|
6285
6214
|
* Auto-init tooltips for elements with a `data-tippy="..."` attribute
|
6286
6215
|
*/
|
6287
|
-
|
6216
|
+
|
6217
|
+
function autoInit() {
|
6288
6218
|
arrayFrom(document.querySelectorAll('[data-tippy]')).forEach(function (el) {
|
6289
6219
|
var content = el.getAttribute('data-tippy');
|
6220
|
+
|
6290
6221
|
if (content) {
|
6291
|
-
tippy
|
6222
|
+
tippy(el, {
|
6223
|
+
content: content
|
6224
|
+
});
|
6292
6225
|
}
|
6293
6226
|
});
|
6294
|
-
}
|
6227
|
+
}
|
6228
|
+
|
6295
6229
|
if (isBrowser$1) {
|
6296
6230
|
setTimeout(autoInit);
|
6297
6231
|
}
|
6298
6232
|
|
6233
|
+
/**
|
6234
|
+
* Injects a string of CSS styles to a style node in <head>
|
6235
|
+
* @param {String} css
|
6236
|
+
*/
|
6237
|
+
|
6238
|
+
function injectCSS(css) {
|
6239
|
+
if (isBrowser$1) {
|
6240
|
+
var style = document.createElement('style');
|
6241
|
+
style.type = 'text/css';
|
6242
|
+
style.textContent = css;
|
6243
|
+
document.head.insertBefore(style, document.head.firstChild);
|
6244
|
+
}
|
6245
|
+
}
|
6246
|
+
|
6247
|
+
injectCSS(css);
|
6248
|
+
|
6299
6249
|
var missingTippy = 'Using the attachment feature of Shepherd requires the Tippy.js library';
|
6300
6250
|
|
6301
6251
|
var centeredStylePopperModifier = {
|
@@ -6376,7 +6326,7 @@
|
|
6376
6326
|
*/
|
6377
6327
|
|
6378
6328
|
function setupTooltip() {
|
6379
|
-
if (isUndefined(tippy
|
6329
|
+
if (isUndefined(tippy)) {
|
6380
6330
|
throw new Error(missingTippy);
|
6381
6331
|
}
|
6382
6332
|
|
@@ -6430,7 +6380,7 @@
|
|
6430
6380
|
|
6431
6381
|
var tippyOptions = _makeAttachedTippyOptions.call(this, attachToOptions);
|
6432
6382
|
|
6433
|
-
return tippy
|
6383
|
+
return tippy(attachToOptions.element, tippyOptions);
|
6434
6384
|
}
|
6435
6385
|
/**
|
6436
6386
|
* Generates the hash of options that will be passed to `Tippy` instances
|
@@ -6479,7 +6429,7 @@
|
|
6479
6429
|
});
|
6480
6430
|
|
6481
6431
|
tippyOptions.popperOptions = finalPopperOptions;
|
6482
|
-
return tippy
|
6432
|
+
return tippy(document.body, tippyOptions);
|
6483
6433
|
}
|
6484
6434
|
|
6485
6435
|
/**
|
@@ -6709,7 +6659,7 @@
|
|
6709
6659
|
var buttons = createFromHTML('<ul class="shepherd-buttons"></ul>');
|
6710
6660
|
footer.classList.add('shepherd-footer');
|
6711
6661
|
this.options.buttons.map(function (cfg) {
|
6712
|
-
var button = createFromHTML("<li><a class=\"shepherd-button ".concat(cfg.classes || '', "\">").concat(cfg.text, "</a>"));
|
6662
|
+
var button = createFromHTML("<li><a class=\"shepherd-button ".concat(cfg.classes || '', "\" tabindex=\"0\">").concat(cfg.text, "</a>"));
|
6713
6663
|
buttons.appendChild(button);
|
6714
6664
|
|
6715
6665
|
_this2.bindButtonEvents(cfg, button.querySelector('a'));
|
@@ -7012,27 +6962,6 @@
|
|
7012
6962
|
return Step;
|
7013
6963
|
}(Evented);
|
7014
6964
|
|
7015
|
-
var isBrowser$2 = typeof window !== 'undefined';
|
7016
|
-
var nav$1 = isBrowser$2 ? navigator : {};
|
7017
|
-
var win$1 = isBrowser$2 ? window : {};
|
7018
|
-
var isBrowserSupported = 'MutationObserver' in win$1;
|
7019
|
-
var isIE$2 = /MSIE |Trident\//.test(nav$1.userAgent);
|
7020
|
-
var isIOS$1 = /iPhone|iPad|iPod/.test(nav$1.platform) && !win$1.MSStream;
|
7021
|
-
|
7022
|
-
/**
|
7023
|
-
* Injects a string of CSS styles to a style node in <head>
|
7024
|
-
* @param {String} css
|
7025
|
-
*/
|
7026
|
-
|
7027
|
-
function injectCSS(css) {
|
7028
|
-
if (isBrowserSupported) {
|
7029
|
-
var style = document.createElement('style');
|
7030
|
-
style.type = 'text/css';
|
7031
|
-
style.textContent = css;
|
7032
|
-
document.head.insertBefore(style, document.head.firstChild);
|
7033
|
-
}
|
7034
|
-
}
|
7035
|
-
|
7036
6965
|
/** `Object#toString` result references. */
|
7037
6966
|
var numberTag$1 = '[object Number]';
|
7038
6967
|
|
@@ -7207,11 +7136,14 @@
|
|
7207
7136
|
x = _targetElement$getBou.x,
|
7208
7137
|
y = _targetElement$getBou.y,
|
7209
7138
|
width = _targetElement$getBou.width,
|
7210
|
-
height = _targetElement$getBou.height
|
7139
|
+
height = _targetElement$getBou.height,
|
7140
|
+
left = _targetElement$getBou.left,
|
7141
|
+
top = _targetElement$getBou.top; // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top
|
7142
|
+
|
7211
7143
|
|
7212
7144
|
_setAttributes(openingElement, {
|
7213
|
-
x: x,
|
7214
|
-
y: y,
|
7145
|
+
x: x || left,
|
7146
|
+
y: y || top,
|
7215
7147
|
width: width,
|
7216
7148
|
height: height
|
7217
7149
|
});
|
@@ -7753,7 +7685,7 @@
|
|
7753
7685
|
* }, 'deferred');
|
7754
7686
|
* // => Logs 'deferred' after one millisecond.
|
7755
7687
|
*/
|
7756
|
-
var defer
|
7688
|
+
var defer = baseRest(function(func, args) {
|
7757
7689
|
return baseDelay(func, 1, args);
|
7758
7690
|
});
|
7759
7691
|
|
@@ -7784,7 +7716,7 @@
|
|
7784
7716
|
value: function cleanup() {
|
7785
7717
|
var _this = this;
|
7786
7718
|
|
7787
|
-
defer
|
7719
|
+
defer(function () {
|
7788
7720
|
var element = _this._modalOverlayElem;
|
7789
7721
|
|
7790
7722
|
if (element && element instanceof SVGElement) {
|
@@ -7866,12 +7798,9 @@
|
|
7866
7798
|
return Modal;
|
7867
7799
|
}();
|
7868
7800
|
|
7869
|
-
var tippyStyles = ".tippy-iOS{cursor:pointer!important}.tippy-notransition{transition:none!important}.tippy-popper{-webkit-perspective:700px;perspective:700px;z-index:9999;outline:0;transition-timing-function:cubic-bezier(.165,.84,.44,1);pointer-events:none;line-height:1.4;max-width:calc(100% - 10px)}.tippy-popper[x-placement^=top] .tippy-backdrop{border-radius:40% 40% 0 0}.tippy-popper[x-placement^=top] .tippy-roundarrow{bottom:-8px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.tippy-popper[x-placement^=top] .tippy-arrow{border-top:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;bottom:-7px;margin:0 6px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-backdrop{-webkit-transform-origin:0 25%;transform-origin:0 25%}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-55%);transform:scale(1) translate(-50%,-55%)}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%,-45%);transform:scale(.2) translate(-50%,-45%);opacity:0}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}.tippy-popper[x-placement^=top] [data-animation=perspective]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=visible]{-webkit-transform:translateY(-10px) rotateX(0);transform:translateY(-10px) rotateX(0)}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) rotateX(60deg);transform:translateY(0) rotateX(60deg)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(-10px) scale(1);transform:translateY(-10px) scale(1)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) scale(.5);transform:translateY(0) scale(.5)}.tippy-popper[x-placement^=bottom] .tippy-backdrop{border-radius:0 0 30% 30%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow{top:-8px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(0);transform:rotate(0)}.tippy-popper[x-placement^=bottom] .tippy-arrow{border-bottom:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;top:-7px;margin:0 6px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-backdrop{-webkit-transform-origin:0 -50%;transform-origin:0 -50%}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-45%);transform:scale(1) translate(-50%,-45%)}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%);transform:scale(.2) translate(-50%);opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=visible]{-webkit-transform:translateY(10px) rotateX(0);transform:translateY(10px) rotateX(0)}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) rotateX(-60deg);transform:translateY(0) rotateX(-60deg)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(10px) scale(1);transform:translateY(10px) scale(1)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) scale(.5);transform:translateY(0) scale(.5)}.tippy-popper[x-placement^=left] .tippy-backdrop{border-radius:50% 0 0 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow{right:-16px;-webkit-transform-origin:33.33333333% 50%;transform-origin:33.33333333% 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.tippy-popper[x-placement^=left] .tippy-arrow{border-left:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;right:-7px;margin:3px 0;-webkit-transform-origin:0 50%;transform-origin:0 50%}.tippy-popper[x-placement^=left] .tippy-backdrop{-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-75%,-50%);transform:scale(.2) translate(-75%,-50%);opacity:0}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}.tippy-popper[x-placement^=left] [data-animation=perspective]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=visible]{-webkit-transform:translateX(-10px) rotateY(0);transform:translateX(-10px) rotateY(0)}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) rotateY(-60deg);transform:translateX(0) rotateY(-60deg)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(-10px) scale(1);transform:translateX(-10px) scale(1)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) scale(.5);transform:translateX(0) scale(.5)}.tippy-popper[x-placement^=right] .tippy-backdrop{border-radius:0 50% 50% 0}.tippy-popper[x-placement^=right] .tippy-roundarrow{left:-16px;-webkit-transform-origin:66.66666666% 50%;transform-origin:66.66666666% 50%}.tippy-popper[x-placement^=right] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.tippy-popper[x-placement^=right] .tippy-arrow{border-right:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;left:-7px;margin:3px 0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tippy-popper[x-placement^=right] .tippy-backdrop{-webkit-transform-origin:-50% 0;transform-origin:-50% 0}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-25%,-50%);transform:scale(.2) translate(-25%,-50%);opacity:0}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.tippy-popper[x-placement^=right] [data-animation=perspective]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=visible]{-webkit-transform:translateX(10px) rotateY(0);transform:translateX(10px) rotateY(0)}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) rotateY(60deg);transform:translateX(0) rotateY(60deg)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(10px) scale(1);transform:translateX(10px) scale(1)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) scale(.5);transform:translateX(0) scale(.5)}.tippy-tooltip{position:relative;color:#fff;border-radius:4px;font-size:.9rem;padding:.3rem .6rem;max-width:350px;text-align:center;will-change:transform;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#333}.tippy-tooltip[data-size=small]{padding:.2rem .4rem;font-size:.75rem}.tippy-tooltip[data-size=large]{padding:.4rem .8rem;font-size:1rem}.tippy-tooltip[data-animatefill]{overflow:hidden;background-color:transparent}.tippy-tooltip[data-interactive],.tippy-tooltip[data-interactive] path{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-tooltip[data-inertia][data-state=hidden]{transition-timing-function:ease}.tippy-arrow,.tippy-roundarrow{position:absolute;width:0;height:0}.tippy-roundarrow{width:24px;height:8px;fill:#333;pointer-events:none}.tippy-backdrop{position:absolute;will-change:transform;background-color:#333;border-radius:50%;width:calc(110% + 2rem);left:50%;top:50%;z-index:-1;transition:all cubic-bezier(.46,.1,.52,.98);-webkit-backface-visibility:hidden;backface-visibility:hidden}.tippy-backdrop:after{content:\"\";float:left;padding-top:100%}.tippy-backdrop+.tippy-content{transition-property:opacity;will-change:opacity}.tippy-backdrop+.tippy-content[data-state=visible]{opacity:1}.tippy-backdrop+.tippy-content[data-state=hidden]{opacity:0}";
|
7870
|
-
|
7871
7801
|
var defaults = {
|
7872
7802
|
trigger: 'manual',
|
7873
7803
|
arrow: true,
|
7874
|
-
arrowTransform: 'scale(2)',
|
7875
7804
|
animation: 'fade',
|
7876
7805
|
duration: 420,
|
7877
7806
|
flip: true,
|
@@ -7965,7 +7894,7 @@
|
|
7965
7894
|
_classCallCheck(this, Tour);
|
7966
7895
|
|
7967
7896
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(Tour).call(this, options));
|
7968
|
-
bindMethods.call(_assertThisInitialized(_assertThisInitialized(_this)), ['back', 'cancel', 'complete', 'next']);
|
7897
|
+
bindMethods.call(_assertThisInitialized(_assertThisInitialized(_this)), ['back', 'cancel', 'complete', 'hide', 'next']);
|
7969
7898
|
_this.options = options;
|
7970
7899
|
_this.steps = _this.options.steps || []; // Pass these events onto the global Shepherd object
|
7971
7900
|
|
@@ -7985,7 +7914,6 @@
|
|
7985
7914
|
|
7986
7915
|
_this._setTourID();
|
7987
7916
|
|
7988
|
-
injectCSS(tippyStyles);
|
7989
7917
|
return _possibleConstructorReturn(_this, _assertThisInitialized(_assertThisInitialized(_this)));
|
7990
7918
|
}
|
7991
7919
|
/**
|
@@ -8300,7 +8228,7 @@
|
|
8300
8228
|
}, {
|
8301
8229
|
key: "_setTooltipDefaults",
|
8302
8230
|
value: function _setTooltipDefaults() {
|
8303
|
-
tippy
|
8231
|
+
tippy.setDefaults(defaults);
|
8304
8232
|
}
|
8305
8233
|
}, {
|
8306
8234
|
key: "_updateStateBeforeShow",
|