Skip to content

pantoken / renderers/web-components/src / RegisterContext

Atanga: RegisterContext

Alpha

Te āhua tūmatanui e hangaia ana e te karanga register() kotahi anake ka haere iho ki ia ElementDefinition. Ka kawe i te haumanu rēhita mō te kaitūpato ingoa, te awhina tag() mō te tohu pareikura, te tūāhua kāwai CSS I, te tūāpapa tautoko + kaiwhakarite mō ngā Invoker Commands, ngā wheketere wrapper/variantClass/iconSvg, me ngā raraunga rohe (strings, locale, dir, firstDay).

Ngā Rawa

registry

registry: ElementRegistry

Alpha

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


tag

tag: (base) => string

Alpha

Whakaritea he ingoa taketake ki te tūemi tapanga māhaki-ā-ino (mō te tohu pareikura, querySelector, tagName).

Ngā Tawhā

base

string

Whakahokia

string


I

I: object

Alpha

Te tūāhua kāwai CSS mō ngā pepa kōwae kuhu — he wā anō tonu instui, motuhake i te tūāhua tapanga.

prefix

readonly prefix: "instui"


invokerSupported

invokerSupported: boolean

Alpha

Mehemea ka tautoko te pūtirotiro i te API o Invoker Commands (command/commandfor).


onCommand

onCommand: OnCommand

Alpha

Arahina ngā kaupapa command o tētahi whāinga (rānei he mōkī pāwhiri hei whakakapi) kia tae atu ki tētahi kaiwhakahaere.


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).

Ngā Tawhā

tag

string

css

string

render

(host) => string

options?
display?

string

invoker?

boolean

Whakahokia

void


variantClass

variantClass: (name, host) => string

Alpha

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

Ngā Tawhā

name

string

host

HTMLElement

Whakahokia

string


iconSvg

iconSvg: (name) => string

Alpha

Whakaoti te ingoa ā-tahua kia kapi ki te SVG kuhu (kāore he tohu mēnā kāore i te mōhiotia).

Ngā Tawhā

name

string

Whakahokia

string


locale

locale: string

Alpha

Tapanga rohe BCP47 e whakamahia ana mō te whakatakotoranga toLocaleDateString me Intl.


dir

dir: "ltr" | "rtl"

Alpha

Te arahina tuhi e ahu mai ana i te kohinga reo o nāianei.


firstDay

firstDay: number

Alpha

Te rā tuatahi o te wiki hei tohu JS Date.getDay() (0=Rāhina … 6=Rāhoroi).


strings

strings: WebComponentStrings

Alpha

Ngā taurangi atanga-kaiwhakamahi kua whakamaoritia mō ngā āhuatanga whanonga katoa.