@ebay/ebayui-core
Version:
Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.
16 lines (15 loc) • 401 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class ToggleButton {
onInput(input) {
this.state = { pressed: !!input.pressed };
}
handleClick(ev) {
this.state.pressed = !this.state.pressed;
this.emit("toggle", {
originalEvent: ev,
pressed: this.state.pressed,
});
}
}
module.exports = ToggleButton;