()
| 136 | } |
| 137 | |
| 138 | private open(): void { |
| 139 | if (!this.popover.parentElement) { |
| 140 | document.body.appendChild(this.popover); |
| 141 | } |
| 142 | if (!this.popper) { |
| 143 | this.popper = createPopper(this.trigger, this.popover, { |
| 144 | placement: 'bottom-end', |
| 145 | modifiers: [{ name: 'offset', options: { offset: [0, 6] } }] |
| 146 | }); |
| 147 | } else { |
| 148 | this.popper.update(); |
| 149 | } |
| 150 | this.isOpen = true; |
| 151 | this.popover.classList.add('open'); |
| 152 | this.trigger.setAttribute('aria-expanded', 'true'); |
| 153 | document.addEventListener('mousedown', this.outsideClick, true); |
| 154 | document.addEventListener('keydown', this.onKey, true); |
| 155 | } |
| 156 | |
| 157 | private close(): void { |
| 158 | this.isOpen = false; |
no test coverage detected