Skip to content

pantoken / renderers/web-components/src / RegisterContext

Interface: RegisterContext

Alpha

L'état partagé qu'un appel register() construit une fois et transmet à chaque ElementDefinition. Il contient l'adaptateur de registre conscient du préfixe, l'aide tag() pour le balisage imbriqué, le préfixe de classe CSS I, le flag de prise en charge + le routeur des Invoker Commands, les usines wrapper/variantClass/iconSvg, et les données de locale (strings, locale, dir, firstDay).

Propriétés

registry

registry: ElementRegistry

Alpha

The scoped registry: rewrites instui-<base> → the active-prefix tag on get/define.


tag

tag: (base) => string

Alpha

Mapper un nom de base vers la balise à préfixe actif (pour le balisage imbriqué, querySelector, tagName).

Paramètres

base

string

Retourne

string


I

I: object

Alpha

Le préfixe de classe CSS pour les feuilles de composant en ligne — toujours instui, distinct du préfixe de la balise.

prefix

readonly prefix: "instui"


invokerSupported

invokerSupported: boolean

Alpha

Indique si le navigateur prend en charge l'API Invoker Commands (command/commandfor).


onCommand

onCommand: OnCommand

Alpha

Router les événements command d'une cible (ou utiliser un repli sur clic) vers un gestionnaire.


wrapper

wrapper: (tag, css, render, options?) => void

Alpha

Define a shadow-DOM element: <style>:host{display}css</style> + markup from render(host). invoker: true forwards the host's popovertarget/command to the inner <button> (IDL).

Paramètres

tag

string

css

string

render

(host) => string

options?
display?

string

invoker?

boolean

Retourne

void


variantClass

variantClass: (name, host) => string

Alpha

Build a .instui-<name> class with an optional -color-<variant> modifier from variant.

Paramètres

name

string

host

HTMLElement

Retourne

string


iconSvg

iconSvg: (name) => string

Alpha

Résoudre un nom d'icône en SVG inline (chaîne vide si inconnu).

Paramètres

name

string

Retourne

string


locale

locale: string

Alpha

Étiquette de locale BCP47 utilisée pour le formatage toLocaleDateString et Intl.


dir

dir: "ltr" | "rtl"

Alpha

Direction du texte dérivée du bundle de locale actif.


firstDay

firstDay: number

Alpha

Premier jour de la semaine comme index JS Date.getDay() (0=dimanche … 6=samedi).


strings

strings: WebComponentStrings

Alpha

Chaînes d'interface traduites pour tous les éléments comportementaux.