@nepwork/dashboards
Version:
Dashboards for emergencies and monitoring
113 lines • 3.61 kB
JavaScript
import { __decorate, __metadata, __param } from "tslib";
import { Component, Inject, Input, TemplateRef, ViewChild } from '@angular/core';
import { NB_STEPPER } from './stepper-tokens';
import { convertToBoolProperty } from '../helpers';
/**
* Component intended to be used within the `<nb-stepper>` component.
* Container for a step
*/
var NbStepComponent = /** @class */ (function () {
function NbStepComponent(stepper) {
this._hidden = false;
this._completed = false;
this.interacted = false;
this.stepper = stepper;
}
Object.defineProperty(NbStepComponent.prototype, "hidden", {
/**
* Whether step will be displayed in wizard
*
* @type {boolean}
*/
get: function () {
return this._hidden;
},
set: function (value) {
this._hidden = convertToBoolProperty(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NbStepComponent.prototype, "isLabelTemplate", {
/**
* Check that label is a TemplateRef.
*
* @return boolean
* */
get: function () {
return this.label instanceof TemplateRef;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NbStepComponent.prototype, "completed", {
/**
* Whether step is marked as completed.
*
* @type {boolean}
*/
get: function () {
return this._completed || this.isCompleted;
},
set: function (value) {
this._completed = convertToBoolProperty(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NbStepComponent.prototype, "isCompleted", {
get: function () {
return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
},
enumerable: true,
configurable: true
});
/**
* Mark step as selected
* */
NbStepComponent.prototype.select = function () {
this.stepper.selected = this;
};
/**
* Reset step and stepControl state
* */
NbStepComponent.prototype.reset = function () {
this.interacted = false;
if (this.stepControl) {
this.stepControl.reset();
}
};
__decorate([
ViewChild(TemplateRef, { static: true }),
__metadata("design:type", TemplateRef)
], NbStepComponent.prototype, "content", void 0);
__decorate([
Input(),
__metadata("design:type", Object)
], NbStepComponent.prototype, "stepControl", void 0);
__decorate([
Input(),
__metadata("design:type", Object)
], NbStepComponent.prototype, "label", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
], NbStepComponent.prototype, "hidden", null);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
], NbStepComponent.prototype, "completed", null);
NbStepComponent = __decorate([
Component({
selector: 'nb-step',
template: "\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "
}),
__param(0, Inject(NB_STEPPER)),
__metadata("design:paramtypes", [Object])
], NbStepComponent);
return NbStepComponent;
}());
export { NbStepComponent };
//# sourceMappingURL=step.component.js.map