|
6 | 6 | * found in the LICENSE file at https://angular.io/license
|
7 | 7 | */
|
8 | 8 |
|
9 |
| -import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; |
| 9 | +import { |
| 10 | + AfterViewInit, |
| 11 | + ChangeDetectionStrategy, |
| 12 | + Component, |
| 13 | + OnDestroy, |
| 14 | + ViewEncapsulation, |
| 15 | +} from '@angular/core'; |
| 16 | +import {SpecificEventListener, EventType} from '@material/base'; |
| 17 | +import { |
| 18 | + MDCSliderAdapter, |
| 19 | + MDCSliderFoundation, |
| 20 | + Thumb, |
| 21 | + TickMark, |
| 22 | +} from '@material/slider'; |
10 | 23 |
|
| 24 | +/** |
| 25 | + * Allows users to select from a range of values by moving the slider thumb. It is similar in |
| 26 | + * behavior to the native `<input type="range">` element. |
| 27 | + */ |
11 | 28 | @Component({
|
12 | 29 | selector: 'mat-slider',
|
13 | 30 | templateUrl: 'slider.html',
|
14 | 31 | styleUrls: ['slider.css'],
|
15 | 32 | changeDetection: ChangeDetectionStrategy.OnPush,
|
16 | 33 | encapsulation: ViewEncapsulation.None,
|
17 | 34 | })
|
18 |
| -export class MatSlider {} |
| 35 | +export class MatSlider { |
| 36 | + /** Instance of the MDC slider foundation for this slider. */ |
| 37 | + private _foundation = new MDCSliderFoundation(new SliderAdapter()); |
| 38 | +} |
| 39 | + |
| 40 | +class SliderAdapter implements MDCSliderAdapter { |
| 41 | + constructor() {} |
| 42 | + hasClass(className: string): boolean { |
| 43 | + throw new Error('Method not implemented.'); |
| 44 | + } |
| 45 | + addClass(className: string): void { |
| 46 | + throw new Error('Method not implemented.'); |
| 47 | + } |
| 48 | + removeClass(className: string): void { |
| 49 | + throw new Error('Method not implemented.'); |
| 50 | + } |
| 51 | + getAttribute(attribute: string): string | null { |
| 52 | + throw new Error('Method not implemented.'); |
| 53 | + } |
| 54 | + addThumbClass(className: string, thumb: Thumb): void { |
| 55 | + throw new Error('Method not implemented.'); |
| 56 | + } |
| 57 | + removeThumbClass(className: string, thumb: Thumb): void { |
| 58 | + throw new Error('Method not implemented.'); |
| 59 | + } |
| 60 | + getInputValue(thumb: Thumb): string { |
| 61 | + throw new Error('Method not implemented.'); |
| 62 | + } |
| 63 | + setInputValue(value: string, thumb: Thumb): void { |
| 64 | + throw new Error('Method not implemented.'); |
| 65 | + } |
| 66 | + getInputAttribute(attribute: string, thumb: Thumb): string | null { |
| 67 | + throw new Error('Method not implemented.'); |
| 68 | + } |
| 69 | + setInputAttribute(attribute: string, value: string, thumb: Thumb): void { |
| 70 | + throw new Error('Method not implemented.'); |
| 71 | + } |
| 72 | + removeInputAttribute(attribute: string, thumb: Thumb): void { |
| 73 | + throw new Error('Method not implemented.'); |
| 74 | + } |
| 75 | + focusInput(thumb: Thumb): void { |
| 76 | + throw new Error('Method not implemented.'); |
| 77 | + } |
| 78 | + isInputFocused(thumb: Thumb): boolean { |
| 79 | + throw new Error('Method not implemented.'); |
| 80 | + } |
| 81 | + getThumbKnobWidth(thumb: Thumb): number { |
| 82 | + throw new Error('Method not implemented.'); |
| 83 | + } |
| 84 | + getThumbBoundingClientRect(thumb: Thumb): ClientRect { |
| 85 | + throw new Error('Method not implemented.'); |
| 86 | + } |
| 87 | + getBoundingClientRect(): ClientRect { |
| 88 | + throw new Error('Method not implemented.'); |
| 89 | + } |
| 90 | + isRTL(): boolean { |
| 91 | + throw new Error('Method not implemented.'); |
| 92 | + } |
| 93 | + setThumbStyleProperty(propertyName: string, value: string, thumb: Thumb): void { |
| 94 | + throw new Error('Method not implemented.'); |
| 95 | + } |
| 96 | + removeThumbStyleProperty(propertyName: string, thumb: Thumb): void { |
| 97 | + throw new Error('Method not implemented.'); |
| 98 | + } |
| 99 | + setTrackActiveStyleProperty(propertyName: string, value: string): void { |
| 100 | + throw new Error('Method not implemented.'); |
| 101 | + } |
| 102 | + removeTrackActiveStyleProperty(propertyName: string): void { |
| 103 | + throw new Error('Method not implemented.'); |
| 104 | + } |
| 105 | + setValueIndicatorText(value: number, thumb: Thumb): void { |
| 106 | + throw new Error('Method not implemented.'); |
| 107 | + } |
| 108 | + getValueToAriaValueTextFn(): ((value: number) => string) | null { |
| 109 | + throw new Error('Method not implemented.'); |
| 110 | + } |
| 111 | + updateTickMarks(tickMarks: TickMark[]): void { |
| 112 | + throw new Error('Method not implemented.'); |
| 113 | + } |
| 114 | + setPointerCapture(pointerId: number): void { |
| 115 | + throw new Error('Method not implemented.'); |
| 116 | + } |
| 117 | + emitChangeEvent(value: number, thumb: Thumb): void { |
| 118 | + throw new Error('Method not implemented.'); |
| 119 | + } |
| 120 | + emitInputEvent(value: number, thumb: Thumb): void { |
| 121 | + throw new Error('Method not implemented.'); |
| 122 | + } |
| 123 | + emitDragStartEvent(value: number, thumb: Thumb): void { |
| 124 | + throw new Error('Method not implemented.'); |
| 125 | + } |
| 126 | + emitDragEndEvent(value: number, thumb: Thumb): void { |
| 127 | + throw new Error('Method not implemented.'); |
| 128 | + } |
| 129 | + registerEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void { |
| 130 | + throw new Error('Method not implemented.'); |
| 131 | + } |
| 132 | + deregisterEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void { |
| 133 | + throw new Error('Method not implemented.'); |
| 134 | + } |
| 135 | + registerThumbEventHandler<K extends EventType> |
| 136 | + (thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void { |
| 137 | + throw new Error('Method not implemented.'); |
| 138 | + } |
| 139 | + deregisterThumbEventHandler<K extends EventType> |
| 140 | + (thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void { |
| 141 | + throw new Error('Method not implemented.'); |
| 142 | + } |
| 143 | + registerInputEventHandler<K extends EventType> |
| 144 | + (thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void { |
| 145 | + throw new Error('Method not implemented.'); |
| 146 | + } |
| 147 | + deregisterInputEventHandler<K extends EventType> |
| 148 | + (thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void { |
| 149 | + throw new Error('Method not implemented.'); |
| 150 | + } |
| 151 | + registerBodyEventHandler<K extends EventType> |
| 152 | + (evtType: K, handler: SpecificEventListener<K>): void { |
| 153 | + throw new Error('Method not implemented.'); |
| 154 | + } |
| 155 | + deregisterBodyEventHandler<K extends EventType> |
| 156 | + (evtType: K, handler: SpecificEventListener<K>): void { |
| 157 | + throw new Error('Method not implemented.'); |
| 158 | + } |
| 159 | + registerWindowEventHandler<K extends EventType> |
| 160 | + (evtType: K, handler: SpecificEventListener<K>): void { |
| 161 | + throw new Error('Method not implemented.'); |
| 162 | + } |
| 163 | + deregisterWindowEventHandler<K extends EventType> |
| 164 | + (evtType: K, handler: SpecificEventListener<K>): void { |
| 165 | + throw new Error('Method not implemented.'); |
| 166 | + } |
| 167 | +} |
0 commit comments