EmailComponent
A component that displays and edits an email address.
You can add this component using SettingEx.addEmail.
In order to add the styles for the component, use initPluginContext in your plugin’s onload() function.
Alternatively, you can copy styles from https://unpkg.com/@mnaoumov/obsidian-lib/dist/styles.css.
Import:
import { EmailComponent } from '@mnaoumov/obsidian-lib/setting-components/email-component';Signature:
export class EmailComponent extends TypedTextComponent<string> implements TextBasedComponent<string>Extends: TypedTextComponent<string>
Implements: TextBasedComponent<string>
Constructor
new EmailComponent(containerEl: HTMLElement)Creates a new email component.
Properties
| Property | Type | Description |
|---|---|---|
| empty | () => void | Empties the component. (Inherited from TextBasedComponent) |
| inputEl | HTMLInputElement | An input element of the component. (Inherited from TypedTextComponent) |
| isEmpty | () => boolean | Checks if the component is empty. (Inherited from TextBasedComponent) |
| setPlaceholderValue | (placeholderValue: string) => this | Sets the placeholder value of the component. (Inherited from TextBasedComponent) |
| textComponent | TextComponent | The inner text component. (Inherited from TypedTextComponent) |
Methods
| Method | Returns | Description |
|---|---|---|
| empty() | void | Empties the component. |
| getValue() | string | Gets the value of the component. (Inherited from TypedTextComponent) |
| isEmpty() | boolean | Checks if the component is empty. |
| onChange(callback) | this | Sets the callback function to be called when the component is changed. (Inherited from TypedTextComponent) |
| onChanged() | void | Called when the component is changed. (Inherited from TypedTextComponent) |
| setDisabled(isDisabled) | this | Sets the disabled state of the component. (Inherited from TypedTextComponent) |
| setPlaceholderValue(placeholderValue) | this | Sets the placeholder value of the component. |
| setValue(value) | this | Sets the value of the component. (Inherited from TypedTextComponent) |
| valueFromString($string) | string | Converts a string to an email address. |
| valueToString(value) | string | Converts a value to a string. (Inherited from TypedTextComponent) |
Links to this page: