ng2-encrm-components
Version:
56 lines • 1.88 kB
JavaScript
var core_1 = require('@angular/core');
var noop = function () {
};
var EnSelectComponent = (function () {
function EnSelectComponent(element) {
this.active = false;
this.element = element;
this.clickedOutside = this.clickedOutside.bind(this);
}
EnSelectComponent.prototype.ngOnInit = function () {
};
EnSelectComponent.prototype._close = function () {
if (this.active) {
this.active = false;
}
};
EnSelectComponent.prototype.clickedOutside = function () {
this._close();
};
EnSelectComponent.prototype.selectOption = function (o) {
this.selectedOption = o;
this.selectedSuboption = null;
this._close();
};
EnSelectComponent.prototype.selectSuboption = function (o, so) {
this.selectedOption = o;
this.selectedSuboption = so;
this._close();
};
EnSelectComponent.prototype.toggleOpen = function () {
this.active = !this.active;
};
__decorate([
core_1.Input(),
__metadata('design:type', Array)
], EnSelectComponent.prototype, "options", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], EnSelectComponent.prototype, "placeholder", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], EnSelectComponent.prototype, "label", void 0);
EnSelectComponent = __decorate([
core_1.Component({
selector: 'en-select',
template: require('./en-select.component.html')
}),
__metadata('design:paramtypes', [core_1.ElementRef])
], EnSelectComponent);
return EnSelectComponent;
}());
exports.EnSelectComponent = EnSelectComponent;
//# sourceMappingURL=en-select.component.js.map
;