@typesafe-html5/typescript 0.2.58
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/README.md +166 -0
- package/block/article/article.ts +506 -0
- package/block/aside/aside.ts +522 -0
- package/block/audio/audio.ts +506 -0
- package/block/blockquote/blockquote.ts +522 -0
- package/block/body/body.ts +458 -0
- package/block/canvas/canvas.ts +538 -0
- package/block/caption/caption.ts +506 -0
- package/block/colgroup/colgroup.ts +154 -0
- package/block/datalist/datalist.ts +506 -0
- package/block/dd/dd.ts +506 -0
- package/block/del/del.ts +538 -0
- package/block/details/details.ts +586 -0
- package/block/dialog/dialog.ts +586 -0
- package/block/div/div.ts +586 -0
- package/block/dl/dl.ts +506 -0
- package/block/dt/dt.ts +506 -0
- package/block/embed/embed.ts +317 -0
- package/block/fieldset/fieldset.ts +570 -0
- package/block/figcaption/figcaption.ts +506 -0
- package/block/figure/figure.ts +506 -0
- package/block/footer/footer.ts +522 -0
- package/block/form/form.ts +490 -0
- package/block/h1/h1.ts +490 -0
- package/block/h2/h2.ts +490 -0
- package/block/h3/h3.ts +490 -0
- package/block/h4/h4.ts +490 -0
- package/block/h5/h5.ts +490 -0
- package/block/h6/h6.ts +490 -0
- package/block/header/header.ts +298 -0
- package/block/hgroup/hgroup.ts +506 -0
- package/block/hr/hr.ts +189 -0
- package/block/html/html.ts +106 -0
- package/block/iframe/iframe.ts +538 -0
- package/block/ins/ins.ts +538 -0
- package/block/legend/legend.ts +506 -0
- package/block/li/li.ts +602 -0
- package/block/main/main.ts +538 -0
- package/block/map/map.ts +522 -0
- package/block/menu/menu.ts +554 -0
- package/block/nav/nav.ts +554 -0
- package/block/noscript/noscript.ts +282 -0
- package/block/object/object.ts +618 -0
- package/block/ol/ol.ts +618 -0
- package/block/optgroup/optgroup.ts +522 -0
- package/block/option/option.ts +618 -0
- package/block/p/p.ts +506 -0
- package/block/picture/picture.ts +506 -0
- package/block/pre/pre.ts +506 -0
- package/block/section/section.ts +538 -0
- package/block/summary/summary.ts +570 -0
- package/block/table/table.ts +570 -0
- package/block/tbody/tbody.ts +506 -0
- package/block/td/td.ts +666 -0
- package/block/template/template.ts +506 -0
- package/block/tfoot/tfoot.ts +506 -0
- package/block/th/th.ts +682 -0
- package/block/thead/thead.ts +506 -0
- package/block/tr/tr.ts +682 -0
- package/block/ul/ul.ts +570 -0
- package/block/video/video.ts +666 -0
- package/index.ts +126 -0
- package/inline/a/a.ts +682 -0
- package/inline/abbr/abbr.ts +490 -0
- package/inline/address/address.ts +474 -0
- package/inline/b/b.ts +506 -0
- package/inline/bdi/bdi.ts +490 -0
- package/inline/bdo/bdo.ts +506 -0
- package/inline/button/button.ts +826 -0
- package/inline/cite/cite.ts +506 -0
- package/inline/code/code.ts +506 -0
- package/inline/data/data.ts +522 -0
- package/inline/dfn/dfn.ts +506 -0
- package/inline/em/em.ts +506 -0
- package/inline/i/i.ts +506 -0
- package/inline/img/img.ts +445 -0
- package/inline/input/input.ts +1197 -0
- package/inline/kbd/kbd.ts +506 -0
- package/inline/label/label.ts +538 -0
- package/inline/mark/mark.ts +506 -0
- package/inline/meter/meter.ts +554 -0
- package/inline/output/output.ts +426 -0
- package/inline/progress/progress.ts +490 -0
- package/inline/q/q.ts +522 -0
- package/inline/rp/rp.ts +506 -0
- package/inline/rt/rt.ts +506 -0
- package/inline/ruby/ruby.ts +506 -0
- package/inline/s/s.ts +506 -0
- package/inline/samp/samp.ts +506 -0
- package/inline/select/select.ts +810 -0
- package/inline/slot/slot.ts +522 -0
- package/inline/small/small.ts +506 -0
- package/inline/span/span.ts +506 -0
- package/inline/strong/strong.ts +506 -0
- package/inline/sub/sub.ts +506 -0
- package/inline/sup/sup.ts +506 -0
- package/inline/svg/svg.ts +618 -0
- package/inline/textarea/textarea.ts +874 -0
- package/inline/time/time.ts +522 -0
- package/inline/u/u.ts +506 -0
- package/inline/var/var.ts +506 -0
- package/package.json +32 -0
- package/tsconfig.json +26 -0
- package/void/area/area.ts +397 -0
- package/void/base/base.ts +61 -0
- package/void/br/br.ts +77 -0
- package/void/col/col.ts +77 -0
- package/void/head/head.ts +58 -0
- package/void/link/link.ts +253 -0
- package/void/meta/meta.ts +157 -0
- package/void/param/param.ts +93 -0
- package/void/script/script.ts +250 -0
- package/void/source/source.ts +125 -0
- package/void/style/style.ts +154 -0
- package/void/title/title.ts +58 -0
- package/void/track/track.ts +157 -0
- package/void/wbr/wbr.ts +61 -0
package/block/tr/tr.ts
ADDED
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
|
|
3
|
+
*
|
|
4
|
+
* @generated December 28, 2025 12:26:31
|
|
5
|
+
* @component Tr
|
|
6
|
+
* @description
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface TrProps {
|
|
10
|
+
/**
|
|
11
|
+
* Child content or elements
|
|
12
|
+
*/
|
|
13
|
+
children?: string | HTMLElement | (string | HTMLElement)[];
|
|
14
|
+
/**
|
|
15
|
+
* specifies a shortcut key (or keys) to activate or focus an element
|
|
16
|
+
*/
|
|
17
|
+
accesskey?: string | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Specifies the horizontal alignment of each row cell. The possible enumerated values are left, center, right, justify, and char. When supported, the char value aligns the textual content on the character defined in the char attribute and on offset defined by the charoff attribute. Use the text-align CSS property instead, as this attribute is deprecated.
|
|
20
|
+
*/
|
|
21
|
+
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether assistive technologies should present the entire region as a whole when changes occur.
|
|
24
|
+
*/
|
|
25
|
+
'aria-atomic'?: 'false' | 'true' | boolean | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The aria-busy attribute is used to indicate whether an element is currently busy or not.
|
|
28
|
+
*/
|
|
29
|
+
'aria-busy'?: 'true' | 'false' | boolean | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Defines the total number of columns in a table or grid.
|
|
32
|
+
*/
|
|
33
|
+
'aria-colcount'?: number | 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
|
+
* Indicates whether the element is exposed to an accessibility API. Use with caution on interactive elements. Set to true only on decorative elements such as icons, or when nav isnt visible
|
|
48
|
+
*/
|
|
49
|
+
'aria-hidden'?: 'false' | 'true' | boolean | null | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Defines keyboard shortcuts available for the element.
|
|
52
|
+
*/
|
|
53
|
+
'aria-keyshortcuts'?: string | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
|
|
56
|
+
*/
|
|
57
|
+
'aria-labelledby'?: string | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Defines the hierarchical level of an element (e.g., headings, tree items).
|
|
60
|
+
*/
|
|
61
|
+
'aria-level'?: number | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Defines how updates to the element should be announced to screen readers.
|
|
64
|
+
*/
|
|
65
|
+
'aria-live'?: 'off' | 'polite' | 'assertive' | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Defines an element's position within a set (1-based index).
|
|
68
|
+
*/
|
|
69
|
+
'aria-posinset'?: number | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates what content changes should be announced in a live region.
|
|
72
|
+
*/
|
|
73
|
+
'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Provides a human-readable custom role description for assistive technologies.
|
|
76
|
+
*/
|
|
77
|
+
'aria-roledescription'?: string | null | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Defines the total number of rows in a table or grid.
|
|
80
|
+
*/
|
|
81
|
+
'aria-rowcount'?: number | null | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Indicates whether an item is selected (e.g., in a list, table, or tree).
|
|
84
|
+
*/
|
|
85
|
+
'aria-selected'?: 'false' | 'true' | 'undefined' | boolean | null | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Specifies the total number of items in a set.
|
|
88
|
+
*/
|
|
89
|
+
'aria-setsize'?: number | null | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Defines the sorting order of a column.
|
|
92
|
+
*/
|
|
93
|
+
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Represents the autocapitalize behavior of the element
|
|
96
|
+
*/
|
|
97
|
+
autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Indicates whether the element is hidden
|
|
100
|
+
*/
|
|
101
|
+
autofocus?: boolean | null | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Defines the background color of each row cell. The value is an HTML color; either a 6-digit hexadecimal RGB code, prefixed by a #, or a color keyword. Other CSS <color> values are not supported. Use the background-color CSS property instead, as this attribute is deprecated.
|
|
104
|
+
*/
|
|
105
|
+
bgcolor?: string | null | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Specifies the alignment of the content to a character of each row cell. Typical values for this include a period (.) when attempting to align numbers or monetary values. If align is not set to char, this attribute is ignored.
|
|
108
|
+
*/
|
|
109
|
+
char?: string | null | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Specifies the number of characters to offset the row cell content from the alignment character specified by the char attribute.
|
|
112
|
+
*/
|
|
113
|
+
charoff?: string | null | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Indicates whether the element can be edited in place
|
|
116
|
+
*/
|
|
117
|
+
contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Represents the text direction of the element
|
|
120
|
+
*/
|
|
121
|
+
dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Indicates whether the element is draggable
|
|
124
|
+
*/
|
|
125
|
+
draggable?: boolean | null | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Indicates whether the element is hidden
|
|
128
|
+
*/
|
|
129
|
+
hidden?: boolean | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* 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
|
|
132
|
+
*/
|
|
133
|
+
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Specifies the primary language for the element's content
|
|
136
|
+
*/
|
|
137
|
+
lang?: string | null | undefined;
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
*/
|
|
141
|
+
popover?: 'auto' | 'hint' | 'manual' | null | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Defines the semantic purpose of an element for assistive technologies.
|
|
144
|
+
*/
|
|
145
|
+
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;
|
|
146
|
+
/**
|
|
147
|
+
* Represents the spellchecking behavior of the element
|
|
148
|
+
*/
|
|
149
|
+
spellcheck?: 'true' | 'false' | boolean | null | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Represents the CSS inline style of the element
|
|
152
|
+
*/
|
|
153
|
+
style?: string | null | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Represents a tab order of the element
|
|
156
|
+
*/
|
|
157
|
+
tabindex?: number | null | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Represents a title or tooltip for the element
|
|
160
|
+
*/
|
|
161
|
+
title?: string | null | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* used to tell user agents whether the content should be translated.
|
|
164
|
+
*/
|
|
165
|
+
translate?: 'yes' | 'no' | null | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Specifies the vertical alignment of each row cell. The possible enumerated values are baseline, bottom, middle, and top. Use the vertical-align CSS property instead, as this attribute is deprecated.
|
|
168
|
+
*/
|
|
169
|
+
valign?: 'baseline' | 'bottom' | 'middle' | 'top' | null | undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Tr -
|
|
174
|
+
*/
|
|
175
|
+
export class Tr {
|
|
176
|
+
private element: HTMLElement;
|
|
177
|
+
|
|
178
|
+
constructor(props: TrProps = {}) {
|
|
179
|
+
this.element = document.createElement('tr');
|
|
180
|
+
this.applyProps(props);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
private applyProps(props: TrProps): void {
|
|
184
|
+
if (props.children !== undefined) {
|
|
185
|
+
this.setChildren(props.children);
|
|
186
|
+
}
|
|
187
|
+
if (props.accesskey !== undefined) {
|
|
188
|
+
this.element.setAttribute('accesskey', String(props.accesskey));
|
|
189
|
+
}
|
|
190
|
+
if (props.align !== undefined) {
|
|
191
|
+
this.setAlign(props.align);
|
|
192
|
+
}
|
|
193
|
+
if (props['aria-atomic'] !== undefined) {
|
|
194
|
+
this.setAriaAtomic(props['aria-atomic']);
|
|
195
|
+
}
|
|
196
|
+
if (props['aria-busy'] !== undefined) {
|
|
197
|
+
this.setAriaBusy(props['aria-busy']);
|
|
198
|
+
}
|
|
199
|
+
if (props['aria-colcount'] !== undefined) {
|
|
200
|
+
this.element.setAttribute('aria-colcount', String(props['aria-colcount']));
|
|
201
|
+
}
|
|
202
|
+
if (props['aria-controls'] !== undefined) {
|
|
203
|
+
this.element.setAttribute('aria-controls', String(props['aria-controls']));
|
|
204
|
+
}
|
|
205
|
+
if (props['aria-describedby'] !== undefined) {
|
|
206
|
+
this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
|
|
207
|
+
}
|
|
208
|
+
if (props['aria-details'] !== undefined) {
|
|
209
|
+
this.element.setAttribute('aria-details', String(props['aria-details']));
|
|
210
|
+
}
|
|
211
|
+
if (props['aria-hidden'] !== undefined) {
|
|
212
|
+
this.setAriaHidden(props['aria-hidden']);
|
|
213
|
+
}
|
|
214
|
+
if (props['aria-keyshortcuts'] !== undefined) {
|
|
215
|
+
this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
|
|
216
|
+
}
|
|
217
|
+
if (props['aria-labelledby'] !== undefined) {
|
|
218
|
+
this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
|
|
219
|
+
}
|
|
220
|
+
if (props['aria-level'] !== undefined) {
|
|
221
|
+
this.element.setAttribute('aria-level', String(props['aria-level']));
|
|
222
|
+
}
|
|
223
|
+
if (props['aria-live'] !== undefined) {
|
|
224
|
+
this.setAriaLive(props['aria-live']);
|
|
225
|
+
}
|
|
226
|
+
if (props['aria-posinset'] !== undefined) {
|
|
227
|
+
this.element.setAttribute('aria-posinset', String(props['aria-posinset']));
|
|
228
|
+
}
|
|
229
|
+
if (props['aria-relevant'] !== undefined) {
|
|
230
|
+
this.setAriaRelevant(props['aria-relevant']);
|
|
231
|
+
}
|
|
232
|
+
if (props['aria-roledescription'] !== undefined) {
|
|
233
|
+
this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
|
|
234
|
+
}
|
|
235
|
+
if (props['aria-rowcount'] !== undefined) {
|
|
236
|
+
this.element.setAttribute('aria-rowcount', String(props['aria-rowcount']));
|
|
237
|
+
}
|
|
238
|
+
if (props['aria-selected'] !== undefined) {
|
|
239
|
+
this.setAriaSelected(props['aria-selected']);
|
|
240
|
+
}
|
|
241
|
+
if (props['aria-setsize'] !== undefined) {
|
|
242
|
+
this.element.setAttribute('aria-setsize', String(props['aria-setsize']));
|
|
243
|
+
}
|
|
244
|
+
if (props['aria-sort'] !== undefined) {
|
|
245
|
+
this.setAriaSort(props['aria-sort']);
|
|
246
|
+
}
|
|
247
|
+
if (props.autocapitalize !== undefined) {
|
|
248
|
+
this.setAutocapitalize(props.autocapitalize);
|
|
249
|
+
}
|
|
250
|
+
if (props.autofocus !== undefined) {
|
|
251
|
+
this.element.setAttribute('autofocus', String(props.autofocus));
|
|
252
|
+
}
|
|
253
|
+
if (props.bgcolor !== undefined) {
|
|
254
|
+
this.element.setAttribute('bgcolor', String(props.bgcolor));
|
|
255
|
+
}
|
|
256
|
+
if (props.char !== undefined) {
|
|
257
|
+
this.element.setAttribute('char', String(props.char));
|
|
258
|
+
}
|
|
259
|
+
if (props.charoff !== undefined) {
|
|
260
|
+
this.element.setAttribute('charoff', String(props.charoff));
|
|
261
|
+
}
|
|
262
|
+
if (props.contenteditable !== undefined) {
|
|
263
|
+
this.setContenteditable(props.contenteditable);
|
|
264
|
+
}
|
|
265
|
+
if (props.dir !== undefined) {
|
|
266
|
+
this.setDir(props.dir);
|
|
267
|
+
}
|
|
268
|
+
if (props.draggable !== undefined) {
|
|
269
|
+
this.element.setAttribute('draggable', String(props.draggable));
|
|
270
|
+
}
|
|
271
|
+
if (props.hidden !== undefined) {
|
|
272
|
+
this.element.setAttribute('hidden', String(props.hidden));
|
|
273
|
+
}
|
|
274
|
+
if (props.inputmode !== undefined) {
|
|
275
|
+
this.setInputmode(props.inputmode);
|
|
276
|
+
}
|
|
277
|
+
if (props.lang !== undefined) {
|
|
278
|
+
this.element.setAttribute('lang', String(props.lang));
|
|
279
|
+
}
|
|
280
|
+
if (props.popover !== undefined) {
|
|
281
|
+
this.setPopover(props.popover);
|
|
282
|
+
}
|
|
283
|
+
if (props.role !== undefined) {
|
|
284
|
+
this.setRole(props.role);
|
|
285
|
+
}
|
|
286
|
+
if (props.spellcheck !== undefined) {
|
|
287
|
+
this.setSpellcheck(props.spellcheck);
|
|
288
|
+
}
|
|
289
|
+
if (props.style !== undefined) {
|
|
290
|
+
this.element.setAttribute('style', String(props.style));
|
|
291
|
+
}
|
|
292
|
+
if (props.tabindex !== undefined) {
|
|
293
|
+
this.element.setAttribute('tabindex', String(props.tabindex));
|
|
294
|
+
}
|
|
295
|
+
if (props.title !== undefined) {
|
|
296
|
+
this.element.setAttribute('title', String(props.title));
|
|
297
|
+
}
|
|
298
|
+
if (props.translate !== undefined) {
|
|
299
|
+
this.setTranslate(props.translate);
|
|
300
|
+
}
|
|
301
|
+
if (props.valign !== undefined) {
|
|
302
|
+
this.setValign(props.valign);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
setAccesskey(value: string | null | undefined): this {
|
|
307
|
+
if (value === null || value === undefined) {
|
|
308
|
+
this.element.removeAttribute('accesskey');
|
|
309
|
+
} else {
|
|
310
|
+
this.element.setAttribute('accesskey', String(value));
|
|
311
|
+
}
|
|
312
|
+
return this;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
setAlign(value: 'left' | 'center' | 'right' | 'justify' | 'char' | null | undefined): this {
|
|
316
|
+
if (value === null || value === undefined) {
|
|
317
|
+
this.element.removeAttribute('align');
|
|
318
|
+
} else {
|
|
319
|
+
this.element.setAttribute('align', String(value));
|
|
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
|
+
setAriaColcount(value: number | null | undefined): this {
|
|
343
|
+
if (value === null || value === undefined) {
|
|
344
|
+
this.element.removeAttribute('aria-colcount');
|
|
345
|
+
} else {
|
|
346
|
+
this.element.setAttribute('aria-colcount', String(value));
|
|
347
|
+
}
|
|
348
|
+
return this;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
setAriaControls(value: string | null | undefined): this {
|
|
352
|
+
if (value === null || value === undefined) {
|
|
353
|
+
this.element.removeAttribute('aria-controls');
|
|
354
|
+
} else {
|
|
355
|
+
this.element.setAttribute('aria-controls', String(value));
|
|
356
|
+
}
|
|
357
|
+
return this;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
setAriaDescribedby(value: string | null | undefined): this {
|
|
361
|
+
if (value === null || value === undefined) {
|
|
362
|
+
this.element.removeAttribute('aria-describedby');
|
|
363
|
+
} else {
|
|
364
|
+
this.element.setAttribute('aria-describedby', String(value));
|
|
365
|
+
}
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
setAriaDetails(value: string | null | undefined): this {
|
|
370
|
+
if (value === null || value === undefined) {
|
|
371
|
+
this.element.removeAttribute('aria-details');
|
|
372
|
+
} else {
|
|
373
|
+
this.element.setAttribute('aria-details', String(value));
|
|
374
|
+
}
|
|
375
|
+
return this;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
setAriaHidden(value: 'false' | 'true' | boolean | null | undefined): this {
|
|
379
|
+
if (value === null || value === undefined) {
|
|
380
|
+
this.element.removeAttribute('aria-hidden');
|
|
381
|
+
} else {
|
|
382
|
+
this.element.setAttribute('aria-hidden', String(value));
|
|
383
|
+
}
|
|
384
|
+
return this;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
setAriaKeyshortcuts(value: string | null | undefined): this {
|
|
388
|
+
if (value === null || value === undefined) {
|
|
389
|
+
this.element.removeAttribute('aria-keyshortcuts');
|
|
390
|
+
} else {
|
|
391
|
+
this.element.setAttribute('aria-keyshortcuts', String(value));
|
|
392
|
+
}
|
|
393
|
+
return this;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
setAriaLabelledby(value: string | null | undefined): this {
|
|
397
|
+
if (value === null || value === undefined) {
|
|
398
|
+
this.element.removeAttribute('aria-labelledby');
|
|
399
|
+
} else {
|
|
400
|
+
this.element.setAttribute('aria-labelledby', String(value));
|
|
401
|
+
}
|
|
402
|
+
return this;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
setAriaLevel(value: number | null | undefined): this {
|
|
406
|
+
if (value === null || value === undefined) {
|
|
407
|
+
this.element.removeAttribute('aria-level');
|
|
408
|
+
} else {
|
|
409
|
+
this.element.setAttribute('aria-level', String(value));
|
|
410
|
+
}
|
|
411
|
+
return this;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
|
|
415
|
+
if (value === null || value === undefined) {
|
|
416
|
+
this.element.removeAttribute('aria-live');
|
|
417
|
+
} else {
|
|
418
|
+
this.element.setAttribute('aria-live', String(value));
|
|
419
|
+
}
|
|
420
|
+
return this;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
setAriaPosinset(value: number | null | undefined): this {
|
|
424
|
+
if (value === null || value === undefined) {
|
|
425
|
+
this.element.removeAttribute('aria-posinset');
|
|
426
|
+
} else {
|
|
427
|
+
this.element.setAttribute('aria-posinset', String(value));
|
|
428
|
+
}
|
|
429
|
+
return this;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
|
|
433
|
+
if (value === null || value === undefined) {
|
|
434
|
+
this.element.removeAttribute('aria-relevant');
|
|
435
|
+
} else {
|
|
436
|
+
this.element.setAttribute('aria-relevant', String(value));
|
|
437
|
+
}
|
|
438
|
+
return this;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
setAriaRoledescription(value: string | null | undefined): this {
|
|
442
|
+
if (value === null || value === undefined) {
|
|
443
|
+
this.element.removeAttribute('aria-roledescription');
|
|
444
|
+
} else {
|
|
445
|
+
this.element.setAttribute('aria-roledescription', String(value));
|
|
446
|
+
}
|
|
447
|
+
return this;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
setAriaRowcount(value: number | null | undefined): this {
|
|
451
|
+
if (value === null || value === undefined) {
|
|
452
|
+
this.element.removeAttribute('aria-rowcount');
|
|
453
|
+
} else {
|
|
454
|
+
this.element.setAttribute('aria-rowcount', String(value));
|
|
455
|
+
}
|
|
456
|
+
return this;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
setAriaSelected(value: 'false' | 'true' | 'undefined' | boolean | null | undefined): this {
|
|
460
|
+
if (value === null || value === undefined) {
|
|
461
|
+
this.element.removeAttribute('aria-selected');
|
|
462
|
+
} else {
|
|
463
|
+
this.element.setAttribute('aria-selected', String(value));
|
|
464
|
+
}
|
|
465
|
+
return this;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
setAriaSetsize(value: number | null | undefined): this {
|
|
469
|
+
if (value === null || value === undefined) {
|
|
470
|
+
this.element.removeAttribute('aria-setsize');
|
|
471
|
+
} else {
|
|
472
|
+
this.element.setAttribute('aria-setsize', String(value));
|
|
473
|
+
}
|
|
474
|
+
return this;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
setAriaSort(value: 'none' | 'ascending' | 'descending' | 'other' | null | undefined): this {
|
|
478
|
+
if (value === null || value === undefined) {
|
|
479
|
+
this.element.removeAttribute('aria-sort');
|
|
480
|
+
} else {
|
|
481
|
+
this.element.setAttribute('aria-sort', String(value));
|
|
482
|
+
}
|
|
483
|
+
return this;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
|
|
487
|
+
if (value === null || value === undefined) {
|
|
488
|
+
this.element.removeAttribute('autocapitalize');
|
|
489
|
+
} else {
|
|
490
|
+
this.element.setAttribute('autocapitalize', String(value));
|
|
491
|
+
}
|
|
492
|
+
return this;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
setAutofocus(value: boolean | null | undefined): this {
|
|
496
|
+
if (value === true) {
|
|
497
|
+
this.element.setAttribute('autofocus', '');
|
|
498
|
+
} else {
|
|
499
|
+
this.element.removeAttribute('autofocus');
|
|
500
|
+
}
|
|
501
|
+
return this;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
setBgcolor(value: string | null | undefined): this {
|
|
505
|
+
if (value === null || value === undefined) {
|
|
506
|
+
this.element.removeAttribute('bgcolor');
|
|
507
|
+
} else {
|
|
508
|
+
this.element.setAttribute('bgcolor', String(value));
|
|
509
|
+
}
|
|
510
|
+
return this;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
setChar(value: string | null | undefined): this {
|
|
514
|
+
if (value === null || value === undefined) {
|
|
515
|
+
this.element.removeAttribute('char');
|
|
516
|
+
} else {
|
|
517
|
+
this.element.setAttribute('char', String(value));
|
|
518
|
+
}
|
|
519
|
+
return this;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
setCharoff(value: string | null | undefined): this {
|
|
523
|
+
if (value === null || value === undefined) {
|
|
524
|
+
this.element.removeAttribute('charoff');
|
|
525
|
+
} else {
|
|
526
|
+
this.element.setAttribute('charoff', String(value));
|
|
527
|
+
}
|
|
528
|
+
return this;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
|
|
532
|
+
if (value === null || value === undefined) {
|
|
533
|
+
this.element.removeAttribute('contenteditable');
|
|
534
|
+
} else {
|
|
535
|
+
this.element.setAttribute('contenteditable', String(value));
|
|
536
|
+
}
|
|
537
|
+
return this;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
|
|
541
|
+
if (value === null || value === undefined) {
|
|
542
|
+
this.element.removeAttribute('dir');
|
|
543
|
+
} else {
|
|
544
|
+
this.element.setAttribute('dir', String(value));
|
|
545
|
+
}
|
|
546
|
+
return this;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
setDraggable(value: boolean | null | undefined): this {
|
|
550
|
+
if (value === true) {
|
|
551
|
+
this.element.setAttribute('draggable', '');
|
|
552
|
+
} else {
|
|
553
|
+
this.element.removeAttribute('draggable');
|
|
554
|
+
}
|
|
555
|
+
return this;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
setHidden(value: boolean | null | undefined): this {
|
|
559
|
+
if (value === true) {
|
|
560
|
+
this.element.setAttribute('hidden', '');
|
|
561
|
+
} else {
|
|
562
|
+
this.element.removeAttribute('hidden');
|
|
563
|
+
}
|
|
564
|
+
return this;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
|
|
568
|
+
if (value === null || value === undefined) {
|
|
569
|
+
this.element.removeAttribute('inputmode');
|
|
570
|
+
} else {
|
|
571
|
+
this.element.setAttribute('inputmode', String(value));
|
|
572
|
+
}
|
|
573
|
+
return this;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
setLang(value: string | null | undefined): this {
|
|
577
|
+
if (value === null || value === undefined) {
|
|
578
|
+
this.element.removeAttribute('lang');
|
|
579
|
+
} else {
|
|
580
|
+
this.element.setAttribute('lang', String(value));
|
|
581
|
+
}
|
|
582
|
+
return this;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
setPopover(value: 'auto' | 'hint' | 'manual' | null | undefined): this {
|
|
586
|
+
if (value === null || value === undefined) {
|
|
587
|
+
this.element.removeAttribute('popover');
|
|
588
|
+
} else {
|
|
589
|
+
this.element.setAttribute('popover', String(value));
|
|
590
|
+
}
|
|
591
|
+
return this;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
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 {
|
|
595
|
+
if (value === null || value === undefined) {
|
|
596
|
+
this.element.removeAttribute('role');
|
|
597
|
+
} else {
|
|
598
|
+
this.element.setAttribute('role', String(value));
|
|
599
|
+
}
|
|
600
|
+
return this;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
|
|
604
|
+
if (value === null || value === undefined) {
|
|
605
|
+
this.element.removeAttribute('spellcheck');
|
|
606
|
+
} else {
|
|
607
|
+
this.element.setAttribute('spellcheck', String(value));
|
|
608
|
+
}
|
|
609
|
+
return this;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
setStyle(value: string | null | undefined): this {
|
|
613
|
+
if (value === null || value === undefined) {
|
|
614
|
+
this.element.removeAttribute('style');
|
|
615
|
+
} else {
|
|
616
|
+
this.element.setAttribute('style', String(value));
|
|
617
|
+
}
|
|
618
|
+
return this;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
setTabindex(value: number | null | undefined): this {
|
|
622
|
+
if (value === null || value === undefined) {
|
|
623
|
+
this.element.removeAttribute('tabindex');
|
|
624
|
+
} else {
|
|
625
|
+
this.element.setAttribute('tabindex', String(value));
|
|
626
|
+
}
|
|
627
|
+
return this;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
setTitle(value: string | null | undefined): this {
|
|
631
|
+
if (value === null || value === undefined) {
|
|
632
|
+
this.element.removeAttribute('title');
|
|
633
|
+
} else {
|
|
634
|
+
this.element.setAttribute('title', String(value));
|
|
635
|
+
}
|
|
636
|
+
return this;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
setTranslate(value: 'yes' | 'no' | null | undefined): this {
|
|
640
|
+
if (value === null || value === undefined) {
|
|
641
|
+
this.element.removeAttribute('translate');
|
|
642
|
+
} else {
|
|
643
|
+
this.element.setAttribute('translate', String(value));
|
|
644
|
+
}
|
|
645
|
+
return this;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
setValign(value: 'baseline' | 'bottom' | 'middle' | 'top' | null | undefined): this {
|
|
649
|
+
if (value === null || value === undefined) {
|
|
650
|
+
this.element.removeAttribute('valign');
|
|
651
|
+
} else {
|
|
652
|
+
this.element.setAttribute('valign', String(value));
|
|
653
|
+
}
|
|
654
|
+
return this;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
|
|
658
|
+
// Clear existing children
|
|
659
|
+
while (this.element.firstChild) {
|
|
660
|
+
this.element.removeChild(this.element.firstChild);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (typeof children === 'string') {
|
|
664
|
+
this.element.textContent = children;
|
|
665
|
+
} else if (Array.isArray(children)) {
|
|
666
|
+
children.forEach(child => {
|
|
667
|
+
if (typeof child === 'string') {
|
|
668
|
+
this.element.appendChild(document.createTextNode(child));
|
|
669
|
+
} else {
|
|
670
|
+
this.element.appendChild(child);
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
} else {
|
|
674
|
+
this.element.appendChild(children);
|
|
675
|
+
}
|
|
676
|
+
return this;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
getElement(): HTMLElement {
|
|
680
|
+
return this.element;
|
|
681
|
+
}
|
|
682
|
+
}
|