Kvaser CanKing GUI Extensions SDK v7.4.0
Kvaser CanKing GUI Extensions SDK / controls / ValidateableTextControlProps
Interface: ValidateableTextControlProps
Properties of the ValidateableTextControl React component.
Properties
disabled?
optionaldisabled:boolean
Set to true to disable this control.
endAdornment?
optionalendAdornment:string
A text to be displayed after the value.
error?
optionalerror:boolean
The current error state.
fullWidth?
optionalfullWidth:boolean
Set to true to expand this control to use the full widht of its parent.
helperText?
optionalhelperText:string
Any helper text that should be displayed.
id?
optionalid:string
The component id.
inputMode?
optionalinputMode:"search"|"text"|"none"|"tel"|"url"|"email"|"numeric"|"decimal"
Input mode.
label?
optionallabel:string
The label of this input control.
margin?
optionalmargin:"none"|"normal"|"dense"
Margins between controls inside this control.
maxValue?
optionalmaxValue:number
The max value if numberType is set.
minValue?
optionalminValue:number
The min value if numberType is set.
numberType?
optionalnumberType:"float"|"int"
Number type if the expected value is a number, if left undefined then the value is expected to be a string.
onBlur()?
optionalonBlur: (value) =>void
Callback that will be called when the control has lost focus.
Parameters
value
string
The new value.
Returns
void
onChange()?
optionalonChange: (value) =>void
Callback that will be called when the value has been changed.
Parameters
value
string
The new value.
Returns
void
onErrorChange()?
optionalonErrorChange: (error) =>void
Callback that is called when the error state has changed.
Parameters
error
boolean
The new error state.
Returns
void
onValidate()?
optionalonValidate: (text,trigger) =>object
Callback that will be called when the value has been changed or the control has lost focus. This callback is called before onChange and if the returned err value is true then onChange won’t be called. The implemtation of this callback is allowed to modify the specified text value and return the modified value in the val property of the returned object.
Parameters
text
string
The new text value.
trigger
The trigger of this callback, either on ‘change’ or on ‘blur’.
"change" | "blur"
Returns
object
An object with the validated value (val) and an error state (err).
err
err:
boolean
val
val:
string
pattern?
optionalpattern:string
Regex pattern of the value in this control.
required?
optionalrequired:boolean
Set to true if this control’s value is required.
size?
optionalsize:"small"|"medium"
The component size.
startAdornment?
optionalstartAdornment:string
A text to be displayed in front of the value.
sx?
optionalsx:SxProps<Theme>
Optional sx properties.
sxEndAdornment?
optionalsxEndAdornment:SxProps<Theme>
Optional sx properties for the end adornment.
sxStartAdornment?
optionalsxStartAdornment:SxProps<Theme>
Optional sx properties for the start adornment.
value
value:
string
The current value.