/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Directive, HostListener, Input } from '@angular/core'; import { CdkStepper } from './stepper'; /** Button that moves to the next step in a stepper workflow. */ export class CdkStepperNext { constructor(_stepper) { this._stepper = _stepper; /** Type of the next button. Defaults to "submit" if not specified. */ this.type = 'submit'; } // We have to use a `HostListener` here in order to support both Ivy and ViewEngine. // In Ivy the `host` bindings will be merged when this class is extended, whereas in // ViewEngine they're overwritten. // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default. // tslint:disable-next-line:no-host-decorator-in-concrete _handleClick() { this._stepper.next(); } } CdkStepperNext.decorators = [ { type: Directive, args: [{ selector: 'button[cdkStepperNext]', host: { '[type]': 'type', } },] } ]; CdkStepperNext.ctorParameters = () => [ { type: CdkStepper } ]; CdkStepperNext.propDecorators = { type: [{ type: Input }], _handleClick: [{ type: HostListener, args: ['click',] }] }; /** Button that moves to the previous step in a stepper workflow. */ export class CdkStepperPrevious { constructor(_stepper) { this._stepper = _stepper; /** Type of the previous button. Defaults to "button" if not specified. */ this.type = 'button'; } // We have to use a `HostListener` here in order to support both Ivy and ViewEngine. // In Ivy the `host` bindings will be merged when this class is extended, whereas in // ViewEngine they're overwritten. // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default. // tslint:disable-next-line:no-host-decorator-in-concrete _handleClick() { this._stepper.previous(); } } CdkStepperPrevious.decorators = [ { type: Directive, args: [{ selector: 'button[cdkStepperPrevious]', host: { '[type]': 'type', } },] } ]; CdkStepperPrevious.ctorParameters = () => [ { type: CdkStepper } ]; CdkStepperPrevious.propDecorators = { type: [{ type: Input }], _handleClick: [{ type: HostListener, args: ['click',] }] }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RlcHBlci1idXR0b24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2Rr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