@deque/cauldron-react 4.3.0-canary.7b91d476 → 4.3.0-canary.9ab9fc67
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.
|
@@ -7,16 +7,18 @@ interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
|
7
7
|
onSort?: () => void;
|
|
8
8
|
className?: string;
|
|
9
9
|
sortAscendingAnnouncement?: string;
|
|
10
|
-
|
|
10
|
+
sortDescendingAnnouncement?: string;
|
|
11
11
|
}
|
|
12
12
|
declare const TableHeader: {
|
|
13
|
-
({ children, sortDirection, onSort, className, sortAscendingAnnouncement,
|
|
13
|
+
({ children, sortDirection, onSort, className, sortAscendingAnnouncement, sortDescendingAnnouncement, ...other }: TableHeaderProps): JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
propTypes: {
|
|
16
16
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
17
17
|
sortDirection: PropTypes.Requireable<string>;
|
|
18
18
|
onSort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
19
|
className: PropTypes.Requireable<string>;
|
|
20
|
+
sortAscendingAnnouncement: PropTypes.Requireable<string>;
|
|
21
|
+
sortDescendingAnnouncement: PropTypes.Requireable<string>;
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
export default TableHeader;
|
package/lib/index.js
CHANGED
|
@@ -8125,18 +8125,15 @@ TableHead.propTypes = {
|
|
|
8125
8125
|
};
|
|
8126
8126
|
|
|
8127
8127
|
var TableHeader = function (_a) {
|
|
8128
|
-
var children = _a.children, sortDirection = _a.sortDirection, onSort = _a.onSort, className = _a.className, _b = _a.sortAscendingAnnouncement, sortAscendingAnnouncement = _b === void 0 ? 'sorted ascending' : _b, _c = _a.
|
|
8128
|
+
var children = _a.children, sortDirection = _a.sortDirection, onSort = _a.onSort, className = _a.className, _b = _a.sortAscendingAnnouncement, sortAscendingAnnouncement = _b === void 0 ? 'sorted ascending' : _b, _c = _a.sortDescendingAnnouncement, sortDescendingAnnouncement = _c === void 0 ? 'sorted descending' : _c, other = tslib.__rest(_a, ["children", "sortDirection", "onSort", "className", "sortAscendingAnnouncement", "sortDescendingAnnouncement"]);
|
|
8129
8129
|
// When the sort direction changes, we want to announce the change in a live region
|
|
8130
8130
|
// because changes to the sort value is not widely supported yet
|
|
8131
8131
|
// see: https://a11ysupport.io/tech/aria/aria-sort_attribute
|
|
8132
|
-
var
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
: sortDescendingAnnouncemen);
|
|
8138
|
-
}
|
|
8139
|
-
}, [sortDirection]);
|
|
8132
|
+
var announcement = sortDirection === 'ascending'
|
|
8133
|
+
? sortAscendingAnnouncement
|
|
8134
|
+
: sortDirection === 'descending'
|
|
8135
|
+
? sortDescendingAnnouncement
|
|
8136
|
+
: '';
|
|
8140
8137
|
return (React__default.createElement("th", tslib.__assign({ "aria-sort": sortDirection, className: classNames('TableHeader', className, {
|
|
8141
8138
|
'TableHeader--sort-ascending': sortDirection === 'ascending',
|
|
8142
8139
|
'TableHeader--sort-descending': sortDirection === 'descending'
|
|
@@ -8151,7 +8148,9 @@ TableHeader.propTypes = {
|
|
|
8151
8148
|
children: PropTypes.node.isRequired,
|
|
8152
8149
|
sortDirection: PropTypes.string,
|
|
8153
8150
|
onSort: PropTypes.func,
|
|
8154
|
-
className: PropTypes.string
|
|
8151
|
+
className: PropTypes.string,
|
|
8152
|
+
sortAscendingAnnouncement: PropTypes.string,
|
|
8153
|
+
sortDescendingAnnouncement: PropTypes.string
|
|
8155
8154
|
};
|
|
8156
8155
|
|
|
8157
8156
|
var TableRow = function (_a) {
|