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.js
CHANGED
|
@@ -8,7 +8,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
|
|
11
|
-
/*! shepherd.js 8.1
|
|
11
|
+
/*! shepherd.js 8.3.1 */
|
|
12
12
|
var isMergeableObject = function isMergeableObject(value) {
|
|
13
13
|
return isNonNullObject(value) && !isSpecial(value);
|
|
14
14
|
};
|
|
@@ -138,7 +138,7 @@ var cjs = deepmerge_1;
|
|
|
138
138
|
* @param {*} value The param to check if it is an Element
|
|
139
139
|
*/
|
|
140
140
|
|
|
141
|
-
function isElement(value) {
|
|
141
|
+
function isElement$1(value) {
|
|
142
142
|
return value instanceof Element;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
@@ -147,7 +147,7 @@ function isElement(value) {
|
|
|
147
147
|
*/
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
function isHTMLElement(value) {
|
|
150
|
+
function isHTMLElement$1(value) {
|
|
151
151
|
return value instanceof HTMLElement;
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
@@ -359,12 +359,12 @@ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain,
|
|
|
359
359
|
function getNodeName(element) {
|
|
360
360
|
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
361
361
|
}
|
|
362
|
-
/*:: import type { Window } from '../types'; */
|
|
363
|
-
|
|
364
|
-
/*:: declare function getWindow(node: Node | Window): Window; */
|
|
365
|
-
|
|
366
362
|
|
|
367
363
|
function getWindow(node) {
|
|
364
|
+
if (node == null) {
|
|
365
|
+
return window;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
368
|
if (node.toString() !== '[object Window]') {
|
|
369
369
|
var ownerDocument = node.ownerDocument;
|
|
370
370
|
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
@@ -372,21 +372,25 @@ function getWindow(node) {
|
|
|
372
372
|
|
|
373
373
|
return node;
|
|
374
374
|
}
|
|
375
|
-
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
|
|
376
|
-
Element); */
|
|
377
|
-
|
|
378
375
|
|
|
379
|
-
function isElement
|
|
376
|
+
function isElement(node) {
|
|
380
377
|
var OwnElement = getWindow(node).Element;
|
|
381
378
|
return node instanceof OwnElement || node instanceof Element;
|
|
382
379
|
}
|
|
383
|
-
/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
|
|
384
|
-
HTMLElement); */
|
|
385
380
|
|
|
386
|
-
|
|
387
|
-
function isHTMLElement$1(node) {
|
|
381
|
+
function isHTMLElement(node) {
|
|
388
382
|
var OwnElement = getWindow(node).HTMLElement;
|
|
389
383
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function isShadowRoot(node) {
|
|
387
|
+
// IE 11 has no ShadowRoot
|
|
388
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
393
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
390
394
|
} // and applies them to the HTMLElements such as popper and arrow
|
|
391
395
|
|
|
392
396
|
|
|
@@ -397,11 +401,11 @@ function applyStyles(_ref) {
|
|
|
397
401
|
var attributes = state.attributes[name] || {};
|
|
398
402
|
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
399
403
|
|
|
400
|
-
if (!isHTMLElement
|
|
404
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
401
405
|
return;
|
|
402
406
|
} // Flow doesn't support to extend this property, but it's the most
|
|
403
407
|
// effective way to apply styles to an HTMLElement
|
|
404
|
-
// $FlowFixMe
|
|
408
|
+
// $FlowFixMe[cannot-write]
|
|
405
409
|
|
|
406
410
|
|
|
407
411
|
Object.assign(element.style, style);
|
|
@@ -417,7 +421,7 @@ function applyStyles(_ref) {
|
|
|
417
421
|
});
|
|
418
422
|
}
|
|
419
423
|
|
|
420
|
-
function effect(_ref2) {
|
|
424
|
+
function effect$2(_ref2) {
|
|
421
425
|
var state = _ref2.state;
|
|
422
426
|
var initialStyles = {
|
|
423
427
|
popper: {
|
|
@@ -432,6 +436,7 @@ function effect(_ref2) {
|
|
|
432
436
|
reference: {}
|
|
433
437
|
};
|
|
434
438
|
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
439
|
+
state.styles = initialStyles;
|
|
435
440
|
|
|
436
441
|
if (state.elements.arrow) {
|
|
437
442
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
@@ -448,12 +453,9 @@ function effect(_ref2) {
|
|
|
448
453
|
return style;
|
|
449
454
|
}, {}); // arrow is optional + virtual elements
|
|
450
455
|
|
|
451
|
-
if (!isHTMLElement
|
|
456
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
452
457
|
return;
|
|
453
|
-
}
|
|
454
|
-
// effective way to apply styles to an HTMLElement
|
|
455
|
-
// $FlowFixMe
|
|
456
|
-
|
|
458
|
+
}
|
|
457
459
|
|
|
458
460
|
Object.assign(element.style, style);
|
|
459
461
|
Object.keys(attributes).forEach(function (attribute) {
|
|
@@ -469,45 +471,70 @@ var applyStyles$1 = {
|
|
|
469
471
|
enabled: true,
|
|
470
472
|
phase: 'write',
|
|
471
473
|
fn: applyStyles,
|
|
472
|
-
effect: effect,
|
|
474
|
+
effect: effect$2,
|
|
473
475
|
requires: ['computeStyles']
|
|
474
476
|
};
|
|
475
477
|
|
|
476
478
|
function getBasePlacement(placement) {
|
|
477
479
|
return placement.split('-')[0];
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function getBoundingClientRect(element) {
|
|
483
|
+
var rect = element.getBoundingClientRect();
|
|
484
|
+
return {
|
|
485
|
+
width: rect.width,
|
|
486
|
+
height: rect.height,
|
|
487
|
+
top: rect.top,
|
|
488
|
+
right: rect.right,
|
|
489
|
+
bottom: rect.bottom,
|
|
490
|
+
left: rect.left,
|
|
491
|
+
x: rect.left,
|
|
492
|
+
y: rect.top
|
|
493
|
+
};
|
|
494
|
+
} // means it doesn't take into account transforms.
|
|
480
495
|
|
|
481
496
|
|
|
482
497
|
function getLayoutRect(element) {
|
|
498
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
499
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
500
|
+
|
|
501
|
+
var width = element.offsetWidth;
|
|
502
|
+
var height = element.offsetHeight;
|
|
503
|
+
|
|
504
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
505
|
+
width = clientRect.width;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
509
|
+
height = clientRect.height;
|
|
510
|
+
}
|
|
511
|
+
|
|
483
512
|
return {
|
|
484
513
|
x: element.offsetLeft,
|
|
485
514
|
y: element.offsetTop,
|
|
486
|
-
width:
|
|
487
|
-
height:
|
|
515
|
+
width: width,
|
|
516
|
+
height: height
|
|
488
517
|
};
|
|
489
518
|
}
|
|
490
519
|
|
|
491
520
|
function contains(parent, child) {
|
|
492
|
-
var rootNode = child.getRootNode && child.getRootNode(); //
|
|
493
|
-
|
|
494
|
-
var isShadow = Boolean(rootNode && rootNode.host); // First, attempt with faster native method
|
|
521
|
+
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
|
495
522
|
|
|
496
523
|
if (parent.contains(child)) {
|
|
497
524
|
return true;
|
|
498
525
|
} // then fallback to custom implementation with Shadow DOM support
|
|
499
|
-
else if (
|
|
500
|
-
|
|
526
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
527
|
+
var next = child;
|
|
501
528
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
529
|
+
do {
|
|
530
|
+
if (next && parent.isSameNode(next)) {
|
|
531
|
+
return true;
|
|
532
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
506
533
|
|
|
507
534
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
535
|
+
next = next.parentNode || next.host;
|
|
536
|
+
} while (next);
|
|
537
|
+
} // Give up, the result is false
|
|
511
538
|
|
|
512
539
|
|
|
513
540
|
return false;
|
|
@@ -522,8 +549,9 @@ function isTableElement(element) {
|
|
|
522
549
|
}
|
|
523
550
|
|
|
524
551
|
function getDocumentElement(element) {
|
|
525
|
-
// $FlowFixMe: assume body is always available
|
|
526
|
-
return ((isElement
|
|
552
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
553
|
+
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
554
|
+
element.document) || window.document).documentElement;
|
|
527
555
|
}
|
|
528
556
|
|
|
529
557
|
function getParentNode(element) {
|
|
@@ -531,46 +559,50 @@ function getParentNode(element) {
|
|
|
531
559
|
return element;
|
|
532
560
|
}
|
|
533
561
|
|
|
534
|
-
return (//
|
|
562
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
563
|
+
// $FlowFixMe[incompatible-return]
|
|
564
|
+
// $FlowFixMe[prop-missing]
|
|
535
565
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
536
|
-
element.parentNode || // DOM Element detected
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
// $FlowFixMe: HTMLElement is a Node
|
|
566
|
+
element.parentNode || ( // DOM Element detected
|
|
567
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
568
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
540
569
|
getDocumentElement(element) // fallback
|
|
541
570
|
|
|
542
571
|
);
|
|
543
572
|
}
|
|
544
573
|
|
|
545
574
|
function getTrueOffsetParent(element) {
|
|
546
|
-
if (!isHTMLElement
|
|
575
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
547
576
|
getComputedStyle(element).position === 'fixed') {
|
|
548
577
|
return null;
|
|
549
578
|
}
|
|
550
579
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
if (offsetParent) {
|
|
554
|
-
var html = getDocumentElement(offsetParent);
|
|
555
|
-
|
|
556
|
-
if (getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && getComputedStyle(html).position !== 'static') {
|
|
557
|
-
return html;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
return offsetParent;
|
|
580
|
+
return element.offsetParent;
|
|
562
581
|
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
|
563
582
|
// return the containing block
|
|
564
583
|
|
|
565
584
|
|
|
566
585
|
function getContainingBlock(element) {
|
|
586
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
|
|
587
|
+
var isIE = navigator.userAgent.indexOf('Trident') !== -1;
|
|
588
|
+
|
|
589
|
+
if (isIE && isHTMLElement(element)) {
|
|
590
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
591
|
+
var elementCss = getComputedStyle(element);
|
|
592
|
+
|
|
593
|
+
if (elementCss.position === 'fixed') {
|
|
594
|
+
return null;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
567
598
|
var currentNode = getParentNode(element);
|
|
568
599
|
|
|
569
|
-
while (isHTMLElement
|
|
600
|
+
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
570
601
|
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
571
602
|
// create a containing block.
|
|
603
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
572
604
|
|
|
573
|
-
if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== '
|
|
605
|
+
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') {
|
|
574
606
|
return currentNode;
|
|
575
607
|
} else {
|
|
576
608
|
currentNode = currentNode.parentNode;
|
|
@@ -590,7 +622,7 @@ function getOffsetParent(element) {
|
|
|
590
622
|
offsetParent = getTrueOffsetParent(offsetParent);
|
|
591
623
|
}
|
|
592
624
|
|
|
593
|
-
if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static') {
|
|
625
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
|
594
626
|
return window;
|
|
595
627
|
}
|
|
596
628
|
|
|
@@ -601,8 +633,12 @@ function getMainAxisFromPlacement(placement) {
|
|
|
601
633
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
602
634
|
}
|
|
603
635
|
|
|
604
|
-
|
|
605
|
-
|
|
636
|
+
var max = Math.max;
|
|
637
|
+
var min = Math.min;
|
|
638
|
+
var round = Math.round;
|
|
639
|
+
|
|
640
|
+
function within(min$1, value, max$1) {
|
|
641
|
+
return max(min$1, min(value, max$1));
|
|
606
642
|
}
|
|
607
643
|
|
|
608
644
|
function getFreshSideObject() {
|
|
@@ -615,7 +651,7 @@ function getFreshSideObject() {
|
|
|
615
651
|
}
|
|
616
652
|
|
|
617
653
|
function mergePaddingObject(paddingObject) {
|
|
618
|
-
return Object.assign(
|
|
654
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
619
655
|
}
|
|
620
656
|
|
|
621
657
|
function expandToHashMap(value, keys) {
|
|
@@ -625,11 +661,19 @@ function expandToHashMap(value, keys) {
|
|
|
625
661
|
}, {});
|
|
626
662
|
}
|
|
627
663
|
|
|
664
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
665
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
666
|
+
placement: state.placement
|
|
667
|
+
})) : padding;
|
|
668
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
669
|
+
};
|
|
670
|
+
|
|
628
671
|
function arrow(_ref) {
|
|
629
672
|
var _state$modifiersData$;
|
|
630
673
|
|
|
631
674
|
var state = _ref.state,
|
|
632
|
-
name = _ref.name
|
|
675
|
+
name = _ref.name,
|
|
676
|
+
options = _ref.options;
|
|
633
677
|
var arrowElement = state.elements.arrow;
|
|
634
678
|
var popperOffsets = state.modifiersData.popperOffsets;
|
|
635
679
|
var basePlacement = getBasePlacement(state.placement);
|
|
@@ -641,7 +685,7 @@ function arrow(_ref) {
|
|
|
641
685
|
return;
|
|
642
686
|
}
|
|
643
687
|
|
|
644
|
-
var paddingObject =
|
|
688
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
645
689
|
var arrowRect = getLayoutRect(arrowElement);
|
|
646
690
|
var minProp = axis === 'y' ? top : left;
|
|
647
691
|
var maxProp = axis === 'y' ? bottom : right;
|
|
@@ -663,12 +707,9 @@ function arrow(_ref) {
|
|
|
663
707
|
|
|
664
708
|
function effect$1(_ref2) {
|
|
665
709
|
var state = _ref2.state,
|
|
666
|
-
options = _ref2.options
|
|
667
|
-
name = _ref2.name;
|
|
710
|
+
options = _ref2.options;
|
|
668
711
|
var _options$element = options.element,
|
|
669
|
-
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element
|
|
670
|
-
_options$padding = options.padding,
|
|
671
|
-
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
712
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
672
713
|
|
|
673
714
|
if (arrowElement == null) {
|
|
674
715
|
return;
|
|
@@ -688,9 +729,6 @@ function effect$1(_ref2) {
|
|
|
688
729
|
}
|
|
689
730
|
|
|
690
731
|
state.elements.arrow = arrowElement;
|
|
691
|
-
state.modifiersData[name + "#persistent"] = {
|
|
692
|
-
padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))
|
|
693
|
-
};
|
|
694
732
|
} // eslint-disable-next-line import/no-unused-modules
|
|
695
733
|
|
|
696
734
|
|
|
@@ -712,14 +750,14 @@ var unsetSides = {
|
|
|
712
750
|
// Zooming can change the DPR, but it seems to report a value that will
|
|
713
751
|
// cleanly divide the values into the appropriate subpixels.
|
|
714
752
|
|
|
715
|
-
function
|
|
753
|
+
function roundOffsetsByDPR(_ref) {
|
|
716
754
|
var x = _ref.x,
|
|
717
755
|
y = _ref.y;
|
|
718
756
|
var win = window;
|
|
719
757
|
var dpr = win.devicePixelRatio || 1;
|
|
720
758
|
return {
|
|
721
|
-
x:
|
|
722
|
-
y:
|
|
759
|
+
x: round(round(x * dpr) / dpr) || 0,
|
|
760
|
+
y: round(round(y * dpr) / dpr) || 0
|
|
723
761
|
};
|
|
724
762
|
}
|
|
725
763
|
|
|
@@ -732,11 +770,14 @@ function mapToStyles(_ref2) {
|
|
|
732
770
|
offsets = _ref2.offsets,
|
|
733
771
|
position = _ref2.position,
|
|
734
772
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
735
|
-
adaptive = _ref2.adaptive
|
|
773
|
+
adaptive = _ref2.adaptive,
|
|
774
|
+
roundOffsets = _ref2.roundOffsets;
|
|
736
775
|
|
|
737
|
-
var
|
|
738
|
-
x =
|
|
739
|
-
|
|
776
|
+
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
|
777
|
+
_ref3$x = _ref3.x,
|
|
778
|
+
x = _ref3$x === void 0 ? 0 : _ref3$x,
|
|
779
|
+
_ref3$y = _ref3.y,
|
|
780
|
+
y = _ref3$y === void 0 ? 0 : _ref3$y;
|
|
740
781
|
|
|
741
782
|
var hasX = offsets.hasOwnProperty('x');
|
|
742
783
|
var hasY = offsets.hasOwnProperty('y');
|
|
@@ -746,23 +787,32 @@ function mapToStyles(_ref2) {
|
|
|
746
787
|
|
|
747
788
|
if (adaptive) {
|
|
748
789
|
var offsetParent = getOffsetParent(popper);
|
|
790
|
+
var heightProp = 'clientHeight';
|
|
791
|
+
var widthProp = 'clientWidth';
|
|
749
792
|
|
|
750
793
|
if (offsetParent === getWindow(popper)) {
|
|
751
794
|
offsetParent = getDocumentElement(popper);
|
|
752
|
-
} // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
753
795
|
|
|
754
|
-
|
|
796
|
+
if (getComputedStyle(offsetParent).position !== 'static') {
|
|
797
|
+
heightProp = 'scrollHeight';
|
|
798
|
+
widthProp = 'scrollWidth';
|
|
799
|
+
}
|
|
800
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
801
|
+
|
|
755
802
|
|
|
803
|
+
offsetParent = offsetParent;
|
|
756
804
|
|
|
757
805
|
if (placement === top) {
|
|
758
|
-
sideY = bottom;
|
|
759
|
-
|
|
806
|
+
sideY = bottom; // $FlowFixMe[prop-missing]
|
|
807
|
+
|
|
808
|
+
y -= offsetParent[heightProp] - popperRect.height;
|
|
760
809
|
y *= gpuAcceleration ? 1 : -1;
|
|
761
810
|
}
|
|
762
811
|
|
|
763
812
|
if (placement === left) {
|
|
764
|
-
sideX = right;
|
|
765
|
-
|
|
813
|
+
sideX = right; // $FlowFixMe[prop-missing]
|
|
814
|
+
|
|
815
|
+
x -= offsetParent[widthProp] - popperRect.width;
|
|
766
816
|
x *= gpuAcceleration ? 1 : -1;
|
|
767
817
|
}
|
|
768
818
|
}
|
|
@@ -774,19 +824,21 @@ function mapToStyles(_ref2) {
|
|
|
774
824
|
if (gpuAcceleration) {
|
|
775
825
|
var _Object$assign;
|
|
776
826
|
|
|
777
|
-
return Object.assign(
|
|
827
|
+
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));
|
|
778
828
|
}
|
|
779
829
|
|
|
780
|
-
return Object.assign(
|
|
830
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
781
831
|
}
|
|
782
832
|
|
|
783
|
-
function computeStyles(
|
|
784
|
-
var state =
|
|
785
|
-
options =
|
|
833
|
+
function computeStyles(_ref4) {
|
|
834
|
+
var state = _ref4.state,
|
|
835
|
+
options = _ref4.options;
|
|
786
836
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
787
837
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
788
838
|
_options$adaptive = options.adaptive,
|
|
789
|
-
adaptive = _options$adaptive === void 0 ? true : _options$adaptive
|
|
839
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
840
|
+
_options$roundOffsets = options.roundOffsets,
|
|
841
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
790
842
|
var commonStyles = {
|
|
791
843
|
placement: getBasePlacement(state.placement),
|
|
792
844
|
popper: state.elements.popper,
|
|
@@ -795,22 +847,24 @@ function computeStyles(_ref3) {
|
|
|
795
847
|
};
|
|
796
848
|
|
|
797
849
|
if (state.modifiersData.popperOffsets != null) {
|
|
798
|
-
state.styles.popper = Object.assign(
|
|
850
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
799
851
|
offsets: state.modifiersData.popperOffsets,
|
|
800
852
|
position: state.options.strategy,
|
|
801
|
-
adaptive: adaptive
|
|
853
|
+
adaptive: adaptive,
|
|
854
|
+
roundOffsets: roundOffsets
|
|
802
855
|
})));
|
|
803
856
|
}
|
|
804
857
|
|
|
805
858
|
if (state.modifiersData.arrow != null) {
|
|
806
|
-
state.styles.arrow = Object.assign(
|
|
859
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
807
860
|
offsets: state.modifiersData.arrow,
|
|
808
861
|
position: 'absolute',
|
|
809
|
-
adaptive: false
|
|
862
|
+
adaptive: false,
|
|
863
|
+
roundOffsets: roundOffsets
|
|
810
864
|
})));
|
|
811
865
|
}
|
|
812
866
|
|
|
813
|
-
state.attributes.popper = Object.assign(
|
|
867
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
814
868
|
'data-popper-placement': state.placement
|
|
815
869
|
});
|
|
816
870
|
} // eslint-disable-next-line import/no-unused-modules
|
|
@@ -827,7 +881,7 @@ var passive = {
|
|
|
827
881
|
passive: true
|
|
828
882
|
};
|
|
829
883
|
|
|
830
|
-
function effect
|
|
884
|
+
function effect(_ref) {
|
|
831
885
|
var state = _ref.state,
|
|
832
886
|
instance = _ref.instance,
|
|
833
887
|
options = _ref.options;
|
|
@@ -867,10 +921,10 @@ var eventListeners = {
|
|
|
867
921
|
enabled: true,
|
|
868
922
|
phase: 'write',
|
|
869
923
|
fn: function fn() {},
|
|
870
|
-
effect: effect
|
|
924
|
+
effect: effect,
|
|
871
925
|
data: {}
|
|
872
926
|
};
|
|
873
|
-
var hash = {
|
|
927
|
+
var hash$1 = {
|
|
874
928
|
left: 'right',
|
|
875
929
|
right: 'left',
|
|
876
930
|
bottom: 'top',
|
|
@@ -879,35 +933,21 @@ var hash = {
|
|
|
879
933
|
|
|
880
934
|
function getOppositePlacement(placement) {
|
|
881
935
|
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
882
|
-
return hash[matched];
|
|
936
|
+
return hash$1[matched];
|
|
883
937
|
});
|
|
884
938
|
}
|
|
885
939
|
|
|
886
|
-
var hash
|
|
940
|
+
var hash = {
|
|
887
941
|
start: 'end',
|
|
888
942
|
end: 'start'
|
|
889
943
|
};
|
|
890
944
|
|
|
891
945
|
function getOppositeVariationPlacement(placement) {
|
|
892
946
|
return placement.replace(/start|end/g, function (matched) {
|
|
893
|
-
return hash
|
|
947
|
+
return hash[matched];
|
|
894
948
|
});
|
|
895
949
|
}
|
|
896
950
|
|
|
897
|
-
function getBoundingClientRect(element) {
|
|
898
|
-
var rect = element.getBoundingClientRect();
|
|
899
|
-
return {
|
|
900
|
-
width: rect.width,
|
|
901
|
-
height: rect.height,
|
|
902
|
-
top: rect.top,
|
|
903
|
-
right: rect.right,
|
|
904
|
-
bottom: rect.bottom,
|
|
905
|
-
left: rect.left,
|
|
906
|
-
x: rect.left,
|
|
907
|
-
y: rect.top
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
|
|
911
951
|
function getWindowScroll(node) {
|
|
912
952
|
var win = getWindow(node);
|
|
913
953
|
var scrollLeft = win.pageXOffset;
|
|
@@ -969,16 +1009,18 @@ function getViewportRect(element) {
|
|
|
969
1009
|
|
|
970
1010
|
|
|
971
1011
|
function getDocumentRect(element) {
|
|
1012
|
+
var _element$ownerDocumen;
|
|
1013
|
+
|
|
972
1014
|
var html = getDocumentElement(element);
|
|
973
1015
|
var winScroll = getWindowScroll(element);
|
|
974
|
-
var body = element.ownerDocument.body;
|
|
975
|
-
var width =
|
|
976
|
-
var height =
|
|
1016
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
1017
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
1018
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
977
1019
|
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
978
1020
|
var y = -winScroll.scrollTop;
|
|
979
1021
|
|
|
980
1022
|
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
981
|
-
x +=
|
|
1023
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
982
1024
|
}
|
|
983
1025
|
|
|
984
1026
|
return {
|
|
@@ -1001,11 +1043,11 @@ function isScrollParent(element) {
|
|
|
1001
1043
|
|
|
1002
1044
|
function getScrollParent(node) {
|
|
1003
1045
|
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
1004
|
-
// $FlowFixMe: assume body is always available
|
|
1046
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
1005
1047
|
return node.ownerDocument.body;
|
|
1006
1048
|
}
|
|
1007
1049
|
|
|
1008
|
-
if (isHTMLElement
|
|
1050
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
1009
1051
|
return node;
|
|
1010
1052
|
}
|
|
1011
1053
|
|
|
@@ -1014,27 +1056,29 @@ function getScrollParent(node) {
|
|
|
1014
1056
|
/*
|
|
1015
1057
|
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
1016
1058
|
until we get to the top window object. This list is what we attach scroll listeners
|
|
1017
|
-
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
1059
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
1018
1060
|
reference element's position.
|
|
1019
1061
|
*/
|
|
1020
1062
|
|
|
1021
1063
|
|
|
1022
1064
|
function listScrollParents(element, list) {
|
|
1065
|
+
var _element$ownerDocumen;
|
|
1066
|
+
|
|
1023
1067
|
if (list === void 0) {
|
|
1024
1068
|
list = [];
|
|
1025
1069
|
}
|
|
1026
1070
|
|
|
1027
1071
|
var scrollParent = getScrollParent(element);
|
|
1028
|
-
var isBody =
|
|
1072
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
1029
1073
|
var win = getWindow(scrollParent);
|
|
1030
1074
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
1031
1075
|
var updatedList = list.concat(target);
|
|
1032
|
-
return isBody ? updatedList : // $FlowFixMe: isBody tells us target will be an HTMLElement here
|
|
1076
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
1033
1077
|
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
1034
1078
|
}
|
|
1035
1079
|
|
|
1036
1080
|
function rectToClientRect(rect) {
|
|
1037
|
-
return Object.assign(
|
|
1081
|
+
return Object.assign({}, rect, {
|
|
1038
1082
|
left: rect.x,
|
|
1039
1083
|
top: rect.y,
|
|
1040
1084
|
right: rect.x + rect.width,
|
|
@@ -1056,7 +1100,7 @@ function getInnerBoundingClientRect(element) {
|
|
|
1056
1100
|
}
|
|
1057
1101
|
|
|
1058
1102
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
1059
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement
|
|
1103
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1060
1104
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
1061
1105
|
// clipping (or hiding) overflowing elements with a position different from
|
|
1062
1106
|
// `initial`
|
|
@@ -1065,15 +1109,15 @@ function getClientRectFromMixedType(element, clippingParent) {
|
|
|
1065
1109
|
function getClippingParents(element) {
|
|
1066
1110
|
var clippingParents = listScrollParents(getParentNode(element));
|
|
1067
1111
|
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
|
1068
|
-
var clipperElement = canEscapeClipping && isHTMLElement
|
|
1112
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
1069
1113
|
|
|
1070
|
-
if (!isElement
|
|
1114
|
+
if (!isElement(clipperElement)) {
|
|
1071
1115
|
return [];
|
|
1072
|
-
} // $FlowFixMe: https://github.com/facebook/flow/issues/1414
|
|
1116
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
1073
1117
|
|
|
1074
1118
|
|
|
1075
1119
|
return clippingParents.filter(function (clippingParent) {
|
|
1076
|
-
return isElement
|
|
1120
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
1077
1121
|
});
|
|
1078
1122
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
1079
1123
|
// clipping parents
|
|
@@ -1085,10 +1129,10 @@ function getClippingRect(element, boundary, rootBoundary) {
|
|
|
1085
1129
|
var firstClippingParent = clippingParents[0];
|
|
1086
1130
|
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
1087
1131
|
var rect = getClientRectFromMixedType(element, clippingParent);
|
|
1088
|
-
accRect.top =
|
|
1089
|
-
accRect.right =
|
|
1090
|
-
accRect.bottom =
|
|
1091
|
-
accRect.left =
|
|
1132
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1133
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1134
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1135
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1092
1136
|
return accRect;
|
|
1093
1137
|
}, getClientRectFromMixedType(element, firstClippingParent));
|
|
1094
1138
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
@@ -1155,11 +1199,11 @@ function computeOffsets(_ref) {
|
|
|
1155
1199
|
|
|
1156
1200
|
switch (variation) {
|
|
1157
1201
|
case start:
|
|
1158
|
-
offsets[mainAxis] =
|
|
1202
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
1159
1203
|
break;
|
|
1160
1204
|
|
|
1161
1205
|
case end:
|
|
1162
|
-
offsets[mainAxis] =
|
|
1206
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
1163
1207
|
break;
|
|
1164
1208
|
}
|
|
1165
1209
|
}
|
|
@@ -1190,7 +1234,7 @@ function detectOverflow(state, options) {
|
|
|
1190
1234
|
var referenceElement = state.elements.reference;
|
|
1191
1235
|
var popperRect = state.rects.popper;
|
|
1192
1236
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
1193
|
-
var clippingClientRect = getClippingRect(isElement
|
|
1237
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
1194
1238
|
var referenceClientRect = getBoundingClientRect(referenceElement);
|
|
1195
1239
|
var popperOffsets = computeOffsets({
|
|
1196
1240
|
reference: referenceClientRect,
|
|
@@ -1198,7 +1242,7 @@ function detectOverflow(state, options) {
|
|
|
1198
1242
|
strategy: 'absolute',
|
|
1199
1243
|
placement: placement
|
|
1200
1244
|
});
|
|
1201
|
-
var popperClientRect = rectToClientRect(Object.assign(
|
|
1245
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
1202
1246
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
1203
1247
|
// 0 or negative = within the clipping rect
|
|
1204
1248
|
|
|
@@ -1221,10 +1265,6 @@ function detectOverflow(state, options) {
|
|
|
1221
1265
|
|
|
1222
1266
|
return overflowOffsets;
|
|
1223
1267
|
}
|
|
1224
|
-
/*:: type OverflowsMap = { [ComputedPlacement]: number }; */
|
|
1225
|
-
|
|
1226
|
-
/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
|
|
1227
|
-
|
|
1228
1268
|
|
|
1229
1269
|
function computeAutoPlacement(state, options) {
|
|
1230
1270
|
if (options === void 0) {
|
|
@@ -1242,15 +1282,14 @@ function computeAutoPlacement(state, options) {
|
|
|
1242
1282
|
var variation = getVariation(placement);
|
|
1243
1283
|
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
|
1244
1284
|
return getVariation(placement) === variation;
|
|
1245
|
-
}) : basePlacements;
|
|
1246
|
-
|
|
1285
|
+
}) : basePlacements;
|
|
1247
1286
|
var allowedPlacements = placements$1.filter(function (placement) {
|
|
1248
1287
|
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
1249
1288
|
});
|
|
1250
1289
|
|
|
1251
1290
|
if (allowedPlacements.length === 0) {
|
|
1252
1291
|
allowedPlacements = placements$1;
|
|
1253
|
-
} // $FlowFixMe: Flow seems to have problems with two array unions...
|
|
1292
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
1254
1293
|
|
|
1255
1294
|
|
|
1256
1295
|
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
@@ -1451,7 +1490,7 @@ function hide(_ref) {
|
|
|
1451
1490
|
isReferenceHidden: isReferenceHidden,
|
|
1452
1491
|
hasPopperEscaped: hasPopperEscaped
|
|
1453
1492
|
};
|
|
1454
|
-
state.attributes.popper = Object.assign(
|
|
1493
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
1455
1494
|
'data-popper-reference-hidden': isReferenceHidden,
|
|
1456
1495
|
'data-popper-escaped': hasPopperEscaped
|
|
1457
1496
|
});
|
|
@@ -1470,7 +1509,7 @@ function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
|
1470
1509
|
var basePlacement = getBasePlacement(placement);
|
|
1471
1510
|
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
1472
1511
|
|
|
1473
|
-
var _ref = typeof offset === 'function' ? offset(Object.assign(
|
|
1512
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
1474
1513
|
placement: placement
|
|
1475
1514
|
})) : offset,
|
|
1476
1515
|
skidding = _ref[0],
|
|
@@ -1576,7 +1615,7 @@ function preventOverflow(_ref) {
|
|
|
1576
1615
|
var popperOffsets = state.modifiersData.popperOffsets;
|
|
1577
1616
|
var referenceRect = state.rects.reference;
|
|
1578
1617
|
var popperRect = state.rects.popper;
|
|
1579
|
-
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(
|
|
1618
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
1580
1619
|
placement: state.placement
|
|
1581
1620
|
})) : tetherOffset;
|
|
1582
1621
|
var data = {
|
|
@@ -1588,13 +1627,13 @@ function preventOverflow(_ref) {
|
|
|
1588
1627
|
return;
|
|
1589
1628
|
}
|
|
1590
1629
|
|
|
1591
|
-
if (checkMainAxis) {
|
|
1630
|
+
if (checkMainAxis || checkAltAxis) {
|
|
1592
1631
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
1593
1632
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
1594
1633
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
1595
1634
|
var offset = popperOffsets[mainAxis];
|
|
1596
|
-
var min = popperOffsets[mainAxis] + overflow[mainSide];
|
|
1597
|
-
var max = popperOffsets[mainAxis] - overflow[altSide];
|
|
1635
|
+
var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
|
|
1636
|
+
var max$1 = popperOffsets[mainAxis] - overflow[altSide];
|
|
1598
1637
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1599
1638
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
1600
1639
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -1621,26 +1660,29 @@ function preventOverflow(_ref) {
|
|
|
1621
1660
|
var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
|
|
1622
1661
|
var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
|
|
1623
1662
|
var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
|
|
1624
|
-
var preventedOffset = within(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max);
|
|
1625
|
-
popperOffsets[mainAxis] = preventedOffset;
|
|
1626
|
-
data[mainAxis] = preventedOffset - offset;
|
|
1627
|
-
}
|
|
1628
1663
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1664
|
+
if (checkMainAxis) {
|
|
1665
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
1666
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
1667
|
+
data[mainAxis] = preventedOffset - offset;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
if (checkAltAxis) {
|
|
1671
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
1631
1672
|
|
|
1632
|
-
|
|
1673
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
1633
1674
|
|
|
1634
|
-
|
|
1675
|
+
var _offset = popperOffsets[altAxis];
|
|
1635
1676
|
|
|
1636
|
-
|
|
1677
|
+
var _min = _offset + overflow[_mainSide];
|
|
1637
1678
|
|
|
1638
|
-
|
|
1679
|
+
var _max = _offset - overflow[_altSide];
|
|
1639
1680
|
|
|
1640
|
-
|
|
1681
|
+
var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
|
|
1641
1682
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1683
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
1684
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
1685
|
+
}
|
|
1644
1686
|
}
|
|
1645
1687
|
|
|
1646
1688
|
state.modifiersData[name] = data;
|
|
@@ -1663,7 +1705,7 @@ function getHTMLElementScroll(element) {
|
|
|
1663
1705
|
}
|
|
1664
1706
|
|
|
1665
1707
|
function getNodeScroll(node) {
|
|
1666
|
-
if (node === getWindow(node) || !isHTMLElement
|
|
1708
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
1667
1709
|
return getWindowScroll(node);
|
|
1668
1710
|
} else {
|
|
1669
1711
|
return getHTMLElementScroll(node);
|
|
@@ -1678,7 +1720,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
1678
1720
|
|
|
1679
1721
|
var documentElement = getDocumentElement(offsetParent);
|
|
1680
1722
|
var rect = getBoundingClientRect(elementOrVirtualElement);
|
|
1681
|
-
var isOffsetParentAnElement = isHTMLElement
|
|
1723
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1682
1724
|
var scroll = {
|
|
1683
1725
|
scrollLeft: 0,
|
|
1684
1726
|
scrollTop: 0
|
|
@@ -1694,7 +1736,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
1694
1736
|
scroll = getNodeScroll(offsetParent);
|
|
1695
1737
|
}
|
|
1696
1738
|
|
|
1697
|
-
if (isHTMLElement
|
|
1739
|
+
if (isHTMLElement(offsetParent)) {
|
|
1698
1740
|
offsets = getBoundingClientRect(offsetParent);
|
|
1699
1741
|
offsets.x += offsetParent.clientLeft;
|
|
1700
1742
|
offsets.y += offsetParent.clientTop;
|
|
@@ -1773,9 +1815,9 @@ function debounce(fn) {
|
|
|
1773
1815
|
function mergeByName(modifiers) {
|
|
1774
1816
|
var merged = modifiers.reduce(function (merged, current) {
|
|
1775
1817
|
var existing = merged[current.name];
|
|
1776
|
-
merged[current.name] = existing ? Object.assign(
|
|
1777
|
-
options: Object.assign(
|
|
1778
|
-
data: Object.assign(
|
|
1818
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
|
1819
|
+
options: Object.assign({}, existing.options, current.options),
|
|
1820
|
+
data: Object.assign({}, existing.data, current.data)
|
|
1779
1821
|
}) : current;
|
|
1780
1822
|
return merged;
|
|
1781
1823
|
}, {}); // IE11 does not support Object.values
|
|
@@ -1819,7 +1861,7 @@ function popperGenerator(generatorOptions) {
|
|
|
1819
1861
|
var state = {
|
|
1820
1862
|
placement: 'bottom',
|
|
1821
1863
|
orderedModifiers: [],
|
|
1822
|
-
options: Object.assign(
|
|
1864
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
1823
1865
|
modifiersData: {},
|
|
1824
1866
|
elements: {
|
|
1825
1867
|
reference: reference,
|
|
@@ -1834,9 +1876,9 @@ function popperGenerator(generatorOptions) {
|
|
|
1834
1876
|
state: state,
|
|
1835
1877
|
setOptions: function setOptions(options) {
|
|
1836
1878
|
cleanupModifierEffects();
|
|
1837
|
-
state.options = Object.assign(
|
|
1879
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
1838
1880
|
state.scrollParents = {
|
|
1839
|
-
reference: isElement
|
|
1881
|
+
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
1840
1882
|
popper: listScrollParents(popper)
|
|
1841
1883
|
}; // Orders the modifiers based on their dependencies and `phase`
|
|
1842
1884
|
// properties
|
|
@@ -2168,7 +2210,8 @@ function getPopperOptions(attachToOptions, step) {
|
|
|
2168
2210
|
modifiers: [{
|
|
2169
2211
|
name: 'preventOverflow',
|
|
2170
2212
|
options: {
|
|
2171
|
-
altAxis: true
|
|
2213
|
+
altAxis: true,
|
|
2214
|
+
tether: false
|
|
2172
2215
|
}
|
|
2173
2216
|
}, {
|
|
2174
2217
|
name: 'focusAfterRender',
|
|
@@ -2333,7 +2376,7 @@ function set_current_component(component) {
|
|
|
2333
2376
|
}
|
|
2334
2377
|
|
|
2335
2378
|
function get_current_component() {
|
|
2336
|
-
if (!current_component) throw new Error(
|
|
2379
|
+
if (!current_component) throw new Error('Function called outside component initialization');
|
|
2337
2380
|
return current_component;
|
|
2338
2381
|
}
|
|
2339
2382
|
|
|
@@ -2506,28 +2549,32 @@ function create_component(block) {
|
|
|
2506
2549
|
block && block.c();
|
|
2507
2550
|
}
|
|
2508
2551
|
|
|
2509
|
-
function mount_component(component, target, anchor) {
|
|
2552
|
+
function mount_component(component, target, anchor, customElement) {
|
|
2510
2553
|
const {
|
|
2511
2554
|
fragment,
|
|
2512
2555
|
on_mount,
|
|
2513
2556
|
on_destroy,
|
|
2514
2557
|
after_update
|
|
2515
2558
|
} = component.$$;
|
|
2516
|
-
fragment && fragment.m(target, anchor);
|
|
2559
|
+
fragment && fragment.m(target, anchor);
|
|
2517
2560
|
|
|
2518
|
-
|
|
2519
|
-
|
|
2561
|
+
if (!customElement) {
|
|
2562
|
+
// onMount happens before the initial afterUpdate
|
|
2563
|
+
add_render_callback(() => {
|
|
2564
|
+
const new_on_destroy = on_mount.map(run).filter(is_function);
|
|
2520
2565
|
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2566
|
+
if (on_destroy) {
|
|
2567
|
+
on_destroy.push(...new_on_destroy);
|
|
2568
|
+
} else {
|
|
2569
|
+
// Edge case - component was destroyed immediately,
|
|
2570
|
+
// most likely as a result of a binding initialising
|
|
2571
|
+
run_all(new_on_destroy);
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
component.$$.on_mount = [];
|
|
2575
|
+
});
|
|
2576
|
+
}
|
|
2528
2577
|
|
|
2529
|
-
component.$$.on_mount = [];
|
|
2530
|
-
});
|
|
2531
2578
|
after_update.forEach(add_render_callback);
|
|
2532
2579
|
}
|
|
2533
2580
|
|
|
@@ -2557,7 +2604,6 @@ function make_dirty(component, i) {
|
|
|
2557
2604
|
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
|
|
2558
2605
|
const parent_component = current_component;
|
|
2559
2606
|
set_current_component(component);
|
|
2560
|
-
const prop_values = options.props || {};
|
|
2561
2607
|
const $$ = component.$$ = {
|
|
2562
2608
|
fragment: null,
|
|
2563
2609
|
ctx: null,
|
|
@@ -2569,16 +2615,17 @@ function init(component, options, instance, create_fragment, not_equal, props, d
|
|
|
2569
2615
|
// lifecycle
|
|
2570
2616
|
on_mount: [],
|
|
2571
2617
|
on_destroy: [],
|
|
2618
|
+
on_disconnect: [],
|
|
2572
2619
|
before_update: [],
|
|
2573
2620
|
after_update: [],
|
|
2574
|
-
context: new Map(parent_component ? parent_component.$$.context : []),
|
|
2621
|
+
context: new Map(parent_component ? parent_component.$$.context : options.context || []),
|
|
2575
2622
|
// everything else
|
|
2576
2623
|
callbacks: blank_object(),
|
|
2577
2624
|
dirty,
|
|
2578
2625
|
skip_bound: false
|
|
2579
2626
|
};
|
|
2580
2627
|
let ready = false;
|
|
2581
|
-
$$.ctx = instance ? instance(component,
|
|
2628
|
+
$$.ctx = instance ? instance(component, options.props || {}, (i, ret, ...rest) => {
|
|
2582
2629
|
const value = rest.length ? rest[0] : ret;
|
|
2583
2630
|
|
|
2584
2631
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
|
@@ -2606,12 +2653,16 @@ function init(component, options, instance, create_fragment, not_equal, props, d
|
|
|
2606
2653
|
}
|
|
2607
2654
|
|
|
2608
2655
|
if (options.intro) transition_in(component.$$.fragment);
|
|
2609
|
-
mount_component(component, options.target, options.anchor);
|
|
2656
|
+
mount_component(component, options.target, options.anchor, options.customElement);
|
|
2610
2657
|
flush();
|
|
2611
2658
|
}
|
|
2612
2659
|
|
|
2613
2660
|
set_current_component(parent_component);
|
|
2614
2661
|
}
|
|
2662
|
+
/**
|
|
2663
|
+
* Base class for Svelte components. Used when dev=false.
|
|
2664
|
+
*/
|
|
2665
|
+
|
|
2615
2666
|
|
|
2616
2667
|
class SvelteComponent {
|
|
2617
2668
|
$destroy() {
|
|
@@ -2637,10 +2688,10 @@ class SvelteComponent {
|
|
|
2637
2688
|
}
|
|
2638
2689
|
|
|
2639
2690
|
}
|
|
2640
|
-
/* src/js/components/shepherd-button.svelte generated by Svelte v3.
|
|
2691
|
+
/* src/js/components/shepherd-button.svelte generated by Svelte v3.37.0 */
|
|
2641
2692
|
|
|
2642
2693
|
|
|
2643
|
-
function create_fragment(ctx) {
|
|
2694
|
+
function create_fragment$8(ctx) {
|
|
2644
2695
|
let button;
|
|
2645
2696
|
let button_aria_label_value;
|
|
2646
2697
|
let button_class_value;
|
|
@@ -2732,7 +2783,7 @@ function create_fragment(ctx) {
|
|
|
2732
2783
|
};
|
|
2733
2784
|
}
|
|
2734
2785
|
|
|
2735
|
-
function instance($$self, $$props, $$invalidate) {
|
|
2786
|
+
function instance$8($$self, $$props, $$invalidate) {
|
|
2736
2787
|
let {
|
|
2737
2788
|
config
|
|
2738
2789
|
} = $$props,
|
|
@@ -2775,14 +2826,14 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
2775
2826
|
class Shepherd_button extends SvelteComponent {
|
|
2776
2827
|
constructor(options) {
|
|
2777
2828
|
super();
|
|
2778
|
-
init(this, options, instance, create_fragment, safe_not_equal, {
|
|
2829
|
+
init(this, options, instance$8, create_fragment$8, safe_not_equal, {
|
|
2779
2830
|
config: 6,
|
|
2780
2831
|
step: 7
|
|
2781
2832
|
});
|
|
2782
2833
|
}
|
|
2783
2834
|
|
|
2784
2835
|
}
|
|
2785
|
-
/* src/js/components/shepherd-footer.svelte generated by Svelte v3.
|
|
2836
|
+
/* src/js/components/shepherd-footer.svelte generated by Svelte v3.37.0 */
|
|
2786
2837
|
|
|
2787
2838
|
|
|
2788
2839
|
function get_each_context(ctx, list, i) {
|
|
@@ -2792,7 +2843,7 @@ function get_each_context(ctx, list, i) {
|
|
|
2792
2843
|
} // (24:4) {#if buttons}
|
|
2793
2844
|
|
|
2794
2845
|
|
|
2795
|
-
function create_if_block(ctx) {
|
|
2846
|
+
function create_if_block$3(ctx) {
|
|
2796
2847
|
let each_1_anchor;
|
|
2797
2848
|
let current;
|
|
2798
2849
|
let each_value =
|
|
@@ -2944,12 +2995,12 @@ function create_each_block(ctx) {
|
|
|
2944
2995
|
};
|
|
2945
2996
|
}
|
|
2946
2997
|
|
|
2947
|
-
function create_fragment$
|
|
2998
|
+
function create_fragment$7(ctx) {
|
|
2948
2999
|
let footer;
|
|
2949
3000
|
let current;
|
|
2950
3001
|
let if_block =
|
|
2951
3002
|
/*buttons*/
|
|
2952
|
-
ctx[1] && create_if_block(ctx);
|
|
3003
|
+
ctx[1] && create_if_block$3(ctx);
|
|
2953
3004
|
return {
|
|
2954
3005
|
c() {
|
|
2955
3006
|
footer = element("footer");
|
|
@@ -2976,7 +3027,7 @@ function create_fragment$1(ctx) {
|
|
|
2976
3027
|
transition_in(if_block, 1);
|
|
2977
3028
|
}
|
|
2978
3029
|
} else {
|
|
2979
|
-
if_block = create_if_block(ctx);
|
|
3030
|
+
if_block = create_if_block$3(ctx);
|
|
2980
3031
|
if_block.c();
|
|
2981
3032
|
transition_in(if_block, 1);
|
|
2982
3033
|
if_block.m(footer, null);
|
|
@@ -3009,7 +3060,8 @@ function create_fragment$1(ctx) {
|
|
|
3009
3060
|
};
|
|
3010
3061
|
}
|
|
3011
3062
|
|
|
3012
|
-
function instance$
|
|
3063
|
+
function instance$7($$self, $$props, $$invalidate) {
|
|
3064
|
+
let buttons;
|
|
3013
3065
|
let {
|
|
3014
3066
|
step
|
|
3015
3067
|
} = $$props;
|
|
@@ -3018,8 +3070,6 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
3018
3070
|
if ("step" in $$props) $$invalidate(0, step = $$props.step);
|
|
3019
3071
|
};
|
|
3020
3072
|
|
|
3021
|
-
let buttons;
|
|
3022
|
-
|
|
3023
3073
|
$$self.$$.update = () => {
|
|
3024
3074
|
if ($$self.$$.dirty &
|
|
3025
3075
|
/*step*/
|
|
@@ -3034,16 +3084,16 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
3034
3084
|
class Shepherd_footer extends SvelteComponent {
|
|
3035
3085
|
constructor(options) {
|
|
3036
3086
|
super();
|
|
3037
|
-
init(this, options, instance$
|
|
3087
|
+
init(this, options, instance$7, create_fragment$7, safe_not_equal, {
|
|
3038
3088
|
step: 0
|
|
3039
3089
|
});
|
|
3040
3090
|
}
|
|
3041
3091
|
|
|
3042
3092
|
}
|
|
3043
|
-
/* src/js/components/shepherd-cancel-icon.svelte generated by Svelte v3.
|
|
3093
|
+
/* src/js/components/shepherd-cancel-icon.svelte generated by Svelte v3.37.0 */
|
|
3044
3094
|
|
|
3045
3095
|
|
|
3046
|
-
function create_fragment$
|
|
3096
|
+
function create_fragment$6(ctx) {
|
|
3047
3097
|
let button;
|
|
3048
3098
|
let span;
|
|
3049
3099
|
let button_aria_label_value;
|
|
@@ -3100,7 +3150,7 @@ function create_fragment$2(ctx) {
|
|
|
3100
3150
|
};
|
|
3101
3151
|
}
|
|
3102
3152
|
|
|
3103
|
-
function instance$
|
|
3153
|
+
function instance$6($$self, $$props, $$invalidate) {
|
|
3104
3154
|
let {
|
|
3105
3155
|
cancelIcon
|
|
3106
3156
|
} = $$props,
|
|
@@ -3127,17 +3177,17 @@ function instance$2($$self, $$props, $$invalidate) {
|
|
|
3127
3177
|
class Shepherd_cancel_icon extends SvelteComponent {
|
|
3128
3178
|
constructor(options) {
|
|
3129
3179
|
super();
|
|
3130
|
-
init(this, options, instance$
|
|
3180
|
+
init(this, options, instance$6, create_fragment$6, safe_not_equal, {
|
|
3131
3181
|
cancelIcon: 0,
|
|
3132
3182
|
step: 2
|
|
3133
3183
|
});
|
|
3134
3184
|
}
|
|
3135
3185
|
|
|
3136
3186
|
}
|
|
3137
|
-
/* src/js/components/shepherd-title.svelte generated by Svelte v3.
|
|
3187
|
+
/* src/js/components/shepherd-title.svelte generated by Svelte v3.37.0 */
|
|
3138
3188
|
|
|
3139
3189
|
|
|
3140
|
-
function create_fragment$
|
|
3190
|
+
function create_fragment$5(ctx) {
|
|
3141
3191
|
let h3;
|
|
3142
3192
|
return {
|
|
3143
3193
|
c() {
|
|
@@ -3178,7 +3228,7 @@ function create_fragment$3(ctx) {
|
|
|
3178
3228
|
};
|
|
3179
3229
|
}
|
|
3180
3230
|
|
|
3181
|
-
function instance$
|
|
3231
|
+
function instance$5($$self, $$props, $$invalidate) {
|
|
3182
3232
|
let {
|
|
3183
3233
|
labelId
|
|
3184
3234
|
} = $$props,
|
|
@@ -3215,7 +3265,7 @@ function instance$3($$self, $$props, $$invalidate) {
|
|
|
3215
3265
|
class Shepherd_title extends SvelteComponent {
|
|
3216
3266
|
constructor(options) {
|
|
3217
3267
|
super();
|
|
3218
|
-
init(this, options, instance$
|
|
3268
|
+
init(this, options, instance$5, create_fragment$5, safe_not_equal, {
|
|
3219
3269
|
labelId: 1,
|
|
3220
3270
|
element: 0,
|
|
3221
3271
|
title: 2
|
|
@@ -3223,10 +3273,10 @@ class Shepherd_title extends SvelteComponent {
|
|
|
3223
3273
|
}
|
|
3224
3274
|
|
|
3225
3275
|
}
|
|
3226
|
-
/* src/js/components/shepherd-header.svelte generated by Svelte v3.
|
|
3276
|
+
/* src/js/components/shepherd-header.svelte generated by Svelte v3.37.0 */
|
|
3227
3277
|
|
|
3228
3278
|
|
|
3229
|
-
function create_if_block_1(ctx) {
|
|
3279
|
+
function create_if_block_1$1(ctx) {
|
|
3230
3280
|
let shepherdtitle;
|
|
3231
3281
|
let current;
|
|
3232
3282
|
shepherdtitle = new Shepherd_title({
|
|
@@ -3283,7 +3333,7 @@ function create_if_block_1(ctx) {
|
|
|
3283
3333
|
} // (39:4) {#if cancelIcon && cancelIcon.enabled}
|
|
3284
3334
|
|
|
3285
3335
|
|
|
3286
|
-
function create_if_block$
|
|
3336
|
+
function create_if_block$2(ctx) {
|
|
3287
3337
|
let shepherdcancelicon;
|
|
3288
3338
|
let current;
|
|
3289
3339
|
shepherdcancelicon = new Shepherd_cancel_icon({
|
|
@@ -3345,12 +3395,12 @@ function create_fragment$4(ctx) {
|
|
|
3345
3395
|
let current;
|
|
3346
3396
|
let if_block0 =
|
|
3347
3397
|
/*title*/
|
|
3348
|
-
ctx[2] && create_if_block_1(ctx);
|
|
3398
|
+
ctx[2] && create_if_block_1$1(ctx);
|
|
3349
3399
|
let if_block1 =
|
|
3350
3400
|
/*cancelIcon*/
|
|
3351
3401
|
ctx[3] &&
|
|
3352
3402
|
/*cancelIcon*/
|
|
3353
|
-
ctx[3].enabled && create_if_block$
|
|
3403
|
+
ctx[3].enabled && create_if_block$2(ctx);
|
|
3354
3404
|
return {
|
|
3355
3405
|
c() {
|
|
3356
3406
|
header = element("header");
|
|
@@ -3381,7 +3431,7 @@ function create_fragment$4(ctx) {
|
|
|
3381
3431
|
transition_in(if_block0, 1);
|
|
3382
3432
|
}
|
|
3383
3433
|
} else {
|
|
3384
|
-
if_block0 = create_if_block_1(ctx);
|
|
3434
|
+
if_block0 = create_if_block_1$1(ctx);
|
|
3385
3435
|
if_block0.c();
|
|
3386
3436
|
transition_in(if_block0, 1);
|
|
3387
3437
|
if_block0.m(header, t);
|
|
@@ -3408,7 +3458,7 @@ function create_fragment$4(ctx) {
|
|
|
3408
3458
|
transition_in(if_block1, 1);
|
|
3409
3459
|
}
|
|
3410
3460
|
} else {
|
|
3411
|
-
if_block1 = create_if_block$
|
|
3461
|
+
if_block1 = create_if_block$2(ctx);
|
|
3412
3462
|
if_block1.c();
|
|
3413
3463
|
transition_in(if_block1, 1);
|
|
3414
3464
|
if_block1.m(header, null);
|
|
@@ -3482,10 +3532,10 @@ class Shepherd_header extends SvelteComponent {
|
|
|
3482
3532
|
}
|
|
3483
3533
|
|
|
3484
3534
|
}
|
|
3485
|
-
/* src/js/components/shepherd-text.svelte generated by Svelte v3.
|
|
3535
|
+
/* src/js/components/shepherd-text.svelte generated by Svelte v3.37.0 */
|
|
3486
3536
|
|
|
3487
3537
|
|
|
3488
|
-
function create_fragment$
|
|
3538
|
+
function create_fragment$3(ctx) {
|
|
3489
3539
|
let div;
|
|
3490
3540
|
return {
|
|
3491
3541
|
c() {
|
|
@@ -3526,7 +3576,7 @@ function create_fragment$5(ctx) {
|
|
|
3526
3576
|
};
|
|
3527
3577
|
}
|
|
3528
3578
|
|
|
3529
|
-
function instance$
|
|
3579
|
+
function instance$3($$self, $$props, $$invalidate) {
|
|
3530
3580
|
let {
|
|
3531
3581
|
descriptionId
|
|
3532
3582
|
} = $$props,
|
|
@@ -3545,7 +3595,7 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
3545
3595
|
text = text.call(step);
|
|
3546
3596
|
}
|
|
3547
3597
|
|
|
3548
|
-
if (isHTMLElement(text)) {
|
|
3598
|
+
if (isHTMLElement$1(text)) {
|
|
3549
3599
|
element.appendChild(text);
|
|
3550
3600
|
} else {
|
|
3551
3601
|
$$invalidate(0, element.innerHTML = text, element);
|
|
@@ -3571,7 +3621,7 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
3571
3621
|
class Shepherd_text extends SvelteComponent {
|
|
3572
3622
|
constructor(options) {
|
|
3573
3623
|
super();
|
|
3574
|
-
init(this, options, instance$
|
|
3624
|
+
init(this, options, instance$3, create_fragment$3, safe_not_equal, {
|
|
3575
3625
|
descriptionId: 1,
|
|
3576
3626
|
element: 0,
|
|
3577
3627
|
step: 2
|
|
@@ -3579,7 +3629,7 @@ class Shepherd_text extends SvelteComponent {
|
|
|
3579
3629
|
}
|
|
3580
3630
|
|
|
3581
3631
|
}
|
|
3582
|
-
/* src/js/components/shepherd-content.svelte generated by Svelte v3.
|
|
3632
|
+
/* src/js/components/shepherd-content.svelte generated by Svelte v3.37.0 */
|
|
3583
3633
|
|
|
3584
3634
|
|
|
3585
3635
|
function create_if_block_2(ctx) {
|
|
@@ -3639,7 +3689,7 @@ function create_if_block_2(ctx) {
|
|
|
3639
3689
|
} // (28:2) {#if !isUndefined(step.options.text)}
|
|
3640
3690
|
|
|
3641
3691
|
|
|
3642
|
-
function create_if_block_1
|
|
3692
|
+
function create_if_block_1(ctx) {
|
|
3643
3693
|
let shepherdtext;
|
|
3644
3694
|
let current;
|
|
3645
3695
|
shepherdtext = new Shepherd_text({
|
|
@@ -3696,7 +3746,7 @@ function create_if_block_1$1(ctx) {
|
|
|
3696
3746
|
} // (35:2) {#if Array.isArray(step.options.buttons) && step.options.buttons.length}
|
|
3697
3747
|
|
|
3698
3748
|
|
|
3699
|
-
function create_if_block$
|
|
3749
|
+
function create_if_block$1(ctx) {
|
|
3700
3750
|
let shepherdfooter;
|
|
3701
3751
|
let current;
|
|
3702
3752
|
shepherdfooter = new Shepherd_footer({
|
|
@@ -3744,7 +3794,7 @@ function create_if_block$2(ctx) {
|
|
|
3744
3794
|
};
|
|
3745
3795
|
}
|
|
3746
3796
|
|
|
3747
|
-
function create_fragment$
|
|
3797
|
+
function create_fragment$2(ctx) {
|
|
3748
3798
|
let div;
|
|
3749
3799
|
let show_if_2 = !isUndefined(
|
|
3750
3800
|
/*step*/
|
|
@@ -3765,8 +3815,8 @@ function create_fragment$6(ctx) {
|
|
|
3765
3815
|
ctx[2].options.buttons.length;
|
|
3766
3816
|
let current;
|
|
3767
3817
|
let if_block0 = show_if_2 && create_if_block_2(ctx);
|
|
3768
|
-
let if_block1 = show_if_1 && create_if_block_1
|
|
3769
|
-
let if_block2 = show_if && create_if_block$
|
|
3818
|
+
let if_block1 = show_if_1 && create_if_block_1(ctx);
|
|
3819
|
+
let if_block2 = show_if && create_if_block$1(ctx);
|
|
3770
3820
|
return {
|
|
3771
3821
|
c() {
|
|
3772
3822
|
div = element("div");
|
|
@@ -3838,7 +3888,7 @@ function create_fragment$6(ctx) {
|
|
|
3838
3888
|
transition_in(if_block1, 1);
|
|
3839
3889
|
}
|
|
3840
3890
|
} else {
|
|
3841
|
-
if_block1 = create_if_block_1
|
|
3891
|
+
if_block1 = create_if_block_1(ctx);
|
|
3842
3892
|
if_block1.c();
|
|
3843
3893
|
transition_in(if_block1, 1);
|
|
3844
3894
|
if_block1.m(div, t1);
|
|
@@ -3869,7 +3919,7 @@ function create_fragment$6(ctx) {
|
|
|
3869
3919
|
transition_in(if_block2, 1);
|
|
3870
3920
|
}
|
|
3871
3921
|
} else {
|
|
3872
|
-
if_block2 = create_if_block$
|
|
3922
|
+
if_block2 = create_if_block$1(ctx);
|
|
3873
3923
|
if_block2.c();
|
|
3874
3924
|
transition_in(if_block2, 1);
|
|
3875
3925
|
if_block2.m(div, null);
|
|
@@ -3908,7 +3958,7 @@ function create_fragment$6(ctx) {
|
|
|
3908
3958
|
};
|
|
3909
3959
|
}
|
|
3910
3960
|
|
|
3911
|
-
function instance$
|
|
3961
|
+
function instance$2($$self, $$props, $$invalidate) {
|
|
3912
3962
|
let {
|
|
3913
3963
|
descriptionId
|
|
3914
3964
|
} = $$props,
|
|
@@ -3931,7 +3981,7 @@ function instance$6($$self, $$props, $$invalidate) {
|
|
|
3931
3981
|
class Shepherd_content extends SvelteComponent {
|
|
3932
3982
|
constructor(options) {
|
|
3933
3983
|
super();
|
|
3934
|
-
init(this, options, instance$
|
|
3984
|
+
init(this, options, instance$2, create_fragment$2, safe_not_equal, {
|
|
3935
3985
|
descriptionId: 0,
|
|
3936
3986
|
labelId: 1,
|
|
3937
3987
|
step: 2
|
|
@@ -3939,10 +3989,10 @@ class Shepherd_content extends SvelteComponent {
|
|
|
3939
3989
|
}
|
|
3940
3990
|
|
|
3941
3991
|
}
|
|
3942
|
-
/* src/js/components/shepherd-element.svelte generated by Svelte v3.
|
|
3992
|
+
/* src/js/components/shepherd-element.svelte generated by Svelte v3.37.0 */
|
|
3943
3993
|
|
|
3944
3994
|
|
|
3945
|
-
function create_if_block
|
|
3995
|
+
function create_if_block(ctx) {
|
|
3946
3996
|
let div;
|
|
3947
3997
|
return {
|
|
3948
3998
|
c() {
|
|
@@ -3962,7 +4012,7 @@ function create_if_block$3(ctx) {
|
|
|
3962
4012
|
};
|
|
3963
4013
|
}
|
|
3964
4014
|
|
|
3965
|
-
function create_fragment$
|
|
4015
|
+
function create_fragment$1(ctx) {
|
|
3966
4016
|
let div;
|
|
3967
4017
|
let t;
|
|
3968
4018
|
let shepherdcontent;
|
|
@@ -3979,7 +4029,7 @@ function create_fragment$7(ctx) {
|
|
|
3979
4029
|
/*step*/
|
|
3980
4030
|
ctx[4].options.attachTo.element &&
|
|
3981
4031
|
/*step*/
|
|
3982
|
-
ctx[4].options.attachTo.on && create_if_block
|
|
4032
|
+
ctx[4].options.attachTo.on && create_if_block();
|
|
3983
4033
|
shepherdcontent = new Shepherd_content({
|
|
3984
4034
|
props: {
|
|
3985
4035
|
descriptionId:
|
|
@@ -4063,7 +4113,7 @@ function create_fragment$7(ctx) {
|
|
|
4063
4113
|
/*step*/
|
|
4064
4114
|
ctx[4].options.attachTo.on) {
|
|
4065
4115
|
if (if_block) ;else {
|
|
4066
|
-
if_block = create_if_block
|
|
4116
|
+
if_block = create_if_block();
|
|
4067
4117
|
if_block.c();
|
|
4068
4118
|
if_block.m(div, t);
|
|
4069
4119
|
}
|
|
@@ -4157,7 +4207,7 @@ function getClassesArray(classes) {
|
|
|
4157
4207
|
return classes.split(" ").filter(className => !!className.length);
|
|
4158
4208
|
}
|
|
4159
4209
|
|
|
4160
|
-
function instance$
|
|
4210
|
+
function instance$1($$self, $$props, $$invalidate) {
|
|
4161
4211
|
let {
|
|
4162
4212
|
classPrefix
|
|
4163
4213
|
} = $$props,
|
|
@@ -4324,7 +4374,7 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
|
4324
4374
|
class Shepherd_element extends SvelteComponent {
|
|
4325
4375
|
constructor(options) {
|
|
4326
4376
|
super();
|
|
4327
|
-
init(this, options, instance$
|
|
4377
|
+
init(this, options, instance$1, create_fragment$1, safe_not_equal, {
|
|
4328
4378
|
classPrefix: 11,
|
|
4329
4379
|
element: 0,
|
|
4330
4380
|
descriptionId: 2,
|
|
@@ -4691,7 +4741,7 @@ var smoothscroll = createCommonjsModule(function (module, exports) {
|
|
|
4691
4741
|
}
|
|
4692
4742
|
})();
|
|
4693
4743
|
});
|
|
4694
|
-
|
|
4744
|
+
smoothscroll.polyfill;
|
|
4695
4745
|
smoothscroll.polyfill();
|
|
4696
4746
|
/**
|
|
4697
4747
|
* A class representing steps to be added to a tour.
|
|
@@ -4829,7 +4879,7 @@ class Step extends Evented {
|
|
|
4829
4879
|
this.tooltip = null;
|
|
4830
4880
|
}
|
|
4831
4881
|
|
|
4832
|
-
if (isHTMLElement(this.el) && this.el.parentNode) {
|
|
4882
|
+
if (isHTMLElement$1(this.el) && this.el.parentNode) {
|
|
4833
4883
|
this.el.parentNode.removeChild(this.el);
|
|
4834
4884
|
this.el = null;
|
|
4835
4885
|
}
|
|
@@ -4974,7 +5024,7 @@ class Step extends Evented {
|
|
|
4974
5024
|
|
|
4975
5025
|
if (isFunction(this.options.scrollToHandler)) {
|
|
4976
5026
|
this.options.scrollToHandler(element);
|
|
4977
|
-
} else if (isElement(element) && typeof element.scrollIntoView === 'function') {
|
|
5027
|
+
} else if (isElement$1(element) && typeof element.scrollIntoView === 'function') {
|
|
4978
5028
|
element.scrollIntoView(scrollToOptions);
|
|
4979
5029
|
}
|
|
4980
5030
|
}
|
|
@@ -5113,7 +5163,7 @@ class Step extends Evented {
|
|
|
5113
5163
|
target.classList.remove(this.options.highlightClass);
|
|
5114
5164
|
}
|
|
5115
5165
|
|
|
5116
|
-
target.classList.remove(`${this.classPrefix}shepherd-enabled`, `${this.classPrefix}shepherd-target`);
|
|
5166
|
+
target.classList.remove('shepherd-target-click-disabled', `${this.classPrefix}shepherd-enabled`, `${this.classPrefix}shepherd-target`);
|
|
5117
5167
|
}
|
|
5118
5168
|
|
|
5119
5169
|
}
|
|
@@ -5176,10 +5226,10 @@ V${y + r}\
|
|
|
5176
5226
|
a${r},${r},0,0,0-${r}-${r}\
|
|
5177
5227
|
Z`;
|
|
5178
5228
|
}
|
|
5179
|
-
/* src/js/components/shepherd-modal.svelte generated by Svelte v3.
|
|
5229
|
+
/* src/js/components/shepherd-modal.svelte generated by Svelte v3.37.0 */
|
|
5180
5230
|
|
|
5181
5231
|
|
|
5182
|
-
function create_fragment
|
|
5232
|
+
function create_fragment(ctx) {
|
|
5183
5233
|
let svg;
|
|
5184
5234
|
let path;
|
|
5185
5235
|
let svg_class_value;
|
|
@@ -5261,14 +5311,14 @@ function _getScrollParent(element) {
|
|
|
5261
5311
|
return _getScrollParent(element.parentElement);
|
|
5262
5312
|
}
|
|
5263
5313
|
/**
|
|
5264
|
-
* Get the visible height of the target element relative to its scrollParent.
|
|
5265
|
-
* If there is no scroll parent, the height of the element is returned.
|
|
5266
|
-
*
|
|
5267
|
-
* @param {HTMLElement} element The target element
|
|
5268
|
-
* @param {HTMLElement} [scrollParent] The scrollable parent element
|
|
5269
|
-
* @returns {{y: number, height: number}}
|
|
5270
|
-
* @private
|
|
5271
|
-
*/
|
|
5314
|
+
* Get the visible height of the target element relative to its scrollParent.
|
|
5315
|
+
* If there is no scroll parent, the height of the element is returned.
|
|
5316
|
+
*
|
|
5317
|
+
* @param {HTMLElement} element The target element
|
|
5318
|
+
* @param {HTMLElement} [scrollParent] The scrollable parent element
|
|
5319
|
+
* @returns {{y: number, height: number}}
|
|
5320
|
+
* @private
|
|
5321
|
+
*/
|
|
5272
5322
|
|
|
5273
5323
|
|
|
5274
5324
|
function _getVisibleHeight(element, scrollParent) {
|
|
@@ -5292,14 +5342,14 @@ function _getVisibleHeight(element, scrollParent) {
|
|
|
5292
5342
|
};
|
|
5293
5343
|
}
|
|
5294
5344
|
|
|
5295
|
-
function instance
|
|
5345
|
+
function instance($$self, $$props, $$invalidate) {
|
|
5296
5346
|
let {
|
|
5297
5347
|
element
|
|
5298
5348
|
} = $$props,
|
|
5299
5349
|
{
|
|
5300
5350
|
openingProperties
|
|
5301
5351
|
} = $$props;
|
|
5302
|
-
|
|
5352
|
+
uuid();
|
|
5303
5353
|
let modalIsVisible = false;
|
|
5304
5354
|
let rafId = undefined;
|
|
5305
5355
|
let pathDefinition;
|
|
@@ -5323,8 +5373,8 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5323
5373
|
_cleanupStepEventListeners();
|
|
5324
5374
|
}
|
|
5325
5375
|
|
|
5326
|
-
function
|
|
5327
|
-
if (targetElement
|
|
5376
|
+
function positionModal(modalOverlayOpeningPadding = 0, modalOverlayOpeningRadius = 0, scrollParent, targetElement) {
|
|
5377
|
+
if (targetElement) {
|
|
5328
5378
|
const {
|
|
5329
5379
|
y,
|
|
5330
5380
|
height
|
|
@@ -5343,6 +5393,8 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5343
5393
|
y: y - modalOverlayOpeningPadding,
|
|
5344
5394
|
r: modalOverlayOpeningRadius
|
|
5345
5395
|
});
|
|
5396
|
+
} else {
|
|
5397
|
+
closeModalOpening();
|
|
5346
5398
|
}
|
|
5347
5399
|
}
|
|
5348
5400
|
|
|
@@ -5411,22 +5463,18 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5411
5463
|
modalOverlayOpeningRadius
|
|
5412
5464
|
} = step.options;
|
|
5413
5465
|
|
|
5414
|
-
|
|
5415
|
-
const scrollParent = _getScrollParent(step.target); // Setup recursive function to call requestAnimationFrame to update the modal opening position
|
|
5466
|
+
const scrollParent = _getScrollParent(step.target); // Setup recursive function to call requestAnimationFrame to update the modal opening position
|
|
5416
5467
|
|
|
5417
5468
|
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5469
|
+
const rafLoop = () => {
|
|
5470
|
+
rafId = undefined;
|
|
5471
|
+
positionModal(modalOverlayOpeningPadding, modalOverlayOpeningRadius, scrollParent, step.target);
|
|
5472
|
+
rafId = requestAnimationFrame(rafLoop);
|
|
5473
|
+
};
|
|
5423
5474
|
|
|
5424
|
-
|
|
5475
|
+
rafLoop();
|
|
5425
5476
|
|
|
5426
|
-
|
|
5427
|
-
} else {
|
|
5428
|
-
closeModalOpening();
|
|
5429
|
-
}
|
|
5477
|
+
_addStepEventListeners();
|
|
5430
5478
|
}
|
|
5431
5479
|
|
|
5432
5480
|
function svg_binding($$value) {
|
|
@@ -5449,19 +5497,19 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
5449
5497
|
}
|
|
5450
5498
|
};
|
|
5451
5499
|
|
|
5452
|
-
return [element, modalIsVisible, pathDefinition, _preventModalOverlayTouch, openingProperties, getElement, closeModalOpening, hide,
|
|
5500
|
+
return [element, modalIsVisible, pathDefinition, _preventModalOverlayTouch, openingProperties, getElement, closeModalOpening, hide, positionModal, setupForStep, show, svg_binding];
|
|
5453
5501
|
}
|
|
5454
5502
|
|
|
5455
5503
|
class Shepherd_modal extends SvelteComponent {
|
|
5456
5504
|
constructor(options) {
|
|
5457
5505
|
super();
|
|
5458
|
-
init(this, options, instance
|
|
5506
|
+
init(this, options, instance, create_fragment, safe_not_equal, {
|
|
5459
5507
|
element: 0,
|
|
5460
5508
|
openingProperties: 4,
|
|
5461
5509
|
getElement: 5,
|
|
5462
5510
|
closeModalOpening: 6,
|
|
5463
5511
|
hide: 7,
|
|
5464
|
-
|
|
5512
|
+
positionModal: 8,
|
|
5465
5513
|
setupForStep: 9,
|
|
5466
5514
|
show: 10
|
|
5467
5515
|
});
|
|
@@ -5479,7 +5527,7 @@ class Shepherd_modal extends SvelteComponent {
|
|
|
5479
5527
|
return this.$$.ctx[7];
|
|
5480
5528
|
}
|
|
5481
5529
|
|
|
5482
|
-
get
|
|
5530
|
+
get positionModal() {
|
|
5483
5531
|
return this.$$.ctx[8];
|
|
5484
5532
|
}
|
|
5485
5533
|
|
|
@@ -5792,7 +5840,7 @@ class Tour extends Evented {
|
|
|
5792
5840
|
} // Focus the element that was focused before the tour started
|
|
5793
5841
|
|
|
5794
5842
|
|
|
5795
|
-
if (isHTMLElement(this.focusedElBeforeOpen)) {
|
|
5843
|
+
if (isHTMLElement$1(this.focusedElBeforeOpen)) {
|
|
5796
5844
|
this.focusedElBeforeOpen.focus();
|
|
5797
5845
|
}
|
|
5798
5846
|
}
|
|
@@ -5870,7 +5918,7 @@ Object.assign(Shepherd, {
|
|
|
5870
5918
|
Step
|
|
5871
5919
|
});
|
|
5872
5920
|
|
|
5873
|
-
var ShepherdTourContext = React__default[
|
|
5921
|
+
var ShepherdTourContext = React__default["default"].createContext(null);
|
|
5874
5922
|
var ShepherdTourContextConsumer = ShepherdTourContext.Consumer;
|
|
5875
5923
|
/**
|
|
5876
5924
|
* Take a set of steps and formats to use actions on the buttons in the current context
|
|
@@ -5912,7 +5960,7 @@ var ShepherdTour = function (props) {
|
|
|
5912
5960
|
addSteps(steps, tourObject);
|
|
5913
5961
|
return tourObject;
|
|
5914
5962
|
}, [tourOptions, steps]);
|
|
5915
|
-
return (React__default[
|
|
5963
|
+
return (React__default["default"].createElement(ShepherdTourContext.Provider, { value: tourObject }, props.children));
|
|
5916
5964
|
};
|
|
5917
5965
|
|
|
5918
5966
|
exports.ShepherdTour = ShepherdTour;
|