Class: BlazeInput
ui/input.BlazeInput
Hierarchy
BlazeElement
<HTMLDivElement
>โณ
BlazeInput
Constructors
constructor
โข new BlazeInput(name
, placeholder
, size
)
Create a BlazeInput.
Parameters
Name | Type | Description |
---|---|---|
name | string | The input's name attribute |
placeholder | string | The input's placeholder |
size | number | The input's font size in rem units |
Overrides
Defined in
src/ui/input.ts:28
Properties
element
โข Readonly
element: HTMLDivElement
Inherited from
Defined in
src/ui/element.ts:9
input
โข Private
input: HTMLInputElement
Defined in
src/ui/input.ts:13
keys
โข Readonly
keys: KeyboardHandler
Inherited from
Defined in
src/ui/element.ts:11
label
โข Private
label: BlazeText
<HTMLParagraphElement
>
Defined in
src/ui/input.ts:14
mouse
โข Readonly
mouse: MouseHandler
Inherited from
Defined in
src/ui/element.ts:10
name
โข Private
name: string
Defined in
src/ui/input.ts:7
onInput
โข onInput: (value
: string
) => void
Type declaration
โธ (value
): void
Callback that is fired whenever the input's value changes.
Parameters
Name | Type |
---|---|
value | string |
Returns
void
Defined in
src/ui/input.ts:19
placeholder
โข Private
placeholder: string
Defined in
src/ui/input.ts:8
size
โข Private
size: number
Defined in
src/ui/input.ts:9
touch
โข Readonly
touch: TouchHandler
Inherited from
Defined in
src/ui/element.ts:12
value
โข Private
value: string
Defined in
src/ui/input.ts:11
Methods
addLabel
โธ addLabel(label
, aside?
): void
Add a label above or to the side of the input.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
label | string | undefined | The label's text |
aside | boolean | false | Wether the label is above or to the side of the input |
Returns
void
Defined in
src/ui/input.ts:134
getName
โธ getName(): string
Gets the input's name
attribute.
Returns
string
The input's name
attribute
Defined in
src/ui/input.ts:86
getPlaceholder
โธ getPlaceholder(): string
Gets the input's placeholder
attribute.
Returns
string
The input's placeholder
attribute
Defined in
src/ui/input.ts:105
getSize
โธ getSize(): number
Gets the input's font size.
Returns
number
The input's font size in rem
units
Defined in
src/ui/input.ts:124
getValue
โธ getValue(): string
Gets the input's current value.
Returns
string
The input's current value
Defined in
src/ui/input.ts:67
removeLabel
โธ removeLabel(): void
Remove the input's label.
Returns
void
Defined in
src/ui/input.ts:153
setName
โธ setName(name
): void
Sets the input's name.
Parameters
Name | Type | Description |
---|---|---|
name | string | The input's new name attribute |
Returns
void
Defined in
src/ui/input.ts:76
setPlaceholder
โธ setPlaceholder(placeholder
): void
Sets the input's placeholder.
Parameters
Name | Type |
---|---|
placeholder | string |
Returns
void
Defined in
src/ui/input.ts:95
setSize
โธ setSize(size
): void
Sets the input's font size.
Parameters
Name | Type | Description |
---|---|---|
size | number | The input's font size in rem units |
Returns
void
Defined in
src/ui/input.ts:114
setValue
โธ setValue(value
): void
Sets the input's value.
Parameters
Name | Type | Description |
---|---|---|
value | string | The input's new value |
Returns
void
Defined in
src/ui/input.ts:55