| import { CommonModule } from '@angular/common'; |
| import { MatIconModule } from '@angular/material/icon'; |
| import { MatRippleModule } from '@angular/material/core'; |
| import { TemplatePortalDirective, TemplatePortal, PortalModule } from '@angular/cdk/portal'; |
| import { mixinDisabled, mixinDisableRipple, tdCollapseAnimation, CovalentCommonModule } from '@covalent/core/common'; |
| import { Directionality } from '@angular/cdk/bidi'; |
| import { RIGHT_ARROW, LEFT_ARROW } from '@angular/cdk/keycodes'; |
| import { ViewportRuler, ScrollDispatchModule } from '@angular/cdk/scrolling'; |
| import { __extends } from 'tslib'; |
| import { coerceBooleanProperty } from '@angular/cdk/coercion'; |
| import { Component, Directive, Input, Output, TemplateRef, ViewChild, ViewContainerRef, ContentChild, EventEmitter, ContentChildren, ElementRef, ChangeDetectionStrategy, ChangeDetectorRef, Optional, Renderer2, NgModule } from '@angular/core'; |
| import { Subject, merge, of } from 'rxjs'; |
| import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| /** @enum {string} */ |
| var StepState = { |
| None: 'none', |
| Required: 'required', |
| Complete: 'complete', |
| }; |
| var TdStepLabelDirective = /** @class */ (function (_super) { |
| __extends(TdStepLabelDirective, _super); |
| function TdStepLabelDirective(templateRef, viewContainerRef) { |
| return _super.call(this, templateRef, viewContainerRef) || this; |
| } |
| TdStepLabelDirective.decorators = [ |
| { type: Directive, args: [{ |
| selector: '[td-step-label]ng-template', |
| },] } |
| ]; |
| /** @nocollapse */ |
| TdStepLabelDirective.ctorParameters = function () { return [ |
| { type: TemplateRef }, |
| { type: ViewContainerRef } |
| ]; }; |
| return TdStepLabelDirective; |
| }(TemplatePortalDirective)); |
| var TdStepActionsDirective = /** @class */ (function (_super) { |
| __extends(TdStepActionsDirective, _super); |
| function TdStepActionsDirective(templateRef, viewContainerRef) { |
| return _super.call(this, templateRef, viewContainerRef) || this; |
| } |
| TdStepActionsDirective.decorators = [ |
| { type: Directive, args: [{ |
| selector: '[td-step-actions]ng-template', |
| },] } |
| ]; |
| /** @nocollapse */ |
| TdStepActionsDirective.ctorParameters = function () { return [ |
| { type: TemplateRef }, |
| { type: ViewContainerRef } |
| ]; }; |
| return TdStepActionsDirective; |
| }(TemplatePortalDirective)); |
| var TdStepSummaryDirective = /** @class */ (function (_super) { |
| __extends(TdStepSummaryDirective, _super); |
| function TdStepSummaryDirective(templateRef, viewContainerRef) { |
| return _super.call(this, templateRef, viewContainerRef) || this; |
| } |
| TdStepSummaryDirective.decorators = [ |
| { type: Directive, args: [{ |
| selector: '[td-step-summary]ng-template', |
| },] } |
| ]; |
| /** @nocollapse */ |
| TdStepSummaryDirective.ctorParameters = function () { return [ |
| { type: TemplateRef }, |
| { type: ViewContainerRef } |
| ]; }; |
| return TdStepSummaryDirective; |
| }(TemplatePortalDirective)); |
| var TdStepBase = /** @class */ (function () { |
| function TdStepBase() { |
| } |
| return TdStepBase; |
| }()); |
| /* tslint:disable-next-line */ |
| /** @type {?} */ |
| var _TdStepMixinBase = mixinDisableRipple(mixinDisabled(TdStepBase)); |
| var TdStepComponent = /** @class */ (function (_super) { |
| __extends(TdStepComponent, _super); |
| function TdStepComponent(_viewContainerRef) { |
| var _this = _super.call(this) || this; |
| _this._viewContainerRef = _viewContainerRef; |
| _this._active = false; |
| _this._state = StepState.None; |
| /** |
| * activated?: function |
| * Event emitted when [TdStepComponent] is activated. |
| */ |
| _this.onActivated = new EventEmitter(); |
| /** |
| * deactivated?: function |
| * Event emitted when [TdStepComponent] is deactivated. |
| */ |
| _this.onDeactivated = new EventEmitter(); |
| return _this; |
| } |
| Object.defineProperty(TdStepComponent.prototype, "stepContent", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._contentPortal; |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdStepComponent.prototype, "active", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._active; |
| }, |
| /** |
| * active?: boolean |
| * Toggles [TdStepComponent] between active/deactive. |
| */ |
| set: /** |
| * active?: boolean |
| * Toggles [TdStepComponent] between active/deactive. |
| * @param {?} active |
| * @return {?} |
| */ |
| function (active) { |
| this._setActive(coerceBooleanProperty(active)); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdStepComponent.prototype, "state", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._state; |
| }, |
| /** |
| * state?: StepState or ['none' | 'required' | 'complete'] |
| * Sets state of [TdStepComponent] depending on value. |
| * Defaults to [StepState.None | 'none']. |
| */ |
| set: /** |
| * state?: StepState or ['none' | 'required' | 'complete'] |
| * Sets state of [TdStepComponent] depending on value. |
| * Defaults to [StepState.None | 'none']. |
| * @param {?} state |
| * @return {?} |
| */ |
| function (state) { |
| switch (state) { |
| case StepState.Complete: |
| this._state = StepState.Complete; |
| break; |
| case StepState.Required: |
| this._state = StepState.Required; |
| break; |
| default: |
| this._state = StepState.None; |
| break; |
| } |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| /** |
| * @return {?} |
| */ |
| TdStepComponent.prototype.ngOnInit = /** |
| * @return {?} |
| */ |
| function () { |
| this._contentPortal = new TemplatePortal(this._content, this._viewContainerRef); |
| }; |
| /** |
| * Toggle active state of [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| */ |
| /** |
| * Toggle active state of [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| * @return {?} |
| */ |
| TdStepComponent.prototype.toggle = /** |
| * Toggle active state of [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this._setActive(!this._active); |
| }; |
| /** |
| * Opens [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| */ |
| /** |
| * Opens [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| * @return {?} |
| */ |
| TdStepComponent.prototype.open = /** |
| * Opens [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this._setActive(true); |
| }; |
| /** |
| * Closes [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| */ |
| /** |
| * Closes [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| * @return {?} |
| */ |
| TdStepComponent.prototype.close = /** |
| * Closes [TdStepComponent] |
| * retuns 'true' if successful, else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this._setActive(false); |
| }; |
| /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| */ |
| /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| * @return {?} |
| */ |
| TdStepComponent.prototype.isComplete = /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this._state === StepState.Complete; |
| }; |
| /** Method executed when the disabled value changes */ |
| /** |
| * Method executed when the disabled value changes |
| * @param {?} v |
| * @return {?} |
| */ |
| TdStepComponent.prototype.onDisabledChange = /** |
| * Method executed when the disabled value changes |
| * @param {?} v |
| * @return {?} |
| */ |
| function (v) { |
| if (v && this._active) { |
| this._active = false; |
| this._onDeactivated(); |
| } |
| }; |
| /** |
| * Method to change active state internally and emit the [onActivated] event if 'true' or [onDeactivated] |
| * event if 'false'. (Blocked if [disabled] is 'true') |
| * returns true if successfully changed state |
| */ |
| /** |
| * Method to change active state internally and emit the [onActivated] event if 'true' or [onDeactivated] |
| * event if 'false'. (Blocked if [disabled] is 'true') |
| * returns true if successfully changed state |
| * @param {?} newActive |
| * @return {?} |
| */ |
| TdStepComponent.prototype._setActive = /** |
| * Method to change active state internally and emit the [onActivated] event if 'true' or [onDeactivated] |
| * event if 'false'. (Blocked if [disabled] is 'true') |
| * returns true if successfully changed state |
| * @param {?} newActive |
| * @return {?} |
| */ |
| function (newActive) { |
| if (this.disabled) { |
| return false; |
| } |
| if (this._active !== newActive) { |
| this._active = newActive; |
| if (newActive) { |
| this._onActivated(); |
| } |
| else { |
| this._onDeactivated(); |
| } |
| return true; |
| } |
| return false; |
| }; |
| /** |
| * @return {?} |
| */ |
| TdStepComponent.prototype._onActivated = /** |
| * @return {?} |
| */ |
| function () { |
| this.onActivated.emit(undefined); |
| }; |
| /** |
| * @return {?} |
| */ |
| TdStepComponent.prototype._onDeactivated = /** |
| * @return {?} |
| */ |
| function () { |
| this.onDeactivated.emit(undefined); |
| }; |
| TdStepComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: 'td-step', |
| inputs: ['disabled', 'disableRipple'], |
| template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>" |
| }] } |
| ]; |
| /** @nocollapse */ |
| TdStepComponent.ctorParameters = function () { return [ |
| { type: ViewContainerRef } |
| ]; }; |
| TdStepComponent.propDecorators = { |
| _content: [{ type: ViewChild, args: [TemplateRef,] }], |
| stepLabel: [{ type: ContentChild, args: [TdStepLabelDirective,] }], |
| stepActions: [{ type: ContentChild, args: [TdStepActionsDirective,] }], |
| stepSummary: [{ type: ContentChild, args: [TdStepSummaryDirective,] }], |
| label: [{ type: Input, args: ['label',] }], |
| sublabel: [{ type: Input, args: ['sublabel',] }], |
| active: [{ type: Input, args: ['active',] }], |
| state: [{ type: Input, args: ['state',] }], |
| onActivated: [{ type: Output, args: ['activated',] }], |
| onDeactivated: [{ type: Output, args: ['deactivated',] }] |
| }; |
| return TdStepComponent; |
| }(_TdStepMixinBase)); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| /** @enum {string} */ |
| var StepMode = { |
| Vertical: 'vertical', |
| Horizontal: 'horizontal', |
| }; |
| var TdStepsComponent = /** @class */ (function () { |
| function TdStepsComponent() { |
| this._mode = StepMode.Vertical; |
| /** |
| * stepChange?: function |
| * Method to be executed when [onStepChange] event is emitted. |
| * Emits an [IStepChangeEvent] implemented object. |
| */ |
| this.onStepChange = new EventEmitter(); |
| } |
| Object.defineProperty(TdStepsComponent.prototype, "stepsContent", { |
| set: /** |
| * @param {?} steps |
| * @return {?} |
| */ |
| function (steps) { |
| if (steps) { |
| this._steps = steps; |
| this._registerSteps(); |
| } |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdStepsComponent.prototype, "steps", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._steps.toArray(); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdStepsComponent.prototype, "mode", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._mode; |
| }, |
| /** |
| * mode?: StepMode or ["vertical" | "horizontal"] |
| * Defines if the mode of the [TdStepsComponent]. Defaults to [StepMode.Vertical | "vertical"] |
| */ |
| set: /** |
| * mode?: StepMode or ["vertical" | "horizontal"] |
| * Defines if the mode of the [TdStepsComponent]. Defaults to [StepMode.Vertical | "vertical"] |
| * @param {?} mode |
| * @return {?} |
| */ |
| function (mode) { |
| switch (mode) { |
| case StepMode.Horizontal: |
| this._mode = StepMode.Horizontal; |
| break; |
| default: |
| this._mode = StepMode.Vertical; |
| } |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| /** |
| * Executed after content is initialized, loops through any [TdStepComponent] children elements, |
| * assigns them a number and subscribes as an observer to their [onActivated] event. |
| */ |
| /** |
| * Executed after content is initialized, loops through any [TdStepComponent] children elements, |
| * assigns them a number and subscribes as an observer to their [onActivated] event. |
| * @return {?} |
| */ |
| TdStepsComponent.prototype.ngAfterContentInit = /** |
| * Executed after content is initialized, loops through any [TdStepComponent] children elements, |
| * assigns them a number and subscribes as an observer to their [onActivated] event. |
| * @return {?} |
| */ |
| function () { |
| this._registerSteps(); |
| }; |
| /** |
| * Unsubscribes from [TdStepComponent] children elements when component is destroyed. |
| */ |
| /** |
| * Unsubscribes from [TdStepComponent] children elements when component is destroyed. |
| * @return {?} |
| */ |
| TdStepsComponent.prototype.ngOnDestroy = /** |
| * Unsubscribes from [TdStepComponent] children elements when component is destroyed. |
| * @return {?} |
| */ |
| function () { |
| this._deregisterSteps(); |
| }; |
| /** |
| * Returns 'true' if [mode] equals to [StepMode.Horizontal | 'horizontal'], else 'false'. |
| */ |
| /** |
| * Returns 'true' if [mode] equals to [StepMode.Horizontal | 'horizontal'], else 'false'. |
| * @return {?} |
| */ |
| TdStepsComponent.prototype.isHorizontal = /** |
| * Returns 'true' if [mode] equals to [StepMode.Horizontal | 'horizontal'], else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this._mode === StepMode.Horizontal; |
| }; |
| /** |
| * Returns 'true' if [mode] equals to [StepMode.Vertical | 'vertical'], else 'false'. |
| */ |
| /** |
| * Returns 'true' if [mode] equals to [StepMode.Vertical | 'vertical'], else 'false'. |
| * @return {?} |
| */ |
| TdStepsComponent.prototype.isVertical = /** |
| * Returns 'true' if [mode] equals to [StepMode.Vertical | 'vertical'], else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this._mode === StepMode.Vertical; |
| }; |
| /** |
| * @return {?} |
| */ |
| TdStepsComponent.prototype.areStepsActive = /** |
| * @return {?} |
| */ |
| function () { |
| return this._steps.filter(function (step) { |
| return step.active; |
| }).length > 0; |
| }; |
| /** |
| * Wraps previous and new [TdStepComponent] numbers in an object that implements [IStepChangeEvent] |
| * and emits [onStepChange] event. |
| */ |
| /** |
| * Wraps previous and new [TdStepComponent] numbers in an object that implements [IStepChangeEvent] |
| * and emits [onStepChange] event. |
| * @param {?} step |
| * @return {?} |
| */ |
| TdStepsComponent.prototype._onStepSelection = /** |
| * Wraps previous and new [TdStepComponent] numbers in an object that implements [IStepChangeEvent] |
| * and emits [onStepChange] event. |
| * @param {?} step |
| * @return {?} |
| */ |
| function (step) { |
| if (this.prevStep !== step) { |
| /** @type {?} */ |
| var prevStep = this.prevStep; |
| this.prevStep = step; |
| /** @type {?} */ |
| var event_1 = { |
| newStep: step, |
| prevStep: prevStep, |
| }; |
| this._deactivateAllBut(step); |
| this.onStepChange.emit(event_1); |
| } |
| }; |
| /** |
| * Loops through [TdStepComponent] children elements and deactivates them ignoring the one passed as an argument. |
| */ |
| /** |
| * Loops through [TdStepComponent] children elements and deactivates them ignoring the one passed as an argument. |
| * @param {?} activeStep |
| * @return {?} |
| */ |
| TdStepsComponent.prototype._deactivateAllBut = /** |
| * Loops through [TdStepComponent] children elements and deactivates them ignoring the one passed as an argument. |
| * @param {?} activeStep |
| * @return {?} |
| */ |
| function (activeStep) { |
| this._steps.filter(function (step) { return step !== activeStep; }) |
| .forEach(function (step) { |
| step.active = false; |
| }); |
| }; |
| /** |
| * @return {?} |
| */ |
| TdStepsComponent.prototype._registerSteps = /** |
| * @return {?} |
| */ |
| function () { |
| var _this = this; |
| this._subcriptions = []; |
| this._steps.toArray().forEach(function (step) { |
| /** @type {?} */ |
| var subscription = step.onActivated.asObservable().subscribe(function () { |
| _this._onStepSelection(step); |
| }); |
| _this._subcriptions.push(subscription); |
| }); |
| }; |
| /** |
| * @return {?} |
| */ |
| TdStepsComponent.prototype._deregisterSteps = /** |
| * @return {?} |
| */ |
| function () { |
| if (this._subcriptions) { |
| this._subcriptions.forEach(function (subs) { |
| subs.unsubscribe(); |
| }); |
| this._subcriptions = undefined; |
| } |
| }; |
| TdStepsComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: 'td-steps', |
| template: "<div *ngIf=\"isHorizontal()\" class=\"td-steps-header\">\n <ng-template let-step let-index=\"index\" let-last=\"last\" ngFor [ngForOf]=\"steps\">\n <td-step-header class=\"td-step-horizontal-header\"\n (keydown.enter)=\"step.open()\"\n [number]=\"index + 1\"\n [active]=\"step.active\"\n [disableRipple]=\"step.disableRipple\"\n [disabled]=\"step.disabled\" \n [state]=\"step.state\"\n (click)=\"step.open()\">\n <ng-template td-step-header-label [cdkPortalOutlet]=\"step.stepLabel\"></ng-template>\n <ng-template td-step-header-label [ngIf]=\"!step.stepLabel\">{{step.label}}</ng-template>\n <ng-template td-step-header-sublabel [ngIf]=\"true\">{{step.sublabel | truncate:30}}</ng-template>\n </td-step-header>\n <span *ngIf=\"!last\" class=\"td-horizontal-line\"></span>\n </ng-template>\n</div>\n<div *ngFor=\"let step of steps; let index = index; let last = last\" class=\"td-step\">\n <td-step-header class=\"td-step-vertical-header\"\n (keydown.enter)=\"step.toggle()\"\n [number]=\"index + 1\"\n [active]=\"step.active\" \n [disabled]=\"step.disabled\"\n [disableRipple]=\"step.disableRipple\"\n [state]=\"step.state\"\n (click)=\"step.toggle()\"\n *ngIf=\"isVertical()\">\n <ng-template td-step-header-label [cdkPortalOutlet]=\"step.stepLabel\"></ng-template>\n <ng-template td-step-header-label [ngIf]=\"!step.stepLabel\">{{step.label}}</ng-template>\n <ng-template td-step-header-sublabel [ngIf]=\"true\">{{step.sublabel}}</ng-template>\n </td-step-header>\n <ng-template [ngIf]=\"isVertical() || step.active || (!areStepsActive() && prevStep === step)\">\n <td-step-body [active]=\"step.active\" [state]=\"step.state\">\n <div *ngIf=\"isVertical()\" class=\"td-line-wrapper\">\n <div *ngIf=\"!last\" class=\"td-vertical-line\"></div>\n </div>\n <ng-template td-step-body-content [cdkPortalOutlet]=\"step.stepContent\"></ng-template>\n <ng-template td-step-body-actions [cdkPortalOutlet]=\"step.stepActions\"></ng-template>\n <ng-template td-step-body-summary [cdkPortalOutlet]=\"step.stepSummary\"></ng-template>\n </td-step-body>\n </ng-template>\n</div>\n", |
| /* tslint:disable-next-line */ |
| host: { |
| class: 'td-steps', |
| }, |
| styles: [".td-line-wrapper,.td-step{position:relative}.td-steps-header{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.td-line-wrapper{width:24px;min-height:1px}.td-horizontal-line{border-bottom-width:1px;border-bottom-style:solid;height:1px;position:relative;top:36px;min-width:15px;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box}::ng-deep :not([dir=rtl]) .td-horizontal-line{left:-6px;right:-3px}::ng-deep [dir=rtl] .td-horizontal-line{left:-3px;right:-6px}.td-vertical-line{position:absolute;bottom:-16px;top:-16px;border-left-width:1px;border-left-style:solid}::ng-deep :not([dir=rtl]) .td-vertical-line{left:20px;right:auto}::ng-deep [dir=rtl] .td-vertical-line{left:auto;right:20px}"] |
| }] } |
| ]; |
| TdStepsComponent.propDecorators = { |
| stepsContent: [{ type: ContentChildren, args: [TdStepComponent,] }], |
| mode: [{ type: Input, args: ['mode',] }], |
| onStepChange: [{ type: Output, args: ['stepChange',] }] |
| }; |
| return TdStepsComponent; |
| }()); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| var TdStepHeaderBase = /** @class */ (function () { |
| function TdStepHeaderBase() { |
| } |
| return TdStepHeaderBase; |
| }()); |
| /* tslint:disable-next-line */ |
| /** @type {?} */ |
| var _TdStepHeaderMixinBase = mixinDisableRipple(mixinDisabled(TdStepHeaderBase)); |
| var TdStepHeaderComponent = /** @class */ (function (_super) { |
| __extends(TdStepHeaderComponent, _super); |
| function TdStepHeaderComponent() { |
| var _this = _super !== null && _super.apply(this, arguments) || this; |
| /** |
| * state?: StepState or ['none' | 'required' | 'complete'] |
| * Sets styles for state of header. |
| * Defaults to [StepState.None | 'none']. |
| */ |
| _this.state = StepState.None; |
| return _this; |
| } |
| /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| */ |
| /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| * @return {?} |
| */ |
| TdStepHeaderComponent.prototype.isComplete = /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this.state === StepState.Complete; |
| }; |
| /** |
| * Returns 'true' if [state] equals to [StepState.Required | 'required'], else 'false'. |
| */ |
| /** |
| * Returns 'true' if [state] equals to [StepState.Required | 'required'], else 'false'. |
| * @return {?} |
| */ |
| TdStepHeaderComponent.prototype.isRequired = /** |
| * Returns 'true' if [state] equals to [StepState.Required | 'required'], else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this.state === StepState.Required; |
| }; |
| TdStepHeaderComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: 'td-step-header', |
| inputs: ['disabled', 'disableRipple'], |
| template: "<div class=\"td-step-header\"\n [class.mat-disabled]=\"disabled\"\n matRipple\n [matRippleDisabled]=\"disabled || disableRipple\"\n [tabIndex]=\"disabled ? -1 : (tabIndex || 0)\">\n <div class=\"td-circle\"\n [class.mat-inactive]=\"(!active && !isComplete()) || disabled\"\n [class.mat-active]=\"active && !disabled\"\n *ngIf=\"!isRequired() && !isComplete()\">\n <span *ngIf=\"(active || !isComplete())\">{{number || ''}}</span>\n </div>\n <div class=\"td-complete\" *ngIf=\"isComplete()\">\n <mat-icon class=\"mat-complete\">check_circle</mat-icon>\n </div>\n <div class=\"td-triangle\"\n [class.bg-muted]=\"disabled\"\n *ngIf=\"isRequired()\">\n <mat-icon class=\"mat-warn\">warning</mat-icon>\n </div>\n <div class=\"td-step-label-wrapper\"\n [class.mat-inactive]=\"(!active && !isComplete()) || disabled\"\n [class.mat-warn]=\"isRequired() && !disabled\">\n <div class=\"td-step-label\">\n <ng-content select=\"[td-step-header-label]\"></ng-content>\n </div>\n <div class=\"td-step-sublabel\">\n <ng-content select=\"[td-step-header-sublabel]\"></ng-content>\n </div>\n </div>\n <span class=\"td-step-header-separator\"></span>\n <mat-icon class=\"td-edit-icon\" *ngIf=\"isComplete() && !active && !disabled\">mode_edit</mat-icon>\n</div>", |
| styles: [".td-step-header{position:relative;outline:0;min-width:120px;height:72px;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;max-width:100%}.td-step-header:hover:not(.mat-disabled){cursor:pointer}.td-step-header mat-icon.td-edit-icon{margin:0 8px}.td-step-header mat-icon.mat-warn{font-size:24px;height:24px;width:24px}.td-step-header mat-icon.mat-complete{position:relative;left:-2px;top:2px;font-size:28px;height:24px;width:24px}.td-step-header .td-circle{height:24px;width:24px;line-height:24px;border-radius:99%;text-align:center;-webkit-box-flex:0;-ms-flex:none;flex:none}.td-step-header .td-circle mat-icon{margin-top:2px;font-weight:700}.td-step-header .td-triangle>mat-icon{font-size:25px}::ng-deep :not([dir=rtl]) .td-step-header .td-circle,::ng-deep :not([dir=rtl]) .td-step-header .td-complete,::ng-deep :not([dir=rtl]) .td-step-header .td-triangle{margin-left:8px;margin-right:0}::ng-deep [dir=rtl] .td-step-header .td-circle,::ng-deep [dir=rtl] .td-step-header .td-complete,::ng-deep [dir=rtl] .td-step-header .td-triangle{margin-left:0;margin-right:8px}.td-step-header .td-circle,.td-step-header .td-complete{font-size:14px}.td-step-header .td-step-label-wrapper{padding-left:8px;padding-right:8px}.td-step-header .td-step-header-separator{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box}"] |
| }] } |
| ]; |
| TdStepHeaderComponent.propDecorators = { |
| number: [{ type: Input, args: ['number',] }], |
| active: [{ type: Input, args: ['active',] }], |
| state: [{ type: Input, args: ['state',] }], |
| tabIndex: [{ type: Input, args: ['tabIndex',] }] |
| }; |
| return TdStepHeaderComponent; |
| }(_TdStepHeaderMixinBase)); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| var TdStepBodyComponent = /** @class */ (function () { |
| function TdStepBodyComponent() { |
| /** |
| * state?: StepState or ['none' | 'required' | 'complete'] |
| * Sets styles for state of body. |
| * Defaults to [StepState.None | 'none']. |
| */ |
| this.state = StepState.None; |
| } |
| Object.defineProperty(TdStepBodyComponent.prototype, "hasContent", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this.contentRef && |
| (this.contentRef.nativeElement.children.length > 0 || !!this.contentRef.nativeElement.textContent.trim()); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdStepBodyComponent.prototype, "hasActions", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this.actionsRef && |
| (this.actionsRef.nativeElement.children.length > 0 || !!this.actionsRef.nativeElement.textContent.trim()); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdStepBodyComponent.prototype, "hasSummary", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this.summaryRef && |
| (this.summaryRef.nativeElement.children.length > 0 || !!this.summaryRef.nativeElement.textContent.trim()); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| */ |
| /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| * @return {?} |
| */ |
| TdStepBodyComponent.prototype.isComplete = /** |
| * Returns 'true' if [state] equals to [StepState.Complete | 'complete'], else 'false'. |
| * @return {?} |
| */ |
| function () { |
| return this.state === StepState.Complete; |
| }; |
| TdStepBodyComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: 'td-step-body', |
| template: "<ng-content></ng-content>\n<div class=\"td-step-body\">\n <div class=\"td-step-content-wrapper\"\n [@tdCollapse]=\"!active\">\n <div #contentRef cdkScrollable [class.td-step-content]=\"hasContent\">\n <ng-content select=\"[td-step-body-content]\"></ng-content>\n </div>\n <div #actionsRef\n [class.td-step-actions]=\"hasActions\">\n <ng-content select=\"[td-step-body-actions]\"></ng-content>\n </div>\n </div>\n <div #summaryRef\n [@tdCollapse]=\"active || !isComplete()\"\n [class.td-step-summary]=\"hasSummary\">\n <ng-content select=\"[td-step-body-summary]\"></ng-content>\n </div>\n</div>", |
| animations: [ |
| tdCollapseAnimation, |
| ], |
| styles: [":host{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}:host .td-step-body{overflow-x:hidden;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box}:host .td-step-body .td-step-content-wrapper.ng-animating,:host .td-step-body .td-step-summary.ng-animating{overflow:hidden}:host .td-step-body .td-step-content{overflow-x:auto}:host .td-step-body .td-step-actions{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}"] |
| }] } |
| ]; |
| TdStepBodyComponent.propDecorators = { |
| contentRef: [{ type: ViewChild, args: ['contentRef', { read: ElementRef },] }], |
| actionsRef: [{ type: ViewChild, args: ['actionsRef', { read: ElementRef },] }], |
| summaryRef: [{ type: ViewChild, args: ['summaryRef', { read: ElementRef },] }], |
| active: [{ type: Input, args: ['active',] }], |
| state: [{ type: Input, args: ['state',] }] |
| }; |
| return TdStepBodyComponent; |
| }()); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| var TdNavStepLinkComponent = /** @class */ (function (_super) { |
| __extends(TdNavStepLinkComponent, _super); |
| function TdNavStepLinkComponent(_changeDetectorRef, elementRef) { |
| var _this = _super.call(this) || this; |
| _this._changeDetectorRef = _changeDetectorRef; |
| _this.elementRef = elementRef; |
| _this._active = false; |
| _this._state = StepState.None; |
| return _this; |
| } |
| Object.defineProperty(TdNavStepLinkComponent.prototype, "state", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._state; |
| }, |
| /** |
| * state?: StepState or ['none' | 'required' | 'complete'] |
| * Sets state of component depending on value. |
| * Defaults to [StepState.None | 'none']. |
| */ |
| set: /** |
| * state?: StepState or ['none' | 'required' | 'complete'] |
| * Sets state of component depending on value. |
| * Defaults to [StepState.None | 'none']. |
| * @param {?} state |
| * @return {?} |
| */ |
| function (state) { |
| switch (state) { |
| case StepState.Complete: |
| this._state = StepState.Complete; |
| break; |
| case StepState.Required: |
| this._state = StepState.Required; |
| break; |
| default: |
| this._state = StepState.None; |
| break; |
| } |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(TdNavStepLinkComponent.prototype, "active", { |
| get: /** |
| * @return {?} |
| */ |
| function () { |
| return this._active; |
| }, |
| /** |
| * active?: boolean |
| * Toggles component between active/deactive. |
| */ |
| set: /** |
| * active?: boolean |
| * Toggles component between active/deactive. |
| * @param {?} active |
| * @return {?} |
| */ |
| function (active) { |
| this._active = coerceBooleanProperty(active); |
| this._changeDetectorRef.markForCheck(); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| /** |
| * @param {?} click |
| * @return {?} |
| */ |
| TdNavStepLinkComponent.prototype._handleClick = /** |
| * @param {?} click |
| * @return {?} |
| */ |
| function (click) { |
| if (this.disabled) { |
| click.preventDefault(); |
| click.stopImmediatePropagation(); |
| } |
| }; |
| TdNavStepLinkComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: '[td-step-link],[tdStepLink]', |
| template: "<td-step-header class=\"td-step-header-wrapper\"\n [tabIndex]=\"-1\"\n [number]=\"number\"\n [active]=\"active\"\n [disableRipple]=\"disableRipple || disabled\"\n [disabled]=\"disabled\" \n [state]=\"state\">\n <ng-template td-step-header-label [ngIf]=\"true\">{{label}}</ng-template>\n <ng-template td-step-header-sublabel [ngIf]=\"true\">{{sublabel | truncate:30}}</ng-template>\n <ng-content></ng-content>\n</td-step-header>", |
| inputs: ['disabled', 'disableRipple'], |
| changeDetection: ChangeDetectionStrategy.OnPush, |
| /* tslint:disable-next-line */ |
| host: { |
| '[class.td-step-link]': 'true', |
| '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)', |
| '[attr.disabled]': 'disabled || null', |
| '[class.mat-disabled]': 'disabled || null', |
| '(click)': '_handleClick($event)', |
| }, |
| styles: [":host{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;max-width:100%;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}:host.mat-disabled{pointer-events:none}:host .td-step-header-wrapper{width:100%}"] |
| }] } |
| ]; |
| /** @nocollapse */ |
| TdNavStepLinkComponent.ctorParameters = function () { return [ |
| { type: ChangeDetectorRef }, |
| { type: ElementRef } |
| ]; }; |
| TdNavStepLinkComponent.propDecorators = { |
| state: [{ type: Input, args: ['state',] }], |
| label: [{ type: Input, args: ['label',] }], |
| sublabel: [{ type: Input, args: ['sublabel',] }], |
| active: [{ type: Input, args: ['active',] }], |
| tabIndex: [{ type: Input, args: ['tabIndex',] }] |
| }; |
| return TdNavStepLinkComponent; |
| }(_TdStepMixinBase)); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| var TdNavStepsHorizontalComponent = /** @class */ (function () { |
| function TdNavStepsHorizontalComponent(_elementRef, _viewportRuler, _dir, _renderer, _changeDetectorRef) { |
| this._elementRef = _elementRef; |
| this._viewportRuler = _viewportRuler; |
| this._dir = _dir; |
| this._renderer = _renderer; |
| this._changeDetectorRef = _changeDetectorRef; |
| this._separators = []; |
| /** |
| * Emits when the component is destroyed. |
| */ |
| this._destroyed = new Subject(); |
| this._widthSubject = new Subject(); |
| this._scrollDistance = 0; |
| this._scrollDistanceChanged = false; |
| /** |
| * Whether the controls for pagination should be displayed |
| */ |
| this._showPaginationControls = false; |
| /** |
| * Whether the step list can be scrolled more towards the end. |
| */ |
| this._disableScrollAfter = true; |
| /** |
| * Whether the step list can be scrolled more towards the beginning. |
| */ |
| this._disableScrollBefore = true; |
| } |
| Object.defineProperty(TdNavStepsHorizontalComponent.prototype, "nativeElementWidth", { |
| /* |
| * Current width of the element container |
| */ |
| get: /* |
| * Current width of the element container |
| */ |
| /** |
| * @return {?} |
| */ |
| function () { |
| /** @type {?} */ |
| var element = ((/** @type {?} */ (this._elementRef.nativeElement))); |
| // Need to take into account border, margin and padding that might be around all the crumbs |
| /** @type {?} */ |
| var style = window.getComputedStyle(element); |
| /** @type {?} */ |
| var borderLeft = parseInt(style.borderLeft, 10); |
| /** @type {?} */ |
| var borderRight = parseInt(style.borderRight, 10); |
| /** @type {?} */ |
| var marginLeft = parseInt(style.marginLeft, 10); |
| /** @type {?} */ |
| var marginRight = parseInt(style.marginRight, 10); |
| /** @type {?} */ |
| var paddingLeft = parseInt(style.paddingLeft, 10); |
| /** @type {?} */ |
| var paddingRight = parseInt(style.paddingRight, 10); |
| return element.getBoundingClientRect().width - borderLeft - borderRight - marginLeft - marginRight - paddingLeft - paddingRight; |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| /** |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype.ngAfterContentInit = /** |
| * @return {?} |
| */ |
| function () { |
| var _this = this; |
| merge(this._widthSubject.asObservable().pipe(distinctUntilChanged()), this._viewportRuler.change(150), this._dir ? this._dir.change : of(undefined), this._steps.changes).pipe(takeUntil(this._destroyed)).subscribe(function () { |
| _this._configureSteps(); |
| _this.updatePagination(); |
| _this._changeDetectorRef.markForCheck(); |
| }); |
| this._configureSteps(); |
| this._changeDetectorRef.markForCheck(); |
| }; |
| /** |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype.ngAfterContentChecked = /** |
| * @return {?} |
| */ |
| function () { |
| if (this._elementRef && this._elementRef.nativeElement) { |
| this._widthSubject.next(this.nativeElementWidth); |
| } |
| if (this._scrollDistanceChanged) { |
| this._updateStepScrollPosition(); |
| this._scrollDistanceChanged = false; |
| this._changeDetectorRef.markForCheck(); |
| } |
| }; |
| /** |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype.ngOnDestroy = /** |
| * @return {?} |
| */ |
| function () { |
| this._destroyed.next(); |
| this._destroyed.complete(); |
| }; |
| /** |
| * Listen to right and left key events to move the the viewport. |
| */ |
| /** |
| * Listen to right and left key events to move the the viewport. |
| * @param {?} event |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._handleKeydown = /** |
| * Listen to right and left key events to move the the viewport. |
| * @param {?} event |
| * @return {?} |
| */ |
| function (event) { |
| switch (event.keyCode) { |
| case LEFT_ARROW: |
| this._scrollHeader('before'); |
| event.preventDefault(); |
| break; |
| case RIGHT_ARROW: |
| this._scrollHeader('after'); |
| event.preventDefault(); |
| break; |
| default: |
| // do something |
| } |
| }; |
| /** |
| * Updates the view whether pagination should be enabled or not. |
| */ |
| /** |
| * Updates the view whether pagination should be enabled or not. |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype.updatePagination = /** |
| * Updates the view whether pagination should be enabled or not. |
| * @return {?} |
| */ |
| function () { |
| this._checkPaginationEnabled(); |
| this._checkScrollingControls(); |
| this._updateStepScrollPosition(); |
| }; |
| /** The layout direction of the containing app. */ |
| /** |
| * The layout direction of the containing app. |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._getLayoutDirection = /** |
| * The layout direction of the containing app. |
| * @return {?} |
| */ |
| function () { |
| return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr'; |
| }; |
| /** Performs the CSS transformation on the step list that will cause the list to scroll. */ |
| /** |
| * Performs the CSS transformation on the step list that will cause the list to scroll. |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._updateStepScrollPosition = /** |
| * Performs the CSS transformation on the step list that will cause the list to scroll. |
| * @return {?} |
| */ |
| function () { |
| /** @type {?} */ |
| var translateX = this._getLayoutDirection() === 'ltr' ? -this.scrollDistance : this.scrollDistance; |
| // Move step list the amount of pixels scrolled |
| this._stepList.nativeElement.style.transform = "translateX(" + Math.round(translateX) + "px)"; |
| // Setting the `transform` on IE will change the scroll offset of the parent, causing the |
| // position to be thrown off in some cases. We have to reset it ourselves to ensure that |
| // it doesn't get thrown off. |
| if (this._getLayoutDirection() === 'ltr') { |
| this._stepListContainer.nativeElement.scrollLeft = 0; |
| } |
| else { |
| this._stepListContainer.nativeElement.scrollLeft = this._getMaxScrollDistance(); |
| } |
| }; |
| Object.defineProperty(TdNavStepsHorizontalComponent.prototype, "scrollDistance", { |
| /** Sets the distance in pixels that the step header should be transformed in the X-axis. */ |
| get: /** |
| * Sets the distance in pixels that the step header should be transformed in the X-axis. |
| * @return {?} |
| */ |
| function () { return this._scrollDistance; }, |
| set: /** |
| * @param {?} v |
| * @return {?} |
| */ |
| function (v) { |
| this._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), v)); |
| // Mark that the scroll distance has changed so that after the view is checked, the CSS |
| // transformation can move the header. |
| this._scrollDistanceChanged = true; |
| this._checkScrollingControls(); |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| /** |
| * Moves the step list in the 'before' or 'after' direction (towards the beginning of the list or |
| * the end of the list, respectively). |
| */ |
| /** |
| * Moves the step list in the 'before' or 'after' direction (towards the beginning of the list or |
| * the end of the list, respectively). |
| * @param {?} scrollDir |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._scrollHeader = /** |
| * Moves the step list in the 'before' or 'after' direction (towards the beginning of the list or |
| * the end of the list, respectively). |
| * @param {?} scrollDir |
| * @return {?} |
| */ |
| function (scrollDir) { |
| // Move the scroll distance one-half the length of the step list's viewport. |
| this.scrollDistance += (scrollDir === 'before' ? -1 : 1) * this._stepListContainer.nativeElement.offsetWidth / 2; |
| }; |
| /** |
| * Evaluate whether the pagination controls should be displayed. If the scroll width of the |
| * step list is wider than the size of the header container, then the pagination controls should |
| * be shown. |
| */ |
| /** |
| * Evaluate whether the pagination controls should be displayed. If the scroll width of the |
| * step list is wider than the size of the header container, then the pagination controls should |
| * be shown. |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._checkPaginationEnabled = /** |
| * Evaluate whether the pagination controls should be displayed. If the scroll width of the |
| * step list is wider than the size of the header container, then the pagination controls should |
| * be shown. |
| * @return {?} |
| */ |
| function () { |
| /** @type {?} */ |
| var isEnabled = this._stepList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth; |
| if (!isEnabled) { |
| this.scrollDistance = 0; |
| } |
| if (isEnabled !== this._showPaginationControls) { |
| this._changeDetectorRef.markForCheck(); |
| } |
| this._showPaginationControls = isEnabled; |
| }; |
| /** |
| * Evaluate whether the before and after controls should be enabled or disabled. |
| * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the |
| * before button. If the header is at the end of the list (scroll distance is equal to the |
| * maximum distance we can scroll), then disable the after button. |
| */ |
| /** |
| * Evaluate whether the before and after controls should be enabled or disabled. |
| * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the |
| * before button. If the header is at the end of the list (scroll distance is equal to the |
| * maximum distance we can scroll), then disable the after button. |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._checkScrollingControls = /** |
| * Evaluate whether the before and after controls should be enabled or disabled. |
| * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the |
| * before button. If the header is at the end of the list (scroll distance is equal to the |
| * maximum distance we can scroll), then disable the after button. |
| * @return {?} |
| */ |
| function () { |
| // Check if the pagination arrows should be activated. |
| this._disableScrollBefore = this.scrollDistance === 0; |
| this._disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance(); |
| this._changeDetectorRef.markForCheck(); |
| }; |
| /** |
| * Determines what is the maximum length in pixels that can be set for the scroll distance. This |
| * is equal to the difference in width between the step list container and step header container. |
| */ |
| /** |
| * Determines what is the maximum length in pixels that can be set for the scroll distance. This |
| * is equal to the difference in width between the step list container and step header container. |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._getMaxScrollDistance = /** |
| * Determines what is the maximum length in pixels that can be set for the scroll distance. This |
| * is equal to the difference in width between the step list container and step header container. |
| * @return {?} |
| */ |
| function () { |
| return (this._stepList.nativeElement.scrollWidth - this._stepListContainer.nativeElement.offsetWidth) || 0; |
| }; |
| /** |
| * Set the step line separators and display numbers |
| */ |
| /** |
| * Set the step line separators and display numbers |
| * @return {?} |
| */ |
| TdNavStepsHorizontalComponent.prototype._configureSteps = /** |
| * Set the step line separators and display numbers |
| * @return {?} |
| */ |
| function () { |
| var _this = this; |
| this._separators.forEach(function (separator) { |
| _this._renderer.removeChild(_this._stepList.nativeElement, separator); |
| }); |
| /** @type {?} */ |
| var stepsArray = this._steps.toArray(); |
| // set the index number of the step so can display that number in circle |
| stepsArray.forEach(function (step, index) { |
| if (index > 0 && index < stepsArray.length) { |
| /** @type {?} */ |
| var separator = _this._renderer.createElement('div'); |
| _this._renderer.addClass(separator, 'td-horizontal-line'); |
| _this._separators.push(separator); |
| _this._renderer.insertBefore(_this._stepList.nativeElement, separator, step.elementRef.nativeElement); |
| } |
| step.number = index + 1; |
| }); |
| }; |
| TdNavStepsHorizontalComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: 'nav[td-steps][horizontal]', |
| template: "<div class=\"td-steps-header\">\n <div class=\"td-step-header-pagination td-step-header-pagination-before mat-elevation-z4\"\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore\"\n [class.td-step-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_scrollHeader('before')\">\n <div class=\"td-step-header-pagination-chevron\"></div>\n </div>\n <div #stepListContainer class=\"td-steps-header-container\" (keydown)=\"_handleKeydown($event)\">\n <div #stepList class=\"td-steps-header-list\">\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"td-step-header-pagination td-step-header-pagination-after mat-elevation-z4\"\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter\"\n [class.td-step-header-pagination-disabled]=\"_disableScrollAfter\"\n (click)=\"_scrollHeader('after')\">\n <div class=\"td-step-header-pagination-chevron\"></div>\n </div>\n</div>\n", |
| changeDetection: ChangeDetectionStrategy.OnPush, |
| /* tslint:disable-next-line */ |
| host: { |
| class: 'td-steps td-steps-horizontal', |
| '[class.td-step-header-pagination-controls-enabled]': '_showPaginationControls', |
| '[class.td-step-header-rtl]': "_getLayoutDirection() == 'rtl'", |
| }, |
| styles: [":host{width:100%;display:block}.td-steps-header,.td-steps-header-list{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.td-steps-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;z-index:1}.td-steps-header-list{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;position:relative;-webkit-transition:-webkit-transform .5s cubic-bezier(.35,0,.25,1);transition:transform .5s cubic-bezier(.35,0,.25,1),-webkit-transform .5s cubic-bezier(.35,0,.25,1);-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;max-width:100%;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.td-step-header-pagination{position:relative;display:none;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-width:32px;cursor:pointer;z-index:2}:host.td-step-header-pagination-controls-enabled .td-step-header-pagination{display:-webkit-box;display:-ms-flexbox;display:flex}.td-step-header-pagination-before,:host.td-step-header-rtl .td-step-header-pagination-after{padding-left:4px}.td-step-header-pagination-before .td-step-header-pagination-chevron,:host.td-step-header-rtl .td-step-header-pagination-after .td-step-header-pagination-chevron{-webkit-transform:rotate(-135deg);-ms-transform:rotate(-135deg);transform:rotate(-135deg)}.td-step-header-pagination-after,:host.td-step-header-rtl .td-step-header-pagination-before{padding-right:4px}.td-step-header-pagination-after .td-step-header-pagination-chevron,:host.td-step-header-rtl .td-step-header-pagination-before .td-step-header-pagination-chevron{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.td-step-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:'';height:8px;width:8px}.td-step-header-pagination-disabled{-webkit-box-shadow:none;box-shadow:none;cursor:default}.td-horizontal-line{border-bottom-width:1px;border-bottom-style:solid;height:1px;min-width:20px;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box}"] |
| }] } |
| ]; |
| /** @nocollapse */ |
| TdNavStepsHorizontalComponent.ctorParameters = function () { return [ |
| { type: ElementRef }, |
| { type: ViewportRuler }, |
| { type: Directionality, decorators: [{ type: Optional }] }, |
| { type: Renderer2 }, |
| { type: ChangeDetectorRef } |
| ]; }; |
| TdNavStepsHorizontalComponent.propDecorators = { |
| _steps: [{ type: ContentChildren, args: [TdNavStepLinkComponent,] }], |
| _stepListContainer: [{ type: ViewChild, args: ['stepListContainer',] }], |
| _stepList: [{ type: ViewChild, args: ['stepList',] }] |
| }; |
| return TdNavStepsHorizontalComponent; |
| }()); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| var TdNavStepsVerticalComponent = /** @class */ (function () { |
| function TdNavStepsVerticalComponent(_renderer, _changeDetectorRef) { |
| this._renderer = _renderer; |
| this._changeDetectorRef = _changeDetectorRef; |
| this._separators = []; |
| /** |
| * Emits when the component is destroyed. |
| */ |
| this._destroyed = new Subject(); |
| } |
| /** |
| * @return {?} |
| */ |
| TdNavStepsVerticalComponent.prototype.ngAfterContentInit = /** |
| * @return {?} |
| */ |
| function () { |
| var _this = this; |
| this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe(function () { |
| _this._configureSteps(); |
| _this._changeDetectorRef.markForCheck(); |
| }); |
| this._configureSteps(); |
| this._changeDetectorRef.markForCheck(); |
| }; |
| /** |
| * @return {?} |
| */ |
| TdNavStepsVerticalComponent.prototype.ngOnDestroy = /** |
| * @return {?} |
| */ |
| function () { |
| this._destroyed.next(); |
| this._destroyed.complete(); |
| }; |
| /** |
| * Set the step line separators and display numbers |
| */ |
| /** |
| * Set the step line separators and display numbers |
| * @return {?} |
| */ |
| TdNavStepsVerticalComponent.prototype._configureSteps = /** |
| * Set the step line separators and display numbers |
| * @return {?} |
| */ |
| function () { |
| var _this = this; |
| this._separators.forEach(function (separator) { |
| _this._renderer.removeChild(_this._stepList.nativeElement, separator); |
| }); |
| /** @type {?} */ |
| var stepsArray = this._steps.toArray(); |
| // set the index number of the step so can display that number in circle |
| stepsArray.forEach(function (step, index) { |
| if (index > 0 && index < stepsArray.length) { |
| /** @type {?} */ |
| var separator = _this._renderer.createElement('div'); |
| _this._renderer.addClass(separator, 'td-vertical-line-wrapper'); |
| /** @type {?} */ |
| var separatorChild = _this._renderer.createElement('div'); |
| _this._renderer.addClass(separatorChild, 'td-vertical-line'); |
| _this._renderer.appendChild(separator, separatorChild); |
| _this._separators.push(separator); |
| _this._renderer.insertBefore(_this._stepList.nativeElement, separator, step.elementRef.nativeElement); |
| } |
| step.number = index + 1; |
| }); |
| }; |
| TdNavStepsVerticalComponent.decorators = [ |
| { type: Component, args: [{ |
| selector: 'nav[td-steps][vertical]', |
| template: "<div class=\"td-steps-header\">\n <div class=\"td-steps-header-container\">\n <div #stepList class=\"td-steps-header-list\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n ", |
| changeDetection: ChangeDetectionStrategy.OnPush, |
| /* tslint:disable-next-line */ |
| host: { |
| class: 'td-steps td-steps-vertical', |
| }, |
| styles: [".td-vertical-line-wrapper{position:relative}.td-vertical-line-wrapper .td-vertical-line{position:absolute;top:-16px;height:34px;border-left-width:1px;border-left-style:solid}::ng-deep :not([dir=rtl]) .td-vertical-line-wrapper .td-vertical-line{left:20px;right:auto}::ng-deep [dir=rtl] .td-vertical-line-wrapper .td-vertical-line{left:auto;right:20px}"] |
| }] } |
| ]; |
| /** @nocollapse */ |
| TdNavStepsVerticalComponent.ctorParameters = function () { return [ |
| { type: Renderer2 }, |
| { type: ChangeDetectorRef } |
| ]; }; |
| TdNavStepsVerticalComponent.propDecorators = { |
| _steps: [{ type: ContentChildren, args: [TdNavStepLinkComponent,] }], |
| _stepList: [{ type: ViewChild, args: ['stepList',] }] |
| }; |
| return TdNavStepsVerticalComponent; |
| }()); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| /** @type {?} */ |
| var TD_STEPS = [ |
| TdStepsComponent, |
| TdStepComponent, |
| TdStepHeaderComponent, |
| TdStepBodyComponent, |
| TdStepLabelDirective, |
| TdStepActionsDirective, |
| TdStepSummaryDirective, |
| TdNavStepsHorizontalComponent, |
| TdNavStepsVerticalComponent, |
| TdNavStepLinkComponent, |
| ]; |
| var CovalentStepsModule = /** @class */ (function () { |
| function CovalentStepsModule() { |
| } |
| CovalentStepsModule.decorators = [ |
| { type: NgModule, args: [{ |
| imports: [ |
| CommonModule, |
| MatIconModule, |
| MatRippleModule, |
| PortalModule, |
| ScrollDispatchModule, |
| CovalentCommonModule, |
| ], |
| declarations: [ |
| TD_STEPS, |
| ], |
| exports: [ |
| TD_STEPS, |
| ], |
| },] } |
| ]; |
| return CovalentStepsModule; |
| }()); |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| |
| /** |
| * @fileoverview added by tsickle |
| * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc |
| */ |
| |
| export { CovalentStepsModule, StepState, TdStepLabelDirective, TdStepActionsDirective, TdStepSummaryDirective, TdStepBase, _TdStepMixinBase, TdStepComponent, StepMode, TdStepsComponent, TdStepBodyComponent, TdStepHeaderBase, _TdStepHeaderMixinBase, TdStepHeaderComponent, TdNavStepLinkComponent as ɵb, TdNavStepsHorizontalComponent as ɵa, TdNavStepsVerticalComponent as ɵc }; |
| |
| //# sourceMappingURL=covalent-core-steps.js.map |