ngx-bootstrap
Version:
Native Angular Bootstrap Components
49 lines • 1.74 kB
JavaScript
import { Component, Input } from '@angular/core';
import { AccordionConfig } from './accordion.config';
/** Displays collapsible content panels for presenting information in a limited amount of space. */
export var AccordionComponent = (function () {
function AccordionComponent(config) {
this.groups = [];
Object.assign(this, config);
}
AccordionComponent.prototype.closeOtherPanels = function (openGroup) {
if (!this.closeOthers) {
return;
}
this.groups.forEach(function (group) {
if (group !== openGroup) {
group.isOpen = false;
}
});
};
AccordionComponent.prototype.addGroup = function (group) {
this.groups.push(group);
};
AccordionComponent.prototype.removeGroup = function (group) {
var index = this.groups.indexOf(group);
if (index !== -1) {
this.groups.splice(index, 1);
}
};
AccordionComponent.decorators = [
{ type: Component, args: [{
selector: 'accordion',
template: "<ng-content></ng-content>",
// tslint:disable-next-line
host: {
'[class.panel-group]': 'true',
'[attr.aria-multiselectable]': 'closeOthers',
role: 'tablist'
}
},] },
];
/** @nocollapse */
AccordionComponent.ctorParameters = function () { return [
{ type: AccordionConfig, },
]; };
AccordionComponent.propDecorators = {
'closeOthers': [{ type: Input },],
};
return AccordionComponent;
}());
//# sourceMappingURL=accordion.component.js.map