@atlaskit/react-select 2.4.1 → 2.4.3
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/compiled/components/input.js +1 -4
- package/dist/cjs/compiled/components/live-region.js +6 -1
- package/dist/cjs/compiled/components/multi-value.js +6 -10
- package/dist/cjs/components/internal/use-scroll-lock.js +0 -1
- package/dist/cjs/components/live-region.js +0 -1
- package/dist/cjs/emotion/components/live-region.js +6 -1
- package/dist/cjs/emotion/components/multi-value.js +6 -10
- package/dist/cjs/filters.js +0 -1
- package/dist/cjs/select.js +13 -7
- package/dist/es2019/compiled/components/input.js +1 -4
- package/dist/es2019/compiled/components/live-region.js +6 -1
- package/dist/es2019/compiled/components/multi-value.js +6 -10
- package/dist/es2019/components/internal/use-scroll-lock.js +0 -1
- package/dist/es2019/components/live-region.js +0 -1
- package/dist/es2019/emotion/components/live-region.js +6 -1
- package/dist/es2019/emotion/components/multi-value.js +6 -10
- package/dist/es2019/filters.js +0 -1
- package/dist/es2019/select.js +11 -4
- package/dist/esm/compiled/components/input.js +1 -4
- package/dist/esm/compiled/components/live-region.js +6 -1
- package/dist/esm/compiled/components/multi-value.js +6 -10
- package/dist/esm/components/internal/use-scroll-lock.js +0 -1
- package/dist/esm/components/live-region.js +0 -1
- package/dist/esm/emotion/components/live-region.js +6 -1
- package/dist/esm/emotion/components/multi-value.js +6 -10
- package/dist/esm/filters.js +0 -1
- package/dist/esm/select.js +13 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 2.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#143201](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143201)
|
|
8
|
+
[`8995008d9cff5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8995008d9cff5) -
|
|
9
|
+
Improve assistive technology support for Async loading.
|
|
10
|
+
|
|
11
|
+
## 2.4.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#140048](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140048)
|
|
16
|
+
[`f05dae04933f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f05dae04933f3) -
|
|
17
|
+
Improve assistive technology support for removing selected values with Multiselect.
|
|
18
|
+
|
|
3
19
|
## 2.4.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -56,10 +56,7 @@ var Input = function Input(props) {
|
|
|
56
56
|
className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _11q7idpf _19itidpf _11c81kw7 _nd5l1yjy _12ji1r31 _1qu2glyw _12y3idpf _1bsb1osq _1ul9yh40 _syaz1kw7 _tzy4kb7n", isHidden && "_tzy4idpf", builtinCX({
|
|
57
57
|
input: true
|
|
58
58
|
}, inputClassName)]),
|
|
59
|
-
ref: innerRef
|
|
60
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
61
|
-
,
|
|
62
|
-
|
|
59
|
+
ref: innerRef,
|
|
63
60
|
disabled: isDisabled,
|
|
64
61
|
"data-testid": dataId
|
|
65
62
|
}, innerProps)));
|
|
@@ -19,7 +19,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
// Root Container
|
|
20
20
|
// ==============================
|
|
21
21
|
|
|
22
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
23
22
|
var LiveRegion = function LiveRegion(props) {
|
|
24
23
|
var ariaSelection = props.ariaSelection,
|
|
25
24
|
focusedOption = props.focusedOption,
|
|
@@ -121,6 +120,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
121
120
|
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
122
121
|
var ariaResults = (0, _react.useMemo)(function () {
|
|
123
122
|
var resultsMsg = '';
|
|
123
|
+
if (isLoading) {
|
|
124
|
+
resultsMsg = 'Loading. ';
|
|
125
|
+
}
|
|
124
126
|
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
125
127
|
var resultsMessage = screenReaderStatus({
|
|
126
128
|
count: focusableOptions.length
|
|
@@ -130,6 +132,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
130
132
|
resultsMessage: resultsMessage
|
|
131
133
|
});
|
|
132
134
|
}
|
|
135
|
+
if (options && options.length === 0) {
|
|
136
|
+
resultsMsg = 'No options. ';
|
|
137
|
+
}
|
|
133
138
|
return resultsMsg;
|
|
134
139
|
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
135
140
|
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
@@ -100,16 +100,12 @@ var renderIcon = function renderIcon() {
|
|
|
100
100
|
color: "currentColor"
|
|
101
101
|
}));
|
|
102
102
|
}
|
|
103
|
-
return (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
size: "small",
|
|
110
|
-
secondaryColor: "inherit"
|
|
111
|
-
})
|
|
112
|
-
);
|
|
103
|
+
return /*#__PURE__*/React.createElement(_selectClear.default, {
|
|
104
|
+
label: "",
|
|
105
|
+
primaryColor: "transparent",
|
|
106
|
+
size: "small",
|
|
107
|
+
secondaryColor: "inherit"
|
|
108
|
+
});
|
|
113
109
|
};
|
|
114
110
|
function MultiValueRemove(_ref3) {
|
|
115
111
|
var isDisabled = _ref3.isDisabled,
|
|
@@ -33,7 +33,6 @@ function preventInertiaScroll() {
|
|
|
33
33
|
// `ontouchstart` check works on most browsers
|
|
34
34
|
// `maxTouchPoints` works on IE10/11 and Surface
|
|
35
35
|
function isTouchDevice() {
|
|
36
|
-
// eslint-disable-next-line compat/compat
|
|
37
36
|
return 'ontouchstart' in window || navigator.maxTouchPoints;
|
|
38
37
|
}
|
|
39
38
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
@@ -15,7 +15,6 @@ var _liveRegion2 = _interopRequireDefault(require("../emotion/components/live-re
|
|
|
15
15
|
// Root Container
|
|
16
16
|
// ==============================
|
|
17
17
|
|
|
18
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
19
18
|
var LiveRegion = function LiveRegion(props) {
|
|
20
19
|
return (0, _platformFeatureFlags.fg)('compiled-react-select') ? /*#__PURE__*/_react.default.createElement(_liveRegion.default, props) : /*#__PURE__*/_react.default.createElement(_liveRegion2.default, props);
|
|
21
20
|
};
|
|
@@ -24,7 +24,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
24
24
|
// Root Container
|
|
25
25
|
// ==============================
|
|
26
26
|
|
|
27
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
28
27
|
var LiveRegion = function LiveRegion(props) {
|
|
29
28
|
var ariaSelection = props.ariaSelection,
|
|
30
29
|
focusedOption = props.focusedOption,
|
|
@@ -126,6 +125,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
126
125
|
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
127
126
|
var ariaResults = (0, _react.useMemo)(function () {
|
|
128
127
|
var resultsMsg = '';
|
|
128
|
+
if (isLoading) {
|
|
129
|
+
resultsMsg = 'Loading. ';
|
|
130
|
+
}
|
|
129
131
|
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
130
132
|
var resultsMessage = screenReaderStatus({
|
|
131
133
|
count: focusableOptions.length
|
|
@@ -135,6 +137,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
135
137
|
resultsMessage: resultsMessage
|
|
136
138
|
});
|
|
137
139
|
}
|
|
140
|
+
if (options && options.length === 0) {
|
|
141
|
+
resultsMsg = 'No options. ';
|
|
142
|
+
}
|
|
138
143
|
return resultsMsg;
|
|
139
144
|
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
140
145
|
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
@@ -121,7 +121,6 @@ var multiValueRemoveCSS = exports.multiValueRemoveCSS = function multiValueRemov
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
125
124
|
var MultiValueGeneric = function MultiValueGeneric(_ref4) {
|
|
126
125
|
var children = _ref4.children,
|
|
127
126
|
innerProps = _ref4.innerProps;
|
|
@@ -160,15 +159,12 @@ var renderIcon = function renderIcon() {
|
|
|
160
159
|
color: "currentColor"
|
|
161
160
|
}));
|
|
162
161
|
}
|
|
163
|
-
return (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
secondaryColor: "inherit"
|
|
170
|
-
})
|
|
171
|
-
);
|
|
162
|
+
return (0, _react.jsx)(_selectClear.default, {
|
|
163
|
+
label: "",
|
|
164
|
+
primaryColor: "transparent",
|
|
165
|
+
size: "small",
|
|
166
|
+
secondaryColor: "inherit"
|
|
167
|
+
});
|
|
172
168
|
};
|
|
173
169
|
function MultiValueRemove(_ref5) {
|
|
174
170
|
var isDisabled = _ref5.isDisabled,
|
package/dist/cjs/filters.js
CHANGED
|
@@ -19,7 +19,6 @@ var defaultStringify = function defaultStringify(option) {
|
|
|
19
19
|
};
|
|
20
20
|
var createFilter = exports.createFilter = function createFilter(config) {
|
|
21
21
|
return function (option, rawInput) {
|
|
22
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
23
22
|
if (option.data.__isNew__) {
|
|
24
23
|
return true;
|
|
25
24
|
}
|
package/dist/cjs/select.js
CHANGED
|
@@ -883,13 +883,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
883
883
|
}
|
|
884
884
|
if (isFocused && isDisabled && !prevProps.isDisabled) {
|
|
885
885
|
// ensure select state gets blurred in case Select is programmatically disabled while focused
|
|
886
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
887
886
|
this.setState({
|
|
888
887
|
isFocused: false
|
|
889
888
|
}, this.onMenuClose);
|
|
890
889
|
} else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
|
|
891
890
|
// ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
|
|
892
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
893
891
|
this.setState({
|
|
894
892
|
isFocused: true
|
|
895
893
|
});
|
|
@@ -1023,7 +1021,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1023
1021
|
this.setState({
|
|
1024
1022
|
inputIsHidden: nextFocus !== -1,
|
|
1025
1023
|
focusedValue: selectValue[nextFocus],
|
|
1026
|
-
focusedValueId: "".concat(this.getElementId('selected-value'), "-").concat(nextFocus),
|
|
1024
|
+
focusedValueId: "".concat(this.getElementId('selected-value'), "-").concat(nextFocus, "-remove"),
|
|
1027
1025
|
focusedOption: null,
|
|
1028
1026
|
focusedOptionId: null
|
|
1029
1027
|
});
|
|
@@ -1367,7 +1365,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1367
1365
|
isDisabled: isDisabled,
|
|
1368
1366
|
key: key,
|
|
1369
1367
|
index: index,
|
|
1370
|
-
removeProps: {
|
|
1368
|
+
removeProps: _objectSpread(_objectSpread({
|
|
1371
1369
|
onClick: function onClick() {
|
|
1372
1370
|
return _this3.removeValue(opt);
|
|
1373
1371
|
},
|
|
@@ -1376,9 +1374,12 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1376
1374
|
},
|
|
1377
1375
|
onMouseDown: function onMouseDown(e) {
|
|
1378
1376
|
e.preventDefault();
|
|
1379
|
-
}
|
|
1377
|
+
}
|
|
1378
|
+
}, testId && {
|
|
1380
1379
|
'data-testid': "".concat(testId, "-select--multivalue-").concat(index, "-remove")
|
|
1381
|
-
},
|
|
1380
|
+
}), {}, {
|
|
1381
|
+
id: "".concat(_this3.getElementId('selected-value'), "-").concat(index, "-remove")
|
|
1382
|
+
}),
|
|
1382
1383
|
data: opt,
|
|
1383
1384
|
innerProps: _objectSpread(_objectSpread({}, testId && {
|
|
1384
1385
|
'data-testid': "".concat(testId, "-select--multivalue-").concat(index)
|
|
@@ -1833,8 +1834,13 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1833
1834
|
}), /*#__PURE__*/_react.default.createElement(ValueContainer, (0, _extends2.default)({}, commonProps, {
|
|
1834
1835
|
isDisabled: isDisabled,
|
|
1835
1836
|
isCompact: isCompact,
|
|
1836
|
-
innerProps: _objectSpread({}, testId && {
|
|
1837
|
+
innerProps: _objectSpread(_objectSpread({}, testId && {
|
|
1837
1838
|
'data-testid': "".concat(testId, "-select--value-container")
|
|
1839
|
+
}), commonProps.isMulti && commonProps.hasValue && !(0, _deviceCheck.isAppleDevice)() && {
|
|
1840
|
+
// Required to keep JAWS from popping out of forms mode when using LEFT/RIGHT arrow keys.
|
|
1841
|
+
// This is Jedi Master level ARIA and not taken lightly. Do not modify without consulting
|
|
1842
|
+
// DST Accessibility.
|
|
1843
|
+
role: 'application'
|
|
1838
1844
|
})
|
|
1839
1845
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/_react.default.createElement(IndicatorsContainer, (0, _extends2.default)({}, commonProps, {
|
|
1840
1846
|
isDisabled: isDisabled,
|
|
@@ -46,10 +46,7 @@ const Input = props => {
|
|
|
46
46
|
className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _11q7idpf _19itidpf _11c81kw7 _nd5l1yjy _12ji1r31 _1qu2glyw _12y3idpf _1bsb1osq _1ul9yh40 _syaz1kw7 _tzy4kb7n", isHidden && "_tzy4idpf", builtinCX({
|
|
47
47
|
input: true
|
|
48
48
|
}, inputClassName)]),
|
|
49
|
-
ref: innerRef
|
|
50
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
51
|
-
,
|
|
52
|
-
|
|
49
|
+
ref: innerRef,
|
|
53
50
|
disabled: isDisabled,
|
|
54
51
|
"data-testid": dataId
|
|
55
52
|
}, innerProps)));
|
|
@@ -7,7 +7,6 @@ import A11yText from './internal/a11y-text';
|
|
|
7
7
|
// Root Container
|
|
8
8
|
// ==============================
|
|
9
9
|
|
|
10
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
10
|
const LiveRegion = props => {
|
|
12
11
|
const {
|
|
13
12
|
ariaSelection,
|
|
@@ -115,6 +114,9 @@ const LiveRegion = props => {
|
|
|
115
114
|
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
116
115
|
const ariaResults = useMemo(() => {
|
|
117
116
|
let resultsMsg = '';
|
|
117
|
+
if (isLoading) {
|
|
118
|
+
resultsMsg = 'Loading. ';
|
|
119
|
+
}
|
|
118
120
|
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
119
121
|
const resultsMessage = screenReaderStatus({
|
|
120
122
|
count: focusableOptions.length
|
|
@@ -124,6 +126,9 @@ const LiveRegion = props => {
|
|
|
124
126
|
resultsMessage
|
|
125
127
|
});
|
|
126
128
|
}
|
|
129
|
+
if (options && options.length === 0) {
|
|
130
|
+
resultsMsg = 'No options. ';
|
|
131
|
+
}
|
|
127
132
|
return resultsMsg;
|
|
128
133
|
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
129
134
|
const isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
@@ -81,16 +81,12 @@ const renderIcon = () => {
|
|
|
81
81
|
color: "currentColor"
|
|
82
82
|
}));
|
|
83
83
|
}
|
|
84
|
-
return (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
size: "small",
|
|
91
|
-
secondaryColor: "inherit"
|
|
92
|
-
})
|
|
93
|
-
);
|
|
84
|
+
return /*#__PURE__*/React.createElement(LegacySelectClearIcon, {
|
|
85
|
+
label: "",
|
|
86
|
+
primaryColor: "transparent",
|
|
87
|
+
size: "small",
|
|
88
|
+
secondaryColor: "inherit"
|
|
89
|
+
});
|
|
94
90
|
};
|
|
95
91
|
export function MultiValueRemove({
|
|
96
92
|
isDisabled,
|
|
@@ -27,7 +27,6 @@ function preventInertiaScroll() {
|
|
|
27
27
|
// `ontouchstart` check works on most browsers
|
|
28
28
|
// `maxTouchPoints` works on IE10/11 and Surface
|
|
29
29
|
function isTouchDevice() {
|
|
30
|
-
// eslint-disable-next-line compat/compat
|
|
31
30
|
return 'ontouchstart' in window || navigator.maxTouchPoints;
|
|
32
31
|
}
|
|
33
32
|
const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
@@ -8,7 +8,6 @@ import Emotion from '../emotion/components/live-region';
|
|
|
8
8
|
// Root Container
|
|
9
9
|
// ==============================
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
11
|
const LiveRegion = props => fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
13
12
|
|
|
14
13
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
@@ -16,7 +16,6 @@ import A11yText from './internal/a11y-text';
|
|
|
16
16
|
// Root Container
|
|
17
17
|
// ==============================
|
|
18
18
|
|
|
19
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
20
19
|
const LiveRegion = props => {
|
|
21
20
|
const {
|
|
22
21
|
ariaSelection,
|
|
@@ -124,6 +123,9 @@ const LiveRegion = props => {
|
|
|
124
123
|
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
125
124
|
const ariaResults = useMemo(() => {
|
|
126
125
|
let resultsMsg = '';
|
|
126
|
+
if (isLoading) {
|
|
127
|
+
resultsMsg = 'Loading. ';
|
|
128
|
+
}
|
|
127
129
|
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
128
130
|
const resultsMessage = screenReaderStatus({
|
|
129
131
|
count: focusableOptions.length
|
|
@@ -133,6 +135,9 @@ const LiveRegion = props => {
|
|
|
133
135
|
resultsMessage
|
|
134
136
|
});
|
|
135
137
|
}
|
|
138
|
+
if (options && options.length === 0) {
|
|
139
|
+
resultsMsg = 'No options. ';
|
|
140
|
+
}
|
|
136
141
|
return resultsMsg;
|
|
137
142
|
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
138
143
|
const isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
@@ -114,7 +114,6 @@ export const multiValueRemoveCSS = ({
|
|
|
114
114
|
}
|
|
115
115
|
})
|
|
116
116
|
});
|
|
117
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
118
117
|
const MultiValueGeneric = ({
|
|
119
118
|
children,
|
|
120
119
|
innerProps
|
|
@@ -152,15 +151,12 @@ const renderIcon = () => {
|
|
|
152
151
|
color: "currentColor"
|
|
153
152
|
}));
|
|
154
153
|
}
|
|
155
|
-
return (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
secondaryColor: "inherit"
|
|
162
|
-
})
|
|
163
|
-
);
|
|
154
|
+
return jsx(LegacySelectClearIcon, {
|
|
155
|
+
label: "",
|
|
156
|
+
primaryColor: "transparent",
|
|
157
|
+
size: "small",
|
|
158
|
+
secondaryColor: "inherit"
|
|
159
|
+
});
|
|
164
160
|
};
|
|
165
161
|
export function MultiValueRemove({
|
|
166
162
|
isDisabled,
|
package/dist/es2019/filters.js
CHANGED
|
@@ -4,7 +4,6 @@ const memoizedStripDiacriticsForInput = memoizeOne(stripDiacritics);
|
|
|
4
4
|
const trimString = str => str.replace(/^\s+|\s+$/g, '');
|
|
5
5
|
const defaultStringify = option => `${option.label} ${option.value}`;
|
|
6
6
|
export const createFilter = config => (option, rawInput) => {
|
|
7
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
8
7
|
if (option.data.__isNew__) {
|
|
9
8
|
return true;
|
|
10
9
|
}
|
package/dist/es2019/select.js
CHANGED
|
@@ -921,13 +921,11 @@ export default class Select extends Component {
|
|
|
921
921
|
}
|
|
922
922
|
if (isFocused && isDisabled && !prevProps.isDisabled) {
|
|
923
923
|
// ensure select state gets blurred in case Select is programmatically disabled while focused
|
|
924
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
925
924
|
this.setState({
|
|
926
925
|
isFocused: false
|
|
927
926
|
}, this.onMenuClose);
|
|
928
927
|
} else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
|
|
929
928
|
// ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
|
|
930
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
931
929
|
this.setState({
|
|
932
930
|
isFocused: true
|
|
933
931
|
});
|
|
@@ -1046,7 +1044,7 @@ export default class Select extends Component {
|
|
|
1046
1044
|
this.setState({
|
|
1047
1045
|
inputIsHidden: nextFocus !== -1,
|
|
1048
1046
|
focusedValue: selectValue[nextFocus],
|
|
1049
|
-
focusedValueId: `${this.getElementId('selected-value')}-${nextFocus}`,
|
|
1047
|
+
focusedValueId: `${this.getElementId('selected-value')}-${nextFocus}-remove`,
|
|
1050
1048
|
focusedOption: null,
|
|
1051
1049
|
focusedOptionId: null
|
|
1052
1050
|
});
|
|
@@ -1390,7 +1388,10 @@ export default class Select extends Component {
|
|
|
1390
1388
|
onMouseDown: e => {
|
|
1391
1389
|
e.preventDefault();
|
|
1392
1390
|
},
|
|
1393
|
-
|
|
1391
|
+
...(testId && {
|
|
1392
|
+
'data-testid': `${testId}-select--multivalue-${index}-remove`
|
|
1393
|
+
}),
|
|
1394
|
+
id: `${this.getElementId('selected-value')}-${index}-remove`
|
|
1394
1395
|
},
|
|
1395
1396
|
data: opt,
|
|
1396
1397
|
innerProps: {
|
|
@@ -1868,6 +1869,12 @@ export default class Select extends Component {
|
|
|
1868
1869
|
innerProps: {
|
|
1869
1870
|
...(testId && {
|
|
1870
1871
|
'data-testid': `${testId}-select--value-container`
|
|
1872
|
+
}),
|
|
1873
|
+
...(commonProps.isMulti && commonProps.hasValue && !isAppleDevice() && {
|
|
1874
|
+
// Required to keep JAWS from popping out of forms mode when using LEFT/RIGHT arrow keys.
|
|
1875
|
+
// This is Jedi Master level ARIA and not taken lightly. Do not modify without consulting
|
|
1876
|
+
// DST Accessibility.
|
|
1877
|
+
role: 'application'
|
|
1871
1878
|
})
|
|
1872
1879
|
}
|
|
1873
1880
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React.createElement(IndicatorsContainer, _extends({}, commonProps, {
|
|
@@ -46,10 +46,7 @@ var Input = function Input(props) {
|
|
|
46
46
|
className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _11q7idpf _19itidpf _11c81kw7 _nd5l1yjy _12ji1r31 _1qu2glyw _12y3idpf _1bsb1osq _1ul9yh40 _syaz1kw7 _tzy4kb7n", isHidden && "_tzy4idpf", builtinCX({
|
|
47
47
|
input: true
|
|
48
48
|
}, inputClassName)]),
|
|
49
|
-
ref: innerRef
|
|
50
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
51
|
-
,
|
|
52
|
-
|
|
49
|
+
ref: innerRef,
|
|
53
50
|
disabled: isDisabled,
|
|
54
51
|
"data-testid": dataId
|
|
55
52
|
}, innerProps)));
|
|
@@ -10,7 +10,6 @@ import A11yText from './internal/a11y-text';
|
|
|
10
10
|
// Root Container
|
|
11
11
|
// ==============================
|
|
12
12
|
|
|
13
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
14
13
|
var LiveRegion = function LiveRegion(props) {
|
|
15
14
|
var ariaSelection = props.ariaSelection,
|
|
16
15
|
focusedOption = props.focusedOption,
|
|
@@ -112,6 +111,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
112
111
|
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
113
112
|
var ariaResults = useMemo(function () {
|
|
114
113
|
var resultsMsg = '';
|
|
114
|
+
if (isLoading) {
|
|
115
|
+
resultsMsg = 'Loading. ';
|
|
116
|
+
}
|
|
115
117
|
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
116
118
|
var resultsMessage = screenReaderStatus({
|
|
117
119
|
count: focusableOptions.length
|
|
@@ -121,6 +123,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
121
123
|
resultsMessage: resultsMessage
|
|
122
124
|
});
|
|
123
125
|
}
|
|
126
|
+
if (options && options.length === 0) {
|
|
127
|
+
resultsMsg = 'No options. ';
|
|
128
|
+
}
|
|
124
129
|
return resultsMsg;
|
|
125
130
|
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
126
131
|
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
@@ -88,16 +88,12 @@ var renderIcon = function renderIcon() {
|
|
|
88
88
|
color: "currentColor"
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
91
|
-
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
size: "small",
|
|
98
|
-
secondaryColor: "inherit"
|
|
99
|
-
})
|
|
100
|
-
);
|
|
91
|
+
return /*#__PURE__*/React.createElement(LegacySelectClearIcon, {
|
|
92
|
+
label: "",
|
|
93
|
+
primaryColor: "transparent",
|
|
94
|
+
size: "small",
|
|
95
|
+
secondaryColor: "inherit"
|
|
96
|
+
});
|
|
101
97
|
};
|
|
102
98
|
export function MultiValueRemove(_ref3) {
|
|
103
99
|
var isDisabled = _ref3.isDisabled,
|
|
@@ -27,7 +27,6 @@ function preventInertiaScroll() {
|
|
|
27
27
|
// `ontouchstart` check works on most browsers
|
|
28
28
|
// `maxTouchPoints` works on IE10/11 and Surface
|
|
29
29
|
function isTouchDevice() {
|
|
30
|
-
// eslint-disable-next-line compat/compat
|
|
31
30
|
return 'ontouchstart' in window || navigator.maxTouchPoints;
|
|
32
31
|
}
|
|
33
32
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
@@ -8,7 +8,6 @@ import Emotion from '../emotion/components/live-region';
|
|
|
8
8
|
// Root Container
|
|
9
9
|
// ==============================
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
11
|
var LiveRegion = function LiveRegion(props) {
|
|
13
12
|
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
14
13
|
};
|
|
@@ -19,7 +19,6 @@ import A11yText from './internal/a11y-text';
|
|
|
19
19
|
// Root Container
|
|
20
20
|
// ==============================
|
|
21
21
|
|
|
22
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
23
22
|
var LiveRegion = function LiveRegion(props) {
|
|
24
23
|
var ariaSelection = props.ariaSelection,
|
|
25
24
|
focusedOption = props.focusedOption,
|
|
@@ -121,6 +120,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
121
120
|
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
122
121
|
var ariaResults = useMemo(function () {
|
|
123
122
|
var resultsMsg = '';
|
|
123
|
+
if (isLoading) {
|
|
124
|
+
resultsMsg = 'Loading. ';
|
|
125
|
+
}
|
|
124
126
|
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
125
127
|
var resultsMessage = screenReaderStatus({
|
|
126
128
|
count: focusableOptions.length
|
|
@@ -130,6 +132,9 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
130
132
|
resultsMessage: resultsMessage
|
|
131
133
|
});
|
|
132
134
|
}
|
|
135
|
+
if (options && options.length === 0) {
|
|
136
|
+
resultsMsg = 'No options. ';
|
|
137
|
+
}
|
|
133
138
|
return resultsMsg;
|
|
134
139
|
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
135
140
|
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
@@ -115,7 +115,6 @@ export var multiValueRemoveCSS = function multiValueRemoveCSS(_ref3) {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
119
118
|
var MultiValueGeneric = function MultiValueGeneric(_ref4) {
|
|
120
119
|
var children = _ref4.children,
|
|
121
120
|
innerProps = _ref4.innerProps;
|
|
@@ -154,15 +153,12 @@ var renderIcon = function renderIcon() {
|
|
|
154
153
|
color: "currentColor"
|
|
155
154
|
}));
|
|
156
155
|
}
|
|
157
|
-
return (
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
secondaryColor: "inherit"
|
|
164
|
-
})
|
|
165
|
-
);
|
|
156
|
+
return jsx(LegacySelectClearIcon, {
|
|
157
|
+
label: "",
|
|
158
|
+
primaryColor: "transparent",
|
|
159
|
+
size: "small",
|
|
160
|
+
secondaryColor: "inherit"
|
|
161
|
+
});
|
|
166
162
|
};
|
|
167
163
|
export function MultiValueRemove(_ref5) {
|
|
168
164
|
var isDisabled = _ref5.isDisabled,
|
package/dist/esm/filters.js
CHANGED
|
@@ -12,7 +12,6 @@ var defaultStringify = function defaultStringify(option) {
|
|
|
12
12
|
};
|
|
13
13
|
export var createFilter = function createFilter(config) {
|
|
14
14
|
return function (option, rawInput) {
|
|
15
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
16
15
|
if (option.data.__isNew__) {
|
|
17
16
|
return true;
|
|
18
17
|
}
|
package/dist/esm/select.js
CHANGED
|
@@ -874,13 +874,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
874
874
|
}
|
|
875
875
|
if (isFocused && isDisabled && !prevProps.isDisabled) {
|
|
876
876
|
// ensure select state gets blurred in case Select is programmatically disabled while focused
|
|
877
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
878
877
|
this.setState({
|
|
879
878
|
isFocused: false
|
|
880
879
|
}, this.onMenuClose);
|
|
881
880
|
} else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
|
|
882
881
|
// ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
|
|
883
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
884
882
|
this.setState({
|
|
885
883
|
isFocused: true
|
|
886
884
|
});
|
|
@@ -1014,7 +1012,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1014
1012
|
this.setState({
|
|
1015
1013
|
inputIsHidden: nextFocus !== -1,
|
|
1016
1014
|
focusedValue: selectValue[nextFocus],
|
|
1017
|
-
focusedValueId: "".concat(this.getElementId('selected-value'), "-").concat(nextFocus),
|
|
1015
|
+
focusedValueId: "".concat(this.getElementId('selected-value'), "-").concat(nextFocus, "-remove"),
|
|
1018
1016
|
focusedOption: null,
|
|
1019
1017
|
focusedOptionId: null
|
|
1020
1018
|
});
|
|
@@ -1358,7 +1356,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1358
1356
|
isDisabled: isDisabled,
|
|
1359
1357
|
key: key,
|
|
1360
1358
|
index: index,
|
|
1361
|
-
removeProps: {
|
|
1359
|
+
removeProps: _objectSpread(_objectSpread({
|
|
1362
1360
|
onClick: function onClick() {
|
|
1363
1361
|
return _this3.removeValue(opt);
|
|
1364
1362
|
},
|
|
@@ -1367,9 +1365,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1367
1365
|
},
|
|
1368
1366
|
onMouseDown: function onMouseDown(e) {
|
|
1369
1367
|
e.preventDefault();
|
|
1370
|
-
}
|
|
1368
|
+
}
|
|
1369
|
+
}, testId && {
|
|
1371
1370
|
'data-testid': "".concat(testId, "-select--multivalue-").concat(index, "-remove")
|
|
1372
|
-
},
|
|
1371
|
+
}), {}, {
|
|
1372
|
+
id: "".concat(_this3.getElementId('selected-value'), "-").concat(index, "-remove")
|
|
1373
|
+
}),
|
|
1373
1374
|
data: opt,
|
|
1374
1375
|
innerProps: _objectSpread(_objectSpread({}, testId && {
|
|
1375
1376
|
'data-testid': "".concat(testId, "-select--multivalue-").concat(index)
|
|
@@ -1824,8 +1825,13 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
1824
1825
|
}), /*#__PURE__*/React.createElement(ValueContainer, _extends({}, commonProps, {
|
|
1825
1826
|
isDisabled: isDisabled,
|
|
1826
1827
|
isCompact: isCompact,
|
|
1827
|
-
innerProps: _objectSpread({}, testId && {
|
|
1828
|
+
innerProps: _objectSpread(_objectSpread({}, testId && {
|
|
1828
1829
|
'data-testid': "".concat(testId, "-select--value-container")
|
|
1830
|
+
}), commonProps.isMulti && commonProps.hasValue && !isAppleDevice() && {
|
|
1831
|
+
// Required to keep JAWS from popping out of forms mode when using LEFT/RIGHT arrow keys.
|
|
1832
|
+
// This is Jedi Master level ARIA and not taken lightly. Do not modify without consulting
|
|
1833
|
+
// DST Accessibility.
|
|
1834
|
+
role: 'application'
|
|
1829
1835
|
})
|
|
1830
1836
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React.createElement(IndicatorsContainer, _extends({}, commonProps, {
|
|
1831
1837
|
isDisabled: isDisabled,
|