Skip to content

MetadataEditorProperty

Extends

Properties

_children

_children: Component[]

Child Components attached to current component, will be unloaded on unloading parent component

Inherited from

Component._children


_events

_events: EventRef[]

Events that are attached to the current component, will be detached on unloading parent component

Inherited from

Component._events


_loaded

_loaded: boolean

Whether the component and its children are loaded

Inherited from

Component._loaded


app

app: App

Reference to the app


containerEl

containerEl: HTMLElement

Container element for the metadata editor property


entry

entry: PropertyEntryData<unknown>

Entry information for the property


iconEl

iconEl: HTMLSpanElement

Icon element of the property


keyEl

keyEl: HTMLElement

Key value of the property


keyInputEl

keyInputEl: HTMLInputElement

Input field for key value of the property


metadataEditor

metadataEditor: MetadataEditor

Metadata editor the property is attached to


rendered

rendered: null | MetadataWidget

Widget that handles user input for this property widget type


typeInfo

typeInfo: object

Info about the inferred and expected property widget given key-value pair

expected

expected: PropertyWidget<unknown>

inferred

inferred: PropertyWidget<unknown>


valueEl

valueEl: HTMLElement

Element that contains the value input or widget


warningEl

warningEl: HTMLElement

Element containing the displayed warning on malformed property field

Methods

addChild()

addChild<T>(component): T

Adds a child component, loading it if this component is loaded

Type Parameters

T extends Component

Parameters

component: T

Returns

T

Inherited from

Component.addChild


focusKey()

focusKey(): void

Focus on the key input element

Returns

void


focusProperty()

focusProperty(): void

Focus on the property (container element)

Returns

void


focusValue()

focusValue(which?): void

Focus on the value input element

Parameters

which?: "both" | "end" | "start"

Returns

void


handleItemClick()

handleItemClick(event): void

Reveal the property menu on click event

Parameters

event: MouseEvent

Returns

void


handlePropertyBlur()

handlePropertyBlur(): void

Focus on property on blur event

Returns

void


handleUpdateKey()

handleUpdateKey(key): boolean

Update key of property and saves, returns false if error

Parameters

key: string

Returns

boolean


handleUpdateValue()

handleUpdateValue(value): void

Update value of property and saves

Parameters

value: unknown

Returns

void


load()

load(): void

Load this component and its children

Returns

void

Inherited from

Component.load


onload()

onload(): void

Loads as draggable property element

Returns

void

Overrides

Component.onload


onunload()

onunload(): void

Override this to unload your component

Returns

void

Inherited from

Component.onunload


register()

register(cb): void

Registers a callback to be called when unloading

Parameters

cb

Returns

void

Inherited from

Component.register


registerDomEvent()

registerDomEvent(el, type, callback, options)

registerDomEvent<K>(el, type, callback, options?): void

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof WindowEventMap

Parameters

el: Window

type: K

callback

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

Component.registerDomEvent

registerDomEvent(el, type, callback, options)

registerDomEvent<K>(el, type, callback, options?): void

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof DocumentEventMap

Parameters

el: Document

type: K

callback

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

Component.registerDomEvent

registerDomEvent(el, type, callback, options)

registerDomEvent<K>(el, type, callback, options?): void

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof HTMLElementEventMap

Parameters

el: HTMLElement

type: K

callback

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

Component.registerDomEvent


registerEvent()

registerEvent(eventRef): void

Registers an event to be detached when unloading

Parameters

eventRef: EventRef

Returns

void

Inherited from

Component.registerEvent


registerInterval()

registerInterval(id): number

Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API

Parameters

id: number

Returns

number

Inherited from

Component.registerInterval


registerScopeEvent()

registerScopeEvent(keymapEventHandler): void

Parameters

keymapEventHandler: KeymapEventHandler

Returns

void

Inherited from

Component.registerScopeEvent


removeChild()

removeChild<T>(component): T

Removes a child component, unloading it

Type Parameters

T extends Component

Parameters

component: T

Returns

T

Inherited from

Component.removeChild


renderProperty()

renderProperty(entry, check_errors?, use_expected_type?): void

Render property widget based on type

Parameters

entry: PropertyEntryData<unknown>

check_errors?: boolean

use_expected_type?: boolean

Returns

void


setSelected()

setSelected(selected): void

Set the selected class of property

Parameters

selected: boolean

Returns

void


showPropertyMenu()

showPropertyMenu(event): void

Reveal property selection menu at mouse event

Parameters

event: MouseEvent

Returns

void


unload()

unload(): void

Unload this component and its children

Returns

void

Inherited from

Component.unload