TypedTextComponent<T>
A component that displays and edits a text-based value.
Import:
import { TypedTextComponent } from 'obsidian-dev-utils/obsidian/setting-components/typed-text-component';Signature:
export class TypedTextComponent<T> extends ValueComponent<T> implements ValidatorComponent, ValueComponentWithChangeTracking<T>Extends: ValueComponent<T>
Implements: ValidatorComponent, ValueComponentWithChangeTracking<T>
Constructor
new TypedTextComponent(params: TypedTextComponentConstructorParams)Creates a new typed text component.
Properties
| Property | Type | Description |
|---|---|---|
| inputEl | HTMLInputElement | An input element of the component. |
| textComponent | TextComponent | The inner text component. |
| validatorEl | ValidatorElement | A validator element of the component. (Inherited from ValidatorComponent) |
Methods
| Method | Returns | Description |
|---|---|---|
| getValue() | T | Gets the value of the component. |
| onChange(callback) | this | Sets the callback function to be called when the component is changed. |
| onChange(callback) | this | Sets a callback function to be called when the value of the component changes. (Inherited from ValueComponentWithChangeTracking) |
| onChanged() | void | Called when the component is changed. |
| setDisabled(disabled) | this | Sets the disabled state of the component. |
| setValue(value) | this | Sets the value of the component. |
| valueFromString(str) | T | Converts a string to a value. |
| valueToString(value) | string | Converts a value to a string. |
Links to this page: