Skip to content

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

Entèfas: RegisterContext ​

Alfa

Eta pataje yon apèl register() konstwi yon fwa epi pase pou chak ElementDefinition. Li pote adaptè rejis ki okouran prefiks la, èd tag() pou makaj nidifye, prefiks klas CSS la I, drapo sipò + routeur pou Invoker Commands, faktori wrapper/variantClass/iconSvg, ak done lokal (strings, locale, dir, firstDay).

Pwopriyete ​

registry ​

registry: ElementRegistry

Alfa

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


tag ​

tag: (base) => string

Alfa

Mape yon non baz sou tag prefiks-aktif la (pou makaj nidifye, querySelector, tagName).

Paramèt ​

base ​

string

Retounen ​

string


I ​

I: object

Alfa

Prefiks klas CSS pou fichye konpozan anlined yo — toujou instui, separe de prefiks tag la.

prefix ​

readonly prefix: "instui"


invokerSupported ​

invokerSupported: boolean

Alfa

Si navigatè a sipòte Invoker Commands API a (command/commandfor).


onCommand ​

onCommand: OnCommand

Alfa

Route evènman command sib yon sib (oswa yon fallback click) bay yon handler.


wrapper ​

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

Alfa

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èt ​

tag ​

string

css ​

string

render ​

(host) => string

options? ​
display? ​

string

invoker? ​

boolean

Retounen ​

void


variantClass ​

variantClass: (name, host) => string

Alfa

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

Paramèt ​

name ​

string

host ​

HTMLElement

Retounen ​

string


iconSvg ​

iconSvg: (name) => string

Alfa

Rezoud yon non ikòn pou SVG anlined (chèn vid si li pa rekonèt).

Paramèt ​

name ​

string

Retounen ​

string


locale ​

locale: string

Alfa

Tag lokal BCP47 ki itilize pou fòmat toLocaleDateString ak Intl.


dir ​

dir: "ltr" | "rtl"

Alfa

Direksyon tèks sòti nan pake lokal aktif la.


firstDay ​

firstDay: number

Alfa

Premye jou semèn nan kòm endèks JS Date.getDay() (0=Dimanch … 6=Samdi).


strings ​

strings: WebComponentStrings

Alfa

Chèn UI tradui pou tout eleman konpòtman yo.