@atlaskit/react-select 3.14.5 → 3.15.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/react-select
2
2
 
3
+ ## 3.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`31cb79d51457a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31cb79d51457a) -
8
+ Remove prop shouldKeepInputOnSelect to clean up stale flag
9
+
3
10
  ## 3.14.5
4
11
 
5
12
  ### 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)('platform_do_not_clear_input_for_multiselect')) {
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
@@ -166,8 +166,7 @@ var defaultProps = exports.defaultProps = {
166
166
  styles: {},
167
167
  tabIndex: 0,
168
168
  tabSelectsValue: true,
169
- UNSAFE_is_experimental_generic: false,
170
- shouldKeepInputOnSelect: false
169
+ UNSAFE_is_experimental_generic: false
171
170
  };
172
171
  function toCategorizedOption(props, option, selectValue, index) {
173
172
  var isDisabled = _isOptionDisabled(props, option, selectValue);
@@ -379,20 +378,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
379
378
  var _this$props2 = _this.props,
380
379
  closeMenuOnSelect = _this$props2.closeMenuOnSelect,
381
380
  isMulti = _this$props2.isMulti,
382
- inputValue = _this$props2.inputValue,
383
- shouldKeepInputOnSelect = _this$props2.shouldKeepInputOnSelect;
384
- // for multiple selection options, do not clear the search input value
385
- if (isMulti && shouldKeepInputOnSelect && (0, _platformFeatureFlags.fg)('platform_do_not_clear_input_for_multiselect')) {
386
- _this.onInputChange(inputValue, {
387
- action: 'set-value',
388
- prevInputValue: inputValue
389
- });
390
- } else {
391
- _this.onInputChange('', {
392
- action: 'set-value',
393
- prevInputValue: inputValue
394
- });
395
- }
381
+ inputValue = _this$props2.inputValue;
382
+ _this.onInputChange('', {
383
+ action: 'set-value',
384
+ prevInputValue: inputValue
385
+ });
396
386
  if (closeMenuOnSelect) {
397
387
  _this.setState({
398
388
  inputIsHiddenAfterUpdate: !isMulti
@@ -39,7 +39,7 @@ const Input = props => {
39
39
  } = getStyleProps(props, 'input', {
40
40
  'input-container': true
41
41
  });
42
- if (fg('platform_do_not_clear_input_for_multiselect')) {
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
@@ -138,8 +138,7 @@ export const defaultProps = {
138
138
  styles: {},
139
139
  tabIndex: 0,
140
140
  tabSelectsValue: true,
141
- UNSAFE_is_experimental_generic: false,
142
- shouldKeepInputOnSelect: false
141
+ UNSAFE_is_experimental_generic: false
143
142
  };
144
143
  function toCategorizedOption(props, option, selectValue, index) {
145
144
  const isDisabled = isOptionDisabled(props, option, selectValue);
@@ -347,21 +346,12 @@ export default class Select extends Component {
347
346
  const {
348
347
  closeMenuOnSelect,
349
348
  isMulti,
350
- inputValue,
351
- shouldKeepInputOnSelect
349
+ inputValue
352
350
  } = this.props;
353
- // for multiple selection options, do not clear the search input value
354
- if (isMulti && shouldKeepInputOnSelect && fg('platform_do_not_clear_input_for_multiselect')) {
355
- this.onInputChange(inputValue, {
356
- action: 'set-value',
357
- prevInputValue: inputValue
358
- });
359
- } else {
360
- this.onInputChange('', {
361
- action: 'set-value',
362
- prevInputValue: inputValue
363
- });
364
- }
351
+ this.onInputChange('', {
352
+ action: 'set-value',
353
+ prevInputValue: inputValue
354
+ });
365
355
  if (closeMenuOnSelect) {
366
356
  this.setState({
367
357
  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('platform_do_not_clear_input_for_multiselect')) {
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
@@ -157,8 +157,7 @@ export var defaultProps = {
157
157
  styles: {},
158
158
  tabIndex: 0,
159
159
  tabSelectsValue: true,
160
- UNSAFE_is_experimental_generic: false,
161
- shouldKeepInputOnSelect: false
160
+ UNSAFE_is_experimental_generic: false
162
161
  };
163
162
  function toCategorizedOption(props, option, selectValue, index) {
164
163
  var isDisabled = _isOptionDisabled(props, option, selectValue);
@@ -370,20 +369,11 @@ var Select = /*#__PURE__*/function (_Component) {
370
369
  var _this$props2 = _this.props,
371
370
  closeMenuOnSelect = _this$props2.closeMenuOnSelect,
372
371
  isMulti = _this$props2.isMulti,
373
- inputValue = _this$props2.inputValue,
374
- shouldKeepInputOnSelect = _this$props2.shouldKeepInputOnSelect;
375
- // for multiple selection options, do not clear the search input value
376
- if (isMulti && shouldKeepInputOnSelect && fg('platform_do_not_clear_input_for_multiselect')) {
377
- _this.onInputChange(inputValue, {
378
- action: 'set-value',
379
- prevInputValue: inputValue
380
- });
381
- } else {
382
- _this.onInputChange('', {
383
- action: 'set-value',
384
- prevInputValue: inputValue
385
- });
386
- }
372
+ inputValue = _this$props2.inputValue;
373
+ _this.onInputChange('', {
374
+ action: 'set-value',
375
+ prevInputValue: inputValue
376
+ });
387
377
  if (closeMenuOnSelect) {
388
378
  _this.setState({
389
379
  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: import("react").Context<{
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>> {
@@ -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: import("react").Context<{
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.14.5",
3
+ "version": "3.15.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",
@@ -25,8 +25,8 @@
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.0.0",
29
- "@atlaskit/tag": "^14.6.0",
28
+ "@atlaskit/spinner": "^19.1.0",
29
+ "@atlaskit/tag": "^14.7.0",
30
30
  "@atlaskit/tokens": "^11.4.0",
31
31
  "@babel/runtime": "^7.0.0",
32
32
  "@compiled/react": "^0.20.0",
@@ -54,7 +54,7 @@
54
54
  "platform_dst_select_menu_close_on_blur": {
55
55
  "type": "boolean"
56
56
  },
57
- "platform_do_not_clear_input_for_multiselect": {
57
+ "platform_fix_input_component_styling": {
58
58
  "type": "boolean"
59
59
  },
60
60
  "platform_fix_autocomplete_aria_for_select": {