@atlaskit/select 16.0.3 → 16.1.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 +11 -0
- package/dist/cjs/PopupSelect/PopupSelect.js +3 -3
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/{ert.js → extract-react-types/ert.js} +0 -0
- package/dist/cjs/extract-react-types/react-popper-props.js +9 -0
- package/dist/cjs/extract-react-types/react-select-async.js +9 -0
- package/dist/cjs/extract-react-types/react-select-creatable.js +9 -0
- package/dist/cjs/extract-react-types/react-select-props.js +9 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/PopupSelect/PopupSelect.js +3 -3
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/{ert.js → extract-react-types/ert.js} +0 -0
- package/dist/es2019/extract-react-types/react-popper-props.js +2 -0
- package/dist/es2019/extract-react-types/react-select-async.js +2 -0
- package/dist/es2019/extract-react-types/react-select-creatable.js +2 -0
- package/dist/es2019/extract-react-types/react-select-props.js +2 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/PopupSelect/PopupSelect.js +3 -3
- package/dist/esm/Select.js +1 -1
- package/dist/esm/{ert.js → extract-react-types/ert.js} +0 -0
- package/dist/esm/extract-react-types/react-popper-props.js +2 -0
- package/dist/esm/extract-react-types/react-select-async.js +2 -0
- package/dist/esm/extract-react-types/react-select-creatable.js +2 -0
- package/dist/esm/extract-react-types/react-select-props.js +2 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/PopupSelect/PopupSelect.d.ts +1 -1
- package/dist/types/{ert.d.ts → extract-react-types/ert.d.ts} +1 -1
- package/dist/types/extract-react-types/react-popper-props.d.ts +21 -0
- package/dist/types/extract-react-types/react-select-async.d.ts +24 -0
- package/dist/types/extract-react-types/react-select-creatable.d.ts +38 -0
- package/dist/types/extract-react-types/react-select-props.d.ts +182 -0
- package/dist/types/types.d.ts +4 -4
- package/package.json +1 -1
- package/report.api.md +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 16.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`017e3dccdf3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/017e3dccdf3) - Add SelectInstance for export
|
|
8
|
+
- [`2368982b4d2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2368982b4d2) - Add MultiValueRemoveProps, SelectInstance to export
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`c74089f0c6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c74089f0c6d) - Revert the onOpen and onClose logic in PopupSelect
|
|
13
|
+
|
|
3
14
|
## 16.0.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -199,15 +199,15 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
201
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "open", function (options) {
|
|
202
|
-
var
|
|
202
|
+
var onOpen = _this.props.onOpen;
|
|
203
203
|
|
|
204
204
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
205
205
|
// Prevent popup opening if it's open state is already being controlled
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
if (
|
|
210
|
-
|
|
209
|
+
if (onOpen) {
|
|
210
|
+
onOpen();
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
_this.setState({
|
package/dist/cjs/Select.js
CHANGED
|
@@ -14,7 +14,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
14
14
|
var _createSelect = _interopRequireDefault(require("./createSelect"));
|
|
15
15
|
|
|
16
16
|
var packageName = "@atlaskit/select";
|
|
17
|
-
var packageVersion = "16.0
|
|
17
|
+
var packageVersion = "16.1.0";
|
|
18
18
|
var SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
|
|
19
19
|
exports.SelectWithoutAnalytics = SelectWithoutAnalytics;
|
|
20
20
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ertHackForPopper;
|
|
7
|
+
|
|
8
|
+
// this is to DOCUMENT/display the underlying react popper props, for our atlaskit/select documentation
|
|
9
|
+
function ertHackForPopper(_) {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ertHackForSelect;
|
|
7
|
+
|
|
8
|
+
// this is to DOCUMENT/display the underlying react select props, for our atlaskit/select documentation
|
|
9
|
+
function ertHackForSelect(_) {}
|
package/dist/cjs/version.json
CHANGED
|
@@ -148,7 +148,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
148
148
|
|
|
149
149
|
_defineProperty(this, "open", options => {
|
|
150
150
|
const {
|
|
151
|
-
|
|
151
|
+
onOpen
|
|
152
152
|
} = this.props;
|
|
153
153
|
|
|
154
154
|
if (!(options !== null && options !== void 0 && options.controlOverride) && this.isOpenControlled) {
|
|
@@ -156,8 +156,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
if (
|
|
160
|
-
|
|
159
|
+
if (onOpen) {
|
|
160
|
+
onOpen();
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
this.setState({
|
package/dist/es2019/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import Select from 'react-select';
|
|
|
2
2
|
import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import createSelect from './createSelect';
|
|
4
4
|
const packageName = "@atlaskit/select";
|
|
5
|
-
const packageVersion = "16.0
|
|
5
|
+
const packageVersion = "16.1.0";
|
|
6
6
|
export const SelectWithoutAnalytics = createSelect(Select);
|
|
7
7
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
export default withAnalyticsContext({
|
|
File without changes
|
package/dist/es2019/version.json
CHANGED
|
@@ -179,15 +179,15 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
179
179
|
});
|
|
180
180
|
|
|
181
181
|
_defineProperty(_assertThisInitialized(_this), "open", function (options) {
|
|
182
|
-
var
|
|
182
|
+
var onOpen = _this.props.onOpen;
|
|
183
183
|
|
|
184
184
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
185
185
|
// Prevent popup opening if it's open state is already being controlled
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
if (
|
|
190
|
-
|
|
189
|
+
if (onOpen) {
|
|
190
|
+
onOpen();
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
_this.setState({
|
package/dist/esm/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import Select from 'react-select';
|
|
|
2
2
|
import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import createSelect from './createSelect';
|
|
4
4
|
var packageName = "@atlaskit/select";
|
|
5
|
-
var packageVersion = "16.0
|
|
5
|
+
var packageVersion = "16.1.0";
|
|
6
6
|
export var SelectWithoutAnalytics = createSelect(Select);
|
|
7
7
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
export default withAnalyticsContext({
|
|
File without changes
|
package/dist/esm/version.json
CHANGED
|
@@ -25,7 +25,7 @@ export interface PopupSelectProps<Option = OptionType, IsMulti extends boolean =
|
|
|
25
25
|
The props passed down to React Popper.
|
|
26
26
|
|
|
27
27
|
Use these to override the default positioning strategy, behaviour and placement used by this library.
|
|
28
|
-
For more information, see the [React Popper documentation](https://popper.js.org/react-popper/v2/render-props).
|
|
28
|
+
For more information, see the Popper Props section below, or [React Popper documentation](https://popper.js.org/react-popper/v2/render-props).
|
|
29
29
|
|
|
30
30
|
*/
|
|
31
31
|
popperProps?: PopperPropsNoChildren<Modifiers>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SelectProps, OptionType } from '
|
|
1
|
+
import { SelectProps, OptionType } from '../types';
|
|
2
2
|
export default function ertHackForSelect(_: SelectProps<OptionType>): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Modifier, Options } from '@popperjs/core';
|
|
3
|
+
declare type Placement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
4
|
+
declare type Strategy = 'absolute' | 'fixed';
|
|
5
|
+
interface NativeReactPopperProps<Name = unknown> {
|
|
6
|
+
/** Function `(?HTMLElement) => void` that can be used to obtain popper reference */
|
|
7
|
+
innerRef?: React.Ref<any>;
|
|
8
|
+
/** One of the accepted placement values listed in the Popper.js documentation.
|
|
9
|
+
Your popper is going to be placed according to the value of this property.
|
|
10
|
+
Defaults to bottom.*/
|
|
11
|
+
placement?: Placement;
|
|
12
|
+
/** Describes the positioning strategy to use. By default, it is absolute, which in the simplest cases does not
|
|
13
|
+
* require repositioning of the popper. If your reference element is in a fixed container, use the fixed strategy. */
|
|
14
|
+
strategy: Strategy;
|
|
15
|
+
/** An object containing custom settings for the Popper.js modifiers.
|
|
16
|
+
You can use this property to override their settings or to inject your custom ones.
|
|
17
|
+
See [Popper Modifiers](https://popper.js.org/docs/v2/modifiers/) for full details. */
|
|
18
|
+
modifiers?: ReadonlyArray<Modifier<Name, Options>>;
|
|
19
|
+
}
|
|
20
|
+
export default function ertHackForPopper(_: NativeReactPopperProps): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GroupBase, OptionsOrGroups } from 'react-select';
|
|
2
|
+
export interface ReactSelectAsyncProps<Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>> {
|
|
3
|
+
/**
|
|
4
|
+
* The default set of options to show before the user starts searching. When
|
|
5
|
+
* set to `true`, the results for loadOptions('') will be autoloaded.
|
|
6
|
+
*/
|
|
7
|
+
defaultOptions?: OptionsOrGroups<Option, Group> | boolean;
|
|
8
|
+
/**
|
|
9
|
+
* If cacheOptions is truthy, then the loaded data will be cached. The cache
|
|
10
|
+
* will remain until `cacheOptions` changes value.
|
|
11
|
+
*/
|
|
12
|
+
cacheOptions?: any;
|
|
13
|
+
/**
|
|
14
|
+
* Function that returns a promise, which is the set of options to be used
|
|
15
|
+
* once the promise resolves.
|
|
16
|
+
*/
|
|
17
|
+
loadOptions?: (inputValue: string, callback: (options: OptionsOrGroups<Option, Group>) => void) => Promise<OptionsOrGroups<Option, Group>> | void;
|
|
18
|
+
/**
|
|
19
|
+
* Will cause the select to be displayed in the loading state, even if the
|
|
20
|
+
* Async select is not currently waiting for loadOptions to resolve
|
|
21
|
+
*/
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export default function ertHackForPopper(_: ReactSelectAsyncProps): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { GetOptionLabel, GetOptionValue, GroupBase, Options, OptionsOrGroups } from 'react-select';
|
|
3
|
+
export interface Accessors<Option> {
|
|
4
|
+
getOptionValue: GetOptionValue<Option>;
|
|
5
|
+
getOptionLabel: GetOptionLabel<Option>;
|
|
6
|
+
}
|
|
7
|
+
export interface ReactSelectCreatableProps<Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>> {
|
|
8
|
+
/**
|
|
9
|
+
* Allow options to be created while the `isLoading` prop is true. Useful to
|
|
10
|
+
* prevent the "create new ..." option being displayed while async results are
|
|
11
|
+
* still being loaded.
|
|
12
|
+
*/
|
|
13
|
+
allowCreateWhileLoading?: boolean;
|
|
14
|
+
/** Sets the position of the createOption element in your options list. Defaults to 'last' */
|
|
15
|
+
createOptionPosition?: 'first' | 'last';
|
|
16
|
+
/**
|
|
17
|
+
* Gets the label for the "create new ..." option in the menu. Is given the
|
|
18
|
+
* current input value.
|
|
19
|
+
*/
|
|
20
|
+
formatCreateLabel?: (inputValue: string) => ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Determines whether the "create new ..." option should be displayed based on
|
|
23
|
+
* the current input value, select value and options array.
|
|
24
|
+
*/
|
|
25
|
+
isValidNewOption?: (inputValue: string, value: Options<Option>, options: OptionsOrGroups<Option, Group>, accessors: Accessors<Option>) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the data for the new option when it is created. Used to display the
|
|
28
|
+
* value, and is passed to `onChange`.
|
|
29
|
+
*/
|
|
30
|
+
getNewOptionData?: (inputValue: string, optionLabel: ReactNode) => Option;
|
|
31
|
+
/**
|
|
32
|
+
* If provided, this will be called with the input value when a new option is
|
|
33
|
+
* created, and `onChange` will **not** be called. Use this when you need more
|
|
34
|
+
* control over what happens when new options are created.
|
|
35
|
+
*/
|
|
36
|
+
onCreateOption?: (inputValue: string) => void;
|
|
37
|
+
}
|
|
38
|
+
export default function ertHackForSelect(_: ReactSelectCreatableProps): void;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { FocusEventHandler, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
|
+
interface FilterOptionOption<Option> {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly value: string;
|
|
5
|
+
readonly data: Option;
|
|
6
|
+
}
|
|
7
|
+
import { StylesConfig } from '../types';
|
|
8
|
+
import { ActionMeta, AriaLiveMessages, FormatOptionLabelMeta, GetOptionLabel, GetOptionValue, GroupBase, InputActionMeta, MenuPlacement, MenuPosition, OnChangeValue, Options, OptionsOrGroups, PropsValue, SelectComponentsConfig, ThemeConfig } from 'react-select';
|
|
9
|
+
interface NativeReactSelectProps<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> {
|
|
10
|
+
/** Aria label (for assistive tech) */
|
|
11
|
+
'aria-label'?: string;
|
|
12
|
+
/** HTML ID of an element that should be used as the label (for assistive tech) */
|
|
13
|
+
'aria-labelledby'?: string;
|
|
14
|
+
/** Used to set the priority with which screen reader should treat updates to live regions. The possible settings are?: off, polite (default) or assertive */
|
|
15
|
+
'aria-live'?: 'off' | 'polite' | 'assertive';
|
|
16
|
+
/** Customize the messages used by the aria-live component. See react-select v5.4.0 documentation for full details */
|
|
17
|
+
ariaLiveMessages?: AriaLiveMessages<Option, IsMulti, Group>;
|
|
18
|
+
/** Focus the control when it is mounted */
|
|
19
|
+
autoFocus?: boolean;
|
|
20
|
+
/** Remove the currently focused option when the user presses backspace when Select isClearable or isMulti */
|
|
21
|
+
backspaceRemovesValue?: boolean;
|
|
22
|
+
/** Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */
|
|
23
|
+
blurInputOnSelect?: boolean;
|
|
24
|
+
/** When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */
|
|
25
|
+
captureMenuScroll?: boolean;
|
|
26
|
+
/** Sets a className attribute on the outer component */
|
|
27
|
+
className?: string;
|
|
28
|
+
classNamePrefix?: string | null;
|
|
29
|
+
/** Close the select menu when the user selects an option */
|
|
30
|
+
closeMenuOnSelect?: boolean;
|
|
31
|
+
closeMenuOnScroll?: boolean | EventListener;
|
|
32
|
+
/**
|
|
33
|
+
* This complex object includes all the compositional components that are used
|
|
34
|
+
* in `react-select`. If you wish to overwrite a component, pass in an object
|
|
35
|
+
* with the appropriate namespace.
|
|
36
|
+
*
|
|
37
|
+
* If you only wish to restyle a component, we recommend using the `styles` prop
|
|
38
|
+
* instead. For a list of the components that can be passed in, and the shape
|
|
39
|
+
* that will be passed to them, see [the components docs](/components)
|
|
40
|
+
*/
|
|
41
|
+
components?: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
42
|
+
/** Whether the value of the select, e.g. SingleValue, should be displayed in the control. */
|
|
43
|
+
controlShouldRenderValue?: boolean;
|
|
44
|
+
/** Delimiter used to join multiple values into a single HTML Input value */
|
|
45
|
+
delimiter?: string;
|
|
46
|
+
/** Clear all values when the user presses escape AND the menu is closed */
|
|
47
|
+
escapeClearsValue?: boolean;
|
|
48
|
+
/** Custom method to filter whether an option should be displayed in the menu */
|
|
49
|
+
filterOption?: ((option?: FilterOptionOption<Option>, inputValue?: string) => boolean) | null;
|
|
50
|
+
/**
|
|
51
|
+
* Formats group labels in the menu as React components
|
|
52
|
+
*
|
|
53
|
+
* An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
|
|
54
|
+
*/
|
|
55
|
+
formatGroupLabel?: (group?: Group) => ReactNode;
|
|
56
|
+
/** Formats option labels in the menu and control as React components */
|
|
57
|
+
formatOptionLabel?: (data?: Option, formatOptionLabelMeta?: FormatOptionLabelMeta<Option>) => ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Resolves option data to a string to be displayed as the label by components
|
|
60
|
+
*
|
|
61
|
+
* Note?: Failure to resolve to a string type can interfere with filtering and
|
|
62
|
+
* screen reader support.
|
|
63
|
+
*/
|
|
64
|
+
getOptionLabel?: GetOptionLabel<Option>;
|
|
65
|
+
/** Resolves option data to a string to compare options and specify value attributes */
|
|
66
|
+
getOptionValue?: GetOptionValue<Option>;
|
|
67
|
+
/** Hide the selected option from the menu */
|
|
68
|
+
hideSelectedOptions?: boolean;
|
|
69
|
+
/** The id to set on the SelectContainer component. */
|
|
70
|
+
id?: string;
|
|
71
|
+
/** The value of the search input */
|
|
72
|
+
inputValue?: string;
|
|
73
|
+
/** The id of the search input */
|
|
74
|
+
inputId?: string;
|
|
75
|
+
/** Define an id prefix for the select components e.g. {your-id}-value */
|
|
76
|
+
instanceId?: number | string;
|
|
77
|
+
/** Is the select value clearable */
|
|
78
|
+
isClearable?: boolean;
|
|
79
|
+
/** Is the select disabled */
|
|
80
|
+
isDisabled?: boolean;
|
|
81
|
+
/** Is the select in a state of loading (async) */
|
|
82
|
+
isLoading?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Override the built-in logic to detect whether an option is disabled
|
|
85
|
+
*
|
|
86
|
+
* An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
|
|
87
|
+
*/
|
|
88
|
+
isOptionDisabled?: (option?: Option, selectValue?: Options<Option>) => boolean;
|
|
89
|
+
/** Override the built-in logic to detect whether an option is selected */
|
|
90
|
+
isOptionSelected?: (option?: Option, selectValue?: Options<Option>) => boolean;
|
|
91
|
+
/** Support multiple selected options */
|
|
92
|
+
isMulti?: IsMulti;
|
|
93
|
+
/** Is the select direction right-to-left */
|
|
94
|
+
isRtl?: boolean;
|
|
95
|
+
/** Whether to enable search functionality */
|
|
96
|
+
isSearchable?: boolean;
|
|
97
|
+
/** Async?: Text to display when loading options */
|
|
98
|
+
loadingMessage?: (obj?: {
|
|
99
|
+
inputValue?: string;
|
|
100
|
+
}) => ReactNode;
|
|
101
|
+
/** Minimum height of the menu before flipping */
|
|
102
|
+
minMenuHeight?: number;
|
|
103
|
+
/** Maximum height of the menu before scrolling */
|
|
104
|
+
maxMenuHeight?: number;
|
|
105
|
+
/** Whether the menu is open */
|
|
106
|
+
menuIsOpen?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Default placement of the menu in relation to the control. 'auto' will flip
|
|
109
|
+
* when there isn't enough space below the control.
|
|
110
|
+
*/
|
|
111
|
+
menuPlacement?: MenuPlacement;
|
|
112
|
+
/** The CSS position value of the menu, when "fixed" extra layout management is required */
|
|
113
|
+
menuPosition?: MenuPosition;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the menu should use a portal, and where it should attach
|
|
116
|
+
*
|
|
117
|
+
* An example can be found in the [Portaling](/advanced#portaling) documentation
|
|
118
|
+
*/
|
|
119
|
+
menuPortalTarget?: HTMLElement | null;
|
|
120
|
+
/** Whether to block scroll events when the menu is open */
|
|
121
|
+
menuShouldBlockScroll?: boolean;
|
|
122
|
+
/** Whether the menu should be scrolled into view when it opens */
|
|
123
|
+
menuShouldScrollIntoView?: boolean;
|
|
124
|
+
/** Name of the HTML Input (optional - without this, no input will be rendered) */
|
|
125
|
+
name?: string;
|
|
126
|
+
/** Text to display when there are no options */
|
|
127
|
+
noOptionsMessage?: (obj?: {
|
|
128
|
+
inputValue?: string;
|
|
129
|
+
}) => ReactNode;
|
|
130
|
+
/** Handle blur events on the control */
|
|
131
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
132
|
+
/** Handle change events on the select */
|
|
133
|
+
onChange?: (newValue?: OnChangeValue<Option, IsMulti>, actionMeta?: ActionMeta<Option>) => void;
|
|
134
|
+
/** Handle focus events on the control */
|
|
135
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
136
|
+
/** Handle change events on the input */
|
|
137
|
+
onInputChange?: (newValue?: string, actionMeta?: InputActionMeta) => void;
|
|
138
|
+
/** Handle key down events on the select */
|
|
139
|
+
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
140
|
+
/** Handle the menu opening */
|
|
141
|
+
onMenuOpen?: () => void;
|
|
142
|
+
/** Handle the menu closing */
|
|
143
|
+
onMenuClose?: () => void;
|
|
144
|
+
/** Fired when the user scrolls to the top of the menu */
|
|
145
|
+
onMenuScrollToTop?: (event?: WheelEvent | TouchEvent) => void;
|
|
146
|
+
/** Fired when the user scrolls to the bottom of the menu */
|
|
147
|
+
onMenuScrollToBottom?: (event?: WheelEvent | TouchEvent) => void;
|
|
148
|
+
/** Allows control of whether the menu is opened when the Select is focused */
|
|
149
|
+
openMenuOnFocus?: boolean;
|
|
150
|
+
/** Allows control of whether the menu is opened when the Select is clicked */
|
|
151
|
+
openMenuOnClick?: boolean;
|
|
152
|
+
/** Array of options that populate the select menu */
|
|
153
|
+
options?: OptionsOrGroups<Option, Group>;
|
|
154
|
+
/** Number of options to jump in menu when page{up|down} keys are used */
|
|
155
|
+
pageSize?: number;
|
|
156
|
+
/** Placeholder for the select value */
|
|
157
|
+
placeholder?: ReactNode;
|
|
158
|
+
/** Status to relay to screen readers */
|
|
159
|
+
screenReaderStatus?: (obj?: {
|
|
160
|
+
count?: number;
|
|
161
|
+
}) => string;
|
|
162
|
+
/**
|
|
163
|
+
* Style modifier methods
|
|
164
|
+
*
|
|
165
|
+
* A basic example can be found at the bottom of the [Replacing builtins](/advanced#replacing-builtins) documentation.
|
|
166
|
+
*/
|
|
167
|
+
styles?: StylesConfig;
|
|
168
|
+
/** Theme modifier method */
|
|
169
|
+
theme?: ThemeConfig;
|
|
170
|
+
/** Sets the tabIndex attribute on the input */
|
|
171
|
+
tabIndex?: number;
|
|
172
|
+
/** Select the currently focused option when the user presses tab */
|
|
173
|
+
tabSelectsValue?: boolean;
|
|
174
|
+
/** The value of the select; reflected by the selected option */
|
|
175
|
+
value?: PropsValue<Option>;
|
|
176
|
+
/** Sets the form attribute on the input */
|
|
177
|
+
form?: string;
|
|
178
|
+
/** Marks the value-holding input as required for form validation */
|
|
179
|
+
required?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export default function ertHackForSelect(_: NativeReactSelectProps): void;
|
|
182
|
+
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -26,14 +26,14 @@ export interface OptionProps<Option = OptionType, IsMulti extends boolean = fals
|
|
|
26
26
|
interface CustomSelectProps extends WithAnalyticsEventsProps {
|
|
27
27
|
/** This prop affects the height of the select control. Compact is gridSize() * 4, default is gridSize * 5 */
|
|
28
28
|
spacing?: 'compact' | 'default';
|
|
29
|
-
/** @deprecated Use isInvalid instead. The state of validation if used in a form. */
|
|
30
|
-
validationState?: ValidationState;
|
|
31
29
|
/** This prop affects the backgroundColor and border of the Select field. 'subtle' makes these transparent while 'none' removes them completely */
|
|
32
30
|
appearance?: 'default' | 'subtle' | 'none';
|
|
33
|
-
/** This prop indicates if the component is in an error state */
|
|
34
|
-
isInvalid?: boolean;
|
|
35
31
|
/** Prop for testing */
|
|
36
32
|
testId?: string;
|
|
33
|
+
/** This prop indicates if the component is in an error state */
|
|
34
|
+
isInvalid?: boolean;
|
|
35
|
+
/** @deprecated Use isInvalid instead. The state of validation if used in a form. */
|
|
36
|
+
validationState?: ValidationState;
|
|
37
37
|
}
|
|
38
38
|
export interface SelectProps<Option, IsMulti extends boolean = false> extends ReactSelectProps<Option, IsMulti>, CustomSelectProps {
|
|
39
39
|
}
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- API Report Version: 2.
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/select"
|
|
4
4
|
|
|
@@ -53,6 +53,7 @@ import { ReactNode } from 'react';
|
|
|
53
53
|
import { Props as ReactSelectProps } from 'react-select';
|
|
54
54
|
import { SelectComponents } from 'react-select/dist/declarations/src/components';
|
|
55
55
|
import { SelectComponentsConfig as SelectComponentsConfig_2 } from 'react-select';
|
|
56
|
+
import { SelectInstance } from 'react-select';
|
|
56
57
|
import { SingleValueProps } from 'react-select';
|
|
57
58
|
import { StylesConfig as StylesConfig_2 } from 'react-select';
|
|
58
59
|
import { UnbindFn } from 'bind-event-listener';
|
|
@@ -868,6 +869,8 @@ export type SelectComponentsConfig<
|
|
|
868
869
|
IsMulti extends boolean = false,
|
|
869
870
|
> = SelectComponentsConfig_2<Option, IsMulti, GroupType<Option>>;
|
|
870
871
|
|
|
872
|
+
export { SelectInstance };
|
|
873
|
+
|
|
871
874
|
// @public (undocumented)
|
|
872
875
|
export interface SelectProps<Option, IsMulti extends boolean = false>
|
|
873
876
|
extends ReactSelectProps<Option, IsMulti>,
|