@ebay/ebayui-core
Version:
Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.
35 lines (34 loc) • 945 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Tourtip {
handleCollapse({ originalEvent }) {
if (this.state.expanded) {
this.state.expanded = false;
this.emit("collapse", { originalEvent });
}
}
handleExpand({ originalEvent }) {
if (!this.state.expanded) {
this.state.expanded = true;
this.emit("expand", { originalEvent });
}
}
onInput(input) {
if (input.open === false || input.open === true) {
this.state.expanded = input.open;
}
}
onCreate() {
this.state = {
expanded: false,
};
}
handleLoaded() {
// This is only done to prevent a blink when loading floating ui library
if (this.input.open !== false) {
this.state.expanded = true;
}
this.emit("loaded");
}
}
module.exports = Tourtip;