@atlaskit/react-select 2.4.0 → 2.4.2
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/group.js +1 -1
- package/dist/cjs/compiled/components/input.js +1 -4
- package/dist/cjs/compiled/components/live-region.js +0 -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/group.js +1 -1
- package/dist/cjs/emotion/components/live-region.js +0 -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/group.js +1 -1
- package/dist/es2019/compiled/components/input.js +1 -4
- package/dist/es2019/compiled/components/live-region.js +0 -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/group.js +1 -1
- package/dist/es2019/emotion/components/live-region.js +0 -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/group.js +1 -1
- package/dist/esm/compiled/components/input.js +1 -4
- package/dist/esm/compiled/components/live-region.js +0 -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/group.js +1 -1
- package/dist/esm/emotion/components/live-region.js +0 -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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 2.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#140048](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140048)
|
|
8
|
+
[`f05dae04933f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f05dae04933f3) -
|
|
9
|
+
Improve assistive technology support for removing selected values with Multiselect.
|
|
10
|
+
|
|
11
|
+
## 2.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#141760](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141760)
|
|
16
|
+
[`2df2e25329cb8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2df2e25329cb8) -
|
|
17
|
+
[ux] Resolved issue where group `Heading` component would render even when no labels were provided
|
|
18
|
+
|
|
3
19
|
## 2.4.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -45,7 +45,7 @@ var Group = function Group(props) {
|
|
|
45
45
|
}, innerProps, {
|
|
46
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
47
47
|
className: (0, _runtime.ax)([styles.root, (0, _react2.cx)(className, xcss, innerProps === null || innerProps === void 0 ? void 0 : innerProps.className)])
|
|
48
|
-
}), /*#__PURE__*/React.createElement(Heading, (0, _extends2.default)({}, headingProps, {
|
|
48
|
+
}), label && /*#__PURE__*/React.createElement(Heading, (0, _extends2.default)({}, headingProps, {
|
|
49
49
|
selectProps: selectProps,
|
|
50
50
|
getStyles: getStyles,
|
|
51
51
|
getClassNames: getClassNames,
|
|
@@ -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,
|
|
@@ -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
|
};
|
|
@@ -35,7 +35,7 @@ var Group = function Group(props) {
|
|
|
35
35
|
selectProps = props.selectProps;
|
|
36
36
|
return (0, _react.jsx)("div", (0, _extends2.default)({}, (0, _utils.getStyleProps)(props, 'group', {
|
|
37
37
|
group: true
|
|
38
|
-
}), innerProps), (0, _react.jsx)(Heading, (0, _extends2.default)({}, headingProps, {
|
|
38
|
+
}), innerProps), label && (0, _react.jsx)(Heading, (0, _extends2.default)({}, headingProps, {
|
|
39
39
|
selectProps: selectProps,
|
|
40
40
|
getStyles: getStyles,
|
|
41
41
|
getClassNames: getClassNames,
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -34,7 +34,7 @@ const Group = props => {
|
|
|
34
34
|
}, innerProps, {
|
|
35
35
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
36
36
|
className: ax([styles.root, cx(className, xcss, innerProps === null || innerProps === void 0 ? void 0 : innerProps.className)])
|
|
37
|
-
}), /*#__PURE__*/React.createElement(Heading, _extends({}, headingProps, {
|
|
37
|
+
}), label && /*#__PURE__*/React.createElement(Heading, _extends({}, headingProps, {
|
|
38
38
|
selectProps: selectProps,
|
|
39
39
|
getStyles: getStyles,
|
|
40
40
|
getClassNames: getClassNames,
|
|
@@ -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)));
|
|
@@ -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
|
|
@@ -25,7 +25,7 @@ const Group = props => {
|
|
|
25
25
|
} = props;
|
|
26
26
|
return jsx("div", _extends({}, getStyleProps(props, 'group', {
|
|
27
27
|
group: true
|
|
28
|
-
}), innerProps), jsx(Heading, _extends({}, headingProps, {
|
|
28
|
+
}), innerProps), label && jsx(Heading, _extends({}, headingProps, {
|
|
29
29
|
selectProps: selectProps,
|
|
30
30
|
getStyles: getStyles,
|
|
31
31
|
getClassNames: getClassNames,
|
|
@@ -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, {
|
|
@@ -35,7 +35,7 @@ var Group = function Group(props) {
|
|
|
35
35
|
}, innerProps, {
|
|
36
36
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
37
37
|
className: ax([styles.root, cx(className, xcss, innerProps === null || innerProps === void 0 ? void 0 : innerProps.className)])
|
|
38
|
-
}), /*#__PURE__*/React.createElement(Heading, _extends({}, headingProps, {
|
|
38
|
+
}), label && /*#__PURE__*/React.createElement(Heading, _extends({}, headingProps, {
|
|
39
39
|
selectProps: selectProps,
|
|
40
40
|
getStyles: getStyles,
|
|
41
41
|
getClassNames: getClassNames,
|
|
@@ -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,
|
|
@@ -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
|
};
|
|
@@ -29,7 +29,7 @@ var Group = function Group(props) {
|
|
|
29
29
|
selectProps = props.selectProps;
|
|
30
30
|
return jsx("div", _extends({}, getStyleProps(props, 'group', {
|
|
31
31
|
group: true
|
|
32
|
-
}), innerProps), jsx(Heading, _extends({}, headingProps, {
|
|
32
|
+
}), innerProps), label && jsx(Heading, _extends({}, headingProps, {
|
|
33
33
|
selectProps: selectProps,
|
|
34
34
|
getStyles: getStyles,
|
|
35
35
|
getClassNames: getClassNames,
|
|
@@ -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,
|
|
@@ -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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
36
36
|
"@atlaskit/primitives": "^14.4.0",
|
|
37
37
|
"@atlaskit/spinner": "^18.0.0",
|
|
38
|
-
"@atlaskit/tokens": "^4.
|
|
38
|
+
"@atlaskit/tokens": "^4.8.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"@compiled/react": "^0.18.3",
|
|
41
41
|
"@emotion/react": "^11.7.1",
|