react-shepherd 3.3.3 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Shepherd.es.js +329 -281
- package/dist/Shepherd.es.js.map +1 -1
- package/dist/Shepherd.js +331 -283
- package/dist/Shepherd.js.map +1 -1
- package/package.json +3 -3
package/dist/Shepherd.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
/*! shepherd.js 8.1
|
|
3
|
+
/*! shepherd.js 8.3.1 */
|
|
4
4
|
var isMergeableObject = function isMergeableObject(value) {
|
|
5
5
|
return isNonNullObject(value) && !isSpecial(value);
|
|
6
6
|
};
|
|
@@ -130,7 +130,7 @@ var cjs = deepmerge_1;
|
|
|
130
130
|
* @param {*} value The param to check if it is an Element
|
|
131
131
|
*/
|
|
132
132
|
|
|
133
|
-
function isElement(value) {
|
|
133
|
+
function isElement$1(value) {
|
|
134
134
|
return value instanceof Element;
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
@@ -139,7 +139,7 @@ function isElement(value) {
|
|
|
139
139
|
*/
|
|
140
140
|
|
|
141
141
|
|
|
142
|
-
function isHTMLElement(value) {
|
|
142
|
+
function isHTMLElement$1(value) {
|
|
143
143
|
return value instanceof HTMLElement;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
@@ -351,12 +351,12 @@ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain,
|
|
|
351
351
|
function getNodeName(element) {
|
|
352
352
|
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
353
353
|
}
|
|
354
|
-
/*:: import type { Window } from '../types'; */
|
|
355
|
-
|
|
356
|
-
/*:: declare function getWindow(node: Node | Window): Window; */
|
|
357
|
-
|
|
358
354
|
|
|
359
355
|
function getWindow(node) {
|
|
356
|
+
if (node == null) {
|
|
357
|
+
return window;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
360
|
if (node.toString() !== '[object Window]') {
|
|
361
361
|
var ownerDocument = node.ownerDocument;
|
|
362
362
|
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
@@ -364,21 +364,25 @@ function getWindow(node) {
|
|
|
364
364
|
|
|
365
365
|
return node;
|
|
366
366
|
}
|
|
367
|
-
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
|
|
368
|
-
Element); */
|
|
369
|
-
|
|
370
367
|
|
|
371
|
-
function isElement
|
|
368
|
+
function isElement(node) {
|
|
372
369
|
var OwnElement = getWindow(node).Element;
|
|
373
370
|
return node instanceof OwnElement || node instanceof Element;
|
|
374
371
|
}
|
|
375
|
-
/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
|
|
376
|
-
HTMLElement); */
|
|
377
372
|
|
|
378
|
-
|
|
379
|
-
function isHTMLElement$1(node) {
|
|
373
|
+
function isHTMLElement(node) {
|
|
380
374
|
var OwnElement = getWindow(node).HTMLElement;
|
|
381
375
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function isShadowRoot(node) {
|
|
379
|
+
// IE 11 has no ShadowRoot
|
|
380
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
385
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
382
386
|
} // and applies them to the HTMLElements such as popper and arrow
|
|
383
387
|
|
|
384
388
|
|
|
@@ -389,11 +393,11 @@ function applyStyles(_ref) {
|
|
|
389
393
|
var attributes = state.attributes[name] || {};
|
|
390
394
|
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
391
395
|
|
|
392
|
-
if (!isHTMLElement
|
|
396
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
393
397
|
return;
|
|
394
398
|
} // Flow doesn't support to extend this property, but it's the most
|
|
395
399
|
// effective way to apply styles to an HTMLElement
|
|
396
|
-
// $FlowFixMe
|
|
400
|
+
// $FlowFixMe[cannot-write]
|
|
397
401
|
|
|
398
402
|
|
|
399
403
|
Object.assign(element.style, style);
|
|
@@ -409,7 +413,7 @@ function applyStyles(_ref) {
|
|
|
409
413
|
});
|
|
410
414
|
}
|
|
411
415
|
|
|
412
|
-
function effect(_ref2) {
|
|
416
|
+
function effect$2(_ref2) {
|
|
413
417
|
var state = _ref2.state;
|
|
414
418
|
var initialStyles = {
|
|
415
419
|
popper: {
|
|
@@ -424,6 +428,7 @@ function effect(_ref2) {
|
|
|
424
428
|
reference: {}
|
|
425
429
|
};
|
|
426
430
|
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
431
|
+
state.styles = initialStyles;
|
|
427
432
|
|
|
428
433
|
if (state.elements.arrow) {
|
|
429
434
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
@@ -440,12 +445,9 @@ function effect(_ref2) {
|
|
|
440
445
|
return style;
|
|
441
446
|
}, {}); // arrow is optional + virtual elements
|
|
442
447
|
|
|
443
|
-
if (!isHTMLElement
|
|
448
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
444
449
|
return;
|
|
445
|
-
}
|
|
446
|
-
// effective way to apply styles to an HTMLElement
|
|
447
|
-
// $FlowFixMe
|
|
448
|
-
|
|
450
|
+
}
|
|
449
451
|
|
|
450
452
|
Object.assign(element.style, style);
|
|
451
453
|
Object.keys(attributes).forEach(function (attribute) {
|
|
@@ -461,45 +463,70 @@ var applyStyles$1 = {
|
|
|
461
463
|
enabled: true,
|
|
462
464
|
phase: 'write',
|
|
463
465
|
fn: applyStyles,
|
|
464
|
-
effect: effect,
|
|
466
|
+
effect: effect$2,
|
|
465
467
|
requires: ['computeStyles']
|
|
466
468
|
};
|
|
467
469
|
|
|
468
470
|
function getBasePlacement(placement) {
|
|
469
471
|
return placement.split('-')[0];
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function getBoundingClientRect(element) {
|
|
475
|
+
var rect = element.getBoundingClientRect();
|
|
476
|
+
return {
|
|
477
|
+
width: rect.width,
|
|
478
|
+
height: rect.height,
|
|
479
|
+
top: rect.top,
|
|
480
|
+
right: rect.right,
|
|
481
|
+
bottom: rect.bottom,
|
|
482
|
+
left: rect.left,
|
|
483
|
+
x: rect.left,
|
|
484
|
+
y: rect.top
|
|
485
|
+
};
|
|
486
|
+
} // means it doesn't take into account transforms.
|
|
472
487
|
|
|
473
488
|
|
|
474
489
|
function getLayoutRect(element) {
|
|
490
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
491
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
492
|
+
|
|
493
|
+
var width = element.offsetWidth;
|
|
494
|
+
var height = element.offsetHeight;
|
|
495
|
+
|
|
496
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
497
|
+
width = clientRect.width;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
501
|
+
height = clientRect.height;
|
|
502
|
+
}
|
|
503
|
+
|
|
475
504
|
return {
|
|
476
505
|
x: element.offsetLeft,
|
|
477
506
|
y: element.offsetTop,
|
|
478
|
-
width:
|
|
479
|
-
height:
|
|
507
|
+
width: width,
|
|
508
|
+
height: height
|
|
480
509
|
};
|
|
481
510
|
}
|
|
482
511
|
|
|
483
512
|
function contains(parent, child) {
|
|
484
|
-
var rootNode = child.getRootNode && child.getRootNode(); //
|
|
485
|
-
|
|
486
|
-
var isShadow = Boolean(rootNode && rootNode.host); // First, attempt with faster native method
|
|
513
|
+
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
|
487
514
|
|
|
488
515
|
if (parent.contains(child)) {
|
|
489
516
|
return true;
|
|
490
517
|
} // then fallback to custom implementation with Shadow DOM support
|
|
491
|
-
else if (
|
|
492
|
-
|
|
518
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
519
|
+
var next = child;
|
|
493
520
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
521
|
+
do {
|
|
522
|
+
if (next && parent.isSameNode(next)) {
|
|
523
|
+
return true;
|
|
524
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
498
525
|
|
|
499
526
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
527
|
+
next = next.parentNode || next.host;
|
|
528
|
+
} while (next);
|
|
529
|
+
} // Give up, the result is false
|
|
503
530
|
|
|
504
531
|
|
|
505
532
|
return false;
|
|
@@ -514,8 +541,9 @@ function isTableElement(element) {
|
|
|
514
541
|
}
|
|
515
542
|
|
|
516
543
|
function getDocumentElement(element) {
|
|
517
|
-
// $FlowFixMe: assume body is always available
|
|
518
|
-
return ((isElement
|
|
544
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
545
|
+
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
546
|
+
element.document) || window.document).documentElement;
|
|
519
547
|
}
|
|
520
548
|
|
|
521
549
|
function getParentNode(element) {
|
|
@@ -523,46 +551,50 @@ function getParentNode(element) {
|
|
|
523
551
|
return element;
|
|
524
552
|
}
|
|
525
553
|
|
|
526
|
-
return (//
|
|
554
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
555
|
+
// $FlowFixMe[incompatible-return]
|
|
556
|
+
// $FlowFixMe[prop-missing]
|
|
527
557
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
528
|
-
element.parentNode || // DOM Element detected
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
// $FlowFixMe: HTMLElement is a Node
|
|
558
|
+
element.parentNode || ( // DOM Element detected
|
|
559
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
560
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
532
561
|
getDocumentElement(element) // fallback
|
|
533
562
|
|
|
534
563
|
);
|
|
535
564
|
}
|
|
536
565
|
|
|
537
566
|
function getTrueOffsetParent(element) {
|
|
538
|
-
if (!isHTMLElement
|
|
567
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
539
568
|
getComputedStyle(element).position === 'fixed') {
|
|
540
569
|
return null;
|
|
541
570
|
}
|
|
542
571
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
if (offsetParent) {
|
|
546
|
-
var html = getDocumentElement(offsetParent);
|
|
547
|
-
|
|
548
|
-
if (getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && getComputedStyle(html).position !== 'static') {
|
|
549
|
-
return html;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
return offsetParent;
|
|
572
|
+
return element.offsetParent;
|
|
554
573
|
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
|
555
574
|
// return the containing block
|
|
556
575
|
|
|
557
576
|
|
|
558
577
|
function getContainingBlock(element) {
|
|
578
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
|
|
579
|
+
var isIE = navigator.userAgent.indexOf('Trident') !== -1;
|
|
580
|
+
|
|
581
|
+
if (isIE && isHTMLElement(element)) {
|
|
582
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
583
|
+
var elementCss = getComputedStyle(element);
|
|
584
|
+
|
|
585
|
+
if (elementCss.position === 'fixed') {
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
559
590
|
var currentNode = getParentNode(element);
|
|
560
591
|
|
|
561
|
-
while (isHTMLElement
|
|
592
|
+
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
562
593
|
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
563
594
|
// create a containing block.
|
|
595
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
564
596
|
|
|
565
|
-
if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== '
|
|
597
|
+
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
|
566
598
|
return currentNode;
|
|
567
599
|
} else {
|
|
568
600
|
currentNode = currentNode.parentNode;
|
|
@@ -582,7 +614,7 @@ function getOffsetParent(element) {
|
|
|
582
614
|
offsetParent = getTrueOffsetParent(offsetParent);
|
|
583
615
|
}
|
|
584
616
|
|
|
585
|
-
if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static') {
|
|
617
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
|
586
618
|
return window;
|
|
587
619
|
}
|
|
588
620
|
|
|
@@ -593,8 +625,12 @@ function getMainAxisFromPlacement(placement) {
|
|
|
593
625
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
594
626
|
}
|
|
595
627
|
|
|
596
|
-
|
|
597
|
-
|
|
628
|
+
var max = Math.max;
|
|
629
|
+
var min = Math.min;
|
|
630
|
+
var round = Math.round;
|
|
631
|
+
|
|
632
|
+
function within(min$1, value, max$1) {
|
|
633
|
+
return max(min$1, min(value, max$1));
|
|
598
634
|
}
|
|
599
635
|
|
|
600
636
|
function getFreshSideObject() {
|
|
@@ -607,7 +643,7 @@ function getFreshSideObject() {
|
|
|
607
643
|
}
|
|
608
644
|
|
|
609
645
|
function mergePaddingObject(paddingObject) {
|
|
610
|
-
return Object.assign(
|
|
646
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
611
647
|
}
|
|
612
648
|
|
|
613
649
|
function expandToHashMap(value, keys) {
|
|
@@ -617,11 +653,19 @@ function expandToHashMap(value, keys) {
|
|
|
617
653
|
}, {});
|
|
618
654
|
}
|
|
619
655
|
|
|
656
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
657
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
658
|
+
placement: state.placement
|
|
659
|
+
})) : padding;
|
|
660
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
661
|
+
};
|
|
662
|
+
|
|
620
663
|
function arrow(_ref) {
|
|
621
664
|
var _state$modifiersData$;
|
|
622
665
|
|
|
623
666
|
var state = _ref.state,
|
|
624
|
-
name = _ref.name
|
|
667
|
+
name = _ref.name,
|
|
668
|
+
options = _ref.options;
|
|
625
669
|
var arrowElement = state.elements.arrow;
|
|
626
670
|
var popperOffsets = state.modifiersData.popperOffsets;
|
|
627
671
|
var basePlacement = getBasePlacement(state.placement);
|
|
@@ -633,7 +677,7 @@ function arrow(_ref) {
|
|
|
633
677
|
return;
|
|
634
678
|
}
|
|
635
679
|
|
|
636
|
-
var paddingObject =
|
|
680
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
637
681
|
var arrowRect = getLayoutRect(arrowElement);
|
|
638
682
|
var minProp = axis === 'y' ? top : left;
|
|
639
683
|
var maxProp = axis === 'y' ? bottom : right;
|
|
@@ -655,12 +699,9 @@ function arrow(_ref) {
|
|
|
655
699
|
|
|
656
700
|
function effect$1(_ref2) {
|
|
657
701
|
var state = _ref2.state,
|
|
658
|
-
options = _ref2.options
|
|
659
|
-
name = _ref2.name;
|
|
702
|
+
options = _ref2.options;
|
|
660
703
|
var _options$element = options.element,
|
|
661
|
-
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element
|
|
662
|
-
_options$padding = options.padding,
|
|
663
|
-
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
704
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
664
705
|
|
|
665
706
|
if (arrowElement == null) {
|
|
666
707
|
return;
|
|
@@ -680,9 +721,6 @@ function effect$1(_ref2) {
|
|
|
680
721
|
}
|
|
681
722
|
|
|
682
723
|
state.elements.arrow = arrowElement;
|
|
683
|
-
state.modifiersData[name + "#persistent"] = {
|
|
684
|
-
padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))
|
|
685
|
-
};
|
|
686
724
|
} // eslint-disable-next-line import/no-unused-modules
|
|
687
725
|
|
|
688
726
|
|
|
@@ -704,14 +742,14 @@ var unsetSides = {
|
|
|
704
742
|
// Zooming can change the DPR, but it seems to report a value that will
|
|
705
743
|
// cleanly divide the values into the appropriate subpixels.
|
|
706
744
|
|
|
707
|
-
function
|
|
745
|
+
function roundOffsetsByDPR(_ref) {
|
|
708
746
|
var x = _ref.x,
|
|
709
747
|
y = _ref.y;
|
|
710
748
|
var win = window;
|
|
711
749
|
var dpr = win.devicePixelRatio || 1;
|
|
712
750
|
return {
|
|
713
|
-
x:
|
|
714
|
-
y:
|
|
751
|
+
x: round(round(x * dpr) / dpr) || 0,
|
|
752
|
+
y: round(round(y * dpr) / dpr) || 0
|
|
715
753
|
};
|
|
716
754
|
}
|
|
717
755
|
|
|
@@ -724,11 +762,14 @@ function mapToStyles(_ref2) {
|
|
|
724
762
|
offsets = _ref2.offsets,
|
|
725
763
|
position = _ref2.position,
|
|
726
764
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
727
|
-
adaptive = _ref2.adaptive
|
|
765
|
+
adaptive = _ref2.adaptive,
|
|
766
|
+
roundOffsets = _ref2.roundOffsets;
|
|
728
767
|
|
|
729
|
-
var
|
|
730
|
-
x =
|
|
731
|
-
|
|
768
|
+
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
|
769
|
+
_ref3$x = _ref3.x,
|
|
770
|
+
x = _ref3$x === void 0 ? 0 : _ref3$x,
|
|
771
|
+
_ref3$y = _ref3.y,
|
|
772
|
+
y = _ref3$y === void 0 ? 0 : _ref3$y;
|
|
732
773
|
|
|
733
774
|
var hasX = offsets.hasOwnProperty('x');
|
|
734
775
|
var hasY = offsets.hasOwnProperty('y');
|
|
@@ -738,23 +779,32 @@ function mapToStyles(_ref2) {
|
|
|
738
779
|
|
|
739
780
|
if (adaptive) {
|
|
740
781
|
var offsetParent = getOffsetParent(popper);
|
|
782
|
+
var heightProp = 'clientHeight';
|
|
783
|
+
var widthProp = 'clientWidth';
|
|
741
784
|
|
|
742
785
|
if (offsetParent === getWindow(popper)) {
|
|
743
786
|
offsetParent = getDocumentElement(popper);
|
|
744
|
-
} // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
745
787
|
|
|
746
|
-
|
|
788
|
+
if (getComputedStyle(offsetParent).position !== 'static') {
|
|
789
|
+
heightProp = 'scrollHeight';
|
|
790
|
+
widthProp = 'scrollWidth';
|
|
791
|
+
}
|
|
792
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
793
|
+
|
|
747
794
|
|
|
795
|
+
offsetParent = offsetParent;
|
|
748
796
|
|
|
749
797
|
if (placement === top) {
|
|
750
|
-
sideY = bottom;
|
|
751
|
-
|
|
798
|
+
sideY = bottom; // $FlowFixMe[prop-missing]
|
|
799
|
+
|
|
800
|
+
y -= offsetParent[heightProp] - popperRect.height;
|
|
752
801
|
y *= gpuAcceleration ? 1 : -1;
|
|
753
802
|
}
|
|
754
803
|
|
|
755
804
|
if (placement === left) {
|
|
756
|
-
sideX = right;
|
|
757
|
-
|
|
805
|
+
sideX = right; // $FlowFixMe[prop-missing]
|
|
806
|
+
|
|
807
|
+
x -= offsetParent[widthProp] - popperRect.width;
|
|
758
808
|
x *= gpuAcceleration ? 1 : -1;
|
|
759
809
|
}
|
|
760
810
|
}
|
|
@@ -766,19 +816,21 @@ function mapToStyles(_ref2) {
|
|
|
766
816
|
if (gpuAcceleration) {
|
|
767
817
|
var _Object$assign;
|
|
768
818
|
|
|
769
|
-
return Object.assign(
|
|
819
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
770
820
|
}
|
|
771
821
|
|
|
772
|
-
return Object.assign(
|
|
822
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
773
823
|
}
|
|
774
824
|
|
|
775
|
-
function computeStyles(
|
|
776
|
-
var state =
|
|
777
|
-
options =
|
|
825
|
+
function computeStyles(_ref4) {
|
|
826
|
+
var state = _ref4.state,
|
|
827
|
+
options = _ref4.options;
|
|
778
828
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
779
829
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
780
830
|
_options$adaptive = options.adaptive,
|
|
781
|
-
adaptive = _options$adaptive === void 0 ? true : _options$adaptive
|
|
831
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
832
|
+
_options$roundOffsets = options.roundOffsets,
|
|
833
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
782
834
|
var commonStyles = {
|
|
783
835
|
placement: getBasePlacement(state.placement),
|
|
784
836
|
popper: state.elements.popper,
|
|
@@ -787,22 +839,24 @@ function computeStyles(_ref3) {
|
|
|
787
839
|
};
|
|
788
840
|
|
|
789
841
|
if (state.modifiersData.popperOffsets != null) {
|
|
790
|
-
state.styles.popper = Object.assign(
|
|
842
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
791
843
|
offsets: state.modifiersData.popperOffsets,
|
|
792
844
|
position: state.options.strategy,
|
|
793
|
-
adaptive: adaptive
|
|
845
|
+
adaptive: adaptive,
|
|
846
|
+
roundOffsets: roundOffsets
|
|
794
847
|
})));
|
|
795
848
|
}
|
|
796
849
|
|
|
797
850
|
if (state.modifiersData.arrow != null) {
|
|
798
|
-
state.styles.arrow = Object.assign(
|
|
851
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
799
852
|
offsets: state.modifiersData.arrow,
|
|
800
853
|
position: 'absolute',
|
|
801
|
-
adaptive: false
|
|
854
|
+
adaptive: false,
|
|
855
|
+
roundOffsets: roundOffsets
|
|
802
856
|
})));
|
|
803
857
|
}
|
|
804
858
|
|
|
805
|
-
state.attributes.popper = Object.assign(
|
|
859
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
806
860
|
'data-popper-placement': state.placement
|
|
807
861
|
});
|
|
808
862
|
} // eslint-disable-next-line import/no-unused-modules
|
|
@@ -819,7 +873,7 @@ var passive = {
|
|
|
819
873
|
passive: true
|
|
820
874
|
};
|
|
821
875
|
|
|
822
|
-
function effect
|
|
876
|
+
function effect(_ref) {
|
|
823
877
|
var state = _ref.state,
|
|
824
878
|
instance = _ref.instance,
|
|
825
879
|
options = _ref.options;
|
|
@@ -859,10 +913,10 @@ var eventListeners = {
|
|
|
859
913
|
enabled: true,
|
|
860
914
|
phase: 'write',
|
|
861
915
|
fn: function fn() {},
|
|
862
|
-
effect: effect
|
|
916
|
+
effect: effect,
|
|
863
917
|
data: {}
|
|
864
918
|
};
|
|
865
|
-
var hash = {
|
|
919
|
+
var hash$1 = {
|
|
866
920
|
left: 'right',
|
|
867
921
|
right: 'left',
|
|
868
922
|
bottom: 'top',
|
|
@@ -871,35 +925,21 @@ var hash = {
|
|
|
871
925
|
|
|
872
926
|
function getOppositePlacement(placement) {
|
|
873
927
|
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
874
|
-
return hash[matched];
|
|
928
|
+
return hash$1[matched];
|
|
875
929
|
});
|
|
876
930
|
}
|
|
877
931
|
|
|
878
|
-
var hash
|
|
932
|
+
var hash = {
|
|
879
933
|
start: 'end',
|
|
880
934
|
end: 'start'
|
|
881
935
|
};
|
|
882
936
|
|
|
883
937
|
function getOppositeVariationPlacement(placement) {
|
|
884
938
|
return placement.replace(/start|end/g, function (matched) {
|
|
885
|
-
return hash
|
|
939
|
+
return hash[matched];
|
|
886
940
|
});
|
|
887
941
|
}
|
|
888
942
|
|
|
889
|
-
function getBoundingClientRect(element) {
|
|
890
|
-
var rect = element.getBoundingClientRect();
|
|
891
|
-
return {
|
|
892
|
-
width: rect.width,
|
|
893
|
-
height: rect.height,
|
|
894
|
-
top: rect.top,
|
|
895
|
-
right: rect.right,
|
|
896
|
-
bottom: rect.bottom,
|
|
897
|
-
left: rect.left,
|
|
898
|
-
x: rect.left,
|
|
899
|
-
y: rect.top
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
|
|
903
943
|
function getWindowScroll(node) {
|
|
904
944
|
var win = getWindow(node);
|
|
905
945
|
var scrollLeft = win.pageXOffset;
|
|
@@ -961,16 +1001,18 @@ function getViewportRect(element) {
|
|
|
961
1001
|
|
|
962
1002
|
|
|
963
1003
|
function getDocumentRect(element) {
|
|
1004
|
+
var _element$ownerDocumen;
|
|
1005
|
+
|
|
964
1006
|
var html = getDocumentElement(element);
|
|
965
1007
|
var winScroll = getWindowScroll(element);
|
|
966
|
-
var body = element.ownerDocument.body;
|
|
967
|
-
var width =
|
|
968
|
-
var height =
|
|
1008
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
1009
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
1010
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
969
1011
|
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
970
1012
|
var y = -winScroll.scrollTop;
|
|
971
1013
|
|
|
972
1014
|
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
973
|
-
x +=
|
|
1015
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
974
1016
|
}
|
|
975
1017
|
|
|
976
1018
|
return {
|
|
@@ -993,11 +1035,11 @@ function isScrollParent(element) {
|
|
|
993
1035
|
|
|
994
1036
|
function getScrollParent(node) {
|
|
995
1037
|
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
996
|
-
// $FlowFixMe: assume body is always available
|
|
1038
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
997
1039
|
return node.ownerDocument.body;
|
|
998
1040
|
}
|
|
999
1041
|
|
|
1000
|
-
if (isHTMLElement
|
|
1042
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
1001
1043
|
return node;
|
|
1002
1044
|
}
|
|
1003
1045
|
|
|
@@ -1006,27 +1048,29 @@ function getScrollParent(node) {
|
|
|
1006
1048
|
/*
|
|
1007
1049
|
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
1008
1050
|
until we get to the top window object. This list is what we attach scroll listeners
|
|
1009
|
-
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
1051
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
1010
1052
|
reference element's position.
|
|
1011
1053
|
*/
|
|
1012
1054
|
|
|
1013
1055
|
|
|
1014
1056
|
function listScrollParents(element, list) {
|
|
1057
|
+
var _element$ownerDocumen;
|
|
1058
|
+
|
|
1015
1059
|
if (list === void 0) {
|
|
1016
1060
|
list = [];
|
|
1017
1061
|
}
|
|
1018
1062
|
|
|
1019
1063
|
var scrollParent = getScrollParent(element);
|
|
1020
|
-
var isBody =
|
|
1064
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
1021
1065
|
var win = getWindow(scrollParent);
|
|
1022
1066
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
1023
1067
|
var updatedList = list.concat(target);
|
|
1024
|
-
return isBody ? updatedList : // $FlowFixMe: isBody tells us target will be an HTMLElement here
|
|
1068
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
1025
1069
|
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
1026
1070
|
}
|
|
1027
1071
|
|
|
1028
1072
|
function rectToClientRect(rect) {
|
|
1029
|
-
return Object.assign(
|
|
1073
|
+
return Object.assign({}, rect, {
|
|
1030
1074
|
left: rect.x,
|
|
1031
1075
|
top: rect.y,
|
|
1032
1076
|
right: rect.x + rect.width,
|
|
@@ -1048,7 +1092,7 @@ function getInnerBoundingClientRect(element) {
|
|
|
1048
1092
|
}
|
|
1049
1093
|
|
|
1050
1094
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
1051
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement
|
|
1095
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1052
1096
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
1053
1097
|
// clipping (or hiding) overflowing elements with a position different from
|
|
1054
1098
|
// `initial`
|
|
@@ -1057,15 +1101,15 @@ function getClientRectFromMixedType(element, clippingParent) {
|
|
|
1057
1101
|
function getClippingParents(element) {
|
|
1058
1102
|
var clippingParents = listScrollParents(getParentNode(element));
|
|
1059
1103
|
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
|
1060
|
-
var clipperElement = canEscapeClipping && isHTMLElement
|
|
1104
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
1061
1105
|
|
|
1062
|
-
if (!isElement
|
|
1106
|
+
if (!isElement(clipperElement)) {
|
|
1063
1107
|
return [];
|
|
1064
|
-
} // $FlowFixMe: https://github.com/facebook/flow/issues/1414
|
|
1108
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
1065
1109
|
|
|
1066
1110
|
|
|
1067
1111
|
return clippingParents.filter(function (clippingParent) {
|
|
1068
|
-
return isElement
|
|
1112
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
1069
1113
|
});
|
|
1070
1114
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
1071
1115
|
// clipping parents
|
|
@@ -1077,10 +1121,10 @@ function getClippingRect(element, boundary, rootBoundary) {
|
|
|
1077
1121
|
var firstClippingParent = clippingParents[0];
|
|
1078
1122
|
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
1079
1123
|
var rect = getClientRectFromMixedType(element, clippingParent);
|
|
1080
|
-
accRect.top =
|
|
1081
|
-
accRect.right =
|
|
1082
|
-
accRect.bottom =
|
|
1083
|
-
accRect.left =
|
|
1124
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1125
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1126
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1127
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1084
1128
|
return accRect;
|
|
1085
1129
|
}, getClientRectFromMixedType(element, firstClippingParent));
|
|
1086
1130
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
@@ -1147,11 +1191,11 @@ function computeOffsets(_ref) {
|
|
|
1147
1191
|
|
|
1148
1192
|
switch (variation) {
|
|
1149
1193
|
case start:
|
|
1150
|
-
offsets[mainAxis] =
|
|
1194
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
1151
1195
|
break;
|
|
1152
1196
|
|
|
1153
1197
|
case end:
|
|
1154
|
-
offsets[mainAxis] =
|
|
1198
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
1155
1199
|
break;
|
|
1156
1200
|
}
|
|
1157
1201
|
}
|
|
@@ -1182,7 +1226,7 @@ function detectOverflow(state, options) {
|
|
|
1182
1226
|
var referenceElement = state.elements.reference;
|
|
1183
1227
|
var popperRect = state.rects.popper;
|
|
1184
1228
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
1185
|
-
var clippingClientRect = getClippingRect(isElement
|
|
1229
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
1186
1230
|
var referenceClientRect = getBoundingClientRect(referenceElement);
|
|
1187
1231
|
var popperOffsets = computeOffsets({
|
|
1188
1232
|
reference: referenceClientRect,
|
|
@@ -1190,7 +1234,7 @@ function detectOverflow(state, options) {
|
|
|
1190
1234
|
strategy: 'absolute',
|
|
1191
1235
|
placement: placement
|
|
1192
1236
|
});
|
|
1193
|
-
var popperClientRect = rectToClientRect(Object.assign(
|
|
1237
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
1194
1238
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
1195
1239
|
// 0 or negative = within the clipping rect
|
|
1196
1240
|
|
|
@@ -1213,10 +1257,6 @@ function detectOverflow(state, options) {
|
|
|
1213
1257
|
|
|
1214
1258
|
return overflowOffsets;
|
|
1215
1259
|
}
|
|
1216
|
-
/*:: type OverflowsMap = { [ComputedPlacement]: number }; */
|
|
1217
|
-
|
|
1218
|
-
/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
|
|
1219
|
-
|
|
1220
1260
|
|
|
1221
1261
|
function computeAutoPlacement(state, options) {
|
|
1222
1262
|
if (options === void 0) {
|
|
@@ -1234,15 +1274,14 @@ function computeAutoPlacement(state, options) {
|
|
|
1234
1274
|
var variation = getVariation(placement);
|
|
1235
1275
|
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
|
1236
1276
|
return getVariation(placement) === variation;
|
|
1237
|
-
}) : basePlacements;
|
|
1238
|
-
|
|
1277
|
+
}) : basePlacements;
|
|
1239
1278
|
var allowedPlacements = placements$1.filter(function (placement) {
|
|
1240
1279
|
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
1241
1280
|
});
|
|
1242
1281
|
|
|
1243
1282
|
if (allowedPlacements.length === 0) {
|
|
1244
1283
|
allowedPlacements = placements$1;
|
|
1245
|
-
} // $FlowFixMe: Flow seems to have problems with two array unions...
|
|
1284
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
1246
1285
|
|
|
1247
1286
|
|
|
1248
1287
|
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
@@ -1443,7 +1482,7 @@ function hide(_ref) {
|
|
|
1443
1482
|
isReferenceHidden: isReferenceHidden,
|
|
1444
1483
|
hasPopperEscaped: hasPopperEscaped
|
|
1445
1484
|
};
|
|
1446
|
-
state.attributes.popper = Object.assign(
|
|
1485
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
1447
1486
|
'data-popper-reference-hidden': isReferenceHidden,
|
|
1448
1487
|
'data-popper-escaped': hasPopperEscaped
|
|
1449
1488
|
});
|
|
@@ -1462,7 +1501,7 @@ function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
|
1462
1501
|
var basePlacement = getBasePlacement(placement);
|
|
1463
1502
|
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
1464
1503
|
|
|
1465
|
-
var _ref = typeof offset === 'function' ? offset(Object.assign(
|
|
1504
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
1466
1505
|
placement: placement
|
|
1467
1506
|
})) : offset,
|
|
1468
1507
|
skidding = _ref[0],
|
|
@@ -1568,7 +1607,7 @@ function preventOverflow(_ref) {
|
|
|
1568
1607
|
var popperOffsets = state.modifiersData.popperOffsets;
|
|
1569
1608
|
var referenceRect = state.rects.reference;
|
|
1570
1609
|
var popperRect = state.rects.popper;
|
|
1571
|
-
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(
|
|
1610
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
1572
1611
|
placement: state.placement
|
|
1573
1612
|
})) : tetherOffset;
|
|
1574
1613
|
var data = {
|
|
@@ -1580,13 +1619,13 @@ function preventOverflow(_ref) {
|
|
|
1580
1619
|
return;
|
|
1581
1620
|
}
|
|
1582
1621
|
|
|
1583
|
-
if (checkMainAxis) {
|
|
1622
|
+
if (checkMainAxis || checkAltAxis) {
|
|
1584
1623
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
1585
1624
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
1586
1625
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
1587
1626
|
var offset = popperOffsets[mainAxis];
|
|
1588
|
-
var min = popperOffsets[mainAxis] + overflow[mainSide];
|
|
1589
|
-
var max = popperOffsets[mainAxis] - overflow[altSide];
|
|
1627
|
+
var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
|
|
1628
|
+
var max$1 = popperOffsets[mainAxis] - overflow[altSide];
|
|
1590
1629
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1591
1630
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
1592
1631
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -1613,26 +1652,29 @@ function preventOverflow(_ref) {
|
|
|
1613
1652
|
var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
|
|
1614
1653
|
var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
|
|
1615
1654
|
var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
|
|
1616
|
-
var preventedOffset = within(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max);
|
|
1617
|
-
popperOffsets[mainAxis] = preventedOffset;
|
|
1618
|
-
data[mainAxis] = preventedOffset - offset;
|
|
1619
|
-
}
|
|
1620
1655
|
|
|
1621
|
-
|
|
1622
|
-
|
|
1656
|
+
if (checkMainAxis) {
|
|
1657
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
1658
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
1659
|
+
data[mainAxis] = preventedOffset - offset;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
if (checkAltAxis) {
|
|
1663
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
1623
1664
|
|
|
1624
|
-
|
|
1665
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
1625
1666
|
|
|
1626
|
-
|
|
1667
|
+
var _offset = popperOffsets[altAxis];
|
|
1627
1668
|
|
|
1628
|
-
|
|
1669
|
+
var _min = _offset + overflow[_mainSide];
|
|
1629
1670
|
|
|
1630
|
-
|
|
1671
|
+
var _max = _offset - overflow[_altSide];
|
|
1631
1672
|
|
|
1632
|
-
|
|
1673
|
+
var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
|
|
1633
1674
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1675
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
1676
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
1677
|
+
}
|
|
1636
1678
|
}
|
|
1637
1679
|
|
|
1638
1680
|
state.modifiersData[name] = data;
|
|
@@ -1655,7 +1697,7 @@ function getHTMLElementScroll(element) {
|
|
|
1655
1697
|
}
|
|
1656
1698
|
|
|
1657
1699
|
function getNodeScroll(node) {
|
|
1658
|
-
if (node === getWindow(node) || !isHTMLElement
|
|
1700
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
1659
1701
|
return getWindowScroll(node);
|
|
1660
1702
|
} else {
|
|
1661
1703
|
return getHTMLElementScroll(node);
|
|
@@ -1670,7 +1712,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
1670
1712
|
|
|
1671
1713
|
var documentElement = getDocumentElement(offsetParent);
|
|
1672
1714
|
var rect = getBoundingClientRect(elementOrVirtualElement);
|
|
1673
|
-
var isOffsetParentAnElement = isHTMLElement
|
|
1715
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1674
1716
|
var scroll = {
|
|
1675
1717
|
scrollLeft: 0,
|
|
1676
1718
|
scrollTop: 0
|
|
@@ -1686,7 +1728,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
1686
1728
|
scroll = getNodeScroll(offsetParent);
|
|
1687
1729
|
}
|
|
1688
1730
|
|
|
1689
|
-
if (isHTMLElement
|
|
1731
|
+
if (isHTMLElement(offsetParent)) {
|
|
1690
1732
|
offsets = getBoundingClientRect(offsetParent);
|
|
1691
1733
|
offsets.x += offsetParent.clientLeft;
|
|
1692
1734
|
offsets.y += offsetParent.clientTop;
|
|
@@ -1765,9 +1807,9 @@ function debounce(fn) {
|
|
|
1765
1807
|
function mergeByName(modifiers) {
|
|
1766
1808
|
var merged = modifiers.reduce(function (merged, current) {
|
|
1767
1809
|
var existing = merged[current.name];
|
|
1768
|
-
merged[current.name] = existing ? Object.assign(
|
|
1769
|
-
options: Object.assign(
|
|
1770
|
-
data: Object.assign(
|
|
1810
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
|
1811
|
+
options: Object.assign({}, existing.options, current.options),
|
|
1812
|
+
data: Object.assign({}, existing.data, current.data)
|
|
1771
1813
|
}) : current;
|
|
1772
1814
|
return merged;
|
|
1773
1815
|
}, {}); // IE11 does not support Object.values
|
|
@@ -1811,7 +1853,7 @@ function popperGenerator(generatorOptions) {
|
|
|
1811
1853
|
var state = {
|
|
1812
1854
|
placement: 'bottom',
|
|
1813
1855
|
orderedModifiers: [],
|
|
1814
|
-
options: Object.assign(
|
|
1856
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
1815
1857
|
modifiersData: {},
|
|
1816
1858
|
elements: {
|
|
1817
1859
|
reference: reference,
|
|
@@ -1826,9 +1868,9 @@ function popperGenerator(generatorOptions) {
|
|
|
1826
1868
|
state: state,
|
|
1827
1869
|
setOptions: function setOptions(options) {
|
|
1828
1870
|
cleanupModifierEffects();
|
|
1829
|
-
state.options = Object.assign(
|
|
1871
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
1830
1872
|
state.scrollParents = {
|
|
1831
|
-
reference: isElement
|
|
1873
|
+
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
1832
1874
|
popper: listScrollParents(popper)
|
|
1833
1875
|
}; // Orders the modifiers based on their dependencies and `phase`
|
|
1834
1876
|
// properties
|
|
@@ -2160,7 +2202,8 @@ function getPopperOptions(attachToOptions, step) {
|
|
|
2160
2202
|
modifiers: [{
|
|
2161
2203
|
name: 'preventOverflow',
|
|
2162
2204
|
options: {
|
|
2163
|
-
altAxis: true
|
|
2205
|
+
altAxis: true,
|
|
2206
|
+
tether: false
|
|
2164
2207
|
}
|
|
2165
2208
|
}, {
|
|
2166
2209
|
name: 'focusAfterRender',
|
|
@@ -2325,7 +2368,7 @@ function set_current_component(component) {
|
|
|
2325
2368
|
}
|
|
2326
2369
|
|
|
2327
2370
|
function get_current_component() {
|
|
2328
|
-
if (!current_component) throw new Error(
|
|
2371
|
+
if (!current_component) throw new Error('Function called outside component initialization');
|
|
2329
2372
|
return current_component;
|
|
2330
2373
|
}
|
|
2331
2374
|
|
|
@@ -2498,28 +2541,32 @@ function create_component(block) {
|
|
|
2498
2541
|
block && block.c();
|
|
2499
2542
|
}
|
|
2500
2543
|
|
|
2501
|
-
function mount_component(component, target, anchor) {
|
|
2544
|
+
function mount_component(component, target, anchor, customElement) {
|
|
2502
2545
|
const {
|
|
2503
2546
|
fragment,
|
|
2504
2547
|
on_mount,
|
|
2505
2548
|
on_destroy,
|
|
2506
2549
|
after_update
|
|
2507
2550
|
} = component.$$;
|
|
2508
|
-
fragment && fragment.m(target, anchor);
|
|
2551
|
+
fragment && fragment.m(target, anchor);
|
|
2509
2552
|
|
|
2510
|
-
|
|
2511
|
-
|
|
2553
|
+
if (!customElement) {
|
|
2554
|
+
// onMount happens before the initial afterUpdate
|
|
2555
|
+
add_render_callback(() => {
|
|
2556
|
+
const new_on_destroy = on_mount.map(run).filter(is_function);
|
|
2512
2557
|
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2558
|
+
if (on_destroy) {
|
|
2559
|
+
on_destroy.push(...new_on_destroy);
|
|
2560
|
+
} else {
|
|
2561
|
+
// Edge case - component was destroyed immediately,
|
|
2562
|
+
// most likely as a result of a binding initialising
|
|
2563
|
+
run_all(new_on_destroy);
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
component.$$.on_mount = [];
|
|
2567
|
+
});
|
|
2568
|
+
}
|
|
2520
2569
|
|
|
2521
|
-
component.$$.on_mount = [];
|
|
2522
|
-
});
|
|
2523
2570
|
after_update.forEach(add_render_callback);
|
|
2524
2571
|
}
|
|
2525
2572
|
|
|
@@ -2549,7 +2596,6 @@ function make_dirty(component, i) {
|
|
|
2549
2596
|
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
|
|
2550
2597
|
const parent_component = current_component;
|
|
2551
2598
|
set_current_component(component);
|
|
2552
|
-
const prop_values = options.props || {};
|
|
2553
2599
|
const $$ = component.$$ = {
|
|
2554
2600
|
fragment: null,
|
|
2555
2601
|
ctx: null,
|
|
@@ -2561,16 +2607,17 @@ function init(component, options, instance, create_fragment, not_equal, props, d
|
|
|
2561
2607
|
// lifecycle
|
|
2562
2608
|
on_mount: [],
|
|
2563
2609
|
on_destroy: [],
|
|
2610
|
+
on_disconnect: [],
|
|
2564
2611
|
before_update: [],
|
|
2565
2612
|
after_update: [],
|
|
2566
|
-
context: new Map(parent_component ? parent_component.$$.context : []),
|
|
2613
|
+
context: new Map(parent_component ? parent_component.$$.context : options.context || []),
|
|
2567
2614
|
// everything else
|
|
2568
2615
|
callbacks: blank_object(),
|
|
2569
2616
|
dirty,
|
|
2570
2617
|
skip_bound: false
|
|
2571
2618
|
};
|
|
2572
2619
|
let ready = false;
|
|
2573
|
-
$$.ctx = instance ? instance(component,
|
|
2620
|
+
$$.ctx = instance ? instance(component, options.props || {}, (i, ret, ...rest) => {
|
|
2574
2621
|
const value = rest.length ? rest[0] : ret;
|
|
2575
2622
|
|
|
2576
2623
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
|
@@ -2598,12 +2645,16 @@ function init(component, options, instance, create_fragment, not_equal, props, d
|
|
|
2598
2645
|
}
|
|
2599
2646
|
|
|
2600
2647
|
if (options.intro) transition_in(component.$$.fragment);
|
|
2601
|
-
mount_component(component, options.target, options.anchor);
|
|
2648
|
+
mount_component(component, options.target, options.anchor, options.customElement);
|
|
2602
2649
|
flush();
|
|
2603
2650
|
}
|
|
2604
2651
|
|
|
2605
2652
|
set_current_component(parent_component);
|
|
2606
2653
|
}
|
|
2654
|
+
/**
|
|
2655
|
+
* Base class for Svelte components. Used when dev=false.
|
|
2656
|
+
*/
|
|
2657
|
+
|
|
2607
2658
|
|
|
2608
2659
|
class SvelteComponent {
|
|
2609
2660
|
$destroy() {
|
|
@@ -2629,10 +2680,10 @@ class SvelteComponent {
|
|
|
2629
2680
|
}
|
|
2630
2681
|
|
|
2631
2682
|
}
|
|
2632
|
-
/* src/js/components/shepherd-button.svelte generated by Svelte v3.
|
|
2683
|
+
/* src/js/components/shepherd-button.svelte generated by Svelte v3.37.0 */
|
|
2633
2684
|
|
|
2634
2685
|
|
|
2635
|
-
function create_fragment(ctx) {
|
|
2686
|
+
function create_fragment$8(ctx) {
|
|
2636
2687
|
let button;
|
|
2637
2688
|
let button_aria_label_value;
|
|
2638
2689
|
let button_class_value;
|
|
@@ -2724,7 +2775,7 @@ function create_fragment(ctx) {
|
|
|
2724
2775
|
};
|
|
2725
2776
|
}
|
|
2726
2777
|
|
|
2727
|
-
function instance($$self, $$props, $$invalidate) {
|
|
2778
|
+
function instance$8($$self, $$props, $$invalidate) {
|
|
2728
2779
|
let {
|
|
2729
2780
|
config
|
|
2730
2781
|
} = $$props,
|
|
@@ -2767,14 +2818,14 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
2767
2818
|
class Shepherd_button extends SvelteComponent {
|
|
2768
2819
|
constructor(options) {
|
|
2769
2820
|
super();
|
|
2770
|
-
init(this, options, instance, create_fragment, safe_not_equal, {
|
|
2821
|
+
init(this, options, instance$8, create_fragment$8, safe_not_equal, {
|
|
2771
2822
|
config: 6,
|
|
2772
2823
|
step: 7
|
|
2773
2824
|
});
|
|
2774
2825
|
}
|
|
2775
2826
|
|
|
2776
2827
|
}
|
|
2777
|
-
/* src/js/components/shepherd-footer.svelte generated by Svelte v3.
|
|
2828
|
+
/* src/js/components/shepherd-footer.svelte generated by Svelte v3.37.0 */
|
|
2778
2829
|
|
|
2779
2830
|
|
|
2780
2831
|
function get_each_context(ctx, list, i) {
|
|
@@ -2784,7 +2835,7 @@ function get_each_context(ctx, list, i) {
|
|
|
2784
2835
|
} // (24:4) {#if buttons}
|
|
2785
2836
|
|
|
2786
2837
|
|
|
2787
|
-
function create_if_block(ctx) {
|
|
2838
|
+
function create_if_block$3(ctx) {
|
|
2788
2839
|
let each_1_anchor;
|
|
2789
2840
|
let current;
|
|
2790
2841
|
let each_value =
|
|
@@ -2936,12 +2987,12 @@ function create_each_block(ctx) {
|
|
|
2936
2987
|
};
|
|
2937
2988
|
}
|
|
2938
2989
|
|
|
2939
|
-
function create_fragment$
|
|
2990
|
+
function create_fragment$7(ctx) {
|
|
2940
2991
|
let footer;
|
|
2941
2992
|
let current;
|
|
2942
2993
|
let if_block =
|
|
2943
2994
|
/*buttons*/
|
|
2944
|
-
ctx[1] && create_if_block(ctx);
|
|
2995
|
+
ctx[1] && create_if_block$3(ctx);
|
|
2945
2996
|
return {
|
|
2946
2997
|
c() {
|
|
2947
2998
|
footer = element("footer");
|
|
@@ -2968,7 +3019,7 @@ function create_fragment$1(ctx) {
|
|
|
2968
3019
|
transition_in(if_block, 1);
|
|
2969
3020
|
}
|
|
2970
3021
|
} else {
|
|
2971
|
-
if_block = create_if_block(ctx);
|
|
3022
|
+
if_block = create_if_block$3(ctx);
|
|
2972
3023
|
if_block.c();
|
|
2973
3024
|
transition_in(if_block, 1);
|
|
2974
3025
|
if_block.m(footer, null);
|
|
@@ -3001,7 +3052,8 @@ function create_fragment$1(ctx) {
|
|
|
3001
3052
|
};
|
|
3002
3053
|
}
|
|
3003
3054
|
|
|
3004
|
-
function instance$
|
|
3055
|
+
function instance$7($$self, $$props, $$invalidate) {
|
|
3056
|
+
let buttons;
|
|
3005
3057
|
let {
|
|
3006
3058
|
step
|
|
3007
3059
|
} = $$props;
|
|
@@ -3010,8 +3062,6 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
3010
3062
|
if ("step" in $$props) $$invalidate(0, step = $$props.step);
|
|
3011
3063
|
};
|
|
3012
3064
|
|
|
3013
|
-
let buttons;
|
|
3014
|
-
|
|
3015
3065
|
$$self.$$.update = () => {
|
|
3016
3066
|
if ($$self.$$.dirty &
|
|
3017
3067
|
/*step*/
|
|
@@ -3026,16 +3076,16 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
3026
3076
|
class Shepherd_footer extends SvelteComponent {
|
|
3027
3077
|
constructor(options) {
|
|
3028
3078
|
super();
|
|
3029
|
-
init(this, options, instance$
|
|
3079
|
+
init(this, options, instance$7, create_fragment$7, safe_not_equal, {
|
|
3030
3080
|
step: 0
|
|
3031
3081
|
});
|
|
3032
3082
|
}
|
|
3033
3083
|
|
|
3034
3084
|
}
|
|
3035
|
-
/* src/js/components/shepherd-cancel-icon.svelte generated by Svelte v3.
|
|
3085
|
+
/* src/js/components/shepherd-cancel-icon.svelte generated by Svelte v3.37.0 */
|
|
3036
3086
|
|
|
3037
3087
|
|
|
3038
|
-
function create_fragment$
|
|
3088
|
+
function create_fragment$6(ctx) {
|
|
3039
3089
|
let button;
|
|
3040
3090
|
let span;
|
|
3041
3091
|
let button_aria_label_value;
|
|
@@ -3092,7 +3142,7 @@ function create_fragment$2(ctx) {
|
|
|
3092
3142
|
};
|
|
3093
3143
|
}
|
|
3094
3144
|
|
|
3095
|
-
function instance$
|
|
3145
|
+
function instance$6($$self, $$props, $$invalidate) {
|
|
3096
3146
|
let {
|
|
3097
3147
|
cancelIcon
|
|
3098
3148
|
} = $$props,
|
|
@@ -3119,17 +3169,17 @@ function instance$2($$self, $$props, $$invalidate) {
|
|
|
3119
3169
|
class Shepherd_cancel_icon extends SvelteComponent {
|
|
3120
3170
|
constructor(options) {
|
|
3121
3171
|
super();
|
|
3122
|
-
init(this, options, instance$
|
|
3172
|
+
init(this, options, instance$6, create_fragment$6, safe_not_equal, {
|
|
3123
3173
|
cancelIcon: 0,
|
|
3124
3174
|
step: 2
|
|
3125
3175
|
});
|
|
3126
3176
|
}
|
|
3127
3177
|
|
|
3128
3178
|
}
|
|
3129
|
-
/* src/js/components/shepherd-title.svelte generated by Svelte v3.
|
|
3179
|
+
/* src/js/components/shepherd-title.svelte generated by Svelte v3.37.0 */
|
|
3130
3180
|
|
|
3131
3181
|
|
|
3132
|
-
function create_fragment$
|
|
3182
|
+
function create_fragment$5(ctx) {
|
|
3133
3183
|
let h3;
|
|
3134
3184
|
return {
|
|
3135
3185
|
c() {
|
|
@@ -3170,7 +3220,7 @@ function create_fragment$3(ctx) {
|
|
|
3170
3220
|
};
|
|
3171
3221
|
}
|
|
3172
3222
|
|
|
3173
|
-
function instance$
|
|
3223
|
+
function instance$5($$self, $$props, $$invalidate) {
|
|
3174
3224
|
let {
|
|
3175
3225
|
labelId
|
|
3176
3226
|
} = $$props,
|
|
@@ -3207,7 +3257,7 @@ function instance$3($$self, $$props, $$invalidate) {
|
|
|
3207
3257
|
class Shepherd_title extends SvelteComponent {
|
|
3208
3258
|
constructor(options) {
|
|
3209
3259
|
super();
|
|
3210
|
-
init(this, options, instance$
|
|
3260
|
+
init(this, options, instance$5, create_fragment$5, safe_not_equal, {
|
|
3211
3261
|
labelId: 1,
|
|
3212
3262
|
element: 0,
|
|
3213
3263
|
title: 2
|
|
@@ -3215,10 +3265,10 @@ class Shepherd_title extends SvelteComponent {
|
|
|
3215
3265
|
}
|
|
3216
3266
|
|
|
3217
3267
|
}
|
|
3218
|
-
/* src/js/components/shepherd-header.svelte generated by Svelte v3.
|
|
3268
|
+
/* src/js/components/shepherd-header.svelte generated by Svelte v3.37.0 */
|
|
3219
3269
|
|
|
3220
3270
|
|
|
3221
|
-
function create_if_block_1(ctx) {
|
|
3271
|
+
function create_if_block_1$1(ctx) {
|
|
3222
3272
|
let shepherdtitle;
|
|
3223
3273
|
let current;
|
|
3224
3274
|
shepherdtitle = new Shepherd_title({
|
|
@@ -3275,7 +3325,7 @@ function create_if_block_1(ctx) {
|
|
|
3275
3325
|
} // (39:4) {#if cancelIcon && cancelIcon.enabled}
|
|
3276
3326
|
|
|
3277
3327
|
|
|
3278
|
-
function create_if_block$
|
|
3328
|
+
function create_if_block$2(ctx) {
|
|
3279
3329
|
let shepherdcancelicon;
|
|
3280
3330
|
let current;
|
|
3281
3331
|
shepherdcancelicon = new Shepherd_cancel_icon({
|
|
@@ -3337,12 +3387,12 @@ function create_fragment$4(ctx) {
|
|
|
3337
3387
|
let current;
|
|
3338
3388
|
let if_block0 =
|
|
3339
3389
|
/*title*/
|
|
3340
|
-
ctx[2] && create_if_block_1(ctx);
|
|
3390
|
+
ctx[2] && create_if_block_1$1(ctx);
|
|
3341
3391
|
let if_block1 =
|
|
3342
3392
|
/*cancelIcon*/
|
|
3343
3393
|
ctx[3] &&
|
|
3344
3394
|
/*cancelIcon*/
|
|
3345
|
-
ctx[3].enabled && create_if_block$
|
|
3395
|
+
ctx[3].enabled && create_if_block$2(ctx);
|
|
3346
3396
|
return {
|
|
3347
3397
|
c() {
|
|
3348
3398
|
header = element("header");
|
|
@@ -3373,7 +3423,7 @@ function create_fragment$4(ctx) {
|
|
|
3373
3423
|
transition_in(if_block0, 1);
|
|
3374
3424
|
}
|
|
3375
3425
|
} else {
|
|
3376
|
-
if_block0 = create_if_block_1(ctx);
|
|
3426
|
+
if_block0 = create_if_block_1$1(ctx);
|
|
3377
3427
|
if_block0.c();
|
|
3378
3428
|
transition_in(if_block0, 1);
|
|
3379
3429
|
if_block0.m(header, t);
|
|
@@ -3400,7 +3450,7 @@ function create_fragment$4(ctx) {
|
|
|
3400
3450
|
transition_in(if_block1, 1);
|
|
3401
3451
|
}
|
|
3402
3452
|
} else {
|
|
3403
|
-
if_block1 = create_if_block$
|
|
3453
|
+
if_block1 = create_if_block$2(ctx);
|
|
3404
3454
|
if_block1.c();
|
|
3405
3455
|
transition_in(if_block1, 1);
|
|
3406
3456
|
if_block1.m(header, null);
|
|
@@ -3474,10 +3524,10 @@ class Shepherd_header extends SvelteComponent {
|
|
|
3474
3524
|
}
|
|
3475
3525
|
|
|
3476
3526
|
}
|
|
3477
|
-
/* src/js/components/shepherd-text.svelte generated by Svelte v3.
|
|
3527
|
+
/* src/js/components/shepherd-text.svelte generated by Svelte v3.37.0 */
|
|
3478
3528
|
|
|
3479
3529
|
|
|
3480
|
-
function create_fragment$
|
|
3530
|
+
function create_fragment$3(ctx) {
|
|
3481
3531
|
let div;
|
|
3482
3532
|
return {
|
|
3483
3533
|
c() {
|
|
@@ -3518,7 +3568,7 @@ function create_fragment$5(ctx) {
|
|
|
3518
3568
|
};
|
|
3519
3569
|
}
|
|
3520
3570
|
|
|
3521
|
-
function instance$
|
|
3571
|
+
function instance$3($$self, $$props, $$invalidate) {
|
|
3522
3572
|
let {
|
|
3523
3573
|
descriptionId
|
|
3524
3574
|
} = $$props,
|
|
@@ -3537,7 +3587,7 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
3537
3587
|
text = text.call(step);
|
|
3538
3588
|
}
|
|
3539
3589
|
|
|
3540
|
-
if (isHTMLElement(text)) {
|
|
3590
|
+
if (isHTMLElement$1(text)) {
|
|
3541
3591
|
element.appendChild(text);
|
|
3542
3592
|
} else {
|
|
3543
3593
|
$$invalidate(0, element.innerHTML = text, element);
|
|
@@ -3563,7 +3613,7 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
3563
3613
|
class Shepherd_text extends SvelteComponent {
|
|
3564
3614
|
constructor(options) {
|
|
3565
3615
|
super();
|
|
3566
|
-
init(this, options, instance$
|
|
3616
|
+
init(this, options, instance$3, create_fragment$3, safe_not_equal, {
|
|
3567
3617
|
descriptionId: 1,
|
|
3568
3618
|
element: 0,
|
|
3569
3619
|
step: 2
|
|
@@ -3571,7 +3621,7 @@ class Shepherd_text extends SvelteComponent {
|
|
|
3571
3621
|
}
|
|
3572
3622
|
|
|
3573
3623
|
}
|
|
3574
|
-
/* src/js/components/shepherd-content.svelte generated by Svelte v3.
|
|
3624
|
+
/* src/js/components/shepherd-content.svelte generated by Svelte v3.37.0 */
|
|
3575
3625
|
|
|
3576
3626
|
|
|
3577
3627
|
function create_if_block_2(ctx) {
|
|
@@ -3631,7 +3681,7 @@ function create_if_block_2(ctx) {
|
|
|
3631
3681
|
} // (28:2) {#if !isUndefined(step.options.text)}
|
|
3632
3682
|
|
|
3633
3683
|
|
|
3634
|
-
function create_if_block_1
|
|
3684
|
+
function create_if_block_1(ctx) {
|
|
3635
3685
|
let shepherdtext;
|
|
3636
3686
|
let current;
|
|
3637
3687
|
shepherdtext = new Shepherd_text({
|
|
@@ -3688,7 +3738,7 @@ function create_if_block_1$1(ctx) {
|
|
|
3688
3738
|
} // (35:2) {#if Array.isArray(step.options.buttons) && step.options.buttons.length}
|
|
3689
3739
|
|
|
3690
3740
|
|
|
3691
|
-
function create_if_block$
|
|
3741
|
+
function create_if_block$1(ctx) {
|
|
3692
3742
|
let shepherdfooter;
|
|
3693
3743
|
let current;
|
|
3694
3744
|
shepherdfooter = new Shepherd_footer({
|
|
@@ -3736,7 +3786,7 @@ function create_if_block$2(ctx) {
|
|
|
3736
3786
|
};
|
|
3737
3787
|
}
|
|
3738
3788
|
|
|
3739
|
-
function create_fragment$
|
|
3789
|
+
function create_fragment$2(ctx) {
|
|
3740
3790
|
let div;
|
|
3741
3791
|
let show_if_2 = !isUndefined(
|
|
3742
3792
|
/*step*/
|
|
@@ -3757,8 +3807,8 @@ function create_fragment$6(ctx) {
|
|
|
3757
3807
|
ctx[2].options.buttons.length;
|
|
3758
3808
|
let current;
|
|
3759
3809
|
let if_block0 = show_if_2 && create_if_block_2(ctx);
|
|
3760
|
-
let if_block1 = show_if_1 && create_if_block_1
|
|
3761
|
-
let if_block2 = show_if && create_if_block$
|
|
3810
|
+
let if_block1 = show_if_1 && create_if_block_1(ctx);
|
|
3811
|
+
let if_block2 = show_if && create_if_block$1(ctx);
|
|
3762
3812
|
return {
|
|
3763
3813
|
c() {
|
|
3764
3814
|
div = element("div");
|
|
@@ -3830,7 +3880,7 @@ function create_fragment$6(ctx) {
|
|
|
3830
3880
|
transition_in(if_block1, 1);
|
|
3831
3881
|
}
|
|
3832
3882
|
} else {
|
|
3833
|
-
if_block1 = create_if_block_1
|
|
3883
|
+
if_block1 = create_if_block_1(ctx);
|
|
3834
3884
|
if_block1.c();
|
|
3835
3885
|
transition_in(if_block1, 1);
|
|
3836
3886
|
if_block1.m(div, t1);
|
|
@@ -3861,7 +3911,7 @@ function create_fragment$6(ctx) {
|
|
|
3861
3911
|
transition_in(if_block2, 1);
|
|
3862
3912
|
}
|
|
3863
3913
|
} else {
|
|
3864
|
-
if_block2 = create_if_block$
|
|
3914
|
+
if_block2 = create_if_block$1(ctx);
|
|
3865
3915
|
if_block2.c();
|
|
3866
3916
|
transition_in(if_block2, 1);
|
|
3867
3917
|
if_block2.m(div, null);
|
|
@@ -3900,7 +3950,7 @@ function create_fragment$6(ctx) {
|
|
|
3900
3950
|
};
|
|
3901
3951
|
}
|
|
3902
3952
|
|
|
3903
|
-
function instance$
|
|
3953
|
+
function instance$2($$self, $$props, $$invalidate) {
|
|
3904
3954
|
let {
|
|
3905
3955
|
descriptionId
|
|
3906
3956
|
} = $$props,
|
|
@@ -3923,7 +3973,7 @@ function instance$6($$self, $$props, $$invalidate) {
|
|
|
3923
3973
|
class Shepherd_content extends SvelteComponent {
|
|
3924
3974
|
constructor(options) {
|
|
3925
3975
|
super();
|
|
3926
|
-
init(this, options, instance$
|
|
3976
|
+
init(this, options, instance$2, create_fragment$2, safe_not_equal, {
|
|
3927
3977
|
descriptionId: 0,
|
|
3928
3978
|
labelId: 1,
|
|
3929
3979
|
step: 2
|
|
@@ -3931,10 +3981,10 @@ class Shepherd_content extends SvelteComponent {
|
|
|
3931
3981
|
}
|
|
3932
3982
|
|
|
3933
3983
|
}
|
|
3934
|
-
/* src/js/components/shepherd-element.svelte generated by Svelte v3.
|
|
3984
|
+
/* src/js/components/shepherd-element.svelte generated by Svelte v3.37.0 */
|
|
3935
3985
|
|
|
3936
3986
|
|
|
3937
|
-
function create_if_block
|
|
3987
|
+
function create_if_block(ctx) {
|
|
3938
3988
|
let div;
|
|
3939
3989
|
return {
|
|
3940
3990
|
c() {
|
|
@@ -3954,7 +4004,7 @@ function create_if_block$3(ctx) {
|
|
|
3954
4004
|
};
|
|
3955
4005
|
}
|
|
3956
4006
|
|
|
3957
|
-
function create_fragment$
|
|
4007
|
+
function create_fragment$1(ctx) {
|
|
3958
4008
|
let div;
|
|
3959
4009
|
let t;
|
|
3960
4010
|
let shepherdcontent;
|
|
@@ -3971,7 +4021,7 @@ function create_fragment$7(ctx) {
|
|
|
3971
4021
|
/*step*/
|
|
3972
4022
|
ctx[4].options.attachTo.element &&
|
|
3973
4023
|
/*step*/
|
|
3974
|
-
ctx[4].options.attachTo.on && create_if_block
|
|
4024
|
+
ctx[4].options.attachTo.on && create_if_block();
|
|
3975
4025
|
shepherdcontent = new Shepherd_content({
|
|
3976
4026
|
props: {
|
|
3977
4027
|
descriptionId:
|
|
@@ -4055,7 +4105,7 @@ function create_fragment$7(ctx) {
|
|
|
4055
4105
|
/*step*/
|
|
4056
4106
|
ctx[4].options.attachTo.on) {
|
|
4057
4107
|
if (if_block) ;else {
|
|
4058
|
-
if_block = create_if_block
|
|
4108
|
+
if_block = create_if_block();
|
|
4059
4109
|
if_block.c();
|
|
4060
4110
|
if_block.m(div, t);
|
|
4061
4111
|
}
|
|
@@ -4149,7 +4199,7 @@ function getClassesArray(classes) {
|
|
|
4149
4199
|
return classes.split(" ").filter(className => !!className.length);
|
|
4150
4200
|
}
|
|
4151
4201
|
|
|
4152
|
-
function instance$
|
|
4202
|
+
function instance$1($$self, $$props, $$invalidate) {
|
|
4153
4203
|
let {
|
|
4154
4204
|
classPrefix
|
|
4155
4205
|
} = $$props,
|
|
@@ -4316,7 +4366,7 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
|
4316
4366
|
class Shepherd_element extends SvelteComponent {
|
|
4317
4367
|
constructor(options) {
|
|
4318
4368
|
super();
|
|
4319
|
-
init(this, options, instance$
|
|
4369
|
+
init(this, options, instance$1, create_fragment$1, safe_not_equal, {
|
|
4320
4370
|
classPrefix: 11,
|
|
4321
4371
|
element: 0,
|
|
4322
4372
|
descriptionId: 2,
|
|
@@ -4683,7 +4733,7 @@ var smoothscroll = createCommonjsModule(function (module, exports) {
|
|
|
4683
4733
|
}
|
|
4684
4734
|
})();
|
|
4685
4735
|
});
|
|
4686
|
-
|
|
4736
|
+
smoothscroll.polyfill;
|
|
4687
4737
|
smoothscroll.polyfill();
|
|
4688
4738
|
/**
|
|
4689
4739
|
* A class representing steps to be added to a tour.
|
|
@@ -4821,7 +4871,7 @@ class Step extends Evented {
|
|
|
4821
4871
|
this.tooltip = null;
|
|
4822
4872
|
}
|
|
4823
4873
|
|
|
4824
|
-
if (isHTMLElement(this.el) && this.el.parentNode) {
|
|
4874
|
+
if (isHTMLElement$1(this.el) && this.el.parentNode) {
|
|
4825
4875
|
this.el.parentNode.removeChild(this.el);
|
|
4826
4876
|
this.el = null;
|
|
4827
4877
|
}
|
|
@@ -4966,7 +5016,7 @@ class Step extends Evented {
|
|
|
4966
5016
|
|
|
4967
5017
|
if (isFunction(this.options.scrollToHandler)) {
|
|
4968
5018
|
this.options.scrollToHandler(element);
|
|
4969
|
-
} else if (isElement(element) && typeof element.scrollIntoView === 'function') {
|
|
5019
|
+
} else if (isElement$1(element) && typeof element.scrollIntoView === 'function') {
|
|
4970
5020
|
element.scrollIntoView(scrollToOptions);
|
|
4971
5021
|
}
|
|
4972
5022
|
}
|
|
@@ -5105,7 +5155,7 @@ class Step extends Evented {
|
|
|
5105
5155
|
target.classList.remove(this.options.highlightClass);
|
|
5106
5156
|
}
|
|
5107
5157
|
|
|
5108
|
-
target.classList.remove(`${this.classPrefix}shepherd-enabled`, `${this.classPrefix}shepherd-target`);
|
|
5158
|
+
target.classList.remove('shepherd-target-click-disabled', `${this.classPrefix}shepherd-enabled`, `${this.classPrefix}shepherd-target`);
|
|
5109
5159
|
}
|
|
5110
5160
|
|
|
5111
5161
|
}
|
|
@@ -5168,10 +5218,10 @@ V${y + r}\
|
|
|
5168
5218
|
a${r},${r},0,0,0-${r}-${r}\
|
|
5169
5219
|
Z`;
|
|
5170
5220
|
}
|
|
5171
|
-
/* src/js/components/shepherd-modal.svelte generated by Svelte v3.
|
|
5221
|
+
/* src/js/components/shepherd-modal.svelte generated by Svelte v3.37.0 */
|
|
5172
5222
|
|
|
5173
5223
|
|
|
5174
|
-
function create_fragment
|
|
5224
|
+
function create_fragment(ctx) {
|
|
5175
5225
|
let svg;
|
|
5176
5226
|
let path;
|
|
5177
5227
|
let svg_class_value;
|
|
@@ -5253,14 +5303,14 @@ function _getScrollParent(element) {
|
|
|
5253
5303
|
return _getScrollParent(element.parentElement);
|
|
5254
5304
|
}
|
|
5255
5305
|
/**
|
|
5256
|
-
* Get the visible height of the target element relative to its scrollParent.
|
|
5257
|
-
* If there is no scroll parent, the height of the element is returned.
|
|
5258
|
-
*
|
|
5259
|
-
* @param {HTMLElement} element The target element
|
|
5260
|
-
* @param {HTMLElement} [scrollParent] The scrollable parent element
|
|
5261
|
-
* @returns {{y: number, height: number}}
|
|
5262
|
-
* @private
|
|
5263
|
-
*/
|
|
5306
|
+
* Get the visible height of the target element relative to its scrollParent.
|
|
5307
|
+
* If there is no scroll parent, the height of the element is returned.
|
|
5308
|
+
*
|
|
5309
|
+
* @param {HTMLElement} element The target element
|
|
5310
|
+
* @param {HTMLElement} [scrollParent] The scrollable parent element
|
|
5311
|
+
* @returns {{y: number, height: number}}
|
|
5312
|
+
* @private
|
|
5313
|
+
*/
|
|
5264
5314
|
|
|
5265
5315
|
|
|
5266
5316
|
function _getVisibleHeight(element, scrollParent) {
|
|
@@ -5284,14 +5334,14 @@ function _getVisibleHeight(element, scrollParent) {
|
|
|
5284
5334
|
};
|
|
5285
5335
|
}
|
|
5286
5336
|
|
|
5287
|
-
function instance
|
|
5337
|
+
function instance($$self, $$props, $$invalidate) {
|
|
5288
5338
|
let {
|
|
5289
5339
|
element
|
|
5290
5340
|
} = $$props,
|
|
5291
5341
|
{
|
|
5292
5342
|
openingProperties
|
|
5293
5343
|
} = $$props;
|
|
5294
|
-
|
|
5344
|
+
uuid();
|
|
5295
5345
|
let modalIsVisible = false;
|
|
5296
5346
|
let rafId = undefined;
|
|
5297
5347
|
let pathDefinition;
|
|
@@ -5315,8 +5365,8 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5315
5365
|
_cleanupStepEventListeners();
|
|
5316
5366
|
}
|
|
5317
5367
|
|
|
5318
|
-
function
|
|
5319
|
-
if (targetElement
|
|
5368
|
+
function positionModal(modalOverlayOpeningPadding = 0, modalOverlayOpeningRadius = 0, scrollParent, targetElement) {
|
|
5369
|
+
if (targetElement) {
|
|
5320
5370
|
const {
|
|
5321
5371
|
y,
|
|
5322
5372
|
height
|
|
@@ -5335,6 +5385,8 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5335
5385
|
y: y - modalOverlayOpeningPadding,
|
|
5336
5386
|
r: modalOverlayOpeningRadius
|
|
5337
5387
|
});
|
|
5388
|
+
} else {
|
|
5389
|
+
closeModalOpening();
|
|
5338
5390
|
}
|
|
5339
5391
|
}
|
|
5340
5392
|
|
|
@@ -5403,22 +5455,18 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5403
5455
|
modalOverlayOpeningRadius
|
|
5404
5456
|
} = step.options;
|
|
5405
5457
|
|
|
5406
|
-
|
|
5407
|
-
const scrollParent = _getScrollParent(step.target); // Setup recursive function to call requestAnimationFrame to update the modal opening position
|
|
5458
|
+
const scrollParent = _getScrollParent(step.target); // Setup recursive function to call requestAnimationFrame to update the modal opening position
|
|
5408
5459
|
|
|
5409
5460
|
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5461
|
+
const rafLoop = () => {
|
|
5462
|
+
rafId = undefined;
|
|
5463
|
+
positionModal(modalOverlayOpeningPadding, modalOverlayOpeningRadius, scrollParent, step.target);
|
|
5464
|
+
rafId = requestAnimationFrame(rafLoop);
|
|
5465
|
+
};
|
|
5415
5466
|
|
|
5416
|
-
|
|
5467
|
+
rafLoop();
|
|
5417
5468
|
|
|
5418
|
-
|
|
5419
|
-
} else {
|
|
5420
|
-
closeModalOpening();
|
|
5421
|
-
}
|
|
5469
|
+
_addStepEventListeners();
|
|
5422
5470
|
}
|
|
5423
5471
|
|
|
5424
5472
|
function svg_binding($$value) {
|
|
@@ -5441,19 +5489,19 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5441
5489
|
}
|
|
5442
5490
|
};
|
|
5443
5491
|
|
|
5444
|
-
return [element, modalIsVisible, pathDefinition, _preventModalOverlayTouch, openingProperties, getElement, closeModalOpening, hide,
|
|
5492
|
+
return [element, modalIsVisible, pathDefinition, _preventModalOverlayTouch, openingProperties, getElement, closeModalOpening, hide, positionModal, setupForStep, show, svg_binding];
|
|
5445
5493
|
}
|
|
5446
5494
|
|
|
5447
5495
|
class Shepherd_modal extends SvelteComponent {
|
|
5448
5496
|
constructor(options) {
|
|
5449
5497
|
super();
|
|
5450
|
-
init(this, options, instance
|
|
5498
|
+
init(this, options, instance, create_fragment, safe_not_equal, {
|
|
5451
5499
|
element: 0,
|
|
5452
5500
|
openingProperties: 4,
|
|
5453
5501
|
getElement: 5,
|
|
5454
5502
|
closeModalOpening: 6,
|
|
5455
5503
|
hide: 7,
|
|
5456
|
-
|
|
5504
|
+
positionModal: 8,
|
|
5457
5505
|
setupForStep: 9,
|
|
5458
5506
|
show: 10
|
|
5459
5507
|
});
|
|
@@ -5471,7 +5519,7 @@ class Shepherd_modal extends SvelteComponent {
|
|
|
5471
5519
|
return this.$$.ctx[7];
|
|
5472
5520
|
}
|
|
5473
5521
|
|
|
5474
|
-
get
|
|
5522
|
+
get positionModal() {
|
|
5475
5523
|
return this.$$.ctx[8];
|
|
5476
5524
|
}
|
|
5477
5525
|
|
|
@@ -5784,7 +5832,7 @@ class Tour extends Evented {
|
|
|
5784
5832
|
} // Focus the element that was focused before the tour started
|
|
5785
5833
|
|
|
5786
5834
|
|
|
5787
|
-
if (isHTMLElement(this.focusedElBeforeOpen)) {
|
|
5835
|
+
if (isHTMLElement$1(this.focusedElBeforeOpen)) {
|
|
5788
5836
|
this.focusedElBeforeOpen.focus();
|
|
5789
5837
|
}
|
|
5790
5838
|
}
|