@atlaskit/react-select 1.7.2 → 1.7.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 +16 -0
- package/dist/cjs/components/input.js +7 -3
- package/dist/cjs/select.js +72 -30
- package/dist/es2019/components/input.js +6 -2
- package/dist/es2019/select.js +79 -20
- package/dist/esm/components/input.js +7 -3
- package/dist/esm/select.js +72 -30
- package/dist/types/components/containers.d.ts +2 -2
- package/dist/types/components/control.d.ts +1 -1
- package/dist/types/components/input.d.ts +4 -0
- package/dist/types/select.d.ts +30 -10
- package/dist/types-ts4.5/components/containers.d.ts +2 -2
- package/dist/types-ts4.5/components/control.d.ts +1 -1
- package/dist/types-ts4.5/components/input.d.ts +4 -0
- package/dist/types-ts4.5/select.d.ts +30 -10
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 1.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#114436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114436)
|
|
8
|
+
[`bbcb49e3d0f31`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bbcb49e3d0f31) -
|
|
9
|
+
Clean up extra testId
|
|
10
|
+
|
|
11
|
+
## 1.7.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#106179](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106179)
|
|
16
|
+
[`84a6c5a582438`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/84a6c5a582438) -
|
|
17
|
+
Add support for testId to Select
|
|
18
|
+
|
|
3
19
|
## 1.7.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = require("@emotion/react");
|
|
12
12
|
var _utils = require("../utils");
|
|
13
|
-
var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
|
|
13
|
+
var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName", "testId"];
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
16
16
|
* @jsxRuntime classic
|
|
@@ -68,11 +68,14 @@ var Input = function Input(props) {
|
|
|
68
68
|
isDisabled = _cleanCommonProps.isDisabled,
|
|
69
69
|
isHidden = _cleanCommonProps.isHidden,
|
|
70
70
|
inputClassName = _cleanCommonProps.inputClassName,
|
|
71
|
+
testId = _cleanCommonProps.testId,
|
|
71
72
|
innerProps = (0, _objectWithoutProperties2.default)(_cleanCommonProps, _excluded);
|
|
73
|
+
var dataId = testId ? "".concat(testId, "-select--input") : null;
|
|
72
74
|
return (0, _react.jsx)("div", (0, _extends2.default)({}, (0, _utils.getStyleProps)(props, 'input', {
|
|
73
75
|
'input-container': true
|
|
74
76
|
}), {
|
|
75
|
-
"data-value": value || ''
|
|
77
|
+
"data-value": value || '',
|
|
78
|
+
"data-testid": dataId && "".concat(dataId, "-container")
|
|
76
79
|
}), (0, _react.jsx)("input", (0, _extends2.default)({
|
|
77
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
78
81
|
className: cx({
|
|
@@ -82,7 +85,8 @@ var Input = function Input(props) {
|
|
|
82
85
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
83
86
|
,
|
|
84
87
|
style: inputStyle(isHidden),
|
|
85
|
-
disabled: isDisabled
|
|
88
|
+
disabled: isDisabled,
|
|
89
|
+
"data-testid": dataId
|
|
86
90
|
}, innerProps)));
|
|
87
91
|
};
|
|
88
92
|
|
package/dist/cjs/select.js
CHANGED
|
@@ -1238,7 +1238,8 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1238
1238
|
menuIsOpen = _this$props8.menuIsOpen,
|
|
1239
1239
|
required = _this$props8.required,
|
|
1240
1240
|
_this$props8$tabIndex = _this$props8.tabIndex,
|
|
1241
|
-
tabIndex = _this$props8$tabIndex === void 0 ? 0 : _this$props8$tabIndex
|
|
1241
|
+
tabIndex = _this$props8$tabIndex === void 0 ? 0 : _this$props8$tabIndex,
|
|
1242
|
+
testId = _this$props8.testId;
|
|
1242
1243
|
var _this$getComponents = this.getComponents(),
|
|
1243
1244
|
Input = _this$getComponents.Input;
|
|
1244
1245
|
var _this$state4 = this.state,
|
|
@@ -1280,7 +1281,8 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1280
1281
|
tabIndex: tabIndex,
|
|
1281
1282
|
inputMode: "none",
|
|
1282
1283
|
form: form,
|
|
1283
|
-
value: ""
|
|
1284
|
+
value: "",
|
|
1285
|
+
"data-testid": testId && "".concat(testId, "-select--input")
|
|
1284
1286
|
}, ariaAttributes));
|
|
1285
1287
|
}
|
|
1286
1288
|
return /*#__PURE__*/_react.default.createElement(Input, (0, _extends2.default)({}, commonProps, {
|
|
@@ -1288,6 +1290,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1288
1290
|
autoComplete: "off",
|
|
1289
1291
|
autoCorrect: "off",
|
|
1290
1292
|
id: id,
|
|
1293
|
+
testId: testId,
|
|
1291
1294
|
innerRef: this.getInputRef,
|
|
1292
1295
|
isDisabled: isDisabled,
|
|
1293
1296
|
isHidden: inputIsHidden,
|
|
@@ -1318,7 +1321,8 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1318
1321
|
isDisabled = _this$props9.isDisabled,
|
|
1319
1322
|
isMulti = _this$props9.isMulti,
|
|
1320
1323
|
inputValue = _this$props9.inputValue,
|
|
1321
|
-
placeholder = _this$props9.placeholder
|
|
1324
|
+
placeholder = _this$props9.placeholder,
|
|
1325
|
+
testId = _this$props9.testId;
|
|
1322
1326
|
var _this$state5 = this.state,
|
|
1323
1327
|
selectValue = _this$state5.selectValue,
|
|
1324
1328
|
focusedValue = _this$state5.focusedValue,
|
|
@@ -1328,9 +1332,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1328
1332
|
key: "placeholder",
|
|
1329
1333
|
isDisabled: isDisabled,
|
|
1330
1334
|
isFocused: isFocused,
|
|
1331
|
-
innerProps: {
|
|
1335
|
+
innerProps: _objectSpread({
|
|
1332
1336
|
id: this.getElementId('placeholder')
|
|
1333
|
-
}
|
|
1337
|
+
}, testId && {
|
|
1338
|
+
'data-testid': "".concat(testId, "-select--placeholder")
|
|
1339
|
+
})
|
|
1334
1340
|
}), placeholder);
|
|
1335
1341
|
}
|
|
1336
1342
|
if (isMulti) {
|
|
@@ -1358,7 +1364,10 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1358
1364
|
e.preventDefault();
|
|
1359
1365
|
}
|
|
1360
1366
|
},
|
|
1361
|
-
data: opt
|
|
1367
|
+
data: opt,
|
|
1368
|
+
innerProps: _objectSpread({}, testId && {
|
|
1369
|
+
'data-testid': "".concat(testId, "-select--multivalue")
|
|
1370
|
+
})
|
|
1362
1371
|
}), _this3.formatOptionLabel(opt, 'value'));
|
|
1363
1372
|
});
|
|
1364
1373
|
}
|
|
@@ -1381,15 +1390,18 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1381
1390
|
clearControlLabel = _this$props10.clearControlLabel,
|
|
1382
1391
|
isDisabled = _this$props10.isDisabled,
|
|
1383
1392
|
isLoading = _this$props10.isLoading,
|
|
1384
|
-
spacing = _this$props10.spacing
|
|
1393
|
+
spacing = _this$props10.spacing,
|
|
1394
|
+
testId = _this$props10.testId;
|
|
1385
1395
|
var isFocused = this.state.isFocused;
|
|
1386
1396
|
if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
|
|
1387
1397
|
return null;
|
|
1388
1398
|
}
|
|
1389
|
-
var innerProps = {
|
|
1399
|
+
var innerProps = _objectSpread({
|
|
1390
1400
|
onMouseDown: this.onClearIndicatorMouseDown,
|
|
1391
1401
|
onTouchEnd: this.onClearIndicatorTouchEnd
|
|
1392
|
-
}
|
|
1402
|
+
}, testId && {
|
|
1403
|
+
'data-testid': "".concat(testId, "-select--clear-indicator")
|
|
1404
|
+
});
|
|
1393
1405
|
var isCompact = spacing === 'compact';
|
|
1394
1406
|
return /*#__PURE__*/_react.default.createElement(ClearIndicator, (0, _extends2.default)({
|
|
1395
1407
|
clearControlLabel: clearControlLabel
|
|
@@ -1408,7 +1420,8 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1408
1420
|
var _this$props11 = this.props,
|
|
1409
1421
|
isDisabled = _this$props11.isDisabled,
|
|
1410
1422
|
isLoading = _this$props11.isLoading,
|
|
1411
|
-
spacing = _this$props11.spacing
|
|
1423
|
+
spacing = _this$props11.spacing,
|
|
1424
|
+
testId = _this$props11.testId;
|
|
1412
1425
|
var isFocused = this.state.isFocused;
|
|
1413
1426
|
if (!LoadingIndicator || !isLoading) {
|
|
1414
1427
|
return null;
|
|
@@ -1417,7 +1430,9 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1417
1430
|
var innerProps = {
|
|
1418
1431
|
'aria-hidden': 'true'
|
|
1419
1432
|
};
|
|
1420
|
-
return /*#__PURE__*/_react.default.createElement(LoadingIndicator, (0, _extends2.default)({
|
|
1433
|
+
return /*#__PURE__*/_react.default.createElement(LoadingIndicator, (0, _extends2.default)({
|
|
1434
|
+
"data-testid": testId && "".concat(testId, "-select--loading-indicator")
|
|
1435
|
+
}, commonProps, {
|
|
1421
1436
|
innerProps: innerProps,
|
|
1422
1437
|
isDisabled: isDisabled,
|
|
1423
1438
|
isFocused: isFocused,
|
|
@@ -1435,14 +1450,17 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1435
1450
|
var commonProps = this.commonProps;
|
|
1436
1451
|
var _this$props12 = this.props,
|
|
1437
1452
|
isDisabled = _this$props12.isDisabled,
|
|
1438
|
-
spacing = _this$props12.spacing
|
|
1453
|
+
spacing = _this$props12.spacing,
|
|
1454
|
+
testId = _this$props12.testId;
|
|
1439
1455
|
var isFocused = this.state.isFocused;
|
|
1440
1456
|
var isCompact = spacing === 'compact';
|
|
1441
|
-
var innerProps = {
|
|
1457
|
+
var innerProps = _objectSpread({
|
|
1442
1458
|
onMouseDown: this.onDropdownIndicatorMouseDown,
|
|
1443
1459
|
onTouchEnd: this.onDropdownIndicatorTouchEnd,
|
|
1444
1460
|
'aria-hidden': 'true'
|
|
1445
|
-
}
|
|
1461
|
+
}, testId && {
|
|
1462
|
+
'data-testid': "".concat(testId, "-select--dropdown-indicator")
|
|
1463
|
+
});
|
|
1446
1464
|
return /*#__PURE__*/_react.default.createElement(DropdownIndicator, (0, _extends2.default)({}, commonProps, {
|
|
1447
1465
|
innerProps: innerProps,
|
|
1448
1466
|
isDisabled: isDisabled,
|
|
@@ -1482,7 +1500,8 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1482
1500
|
onMenuScrollToTop = _this$props13.onMenuScrollToTop,
|
|
1483
1501
|
onMenuScrollToBottom = _this$props13.onMenuScrollToBottom,
|
|
1484
1502
|
labelId = _this$props13.labelId,
|
|
1485
|
-
label = _this$props13.label
|
|
1503
|
+
label = _this$props13.label,
|
|
1504
|
+
testId = _this$props13.testId;
|
|
1486
1505
|
if (!menuIsOpen) {
|
|
1487
1506
|
return null;
|
|
1488
1507
|
}
|
|
@@ -1503,7 +1522,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1503
1522
|
return _this4.selectOption(data);
|
|
1504
1523
|
};
|
|
1505
1524
|
var optionId = "".concat(_this4.getElementId('option'), "-").concat(id);
|
|
1506
|
-
var innerProps = {
|
|
1525
|
+
var innerProps = _objectSpread({
|
|
1507
1526
|
id: optionId,
|
|
1508
1527
|
onClick: onSelect,
|
|
1509
1528
|
onMouseMove: onHover,
|
|
@@ -1514,7 +1533,9 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1514
1533
|
// We don't want aria-disabled on Apple devices or if it's false. It's just noisy.
|
|
1515
1534
|
'aria-disabled': ((0, _deviceCheck.isAppleDevice)() || !isDisabled) && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : isDisabled,
|
|
1516
1535
|
'aria-describedby': (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? headingId : undefined
|
|
1517
|
-
}
|
|
1536
|
+
}, testId && {
|
|
1537
|
+
'data-testid': "".concat(testId, "-select--option-").concat(id)
|
|
1538
|
+
});
|
|
1518
1539
|
return /*#__PURE__*/_react.default.createElement(Option, (0, _extends2.default)({}, commonProps, {
|
|
1519
1540
|
innerProps: innerProps,
|
|
1520
1541
|
data: data,
|
|
@@ -1543,10 +1564,12 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1543
1564
|
data: data,
|
|
1544
1565
|
options: options,
|
|
1545
1566
|
Heading: GroupHeading,
|
|
1546
|
-
headingProps: {
|
|
1567
|
+
headingProps: _objectSpread({
|
|
1547
1568
|
id: headingId,
|
|
1548
1569
|
data: item.data
|
|
1549
|
-
},
|
|
1570
|
+
}, testId && {
|
|
1571
|
+
'data-testid': "".concat(testId, "-select--group-").concat(groupIndex, "-heading")
|
|
1572
|
+
}),
|
|
1550
1573
|
label: _this4.formatGroupLabel(item.data)
|
|
1551
1574
|
}), item.options.map(function (option) {
|
|
1552
1575
|
return render(option, "".concat(groupIndex, "-").concat(option.index), headingId);
|
|
@@ -1570,7 +1593,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1570
1593
|
if (_message === null) {
|
|
1571
1594
|
return null;
|
|
1572
1595
|
}
|
|
1573
|
-
menuUI = /*#__PURE__*/_react.default.createElement(NoOptionsMessage, commonProps,
|
|
1596
|
+
menuUI = /*#__PURE__*/_react.default.createElement(NoOptionsMessage, (0, _extends2.default)({}, commonProps, {
|
|
1597
|
+
innerProps: _objectSpread({}, testId && {
|
|
1598
|
+
'data-testid': "".concat(testId, "-select--no-options")
|
|
1599
|
+
})
|
|
1600
|
+
}), _message);
|
|
1574
1601
|
}
|
|
1575
1602
|
var menuPlacementProps = {
|
|
1576
1603
|
minMenuHeight: minMenuHeight,
|
|
@@ -1586,11 +1613,13 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1586
1613
|
maxHeight = _ref4$placerProps.maxHeight;
|
|
1587
1614
|
return /*#__PURE__*/_react.default.createElement(Menu, (0, _extends2.default)({}, commonProps, menuPlacementProps, {
|
|
1588
1615
|
innerRef: ref,
|
|
1589
|
-
innerProps: {
|
|
1616
|
+
innerProps: _objectSpread({
|
|
1590
1617
|
onMouseDown: _this4.onMenuMouseDown,
|
|
1591
1618
|
onMouseMove: _this4.onMenuMouseMove,
|
|
1592
1619
|
id: _this4.props.components.Menu ? _this4.getElementId('listbox') : undefined
|
|
1593
|
-
},
|
|
1620
|
+
}, testId && {
|
|
1621
|
+
'data-testid': "".concat(testId, "-select--listbox-container")
|
|
1622
|
+
}),
|
|
1594
1623
|
isLoading: isLoading,
|
|
1595
1624
|
placement: placement
|
|
1596
1625
|
}), /*#__PURE__*/_react.default.createElement(_internal.ScrollManager, {
|
|
@@ -1605,11 +1634,13 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1605
1634
|
_this4.getMenuListRef(instance);
|
|
1606
1635
|
scrollTargetRef(instance);
|
|
1607
1636
|
},
|
|
1608
|
-
innerProps: _objectSpread({
|
|
1637
|
+
innerProps: _objectSpread(_objectSpread({
|
|
1609
1638
|
role: 'listbox',
|
|
1610
1639
|
'aria-multiselectable': (_this4.isVoiceOver || !commonProps.isMulti) && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : commonProps.isMulti,
|
|
1611
1640
|
id: _this4.getElementId('listbox')
|
|
1612
|
-
},
|
|
1641
|
+
}, testId && {
|
|
1642
|
+
'data-testid': "".concat(testId, "-select--listbox")
|
|
1643
|
+
}), (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') && {
|
|
1613
1644
|
'aria-label': label,
|
|
1614
1645
|
'aria-labelledby': "".concat(labelId || ((_this4$inputRef = _this4.inputRef) === null || _this4$inputRef === void 0 ? void 0 : _this4$inputRef.id) || _this4.getElementId('input'), " ").concat(commonProps.isMulti && (0, _deviceCheck.isSafari)() ? _this4.getElementId('multi-message') : '')
|
|
1615
1646
|
}),
|
|
@@ -1732,6 +1763,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1732
1763
|
isDisabled = _this$props15.isDisabled,
|
|
1733
1764
|
menuIsOpen = _this$props15.menuIsOpen,
|
|
1734
1765
|
isInvalid = _this$props15.isInvalid,
|
|
1766
|
+
testId = _this$props15.testId,
|
|
1735
1767
|
_this$props15$appeara = _this$props15.appearance,
|
|
1736
1768
|
appearance = _this$props15$appeara === void 0 ? 'default' : _this$props15$appeara,
|
|
1737
1769
|
_this$props15$spacing = _this$props15.spacing,
|
|
@@ -1742,18 +1774,22 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1742
1774
|
return /*#__PURE__*/_react.default.createElement(SelectContainer, (0, _extends2.default)({}, commonProps, {
|
|
1743
1775
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
1744
1776
|
className: className,
|
|
1745
|
-
innerProps: {
|
|
1777
|
+
innerProps: _objectSpread({
|
|
1746
1778
|
id: id,
|
|
1747
1779
|
onKeyDown: this.onKeyDown
|
|
1748
|
-
},
|
|
1780
|
+
}, testId && {
|
|
1781
|
+
'data-testid': testId && "".concat(testId, "-select--container")
|
|
1782
|
+
}),
|
|
1749
1783
|
isDisabled: isDisabled,
|
|
1750
1784
|
isFocused: isFocused
|
|
1751
1785
|
}), this.renderLiveRegion(), commonProps.isMulti && this.isVoiceOver && this.renderMultiselectMessage(), /*#__PURE__*/_react.default.createElement(Control, (0, _extends2.default)({}, commonProps, {
|
|
1752
1786
|
innerRef: this.getControlRef,
|
|
1753
|
-
innerProps: {
|
|
1787
|
+
innerProps: _objectSpread({
|
|
1754
1788
|
onMouseDown: this.onControlMouseDown,
|
|
1755
1789
|
onTouchEnd: this.onControlTouchEnd
|
|
1756
|
-
},
|
|
1790
|
+
}, testId && {
|
|
1791
|
+
'data-testid': "".concat(testId, "-select--control")
|
|
1792
|
+
}),
|
|
1757
1793
|
appearance: appearance,
|
|
1758
1794
|
isInvalid: isInvalid,
|
|
1759
1795
|
isDisabled: isDisabled,
|
|
@@ -1762,9 +1798,15 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1762
1798
|
isCompact: isCompact
|
|
1763
1799
|
}), /*#__PURE__*/_react.default.createElement(ValueContainer, (0, _extends2.default)({}, commonProps, {
|
|
1764
1800
|
isDisabled: isDisabled,
|
|
1765
|
-
isCompact: isCompact
|
|
1801
|
+
isCompact: isCompact,
|
|
1802
|
+
innerProps: _objectSpread({}, testId && {
|
|
1803
|
+
'data-testid': "".concat(testId, "-select--value-container")
|
|
1804
|
+
})
|
|
1766
1805
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/_react.default.createElement(IndicatorsContainer, (0, _extends2.default)({}, commonProps, {
|
|
1767
|
-
isDisabled: isDisabled
|
|
1806
|
+
isDisabled: isDisabled,
|
|
1807
|
+
innerProps: _objectSpread({}, testId && {
|
|
1808
|
+
'data-testid': "".concat(testId, "-select--indicators-container")
|
|
1809
|
+
})
|
|
1768
1810
|
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
|
|
1769
1811
|
}
|
|
1770
1812
|
}], [{
|
|
@@ -59,12 +59,15 @@ const Input = props => {
|
|
|
59
59
|
isDisabled,
|
|
60
60
|
isHidden,
|
|
61
61
|
inputClassName,
|
|
62
|
+
testId,
|
|
62
63
|
...innerProps
|
|
63
64
|
} = cleanCommonProps(props);
|
|
65
|
+
const dataId = testId ? `${testId}-select--input` : null;
|
|
64
66
|
return jsx("div", _extends({}, getStyleProps(props, 'input', {
|
|
65
67
|
'input-container': true
|
|
66
68
|
}), {
|
|
67
|
-
"data-value": value || ''
|
|
69
|
+
"data-value": value || '',
|
|
70
|
+
"data-testid": dataId && `${dataId}-container`
|
|
68
71
|
}), jsx("input", _extends({
|
|
69
72
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
70
73
|
className: cx({
|
|
@@ -74,7 +77,8 @@ const Input = props => {
|
|
|
74
77
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
75
78
|
,
|
|
76
79
|
style: inputStyle(isHidden),
|
|
77
|
-
disabled: isDisabled
|
|
80
|
+
disabled: isDisabled,
|
|
81
|
+
"data-testid": dataId
|
|
78
82
|
}, innerProps)));
|
|
79
83
|
};
|
|
80
84
|
|
package/dist/es2019/select.js
CHANGED
|
@@ -1243,7 +1243,8 @@ export default class Select extends Component {
|
|
|
1243
1243
|
labelId,
|
|
1244
1244
|
menuIsOpen,
|
|
1245
1245
|
required,
|
|
1246
|
-
tabIndex = 0
|
|
1246
|
+
tabIndex = 0,
|
|
1247
|
+
testId
|
|
1247
1248
|
} = this.props;
|
|
1248
1249
|
const {
|
|
1249
1250
|
Input
|
|
@@ -1294,7 +1295,8 @@ export default class Select extends Component {
|
|
|
1294
1295
|
tabIndex: tabIndex,
|
|
1295
1296
|
inputMode: "none",
|
|
1296
1297
|
form: form,
|
|
1297
|
-
value: ""
|
|
1298
|
+
value: "",
|
|
1299
|
+
"data-testid": testId && `${testId}-select--input`
|
|
1298
1300
|
}, ariaAttributes));
|
|
1299
1301
|
}
|
|
1300
1302
|
return /*#__PURE__*/React.createElement(Input, _extends({}, commonProps, {
|
|
@@ -1302,6 +1304,7 @@ export default class Select extends Component {
|
|
|
1302
1304
|
autoComplete: "off",
|
|
1303
1305
|
autoCorrect: "off",
|
|
1304
1306
|
id: id,
|
|
1307
|
+
testId: testId,
|
|
1305
1308
|
innerRef: this.getInputRef,
|
|
1306
1309
|
isDisabled: isDisabled,
|
|
1307
1310
|
isHidden: inputIsHidden,
|
|
@@ -1332,7 +1335,8 @@ export default class Select extends Component {
|
|
|
1332
1335
|
isDisabled,
|
|
1333
1336
|
isMulti,
|
|
1334
1337
|
inputValue,
|
|
1335
|
-
placeholder
|
|
1338
|
+
placeholder,
|
|
1339
|
+
testId
|
|
1336
1340
|
} = this.props;
|
|
1337
1341
|
const {
|
|
1338
1342
|
selectValue,
|
|
@@ -1345,7 +1349,10 @@ export default class Select extends Component {
|
|
|
1345
1349
|
isDisabled: isDisabled,
|
|
1346
1350
|
isFocused: isFocused,
|
|
1347
1351
|
innerProps: {
|
|
1348
|
-
id: this.getElementId('placeholder')
|
|
1352
|
+
id: this.getElementId('placeholder'),
|
|
1353
|
+
...(testId && {
|
|
1354
|
+
'data-testid': `${testId}-select--placeholder`
|
|
1355
|
+
})
|
|
1349
1356
|
}
|
|
1350
1357
|
}), placeholder);
|
|
1351
1358
|
}
|
|
@@ -1370,7 +1377,12 @@ export default class Select extends Component {
|
|
|
1370
1377
|
e.preventDefault();
|
|
1371
1378
|
}
|
|
1372
1379
|
},
|
|
1373
|
-
data: opt
|
|
1380
|
+
data: opt,
|
|
1381
|
+
innerProps: {
|
|
1382
|
+
...(testId && {
|
|
1383
|
+
'data-testid': `${testId}-select--multivalue`
|
|
1384
|
+
})
|
|
1385
|
+
}
|
|
1374
1386
|
}), this.formatOptionLabel(opt, 'value'));
|
|
1375
1387
|
});
|
|
1376
1388
|
}
|
|
@@ -1394,7 +1406,8 @@ export default class Select extends Component {
|
|
|
1394
1406
|
clearControlLabel,
|
|
1395
1407
|
isDisabled,
|
|
1396
1408
|
isLoading,
|
|
1397
|
-
spacing
|
|
1409
|
+
spacing,
|
|
1410
|
+
testId
|
|
1398
1411
|
} = this.props;
|
|
1399
1412
|
const {
|
|
1400
1413
|
isFocused
|
|
@@ -1404,7 +1417,10 @@ export default class Select extends Component {
|
|
|
1404
1417
|
}
|
|
1405
1418
|
const innerProps = {
|
|
1406
1419
|
onMouseDown: this.onClearIndicatorMouseDown,
|
|
1407
|
-
onTouchEnd: this.onClearIndicatorTouchEnd
|
|
1420
|
+
onTouchEnd: this.onClearIndicatorTouchEnd,
|
|
1421
|
+
...(testId && {
|
|
1422
|
+
'data-testid': `${testId}-select--clear-indicator`
|
|
1423
|
+
})
|
|
1408
1424
|
};
|
|
1409
1425
|
const isCompact = spacing === 'compact';
|
|
1410
1426
|
return /*#__PURE__*/React.createElement(ClearIndicator, _extends({
|
|
@@ -1425,7 +1441,8 @@ export default class Select extends Component {
|
|
|
1425
1441
|
const {
|
|
1426
1442
|
isDisabled,
|
|
1427
1443
|
isLoading,
|
|
1428
|
-
spacing
|
|
1444
|
+
spacing,
|
|
1445
|
+
testId
|
|
1429
1446
|
} = this.props;
|
|
1430
1447
|
const {
|
|
1431
1448
|
isFocused
|
|
@@ -1437,7 +1454,9 @@ export default class Select extends Component {
|
|
|
1437
1454
|
const innerProps = {
|
|
1438
1455
|
'aria-hidden': 'true'
|
|
1439
1456
|
};
|
|
1440
|
-
return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({
|
|
1457
|
+
return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({
|
|
1458
|
+
"data-testid": testId && `${testId}-select--loading-indicator`
|
|
1459
|
+
}, commonProps, {
|
|
1441
1460
|
innerProps: innerProps,
|
|
1442
1461
|
isDisabled: isDisabled,
|
|
1443
1462
|
isFocused: isFocused,
|
|
@@ -1456,7 +1475,8 @@ export default class Select extends Component {
|
|
|
1456
1475
|
} = this;
|
|
1457
1476
|
const {
|
|
1458
1477
|
isDisabled,
|
|
1459
|
-
spacing
|
|
1478
|
+
spacing,
|
|
1479
|
+
testId
|
|
1460
1480
|
} = this.props;
|
|
1461
1481
|
const {
|
|
1462
1482
|
isFocused
|
|
@@ -1465,7 +1485,10 @@ export default class Select extends Component {
|
|
|
1465
1485
|
const innerProps = {
|
|
1466
1486
|
onMouseDown: this.onDropdownIndicatorMouseDown,
|
|
1467
1487
|
onTouchEnd: this.onDropdownIndicatorTouchEnd,
|
|
1468
|
-
'aria-hidden': 'true'
|
|
1488
|
+
'aria-hidden': 'true',
|
|
1489
|
+
...(testId && {
|
|
1490
|
+
'data-testid': `${testId}-select--dropdown-indicator`
|
|
1491
|
+
})
|
|
1469
1492
|
};
|
|
1470
1493
|
return /*#__PURE__*/React.createElement(DropdownIndicator, _extends({}, commonProps, {
|
|
1471
1494
|
innerProps: innerProps,
|
|
@@ -1508,7 +1531,8 @@ export default class Select extends Component {
|
|
|
1508
1531
|
onMenuScrollToTop,
|
|
1509
1532
|
onMenuScrollToBottom,
|
|
1510
1533
|
labelId,
|
|
1511
|
-
label
|
|
1534
|
+
label,
|
|
1535
|
+
testId
|
|
1512
1536
|
} = this.props;
|
|
1513
1537
|
if (!menuIsOpen) {
|
|
1514
1538
|
return null;
|
|
@@ -1538,7 +1562,10 @@ export default class Select extends Component {
|
|
|
1538
1562
|
'aria-selected': (!commonProps.isMulti || this.isVoiceOver || !isSelected) && fg('design_system_select-a11y-improvement') ? undefined : isSelected,
|
|
1539
1563
|
// We don't want aria-disabled on Apple devices or if it's false. It's just noisy.
|
|
1540
1564
|
'aria-disabled': (isAppleDevice() || !isDisabled) && fg('design_system_select-a11y-improvement') ? undefined : isDisabled,
|
|
1541
|
-
'aria-describedby': fg('design_system_select-a11y-improvement') ? headingId : undefined
|
|
1565
|
+
'aria-describedby': fg('design_system_select-a11y-improvement') ? headingId : undefined,
|
|
1566
|
+
...(testId && {
|
|
1567
|
+
'data-testid': `${testId}-select--option-${id}`
|
|
1568
|
+
})
|
|
1542
1569
|
};
|
|
1543
1570
|
return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
|
|
1544
1571
|
innerProps: innerProps,
|
|
@@ -1572,7 +1599,10 @@ export default class Select extends Component {
|
|
|
1572
1599
|
Heading: GroupHeading,
|
|
1573
1600
|
headingProps: {
|
|
1574
1601
|
id: headingId,
|
|
1575
|
-
data: item.data
|
|
1602
|
+
data: item.data,
|
|
1603
|
+
...(testId && {
|
|
1604
|
+
'data-testid': `${testId}-select--group-${groupIndex}-heading`
|
|
1605
|
+
})
|
|
1576
1606
|
},
|
|
1577
1607
|
label: this.formatGroupLabel(item.data)
|
|
1578
1608
|
}), item.options.map(option => render(option, `${groupIndex}-${option.index}`, headingId)));
|
|
@@ -1595,7 +1625,13 @@ export default class Select extends Component {
|
|
|
1595
1625
|
if (message === null) {
|
|
1596
1626
|
return null;
|
|
1597
1627
|
}
|
|
1598
|
-
menuUI = /*#__PURE__*/React.createElement(NoOptionsMessage, commonProps,
|
|
1628
|
+
menuUI = /*#__PURE__*/React.createElement(NoOptionsMessage, _extends({}, commonProps, {
|
|
1629
|
+
innerProps: {
|
|
1630
|
+
...(testId && {
|
|
1631
|
+
'data-testid': `${testId}-select--no-options`
|
|
1632
|
+
})
|
|
1633
|
+
}
|
|
1634
|
+
}), message);
|
|
1599
1635
|
}
|
|
1600
1636
|
const menuPlacementProps = {
|
|
1601
1637
|
minMenuHeight,
|
|
@@ -1615,7 +1651,10 @@ export default class Select extends Component {
|
|
|
1615
1651
|
innerProps: {
|
|
1616
1652
|
onMouseDown: this.onMenuMouseDown,
|
|
1617
1653
|
onMouseMove: this.onMenuMouseMove,
|
|
1618
|
-
id: this.props.components.Menu ? this.getElementId('listbox') : undefined
|
|
1654
|
+
id: this.props.components.Menu ? this.getElementId('listbox') : undefined,
|
|
1655
|
+
...(testId && {
|
|
1656
|
+
'data-testid': `${testId}-select--listbox-container`
|
|
1657
|
+
})
|
|
1619
1658
|
},
|
|
1620
1659
|
isLoading: isLoading,
|
|
1621
1660
|
placement: placement
|
|
@@ -1635,6 +1674,9 @@ export default class Select extends Component {
|
|
|
1635
1674
|
role: 'listbox',
|
|
1636
1675
|
'aria-multiselectable': (this.isVoiceOver || !commonProps.isMulti) && fg('design_system_select-a11y-improvement') ? undefined : commonProps.isMulti,
|
|
1637
1676
|
id: this.getElementId('listbox'),
|
|
1677
|
+
...(testId && {
|
|
1678
|
+
'data-testid': `${testId}-select--listbox`
|
|
1679
|
+
}),
|
|
1638
1680
|
// add aditional label on listbox when ff is on
|
|
1639
1681
|
...(fg('design_system_select-a11y-improvement') && {
|
|
1640
1682
|
'aria-label': label,
|
|
@@ -1753,6 +1795,7 @@ export default class Select extends Component {
|
|
|
1753
1795
|
isDisabled,
|
|
1754
1796
|
menuIsOpen,
|
|
1755
1797
|
isInvalid,
|
|
1798
|
+
testId,
|
|
1756
1799
|
appearance = 'default',
|
|
1757
1800
|
spacing = 'default'
|
|
1758
1801
|
} = this.props;
|
|
@@ -1766,7 +1809,10 @@ export default class Select extends Component {
|
|
|
1766
1809
|
className: className,
|
|
1767
1810
|
innerProps: {
|
|
1768
1811
|
id: id,
|
|
1769
|
-
onKeyDown: this.onKeyDown
|
|
1812
|
+
onKeyDown: this.onKeyDown,
|
|
1813
|
+
...(testId && {
|
|
1814
|
+
'data-testid': testId && `${testId}-select--container`
|
|
1815
|
+
})
|
|
1770
1816
|
},
|
|
1771
1817
|
isDisabled: isDisabled,
|
|
1772
1818
|
isFocused: isFocused
|
|
@@ -1774,7 +1820,10 @@ export default class Select extends Component {
|
|
|
1774
1820
|
innerRef: this.getControlRef,
|
|
1775
1821
|
innerProps: {
|
|
1776
1822
|
onMouseDown: this.onControlMouseDown,
|
|
1777
|
-
onTouchEnd: this.onControlTouchEnd
|
|
1823
|
+
onTouchEnd: this.onControlTouchEnd,
|
|
1824
|
+
...(testId && {
|
|
1825
|
+
'data-testid': `${testId}-select--control`
|
|
1826
|
+
})
|
|
1778
1827
|
},
|
|
1779
1828
|
appearance: appearance,
|
|
1780
1829
|
isInvalid: isInvalid,
|
|
@@ -1784,9 +1833,19 @@ export default class Select extends Component {
|
|
|
1784
1833
|
isCompact: isCompact
|
|
1785
1834
|
}), /*#__PURE__*/React.createElement(ValueContainer, _extends({}, commonProps, {
|
|
1786
1835
|
isDisabled: isDisabled,
|
|
1787
|
-
isCompact: isCompact
|
|
1836
|
+
isCompact: isCompact,
|
|
1837
|
+
innerProps: {
|
|
1838
|
+
...(testId && {
|
|
1839
|
+
'data-testid': `${testId}-select--value-container`
|
|
1840
|
+
})
|
|
1841
|
+
}
|
|
1788
1842
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React.createElement(IndicatorsContainer, _extends({}, commonProps, {
|
|
1789
|
-
isDisabled: isDisabled
|
|
1843
|
+
isDisabled: isDisabled,
|
|
1844
|
+
innerProps: {
|
|
1845
|
+
...(testId && {
|
|
1846
|
+
'data-testid': `${testId}-select--indicators-container`
|
|
1847
|
+
})
|
|
1848
|
+
}
|
|
1790
1849
|
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
|
|
1791
1850
|
}
|
|
1792
1851
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
|
|
4
|
+
var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName", "testId"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/**
|
|
@@ -63,11 +63,14 @@ var Input = function Input(props) {
|
|
|
63
63
|
isDisabled = _cleanCommonProps.isDisabled,
|
|
64
64
|
isHidden = _cleanCommonProps.isHidden,
|
|
65
65
|
inputClassName = _cleanCommonProps.inputClassName,
|
|
66
|
+
testId = _cleanCommonProps.testId,
|
|
66
67
|
innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded);
|
|
68
|
+
var dataId = testId ? "".concat(testId, "-select--input") : null;
|
|
67
69
|
return jsx("div", _extends({}, getStyleProps(props, 'input', {
|
|
68
70
|
'input-container': true
|
|
69
71
|
}), {
|
|
70
|
-
"data-value": value || ''
|
|
72
|
+
"data-value": value || '',
|
|
73
|
+
"data-testid": dataId && "".concat(dataId, "-container")
|
|
71
74
|
}), jsx("input", _extends({
|
|
72
75
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
73
76
|
className: cx({
|
|
@@ -77,7 +80,8 @@ var Input = function Input(props) {
|
|
|
77
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
78
81
|
,
|
|
79
82
|
style: inputStyle(isHidden),
|
|
80
|
-
disabled: isDisabled
|
|
83
|
+
disabled: isDisabled,
|
|
84
|
+
"data-testid": dataId
|
|
81
85
|
}, innerProps)));
|
|
82
86
|
};
|
|
83
87
|
|
package/dist/esm/select.js
CHANGED
|
@@ -1229,7 +1229,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1229
1229
|
menuIsOpen = _this$props8.menuIsOpen,
|
|
1230
1230
|
required = _this$props8.required,
|
|
1231
1231
|
_this$props8$tabIndex = _this$props8.tabIndex,
|
|
1232
|
-
tabIndex = _this$props8$tabIndex === void 0 ? 0 : _this$props8$tabIndex
|
|
1232
|
+
tabIndex = _this$props8$tabIndex === void 0 ? 0 : _this$props8$tabIndex,
|
|
1233
|
+
testId = _this$props8.testId;
|
|
1233
1234
|
var _this$getComponents = this.getComponents(),
|
|
1234
1235
|
Input = _this$getComponents.Input;
|
|
1235
1236
|
var _this$state4 = this.state,
|
|
@@ -1271,7 +1272,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1271
1272
|
tabIndex: tabIndex,
|
|
1272
1273
|
inputMode: "none",
|
|
1273
1274
|
form: form,
|
|
1274
|
-
value: ""
|
|
1275
|
+
value: "",
|
|
1276
|
+
"data-testid": testId && "".concat(testId, "-select--input")
|
|
1275
1277
|
}, ariaAttributes));
|
|
1276
1278
|
}
|
|
1277
1279
|
return /*#__PURE__*/React.createElement(Input, _extends({}, commonProps, {
|
|
@@ -1279,6 +1281,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1279
1281
|
autoComplete: "off",
|
|
1280
1282
|
autoCorrect: "off",
|
|
1281
1283
|
id: id,
|
|
1284
|
+
testId: testId,
|
|
1282
1285
|
innerRef: this.getInputRef,
|
|
1283
1286
|
isDisabled: isDisabled,
|
|
1284
1287
|
isHidden: inputIsHidden,
|
|
@@ -1309,7 +1312,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1309
1312
|
isDisabled = _this$props9.isDisabled,
|
|
1310
1313
|
isMulti = _this$props9.isMulti,
|
|
1311
1314
|
inputValue = _this$props9.inputValue,
|
|
1312
|
-
placeholder = _this$props9.placeholder
|
|
1315
|
+
placeholder = _this$props9.placeholder,
|
|
1316
|
+
testId = _this$props9.testId;
|
|
1313
1317
|
var _this$state5 = this.state,
|
|
1314
1318
|
selectValue = _this$state5.selectValue,
|
|
1315
1319
|
focusedValue = _this$state5.focusedValue,
|
|
@@ -1319,9 +1323,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1319
1323
|
key: "placeholder",
|
|
1320
1324
|
isDisabled: isDisabled,
|
|
1321
1325
|
isFocused: isFocused,
|
|
1322
|
-
innerProps: {
|
|
1326
|
+
innerProps: _objectSpread({
|
|
1323
1327
|
id: this.getElementId('placeholder')
|
|
1324
|
-
}
|
|
1328
|
+
}, testId && {
|
|
1329
|
+
'data-testid': "".concat(testId, "-select--placeholder")
|
|
1330
|
+
})
|
|
1325
1331
|
}), placeholder);
|
|
1326
1332
|
}
|
|
1327
1333
|
if (isMulti) {
|
|
@@ -1349,7 +1355,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1349
1355
|
e.preventDefault();
|
|
1350
1356
|
}
|
|
1351
1357
|
},
|
|
1352
|
-
data: opt
|
|
1358
|
+
data: opt,
|
|
1359
|
+
innerProps: _objectSpread({}, testId && {
|
|
1360
|
+
'data-testid': "".concat(testId, "-select--multivalue")
|
|
1361
|
+
})
|
|
1353
1362
|
}), _this3.formatOptionLabel(opt, 'value'));
|
|
1354
1363
|
});
|
|
1355
1364
|
}
|
|
@@ -1372,15 +1381,18 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1372
1381
|
clearControlLabel = _this$props10.clearControlLabel,
|
|
1373
1382
|
isDisabled = _this$props10.isDisabled,
|
|
1374
1383
|
isLoading = _this$props10.isLoading,
|
|
1375
|
-
spacing = _this$props10.spacing
|
|
1384
|
+
spacing = _this$props10.spacing,
|
|
1385
|
+
testId = _this$props10.testId;
|
|
1376
1386
|
var isFocused = this.state.isFocused;
|
|
1377
1387
|
if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
|
|
1378
1388
|
return null;
|
|
1379
1389
|
}
|
|
1380
|
-
var innerProps = {
|
|
1390
|
+
var innerProps = _objectSpread({
|
|
1381
1391
|
onMouseDown: this.onClearIndicatorMouseDown,
|
|
1382
1392
|
onTouchEnd: this.onClearIndicatorTouchEnd
|
|
1383
|
-
}
|
|
1393
|
+
}, testId && {
|
|
1394
|
+
'data-testid': "".concat(testId, "-select--clear-indicator")
|
|
1395
|
+
});
|
|
1384
1396
|
var isCompact = spacing === 'compact';
|
|
1385
1397
|
return /*#__PURE__*/React.createElement(ClearIndicator, _extends({
|
|
1386
1398
|
clearControlLabel: clearControlLabel
|
|
@@ -1399,7 +1411,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1399
1411
|
var _this$props11 = this.props,
|
|
1400
1412
|
isDisabled = _this$props11.isDisabled,
|
|
1401
1413
|
isLoading = _this$props11.isLoading,
|
|
1402
|
-
spacing = _this$props11.spacing
|
|
1414
|
+
spacing = _this$props11.spacing,
|
|
1415
|
+
testId = _this$props11.testId;
|
|
1403
1416
|
var isFocused = this.state.isFocused;
|
|
1404
1417
|
if (!LoadingIndicator || !isLoading) {
|
|
1405
1418
|
return null;
|
|
@@ -1408,7 +1421,9 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1408
1421
|
var innerProps = {
|
|
1409
1422
|
'aria-hidden': 'true'
|
|
1410
1423
|
};
|
|
1411
|
-
return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({
|
|
1424
|
+
return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({
|
|
1425
|
+
"data-testid": testId && "".concat(testId, "-select--loading-indicator")
|
|
1426
|
+
}, commonProps, {
|
|
1412
1427
|
innerProps: innerProps,
|
|
1413
1428
|
isDisabled: isDisabled,
|
|
1414
1429
|
isFocused: isFocused,
|
|
@@ -1426,14 +1441,17 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1426
1441
|
var commonProps = this.commonProps;
|
|
1427
1442
|
var _this$props12 = this.props,
|
|
1428
1443
|
isDisabled = _this$props12.isDisabled,
|
|
1429
|
-
spacing = _this$props12.spacing
|
|
1444
|
+
spacing = _this$props12.spacing,
|
|
1445
|
+
testId = _this$props12.testId;
|
|
1430
1446
|
var isFocused = this.state.isFocused;
|
|
1431
1447
|
var isCompact = spacing === 'compact';
|
|
1432
|
-
var innerProps = {
|
|
1448
|
+
var innerProps = _objectSpread({
|
|
1433
1449
|
onMouseDown: this.onDropdownIndicatorMouseDown,
|
|
1434
1450
|
onTouchEnd: this.onDropdownIndicatorTouchEnd,
|
|
1435
1451
|
'aria-hidden': 'true'
|
|
1436
|
-
}
|
|
1452
|
+
}, testId && {
|
|
1453
|
+
'data-testid': "".concat(testId, "-select--dropdown-indicator")
|
|
1454
|
+
});
|
|
1437
1455
|
return /*#__PURE__*/React.createElement(DropdownIndicator, _extends({}, commonProps, {
|
|
1438
1456
|
innerProps: innerProps,
|
|
1439
1457
|
isDisabled: isDisabled,
|
|
@@ -1473,7 +1491,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1473
1491
|
onMenuScrollToTop = _this$props13.onMenuScrollToTop,
|
|
1474
1492
|
onMenuScrollToBottom = _this$props13.onMenuScrollToBottom,
|
|
1475
1493
|
labelId = _this$props13.labelId,
|
|
1476
|
-
label = _this$props13.label
|
|
1494
|
+
label = _this$props13.label,
|
|
1495
|
+
testId = _this$props13.testId;
|
|
1477
1496
|
if (!menuIsOpen) {
|
|
1478
1497
|
return null;
|
|
1479
1498
|
}
|
|
@@ -1494,7 +1513,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1494
1513
|
return _this4.selectOption(data);
|
|
1495
1514
|
};
|
|
1496
1515
|
var optionId = "".concat(_this4.getElementId('option'), "-").concat(id);
|
|
1497
|
-
var innerProps = {
|
|
1516
|
+
var innerProps = _objectSpread({
|
|
1498
1517
|
id: optionId,
|
|
1499
1518
|
onClick: onSelect,
|
|
1500
1519
|
onMouseMove: onHover,
|
|
@@ -1505,7 +1524,9 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1505
1524
|
// We don't want aria-disabled on Apple devices or if it's false. It's just noisy.
|
|
1506
1525
|
'aria-disabled': (isAppleDevice() || !isDisabled) && fg('design_system_select-a11y-improvement') ? undefined : isDisabled,
|
|
1507
1526
|
'aria-describedby': fg('design_system_select-a11y-improvement') ? headingId : undefined
|
|
1508
|
-
}
|
|
1527
|
+
}, testId && {
|
|
1528
|
+
'data-testid': "".concat(testId, "-select--option-").concat(id)
|
|
1529
|
+
});
|
|
1509
1530
|
return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
|
|
1510
1531
|
innerProps: innerProps,
|
|
1511
1532
|
data: data,
|
|
@@ -1534,10 +1555,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1534
1555
|
data: data,
|
|
1535
1556
|
options: options,
|
|
1536
1557
|
Heading: GroupHeading,
|
|
1537
|
-
headingProps: {
|
|
1558
|
+
headingProps: _objectSpread({
|
|
1538
1559
|
id: headingId,
|
|
1539
1560
|
data: item.data
|
|
1540
|
-
},
|
|
1561
|
+
}, testId && {
|
|
1562
|
+
'data-testid': "".concat(testId, "-select--group-").concat(groupIndex, "-heading")
|
|
1563
|
+
}),
|
|
1541
1564
|
label: _this4.formatGroupLabel(item.data)
|
|
1542
1565
|
}), item.options.map(function (option) {
|
|
1543
1566
|
return render(option, "".concat(groupIndex, "-").concat(option.index), headingId);
|
|
@@ -1561,7 +1584,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1561
1584
|
if (_message === null) {
|
|
1562
1585
|
return null;
|
|
1563
1586
|
}
|
|
1564
|
-
menuUI = /*#__PURE__*/React.createElement(NoOptionsMessage, commonProps,
|
|
1587
|
+
menuUI = /*#__PURE__*/React.createElement(NoOptionsMessage, _extends({}, commonProps, {
|
|
1588
|
+
innerProps: _objectSpread({}, testId && {
|
|
1589
|
+
'data-testid': "".concat(testId, "-select--no-options")
|
|
1590
|
+
})
|
|
1591
|
+
}), _message);
|
|
1565
1592
|
}
|
|
1566
1593
|
var menuPlacementProps = {
|
|
1567
1594
|
minMenuHeight: minMenuHeight,
|
|
@@ -1577,11 +1604,13 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1577
1604
|
maxHeight = _ref4$placerProps.maxHeight;
|
|
1578
1605
|
return /*#__PURE__*/React.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {
|
|
1579
1606
|
innerRef: ref,
|
|
1580
|
-
innerProps: {
|
|
1607
|
+
innerProps: _objectSpread({
|
|
1581
1608
|
onMouseDown: _this4.onMenuMouseDown,
|
|
1582
1609
|
onMouseMove: _this4.onMenuMouseMove,
|
|
1583
1610
|
id: _this4.props.components.Menu ? _this4.getElementId('listbox') : undefined
|
|
1584
|
-
},
|
|
1611
|
+
}, testId && {
|
|
1612
|
+
'data-testid': "".concat(testId, "-select--listbox-container")
|
|
1613
|
+
}),
|
|
1585
1614
|
isLoading: isLoading,
|
|
1586
1615
|
placement: placement
|
|
1587
1616
|
}), /*#__PURE__*/React.createElement(ScrollManager, {
|
|
@@ -1596,11 +1625,13 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1596
1625
|
_this4.getMenuListRef(instance);
|
|
1597
1626
|
scrollTargetRef(instance);
|
|
1598
1627
|
},
|
|
1599
|
-
innerProps: _objectSpread({
|
|
1628
|
+
innerProps: _objectSpread(_objectSpread({
|
|
1600
1629
|
role: 'listbox',
|
|
1601
1630
|
'aria-multiselectable': (_this4.isVoiceOver || !commonProps.isMulti) && fg('design_system_select-a11y-improvement') ? undefined : commonProps.isMulti,
|
|
1602
1631
|
id: _this4.getElementId('listbox')
|
|
1603
|
-
},
|
|
1632
|
+
}, testId && {
|
|
1633
|
+
'data-testid': "".concat(testId, "-select--listbox")
|
|
1634
|
+
}), fg('design_system_select-a11y-improvement') && {
|
|
1604
1635
|
'aria-label': label,
|
|
1605
1636
|
'aria-labelledby': "".concat(labelId || ((_this4$inputRef = _this4.inputRef) === null || _this4$inputRef === void 0 ? void 0 : _this4$inputRef.id) || _this4.getElementId('input'), " ").concat(commonProps.isMulti && isSafari() ? _this4.getElementId('multi-message') : '')
|
|
1606
1637
|
}),
|
|
@@ -1723,6 +1754,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1723
1754
|
isDisabled = _this$props15.isDisabled,
|
|
1724
1755
|
menuIsOpen = _this$props15.menuIsOpen,
|
|
1725
1756
|
isInvalid = _this$props15.isInvalid,
|
|
1757
|
+
testId = _this$props15.testId,
|
|
1726
1758
|
_this$props15$appeara = _this$props15.appearance,
|
|
1727
1759
|
appearance = _this$props15$appeara === void 0 ? 'default' : _this$props15$appeara,
|
|
1728
1760
|
_this$props15$spacing = _this$props15.spacing,
|
|
@@ -1733,18 +1765,22 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1733
1765
|
return /*#__PURE__*/React.createElement(SelectContainer, _extends({}, commonProps, {
|
|
1734
1766
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
1735
1767
|
className: className,
|
|
1736
|
-
innerProps: {
|
|
1768
|
+
innerProps: _objectSpread({
|
|
1737
1769
|
id: id,
|
|
1738
1770
|
onKeyDown: this.onKeyDown
|
|
1739
|
-
},
|
|
1771
|
+
}, testId && {
|
|
1772
|
+
'data-testid': testId && "".concat(testId, "-select--container")
|
|
1773
|
+
}),
|
|
1740
1774
|
isDisabled: isDisabled,
|
|
1741
1775
|
isFocused: isFocused
|
|
1742
1776
|
}), this.renderLiveRegion(), commonProps.isMulti && this.isVoiceOver && this.renderMultiselectMessage(), /*#__PURE__*/React.createElement(Control, _extends({}, commonProps, {
|
|
1743
1777
|
innerRef: this.getControlRef,
|
|
1744
|
-
innerProps: {
|
|
1778
|
+
innerProps: _objectSpread({
|
|
1745
1779
|
onMouseDown: this.onControlMouseDown,
|
|
1746
1780
|
onTouchEnd: this.onControlTouchEnd
|
|
1747
|
-
},
|
|
1781
|
+
}, testId && {
|
|
1782
|
+
'data-testid': "".concat(testId, "-select--control")
|
|
1783
|
+
}),
|
|
1748
1784
|
appearance: appearance,
|
|
1749
1785
|
isInvalid: isInvalid,
|
|
1750
1786
|
isDisabled: isDisabled,
|
|
@@ -1753,9 +1789,15 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1753
1789
|
isCompact: isCompact
|
|
1754
1790
|
}), /*#__PURE__*/React.createElement(ValueContainer, _extends({}, commonProps, {
|
|
1755
1791
|
isDisabled: isDisabled,
|
|
1756
|
-
isCompact: isCompact
|
|
1792
|
+
isCompact: isCompact,
|
|
1793
|
+
innerProps: _objectSpread({}, testId && {
|
|
1794
|
+
'data-testid': "".concat(testId, "-select--value-container")
|
|
1795
|
+
})
|
|
1757
1796
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React.createElement(IndicatorsContainer, _extends({}, commonProps, {
|
|
1758
|
-
isDisabled: isDisabled
|
|
1797
|
+
isDisabled: isDisabled,
|
|
1798
|
+
innerProps: _objectSpread({}, testId && {
|
|
1799
|
+
'data-testid': "".concat(testId, "-select--indicators-container")
|
|
1800
|
+
})
|
|
1759
1801
|
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
|
|
1760
1802
|
}
|
|
1761
1803
|
}], [{
|
|
@@ -18,7 +18,7 @@ export interface ContainerProps<Option = unknown, IsMulti extends boolean = bool
|
|
|
18
18
|
/**
|
|
19
19
|
* Inner props to be passed down to the container.
|
|
20
20
|
*/
|
|
21
|
-
innerProps:
|
|
21
|
+
innerProps: {};
|
|
22
22
|
}
|
|
23
23
|
export declare const containerCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, isRtl, }: ContainerProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
|
|
24
24
|
export declare const SelectContainer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ContainerProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
@@ -26,7 +26,7 @@ export interface ValueContainerProps<Option = unknown, IsMulti extends boolean =
|
|
|
26
26
|
/**
|
|
27
27
|
* Props to be passed to the value container element.
|
|
28
28
|
*/
|
|
29
|
-
innerProps?:
|
|
29
|
+
innerProps?: {};
|
|
30
30
|
/**
|
|
31
31
|
* The children to be rendered.
|
|
32
32
|
*/
|
|
@@ -14,7 +14,7 @@ export interface ControlProps<Option = unknown, IsMulti extends boolean = boolea
|
|
|
14
14
|
/**
|
|
15
15
|
* The mouse down event and the innerRef to pass down to the controller element.
|
|
16
16
|
*/
|
|
17
|
-
innerProps:
|
|
17
|
+
innerProps: {};
|
|
18
18
|
/**
|
|
19
19
|
* Whether the select is disabled.
|
|
20
20
|
*/
|
|
@@ -26,6 +26,10 @@ export interface InputSpecificProps<Option = unknown, IsMulti extends boolean =
|
|
|
26
26
|
* Set className for the input element
|
|
27
27
|
*/
|
|
28
28
|
inputClassName?: string;
|
|
29
|
+
/**
|
|
30
|
+
* A testId prop is provided for specific elements. This is a unique string that appears as a data attribute data-testid in the rendered code and serves as a hook for automated tests.
|
|
31
|
+
*/
|
|
32
|
+
testId?: string;
|
|
29
33
|
}
|
|
30
34
|
export type InputProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> = InputSpecificProps<Option, IsMulti, Group>;
|
|
31
35
|
export declare const inputCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, value, }: InputProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
|
package/dist/types/select.d.ts
CHANGED
|
@@ -383,6 +383,26 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
383
383
|
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-14529 Internal documentation for deprecation (no external access)}. Will soon be handled automatically to support expected keyboard accessibility.
|
|
384
384
|
*/
|
|
385
385
|
tabSelectsValue: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
388
|
+
* Use this instead of using ARIA properties as locators.
|
|
389
|
+
*
|
|
390
|
+
* - Container: `${testId}-select--container`
|
|
391
|
+
* - Control : `${testId}-select--control`
|
|
392
|
+
* - Value container: `${testId}-select--value-container`
|
|
393
|
+
* - Placeholder: `${testId}-select--placeholder`
|
|
394
|
+
* - Input container: `${testId}-select--input-container`
|
|
395
|
+
* - Input: `${testId}-select--input`
|
|
396
|
+
* - Indicators container: `${testId}-select--indicators-container`
|
|
397
|
+
* - Dropdown indicator: `${testId}-select--dropdown-indicator`
|
|
398
|
+
* - Clear indicator: `${testId}-select--clear-indicator`
|
|
399
|
+
* - Loading indicator: `${testId}-select--loading-indicator`
|
|
400
|
+
* - Listbox container: `${testId}-select--listbox-container`
|
|
401
|
+
* - Listbox: `${testId}-select--listbox`
|
|
402
|
+
* - Option group heading: `${testId}-select--group-${groupIndex}-heading`
|
|
403
|
+
* - Option: `${testId}-select--option-${id}`
|
|
404
|
+
*/
|
|
405
|
+
testId?: string;
|
|
386
406
|
/**
|
|
387
407
|
* The value of the select; reflected by the selected option
|
|
388
408
|
*/
|
|
@@ -664,16 +684,16 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
664
684
|
shouldHideSelectedOptions: () => boolean;
|
|
665
685
|
onValueInputFocus: FocusEventHandler;
|
|
666
686
|
onKeyDown: KeyboardEventHandler<HTMLDivElement>;
|
|
667
|
-
renderInput(): JSX.Element;
|
|
668
|
-
renderPlaceholderOrValue(): JSX.Element | JSX.Element[] | null;
|
|
669
|
-
renderClearIndicator(): JSX.Element | null;
|
|
670
|
-
renderLoadingIndicator(): JSX.Element | null;
|
|
671
|
-
renderDropdownIndicator(): JSX.Element | null;
|
|
672
|
-
renderMenu(): JSX.Element | null;
|
|
673
|
-
renderFormField(): JSX.Element | undefined;
|
|
674
|
-
renderLiveRegion(): JSX.Element;
|
|
675
|
-
renderMultiselectMessage(): JSX.Element;
|
|
676
|
-
render(): JSX.Element;
|
|
687
|
+
renderInput(): React.JSX.Element;
|
|
688
|
+
renderPlaceholderOrValue(): React.JSX.Element | React.JSX.Element[] | null;
|
|
689
|
+
renderClearIndicator(): React.JSX.Element | null;
|
|
690
|
+
renderLoadingIndicator(): React.JSX.Element | null;
|
|
691
|
+
renderDropdownIndicator(): React.JSX.Element | null;
|
|
692
|
+
renderMenu(): React.JSX.Element | null;
|
|
693
|
+
renderFormField(): React.JSX.Element | undefined;
|
|
694
|
+
renderLiveRegion(): React.JSX.Element;
|
|
695
|
+
renderMultiselectMessage(): React.JSX.Element;
|
|
696
|
+
render(): React.JSX.Element;
|
|
677
697
|
}
|
|
678
698
|
export type PublicBaseSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = JSX.LibraryManagedAttributes<typeof Select, SelectProps<Option, IsMulti, Group>>;
|
|
679
699
|
export {};
|
|
@@ -18,7 +18,7 @@ export interface ContainerProps<Option = unknown, IsMulti extends boolean = bool
|
|
|
18
18
|
/**
|
|
19
19
|
* Inner props to be passed down to the container.
|
|
20
20
|
*/
|
|
21
|
-
innerProps:
|
|
21
|
+
innerProps: {};
|
|
22
22
|
}
|
|
23
23
|
export declare const containerCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, isRtl, }: ContainerProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
|
|
24
24
|
export declare const SelectContainer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ContainerProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
@@ -26,7 +26,7 @@ export interface ValueContainerProps<Option = unknown, IsMulti extends boolean =
|
|
|
26
26
|
/**
|
|
27
27
|
* Props to be passed to the value container element.
|
|
28
28
|
*/
|
|
29
|
-
innerProps?:
|
|
29
|
+
innerProps?: {};
|
|
30
30
|
/**
|
|
31
31
|
* The children to be rendered.
|
|
32
32
|
*/
|
|
@@ -14,7 +14,7 @@ export interface ControlProps<Option = unknown, IsMulti extends boolean = boolea
|
|
|
14
14
|
/**
|
|
15
15
|
* The mouse down event and the innerRef to pass down to the controller element.
|
|
16
16
|
*/
|
|
17
|
-
innerProps:
|
|
17
|
+
innerProps: {};
|
|
18
18
|
/**
|
|
19
19
|
* Whether the select is disabled.
|
|
20
20
|
*/
|
|
@@ -26,6 +26,10 @@ export interface InputSpecificProps<Option = unknown, IsMulti extends boolean =
|
|
|
26
26
|
* Set className for the input element
|
|
27
27
|
*/
|
|
28
28
|
inputClassName?: string;
|
|
29
|
+
/**
|
|
30
|
+
* A testId prop is provided for specific elements. This is a unique string that appears as a data attribute data-testid in the rendered code and serves as a hook for automated tests.
|
|
31
|
+
*/
|
|
32
|
+
testId?: string;
|
|
29
33
|
}
|
|
30
34
|
export type InputProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> = InputSpecificProps<Option, IsMulti, Group>;
|
|
31
35
|
export declare const inputCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, value, }: InputProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
|
|
@@ -383,6 +383,26 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
383
383
|
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-14529 Internal documentation for deprecation (no external access)}. Will soon be handled automatically to support expected keyboard accessibility.
|
|
384
384
|
*/
|
|
385
385
|
tabSelectsValue: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
388
|
+
* Use this instead of using ARIA properties as locators.
|
|
389
|
+
*
|
|
390
|
+
* - Container: `${testId}-select--container`
|
|
391
|
+
* - Control : `${testId}-select--control`
|
|
392
|
+
* - Value container: `${testId}-select--value-container`
|
|
393
|
+
* - Placeholder: `${testId}-select--placeholder`
|
|
394
|
+
* - Input container: `${testId}-select--input-container`
|
|
395
|
+
* - Input: `${testId}-select--input`
|
|
396
|
+
* - Indicators container: `${testId}-select--indicators-container`
|
|
397
|
+
* - Dropdown indicator: `${testId}-select--dropdown-indicator`
|
|
398
|
+
* - Clear indicator: `${testId}-select--clear-indicator`
|
|
399
|
+
* - Loading indicator: `${testId}-select--loading-indicator`
|
|
400
|
+
* - Listbox container: `${testId}-select--listbox-container`
|
|
401
|
+
* - Listbox: `${testId}-select--listbox`
|
|
402
|
+
* - Option group heading: `${testId}-select--group-${groupIndex}-heading`
|
|
403
|
+
* - Option: `${testId}-select--option-${id}`
|
|
404
|
+
*/
|
|
405
|
+
testId?: string;
|
|
386
406
|
/**
|
|
387
407
|
* The value of the select; reflected by the selected option
|
|
388
408
|
*/
|
|
@@ -664,16 +684,16 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
664
684
|
shouldHideSelectedOptions: () => boolean;
|
|
665
685
|
onValueInputFocus: FocusEventHandler;
|
|
666
686
|
onKeyDown: KeyboardEventHandler<HTMLDivElement>;
|
|
667
|
-
renderInput(): JSX.Element;
|
|
668
|
-
renderPlaceholderOrValue(): JSX.Element | JSX.Element[] | null;
|
|
669
|
-
renderClearIndicator(): JSX.Element | null;
|
|
670
|
-
renderLoadingIndicator(): JSX.Element | null;
|
|
671
|
-
renderDropdownIndicator(): JSX.Element | null;
|
|
672
|
-
renderMenu(): JSX.Element | null;
|
|
673
|
-
renderFormField(): JSX.Element | undefined;
|
|
674
|
-
renderLiveRegion(): JSX.Element;
|
|
675
|
-
renderMultiselectMessage(): JSX.Element;
|
|
676
|
-
render(): JSX.Element;
|
|
687
|
+
renderInput(): React.JSX.Element;
|
|
688
|
+
renderPlaceholderOrValue(): React.JSX.Element | React.JSX.Element[] | null;
|
|
689
|
+
renderClearIndicator(): React.JSX.Element | null;
|
|
690
|
+
renderLoadingIndicator(): React.JSX.Element | null;
|
|
691
|
+
renderDropdownIndicator(): React.JSX.Element | null;
|
|
692
|
+
renderMenu(): React.JSX.Element | null;
|
|
693
|
+
renderFormField(): React.JSX.Element | undefined;
|
|
694
|
+
renderLiveRegion(): React.JSX.Element;
|
|
695
|
+
renderMultiselectMessage(): React.JSX.Element;
|
|
696
|
+
render(): React.JSX.Element;
|
|
677
697
|
}
|
|
678
698
|
export type PublicBaseSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = JSX.LibraryManagedAttributes<typeof Select, SelectProps<Option, IsMulti, Group>>;
|
|
679
699
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.4",
|
|
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,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/ds-lib": "^3.5.0",
|
|
33
|
-
"@atlaskit/icon": "^23.
|
|
33
|
+
"@atlaskit/icon": "^23.9.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
35
|
-
"@atlaskit/primitives": "^13.
|
|
35
|
+
"@atlaskit/primitives": "^13.5.0",
|
|
36
36
|
"@atlaskit/spinner": "^17.1.0",
|
|
37
37
|
"@atlaskit/tokens": "^3.3.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@af/visual-regression": "*",
|
|
51
51
|
"@atlaskit/ssr": "*",
|
|
52
52
|
"@atlaskit/visual-regression": "*",
|
|
53
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
53
54
|
"@testing-library/react": "^13.4.0",
|
|
54
55
|
"@testing-library/user-event": "^14.4.3",
|
|
55
56
|
"jest-in-case": "^1.0.2",
|