5.1.10 • Published 2 years ago

@axa-ch/textarea v5.1.10

Weekly downloads
195
License
Copyright 2019 AX...
Repository
github
Last release
2 years ago

Textarea

The <axa-textarea> component is a wrapper for the HTML <textarea> element with custom styling and additional functionality, e.g. a character counter.

Properties

label

The string-valued label provides label text for the element as HTML.

refId

The string-valued refId sets the id attribute for the underlying native HTML <textarea>. (default: a random id value).

name

The string-valued name of the element can be set with this attribute.

Its intended use is for purposes of form submission.

required

The Boolean attribute required visualizes an element that must obligatorily be filled by the user. When true, it displays * after the label text.

placeholder

String-valued placeholderspecifies the placeholder text shown when the element is empty.

invalid

The Boolean attribute invalid serves to indicate the validity of the element (default: false). If set to true, it puts the element into a visual error state.

checkMark

The Boolean attribute checkMark shows an animated check mark to the right of the textarea (default: false).

Showing the check mark is suppressed when a character limit has been reached (cf. maxLength below).

value

The string-valued value sets the value of the underlying native HTML <textarea>.

disabled

The Boolean attribute disabled disables the underlying native HTML <textarea> text.

readonly

The Boolean readonly attribute, when present, makes the underlying native HTML <textarea> text not mutable, meaning the user can not edit the control.

autocomplete

The boolean attribute autocomplete put the HTML autocomplete attribute to "on". The default ist "off"

error

The string-valued error provides error text as HTML, to be shown when invalid is true.

maxLength

The number-valued maxlength provides a maximum number of characters that the textarea allows to be entered.

To reflect this visually, a character counter is added to the element UI.

counter

The string-valued counter takes a string template which will be used when formatting the aforementioned character counter.

A ##counter## placeholder anywhere in the string template is instantiated with the concrete character count. A missing placeholder is treated as if it were placed last in the counter string.

counterMax

The string-valued countermax provides information text as HTML.

The information text is displayed instead of the character counter if the character limit defined in maxlength has been reached.

defaultValue

The string-valued defaultValue sets an initial (default) text in the underlying native HTML <textarea>, applied on first render of the element.

It can only be used for React.

Note: In native applications you may achieve a similar effect by making your default text a child of the element, like so: <axa-textarea>default value</axa-textarea>.

Callbacks

onChange

The function-valued property onChange can be used as a callback prop for React and other frameworks.

The callback is invoked whenever the underlying native HTML <textarea>'s input event fires. Its only argument is the original input event.

onFocus

The function-valued property onFocus can be used as a callback prop for React and other frameworks.

The callback is invoked whenever the underlying native HTML <textarea>'s focus event fires. Its only argument is the original focus event.

onBlur

The function-valued property onBlur can be used as a callback prop for React and other frameworks.

The callback is invoked whenever the underlying native HTML <textarea>'s blur event fires. Its only argument is the original blur event.

Methods

focus()

The focus() method focusses the underlying native HTML <textarea>.

Its UI consequences are the same as a keyboard/mouse-initiated focus.

blur()

The blur() method unfocusses the underlying native HTML <textarea>.

Its UI consequences are the same as a keyboard/mouse-initiated blur.

5.1.10

2 years ago

5.1.9

2 years ago

5.1.8

2 years ago

5.1.7

2 years ago

5.1.6

2 years ago

5.1.5

2 years ago

5.1.4

2 years ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

4.0.1

2 years ago

4.0.2

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.0.0

3 years ago

3.1.12

3 years ago

3.1.11

4 years ago

3.1.10

4 years ago

3.1.9

4 years ago

3.1.8

4 years ago

3.1.7

4 years ago

3.1.6

4 years ago

3.1.5

4 years ago

3.1.4

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.8

4 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.5.5

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago