@typesafe-html5/typescript 0.2.62 → 0.2.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-all.mjs +54 -0
- package/dist/block/article/article.js +465 -0
- package/dist/block/article/article.js.map +7 -0
- package/dist/block/aside/aside.js +476 -0
- package/dist/block/aside/aside.js.map +7 -0
- package/dist/block/audio/audio.js +454 -0
- package/dist/block/audio/audio.js.map +7 -0
- package/dist/block/blockquote/blockquote.js +476 -0
- package/dist/block/blockquote/blockquote.js.map +7 -0
- package/dist/block/body/body.js +378 -0
- package/dist/block/body/body.js.map +7 -0
- package/dist/block/canvas/canvas.js +487 -0
- package/dist/block/canvas/canvas.js.map +7 -0
- package/dist/block/caption/caption.js +465 -0
- package/dist/block/caption/caption.js.map +7 -0
- package/dist/block/colgroup/colgroup.js +190 -0
- package/dist/block/colgroup/colgroup.js.map +7 -0
- package/dist/block/datalist/datalist.js +465 -0
- package/dist/block/datalist/datalist.js.map +7 -0
- package/dist/block/dd/dd.js +422 -0
- package/dist/block/dd/dd.js.map +7 -0
- package/dist/block/del/del.js +487 -0
- package/dist/block/del/del.js.map +7 -0
- package/dist/block/details/details.js +520 -0
- package/dist/block/details/details.js.map +7 -0
- package/dist/block/dialog/dialog.js +520 -0
- package/dist/block/dialog/dialog.js.map +7 -0
- package/dist/block/div/div.js +520 -0
- package/dist/block/div/div.js.map +7 -0
- package/dist/block/dl/dl.js +465 -0
- package/dist/block/dl/dl.js.map +7 -0
- package/dist/block/dt/dt.js +422 -0
- package/dist/block/dt/dt.js.map +7 -0
- package/dist/block/embed/embed.js +333 -0
- package/dist/block/embed/embed.js.map +7 -0
- package/dist/block/fieldset/fieldset.js +509 -0
- package/dist/block/fieldset/fieldset.js.map +7 -0
- package/dist/block/figcaption/figcaption.js +465 -0
- package/dist/block/figcaption/figcaption.js.map +7 -0
- package/dist/block/figure/figure.js +465 -0
- package/dist/block/figure/figure.js.map +7 -0
- package/dist/block/footer/footer.js +476 -0
- package/dist/block/footer/footer.js.map +7 -0
- package/dist/block/form/form.js +443 -0
- package/dist/block/form/form.js.map +7 -0
- package/dist/block/h1/h1.js +454 -0
- package/dist/block/h1/h1.js.map +7 -0
- package/dist/block/h2/h2.js +454 -0
- package/dist/block/h2/h2.js.map +7 -0
- package/dist/block/h3/h3.js +454 -0
- package/dist/block/h3/h3.js.map +7 -0
- package/dist/block/h4/h4.js +454 -0
- package/dist/block/h4/h4.js.map +7 -0
- package/dist/block/h5/h5.js +454 -0
- package/dist/block/h5/h5.js.map +7 -0
- package/dist/block/h6/h6.js +454 -0
- package/dist/block/h6/h6.js.map +7 -0
- package/dist/block/header/header.js +322 -0
- package/dist/block/header/header.js.map +7 -0
- package/dist/block/hgroup/hgroup.js +465 -0
- package/dist/block/hgroup/hgroup.js.map +7 -0
- package/dist/block/hr/hr.js +169 -0
- package/dist/block/hr/hr.js.map +7 -0
- package/dist/block/html/html.js +92 -0
- package/dist/block/html/html.js.map +7 -0
- package/dist/block/iframe/iframe.js +465 -0
- package/dist/block/iframe/iframe.js.map +7 -0
- package/dist/block/ins/ins.js +487 -0
- package/dist/block/ins/ins.js.map +7 -0
- package/dist/block/legend/legend.js +465 -0
- package/dist/block/legend/legend.js.map +7 -0
- package/dist/block/li/li.js +488 -0
- package/dist/block/li/li.js.map +7 -0
- package/dist/block/main/main.js +444 -0
- package/dist/block/main/main.js.map +7 -0
- package/dist/block/map/map.js +476 -0
- package/dist/block/map/map.js.map +7 -0
- package/dist/block/menu/menu.js +498 -0
- package/dist/block/menu/menu.js.map +7 -0
- package/dist/block/nav/nav.js +455 -0
- package/dist/block/nav/nav.js.map +7 -0
- package/dist/block/noscript/noscript.js +311 -0
- package/dist/block/noscript/noscript.js.map +7 -0
- package/dist/block/object/object.js +542 -0
- package/dist/block/object/object.js.map +7 -0
- package/dist/block/ol/ol.js +542 -0
- package/dist/block/ol/ol.js.map +7 -0
- package/dist/block/optgroup/optgroup.js +476 -0
- package/dist/block/optgroup/optgroup.js.map +7 -0
- package/dist/block/option/option.js +542 -0
- package/dist/block/option/option.js.map +7 -0
- package/dist/block/p/p.js +465 -0
- package/dist/block/p/p.js.map +7 -0
- package/dist/block/picture/picture.js +465 -0
- package/dist/block/picture/picture.js.map +7 -0
- package/dist/block/pre/pre.js +465 -0
- package/dist/block/pre/pre.js.map +7 -0
- package/dist/block/section/section.js +487 -0
- package/dist/block/section/section.js.map +7 -0
- package/dist/block/summary/summary.js +466 -0
- package/dist/block/summary/summary.js.map +7 -0
- package/dist/block/table/table.js +509 -0
- package/dist/block/table/table.js.map +7 -0
- package/dist/block/tbody/tbody.js +465 -0
- package/dist/block/tbody/tbody.js.map +7 -0
- package/dist/block/td/td.js +575 -0
- package/dist/block/td/td.js.map +7 -0
- package/dist/block/template/template.js +465 -0
- package/dist/block/template/template.js.map +7 -0
- package/dist/block/tfoot/tfoot.js +465 -0
- package/dist/block/tfoot/tfoot.js.map +7 -0
- package/dist/block/th/th.js +586 -0
- package/dist/block/th/th.js.map +7 -0
- package/dist/block/thead/thead.js +465 -0
- package/dist/block/thead/thead.js.map +7 -0
- package/dist/block/tr/tr.js +586 -0
- package/dist/block/tr/tr.js.map +7 -0
- package/dist/block/ul/ul.js +509 -0
- package/dist/block/ul/ul.js.map +7 -0
- package/dist/block/video/video.js +575 -0
- package/dist/block/video/video.js.map +7 -0
- package/dist/index.js +48830 -0
- package/dist/index.js.map +7 -0
- package/dist/inline/a/a.js +586 -0
- package/dist/inline/a/a.js.map +7 -0
- package/dist/inline/abbr/abbr.js +454 -0
- package/dist/inline/abbr/abbr.js.map +7 -0
- package/dist/inline/address/address.js +443 -0
- package/dist/inline/address/address.js.map +7 -0
- package/dist/inline/b/b.js +465 -0
- package/dist/inline/b/b.js.map +7 -0
- package/dist/inline/bdi/bdi.js +454 -0
- package/dist/inline/bdi/bdi.js.map +7 -0
- package/dist/inline/bdo/bdo.js +465 -0
- package/dist/inline/bdo/bdo.js.map +7 -0
- package/dist/inline/button/button.js +685 -0
- package/dist/inline/button/button.js.map +7 -0
- package/dist/inline/cite/cite.js +465 -0
- package/dist/inline/cite/cite.js.map +7 -0
- package/dist/inline/code/code.js +465 -0
- package/dist/inline/code/code.js.map +7 -0
- package/dist/inline/data/data.js +476 -0
- package/dist/inline/data/data.js.map +7 -0
- package/dist/inline/dfn/dfn.js +465 -0
- package/dist/inline/dfn/dfn.js.map +7 -0
- package/dist/inline/em/em.js +465 -0
- package/dist/inline/em/em.js.map +7 -0
- package/dist/inline/i/i.js +465 -0
- package/dist/inline/i/i.js.map +7 -0
- package/dist/inline/img/img.js +399 -0
- package/dist/inline/img/img.js.map +7 -0
- package/dist/inline/input/input.js +938 -0
- package/dist/inline/input/input.js.map +7 -0
- package/dist/inline/kbd/kbd.js +465 -0
- package/dist/inline/kbd/kbd.js.map +7 -0
- package/dist/inline/label/label.js +487 -0
- package/dist/inline/label/label.js.map +7 -0
- package/dist/inline/mark/mark.js +465 -0
- package/dist/inline/mark/mark.js.map +7 -0
- package/dist/inline/meter/meter.js +498 -0
- package/dist/inline/meter/meter.js.map +7 -0
- package/dist/inline/output/output.js +410 -0
- package/dist/inline/output/output.js.map +7 -0
- package/dist/inline/progress/progress.js +454 -0
- package/dist/inline/progress/progress.js.map +7 -0
- package/dist/inline/q/q.js +476 -0
- package/dist/inline/q/q.js.map +7 -0
- package/dist/inline/rp/rp.js +465 -0
- package/dist/inline/rp/rp.js.map +7 -0
- package/dist/inline/rt/rt.js +465 -0
- package/dist/inline/rt/rt.js.map +7 -0
- package/dist/inline/ruby/ruby.js +465 -0
- package/dist/inline/ruby/ruby.js.map +7 -0
- package/dist/inline/s/s.js +465 -0
- package/dist/inline/s/s.js.map +7 -0
- package/dist/inline/samp/samp.js +465 -0
- package/dist/inline/samp/samp.js.map +7 -0
- package/dist/inline/select/select.js +674 -0
- package/dist/inline/select/select.js.map +7 -0
- package/dist/inline/slot/slot.js +476 -0
- package/dist/inline/slot/slot.js.map +7 -0
- package/dist/inline/small/small.js +465 -0
- package/dist/inline/small/small.js.map +7 -0
- package/dist/inline/span/span.js +465 -0
- package/dist/inline/span/span.js.map +7 -0
- package/dist/inline/strong/strong.js +465 -0
- package/dist/inline/strong/strong.js.map +7 -0
- package/dist/inline/sub/sub.js +465 -0
- package/dist/inline/sub/sub.js.map +7 -0
- package/dist/inline/sup/sup.js +465 -0
- package/dist/inline/sup/sup.js.map +7 -0
- package/dist/inline/svg/svg.js +542 -0
- package/dist/inline/svg/svg.js.map +7 -0
- package/dist/inline/textarea/textarea.js +718 -0
- package/dist/inline/textarea/textarea.js.map +7 -0
- package/dist/inline/time/time.js +476 -0
- package/dist/inline/time/time.js.map +7 -0
- package/dist/inline/u/u.js +465 -0
- package/dist/inline/u/u.js.map +7 -0
- package/dist/inline/var/var.js +465 -0
- package/dist/inline/var/var.js.map +7 -0
- package/dist/void/area/area.js +388 -0
- package/dist/void/area/area.js.map +7 -0
- package/dist/void/base/base.js +37 -0
- package/dist/void/base/base.js.map +7 -0
- package/dist/void/br/br.js +135 -0
- package/dist/void/br/br.js.map +7 -0
- package/dist/void/col/col.js +135 -0
- package/dist/void/col/col.js.map +7 -0
- package/dist/void/head/head.js +37 -0
- package/dist/void/head/head.js.map +7 -0
- package/dist/void/link/link.js +213 -0
- package/dist/void/link/link.js.map +7 -0
- package/dist/void/meta/meta.js +147 -0
- package/dist/void/meta/meta.js.map +7 -0
- package/dist/void/param/param.js +146 -0
- package/dist/void/param/param.js.map +7 -0
- package/dist/void/script/script.js +213 -0
- package/dist/void/script/script.js.map +7 -0
- package/dist/void/source/source.js +168 -0
- package/dist/void/source/source.js.map +7 -0
- package/dist/void/style/style.js +147 -0
- package/dist/void/style/style.js.map +7 -0
- package/dist/void/title/title.js +37 -0
- package/dist/void/title/title.js.map +7 -0
- package/dist/void/track/track.js +190 -0
- package/dist/void/track/track.js.map +7 -0
- package/dist/void/wbr/wbr.js +124 -0
- package/dist/void/wbr/wbr.js.map +7 -0
- package/package.json +4 -4
- package/src/block/article/article.ts +649 -0
- package/{block → src/block}/aside/aside.ts +144 -1
- package/{block → src/block}/audio/audio.ts +128 -1
- package/src/block/blockquote/blockquote.ts +665 -0
- package/{block → src/block}/body/body.ts +91 -1
- package/{block → src/block}/canvas/canvas.ts +144 -1
- package/src/block/caption/caption.ts +649 -0
- package/{block → src/block}/colgroup/colgroup.ts +96 -1
- package/src/block/datalist/datalist.ts +649 -0
- package/{block/dialog/dialog.ts → src/block/dd/dd.ts} +114 -88
- package/{block → src/block}/del/del.ts +144 -1
- package/src/block/details/details.ts +729 -0
- package/src/block/dialog/dialog.ts +729 -0
- package/src/block/div/div.ts +729 -0
- package/src/block/dl/dl.ts +649 -0
- package/{block/details/details.ts → src/block/dt/dt.ts} +114 -88
- package/{block → src/block}/embed/embed.ts +144 -1
- package/{block → src/block}/fieldset/fieldset.ts +144 -1
- package/src/block/figcaption/figcaption.ts +649 -0
- package/src/block/figure/figure.ts +649 -0
- package/src/block/footer/footer.ts +665 -0
- package/{block → src/block}/form/form.ts +132 -5
- package/src/block/h1/h1.ts +633 -0
- package/src/block/h2/h2.ts +633 -0
- package/src/block/h3/h3.ts +633 -0
- package/src/block/h4/h4.ts +633 -0
- package/src/block/h5/h5.ts +633 -0
- package/src/block/h6/h6.ts +633 -0
- package/{block → src/block}/header/header.ts +144 -1
- package/src/block/hgroup/hgroup.ts +649 -0
- package/{block → src/block}/hr/hr.ts +59 -1
- package/{block → src/block}/html/html.ts +27 -1
- package/{block → src/block}/iframe/iframe.ts +112 -1
- package/{block → src/block}/ins/ins.ts +144 -1
- package/src/block/legend/legend.ts +649 -0
- package/{block → src/block}/li/li.ts +107 -1
- package/{block/div/div.ts → src/block/main/main.ts} +112 -54
- package/src/block/map/map.ts +665 -0
- package/{block → src/block}/menu/menu.ts +144 -1
- package/{block → src/block}/nav/nav.ts +107 -1
- package/{block → src/block}/noscript/noscript.ts +144 -1
- package/{block → src/block}/object/object.ts +144 -1
- package/{block → src/block}/ol/ol.ts +144 -1
- package/{block → src/block}/optgroup/optgroup.ts +144 -1
- package/{block → src/block}/option/option.ts +144 -1
- package/src/block/p/p.ts +649 -0
- package/src/block/picture/picture.ts +649 -0
- package/src/block/pre/pre.ts +649 -0
- package/{block → src/block}/section/section.ts +144 -1
- package/{block → src/block}/summary/summary.ts +107 -1
- package/{block → src/block}/table/table.ts +144 -1
- package/src/block/tbody/tbody.ts +649 -0
- package/{block → src/block}/td/td.ts +144 -1
- package/src/block/template/template.ts +649 -0
- package/src/block/tfoot/tfoot.ts +649 -0
- package/{block → src/block}/th/th.ts +144 -1
- package/src/block/thead/thead.ts +649 -0
- package/{block → src/block}/tr/tr.ts +144 -1
- package/{block → src/block}/ul/ul.ts +144 -1
- package/{block → src/block}/video/video.ts +144 -1
- package/{inline → src/inline}/a/a.ts +144 -1
- package/src/inline/abbr/abbr.ts +633 -0
- package/src/inline/address/address.ts +617 -0
- package/src/inline/b/b.ts +649 -0
- package/src/inline/bdi/bdi.ts +633 -0
- package/src/inline/bdo/bdo.ts +649 -0
- package/{inline → src/inline}/button/button.ts +145 -2
- package/src/inline/cite/cite.ts +649 -0
- package/src/inline/code/code.ts +649 -0
- package/src/inline/data/data.ts +665 -0
- package/src/inline/dfn/dfn.ts +649 -0
- package/src/inline/em/em.ts +649 -0
- package/src/inline/i/i.ts +649 -0
- package/{inline → src/inline}/img/img.ts +112 -1
- package/{inline → src/inline}/input/input.ts +145 -2
- package/src/inline/kbd/kbd.ts +649 -0
- package/{inline → src/inline}/label/label.ts +144 -1
- package/src/inline/mark/mark.ts +649 -0
- package/{inline → src/inline}/meter/meter.ts +144 -1
- package/{inline → src/inline}/output/output.ts +144 -1
- package/{inline → src/inline}/progress/progress.ts +144 -1
- package/src/inline/q/q.ts +665 -0
- package/src/inline/rp/rp.ts +649 -0
- package/src/inline/rt/rt.ts +649 -0
- package/src/inline/ruby/ruby.ts +649 -0
- package/src/inline/s/s.ts +649 -0
- package/src/inline/samp/samp.ts +649 -0
- package/{inline → src/inline}/select/select.ts +144 -1
- package/src/inline/slot/slot.ts +665 -0
- package/src/inline/small/small.ts +649 -0
- package/src/inline/span/span.ts +649 -0
- package/src/inline/strong/strong.ts +649 -0
- package/src/inline/sub/sub.ts +649 -0
- package/src/inline/sup/sup.ts +649 -0
- package/{inline → src/inline}/svg/svg.ts +144 -1
- package/{inline → src/inline}/textarea/textarea.ts +144 -1
- package/src/inline/time/time.ts +665 -0
- package/src/inline/u/u.ts +649 -0
- package/src/inline/var/var.ts +649 -0
- package/{void → src/void}/area/area.ts +144 -1
- package/{void → src/void}/base/base.ts +1 -1
- package/src/void/br/br.ts +172 -0
- package/src/void/col/col.ts +172 -0
- package/{void → src/void}/head/head.ts +1 -1
- package/{void → src/void}/link/link.ts +59 -1
- package/{void → src/void}/meta/meta.ts +59 -1
- package/src/void/param/param.ts +188 -0
- package/{void → src/void}/script/script.ts +59 -1
- package/src/void/source/source.ts +220 -0
- package/{void → src/void}/style/style.ts +59 -1
- package/{void → src/void}/title/title.ts +1 -1
- package/{void → src/void}/track/track.ts +96 -1
- package/src/void/wbr/wbr.ts +156 -0
- package/block/article/article.ts +0 -506
- package/block/blockquote/blockquote.ts +0 -522
- package/block/caption/caption.ts +0 -506
- package/block/datalist/datalist.ts +0 -506
- package/block/dd/dd.ts +0 -506
- package/block/dl/dl.ts +0 -506
- package/block/dt/dt.ts +0 -506
- package/block/figcaption/figcaption.ts +0 -506
- package/block/figure/figure.ts +0 -506
- package/block/footer/footer.ts +0 -522
- package/block/h1/h1.ts +0 -490
- package/block/h2/h2.ts +0 -490
- package/block/h3/h3.ts +0 -490
- package/block/h4/h4.ts +0 -490
- package/block/h5/h5.ts +0 -490
- package/block/h6/h6.ts +0 -490
- package/block/hgroup/hgroup.ts +0 -506
- package/block/legend/legend.ts +0 -506
- package/block/main/main.ts +0 -538
- package/block/map/map.ts +0 -522
- package/block/p/p.ts +0 -506
- package/block/picture/picture.ts +0 -506
- package/block/pre/pre.ts +0 -506
- package/block/tbody/tbody.ts +0 -506
- package/block/template/template.ts +0 -506
- package/block/tfoot/tfoot.ts +0 -506
- package/block/thead/thead.ts +0 -506
- package/inline/abbr/abbr.ts +0 -490
- package/inline/address/address.ts +0 -474
- package/inline/b/b.ts +0 -506
- package/inline/bdi/bdi.ts +0 -490
- package/inline/bdo/bdo.ts +0 -506
- package/inline/cite/cite.ts +0 -506
- package/inline/code/code.ts +0 -506
- package/inline/data/data.ts +0 -522
- package/inline/dfn/dfn.ts +0 -506
- package/inline/em/em.ts +0 -506
- package/inline/i/i.ts +0 -506
- package/inline/kbd/kbd.ts +0 -506
- package/inline/mark/mark.ts +0 -506
- package/inline/q/q.ts +0 -522
- package/inline/rp/rp.ts +0 -506
- package/inline/rt/rt.ts +0 -506
- package/inline/ruby/ruby.ts +0 -506
- package/inline/s/s.ts +0 -506
- package/inline/samp/samp.ts +0 -506
- package/inline/slot/slot.ts +0 -522
- package/inline/small/small.ts +0 -506
- package/inline/span/span.ts +0 -506
- package/inline/strong/strong.ts +0 -506
- package/inline/sub/sub.ts +0 -506
- package/inline/sup/sup.ts +0 -506
- package/inline/time/time.ts +0 -522
- package/inline/u/u.ts +0 -506
- package/inline/var/var.ts +0 -506
- package/void/br/br.ts +0 -77
- package/void/col/col.ts +0 -77
- package/void/param/param.ts +0 -93
- package/void/source/source.ts +0 -125
- package/void/wbr/wbr.ts +0 -61
- /package/{index.ts → src/index.ts} +0 -0
- /package/{tsconfig.json → src/tsconfig.json} +0 -0
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
|
|
3
|
+
*
|
|
4
|
+
* @generated January 2, 2026 15:45:45
|
|
5
|
+
* @component Abbr
|
|
6
|
+
* @description
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface AbbrProps {
|
|
10
|
+
/**
|
|
11
|
+
* Child content or elements
|
|
12
|
+
*/
|
|
13
|
+
children?: string | HTMLElement | (string | HTMLElement)[];
|
|
14
|
+
/**
|
|
15
|
+
* Keyboard shortcut to activate or focus the element
|
|
16
|
+
*/
|
|
17
|
+
accessKey?: string;
|
|
18
|
+
/**
|
|
19
|
+
* specifies a shortcut key (or keys) to activate or focus an element
|
|
20
|
+
*/
|
|
21
|
+
accesskey?: string | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Mapping of Alpine.js directives (shorthand or full) to their values (e.g., {@click: "do()"} or {"x-on:click":"do()"})
|
|
24
|
+
*/
|
|
25
|
+
'alpine-attributes'?: Record<string, string> | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether assistive technologies should present the entire region as a whole when changes occur.
|
|
28
|
+
*/
|
|
29
|
+
'aria-atomic'?: 'false' | 'true' | boolean | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The aria-busy attribute is used to indicate whether an element is currently busy or not.
|
|
32
|
+
*/
|
|
33
|
+
'aria-busy'?: 'true' | 'false' | boolean | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Identifies the element(s) whose contents or presence are controlled by this element. Value is a list of IDs separated by a space
|
|
36
|
+
*/
|
|
37
|
+
'aria-controls'?: string | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Identifies the element(s) that describes the object. Value is a list of IDs separated by a space
|
|
40
|
+
*/
|
|
41
|
+
'aria-describedby'?: string | null | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* References an element that provides additional details about the current element.
|
|
44
|
+
*/
|
|
45
|
+
'aria-details'?: string | null | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Defines keyboard shortcuts available for the element.
|
|
48
|
+
*/
|
|
49
|
+
'aria-keyshortcuts'?: string | null | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
|
|
52
|
+
*/
|
|
53
|
+
'aria-labelledby'?: string | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Defines how updates to the element should be announced to screen readers.
|
|
56
|
+
*/
|
|
57
|
+
'aria-live'?: 'off' | 'polite' | 'assertive' | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates what content changes should be announced in a live region.
|
|
60
|
+
*/
|
|
61
|
+
'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Provides a human-readable custom role description for assistive technologies.
|
|
64
|
+
*/
|
|
65
|
+
'aria-roledescription'?: string | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Represents the autocapitalize behavior of the element
|
|
68
|
+
*/
|
|
69
|
+
autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates whether the element is hidden
|
|
72
|
+
*/
|
|
73
|
+
autofocus?: boolean | null | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* CSS class names
|
|
76
|
+
*/
|
|
77
|
+
className?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the element is editable
|
|
80
|
+
*/
|
|
81
|
+
contentEditable?: boolean | "true" | "false" | "inherit";
|
|
82
|
+
/**
|
|
83
|
+
* Indicates whether the element can be edited in place
|
|
84
|
+
*/
|
|
85
|
+
contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Mapping of data-* attributes to their values (e.g., {"test":"value"} -> data-test="value")
|
|
88
|
+
*/
|
|
89
|
+
'data-attributes'?: Record<string, string> | null | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Represents the text direction of the element
|
|
92
|
+
*/
|
|
93
|
+
dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Indicates whether the element is draggable
|
|
96
|
+
*/
|
|
97
|
+
draggable?: boolean | null | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Indicates whether the element is hidden
|
|
100
|
+
*/
|
|
101
|
+
hidden?: boolean | null | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Unique identifier
|
|
104
|
+
*/
|
|
105
|
+
id?: string;
|
|
106
|
+
/**
|
|
107
|
+
* used to specify the data entry mode for an input. It helps guide on-screen keyboards (especially on mobile devices) to show the appropriate layout for the expected input type
|
|
108
|
+
*/
|
|
109
|
+
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Specifies the primary language for the element's content
|
|
112
|
+
*/
|
|
113
|
+
lang?: string | null | undefined;
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
popover?: 'auto' | 'hint' | 'manual' | null | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Defines the semantic purpose of an element for assistive technologies.
|
|
120
|
+
*/
|
|
121
|
+
role?: 'alert' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'complementary' | 'contentinfo' | 'dialog' | 'form' | 'grid' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'main' | 'menu' | 'menubar' | 'menuitem' | 'navigation' | 'none' | 'presentation' | 'radio' | 'region' | 'search' | 'status' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'toolbar' | 'tooltip' | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Represents a slot in a shadow DOM
|
|
124
|
+
*/
|
|
125
|
+
slot?: string | null | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Represents the spellchecking behavior of the element
|
|
128
|
+
*/
|
|
129
|
+
spellcheck?: 'true' | 'false' | boolean | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Represents the CSS inline style of the element
|
|
132
|
+
*/
|
|
133
|
+
style?: string | null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Tab order position
|
|
136
|
+
*/
|
|
137
|
+
tabIndex?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Represents a tab order of the element
|
|
140
|
+
*/
|
|
141
|
+
tabindex?: number | null | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Represents a title or tooltip for the element
|
|
144
|
+
*/
|
|
145
|
+
title?: string | null | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* used to tell user agents whether the content should be translated.
|
|
148
|
+
*/
|
|
149
|
+
translate?: 'yes' | 'no' | null | undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Abbr -
|
|
154
|
+
*/
|
|
155
|
+
export class Abbr {
|
|
156
|
+
private element: HTMLElement;
|
|
157
|
+
|
|
158
|
+
constructor(props: AbbrProps = {}) {
|
|
159
|
+
this.element = document.createElement('abbr');
|
|
160
|
+
this.applyProps(props);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private applyProps(props: AbbrProps): void {
|
|
164
|
+
if (props.children !== undefined) {
|
|
165
|
+
this.setChildren(props.children);
|
|
166
|
+
}
|
|
167
|
+
if (props.accessKey !== undefined) {
|
|
168
|
+
this.element.setAttribute('accessKey', String(props.accessKey));
|
|
169
|
+
}
|
|
170
|
+
if (props.accesskey !== undefined) {
|
|
171
|
+
this.element.setAttribute('accesskey', String(props.accesskey));
|
|
172
|
+
}
|
|
173
|
+
if (props['alpine-attributes'] !== undefined) {
|
|
174
|
+
const __map = props['alpine-attributes'];
|
|
175
|
+
if (__map !== null && __map !== undefined) {
|
|
176
|
+
for (const __k in __map) {
|
|
177
|
+
const __v = (__map as any)[__k];
|
|
178
|
+
let __attr = __k;
|
|
179
|
+
if (__k.startsWith('@')) { __attr = 'x-on:' + __k.slice(1); }
|
|
180
|
+
else if (__k.startsWith(':')) { __attr = 'x-bind:' + __k.slice(1); }
|
|
181
|
+
else if (__k.startsWith('.')) { __attr = 'x-model' + __k; }
|
|
182
|
+
else if (!__k.startsWith('x-') && ['show','text','html','if','for','cloak','init','data','effect','ignore','ref','transition','teleport'].includes(__k)) { __attr = 'x-' + __k; }
|
|
183
|
+
this.element.setAttribute(__attr, String(__v));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (props['aria-atomic'] !== undefined) {
|
|
188
|
+
this.setAriaAtomic(props['aria-atomic']);
|
|
189
|
+
}
|
|
190
|
+
if (props['aria-busy'] !== undefined) {
|
|
191
|
+
this.setAriaBusy(props['aria-busy']);
|
|
192
|
+
}
|
|
193
|
+
if (props['aria-controls'] !== undefined) {
|
|
194
|
+
this.element.setAttribute('aria-controls', String(props['aria-controls']));
|
|
195
|
+
}
|
|
196
|
+
if (props['aria-describedby'] !== undefined) {
|
|
197
|
+
this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
|
|
198
|
+
}
|
|
199
|
+
if (props['aria-details'] !== undefined) {
|
|
200
|
+
this.element.setAttribute('aria-details', String(props['aria-details']));
|
|
201
|
+
}
|
|
202
|
+
if (props['aria-keyshortcuts'] !== undefined) {
|
|
203
|
+
this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
|
|
204
|
+
}
|
|
205
|
+
if (props['aria-labelledby'] !== undefined) {
|
|
206
|
+
this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
|
|
207
|
+
}
|
|
208
|
+
if (props['aria-live'] !== undefined) {
|
|
209
|
+
this.setAriaLive(props['aria-live']);
|
|
210
|
+
}
|
|
211
|
+
if (props['aria-relevant'] !== undefined) {
|
|
212
|
+
this.setAriaRelevant(props['aria-relevant']);
|
|
213
|
+
}
|
|
214
|
+
if (props['aria-roledescription'] !== undefined) {
|
|
215
|
+
this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
|
|
216
|
+
}
|
|
217
|
+
if (props.autocapitalize !== undefined) {
|
|
218
|
+
this.setAutocapitalize(props.autocapitalize);
|
|
219
|
+
}
|
|
220
|
+
if (props.autofocus !== undefined) {
|
|
221
|
+
this.element.setAttribute('autofocus', String(props.autofocus));
|
|
222
|
+
}
|
|
223
|
+
if (props.className !== undefined) {
|
|
224
|
+
this.element.setAttribute('className', String(props.className));
|
|
225
|
+
}
|
|
226
|
+
if (props.contentEditable !== undefined) {
|
|
227
|
+
this.element.setAttribute('contentEditable', String(props.contentEditable));
|
|
228
|
+
}
|
|
229
|
+
if (props.contenteditable !== undefined) {
|
|
230
|
+
this.setContenteditable(props.contenteditable);
|
|
231
|
+
}
|
|
232
|
+
if (props['data-attributes'] !== undefined) {
|
|
233
|
+
const __map = props['data-attributes'];
|
|
234
|
+
if (__map !== null && __map !== undefined) {
|
|
235
|
+
for (const __k in __map) {
|
|
236
|
+
this.element.setAttribute(`data-${__k}`, String((__map as any)[__k]));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (props.dir !== undefined) {
|
|
241
|
+
this.setDir(props.dir);
|
|
242
|
+
}
|
|
243
|
+
if (props.draggable !== undefined) {
|
|
244
|
+
this.element.setAttribute('draggable', String(props.draggable));
|
|
245
|
+
}
|
|
246
|
+
if (props.hidden !== undefined) {
|
|
247
|
+
this.element.setAttribute('hidden', String(props.hidden));
|
|
248
|
+
}
|
|
249
|
+
if (props.id !== undefined) {
|
|
250
|
+
this.element.setAttribute('id', String(props.id));
|
|
251
|
+
}
|
|
252
|
+
if (props.inputmode !== undefined) {
|
|
253
|
+
this.setInputmode(props.inputmode);
|
|
254
|
+
}
|
|
255
|
+
if (props.lang !== undefined) {
|
|
256
|
+
this.element.setAttribute('lang', String(props.lang));
|
|
257
|
+
}
|
|
258
|
+
if (props.popover !== undefined) {
|
|
259
|
+
this.setPopover(props.popover);
|
|
260
|
+
}
|
|
261
|
+
if (props.role !== undefined) {
|
|
262
|
+
this.setRole(props.role);
|
|
263
|
+
}
|
|
264
|
+
if (props.slot !== undefined) {
|
|
265
|
+
this.element.setAttribute('slot', String(props.slot));
|
|
266
|
+
}
|
|
267
|
+
if (props.spellcheck !== undefined) {
|
|
268
|
+
this.setSpellcheck(props.spellcheck);
|
|
269
|
+
}
|
|
270
|
+
if (props.style !== undefined) {
|
|
271
|
+
this.element.setAttribute('style', String(props.style));
|
|
272
|
+
}
|
|
273
|
+
if (props.tabIndex !== undefined) {
|
|
274
|
+
this.element.setAttribute('tabIndex', String(props.tabIndex));
|
|
275
|
+
}
|
|
276
|
+
if (props.tabindex !== undefined) {
|
|
277
|
+
this.element.setAttribute('tabindex', String(props.tabindex));
|
|
278
|
+
}
|
|
279
|
+
if (props.title !== undefined) {
|
|
280
|
+
this.element.setAttribute('title', String(props.title));
|
|
281
|
+
}
|
|
282
|
+
if (props.translate !== undefined) {
|
|
283
|
+
this.setTranslate(props.translate);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
setAccessKey(value: string): this {
|
|
288
|
+
if (value === null || value === undefined) {
|
|
289
|
+
this.element.removeAttribute('accessKey');
|
|
290
|
+
} else {
|
|
291
|
+
this.element.setAttribute('accessKey', String(value));
|
|
292
|
+
}
|
|
293
|
+
return this;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
setAccesskey(value: string | null | undefined): this {
|
|
297
|
+
if (value === null || value === undefined) {
|
|
298
|
+
this.element.removeAttribute('accesskey');
|
|
299
|
+
} else {
|
|
300
|
+
this.element.setAttribute('accesskey', String(value));
|
|
301
|
+
}
|
|
302
|
+
return this;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
setAlpineAttributes(value: string | null | undefined): this {
|
|
306
|
+
if (value === null || value === undefined) {
|
|
307
|
+
// Remove all x-* Alpine attributes (best-effort)
|
|
308
|
+
for (const __a of Array.from(this.element.attributes)) {
|
|
309
|
+
if ((__a as Attr).name.startsWith('x-')) { (this.element as HTMLElement).removeAttribute((__a as Attr).name); }
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
for (const __k in value as Record<string, string>) {
|
|
313
|
+
let __attr = __k;
|
|
314
|
+
if (__k.startsWith('@')) { __attr = 'x-on:' + __k.slice(1); }
|
|
315
|
+
else if (__k.startsWith(':')) { __attr = 'x-bind:' + __k.slice(1); }
|
|
316
|
+
else if (__k.startsWith('.')) { __attr = 'x-model' + __k; }
|
|
317
|
+
else if (!__k.startsWith('x-') && ['show','text','html','if','for','cloak','init','data','effect','ignore','ref','transition','teleport'].includes(__k)) { __attr = 'x-' + __k; }
|
|
318
|
+
this.element.setAttribute(__attr, String((value as any)[__k]));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return this;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
setAriaAtomic(value: 'false' | 'true' | boolean | null | undefined): this {
|
|
325
|
+
if (value === null || value === undefined) {
|
|
326
|
+
this.element.removeAttribute('aria-atomic');
|
|
327
|
+
} else {
|
|
328
|
+
this.element.setAttribute('aria-atomic', String(value));
|
|
329
|
+
}
|
|
330
|
+
return this;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
setAriaBusy(value: 'true' | 'false' | boolean | null | undefined): this {
|
|
334
|
+
if (value === null || value === undefined) {
|
|
335
|
+
this.element.removeAttribute('aria-busy');
|
|
336
|
+
} else {
|
|
337
|
+
this.element.setAttribute('aria-busy', String(value));
|
|
338
|
+
}
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
setAriaControls(value: string | null | undefined): this {
|
|
343
|
+
if (value === null || value === undefined) {
|
|
344
|
+
this.element.removeAttribute('aria-controls');
|
|
345
|
+
} else {
|
|
346
|
+
this.element.setAttribute('aria-controls', String(value));
|
|
347
|
+
}
|
|
348
|
+
return this;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
setAriaDescribedby(value: string | null | undefined): this {
|
|
352
|
+
if (value === null || value === undefined) {
|
|
353
|
+
this.element.removeAttribute('aria-describedby');
|
|
354
|
+
} else {
|
|
355
|
+
this.element.setAttribute('aria-describedby', String(value));
|
|
356
|
+
}
|
|
357
|
+
return this;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
setAriaDetails(value: string | null | undefined): this {
|
|
361
|
+
if (value === null || value === undefined) {
|
|
362
|
+
this.element.removeAttribute('aria-details');
|
|
363
|
+
} else {
|
|
364
|
+
this.element.setAttribute('aria-details', String(value));
|
|
365
|
+
}
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
setAriaKeyshortcuts(value: string | null | undefined): this {
|
|
370
|
+
if (value === null || value === undefined) {
|
|
371
|
+
this.element.removeAttribute('aria-keyshortcuts');
|
|
372
|
+
} else {
|
|
373
|
+
this.element.setAttribute('aria-keyshortcuts', String(value));
|
|
374
|
+
}
|
|
375
|
+
return this;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
setAriaLabelledby(value: string | null | undefined): this {
|
|
379
|
+
if (value === null || value === undefined) {
|
|
380
|
+
this.element.removeAttribute('aria-labelledby');
|
|
381
|
+
} else {
|
|
382
|
+
this.element.setAttribute('aria-labelledby', String(value));
|
|
383
|
+
}
|
|
384
|
+
return this;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
|
|
388
|
+
if (value === null || value === undefined) {
|
|
389
|
+
this.element.removeAttribute('aria-live');
|
|
390
|
+
} else {
|
|
391
|
+
this.element.setAttribute('aria-live', String(value));
|
|
392
|
+
}
|
|
393
|
+
return this;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
|
|
397
|
+
if (value === null || value === undefined) {
|
|
398
|
+
this.element.removeAttribute('aria-relevant');
|
|
399
|
+
} else {
|
|
400
|
+
this.element.setAttribute('aria-relevant', String(value));
|
|
401
|
+
}
|
|
402
|
+
return this;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
setAriaRoledescription(value: string | null | undefined): this {
|
|
406
|
+
if (value === null || value === undefined) {
|
|
407
|
+
this.element.removeAttribute('aria-roledescription');
|
|
408
|
+
} else {
|
|
409
|
+
this.element.setAttribute('aria-roledescription', String(value));
|
|
410
|
+
}
|
|
411
|
+
return this;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
|
|
415
|
+
if (value === null || value === undefined) {
|
|
416
|
+
this.element.removeAttribute('autocapitalize');
|
|
417
|
+
} else {
|
|
418
|
+
this.element.setAttribute('autocapitalize', String(value));
|
|
419
|
+
}
|
|
420
|
+
return this;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
setAutofocus(value: boolean | null | undefined): this {
|
|
424
|
+
if (value === true) {
|
|
425
|
+
this.element.setAttribute('autofocus', '');
|
|
426
|
+
} else {
|
|
427
|
+
this.element.removeAttribute('autofocus');
|
|
428
|
+
}
|
|
429
|
+
return this;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
setClassName(value: string): this {
|
|
433
|
+
if (value === null || value === undefined) {
|
|
434
|
+
this.element.removeAttribute('className');
|
|
435
|
+
} else {
|
|
436
|
+
this.element.setAttribute('className', String(value));
|
|
437
|
+
}
|
|
438
|
+
return this;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
setContentEditable(value: boolean | "true" | "false" | "inherit"): this {
|
|
442
|
+
if (value === true) {
|
|
443
|
+
this.element.setAttribute('contentEditable', '');
|
|
444
|
+
} else {
|
|
445
|
+
this.element.removeAttribute('contentEditable');
|
|
446
|
+
}
|
|
447
|
+
return this;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
|
|
451
|
+
if (value === null || value === undefined) {
|
|
452
|
+
this.element.removeAttribute('contenteditable');
|
|
453
|
+
} else {
|
|
454
|
+
this.element.setAttribute('contenteditable', String(value));
|
|
455
|
+
}
|
|
456
|
+
return this;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
setDataAttributes(value: Record<string, string>): this {
|
|
460
|
+
if (value === null || value === undefined) {
|
|
461
|
+
// Remove all data-* attributes (best-effort)
|
|
462
|
+
for (const __a of Array.from(this.element.attributes)) {
|
|
463
|
+
if ((__a as Attr).name.startsWith('data-')) { (this.element as HTMLElement).removeAttribute((__a as Attr).name); }
|
|
464
|
+
}
|
|
465
|
+
} else {
|
|
466
|
+
for (const __k in value as Record<string, string>) {
|
|
467
|
+
this.element.setAttribute(`data-${__k}`, String((value as any)[__k]));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return this;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
|
|
474
|
+
if (value === null || value === undefined) {
|
|
475
|
+
this.element.removeAttribute('dir');
|
|
476
|
+
} else {
|
|
477
|
+
this.element.setAttribute('dir', String(value));
|
|
478
|
+
}
|
|
479
|
+
return this;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
setDraggable(value: boolean | null | undefined): this {
|
|
483
|
+
if (value === true) {
|
|
484
|
+
this.element.setAttribute('draggable', '');
|
|
485
|
+
} else {
|
|
486
|
+
this.element.removeAttribute('draggable');
|
|
487
|
+
}
|
|
488
|
+
return this;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
setHidden(value: boolean | null | undefined): this {
|
|
492
|
+
if (value === true) {
|
|
493
|
+
this.element.setAttribute('hidden', '');
|
|
494
|
+
} else {
|
|
495
|
+
this.element.removeAttribute('hidden');
|
|
496
|
+
}
|
|
497
|
+
return this;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
setId(value: string): this {
|
|
501
|
+
if (value === null || value === undefined) {
|
|
502
|
+
this.element.removeAttribute('id');
|
|
503
|
+
} else {
|
|
504
|
+
this.element.setAttribute('id', String(value));
|
|
505
|
+
}
|
|
506
|
+
return this;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
|
|
510
|
+
if (value === null || value === undefined) {
|
|
511
|
+
this.element.removeAttribute('inputmode');
|
|
512
|
+
} else {
|
|
513
|
+
this.element.setAttribute('inputmode', String(value));
|
|
514
|
+
}
|
|
515
|
+
return this;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
setLang(value: string | null | undefined): this {
|
|
519
|
+
if (value === null || value === undefined) {
|
|
520
|
+
this.element.removeAttribute('lang');
|
|
521
|
+
} else {
|
|
522
|
+
this.element.setAttribute('lang', String(value));
|
|
523
|
+
}
|
|
524
|
+
return this;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
setPopover(value: 'auto' | 'hint' | 'manual' | null | undefined): this {
|
|
528
|
+
if (value === null || value === undefined) {
|
|
529
|
+
this.element.removeAttribute('popover');
|
|
530
|
+
} else {
|
|
531
|
+
this.element.setAttribute('popover', String(value));
|
|
532
|
+
}
|
|
533
|
+
return this;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
setRole(value: 'alert' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'complementary' | 'contentinfo' | 'dialog' | 'form' | 'grid' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'main' | 'menu' | 'menubar' | 'menuitem' | 'navigation' | 'none' | 'presentation' | 'radio' | 'region' | 'search' | 'status' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'toolbar' | 'tooltip' | null | undefined): this {
|
|
537
|
+
if (value === null || value === undefined) {
|
|
538
|
+
this.element.removeAttribute('role');
|
|
539
|
+
} else {
|
|
540
|
+
this.element.setAttribute('role', String(value));
|
|
541
|
+
}
|
|
542
|
+
return this;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
setSlot(value: string | null | undefined): this {
|
|
546
|
+
if (value === null || value === undefined) {
|
|
547
|
+
this.element.removeAttribute('slot');
|
|
548
|
+
} else {
|
|
549
|
+
this.element.setAttribute('slot', String(value));
|
|
550
|
+
}
|
|
551
|
+
return this;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
|
|
555
|
+
if (value === null || value === undefined) {
|
|
556
|
+
this.element.removeAttribute('spellcheck');
|
|
557
|
+
} else {
|
|
558
|
+
this.element.setAttribute('spellcheck', String(value));
|
|
559
|
+
}
|
|
560
|
+
return this;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
setStyle(value: string | null | undefined): this {
|
|
564
|
+
if (value === null || value === undefined) {
|
|
565
|
+
this.element.removeAttribute('style');
|
|
566
|
+
} else {
|
|
567
|
+
this.element.setAttribute('style', String(value));
|
|
568
|
+
}
|
|
569
|
+
return this;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
setTabIndex(value: number): this {
|
|
573
|
+
if (value === null || value === undefined) {
|
|
574
|
+
this.element.removeAttribute('tabIndex');
|
|
575
|
+
} else {
|
|
576
|
+
this.element.setAttribute('tabIndex', String(value));
|
|
577
|
+
}
|
|
578
|
+
return this;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
setTabindex(value: number | null | undefined): this {
|
|
582
|
+
if (value === null || value === undefined) {
|
|
583
|
+
this.element.removeAttribute('tabindex');
|
|
584
|
+
} else {
|
|
585
|
+
this.element.setAttribute('tabindex', String(value));
|
|
586
|
+
}
|
|
587
|
+
return this;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
setTitle(value: string | null | undefined): this {
|
|
591
|
+
if (value === null || value === undefined) {
|
|
592
|
+
this.element.removeAttribute('title');
|
|
593
|
+
} else {
|
|
594
|
+
this.element.setAttribute('title', String(value));
|
|
595
|
+
}
|
|
596
|
+
return this;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
setTranslate(value: 'yes' | 'no' | null | undefined): this {
|
|
600
|
+
if (value === null || value === undefined) {
|
|
601
|
+
this.element.removeAttribute('translate');
|
|
602
|
+
} else {
|
|
603
|
+
this.element.setAttribute('translate', String(value));
|
|
604
|
+
}
|
|
605
|
+
return this;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
|
|
609
|
+
// Clear existing children
|
|
610
|
+
while (this.element.firstChild) {
|
|
611
|
+
this.element.removeChild(this.element.firstChild);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
if (typeof children === 'string') {
|
|
615
|
+
this.element.textContent = children;
|
|
616
|
+
} else if (Array.isArray(children)) {
|
|
617
|
+
children.forEach(child => {
|
|
618
|
+
if (typeof child === 'string') {
|
|
619
|
+
this.element.appendChild(document.createTextNode(child));
|
|
620
|
+
} else {
|
|
621
|
+
this.element.appendChild(child);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
} else {
|
|
625
|
+
this.element.appendChild(children);
|
|
626
|
+
}
|
|
627
|
+
return this;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
getElement(): HTMLElement {
|
|
631
|
+
return this.element;
|
|
632
|
+
}
|
|
633
|
+
}
|