MetadataEditorProperty
Unofficial
Component representing a single property field in the metadata editor.
Import:
import type { MetadataEditorProperty } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface MetadataEditorProperty extends ComponentExtends: Component
Constructor
new MetadataEditorProperty()Constructor.
To extract the constructor type, use ExtractConstructor<Component>.
Properties
| Property | Type | Description | |
|---|---|---|---|
| _children | Component[] | Child Components attached to current component, will be unloaded on unloading parent component. (Inherited from Component) | |
| _events | EventRef[] | Events that are attached to the current component, will be detached on unloading parent component. (Inherited from Component) | |
| _loaded | boolean | Whether the component and its children are loaded. (Inherited from Component) | |
| app | App | Reference to the app. | |
| containerEl | HTMLElement | Container element for the metadata editor property. | |
| entry | PropertyEntryData<unknown> | Entry information for the property. | |
| iconEl | HTMLSpanElement | Icon element of the property. | |
| keyEl | HTMLElement | Key value of the property. | |
| keyInputEl | HTMLInputElement | Input field for key value of the property. | |
| metadataEditor | MetadataEditor | Metadata editor the property is attached to. | |
| rendered | MetadataWidget | null | Widget that handles user input for this property widget type. | |
| typeInfo | TypeInfo | Info about the inferred and expected property widget given key-value pair. | |
| valueEl | HTMLElement | Element that contains the value input or widget. | |
| warningEl | HTMLElement | Element containing the displayed warning on malformed property field. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| addChild(component) | T | Adds a child component, loading it if this component is loaded. (Inherited from Component) | |
| focusKey() | void | Focus on the key input element. | |
| focusProperty() | void | Focus on the property (container element). | |
| focusValue(mode?) | void | Focus on the value input element. | |
| handleItemClick(event) | void | Reveal the property menu on click event. | |
| handlePropertyBlur() | void | Focus on property on blur event. | |
| handleUpdateKey(key) | boolean | Update key of property and saves, returns false if error. | |
| handleUpdateValue(value) | void | Update value of property and saves. | |
| load() | void | Load this component and its children. (Inherited from Component) | |
| onload() | void | Loads as draggable property element. | |
| onunload() | void | Override this to unload your component (Inherited from Component) | |
| register(cb) | void | Registers a callback to be called when unloading. (Inherited from Component) | |
| registerDomEvent(el, type, callback, options?) | void | Registers a DOM event to be detached when unloading. (Inherited from Component) | |
| registerDomEvent(el, type, callback, options?) | void | Registers a DOM event to be detached when unloading (Inherited from Component) | |
| registerDomEvent(el, type, callback, options?) | void | Registers a DOM event to be detached when unloading (Inherited from Component) | |
| registerEvent(eventRef) | void | Registers an event to be detached when unloading. (Inherited from Component) | |
| registerInterval(id) | number | Registers an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API(Inherited from Component) | |
| registerScopeEvent(keymapEventHandler) | void | Register a scope keymap event handler to be removed on unload. (Inherited from Component) | |
| removeChild(component) | T | Removes a child component, unloading it. (Inherited from Component) | |
| renderProperty(entry, checkErrors?, useExpectedType?) | void | Render property widget based on type. | |
| setSelected(selected) | void | Set the selected class of property. | |
| showPropertyMenu(event) | void | Reveal property selection menu at mouse event. | |
| unload() | void | Override this to unload your component. (Inherited from Component) |
Links to this page: