Skip to main content

Class: TouchSlider<S, P>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:161

A touchscreen slider.

Extends​

Type Parameters​

Type ParameterDefault type
S extends Subscribable<number> | MutableSubscribable<number>-
P extends TouchSliderProps<S>TouchSliderProps<S>

Constructors​

Constructor​

new TouchSlider<S, P>(props): TouchSlider<S, P>

Defined in: src/sdk/components/FSComponent.ts:76

Creates an instance of a DisplayComponent.

Parameters​

ParameterTypeDescription
propsPThe propertis of the component.

Returns​

TouchSlider<S, P>

Inherited from​

DisplayComponent.constructor

Properties​

context?​

optional context: [] = undefined

Defined in: src/sdk/components/FSComponent.ts:67

The context on this component, if any.

Inherited from​

DisplayComponent.context


contextType?​

readonly optional contextType: readonly [] = undefined

Defined in: src/sdk/components/FSComponent.ts:70

The type of context for this component, if any.

Inherited from​

DisplayComponent.contextType


crossAxisIndex​

protected readonly crossAxisIndex: number

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:180


cssClassSub?​

protected optional cssClassSub: Subscription

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:258


currentMousePosition​

protected readonly currentMousePosition: Float64Array<ArrayBufferLike>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:250


draggedValue​

protected draggedValue: number = 0

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:246


dragInhibitThresholdPx​

protected readonly dragInhibitThresholdPx: number

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:256


dragLockFocusThresholdPx​

protected readonly dragLockFocusThresholdPx: number

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:254


focusOnDrag​

protected readonly focusOnDrag: boolean

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:252


inhibitOnDrag​

protected readonly inhibitOnDrag: boolean

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:255


isEnabled​

protected readonly isEnabled: Subscribable<boolean> | Subscribable<false> | Subscribable<true>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:236


isEnabledSub?​

protected optional isEnabledSub: Subscription

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:259


isPrimed​

protected isPrimed: boolean = false

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:239


isVisible​

protected readonly isVisible: Subscribable<boolean> | Subscribable<false> | Subscribable<true>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:237


isVisibleSub?​

protected optional isVisibleSub: Subscription

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:260


lockFocusOnDrag​

protected readonly lockFocusOnDrag: boolean

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:253


mainAxisIndex​

protected readonly mainAxisIndex: 0 | 1

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:179


mainAxisSign​

protected readonly mainAxisSign: -1 | 1

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:182


mouseDownPosition​

protected readonly mouseDownPosition: Float64Array<ArrayBufferLike>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:248


mouseDownValue​

protected mouseDownValue: number = 0

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:245


props​

props: P & ComponentProps

Defined in: src/sdk/components/FSComponent.ts:64

The properties of the component.

Inherited from​

DisplayComponent.props


referenceMousePosition​

protected readonly referenceMousePosition: Float64Array<ArrayBufferLike>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:249


rootCssClass​

protected readonly rootCssClass: SetSubject<string>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:230


sliderContainerRef​

protected readonly sliderContainerRef: NodeReference<HTMLDivElement>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:184


sliderForegroundClipPathFunc()​

protected readonly sliderForegroundClipPathFunc: (value) => string

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:194

Parameters​

ParameterType
valuenumber

Returns​

string


sliderForegroundStyle​

protected readonly sliderForegroundStyle: ObjectSubject<{ -webkit-clip-path: string; }>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:222


sliderLength​

protected sliderLength: number = 0

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:243


sliderThumbRef​

protected readonly sliderThumbRef: NodeReference<HTMLDivElement>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:186


sliderThumbStyle​

protected readonly sliderThumbStyle: ObjectSubject<{ transform: string; }>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:226


sliderThumbTranslateFunc()​

protected readonly sliderThumbTranslateFunc: (value) => string

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:214

Parameters​

ParameterType
valuenumber

Returns​

string


snapAnimationEasing()​

protected readonly snapAnimationEasing: (start, stop, progress) => number

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:189

Parameters​

ParameterType
startnumber
stopnumber
progressnumber

Returns​

number


snapAnimationSpeed​

protected readonly snapAnimationSpeed: Subscribable<number>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:188


stateSub?​

protected optional stateSub: Subscription

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:261


stops​

protected readonly stops: Subscribable<readonly number[]>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:241


thumbLength​

protected thumbLength: number = 0

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:244


touchPadRef​

protected readonly touchPadRef: NodeReference<TouchPad<TouchPadProps>>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:185


valueAnimator​

protected readonly valueAnimator: Animator

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:190


DEFAULT_SNAP_ANIMATION_EASING()​

protected readonly static DEFAULT_SNAP_ANIMATION_EASING: (start, stop, progress) => number

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:164

Parameters​

ParameterType
startnumber
stopnumber
progressnumber

Returns​

number


RESERVED_CSS_CLASSES​

protected readonly static RESERVED_CSS_CLASSES: Set<string>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:166

Methods​

destroy()​

destroy(): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:488

Destroys this component.

Returns​

void

Overrides​

DisplayComponent.destroy


findClosestStop()​

protected findClosestStop(value): number

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:408

Finds the stop closest to a given value. If this slider has no defined stops, this method will return the query value as-is.

Parameters​

ParameterTypeDescription
valuenumberThe query value.

Returns​

number

The stop closest to the specified value, or the specified value if this slider has no defined stops.


getContext()​

protected getContext(context): never

Defined in: src/sdk/components/FSComponent.ts:109

Gets a context data subscription from the context collection.

Parameters​

ParameterTypeDescription
contextneverThe context to get the subscription for.

Returns​

never

The requested context.

Throws​

An error if no data for the specified context type could be found.

Inherited from​

DisplayComponent.getContext


getReservedCssClasses()​

protected getReservedCssClasses(): ReadonlySet<string>

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:483

Gets the CSS classes that are reserved for this slider's root element.

Returns​

ReadonlySet<string>

The CSS classes that are reserved for this slider's root element.


onAfterRender()​

onAfterRender(node): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:265

A callback that is called after the component is rendered.

Parameters​

ParameterTypeDescription
nodeVNodeThe component's VNode.

Returns​

void

Overrides​

DisplayComponent.onAfterRender


onBeforeRender()​

onBeforeRender(): void

Defined in: src/sdk/components/FSComponent.ts:83

A callback that is called before the component is rendered.

Returns​

void

Inherited from​

DisplayComponent.onBeforeRender


onDragEnded()​

protected onDragEnded(position, initialPosition): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:357

Responds to when a mouse drag is released on this slider.

Parameters​

ParameterTypeDescription
positionReadonlyFloat64ArrayThe current position of the mouse.
initialPositionReadonlyFloat64ArrayThe position of the mouse at the start of the drag motion.

Returns​

void


onDragMoved()​

protected onDragMoved(position, prevPosition, initialPosition): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:335

Responds to when this slider is dragged.

Parameters​

ParameterTypeDescription
positionReadonlyFloat64ArrayThe current mouse position.
prevPositionReadonlyFloat64ArrayThe position of the mouse at the previous update.
initialPositionReadonlyFloat64ArrayThe position of the mouse at the start of the current drag motion.

Returns​

void


onDragStarted()​

protected onDragStarted(position): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:315

Responds to when a mouse drag is started on this slider.

Parameters​

ParameterTypeDescription
positionReadonlyFloat64ArrayThe current mouse position.

Returns​

void


onValueChangedFromInput()​

protected onValueChangedFromInput(value): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:394

Responds to when this slider's value changes from user input.

Parameters​

ParameterTypeDescription
valuenumberThe new slider value.

Returns​

void


render()​

render(): VNode

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:436

Renders the component.

Returns​

VNode

A JSX element to be rendered.

Overrides​

DisplayComponent.render


setDisplayedValue()​

protected setDisplayedValue(value, animate): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:424

Sets this slider's displayed value.

Parameters​

ParameterTypeDescription
valuenumberThe value to set.
animatebooleanWhether to animate the change.

Returns​

void


setPrimed()​

protected setPrimed(isPrimed): void

Defined in: src/garminsdk/components/touchslider/TouchSlider.tsx:301

Sets the primed state of this slider.

Parameters​

ParameterTypeDescription
isPrimedbooleanThe new primed state.

Returns​

void