UNPKG

@scania/tegel

Version:
101 lines (100 loc) 3.54 kB
import { EventEmitter } from '../../stencil-public-runtime'; export declare class TdsSlider { host: HTMLElement; /** Text for label */ label: string; /** Initial value */ value: string; /** Minimum value */ min: string; /** Maximum value */ max: string; /** Number of tick markers (tick for min- and max-value will be added automatically) */ ticks: string; /** Decide to show numbers above the tick markers or not */ showTickNumbers: boolean; /** Decide to show the tooltip or not */ tooltip: boolean; /** Sets the disabled state for the whole component */ disabled: boolean; /** Sets the read only state for the whole component */ readOnly: boolean; /** Decide to show the controls or not */ controls: boolean; /** Decide to show the input field or not */ input: boolean; /** Defines how much to increment/decrement the value when using controls */ step: string; /** Name property (will be inherited by the native slider component) */ name: string; /** Sets the size of the thumb */ thumbSize: 'sm' | 'lg'; /** Snap to the tick's grid */ snap: boolean; /** Sets the aria-label for the slider control. */ tdsAriaLabel: string; /** ID for the Slider's input element, randomly generated if not specified. */ sliderId: string; /** Sets the read only aria label for the input field */ tdsReadOnlyAriaLabel: string; private wrapperElement; private thumbElement; private thumbInnerElement; private trackElement; private trackFillElement; private thumbGrabbed; private thumbLeft; private tickValues; private useControls; private useInput; private useSmall; private useSnapping; private supposedValueSlot; private resizeObserverAdded; private initialValue; private resetEventListenerAdded; private formElement; private ariaLiveElement; private roundToStep; /** Sends the value of the slider when changed. Fires after mouse up and touch end events. */ tdsChange: EventEmitter<{ value: string; }>; /** Sends the value of the slider while moving the thumb. Fires on mouse move and touch move events. */ tdsInput: EventEmitter<{ value: string; }>; /** Public method to re-initialise the slider if some configuration props are changed */ reset(): Promise<void>; handleKeydown(event: any): void; handleRelease(event: MouseEvent | TouchEvent): void; handleMove(event: MouseEvent | TouchEvent): void; handleValueUpdate(newValue: string): void; private setToMinValue; private setToMaxValue; private updateSupposedValueSlot; private thumbCore; private updateTrack; private announcementDebounceTimeout; private announceValueChange; private updateValue; private forceValueUpdate; private constrainThumb; private getTrackWidth; private calculateThumbLeftFromValue; /** Updates the slider value based on the current input value */ private updateSliderValueOnInputChange; /** Updates the slider value based on the current input value when enter is pressed */ private handleInputFieldEnterPress; private grabThumb; private calculateInputSizeFromMax; private controlsStep; private stepLeft; private stepRight; private resetToInitialValue; componentWillLoad(): void; componentDidLoad(): void; componentDidRender(): void; connectedCallback(): void; render(): any; }