* Triggers `before-show`, generates the tooltip DOM content, * sets up a FloatingUI instance for the tooltip, then triggers `show`. * @private
()
| 720 | * @private |
| 721 | */ |
| 722 | _show() { |
| 723 | this.trigger('before-show'); |
| 724 | |
| 725 | // Force resolve to make sure the options are updated on subsequent shows. |
| 726 | this._resolveAttachToOptions(); |
| 727 | this._resolveExtraHiglightElements(); |
| 728 | this._setupElements(); |
| 729 | |
| 730 | if (!this.tour.modal) { |
| 731 | this.tour.setupModal(); |
| 732 | } |
| 733 | |
| 734 | this.tour.modal?.setupForStep(this); |
| 735 | this._styleTargetElementForStep(this); |
| 736 | |
| 737 | if (this.el) { |
| 738 | this.el.hidden = false; |
| 739 | } |
| 740 | |
| 741 | // start scrolling to target before showing the step |
| 742 | if (this.options.scrollTo) { |
| 743 | setTimeout(() => { |
| 744 | this._scrollTo( |
| 745 | this.options.scrollTo as boolean | ScrollIntoViewOptions |
| 746 | ); |
| 747 | }); |
| 748 | } |
| 749 | |
| 750 | if (this.el) { |
| 751 | this.el.hidden = false; |
| 752 | } |
| 753 | |
| 754 | const content = this.shepherdElementComponent!.element; |
| 755 | const target = this.target || document.body; |
| 756 | const extraHighlightElements = this._resolvedExtraHighlightElements; |
| 757 | |
| 758 | target.classList.add(`${this.classPrefix}shepherd-enabled`); |
| 759 | target.classList.add(`${this.classPrefix}shepherd-target`); |
| 760 | content.classList.add('shepherd-enabled'); |
| 761 | |
| 762 | extraHighlightElements?.forEach((el) => { |
| 763 | el.classList.add(`${this.classPrefix}shepherd-enabled`); |
| 764 | el.classList.add(`${this.classPrefix}shepherd-target`); |
| 765 | }); |
| 766 | |
| 767 | this.trigger('show'); |
| 768 | } |
| 769 | |
| 770 | /** |
| 771 | * Modulates the styles of the passed step's target element, based on the step's options and |
no test coverage detected