Skip to content

pantoken / renderers/web-components/src / RegisterContext

อินเทอร์เฟซ: RegisterContext

อัลฟา

สถานะร่วมที่เรียกโดย register() ครั้งเดียวและส่งผ่านไปยังทุก ElementDefinition มันบรรจุอะแดปเตอร์รีจิสทรีที่รู้เรื่องคำนำหน้า ตัวช่วย tag() สำหรับมาร์กอัปซ้อน ชั้น CSS-class คำนำหน้า 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

อัลฟา

วันแรกของสัปดาห์เป็นดรรชนี JS Date.getDay() (0=วันอาทิตย์ … 6=วันเสาร์).


strings

strings: WebComponentStrings

อัลฟา

สตริง UI ที่แปลแล้วสำหรับองค์ประกอบเชิงพฤติกรรมทั้งหมด.