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