Skip to content

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

ממשק: RegisterContext ​

אלפא

המצב המשותף שקריאה ל-register() בונה פעם אחת ומעבירה לכל ElementDefinition. הוא מכיל את מתאם הרישום המודע לקידומת, את העזר tag() לסימון מקונן, את קידומת מחלקת ה-CSS I, את דגל התמיכה והנתב של Invoker Commands, את מפעלי wrapper/variantClass/iconSvg ו-נתוני האזוריות (strings, locale, dir, firstDay).

תכונות ​

registry ​

registry: ElementRegistry

אלפא

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


tag ​

tag: (base) => string

אלפא

ממפה שם בסיסי לתג עם הקידומת הפעילה (עבור סימון מקונן, querySelector, tagName).

פרמטרים ​

base ​

string

מחזיר ​

string


I ​

I: object

אלפא

קידומת מחלקת ה-CSS לגיליונות הרכיבים המוטמעים — תמיד instui, נפרדת מקידומת התג.

prefix ​

readonly prefix: "instui"


invokerSupported ​

invokerSupported: boolean

אלפא

האם הדפדפן תומך ב-Invoker Commands API (command/commandfor).


onCommand ​

onCommand: OnCommand

אלפא

נתב את אירועי command של היעד (או גיבוי בלחיצה) למטפל.


wrapper ​

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

אלפא

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

פרמטרים ​

tag ​

string

css ​

string

render ​

(host) => string

options? ​
display? ​

string

invoker? ​

boolean

מחזיר ​

void


variantClass ​

variantClass: (name, host) => string

אלפא

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

פרמטרים ​

name ​

string

host ​

HTMLElement

מחזיר ​

string


iconSvg ​

iconSvg: (name) => string

אלפא

להמיר שם אייקון ל-SVG מוטמע (מחרוזת ריקה כאשר אינו ידוע).

פרמטרים ​

name ​

string

מחזיר ​

string


locale ​

locale: string

אלפא

תג אזוריות BCP47 המשמש לעיצוב של toLocaleDateString ו-Intl.


dir ​

dir: "ltr" | "rtl"

אלפא

כיוון הטקסט הנגזר מחבילת האזור הפעילה.


firstDay ​

firstDay: number

אלפא

יום השבוע הראשון כאינדקס Date.getDay() של JS (0=יום ראשון … 6=שבת).


strings ​

strings: WebComponentStrings

אלפא

מחרוזות ממשק מתורגמות עבור כל רכיבי ההתנהגות.