Skip to content

Commit 33cc33c

Browse files
committed
feat(material-experimental/mdc-slider): add skeleton code for
MatSliderAdapter * add method stubs for MDCSliderAdapter implementation * add MDCSliderFoundation class variable to MatSlider
1 parent 3e7ff8a commit 33cc33c

File tree

1 file changed

+152
-2
lines changed
  • src/material-experimental/mdc-slider

1 file changed

+152
-2
lines changed

src/material-experimental/mdc-slider/slider.ts

Lines changed: 152 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,163 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
9+
import {
10+
ChangeDetectionStrategy,
11+
Component,
12+
ViewEncapsulation,
13+
} from '@angular/core';
14+
import {SpecificEventListener, EventType} from '@material/base';
15+
import {
16+
MDCSliderAdapter,
17+
MDCSliderFoundation,
18+
Thumb,
19+
TickMark,
20+
} from '@material/slider';
1021

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

0 commit comments

Comments
 (0)