import {ComponentInitParams, Container, TooltipData, UiElement} from '../../controls.js'; export class AmeRevPostboxSection extends Container { public readonly isOpen: KnockoutObservable; constructor(params: ComponentInitParams, $element: JQuery) { super(params, $element); this.elementClasses.push('ws-ame-postbox', 'ame-postbox-section'); //Optionally, remember the open/closed state of the section. if (this.id && this.registry && this.registry.has('collapsibleStateStore')) { const collapsibleStateStore: AmeCollapsibleStateStore = this.registry.get('collapsibleStateStore'); this.isOpen = collapsibleStateStore.getOrCreateObservable(this.id, true); } else { this.isOpen = ko.observable(true); } if (this.id) { this.elementId = this.id; } if (this.description() && !this.tooltip) { this.tooltip = new TooltipData(this.description(), 'info'); } if (typeof params.registerSelf === 'function') { params.registerSelf(this); } } public toggle(): void { this.isOpen(!this.isOpen()); } static componentName = 'ame-rev-postbox-section'; static template = `

${UiElement.tooltipTriggerTemplate}

`; }