Skip to content

MetadataEditorProperty

Unofficial

Component representing a single property field in the metadata editor.

Import:

import type { MetadataEditorProperty } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface MetadataEditorProperty extends Component

Extends: Component

Constructor

new MetadataEditorProperty()

Constructor.

To extract the constructor type, use ExtractConstructor<Component>.

Properties

PropertyTypeDescription
_childrenComponent[]Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from Component)
_eventsEventRef[]Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from Component)
_loadedbooleanWhether the component and its children are loaded.
(Inherited from Component)
appAppReference to the app.
containerElHTMLElementContainer element for the metadata editor property.
entryPropertyEntryData<unknown>Entry information for the property.
iconElHTMLSpanElementIcon element of the property.
keyElHTMLElementKey value of the property.
keyInputElHTMLInputElementInput field for key value of the property.
metadataEditorMetadataEditorMetadata editor the property is attached to.
renderedMetadataWidget | nullWidget that handles user input for this property widget type.
typeInfoTypeInfoInfo about the inferred and expected property widget given key-value pair.
valueElHTMLElementElement that contains the value input or widget.
warningElHTMLElementElement containing the displayed warning on malformed property field.

Methods

MethodReturnsDescription
addChild(component)TAdds a child component, loading it if this component is loaded.
(Inherited from Component)
focusKey()voidFocus on the key input element.
focusProperty()voidFocus on the property (container element).
focusValue(mode?)voidFocus on the value input element.
handleItemClick(event)voidReveal the property menu on click event.
handlePropertyBlur()voidFocus on property on blur event.
handleUpdateKey(key)booleanUpdate key of property and saves, returns false if error.
handleUpdateValue(value)voidUpdate value of property and saves.
load()voidLoad this component and its children.
(Inherited from Component)
onload()voidLoads as draggable property element.
onunload()voidOverride this to unload your component
(Inherited from Component)
register(cb)voidRegisters a callback to be called when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from Component)
registerEvent(eventRef)voidRegisters an event to be detached when unloading.
(Inherited from Component)
registerInterval(id)numberRegisters 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)voidRegister a scope keymap event handler to be removed on unload.
(Inherited from Component)
removeChild(component)TRemoves a child component, unloading it.
(Inherited from Component)
renderProperty(entry, checkErrors?, useExpectedType?)voidRender property widget based on type.
setSelected(selected)voidSet the selected class of property.
showPropertyMenu(event)voidReveal property selection menu at mouse event.
unload()voidOverride this to unload your component.
(Inherited from Component)

Links to this page: