UNPKG

@ebay/ebayui-core

Version:

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

22 lines (21 loc) 550 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class Accordion { onInput(input) { this.state = { index: -1, }; } handleToggle(index, event) { const { autoCollapse } = this.input; if (autoCollapse && event.open) { this.state.index = index; } this.emit("toggle", { originalEvent: event.originalEvent, open: event.originalEvent.target.open, index: index, }); } } module.exports = Accordion;