@samatawy/diagrams
    Preparing search index...

    Class Inspector

    Generic sectioned inspector that renders property rows and syncs adapter values.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    host: HTMLElement
    config: Required<InspectorConfig>
    readonly: boolean = false
    definitions: { [key: string]: InspectorPropertyDefinition } = {}
    adapters: Map<string, InspectorAdapter> = ...
    syncingAdapters: boolean = false
    cells: Map<string, HTMLElement> = ...

    Methods

    • Evaluates every row's isVisible() callback and toggles the 'is-hidden' CSS class on its label and value cells. Also hides sections whose every row is hidden. Subclasses may override to apply additional visibility rules.

      Returns void

    • Removes a previously registered adapter by name.

      Parameters

      • name: string

        The lookup key of the adapter to remove.

      Returns void

    • Derives the overall selection state from the item count and value diversity.

      Parameters

      • selectedCount: number

        Number of currently selected nodes.

      • values: Record<string, Set<unknown>>

        Per-key value sets collected from the selection.

      Returns InspectorSelectionState

      'none', 'single', or 'mixed'.

    • Reads a value from a flat or nested record using the registered adapter for the key. Falls back to dot-path traversal if no adapter is registered.

      Parameters

      • record: EditableRecord

        The source data record.

      • key: string

        The property key, supporting dot-separated paths.

      Returns unknown

      The resolved value, or undefined if not found.

    • Traverses a dot-separated path inside a record and returns the leaf value.

      Parameters

      • record: EditableRecord

        The root record to traverse.

      • path: string

        Dot-separated property path, e.g. 'shadowStyle.offset.x'.

      Returns unknown

      The value at the path, or undefined if any segment is missing.

    • Adds a value to a set while deduplicating object values by shallow first-level comparison.

      Parameters

      • set: Set<unknown>
      • value: unknown

      Returns void

    • Compares two objects using only first-level keys and values.

      Parameters

      • a: Record<string, unknown>
      • b: Record<string, unknown>

      Returns boolean

    • Creates a collapsible section element with a heading and a two-column property grid inside. Returns the section root and the inner grid so rows can be appended to it.

      Parameters

      • heading: string
      • state: "expanded" | "collapsed"

      Returns { section: HTMLElement; grid: HTMLElement }

    • Removes all rows marked as volatile from the given grid. Returns the removed keys so subclasses can clear any companion maps.

      Parameters

      • grid: HTMLElement

      Returns string[]