@atlaskit/select 15.3.0 → 15.4.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 +19 -0
- package/dist/cjs/PopupSelect/PopupSelect.js +31 -8
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/index.js +14 -2
- package/dist/cjs/styles.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/PopupSelect/PopupSelect.js +29 -5
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/PopupSelect/PopupSelect.js +32 -8
- package/dist/esm/Select.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/styles.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/PopupSelect/PopupSelect.d.ts +41 -0
- package/dist/types/PopupSelect/components.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +7 -4
- package/report.api.md +710 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 15.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`4609a8a733a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4609a8a733a) - Made SelectWithoutAnalytics component and InputActionMeta type available from @atlaskit/select
|
|
8
|
+
|
|
9
|
+
## 15.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8a5bdb3c844`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a5bdb3c844) - Upgrading internal dependency (bind-event-listener) for improved internal types
|
|
14
|
+
|
|
15
|
+
## 15.3.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`8f6f225ac11`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f6f225ac11) - Updated prop types for Popup Select
|
|
20
|
+
- [`e4b612d1c48`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4b612d1c48) - Internal migration to bind-event-listener for safer DOM Event cleanup
|
|
21
|
+
|
|
3
22
|
## 15.3.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -49,6 +49,8 @@ var _components = require("./components");
|
|
|
49
49
|
|
|
50
50
|
var _styles = _interopRequireDefault(require("../styles"));
|
|
51
51
|
|
|
52
|
+
var _bindEventListener = require("bind-event-listener");
|
|
53
|
+
|
|
52
54
|
var _excluded = ["footer", "maxMenuWidth", "minMenuWidth", "target"];
|
|
53
55
|
|
|
54
56
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -118,6 +120,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
118
120
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "menuRef", null);
|
|
119
121
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectRef", null);
|
|
120
122
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", null);
|
|
123
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowClick", null);
|
|
124
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowKeydown", null);
|
|
121
125
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultStyles", (0, _reactSelect.mergeStyles)((0, _styles.default)(_this.props.validationState, _this.props.spacing === 'compact'), {
|
|
122
126
|
groupHeading: function groupHeading(provided) {
|
|
123
127
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
@@ -209,7 +213,13 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
209
213
|
return;
|
|
210
214
|
}
|
|
211
215
|
|
|
212
|
-
|
|
216
|
+
_this.unbindWindowKeydown = (0, _bindEventListener.bind)(window, {
|
|
217
|
+
type: 'keydown',
|
|
218
|
+
listener: _this.handleKeyDown,
|
|
219
|
+
options: {
|
|
220
|
+
capture: true
|
|
221
|
+
}
|
|
222
|
+
});
|
|
213
223
|
});
|
|
214
224
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "initialiseFocusTrap", function () {
|
|
215
225
|
if (!_this.menuRef) {
|
|
@@ -229,6 +239,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
229
239
|
}, 1);
|
|
230
240
|
});
|
|
231
241
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "close", function (options) {
|
|
242
|
+
var _this$unbindWindowKey, _this2;
|
|
243
|
+
|
|
232
244
|
var onClose = _this.props.onClose;
|
|
233
245
|
|
|
234
246
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
@@ -256,7 +268,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
256
268
|
return;
|
|
257
269
|
}
|
|
258
270
|
|
|
259
|
-
|
|
271
|
+
(_this$unbindWindowKey = (_this2 = _this).unbindWindowKeydown) === null || _this$unbindWindowKey === void 0 ? void 0 : _this$unbindWindowKey.call(_this2);
|
|
272
|
+
_this.unbindWindowKeydown = null;
|
|
260
273
|
});
|
|
261
274
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resolveTargetRef", function (popperRef) {
|
|
262
275
|
return function (ref) {
|
|
@@ -384,17 +397,27 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
384
397
|
return;
|
|
385
398
|
}
|
|
386
399
|
|
|
387
|
-
|
|
400
|
+
this.unbindWindowClick = (0, _bindEventListener.bind)(window, {
|
|
401
|
+
type: 'click',
|
|
402
|
+
listener: this.handleClick,
|
|
403
|
+
options: {
|
|
404
|
+
capture: true
|
|
405
|
+
}
|
|
406
|
+
});
|
|
388
407
|
}
|
|
389
408
|
}, {
|
|
390
409
|
key: "componentWillUnmount",
|
|
391
410
|
value: function componentWillUnmount() {
|
|
411
|
+
var _this$unbindWindowCli, _this$unbindWindowKey2;
|
|
412
|
+
|
|
392
413
|
if (typeof window === 'undefined') {
|
|
393
414
|
return;
|
|
394
415
|
}
|
|
395
416
|
|
|
396
|
-
|
|
397
|
-
|
|
417
|
+
(_this$unbindWindowCli = this.unbindWindowClick) === null || _this$unbindWindowCli === void 0 ? void 0 : _this$unbindWindowCli.call(this);
|
|
418
|
+
this.unbindWindowClick = null;
|
|
419
|
+
(_this$unbindWindowKey2 = this.unbindWindowKeydown) === null || _this$unbindWindowKey2 === void 0 ? void 0 : _this$unbindWindowKey2.call(this);
|
|
420
|
+
this.unbindWindowKeydown = null;
|
|
398
421
|
}
|
|
399
422
|
}, {
|
|
400
423
|
key: "componentDidUpdate",
|
|
@@ -418,7 +441,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
418
441
|
}, {
|
|
419
442
|
key: "render",
|
|
420
443
|
value: function render() {
|
|
421
|
-
var
|
|
444
|
+
var _this3 = this;
|
|
422
445
|
|
|
423
446
|
var target = this.props.target;
|
|
424
447
|
var isOpen = this.state.isOpen;
|
|
@@ -426,10 +449,10 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
426
449
|
var ref = _ref3.ref;
|
|
427
450
|
return target && target({
|
|
428
451
|
isOpen: isOpen,
|
|
429
|
-
ref:
|
|
452
|
+
ref: _this3.resolveTargetRef(ref),
|
|
430
453
|
'aria-haspopup': 'true',
|
|
431
454
|
'aria-expanded': isOpen,
|
|
432
|
-
'aria-controls': isOpen ?
|
|
455
|
+
'aria-controls': isOpen ? _this3.popperWrapperId : undefined
|
|
433
456
|
});
|
|
434
457
|
}), this.renderSelect());
|
|
435
458
|
}
|
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 = "15.
|
|
17
|
+
var packageVersion = "15.4.0";
|
|
18
18
|
var SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
|
|
19
19
|
exports.SelectWithoutAnalytics = SelectWithoutAnalytics;
|
|
20
20
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
package/dist/cjs/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -59,6 +61,12 @@ Object.defineProperty(exports, "RadioSelect", {
|
|
|
59
61
|
return _RadioSelect.default;
|
|
60
62
|
}
|
|
61
63
|
});
|
|
64
|
+
Object.defineProperty(exports, "SelectWithoutAnalytics", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function get() {
|
|
67
|
+
return _Select.SelectWithoutAnalytics;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
62
70
|
Object.defineProperty(exports, "components", {
|
|
63
71
|
enumerable: true,
|
|
64
72
|
get: function get() {
|
|
@@ -104,7 +112,7 @@ var _creatable = require("react-select/creatable");
|
|
|
104
112
|
|
|
105
113
|
var _inputOptions = require("./components/input-options");
|
|
106
114
|
|
|
107
|
-
var _Select =
|
|
115
|
+
var _Select = _interopRequireWildcard(require("./Select"));
|
|
108
116
|
|
|
109
117
|
var _AsyncSelect = _interopRequireDefault(require("./AsyncSelect"));
|
|
110
118
|
|
|
@@ -118,4 +126,8 @@ var _CreatableSelect = _interopRequireDefault(require("./CreatableSelect"));
|
|
|
118
126
|
|
|
119
127
|
var _AsyncCreatableSelect = _interopRequireDefault(require("./AsyncCreatableSelect"));
|
|
120
128
|
|
|
121
|
-
var _PopupSelect = _interopRequireDefault(require("./PopupSelect"));
|
|
129
|
+
var _PopupSelect = _interopRequireDefault(require("./PopupSelect"));
|
|
130
|
+
|
|
131
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
132
|
+
|
|
133
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/dist/cjs/styles.js
CHANGED
|
@@ -229,7 +229,7 @@ function baseStyles(validationState, isCompact) {
|
|
|
229
229
|
return _objectSpread(_objectSpread({}, css), {}, {
|
|
230
230
|
borderRadius: '2px',
|
|
231
231
|
backgroundColor: isFocused ? "var(--ds-background-selected, ".concat(_colors.N40, ")") : "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N40, ")"),
|
|
232
|
-
boxShadow: isFocused ? "0 0 0 2px ".concat("var(--ds-surface, transparent)", ", 0 0 0 4px "
|
|
232
|
+
boxShadow: isFocused ? "0 0 0 2px ".concat("var(--ds-surface, transparent)", ", 0 0 0 4px ", "var(--ds-border-focused, transparent)") : 'none',
|
|
233
233
|
maxWidth: '100%',
|
|
234
234
|
'@media screen and (-ms-high-contrast: active)': {
|
|
235
235
|
border: isFocused ? '1px solid transparent' : 'none'
|
package/dist/cjs/version.json
CHANGED
|
@@ -11,6 +11,7 @@ import shallowEqualObjects from 'shallow-equal/objects';
|
|
|
11
11
|
import { N80 } from '@atlaskit/theme/colors';
|
|
12
12
|
import { MenuDialog, DummyControl, defaultComponents } from './components';
|
|
13
13
|
import baseStyles from '../styles';
|
|
14
|
+
import { bind } from 'bind-event-listener';
|
|
14
15
|
|
|
15
16
|
/** Are we rendering on the client or server? */
|
|
16
17
|
const canUseDOM = () => Boolean(typeof window !== 'undefined' && window.document && window.document.createElement); // ==============================
|
|
@@ -56,6 +57,10 @@ export default class PopupSelect extends PureComponent {
|
|
|
56
57
|
|
|
57
58
|
_defineProperty(this, "targetRef", null);
|
|
58
59
|
|
|
60
|
+
_defineProperty(this, "unbindWindowClick", null);
|
|
61
|
+
|
|
62
|
+
_defineProperty(this, "unbindWindowKeydown", null);
|
|
63
|
+
|
|
59
64
|
_defineProperty(this, "defaultStyles", mergeStyles(baseStyles(this.props.validationState, this.props.spacing === 'compact'), {
|
|
60
65
|
groupHeading: provided => ({ ...provided,
|
|
61
66
|
color: `var(--ds-text-subtlest, ${N80})`
|
|
@@ -157,7 +162,13 @@ export default class PopupSelect extends PureComponent {
|
|
|
157
162
|
return;
|
|
158
163
|
}
|
|
159
164
|
|
|
160
|
-
|
|
165
|
+
this.unbindWindowKeydown = bind(window, {
|
|
166
|
+
type: 'keydown',
|
|
167
|
+
listener: this.handleKeyDown,
|
|
168
|
+
options: {
|
|
169
|
+
capture: true
|
|
170
|
+
}
|
|
171
|
+
});
|
|
161
172
|
});
|
|
162
173
|
|
|
163
174
|
_defineProperty(this, "initialiseFocusTrap", () => {
|
|
@@ -177,6 +188,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
177
188
|
});
|
|
178
189
|
|
|
179
190
|
_defineProperty(this, "close", options => {
|
|
191
|
+
var _this$unbindWindowKey;
|
|
192
|
+
|
|
180
193
|
const {
|
|
181
194
|
onClose
|
|
182
195
|
} = this.props;
|
|
@@ -206,7 +219,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
206
219
|
return;
|
|
207
220
|
}
|
|
208
221
|
|
|
209
|
-
|
|
222
|
+
(_this$unbindWindowKey = this.unbindWindowKeydown) === null || _this$unbindWindowKey === void 0 ? void 0 : _this$unbindWindowKey.call(this);
|
|
223
|
+
this.unbindWindowKeydown = null;
|
|
210
224
|
});
|
|
211
225
|
|
|
212
226
|
_defineProperty(this, "resolveTargetRef", popperRef => ref => {
|
|
@@ -367,16 +381,26 @@ export default class PopupSelect extends PureComponent {
|
|
|
367
381
|
return;
|
|
368
382
|
}
|
|
369
383
|
|
|
370
|
-
|
|
384
|
+
this.unbindWindowClick = bind(window, {
|
|
385
|
+
type: 'click',
|
|
386
|
+
listener: this.handleClick,
|
|
387
|
+
options: {
|
|
388
|
+
capture: true
|
|
389
|
+
}
|
|
390
|
+
});
|
|
371
391
|
}
|
|
372
392
|
|
|
373
393
|
componentWillUnmount() {
|
|
394
|
+
var _this$unbindWindowCli, _this$unbindWindowKey2;
|
|
395
|
+
|
|
374
396
|
if (typeof window === 'undefined') {
|
|
375
397
|
return;
|
|
376
398
|
}
|
|
377
399
|
|
|
378
|
-
|
|
379
|
-
|
|
400
|
+
(_this$unbindWindowCli = this.unbindWindowClick) === null || _this$unbindWindowCli === void 0 ? void 0 : _this$unbindWindowCli.call(this);
|
|
401
|
+
this.unbindWindowClick = null;
|
|
402
|
+
(_this$unbindWindowKey2 = this.unbindWindowKeydown) === null || _this$unbindWindowKey2 === void 0 ? void 0 : _this$unbindWindowKey2.call(this);
|
|
403
|
+
this.unbindWindowKeydown = null;
|
|
380
404
|
}
|
|
381
405
|
|
|
382
406
|
componentDidUpdate(prevProps) {
|
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 = "15.
|
|
5
|
+
const packageVersion = "15.4.0";
|
|
6
6
|
export const SelectWithoutAnalytics = createSelect(Select);
|
|
7
7
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
export default withAnalyticsContext({
|
package/dist/es2019/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { components, createFilter, mergeStyles } from 'react-select';
|
|
|
2
2
|
export { makeAsyncSelect } from 'react-select/async';
|
|
3
3
|
export { makeCreatableSelect } from 'react-select/creatable';
|
|
4
4
|
export { CheckboxOption, RadioOption } from './components/input-options';
|
|
5
|
-
export { default } from './Select';
|
|
5
|
+
export { default, SelectWithoutAnalytics } from './Select';
|
|
6
6
|
export { default as AsyncSelect } from './AsyncSelect';
|
|
7
7
|
export { default as CheckboxSelect } from './CheckboxSelect';
|
|
8
8
|
export { default as CountrySelect } from './CountrySelect';
|
package/dist/es2019/version.json
CHANGED
|
@@ -28,6 +28,7 @@ import shallowEqualObjects from 'shallow-equal/objects';
|
|
|
28
28
|
import { N80 } from '@atlaskit/theme/colors';
|
|
29
29
|
import { MenuDialog, DummyControl, defaultComponents } from './components';
|
|
30
30
|
import baseStyles from '../styles';
|
|
31
|
+
import { bind } from 'bind-event-listener';
|
|
31
32
|
|
|
32
33
|
/** Are we rendering on the client or server? */
|
|
33
34
|
var canUseDOM = function canUseDOM() {
|
|
@@ -89,6 +90,10 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
89
90
|
|
|
90
91
|
_defineProperty(_assertThisInitialized(_this), "targetRef", null);
|
|
91
92
|
|
|
93
|
+
_defineProperty(_assertThisInitialized(_this), "unbindWindowClick", null);
|
|
94
|
+
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "unbindWindowKeydown", null);
|
|
96
|
+
|
|
92
97
|
_defineProperty(_assertThisInitialized(_this), "defaultStyles", mergeStyles(baseStyles(_this.props.validationState, _this.props.spacing === 'compact'), {
|
|
93
98
|
groupHeading: function groupHeading(provided) {
|
|
94
99
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
@@ -188,7 +193,13 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
188
193
|
return;
|
|
189
194
|
}
|
|
190
195
|
|
|
191
|
-
|
|
196
|
+
_this.unbindWindowKeydown = bind(window, {
|
|
197
|
+
type: 'keydown',
|
|
198
|
+
listener: _this.handleKeyDown,
|
|
199
|
+
options: {
|
|
200
|
+
capture: true
|
|
201
|
+
}
|
|
202
|
+
});
|
|
192
203
|
});
|
|
193
204
|
|
|
194
205
|
_defineProperty(_assertThisInitialized(_this), "initialiseFocusTrap", function () {
|
|
@@ -210,6 +221,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
210
221
|
});
|
|
211
222
|
|
|
212
223
|
_defineProperty(_assertThisInitialized(_this), "close", function (options) {
|
|
224
|
+
var _this$unbindWindowKey, _this2;
|
|
225
|
+
|
|
213
226
|
var onClose = _this.props.onClose;
|
|
214
227
|
|
|
215
228
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
@@ -237,7 +250,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
237
250
|
return;
|
|
238
251
|
}
|
|
239
252
|
|
|
240
|
-
|
|
253
|
+
(_this$unbindWindowKey = (_this2 = _this).unbindWindowKeydown) === null || _this$unbindWindowKey === void 0 ? void 0 : _this$unbindWindowKey.call(_this2);
|
|
254
|
+
_this.unbindWindowKeydown = null;
|
|
241
255
|
});
|
|
242
256
|
|
|
243
257
|
_defineProperty(_assertThisInitialized(_this), "resolveTargetRef", function (popperRef) {
|
|
@@ -373,17 +387,27 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
373
387
|
return;
|
|
374
388
|
}
|
|
375
389
|
|
|
376
|
-
|
|
390
|
+
this.unbindWindowClick = bind(window, {
|
|
391
|
+
type: 'click',
|
|
392
|
+
listener: this.handleClick,
|
|
393
|
+
options: {
|
|
394
|
+
capture: true
|
|
395
|
+
}
|
|
396
|
+
});
|
|
377
397
|
}
|
|
378
398
|
}, {
|
|
379
399
|
key: "componentWillUnmount",
|
|
380
400
|
value: function componentWillUnmount() {
|
|
401
|
+
var _this$unbindWindowCli, _this$unbindWindowKey2;
|
|
402
|
+
|
|
381
403
|
if (typeof window === 'undefined') {
|
|
382
404
|
return;
|
|
383
405
|
}
|
|
384
406
|
|
|
385
|
-
|
|
386
|
-
|
|
407
|
+
(_this$unbindWindowCli = this.unbindWindowClick) === null || _this$unbindWindowCli === void 0 ? void 0 : _this$unbindWindowCli.call(this);
|
|
408
|
+
this.unbindWindowClick = null;
|
|
409
|
+
(_this$unbindWindowKey2 = this.unbindWindowKeydown) === null || _this$unbindWindowKey2 === void 0 ? void 0 : _this$unbindWindowKey2.call(this);
|
|
410
|
+
this.unbindWindowKeydown = null;
|
|
387
411
|
}
|
|
388
412
|
}, {
|
|
389
413
|
key: "componentDidUpdate",
|
|
@@ -407,7 +431,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
407
431
|
}, {
|
|
408
432
|
key: "render",
|
|
409
433
|
value: function render() {
|
|
410
|
-
var
|
|
434
|
+
var _this3 = this;
|
|
411
435
|
|
|
412
436
|
var target = this.props.target;
|
|
413
437
|
var isOpen = this.state.isOpen;
|
|
@@ -415,10 +439,10 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
415
439
|
var ref = _ref3.ref;
|
|
416
440
|
return target && target({
|
|
417
441
|
isOpen: isOpen,
|
|
418
|
-
ref:
|
|
442
|
+
ref: _this3.resolveTargetRef(ref),
|
|
419
443
|
'aria-haspopup': 'true',
|
|
420
444
|
'aria-expanded': isOpen,
|
|
421
|
-
'aria-controls': isOpen ?
|
|
445
|
+
'aria-controls': isOpen ? _this3.popperWrapperId : undefined
|
|
422
446
|
});
|
|
423
447
|
}), this.renderSelect());
|
|
424
448
|
}
|
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 = "15.
|
|
5
|
+
var packageVersion = "15.4.0";
|
|
6
6
|
export var SelectWithoutAnalytics = createSelect(Select);
|
|
7
7
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
export default withAnalyticsContext({
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { components, createFilter, mergeStyles } from 'react-select';
|
|
|
2
2
|
export { makeAsyncSelect } from 'react-select/async';
|
|
3
3
|
export { makeCreatableSelect } from 'react-select/creatable';
|
|
4
4
|
export { CheckboxOption, RadioOption } from './components/input-options';
|
|
5
|
-
export { default } from './Select';
|
|
5
|
+
export { default, SelectWithoutAnalytics } from './Select';
|
|
6
6
|
export { default as AsyncSelect } from './AsyncSelect';
|
|
7
7
|
export { default as CheckboxSelect } from './CheckboxSelect';
|
|
8
8
|
export { default as CountrySelect } from './CountrySelect';
|
package/dist/esm/styles.js
CHANGED
|
@@ -217,7 +217,7 @@ export default function baseStyles(validationState, isCompact) {
|
|
|
217
217
|
return _objectSpread(_objectSpread({}, css), {}, {
|
|
218
218
|
borderRadius: '2px',
|
|
219
219
|
backgroundColor: isFocused ? "var(--ds-background-selected, ".concat(N40, ")") : "var(--ds-background-neutral-subtle-hovered, ".concat(N40, ")"),
|
|
220
|
-
boxShadow: isFocused ? "0 0 0 2px ".concat("var(--ds-surface, transparent)", ", 0 0 0 4px "
|
|
220
|
+
boxShadow: isFocused ? "0 0 0 2px ".concat("var(--ds-surface, transparent)", ", 0 0 0 4px ", "var(--ds-border-focused, transparent)") : 'none',
|
|
221
221
|
maxWidth: '100%',
|
|
222
222
|
'@media screen and (-ms-high-contrast: active)': {
|
|
223
223
|
border: isFocused ? '1px solid transparent' : 'none'
|
package/dist/esm/version.json
CHANGED
|
@@ -3,6 +3,7 @@ import Select from 'react-select';
|
|
|
3
3
|
import { FocusTrap } from 'focus-trap';
|
|
4
4
|
import { PopperProps } from 'react-popper';
|
|
5
5
|
import { OptionType, ActionMeta, ReactSelectProps, StylesConfig, ValueType } from '../types';
|
|
6
|
+
import { UnbindFn } from 'bind-event-listener';
|
|
6
7
|
declare type defaultModifiers = 'offset' | 'preventOverflow';
|
|
7
8
|
declare type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
|
|
8
9
|
interface PopupSelectTriggerProps {
|
|
@@ -12,10 +13,48 @@ interface PopupSelectTriggerProps {
|
|
|
12
13
|
'aria-controls'?: string;
|
|
13
14
|
}
|
|
14
15
|
export interface PopupSelectProps<Option = OptionType, IsMulti extends boolean = false, Modifiers = string> extends ReactSelectProps<Option, IsMulti> {
|
|
16
|
+
/**
|
|
17
|
+
* Defines whether the menu should close when selected. Defaults to "true"
|
|
18
|
+
*/
|
|
15
19
|
closeMenuOnSelect?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The footer content shown at the bottom of the Popup, underneath the Select options
|
|
22
|
+
*/
|
|
16
23
|
footer?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
The props passed down to React Popper.
|
|
26
|
+
|
|
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).
|
|
29
|
+
|
|
30
|
+
*/
|
|
17
31
|
popperProps?: PopperPropsNoChildren<Modifiers>;
|
|
32
|
+
/**
|
|
33
|
+
* The maximum number of options the Select can contain without rendering the search field.
|
|
34
|
+
*/
|
|
18
35
|
searchThreshold?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The maximum width for the popup menu. Can be a number, representing width in pixels,
|
|
38
|
+
* or a string containing a CSS length datatype.
|
|
39
|
+
*/
|
|
40
|
+
maxMenuWidth?: number | string;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum width for the popup menu. Can be a number, representing width in pixels,
|
|
43
|
+
* or a string containing a CSS length datatype.
|
|
44
|
+
*/
|
|
45
|
+
minMenuWidth?: number | string;
|
|
46
|
+
/**
|
|
47
|
+
Render props used to anchor the popup to your content.
|
|
48
|
+
|
|
49
|
+
Make this an interactive element, such as an @atlaskit/button component.
|
|
50
|
+
|
|
51
|
+
The provided render props in `options` are detailed below:
|
|
52
|
+
- `isOpen`: The current state of the popup.
|
|
53
|
+
Use this to change the appearance of your target based on the state of your component
|
|
54
|
+
- `ref`: Pass this ref to the element the Popup should be attached to
|
|
55
|
+
- `aria-haspopup`, `aria-expanded`, `aria-controls`: Spread these onto a target element to
|
|
56
|
+
ensure your experience is accessible
|
|
57
|
+
*/
|
|
19
58
|
target?: (options: PopupSelectTriggerProps & {
|
|
20
59
|
isOpen: boolean;
|
|
21
60
|
}) => ReactNode;
|
|
@@ -32,6 +71,8 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
32
71
|
menuRef: HTMLElement | null;
|
|
33
72
|
selectRef: Select<Option, IsMulti> | null;
|
|
34
73
|
targetRef: HTMLElement | null;
|
|
74
|
+
unbindWindowClick: UnbindFn | null;
|
|
75
|
+
unbindWindowKeydown: UnbindFn | null;
|
|
35
76
|
defaultStyles: StylesConfig<Option, IsMulti>;
|
|
36
77
|
isOpenControlled: boolean;
|
|
37
78
|
defaultOpenState: boolean | undefined;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { FC, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { ControlProps, MenuProps, OptionType } from '../types';
|
|
4
4
|
interface MenuDialogProps {
|
|
5
|
-
maxWidth
|
|
6
|
-
minWidth
|
|
5
|
+
maxWidth?: number | string;
|
|
6
|
+
minWidth?: number | string;
|
|
7
7
|
style: CSSProperties;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
id: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { components, createFilter, mergeStyles } from 'react-select';
|
|
|
2
2
|
export { makeAsyncSelect } from 'react-select/async';
|
|
3
3
|
export { makeCreatableSelect } from 'react-select/creatable';
|
|
4
4
|
export { CheckboxOption, RadioOption } from './components/input-options';
|
|
5
|
-
export { default } from './Select';
|
|
5
|
+
export { default, SelectWithoutAnalytics } from './Select';
|
|
6
6
|
export { default as AsyncSelect } from './AsyncSelect';
|
|
7
7
|
export { default as CheckboxSelect } from './CheckboxSelect';
|
|
8
8
|
export { default as CountrySelect } from './CountrySelect';
|
|
@@ -11,4 +11,4 @@ export { default as CreatableSelect } from './CreatableSelect';
|
|
|
11
11
|
export { default as AsyncCreatableSelect } from './AsyncCreatableSelect';
|
|
12
12
|
export { default as PopupSelect } from './PopupSelect';
|
|
13
13
|
export type { PopupSelectProps } from './PopupSelect';
|
|
14
|
-
export type { ActionMeta, ControlProps, FormatOptionLabelMeta, IndicatorComponentType, IndicatorProps, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, } from './types';
|
|
14
|
+
export type { ActionMeta, ControlProps, FormatOptionLabelMeta, IndicatorComponentType, IndicatorProps, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, } from './types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/select",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.4.0",
|
|
4
4
|
"description": "Select allows users to make a single selection or multiple selections from a list of options.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"atlaskit:src": "src/index.
|
|
16
|
+
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
19
|
"deprecatedAutoEntryPoints": true,
|
|
20
20
|
"releaseModel": "scheduled",
|
|
21
21
|
"website": {
|
|
22
|
-
"name": "Select"
|
|
22
|
+
"name": "Select",
|
|
23
|
+
"category": "Components"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"@emotion/core": "^10.0.9",
|
|
34
35
|
"@popperjs/core": "^2.9.1",
|
|
35
36
|
"@types/react-select": "^4.0.18",
|
|
37
|
+
"bind-event-listener": "^2.1.1",
|
|
36
38
|
"focus-trap": "^2.4.5",
|
|
37
39
|
"memoize-one": "^6.0.0",
|
|
38
40
|
"react-fast-compare": "^3.2.0",
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
"@atlaskit/docs": "*",
|
|
53
55
|
"@atlaskit/drawer": "^7.1.0",
|
|
54
56
|
"@atlaskit/form": "^8.5.0",
|
|
55
|
-
"@atlaskit/logo": "^13.
|
|
57
|
+
"@atlaskit/logo": "^13.8.0",
|
|
56
58
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
57
59
|
"@atlaskit/section-message": "^6.0.0",
|
|
58
60
|
"@atlaskit/ssr": "*",
|
|
@@ -72,6 +74,7 @@
|
|
|
72
74
|
},
|
|
73
75
|
"techstack": {
|
|
74
76
|
"@repo/internal": {
|
|
77
|
+
"dom-events": "use-bind-event-listener",
|
|
75
78
|
"theming": "tokens",
|
|
76
79
|
"deprecation": "no-deprecated-imports",
|
|
77
80
|
"styling": [
|
package/report.api.md
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/select"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
/// <reference types="react" />
|
|
7
|
+
|
|
8
|
+
import { ActionMeta as ActionMeta_2 } from 'react-select';
|
|
9
|
+
import { components } from 'react-select';
|
|
10
|
+
import { Context } from 'react';
|
|
11
|
+
import { ControlProps as ControlProps_2 } from 'react-select';
|
|
12
|
+
import { createFilter } from 'react-select';
|
|
13
|
+
import { default as default_2 } from 'react-select/src/Select';
|
|
14
|
+
import { default as default_3 } from 'react-select';
|
|
15
|
+
import { ErrorInfo } from 'react';
|
|
16
|
+
import { FC } from 'react';
|
|
17
|
+
import { FocusTrap } from 'focus-trap';
|
|
18
|
+
import { FormatOptionLabelMeta as FormatOptionLabelMeta_2 } from 'react-select';
|
|
19
|
+
import { GroupedOptionsType } from 'react-select';
|
|
20
|
+
import { GroupTypeBase as GroupType } from 'react-select';
|
|
21
|
+
import { IndicatorComponentType as IndicatorComponentType_2 } from 'react-select';
|
|
22
|
+
import { IndicatorProps as IndicatorProps_2 } from 'react-select';
|
|
23
|
+
import { InputProps } from 'react-select';
|
|
24
|
+
import { makeAsyncSelect } from 'react-select/async';
|
|
25
|
+
import { makeCreatableSelect } from 'react-select/creatable';
|
|
26
|
+
import { MenuListComponentProps as MenuListComponentProps_2 } from 'react-select';
|
|
27
|
+
import { MenuProps as MenuProps_2 } from 'react-select';
|
|
28
|
+
import { mergeStyles } from 'react-select';
|
|
29
|
+
import { OptionProps as OptionProps_2 } from 'react-select';
|
|
30
|
+
import { OptionsType as OptionsType_2 } from 'react-select';
|
|
31
|
+
import { PopperProps } from 'react-popper';
|
|
32
|
+
import { Props } from 'react-select';
|
|
33
|
+
import { PureComponent } from 'react';
|
|
34
|
+
import { default as React_2 } from 'react';
|
|
35
|
+
import { ReactInstance } from 'react';
|
|
36
|
+
import { ReactNode } from 'react';
|
|
37
|
+
import Select from 'react-select';
|
|
38
|
+
import { SelectComponents } from 'react-select/src/components';
|
|
39
|
+
import { SelectComponentsConfig as SelectComponentsConfig_2 } from 'react-select';
|
|
40
|
+
import { StylesConfig as StylesConfig_2 } from 'react-select';
|
|
41
|
+
import { UnbindFn } from 'bind-event-listener';
|
|
42
|
+
import { ValueContainerProps as ValueContainerProps_2 } from 'react-select';
|
|
43
|
+
import { ValueType as ValueType_2 } from 'react-select';
|
|
44
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
45
|
+
|
|
46
|
+
export declare type ActionMeta<Option = OptionType> = ActionMeta_2<Option>;
|
|
47
|
+
|
|
48
|
+
export declare const AsyncCreatableSelect: {
|
|
49
|
+
new <Option = OptionType, IsMulti extends boolean = false>(
|
|
50
|
+
props: SelectProps<Option, IsMulti>,
|
|
51
|
+
): {
|
|
52
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>;
|
|
53
|
+
select: default_3<
|
|
54
|
+
Option,
|
|
55
|
+
false,
|
|
56
|
+
GroupType<Option>,
|
|
57
|
+
default_2<Option, false, GroupType<Option>>
|
|
58
|
+
> | null;
|
|
59
|
+
UNSAFE_componentWillReceiveProps(
|
|
60
|
+
nextProps: SelectProps<Option, IsMulti>,
|
|
61
|
+
): void;
|
|
62
|
+
cacheComponents: (
|
|
63
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>,
|
|
64
|
+
) => void;
|
|
65
|
+
focus(): void;
|
|
66
|
+
blur(): void;
|
|
67
|
+
onSelectRef: (
|
|
68
|
+
ref: default_3<
|
|
69
|
+
Option,
|
|
70
|
+
false,
|
|
71
|
+
GroupType<Option>,
|
|
72
|
+
default_2<Option, false, GroupType<Option>>
|
|
73
|
+
>,
|
|
74
|
+
) => void;
|
|
75
|
+
render(): JSX.Element;
|
|
76
|
+
context: any;
|
|
77
|
+
setState<K extends never>(
|
|
78
|
+
state:
|
|
79
|
+
| {}
|
|
80
|
+
| ((
|
|
81
|
+
prevState: Readonly<{}>,
|
|
82
|
+
props: Readonly<SelectProps<Option, IsMulti>>,
|
|
83
|
+
) => {} | Pick<{}, K> | null)
|
|
84
|
+
| Pick<{}, K>
|
|
85
|
+
| null,
|
|
86
|
+
callback?: (() => void) | undefined,
|
|
87
|
+
): void;
|
|
88
|
+
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
89
|
+
readonly props: Readonly<SelectProps<Option, IsMulti>> &
|
|
90
|
+
Readonly<{
|
|
91
|
+
children?: ReactNode;
|
|
92
|
+
}>;
|
|
93
|
+
state: Readonly<{}>;
|
|
94
|
+
refs: {
|
|
95
|
+
[key: string]: ReactInstance;
|
|
96
|
+
};
|
|
97
|
+
componentDidMount?(): void;
|
|
98
|
+
shouldComponentUpdate?(
|
|
99
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
100
|
+
nextState: Readonly<{}>,
|
|
101
|
+
nextContext: any,
|
|
102
|
+
): boolean;
|
|
103
|
+
componentWillUnmount?(): void;
|
|
104
|
+
componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
|
|
105
|
+
getSnapshotBeforeUpdate?(
|
|
106
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
107
|
+
prevState: Readonly<{}>,
|
|
108
|
+
): any;
|
|
109
|
+
componentDidUpdate?(
|
|
110
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
111
|
+
prevState: Readonly<{}>,
|
|
112
|
+
snapshot?: any,
|
|
113
|
+
): void;
|
|
114
|
+
componentWillMount?(): void;
|
|
115
|
+
UNSAFE_componentWillMount?(): void;
|
|
116
|
+
componentWillReceiveProps?(
|
|
117
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
118
|
+
nextContext: any,
|
|
119
|
+
): void;
|
|
120
|
+
componentWillUpdate?(
|
|
121
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
122
|
+
nextState: Readonly<{}>,
|
|
123
|
+
nextContext: any,
|
|
124
|
+
): void;
|
|
125
|
+
UNSAFE_componentWillUpdate?(
|
|
126
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
127
|
+
nextState: Readonly<{}>,
|
|
128
|
+
nextContext: any,
|
|
129
|
+
): void;
|
|
130
|
+
};
|
|
131
|
+
defaultProps: {
|
|
132
|
+
validationState: string;
|
|
133
|
+
spacing: string;
|
|
134
|
+
onClickPreventDefault: boolean;
|
|
135
|
+
tabSelectsValue: boolean;
|
|
136
|
+
components: {};
|
|
137
|
+
styles: {};
|
|
138
|
+
};
|
|
139
|
+
contextType?: Context<any> | undefined;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export declare const AsyncSelect: {
|
|
143
|
+
new <Option = OptionType, IsMulti extends boolean = false>(
|
|
144
|
+
props: SelectProps<Option, IsMulti>,
|
|
145
|
+
): {
|
|
146
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>;
|
|
147
|
+
select: default_3<
|
|
148
|
+
Option,
|
|
149
|
+
false,
|
|
150
|
+
GroupType<Option>,
|
|
151
|
+
default_2<Option, false, GroupType<Option>>
|
|
152
|
+
> | null;
|
|
153
|
+
UNSAFE_componentWillReceiveProps(
|
|
154
|
+
nextProps: SelectProps<Option, IsMulti>,
|
|
155
|
+
): void;
|
|
156
|
+
cacheComponents: (
|
|
157
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>,
|
|
158
|
+
) => void;
|
|
159
|
+
focus(): void;
|
|
160
|
+
blur(): void;
|
|
161
|
+
onSelectRef: (
|
|
162
|
+
ref: default_3<
|
|
163
|
+
Option,
|
|
164
|
+
false,
|
|
165
|
+
GroupType<Option>,
|
|
166
|
+
default_2<Option, false, GroupType<Option>>
|
|
167
|
+
>,
|
|
168
|
+
) => void;
|
|
169
|
+
render(): JSX.Element;
|
|
170
|
+
context: any;
|
|
171
|
+
setState<K extends never>(
|
|
172
|
+
state:
|
|
173
|
+
| {}
|
|
174
|
+
| ((
|
|
175
|
+
prevState: Readonly<{}>,
|
|
176
|
+
props: Readonly<SelectProps<Option, IsMulti>>,
|
|
177
|
+
) => {} | Pick<{}, K> | null)
|
|
178
|
+
| Pick<{}, K>
|
|
179
|
+
| null,
|
|
180
|
+
callback?: (() => void) | undefined,
|
|
181
|
+
): void;
|
|
182
|
+
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
183
|
+
readonly props: Readonly<SelectProps<Option, IsMulti>> &
|
|
184
|
+
Readonly<{
|
|
185
|
+
children?: ReactNode;
|
|
186
|
+
}>;
|
|
187
|
+
state: Readonly<{}>;
|
|
188
|
+
refs: {
|
|
189
|
+
[key: string]: ReactInstance;
|
|
190
|
+
};
|
|
191
|
+
componentDidMount?(): void;
|
|
192
|
+
shouldComponentUpdate?(
|
|
193
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
194
|
+
nextState: Readonly<{}>,
|
|
195
|
+
nextContext: any,
|
|
196
|
+
): boolean;
|
|
197
|
+
componentWillUnmount?(): void;
|
|
198
|
+
componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
|
|
199
|
+
getSnapshotBeforeUpdate?(
|
|
200
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
201
|
+
prevState: Readonly<{}>,
|
|
202
|
+
): any;
|
|
203
|
+
componentDidUpdate?(
|
|
204
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
205
|
+
prevState: Readonly<{}>,
|
|
206
|
+
snapshot?: any,
|
|
207
|
+
): void;
|
|
208
|
+
componentWillMount?(): void;
|
|
209
|
+
UNSAFE_componentWillMount?(): void;
|
|
210
|
+
componentWillReceiveProps?(
|
|
211
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
212
|
+
nextContext: any,
|
|
213
|
+
): void;
|
|
214
|
+
componentWillUpdate?(
|
|
215
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
216
|
+
nextState: Readonly<{}>,
|
|
217
|
+
nextContext: any,
|
|
218
|
+
): void;
|
|
219
|
+
UNSAFE_componentWillUpdate?(
|
|
220
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
221
|
+
nextState: Readonly<{}>,
|
|
222
|
+
nextContext: any,
|
|
223
|
+
): void;
|
|
224
|
+
};
|
|
225
|
+
defaultProps: {
|
|
226
|
+
validationState: string;
|
|
227
|
+
spacing: string;
|
|
228
|
+
onClickPreventDefault: boolean;
|
|
229
|
+
tabSelectsValue: boolean;
|
|
230
|
+
components: {};
|
|
231
|
+
styles: {};
|
|
232
|
+
};
|
|
233
|
+
contextType?: Context<any> | undefined;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export declare const CheckboxOption: FC<OptionProps<OptionType, true>>;
|
|
237
|
+
|
|
238
|
+
export declare const CheckboxSelect: ({
|
|
239
|
+
components,
|
|
240
|
+
...props
|
|
241
|
+
}: SelectProps<OptionType, true>) => JSX.Element;
|
|
242
|
+
|
|
243
|
+
export { components };
|
|
244
|
+
|
|
245
|
+
export declare type ControlProps<
|
|
246
|
+
OptionType,
|
|
247
|
+
IsMulti extends boolean = false
|
|
248
|
+
> = ControlProps_2<OptionType, IsMulti>;
|
|
249
|
+
|
|
250
|
+
export declare const CountrySelect: (props: any) => JSX.Element;
|
|
251
|
+
|
|
252
|
+
export declare const CreatableSelect: {
|
|
253
|
+
new <Option = OptionType, IsMulti extends boolean = false>(
|
|
254
|
+
props: SelectProps<Option, IsMulti>,
|
|
255
|
+
): {
|
|
256
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>;
|
|
257
|
+
select: default_3<
|
|
258
|
+
Option,
|
|
259
|
+
false,
|
|
260
|
+
GroupType<Option>,
|
|
261
|
+
default_2<Option, false, GroupType<Option>>
|
|
262
|
+
> | null;
|
|
263
|
+
UNSAFE_componentWillReceiveProps(
|
|
264
|
+
nextProps: SelectProps<Option, IsMulti>,
|
|
265
|
+
): void;
|
|
266
|
+
cacheComponents: (
|
|
267
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>,
|
|
268
|
+
) => void;
|
|
269
|
+
focus(): void;
|
|
270
|
+
blur(): void;
|
|
271
|
+
onSelectRef: (
|
|
272
|
+
ref: default_3<
|
|
273
|
+
Option,
|
|
274
|
+
false,
|
|
275
|
+
GroupType<Option>,
|
|
276
|
+
default_2<Option, false, GroupType<Option>>
|
|
277
|
+
>,
|
|
278
|
+
) => void;
|
|
279
|
+
render(): JSX.Element;
|
|
280
|
+
context: any;
|
|
281
|
+
setState<K extends never>(
|
|
282
|
+
state:
|
|
283
|
+
| {}
|
|
284
|
+
| ((
|
|
285
|
+
prevState: Readonly<{}>,
|
|
286
|
+
props: Readonly<SelectProps<Option, IsMulti>>,
|
|
287
|
+
) => {} | Pick<{}, K> | null)
|
|
288
|
+
| Pick<{}, K>
|
|
289
|
+
| null,
|
|
290
|
+
callback?: (() => void) | undefined,
|
|
291
|
+
): void;
|
|
292
|
+
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
293
|
+
readonly props: Readonly<SelectProps<Option, IsMulti>> &
|
|
294
|
+
Readonly<{
|
|
295
|
+
children?: ReactNode;
|
|
296
|
+
}>;
|
|
297
|
+
state: Readonly<{}>;
|
|
298
|
+
refs: {
|
|
299
|
+
[key: string]: ReactInstance;
|
|
300
|
+
};
|
|
301
|
+
componentDidMount?(): void;
|
|
302
|
+
shouldComponentUpdate?(
|
|
303
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
304
|
+
nextState: Readonly<{}>,
|
|
305
|
+
nextContext: any,
|
|
306
|
+
): boolean;
|
|
307
|
+
componentWillUnmount?(): void;
|
|
308
|
+
componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
|
|
309
|
+
getSnapshotBeforeUpdate?(
|
|
310
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
311
|
+
prevState: Readonly<{}>,
|
|
312
|
+
): any;
|
|
313
|
+
componentDidUpdate?(
|
|
314
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
315
|
+
prevState: Readonly<{}>,
|
|
316
|
+
snapshot?: any,
|
|
317
|
+
): void;
|
|
318
|
+
componentWillMount?(): void;
|
|
319
|
+
UNSAFE_componentWillMount?(): void;
|
|
320
|
+
componentWillReceiveProps?(
|
|
321
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
322
|
+
nextContext: any,
|
|
323
|
+
): void;
|
|
324
|
+
componentWillUpdate?(
|
|
325
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
326
|
+
nextState: Readonly<{}>,
|
|
327
|
+
nextContext: any,
|
|
328
|
+
): void;
|
|
329
|
+
UNSAFE_componentWillUpdate?(
|
|
330
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
331
|
+
nextState: Readonly<{}>,
|
|
332
|
+
nextContext: any,
|
|
333
|
+
): void;
|
|
334
|
+
};
|
|
335
|
+
defaultProps: {
|
|
336
|
+
validationState: string;
|
|
337
|
+
spacing: string;
|
|
338
|
+
onClickPreventDefault: boolean;
|
|
339
|
+
tabSelectsValue: boolean;
|
|
340
|
+
components: {};
|
|
341
|
+
styles: {};
|
|
342
|
+
};
|
|
343
|
+
contextType?: Context<any> | undefined;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export { createFilter };
|
|
347
|
+
|
|
348
|
+
declare const _default: {
|
|
349
|
+
new <Option = OptionType, IsMulti extends boolean = false>(
|
|
350
|
+
props: SelectProps<Option, IsMulti>,
|
|
351
|
+
): {
|
|
352
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>;
|
|
353
|
+
select: Select<
|
|
354
|
+
Option,
|
|
355
|
+
false,
|
|
356
|
+
GroupType<Option>,
|
|
357
|
+
default_2<Option, false, GroupType<Option>>
|
|
358
|
+
> | null;
|
|
359
|
+
UNSAFE_componentWillReceiveProps(
|
|
360
|
+
nextProps: SelectProps<Option, IsMulti>,
|
|
361
|
+
): void;
|
|
362
|
+
cacheComponents: (
|
|
363
|
+
components: Partial<SelectComponents<Option, IsMulti, GroupType<Option>>>,
|
|
364
|
+
) => void;
|
|
365
|
+
focus(): void;
|
|
366
|
+
blur(): void;
|
|
367
|
+
onSelectRef: (
|
|
368
|
+
ref: Select<
|
|
369
|
+
Option,
|
|
370
|
+
false,
|
|
371
|
+
GroupType<Option>,
|
|
372
|
+
default_2<Option, false, GroupType<Option>>
|
|
373
|
+
>,
|
|
374
|
+
) => void;
|
|
375
|
+
render(): JSX.Element;
|
|
376
|
+
context: any;
|
|
377
|
+
setState<K extends never>(
|
|
378
|
+
state:
|
|
379
|
+
| {}
|
|
380
|
+
| ((
|
|
381
|
+
prevState: Readonly<{}>,
|
|
382
|
+
props: Readonly<SelectProps<Option, IsMulti>>,
|
|
383
|
+
) => {} | Pick<{}, K> | null)
|
|
384
|
+
| Pick<{}, K>
|
|
385
|
+
| null,
|
|
386
|
+
callback?: (() => void) | undefined,
|
|
387
|
+
): void;
|
|
388
|
+
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
389
|
+
readonly props: Readonly<SelectProps<Option, IsMulti>> &
|
|
390
|
+
Readonly<{
|
|
391
|
+
children?: ReactNode;
|
|
392
|
+
}>;
|
|
393
|
+
state: Readonly<{}>;
|
|
394
|
+
refs: {
|
|
395
|
+
[key: string]: ReactInstance;
|
|
396
|
+
};
|
|
397
|
+
componentDidMount?(): void;
|
|
398
|
+
shouldComponentUpdate?(
|
|
399
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
400
|
+
nextState: Readonly<{}>,
|
|
401
|
+
nextContext: any,
|
|
402
|
+
): boolean;
|
|
403
|
+
componentWillUnmount?(): void;
|
|
404
|
+
componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
|
|
405
|
+
getSnapshotBeforeUpdate?(
|
|
406
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
407
|
+
prevState: Readonly<{}>,
|
|
408
|
+
): any;
|
|
409
|
+
componentDidUpdate?(
|
|
410
|
+
prevProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
411
|
+
prevState: Readonly<{}>,
|
|
412
|
+
snapshot?: any,
|
|
413
|
+
): void;
|
|
414
|
+
componentWillMount?(): void;
|
|
415
|
+
UNSAFE_componentWillMount?(): void;
|
|
416
|
+
componentWillReceiveProps?(
|
|
417
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
418
|
+
nextContext: any,
|
|
419
|
+
): void;
|
|
420
|
+
componentWillUpdate?(
|
|
421
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
422
|
+
nextState: Readonly<{}>,
|
|
423
|
+
nextContext: any,
|
|
424
|
+
): void;
|
|
425
|
+
UNSAFE_componentWillUpdate?(
|
|
426
|
+
nextProps: Readonly<SelectProps<Option, IsMulti>>,
|
|
427
|
+
nextState: Readonly<{}>,
|
|
428
|
+
nextContext: any,
|
|
429
|
+
): void;
|
|
430
|
+
};
|
|
431
|
+
defaultProps: {
|
|
432
|
+
validationState: string;
|
|
433
|
+
spacing: string;
|
|
434
|
+
onClickPreventDefault: boolean;
|
|
435
|
+
tabSelectsValue: boolean;
|
|
436
|
+
components: {};
|
|
437
|
+
styles: {};
|
|
438
|
+
};
|
|
439
|
+
contextType?: Context<any> | undefined;
|
|
440
|
+
};
|
|
441
|
+
export default _default;
|
|
442
|
+
|
|
443
|
+
declare type defaultModifiers = 'offset' | 'preventOverflow';
|
|
444
|
+
|
|
445
|
+
export declare type FormatOptionLabelMeta<
|
|
446
|
+
OptionType,
|
|
447
|
+
IsMulti extends boolean = false
|
|
448
|
+
> = FormatOptionLabelMeta_2<OptionType, IsMulti>;
|
|
449
|
+
|
|
450
|
+
export { GroupedOptionsType };
|
|
451
|
+
|
|
452
|
+
export { GroupType };
|
|
453
|
+
|
|
454
|
+
export declare type IndicatorComponentType<
|
|
455
|
+
OptionType,
|
|
456
|
+
IsMulti extends boolean = false
|
|
457
|
+
> = IndicatorComponentType_2<OptionType, IsMulti>;
|
|
458
|
+
|
|
459
|
+
export declare type IndicatorProps<
|
|
460
|
+
OptionType,
|
|
461
|
+
IsMulti extends boolean = false
|
|
462
|
+
> = IndicatorProps_2<OptionType, IsMulti>;
|
|
463
|
+
|
|
464
|
+
export { InputProps };
|
|
465
|
+
|
|
466
|
+
export { makeAsyncSelect };
|
|
467
|
+
|
|
468
|
+
export { makeCreatableSelect };
|
|
469
|
+
|
|
470
|
+
export declare type MenuListComponentProps<
|
|
471
|
+
OptionType,
|
|
472
|
+
IsMulti extends boolean = false
|
|
473
|
+
> = MenuListComponentProps_2<OptionType, IsMulti>;
|
|
474
|
+
|
|
475
|
+
export declare type MenuProps<
|
|
476
|
+
OptionType,
|
|
477
|
+
IsMulti extends boolean = false
|
|
478
|
+
> = MenuProps_2<OptionType, IsMulti>;
|
|
479
|
+
|
|
480
|
+
export { mergeStyles };
|
|
481
|
+
|
|
482
|
+
export declare interface OptionProps<
|
|
483
|
+
Option = OptionType,
|
|
484
|
+
IsMulti extends boolean = false
|
|
485
|
+
> extends OptionProps_2<Option, IsMulti> {
|
|
486
|
+
[key: string]: any;
|
|
487
|
+
Icon?: React.ComponentType<{
|
|
488
|
+
label: string;
|
|
489
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
490
|
+
onClick?: (e: MouseEvent) => void;
|
|
491
|
+
primaryColor?: string;
|
|
492
|
+
secondaryColor?: string;
|
|
493
|
+
}>;
|
|
494
|
+
isDisabled: boolean;
|
|
495
|
+
isFocused: boolean;
|
|
496
|
+
isSelected: boolean;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export declare type OptionsType<Option = OptionType> = OptionsType_2<Option>;
|
|
500
|
+
|
|
501
|
+
export declare interface OptionType {
|
|
502
|
+
[key: string]: any;
|
|
503
|
+
label: string;
|
|
504
|
+
value: string | number;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
declare type PopperPropsNoChildren<Modifiers> = Omit<
|
|
508
|
+
PopperProps<Modifiers>,
|
|
509
|
+
'children'
|
|
510
|
+
>;
|
|
511
|
+
|
|
512
|
+
export declare class PopupSelect<
|
|
513
|
+
Option = OptionType,
|
|
514
|
+
IsMulti extends boolean = false
|
|
515
|
+
> extends PureComponent<PopupSelectProps<Option, IsMulti>, State> {
|
|
516
|
+
focusTrap: FocusTrap | null;
|
|
517
|
+
menuRef: HTMLElement | null;
|
|
518
|
+
selectRef: Select<Option, IsMulti> | null;
|
|
519
|
+
targetRef: HTMLElement | null;
|
|
520
|
+
unbindWindowClick: UnbindFn | null;
|
|
521
|
+
unbindWindowKeydown: UnbindFn | null;
|
|
522
|
+
defaultStyles: StylesConfig<Option, IsMulti>;
|
|
523
|
+
isOpenControlled: boolean;
|
|
524
|
+
defaultOpenState: boolean | undefined;
|
|
525
|
+
state: {
|
|
526
|
+
isOpen: boolean;
|
|
527
|
+
mergedComponents: {
|
|
528
|
+
Control: React_2.FC<ControlProps<OptionType, boolean>>;
|
|
529
|
+
DropdownIndicator: () => JSX.Element;
|
|
530
|
+
Menu: ({
|
|
531
|
+
children,
|
|
532
|
+
innerProps,
|
|
533
|
+
...props
|
|
534
|
+
}: MenuProps<OptionType, boolean>) => JSX.Element;
|
|
535
|
+
};
|
|
536
|
+
mergedPopperProps: PopperPropsNoChildren<string>;
|
|
537
|
+
};
|
|
538
|
+
popperWrapperId: string;
|
|
539
|
+
static defaultProps: {
|
|
540
|
+
closeMenuOnSelect: boolean;
|
|
541
|
+
components: {};
|
|
542
|
+
maxMenuHeight: number;
|
|
543
|
+
maxMenuWidth: number;
|
|
544
|
+
minMenuWidth: number;
|
|
545
|
+
popperProps: {};
|
|
546
|
+
searchThreshold: number;
|
|
547
|
+
styles: {};
|
|
548
|
+
options: never[];
|
|
549
|
+
};
|
|
550
|
+
static getDerivedStateFromProps(
|
|
551
|
+
props: PopupSelectProps<OptionType>,
|
|
552
|
+
state: State,
|
|
553
|
+
): Partial<State<string>> | null;
|
|
554
|
+
componentDidMount(): void;
|
|
555
|
+
componentWillUnmount(): void;
|
|
556
|
+
componentDidUpdate(prevProps: PopupSelectProps<Option, IsMulti>): void;
|
|
557
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
558
|
+
handleClick: ({ target }: MouseEvent) => void;
|
|
559
|
+
handleSelectChange: (
|
|
560
|
+
value: ValueType<Option, IsMulti>,
|
|
561
|
+
actionMeta: ActionMeta<Option>,
|
|
562
|
+
) => void;
|
|
563
|
+
/**
|
|
564
|
+
* Opens the popup
|
|
565
|
+
*
|
|
566
|
+
* @param options.controlOverride - Force the popup to open when it's open state is being controlled
|
|
567
|
+
*/
|
|
568
|
+
open: (
|
|
569
|
+
options?:
|
|
570
|
+
| {
|
|
571
|
+
controlOverride?: boolean | undefined;
|
|
572
|
+
}
|
|
573
|
+
| undefined,
|
|
574
|
+
) => void;
|
|
575
|
+
initialiseFocusTrap: () => void;
|
|
576
|
+
/**
|
|
577
|
+
* Closes the popup
|
|
578
|
+
*
|
|
579
|
+
* @param options.controlOverride - Force the popup to close when it's open state is being controlled
|
|
580
|
+
*/
|
|
581
|
+
close: (
|
|
582
|
+
options?:
|
|
583
|
+
| {
|
|
584
|
+
controlOverride?: boolean | undefined;
|
|
585
|
+
}
|
|
586
|
+
| undefined,
|
|
587
|
+
) => void;
|
|
588
|
+
resolveTargetRef: (
|
|
589
|
+
popperRef: React_2.Ref<HTMLElement>,
|
|
590
|
+
) => (ref: HTMLElement) => void;
|
|
591
|
+
resolveMenuRef: (
|
|
592
|
+
popperRef: React_2.Ref<HTMLElement>,
|
|
593
|
+
) => (ref: HTMLElement) => void;
|
|
594
|
+
getSelectRef: (ref: Select<Option, IsMulti>) => void;
|
|
595
|
+
getItemCount: () => number;
|
|
596
|
+
getMaxHeight: () => number | undefined;
|
|
597
|
+
showSearchControl: () => boolean;
|
|
598
|
+
renderSelect: () => JSX.Element | null;
|
|
599
|
+
render(): JSX.Element;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export declare interface PopupSelectProps<
|
|
603
|
+
Option = OptionType,
|
|
604
|
+
IsMulti extends boolean = false,
|
|
605
|
+
Modifiers = string
|
|
606
|
+
> extends Props<Option, IsMulti> {
|
|
607
|
+
/**
|
|
608
|
+
* Defines whether the menu should close when selected. Defaults to "true"
|
|
609
|
+
*/
|
|
610
|
+
closeMenuOnSelect?: boolean;
|
|
611
|
+
/**
|
|
612
|
+
* The footer content shown at the bottom of the Popup, underneath the Select options
|
|
613
|
+
*/
|
|
614
|
+
footer?: ReactNode;
|
|
615
|
+
/**
|
|
616
|
+
The props passed down to React Popper.
|
|
617
|
+
|
|
618
|
+
Use these to override the default positioning strategy, behaviour and placement used by this library.
|
|
619
|
+
For more information, see the [React Popper documentation](https://popper.js.org/react-popper/v2/render-props).
|
|
620
|
+
|
|
621
|
+
*/
|
|
622
|
+
popperProps?: PopperPropsNoChildren<Modifiers>;
|
|
623
|
+
/**
|
|
624
|
+
* The maximum number of options the Select can contain without rendering the search field.
|
|
625
|
+
*/
|
|
626
|
+
searchThreshold?: number;
|
|
627
|
+
/**
|
|
628
|
+
* The maximum width for the popup menu. Can be a number, representing width in pixels,
|
|
629
|
+
* or a string containing a CSS length datatype.
|
|
630
|
+
*/
|
|
631
|
+
maxMenuWidth?: number | string;
|
|
632
|
+
/**
|
|
633
|
+
* The maximum width for the popup menu. Can be a number, representing width in pixels,
|
|
634
|
+
* or a string containing a CSS length datatype.
|
|
635
|
+
*/
|
|
636
|
+
minMenuWidth?: number | string;
|
|
637
|
+
/**
|
|
638
|
+
Render props used to anchor the popup to your content.
|
|
639
|
+
|
|
640
|
+
Make this an interactive element, such as an @atlaskit/button component.
|
|
641
|
+
|
|
642
|
+
The provided render props in `options` are detailed below:
|
|
643
|
+
- `isOpen`: The current state of the popup.
|
|
644
|
+
Use this to change the appearance of your target based on the state of your component
|
|
645
|
+
- `ref`: Pass this ref to the element the Popup should be attached to
|
|
646
|
+
- `aria-haspopup`, `aria-expanded`, `aria-controls`: Spread these onto a target element to
|
|
647
|
+
ensure your experience is accessible
|
|
648
|
+
*/
|
|
649
|
+
target?: (
|
|
650
|
+
options: PopupSelectTriggerProps & {
|
|
651
|
+
isOpen: boolean;
|
|
652
|
+
},
|
|
653
|
+
) => ReactNode;
|
|
654
|
+
isOpen?: boolean;
|
|
655
|
+
defaultIsOpen?: boolean;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
declare interface PopupSelectTriggerProps {
|
|
659
|
+
ref: any;
|
|
660
|
+
'aria-haspopup': 'true';
|
|
661
|
+
'aria-expanded': boolean;
|
|
662
|
+
'aria-controls'?: string;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export declare const RadioOption: FC<OptionProps>;
|
|
666
|
+
|
|
667
|
+
export declare const RadioSelect: ({
|
|
668
|
+
components,
|
|
669
|
+
...props
|
|
670
|
+
}: SelectProps<OptionType>) => JSX.Element;
|
|
671
|
+
|
|
672
|
+
export declare type SelectComponentsConfig<
|
|
673
|
+
OptionType,
|
|
674
|
+
IsMulti extends boolean = false
|
|
675
|
+
> = SelectComponentsConfig_2<OptionType, IsMulti>;
|
|
676
|
+
|
|
677
|
+
export declare interface SelectProps<
|
|
678
|
+
OptionType,
|
|
679
|
+
IsMulti extends boolean = false
|
|
680
|
+
> extends Props<OptionType, IsMulti>,
|
|
681
|
+
WithAnalyticsEventsProps {
|
|
682
|
+
spacing?: 'compact' | 'default';
|
|
683
|
+
validationState?: ValidationState;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
declare interface State<Modifiers = string> {
|
|
687
|
+
isOpen: boolean;
|
|
688
|
+
mergedComponents: Object;
|
|
689
|
+
mergedPopperProps: PopperPropsNoChildren<defaultModifiers | Modifiers>;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
export declare type StylesConfig<
|
|
693
|
+
Option = OptionType,
|
|
694
|
+
IsMulti extends boolean = false
|
|
695
|
+
> = StylesConfig_2<Option, IsMulti>;
|
|
696
|
+
|
|
697
|
+
declare type ValidationState = 'default' | 'error' | 'success';
|
|
698
|
+
|
|
699
|
+
export declare type ValueContainerProps<
|
|
700
|
+
OptionType,
|
|
701
|
+
IsMulti extends boolean = false
|
|
702
|
+
> = ValueContainerProps_2<OptionType, IsMulti>;
|
|
703
|
+
|
|
704
|
+
export declare type ValueType<
|
|
705
|
+
OptionType,
|
|
706
|
+
IsMulti extends boolean = false
|
|
707
|
+
> = ValueType_2<OptionType, IsMulti>;
|
|
708
|
+
|
|
709
|
+
export {};
|
|
710
|
+
```
|