* Sets the options for the step, maps `when` to events, sets up buttons * @param options - The options for the step
(options: StepOptions = {})
| 665 | * @param options - The options for the step |
| 666 | */ |
| 667 | _setOptions(options: StepOptions = {}) { |
| 668 | let tourOptions = |
| 669 | this.tour && this.tour.options && this.tour.options.defaultStepOptions; |
| 670 | |
| 671 | tourOptions = deepmerge({}, tourOptions || {}); |
| 672 | |
| 673 | this.options = Object.assign( |
| 674 | { |
| 675 | arrow: true |
| 676 | }, |
| 677 | tourOptions, |
| 678 | options, |
| 679 | mergeTooltipConfig(tourOptions, options) |
| 680 | ); |
| 681 | |
| 682 | const { when } = this.options; |
| 683 | |
| 684 | this.options.classes = this._getClassOptions(options); |
| 685 | |
| 686 | this.destroy(); |
| 687 | this.id = this.options.id || `step-${uuid()}`; |
| 688 | |
| 689 | if (when) { |
| 690 | Object.keys(when).forEach((event) => { |
| 691 | // @ts-expect-error TODO: fix this type error |
| 692 | this.on(event, when[event], this); |
| 693 | }); |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | /** |
| 698 | * Create the element and set up the FloatingUI instance |
no test coverage detected