@atlaskit/react-select 2.5.0 → 2.6.1
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 +17 -0
- package/dist/cjs/compiled/components/control.js +1 -1
- package/dist/cjs/select.js +81 -77
- package/dist/es2019/compiled/components/control.js +1 -1
- package/dist/es2019/select.js +6 -3
- package/dist/esm/compiled/components/control.js +1 -1
- package/dist/esm/select.js +81 -77
- package/dist/types/select.d.ts +6 -0
- package/dist/types-ts4.5/select.d.ts +6 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 2.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159414](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159414)
|
|
8
|
+
[`51ab2e7b0a12d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/51ab2e7b0a12d) -
|
|
9
|
+
Added aria label for options dialog
|
|
10
|
+
|
|
11
|
+
## 2.6.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#158127](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158127)
|
|
16
|
+
[`b7989ac128aef`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b7989ac128aef) -
|
|
17
|
+
Added "shouldOmitDefaultDescription" prop for `Select` to omit default description being set for
|
|
18
|
+
"aria-describedby" attribute
|
|
19
|
+
|
|
3
20
|
## 2.5.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -22,7 +22,7 @@ var styles = {
|
|
|
22
22
|
invalid: "_1h6d1bqt _16qsizbr _1u6lizbr _4cvx1bqt",
|
|
23
23
|
focusedInvalid: "_16qsq049",
|
|
24
24
|
disabled: "_1h6dsyzs _lcxvglyw _bfhksyzs _1u6llkwx",
|
|
25
|
-
focused: "_1h6d1p6i _bfhkr01l _1u6lq049 _4cvx1p6i _irr3r01l",
|
|
25
|
+
focused: "_1h6d1p6i _bfhkr01l _16qsq049 _1u6lq049 _4cvx1p6i _irr3r01l",
|
|
26
26
|
subtle: "_1h6d1j28 _bfhk1j28 _1u6l3sij",
|
|
27
27
|
subtleFocused: "_bfhkvuon",
|
|
28
28
|
none: "_1h6d1j28 _bfhk1j28 _1u6l3sij _4cvx1j28 _irr31j28"
|
package/dist/cjs/select.js
CHANGED
|
@@ -81,7 +81,8 @@ var defaultProps = exports.defaultProps = {
|
|
|
81
81
|
styles: {},
|
|
82
82
|
tabIndex: 0,
|
|
83
83
|
tabSelectsValue: true,
|
|
84
|
-
UNSAFE_is_experimental_generic: false
|
|
84
|
+
UNSAFE_is_experimental_generic: false,
|
|
85
|
+
shouldOmitDefaultDescription: false
|
|
85
86
|
};
|
|
86
87
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
87
88
|
var isDisabled = _isOptionDisabled(props, option, selectValue);
|
|
@@ -1161,7 +1162,9 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1161
1162
|
key: "calculateDescription",
|
|
1162
1163
|
value: function calculateDescription(action) {
|
|
1163
1164
|
var descriptionProp = this.props['aria-describedby'] || this.props['descriptionId'];
|
|
1164
|
-
var
|
|
1165
|
+
var _this$props8 = this.props,
|
|
1166
|
+
isMulti = _this$props8.isMulti,
|
|
1167
|
+
shouldOmitDefaultDescription = _this$props8.shouldOmitDefaultDescription;
|
|
1165
1168
|
var selectValue = this.state.selectValue;
|
|
1166
1169
|
var defaultDescription = selectValue.length ? this.getElementId('live-region') : this.getElementId('placeholder');
|
|
1167
1170
|
if (!isMulti && selectValue.length && action !== 'initial-input-focus') {
|
|
@@ -1170,7 +1173,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1170
1173
|
if (isMulti) {
|
|
1171
1174
|
var multiMessage = this.getElementId('multi-message');
|
|
1172
1175
|
return {
|
|
1173
|
-
'aria-describedby':
|
|
1176
|
+
'aria-describedby': [descriptionProp, !shouldOmitDefaultDescription && defaultDescription, multiMessage].filter(Boolean).join(' ')
|
|
1174
1177
|
};
|
|
1175
1178
|
} else {
|
|
1176
1179
|
return {
|
|
@@ -1239,22 +1242,22 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1239
1242
|
// Renderers
|
|
1240
1243
|
// ==============================
|
|
1241
1244
|
function renderInput() {
|
|
1242
|
-
var _this$
|
|
1243
|
-
descriptionId = _this$
|
|
1244
|
-
form = _this$
|
|
1245
|
-
inputId = _this$
|
|
1246
|
-
inputValue = _this$
|
|
1247
|
-
isDisabled = _this$
|
|
1248
|
-
isInvalid = _this$
|
|
1249
|
-
isRequired = _this$
|
|
1250
|
-
isSearchable = _this$
|
|
1251
|
-
label = _this$
|
|
1252
|
-
labelId = _this$
|
|
1253
|
-
menuIsOpen = _this$
|
|
1254
|
-
required = _this$
|
|
1255
|
-
_this$
|
|
1256
|
-
tabIndex = _this$
|
|
1257
|
-
testId = _this$
|
|
1245
|
+
var _this$props9 = this.props,
|
|
1246
|
+
descriptionId = _this$props9.descriptionId,
|
|
1247
|
+
form = _this$props9.form,
|
|
1248
|
+
inputId = _this$props9.inputId,
|
|
1249
|
+
inputValue = _this$props9.inputValue,
|
|
1250
|
+
isDisabled = _this$props9.isDisabled,
|
|
1251
|
+
isInvalid = _this$props9.isInvalid,
|
|
1252
|
+
isRequired = _this$props9.isRequired,
|
|
1253
|
+
isSearchable = _this$props9.isSearchable,
|
|
1254
|
+
label = _this$props9.label,
|
|
1255
|
+
labelId = _this$props9.labelId,
|
|
1256
|
+
menuIsOpen = _this$props9.menuIsOpen,
|
|
1257
|
+
required = _this$props9.required,
|
|
1258
|
+
_this$props9$tabIndex = _this$props9.tabIndex,
|
|
1259
|
+
tabIndex = _this$props9$tabIndex === void 0 ? 0 : _this$props9$tabIndex,
|
|
1260
|
+
testId = _this$props9.testId;
|
|
1258
1261
|
var _this$getComponents = this.getComponents(),
|
|
1259
1262
|
Input = _this$getComponents.Input;
|
|
1260
1263
|
var _this$state4 = this.state,
|
|
@@ -1329,13 +1332,13 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1329
1332
|
SingleValue = _this$getComponents2.SingleValue,
|
|
1330
1333
|
Placeholder = _this$getComponents2.Placeholder;
|
|
1331
1334
|
var commonProps = this.commonProps;
|
|
1332
|
-
var _this$
|
|
1333
|
-
controlShouldRenderValue = _this$
|
|
1334
|
-
isDisabled = _this$
|
|
1335
|
-
isMulti = _this$
|
|
1336
|
-
inputValue = _this$
|
|
1337
|
-
placeholder = _this$
|
|
1338
|
-
testId = _this$
|
|
1335
|
+
var _this$props10 = this.props,
|
|
1336
|
+
controlShouldRenderValue = _this$props10.controlShouldRenderValue,
|
|
1337
|
+
isDisabled = _this$props10.isDisabled,
|
|
1338
|
+
isMulti = _this$props10.isMulti,
|
|
1339
|
+
inputValue = _this$props10.inputValue,
|
|
1340
|
+
placeholder = _this$props10.placeholder,
|
|
1341
|
+
testId = _this$props10.testId;
|
|
1339
1342
|
var _this$state5 = this.state,
|
|
1340
1343
|
selectValue = _this$state5.selectValue,
|
|
1341
1344
|
focusedValue = _this$state5.focusedValue,
|
|
@@ -1405,12 +1408,12 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1405
1408
|
var _this$getComponents3 = this.getComponents(),
|
|
1406
1409
|
ClearIndicator = _this$getComponents3.ClearIndicator;
|
|
1407
1410
|
var commonProps = this.commonProps;
|
|
1408
|
-
var _this$
|
|
1409
|
-
clearControlLabel = _this$
|
|
1410
|
-
isDisabled = _this$
|
|
1411
|
-
isLoading = _this$
|
|
1412
|
-
spacing = _this$
|
|
1413
|
-
testId = _this$
|
|
1411
|
+
var _this$props11 = this.props,
|
|
1412
|
+
clearControlLabel = _this$props11.clearControlLabel,
|
|
1413
|
+
isDisabled = _this$props11.isDisabled,
|
|
1414
|
+
isLoading = _this$props11.isLoading,
|
|
1415
|
+
spacing = _this$props11.spacing,
|
|
1416
|
+
testId = _this$props11.testId;
|
|
1414
1417
|
var isFocused = this.state.isFocused;
|
|
1415
1418
|
if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
|
|
1416
1419
|
return null;
|
|
@@ -1436,11 +1439,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1436
1439
|
var _this$getComponents4 = this.getComponents(),
|
|
1437
1440
|
LoadingIndicator = _this$getComponents4.LoadingIndicator;
|
|
1438
1441
|
var commonProps = this.commonProps;
|
|
1439
|
-
var _this$
|
|
1440
|
-
isDisabled = _this$
|
|
1441
|
-
isLoading = _this$
|
|
1442
|
-
spacing = _this$
|
|
1443
|
-
testId = _this$
|
|
1442
|
+
var _this$props12 = this.props,
|
|
1443
|
+
isDisabled = _this$props12.isDisabled,
|
|
1444
|
+
isLoading = _this$props12.isLoading,
|
|
1445
|
+
spacing = _this$props12.spacing,
|
|
1446
|
+
testId = _this$props12.testId;
|
|
1444
1447
|
var isFocused = this.state.isFocused;
|
|
1445
1448
|
if (!LoadingIndicator || !isLoading) {
|
|
1446
1449
|
return null;
|
|
@@ -1467,10 +1470,10 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1467
1470
|
return null;
|
|
1468
1471
|
}
|
|
1469
1472
|
var commonProps = this.commonProps;
|
|
1470
|
-
var _this$
|
|
1471
|
-
isDisabled = _this$
|
|
1472
|
-
spacing = _this$
|
|
1473
|
-
testId = _this$
|
|
1473
|
+
var _this$props13 = this.props,
|
|
1474
|
+
isDisabled = _this$props13.isDisabled,
|
|
1475
|
+
spacing = _this$props13.spacing,
|
|
1476
|
+
testId = _this$props13.testId;
|
|
1474
1477
|
var isFocused = this.state.isFocused;
|
|
1475
1478
|
var isCompact = spacing === 'compact';
|
|
1476
1479
|
var innerProps = _objectSpread({
|
|
@@ -1502,25 +1505,25 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1502
1505
|
Option = _this$getComponents6.Option;
|
|
1503
1506
|
var commonProps = this.commonProps;
|
|
1504
1507
|
var focusedOption = this.state.focusedOption;
|
|
1505
|
-
var _this$
|
|
1506
|
-
captureMenuScroll = _this$
|
|
1507
|
-
inputValue = _this$
|
|
1508
|
-
isLoading = _this$
|
|
1509
|
-
loadingMessage = _this$
|
|
1510
|
-
minMenuHeight = _this$
|
|
1511
|
-
maxMenuHeight = _this$
|
|
1512
|
-
menuIsOpen = _this$
|
|
1513
|
-
menuPlacement = _this$
|
|
1514
|
-
menuPosition = _this$
|
|
1515
|
-
menuPortalTarget = _this$
|
|
1516
|
-
menuShouldBlockScroll = _this$
|
|
1517
|
-
menuShouldScrollIntoView = _this$
|
|
1518
|
-
noOptionsMessage = _this$
|
|
1519
|
-
onMenuScrollToTop = _this$
|
|
1520
|
-
onMenuScrollToBottom = _this$
|
|
1521
|
-
labelId = _this$
|
|
1522
|
-
label = _this$
|
|
1523
|
-
testId = _this$
|
|
1508
|
+
var _this$props14 = this.props,
|
|
1509
|
+
captureMenuScroll = _this$props14.captureMenuScroll,
|
|
1510
|
+
inputValue = _this$props14.inputValue,
|
|
1511
|
+
isLoading = _this$props14.isLoading,
|
|
1512
|
+
loadingMessage = _this$props14.loadingMessage,
|
|
1513
|
+
minMenuHeight = _this$props14.minMenuHeight,
|
|
1514
|
+
maxMenuHeight = _this$props14.maxMenuHeight,
|
|
1515
|
+
menuIsOpen = _this$props14.menuIsOpen,
|
|
1516
|
+
menuPlacement = _this$props14.menuPlacement,
|
|
1517
|
+
menuPosition = _this$props14.menuPosition,
|
|
1518
|
+
menuPortalTarget = _this$props14.menuPortalTarget,
|
|
1519
|
+
menuShouldBlockScroll = _this$props14.menuShouldBlockScroll,
|
|
1520
|
+
menuShouldScrollIntoView = _this$props14.menuShouldScrollIntoView,
|
|
1521
|
+
noOptionsMessage = _this$props14.noOptionsMessage,
|
|
1522
|
+
onMenuScrollToTop = _this$props14.onMenuScrollToTop,
|
|
1523
|
+
onMenuScrollToBottom = _this$props14.onMenuScrollToBottom,
|
|
1524
|
+
labelId = _this$props14.labelId,
|
|
1525
|
+
label = _this$props14.label,
|
|
1526
|
+
testId = _this$props14.testId;
|
|
1524
1527
|
if (!menuIsOpen) {
|
|
1525
1528
|
return null;
|
|
1526
1529
|
}
|
|
@@ -1673,6 +1676,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1673
1676
|
},
|
|
1674
1677
|
innerProps: _objectSpread(_objectSpread({
|
|
1675
1678
|
role: _this4.props['UNSAFE_is_experimental_generic'] ? 'dialog' : 'listbox',
|
|
1679
|
+
'aria-label': _this4.props['UNSAFE_is_experimental_generic'] ? "".concat(_this4.props['aria-label'] || label, "-dialog") : null,
|
|
1676
1680
|
'aria-multiselectable': (_this4.isVoiceOver || !commonProps.isMulti) && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') || _this4.props['UNSAFE_is_experimental_generic'] ? undefined : commonProps.isMulti,
|
|
1677
1681
|
id: _this4.getElementId('listbox')
|
|
1678
1682
|
}, testId && {
|
|
@@ -1701,12 +1705,12 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1701
1705
|
key: "renderFormField",
|
|
1702
1706
|
value: function renderFormField() {
|
|
1703
1707
|
var _this5 = this;
|
|
1704
|
-
var _this$
|
|
1705
|
-
delimiter = _this$
|
|
1706
|
-
isDisabled = _this$
|
|
1707
|
-
isMulti = _this$
|
|
1708
|
-
required = _this$
|
|
1709
|
-
name = _this$
|
|
1708
|
+
var _this$props15 = this.props,
|
|
1709
|
+
delimiter = _this$props15.delimiter,
|
|
1710
|
+
isDisabled = _this$props15.isDisabled,
|
|
1711
|
+
isMulti = _this$props15.isMulti,
|
|
1712
|
+
required = _this$props15.required,
|
|
1713
|
+
name = _this$props15.name;
|
|
1710
1714
|
var selectValue = this.state.selectValue;
|
|
1711
1715
|
if (required && !this.hasValue() && !isDisabled) {
|
|
1712
1716
|
return /*#__PURE__*/_react.default.createElement(_internal.RequiredInput, {
|
|
@@ -1793,17 +1797,17 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1793
1797
|
IndicatorsContainer = _this$getComponents7.IndicatorsContainer,
|
|
1794
1798
|
SelectContainer = _this$getComponents7.SelectContainer,
|
|
1795
1799
|
ValueContainer = _this$getComponents7.ValueContainer;
|
|
1796
|
-
var _this$
|
|
1797
|
-
className = _this$
|
|
1798
|
-
id = _this$
|
|
1799
|
-
isDisabled = _this$
|
|
1800
|
-
menuIsOpen = _this$
|
|
1801
|
-
isInvalid = _this$
|
|
1802
|
-
testId = _this$
|
|
1803
|
-
_this$
|
|
1804
|
-
appearance = _this$
|
|
1805
|
-
_this$
|
|
1806
|
-
spacing = _this$
|
|
1800
|
+
var _this$props16 = this.props,
|
|
1801
|
+
className = _this$props16.className,
|
|
1802
|
+
id = _this$props16.id,
|
|
1803
|
+
isDisabled = _this$props16.isDisabled,
|
|
1804
|
+
menuIsOpen = _this$props16.menuIsOpen,
|
|
1805
|
+
isInvalid = _this$props16.isInvalid,
|
|
1806
|
+
testId = _this$props16.testId,
|
|
1807
|
+
_this$props16$appeara = _this$props16.appearance,
|
|
1808
|
+
appearance = _this$props16$appeara === void 0 ? 'default' : _this$props16$appeara,
|
|
1809
|
+
_this$props16$spacing = _this$props16.spacing,
|
|
1810
|
+
spacing = _this$props16$spacing === void 0 ? 'default' : _this$props16$spacing;
|
|
1807
1811
|
var isFocused = this.state.isFocused;
|
|
1808
1812
|
var commonProps = this.commonProps = this.getCommonProps();
|
|
1809
1813
|
var isCompact = spacing === 'compact';
|
|
@@ -13,7 +13,7 @@ const styles = {
|
|
|
13
13
|
invalid: "_1h6d1bqt _16qsizbr _1u6lizbr _4cvx1bqt",
|
|
14
14
|
focusedInvalid: "_16qsq049",
|
|
15
15
|
disabled: "_1h6dsyzs _lcxvglyw _bfhksyzs _1u6llkwx",
|
|
16
|
-
focused: "_1h6d1p6i _bfhkr01l _1u6lq049 _4cvx1p6i _irr3r01l",
|
|
16
|
+
focused: "_1h6d1p6i _bfhkr01l _16qsq049 _1u6lq049 _4cvx1p6i _irr3r01l",
|
|
17
17
|
subtle: "_1h6d1j28 _bfhk1j28 _1u6l3sij",
|
|
18
18
|
subtleFocused: "_bfhkvuon",
|
|
19
19
|
none: "_1h6d1j28 _bfhk1j28 _1u6l3sij _4cvx1j28 _irr31j28"
|
package/dist/es2019/select.js
CHANGED
|
@@ -56,7 +56,8 @@ export const defaultProps = {
|
|
|
56
56
|
styles: {},
|
|
57
57
|
tabIndex: 0,
|
|
58
58
|
tabSelectsValue: true,
|
|
59
|
-
UNSAFE_is_experimental_generic: false
|
|
59
|
+
UNSAFE_is_experimental_generic: false,
|
|
60
|
+
shouldOmitDefaultDescription: false
|
|
60
61
|
};
|
|
61
62
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
62
63
|
const isDisabled = isOptionDisabled(props, option, selectValue);
|
|
@@ -1177,7 +1178,8 @@ export default class Select extends Component {
|
|
|
1177
1178
|
calculateDescription(action) {
|
|
1178
1179
|
const descriptionProp = this.props['aria-describedby'] || this.props['descriptionId'];
|
|
1179
1180
|
const {
|
|
1180
|
-
isMulti
|
|
1181
|
+
isMulti,
|
|
1182
|
+
shouldOmitDefaultDescription
|
|
1181
1183
|
} = this.props;
|
|
1182
1184
|
const {
|
|
1183
1185
|
selectValue
|
|
@@ -1189,7 +1191,7 @@ export default class Select extends Component {
|
|
|
1189
1191
|
if (isMulti) {
|
|
1190
1192
|
const multiMessage = this.getElementId('multi-message');
|
|
1191
1193
|
return {
|
|
1192
|
-
'aria-describedby':
|
|
1194
|
+
'aria-describedby': [descriptionProp, !shouldOmitDefaultDescription && defaultDescription, multiMessage].filter(Boolean).join(' ')
|
|
1193
1195
|
};
|
|
1194
1196
|
} else {
|
|
1195
1197
|
return {
|
|
@@ -1707,6 +1709,7 @@ export default class Select extends Component {
|
|
|
1707
1709
|
},
|
|
1708
1710
|
innerProps: {
|
|
1709
1711
|
role: this.props['UNSAFE_is_experimental_generic'] ? 'dialog' : 'listbox',
|
|
1712
|
+
'aria-label': this.props['UNSAFE_is_experimental_generic'] ? `${this.props['aria-label'] || label}-dialog` : null,
|
|
1710
1713
|
'aria-multiselectable': (this.isVoiceOver || !commonProps.isMulti) && fg('design_system_select-a11y-improvement') || this.props['UNSAFE_is_experimental_generic'] ? undefined : commonProps.isMulti,
|
|
1711
1714
|
id: this.getElementId('listbox'),
|
|
1712
1715
|
...(testId && {
|
|
@@ -13,7 +13,7 @@ var styles = {
|
|
|
13
13
|
invalid: "_1h6d1bqt _16qsizbr _1u6lizbr _4cvx1bqt",
|
|
14
14
|
focusedInvalid: "_16qsq049",
|
|
15
15
|
disabled: "_1h6dsyzs _lcxvglyw _bfhksyzs _1u6llkwx",
|
|
16
|
-
focused: "_1h6d1p6i _bfhkr01l _1u6lq049 _4cvx1p6i _irr3r01l",
|
|
16
|
+
focused: "_1h6d1p6i _bfhkr01l _16qsq049 _1u6lq049 _4cvx1p6i _irr3r01l",
|
|
17
17
|
subtle: "_1h6d1j28 _bfhk1j28 _1u6l3sij",
|
|
18
18
|
subtleFocused: "_bfhkvuon",
|
|
19
19
|
none: "_1h6d1j28 _bfhk1j28 _1u6l3sij _4cvx1j28 _irr31j28"
|
package/dist/esm/select.js
CHANGED
|
@@ -72,7 +72,8 @@ export var defaultProps = {
|
|
|
72
72
|
styles: {},
|
|
73
73
|
tabIndex: 0,
|
|
74
74
|
tabSelectsValue: true,
|
|
75
|
-
UNSAFE_is_experimental_generic: false
|
|
75
|
+
UNSAFE_is_experimental_generic: false,
|
|
76
|
+
shouldOmitDefaultDescription: false
|
|
76
77
|
};
|
|
77
78
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
78
79
|
var isDisabled = _isOptionDisabled(props, option, selectValue);
|
|
@@ -1152,7 +1153,9 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1152
1153
|
key: "calculateDescription",
|
|
1153
1154
|
value: function calculateDescription(action) {
|
|
1154
1155
|
var descriptionProp = this.props['aria-describedby'] || this.props['descriptionId'];
|
|
1155
|
-
var
|
|
1156
|
+
var _this$props8 = this.props,
|
|
1157
|
+
isMulti = _this$props8.isMulti,
|
|
1158
|
+
shouldOmitDefaultDescription = _this$props8.shouldOmitDefaultDescription;
|
|
1156
1159
|
var selectValue = this.state.selectValue;
|
|
1157
1160
|
var defaultDescription = selectValue.length ? this.getElementId('live-region') : this.getElementId('placeholder');
|
|
1158
1161
|
if (!isMulti && selectValue.length && action !== 'initial-input-focus') {
|
|
@@ -1161,7 +1164,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1161
1164
|
if (isMulti) {
|
|
1162
1165
|
var multiMessage = this.getElementId('multi-message');
|
|
1163
1166
|
return {
|
|
1164
|
-
'aria-describedby':
|
|
1167
|
+
'aria-describedby': [descriptionProp, !shouldOmitDefaultDescription && defaultDescription, multiMessage].filter(Boolean).join(' ')
|
|
1165
1168
|
};
|
|
1166
1169
|
} else {
|
|
1167
1170
|
return {
|
|
@@ -1230,22 +1233,22 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1230
1233
|
// Renderers
|
|
1231
1234
|
// ==============================
|
|
1232
1235
|
function renderInput() {
|
|
1233
|
-
var _this$
|
|
1234
|
-
descriptionId = _this$
|
|
1235
|
-
form = _this$
|
|
1236
|
-
inputId = _this$
|
|
1237
|
-
inputValue = _this$
|
|
1238
|
-
isDisabled = _this$
|
|
1239
|
-
isInvalid = _this$
|
|
1240
|
-
isRequired = _this$
|
|
1241
|
-
isSearchable = _this$
|
|
1242
|
-
label = _this$
|
|
1243
|
-
labelId = _this$
|
|
1244
|
-
menuIsOpen = _this$
|
|
1245
|
-
required = _this$
|
|
1246
|
-
_this$
|
|
1247
|
-
tabIndex = _this$
|
|
1248
|
-
testId = _this$
|
|
1236
|
+
var _this$props9 = this.props,
|
|
1237
|
+
descriptionId = _this$props9.descriptionId,
|
|
1238
|
+
form = _this$props9.form,
|
|
1239
|
+
inputId = _this$props9.inputId,
|
|
1240
|
+
inputValue = _this$props9.inputValue,
|
|
1241
|
+
isDisabled = _this$props9.isDisabled,
|
|
1242
|
+
isInvalid = _this$props9.isInvalid,
|
|
1243
|
+
isRequired = _this$props9.isRequired,
|
|
1244
|
+
isSearchable = _this$props9.isSearchable,
|
|
1245
|
+
label = _this$props9.label,
|
|
1246
|
+
labelId = _this$props9.labelId,
|
|
1247
|
+
menuIsOpen = _this$props9.menuIsOpen,
|
|
1248
|
+
required = _this$props9.required,
|
|
1249
|
+
_this$props9$tabIndex = _this$props9.tabIndex,
|
|
1250
|
+
tabIndex = _this$props9$tabIndex === void 0 ? 0 : _this$props9$tabIndex,
|
|
1251
|
+
testId = _this$props9.testId;
|
|
1249
1252
|
var _this$getComponents = this.getComponents(),
|
|
1250
1253
|
Input = _this$getComponents.Input;
|
|
1251
1254
|
var _this$state4 = this.state,
|
|
@@ -1320,13 +1323,13 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1320
1323
|
SingleValue = _this$getComponents2.SingleValue,
|
|
1321
1324
|
Placeholder = _this$getComponents2.Placeholder;
|
|
1322
1325
|
var commonProps = this.commonProps;
|
|
1323
|
-
var _this$
|
|
1324
|
-
controlShouldRenderValue = _this$
|
|
1325
|
-
isDisabled = _this$
|
|
1326
|
-
isMulti = _this$
|
|
1327
|
-
inputValue = _this$
|
|
1328
|
-
placeholder = _this$
|
|
1329
|
-
testId = _this$
|
|
1326
|
+
var _this$props10 = this.props,
|
|
1327
|
+
controlShouldRenderValue = _this$props10.controlShouldRenderValue,
|
|
1328
|
+
isDisabled = _this$props10.isDisabled,
|
|
1329
|
+
isMulti = _this$props10.isMulti,
|
|
1330
|
+
inputValue = _this$props10.inputValue,
|
|
1331
|
+
placeholder = _this$props10.placeholder,
|
|
1332
|
+
testId = _this$props10.testId;
|
|
1330
1333
|
var _this$state5 = this.state,
|
|
1331
1334
|
selectValue = _this$state5.selectValue,
|
|
1332
1335
|
focusedValue = _this$state5.focusedValue,
|
|
@@ -1396,12 +1399,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1396
1399
|
var _this$getComponents3 = this.getComponents(),
|
|
1397
1400
|
ClearIndicator = _this$getComponents3.ClearIndicator;
|
|
1398
1401
|
var commonProps = this.commonProps;
|
|
1399
|
-
var _this$
|
|
1400
|
-
clearControlLabel = _this$
|
|
1401
|
-
isDisabled = _this$
|
|
1402
|
-
isLoading = _this$
|
|
1403
|
-
spacing = _this$
|
|
1404
|
-
testId = _this$
|
|
1402
|
+
var _this$props11 = this.props,
|
|
1403
|
+
clearControlLabel = _this$props11.clearControlLabel,
|
|
1404
|
+
isDisabled = _this$props11.isDisabled,
|
|
1405
|
+
isLoading = _this$props11.isLoading,
|
|
1406
|
+
spacing = _this$props11.spacing,
|
|
1407
|
+
testId = _this$props11.testId;
|
|
1405
1408
|
var isFocused = this.state.isFocused;
|
|
1406
1409
|
if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
|
|
1407
1410
|
return null;
|
|
@@ -1427,11 +1430,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1427
1430
|
var _this$getComponents4 = this.getComponents(),
|
|
1428
1431
|
LoadingIndicator = _this$getComponents4.LoadingIndicator;
|
|
1429
1432
|
var commonProps = this.commonProps;
|
|
1430
|
-
var _this$
|
|
1431
|
-
isDisabled = _this$
|
|
1432
|
-
isLoading = _this$
|
|
1433
|
-
spacing = _this$
|
|
1434
|
-
testId = _this$
|
|
1433
|
+
var _this$props12 = this.props,
|
|
1434
|
+
isDisabled = _this$props12.isDisabled,
|
|
1435
|
+
isLoading = _this$props12.isLoading,
|
|
1436
|
+
spacing = _this$props12.spacing,
|
|
1437
|
+
testId = _this$props12.testId;
|
|
1435
1438
|
var isFocused = this.state.isFocused;
|
|
1436
1439
|
if (!LoadingIndicator || !isLoading) {
|
|
1437
1440
|
return null;
|
|
@@ -1458,10 +1461,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1458
1461
|
return null;
|
|
1459
1462
|
}
|
|
1460
1463
|
var commonProps = this.commonProps;
|
|
1461
|
-
var _this$
|
|
1462
|
-
isDisabled = _this$
|
|
1463
|
-
spacing = _this$
|
|
1464
|
-
testId = _this$
|
|
1464
|
+
var _this$props13 = this.props,
|
|
1465
|
+
isDisabled = _this$props13.isDisabled,
|
|
1466
|
+
spacing = _this$props13.spacing,
|
|
1467
|
+
testId = _this$props13.testId;
|
|
1465
1468
|
var isFocused = this.state.isFocused;
|
|
1466
1469
|
var isCompact = spacing === 'compact';
|
|
1467
1470
|
var innerProps = _objectSpread({
|
|
@@ -1493,25 +1496,25 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1493
1496
|
Option = _this$getComponents6.Option;
|
|
1494
1497
|
var commonProps = this.commonProps;
|
|
1495
1498
|
var focusedOption = this.state.focusedOption;
|
|
1496
|
-
var _this$
|
|
1497
|
-
captureMenuScroll = _this$
|
|
1498
|
-
inputValue = _this$
|
|
1499
|
-
isLoading = _this$
|
|
1500
|
-
loadingMessage = _this$
|
|
1501
|
-
minMenuHeight = _this$
|
|
1502
|
-
maxMenuHeight = _this$
|
|
1503
|
-
menuIsOpen = _this$
|
|
1504
|
-
menuPlacement = _this$
|
|
1505
|
-
menuPosition = _this$
|
|
1506
|
-
menuPortalTarget = _this$
|
|
1507
|
-
menuShouldBlockScroll = _this$
|
|
1508
|
-
menuShouldScrollIntoView = _this$
|
|
1509
|
-
noOptionsMessage = _this$
|
|
1510
|
-
onMenuScrollToTop = _this$
|
|
1511
|
-
onMenuScrollToBottom = _this$
|
|
1512
|
-
labelId = _this$
|
|
1513
|
-
label = _this$
|
|
1514
|
-
testId = _this$
|
|
1499
|
+
var _this$props14 = this.props,
|
|
1500
|
+
captureMenuScroll = _this$props14.captureMenuScroll,
|
|
1501
|
+
inputValue = _this$props14.inputValue,
|
|
1502
|
+
isLoading = _this$props14.isLoading,
|
|
1503
|
+
loadingMessage = _this$props14.loadingMessage,
|
|
1504
|
+
minMenuHeight = _this$props14.minMenuHeight,
|
|
1505
|
+
maxMenuHeight = _this$props14.maxMenuHeight,
|
|
1506
|
+
menuIsOpen = _this$props14.menuIsOpen,
|
|
1507
|
+
menuPlacement = _this$props14.menuPlacement,
|
|
1508
|
+
menuPosition = _this$props14.menuPosition,
|
|
1509
|
+
menuPortalTarget = _this$props14.menuPortalTarget,
|
|
1510
|
+
menuShouldBlockScroll = _this$props14.menuShouldBlockScroll,
|
|
1511
|
+
menuShouldScrollIntoView = _this$props14.menuShouldScrollIntoView,
|
|
1512
|
+
noOptionsMessage = _this$props14.noOptionsMessage,
|
|
1513
|
+
onMenuScrollToTop = _this$props14.onMenuScrollToTop,
|
|
1514
|
+
onMenuScrollToBottom = _this$props14.onMenuScrollToBottom,
|
|
1515
|
+
labelId = _this$props14.labelId,
|
|
1516
|
+
label = _this$props14.label,
|
|
1517
|
+
testId = _this$props14.testId;
|
|
1515
1518
|
if (!menuIsOpen) {
|
|
1516
1519
|
return null;
|
|
1517
1520
|
}
|
|
@@ -1664,6 +1667,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1664
1667
|
},
|
|
1665
1668
|
innerProps: _objectSpread(_objectSpread({
|
|
1666
1669
|
role: _this4.props['UNSAFE_is_experimental_generic'] ? 'dialog' : 'listbox',
|
|
1670
|
+
'aria-label': _this4.props['UNSAFE_is_experimental_generic'] ? "".concat(_this4.props['aria-label'] || label, "-dialog") : null,
|
|
1667
1671
|
'aria-multiselectable': (_this4.isVoiceOver || !commonProps.isMulti) && fg('design_system_select-a11y-improvement') || _this4.props['UNSAFE_is_experimental_generic'] ? undefined : commonProps.isMulti,
|
|
1668
1672
|
id: _this4.getElementId('listbox')
|
|
1669
1673
|
}, testId && {
|
|
@@ -1692,12 +1696,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1692
1696
|
key: "renderFormField",
|
|
1693
1697
|
value: function renderFormField() {
|
|
1694
1698
|
var _this5 = this;
|
|
1695
|
-
var _this$
|
|
1696
|
-
delimiter = _this$
|
|
1697
|
-
isDisabled = _this$
|
|
1698
|
-
isMulti = _this$
|
|
1699
|
-
required = _this$
|
|
1700
|
-
name = _this$
|
|
1699
|
+
var _this$props15 = this.props,
|
|
1700
|
+
delimiter = _this$props15.delimiter,
|
|
1701
|
+
isDisabled = _this$props15.isDisabled,
|
|
1702
|
+
isMulti = _this$props15.isMulti,
|
|
1703
|
+
required = _this$props15.required,
|
|
1704
|
+
name = _this$props15.name;
|
|
1701
1705
|
var selectValue = this.state.selectValue;
|
|
1702
1706
|
if (required && !this.hasValue() && !isDisabled) {
|
|
1703
1707
|
return /*#__PURE__*/React.createElement(RequiredInput, {
|
|
@@ -1784,17 +1788,17 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1784
1788
|
IndicatorsContainer = _this$getComponents7.IndicatorsContainer,
|
|
1785
1789
|
SelectContainer = _this$getComponents7.SelectContainer,
|
|
1786
1790
|
ValueContainer = _this$getComponents7.ValueContainer;
|
|
1787
|
-
var _this$
|
|
1788
|
-
className = _this$
|
|
1789
|
-
id = _this$
|
|
1790
|
-
isDisabled = _this$
|
|
1791
|
-
menuIsOpen = _this$
|
|
1792
|
-
isInvalid = _this$
|
|
1793
|
-
testId = _this$
|
|
1794
|
-
_this$
|
|
1795
|
-
appearance = _this$
|
|
1796
|
-
_this$
|
|
1797
|
-
spacing = _this$
|
|
1791
|
+
var _this$props16 = this.props,
|
|
1792
|
+
className = _this$props16.className,
|
|
1793
|
+
id = _this$props16.id,
|
|
1794
|
+
isDisabled = _this$props16.isDisabled,
|
|
1795
|
+
menuIsOpen = _this$props16.menuIsOpen,
|
|
1796
|
+
isInvalid = _this$props16.isInvalid,
|
|
1797
|
+
testId = _this$props16.testId,
|
|
1798
|
+
_this$props16$appeara = _this$props16.appearance,
|
|
1799
|
+
appearance = _this$props16$appeara === void 0 ? 'default' : _this$props16$appeara,
|
|
1800
|
+
_this$props16$spacing = _this$props16.spacing,
|
|
1801
|
+
spacing = _this$props16$spacing === void 0 ? 'default' : _this$props16$spacing;
|
|
1798
1802
|
var isFocused = this.state.isFocused;
|
|
1799
1803
|
var commonProps = this.commonProps = this.getCommonProps();
|
|
1800
1804
|
var isCompact = spacing === 'compact';
|
package/dist/types/select.d.ts
CHANGED
|
@@ -425,6 +425,10 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
425
425
|
appearance: 'default' | 'subtle' | 'none';
|
|
426
426
|
[key: string]: any;
|
|
427
427
|
UNSAFE_is_experimental_generic?: boolean;
|
|
428
|
+
/**
|
|
429
|
+
* omit default description being set for "aria-describedby" attribute
|
|
430
|
+
*/
|
|
431
|
+
shouldOmitDefaultDescription?: boolean;
|
|
428
432
|
}
|
|
429
433
|
export declare const defaultProps: {
|
|
430
434
|
'aria-live': string | undefined;
|
|
@@ -468,6 +472,7 @@ export declare const defaultProps: {
|
|
|
468
472
|
tabIndex: number;
|
|
469
473
|
tabSelectsValue: boolean;
|
|
470
474
|
UNSAFE_is_experimental_generic: boolean;
|
|
475
|
+
shouldOmitDefaultDescription: boolean;
|
|
471
476
|
};
|
|
472
477
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
473
478
|
ariaSelection: AriaSelection<Option, IsMulti> | null;
|
|
@@ -548,6 +553,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
548
553
|
tabIndex: number;
|
|
549
554
|
tabSelectsValue: boolean;
|
|
550
555
|
UNSAFE_is_experimental_generic: boolean;
|
|
556
|
+
shouldOmitDefaultDescription: boolean;
|
|
551
557
|
};
|
|
552
558
|
state: State<Option, IsMulti, Group>;
|
|
553
559
|
blockOptionHover: boolean;
|
|
@@ -425,6 +425,10 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
425
425
|
appearance: 'default' | 'subtle' | 'none';
|
|
426
426
|
[key: string]: any;
|
|
427
427
|
UNSAFE_is_experimental_generic?: boolean;
|
|
428
|
+
/**
|
|
429
|
+
* omit default description being set for "aria-describedby" attribute
|
|
430
|
+
*/
|
|
431
|
+
shouldOmitDefaultDescription?: boolean;
|
|
428
432
|
}
|
|
429
433
|
export declare const defaultProps: {
|
|
430
434
|
'aria-live': string | undefined;
|
|
@@ -468,6 +472,7 @@ export declare const defaultProps: {
|
|
|
468
472
|
tabIndex: number;
|
|
469
473
|
tabSelectsValue: boolean;
|
|
470
474
|
UNSAFE_is_experimental_generic: boolean;
|
|
475
|
+
shouldOmitDefaultDescription: boolean;
|
|
471
476
|
};
|
|
472
477
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
473
478
|
ariaSelection: AriaSelection<Option, IsMulti> | null;
|
|
@@ -548,6 +553,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
548
553
|
tabIndex: number;
|
|
549
554
|
tabSelectsValue: boolean;
|
|
550
555
|
UNSAFE_is_experimental_generic: boolean;
|
|
556
|
+
shouldOmitDefaultDescription: boolean;
|
|
551
557
|
};
|
|
552
558
|
state: State<Option, IsMulti, Group>;
|
|
553
559
|
blockOptionHover: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "A forked version of react-select to only be used in atlaskit/select",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
33
|
-
"@atlaskit/icon": "^26.
|
|
33
|
+
"@atlaskit/icon": "^26.3.0",
|
|
34
34
|
"@atlaskit/layering": "^2.1.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
36
|
-
"@atlaskit/primitives": "^14.
|
|
36
|
+
"@atlaskit/primitives": "^14.8.0",
|
|
37
37
|
"@atlaskit/spinner": "^18.0.0",
|
|
38
|
-
"@atlaskit/tokens": "^4.
|
|
38
|
+
"@atlaskit/tokens": "^4.9.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"@compiled/react": "^0.18.3",
|
|
41
41
|
"@emotion/react": "^11.7.1",
|