UNPKG

@ebay/ebayui-core

Version:

Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.

40 lines (39 loc) 903 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class Infotip { onInput(input) { this.state = { open: input.open || false, }; } setOpen(isOpen) { if (this.input.variant === "modal") { this.state.open = isOpen; } } handleOpenModal() { this.setOpen(true); } handleExpand() { this.setOpen(true); this.emit("expand"); } handleOverlayClose() { this.getComponent("base").collapse(); } isExpanded() { return this.getComponent("base").isExpanded(); } expand() { this.getComponent("base").expand(); } collapse() { this.getComponent("base").collapse(); } handleCollapse() { this.setOpen(false); this.getEl("host").focus(); this.emit("collapse"); } } module.exports = Infotip;