@atlaskit/dynamic-table 14.8.13 → 14.8.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.8.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`df9b2633fe4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/df9b2633fe4) - [ux] Adds `aria-sort` to sortable headers when being used to sort.
8
+
3
9
  ## 14.8.13
4
10
 
5
11
  ### Patch Changes
@@ -29,7 +29,7 @@ var _tableHead = _interopRequireDefault(require("./table-head"));
29
29
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
31
  var packageName = "@atlaskit/dynamic-table";
32
- var packageVersion = "14.8.13";
32
+ var packageVersion = "14.8.14";
33
33
  function toggleSortOrder(currentSortOrder) {
34
34
  switch (currentSortOrder) {
35
35
  case _constants.DESC:
@@ -134,7 +134,15 @@ var HeadCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
134
134
  })), {}, (0, _defineProperty2.default)({}, CSS_VAR_TEXT_COLOR, _theme.head.textColor));
135
135
  var isASC = sortOrder === _constants2.ASC;
136
136
  var isDESC = sortOrder === _constants2.DESC;
137
+ var getFormattedSortOrder = function getFormattedSortOrder() {
138
+ if (isASC) {
139
+ return 'ascending';
140
+ } else if (isDESC) {
141
+ return 'descending';
142
+ }
143
+ };
137
144
  return (0, _react2.jsx)("th", (0, _extends2.default)({
145
+ "aria-sort": getFormattedSortOrder(),
138
146
  style: mergedStyles,
139
147
  css: [headCellStyles, onClick && onClickStyles, _constants3.truncationWidthStyles, isFixedSize && shouldTruncate && _constants3.fixedSizeTruncateStyles, isFixedSize && _constants3.overflowTruncateStyles, isSortable && baseStyles, isASC && ascendingStyles, isDESC && descendingStyles],
140
148
  onClick: onClick,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.13",
3
+ "version": "14.8.14",
4
4
  "sideEffects": false
5
5
  }
@@ -14,7 +14,7 @@ import ManagedPagination from './managed-pagination';
14
14
  import RankableTableBody from './rankable/body';
15
15
  import TableHead from './table-head';
16
16
  const packageName = "@atlaskit/dynamic-table";
17
- const packageVersion = "14.8.13";
17
+ const packageVersion = "14.8.14";
18
18
  function toggleSortOrder(currentSortOrder) {
19
19
  switch (currentSortOrder) {
20
20
  case DESC:
@@ -129,7 +129,15 @@ export const HeadCell = /*#__PURE__*/forwardRef(({
129
129
  };
130
130
  const isASC = sortOrder === ASC;
131
131
  const isDESC = sortOrder === DESC;
132
+ const getFormattedSortOrder = () => {
133
+ if (isASC) {
134
+ return 'ascending';
135
+ } else if (isDESC) {
136
+ return 'descending';
137
+ }
138
+ };
132
139
  return jsx("th", _extends({
140
+ "aria-sort": getFormattedSortOrder(),
133
141
  style: mergedStyles,
134
142
  css: [headCellStyles, onClick && onClickStyles, truncationWidthStyles, isFixedSize && shouldTruncate && fixedSizeTruncateStyles, isFixedSize && overflowTruncateStyles, isSortable && baseStyles, isASC && ascendingStyles, isDESC && descendingStyles],
135
143
  onClick: onClick,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.13",
3
+ "version": "14.8.14",
4
4
  "sideEffects": false
5
5
  }
@@ -22,7 +22,7 @@ import ManagedPagination from './managed-pagination';
22
22
  import RankableTableBody from './rankable/body';
23
23
  import TableHead from './table-head';
24
24
  var packageName = "@atlaskit/dynamic-table";
25
- var packageVersion = "14.8.13";
25
+ var packageVersion = "14.8.14";
26
26
  function toggleSortOrder(currentSortOrder) {
27
27
  switch (currentSortOrder) {
28
28
  case DESC:
@@ -129,7 +129,15 @@ export var HeadCell = /*#__PURE__*/forwardRef(function (_ref2, ref) {
129
129
  })), {}, _defineProperty({}, CSS_VAR_TEXT_COLOR, head.textColor));
130
130
  var isASC = sortOrder === ASC;
131
131
  var isDESC = sortOrder === DESC;
132
+ var getFormattedSortOrder = function getFormattedSortOrder() {
133
+ if (isASC) {
134
+ return 'ascending';
135
+ } else if (isDESC) {
136
+ return 'descending';
137
+ }
138
+ };
132
139
  return jsx("th", _extends({
140
+ "aria-sort": getFormattedSortOrder(),
133
141
  style: mergedStyles,
134
142
  css: [headCellStyles, onClick && onClickStyles, truncationWidthStyles, isFixedSize && shouldTruncate && fixedSizeTruncateStyles, isFixedSize && overflowTruncateStyles, isSortable && baseStyles, isASC && ascendingStyles, isDESC && descendingStyles],
135
143
  onClick: onClick,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.13",
3
+ "version": "14.8.14",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.13",
3
+ "version": "14.8.14",
4
4
  "description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@atlaskit/avatar": "^21.2.0",
44
- "@atlaskit/button": "^16.5.0",
44
+ "@atlaskit/button": "^16.6.0",
45
45
  "@atlaskit/docs": "*",
46
46
  "@atlaskit/dropdown-menu": "^11.7.0",
47
47
  "@atlaskit/ssr": "*",