@atlaskit/react-select 2.0.2 → 2.0.3
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/components/index.js +2 -0
- package/dist/cjs/components/menu.js +1 -3
- package/dist/cjs/components/multi-value.js +2 -2
- package/dist/cjs/use-state-manager.js +2 -0
- package/dist/cjs/utils.js +1 -13
- package/dist/es2019/components/index.js +3 -0
- package/dist/es2019/components/menu.js +1 -1
- package/dist/es2019/components/multi-value.js +1 -1
- package/dist/es2019/use-state-manager.js +3 -0
- package/dist/es2019/utils.js +1 -9
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/components/menu.js +1 -1
- package/dist/esm/components/multi-value.js +1 -1
- package/dist/esm/use-state-manager.js +3 -0
- package/dist/esm/utils.js +1 -11
- package/dist/types/components/group.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/input.d.ts +1 -1
- package/dist/types/components/live-region.d.ts +1 -1
- package/dist/types/components/menu.d.ts +2 -16
- package/dist/types/components/multi-value.d.ts +0 -1
- package/dist/types/state-manager.d.ts +0 -1
- package/dist/types/use-creatable.d.ts +1 -1
- package/dist/types/utils.d.ts +0 -10
- package/dist/types-ts4.5/components/group.d.ts +1 -1
- package/dist/types-ts4.5/components/index.d.ts +1 -1
- package/dist/types-ts4.5/components/input.d.ts +1 -1
- package/dist/types-ts4.5/components/live-region.d.ts +1 -1
- package/dist/types-ts4.5/components/menu.d.ts +2 -16
- package/dist/types-ts4.5/components/multi-value.d.ts +0 -1
- package/dist/types-ts4.5/state-manager.d.ts +0 -1
- package/dist/types-ts4.5/use-creatable.d.ts +1 -1
- package/dist/types-ts4.5/utils.d.ts +0 -10
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#120299](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120299)
|
|
8
|
+
[`8e94f6d9a4d9f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e94f6d9a4d9f) -
|
|
9
|
+
Remove unused internal exports and functions and update dependencies.
|
|
10
|
+
|
|
3
11
|
## 2.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
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; }
|
|
23
23
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
// Required export for external packages
|
|
25
|
+
|
|
24
26
|
var components = exports.components = {
|
|
25
27
|
ClearIndicator: _indicators.ClearIndicator,
|
|
26
28
|
Control: _control.default,
|
|
@@ -4,9 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = exports.NoOptionsMessage = exports.MenuPortal = exports.MenuPlacer = exports.MenuList = exports.LoadingMessage = void 0;
|
|
8
|
-
exports.getMenuPlacement = getMenuPlacement;
|
|
9
|
-
exports.noOptionsMessageCSS = exports.menuPortalCSS = exports.menuListCSS = exports.menuCSS = exports.loadingMessageCSS = void 0;
|
|
7
|
+
exports.noOptionsMessageCSS = exports.menuPortalCSS = exports.menuListCSS = exports.menuCSS = exports.loadingMessageCSS = exports.default = exports.NoOptionsMessage = exports.MenuPortal = exports.MenuPlacer = exports.MenuList = exports.LoadingMessage = void 0;
|
|
10
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
9
|
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
12
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.MultiValueLabel = exports.
|
|
7
|
+
exports.MultiValueLabel = exports.MultiValueContainer = void 0;
|
|
8
8
|
exports.MultiValueRemove = MultiValueRemove;
|
|
9
9
|
exports.multiValueRemoveCSS = exports.multiValueLabelCSS = exports.multiValueCSS = exports.default = void 0;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -123,7 +123,7 @@ var multiValueRemoveCSS = exports.multiValueRemoveCSS = function multiValueRemov
|
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
125
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
126
|
-
var MultiValueGeneric =
|
|
126
|
+
var MultiValueGeneric = function MultiValueGeneric(_ref4) {
|
|
127
127
|
var children = _ref4.children,
|
|
128
128
|
innerProps = _ref4.innerProps;
|
|
129
129
|
return (0, _react.jsx)("div", innerProps, children);
|
|
@@ -12,6 +12,8 @@ var _react = require("react");
|
|
|
12
12
|
var _excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
|
|
13
13
|
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; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
// Export required for downstream consumers
|
|
16
|
+
|
|
15
17
|
// TODO: Fill in the hook {description}.
|
|
16
18
|
/**
|
|
17
19
|
* {description}.
|
package/dist/cjs/utils.js
CHANGED
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.animatedScrollTo = animatedScrollTo;
|
|
8
8
|
exports.classNames = classNames;
|
|
9
|
-
exports.
|
|
9
|
+
exports.cleanValue = exports.cleanCommonProps = void 0;
|
|
10
10
|
exports.getBoundingClientObj = getBoundingClientObj;
|
|
11
11
|
exports.getScrollParent = getScrollParent;
|
|
12
12
|
exports.getScrollTop = getScrollTop;
|
|
13
13
|
exports.getStyleProps = void 0;
|
|
14
14
|
exports.handleInputChange = handleInputChange;
|
|
15
|
-
exports.isArray = isArray;
|
|
16
15
|
exports.isDocumentElement = isDocumentElement;
|
|
17
16
|
exports.isMobileDevice = isMobileDevice;
|
|
18
17
|
exports.isTouchCapable = isTouchCapable;
|
|
@@ -25,7 +24,6 @@ exports.scrollIntoView = scrollIntoView;
|
|
|
25
24
|
exports.scrollTo = scrollTo;
|
|
26
25
|
exports.singleValueAsValue = singleValueAsValue;
|
|
27
26
|
exports.supportsPassiveEvents = void 0;
|
|
28
|
-
exports.toKey = toKey;
|
|
29
27
|
exports.valueTernary = valueTernary;
|
|
30
28
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
31
29
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -39,9 +37,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
39
37
|
// ==============================
|
|
40
38
|
|
|
41
39
|
var noop = exports.noop = function noop() {};
|
|
42
|
-
var emptyString = exports.emptyString = function emptyString() {
|
|
43
|
-
return '';
|
|
44
|
-
};
|
|
45
40
|
|
|
46
41
|
// ==============================
|
|
47
42
|
// Class Name Prefixer
|
|
@@ -269,13 +264,6 @@ function getBoundingClientObj(element) {
|
|
|
269
264
|
width: rect.width
|
|
270
265
|
};
|
|
271
266
|
}
|
|
272
|
-
// ==============================
|
|
273
|
-
// String to Key (kebabify)
|
|
274
|
-
// ==============================
|
|
275
|
-
|
|
276
|
-
function toKey(str) {
|
|
277
|
-
return str.replace(/\W/g, '-');
|
|
278
|
-
}
|
|
279
267
|
|
|
280
268
|
// ==============================
|
|
281
269
|
// Touch Capability Detector
|
|
@@ -8,6 +8,9 @@ import MultiValue, { MultiValueContainer, MultiValueLabel, MultiValueRemove } fr
|
|
|
8
8
|
import Option from './option';
|
|
9
9
|
import Placeholder from './placeholder';
|
|
10
10
|
import SingleValue from './single-value';
|
|
11
|
+
|
|
12
|
+
// Required export for external packages
|
|
13
|
+
|
|
11
14
|
export const components = {
|
|
12
15
|
ClearIndicator: ClearIndicator,
|
|
13
16
|
Control: Control,
|
|
@@ -19,7 +19,7 @@ import { animatedScrollTo, getBoundingClientObj, getScrollParent, getScrollTop,
|
|
|
19
19
|
// Get Menu Placement
|
|
20
20
|
// ------------------------------
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
function getMenuPlacement({
|
|
23
23
|
maxHeight: preferredMaxHeight,
|
|
24
24
|
menuEl,
|
|
25
25
|
minHeight,
|
|
@@ -115,7 +115,7 @@ export const multiValueRemoveCSS = ({
|
|
|
115
115
|
})
|
|
116
116
|
});
|
|
117
117
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
118
|
-
|
|
118
|
+
const MultiValueGeneric = ({
|
|
119
119
|
children,
|
|
120
120
|
innerProps
|
|
121
121
|
}) => jsx("div", innerProps, children);
|
package/dist/es2019/utils.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// ==============================
|
|
4
4
|
|
|
5
5
|
export const noop = () => {};
|
|
6
|
-
export const emptyString = () => '';
|
|
7
6
|
|
|
8
7
|
// ==============================
|
|
9
8
|
// Class Name Prefixer
|
|
@@ -230,13 +229,6 @@ export function getBoundingClientObj(element) {
|
|
|
230
229
|
width: rect.width
|
|
231
230
|
};
|
|
232
231
|
}
|
|
233
|
-
// ==============================
|
|
234
|
-
// String to Key (kebabify)
|
|
235
|
-
// ==============================
|
|
236
|
-
|
|
237
|
-
export function toKey(str) {
|
|
238
|
-
return str.replace(/\W/g, '-');
|
|
239
|
-
}
|
|
240
232
|
|
|
241
233
|
// ==============================
|
|
242
234
|
// Touch Capability Detector
|
|
@@ -286,7 +278,7 @@ export const supportsPassiveEvents = passiveOptionAccessed;
|
|
|
286
278
|
export function notNullish(item) {
|
|
287
279
|
return item != null;
|
|
288
280
|
}
|
|
289
|
-
|
|
281
|
+
function isArray(arg) {
|
|
290
282
|
return Array.isArray(arg);
|
|
291
283
|
}
|
|
292
284
|
export function valueTernary(isMulti, multiValue, singleValue) {
|
|
@@ -11,6 +11,9 @@ import MultiValue, { MultiValueContainer, MultiValueLabel, MultiValueRemove } fr
|
|
|
11
11
|
import Option from './option';
|
|
12
12
|
import Placeholder from './placeholder';
|
|
13
13
|
import SingleValue from './single-value';
|
|
14
|
+
|
|
15
|
+
// Required export for external packages
|
|
16
|
+
|
|
14
17
|
export var components = {
|
|
15
18
|
ClearIndicator: ClearIndicator,
|
|
16
19
|
Control: Control,
|
|
@@ -27,7 +27,7 @@ import { animatedScrollTo, getBoundingClientObj, getScrollParent, getScrollTop,
|
|
|
27
27
|
// Get Menu Placement
|
|
28
28
|
// ------------------------------
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
function getMenuPlacement(_ref) {
|
|
31
31
|
var preferredMaxHeight = _ref.maxHeight,
|
|
32
32
|
menuEl = _ref.menuEl,
|
|
33
33
|
minHeight = _ref.minHeight,
|
|
@@ -116,7 +116,7 @@ export var multiValueRemoveCSS = function multiValueRemoveCSS(_ref3) {
|
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
119
|
-
|
|
119
|
+
var MultiValueGeneric = function MultiValueGeneric(_ref4) {
|
|
120
120
|
var children = _ref4.children,
|
|
121
121
|
innerProps = _ref4.innerProps;
|
|
122
122
|
return jsx("div", innerProps, children);
|
|
@@ -5,6 +5,9 @@ var _excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inpu
|
|
|
5
5
|
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; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import { useCallback, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
// Export required for downstream consumers
|
|
10
|
+
|
|
8
11
|
// TODO: Fill in the hook {description}.
|
|
9
12
|
/**
|
|
10
13
|
* {description}.
|
package/dist/esm/utils.js
CHANGED
|
@@ -10,9 +10,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
// ==============================
|
|
11
11
|
|
|
12
12
|
export var noop = function noop() {};
|
|
13
|
-
export var emptyString = function emptyString() {
|
|
14
|
-
return '';
|
|
15
|
-
};
|
|
16
13
|
|
|
17
14
|
// ==============================
|
|
18
15
|
// Class Name Prefixer
|
|
@@ -240,13 +237,6 @@ export function getBoundingClientObj(element) {
|
|
|
240
237
|
width: rect.width
|
|
241
238
|
};
|
|
242
239
|
}
|
|
243
|
-
// ==============================
|
|
244
|
-
// String to Key (kebabify)
|
|
245
|
-
// ==============================
|
|
246
|
-
|
|
247
|
-
export function toKey(str) {
|
|
248
|
-
return str.replace(/\W/g, '-');
|
|
249
|
-
}
|
|
250
240
|
|
|
251
241
|
// ==============================
|
|
252
242
|
// Touch Capability Detector
|
|
@@ -296,7 +286,7 @@ export var supportsPassiveEvents = passiveOptionAccessed;
|
|
|
296
286
|
export function notNullish(item) {
|
|
297
287
|
return item != null;
|
|
298
288
|
}
|
|
299
|
-
|
|
289
|
+
function isArray(arg) {
|
|
300
290
|
return Array.isArray(arg);
|
|
301
291
|
}
|
|
302
292
|
export function valueTernary(isMulti, multiValue, singleValue) {
|
|
@@ -6,7 +6,7 @@ import { type ComponentType, type ReactNode } from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type SelectProps } from '../select';
|
|
8
8
|
import { type CommonProps, type CommonPropsAndClassName, type CSSObjectWithLabel, type CX, type GetStyles, type GroupBase, type Options } from '../types';
|
|
9
|
-
|
|
9
|
+
interface ForwardedHeadingProps<Option, Group extends GroupBase<Option>> {
|
|
10
10
|
id: string;
|
|
11
11
|
data: Group;
|
|
12
12
|
}
|
|
@@ -59,7 +59,7 @@ export declare const components: {
|
|
|
59
59
|
SingleValue: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: SingleValueProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
|
|
60
60
|
ValueContainer: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: ValueContainerProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
type SelectComponentsGeneric = typeof components;
|
|
63
63
|
interface ComponentsProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
64
64
|
components: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
65
65
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type InputHTMLAttributes } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../types';
|
|
8
|
-
|
|
8
|
+
interface InputSpecificProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends InputHTMLAttributes<HTMLInputElement>, CommonPropsAndClassName<Option, IsMulti, Group> {
|
|
9
9
|
/**
|
|
10
10
|
* Reference to the internal element
|
|
11
11
|
*/
|
|
@@ -6,7 +6,7 @@ import { type ReactNode } from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type AriaSelection } from '../accessibility';
|
|
8
8
|
import { type CommonProps, type GroupBase, type Options } from '../types';
|
|
9
|
-
|
|
9
|
+
interface LiveRegionProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonProps<Option, IsMulti, Group> {
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
innerProps: {
|
|
12
12
|
className?: string;
|
|
@@ -5,21 +5,7 @@
|
|
|
5
5
|
import { type LegacyRef, type ReactElement, type ReactNode, type Ref } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type CoercedMenuPlacement, type CommonProps, type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase, type MenuPlacement, type MenuPosition } from '../types';
|
|
8
|
-
interface
|
|
9
|
-
placement: CoercedMenuPlacement;
|
|
10
|
-
maxHeight: number;
|
|
11
|
-
}
|
|
12
|
-
interface PlacementArgs {
|
|
13
|
-
maxHeight: number;
|
|
14
|
-
menuEl: HTMLDivElement | null;
|
|
15
|
-
minHeight: number;
|
|
16
|
-
placement: MenuPlacement;
|
|
17
|
-
shouldScroll: boolean;
|
|
18
|
-
isFixedPosition: boolean;
|
|
19
|
-
controlHeight: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function getMenuPlacement({ maxHeight: preferredMaxHeight, menuEl, minHeight, placement: preferredPlacement, shouldScroll, isFixedPosition, controlHeight, }: PlacementArgs): CalculatedMenuPlacementAndHeight;
|
|
22
|
-
export interface MenuPlacementProps {
|
|
8
|
+
interface MenuPlacementProps {
|
|
23
9
|
/**
|
|
24
10
|
* Set the minimum height of the menu.
|
|
25
11
|
*/
|
|
@@ -62,7 +48,7 @@ interface ChildrenProps {
|
|
|
62
48
|
ref: Ref<HTMLDivElement>;
|
|
63
49
|
placerProps: PlacerProps;
|
|
64
50
|
}
|
|
65
|
-
|
|
51
|
+
interface MenuPlacerProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonProps<Option, IsMulti, Group>, MenuPlacementProps {
|
|
66
52
|
/**
|
|
67
53
|
* The children to be rendered.
|
|
68
54
|
*/
|
|
@@ -33,7 +33,6 @@ export interface MultiValueGenericProps<Option = unknown, IsMulti extends boolea
|
|
|
33
33
|
};
|
|
34
34
|
selectProps: SelectProps<Option, IsMulti, Group>;
|
|
35
35
|
}
|
|
36
|
-
export declare const MultiValueGeneric: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
37
36
|
export declare const MultiValueContainer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
38
37
|
export declare const MultiValueLabel: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
39
38
|
export interface MultiValueRemoveProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> {
|
|
@@ -2,7 +2,6 @@ import { type ReactElement, type RefAttributes } from 'react';
|
|
|
2
2
|
import Select from './select';
|
|
3
3
|
import { type GroupBase } from './types';
|
|
4
4
|
import { type StateManagerProps } from './use-state-manager';
|
|
5
|
-
export type { StateManagerProps };
|
|
6
5
|
/**
|
|
7
6
|
* __StateManagedSelect__
|
|
8
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type PublicBaseSelectProps } from './select';
|
|
3
3
|
import { type GetOptionLabel, type GetOptionValue, type GroupBase, type Options, type OptionsOrGroups } from './types';
|
|
4
|
-
|
|
4
|
+
interface Accessors<Option> {
|
|
5
5
|
getOptionValue: GetOptionValue<Option>;
|
|
6
6
|
getOptionLabel: GetOptionLabel<Option>;
|
|
7
7
|
}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { StylesProps } from './styles';
|
|
2
2
|
import type { ClassNamesState, CommonPropsAndClassName, GroupBase, InputActionMeta, MultiValue, OnChangeValue, Options, PropsValue, SingleValue } from './types';
|
|
3
3
|
export declare const noop: () => void;
|
|
4
|
-
export declare const emptyString: () => string;
|
|
5
4
|
export declare function classNames(prefix?: string | null, state?: ClassNamesState, ...classNameList: string[]): string;
|
|
6
5
|
export declare const cleanValue: <Option>(value: PropsValue<Option>) => Options<Option>;
|
|
7
6
|
export declare const cleanCommonProps: <Option, IsMulti extends boolean, Group extends GroupBase<Option>, AdditionalProps>(props: Partial<CommonPropsAndClassName<Option, IsMulti, Group>> & AdditionalProps) => Omit<AdditionalProps, keyof CommonPropsAndClassName<Option, IsMulti, Group>>;
|
|
@@ -25,19 +24,10 @@ export declare function getBoundingClientObj(element: HTMLElement): {
|
|
|
25
24
|
top: number;
|
|
26
25
|
width: number;
|
|
27
26
|
};
|
|
28
|
-
export interface Rect {
|
|
29
|
-
left: number;
|
|
30
|
-
right: number;
|
|
31
|
-
bottom: number;
|
|
32
|
-
height: number;
|
|
33
|
-
width: number;
|
|
34
|
-
}
|
|
35
|
-
export declare function toKey(str: string): string;
|
|
36
27
|
export declare function isTouchCapable(): boolean;
|
|
37
28
|
export declare function isMobileDevice(): boolean;
|
|
38
29
|
export declare const supportsPassiveEvents: boolean;
|
|
39
30
|
export declare function notNullish<T>(item: T | null | undefined): item is T;
|
|
40
|
-
export declare function isArray<T>(arg: unknown): arg is readonly T[];
|
|
41
31
|
export declare function valueTernary<Option, IsMulti extends boolean>(isMulti: IsMulti | undefined, multiValue: MultiValue<Option>, singleValue: SingleValue<Option>): OnChangeValue<Option, IsMulti>;
|
|
42
32
|
export declare function singleValueAsValue<Option, IsMulti extends boolean>(singleValue: SingleValue<Option>): OnChangeValue<Option, IsMulti>;
|
|
43
33
|
export declare function multiValueAsValue<Option, IsMulti extends boolean>(multiValue: MultiValue<Option>): OnChangeValue<Option, IsMulti>;
|
|
@@ -6,7 +6,7 @@ import { type ComponentType, type ReactNode } from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type SelectProps } from '../select';
|
|
8
8
|
import { type CommonProps, type CommonPropsAndClassName, type CSSObjectWithLabel, type CX, type GetStyles, type GroupBase, type Options } from '../types';
|
|
9
|
-
|
|
9
|
+
interface ForwardedHeadingProps<Option, Group extends GroupBase<Option>> {
|
|
10
10
|
id: string;
|
|
11
11
|
data: Group;
|
|
12
12
|
}
|
|
@@ -59,7 +59,7 @@ export declare const components: {
|
|
|
59
59
|
SingleValue: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: SingleValueProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
|
|
60
60
|
ValueContainer: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: ValueContainerProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
type SelectComponentsGeneric = typeof components;
|
|
63
63
|
interface ComponentsProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
|
64
64
|
components: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
65
65
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type InputHTMLAttributes } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../types';
|
|
8
|
-
|
|
8
|
+
interface InputSpecificProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends InputHTMLAttributes<HTMLInputElement>, CommonPropsAndClassName<Option, IsMulti, Group> {
|
|
9
9
|
/**
|
|
10
10
|
* Reference to the internal element
|
|
11
11
|
*/
|
|
@@ -6,7 +6,7 @@ import { type ReactNode } from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type AriaSelection } from '../accessibility';
|
|
8
8
|
import { type CommonProps, type GroupBase, type Options } from '../types';
|
|
9
|
-
|
|
9
|
+
interface LiveRegionProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonProps<Option, IsMulti, Group> {
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
innerProps: {
|
|
12
12
|
className?: string;
|
|
@@ -5,21 +5,7 @@
|
|
|
5
5
|
import { type LegacyRef, type ReactElement, type ReactNode, type Ref } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type CoercedMenuPlacement, type CommonProps, type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase, type MenuPlacement, type MenuPosition } from '../types';
|
|
8
|
-
interface
|
|
9
|
-
placement: CoercedMenuPlacement;
|
|
10
|
-
maxHeight: number;
|
|
11
|
-
}
|
|
12
|
-
interface PlacementArgs {
|
|
13
|
-
maxHeight: number;
|
|
14
|
-
menuEl: HTMLDivElement | null;
|
|
15
|
-
minHeight: number;
|
|
16
|
-
placement: MenuPlacement;
|
|
17
|
-
shouldScroll: boolean;
|
|
18
|
-
isFixedPosition: boolean;
|
|
19
|
-
controlHeight: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function getMenuPlacement({ maxHeight: preferredMaxHeight, menuEl, minHeight, placement: preferredPlacement, shouldScroll, isFixedPosition, controlHeight, }: PlacementArgs): CalculatedMenuPlacementAndHeight;
|
|
22
|
-
export interface MenuPlacementProps {
|
|
8
|
+
interface MenuPlacementProps {
|
|
23
9
|
/**
|
|
24
10
|
* Set the minimum height of the menu.
|
|
25
11
|
*/
|
|
@@ -62,7 +48,7 @@ interface ChildrenProps {
|
|
|
62
48
|
ref: Ref<HTMLDivElement>;
|
|
63
49
|
placerProps: PlacerProps;
|
|
64
50
|
}
|
|
65
|
-
|
|
51
|
+
interface MenuPlacerProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonProps<Option, IsMulti, Group>, MenuPlacementProps {
|
|
66
52
|
/**
|
|
67
53
|
* The children to be rendered.
|
|
68
54
|
*/
|
|
@@ -33,7 +33,6 @@ export interface MultiValueGenericProps<Option = unknown, IsMulti extends boolea
|
|
|
33
33
|
};
|
|
34
34
|
selectProps: SelectProps<Option, IsMulti, Group>;
|
|
35
35
|
}
|
|
36
|
-
export declare const MultiValueGeneric: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
37
36
|
export declare const MultiValueContainer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
38
37
|
export declare const MultiValueLabel: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
|
|
39
38
|
export interface MultiValueRemoveProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> {
|
|
@@ -2,7 +2,6 @@ import { type ReactElement, type RefAttributes } from 'react';
|
|
|
2
2
|
import Select from './select';
|
|
3
3
|
import { type GroupBase } from './types';
|
|
4
4
|
import { type StateManagerProps } from './use-state-manager';
|
|
5
|
-
export type { StateManagerProps };
|
|
6
5
|
/**
|
|
7
6
|
* __StateManagedSelect__
|
|
8
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type PublicBaseSelectProps } from './select';
|
|
3
3
|
import { type GetOptionLabel, type GetOptionValue, type GroupBase, type Options, type OptionsOrGroups } from './types';
|
|
4
|
-
|
|
4
|
+
interface Accessors<Option> {
|
|
5
5
|
getOptionValue: GetOptionValue<Option>;
|
|
6
6
|
getOptionLabel: GetOptionLabel<Option>;
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { StylesProps } from './styles';
|
|
2
2
|
import type { ClassNamesState, CommonPropsAndClassName, GroupBase, InputActionMeta, MultiValue, OnChangeValue, Options, PropsValue, SingleValue } from './types';
|
|
3
3
|
export declare const noop: () => void;
|
|
4
|
-
export declare const emptyString: () => string;
|
|
5
4
|
export declare function classNames(prefix?: string | null, state?: ClassNamesState, ...classNameList: string[]): string;
|
|
6
5
|
export declare const cleanValue: <Option>(value: PropsValue<Option>) => Options<Option>;
|
|
7
6
|
export declare const cleanCommonProps: <Option, IsMulti extends boolean, Group extends GroupBase<Option>, AdditionalProps>(props: Partial<CommonPropsAndClassName<Option, IsMulti, Group>> & AdditionalProps) => Omit<AdditionalProps, keyof CommonPropsAndClassName<Option, IsMulti, Group>>;
|
|
@@ -25,19 +24,10 @@ export declare function getBoundingClientObj(element: HTMLElement): {
|
|
|
25
24
|
top: number;
|
|
26
25
|
width: number;
|
|
27
26
|
};
|
|
28
|
-
export interface Rect {
|
|
29
|
-
left: number;
|
|
30
|
-
right: number;
|
|
31
|
-
bottom: number;
|
|
32
|
-
height: number;
|
|
33
|
-
width: number;
|
|
34
|
-
}
|
|
35
|
-
export declare function toKey(str: string): string;
|
|
36
27
|
export declare function isTouchCapable(): boolean;
|
|
37
28
|
export declare function isMobileDevice(): boolean;
|
|
38
29
|
export declare const supportsPassiveEvents: boolean;
|
|
39
30
|
export declare function notNullish<T>(item: T | null | undefined): item is T;
|
|
40
|
-
export declare function isArray<T>(arg: unknown): arg is readonly T[];
|
|
41
31
|
export declare function valueTernary<Option, IsMulti extends boolean>(isMulti: IsMulti | undefined, multiValue: MultiValue<Option>, singleValue: SingleValue<Option>): OnChangeValue<Option, IsMulti>;
|
|
42
32
|
export declare function singleValueAsValue<Option, IsMulti extends boolean>(singleValue: SingleValue<Option>): OnChangeValue<Option, IsMulti>;
|
|
43
33
|
export declare function multiValueAsValue<Option, IsMulti extends boolean>(multiValue: MultiValue<Option>): OnChangeValue<Option, IsMulti>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-select",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
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",
|
|
@@ -46,15 +46,12 @@
|
|
|
46
46
|
"react-dom": "^18.2.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@atlaskit/ssr": "*",
|
|
52
|
-
"@atlaskit/visual-regression": "*",
|
|
49
|
+
"@atlaskit/checkbox": "^17.0.0",
|
|
50
|
+
"@atlaskit/form": "^12.0.0",
|
|
53
51
|
"@atlassian/feature-flags-test-utils": "*",
|
|
54
52
|
"@testing-library/react": "^13.4.0",
|
|
55
53
|
"@testing-library/user-event": "^14.4.3",
|
|
56
54
|
"jest-in-case": "^1.0.2",
|
|
57
|
-
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
58
55
|
"typescript": "~5.4.2"
|
|
59
56
|
},
|
|
60
57
|
"platform-feature-flags": {
|