@atlaskit/renderer 108.15.2 → 108.15.4
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 +12 -0
- package/dist/cjs/messages.js +30 -2
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/SortingIcon.js +22 -2
- package/dist/es2019/messages.js +27 -0
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/SortingIcon.js +25 -3
- package/dist/esm/messages.js +27 -0
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/SortingIcon.js +23 -3
- package/dist/types/messages.d.ts +27 -0
- package/dist/types/ui/SortingIcon.d.ts +1 -1
- package/dist/types-ts4.5/messages.d.ts +27 -0
- package/dist/types-ts4.5/ui/SortingIcon.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 108.15.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 108.15.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`1b31bd53b23`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b31bd53b23) - [ux] [ECA11Y-89] Added aria-label for sortable table header cell button
|
|
14
|
+
|
|
3
15
|
## 108.15.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.tableCellMessages = exports.sortingIconMessages = exports.headingAnchorLinkMessages = void 0;
|
|
6
|
+
exports.tableCellMessages = exports.sortingIconMessages = exports.sortingAriaLabelMessages = exports.headingAnchorLinkMessages = void 0;
|
|
7
7
|
var _reactIntlNext = require("react-intl-next");
|
|
8
8
|
var headingAnchorLinkMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
9
|
copyHeadingLinkToClipboard: {
|
|
@@ -68,4 +68,32 @@ var sortingIconMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
68
68
|
description: 'this sort is invalid for merged cells'
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
exports.sortingIconMessages = sortingIconMessages;
|
|
71
|
+
exports.sortingIconMessages = sortingIconMessages;
|
|
72
|
+
var sortingAriaLabelMessages = (0, _reactIntlNext.defineMessages)({
|
|
73
|
+
noOrderLabel: {
|
|
74
|
+
id: 'fabric.editor.tableHeader.sorting.no',
|
|
75
|
+
defaultMessage: 'No sort applied to the column',
|
|
76
|
+
description: 'Aria-label for Sort column button when sorting was not applied or the sorting has been cleared'
|
|
77
|
+
},
|
|
78
|
+
ascOrderLabel: {
|
|
79
|
+
id: 'fabric.editor.tableHeader.sorting.asc',
|
|
80
|
+
defaultMessage: 'Ascending sort applied',
|
|
81
|
+
description: 'Aria-label for Sort column button when ascending sorting was applied'
|
|
82
|
+
},
|
|
83
|
+
descOrderLabel: {
|
|
84
|
+
id: 'fabric.editor.tableHeader.sorting.desc',
|
|
85
|
+
defaultMessage: 'Descending sort applied',
|
|
86
|
+
description: 'Aria-label for Sort column button when descending sorting was applied'
|
|
87
|
+
},
|
|
88
|
+
invalidLabel: {
|
|
89
|
+
id: 'fabric.editor.tableHeader.sorting.invalid',
|
|
90
|
+
defaultMessage: "You can't sort a table with merged cells",
|
|
91
|
+
description: 'Aria-label for Sort column button when sorting is not possible'
|
|
92
|
+
},
|
|
93
|
+
defaultLabel: {
|
|
94
|
+
id: 'fabric.editor.tableHeader.sorting.default',
|
|
95
|
+
defaultMessage: 'Sort the column',
|
|
96
|
+
description: 'Default aria-label for Sort column button'
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
exports.sortingAriaLabelMessages = sortingAriaLabelMessages;
|
|
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
|
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "108.15.
|
|
58
|
+
var packageVersion = "108.15.4";
|
|
59
59
|
var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -23,7 +23,7 @@ var StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
|
23
23
|
return StatusClassNames;
|
|
24
24
|
}({});
|
|
25
25
|
exports.StatusClassNames = StatusClassNames;
|
|
26
|
-
var buttonStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin:
|
|
26
|
+
var buttonStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: ", ";\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-space-075, 6px)", "var(--ds-border, #fff)", "var(--ds-border-radius-100, 4px)", "var(--ds-surface-overlay, ".concat(_colors.N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(_colors.N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", _consts.RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
27
27
|
var iconWrapperStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
28
28
|
|
|
29
29
|
// The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
@@ -63,6 +63,25 @@ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, sortOrder
|
|
|
63
63
|
}
|
|
64
64
|
return '';
|
|
65
65
|
};
|
|
66
|
+
var getAriaLabel = function getAriaLabel(intl, isSortingAllowed, sortOrdered) {
|
|
67
|
+
var noOrderLabel = _messages.sortingAriaLabelMessages.noOrderLabel,
|
|
68
|
+
ascOrderLabel = _messages.sortingAriaLabelMessages.ascOrderLabel,
|
|
69
|
+
descOrderLabel = _messages.sortingAriaLabelMessages.descOrderLabel,
|
|
70
|
+
invalidLabel = _messages.sortingAriaLabelMessages.invalidLabel,
|
|
71
|
+
defaultLabel = _messages.sortingAriaLabelMessages.defaultLabel;
|
|
72
|
+
if (!isSortingAllowed) {
|
|
73
|
+
return intl.formatMessage(invalidLabel);
|
|
74
|
+
}
|
|
75
|
+
switch (sortOrdered) {
|
|
76
|
+
case _types.SortOrder.NO_ORDER:
|
|
77
|
+
return intl.formatMessage(noOrderLabel);
|
|
78
|
+
case _types.SortOrder.ASC:
|
|
79
|
+
return intl.formatMessage(ascOrderLabel);
|
|
80
|
+
case _types.SortOrder.DESC:
|
|
81
|
+
return intl.formatMessage(descOrderLabel);
|
|
82
|
+
}
|
|
83
|
+
return intl.formatMessage(defaultLabel);
|
|
84
|
+
};
|
|
66
85
|
var SortingIcon = function SortingIcon(_ref) {
|
|
67
86
|
var isSortingAllowed = _ref.isSortingAllowed,
|
|
68
87
|
sortOrdered = _ref.sortOrdered,
|
|
@@ -71,6 +90,7 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
71
90
|
onKeyDown = _ref.onKeyDown;
|
|
72
91
|
var buttonClassName = "".concat(_consts.RendererCssClassName.SORTABLE_COLUMN_ICON).concat(isSortingAllowed ? '' : " ".concat(_consts.RendererCssClassName.SORTABLE_COLUMN_ICON, "__not-allowed"));
|
|
73
92
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
93
|
+
var ariaLabel = getAriaLabel(intl, isSortingAllowed, sortOrdered);
|
|
74
94
|
var handleClick = function handleClick() {
|
|
75
95
|
if (isSortingAllowed) {
|
|
76
96
|
onClick();
|
|
@@ -90,7 +110,7 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
90
110
|
className: buttonClassName,
|
|
91
111
|
role: "button",
|
|
92
112
|
tabIndex: isSortingAllowed ? 0 : -1,
|
|
93
|
-
"aria-label":
|
|
113
|
+
"aria-label": ariaLabel,
|
|
94
114
|
"aria-disabled": !isSortingAllowed,
|
|
95
115
|
onClick: handleClick,
|
|
96
116
|
onKeyDown: handleKeyDown
|
package/dist/es2019/messages.js
CHANGED
|
@@ -59,4 +59,31 @@ export const sortingIconMessages = defineMessages({
|
|
|
59
59
|
defaultMessage: `⚠️ You can't sort a table with merged cells`,
|
|
60
60
|
description: 'this sort is invalid for merged cells'
|
|
61
61
|
}
|
|
62
|
+
});
|
|
63
|
+
export const sortingAriaLabelMessages = defineMessages({
|
|
64
|
+
noOrderLabel: {
|
|
65
|
+
id: 'fabric.editor.tableHeader.sorting.no',
|
|
66
|
+
defaultMessage: 'No sort applied to the column',
|
|
67
|
+
description: 'Aria-label for Sort column button when sorting was not applied or the sorting has been cleared'
|
|
68
|
+
},
|
|
69
|
+
ascOrderLabel: {
|
|
70
|
+
id: 'fabric.editor.tableHeader.sorting.asc',
|
|
71
|
+
defaultMessage: 'Ascending sort applied',
|
|
72
|
+
description: 'Aria-label for Sort column button when ascending sorting was applied'
|
|
73
|
+
},
|
|
74
|
+
descOrderLabel: {
|
|
75
|
+
id: 'fabric.editor.tableHeader.sorting.desc',
|
|
76
|
+
defaultMessage: 'Descending sort applied',
|
|
77
|
+
description: 'Aria-label for Sort column button when descending sorting was applied'
|
|
78
|
+
},
|
|
79
|
+
invalidLabel: {
|
|
80
|
+
id: 'fabric.editor.tableHeader.sorting.invalid',
|
|
81
|
+
defaultMessage: `You can't sort a table with merged cells`,
|
|
82
|
+
description: 'Aria-label for Sort column button when sorting is not possible'
|
|
83
|
+
},
|
|
84
|
+
defaultLabel: {
|
|
85
|
+
id: 'fabric.editor.tableHeader.sorting.default',
|
|
86
|
+
defaultMessage: 'Sort the column',
|
|
87
|
+
description: 'Default aria-label for Sort column button'
|
|
88
|
+
}
|
|
62
89
|
});
|
|
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "108.15.
|
|
38
|
+
const packageVersion = "108.15.4";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
|
@@ -3,7 +3,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
3
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
4
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
6
|
-
import { sortingIconMessages } from '../messages';
|
|
6
|
+
import { sortingIconMessages, sortingAriaLabelMessages } from '../messages';
|
|
7
7
|
import { injectIntl } from 'react-intl-next';
|
|
8
8
|
import { RendererCssClassName } from '../consts';
|
|
9
9
|
export let StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
@@ -18,7 +18,7 @@ const buttonStyles = css`
|
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 28px;
|
|
20
20
|
width: 28px;
|
|
21
|
-
margin: 6px;
|
|
21
|
+
margin: ${"var(--ds-space-075, 6px)"};
|
|
22
22
|
right: 0;
|
|
23
23
|
top: 0;
|
|
24
24
|
border: 2px solid ${"var(--ds-border, #fff)"};
|
|
@@ -119,6 +119,27 @@ const getTooltipTitle = (intl, isSortingAllowed, sortOrdered) => {
|
|
|
119
119
|
}
|
|
120
120
|
return '';
|
|
121
121
|
};
|
|
122
|
+
const getAriaLabel = (intl, isSortingAllowed, sortOrdered) => {
|
|
123
|
+
const {
|
|
124
|
+
noOrderLabel,
|
|
125
|
+
ascOrderLabel,
|
|
126
|
+
descOrderLabel,
|
|
127
|
+
invalidLabel,
|
|
128
|
+
defaultLabel
|
|
129
|
+
} = sortingAriaLabelMessages;
|
|
130
|
+
if (!isSortingAllowed) {
|
|
131
|
+
return intl.formatMessage(invalidLabel);
|
|
132
|
+
}
|
|
133
|
+
switch (sortOrdered) {
|
|
134
|
+
case SortOrder.NO_ORDER:
|
|
135
|
+
return intl.formatMessage(noOrderLabel);
|
|
136
|
+
case SortOrder.ASC:
|
|
137
|
+
return intl.formatMessage(ascOrderLabel);
|
|
138
|
+
case SortOrder.DESC:
|
|
139
|
+
return intl.formatMessage(descOrderLabel);
|
|
140
|
+
}
|
|
141
|
+
return intl.formatMessage(defaultLabel);
|
|
142
|
+
};
|
|
122
143
|
const SortingIcon = ({
|
|
123
144
|
isSortingAllowed,
|
|
124
145
|
sortOrdered,
|
|
@@ -128,6 +149,7 @@ const SortingIcon = ({
|
|
|
128
149
|
}) => {
|
|
129
150
|
const buttonClassName = `${RendererCssClassName.SORTABLE_COLUMN_ICON}${isSortingAllowed ? '' : ` ${RendererCssClassName.SORTABLE_COLUMN_ICON}__not-allowed`}`;
|
|
130
151
|
const content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
152
|
+
const ariaLabel = getAriaLabel(intl, isSortingAllowed, sortOrdered);
|
|
131
153
|
const handleClick = () => {
|
|
132
154
|
if (isSortingAllowed) {
|
|
133
155
|
onClick();
|
|
@@ -147,7 +169,7 @@ const SortingIcon = ({
|
|
|
147
169
|
className: buttonClassName,
|
|
148
170
|
role: "button",
|
|
149
171
|
tabIndex: isSortingAllowed ? 0 : -1,
|
|
150
|
-
"aria-label":
|
|
172
|
+
"aria-label": ariaLabel,
|
|
151
173
|
"aria-disabled": !isSortingAllowed,
|
|
152
174
|
onClick: handleClick,
|
|
153
175
|
onKeyDown: handleKeyDown
|
package/dist/esm/messages.js
CHANGED
|
@@ -59,4 +59,31 @@ export var sortingIconMessages = defineMessages({
|
|
|
59
59
|
defaultMessage: "\u26A0\uFE0F You can't sort a table with merged cells",
|
|
60
60
|
description: 'this sort is invalid for merged cells'
|
|
61
61
|
}
|
|
62
|
+
});
|
|
63
|
+
export var sortingAriaLabelMessages = defineMessages({
|
|
64
|
+
noOrderLabel: {
|
|
65
|
+
id: 'fabric.editor.tableHeader.sorting.no',
|
|
66
|
+
defaultMessage: 'No sort applied to the column',
|
|
67
|
+
description: 'Aria-label for Sort column button when sorting was not applied or the sorting has been cleared'
|
|
68
|
+
},
|
|
69
|
+
ascOrderLabel: {
|
|
70
|
+
id: 'fabric.editor.tableHeader.sorting.asc',
|
|
71
|
+
defaultMessage: 'Ascending sort applied',
|
|
72
|
+
description: 'Aria-label for Sort column button when ascending sorting was applied'
|
|
73
|
+
},
|
|
74
|
+
descOrderLabel: {
|
|
75
|
+
id: 'fabric.editor.tableHeader.sorting.desc',
|
|
76
|
+
defaultMessage: 'Descending sort applied',
|
|
77
|
+
description: 'Aria-label for Sort column button when descending sorting was applied'
|
|
78
|
+
},
|
|
79
|
+
invalidLabel: {
|
|
80
|
+
id: 'fabric.editor.tableHeader.sorting.invalid',
|
|
81
|
+
defaultMessage: "You can't sort a table with merged cells",
|
|
82
|
+
description: 'Aria-label for Sort column button when sorting is not possible'
|
|
83
|
+
},
|
|
84
|
+
defaultLabel: {
|
|
85
|
+
id: 'fabric.editor.tableHeader.sorting.default',
|
|
86
|
+
defaultMessage: 'Sort the column',
|
|
87
|
+
description: 'Default aria-label for Sort column button'
|
|
88
|
+
}
|
|
62
89
|
});
|
|
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "108.15.
|
|
48
|
+
var packageVersion = "108.15.4";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -5,7 +5,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
5
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
6
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
8
|
-
import { sortingIconMessages } from '../messages';
|
|
8
|
+
import { sortingIconMessages, sortingAriaLabelMessages } from '../messages';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { RendererCssClassName } from '../consts';
|
|
11
11
|
export var StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
@@ -15,7 +15,7 @@ export var StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
|
15
15
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
16
16
|
return StatusClassNames;
|
|
17
17
|
}({});
|
|
18
|
-
var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin:
|
|
18
|
+
var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: ", ";\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-space-075, 6px)", "var(--ds-border, #fff)", "var(--ds-border-radius-100, 4px)", "var(--ds-surface-overlay, ".concat(N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
19
19
|
var iconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
20
20
|
|
|
21
21
|
// The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
@@ -55,6 +55,25 @@ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, sortOrder
|
|
|
55
55
|
}
|
|
56
56
|
return '';
|
|
57
57
|
};
|
|
58
|
+
var getAriaLabel = function getAriaLabel(intl, isSortingAllowed, sortOrdered) {
|
|
59
|
+
var noOrderLabel = sortingAriaLabelMessages.noOrderLabel,
|
|
60
|
+
ascOrderLabel = sortingAriaLabelMessages.ascOrderLabel,
|
|
61
|
+
descOrderLabel = sortingAriaLabelMessages.descOrderLabel,
|
|
62
|
+
invalidLabel = sortingAriaLabelMessages.invalidLabel,
|
|
63
|
+
defaultLabel = sortingAriaLabelMessages.defaultLabel;
|
|
64
|
+
if (!isSortingAllowed) {
|
|
65
|
+
return intl.formatMessage(invalidLabel);
|
|
66
|
+
}
|
|
67
|
+
switch (sortOrdered) {
|
|
68
|
+
case SortOrder.NO_ORDER:
|
|
69
|
+
return intl.formatMessage(noOrderLabel);
|
|
70
|
+
case SortOrder.ASC:
|
|
71
|
+
return intl.formatMessage(ascOrderLabel);
|
|
72
|
+
case SortOrder.DESC:
|
|
73
|
+
return intl.formatMessage(descOrderLabel);
|
|
74
|
+
}
|
|
75
|
+
return intl.formatMessage(defaultLabel);
|
|
76
|
+
};
|
|
58
77
|
var SortingIcon = function SortingIcon(_ref) {
|
|
59
78
|
var isSortingAllowed = _ref.isSortingAllowed,
|
|
60
79
|
sortOrdered = _ref.sortOrdered,
|
|
@@ -63,6 +82,7 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
63
82
|
onKeyDown = _ref.onKeyDown;
|
|
64
83
|
var buttonClassName = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON).concat(isSortingAllowed ? '' : " ".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "__not-allowed"));
|
|
65
84
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
85
|
+
var ariaLabel = getAriaLabel(intl, isSortingAllowed, sortOrdered);
|
|
66
86
|
var handleClick = function handleClick() {
|
|
67
87
|
if (isSortingAllowed) {
|
|
68
88
|
onClick();
|
|
@@ -82,7 +102,7 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
82
102
|
className: buttonClassName,
|
|
83
103
|
role: "button",
|
|
84
104
|
tabIndex: isSortingAllowed ? 0 : -1,
|
|
85
|
-
"aria-label":
|
|
105
|
+
"aria-label": ariaLabel,
|
|
86
106
|
"aria-disabled": !isSortingAllowed,
|
|
87
107
|
onClick: handleClick,
|
|
88
108
|
onKeyDown: handleKeyDown
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -59,3 +59,30 @@ export declare const sortingIconMessages: {
|
|
|
59
59
|
description: string;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
+
export declare const sortingAriaLabelMessages: {
|
|
63
|
+
noOrderLabel: {
|
|
64
|
+
id: string;
|
|
65
|
+
defaultMessage: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
ascOrderLabel: {
|
|
69
|
+
id: string;
|
|
70
|
+
defaultMessage: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
descOrderLabel: {
|
|
74
|
+
id: string;
|
|
75
|
+
defaultMessage: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
invalidLabel: {
|
|
79
|
+
id: string;
|
|
80
|
+
defaultMessage: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
defaultLabel: {
|
|
84
|
+
id: string;
|
|
85
|
+
defaultMessage: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
export declare enum StatusClassNames {
|
|
5
5
|
ASC = "sorting-icon-svg__asc",
|
|
6
6
|
DESC = "sorting-icon-svg__desc",
|
|
@@ -59,3 +59,30 @@ export declare const sortingIconMessages: {
|
|
|
59
59
|
description: string;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
+
export declare const sortingAriaLabelMessages: {
|
|
63
|
+
noOrderLabel: {
|
|
64
|
+
id: string;
|
|
65
|
+
defaultMessage: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
ascOrderLabel: {
|
|
69
|
+
id: string;
|
|
70
|
+
defaultMessage: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
descOrderLabel: {
|
|
74
|
+
id: string;
|
|
75
|
+
defaultMessage: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
invalidLabel: {
|
|
79
|
+
id: string;
|
|
80
|
+
defaultMessage: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
defaultLabel: {
|
|
84
|
+
id: string;
|
|
85
|
+
defaultMessage: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
export declare enum StatusClassNames {
|
|
5
5
|
ASC = "sorting-icon-svg__asc",
|
|
6
6
|
DESC = "sorting-icon-svg__desc",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "108.15.
|
|
3
|
+
"version": "108.15.4",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
32
32
|
"@atlaskit/button": "^16.10.0",
|
|
33
33
|
"@atlaskit/code": "^14.6.0",
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^76.0.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.1",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "1.1.0",
|