[TS] Fix / consolidate DOM widget types (#3830)

This commit is contained in:
filtered
2025-05-09 16:24:31 +10:00
committed by GitHub
parent 3501b480d4
commit 0f95ed852e
2 changed files with 12 additions and 14 deletions

View File

@@ -152,7 +152,7 @@ abstract class BaseDOMWidgetImpl<V extends object | string>
this.options.onDraw?.(this)
}
onRemove(): void {
override onRemove(): void {
useDomWidgetStore().unregisterWidget(this.id)
}
}
@@ -175,7 +175,7 @@ export class DOMWidgetImpl<T extends HTMLElement, V extends object | string>
}
/** Extract DOM widget size info */
computeLayoutSize(node: LGraphNode) {
override computeLayoutSize(node: LGraphNode) {
if (this.type === 'hidden') {
return {
minHeight: 0,
@@ -239,7 +239,7 @@ export class ComponentWidgetImpl<V extends object | string>
this.inputSpec = obj.inputSpec
}
computeLayoutSize() {
override computeLayoutSize() {
const minHeight = this.options.getMinHeight?.() ?? 50
const maxHeight = this.options.getMaxHeight?.()
return {