aria-ease 1.3.7 → 1.3.8
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/Types.d.ts
CHANGED
package/aria-ease.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare module 'aria-ease' {
|
|
|
43
43
|
function updateAccordionTriggerAriaAttributes(accordionStates: AccordionStates[], accordionsClass: string, currentClickedTriggerIndex: number): void;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-
|
|
46
|
+
* Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-checked and aria-label.
|
|
47
47
|
* @param {CheckboxStates[]} checkboxStates Array of objects containing checkboxes state information
|
|
48
48
|
* @param {string} checkboxesClass The shared class of all the checkboxes
|
|
49
49
|
* @param {number} currentPressedCheckboxIndex Index of the currently checked or unchecked checkbox
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-
|
|
2
|
+
* Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-checked and aria-label.
|
|
3
3
|
* @param {CheckboxStates[]} checkboxStates Array of objects containing checkboxes state information
|
|
4
4
|
* @param {string} checkboxesClass The shared class of all the checkboxes
|
|
5
5
|
* @param {number} currentPressedCheckboxIndex Index of the currently checked or unchecked checkbox
|
|
@@ -11,8 +11,8 @@ export function updateCheckboxAriaAttributes(checkboxStates, checkboxesClass, cu
|
|
|
11
11
|
}
|
|
12
12
|
allCheckboxes.forEach(function (checkbox, index) {
|
|
13
13
|
if (index === currentPressedCheckboxIndex) {
|
|
14
|
-
checkbox.setAttribute("aria-
|
|
15
|
-
checkbox.setAttribute("aria-label", checkboxStates[index].
|
|
14
|
+
checkbox.setAttribute("aria-checked", checkboxStates[index].checked ? 'true' : 'false');
|
|
15
|
+
checkbox.setAttribute("aria-label", checkboxStates[index].checked ? checkboxStates[index].checkedAriaLabel : checkboxStates[index].uncheckedAriaLabel);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-
|
|
2
|
+
* Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-checked and aria-label.
|
|
3
3
|
* @param {CheckboxStates[]} checkboxStates Array of objects containing checkboxes state information
|
|
4
4
|
* @param {string} checkboxesClass The shared class of all the checkboxes
|
|
5
5
|
* @param {number} currentPressedCheckboxIndex Index of the currently checked or unchecked checkbox
|
|
@@ -16,8 +16,8 @@ export function updateCheckboxAriaAttributes(checkboxStates: CheckboxStates[], c
|
|
|
16
16
|
|
|
17
17
|
allCheckboxes.forEach((checkbox, index) => {
|
|
18
18
|
if (index === currentPressedCheckboxIndex) {
|
|
19
|
-
checkbox.setAttribute("aria-
|
|
20
|
-
checkbox.setAttribute("aria-label", checkboxStates[index].
|
|
19
|
+
checkbox.setAttribute("aria-checked", checkboxStates[index].checked ? 'true' : 'false');
|
|
20
|
+
checkbox.setAttribute("aria-label", checkboxStates[index].checked ? checkboxStates[index].checkedAriaLabel : checkboxStates[index].uncheckedAriaLabel);
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
}
|