Skip to main content

Class: InputBase<T>

dg.InputBase

Input control base. Could be used for editing Property values as well. The root is a div that consists of captionLabel and input.

Type parameters

NameType
Tany

Hierarchy

Constructors

constructor

new InputBase<T>(dart, onChanged?)

Type parameters

NameType
Tany

Parameters

NameTypeDefault value
dartanyundefined
onChangedanynull

Defined in

src/widgets.ts:1026

Properties

dart

dart: any

Defined in

src/widgets.ts:1024

Accessors

caption

get caption(): string

Returns

string

Defined in

src/widgets.ts:1058

set caption(s): void

Parameters

NameType
sstring

Returns

void

Defined in

src/widgets.ts:1061


captionLabel

get captionLabel(): HTMLElement

Returns

HTMLElement

Defined in

src/widgets.ts:1071


classList

get classList(): DOMTokenList

Returns

DOMTokenList

Defined in

src/widgets.ts:1167


dataType

get dataType(): string

Data type this input can edit. See Type.

Returns

string

Defined in

src/widgets.ts:1053


enabled

get enabled(): boolean

Whether the input is enabled

Returns

boolean

Defined in

src/widgets.ts:1097

set enabled(v): void

Parameters

NameType
vboolean

Returns

void

Defined in

src/widgets.ts:1098


format

get format(): string

Value format.

Returns

string

Defined in

src/widgets.ts:1068

set format(s): void

Parameters

NameType
sstring

Returns

void

Defined in

src/widgets.ts:1069


input

get input(): HTMLElement

Returns the actual input

Returns

HTMLElement

Defined in

src/widgets.ts:1074


inputType

get inputType(): string

Input type identifier (such as "Slider" for the slider input). See InputType.

Returns

string

Defined in

src/widgets.ts:1048


notify

get notify(): boolean

Whether events are thrown on value set

Returns

boolean

Defined in

src/widgets.ts:1081

set notify(v): void

Parameters

NameType
vboolean

Returns

void

Defined in

src/widgets.ts:1082


nullable

get nullable(): boolean

Whether empty values are allowed

Returns

boolean

Defined in

src/widgets.ts:1077

set nullable(v): void

Parameters

NameType
vboolean

Returns

void

Defined in

src/widgets.ts:1078


property

get property(): any

Property if associated with

Returns

any

Defined in

src/widgets.ts:1064

set property(p): void

Parameters

NameType
pProperty

Returns

void

Defined in

src/widgets.ts:1065


readOnly

get readOnly(): boolean

Whether the input is readonly

Returns

boolean

Defined in

src/widgets.ts:1093

set readOnly(v): void

Parameters

NameType
vboolean

Returns

void

Defined in

src/widgets.ts:1094


root

get root(): HTMLElement

Visual root (typically a div element that contains caption and input)

Returns

HTMLElement

Defined in

src/widgets.ts:1056


stringValue

get stringValue(): string

String representation of the value

Returns

string

Defined in

src/widgets.ts:1089

set stringValue(s): void

Parameters

NameType
sstring

Returns

void

Defined in

src/widgets.ts:1090


value

get value(): T

Input value

Returns

T

Defined in

src/widgets.ts:1085

set value(x): void

Parameters

NameType
xT

Returns

void

Defined in

src/widgets.ts:1086

Methods

addCaption

addCaption(caption): InputBase<T>

Adds the specified caption

Parameters

NameType
captionstring

Returns

InputBase<T>

Defined in

src/widgets.ts:1133


addOptions

addOptions(options): InputBase<T>

Adds the specified options

Parameters

NameType
optionsHTMLElement

Returns

InputBase<T>

Defined in

src/widgets.ts:1145


addPatternMenu

addPatternMenu(pattern): void

Adds a usage example to the input's hamburger menu

Parameters

NameType
patternany

Returns

void

Defined in

src/widgets.ts:1151


addPostfix

addPostfix(postfix): InputBase<T>

Adds the specified postfix

Parameters

NameType
postfixstring

Returns

InputBase<T>

Defined in

src/widgets.ts:1139


addValidator

addValidator(validator): void

Adds a validator that accepts a string representation of the edited value and returns null if valid, or error message if invalid

Parameters

NameType
validator(value: string) => null | string

Returns

void

Defined in

src/widgets.ts:1157


fireChanged

fireChanged(): any

Fires the 'changed' event (value has changed). See also fireInput

Returns

any

Defined in

src/widgets.ts:1123


fireInput

fireInput(): any

Fires the 'input' event (user input). See also fireChanged

Returns

any

Defined in

src/widgets.ts:1128


init

init(): any

Returns

any

Defined in

src/widgets.ts:1118


load

load(s): any

Loads the value. Used in dialog history. See also load

Parameters

NameType
sany

Returns

any

Defined in

src/widgets.ts:1116


onChanged

onChanged(callback): StreamSubscription

Occurs when [value] is changed, either by user or programmatically.

Parameters

NameType
callbackFunction

Returns

StreamSubscription

Defined in

src/widgets.ts:1101


onInput

onInput(callback): StreamSubscription

Occurs when [value] is changed by user.

Parameters

NameType
callbackFunction

Returns

StreamSubscription

Defined in

src/widgets.ts:1106


save

save(): any

Saves the value. Used in dialog history. See also load

Returns

any

Defined in

src/widgets.ts:1111


setTooltip

setTooltip(msg, tooltipCheck?): InputBase<T>

Sets the tooltip

Parameters

NameTypeDefault value
msgstringundefined
tooltipChecknull | () => booleannull

Returns

InputBase<T>

Defined in

src/widgets.ts:1162


forColumn

Static forColumn<T>(column): InputBase<null | T>

Creates input for the specified column

Type parameters

NameType
Tany

Parameters

NameType
columnColumn<T>

Returns

InputBase<null | T>

Defined in

src/widgets.ts:1043


forInputType

Static forInputType(inputType): InputBase<any>

Creates input for the specified input type

Parameters

NameType
inputTypestring | InputType

Returns

InputBase<any>

Defined in

src/widgets.ts:1038


forProperty

Static forProperty(property, source?): InputBase<any>

Creates input for the specified property, and optionally binds it to the specified object

Parameters

NameTypeDefault value
propertyPropertyundefined
sourceanynull

Returns

InputBase<any>

Defined in

src/widgets.ts:1033