ngx-bootstrap
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -51,3 +51,3 @@ import { Component, HostBinding, Inject, Input } from '@angular/core'; | ||
selector: 'accordion-group, accordion-panel', | ||
template: "\n<div class=\"panel card\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading card-header\" role=\"tab\" (click)=\"toggleOpen($event)\">\n <div class=\"panel-title card-title\">\n <div role=\"button\" class=\"accordion-toggle\" [attr.aria-expanded]=\"isOpen\">\n <div *ngIf=\"heading\"[ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</div>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </div>\n </div>\n </div>\n <div class=\"panel-collapse collapse\" role=\"tabpanel\" [collapse]=\"!isOpen\">\n <div class=\"panel-body card-block\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n " | ||
template: "\n<div class=\"panel card\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading card-header\" role=\"tab\" (click)=\"toggleOpen($event)\">\n <div class=\"panel-title\">\n <div role=\"button\" class=\"accordion-toggle\" [attr.aria-expanded]=\"isOpen\">\n <div *ngIf=\"heading\"[ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</div>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </div>\n </div>\n </div>\n <div class=\"panel-collapse collapse\" role=\"tabpanel\" [collapse]=\"!isOpen\">\n <div class=\"panel-body card-block\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n " | ||
},] }, | ||
@@ -54,0 +54,0 @@ ]; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"AccordionPanelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"accordion-group, accordion-panel","template":"\n<div class=\"panel card\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading card-header\" role=\"tab\" (click)=\"toggleOpen($event)\">\n <div class=\"panel-title card-title\">\n <div role=\"button\" class=\"accordion-toggle\" [attr.aria-expanded]=\"isOpen\">\n <div *ngIf=\"heading\"[ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</div>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </div>\n </div>\n </div>\n <div class=\"panel-collapse collapse\" role=\"tabpanel\" [collapse]=\"!isOpen\">\n <div class=\"panel-body card-block\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n "}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"panelClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.panel-open"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}]],"parameters":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"toggleOpen":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"AccordionPanelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"accordion-group, accordion-panel","template":"\n<div class=\"panel card\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading card-header\" role=\"tab\" (click)=\"toggleOpen($event)\">\n <div class=\"panel-title card-title\">\n <div role=\"button\" class=\"accordion-toggle\" [attr.aria-expanded]=\"isOpen\">\n <div *ngIf=\"heading\"[ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</div>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </div>\n </div>\n </div>\n <div class=\"panel-collapse collapse\" role=\"tabpanel\" [collapse]=\"!isOpen\">\n <div class=\"panel-body card-block\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n "}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"panelClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.panel-open"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}]],"parameters":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"toggleOpen":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"AccordionPanelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"accordion-group, accordion-panel","template":"\n<div class=\"panel card\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading card-header\" role=\"tab\" (click)=\"toggleOpen($event)\">\n <div class=\"panel-title\">\n <div role=\"button\" class=\"accordion-toggle\" [attr.aria-expanded]=\"isOpen\">\n <div *ngIf=\"heading\"[ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</div>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </div>\n </div>\n </div>\n <div class=\"panel-collapse collapse\" role=\"tabpanel\" [collapse]=\"!isOpen\">\n <div class=\"panel-body card-block\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n "}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"panelClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.panel-open"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}]],"parameters":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"toggleOpen":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"AccordionPanelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"accordion-group, accordion-panel","template":"\n<div class=\"panel card\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading card-header\" role=\"tab\" (click)=\"toggleOpen($event)\">\n <div class=\"panel-title\">\n <div role=\"button\" class=\"accordion-toggle\" [attr.aria-expanded]=\"isOpen\">\n <div *ngIf=\"heading\"[ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</div>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </div>\n </div>\n </div>\n <div class=\"panel-collapse collapse\" role=\"tabpanel\" [collapse]=\"!isOpen\">\n <div class=\"panel-body card-block\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n "}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"panelClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.panel-open"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}]],"parameters":[{"__symbolic":"reference","module":"./accordion.component","name":"AccordionComponent"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"toggleOpen":[{"__symbolic":"method"}]}}}}] |
{ | ||
"main": "bundles/ngx-bootstrap.umd.js", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Native Angular Bootstrap Components", | ||
@@ -5,0 +5,0 @@ "module": "index.js", |
@@ -43,2 +43,3 @@ import { EventEmitter, OnInit, OnDestroy, Renderer, ElementRef, TemplateRef, ViewContainerRef } from '@angular/core'; | ||
private _popover; | ||
private _isInited; | ||
constructor(_elementRef: ElementRef, _renderer: Renderer, _viewContainerRef: ViewContainerRef, _config: PopoverConfig, cis: ComponentLoaderFactory); | ||
@@ -45,0 +46,0 @@ /** |
@@ -10,2 +10,3 @@ import { Directive, Input, Output, Renderer, ElementRef, ViewContainerRef } from '@angular/core'; | ||
function PopoverDirective(_elementRef, _renderer, _viewContainerRef, _config, cis) { | ||
this._isInited = false; | ||
this._popover = cis | ||
@@ -75,2 +76,9 @@ .createLoader(_elementRef, _viewContainerRef, _renderer) | ||
var _this = this; | ||
// fix: seems there are an issue with `routerLinkActive` | ||
// which result in duplicated call ngOnInit without call to ngOnDestroy | ||
// read more: https://github.com/valor-software/ngx-bootstrap/issues/1885 | ||
if (this._isInited) { | ||
return; | ||
} | ||
this._isInited = true; | ||
this._popover.listen({ | ||
@@ -77,0 +85,0 @@ triggers: this.triggers, |
@@ -1,6 +0,9 @@ | ||
import { EventEmitter, TemplateRef, OnInit } from '@angular/core'; | ||
import { EventEmitter, TemplateRef, OnInit, OnDestroy, ElementRef } from '@angular/core'; | ||
import { TabsetComponent } from './tabset.component'; | ||
export declare class TabDirective implements OnInit { | ||
export declare class TabDirective implements OnInit, OnDestroy { | ||
elementRef: ElementRef; | ||
/** tab header text */ | ||
heading: string; | ||
/** tab id */ | ||
id: string; | ||
/** if true tab can not be activated */ | ||
@@ -18,3 +21,3 @@ disabled: boolean; | ||
deselect: EventEmitter<TabDirective>; | ||
/** fired before tab will be removed */ | ||
/** fired before tab will be removed, $event:Tab equals to instance of removed tab */ | ||
removed: EventEmitter<TabDirective>; | ||
@@ -25,4 +28,5 @@ addClass: boolean; | ||
protected _active: boolean; | ||
constructor(tabset: TabsetComponent); | ||
constructor(tabset: TabsetComponent, elementRef: ElementRef); | ||
ngOnInit(): void; | ||
ngOnDestroy(): void; | ||
} |
@@ -1,5 +0,6 @@ | ||
import { Directive, EventEmitter, HostBinding, Input, Output } from '@angular/core'; | ||
import { Directive, EventEmitter, HostBinding, Input, Output, ElementRef } from '@angular/core'; | ||
import { TabsetComponent } from './tabset.component'; | ||
export var TabDirective = (function () { | ||
function TabDirective(tabset) { | ||
function TabDirective(tabset, elementRef) { | ||
this.elementRef = elementRef; | ||
/** fired when tab became active, $event:Tab equals to selected instance of Tab component */ | ||
@@ -9,3 +10,3 @@ this.select = new EventEmitter(); | ||
this.deselect = new EventEmitter(); | ||
/** fired before tab will be removed */ | ||
/** fired before tab will be removed, $event:Tab equals to instance of removed tab */ | ||
this.removed = new EventEmitter(); | ||
@@ -44,2 +45,5 @@ this.addClass = true; | ||
}; | ||
TabDirective.prototype.ngOnDestroy = function () { | ||
this.tabset.removeTab(this, { reselect: false, emit: false }); | ||
}; | ||
TabDirective.decorators = [ | ||
@@ -51,5 +55,7 @@ { type: Directive, args: [{ selector: 'tab, [tab]' },] }, | ||
{ type: TabsetComponent, }, | ||
{ type: ElementRef, }, | ||
]; }; | ||
TabDirective.propDecorators = { | ||
'heading': [{ type: Input },], | ||
'id': [{ type: Input },], | ||
'disabled': [{ type: Input },], | ||
@@ -56,0 +62,0 @@ 'removable': [{ type: Input },], |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"TabDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"tab, [tab]"}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"customClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"active":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"select":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"deselect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"addClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.tab-pane"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./tabset.component","name":"TabsetComponent"}]}],"ngOnInit":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"TabDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"tab, [tab]"}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"customClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"active":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"select":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"deselect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"addClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.tab-pane"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./tabset.component","name":"TabsetComponent"}]}],"ngOnInit":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"TabDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"tab, [tab]"}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"customClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"active":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"select":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"deselect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"addClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.tab-pane"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./tabset.component","name":"TabsetComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"TabDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"tab, [tab]"}]}],"members":{"heading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"customClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"active":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"select":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"deselect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"addClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class.tab-pane"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./tabset.component","name":"TabsetComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] |
@@ -21,3 +21,6 @@ import { OnDestroy } from '@angular/core'; | ||
addTab(tab: TabDirective): void; | ||
removeTab(tab: TabDirective): void; | ||
removeTab(tab: TabDirective, options?: { | ||
reselect: boolean; | ||
emit: boolean; | ||
}): void; | ||
protected getClosestTabIndex(index: number): number; | ||
@@ -24,0 +27,0 @@ protected hasAvailableTabs(index: number): boolean; |
@@ -55,3 +55,4 @@ import { Component, HostBinding, Input } from '@angular/core'; | ||
}; | ||
TabsetComponent.prototype.removeTab = function (tab) { | ||
TabsetComponent.prototype.removeTab = function (tab, options) { | ||
if (options === void 0) { options = { reselect: true, emit: true }; } | ||
var index = this.tabs.indexOf(tab); | ||
@@ -62,8 +63,13 @@ if (index === -1 || this.isDestroyed) { | ||
// Select a new tab if the tab to be removed is selected and not destroyed | ||
if (tab.active && this.hasAvailableTabs(index)) { | ||
if (options.reselect && tab.active && this.hasAvailableTabs(index)) { | ||
var newActiveIndex = this.getClosestTabIndex(index); | ||
this.tabs[newActiveIndex].active = true; | ||
} | ||
tab.removed.emit(tab); | ||
if (options.emit) { | ||
tab.removed.emit(tab); | ||
} | ||
this.tabs.splice(index, 1); | ||
if (tab.elementRef.nativeElement && tab.elementRef.nativeElement.remove) { | ||
tab.elementRef.nativeElement.remove(); | ||
} | ||
}; | ||
@@ -70,0 +76,0 @@ TabsetComponent.prototype.getClosestTabIndex = function (index) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3665365
32291