@atlaskit/react-select 3.7.0 → 3.7.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 3.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`437668dfbdec9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/437668dfbdec9) -
|
|
8
|
+
Add explicit types to a number of DST components
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 3.7.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -17,6 +17,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
17
17
|
var _react2 = require("@compiled/react");
|
|
18
18
|
var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
|
|
19
19
|
var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _utils = require("../utils");
|
|
21
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
23
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -57,7 +58,7 @@ var MultiValueContainer = exports.MultiValueContainer = function MultiValueConta
|
|
|
57
58
|
xcss = _ref.xcss;
|
|
58
59
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, innerProps, {
|
|
59
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
60
|
-
className: (0, _runtime.ax)([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, multiValueStyles.refresh, (0, _react2.cx)(className, xcss, '-multiValue')])
|
|
61
|
+
className: (0, _runtime.ax)([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && multiValueStyles.refresh, (0, _react2.cx)(className, xcss, '-multiValue')])
|
|
61
62
|
}), children);
|
|
62
63
|
};
|
|
63
64
|
|
|
@@ -71,7 +72,7 @@ var MultiValueLabel = exports.MultiValueLabel = function MultiValueLabel(_ref2)
|
|
|
71
72
|
xcss = _ref2.xcss;
|
|
72
73
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, innerProps, {
|
|
73
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
74
|
-
className: (0, _runtime.ax)([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, multiValueLabelStyles.refresh, (0, _react2.cx)(className, xcss, '-MultiValueLabel')])
|
|
75
|
+
className: (0, _runtime.ax)([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && multiValueLabelStyles.refresh, (0, _react2.cx)(className, xcss, '-MultiValueLabel')])
|
|
75
76
|
}), children);
|
|
76
77
|
};
|
|
77
78
|
var disabledStyles = null;
|
|
@@ -84,7 +85,7 @@ function MultiValueRemove(_ref3) {
|
|
|
84
85
|
xcss = _ref3.xcss;
|
|
85
86
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, innerProps, {
|
|
86
87
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
87
|
-
className: (0, _runtime.ax)([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, multiValueRemoveStyles.refresh, (0, _react2.cx)(className, xcss, '-MultiValueRemove')])
|
|
88
|
+
className: (0, _runtime.ax)([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && multiValueRemoveStyles.refresh, (0, _react2.cx)(className, xcss, '-MultiValueRemove')])
|
|
88
89
|
}), /*#__PURE__*/React.createElement("div", {
|
|
89
90
|
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
|
|
90
91
|
className: (0, _runtime.ax)([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
|
|
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
7
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
8
8
|
import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { getStyleProps } from '../utils';
|
|
10
11
|
const multiValueStyles = {
|
|
11
12
|
root: "_2rkolb4i _1e0c1txw _1ul9ze3t _1pfhv77o _12l2v77o _6rthv77o _ahbqv77o _bfhkm7j4 _p12f1osq _syazjpor _3yq3glyw",
|
|
@@ -38,7 +39,7 @@ export const MultiValueContainer = ({
|
|
|
38
39
|
}) => {
|
|
39
40
|
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
40
41
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
41
|
-
className: ax([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, multiValueStyles.refresh, cx(className, xcss, '-multiValue')])
|
|
42
|
+
className: ax([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, fg('platform-component-visual-refresh') && multiValueStyles.refresh, cx(className, xcss, '-multiValue')])
|
|
42
43
|
}), children);
|
|
43
44
|
};
|
|
44
45
|
|
|
@@ -53,7 +54,7 @@ export const MultiValueLabel = ({
|
|
|
53
54
|
}) => {
|
|
54
55
|
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
55
56
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
56
|
-
className: ax([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, multiValueLabelStyles.refresh, cx(className, xcss, '-MultiValueLabel')])
|
|
57
|
+
className: ax([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, fg('platform-component-visual-refresh') && multiValueLabelStyles.refresh, cx(className, xcss, '-MultiValueLabel')])
|
|
57
58
|
}), children);
|
|
58
59
|
};
|
|
59
60
|
const disabledStyles = null;
|
|
@@ -67,7 +68,7 @@ export function MultiValueRemove({
|
|
|
67
68
|
}) {
|
|
68
69
|
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
69
70
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
70
|
-
className: ax([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, multiValueRemoveStyles.refresh, cx(className, xcss, '-MultiValueRemove')])
|
|
71
|
+
className: ax([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, fg('platform-component-visual-refresh') && multiValueRemoveStyles.refresh, cx(className, xcss, '-MultiValueRemove')])
|
|
71
72
|
}), /*#__PURE__*/React.createElement("div", {
|
|
72
73
|
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
|
|
73
74
|
className: ax([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
|
|
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
import { cx } from '@compiled/react';
|
|
10
10
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
11
11
|
import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { getStyleProps } from '../utils';
|
|
13
14
|
var multiValueStyles = {
|
|
14
15
|
root: "_2rkolb4i _1e0c1txw _1ul9ze3t _1pfhv77o _12l2v77o _6rthv77o _ahbqv77o _bfhkm7j4 _p12f1osq _syazjpor _3yq3glyw",
|
|
@@ -46,7 +47,7 @@ export var MultiValueContainer = function MultiValueContainer(_ref) {
|
|
|
46
47
|
xcss = _ref.xcss;
|
|
47
48
|
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
48
49
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
49
|
-
className: ax([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, multiValueStyles.refresh, cx(className, xcss, '-multiValue')])
|
|
50
|
+
className: ax([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, fg('platform-component-visual-refresh') && multiValueStyles.refresh, cx(className, xcss, '-multiValue')])
|
|
50
51
|
}), children);
|
|
51
52
|
};
|
|
52
53
|
|
|
@@ -60,7 +61,7 @@ export var MultiValueLabel = function MultiValueLabel(_ref2) {
|
|
|
60
61
|
xcss = _ref2.xcss;
|
|
61
62
|
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
62
63
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
63
|
-
className: ax([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, multiValueLabelStyles.refresh, cx(className, xcss, '-MultiValueLabel')])
|
|
64
|
+
className: ax([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, fg('platform-component-visual-refresh') && multiValueLabelStyles.refresh, cx(className, xcss, '-MultiValueLabel')])
|
|
64
65
|
}), children);
|
|
65
66
|
};
|
|
66
67
|
var disabledStyles = null;
|
|
@@ -73,7 +74,7 @@ export function MultiValueRemove(_ref3) {
|
|
|
73
74
|
xcss = _ref3.xcss;
|
|
74
75
|
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
75
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
76
|
-
className: ax([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, multiValueRemoveStyles.refresh, cx(className, xcss, '-MultiValueRemove')])
|
|
77
|
+
className: ax([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, fg('platform-component-visual-refresh') && multiValueRemoveStyles.refresh, cx(className, xcss, '-MultiValueRemove')])
|
|
77
78
|
}), /*#__PURE__*/React.createElement("div", {
|
|
78
79
|
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
|
|
79
80
|
className: ax([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
|
package/dist/types/select.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type AriaAttributes, Component, type FocusEventHandler, type FormEventHandler, type KeyboardEventHandler, type MouseEventHandler, type ReactNode, type RefCallback, type TouchEventHandler } from 'react';
|
|
2
2
|
import { type AriaLiveMessages, type AriaSelection } from './accessibility';
|
|
3
|
-
import { type SelectComponentsConfig } from './components';
|
|
3
|
+
import { defaultComponents, type SelectComponentsConfig } from './components';
|
|
4
4
|
import { type FilterOptionOption } from './filters';
|
|
5
5
|
import { type ClassNamesConfig, type StylesConfig, type StylesProps } from './styles';
|
|
6
|
-
import { type ActionMeta, type FocusDirection, type GetOptionLabel, type GetOptionValue, type GroupBase, type InputActionMeta, type MenuPlacement, type MenuPosition, type OnChangeValue, type Options, type OptionsOrGroups, type PropsValue, type SetValueAction } from './types';
|
|
6
|
+
import { type ActionMeta, type CommonProps, type FocusDirection, type GetOptionLabel, type GetOptionValue, type GroupBase, type InputActionMeta, type MenuPlacement, type MenuPosition, type OnChangeValue, type Options, type OptionsOrGroups, type PropsValue, type SetValueAction } from './types';
|
|
7
7
|
export type FormatOptionLabelContext = 'menu' | 'value';
|
|
8
8
|
export interface FormatOptionLabelMeta<Option> {
|
|
9
9
|
context: FormatOptionLabelContext;
|
|
@@ -438,50 +438,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
438
438
|
*/
|
|
439
439
|
shouldKeepInputOnSelect?: boolean;
|
|
440
440
|
}
|
|
441
|
-
export declare const defaultProps:
|
|
442
|
-
backspaceRemovesValue: boolean;
|
|
443
|
-
blurInputOnSelect: boolean;
|
|
444
|
-
captureMenuScroll: boolean;
|
|
445
|
-
classNames: {};
|
|
446
|
-
closeMenuOnSelect: boolean;
|
|
447
|
-
closeMenuOnScroll: boolean;
|
|
448
|
-
components: {};
|
|
449
|
-
controlShouldRenderValue: boolean;
|
|
450
|
-
escapeClearsValue: boolean;
|
|
451
|
-
filterOption: (option: FilterOptionOption<unknown>, rawInput: string) => boolean;
|
|
452
|
-
formatGroupLabel: <Option, Group extends GroupBase<Option>>(group: Group) => string;
|
|
453
|
-
getOptionLabel: <Option>(option: Option) => string;
|
|
454
|
-
getOptionValue: <Option>(option: Option) => string;
|
|
455
|
-
isDisabled: boolean;
|
|
456
|
-
isLoading: boolean;
|
|
457
|
-
isMulti: boolean;
|
|
458
|
-
isRtl: boolean;
|
|
459
|
-
isSearchable: boolean;
|
|
460
|
-
isOptionDisabled: <Option>(option: Option) => boolean;
|
|
461
|
-
loadingMessage: () => string;
|
|
462
|
-
maxMenuHeight: number;
|
|
463
|
-
minMenuHeight: number;
|
|
464
|
-
menuIsOpen: boolean;
|
|
465
|
-
menuPlacement: string;
|
|
466
|
-
menuPosition: string;
|
|
467
|
-
menuShouldBlockScroll: boolean;
|
|
468
|
-
menuShouldScrollIntoView: boolean;
|
|
469
|
-
noOptionsMessage: () => string;
|
|
470
|
-
openMenuOnFocus: boolean;
|
|
471
|
-
openMenuOnClick: boolean;
|
|
472
|
-
shouldPreventEscapePropagation: boolean;
|
|
473
|
-
options: never[];
|
|
474
|
-
pageSize: number;
|
|
475
|
-
placeholder: string;
|
|
476
|
-
screenReaderStatus: ({ count }: {
|
|
477
|
-
count: number;
|
|
478
|
-
}) => string;
|
|
479
|
-
styles: {};
|
|
480
|
-
tabIndex: number;
|
|
481
|
-
tabSelectsValue: boolean;
|
|
482
|
-
UNSAFE_is_experimental_generic: boolean;
|
|
483
|
-
shouldKeepInputOnSelect: boolean;
|
|
484
|
-
};
|
|
441
|
+
export declare const defaultProps: Omit<SelectProps<unknown, false, GroupBase<unknown>>, 'inputValue' | 'onChange' | 'onInputChange' | 'onMenuOpen' | 'onMenuClose' | 'value' | 'appearance'>;
|
|
485
442
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
486
443
|
ariaSelection: AriaSelection<Option, IsMulti> | null;
|
|
487
444
|
inputIsHidden: boolean;
|
|
@@ -519,50 +476,7 @@ interface CategorizedGroup<Option, Group extends GroupBase<Option>> {
|
|
|
519
476
|
}
|
|
520
477
|
type CategorizedGroupOrOption<Option, Group extends GroupBase<Option>> = CategorizedGroup<Option, Group> | CategorizedOption<Option>;
|
|
521
478
|
export default class Select<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends Component<SelectProps<Option, IsMulti, Group>, State<Option, IsMulti, Group>> {
|
|
522
|
-
static defaultProps:
|
|
523
|
-
backspaceRemovesValue: boolean;
|
|
524
|
-
blurInputOnSelect: boolean;
|
|
525
|
-
captureMenuScroll: boolean;
|
|
526
|
-
classNames: {};
|
|
527
|
-
closeMenuOnSelect: boolean;
|
|
528
|
-
closeMenuOnScroll: boolean;
|
|
529
|
-
components: {};
|
|
530
|
-
controlShouldRenderValue: boolean;
|
|
531
|
-
escapeClearsValue: boolean;
|
|
532
|
-
filterOption: (option: FilterOptionOption<unknown>, rawInput: string) => boolean;
|
|
533
|
-
formatGroupLabel: <Option_1, Group_1 extends GroupBase<Option_1>>(group: Group_1) => string;
|
|
534
|
-
getOptionLabel: <Option_1>(option: Option_1) => string;
|
|
535
|
-
getOptionValue: <Option_1>(option: Option_1) => string;
|
|
536
|
-
isDisabled: boolean;
|
|
537
|
-
isLoading: boolean;
|
|
538
|
-
isMulti: boolean;
|
|
539
|
-
isRtl: boolean;
|
|
540
|
-
isSearchable: boolean;
|
|
541
|
-
isOptionDisabled: <Option_1>(option: Option_1) => boolean;
|
|
542
|
-
loadingMessage: () => string;
|
|
543
|
-
maxMenuHeight: number;
|
|
544
|
-
minMenuHeight: number;
|
|
545
|
-
menuIsOpen: boolean;
|
|
546
|
-
menuPlacement: string;
|
|
547
|
-
menuPosition: string;
|
|
548
|
-
menuShouldBlockScroll: boolean;
|
|
549
|
-
menuShouldScrollIntoView: boolean;
|
|
550
|
-
noOptionsMessage: () => string;
|
|
551
|
-
openMenuOnFocus: boolean;
|
|
552
|
-
openMenuOnClick: boolean;
|
|
553
|
-
shouldPreventEscapePropagation: boolean;
|
|
554
|
-
options: never[];
|
|
555
|
-
pageSize: number;
|
|
556
|
-
placeholder: string;
|
|
557
|
-
screenReaderStatus: ({ count }: {
|
|
558
|
-
count: number;
|
|
559
|
-
}) => string;
|
|
560
|
-
styles: {};
|
|
561
|
-
tabIndex: number;
|
|
562
|
-
tabSelectsValue: boolean;
|
|
563
|
-
UNSAFE_is_experimental_generic: boolean;
|
|
564
|
-
shouldKeepInputOnSelect: boolean;
|
|
565
|
-
};
|
|
479
|
+
static defaultProps: typeof defaultProps;
|
|
566
480
|
state: State<Option, IsMulti, Group>;
|
|
567
481
|
blockOptionHover: boolean;
|
|
568
482
|
isComposing: boolean;
|
|
@@ -619,49 +533,13 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
619
533
|
getFocusableOptionsWithIds: () => FocusableOptionWithId<Option>[];
|
|
620
534
|
getValue: () => Options<Option>;
|
|
621
535
|
cx: (...args: any) => string;
|
|
622
|
-
getCommonProps():
|
|
623
|
-
clearValue: () => void;
|
|
624
|
-
cx: (...args: any) => string;
|
|
625
|
-
getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => any;
|
|
626
|
-
getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
|
|
627
|
-
getValue: () => Options<Option>;
|
|
628
|
-
hasValue: boolean;
|
|
629
|
-
isMulti: IsMulti;
|
|
630
|
-
isRtl: boolean;
|
|
631
|
-
options: OptionsOrGroups<Option, Group>;
|
|
632
|
-
selectOption: (newValue: Option) => void;
|
|
633
|
-
selectProps: Readonly<SelectProps<Option, IsMulti, Group>>;
|
|
634
|
-
setValue: (newValue: OnChangeValue<Option, IsMulti>, action: SetValueAction, option?: Option) => void;
|
|
635
|
-
};
|
|
536
|
+
getCommonProps(): CommonProps<Option, IsMulti, Group>;
|
|
636
537
|
getOptionLabel: (data: Option) => string;
|
|
637
538
|
getOptionValue: (data: Option) => string;
|
|
638
539
|
getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => any;
|
|
639
540
|
getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
|
|
640
541
|
getElementId: (element: "group" | "input" | "listbox" | "option" | "placeholder" | "live-region" | "multi-message" | "single-value" | "selected-value") => string;
|
|
641
|
-
getComponents: () =>
|
|
642
|
-
ClearIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ClearIndicatorProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
643
|
-
Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ControlProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
644
|
-
DropdownIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").DropdownIndicatorProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
645
|
-
Group: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").GroupProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
646
|
-
GroupHeading: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").GroupHeadingProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
647
|
-
IndicatorsContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").IndicatorsContainerProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
648
|
-
Input: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").InputProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
649
|
-
LoadingIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ innerProps, isRtl, size, isCompact, xcss, ...restProps }: import(".").LoadingIndicatorProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
650
|
-
Menu: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("./components/menu").MenuProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
651
|
-
MenuList: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("./components/menu").MenuListProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
652
|
-
MenuPortal: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("./components/menu").MenuPortalProps<Option_1, IsMulti_1, Group_1>) => JSX.Element | null;
|
|
653
|
-
LoadingMessage: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, xcss, ...restProps }: import("./components/menu").NoticeProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
654
|
-
NoOptionsMessage: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, xcss, ...restProps }: import("./components/menu").NoticeProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
655
|
-
MultiValue: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").MultiValueProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
656
|
-
MultiValueContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, isFocused, isDisabled, className, xcss, }: import(".").MultiValueGenericProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
657
|
-
MultiValueLabel: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, isDisabled, hasEllipsis, className, xcss, }: import(".").MultiValueGenericProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
658
|
-
MultiValueRemove: typeof import("./components/multi-value").MultiValueRemove;
|
|
659
|
-
Option: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").OptionProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
660
|
-
Placeholder: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").PlaceholderProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
661
|
-
SelectContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ContainerProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
662
|
-
SingleValue: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").SingleValueProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
663
|
-
ValueContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ValueContainerProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
664
|
-
};
|
|
542
|
+
getComponents: () => ReturnType<typeof defaultComponents>;
|
|
665
543
|
buildCategorizedOptions: () => CategorizedGroupOrOption<Option, Group>[];
|
|
666
544
|
getCategorizedOptions: () => CategorizedGroupOrOption<Option, Group>[];
|
|
667
545
|
buildFocusableOptions: () => Option[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type AriaAttributes, Component, type FocusEventHandler, type FormEventHandler, type KeyboardEventHandler, type MouseEventHandler, type ReactNode, type RefCallback, type TouchEventHandler } from 'react';
|
|
2
2
|
import { type AriaLiveMessages, type AriaSelection } from './accessibility';
|
|
3
|
-
import { type SelectComponentsConfig } from './components';
|
|
3
|
+
import { defaultComponents, type SelectComponentsConfig } from './components';
|
|
4
4
|
import { type FilterOptionOption } from './filters';
|
|
5
5
|
import { type ClassNamesConfig, type StylesConfig, type StylesProps } from './styles';
|
|
6
|
-
import { type ActionMeta, type FocusDirection, type GetOptionLabel, type GetOptionValue, type GroupBase, type InputActionMeta, type MenuPlacement, type MenuPosition, type OnChangeValue, type Options, type OptionsOrGroups, type PropsValue, type SetValueAction } from './types';
|
|
6
|
+
import { type ActionMeta, type CommonProps, type FocusDirection, type GetOptionLabel, type GetOptionValue, type GroupBase, type InputActionMeta, type MenuPlacement, type MenuPosition, type OnChangeValue, type Options, type OptionsOrGroups, type PropsValue, type SetValueAction } from './types';
|
|
7
7
|
export type FormatOptionLabelContext = 'menu' | 'value';
|
|
8
8
|
export interface FormatOptionLabelMeta<Option> {
|
|
9
9
|
context: FormatOptionLabelContext;
|
|
@@ -438,50 +438,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
|
|
|
438
438
|
*/
|
|
439
439
|
shouldKeepInputOnSelect?: boolean;
|
|
440
440
|
}
|
|
441
|
-
export declare const defaultProps:
|
|
442
|
-
backspaceRemovesValue: boolean;
|
|
443
|
-
blurInputOnSelect: boolean;
|
|
444
|
-
captureMenuScroll: boolean;
|
|
445
|
-
classNames: {};
|
|
446
|
-
closeMenuOnSelect: boolean;
|
|
447
|
-
closeMenuOnScroll: boolean;
|
|
448
|
-
components: {};
|
|
449
|
-
controlShouldRenderValue: boolean;
|
|
450
|
-
escapeClearsValue: boolean;
|
|
451
|
-
filterOption: (option: FilterOptionOption<unknown>, rawInput: string) => boolean;
|
|
452
|
-
formatGroupLabel: <Option, Group extends GroupBase<Option>>(group: Group) => string;
|
|
453
|
-
getOptionLabel: <Option>(option: Option) => string;
|
|
454
|
-
getOptionValue: <Option>(option: Option) => string;
|
|
455
|
-
isDisabled: boolean;
|
|
456
|
-
isLoading: boolean;
|
|
457
|
-
isMulti: boolean;
|
|
458
|
-
isRtl: boolean;
|
|
459
|
-
isSearchable: boolean;
|
|
460
|
-
isOptionDisabled: <Option>(option: Option) => boolean;
|
|
461
|
-
loadingMessage: () => string;
|
|
462
|
-
maxMenuHeight: number;
|
|
463
|
-
minMenuHeight: number;
|
|
464
|
-
menuIsOpen: boolean;
|
|
465
|
-
menuPlacement: string;
|
|
466
|
-
menuPosition: string;
|
|
467
|
-
menuShouldBlockScroll: boolean;
|
|
468
|
-
menuShouldScrollIntoView: boolean;
|
|
469
|
-
noOptionsMessage: () => string;
|
|
470
|
-
openMenuOnFocus: boolean;
|
|
471
|
-
openMenuOnClick: boolean;
|
|
472
|
-
shouldPreventEscapePropagation: boolean;
|
|
473
|
-
options: never[];
|
|
474
|
-
pageSize: number;
|
|
475
|
-
placeholder: string;
|
|
476
|
-
screenReaderStatus: ({ count }: {
|
|
477
|
-
count: number;
|
|
478
|
-
}) => string;
|
|
479
|
-
styles: {};
|
|
480
|
-
tabIndex: number;
|
|
481
|
-
tabSelectsValue: boolean;
|
|
482
|
-
UNSAFE_is_experimental_generic: boolean;
|
|
483
|
-
shouldKeepInputOnSelect: boolean;
|
|
484
|
-
};
|
|
441
|
+
export declare const defaultProps: Omit<SelectProps<unknown, false, GroupBase<unknown>>, 'inputValue' | 'onChange' | 'onInputChange' | 'onMenuOpen' | 'onMenuClose' | 'value' | 'appearance'>;
|
|
485
442
|
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
486
443
|
ariaSelection: AriaSelection<Option, IsMulti> | null;
|
|
487
444
|
inputIsHidden: boolean;
|
|
@@ -519,50 +476,7 @@ interface CategorizedGroup<Option, Group extends GroupBase<Option>> {
|
|
|
519
476
|
}
|
|
520
477
|
type CategorizedGroupOrOption<Option, Group extends GroupBase<Option>> = CategorizedGroup<Option, Group> | CategorizedOption<Option>;
|
|
521
478
|
export default class Select<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends Component<SelectProps<Option, IsMulti, Group>, State<Option, IsMulti, Group>> {
|
|
522
|
-
static defaultProps:
|
|
523
|
-
backspaceRemovesValue: boolean;
|
|
524
|
-
blurInputOnSelect: boolean;
|
|
525
|
-
captureMenuScroll: boolean;
|
|
526
|
-
classNames: {};
|
|
527
|
-
closeMenuOnSelect: boolean;
|
|
528
|
-
closeMenuOnScroll: boolean;
|
|
529
|
-
components: {};
|
|
530
|
-
controlShouldRenderValue: boolean;
|
|
531
|
-
escapeClearsValue: boolean;
|
|
532
|
-
filterOption: (option: FilterOptionOption<unknown>, rawInput: string) => boolean;
|
|
533
|
-
formatGroupLabel: <Option_1, Group_1 extends GroupBase<Option_1>>(group: Group_1) => string;
|
|
534
|
-
getOptionLabel: <Option_1>(option: Option_1) => string;
|
|
535
|
-
getOptionValue: <Option_1>(option: Option_1) => string;
|
|
536
|
-
isDisabled: boolean;
|
|
537
|
-
isLoading: boolean;
|
|
538
|
-
isMulti: boolean;
|
|
539
|
-
isRtl: boolean;
|
|
540
|
-
isSearchable: boolean;
|
|
541
|
-
isOptionDisabled: <Option_1>(option: Option_1) => boolean;
|
|
542
|
-
loadingMessage: () => string;
|
|
543
|
-
maxMenuHeight: number;
|
|
544
|
-
minMenuHeight: number;
|
|
545
|
-
menuIsOpen: boolean;
|
|
546
|
-
menuPlacement: string;
|
|
547
|
-
menuPosition: string;
|
|
548
|
-
menuShouldBlockScroll: boolean;
|
|
549
|
-
menuShouldScrollIntoView: boolean;
|
|
550
|
-
noOptionsMessage: () => string;
|
|
551
|
-
openMenuOnFocus: boolean;
|
|
552
|
-
openMenuOnClick: boolean;
|
|
553
|
-
shouldPreventEscapePropagation: boolean;
|
|
554
|
-
options: never[];
|
|
555
|
-
pageSize: number;
|
|
556
|
-
placeholder: string;
|
|
557
|
-
screenReaderStatus: ({ count }: {
|
|
558
|
-
count: number;
|
|
559
|
-
}) => string;
|
|
560
|
-
styles: {};
|
|
561
|
-
tabIndex: number;
|
|
562
|
-
tabSelectsValue: boolean;
|
|
563
|
-
UNSAFE_is_experimental_generic: boolean;
|
|
564
|
-
shouldKeepInputOnSelect: boolean;
|
|
565
|
-
};
|
|
479
|
+
static defaultProps: typeof defaultProps;
|
|
566
480
|
state: State<Option, IsMulti, Group>;
|
|
567
481
|
blockOptionHover: boolean;
|
|
568
482
|
isComposing: boolean;
|
|
@@ -619,49 +533,13 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
|
|
|
619
533
|
getFocusableOptionsWithIds: () => FocusableOptionWithId<Option>[];
|
|
620
534
|
getValue: () => Options<Option>;
|
|
621
535
|
cx: (...args: any) => string;
|
|
622
|
-
getCommonProps():
|
|
623
|
-
clearValue: () => void;
|
|
624
|
-
cx: (...args: any) => string;
|
|
625
|
-
getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => any;
|
|
626
|
-
getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
|
|
627
|
-
getValue: () => Options<Option>;
|
|
628
|
-
hasValue: boolean;
|
|
629
|
-
isMulti: IsMulti;
|
|
630
|
-
isRtl: boolean;
|
|
631
|
-
options: OptionsOrGroups<Option, Group>;
|
|
632
|
-
selectOption: (newValue: Option) => void;
|
|
633
|
-
selectProps: Readonly<SelectProps<Option, IsMulti, Group>>;
|
|
634
|
-
setValue: (newValue: OnChangeValue<Option, IsMulti>, action: SetValueAction, option?: Option) => void;
|
|
635
|
-
};
|
|
536
|
+
getCommonProps(): CommonProps<Option, IsMulti, Group>;
|
|
636
537
|
getOptionLabel: (data: Option) => string;
|
|
637
538
|
getOptionValue: (data: Option) => string;
|
|
638
539
|
getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => any;
|
|
639
540
|
getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
|
|
640
541
|
getElementId: (element: "group" | "input" | "listbox" | "option" | "placeholder" | "live-region" | "multi-message" | "single-value" | "selected-value") => string;
|
|
641
|
-
getComponents: () =>
|
|
642
|
-
ClearIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ClearIndicatorProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
643
|
-
Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ControlProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
644
|
-
DropdownIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").DropdownIndicatorProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
645
|
-
Group: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").GroupProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
646
|
-
GroupHeading: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").GroupHeadingProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
647
|
-
IndicatorsContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").IndicatorsContainerProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
648
|
-
Input: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").InputProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
649
|
-
LoadingIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ innerProps, isRtl, size, isCompact, xcss, ...restProps }: import(".").LoadingIndicatorProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
650
|
-
Menu: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("./components/menu").MenuProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
651
|
-
MenuList: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("./components/menu").MenuListProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
652
|
-
MenuPortal: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("./components/menu").MenuPortalProps<Option_1, IsMulti_1, Group_1>) => JSX.Element | null;
|
|
653
|
-
LoadingMessage: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, xcss, ...restProps }: import("./components/menu").NoticeProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
654
|
-
NoOptionsMessage: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, xcss, ...restProps }: import("./components/menu").NoticeProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
655
|
-
MultiValue: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").MultiValueProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
656
|
-
MultiValueContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, isFocused, isDisabled, className, xcss, }: import(".").MultiValueGenericProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
657
|
-
MultiValueLabel: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>({ children, innerProps, isDisabled, hasEllipsis, className, xcss, }: import(".").MultiValueGenericProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
658
|
-
MultiValueRemove: typeof import("./components/multi-value").MultiValueRemove;
|
|
659
|
-
Option: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").OptionProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
660
|
-
Placeholder: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").PlaceholderProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
661
|
-
SelectContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ContainerProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
662
|
-
SingleValue: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").SingleValueProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
663
|
-
ValueContainer: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ValueContainerProps<Option_1, IsMulti_1, Group_1>) => JSX.Element;
|
|
664
|
-
};
|
|
542
|
+
getComponents: () => ReturnType<typeof defaultComponents>;
|
|
665
543
|
buildCategorizedOptions: () => CategorizedGroupOrOption<Option, Group>[];
|
|
666
544
|
getCategorizedOptions: () => CategorizedGroupOrOption<Option, Group>[];
|
|
667
545
|
buildFocusableOptions: () => Option[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.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",
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
"custom-interactive-elements-not-keyboard-focusable": {
|
|
50
50
|
"type": "boolean"
|
|
51
51
|
},
|
|
52
|
+
"platform-component-visual-refresh": {
|
|
53
|
+
"type": "boolean"
|
|
54
|
+
},
|
|
52
55
|
"platform_design_system_team_safari_input_fix": {
|
|
53
56
|
"type": "boolean"
|
|
54
57
|
},
|