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