1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { Directive, HostListener, Input } from '@angular/core';
|
---|
9 | import { CdkStepper } from './stepper';
|
---|
10 | /** Button that moves to the next step in a stepper workflow. */
|
---|
11 | export class CdkStepperNext {
|
---|
12 | constructor(_stepper) {
|
---|
13 | this._stepper = _stepper;
|
---|
14 | /** Type of the next button. Defaults to "submit" if not specified. */
|
---|
15 | this.type = 'submit';
|
---|
16 | }
|
---|
17 | // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
---|
18 | // In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
---|
19 | // ViewEngine they're overwritten.
|
---|
20 | // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
---|
21 | // tslint:disable-next-line:no-host-decorator-in-concrete
|
---|
22 | _handleClick() {
|
---|
23 | this._stepper.next();
|
---|
24 | }
|
---|
25 | }
|
---|
26 | CdkStepperNext.decorators = [
|
---|
27 | { type: Directive, args: [{
|
---|
28 | selector: 'button[cdkStepperNext]',
|
---|
29 | host: {
|
---|
30 | '[type]': 'type',
|
---|
31 | }
|
---|
32 | },] }
|
---|
33 | ];
|
---|
34 | CdkStepperNext.ctorParameters = () => [
|
---|
35 | { type: CdkStepper }
|
---|
36 | ];
|
---|
37 | CdkStepperNext.propDecorators = {
|
---|
38 | type: [{ type: Input }],
|
---|
39 | _handleClick: [{ type: HostListener, args: ['click',] }]
|
---|
40 | };
|
---|
41 | /** Button that moves to the previous step in a stepper workflow. */
|
---|
42 | export class CdkStepperPrevious {
|
---|
43 | constructor(_stepper) {
|
---|
44 | this._stepper = _stepper;
|
---|
45 | /** Type of the previous button. Defaults to "button" if not specified. */
|
---|
46 | this.type = 'button';
|
---|
47 | }
|
---|
48 | // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
---|
49 | // In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
---|
50 | // ViewEngine they're overwritten.
|
---|
51 | // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
---|
52 | // tslint:disable-next-line:no-host-decorator-in-concrete
|
---|
53 | _handleClick() {
|
---|
54 | this._stepper.previous();
|
---|
55 | }
|
---|
56 | }
|
---|
57 | CdkStepperPrevious.decorators = [
|
---|
58 | { type: Directive, args: [{
|
---|
59 | selector: 'button[cdkStepperPrevious]',
|
---|
60 | host: {
|
---|
61 | '[type]': 'type',
|
---|
62 | }
|
---|
63 | },] }
|
---|
64 | ];
|
---|
65 | CdkStepperPrevious.ctorParameters = () => [
|
---|
66 | { type: CdkStepper }
|
---|
67 | ];
|
---|
68 | CdkStepperPrevious.propDecorators = {
|
---|
69 | type: [{ type: Input }],
|
---|
70 | _handleClick: [{ type: HostListener, args: ['click',] }]
|
---|
71 | };
|
---|
72 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RlcHBlci1idXR0b24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2RrL3N0ZXBwZXIvc3RlcHBlci1idXR0b24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRTdELE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxXQUFXLENBQUM7QUFFckMsZ0VBQWdFO0FBT2hFLE1BQU0sT0FBTyxjQUFjO0lBSXpCLFlBQW1CLFFBQW9CO1FBQXBCLGFBQVEsR0FBUixRQUFRLENBQVk7UUFIdkMsc0VBQXNFO1FBQzdELFNBQUksR0FBVyxRQUFRLENBQUM7SUFFUyxDQUFDO0lBRTNDLG9GQUFvRjtJQUNwR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