@atlaskit/react-select 3.5.4 → 3.6.0
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 +8 -0
- package/dist/cjs/compiled/components/containers.js +1 -1
- package/dist/cjs/components/containers.js +1 -1
- package/dist/cjs/components/control.js +1 -1
- package/dist/cjs/components/group.js +1 -1
- package/dist/cjs/components/indicators.js +1 -1
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/components/internal/a11y-text.js +1 -1
- package/dist/cjs/components/internal/dummy-input.js +1 -1
- package/dist/cjs/components/internal/required-input.js +1 -1
- package/dist/cjs/components/menu.js +1 -1
- package/dist/cjs/components/multi-value.js +1 -1
- package/dist/cjs/components/option.js +1 -1
- package/dist/cjs/components/placeholder.js +1 -1
- package/dist/cjs/components/single-value.js +1 -1
- package/dist/cjs/select.js +5 -3
- package/dist/es2019/compiled/components/containers.js +1 -1
- package/dist/es2019/components/containers.js +1 -1
- package/dist/es2019/components/control.js +1 -1
- package/dist/es2019/components/group.js +1 -1
- package/dist/es2019/components/indicators.js +1 -1
- package/dist/es2019/components/input.js +1 -1
- package/dist/es2019/components/internal/a11y-text.js +1 -1
- package/dist/es2019/components/internal/dummy-input.js +1 -1
- package/dist/es2019/components/internal/required-input.js +1 -1
- package/dist/es2019/components/menu.js +1 -1
- package/dist/es2019/components/multi-value.js +1 -1
- package/dist/es2019/components/option.js +1 -1
- package/dist/es2019/components/placeholder.js +1 -1
- package/dist/es2019/components/single-value.js +1 -1
- package/dist/es2019/select.js +5 -3
- package/dist/esm/compiled/components/containers.js +1 -1
- package/dist/esm/components/containers.js +1 -1
- package/dist/esm/components/control.js +1 -1
- package/dist/esm/components/group.js +1 -1
- package/dist/esm/components/indicators.js +1 -1
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/internal/a11y-text.js +1 -1
- package/dist/esm/components/internal/dummy-input.js +1 -1
- package/dist/esm/components/internal/required-input.js +1 -1
- package/dist/esm/components/menu.js +1 -1
- package/dist/esm/components/multi-value.js +1 -1
- package/dist/esm/components/option.js +1 -1
- package/dist/esm/components/placeholder.js +1 -1
- package/dist/esm/components/single-value.js +1 -1
- package/dist/esm/select.js +5 -3
- package/dist/types/select.d.ts +6 -0
- package/dist/types-ts4.5/select.d.ts +6 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 3.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`153fad932190f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/153fad932190f) -
|
|
8
|
+
[ux] Added a new prop shouldKeepInputOnSelect to the select component to prevent clearing the
|
|
9
|
+
input when isMulti is true
|
|
10
|
+
|
|
3
11
|
## 3.5.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/select.js
CHANGED
|
@@ -79,7 +79,8 @@ var defaultProps = exports.defaultProps = {
|
|
|
79
79
|
styles: {},
|
|
80
80
|
tabIndex: 0,
|
|
81
81
|
tabSelectsValue: true,
|
|
82
|
-
UNSAFE_is_experimental_generic: false
|
|
82
|
+
UNSAFE_is_experimental_generic: false,
|
|
83
|
+
shouldKeepInputOnSelect: false
|
|
83
84
|
};
|
|
84
85
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
85
86
|
var isDisabled = _isOptionDisabled(props, option, selectValue);
|
|
@@ -291,9 +292,10 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
291
292
|
var _this$props2 = _this.props,
|
|
292
293
|
closeMenuOnSelect = _this$props2.closeMenuOnSelect,
|
|
293
294
|
isMulti = _this$props2.isMulti,
|
|
294
|
-
inputValue = _this$props2.inputValue
|
|
295
|
+
inputValue = _this$props2.inputValue,
|
|
296
|
+
shouldKeepInputOnSelect = _this$props2.shouldKeepInputOnSelect;
|
|
295
297
|
// for multiple selection options, do not clear the search input value
|
|
296
|
-
if (isMulti && (0, _platformFeatureFlags.fg)('platform_do_not_clear_input_for_multiselect')) {
|
|
298
|
+
if (isMulti && shouldKeepInputOnSelect && (0, _platformFeatureFlags.fg)('platform_do_not_clear_input_for_multiselect')) {
|
|
297
299
|
_this.onInputChange(inputValue, {
|
|
298
300
|
action: 'set-value',
|
|
299
301
|
prevInputValue: inputValue
|
package/dist/es2019/select.js
CHANGED
|
@@ -53,7 +53,8 @@ export const defaultProps = {
|
|
|
53
53
|
styles: {},
|
|
54
54
|
tabIndex: 0,
|
|
55
55
|
tabSelectsValue: true,
|
|
56
|
-
UNSAFE_is_experimental_generic: false
|
|
56
|
+
UNSAFE_is_experimental_generic: false,
|
|
57
|
+
shouldKeepInputOnSelect: false
|
|
57
58
|
};
|
|
58
59
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
59
60
|
const isDisabled = isOptionDisabled(props, option, selectValue);
|
|
@@ -261,10 +262,11 @@ export default class Select extends Component {
|
|
|
261
262
|
const {
|
|
262
263
|
closeMenuOnSelect,
|
|
263
264
|
isMulti,
|
|
264
|
-
inputValue
|
|
265
|
+
inputValue,
|
|
266
|
+
shouldKeepInputOnSelect
|
|
265
267
|
} = this.props;
|
|
266
268
|
// for multiple selection options, do not clear the search input value
|
|
267
|
-
if (isMulti && fg('platform_do_not_clear_input_for_multiselect')) {
|
|
269
|
+
if (isMulti && shouldKeepInputOnSelect && fg('platform_do_not_clear_input_for_multiselect')) {
|
|
268
270
|
this.onInputChange(inputValue, {
|
|
269
271
|
action: 'set-value',
|
|
270
272
|
prevInputValue: inputValue
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* group.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* group.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
var _excluded = ["data"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* indicators.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* indicators.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/extends";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* input.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* input.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName", "testId"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* dummy-input.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* dummy-input.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["innerRef"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* menu.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* menu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* multi-value.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* multi-value.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import "./multi-value.compiled.css";
|
package/dist/esm/select.js
CHANGED
|
@@ -70,7 +70,8 @@ export var defaultProps = {
|
|
|
70
70
|
styles: {},
|
|
71
71
|
tabIndex: 0,
|
|
72
72
|
tabSelectsValue: true,
|
|
73
|
-
UNSAFE_is_experimental_generic: false
|
|
73
|
+
UNSAFE_is_experimental_generic: false,
|
|
74
|
+
shouldKeepInputOnSelect: false
|
|
74
75
|
};
|
|
75
76
|
function toCategorizedOption(props, option, selectValue, index) {
|
|
76
77
|
var isDisabled = _isOptionDisabled(props, option, selectValue);
|
|
@@ -282,9 +283,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
282
283
|
var _this$props2 = _this.props,
|
|
283
284
|
closeMenuOnSelect = _this$props2.closeMenuOnSelect,
|
|
284
285
|
isMulti = _this$props2.isMulti,
|
|
285
|
-
inputValue = _this$props2.inputValue
|
|
286
|
+
inputValue = _this$props2.inputValue,
|
|
287
|
+
shouldKeepInputOnSelect = _this$props2.shouldKeepInputOnSelect;
|
|
286
288
|
// for multiple selection options, do not clear the search input value
|
|
287
|
-
if (isMulti && fg('platform_do_not_clear_input_for_multiselect')) {
|
|
289
|
+
if (isMulti && shouldKeepInputOnSelect && fg('platform_do_not_clear_input_for_multiselect')) {
|
|
288
290
|
_this.onInputChange(inputValue, {
|
|
289
291
|
action: 'set-value',
|
|
290
292
|
prevInputValue: inputValue
|
package/dist/types/select.d.ts
CHANGED
|
@@ -433,6 +433,10 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
433
433
|
appearance: 'default' | 'subtle' | 'none';
|
|
434
434
|
[key: string]: any;
|
|
435
435
|
UNSAFE_is_experimental_generic?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* If `true`, the input value will be kept when an option is selected and isMulti is `true`. The default is `false`.
|
|
438
|
+
*/
|
|
439
|
+
shouldKeepInputOnSelect?: boolean;
|
|
436
440
|
}
|
|
437
441
|
export declare const defaultProps: {
|
|
438
442
|
backspaceRemovesValue: boolean;
|
|
@@ -476,6 +480,7 @@ export declare const defaultProps: {
|
|
|
476
480
|
tabIndex: number;
|
|
477
481
|
tabSelectsValue: boolean;
|
|
478
482
|
UNSAFE_is_experimental_generic: boolean;
|
|
483
|
+
shouldKeepInputOnSelect: boolean;
|
|
479
484
|
};
|
|
480
485
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
481
486
|
ariaSelection: AriaSelection<Option, IsMulti> | null;
|
|
@@ -556,6 +561,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
556
561
|
tabIndex: number;
|
|
557
562
|
tabSelectsValue: boolean;
|
|
558
563
|
UNSAFE_is_experimental_generic: boolean;
|
|
564
|
+
shouldKeepInputOnSelect: boolean;
|
|
559
565
|
};
|
|
560
566
|
state: State<Option, IsMulti, Group>;
|
|
561
567
|
blockOptionHover: boolean;
|
|
@@ -433,6 +433,10 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
433
433
|
appearance: 'default' | 'subtle' | 'none';
|
|
434
434
|
[key: string]: any;
|
|
435
435
|
UNSAFE_is_experimental_generic?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* If `true`, the input value will be kept when an option is selected and isMulti is `true`. The default is `false`.
|
|
438
|
+
*/
|
|
439
|
+
shouldKeepInputOnSelect?: boolean;
|
|
436
440
|
}
|
|
437
441
|
export declare const defaultProps: {
|
|
438
442
|
backspaceRemovesValue: boolean;
|
|
@@ -476,6 +480,7 @@ export declare const defaultProps: {
|
|
|
476
480
|
tabIndex: number;
|
|
477
481
|
tabSelectsValue: boolean;
|
|
478
482
|
UNSAFE_is_experimental_generic: boolean;
|
|
483
|
+
shouldKeepInputOnSelect: boolean;
|
|
479
484
|
};
|
|
480
485
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
481
486
|
ariaSelection: AriaSelection<Option, IsMulti> | null;
|
|
@@ -556,6 +561,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
556
561
|
tabIndex: number;
|
|
557
562
|
tabSelectsValue: boolean;
|
|
558
563
|
UNSAFE_is_experimental_generic: boolean;
|
|
564
|
+
shouldKeepInputOnSelect: boolean;
|
|
559
565
|
};
|
|
560
566
|
state: State<Option, IsMulti, Group>;
|
|
561
567
|
blockOptionHover: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"atlaskit:src": "src/index.tsx",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
24
|
-
"@atlaskit/icon": "^28.
|
|
24
|
+
"@atlaskit/icon": "^28.2.0",
|
|
25
25
|
"@atlaskit/layering": "^3.0.0",
|
|
26
26
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
27
27
|
"@atlaskit/primitives": "^14.14.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@atlaskit/checkbox": "^17.1.0",
|
|
42
|
-
"@atlaskit/form": "^12.
|
|
42
|
+
"@atlaskit/form": "^12.6.0",
|
|
43
43
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
44
44
|
"@testing-library/react": "^13.4.0",
|
|
45
45
|
"@testing-library/user-event": "^14.4.3",
|