MultipleFileComponent
A component that displays and edits multiple files.
You can add this component using SettingEx.addMultipleFile.
In order to add the styles for the component, use initPluginContext in your plugin’s onload() function.
Alternatively, you can copy styles from https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css.
Import:
import { MultipleFileComponent } from 'obsidian-dev-utils/obsidian/setting-components/multiple-file-component';Signature:
export class MultipleFileComponent extends TypedTextComponent<readonly File[]>Extends: TypedTextComponent<readonly File[]>
Constructor
new MultipleFileComponent(containerEl: HTMLElement)Creates a new multiple file component.
Properties
| Property | Type | Description |
|---|---|---|
| inputEl | HTMLInputElement | An input element of the component. (Inherited from TypedTextComponent) |
| textComponent | TextComponent | The inner text component. (Inherited from TypedTextComponent) |
Methods
| Method | Returns | Description |
|---|---|---|
| getValue() | readonly File[] | Gets the value of the component. |
| 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(disabled) | this | Sets the disabled state of the component. (Inherited from TypedTextComponent) |
| setValue(value) | this | Sets the value of the component. (Inherited from TypedTextComponent) |
| valueFromString() | readonly File[] | Converts a string to a file. |
| valueFromString(str) | readonly File[] | Converts a string to a value. (Inherited from TypedTextComponent) |
| valueToString(value) | string | Converts a file to a string. |
| valueToString(value) | string | Converts a value to a string. (Inherited from TypedTextComponent) |
Links to this page: