@atlaskit/react-select 3.14.5 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/select.js +9 -18
- package/dist/es2019/components/input.js +1 -1
- package/dist/es2019/select.js +8 -17
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/select.js +8 -17
- package/dist/types/internal/portal-placement-context.d.ts +2 -1
- package/dist/types/select.d.ts +0 -4
- package/dist/types-ts4.5/internal/portal-placement-context.d.ts +2 -1
- package/dist/types-ts4.5/select.d.ts +0 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 3.15.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.15.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`31cb79d51457a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31cb79d51457a) -
|
|
14
|
+
Remove prop shouldKeepInputOnSelect to clean up stale flag
|
|
15
|
+
|
|
3
16
|
## 3.14.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -46,7 +46,7 @@ var Input = function Input(props) {
|
|
|
46
46
|
}),
|
|
47
47
|
css = _getStyleProps.css,
|
|
48
48
|
className = _getStyleProps.className;
|
|
49
|
-
if ((0, _platformFeatureFlags.fg)('
|
|
49
|
+
if ((0, _platformFeatureFlags.fg)('platform_fix_input_component_styling')) {
|
|
50
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
51
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
52
52
|
style: css
|
package/dist/cjs/select.js
CHANGED
|
@@ -21,6 +21,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
21
21
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
22
22
|
var _react = _interopRequireWildcard(require("react"));
|
|
23
23
|
var _deviceCheck = require("@atlaskit/ds-lib/device-check");
|
|
24
|
+
var _isSafari = require("@atlaskit/ds-lib/is-safari");
|
|
24
25
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
25
26
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
27
|
var _builtins = require("./builtins");
|
|
@@ -166,8 +167,7 @@ var defaultProps = exports.defaultProps = {
|
|
|
166
167
|
styles: {},
|
|
167
168
|
tabIndex: 0,
|
|
168
169
|
tabSelectsValue: true,
|
|
169
|
-
UNSAFE_is_experimental_generic: false
|
|
170
|
-
shouldKeepInputOnSelect: false
|
|
170
|
+
UNSAFE_is_experimental_generic: false
|
|
171
171
|
};
|
|
172
172
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
173
173
|
var isDisabled = _isOptionDisabled(props, option, selectValue);
|
|
@@ -379,20 +379,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
379
379
|
var _this$props2 = _this.props,
|
|
380
380
|
closeMenuOnSelect = _this$props2.closeMenuOnSelect,
|
|
381
381
|
isMulti = _this$props2.isMulti,
|
|
382
|
-
inputValue = _this$props2.inputValue
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
action: 'set-value',
|
|
388
|
-
prevInputValue: inputValue
|
|
389
|
-
});
|
|
390
|
-
} else {
|
|
391
|
-
_this.onInputChange('', {
|
|
392
|
-
action: 'set-value',
|
|
393
|
-
prevInputValue: inputValue
|
|
394
|
-
});
|
|
395
|
-
}
|
|
382
|
+
inputValue = _this$props2.inputValue;
|
|
383
|
+
_this.onInputChange('', {
|
|
384
|
+
action: 'set-value',
|
|
385
|
+
prevInputValue: inputValue
|
|
386
|
+
});
|
|
396
387
|
if (closeMenuOnSelect) {
|
|
397
388
|
_this.setState({
|
|
398
389
|
inputIsHiddenAfterUpdate: !isMulti
|
|
@@ -1081,7 +1072,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1081
1072
|
}, function () {
|
|
1082
1073
|
return _this2.onMenuOpen();
|
|
1083
1074
|
});
|
|
1084
|
-
(0,
|
|
1075
|
+
(0, _isSafari.isSafari)() && focusedOption && this.updateInputLabel(this.calculateInputLabel(focusedOption, openAtIndex));
|
|
1085
1076
|
}
|
|
1086
1077
|
}, {
|
|
1087
1078
|
key: "updateInputLabel",
|
|
@@ -1845,7 +1836,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1845
1836
|
id: _this6.getElementId('listbox')
|
|
1846
1837
|
}, testId && {
|
|
1847
1838
|
'data-testid': "".concat(testId, "-select--listbox")
|
|
1848
|
-
}), (0,
|
|
1839
|
+
}), (0, _isSafari.isSafari)() && !_this6.props['UNSAFE_is_experimental_generic'] && {
|
|
1849
1840
|
'aria-describedby': ((_this6$inputRef2 = _this6.inputRef) === null || _this6$inputRef2 === void 0 ? void 0 : _this6$inputRef2.id) || _this6.getElementId('input')
|
|
1850
1841
|
}),
|
|
1851
1842
|
isLoading: isLoading,
|
|
@@ -39,7 +39,7 @@ const Input = props => {
|
|
|
39
39
|
} = getStyleProps(props, 'input', {
|
|
40
40
|
'input-container': true
|
|
41
41
|
});
|
|
42
|
-
if (fg('
|
|
42
|
+
if (fg('platform_fix_input_component_styling')) {
|
|
43
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
45
45
|
style: css
|
package/dist/es2019/select.js
CHANGED
|
@@ -4,7 +4,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import "./select.compiled.css";
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import React, { Component } from 'react';
|
|
7
|
-
import { isAppleDevice
|
|
7
|
+
import { isAppleDevice } from '@atlaskit/ds-lib/device-check';
|
|
8
|
+
import { isSafari } from '@atlaskit/ds-lib/is-safari';
|
|
8
9
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
9
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { formatGroupLabel as formatGroupLabelBuiltin, getOptionLabel as getOptionLabelBuiltin, getOptionValue as getOptionValueBuiltin, isOptionDisabled as isOptionDisabledBuiltin } from './builtins';
|
|
@@ -138,8 +139,7 @@ export const defaultProps = {
|
|
|
138
139
|
styles: {},
|
|
139
140
|
tabIndex: 0,
|
|
140
141
|
tabSelectsValue: true,
|
|
141
|
-
UNSAFE_is_experimental_generic: false
|
|
142
|
-
shouldKeepInputOnSelect: false
|
|
142
|
+
UNSAFE_is_experimental_generic: false
|
|
143
143
|
};
|
|
144
144
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
145
145
|
const isDisabled = isOptionDisabled(props, option, selectValue);
|
|
@@ -347,21 +347,12 @@ export default class Select extends Component {
|
|
|
347
347
|
const {
|
|
348
348
|
closeMenuOnSelect,
|
|
349
349
|
isMulti,
|
|
350
|
-
inputValue
|
|
351
|
-
shouldKeepInputOnSelect
|
|
350
|
+
inputValue
|
|
352
351
|
} = this.props;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
prevInputValue: inputValue
|
|
358
|
-
});
|
|
359
|
-
} else {
|
|
360
|
-
this.onInputChange('', {
|
|
361
|
-
action: 'set-value',
|
|
362
|
-
prevInputValue: inputValue
|
|
363
|
-
});
|
|
364
|
-
}
|
|
352
|
+
this.onInputChange('', {
|
|
353
|
+
action: 'set-value',
|
|
354
|
+
prevInputValue: inputValue
|
|
355
|
+
});
|
|
365
356
|
if (closeMenuOnSelect) {
|
|
366
357
|
this.setState({
|
|
367
358
|
inputIsHiddenAfterUpdate: !isMulti
|
|
@@ -37,7 +37,7 @@ var Input = function Input(props) {
|
|
|
37
37
|
}),
|
|
38
38
|
css = _getStyleProps.css,
|
|
39
39
|
className = _getStyleProps.className;
|
|
40
|
-
if (fg('
|
|
40
|
+
if (fg('platform_fix_input_component_styling')) {
|
|
41
41
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
42
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
43
43
|
style: css
|
package/dist/esm/select.js
CHANGED
|
@@ -16,7 +16,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
17
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
18
|
import React, { Component } from 'react';
|
|
19
|
-
import { isAppleDevice
|
|
19
|
+
import { isAppleDevice } from '@atlaskit/ds-lib/device-check';
|
|
20
|
+
import { isSafari } from '@atlaskit/ds-lib/is-safari';
|
|
20
21
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
21
22
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
23
|
import { formatGroupLabel as formatGroupLabelBuiltin, getOptionLabel as getOptionLabelBuiltin, getOptionValue as getOptionValueBuiltin, isOptionDisabled as isOptionDisabledBuiltin } from './builtins';
|
|
@@ -157,8 +158,7 @@ export var defaultProps = {
|
|
|
157
158
|
styles: {},
|
|
158
159
|
tabIndex: 0,
|
|
159
160
|
tabSelectsValue: true,
|
|
160
|
-
UNSAFE_is_experimental_generic: false
|
|
161
|
-
shouldKeepInputOnSelect: false
|
|
161
|
+
UNSAFE_is_experimental_generic: false
|
|
162
162
|
};
|
|
163
163
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
164
164
|
var isDisabled = _isOptionDisabled(props, option, selectValue);
|
|
@@ -370,20 +370,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
370
370
|
var _this$props2 = _this.props,
|
|
371
371
|
closeMenuOnSelect = _this$props2.closeMenuOnSelect,
|
|
372
372
|
isMulti = _this$props2.isMulti,
|
|
373
|
-
inputValue = _this$props2.inputValue
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
action: 'set-value',
|
|
379
|
-
prevInputValue: inputValue
|
|
380
|
-
});
|
|
381
|
-
} else {
|
|
382
|
-
_this.onInputChange('', {
|
|
383
|
-
action: 'set-value',
|
|
384
|
-
prevInputValue: inputValue
|
|
385
|
-
});
|
|
386
|
-
}
|
|
373
|
+
inputValue = _this$props2.inputValue;
|
|
374
|
+
_this.onInputChange('', {
|
|
375
|
+
action: 'set-value',
|
|
376
|
+
prevInputValue: inputValue
|
|
377
|
+
});
|
|
387
378
|
if (closeMenuOnSelect) {
|
|
388
379
|
_this.setState({
|
|
389
380
|
inputIsHiddenAfterUpdate: !isMulti
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Context } from 'react';
|
|
1
2
|
import type { CoercedMenuPlacement } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* __Portal placement context__
|
|
@@ -8,6 +9,6 @@ import type { CoercedMenuPlacement } from '../types';
|
|
|
8
9
|
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
9
10
|
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
10
11
|
*/
|
|
11
|
-
export declare const PortalPlacementContext:
|
|
12
|
+
export declare const PortalPlacementContext: Context<{
|
|
12
13
|
setPortalPlacement: (placement: CoercedMenuPlacement) => void;
|
|
13
14
|
} | null>;
|
package/dist/types/select.d.ts
CHANGED
|
@@ -437,10 +437,6 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
437
437
|
appearance: 'default' | 'subtle' | 'none';
|
|
438
438
|
[key: string]: any;
|
|
439
439
|
UNSAFE_is_experimental_generic?: boolean;
|
|
440
|
-
/**
|
|
441
|
-
* If `true`, the input value will be kept when an option is selected and isMulti is `true`. The default is `false`.
|
|
442
|
-
*/
|
|
443
|
-
shouldKeepInputOnSelect?: boolean;
|
|
444
440
|
}
|
|
445
441
|
export declare const defaultProps: Omit<SelectProps<unknown, false, GroupBase<unknown>>, 'inputValue' | 'onChange' | 'onInputChange' | 'onMenuOpen' | 'onMenuClose' | 'value' | 'appearance'>;
|
|
446
442
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Context } from 'react';
|
|
1
2
|
import type { CoercedMenuPlacement } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* __Portal placement context__
|
|
@@ -8,6 +9,6 @@ import type { CoercedMenuPlacement } from '../types';
|
|
|
8
9
|
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
9
10
|
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
10
11
|
*/
|
|
11
|
-
export declare const PortalPlacementContext:
|
|
12
|
+
export declare const PortalPlacementContext: Context<{
|
|
12
13
|
setPortalPlacement: (placement: CoercedMenuPlacement) => void;
|
|
13
14
|
} | null>;
|
|
@@ -437,10 +437,6 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
437
437
|
appearance: 'default' | 'subtle' | 'none';
|
|
438
438
|
[key: string]: any;
|
|
439
439
|
UNSAFE_is_experimental_generic?: boolean;
|
|
440
|
-
/**
|
|
441
|
-
* If `true`, the input value will be kept when an option is selected and isMulti is `true`. The default is `false`.
|
|
442
|
-
*/
|
|
443
|
-
shouldKeepInputOnSelect?: boolean;
|
|
444
440
|
}
|
|
445
441
|
export declare const defaultProps: Omit<SelectProps<unknown, false, GroupBase<unknown>>, 'inputValue' | 'onChange' | 'onInputChange' | 'onMenuOpen' | 'onMenuClose' | 'value' | 'appearance'>;
|
|
446
442
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.1",
|
|
4
4
|
"description": "A forked version of react-select to only be used in atlaskit/select",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
],
|
|
21
21
|
"atlaskit:src": "src/index.tsx",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaskit/ds-lib": "^
|
|
23
|
+
"@atlaskit/ds-lib": "^7.0.0",
|
|
24
24
|
"@atlaskit/icon": "^34.0.0",
|
|
25
25
|
"@atlaskit/layering": "^3.6.0",
|
|
26
26
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
27
27
|
"@atlaskit/primitives": "^18.1.0",
|
|
28
|
-
"@atlaskit/spinner": "^19.
|
|
29
|
-
"@atlaskit/tag": "^14.
|
|
30
|
-
"@atlaskit/tokens": "^
|
|
28
|
+
"@atlaskit/spinner": "^19.1.0",
|
|
29
|
+
"@atlaskit/tag": "^14.7.0",
|
|
30
|
+
"@atlaskit/tokens": "^12.0.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0",
|
|
32
32
|
"@compiled/react": "^0.20.0",
|
|
33
33
|
"@floating-ui/dom": "^1.0.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"platform_dst_select_menu_close_on_blur": {
|
|
55
55
|
"type": "boolean"
|
|
56
56
|
},
|
|
57
|
-
"
|
|
57
|
+
"platform_fix_input_component_styling": {
|
|
58
58
|
"type": "boolean"
|
|
59
59
|
},
|
|
60
60
|
"platform_fix_autocomplete_aria_for_select": {
|