@ng-bootstrap/ng-bootstrap
Advanced tools
Comparing version 1.0.0-alpha.5 to 1.0.0-alpha.6
@@ -81,3 +81,3 @@ import { QueryList, TemplateRef, EventEmitter, AfterContentChecked } from '@angular/core'; | ||
*/ | ||
change: EventEmitter<NgbPanelChangeEvent>; | ||
panelChange: EventEmitter<NgbPanelChangeEvent>; | ||
/** | ||
@@ -84,0 +84,0 @@ * A map that stores each panel state |
@@ -82,3 +82,3 @@ import { Component, Input, ContentChildren, Directive, TemplateRef, ContentChild, Output, EventEmitter } from '@angular/core'; | ||
*/ | ||
this.change = new EventEmitter(); | ||
this.panelChange = new EventEmitter(); | ||
/** | ||
@@ -103,3 +103,3 @@ * A map that stores each panel state | ||
var defaultPrevented_1 = false; | ||
this.change.emit({ panelId: panelId, nextState: nextState, preventDefault: function () { defaultPrevented_1 = true; } }); | ||
this.panelChange.emit({ panelId: panelId, nextState: nextState, preventDefault: function () { defaultPrevented_1 = true; } }); | ||
if (!defaultPrevented_1) { | ||
@@ -168,3 +168,3 @@ this._states.set(panelId, nextState); | ||
'type': [{ type: Input },], | ||
'change': [{ type: Output },], | ||
'panelChange': [{ type: Output },], | ||
}; | ||
@@ -171,0 +171,0 @@ return NgbAccordion; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbPanelTitle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbPanelTitle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbPanelContent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbPanelContent]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbPanel":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"ngb-panel"}]}],"members":{"disabled":[{"__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"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"contentTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbPanelContent"}]}]}],"titleTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbPanelTitle"}]}]}]}},"NgbAccordion":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-accordion","exportAs":"ngbAccordion","template":"\n <div class=\"card\">\n <template ngFor let-panel [ngForOf]=\"panels\">\n <div [class]=\"'card-header ' + (panel.type ? 'card-'+panel.type: type ? 'card-'+type : '')\" [class.active]=\"isOpen(panel.id)\">\n <a tabindex=\"0\" href (click)=\"!!toggle(panel.id)\" [class.text-muted]=\"panel.disabled\">\n {{panel.title}}<template [ngTemplateOutlet]=\"panel.titleTpl?.templateRef\"></template> \n </a>\n </div>\n <div class=\"card-block\" *ngIf=\"isOpen(panel.id)\">\n <template [ngTemplateOutlet]=\"panel.contentTpl.templateRef\"></template>\n </div>\n </template>\n </div>\n"}]}],"members":{"panels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","name":"NgbPanel"}]}]}],"activeIds":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"closeOtherPanels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["closeOthers"]}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./accordion-config","name":"NgbAccordionConfig"}]}],"toggle":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"isOpen":[{"__symbolic":"method"}],"_closeOthers":[{"__symbolic":"method"}],"_updateActiveIds":[{"__symbolic":"method"}],"_updateStates":[{"__symbolic":"method"}]}},"NGB_ACCORDION_DIRECTIVES":[{"__symbolic":"reference","name":"NgbAccordion"},{"__symbolic":"reference","name":"NgbPanel"},{"__symbolic":"reference","name":"NgbPanelTitle"},{"__symbolic":"reference","name":"NgbPanelContent"}]}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbPanelTitle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbPanelTitle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbPanelContent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbPanelContent]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbPanel":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"ngb-panel"}]}],"members":{"disabled":[{"__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"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"contentTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbPanelContent"}]}]}],"titleTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbPanelTitle"}]}]}]}},"NgbAccordion":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-accordion","exportAs":"ngbAccordion","template":"\n <div class=\"card\">\n <template ngFor let-panel [ngForOf]=\"panels\">\n <div [class]=\"'card-header ' + (panel.type ? 'card-'+panel.type: type ? 'card-'+type : '')\" [class.active]=\"isOpen(panel.id)\">\n <a tabindex=\"0\" href (click)=\"!!toggle(panel.id)\" [class.text-muted]=\"panel.disabled\">\n {{panel.title}}<template [ngTemplateOutlet]=\"panel.titleTpl?.templateRef\"></template> \n </a>\n </div>\n <div class=\"card-block\" *ngIf=\"isOpen(panel.id)\">\n <template [ngTemplateOutlet]=\"panel.contentTpl.templateRef\"></template>\n </div>\n </template>\n </div>\n"}]}],"members":{"panels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","name":"NgbPanel"}]}]}],"activeIds":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"closeOtherPanels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["closeOthers"]}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"panelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./accordion-config","name":"NgbAccordionConfig"}]}],"toggle":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"isOpen":[{"__symbolic":"method"}],"_closeOthers":[{"__symbolic":"method"}],"_updateActiveIds":[{"__symbolic":"method"}],"_updateStates":[{"__symbolic":"method"}]}},"NGB_ACCORDION_DIRECTIVES":[{"__symbolic":"reference","name":"NgbAccordion"},{"__symbolic":"reference","name":"NgbPanel"},{"__symbolic":"reference","name":"NgbPanelTitle"},{"__symbolic":"reference","name":"NgbPanelContent"}]}} |
@@ -10,11 +10,1 @@ /** | ||
} | ||
/** | ||
* Configuration service for the NgbSelfClosingAlert component. | ||
* You can inject this service, typically in your root component, and customize the values of its properties in | ||
* order to provide default values for all the self-closing alerts used in the application. | ||
*/ | ||
export declare class NgbSelfClosingAlertConfig { | ||
dismissible: boolean; | ||
type: string; | ||
dismissOnTimeout: number; | ||
} |
@@ -19,19 +19,2 @@ import { Injectable } from '@angular/core'; | ||
}()); | ||
/** | ||
* Configuration service for the NgbSelfClosingAlert component. | ||
* You can inject this service, typically in your root component, and customize the values of its properties in | ||
* order to provide default values for all the self-closing alerts used in the application. | ||
*/ | ||
export var NgbSelfClosingAlertConfig = (function () { | ||
function NgbSelfClosingAlertConfig() { | ||
this.dismissible = false; | ||
this.type = 'warning'; | ||
} | ||
NgbSelfClosingAlertConfig.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** @nocollapse */ | ||
NgbSelfClosingAlertConfig.ctorParameters = []; | ||
return NgbSelfClosingAlertConfig; | ||
}()); | ||
//# sourceMappingURL=alert-config.js.map |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbAlertConfig":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}]},"NgbSelfClosingAlertConfig":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}]}}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbAlertConfig":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}]}}} |
@@ -1,3 +0,3 @@ | ||
import { EventEmitter, OnInit, ViewContainerRef, Injector, OnDestroy, ComponentFactoryResolver, Renderer, TemplateRef } from '@angular/core'; | ||
import { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert-config'; | ||
import { EventEmitter } from '@angular/core'; | ||
import { NgbAlertConfig } from './alert-config'; | ||
/** | ||
@@ -23,31 +23,2 @@ * Alerts can be used to provide feedback messages. | ||
} | ||
/** | ||
* Alerts that can be dismissed without any additional code. | ||
*/ | ||
export declare class NgbSelfClosingAlert implements OnInit, OnDestroy { | ||
private _templateRef; | ||
private _popupService; | ||
private _timeout; | ||
/** | ||
* A flag indicating if the alert can be dismissed (closed) by a user. If this flag is set, a close button (in a | ||
* form of an ×) will be displayed. | ||
*/ | ||
dismissible: boolean; | ||
/** | ||
* Alert type (CSS class). Bootstrap 4 recognizes the following types: "success", "info", "warning" and "danger". | ||
*/ | ||
type: string; | ||
/** | ||
* An event emitted when the close button is clicked. | ||
*/ | ||
closeEvent: EventEmitter<{}>; | ||
/** | ||
* Time, in milliseconds, before the alert auto closes. | ||
*/ | ||
dismissOnTimeout: number; | ||
constructor(_templateRef: TemplateRef<Object>, viewContainerRef: ViewContainerRef, injector: Injector, componentFactoryResolver: ComponentFactoryResolver, renderer: Renderer, config: NgbSelfClosingAlertConfig); | ||
close(): void; | ||
ngOnInit(): void; | ||
ngOnDestroy(): void; | ||
} | ||
export declare const NGB_ALERT_DIRECTIVES: (typeof NgbAlert | typeof NgbSelfClosingAlert)[]; | ||
export declare const NGB_ALERT_DIRECTIVES: typeof NgbAlert[]; |
@@ -1,4 +0,3 @@ | ||
import { Component, Directive, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewContainerRef, Injector, ComponentFactoryResolver, Renderer, TemplateRef } from '@angular/core'; | ||
import { PopupService } from '../util/popup'; | ||
import { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert-config'; | ||
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; | ||
import { NgbAlertConfig } from './alert-config'; | ||
/** | ||
@@ -35,54 +34,3 @@ * Alerts can be used to provide feedback messages. | ||
}()); | ||
/** | ||
* Alerts that can be dismissed without any additional code. | ||
*/ | ||
export var NgbSelfClosingAlert = (function () { | ||
function NgbSelfClosingAlert(_templateRef, viewContainerRef, injector, componentFactoryResolver, renderer, config) { | ||
this._templateRef = _templateRef; | ||
/** | ||
* An event emitted when the close button is clicked. | ||
*/ | ||
this.closeEvent = new EventEmitter(); | ||
this._popupService = | ||
new PopupService(NgbAlert, injector, viewContainerRef, renderer, componentFactoryResolver); | ||
this.dismissible = config.dismissible; | ||
this.type = config.type; | ||
this.dismissOnTimeout = config.dismissOnTimeout; | ||
} | ||
NgbSelfClosingAlert.prototype.close = function () { this._popupService.close(); }; | ||
NgbSelfClosingAlert.prototype.ngOnInit = function () { | ||
var _this = this; | ||
var windowRef = this._popupService.open(this._templateRef); | ||
windowRef.instance.type = this.type; | ||
windowRef.instance.dismissible = this.dismissible; | ||
windowRef.instance.close.subscribe(function ($event) { | ||
_this.closeEvent.emit($event); | ||
_this.close(); | ||
}); | ||
if (this.dismissOnTimeout) { | ||
this._timeout = setTimeout(function () { _this.close(); }, this.dismissOnTimeout); | ||
} | ||
}; | ||
NgbSelfClosingAlert.prototype.ngOnDestroy = function () { clearTimeout(this._timeout); }; | ||
NgbSelfClosingAlert.decorators = [ | ||
{ type: Directive, args: [{ selector: 'template[ngbAlert]' },] }, | ||
]; | ||
/** @nocollapse */ | ||
NgbSelfClosingAlert.ctorParameters = [ | ||
{ type: TemplateRef, }, | ||
{ type: ViewContainerRef, }, | ||
{ type: Injector, }, | ||
{ type: ComponentFactoryResolver, }, | ||
{ type: Renderer, }, | ||
{ type: NgbSelfClosingAlertConfig, }, | ||
]; | ||
NgbSelfClosingAlert.propDecorators = { | ||
'dismissible': [{ type: Input },], | ||
'type': [{ type: Input },], | ||
'closeEvent': [{ type: Output, args: ['close',] },], | ||
'dismissOnTimeout': [{ type: Input },], | ||
}; | ||
return NgbSelfClosingAlert; | ||
}()); | ||
export var NGB_ALERT_DIRECTIVES = [NgbAlert, NgbSelfClosingAlert]; | ||
export var NGB_ALERT_DIRECTIVES = [NgbAlert]; | ||
//# sourceMappingURL=alert.js.map |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbAlert":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-alert","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"},"template":"\n <div [class]=\"'alert alert-' + type\" role=\"alert\">\n <button *ngIf=\"dismissible\" type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"closeHandler()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <ng-content></ng-content>\n </div>\n "}]}],"members":{"dismissible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"close":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./alert-config","name":"NgbAlertConfig"}]}],"closeHandler":[{"__symbolic":"method"}]}},"NgbSelfClosingAlert":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbAlert]"}]}],"members":{"dismissible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"closeEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["close"]}]}],"dismissOnTimeout":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"Object"}]},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./alert-config","name":"NgbSelfClosingAlertConfig"}]}],"close":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"NGB_ALERT_DIRECTIVES":[{"__symbolic":"reference","name":"NgbAlert"},{"__symbolic":"reference","name":"NgbSelfClosingAlert"}]}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbAlert":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-alert","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"},"template":"\n <div [class]=\"'alert alert-' + type\" role=\"alert\">\n <button *ngIf=\"dismissible\" type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"closeHandler()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <ng-content></ng-content>\n </div>\n "}]}],"members":{"dismissible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"close":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./alert-config","name":"NgbAlertConfig"}]}],"closeHandler":[{"__symbolic":"method"}]}},"NGB_ALERT_DIRECTIVES":[{"__symbolic":"reference","name":"NgbAlert"}]}} |
@@ -1,3 +0,3 @@ | ||
export { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert-config'; | ||
export { NgbAlertConfig } from './alert-config'; | ||
export declare class NgbAlertModule { | ||
} |
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { NGB_ALERT_DIRECTIVES, NgbAlert } from './alert'; | ||
import { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert-config'; | ||
export { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert-config'; | ||
import { NgbAlertConfig } from './alert-config'; | ||
export { NgbAlertConfig } from './alert-config'; | ||
export var NgbAlertModule = (function () { | ||
@@ -15,3 +15,3 @@ function NgbAlertModule() { | ||
entryComponents: [NgbAlert], | ||
providers: [NgbAlertConfig, NgbSelfClosingAlertConfig] | ||
providers: [NgbAlertConfig] | ||
},] }, | ||
@@ -18,0 +18,0 @@ ]; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbAlertModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":{"__symbolic":"reference","module":"./alert","name":"NGB_ALERT_DIRECTIVES"},"exports":{"__symbolic":"reference","module":"./alert","name":"NGB_ALERT_DIRECTIVES"},"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"entryComponents":[{"__symbolic":"reference","module":"./alert","name":"NgbAlert"}],"providers":[{"__symbolic":"reference","module":"./alert-config","name":"NgbAlertConfig"},{"__symbolic":"reference","module":"./alert-config","name":"NgbSelfClosingAlertConfig"}]}]}]}},"exports":[{"from":"./alert-config","export":["NgbAlertConfig","NgbSelfClosingAlertConfig"]}]} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbAlertModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":{"__symbolic":"reference","module":"./alert","name":"NGB_ALERT_DIRECTIVES"},"exports":{"__symbolic":"reference","module":"./alert","name":"NGB_ALERT_DIRECTIVES"},"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"entryComponents":[{"__symbolic":"reference","module":"./alert","name":"NgbAlert"}],"providers":[{"__symbolic":"reference","module":"./alert-config","name":"NgbAlertConfig"}]}]}]}},"exports":[{"from":"./alert-config","export":["NgbAlertConfig"]}]} |
import { TemplateRef } from '@angular/core'; | ||
import { DayTemplateContext } from './datepicker-day-template-context'; | ||
import { NgbDateStruct } from './ngb-date-struct'; | ||
/** | ||
@@ -11,17 +12,5 @@ * Configuration service for the NgbDatepicker component. | ||
firstDayOfWeek: number; | ||
markDisabled: (date: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}) => boolean; | ||
minDate: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
maxDate: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
markDisabled: (date: NgbDateStruct) => boolean; | ||
minDate: NgbDateStruct; | ||
maxDate: NgbDateStruct; | ||
showNavigation: boolean; | ||
@@ -28,0 +17,0 @@ showWeekdays: boolean; |
@@ -0,1 +1,2 @@ | ||
import { NgbDateStruct } from './ngb-date-struct'; | ||
/** | ||
@@ -12,7 +13,3 @@ * Context for the datepicker 'day' template in case you want to override the default one | ||
*/ | ||
date: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
date: NgbDateStruct; | ||
/** | ||
@@ -19,0 +16,0 @@ * True if current date is disabled |
@@ -0,8 +1,5 @@ | ||
import { NgbDateStruct } from './ngb-date-struct'; | ||
export declare class NgbDatepickerDayView { | ||
currentMonth: number; | ||
date: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
date: NgbDateStruct; | ||
disabled: boolean; | ||
@@ -9,0 +6,0 @@ selected: boolean; |
@@ -5,2 +5,3 @@ import { ElementRef, ViewContainerRef, Renderer, ComponentFactoryResolver, NgZone, TemplateRef } from '@angular/core'; | ||
import { NgbDateParserFormatter } from './ngb-date-parser-formatter'; | ||
import { NgbDateStruct } from './ngb-date-struct'; | ||
/** | ||
@@ -30,23 +31,11 @@ * A directive that makes it possible to have datepickers on input fields. | ||
*/ | ||
markDisabled: (date: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}) => boolean; | ||
markDisabled: (date: NgbDateStruct) => boolean; | ||
/** | ||
* Min date for the navigation. If not provided will be 10 years before today or `startDate` | ||
*/ | ||
minDate: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
minDate: NgbDateStruct; | ||
/** | ||
* Max date for the navigation. If not provided will be 10 years from today or `startDate` | ||
*/ | ||
maxDate: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
maxDate: NgbDateStruct; | ||
/** | ||
@@ -75,2 +64,6 @@ * Whether to display navigation or not | ||
constructor(_parserFormatter: NgbDateParserFormatter, _elRef: ElementRef, _vcRef: ViewContainerRef, _renderer: Renderer, _cfr: ComponentFactoryResolver, ngZone: NgZone); | ||
registerOnChange(fn: (value: any) => any): void; | ||
registerOnTouched(fn: () => any): void; | ||
writeValue(value: any): void; | ||
setDisabledState(isDisabled: boolean): void; | ||
isOpen(): boolean; | ||
@@ -77,0 +70,0 @@ /** |
@@ -33,13 +33,4 @@ import { Directive, Input, ElementRef, ViewContainerRef, Renderer, ComponentFactoryResolver, NgZone, forwardRef } from '@angular/core'; | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
NgbInputDatepicker.prototype.registerOnChange = function (fn) { this._onChange = fn; }; | ||
/** | ||
* @internal | ||
*/ | ||
NgbInputDatepicker.prototype.registerOnTouched = function (fn) { this._onTouched = fn; }; | ||
/** | ||
* @internal | ||
*/ | ||
NgbInputDatepicker.prototype.writeValue = function (value) { | ||
@@ -49,5 +40,2 @@ this._model = value ? new NgbDate(value.year, value.month, value.day) : null; | ||
}; | ||
/** | ||
* @internal | ||
*/ | ||
NgbInputDatepicker.prototype.setDisabledState = function (isDisabled) { | ||
@@ -63,3 +51,3 @@ this._renderer.setElementProperty(this._elRef.nativeElement, 'disabled', isDisabled); | ||
NgbInputDatepicker.prototype.manualDateChange = function (value) { | ||
this._model = this._parserFormatter.parse(value); | ||
this._model = NgbDate.from(this._parserFormatter.parse(value)); | ||
this._onChange(this._model ? { year: this._model.year, month: this._model.month, day: this._model.day } : null); | ||
@@ -66,0 +54,0 @@ this._writeModelValue(this._model); |
@@ -9,2 +9,3 @@ import { OnChanges, SimpleChanges, TemplateRef, OnInit } from '@angular/core'; | ||
import { NgbDatepickerConfig } from './datepicker-config'; | ||
import { NgbDateStruct } from './ngb-date-struct'; | ||
/** | ||
@@ -32,23 +33,11 @@ * A lightweight and highly configurable datepicker directive | ||
*/ | ||
markDisabled: (date: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}) => boolean; | ||
markDisabled: (date: NgbDateStruct) => boolean; | ||
/** | ||
* Min date for the navigation. If not provided will be 10 years before today or `startDate` | ||
*/ | ||
minDate: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
minDate: NgbDateStruct; | ||
/** | ||
* Max date for the navigation. If not provided will be 10 years from today or `startDate` | ||
*/ | ||
maxDate: { | ||
year: number; | ||
month: number; | ||
day: number; | ||
}; | ||
maxDate: NgbDateStruct; | ||
/** | ||
@@ -88,2 +77,6 @@ * Whether to display navigation or not | ||
ngOnChanges(changes: SimpleChanges): void; | ||
registerOnChange(fn: (value: any) => any): void; | ||
registerOnTouched(fn: () => any): void; | ||
writeValue(value: any): void; | ||
setDisabledState(isDisabled: boolean): void; | ||
private _setDates(); | ||
@@ -90,0 +83,0 @@ private _setViewWithinLimits(date); |
@@ -84,17 +84,5 @@ import { Component, Input, forwardRef } from '@angular/core'; | ||
}; | ||
/** | ||
* @internal | ||
*/ | ||
NgbDatepicker.prototype.registerOnChange = function (fn) { this.onChange = fn; }; | ||
/** | ||
* @internal | ||
*/ | ||
NgbDatepicker.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; | ||
/** | ||
* @internal | ||
*/ | ||
NgbDatepicker.prototype.writeValue = function (value) { this.model = value ? new NgbDate(value.year, value.month, value.day) : null; }; | ||
/** | ||
* @internal | ||
*/ | ||
NgbDatepicker.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; }; | ||
@@ -101,0 +89,0 @@ NgbDatepicker.prototype._setDates = function () { |
export { NgbDatepickerConfig } from './datepicker-config'; | ||
export { NgbDatepickerI18n } from './datepicker-i18n'; | ||
export { NgbDateStruct } from './ngb-date-struct'; | ||
export { NgbDateParserFormatter } from './ngb-date-parser-formatter'; | ||
export declare class NgbDatepickerModule { | ||
} |
@@ -17,2 +17,3 @@ import { NgModule } from '@angular/core'; | ||
export { NgbDatepickerI18n } from './datepicker-i18n'; | ||
export { NgbDateParserFormatter } from './ngb-date-parser-formatter'; | ||
export var NgbDatepickerModule = (function () { | ||
@@ -19,0 +20,0 @@ function NgbDatepickerModule() { |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbDatepickerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./datepicker","name":"NgbDatepicker"},{"__symbolic":"reference","module":"./datepicker-month-view","name":"NgbDatepickerMonthView"},{"__symbolic":"reference","module":"./datepicker-navigation","name":"NgbDatepickerNavigation"},{"__symbolic":"reference","module":"./datepicker-navigation-select","name":"NgbDatepickerNavigationSelect"},{"__symbolic":"reference","module":"./datepicker-day-view","name":"NgbDatepickerDayView"},{"__symbolic":"reference","module":"./datepicker-input","name":"NgbInputDatepicker"}],"exports":[{"__symbolic":"reference","module":"./datepicker","name":"NgbDatepicker"},{"__symbolic":"reference","module":"./datepicker-input","name":"NgbInputDatepicker"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule"}],"entryComponents":[{"__symbolic":"reference","module":"./datepicker","name":"NgbDatepicker"}],"providers":[{"provide":{"__symbolic":"reference","module":"./ngb-calendar","name":"NgbCalendar"},"useClass":{"__symbolic":"reference","module":"./ngb-calendar","name":"NgbCalendarGregorian"}},{"provide":{"__symbolic":"reference","module":"./datepicker-i18n","name":"NgbDatepickerI18n"},"useClass":{"__symbolic":"reference","module":"./datepicker-i18n","name":"NgbDatepickerI18nDefault"}},{"provide":{"__symbolic":"reference","module":"./ngb-date-parser-formatter","name":"NgbDateParserFormatter"},"useClass":{"__symbolic":"reference","module":"./ngb-date-parser-formatter","name":"NgbDateISOParserFormatter"}},{"__symbolic":"reference","module":"./datepicker-service","name":"NgbDatepickerService"},{"__symbolic":"reference","module":"./datepicker-config","name":"NgbDatepickerConfig"}]}]}]}},"exports":[{"from":"./datepicker-config","export":["NgbDatepickerConfig"]},{"from":"./datepicker-i18n","export":["NgbDatepickerI18n"]}]} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbDatepickerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./datepicker","name":"NgbDatepicker"},{"__symbolic":"reference","module":"./datepicker-month-view","name":"NgbDatepickerMonthView"},{"__symbolic":"reference","module":"./datepicker-navigation","name":"NgbDatepickerNavigation"},{"__symbolic":"reference","module":"./datepicker-navigation-select","name":"NgbDatepickerNavigationSelect"},{"__symbolic":"reference","module":"./datepicker-day-view","name":"NgbDatepickerDayView"},{"__symbolic":"reference","module":"./datepicker-input","name":"NgbInputDatepicker"}],"exports":[{"__symbolic":"reference","module":"./datepicker","name":"NgbDatepicker"},{"__symbolic":"reference","module":"./datepicker-input","name":"NgbInputDatepicker"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule"}],"entryComponents":[{"__symbolic":"reference","module":"./datepicker","name":"NgbDatepicker"}],"providers":[{"provide":{"__symbolic":"reference","module":"./ngb-calendar","name":"NgbCalendar"},"useClass":{"__symbolic":"reference","module":"./ngb-calendar","name":"NgbCalendarGregorian"}},{"provide":{"__symbolic":"reference","module":"./datepicker-i18n","name":"NgbDatepickerI18n"},"useClass":{"__symbolic":"reference","module":"./datepicker-i18n","name":"NgbDatepickerI18nDefault"}},{"provide":{"__symbolic":"reference","module":"./ngb-date-parser-formatter","name":"NgbDateParserFormatter"},"useClass":{"__symbolic":"reference","module":"./ngb-date-parser-formatter","name":"NgbDateISOParserFormatter"}},{"__symbolic":"reference","module":"./datepicker-service","name":"NgbDatepickerService"},{"__symbolic":"reference","module":"./datepicker-config","name":"NgbDatepickerConfig"}]}]}]}},"exports":[{"from":"./datepicker-config","export":["NgbDatepickerConfig"]},{"from":"./datepicker-i18n","export":["NgbDatepickerI18n"]},{"from":"./ngb-date-struct","export":["NgbDateStruct"]},{"from":"./ngb-date-parser-formatter","export":["NgbDateParserFormatter"]}]} |
@@ -1,9 +0,24 @@ | ||
import { NgbDate } from './ngb-date'; | ||
import { NgbDateStruct } from './ngb-date-struct'; | ||
/** | ||
* Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker | ||
* directive. A default implementation using the ISO format is provided, but you can provide another implementation | ||
* to use an alternative format. | ||
*/ | ||
export declare abstract class NgbDateParserFormatter { | ||
abstract parse(value: string): NgbDate; | ||
abstract format(date: NgbDate): string; | ||
/** | ||
* Parses the given value to an NgbDateStruct. Implementations should try their best to provide a result, even | ||
* partial. They must return null if the value can't be parsed. | ||
* @param value the value to parse | ||
*/ | ||
abstract parse(value: string): NgbDateStruct; | ||
/** | ||
* Formats the given date to a string. Implementations should return an empty string if the given date is null, | ||
* and try their best to provide a partial result if the given date is incomplete or invalid. | ||
* @param date the date to format as a string | ||
*/ | ||
abstract format(date: NgbDateStruct): string; | ||
} | ||
export declare class NgbDateISOParserFormatter extends NgbDateParserFormatter { | ||
parse(value: string): NgbDate; | ||
format(date: NgbDate): string; | ||
parse(value: string): NgbDateStruct; | ||
format(date: NgbDateStruct): string; | ||
} |
@@ -6,4 +6,8 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
}; | ||
import { NgbDate } from './ngb-date'; | ||
import { padNumber, toInteger, isNumber } from '../util/util'; | ||
/** | ||
* Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker | ||
* directive. A default implementation using the ISO format is provided, but you can provide another implementation | ||
* to use an alternative format. | ||
*/ | ||
export var NgbDateParserFormatter = (function () { | ||
@@ -23,9 +27,9 @@ function NgbDateParserFormatter() { | ||
if (dateParts.length === 1 && isNumber(dateParts[0])) { | ||
return new NgbDate(toInteger(dateParts[0]), null, null); | ||
return { year: toInteger(dateParts[0]), month: null, day: null }; | ||
} | ||
else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) { | ||
return new NgbDate(toInteger(dateParts[0]), toInteger(dateParts[1]) - 1, null); | ||
return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]) - 1, day: null }; | ||
} | ||
else if (dateParts.length === 3 && isNumber(dateParts[0]) && isNumber(dateParts[1]) && isNumber(dateParts[2])) { | ||
return new NgbDate(toInteger(dateParts[0]), toInteger(dateParts[1]) - 1, toInteger(dateParts[2])); | ||
return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]) - 1, day: toInteger(dateParts[2]) }; | ||
} | ||
@@ -32,0 +36,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from '@angular/core'; | ||
import { EventEmitter, ElementRef } from '@angular/core'; | ||
import { NgbDropdownConfig } from './dropdown-config'; | ||
@@ -7,2 +7,3 @@ /** | ||
export declare class NgbDropdown { | ||
private _toggleElement; | ||
/** | ||
@@ -42,2 +43,3 @@ * Indicates that the dropdown should open upwards | ||
toggle(): void; | ||
private _isEventFromToggle($event); | ||
} | ||
@@ -48,6 +50,6 @@ /** | ||
export declare class NgbDropdownToggle { | ||
private _dropdown; | ||
constructor(_dropdown: NgbDropdown); | ||
toggleOpen($event: any): void; | ||
dropdown: NgbDropdown; | ||
constructor(dropdown: NgbDropdown, elementRef: ElementRef); | ||
toggleOpen(): void; | ||
} | ||
export declare const NGB_DROPDOWN_DIRECTIVES: (typeof NgbDropdown | typeof NgbDropdownToggle)[]; |
@@ -1,2 +0,2 @@ | ||
import { Directive, Input, Output, HostListener, EventEmitter } from '@angular/core'; | ||
import { Directive, Input, Output, EventEmitter, ElementRef } from '@angular/core'; | ||
import { NgbDropdownConfig } from './dropdown-config'; | ||
@@ -56,3 +56,11 @@ /** | ||
*/ | ||
NgbDropdown.prototype.closeFromOutside = function () { | ||
NgbDropdown.prototype.closeFromOutsideClick = function ($event) { | ||
if (this.autoClose && !this._isEventFromToggle($event)) { | ||
this.close(); | ||
} | ||
}; | ||
/** | ||
* @internal | ||
*/ | ||
NgbDropdown.prototype.closeFromOutsideEsc = function () { | ||
if (this.autoClose) { | ||
@@ -62,2 +70,11 @@ this.close(); | ||
}; | ||
Object.defineProperty(NgbDropdown.prototype, "toggleElement", { | ||
/** | ||
* @internal | ||
*/ | ||
set: function (toggleElement) { this._toggleElement = toggleElement; }, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
NgbDropdown.prototype._isEventFromToggle = function ($event) { return $event.target === this._toggleElement; }; | ||
NgbDropdown.decorators = [ | ||
@@ -71,4 +88,4 @@ { type: Directive, args: [{ | ||
'[class.open]': 'isOpen()', | ||
'(keyup.esc)': 'closeFromOutside()', | ||
'(document:click)': 'closeFromOutside()' | ||
'(keyup.esc)': 'closeFromOutsideEsc()', | ||
'(document:click)': 'closeFromOutsideClick($event)' | ||
} | ||
@@ -93,13 +110,16 @@ },] }, | ||
export var NgbDropdownToggle = (function () { | ||
function NgbDropdownToggle(_dropdown) { | ||
this._dropdown = _dropdown; | ||
function NgbDropdownToggle(dropdown, elementRef) { | ||
this.dropdown = dropdown; | ||
dropdown.toggleElement = elementRef.nativeElement; | ||
} | ||
NgbDropdownToggle.prototype.toggleOpen = function ($event) { | ||
$event.stopPropagation(); | ||
this._dropdown.toggle(); | ||
}; | ||
NgbDropdownToggle.prototype.toggleOpen = function () { this.dropdown.toggle(); }; | ||
NgbDropdownToggle.decorators = [ | ||
{ type: Directive, args: [{ | ||
selector: '[ngbDropdownToggle]', | ||
host: { 'class': 'dropdown-toggle', 'aria-haspopup': 'true', '[attr.aria-expanded]': '_dropdown.isOpen()' } | ||
host: { | ||
'class': 'dropdown-toggle', | ||
'aria-haspopup': 'true', | ||
'[attr.aria-expanded]': 'dropdown.isOpen()', | ||
'(click)': 'toggleOpen()' | ||
} | ||
},] }, | ||
@@ -110,6 +130,4 @@ ]; | ||
{ type: NgbDropdown, }, | ||
{ type: ElementRef, }, | ||
]; | ||
NgbDropdownToggle.propDecorators = { | ||
'toggleOpen': [{ type: HostListener, args: ['click', ['$event'],] },], | ||
}; | ||
return NgbDropdownToggle; | ||
@@ -116,0 +134,0 @@ }()); |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbDropdown":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbDropdown]","exportAs":"ngbDropdown","host":{"[class.dropdown]":"!up","[class.dropup]":"up","[class.open]":"isOpen()","(keyup.esc)":"closeFromOutside()","(document:click)":"closeFromOutside()"}}]}],"members":{"up":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"autoClose":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"_open":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["open"]}]}],"openChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./dropdown-config","name":"NgbDropdownConfig"}]}],"isOpen":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"closeFromOutside":[{"__symbolic":"method"}]}},"NgbDropdownToggle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbDropdownToggle]","host":{"class":"dropdown-toggle","aria-haspopup":"true","[attr.aria-expanded]":"_dropdown.isOpen()"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgbDropdown"}]}],"toggleOpen":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",["$event"]]}]}]}},"NGB_DROPDOWN_DIRECTIVES":[{"__symbolic":"reference","name":"NgbDropdownToggle"},{"__symbolic":"reference","name":"NgbDropdown"}]}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbDropdown":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbDropdown]","exportAs":"ngbDropdown","host":{"[class.dropdown]":"!up","[class.dropup]":"up","[class.open]":"isOpen()","(keyup.esc)":"closeFromOutsideEsc()","(document:click)":"closeFromOutsideClick($event)"}}]}],"members":{"up":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"autoClose":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"_open":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["open"]}]}],"openChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./dropdown-config","name":"NgbDropdownConfig"}]}],"isOpen":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"closeFromOutsideClick":[{"__symbolic":"method"}],"closeFromOutsideEsc":[{"__symbolic":"method"}],"_isEventFromToggle":[{"__symbolic":"method"}]}},"NgbDropdownToggle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbDropdownToggle]","host":{"class":"dropdown-toggle","aria-haspopup":"true","[attr.aria-expanded]":"dropdown.isOpen()","(click)":"toggleOpen()"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgbDropdown"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"toggleOpen":[{"__symbolic":"method"}]}},"NGB_DROPDOWN_DIRECTIVES":[{"__symbolic":"reference","name":"NgbDropdownToggle"},{"__symbolic":"reference","name":"NgbDropdown"}]}} |
@@ -1,17 +0,18 @@ | ||
export { NgbPanelChangeEvent, NgbAccordionConfig } from './accordion/accordion.module'; | ||
export { NgbModal, NgbModalOptions, NgbModalRef, ModalDismissReasons } from './modal/modal.module'; | ||
export { NgbTabChangeEvent } from './tabset/tabset.module'; | ||
export { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert/alert.module'; | ||
export { NgbCarouselConfig } from './carousel/carousel.module'; | ||
export { NgbDatepickerI18n, NgbDatepickerConfig } from './datepicker/datepicker.module'; | ||
export { NgbDropdownConfig } from './dropdown/dropdown.module'; | ||
export { NgbPaginationConfig } from './pagination/pagination.module'; | ||
export { NgbPopoverConfig } from './popover/popover.module'; | ||
export { NgbProgressbarConfig } from './progressbar/progressbar.module'; | ||
export { NgbRatingConfig } from './rating/rating.module'; | ||
export { NgbTimepickerConfig } from './timepicker/timepicker.module'; | ||
export { NgbTabsetConfig } from './tabset/tabset.module'; | ||
export { NgbTooltipConfig } from './tooltip/tooltip.module'; | ||
export { NgbTypeaheadConfig, NgbTypeaheadSelectItemEvent } from './typeahead/typeahead.module'; | ||
export { NgbAccordionModule, NgbPanelChangeEvent, NgbAccordionConfig } from './accordion/accordion.module'; | ||
export { NgbAlertModule, NgbAlertConfig } from './alert/alert.module'; | ||
export { NgbButtonsModule } from './buttons/radio.module'; | ||
export { NgbCarouselModule, NgbCarouselConfig } from './carousel/carousel.module'; | ||
export { NgbCollapseModule } from './collapse/collapse.module'; | ||
export { NgbDatepickerModule, NgbDatepickerI18n, NgbDatepickerConfig, NgbDateStruct, NgbDateParserFormatter } from './datepicker/datepicker.module'; | ||
export { NgbDropdownModule, NgbDropdownConfig } from './dropdown/dropdown.module'; | ||
export { NgbModalModule, NgbModal, NgbModalOptions, NgbModalRef, ModalDismissReasons } from './modal/modal.module'; | ||
export { NgbPaginationModule, NgbPaginationConfig } from './pagination/pagination.module'; | ||
export { NgbPopoverModule, NgbPopoverConfig } from './popover/popover.module'; | ||
export { NgbProgressbarModule, NgbProgressbarConfig } from './progressbar/progressbar.module'; | ||
export { NgbRatingModule, NgbRatingConfig } from './rating/rating.module'; | ||
export { NgbTabsetModule, NgbTabChangeEvent, NgbTabsetConfig } from './tabset/tabset.module'; | ||
export { NgbTimepickerModule, NgbTimepickerConfig, NgbTimeStruct } from './timepicker/timepicker.module'; | ||
export { NgbTooltipModule, NgbTooltipConfig } from './tooltip/tooltip.module'; | ||
export { NgbTypeaheadModule, NgbTypeaheadConfig, NgbTypeaheadSelectItemEvent } from './typeahead/typeahead.module'; | ||
export declare class NgbModule { | ||
} |
30
index.js
@@ -18,16 +18,18 @@ import { NgModule } from '@angular/core'; | ||
import { NgbTypeaheadModule } from './typeahead/typeahead.module'; | ||
export { NgbAccordionConfig } from './accordion/accordion.module'; | ||
export { NgbModal, NgbModalRef, ModalDismissReasons } from './modal/modal.module'; | ||
export { NgbAlertConfig, NgbSelfClosingAlertConfig } from './alert/alert.module'; | ||
export { NgbCarouselConfig } from './carousel/carousel.module'; | ||
export { NgbDatepickerI18n, NgbDatepickerConfig } from './datepicker/datepicker.module'; | ||
export { NgbDropdownConfig } from './dropdown/dropdown.module'; | ||
export { NgbPaginationConfig } from './pagination/pagination.module'; | ||
export { NgbPopoverConfig } from './popover/popover.module'; | ||
export { NgbProgressbarConfig } from './progressbar/progressbar.module'; | ||
export { NgbRatingConfig } from './rating/rating.module'; | ||
export { NgbTimepickerConfig } from './timepicker/timepicker.module'; | ||
export { NgbTabsetConfig } from './tabset/tabset.module'; | ||
export { NgbTooltipConfig } from './tooltip/tooltip.module'; | ||
export { NgbTypeaheadConfig } from './typeahead/typeahead.module'; | ||
export { NgbAccordionModule, NgbAccordionConfig } from './accordion/accordion.module'; | ||
export { NgbAlertModule, NgbAlertConfig } from './alert/alert.module'; | ||
export { NgbButtonsModule } from './buttons/radio.module'; | ||
export { NgbCarouselModule, NgbCarouselConfig } from './carousel/carousel.module'; | ||
export { NgbCollapseModule } from './collapse/collapse.module'; | ||
export { NgbDatepickerModule, NgbDatepickerI18n, NgbDatepickerConfig, NgbDateParserFormatter } from './datepicker/datepicker.module'; | ||
export { NgbDropdownModule, NgbDropdownConfig } from './dropdown/dropdown.module'; | ||
export { NgbModalModule, NgbModal, NgbModalRef, ModalDismissReasons } from './modal/modal.module'; | ||
export { NgbPaginationModule, NgbPaginationConfig } from './pagination/pagination.module'; | ||
export { NgbPopoverModule, NgbPopoverConfig } from './popover/popover.module'; | ||
export { NgbProgressbarModule, NgbProgressbarConfig } from './progressbar/progressbar.module'; | ||
export { NgbRatingModule, NgbRatingConfig } from './rating/rating.module'; | ||
export { NgbTabsetModule, NgbTabsetConfig } from './tabset/tabset.module'; | ||
export { NgbTimepickerModule, NgbTimepickerConfig } from './timepicker/timepicker.module'; | ||
export { NgbTooltipModule, NgbTooltipConfig } from './tooltip/tooltip.module'; | ||
export { NgbTypeaheadModule, NgbTypeaheadConfig } from './typeahead/typeahead.module'; | ||
export var NgbModule = (function () { | ||
@@ -34,0 +36,0 @@ function NgbModule() { |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"exports":[{"__symbolic":"reference","module":"./accordion/accordion.module","name":"NgbAccordionModule"},{"__symbolic":"reference","module":"./alert/alert.module","name":"NgbAlertModule"},{"__symbolic":"reference","module":"./buttons/radio.module","name":"NgbButtonsModule"},{"__symbolic":"reference","module":"./carousel/carousel.module","name":"NgbCarouselModule"},{"__symbolic":"reference","module":"./collapse/collapse.module","name":"NgbCollapseModule"},{"__symbolic":"reference","module":"./datepicker/datepicker.module","name":"NgbDatepickerModule"},{"__symbolic":"reference","module":"./dropdown/dropdown.module","name":"NgbDropdownModule"},{"__symbolic":"reference","module":"./modal/modal.module","name":"NgbModalModule"},{"__symbolic":"reference","module":"./pagination/pagination.module","name":"NgbPaginationModule"},{"__symbolic":"reference","module":"./popover/popover.module","name":"NgbPopoverModule"},{"__symbolic":"reference","module":"./progressbar/progressbar.module","name":"NgbProgressbarModule"},{"__symbolic":"reference","module":"./rating/rating.module","name":"NgbRatingModule"},{"__symbolic":"reference","module":"./tabset/tabset.module","name":"NgbTabsetModule"},{"__symbolic":"reference","module":"./timepicker/timepicker.module","name":"NgbTimepickerModule"},{"__symbolic":"reference","module":"./tooltip/tooltip.module","name":"NgbTooltipModule"},{"__symbolic":"reference","module":"./typeahead/typeahead.module","name":"NgbTypeaheadModule"}]}]}]}},"exports":[{"from":"./accordion/accordion.module","export":["NgbPanelChangeEvent","NgbAccordionConfig"]},{"from":"./modal/modal.module","export":["NgbModal","NgbModalOptions","NgbModalRef","ModalDismissReasons"]},{"from":"./tabset/tabset.module","export":["NgbTabChangeEvent"]},{"from":"./alert/alert.module","export":["NgbAlertConfig","NgbSelfClosingAlertConfig"]},{"from":"./carousel/carousel.module","export":["NgbCarouselConfig"]},{"from":"./datepicker/datepicker.module","export":["NgbDatepickerI18n","NgbDatepickerConfig"]},{"from":"./dropdown/dropdown.module","export":["NgbDropdownConfig"]},{"from":"./pagination/pagination.module","export":["NgbPaginationConfig"]},{"from":"./popover/popover.module","export":["NgbPopoverConfig"]},{"from":"./progressbar/progressbar.module","export":["NgbProgressbarConfig"]},{"from":"./rating/rating.module","export":["NgbRatingConfig"]},{"from":"./timepicker/timepicker.module","export":["NgbTimepickerConfig"]},{"from":"./tabset/tabset.module","export":["NgbTabsetConfig"]},{"from":"./tooltip/tooltip.module","export":["NgbTooltipConfig"]},{"from":"./typeahead/typeahead.module","export":["NgbTypeaheadConfig","NgbTypeaheadSelectItemEvent"]}]} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"exports":[{"__symbolic":"reference","module":"./accordion/accordion.module","name":"NgbAccordionModule"},{"__symbolic":"reference","module":"./alert/alert.module","name":"NgbAlertModule"},{"__symbolic":"reference","module":"./buttons/radio.module","name":"NgbButtonsModule"},{"__symbolic":"reference","module":"./carousel/carousel.module","name":"NgbCarouselModule"},{"__symbolic":"reference","module":"./collapse/collapse.module","name":"NgbCollapseModule"},{"__symbolic":"reference","module":"./datepicker/datepicker.module","name":"NgbDatepickerModule"},{"__symbolic":"reference","module":"./dropdown/dropdown.module","name":"NgbDropdownModule"},{"__symbolic":"reference","module":"./modal/modal.module","name":"NgbModalModule"},{"__symbolic":"reference","module":"./pagination/pagination.module","name":"NgbPaginationModule"},{"__symbolic":"reference","module":"./popover/popover.module","name":"NgbPopoverModule"},{"__symbolic":"reference","module":"./progressbar/progressbar.module","name":"NgbProgressbarModule"},{"__symbolic":"reference","module":"./rating/rating.module","name":"NgbRatingModule"},{"__symbolic":"reference","module":"./tabset/tabset.module","name":"NgbTabsetModule"},{"__symbolic":"reference","module":"./timepicker/timepicker.module","name":"NgbTimepickerModule"},{"__symbolic":"reference","module":"./tooltip/tooltip.module","name":"NgbTooltipModule"},{"__symbolic":"reference","module":"./typeahead/typeahead.module","name":"NgbTypeaheadModule"}]}]}]}},"exports":[{"from":"./accordion/accordion.module","export":["NgbAccordionModule","NgbPanelChangeEvent","NgbAccordionConfig"]},{"from":"./alert/alert.module","export":["NgbAlertModule","NgbAlertConfig"]},{"from":"./buttons/radio.module","export":["NgbButtonsModule"]},{"from":"./carousel/carousel.module","export":["NgbCarouselModule","NgbCarouselConfig"]},{"from":"./collapse/collapse.module","export":["NgbCollapseModule"]},{"from":"./datepicker/datepicker.module","export":["NgbDatepickerModule","NgbDatepickerI18n","NgbDatepickerConfig","NgbDateStruct","NgbDateParserFormatter"]},{"from":"./dropdown/dropdown.module","export":["NgbDropdownModule","NgbDropdownConfig"]},{"from":"./modal/modal.module","export":["NgbModalModule","NgbModal","NgbModalOptions","NgbModalRef","ModalDismissReasons"]},{"from":"./pagination/pagination.module","export":["NgbPaginationModule","NgbPaginationConfig"]},{"from":"./popover/popover.module","export":["NgbPopoverModule","NgbPopoverConfig"]},{"from":"./progressbar/progressbar.module","export":["NgbProgressbarModule","NgbProgressbarConfig"]},{"from":"./rating/rating.module","export":["NgbRatingModule","NgbRatingConfig"]},{"from":"./tabset/tabset.module","export":["NgbTabsetModule","NgbTabChangeEvent","NgbTabsetConfig"]},{"from":"./timepicker/timepicker.module","export":["NgbTimepickerModule","NgbTimepickerConfig","NgbTimeStruct"]},{"from":"./tooltip/tooltip.module","export":["NgbTooltipModule","NgbTooltipConfig"]},{"from":"./typeahead/typeahead.module","export":["NgbTypeaheadModule","NgbTypeaheadConfig","NgbTypeaheadSelectItemEvent"]}]} |
{ | ||
"name": "@ng-bootstrap/ng-bootstrap", | ||
"version": "1.0.0-alpha.5", | ||
"version": "1.0.0-alpha.6", | ||
"description": "Angular 2 powered Bootstrap", | ||
@@ -5,0 +5,0 @@ "keywords": "Angular 2 Angular2 Bootstrap autocomplete accordion alert buttons carousel collapse dropdown pagination popover progressbar rating tabset timepicker tooltip typeahead", |
@@ -20,3 +20,3 @@ import { OnInit, OnDestroy, Injector, Renderer, ElementRef, TemplateRef, ViewContainerRef, ComponentFactoryResolver, NgZone } from '@angular/core'; | ||
*/ | ||
title: string; | ||
popoverTitle: string; | ||
/** | ||
@@ -23,0 +23,0 @@ * Placement of a popover. Accepts: "top", "bottom", "left", "right" |
@@ -50,3 +50,6 @@ import { Component, Directive, Input, ChangeDetectionStrategy, Injector, Renderer, ElementRef, ViewContainerRef, ComponentFactoryResolver, NgZone } from '@angular/core'; | ||
this._windowRef.instance.placement = this.placement; | ||
this._windowRef.instance.title = this.title; | ||
this._windowRef.instance.title = this.popoverTitle; | ||
// we need to manually invoke change detection since events registered via | ||
// Renderer::listen() are not picked up by change detection with the OnPush strategy | ||
this._windowRef.changeDetectorRef.markForCheck(); | ||
} | ||
@@ -94,3 +97,3 @@ }; | ||
'ngbPopover': [{ type: Input },], | ||
'title': [{ type: Input },], | ||
'popoverTitle': [{ type: Input },], | ||
'placement': [{ type: Input },], | ||
@@ -97,0 +100,0 @@ 'triggers': [{ type: Input },], |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbPopoverWindow":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-popover-window","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"},"host":{"[class]":"\"popover in popover-\" + placement","role":"tooltip"},"template":"\n <div class=\"popover-arrow\"></div>\n <h3 class=\"popover-title\">{{title}}</h3><div class=\"popover-content\"><ng-content></ng-content></div>\n "}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}]}},"NgbPopover":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbPopover]","exportAs":"ngbPopover"}]}],"members":{"ngbPopover":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"./popover-config","name":"NgbPopoverConfig"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone"}]}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"NGB_POPOVER_DIRECTIVES":[{"__symbolic":"reference","name":"NgbPopover"},{"__symbolic":"reference","name":"NgbPopoverWindow"}]}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbPopoverWindow":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-popover-window","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"},"host":{"[class]":"\"popover in popover-\" + placement","role":"tooltip"},"template":"\n <div class=\"popover-arrow\"></div>\n <h3 class=\"popover-title\">{{title}}</h3><div class=\"popover-content\"><ng-content></ng-content></div>\n "}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}]}},"NgbPopover":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbPopover]","exportAs":"ngbPopover"}]}],"members":{"ngbPopover":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"popoverTitle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"./popover-config","name":"NgbPopoverConfig"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone"}]}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"NGB_POPOVER_DIRECTIVES":[{"__symbolic":"reference","name":"NgbPopover"},{"__symbolic":"reference","name":"NgbPopoverWindow"}]}} |
@@ -59,3 +59,3 @@ import { QueryList, TemplateRef, AfterContentChecked, EventEmitter } from '@angular/core'; | ||
/** | ||
* An identifier of a tab that should be selected (active). | ||
* An identifier of an initially selected (active) tab. Use the "select" method to switch a tab programmatically. | ||
*/ | ||
@@ -70,3 +70,3 @@ activeId: string; | ||
*/ | ||
change: EventEmitter<NgbTabChangeEvent>; | ||
tabChange: EventEmitter<NgbTabChangeEvent>; | ||
constructor(config: NgbTabsetConfig); | ||
@@ -73,0 +73,0 @@ /** |
@@ -72,3 +72,3 @@ import { Component, Input, ContentChildren, Directive, TemplateRef, ContentChild, Output, EventEmitter } from '@angular/core'; | ||
*/ | ||
this.change = new EventEmitter(); | ||
this.tabChange = new EventEmitter(); | ||
this.type = config.type; | ||
@@ -84,3 +84,3 @@ } | ||
var defaultPrevented_1 = false; | ||
this.change.emit({ activeId: this.activeId, nextId: selectedTab.id, preventDefault: function () { defaultPrevented_1 = true; } }); | ||
this.tabChange.emit({ activeId: this.activeId, nextId: selectedTab.id, preventDefault: function () { defaultPrevented_1 = true; } }); | ||
if (!defaultPrevented_1) { | ||
@@ -115,3 +115,3 @@ this.activeId = selectedTab.id; | ||
'type': [{ type: Input },], | ||
'change': [{ type: Output },], | ||
'tabChange': [{ type: Output },], | ||
}; | ||
@@ -118,0 +118,0 @@ return NgbTabset; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTabTitle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbTabTitle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbTabContent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbTabContent]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbTab":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"ngb-tab"}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__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"}}]}],"contentTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbTabContent"}]}]}],"titleTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbTabTitle"}]}]}]}},"NgbTabset":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-tabset","exportAs":"ngbTabset","template":"\n <ul [class]=\"'nav nav-' + type\" role=\"tablist\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabs\">\n <a [id]=\"tab.id\" class=\"nav-link\" [class.active]=\"tab.id === activeId\" [class.disabled]=\"tab.disabled\" \n href (click)=\"!!select(tab.id)\">\n {{tab.title}}<template [ngTemplateOutlet]=\"tab.titleTpl?.templateRef\"></template>\n </a>\n </li>\n </ul>\n <div class=\"tab-content\">\n <template ngFor let-tab [ngForOf]=\"tabs\">\n <div class=\"tab-pane active\" *ngIf=\"tab.id === activeId\" role=\"tabpanel\" [attr.aria-labelledby]=\"tab.id\">\n <template [ngTemplateOutlet]=\"tab.contentTpl.templateRef\"></template>\n </div>\n </template>\n </div>\n "}]}],"members":{"tabs":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","name":"NgbTab"}]}]}],"activeId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./tabset-config","name":"NgbTabsetConfig"}]}],"select":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"_getTabById":[{"__symbolic":"method"}]}},"NGB_TABSET_DIRECTIVES":[{"__symbolic":"reference","name":"NgbTabset"},{"__symbolic":"reference","name":"NgbTab"},{"__symbolic":"reference","name":"NgbTabContent"},{"__symbolic":"reference","name":"NgbTabTitle"}]}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTabTitle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbTabTitle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbTabContent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"template[ngbTabContent]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"NgbTab":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"ngb-tab"}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__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"}}]}],"contentTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbTabContent"}]}]}],"titleTpl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild"},"arguments":[{"__symbolic":"reference","name":"NgbTabTitle"}]}]}]}},"NgbTabset":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-tabset","exportAs":"ngbTabset","template":"\n <ul [class]=\"'nav nav-' + type\" role=\"tablist\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabs\">\n <a [id]=\"tab.id\" class=\"nav-link\" [class.active]=\"tab.id === activeId\" [class.disabled]=\"tab.disabled\" \n href (click)=\"!!select(tab.id)\">\n {{tab.title}}<template [ngTemplateOutlet]=\"tab.titleTpl?.templateRef\"></template>\n </a>\n </li>\n </ul>\n <div class=\"tab-content\">\n <template ngFor let-tab [ngForOf]=\"tabs\">\n <div class=\"tab-pane active\" *ngIf=\"tab.id === activeId\" role=\"tabpanel\" [attr.aria-labelledby]=\"tab.id\">\n <template [ngTemplateOutlet]=\"tab.contentTpl.templateRef\"></template>\n </div>\n </template>\n </div>\n "}]}],"members":{"tabs":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","name":"NgbTab"}]}]}],"activeId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./tabset-config","name":"NgbTabsetConfig"}]}],"select":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"_getTabById":[{"__symbolic":"method"}]}},"NGB_TABSET_DIRECTIVES":[{"__symbolic":"reference","name":"NgbTabset"},{"__symbolic":"reference","name":"NgbTab"},{"__symbolic":"reference","name":"NgbTabContent"},{"__symbolic":"reference","name":"NgbTabTitle"}]}} |
export { NgbTimepickerConfig } from './timepicker-config'; | ||
export { NgbTimeStruct } from './ngb-time-struct'; | ||
export declare class NgbTimepickerModule { | ||
} |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTimepickerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":{"__symbolic":"reference","module":"./timepicker","name":"NGB_TIMEPICKER_DIRECTIVES"},"exports":{"__symbolic":"reference","module":"./timepicker","name":"NGB_TIMEPICKER_DIRECTIVES"},"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"providers":[{"__symbolic":"reference","module":"./timepicker-config","name":"NgbTimepickerConfig"}]}]}]}},"exports":[{"from":"./timepicker-config","export":["NgbTimepickerConfig"]}]} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTimepickerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":{"__symbolic":"reference","module":"./timepicker","name":"NGB_TIMEPICKER_DIRECTIVES"},"exports":{"__symbolic":"reference","module":"./timepicker","name":"NGB_TIMEPICKER_DIRECTIVES"},"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"providers":[{"__symbolic":"reference","module":"./timepicker-config","name":"NgbTimepickerConfig"}]}]}]}},"exports":[{"from":"./timepicker-config","export":["NgbTimepickerConfig"]},{"from":"./ngb-time-struct","export":["NgbTimeStruct"]}]} |
@@ -13,6 +13,2 @@ import { OnInit, OnDestroy, Injector, Renderer, ElementRef, TemplateRef, ViewContainerRef, ComponentFactoryResolver, NgZone } from '@angular/core'; | ||
/** | ||
* Content to be displayed as tooltip. | ||
*/ | ||
ngbTooltip: string | TemplateRef<any>; | ||
/** | ||
* Placement of a tooltip. Accepts: "top", "bottom", "left", "right" | ||
@@ -25,2 +21,3 @@ */ | ||
triggers: string; | ||
private _ngbTooltip; | ||
private _popupService; | ||
@@ -32,2 +29,6 @@ private _windowRef; | ||
/** | ||
* Content to be displayed as tooltip. If falsy, the tooltip won't open. | ||
*/ | ||
ngbTooltip: string | TemplateRef<any>; | ||
/** | ||
* Opens an element’s tooltip. This is considered a “manual” triggering of the tooltip. | ||
@@ -34,0 +35,0 @@ */ |
@@ -42,2 +42,16 @@ import { Component, Directive, Input, ChangeDetectionStrategy, Injector, Renderer, ElementRef, ViewContainerRef, ComponentFactoryResolver, NgZone } from '@angular/core'; | ||
} | ||
Object.defineProperty(NgbTooltip.prototype, "ngbTooltip", { | ||
get: function () { return this._ngbTooltip; }, | ||
/** | ||
* Content to be displayed as tooltip. If falsy, the tooltip won't open. | ||
*/ | ||
set: function (value) { | ||
this._ngbTooltip = value; | ||
if (!value && this._windowRef) { | ||
this.close(); | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
/** | ||
@@ -47,5 +61,8 @@ * Opens an element’s tooltip. This is considered a “manual” triggering of the tooltip. | ||
NgbTooltip.prototype.open = function () { | ||
if (!this._windowRef) { | ||
this._windowRef = this._popupService.open(this.ngbTooltip); | ||
if (!this._windowRef && this._ngbTooltip) { | ||
this._windowRef = this._popupService.open(this._ngbTooltip); | ||
this._windowRef.instance.placement = this.placement; | ||
// we need to manually invoke change detection since events registered via | ||
// Renderer::listen() - to be determined if this is a bug in the Angular 2 | ||
this._windowRef.changeDetectorRef.markForCheck(); | ||
} | ||
@@ -92,5 +109,5 @@ }; | ||
NgbTooltip.propDecorators = { | ||
'ngbTooltip': [{ type: Input },], | ||
'placement': [{ type: Input },], | ||
'triggers': [{ type: Input },], | ||
'ngbTooltip': [{ type: Input },], | ||
}; | ||
@@ -97,0 +114,0 @@ return NgbTooltip; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTooltipWindow":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-tooltip-window","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"},"host":{"[class]":"\"tooltip in tooltip-\" + placement","role":"tooltip"},"template":"\n <div class=\"tooltip-arrow\"></div>\n <div class=\"tooltip-inner\"><ng-content></ng-content></div>\n "}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}]}},"NgbTooltip":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbTooltip]","exportAs":"ngbTooltip"}]}],"members":{"ngbTooltip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"./tooltip-config","name":"NgbTooltipConfig"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone"}]}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTooltipWindow":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ngb-tooltip-window","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"},"host":{"[class]":"\"tooltip in tooltip-\" + placement","role":"tooltip"},"template":"\n <div class=\"tooltip-arrow\"></div>\n <div class=\"tooltip-inner\"><ng-content></ng-content></div>\n "}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}]}},"NgbTooltip":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngbTooltip]","exportAs":"ngbTooltip"}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"./tooltip-config","name":"NgbTooltipConfig"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone"}]}],"ngbTooltip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}} |
@@ -7,3 +7,4 @@ /** | ||
export declare class NgbTypeaheadConfig { | ||
editable: boolean; | ||
showHint: boolean; | ||
} |
@@ -9,2 +9,3 @@ import { Injectable } from '@angular/core'; | ||
function NgbTypeaheadConfig() { | ||
this.editable = true; | ||
this.showHint = false; | ||
@@ -11,0 +12,0 @@ } |
@@ -24,3 +24,3 @@ import { OnInit, EventEmitter, ComponentFactoryResolver, ViewContainerRef, Injector, Renderer, ElementRef, TemplateRef, OnDestroy, NgZone } from '@angular/core'; | ||
*/ | ||
export declare class NgbTypeahead implements OnInit, ControlValueAccessor, OnDestroy { | ||
export declare class NgbTypeahead implements ControlValueAccessor, OnInit, OnDestroy { | ||
private _elementRef; | ||
@@ -30,3 +30,2 @@ private _viewContainerRef; | ||
private _injector; | ||
private _onChangeNoEmit; | ||
private _popupService; | ||
@@ -39,2 +38,6 @@ private _subscription; | ||
/** | ||
* A flag indicating if model values should be restricted to the ones selected from the popup only. | ||
*/ | ||
editable: boolean; | ||
/** | ||
* A function to convert a given value into string to display in the input field | ||
@@ -64,7 +67,7 @@ */ | ||
selectItem: EventEmitter<NgbTypeaheadSelectItemEvent>; | ||
onChange: (value: any) => void; | ||
onTouched: () => void; | ||
private _onTouched; | ||
private _onChange; | ||
constructor(_elementRef: ElementRef, _viewContainerRef: ViewContainerRef, _renderer: Renderer, _injector: Injector, componentFactoryResolver: ComponentFactoryResolver, config: NgbTypeaheadConfig, ngZone: NgZone); | ||
ngOnInit(): void; | ||
ngOnDestroy(): void; | ||
ngOnInit(): void; | ||
registerOnChange(fn: (value: any) => any): void; | ||
@@ -80,2 +83,4 @@ registerOnTouched(fn: () => any): void; | ||
private _writeInputValue(value); | ||
private _subscribeToUserInput(userInput$); | ||
private _unsubscribeFromUserInput(); | ||
} |
import { Directive, Input, Output, EventEmitter, ComponentFactoryResolver, ViewContainerRef, Injector, Renderer, ElementRef, forwardRef, NgZone } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { Subject } from 'rxjs/Rx'; | ||
import { Observable } from 'rxjs/Rx'; | ||
import 'rxjs/add/operator/do'; | ||
@@ -34,3 +34,2 @@ import 'rxjs/add/operator/let'; | ||
this._injector = _injector; | ||
this._valueChanges = new Subject(); | ||
/** | ||
@@ -40,10 +39,8 @@ * An event emitted when a match is selected. Event payload is of type NgbTypeaheadSelectItemEvent. | ||
this.selectItem = new EventEmitter(); | ||
this.onChange = function (value) { | ||
_this._onChangeNoEmit(value); | ||
_this._valueChanges.next(value); | ||
}; | ||
this.onTouched = function () { }; | ||
this._onTouched = function () { }; | ||
this._onChange = function (_) { }; | ||
this.editable = config.editable; | ||
this.showHint = config.showHint; | ||
this._valueChanges = Observable.fromEvent(_elementRef.nativeElement, 'input', function ($event) { return $event.target.value; }); | ||
this._popupService = new PopupService(NgbTypeaheadWindow, _injector, _viewContainerRef, _renderer, componentFactoryResolver); | ||
this._onChangeNoEmit = function (_) { }; | ||
this._zoneSubscription = ngZone.onStable.subscribe(function () { | ||
@@ -55,29 +52,19 @@ if (_this._windowRef) { | ||
} | ||
NgbTypeahead.prototype.ngOnInit = function () { | ||
var _this = this; | ||
this._subscription = this._subscribeToUserInput(this._valueChanges | ||
.do(function (value) { | ||
_this._userInput = value; | ||
if (_this.editable) { | ||
_this._onChange(value); | ||
} | ||
}) | ||
.let(this.ngbTypeahead)); | ||
}; | ||
NgbTypeahead.prototype.ngOnDestroy = function () { | ||
this._subscription.unsubscribe(); | ||
this._unsubscribeFromUserInput(); | ||
this._zoneSubscription.unsubscribe(); | ||
}; | ||
NgbTypeahead.prototype.ngOnInit = function () { | ||
var _this = this; | ||
this._subscription = | ||
this._valueChanges.do(function (value) { return _this._userInput = value; }).let(this.ngbTypeahead).subscribe(function (results) { | ||
if (!results || results.length === 0) { | ||
_this._closePopup(); | ||
} | ||
else { | ||
_this._openPopup(); | ||
_this._windowRef.instance.results = results; | ||
_this._windowRef.instance.term = _this._elementRef.nativeElement.value; | ||
if (_this.resultFormatter) { | ||
_this._windowRef.instance.formatter = _this.resultFormatter; | ||
} | ||
if (_this.resultTemplate) { | ||
_this._windowRef.instance.resultTemplate = _this.resultTemplate; | ||
} | ||
_this._showHint(); | ||
} | ||
}); | ||
}; | ||
NgbTypeahead.prototype.registerOnChange = function (fn) { this._onChangeNoEmit = fn; }; | ||
NgbTypeahead.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; | ||
NgbTypeahead.prototype.registerOnChange = function (fn) { this._onChange = fn; }; | ||
NgbTypeahead.prototype.registerOnTouched = function (fn) { this._onTouched = fn; }; | ||
NgbTypeahead.prototype.writeValue = function (value) { this._writeInputValue(this._formatItemForInput(value)); }; | ||
@@ -103,2 +90,6 @@ NgbTypeahead.prototype.setDisabledState = function (isDisabled) { | ||
*/ | ||
NgbTypeahead.prototype.handleBlur = function () { this._onTouched(); }; | ||
/** | ||
* @internal | ||
*/ | ||
NgbTypeahead.prototype.handleKeyDown = function (event) { | ||
@@ -146,3 +137,3 @@ if (!this._windowRef) { | ||
this.writeValue(result); | ||
this._onChangeNoEmit(result); | ||
this._onChange(result); | ||
} | ||
@@ -170,2 +161,32 @@ this._closePopup(); | ||
}; | ||
NgbTypeahead.prototype._subscribeToUserInput = function (userInput$) { | ||
var _this = this; | ||
return userInput$.subscribe(function (results) { | ||
if (!results || results.length === 0) { | ||
_this._closePopup(); | ||
} | ||
else { | ||
_this._openPopup(); | ||
_this._windowRef.instance.results = results; | ||
_this._windowRef.instance.term = _this._elementRef.nativeElement.value; | ||
if (_this.resultFormatter) { | ||
_this._windowRef.instance.formatter = _this.resultFormatter; | ||
} | ||
if (_this.resultTemplate) { | ||
_this._windowRef.instance.resultTemplate = _this.resultTemplate; | ||
} | ||
_this._showHint(); | ||
// The observable stream we are subscribing to might have async steps | ||
// and if a component containing typeahead is using the OnPush strategy | ||
// the change detection turn wouldn't be invoked automatically. | ||
_this._windowRef.changeDetectorRef.detectChanges(); | ||
} | ||
}); | ||
}; | ||
NgbTypeahead.prototype._unsubscribeFromUserInput = function () { | ||
if (this._subscription) { | ||
this._subscription.unsubscribe(); | ||
} | ||
this._subscription = null; | ||
}; | ||
NgbTypeahead.decorators = [ | ||
@@ -175,6 +196,5 @@ { type: Directive, args: [{ | ||
host: { | ||
'(blur)': 'onTouched()', | ||
'(blur)': 'handleBlur()', | ||
'[class.open]': 'isPopupOpen()', | ||
'(document:click)': 'dismissPopup()', | ||
'(input)': 'onChange($event.target.value)', | ||
'(keydown)': 'handleKeyDown($event)', | ||
@@ -199,2 +219,3 @@ 'autocomplete': 'off', | ||
NgbTypeahead.propDecorators = { | ||
'editable': [{ type: Input },], | ||
'inputFormatter': [{ type: Input },], | ||
@@ -201,0 +222,0 @@ 'ngbTypeahead': [{ type: Input },], |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTypeahead":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[ngbTypeahead]","host":{"(blur)":"onTouched()","[class.open]":"isPopupOpen()","(document:click)":"dismissPopup()","(input)":"onChange($event.target.value)","(keydown)":"handleKeyDown($event)","autocomplete":"off","autocapitalize":"off","autocorrect":"off"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgbTypeahead"},"multi":true}]}]}],"members":{"inputFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngbTypeahead":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"resultFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"resultTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"showHint":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"selectItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"./typeahead-config","name":"NgbTypeaheadConfig"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}],"dismissPopup":[{"__symbolic":"method"}],"isPopupOpen":[{"__symbolic":"method"}],"handleKeyDown":[{"__symbolic":"method"}],"_openPopup":[{"__symbolic":"method"}],"_closePopup":[{"__symbolic":"method"}],"_selectResult":[{"__symbolic":"method"}],"_showHint":[{"__symbolic":"method"}],"_formatItemForInput":[{"__symbolic":"method"}],"_writeInputValue":[{"__symbolic":"method"}]}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"NgbTypeahead":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[ngbTypeahead]","host":{"(blur)":"handleBlur()","[class.open]":"isPopupOpen()","(document:click)":"dismissPopup()","(keydown)":"handleKeyDown($event)","autocomplete":"off","autocapitalize":"off","autocorrect":"off"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgbTypeahead"},"multi":true}]}]}],"members":{"editable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"inputFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngbTypeahead":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"resultFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"resultTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"showHint":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"selectItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"./typeahead-config","name":"NgbTypeaheadConfig"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}],"dismissPopup":[{"__symbolic":"method"}],"isPopupOpen":[{"__symbolic":"method"}],"handleBlur":[{"__symbolic":"method"}],"handleKeyDown":[{"__symbolic":"method"}],"_openPopup":[{"__symbolic":"method"}],"_closePopup":[{"__symbolic":"method"}],"_selectResult":[{"__symbolic":"method"}],"_showHint":[{"__symbolic":"method"}],"_formatItemForInput":[{"__symbolic":"method"}],"_writeInputValue":[{"__symbolic":"method"}],"_subscribeToUserInput":[{"__symbolic":"method"}],"_unsubscribeFromUserInput":[{"__symbolic":"method"}]}}}} |
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
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 not supported yet
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
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
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
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
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
1163931
287
10926