Skip to content

feat(material-experimental/mdc-slider): add skeleton code for MDCSliderFoundation #21645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions src/material-experimental/mdc-slider/slider-adapter.ts
Original file line number Diff line number Diff line change
@@ -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<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
deregisterEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
registerThumbEventHandler<K extends EventType>
(thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
deregisterThumbEventHandler<K extends EventType>
(thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
registerInputEventHandler<K extends EventType>
(thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
deregisterInputEventHandler<K extends EventType>
(thumb: Thumb, evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
registerBodyEventHandler<K extends EventType>
(evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
deregisterBodyEventHandler<K extends EventType>
(evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
registerWindowEventHandler<K extends EventType>
(evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
deregisterWindowEventHandler<K extends EventType>
(evtType: K, handler: SpecificEventListener<K>): void {
throw Error('Method not implemented.');
}
}
20 changes: 18 additions & 2 deletions src/material-experimental/mdc-slider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@
* 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 `<input type="range">` element.
*/
@Component({
selector: 'mat-slider',
templateUrl: 'slider.html',
styleUrls: ['slider.css'],
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());
}