diff --git a/src/material-experimental/mdc-slider/slider-adapter.ts b/src/material-experimental/mdc-slider/slider-adapter.ts new file mode 100644 index 000000000000..a3144d73f0d6 --- /dev/null +++ b/src/material-experimental/mdc-slider/slider-adapter.ts @@ -0,0 +1,138 @@ +/** + * @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 {SpecificEventListener, EventType} from '@material/base'; +import {MDCSliderAdapter, Thumb, TickMark} from '@material/slider'; + +export class SliderAdapter implements MDCSliderAdapter { + hasClass(className: string): boolean { + throw Error('Method not implemented.'); + } + addClass(className: string): void { + throw Error('Method not implemented.'); + } + removeClass(className: string): void { + throw Error('Method not implemented.'); + } + getAttribute(attribute: string): string | null { + throw Error('Method not implemented.'); + } + addThumbClass(className: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + removeThumbClass(className: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + getInputValue(thumb: Thumb): string { + throw Error('Method not implemented.'); + } + setInputValue(value: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + getInputAttribute(attribute: string, thumb: Thumb): string | null { + throw Error('Method not implemented.'); + } + setInputAttribute(attribute: string, value: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + removeInputAttribute(attribute: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + focusInput(thumb: Thumb): void { + throw Error('Method not implemented.'); + } + isInputFocused(thumb: Thumb): boolean { + throw Error('Method not implemented.'); + } + getThumbKnobWidth(thumb: Thumb): number { + throw Error('Method not implemented.'); + } + getThumbBoundingClientRect(thumb: Thumb): ClientRect { + throw Error('Method not implemented.'); + } + getBoundingClientRect(): ClientRect { + throw Error('Method not implemented.'); + } + isRTL(): boolean { + throw Error('Method not implemented.'); + } + setThumbStyleProperty(propertyName: string, value: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + removeThumbStyleProperty(propertyName: string, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + setTrackActiveStyleProperty(propertyName: string, value: string): void { + throw Error('Method not implemented.'); + } + removeTrackActiveStyleProperty(propertyName: string): void { + throw Error('Method not implemented.'); + } + setValueIndicatorText(value: number, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + getValueToAriaValueTextFn(): ((value: number) => string) | null { + throw Error('Method not implemented.'); + } + updateTickMarks(tickMarks: TickMark[]): void { + throw Error('Method not implemented.'); + } + setPointerCapture(pointerId: number): void { + throw Error('Method not implemented.'); + } + emitChangeEvent(value: number, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + emitInputEvent(value: number, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + emitDragStartEvent(value: number, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + emitDragEndEvent(value: number, thumb: Thumb): void { + throw Error('Method not implemented.'); + } + registerEventHandler(evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + deregisterEventHandler(evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + registerThumbEventHandler + (thumb: Thumb, evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + deregisterThumbEventHandler + (thumb: Thumb, evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + registerInputEventHandler + (thumb: Thumb, evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + deregisterInputEventHandler + (thumb: Thumb, evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + registerBodyEventHandler + (evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + deregisterBodyEventHandler + (evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + registerWindowEventHandler + (evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } + deregisterWindowEventHandler + (evtType: K, handler: SpecificEventListener): void { + throw Error('Method not implemented.'); + } +} diff --git a/src/material-experimental/mdc-slider/slider.ts b/src/material-experimental/mdc-slider/slider.ts index 9b457e7172d7..b82a61f60447 100644 --- a/src/material-experimental/mdc-slider/slider.ts +++ b/src/material-experimental/mdc-slider/slider.ts @@ -6,8 +6,18 @@ * found in the LICENSE file at https://angular.io/license */ -import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + ViewEncapsulation, +} from '@angular/core'; +import {MDCSliderFoundation} from '@material/slider'; +import {SliderAdapter} from './slider-adapter'; +/** + * Allows users to select from a range of values by moving the slider thumb. It is similar in + * behavior to the native `` element. + */ @Component({ selector: 'mat-slider', templateUrl: 'slider.html', @@ -15,4 +25,10 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, }) -export class MatSlider {} +export class MatSlider { + + /** Instance of the MDC slider foundation for this slider. */ + + // tslint:disable-next-line:no-unused-variable + private _foundation = new MDCSliderFoundation(new SliderAdapter()); +}