Skip to content

pantoken-root / renderers/web-components/src / RegisterContext

Interface: RegisterContext ​

Alpha

L'état partagé qu'un appel register() construit une fois et transmet à chaque ElementDefinition. Il transporte l'adaptateur de registre conscient du préfixe, l'utilitaire tag() pour le balisage imbriqué, le préfixe de classe CSS I, le drapeau 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

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

Paramètres ​

base ​

string

Renvoie ​

string


I ​

I: object

Alpha

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

prefix ​

readonly prefix: "instui"


invokerSupported ​

invokerSupported: boolean

Alpha

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


onCommand ​

onCommand: OnCommand

Alpha

Acheminer les événements command d'une cible (ou une solution de 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

Renvoie ​

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

Renvoie ​

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

Renvoie ​

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 en tant qu'index JS Date.getDay() (0=dimanche … 6=samedi).


strings ​

strings: WebComponentStrings

Alpha

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