Skip to main content

Class: GenericCursorInputSlot<T, P>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:253

A generic implementation of CursorInputSlot whose behavior is largely defined though props.

Extends​

  • DisplayComponent<P>

Type Parameters​

Type ParameterDefault type
T-
P extends GenericCursorInputSlotProps<T>GenericCursorInputSlotProps<T>

Implements​

Constructors​

Constructor​

new GenericCursorInputSlot<T, P>(props): GenericCursorInputSlot<T, P>

Defined in: sdk/components/FSComponent.ts:73

Creates an instance of a DisplayComponent.

Parameters​

ParameterTypeDescription
propsPThe propertis of the component.

Returns​

GenericCursorInputSlot<T, P>

Inherited from​

DisplayComponent<P>.constructor

Properties​

_characters​

protected readonly _characters: MappedSubject<(null | string)[], readonly (null | string)[]>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:277


_value​

protected readonly _value: MappedSubscribable<T>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:287


characterArray​

protected readonly characterArray: Subject<null | string>[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:274


characterCount​

readonly characterCount: number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:267

The number of characters contained in this slot.

Implementation of​

CursorInputSlot.characterCount


characterCssClasses​

protected readonly characterCssClasses: SetSubject<string>[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:272


characterRefs​

protected readonly characterRefs: NodeReference<HTMLDivElement>[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:270


characters​

readonly characters: Subscribable<readonly (null | string)[]>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:279

The value of this slot's characters, in order.

Implementation of​

CursorInputSlot.characters


characterSetFuncs​

protected readonly characterSetFuncs: (value) => void[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:275

Sets the value of this subject and notifies subscribers if the value changed.

Parameters​

ParameterTypeDescription
valuenull | stringThe new value.

Returns​

void


charactersText​

protected readonly charactersText: MappedSubscribable<string>[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:281


context?​

optional context: [] = undefined

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

The context on this component, if any.

Inherited from​

DisplayComponent.context


contextType?​

readonly optional contextType: readonly [] = undefined

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

The type of context for this component, if any.

Inherited from​

DisplayComponent.contextType


isCursorInputSlot​

readonly isCursorInputSlot: true = true

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:259

Flags this object as a CursorInputSlot.

Implementation of​

CursorInputSlot.isCursorInputSlot


isEmpty​

protected readonly isEmpty: MappedSubscribable<boolean>[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:282


props​

props: P & ComponentProps

Defined in: sdk/components/FSComponent.ts:61

The properties of the component.

Inherited from​

DisplayComponent.props


rootRef​

protected readonly rootRef: NodeReference<HTMLDivElement>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:269


selectionMode​

protected readonly selectionMode: Subject<CursorInputCharSelectionMode>[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:283


setValueFunc()​

protected readonly setValueFunc: (value) => T

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:291

Parameters​

ParameterType
valueT

Returns​

T

Inherit Doc​


value​

readonly value: Subscribable<T>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:289

The current value of this slot.

Implementation of​

CursorInputSlot.value


valueEqualsFunc()​

protected readonly valueEqualsFunc: (a, b) => boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:285

Parameters​

ParameterType
aT
bT

Returns​

boolean

Accessors​

allowBackfill​

Get Signature​

get allowBackfill(): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:262

Whether this slot supports backfill operations.

Returns​

boolean

Whether this slot supports backfill operations.

Implementation of​

CursorInputSlot.allowBackfill

Methods​

canSetChar()​

canSetChar(index, char, force): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:352

Checks if one of this slot's characters can accept a value.

Parameters​

ParameterTypeDefault valueDescription
indexnumberundefinedThe index of the character to query.
charnull | stringundefinedThe value to query.
forcebooleanfalseWhether the character should be forced to accept a value that would normally be invalid. Defaults to false.

Returns​

boolean

Whether the character can accept the specified value.

Throws​

RangeError if index is out of bounds.

Implementation of​

CursorInputSlot.canSetChar


decrementValue()​

decrementValue(): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:338

Decrements this slot's value.

Returns​

boolean

Whether the operation was accepted.

Implementation of​

CursorInputSlot.decrementValue


destroy()​

destroy(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:484

Returns​

void

Inherit Doc​

Overrides​

DisplayComponent.destroy


getBottom()​

getBottom(): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:395

Gets the y coordinate, in pixels, of the bottom edge of this slot's border box, relative to its nearest positioned ancestor.

Returns​

number

The y coordinate, in pixels, of the bottom edge of this slot's border box, relative to its nearest positioned ancestor.

Implementation of​

CursorInputSlot.getBottom


getCharLeft()​

getCharLeft(index): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:411

Gets the x coordinate, in pixels, of the left edge of the border box of one of this slot's characters, relative to this slot's nearest positioned ancestor.

Parameters​

ParameterTypeDescription
indexnumberThe index of the character to query.

Returns​

number

The x coordinate, in pixels, of the left edge of the border box of one of the specified character, relative to this slot's nearest positioned ancestor.

Throws​

RangeError if index is out of bounds.

Implementation of​

CursorInputSlot.getCharLeft


getCharRight()​

getCharRight(index): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:420

Gets the x coordinate, in pixels, of the right edge of the border box of one of this slot's characters, relative to this slot's nearest positioned ancestor.

Parameters​

ParameterTypeDescription
indexnumberThe index of the character to query.

Returns​

number

The x coordinate, in pixels, of the right edge of the border box of one of the specified character, relative to this slot's nearest positioned ancestor.

Throws​

RangeError if index is out of bounds.

Implementation of​

CursorInputSlot.getCharRight


getCharWidth()​

getCharWidth(index): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:435

Gets the width, in pixels, of one of this slot's characters.

Parameters​

ParameterTypeDescription
indexnumberThe index of the character to query.

Returns​

number

The width, in pixels, of one of the specified character.

Throws​

RangeError if index is out of bounds.

Implementation of​

CursorInputSlot.getCharWidth


getContext()​

protected getContext(context): never

Defined in: sdk/components/FSComponent.ts:106

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


getHeight()​

getHeight(): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:406

Gets the height, in pixels, of this slot's border box.

Returns​

number

The height, in pixels, of this slot's border box.

Implementation of​

CursorInputSlot.getHeight


getLeft()​

getLeft(): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:375

Gets the x coordinate, in pixels, of the left edge of this slot's border box, relative to its nearest positioned ancestor.

Returns​

number

The x coordinate, in pixels, of the left edge of this slot's border box, relative to its nearest positioned ancestor.

Implementation of​

CursorInputSlot.getLeft


getRight()​

getRight(): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:380

Gets the x coordinate, in pixels, of the right edge of this slot's border box, relative to its nearest positioned ancestor.

Returns​

number

The x coordinate, in pixels, of the right edge of this slot's border box, relative to its nearest positioned ancestor.

Implementation of​

CursorInputSlot.getRight


getTop()​

getTop(): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:390

Gets the y coordinate, in pixels, of the top edge of this slot's border box, relative to its nearest positioned ancestor.

Returns​

number

The y coordinate, in pixels, of the top edge of this slot's border box, relative to its nearest positioned ancestor.

Implementation of​

CursorInputSlot.getTop


getWidth()​

getWidth(): number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:385

Gets the width, in pixels, of this slot's border box.

Returns​

number

The width, in pixels, of this slot's border box.

Implementation of​

CursorInputSlot.getWidth


incrementValue()​

incrementValue(): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:333

Increments this slot's value.

Returns​

boolean

Whether the operation was accepted.

Implementation of​

CursorInputSlot.incrementValue


onAfterRender()​

onAfterRender(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:296

Returns​

void

Inherit Doc​

Overrides​

DisplayComponent.onAfterRender


onBeforeRender()​

onBeforeRender(): void

Defined in: sdk/components/FSComponent.ts:80

A callback that is called before the component is rendered.

Returns​

void

Inherited from​

DisplayComponent.onBeforeRender


populateCharsFromValue()​

populateCharsFromValue(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:370

Populates all of this slot's characters with non-empty values, if possible, using this slot's current value as a template.

Returns​

void

Implementation of​

CursorInputSlot.populateCharsFromValue


refreshFromChars()​

refreshFromChars(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:446

Recomputes this slot's value from its characters and re-renders all characters.

Returns​

void


render()​

render(): VNode

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:453

Returns​

VNode

Inherit Doc​

Overrides​

DisplayComponent.render


setChar()​

setChar(index, char, force): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:343

Sets the value of one of this slot's characters.

Parameters​

ParameterTypeDefault valueDescription
indexnumberundefinedThe index of the character to set.
charnull | stringundefinedThe value to set.
forcebooleanfalseWhether to force the character to accept a value that would normally be invalid. Defaults to false.

Returns​

boolean

Whether the operation was accepted.

Throws​

RangeError if index is out of bounds.

Implementation of​

CursorInputSlot.setChar


setCharSelected()​

setCharSelected(index, mode): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:361

Sets the selection mode for one of this slot's characters.

Parameters​

ParameterTypeDescription
indexnumberThe index of the character for which to set a selection mode.
modeCursorInputCharSelectionModeA character selection mode.

Returns​

void

Throws​

RangeError if index is out of bounds.

Implementation of​

CursorInputSlot.setCharSelected


setValue()​

setValue(value): T

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Components/CursorInput/CursorInputSlot.tsx:327

Sets the value of this slot. The value of this slot after the operation is complete may be different from the requested value, depending on whether this slot can accurately represent the requested value.

Parameters​

ParameterTypeDescription
valueTThe new value.

Returns​

T

The value of this slot after the operation is complete.

Implementation of​

CursorInputSlot.setValue