@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
@@ -0,0 +1,810 @@
1
+ /**
2
+ * THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
3
+ *
4
+ * @generated December 28, 2025 12:26:31
5
+ * @component Select
6
+ * @description
7
+ */
8
+
9
+ export interface SelectProps {
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
+ * Identifies the currently active child element (e.g., for autocomplete suggestions or composite widgets).
20
+ */
21
+ 'aria-activedescendant'?: string | 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
+ * Specifies autocomplete behavior for input fields.
28
+ */
29
+ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | null | undefined;
30
+ /**
31
+ * Identifies the element(s) whose contents or presence are controlled by this element. Value is a list of IDs separated by a space
32
+ */
33
+ 'aria-controls'?: string | null | undefined;
34
+ /**
35
+ * Identifies the element(s) that describes the object. Value is a list of IDs separated by a space
36
+ */
37
+ 'aria-describedby'?: string | null | undefined;
38
+ /**
39
+ * References an element that provides additional details about the current element.
40
+ */
41
+ 'aria-details'?: string | null | undefined;
42
+ /**
43
+ * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
44
+ */
45
+ 'aria-disabled'?: 'false' | 'true' | boolean | null | undefined;
46
+ /**
47
+ * Indicates whether a collapsible UI element is expanded (true) or collapsed (false).
48
+ */
49
+ 'aria-expanded'?: 'false' | 'true' | 'undefined' | boolean | null | undefined;
50
+ /**
51
+ * Indicates that an element has an associated popup menu, listbox, tree, grid, or dialog.
52
+ */
53
+ 'aria-haspopup'?: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | boolean | null | undefined;
54
+ /**
55
+ * Indicates that the value entered does not conform to the expected format.
56
+ */
57
+ 'aria-invalid'?: 'false' | 'true' | 'grammar' | 'spelling' | boolean | null | undefined;
58
+ /**
59
+ * Defines keyboard shortcuts available for the element.
60
+ */
61
+ 'aria-keyshortcuts'?: string | null | undefined;
62
+ /**
63
+ * Defines a string value that labels the current element for assistive technologies.
64
+ */
65
+ 'aria-label'?: string | null | undefined;
66
+ /**
67
+ * Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
68
+ */
69
+ 'aria-labelledby'?: string | null | undefined;
70
+ /**
71
+ * Defines how updates to the element should be announced to screen readers.
72
+ */
73
+ 'aria-live'?: 'off' | 'polite' | 'assertive' | null | undefined;
74
+ /**
75
+ * Defines whether multiple items can be selected in a listbox, grid, or tree.
76
+ */
77
+ 'aria-multiselectable'?: 'false' | 'true' | boolean | null | undefined;
78
+ /**
79
+ * Specifies whether an element is horizontal or vertical.
80
+ */
81
+ 'aria-orientation'?: 'horizontal' | 'vertical' | 'undefined' | null | undefined;
82
+ /**
83
+ * Provides a placeholder hint for an input field.
84
+ */
85
+ 'aria-placeholder'?: string | null | undefined;
86
+ /**
87
+ * Indicates whether a toggle button is pressed (true, false, or mixed).
88
+ */
89
+ 'aria-pressed'?: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined;
90
+ /**
91
+ * Marks an input field as read-only but still selectable and focusable.
92
+ */
93
+ 'aria-readonly'?: 'false' | 'true' | boolean | null | undefined;
94
+ /**
95
+ * Indicates what content changes should be announced in a live region.
96
+ */
97
+ 'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined;
98
+ /**
99
+ * Specifies that an input field is required before form submission.
100
+ */
101
+ 'aria-required'?: 'false' | 'true' | boolean | null | undefined;
102
+ /**
103
+ * Provides a human-readable custom role description for assistive technologies.
104
+ */
105
+ 'aria-roledescription'?: string | null | undefined;
106
+ /**
107
+ * Represents the autocapitalize behavior of the element
108
+ */
109
+ autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
110
+ /**
111
+ *
112
+ */
113
+ autocomplete?: 'off' | 'on' | null | undefined;
114
+ /**
115
+ * Specifies controls whether autocorrection of editable text is enabled for spelling and/or punctuation errors. Default is on.
116
+ */
117
+ autocorrect?: 'off' | 'on' | null | undefined;
118
+ /**
119
+ * Indicates whether the element is hidden
120
+ */
121
+ autofocus?: boolean | null | undefined;
122
+ /**
123
+ * Indicates whether the element can be edited in place
124
+ */
125
+ contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
126
+ /**
127
+ * Represents the text direction of the element
128
+ */
129
+ dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
130
+ /**
131
+ * When present, it specifies that an input element should be disabled.
132
+ */
133
+ disabled?: boolean | null | undefined;
134
+ /**
135
+ * Indicates whether the element is draggable
136
+ */
137
+ draggable?: boolean | null | undefined;
138
+ /**
139
+ * Associates the button with a form element by ID. Allows buttons to be associated with forms anywhere in the document, not just inside a form element. Can override ancestor form association. Element-specific to button, input, object, select, textarea, and fieldset.
140
+ */
141
+ form?: string | null | undefined;
142
+ /**
143
+ * Indicates whether the element is hidden
144
+ */
145
+ hidden?: boolean | null | undefined;
146
+ /**
147
+ * 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
148
+ */
149
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
150
+ /**
151
+ * Specifies the primary language for the element's content
152
+ */
153
+ lang?: string | null | undefined;
154
+ /**
155
+ * When present, it specifies that the user is allowed to enter more than one value in an input element.
156
+ */
157
+ multiple?: boolean | null | undefined;
158
+ /**
159
+ * Specifies the name associated with the element. The meaning may vary depending on the context.
160
+ */
161
+ name?: string | null | undefined;
162
+ /**
163
+ *
164
+ */
165
+ popover?: 'auto' | 'hint' | 'manual' | null | undefined;
166
+ /**
167
+ * When present, it specifies that an input field must be filled out before submitting the form.
168
+ */
169
+ required?: boolean | null | undefined;
170
+ /**
171
+ * Defines the semantic purpose of an element for assistive technologies.
172
+ */
173
+ 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;
174
+ /**
175
+ * Specifies the height of a hr element in pixels.
176
+ */
177
+ size?: number | null | undefined;
178
+ /**
179
+ * Represents a slot in a shadow DOM
180
+ */
181
+ slot?: string | null | undefined;
182
+ /**
183
+ * Represents the spellchecking behavior of the element
184
+ */
185
+ spellcheck?: 'true' | 'false' | boolean | null | undefined;
186
+ /**
187
+ * Represents the CSS inline style of the element
188
+ */
189
+ style?: string | null | undefined;
190
+ /**
191
+ * Represents a tab order of the element
192
+ */
193
+ tabindex?: number | null | undefined;
194
+ /**
195
+ * Represents a title or tooltip for the element
196
+ */
197
+ title?: string | null | undefined;
198
+ /**
199
+ * used to tell user agents whether the content should be translated.
200
+ */
201
+ translate?: 'yes' | 'no' | null | undefined;
202
+ }
203
+
204
+ /**
205
+ * Select -
206
+ */
207
+ export class Select {
208
+ private element: HTMLElement;
209
+
210
+ constructor(props: SelectProps = {}) {
211
+ this.element = document.createElement('select');
212
+ this.applyProps(props);
213
+ }
214
+
215
+ private applyProps(props: SelectProps): void {
216
+ if (props.children !== undefined) {
217
+ this.setChildren(props.children);
218
+ }
219
+ if (props.accesskey !== undefined) {
220
+ this.element.setAttribute('accesskey', String(props.accesskey));
221
+ }
222
+ if (props['aria-activedescendant'] !== undefined) {
223
+ this.element.setAttribute('aria-activedescendant', String(props['aria-activedescendant']));
224
+ }
225
+ if (props['aria-atomic'] !== undefined) {
226
+ this.setAriaAtomic(props['aria-atomic']);
227
+ }
228
+ if (props['aria-autocomplete'] !== undefined) {
229
+ this.setAriaAutocomplete(props['aria-autocomplete']);
230
+ }
231
+ if (props['aria-controls'] !== undefined) {
232
+ this.element.setAttribute('aria-controls', String(props['aria-controls']));
233
+ }
234
+ if (props['aria-describedby'] !== undefined) {
235
+ this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
236
+ }
237
+ if (props['aria-details'] !== undefined) {
238
+ this.element.setAttribute('aria-details', String(props['aria-details']));
239
+ }
240
+ if (props['aria-disabled'] !== undefined) {
241
+ this.setAriaDisabled(props['aria-disabled']);
242
+ }
243
+ if (props['aria-expanded'] !== undefined) {
244
+ this.setAriaExpanded(props['aria-expanded']);
245
+ }
246
+ if (props['aria-haspopup'] !== undefined) {
247
+ this.setAriaHaspopup(props['aria-haspopup']);
248
+ }
249
+ if (props['aria-invalid'] !== undefined) {
250
+ this.setAriaInvalid(props['aria-invalid']);
251
+ }
252
+ if (props['aria-keyshortcuts'] !== undefined) {
253
+ this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
254
+ }
255
+ if (props['aria-label'] !== undefined) {
256
+ this.element.setAttribute('aria-label', String(props['aria-label']));
257
+ }
258
+ if (props['aria-labelledby'] !== undefined) {
259
+ this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
260
+ }
261
+ if (props['aria-live'] !== undefined) {
262
+ this.setAriaLive(props['aria-live']);
263
+ }
264
+ if (props['aria-multiselectable'] !== undefined) {
265
+ this.setAriaMultiselectable(props['aria-multiselectable']);
266
+ }
267
+ if (props['aria-orientation'] !== undefined) {
268
+ this.setAriaOrientation(props['aria-orientation']);
269
+ }
270
+ if (props['aria-placeholder'] !== undefined) {
271
+ this.element.setAttribute('aria-placeholder', String(props['aria-placeholder']));
272
+ }
273
+ if (props['aria-pressed'] !== undefined) {
274
+ this.setAriaPressed(props['aria-pressed']);
275
+ }
276
+ if (props['aria-readonly'] !== undefined) {
277
+ this.setAriaReadonly(props['aria-readonly']);
278
+ }
279
+ if (props['aria-relevant'] !== undefined) {
280
+ this.setAriaRelevant(props['aria-relevant']);
281
+ }
282
+ if (props['aria-required'] !== undefined) {
283
+ this.setAriaRequired(props['aria-required']);
284
+ }
285
+ if (props['aria-roledescription'] !== undefined) {
286
+ this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
287
+ }
288
+ if (props.autocapitalize !== undefined) {
289
+ this.setAutocapitalize(props.autocapitalize);
290
+ }
291
+ if (props.autocomplete !== undefined) {
292
+ this.setAutocomplete(props.autocomplete);
293
+ }
294
+ if (props.autocorrect !== undefined) {
295
+ this.setAutocorrect(props.autocorrect);
296
+ }
297
+ if (props.autofocus !== undefined) {
298
+ this.element.setAttribute('autofocus', String(props.autofocus));
299
+ }
300
+ if (props.contenteditable !== undefined) {
301
+ this.setContenteditable(props.contenteditable);
302
+ }
303
+ if (props.dir !== undefined) {
304
+ this.setDir(props.dir);
305
+ }
306
+ if (props.disabled !== undefined) {
307
+ this.element.setAttribute('disabled', String(props.disabled));
308
+ }
309
+ if (props.draggable !== undefined) {
310
+ this.element.setAttribute('draggable', String(props.draggable));
311
+ }
312
+ if (props.form !== undefined) {
313
+ this.element.setAttribute('form', String(props.form));
314
+ }
315
+ if (props.hidden !== undefined) {
316
+ this.element.setAttribute('hidden', String(props.hidden));
317
+ }
318
+ if (props.inputmode !== undefined) {
319
+ this.setInputmode(props.inputmode);
320
+ }
321
+ if (props.lang !== undefined) {
322
+ this.element.setAttribute('lang', String(props.lang));
323
+ }
324
+ if (props.multiple !== undefined) {
325
+ this.element.setAttribute('multiple', String(props.multiple));
326
+ }
327
+ if (props.name !== undefined) {
328
+ this.element.setAttribute('name', String(props.name));
329
+ }
330
+ if (props.popover !== undefined) {
331
+ this.setPopover(props.popover);
332
+ }
333
+ if (props.required !== undefined) {
334
+ this.element.setAttribute('required', String(props.required));
335
+ }
336
+ if (props.role !== undefined) {
337
+ this.setRole(props.role);
338
+ }
339
+ if (props.size !== undefined) {
340
+ this.element.setAttribute('size', String(props.size));
341
+ }
342
+ if (props.slot !== undefined) {
343
+ this.element.setAttribute('slot', String(props.slot));
344
+ }
345
+ if (props.spellcheck !== undefined) {
346
+ this.setSpellcheck(props.spellcheck);
347
+ }
348
+ if (props.style !== undefined) {
349
+ this.element.setAttribute('style', String(props.style));
350
+ }
351
+ if (props.tabindex !== undefined) {
352
+ this.element.setAttribute('tabindex', String(props.tabindex));
353
+ }
354
+ if (props.title !== undefined) {
355
+ this.element.setAttribute('title', String(props.title));
356
+ }
357
+ if (props.translate !== undefined) {
358
+ this.setTranslate(props.translate);
359
+ }
360
+ }
361
+
362
+ setAccesskey(value: string | null | undefined): this {
363
+ if (value === null || value === undefined) {
364
+ this.element.removeAttribute('accesskey');
365
+ } else {
366
+ this.element.setAttribute('accesskey', String(value));
367
+ }
368
+ return this;
369
+ }
370
+
371
+ setAriaActivedescendant(value: string | null | undefined): this {
372
+ if (value === null || value === undefined) {
373
+ this.element.removeAttribute('aria-activedescendant');
374
+ } else {
375
+ this.element.setAttribute('aria-activedescendant', String(value));
376
+ }
377
+ return this;
378
+ }
379
+
380
+ setAriaAtomic(value: 'false' | 'true' | boolean | null | undefined): this {
381
+ if (value === null || value === undefined) {
382
+ this.element.removeAttribute('aria-atomic');
383
+ } else {
384
+ this.element.setAttribute('aria-atomic', String(value));
385
+ }
386
+ return this;
387
+ }
388
+
389
+ setAriaAutocomplete(value: 'none' | 'inline' | 'list' | 'both' | null | undefined): this {
390
+ if (value === null || value === undefined) {
391
+ this.element.removeAttribute('aria-autocomplete');
392
+ } else {
393
+ this.element.setAttribute('aria-autocomplete', String(value));
394
+ }
395
+ return this;
396
+ }
397
+
398
+ setAriaControls(value: string | null | undefined): this {
399
+ if (value === null || value === undefined) {
400
+ this.element.removeAttribute('aria-controls');
401
+ } else {
402
+ this.element.setAttribute('aria-controls', String(value));
403
+ }
404
+ return this;
405
+ }
406
+
407
+ setAriaDescribedby(value: string | null | undefined): this {
408
+ if (value === null || value === undefined) {
409
+ this.element.removeAttribute('aria-describedby');
410
+ } else {
411
+ this.element.setAttribute('aria-describedby', String(value));
412
+ }
413
+ return this;
414
+ }
415
+
416
+ setAriaDetails(value: string | null | undefined): this {
417
+ if (value === null || value === undefined) {
418
+ this.element.removeAttribute('aria-details');
419
+ } else {
420
+ this.element.setAttribute('aria-details', String(value));
421
+ }
422
+ return this;
423
+ }
424
+
425
+ setAriaDisabled(value: 'false' | 'true' | boolean | null | undefined): this {
426
+ if (value === null || value === undefined) {
427
+ this.element.removeAttribute('aria-disabled');
428
+ } else {
429
+ this.element.setAttribute('aria-disabled', String(value));
430
+ }
431
+ return this;
432
+ }
433
+
434
+ setAriaExpanded(value: 'false' | 'true' | 'undefined' | boolean | null | undefined): this {
435
+ if (value === null || value === undefined) {
436
+ this.element.removeAttribute('aria-expanded');
437
+ } else {
438
+ this.element.setAttribute('aria-expanded', String(value));
439
+ }
440
+ return this;
441
+ }
442
+
443
+ setAriaHaspopup(value: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | boolean | null | undefined): this {
444
+ if (value === null || value === undefined) {
445
+ this.element.removeAttribute('aria-haspopup');
446
+ } else {
447
+ this.element.setAttribute('aria-haspopup', String(value));
448
+ }
449
+ return this;
450
+ }
451
+
452
+ setAriaInvalid(value: 'false' | 'true' | 'grammar' | 'spelling' | boolean | null | undefined): this {
453
+ if (value === null || value === undefined) {
454
+ this.element.removeAttribute('aria-invalid');
455
+ } else {
456
+ this.element.setAttribute('aria-invalid', String(value));
457
+ }
458
+ return this;
459
+ }
460
+
461
+ setAriaKeyshortcuts(value: string | null | undefined): this {
462
+ if (value === null || value === undefined) {
463
+ this.element.removeAttribute('aria-keyshortcuts');
464
+ } else {
465
+ this.element.setAttribute('aria-keyshortcuts', String(value));
466
+ }
467
+ return this;
468
+ }
469
+
470
+ setAriaLabel(value: string | null | undefined): this {
471
+ if (value === null || value === undefined) {
472
+ this.element.removeAttribute('aria-label');
473
+ } else {
474
+ this.element.setAttribute('aria-label', String(value));
475
+ }
476
+ return this;
477
+ }
478
+
479
+ setAriaLabelledby(value: string | null | undefined): this {
480
+ if (value === null || value === undefined) {
481
+ this.element.removeAttribute('aria-labelledby');
482
+ } else {
483
+ this.element.setAttribute('aria-labelledby', String(value));
484
+ }
485
+ return this;
486
+ }
487
+
488
+ setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
489
+ if (value === null || value === undefined) {
490
+ this.element.removeAttribute('aria-live');
491
+ } else {
492
+ this.element.setAttribute('aria-live', String(value));
493
+ }
494
+ return this;
495
+ }
496
+
497
+ setAriaMultiselectable(value: 'false' | 'true' | boolean | null | undefined): this {
498
+ if (value === null || value === undefined) {
499
+ this.element.removeAttribute('aria-multiselectable');
500
+ } else {
501
+ this.element.setAttribute('aria-multiselectable', String(value));
502
+ }
503
+ return this;
504
+ }
505
+
506
+ setAriaOrientation(value: 'horizontal' | 'vertical' | 'undefined' | null | undefined): this {
507
+ if (value === null || value === undefined) {
508
+ this.element.removeAttribute('aria-orientation');
509
+ } else {
510
+ this.element.setAttribute('aria-orientation', String(value));
511
+ }
512
+ return this;
513
+ }
514
+
515
+ setAriaPlaceholder(value: string | null | undefined): this {
516
+ if (value === null || value === undefined) {
517
+ this.element.removeAttribute('aria-placeholder');
518
+ } else {
519
+ this.element.setAttribute('aria-placeholder', String(value));
520
+ }
521
+ return this;
522
+ }
523
+
524
+ setAriaPressed(value: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined): this {
525
+ if (value === null || value === undefined) {
526
+ this.element.removeAttribute('aria-pressed');
527
+ } else {
528
+ this.element.setAttribute('aria-pressed', String(value));
529
+ }
530
+ return this;
531
+ }
532
+
533
+ setAriaReadonly(value: 'false' | 'true' | boolean | null | undefined): this {
534
+ if (value === null || value === undefined) {
535
+ this.element.removeAttribute('aria-readonly');
536
+ } else {
537
+ this.element.setAttribute('aria-readonly', String(value));
538
+ }
539
+ return this;
540
+ }
541
+
542
+ setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
543
+ if (value === null || value === undefined) {
544
+ this.element.removeAttribute('aria-relevant');
545
+ } else {
546
+ this.element.setAttribute('aria-relevant', String(value));
547
+ }
548
+ return this;
549
+ }
550
+
551
+ setAriaRequired(value: 'false' | 'true' | boolean | null | undefined): this {
552
+ if (value === null || value === undefined) {
553
+ this.element.removeAttribute('aria-required');
554
+ } else {
555
+ this.element.setAttribute('aria-required', String(value));
556
+ }
557
+ return this;
558
+ }
559
+
560
+ setAriaRoledescription(value: string | null | undefined): this {
561
+ if (value === null || value === undefined) {
562
+ this.element.removeAttribute('aria-roledescription');
563
+ } else {
564
+ this.element.setAttribute('aria-roledescription', String(value));
565
+ }
566
+ return this;
567
+ }
568
+
569
+ setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
570
+ if (value === null || value === undefined) {
571
+ this.element.removeAttribute('autocapitalize');
572
+ } else {
573
+ this.element.setAttribute('autocapitalize', String(value));
574
+ }
575
+ return this;
576
+ }
577
+
578
+ setAutocomplete(value: 'off' | 'on' | null | undefined): this {
579
+ if (value === null || value === undefined) {
580
+ this.element.removeAttribute('autocomplete');
581
+ } else {
582
+ this.element.setAttribute('autocomplete', String(value));
583
+ }
584
+ return this;
585
+ }
586
+
587
+ setAutocorrect(value: 'off' | 'on' | null | undefined): this {
588
+ if (value === null || value === undefined) {
589
+ this.element.removeAttribute('autocorrect');
590
+ } else {
591
+ this.element.setAttribute('autocorrect', String(value));
592
+ }
593
+ return this;
594
+ }
595
+
596
+ setAutofocus(value: boolean | null | undefined): this {
597
+ if (value === true) {
598
+ this.element.setAttribute('autofocus', '');
599
+ } else {
600
+ this.element.removeAttribute('autofocus');
601
+ }
602
+ return this;
603
+ }
604
+
605
+ setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
606
+ if (value === null || value === undefined) {
607
+ this.element.removeAttribute('contenteditable');
608
+ } else {
609
+ this.element.setAttribute('contenteditable', String(value));
610
+ }
611
+ return this;
612
+ }
613
+
614
+ setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
615
+ if (value === null || value === undefined) {
616
+ this.element.removeAttribute('dir');
617
+ } else {
618
+ this.element.setAttribute('dir', String(value));
619
+ }
620
+ return this;
621
+ }
622
+
623
+ setDisabled(value: boolean | null | undefined): this {
624
+ if (value === true) {
625
+ this.element.setAttribute('disabled', '');
626
+ } else {
627
+ this.element.removeAttribute('disabled');
628
+ }
629
+ return this;
630
+ }
631
+
632
+ setDraggable(value: boolean | null | undefined): this {
633
+ if (value === true) {
634
+ this.element.setAttribute('draggable', '');
635
+ } else {
636
+ this.element.removeAttribute('draggable');
637
+ }
638
+ return this;
639
+ }
640
+
641
+ setForm(value: string | null | undefined): this {
642
+ if (value === null || value === undefined) {
643
+ this.element.removeAttribute('form');
644
+ } else {
645
+ this.element.setAttribute('form', String(value));
646
+ }
647
+ return this;
648
+ }
649
+
650
+ setHidden(value: boolean | null | undefined): this {
651
+ if (value === true) {
652
+ this.element.setAttribute('hidden', '');
653
+ } else {
654
+ this.element.removeAttribute('hidden');
655
+ }
656
+ return this;
657
+ }
658
+
659
+ setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
660
+ if (value === null || value === undefined) {
661
+ this.element.removeAttribute('inputmode');
662
+ } else {
663
+ this.element.setAttribute('inputmode', String(value));
664
+ }
665
+ return this;
666
+ }
667
+
668
+ setLang(value: string | null | undefined): this {
669
+ if (value === null || value === undefined) {
670
+ this.element.removeAttribute('lang');
671
+ } else {
672
+ this.element.setAttribute('lang', String(value));
673
+ }
674
+ return this;
675
+ }
676
+
677
+ setMultiple(value: boolean | null | undefined): this {
678
+ if (value === true) {
679
+ this.element.setAttribute('multiple', '');
680
+ } else {
681
+ this.element.removeAttribute('multiple');
682
+ }
683
+ return this;
684
+ }
685
+
686
+ setName(value: string | null | undefined): this {
687
+ if (value === null || value === undefined) {
688
+ this.element.removeAttribute('name');
689
+ } else {
690
+ this.element.setAttribute('name', String(value));
691
+ }
692
+ return this;
693
+ }
694
+
695
+ setPopover(value: 'auto' | 'hint' | 'manual' | null | undefined): this {
696
+ if (value === null || value === undefined) {
697
+ this.element.removeAttribute('popover');
698
+ } else {
699
+ this.element.setAttribute('popover', String(value));
700
+ }
701
+ return this;
702
+ }
703
+
704
+ setRequired(value: boolean | null | undefined): this {
705
+ if (value === true) {
706
+ this.element.setAttribute('required', '');
707
+ } else {
708
+ this.element.removeAttribute('required');
709
+ }
710
+ return this;
711
+ }
712
+
713
+ 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 {
714
+ if (value === null || value === undefined) {
715
+ this.element.removeAttribute('role');
716
+ } else {
717
+ this.element.setAttribute('role', String(value));
718
+ }
719
+ return this;
720
+ }
721
+
722
+ setSize(value: number | null | undefined): this {
723
+ if (value === null || value === undefined) {
724
+ this.element.removeAttribute('size');
725
+ } else {
726
+ this.element.setAttribute('size', String(value));
727
+ }
728
+ return this;
729
+ }
730
+
731
+ setSlot(value: string | null | undefined): this {
732
+ if (value === null || value === undefined) {
733
+ this.element.removeAttribute('slot');
734
+ } else {
735
+ this.element.setAttribute('slot', String(value));
736
+ }
737
+ return this;
738
+ }
739
+
740
+ setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
741
+ if (value === null || value === undefined) {
742
+ this.element.removeAttribute('spellcheck');
743
+ } else {
744
+ this.element.setAttribute('spellcheck', String(value));
745
+ }
746
+ return this;
747
+ }
748
+
749
+ setStyle(value: string | null | undefined): this {
750
+ if (value === null || value === undefined) {
751
+ this.element.removeAttribute('style');
752
+ } else {
753
+ this.element.setAttribute('style', String(value));
754
+ }
755
+ return this;
756
+ }
757
+
758
+ setTabindex(value: number | null | undefined): this {
759
+ if (value === null || value === undefined) {
760
+ this.element.removeAttribute('tabindex');
761
+ } else {
762
+ this.element.setAttribute('tabindex', String(value));
763
+ }
764
+ return this;
765
+ }
766
+
767
+ setTitle(value: string | null | undefined): this {
768
+ if (value === null || value === undefined) {
769
+ this.element.removeAttribute('title');
770
+ } else {
771
+ this.element.setAttribute('title', String(value));
772
+ }
773
+ return this;
774
+ }
775
+
776
+ setTranslate(value: 'yes' | 'no' | null | undefined): this {
777
+ if (value === null || value === undefined) {
778
+ this.element.removeAttribute('translate');
779
+ } else {
780
+ this.element.setAttribute('translate', String(value));
781
+ }
782
+ return this;
783
+ }
784
+
785
+ setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
786
+ // Clear existing children
787
+ while (this.element.firstChild) {
788
+ this.element.removeChild(this.element.firstChild);
789
+ }
790
+
791
+ if (typeof children === 'string') {
792
+ this.element.textContent = children;
793
+ } else if (Array.isArray(children)) {
794
+ children.forEach(child => {
795
+ if (typeof child === 'string') {
796
+ this.element.appendChild(document.createTextNode(child));
797
+ } else {
798
+ this.element.appendChild(child);
799
+ }
800
+ });
801
+ } else {
802
+ this.element.appendChild(children);
803
+ }
804
+ return this;
805
+ }
806
+
807
+ getElement(): HTMLElement {
808
+ return this.element;
809
+ }
810
+ }