Class: TouchSlider<S, P>
A touchscreen slider.
Type parameters
Name | Type |
---|---|
S | extends Subscribable <number > | MutableSubscribable <number > |
P | extends 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
Name | Type |
---|---|
S | extends Subscribable <number > | MutableSubscribable <number , number > |
P | extends TouchSliderProps <S > = TouchSliderProps <S > |
Parameters
Name | Type | Description |
---|---|---|
props | P | The propertis of the component. |
Returns
TouchSlider
<S
, P
>
Inherited from
DisplayComponent<P>.constructor
Defined in
sdk/components/FSComponent.ts:73
Properties
context
• Optional
context: [] = undefined
The context on this component, if any.
Inherited from
DisplayComponent.context
Defined in
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
sdk/components/FSComponent.ts:67
crossAxisIndex
• Protected
Readonly
crossAxisIndex: number
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:180
cssClassSub
• Protected
Optional
cssClassSub: Subscription
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:258
currentMousePosition
• Protected
Readonly
currentMousePosition: Float64Array
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:250
dragInhibitThresholdPx
• Protected
Readonly
dragInhibitThresholdPx: number
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:256
dragLockFocusThresholdPx
• Protected
Readonly
dragLockFocusThresholdPx: number
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:254
draggedValue
• Protected
draggedValue: number
= 0
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:246
focusOnDrag
• Protected
Readonly
focusOnDrag: boolean
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:252
inhibitOnDrag
• Protected
Readonly
inhibitOnDrag: boolean
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:255
isEnabled
• Protected
Readonly
isEnabled: Subscribable
<boolean
> | Subscribable
<false
> | Subscribable
<true
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:236
isEnabledSub
• Protected
Optional
isEnabledSub: Subscription
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:259
isPrimed
• Protected
isPrimed: boolean
= false
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:239
isVisible
• Protected
Readonly
isVisible: Subscribable
<boolean
> | Subscribable
<false
> | Subscribable
<true
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:237
isVisibleSub
• Protected
Optional
isVisibleSub: Subscription
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:260
lockFocusOnDrag
• Protected
Readonly
lockFocusOnDrag: boolean
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:253
mainAxisIndex
• Protected
Readonly
mainAxisIndex: 0
| 1
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:179
mainAxisSign
• Protected
Readonly
mainAxisSign: 1
| -1
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:182
mouseDownPosition
• Protected
Readonly
mouseDownPosition: Float64Array
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:248
mouseDownValue
• Protected
mouseDownValue: number
= 0
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:245
props
• props: P
& ComponentProps
The properties of the component.
Inherited from
DisplayComponent.props
Defined in
sdk/components/FSComponent.ts:61
referenceMousePosition
• Protected
Readonly
referenceMousePosition: Float64Array
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:249
rootCssClass
• Protected
Readonly
rootCssClass: SetSubject
<string
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:230
sliderContainerRef
• Protected
Readonly
sliderContainerRef: NodeReference
<HTMLDivElement
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:184
sliderForegroundClipPathFunc
• Protected
Readonly
sliderForegroundClipPathFunc: (value
: number
) => string
Type declaration
▸ (value
): string
Parameters
Name | Type |
---|---|
value | number |
Returns
string
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:194
sliderForegroundStyle
• Protected
Readonly
sliderForegroundStyle: ObjectSubject
<{ -webkit-clip-path
: string
}>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:222
sliderLength
• Protected
sliderLength: number
= 0
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:243
sliderThumbRef
• Protected
Readonly
sliderThumbRef: NodeReference
<HTMLDivElement
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:186
sliderThumbStyle
• Protected
Readonly
sliderThumbStyle: ObjectSubject
<{ transform
: string
}>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:226
sliderThumbTranslateFunc
• Protected
Readonly
sliderThumbTranslateFunc: (value
: number
) => string
Type declaration
▸ (value
): string
Parameters
Name | Type |
---|---|
value | number |
Returns
string
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:214
snapAnimationEasing
• Protected
Readonly
snapAnimationEasing: (start
: number
, stop
: number
, progress
: number
) => number
Type declaration
▸ (start
, stop
, progress
): number
Parameters
Name | Type |
---|---|
start | number |
stop | number |
progress | number |
Returns
number
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:189
snapAnimationSpeed
• Protected
Readonly
snapAnimationSpeed: Subscribable
<number
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:188
stateSub
• Protected
Optional
stateSub: Subscription
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:261
stops
• Protected
Readonly
stops: Subscribable
<readonly number
[]>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:241
thumbLength
• Protected
thumbLength: number
= 0
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:244
touchPadRef
• Protected
Readonly
touchPadRef: NodeReference
<TouchPad
<TouchPadProps
>>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:185
valueAnimator
• Protected
Readonly
valueAnimator: Animator
Defined in
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
Name | Type |
---|---|
start | number |
stop | number |
progress | number |
Returns
number
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:164
RESERVED_CSS_CLASSES
▪ Static
Protected
Readonly
RESERVED_CSS_CLASSES: Set
<string
>
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:166
Methods
destroy
▸ destroy(): void
Returns
void
Inherit Doc
Overrides
DisplayComponent.destroy
Defined in
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
Name | Type | Description |
---|---|---|
value | number | The query value. |
Returns
number
The stop closest to the specified value, or the specified value if this slider has no defined stops.
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:408
getContext
▸ getContext(context
): never
Gets a context data subscription from the context collection.
Parameters
Name | Type | Description |
---|---|---|
context | never | The 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
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
garminsdk/components/touchslider/TouchSlider.tsx:483
onAfterRender
▸ onAfterRender(node
): void
Parameters
Name | Type |
---|---|
node | VNode |
Returns
void
Inherit Doc
Overrides
DisplayComponent.onAfterRender
Defined in
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
sdk/components/FSComponent.ts:80
onDragEnded
▸ onDragEnded(position
, initialPosition
): void
Responds to when a mouse drag is released on this slider.
Parameters
Name | Type | Description |
---|---|---|
position | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The current position of the mouse. |
initialPosition | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The position of the mouse at the start of the drag motion. |
Returns
void
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:357
onDragMoved
▸ onDragMoved(position
, prevPosition
, initialPosition
): void
Responds to when this slider is dragged.
Parameters
Name | Type | Description |
---|---|---|
position | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The current mouse position. |
prevPosition | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The position of the mouse at the previous update. |
initialPosition | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The position of the mouse at the start of the current drag motion. |
Returns
void
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:335
onDragStarted
▸ onDragStarted(position
): void
Responds to when a mouse drag is started on this slider.
Parameters
Name | Type | Description |
---|---|---|
position | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The current mouse position. |
Returns
void
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:315
onValueChangedFromInput
▸ onValueChangedFromInput(value
): void
Responds to when this slider's value changes from user input.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new slider value. |
Returns
void
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:394
render
▸ render(): VNode
Returns
VNode
Inherit Doc
Overrides
DisplayComponent.render
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:436
setDisplayedValue
▸ setDisplayedValue(value
, animate
): void
Sets this slider's displayed value.
Parameters
Name | Type | Description |
---|---|---|
value | number | The value to set. |
animate | boolean | Whether to animate the change. |
Returns
void
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:424
setPrimed
▸ setPrimed(isPrimed
): void
Sets the primed state of this slider.
Parameters
Name | Type | Description |
---|---|---|
isPrimed | boolean | The new primed state. |
Returns
void
Defined in
garminsdk/components/touchslider/TouchSlider.tsx:301