Skip to main content

Class: TouchSlider<S, P>

A touchscreen slider.

Type parameters

NameType
Sextends Subscribable<number> | MutableSubscribable<number>
Pextends TouchSliderProps<S> = TouchSliderProps<S>

Hierarchy

  • DisplayComponent<P>

    TouchSlider

Constructors

constructor

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

Creates an instance of a DisplayComponent.

Type parameters

NameType
Sextends Subscribable<number> | MutableSubscribable<number, number>
Pextends TouchSliderProps<S> = TouchSliderProps<S>

Parameters

NameTypeDescription
propsPThe propertis of the component.

Returns

TouchSlider<S, P>

Inherited from

DisplayComponent<P>.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

DisplayComponent.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Defined in

src/sdk/components/FSComponent.ts:67


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

Defined in

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


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


draggedValue

Protected draggedValue: number = 0

Defined in

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


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

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

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61


referenceMousePosition

Protected Readonly referenceMousePosition: Float64Array

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: number) => string

Type declaration

▸ (value): string

Parameters
NameType
valuenumber
Returns

string

Defined in

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


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: number) => string

Type declaration

▸ (value): string

Parameters
NameType
valuenumber
Returns

string

Defined in

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


snapAnimationEasing

Protected Readonly snapAnimationEasing: (start: number, stop: number, progress: number) => number

Type declaration

▸ (start, stop, progress): number

Parameters
NameType
startnumber
stopnumber
progressnumber
Returns

number

Defined in

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


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

Static Protected Readonly DEFAULT_SNAP_ANIMATION_EASING: (start: number, stop: number, progress: number) => number

Type declaration

▸ (start, stop, progress): number

Parameters
NameType
startnumber
stopnumber
progressnumber
Returns

number

Defined in

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


RESERVED_CSS_CLASSES

Static Protected Readonly RESERVED_CSS_CLASSES: Set<string>

Defined in

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

Methods

destroy

destroy(): void

Returns

void

Inherit Doc

Overrides

DisplayComponent.destroy

Defined in

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


findClosestStop

findClosestStop(value): number

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

NameTypeDescription
valuenumberThe query value.

Returns

number

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

Defined in

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


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
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

Defined in

src/sdk/components/FSComponent.ts:106


getReservedCssClasses

getReservedCssClasses(): ReadonlySet<string>

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.

Defined in

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


onAfterRender

onAfterRender(node): void

Parameters

NameType
nodeVNode

Returns

void

Inherit Doc

Overrides

DisplayComponent.onAfterRender

Defined in

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


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


onDragEnded

onDragEnded(position, initialPosition): void

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

Parameters

NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current position of the mouse.
initialPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the start of the drag motion.

Returns

void

Defined in

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


onDragMoved

onDragMoved(position, prevPosition, initialPosition): void

Responds to when this slider is dragged.

Parameters

NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current mouse position.
prevPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the previous update.
initialPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the start of the current drag motion.

Returns

void

Defined in

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


onDragStarted

onDragStarted(position): void

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

Parameters

NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current mouse position.

Returns

void

Defined in

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


onValueChangedFromInput

onValueChangedFromInput(value): void

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

Parameters

NameTypeDescription
valuenumberThe new slider value.

Returns

void

Defined in

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


render

render(): VNode

Returns

VNode

Inherit Doc

Overrides

DisplayComponent.render

Defined in

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


setDisplayedValue

setDisplayedValue(value, animate): void

Sets this slider's displayed value.

Parameters

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

Returns

void

Defined in

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


setPrimed

setPrimed(isPrimed): void

Sets the primed state of this slider.

Parameters

NameTypeDescription
isPrimedbooleanThe new primed state.

Returns

void

Defined in

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