1 | import { ElementRef, EventEmitter, Renderer, ModuleWithProviders } from '@angular/core';
|
2 | import { ControlValueAccessor } from '@angular/forms';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export declare const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR: any;
|
8 |
|
9 |
|
10 |
|
11 | export declare enum TransitionCheckState {
|
12 |
|
13 | Init = 0,
|
14 |
|
15 | Checked = 1,
|
16 |
|
17 | Unchecked = 2,
|
18 |
|
19 | Indeterminate = 3,
|
20 | }
|
21 | export declare class MdCheckboxChange {
|
22 | source: MdCheckbox;
|
23 | checked: boolean;
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare class MdCheckbox implements ControlValueAccessor {
|
34 | private _renderer;
|
35 | private _elementRef;
|
36 | |
37 |
|
38 |
|
39 |
|
40 | ariaLabel: string;
|
41 | |
42 |
|
43 |
|
44 | ariaLabelledby: string;
|
45 |
|
46 | id: string;
|
47 |
|
48 | readonly inputId: string;
|
49 |
|
50 | align: 'start' | 'end';
|
51 | |
52 |
|
53 |
|
54 |
|
55 | disabled: boolean;
|
56 | |
57 |
|
58 |
|
59 |
|
60 | tabindex: number;
|
61 |
|
62 | name: string;
|
63 |
|
64 | change: EventEmitter<MdCheckboxChange>;
|
65 |
|
66 | onTouched: () => any;
|
67 | private _currentAnimationClass;
|
68 | private _currentCheckState;
|
69 | private _checked;
|
70 | private _indeterminate;
|
71 | private _controlValueAccessorChangeFn;
|
72 | hasFocus: boolean;
|
73 | constructor(_renderer: Renderer, _elementRef: ElementRef);
|
74 | /**
|
75 | * Whether the checkbox is checked. Note that setting `checked` will immediately set
|
76 | * `indeterminate` to false.
|
77 | */
|
78 | checked: boolean;
|
79 | /**
|
80 | * Whether the checkbox is indeterminate. This is also known as "mixed" mode and can be used to
|
81 | * represent a checkbox with three states, e.g. a checkbox that represents a nested list of
|
82 | * checkable items. Note that whenever `checked` is set, indeterminate is immediately set to
|
83 | * false. This differs from the web platform in that indeterminate state on native
|
84 | * checkboxes is only remove when the user manually checks the checkbox (rather than setting the
|
85 | * `checked` property programmatically). However, we feel that this behavior is more accommodating
|
86 | * to the way consumers would envision using this component.
|
87 | */
|
88 | indeterminate: boolean;
|
89 | /**
|
90 | * Implemented as part of ControlValueAccessor.
|
91 | * TODO: internal
|
92 | */
|
93 | writeValue(value: any): void;
|
94 | /**
|
95 | * Implemented as part of ControlValueAccessor.
|
96 | * TODO: internal
|
97 | */
|
98 | registerOnChange(fn: (value: any) => void): void;
|
99 | /**
|
100 | * Implemented as part of ControlValueAccessor.
|
101 | * TODO: internal
|
102 | */
|
103 | registerOnTouched(fn: any): void;
|
104 | private _transitionCheckState(newState);
|
105 | private _emitChangeEvent();
|
106 | /** Informs the component when the input has focus so that we can style accordingly */
|
107 | _onInputFocus(): void;
|
108 | /** Informs the component when we lose focus in order to style accordingly */
|
109 | _onInputBlur(): void;
|
110 | /**
|
111 | * Toggles the `checked` value between true and false
|
112 | */
|
113 | toggle(): void;
|
114 | /**
|
115 | * Event handler for checkbox input element.
|
116 | * Toggles checked state if element is not disabled.
|
117 | * @param event
|
118 | */
|
119 | _onInteractionEvent(event: Event): void;
|
120 | _onInputClick(event: Event): void;
|
121 | private _getAnimationClassForCheckStateTransition(oldState, newState);
|
122 | }
|
123 | export declare class MdCheckboxModule {
|
124 | static forRoot(): ModuleWithProviders;
|
125 | }
|