schema-components - v3.7.0
    Preparing search index...

    Module lit/defaultResolver

    Default Lit LitComponentResolver that dispatches every built-in schema type to the matching <sc-*> Custom Element.

    Where the React adapter's headless resolver composes per-type functions that return React elements, the Lit equivalent emits a <sc-string> / <sc-number> / … Custom Element with the per-field props attached. The element itself is responsible for rendering — the resolver is just a tag-name lookup with property assignment.

    When the consumer registered the elements with a non-empty prefix (registerSchemaComponents("myapp-")), the resolver looks up the prefixed tag from the RegistrationResult.tags map so the right element is instantiated. A consumer that never called registerSchemaComponents falls back to the canonical sc-* names — letting tests render the elements directly with customElements.define while keeping the production path consumer-controlled.

    Implementation note: because Lit's html tagged template does not support dynamically-named element tags, the resolver builds each Custom Element via document.createElement and interpolates the resulting Node into the template. This trades one shared cache entry for any tag prefix — Lit's template caching is keyed on the literal, so all 17 dispatches share the same cache slot — for the loss of strictly-typed attribute templating. Per-field props are still assigned through statically-typed property accessors below.

    Variables

    TYPE_TO_CANONICAL_TAG

    Functions

    createDefaultLitResolver