-
Notifications
You must be signed in to change notification settings - Fork 0
/
aria_widget_attributes.go
297 lines (231 loc) · 8.41 KB
/
aria_widget_attributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
package gomplements
import (
"strconv"
"maragu.dev/gomponents"
)
type ariaAutocomplete string
// aria-autocomplete attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-autocomplete
const (
AriaAutocompleteNone ariaAutocomplete = "none"
AriaAutocompleteList ariaAutocomplete = "list"
AriaAutocompleteBoth ariaAutocomplete = "both"
)
func (a ariaAutocomplete) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-autocomplete", string(a)))
}
type ariaChecked string
// aria-checked attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
const (
AriaCheckedUndefined ariaChecked = "undefined"
AriaCheckedTrue ariaChecked = "true"
AriaCheckedFalse ariaChecked = "false"
AriaCheckedMixed ariaChecked = "mixed"
)
func (a ariaChecked) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-checked", string(a)))
}
type ariaDisabled string
// aria-disabled attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled
const (
AriaDisabledTrue ariaDisabled = "true"
AriaDisabledFalse ariaDisabled = "false"
)
func (a ariaDisabled) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-disabled", string(a)))
}
// aria-errormessage attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage
type AriaErrorMessageID string
func (a AriaErrorMessageID) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-errormessage", string(a)))
}
type ariaExpanded string
// aria-expanded attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded
const (
AriaExpandedUndefined ariaExpanded = "undefined"
AriaExpandedTrue ariaExpanded = "true"
AriaExpandedFalse ariaExpanded = "false"
)
func (a ariaExpanded) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-expanded", string(a)))
}
type ariaHasPopup string
// aria-haspopup attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup
const (
AriaHasPopupTrue ariaHasPopup = "true"
AriaHasPopupFalse ariaHasPopup = "false"
AriaHasPopupMenu ariaHasPopup = "menu"
AriaHasPopupListbox ariaHasPopup = "listbox"
AriaHasPopupTree ariaHasPopup = "tree"
AriaHasPopupGrid ariaHasPopup = "grid"
AriaHasPopupDialog ariaHasPopup = "dialog"
)
func (a ariaHasPopup) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-haspopup", string(a)))
}
type ariaHidden string
// aria-hidden attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden
const (
AriaHiddenUndefined ariaHidden = "undefined"
AriaHiddenTrue ariaHidden = "true"
AriaHiddenFalse ariaHidden = "false"
)
func (a ariaHidden) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-hidden", string(a)))
}
type ariaInvalid string
// aria-invalid attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid
const (
AriaInvalidTrue ariaInvalid = "true"
AriaInvalidFalse ariaInvalid = "false"
AriaInvalidGrammar ariaInvalid = "grammar"
AriaInvalidSpelling ariaInvalid = "spelling"
)
func (a ariaInvalid) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-invalid", string(a)))
}
// aria-label attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
type AriaLabel string
func (a AriaLabel) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-label", string(a)))
}
// aria-level attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-level
type AriaLevel int
func (a AriaLevel) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-level", strconv.Itoa(int(a))))
}
type ariaModal string
// aria-modal attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-modal
const (
AriaModalTrue ariaModal = "true"
AriaModalFalse ariaModal = "false"
)
func (a ariaModal) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-modal", string(a)))
}
type ariaMultiline string
// aria-multiline attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-multiline
const (
AdiaMultilineTrue ariaMultiline = "true"
AdiaMultilineFalse ariaMultiline = "false"
)
func (a ariaMultiline) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-multiline", string(a)))
}
type ariaMultiselectable string
// aria-multiselectable attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-multiselectable
const (
AdiaMultiselectableTrue ariaMultiselectable = "true"
AdiaMultiselectableFalse ariaMultiselectable = "false"
)
func (a ariaMultiselectable) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-multiselectable", string(a)))
}
type ariaOrientation string
// aria-orientation attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-orientation
const (
AriaOrientationUndefined ariaOrientation = "undefined"
AriaOrientationHorizontal ariaOrientation = "horizontal"
AriaOrientationVertical ariaOrientation = "vertical"
)
func (a ariaOrientation) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-orientation", string(a)))
}
// aria-placeholder attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-placeholder
type AriaPlaceholder string
func (a AriaPlaceholder) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-placeholder", string(a)))
}
type ariaPressed string
// aria-pressed attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed
const (
AriaPressedUndefined ariaPressed = "undefined"
AriaPressedTrue ariaPressed = "true"
AriaPressedFalse ariaPressed = "false"
AriaPressedMixed ariaPressed = "mixed"
)
func (a ariaPressed) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-pressed", string(a)))
}
type ariaReadonly string
// aria-readonly attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-readonly
const (
AriaReadonlyTrue ariaReadonly = "true"
AriaReadonlyFalse ariaReadonly = "false"
)
func (a ariaReadonly) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-readonly", string(a)))
}
type ariaRequired string
// aria-required attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-required
const (
AriaRequiredTrue ariaRequired = "true"
AriaRequiredFalse ariaRequired = "false"
)
func (a ariaRequired) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-required", string(a)))
}
type ariaSelected string
// aria-selected attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
const (
AriaSelectedUndefined ariaSelected = "undefined"
AriaSelectedTrue ariaSelected = "true"
AriaSelectedFalse ariaSelected = "false"
)
func (a ariaSelected) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-selected", string(a)))
}
type ariaSort string
// aria-sort attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
const (
AriaSortNone ariaSort = "none"
AriaSortAscending ariaSort = "ascending"
AriaSortDescending ariaSort = "descending"
AriaSortOther ariaSort = "other"
)
func (a ariaSort) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-sort", string(a)))
}
// aria-valuemax attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemax
type AriaValueMax float64
func (a AriaValueMax) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-valuemax", strconv.FormatFloat(float64(a), 'f', -1, 64)))
}
// aria-valuemin attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemin
type AriaValueMin float64
func (a AriaValueMin) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-valuemin", strconv.FormatFloat(float64(a), 'f', -1, 64)))
}
// aria-valuenow attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuenow
type AriaValueNow float64
func (a AriaValueNow) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-valuenow", strconv.FormatFloat(float64(a), 'f', -1, 64)))
}
// aria-valuetext attribute
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext
type AriaValueText string
func (a AriaValueText) ModifyParent(p Element) {
p.With(gomponents.Attr("aria-valuetext", string(a)))
}