UNPKG

@nova-ui/bits

Version:

SolarWinds Nova Framework

29 lines 929 B
import { Atom } from "../../atom"; export class MenuPopupAtom extends Atom { constructor() { super(...arguments); this.itemByIndex = (idx) => this.items.nth(idx); } static { this.CSS_CLASS = "nui-menu-popup"; } get items() { return super.getLocator().locator(".nui-menu-item"); } get selectedItems() { return super.getLocator().locator(".nui-menu-item--selected"); } get selectedItem() { return super.getLocator().locator(".nui-menu-item--selected").first(); } async clickItemByText(title, exact = true) { const items = this.items; if ((await items.count()) === 0) { return; } await items.getByText(title, { exact }).first().click(); } itemByText(title) { const items = this.items; return items.getByText(title, { exact: true }); } } //# sourceMappingURL=menu-popup.atom.js.map