@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
|
@@ -0,0 +1,1197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
|
|
3
|
+
*
|
|
4
|
+
* @generated December 28, 2025 12:26:31
|
|
5
|
+
* @component Input
|
|
6
|
+
* @description
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface InputProps {
|
|
10
|
+
/**
|
|
11
|
+
* Specifies a comma-separated list of file types that the server accepts.
|
|
12
|
+
*/
|
|
13
|
+
accept?: string | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* specifies a shortcut key (or keys) to activate or focus an element
|
|
16
|
+
*/
|
|
17
|
+
accesskey?: string | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Specifies alternative text to be displayed when the image cannot be rendered.
|
|
20
|
+
*/
|
|
21
|
+
alt?: 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
|
+
* Defines the checked state for checkboxes, radio buttons, or toggle switches.
|
|
32
|
+
*/
|
|
33
|
+
'aria-checked'?: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Identifies the element(s) whose contents or presence are controlled by this element. Value is a list of IDs separated by a space
|
|
36
|
+
*/
|
|
37
|
+
'aria-controls'?: string | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates the current item within a container or set of related elements.
|
|
40
|
+
*/
|
|
41
|
+
'aria-current'?: 'false' | 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | boolean | 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 that the element is perceivable but disabled, so it is not editable or otherwise operable.
|
|
52
|
+
*/
|
|
53
|
+
'aria-disabled'?: 'false' | 'true' | boolean | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Indicates whether a collapsible UI element is expanded (true) or collapsed (false).
|
|
56
|
+
*/
|
|
57
|
+
'aria-expanded'?: 'false' | 'true' | 'undefined' | boolean | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates that an element has an associated popup menu, listbox, tree, grid, or dialog.
|
|
60
|
+
*/
|
|
61
|
+
'aria-haspopup'?: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | boolean | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Indicates that the value entered does not conform to the expected format.
|
|
64
|
+
*/
|
|
65
|
+
'aria-invalid'?: 'false' | 'true' | 'grammar' | 'spelling' | boolean | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Defines keyboard shortcuts available for the element.
|
|
68
|
+
*/
|
|
69
|
+
'aria-keyshortcuts'?: string | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Defines a string value that labels the current element for assistive technologies.
|
|
72
|
+
*/
|
|
73
|
+
'aria-label'?: string | null | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
|
|
76
|
+
*/
|
|
77
|
+
'aria-labelledby'?: string | null | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Defines how updates to the element should be announced to screen readers.
|
|
80
|
+
*/
|
|
81
|
+
'aria-live'?: 'off' | 'polite' | 'assertive' | 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
|
+
* Defines the maximum value for a range input.
|
|
108
|
+
*/
|
|
109
|
+
'aria-valuemax'?: number | null | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Defines the minimum value for a range input.
|
|
112
|
+
*/
|
|
113
|
+
'aria-valuemin'?: number | null | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Specifies the current value for a range input.
|
|
116
|
+
*/
|
|
117
|
+
'aria-valuenow'?: number | null | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Provides a human-readable representation of the current value.
|
|
120
|
+
*/
|
|
121
|
+
'aria-valuetext'?: string | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Represents the autocapitalize behavior of the element
|
|
124
|
+
*/
|
|
125
|
+
autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
autocomplete?: 'off' | 'on' | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Specifies controls whether autocorrection of editable text is enabled for spelling and/or punctuation errors. Default is on.
|
|
132
|
+
*/
|
|
133
|
+
autocorrect?: 'off' | 'on' | null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Indicates whether the element is hidden
|
|
136
|
+
*/
|
|
137
|
+
autofocus?: boolean | null | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* When present, it indicates that an input element should be pre-selected (checked) when the page loads.
|
|
140
|
+
*/
|
|
141
|
+
checked?: boolean | null | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Indicates whether the element can be edited in place
|
|
144
|
+
*/
|
|
145
|
+
contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Represents the text direction of the element
|
|
148
|
+
*/
|
|
149
|
+
dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Specifies the direction of the text.
|
|
152
|
+
*/
|
|
153
|
+
dirname?: string | null | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* When present, it specifies that an input element should be disabled.
|
|
156
|
+
*/
|
|
157
|
+
disabled?: boolean | null | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Indicates whether the element is draggable
|
|
160
|
+
*/
|
|
161
|
+
draggable?: boolean | null | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* 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.
|
|
164
|
+
*/
|
|
165
|
+
form?: string | null | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* The URL that processes the form submission. Overrides the action attribute of the button's form owner. Only applies to submit buttons. Element-specific to button and input elements with type submit or image.
|
|
168
|
+
*/
|
|
169
|
+
formaction?: string | null | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Specifies how form data should be encoded when submitting to the server. Only for submit buttons. Overrides the form's enctype attribute. Element-specific to button and input elements with type submit or image.
|
|
172
|
+
*/
|
|
173
|
+
formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | null | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Specifies the HTTP method to use when submitting the form. Only for submit buttons. Overrides the form's method attribute. Use "post" for sensitive data, "get" for idempotent operations, "dialog" to close dialog without submission. Element-specific to button and input elements with type submit or image.
|
|
176
|
+
*/
|
|
177
|
+
formmethod?: 'get' | 'post' | 'dialog' | null | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* When present, specifies that the form should not be validated when submitted. Only applies to submit buttons. Overrides the form's novalidate attribute. Element-specific to button and input elements with type submit or image.
|
|
180
|
+
*/
|
|
181
|
+
formnovalidate?: boolean | null | undefined;
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
*/
|
|
185
|
+
formtarget?: '_self' | '_blank' | '_parent' | '_top' | string | null | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Specifies the height of the element. The meaning may vary depending on the element type. Accepts integers, pixels (px), and percentages (%).
|
|
188
|
+
*/
|
|
189
|
+
height?: string | null | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Indicates whether the element is hidden
|
|
192
|
+
*/
|
|
193
|
+
hidden?: boolean | null | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* 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
|
|
196
|
+
*/
|
|
197
|
+
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Specifies the primary language for the element's content
|
|
200
|
+
*/
|
|
201
|
+
lang?: string | null | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Refers to a <datalist> element that contains pre-defined options for an input element.
|
|
204
|
+
*/
|
|
205
|
+
list?: string | null | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Specifies the maximum value for an input element, meter, or progress element.
|
|
208
|
+
*/
|
|
209
|
+
max?: number | null | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Specifies the maximum number of characters allowed in an input field.
|
|
212
|
+
*/
|
|
213
|
+
maxlength?: number | null | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Specifies the minimum value for an input element or a meter element.
|
|
216
|
+
*/
|
|
217
|
+
min?: string | null | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Specifies the minimum number of characters required in an input field.
|
|
220
|
+
*/
|
|
221
|
+
minlength?: number | null | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* When present, it specifies that the user is allowed to enter more than one value in an input element.
|
|
224
|
+
*/
|
|
225
|
+
multiple?: boolean | null | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* Specifies the name associated with the element. The meaning may vary depending on the context.
|
|
228
|
+
*/
|
|
229
|
+
name?: string | null | undefined;
|
|
230
|
+
/**
|
|
231
|
+
* Specifies a regular expression that the <input> element's value is checked against.
|
|
232
|
+
*/
|
|
233
|
+
pattern?: string | null | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* Specifies a short hint that describes the expected value of an input field.
|
|
236
|
+
*/
|
|
237
|
+
placeholder?: string | null | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Turns the button into a popover control by specifying the ID of the popover element to control. Creates implicit aria-details and aria-expanded relationships, establishes anchor positioning reference, and improves accessibility. Part of the Popover API. Element-specific to button and input elements.
|
|
240
|
+
*/
|
|
241
|
+
popovertarget?: string | null | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* Specifies the action to perform on the popover element controlled by popovertarget. "show" displays a hidden popover, "hide" hides a visible popover, "toggle" (default) switches between states. Part of the Popover API. Element-specific to button and input elements.
|
|
244
|
+
*/
|
|
245
|
+
popovertargetaction?: 'show' | 'hide' | 'toggle' | null | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* When present, it specifies that an input element is read-only.
|
|
248
|
+
*/
|
|
249
|
+
readonly?: boolean | null | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* When present, it specifies that an input field must be filled out before submitting the form.
|
|
252
|
+
*/
|
|
253
|
+
required?: boolean | null | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* The role attribute is used to define the purpose of an element.
|
|
256
|
+
*/
|
|
257
|
+
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;
|
|
258
|
+
/**
|
|
259
|
+
* Specifies the height of a hr element in pixels.
|
|
260
|
+
*/
|
|
261
|
+
size?: number | null | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* Represents the spellchecking behavior of the element
|
|
264
|
+
*/
|
|
265
|
+
spellcheck?: 'true' | 'false' | boolean | null | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* Specifies the URL of the external resource to be embedded or referenced. Required if input type is image
|
|
268
|
+
*/
|
|
269
|
+
src?: string | null | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Specifies the legal number intervals for an input element.
|
|
272
|
+
*/
|
|
273
|
+
step?: string | null | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* Represents the CSS inline style of the element
|
|
276
|
+
*/
|
|
277
|
+
style?: string | null | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Represents a tab order of the element
|
|
280
|
+
*/
|
|
281
|
+
tabindex?: number | null | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Represents a title or tooltip for the element
|
|
284
|
+
*/
|
|
285
|
+
title?: string | null | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* used to tell user agents whether the content should be translated.
|
|
288
|
+
*/
|
|
289
|
+
translate?: 'yes' | 'no' | null | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* Specifies the type of the input. Defaults to text if the attribute is omitted
|
|
292
|
+
*/
|
|
293
|
+
type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | null | undefined;
|
|
294
|
+
/**
|
|
295
|
+
* Specifies the value associated with the element. The meaning and usage may vary depending on the element type.
|
|
296
|
+
*/
|
|
297
|
+
value?: string | null | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* Specifies the width of the element. The meaning may vary depending on the element type. Accepts integers, pixels (px), and percentages (%).
|
|
300
|
+
*/
|
|
301
|
+
width?: string | null | undefined;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Input -
|
|
306
|
+
*/
|
|
307
|
+
export class Input {
|
|
308
|
+
private element: HTMLElement;
|
|
309
|
+
|
|
310
|
+
constructor(props: InputProps = {}) {
|
|
311
|
+
this.element = document.createElement('input');
|
|
312
|
+
this.applyProps(props);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
private applyProps(props: InputProps): void {
|
|
316
|
+
if (props.accept !== undefined) {
|
|
317
|
+
this.element.setAttribute('accept', String(props.accept));
|
|
318
|
+
}
|
|
319
|
+
if (props.accesskey !== undefined) {
|
|
320
|
+
this.element.setAttribute('accesskey', String(props.accesskey));
|
|
321
|
+
}
|
|
322
|
+
if (props.alt !== undefined) {
|
|
323
|
+
this.element.setAttribute('alt', String(props.alt));
|
|
324
|
+
}
|
|
325
|
+
if (props['aria-atomic'] !== undefined) {
|
|
326
|
+
this.setAriaAtomic(props['aria-atomic']);
|
|
327
|
+
}
|
|
328
|
+
if (props['aria-autocomplete'] !== undefined) {
|
|
329
|
+
this.setAriaAutocomplete(props['aria-autocomplete']);
|
|
330
|
+
}
|
|
331
|
+
if (props['aria-checked'] !== undefined) {
|
|
332
|
+
this.setAriaChecked(props['aria-checked']);
|
|
333
|
+
}
|
|
334
|
+
if (props['aria-controls'] !== undefined) {
|
|
335
|
+
this.element.setAttribute('aria-controls', String(props['aria-controls']));
|
|
336
|
+
}
|
|
337
|
+
if (props['aria-current'] !== undefined) {
|
|
338
|
+
this.setAriaCurrent(props['aria-current']);
|
|
339
|
+
}
|
|
340
|
+
if (props['aria-describedby'] !== undefined) {
|
|
341
|
+
this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
|
|
342
|
+
}
|
|
343
|
+
if (props['aria-details'] !== undefined) {
|
|
344
|
+
this.element.setAttribute('aria-details', String(props['aria-details']));
|
|
345
|
+
}
|
|
346
|
+
if (props['aria-disabled'] !== undefined) {
|
|
347
|
+
this.setAriaDisabled(props['aria-disabled']);
|
|
348
|
+
}
|
|
349
|
+
if (props['aria-expanded'] !== undefined) {
|
|
350
|
+
this.setAriaExpanded(props['aria-expanded']);
|
|
351
|
+
}
|
|
352
|
+
if (props['aria-haspopup'] !== undefined) {
|
|
353
|
+
this.setAriaHaspopup(props['aria-haspopup']);
|
|
354
|
+
}
|
|
355
|
+
if (props['aria-invalid'] !== undefined) {
|
|
356
|
+
this.setAriaInvalid(props['aria-invalid']);
|
|
357
|
+
}
|
|
358
|
+
if (props['aria-keyshortcuts'] !== undefined) {
|
|
359
|
+
this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
|
|
360
|
+
}
|
|
361
|
+
if (props['aria-label'] !== undefined) {
|
|
362
|
+
this.element.setAttribute('aria-label', String(props['aria-label']));
|
|
363
|
+
}
|
|
364
|
+
if (props['aria-labelledby'] !== undefined) {
|
|
365
|
+
this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
|
|
366
|
+
}
|
|
367
|
+
if (props['aria-live'] !== undefined) {
|
|
368
|
+
this.setAriaLive(props['aria-live']);
|
|
369
|
+
}
|
|
370
|
+
if (props['aria-placeholder'] !== undefined) {
|
|
371
|
+
this.element.setAttribute('aria-placeholder', String(props['aria-placeholder']));
|
|
372
|
+
}
|
|
373
|
+
if (props['aria-pressed'] !== undefined) {
|
|
374
|
+
this.setAriaPressed(props['aria-pressed']);
|
|
375
|
+
}
|
|
376
|
+
if (props['aria-readonly'] !== undefined) {
|
|
377
|
+
this.setAriaReadonly(props['aria-readonly']);
|
|
378
|
+
}
|
|
379
|
+
if (props['aria-relevant'] !== undefined) {
|
|
380
|
+
this.setAriaRelevant(props['aria-relevant']);
|
|
381
|
+
}
|
|
382
|
+
if (props['aria-required'] !== undefined) {
|
|
383
|
+
this.setAriaRequired(props['aria-required']);
|
|
384
|
+
}
|
|
385
|
+
if (props['aria-roledescription'] !== undefined) {
|
|
386
|
+
this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
|
|
387
|
+
}
|
|
388
|
+
if (props['aria-valuemax'] !== undefined) {
|
|
389
|
+
this.element.setAttribute('aria-valuemax', String(props['aria-valuemax']));
|
|
390
|
+
}
|
|
391
|
+
if (props['aria-valuemin'] !== undefined) {
|
|
392
|
+
this.element.setAttribute('aria-valuemin', String(props['aria-valuemin']));
|
|
393
|
+
}
|
|
394
|
+
if (props['aria-valuenow'] !== undefined) {
|
|
395
|
+
this.element.setAttribute('aria-valuenow', String(props['aria-valuenow']));
|
|
396
|
+
}
|
|
397
|
+
if (props['aria-valuetext'] !== undefined) {
|
|
398
|
+
this.element.setAttribute('aria-valuetext', String(props['aria-valuetext']));
|
|
399
|
+
}
|
|
400
|
+
if (props.autocapitalize !== undefined) {
|
|
401
|
+
this.setAutocapitalize(props.autocapitalize);
|
|
402
|
+
}
|
|
403
|
+
if (props.autocomplete !== undefined) {
|
|
404
|
+
this.setAutocomplete(props.autocomplete);
|
|
405
|
+
}
|
|
406
|
+
if (props.autocorrect !== undefined) {
|
|
407
|
+
this.setAutocorrect(props.autocorrect);
|
|
408
|
+
}
|
|
409
|
+
if (props.autofocus !== undefined) {
|
|
410
|
+
this.element.setAttribute('autofocus', String(props.autofocus));
|
|
411
|
+
}
|
|
412
|
+
if (props.checked !== undefined) {
|
|
413
|
+
this.element.setAttribute('checked', String(props.checked));
|
|
414
|
+
}
|
|
415
|
+
if (props.contenteditable !== undefined) {
|
|
416
|
+
this.setContenteditable(props.contenteditable);
|
|
417
|
+
}
|
|
418
|
+
if (props.dir !== undefined) {
|
|
419
|
+
this.setDir(props.dir);
|
|
420
|
+
}
|
|
421
|
+
if (props.dirname !== undefined) {
|
|
422
|
+
this.element.setAttribute('dirname', String(props.dirname));
|
|
423
|
+
}
|
|
424
|
+
if (props.disabled !== undefined) {
|
|
425
|
+
this.element.setAttribute('disabled', String(props.disabled));
|
|
426
|
+
}
|
|
427
|
+
if (props.draggable !== undefined) {
|
|
428
|
+
this.element.setAttribute('draggable', String(props.draggable));
|
|
429
|
+
}
|
|
430
|
+
if (props.form !== undefined) {
|
|
431
|
+
this.element.setAttribute('form', String(props.form));
|
|
432
|
+
}
|
|
433
|
+
if (props.formaction !== undefined) {
|
|
434
|
+
this.element.setAttribute('formaction', String(props.formaction));
|
|
435
|
+
}
|
|
436
|
+
if (props.formenctype !== undefined) {
|
|
437
|
+
this.setFormenctype(props.formenctype);
|
|
438
|
+
}
|
|
439
|
+
if (props.formmethod !== undefined) {
|
|
440
|
+
this.setFormmethod(props.formmethod);
|
|
441
|
+
}
|
|
442
|
+
if (props.formnovalidate !== undefined) {
|
|
443
|
+
this.element.setAttribute('formnovalidate', String(props.formnovalidate));
|
|
444
|
+
}
|
|
445
|
+
if (props.formtarget !== undefined) {
|
|
446
|
+
this.setFormtarget(props.formtarget);
|
|
447
|
+
}
|
|
448
|
+
if (props.height !== undefined) {
|
|
449
|
+
this.element.setAttribute('height', String(props.height));
|
|
450
|
+
}
|
|
451
|
+
if (props.hidden !== undefined) {
|
|
452
|
+
this.element.setAttribute('hidden', String(props.hidden));
|
|
453
|
+
}
|
|
454
|
+
if (props.inputmode !== undefined) {
|
|
455
|
+
this.setInputmode(props.inputmode);
|
|
456
|
+
}
|
|
457
|
+
if (props.lang !== undefined) {
|
|
458
|
+
this.element.setAttribute('lang', String(props.lang));
|
|
459
|
+
}
|
|
460
|
+
if (props.list !== undefined) {
|
|
461
|
+
this.element.setAttribute('list', String(props.list));
|
|
462
|
+
}
|
|
463
|
+
if (props.max !== undefined) {
|
|
464
|
+
this.element.setAttribute('max', String(props.max));
|
|
465
|
+
}
|
|
466
|
+
if (props.maxlength !== undefined) {
|
|
467
|
+
this.element.setAttribute('maxlength', String(props.maxlength));
|
|
468
|
+
}
|
|
469
|
+
if (props.min !== undefined) {
|
|
470
|
+
this.element.setAttribute('min', String(props.min));
|
|
471
|
+
}
|
|
472
|
+
if (props.minlength !== undefined) {
|
|
473
|
+
this.element.setAttribute('minlength', String(props.minlength));
|
|
474
|
+
}
|
|
475
|
+
if (props.multiple !== undefined) {
|
|
476
|
+
this.element.setAttribute('multiple', String(props.multiple));
|
|
477
|
+
}
|
|
478
|
+
if (props.name !== undefined) {
|
|
479
|
+
this.element.setAttribute('name', String(props.name));
|
|
480
|
+
}
|
|
481
|
+
if (props.pattern !== undefined) {
|
|
482
|
+
this.element.setAttribute('pattern', String(props.pattern));
|
|
483
|
+
}
|
|
484
|
+
if (props.placeholder !== undefined) {
|
|
485
|
+
this.element.setAttribute('placeholder', String(props.placeholder));
|
|
486
|
+
}
|
|
487
|
+
if (props.popovertarget !== undefined) {
|
|
488
|
+
this.element.setAttribute('popovertarget', String(props.popovertarget));
|
|
489
|
+
}
|
|
490
|
+
if (props.popovertargetaction !== undefined) {
|
|
491
|
+
this.setPopovertargetaction(props.popovertargetaction);
|
|
492
|
+
}
|
|
493
|
+
if (props.readonly !== undefined) {
|
|
494
|
+
this.element.setAttribute('readonly', String(props.readonly));
|
|
495
|
+
}
|
|
496
|
+
if (props.required !== undefined) {
|
|
497
|
+
this.element.setAttribute('required', String(props.required));
|
|
498
|
+
}
|
|
499
|
+
if (props.role !== undefined) {
|
|
500
|
+
this.setRole(props.role);
|
|
501
|
+
}
|
|
502
|
+
if (props.size !== undefined) {
|
|
503
|
+
this.element.setAttribute('size', String(props.size));
|
|
504
|
+
}
|
|
505
|
+
if (props.spellcheck !== undefined) {
|
|
506
|
+
this.setSpellcheck(props.spellcheck);
|
|
507
|
+
}
|
|
508
|
+
if (props.src !== undefined) {
|
|
509
|
+
this.element.setAttribute('src', String(props.src));
|
|
510
|
+
}
|
|
511
|
+
if (props.step !== undefined) {
|
|
512
|
+
this.element.setAttribute('step', String(props.step));
|
|
513
|
+
}
|
|
514
|
+
if (props.style !== undefined) {
|
|
515
|
+
this.element.setAttribute('style', String(props.style));
|
|
516
|
+
}
|
|
517
|
+
if (props.tabindex !== undefined) {
|
|
518
|
+
this.element.setAttribute('tabindex', String(props.tabindex));
|
|
519
|
+
}
|
|
520
|
+
if (props.title !== undefined) {
|
|
521
|
+
this.element.setAttribute('title', String(props.title));
|
|
522
|
+
}
|
|
523
|
+
if (props.translate !== undefined) {
|
|
524
|
+
this.setTranslate(props.translate);
|
|
525
|
+
}
|
|
526
|
+
if (props.type !== undefined) {
|
|
527
|
+
this.setType(props.type);
|
|
528
|
+
}
|
|
529
|
+
if (props.value !== undefined) {
|
|
530
|
+
this.element.setAttribute('value', String(props.value));
|
|
531
|
+
}
|
|
532
|
+
if (props.width !== undefined) {
|
|
533
|
+
this.element.setAttribute('width', String(props.width));
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
setAccept(value: string | null | undefined): this {
|
|
538
|
+
if (value === null || value === undefined) {
|
|
539
|
+
this.element.removeAttribute('accept');
|
|
540
|
+
} else {
|
|
541
|
+
this.element.setAttribute('accept', String(value));
|
|
542
|
+
}
|
|
543
|
+
return this;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
setAccesskey(value: string | null | undefined): this {
|
|
547
|
+
if (value === null || value === undefined) {
|
|
548
|
+
this.element.removeAttribute('accesskey');
|
|
549
|
+
} else {
|
|
550
|
+
this.element.setAttribute('accesskey', String(value));
|
|
551
|
+
}
|
|
552
|
+
return this;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
setAlt(value: string | null | undefined): this {
|
|
556
|
+
if (value === null || value === undefined) {
|
|
557
|
+
this.element.removeAttribute('alt');
|
|
558
|
+
} else {
|
|
559
|
+
this.element.setAttribute('alt', String(value));
|
|
560
|
+
}
|
|
561
|
+
return this;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
setAriaAtomic(value: 'false' | 'true' | boolean | null | undefined): this {
|
|
565
|
+
if (value === null || value === undefined) {
|
|
566
|
+
this.element.removeAttribute('aria-atomic');
|
|
567
|
+
} else {
|
|
568
|
+
this.element.setAttribute('aria-atomic', String(value));
|
|
569
|
+
}
|
|
570
|
+
return this;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
setAriaAutocomplete(value: 'none' | 'inline' | 'list' | 'both' | null | undefined): this {
|
|
574
|
+
if (value === null || value === undefined) {
|
|
575
|
+
this.element.removeAttribute('aria-autocomplete');
|
|
576
|
+
} else {
|
|
577
|
+
this.element.setAttribute('aria-autocomplete', String(value));
|
|
578
|
+
}
|
|
579
|
+
return this;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
setAriaChecked(value: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined): this {
|
|
583
|
+
if (value === null || value === undefined) {
|
|
584
|
+
this.element.removeAttribute('aria-checked');
|
|
585
|
+
} else {
|
|
586
|
+
this.element.setAttribute('aria-checked', String(value));
|
|
587
|
+
}
|
|
588
|
+
return this;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
setAriaControls(value: string | null | undefined): this {
|
|
592
|
+
if (value === null || value === undefined) {
|
|
593
|
+
this.element.removeAttribute('aria-controls');
|
|
594
|
+
} else {
|
|
595
|
+
this.element.setAttribute('aria-controls', String(value));
|
|
596
|
+
}
|
|
597
|
+
return this;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
setAriaCurrent(value: 'false' | 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | boolean | null | undefined): this {
|
|
601
|
+
if (value === null || value === undefined) {
|
|
602
|
+
this.element.removeAttribute('aria-current');
|
|
603
|
+
} else {
|
|
604
|
+
this.element.setAttribute('aria-current', String(value));
|
|
605
|
+
}
|
|
606
|
+
return this;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
setAriaDescribedby(value: string | null | undefined): this {
|
|
610
|
+
if (value === null || value === undefined) {
|
|
611
|
+
this.element.removeAttribute('aria-describedby');
|
|
612
|
+
} else {
|
|
613
|
+
this.element.setAttribute('aria-describedby', String(value));
|
|
614
|
+
}
|
|
615
|
+
return this;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
setAriaDetails(value: string | null | undefined): this {
|
|
619
|
+
if (value === null || value === undefined) {
|
|
620
|
+
this.element.removeAttribute('aria-details');
|
|
621
|
+
} else {
|
|
622
|
+
this.element.setAttribute('aria-details', String(value));
|
|
623
|
+
}
|
|
624
|
+
return this;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
setAriaDisabled(value: 'false' | 'true' | boolean | null | undefined): this {
|
|
628
|
+
if (value === null || value === undefined) {
|
|
629
|
+
this.element.removeAttribute('aria-disabled');
|
|
630
|
+
} else {
|
|
631
|
+
this.element.setAttribute('aria-disabled', String(value));
|
|
632
|
+
}
|
|
633
|
+
return this;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
setAriaExpanded(value: 'false' | 'true' | 'undefined' | boolean | null | undefined): this {
|
|
637
|
+
if (value === null || value === undefined) {
|
|
638
|
+
this.element.removeAttribute('aria-expanded');
|
|
639
|
+
} else {
|
|
640
|
+
this.element.setAttribute('aria-expanded', String(value));
|
|
641
|
+
}
|
|
642
|
+
return this;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
setAriaHaspopup(value: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | boolean | null | undefined): this {
|
|
646
|
+
if (value === null || value === undefined) {
|
|
647
|
+
this.element.removeAttribute('aria-haspopup');
|
|
648
|
+
} else {
|
|
649
|
+
this.element.setAttribute('aria-haspopup', String(value));
|
|
650
|
+
}
|
|
651
|
+
return this;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
setAriaInvalid(value: 'false' | 'true' | 'grammar' | 'spelling' | boolean | null | undefined): this {
|
|
655
|
+
if (value === null || value === undefined) {
|
|
656
|
+
this.element.removeAttribute('aria-invalid');
|
|
657
|
+
} else {
|
|
658
|
+
this.element.setAttribute('aria-invalid', String(value));
|
|
659
|
+
}
|
|
660
|
+
return this;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
setAriaKeyshortcuts(value: string | null | undefined): this {
|
|
664
|
+
if (value === null || value === undefined) {
|
|
665
|
+
this.element.removeAttribute('aria-keyshortcuts');
|
|
666
|
+
} else {
|
|
667
|
+
this.element.setAttribute('aria-keyshortcuts', String(value));
|
|
668
|
+
}
|
|
669
|
+
return this;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
setAriaLabel(value: string | null | undefined): this {
|
|
673
|
+
if (value === null || value === undefined) {
|
|
674
|
+
this.element.removeAttribute('aria-label');
|
|
675
|
+
} else {
|
|
676
|
+
this.element.setAttribute('aria-label', String(value));
|
|
677
|
+
}
|
|
678
|
+
return this;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
setAriaLabelledby(value: string | null | undefined): this {
|
|
682
|
+
if (value === null || value === undefined) {
|
|
683
|
+
this.element.removeAttribute('aria-labelledby');
|
|
684
|
+
} else {
|
|
685
|
+
this.element.setAttribute('aria-labelledby', String(value));
|
|
686
|
+
}
|
|
687
|
+
return this;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
|
|
691
|
+
if (value === null || value === undefined) {
|
|
692
|
+
this.element.removeAttribute('aria-live');
|
|
693
|
+
} else {
|
|
694
|
+
this.element.setAttribute('aria-live', String(value));
|
|
695
|
+
}
|
|
696
|
+
return this;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
setAriaPlaceholder(value: string | null | undefined): this {
|
|
700
|
+
if (value === null || value === undefined) {
|
|
701
|
+
this.element.removeAttribute('aria-placeholder');
|
|
702
|
+
} else {
|
|
703
|
+
this.element.setAttribute('aria-placeholder', String(value));
|
|
704
|
+
}
|
|
705
|
+
return this;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
setAriaPressed(value: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined): this {
|
|
709
|
+
if (value === null || value === undefined) {
|
|
710
|
+
this.element.removeAttribute('aria-pressed');
|
|
711
|
+
} else {
|
|
712
|
+
this.element.setAttribute('aria-pressed', String(value));
|
|
713
|
+
}
|
|
714
|
+
return this;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
setAriaReadonly(value: 'false' | 'true' | boolean | null | undefined): this {
|
|
718
|
+
if (value === null || value === undefined) {
|
|
719
|
+
this.element.removeAttribute('aria-readonly');
|
|
720
|
+
} else {
|
|
721
|
+
this.element.setAttribute('aria-readonly', String(value));
|
|
722
|
+
}
|
|
723
|
+
return this;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
|
|
727
|
+
if (value === null || value === undefined) {
|
|
728
|
+
this.element.removeAttribute('aria-relevant');
|
|
729
|
+
} else {
|
|
730
|
+
this.element.setAttribute('aria-relevant', String(value));
|
|
731
|
+
}
|
|
732
|
+
return this;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
setAriaRequired(value: 'false' | 'true' | boolean | null | undefined): this {
|
|
736
|
+
if (value === null || value === undefined) {
|
|
737
|
+
this.element.removeAttribute('aria-required');
|
|
738
|
+
} else {
|
|
739
|
+
this.element.setAttribute('aria-required', String(value));
|
|
740
|
+
}
|
|
741
|
+
return this;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
setAriaRoledescription(value: string | null | undefined): this {
|
|
745
|
+
if (value === null || value === undefined) {
|
|
746
|
+
this.element.removeAttribute('aria-roledescription');
|
|
747
|
+
} else {
|
|
748
|
+
this.element.setAttribute('aria-roledescription', String(value));
|
|
749
|
+
}
|
|
750
|
+
return this;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
setAriaValuemax(value: number | null | undefined): this {
|
|
754
|
+
if (value === null || value === undefined) {
|
|
755
|
+
this.element.removeAttribute('aria-valuemax');
|
|
756
|
+
} else {
|
|
757
|
+
this.element.setAttribute('aria-valuemax', String(value));
|
|
758
|
+
}
|
|
759
|
+
return this;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
setAriaValuemin(value: number | null | undefined): this {
|
|
763
|
+
if (value === null || value === undefined) {
|
|
764
|
+
this.element.removeAttribute('aria-valuemin');
|
|
765
|
+
} else {
|
|
766
|
+
this.element.setAttribute('aria-valuemin', String(value));
|
|
767
|
+
}
|
|
768
|
+
return this;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
setAriaValuenow(value: number | null | undefined): this {
|
|
772
|
+
if (value === null || value === undefined) {
|
|
773
|
+
this.element.removeAttribute('aria-valuenow');
|
|
774
|
+
} else {
|
|
775
|
+
this.element.setAttribute('aria-valuenow', String(value));
|
|
776
|
+
}
|
|
777
|
+
return this;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
setAriaValuetext(value: string | null | undefined): this {
|
|
781
|
+
if (value === null || value === undefined) {
|
|
782
|
+
this.element.removeAttribute('aria-valuetext');
|
|
783
|
+
} else {
|
|
784
|
+
this.element.setAttribute('aria-valuetext', String(value));
|
|
785
|
+
}
|
|
786
|
+
return this;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
|
|
790
|
+
if (value === null || value === undefined) {
|
|
791
|
+
this.element.removeAttribute('autocapitalize');
|
|
792
|
+
} else {
|
|
793
|
+
this.element.setAttribute('autocapitalize', String(value));
|
|
794
|
+
}
|
|
795
|
+
return this;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
setAutocomplete(value: 'off' | 'on' | null | undefined): this {
|
|
799
|
+
if (value === null || value === undefined) {
|
|
800
|
+
this.element.removeAttribute('autocomplete');
|
|
801
|
+
} else {
|
|
802
|
+
this.element.setAttribute('autocomplete', String(value));
|
|
803
|
+
}
|
|
804
|
+
return this;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
setAutocorrect(value: 'off' | 'on' | null | undefined): this {
|
|
808
|
+
if (value === null || value === undefined) {
|
|
809
|
+
this.element.removeAttribute('autocorrect');
|
|
810
|
+
} else {
|
|
811
|
+
this.element.setAttribute('autocorrect', String(value));
|
|
812
|
+
}
|
|
813
|
+
return this;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
setAutofocus(value: boolean | null | undefined): this {
|
|
817
|
+
if (value === true) {
|
|
818
|
+
this.element.setAttribute('autofocus', '');
|
|
819
|
+
} else {
|
|
820
|
+
this.element.removeAttribute('autofocus');
|
|
821
|
+
}
|
|
822
|
+
return this;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
setChecked(value: boolean | null | undefined): this {
|
|
826
|
+
if (value === true) {
|
|
827
|
+
this.element.setAttribute('checked', '');
|
|
828
|
+
} else {
|
|
829
|
+
this.element.removeAttribute('checked');
|
|
830
|
+
}
|
|
831
|
+
return this;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
|
|
835
|
+
if (value === null || value === undefined) {
|
|
836
|
+
this.element.removeAttribute('contenteditable');
|
|
837
|
+
} else {
|
|
838
|
+
this.element.setAttribute('contenteditable', String(value));
|
|
839
|
+
}
|
|
840
|
+
return this;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
|
|
844
|
+
if (value === null || value === undefined) {
|
|
845
|
+
this.element.removeAttribute('dir');
|
|
846
|
+
} else {
|
|
847
|
+
this.element.setAttribute('dir', String(value));
|
|
848
|
+
}
|
|
849
|
+
return this;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
setDirname(value: string | null | undefined): this {
|
|
853
|
+
if (value === null || value === undefined) {
|
|
854
|
+
this.element.removeAttribute('dirname');
|
|
855
|
+
} else {
|
|
856
|
+
this.element.setAttribute('dirname', String(value));
|
|
857
|
+
}
|
|
858
|
+
return this;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
setDisabled(value: boolean | null | undefined): this {
|
|
862
|
+
if (value === true) {
|
|
863
|
+
this.element.setAttribute('disabled', '');
|
|
864
|
+
} else {
|
|
865
|
+
this.element.removeAttribute('disabled');
|
|
866
|
+
}
|
|
867
|
+
return this;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
setDraggable(value: boolean | null | undefined): this {
|
|
871
|
+
if (value === true) {
|
|
872
|
+
this.element.setAttribute('draggable', '');
|
|
873
|
+
} else {
|
|
874
|
+
this.element.removeAttribute('draggable');
|
|
875
|
+
}
|
|
876
|
+
return this;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
setForm(value: string | null | undefined): this {
|
|
880
|
+
if (value === null || value === undefined) {
|
|
881
|
+
this.element.removeAttribute('form');
|
|
882
|
+
} else {
|
|
883
|
+
this.element.setAttribute('form', String(value));
|
|
884
|
+
}
|
|
885
|
+
return this;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
setFormaction(value: string | null | undefined): this {
|
|
889
|
+
if (value === null || value === undefined) {
|
|
890
|
+
this.element.removeAttribute('formaction');
|
|
891
|
+
} else {
|
|
892
|
+
this.element.setAttribute('formaction', String(value));
|
|
893
|
+
}
|
|
894
|
+
return this;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
setFormenctype(value: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | null | undefined): this {
|
|
898
|
+
if (value === null || value === undefined) {
|
|
899
|
+
this.element.removeAttribute('formenctype');
|
|
900
|
+
} else {
|
|
901
|
+
this.element.setAttribute('formenctype', String(value));
|
|
902
|
+
}
|
|
903
|
+
return this;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
setFormmethod(value: 'get' | 'post' | 'dialog' | null | undefined): this {
|
|
907
|
+
if (value === null || value === undefined) {
|
|
908
|
+
this.element.removeAttribute('formmethod');
|
|
909
|
+
} else {
|
|
910
|
+
this.element.setAttribute('formmethod', String(value));
|
|
911
|
+
}
|
|
912
|
+
return this;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
setFormnovalidate(value: boolean | null | undefined): this {
|
|
916
|
+
if (value === true) {
|
|
917
|
+
this.element.setAttribute('formnovalidate', '');
|
|
918
|
+
} else {
|
|
919
|
+
this.element.removeAttribute('formnovalidate');
|
|
920
|
+
}
|
|
921
|
+
return this;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
setFormtarget(value: '_self' | '_blank' | '_parent' | '_top' | string | null | undefined): this {
|
|
925
|
+
if (value === null || value === undefined) {
|
|
926
|
+
this.element.removeAttribute('formtarget');
|
|
927
|
+
} else {
|
|
928
|
+
this.element.setAttribute('formtarget', String(value));
|
|
929
|
+
}
|
|
930
|
+
return this;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
setHeight(value: string | null | undefined): this {
|
|
934
|
+
if (value === null || value === undefined) {
|
|
935
|
+
this.element.removeAttribute('height');
|
|
936
|
+
} else {
|
|
937
|
+
this.element.setAttribute('height', String(value));
|
|
938
|
+
}
|
|
939
|
+
return this;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
setHidden(value: boolean | null | undefined): this {
|
|
943
|
+
if (value === true) {
|
|
944
|
+
this.element.setAttribute('hidden', '');
|
|
945
|
+
} else {
|
|
946
|
+
this.element.removeAttribute('hidden');
|
|
947
|
+
}
|
|
948
|
+
return this;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
|
|
952
|
+
if (value === null || value === undefined) {
|
|
953
|
+
this.element.removeAttribute('inputmode');
|
|
954
|
+
} else {
|
|
955
|
+
this.element.setAttribute('inputmode', String(value));
|
|
956
|
+
}
|
|
957
|
+
return this;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
setLang(value: string | null | undefined): this {
|
|
961
|
+
if (value === null || value === undefined) {
|
|
962
|
+
this.element.removeAttribute('lang');
|
|
963
|
+
} else {
|
|
964
|
+
this.element.setAttribute('lang', String(value));
|
|
965
|
+
}
|
|
966
|
+
return this;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
setList(value: string | null | undefined): this {
|
|
970
|
+
if (value === null || value === undefined) {
|
|
971
|
+
this.element.removeAttribute('list');
|
|
972
|
+
} else {
|
|
973
|
+
this.element.setAttribute('list', String(value));
|
|
974
|
+
}
|
|
975
|
+
return this;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
setMax(value: number | null | undefined): this {
|
|
979
|
+
if (value === null || value === undefined) {
|
|
980
|
+
this.element.removeAttribute('max');
|
|
981
|
+
} else {
|
|
982
|
+
this.element.setAttribute('max', String(value));
|
|
983
|
+
}
|
|
984
|
+
return this;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
setMaxlength(value: number | null | undefined): this {
|
|
988
|
+
if (value === null || value === undefined) {
|
|
989
|
+
this.element.removeAttribute('maxlength');
|
|
990
|
+
} else {
|
|
991
|
+
this.element.setAttribute('maxlength', String(value));
|
|
992
|
+
}
|
|
993
|
+
return this;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
setMin(value: string | null | undefined): this {
|
|
997
|
+
if (value === null || value === undefined) {
|
|
998
|
+
this.element.removeAttribute('min');
|
|
999
|
+
} else {
|
|
1000
|
+
this.element.setAttribute('min', String(value));
|
|
1001
|
+
}
|
|
1002
|
+
return this;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
setMinlength(value: number | null | undefined): this {
|
|
1006
|
+
if (value === null || value === undefined) {
|
|
1007
|
+
this.element.removeAttribute('minlength');
|
|
1008
|
+
} else {
|
|
1009
|
+
this.element.setAttribute('minlength', String(value));
|
|
1010
|
+
}
|
|
1011
|
+
return this;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
setMultiple(value: boolean | null | undefined): this {
|
|
1015
|
+
if (value === true) {
|
|
1016
|
+
this.element.setAttribute('multiple', '');
|
|
1017
|
+
} else {
|
|
1018
|
+
this.element.removeAttribute('multiple');
|
|
1019
|
+
}
|
|
1020
|
+
return this;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
setName(value: string | null | undefined): this {
|
|
1024
|
+
if (value === null || value === undefined) {
|
|
1025
|
+
this.element.removeAttribute('name');
|
|
1026
|
+
} else {
|
|
1027
|
+
this.element.setAttribute('name', String(value));
|
|
1028
|
+
}
|
|
1029
|
+
return this;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
setPattern(value: string | null | undefined): this {
|
|
1033
|
+
if (value === null || value === undefined) {
|
|
1034
|
+
this.element.removeAttribute('pattern');
|
|
1035
|
+
} else {
|
|
1036
|
+
this.element.setAttribute('pattern', String(value));
|
|
1037
|
+
}
|
|
1038
|
+
return this;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
setPlaceholder(value: string | null | undefined): this {
|
|
1042
|
+
if (value === null || value === undefined) {
|
|
1043
|
+
this.element.removeAttribute('placeholder');
|
|
1044
|
+
} else {
|
|
1045
|
+
this.element.setAttribute('placeholder', String(value));
|
|
1046
|
+
}
|
|
1047
|
+
return this;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
setPopovertarget(value: string | null | undefined): this {
|
|
1051
|
+
if (value === null || value === undefined) {
|
|
1052
|
+
this.element.removeAttribute('popovertarget');
|
|
1053
|
+
} else {
|
|
1054
|
+
this.element.setAttribute('popovertarget', String(value));
|
|
1055
|
+
}
|
|
1056
|
+
return this;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
setPopovertargetaction(value: 'show' | 'hide' | 'toggle' | null | undefined): this {
|
|
1060
|
+
if (value === null || value === undefined) {
|
|
1061
|
+
this.element.removeAttribute('popovertargetaction');
|
|
1062
|
+
} else {
|
|
1063
|
+
this.element.setAttribute('popovertargetaction', String(value));
|
|
1064
|
+
}
|
|
1065
|
+
return this;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
setReadonly(value: boolean | null | undefined): this {
|
|
1069
|
+
if (value === true) {
|
|
1070
|
+
this.element.setAttribute('readonly', '');
|
|
1071
|
+
} else {
|
|
1072
|
+
this.element.removeAttribute('readonly');
|
|
1073
|
+
}
|
|
1074
|
+
return this;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
setRequired(value: boolean | null | undefined): this {
|
|
1078
|
+
if (value === true) {
|
|
1079
|
+
this.element.setAttribute('required', '');
|
|
1080
|
+
} else {
|
|
1081
|
+
this.element.removeAttribute('required');
|
|
1082
|
+
}
|
|
1083
|
+
return this;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
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 {
|
|
1087
|
+
if (value === null || value === undefined) {
|
|
1088
|
+
this.element.removeAttribute('role');
|
|
1089
|
+
} else {
|
|
1090
|
+
this.element.setAttribute('role', String(value));
|
|
1091
|
+
}
|
|
1092
|
+
return this;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
setSize(value: number | null | undefined): this {
|
|
1096
|
+
if (value === null || value === undefined) {
|
|
1097
|
+
this.element.removeAttribute('size');
|
|
1098
|
+
} else {
|
|
1099
|
+
this.element.setAttribute('size', String(value));
|
|
1100
|
+
}
|
|
1101
|
+
return this;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
|
|
1105
|
+
if (value === null || value === undefined) {
|
|
1106
|
+
this.element.removeAttribute('spellcheck');
|
|
1107
|
+
} else {
|
|
1108
|
+
this.element.setAttribute('spellcheck', String(value));
|
|
1109
|
+
}
|
|
1110
|
+
return this;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
setSrc(value: string | null | undefined): this {
|
|
1114
|
+
if (value === null || value === undefined) {
|
|
1115
|
+
this.element.removeAttribute('src');
|
|
1116
|
+
} else {
|
|
1117
|
+
this.element.setAttribute('src', String(value));
|
|
1118
|
+
}
|
|
1119
|
+
return this;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
setStep(value: string | null | undefined): this {
|
|
1123
|
+
if (value === null || value === undefined) {
|
|
1124
|
+
this.element.removeAttribute('step');
|
|
1125
|
+
} else {
|
|
1126
|
+
this.element.setAttribute('step', String(value));
|
|
1127
|
+
}
|
|
1128
|
+
return this;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
setStyle(value: string | null | undefined): this {
|
|
1132
|
+
if (value === null || value === undefined) {
|
|
1133
|
+
this.element.removeAttribute('style');
|
|
1134
|
+
} else {
|
|
1135
|
+
this.element.setAttribute('style', String(value));
|
|
1136
|
+
}
|
|
1137
|
+
return this;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
setTabindex(value: number | null | undefined): this {
|
|
1141
|
+
if (value === null || value === undefined) {
|
|
1142
|
+
this.element.removeAttribute('tabindex');
|
|
1143
|
+
} else {
|
|
1144
|
+
this.element.setAttribute('tabindex', String(value));
|
|
1145
|
+
}
|
|
1146
|
+
return this;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
setTitle(value: string | null | undefined): this {
|
|
1150
|
+
if (value === null || value === undefined) {
|
|
1151
|
+
this.element.removeAttribute('title');
|
|
1152
|
+
} else {
|
|
1153
|
+
this.element.setAttribute('title', String(value));
|
|
1154
|
+
}
|
|
1155
|
+
return this;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
setTranslate(value: 'yes' | 'no' | null | undefined): this {
|
|
1159
|
+
if (value === null || value === undefined) {
|
|
1160
|
+
this.element.removeAttribute('translate');
|
|
1161
|
+
} else {
|
|
1162
|
+
this.element.setAttribute('translate', String(value));
|
|
1163
|
+
}
|
|
1164
|
+
return this;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
setType(value: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | null | undefined): this {
|
|
1168
|
+
if (value === null || value === undefined) {
|
|
1169
|
+
this.element.removeAttribute('type');
|
|
1170
|
+
} else {
|
|
1171
|
+
this.element.setAttribute('type', String(value));
|
|
1172
|
+
}
|
|
1173
|
+
return this;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
setValue(value: string | null | undefined): this {
|
|
1177
|
+
if (value === null || value === undefined) {
|
|
1178
|
+
this.element.removeAttribute('value');
|
|
1179
|
+
} else {
|
|
1180
|
+
this.element.setAttribute('value', String(value));
|
|
1181
|
+
}
|
|
1182
|
+
return this;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
setWidth(value: string | null | undefined): this {
|
|
1186
|
+
if (value === null || value === undefined) {
|
|
1187
|
+
this.element.removeAttribute('width');
|
|
1188
|
+
} else {
|
|
1189
|
+
this.element.setAttribute('width', String(value));
|
|
1190
|
+
}
|
|
1191
|
+
return this;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
getElement(): HTMLElement {
|
|
1195
|
+
return this.element;
|
|
1196
|
+
}
|
|
1197
|
+
}
|