-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy patharia.js
More file actions
80 lines (77 loc) · 2.68 KB
/
aria.js
File metadata and controls
80 lines (77 loc) · 2.68 KB
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
// This mapping should be kept up-to-date with the mapping in @lwc/shared -> aria.ts
export const ariaPropertiesMapping = {
ariaAutoComplete: 'aria-autocomplete',
ariaChecked: 'aria-checked',
ariaCurrent: 'aria-current',
ariaDisabled: 'aria-disabled',
ariaExpanded: 'aria-expanded',
ariaHasPopup: 'aria-haspopup',
ariaHidden: 'aria-hidden',
ariaInvalid: 'aria-invalid',
ariaLabel: 'aria-label',
ariaLevel: 'aria-level',
ariaMultiLine: 'aria-multiline',
ariaMultiSelectable: 'aria-multiselectable',
ariaOrientation: 'aria-orientation',
ariaPressed: 'aria-pressed',
ariaReadOnly: 'aria-readonly',
ariaRequired: 'aria-required',
ariaSelected: 'aria-selected',
ariaSort: 'aria-sort',
ariaValueMax: 'aria-valuemax',
ariaValueMin: 'aria-valuemin',
ariaValueNow: 'aria-valuenow',
ariaValueText: 'aria-valuetext',
ariaLive: 'aria-live',
ariaRelevant: 'aria-relevant',
ariaAtomic: 'aria-atomic',
ariaBusy: 'aria-busy',
ariaActiveDescendant: 'aria-activedescendant',
ariaControls: 'aria-controls',
ariaDescribedBy: 'aria-describedby',
ariaFlowTo: 'aria-flowto',
ariaLabelledBy: 'aria-labelledby',
ariaOwns: 'aria-owns',
ariaPosInSet: 'aria-posinset',
ariaSetSize: 'aria-setsize',
ariaColCount: 'aria-colcount',
ariaColSpan: 'aria-colspan',
ariaColIndex: 'aria-colindex',
ariaColIndexText: 'aria-colindextext',
ariaDescription: 'aria-description',
ariaDetails: 'aria-details',
ariaErrorMessage: 'aria-errormessage',
ariaKeyShortcuts: 'aria-keyshortcuts',
ariaModal: 'aria-modal',
ariaPlaceholder: 'aria-placeholder',
ariaRoleDescription: 'aria-roledescription',
ariaRowCount: 'aria-rowcount',
ariaRowIndex: 'aria-rowindex',
ariaRowIndexText: 'aria-rowindextext',
ariaRowSpan: 'aria-rowspan',
ariaBrailleLabel: 'aria-braillelabel',
ariaBrailleRoleDescription: 'aria-brailleroledescription',
role: 'role',
};
// See the README for @lwc/aria-reflection
export const nonStandardAriaProperties = [
'ariaActiveDescendant',
'ariaControls',
'ariaDescribedBy',
'ariaDetails',
'ariaErrorMessage',
'ariaFlowTo',
'ariaLabelledBy',
'ariaOwns',
];
// These properties are not included in the global polyfill, but were added to LightningElement/BridgeElement
// prototypes in https://github.com/salesforce/lwc/pull/3702
export const nonPolyfilledAriaProperties = [
'ariaColIndexText',
'ariaBrailleLabel',
'ariaBrailleRoleDescription',
'ariaDescription',
'ariaRowIndexText',
];
export const ariaProperties = Object.keys(ariaPropertiesMapping);
export const ariaAttributes = Object.values(ariaPropertiesMapping);