@atlaskit/select 17.11.12 → 17.11.13
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 +9 -0
- package/dist/cjs/PopupSelect/PopupSelect.js +13 -13
- package/dist/cjs/PopupSelect/components.js +9 -14
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/createSelect.js +1 -3
- package/dist/cjs/utils/grouped-options-announcement.js +5 -4
- package/dist/es2019/PopupSelect/PopupSelect.js +14 -14
- package/dist/es2019/PopupSelect/components.js +9 -8
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/createSelect.js +1 -1
- package/dist/es2019/utils/grouped-options-announcement.js +6 -5
- package/dist/esm/PopupSelect/PopupSelect.js +14 -14
- package/dist/esm/PopupSelect/components.js +9 -14
- package/dist/esm/Select.js +1 -1
- package/dist/esm/createSelect.js +2 -4
- package/dist/esm/utils/grouped-options-announcement.js +5 -4
- package/dist/types/PopupSelect/PopupSelect.d.ts +1 -5
- package/dist/types/PopupSelect/components.d.ts +7 -5
- package/dist/types/utils/grouped-options-announcement.d.ts +1 -1
- package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +1 -5
- package/dist/types-ts4.5/PopupSelect/components.d.ts +7 -5
- package/dist/types-ts4.5/utils/grouped-options-announcement.d.ts +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 17.11.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#127125](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/127125)
|
|
8
|
+
[`8ebc56af5f1ca`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8ebc56af5f1ca) -
|
|
9
|
+
Revert due to HOT-110871 - causing Jira red master
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 17.11.12
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -21,9 +21,10 @@ var _reactDom = require("react-dom");
|
|
|
21
21
|
var _reactFocusLock = _interopRequireDefault(require("react-focus-lock"));
|
|
22
22
|
var _reactNodeResolver = _interopRequireDefault(require("react-node-resolver"));
|
|
23
23
|
var _reactPopper = require("react-popper");
|
|
24
|
-
var _reactSelect = require("react-select");
|
|
24
|
+
var _reactSelect = _interopRequireWildcard(require("react-select"));
|
|
25
25
|
var _reactUid = require("react-uid");
|
|
26
26
|
var _shallowEqual = require("shallow-equal");
|
|
27
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
28
|
var _colors = require("@atlaskit/theme/colors");
|
|
28
29
|
var _Select = _interopRequireDefault(require("../Select"));
|
|
29
30
|
var _styles = _interopRequireDefault(require("../styles"));
|
|
@@ -85,7 +86,6 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
85
86
|
}
|
|
86
87
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
87
88
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "menuRef", null);
|
|
88
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectRef", null);
|
|
89
89
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", null);
|
|
90
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowClick", null);
|
|
91
91
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowKeydown", null);
|
|
@@ -191,7 +191,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
191
191
|
});
|
|
192
192
|
if (_this.selectRef) {
|
|
193
193
|
var _this$selectRef$selec;
|
|
194
|
-
(_this$selectRef$selec = _this.selectRef.select) === null || _this$selectRef$selec === void 0
|
|
194
|
+
(0, _platformFeatureFlags.fg)('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef$selec = _this.selectRef.select) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.openMenu('first') : _this.selectRef.openMenu('first');
|
|
195
195
|
}
|
|
196
196
|
if (typeof window === 'undefined') {
|
|
197
197
|
return;
|
|
@@ -289,7 +289,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
289
289
|
|
|
290
290
|
// subtract the control height to maintain consistency
|
|
291
291
|
var showSearchControl = _this.showSearchControl();
|
|
292
|
-
var controlRef = (_this$selectRef$selec2 = _this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef;
|
|
292
|
+
var controlRef = (0, _platformFeatureFlags.fg)('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef$selec2 = _this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef : _this.selectRef.controlRef;
|
|
293
293
|
var offsetHeight = showSearchControl && controlRef ? controlRef.offsetHeight : 0;
|
|
294
294
|
var maxHeight = maxMenuHeight - offsetHeight;
|
|
295
295
|
return maxHeight;
|
|
@@ -333,28 +333,29 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
333
333
|
return placeholder;
|
|
334
334
|
}
|
|
335
335
|
};
|
|
336
|
+
var InternalSelect = (0, _platformFeatureFlags.fg)('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? _Select.default : _reactSelect.default;
|
|
336
337
|
var providedAriaLabel = getLabel();
|
|
337
338
|
var updateInputAriaLabel = function updateInputAriaLabel(ariaLabelText) {
|
|
338
|
-
var _this$selectRef;
|
|
339
|
+
var _this$selectRef, _this$selectRef2;
|
|
339
340
|
// Update aria-label to get first announcement when popup opened.
|
|
340
|
-
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef) {
|
|
341
|
-
var _this$
|
|
341
|
+
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef || (_this$selectRef2 = _this.selectRef) !== null && _this$selectRef2 !== void 0 && _this$selectRef2.inputRef) {
|
|
342
|
+
var _this$selectRef3, _this$selectRef4;
|
|
342
343
|
if (providedAriaLabel) {
|
|
343
344
|
ariaLabelText = "".concat(providedAriaLabel, ". ").concat(ariaLabelText);
|
|
344
345
|
}
|
|
345
|
-
(_this$
|
|
346
|
+
(0, _platformFeatureFlags.fg)('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef3 = _this.selectRef) === null || _this$selectRef3 === void 0 || (_this$selectRef3 = _this$selectRef3.select.inputRef) === null || _this$selectRef3 === void 0 ? void 0 : _this$selectRef3.setAttribute('aria-label', ariaLabelText) : (_this$selectRef4 = _this.selectRef) === null || _this$selectRef4 === void 0 || (_this$selectRef4 = _this$selectRef4.inputRef) === null || _this$selectRef4 === void 0 ? void 0 : _this$selectRef4.setAttribute('aria-label', ariaLabelText);
|
|
346
347
|
}
|
|
347
348
|
};
|
|
348
349
|
var generateNoGroupsAriaText = function generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix) {
|
|
349
350
|
var _options$findIndex;
|
|
350
351
|
var focused = onFocusProps.focused;
|
|
351
352
|
var options = (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
352
|
-
var totalLength = options === null || options === void 0 ? void 0 : options.length;
|
|
353
|
+
var totalLength = (options === null || options === void 0 ? void 0 : options.length) + 1;
|
|
353
354
|
var optionIndex = (_options$findIndex = options === null || options === void 0 ? void 0 : options.findIndex(function (option) {
|
|
354
355
|
return option === focused;
|
|
355
356
|
})) !== null && _options$findIndex !== void 0 ? _options$findIndex : 0;
|
|
356
357
|
var optionName = typeof (props === null || props === void 0 ? void 0 : props.getOptionLabel) === 'function' ? props.getOptionLabel(focused) : focused.label;
|
|
357
|
-
var ariaLabelText = "Option ".concat(optionName, " focused, ").concat(optionIndex
|
|
358
|
+
var ariaLabelText = "Option ".concat(optionName, " focused, ").concat(optionIndex, " of ").concat(totalLength, ".\n\t\t\t").concat(totalLength, " results available.\n\t\t\t").concat(ariaLabelSuffix, "\n\t\t\t");
|
|
358
359
|
// Option LABEL focused, 1 of 8. 8 results available.
|
|
359
360
|
// Use Up and Down to choose options, press Enter to select the currently focused option,
|
|
360
361
|
// press Escape to exit the menu.
|
|
@@ -368,7 +369,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
368
369
|
if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
|
|
369
370
|
if ((0, _groupedOptionsAnnouncement.isOptionsGrouped)(props.options)) {
|
|
370
371
|
var totalLength = (0, _groupedOptionsAnnouncement.countAllOptions)(props.options);
|
|
371
|
-
ariaLiveMessage = (0, _groupedOptionsAnnouncement.onFocus)(onFocusProps
|
|
372
|
+
ariaLiveMessage = (0, _groupedOptionsAnnouncement.onFocus)(onFocusProps);
|
|
372
373
|
ariaLabelText = "".concat(ariaLiveMessage, " ").concat(totalLength, " results available. ").concat(ariaLabelSuffix);
|
|
373
374
|
} else {
|
|
374
375
|
ariaLabelText = generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix);
|
|
@@ -377,7 +378,6 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
377
378
|
updateInputAriaLabel(ariaLabelText);
|
|
378
379
|
return ariaLiveMessage;
|
|
379
380
|
}
|
|
380
|
-
return ariaLiveMessage;
|
|
381
381
|
};
|
|
382
382
|
var popper = /*#__PURE__*/_react.default.createElement(_reactPopper.Popper, (0, _extends2.default)({}, mergedPopperProps, {
|
|
383
383
|
onFirstUpdate: function onFirstUpdate(state) {
|
|
@@ -403,7 +403,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
403
403
|
}, /*#__PURE__*/_react.default.createElement(_reactFocusLock.default, {
|
|
404
404
|
disabled: !focusLockEnabled,
|
|
405
405
|
returnFocus: true
|
|
406
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
406
|
+
}, /*#__PURE__*/_react.default.createElement(InternalSelect, (0, _extends2.default)({
|
|
407
407
|
"aria-label": providedAriaLabel,
|
|
408
408
|
backspaceRemovesValue: false,
|
|
409
409
|
controlShouldRenderValue: false,
|
|
@@ -90,9 +90,16 @@ var Control = function Control(_ref2) {
|
|
|
90
90
|
})));
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
94
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
93
95
|
/**
|
|
94
96
|
* __Dummy control__
|
|
95
|
-
*
|
|
97
|
+
*
|
|
98
|
+
* A dummy control {description}.
|
|
99
|
+
*
|
|
100
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
101
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
102
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
96
103
|
*/
|
|
97
104
|
var DummyControl = exports.DummyControl = function DummyControl(props) {
|
|
98
105
|
return (0, _react.jsx)(_visuallyHidden.default, null, (0, _react.jsx)(_reactSelect.components.Control, props));
|
|
@@ -104,20 +111,8 @@ var Menu = function Menu(_ref3) {
|
|
|
104
111
|
innerProps = _ref3.innerProps;
|
|
105
112
|
return (0, _react.jsx)("div", innerProps, children);
|
|
106
113
|
};
|
|
107
|
-
var IndicatorSeparator = function IndicatorSeparator(props) {
|
|
108
|
-
return (0, _react.jsx)(_reactSelect.components.IndicatorSeparator, props);
|
|
109
|
-
};
|
|
110
|
-
var ClearIndicator = function ClearIndicator(props) {
|
|
111
|
-
return (0, _react.jsx)(_reactSelect.components.ClearIndicator, props);
|
|
112
|
-
};
|
|
113
|
-
var MultiValueRemove = function MultiValueRemove(props) {
|
|
114
|
-
return (0, _react.jsx)(_reactSelect.components.MultiValueRemove, props);
|
|
115
|
-
};
|
|
116
114
|
var defaultComponents = exports.defaultComponents = {
|
|
117
115
|
Control: Control,
|
|
118
116
|
DropdownIndicator: DropdownIndicator,
|
|
119
|
-
Menu: Menu
|
|
120
|
-
IndicatorSeparator: IndicatorSeparator,
|
|
121
|
-
ClearIndicator: ClearIndicator,
|
|
122
|
-
MultiValueRemove: MultiValueRemove
|
|
117
|
+
Menu: Menu
|
|
123
118
|
};
|
package/dist/cjs/Select.js
CHANGED
|
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
|
9
9
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
10
10
|
var _createSelect = _interopRequireDefault(require("./createSelect"));
|
|
11
11
|
var packageName = "@atlaskit/select";
|
|
12
|
-
var packageVersion = "17.11.
|
|
12
|
+
var packageVersion = "17.11.13";
|
|
13
13
|
var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
|
|
14
14
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
15
15
|
var Select = (0, _analyticsNext.withAnalyticsContext)({
|
package/dist/cjs/createSelect.js
CHANGED
|
@@ -90,9 +90,7 @@ function createSelect(WrappedComponent) {
|
|
|
90
90
|
ref: internalSelectRef,
|
|
91
91
|
"aria-live": "assertive",
|
|
92
92
|
ariaLiveMessages: (0, _groupedOptionsAnnouncement.isOptionsGrouped)(props.options) ? _objectSpread({
|
|
93
|
-
onFocus:
|
|
94
|
-
return (0, _groupedOptionsAnnouncement.onFocus)(data, props.options);
|
|
95
|
-
}
|
|
93
|
+
onFocus: _groupedOptionsAnnouncement.onFocus
|
|
96
94
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages),
|
|
97
95
|
tabSelectsValue: tabSelectsValue,
|
|
98
96
|
onClickPreventDefault: onClickPreventDefault
|
|
@@ -7,13 +7,14 @@ exports.isOptionsGrouped = exports.countAllOptions = void 0;
|
|
|
7
7
|
exports.onFocus = onFocus;
|
|
8
8
|
// Used for overwriting ariaLiveMessages builtin onFocus method.
|
|
9
9
|
// Returns custom built string while focusing each group option. This string is used for screen reader announcement.
|
|
10
|
-
function onFocus(
|
|
10
|
+
function onFocus(props) {
|
|
11
11
|
var _groupData$options$fi;
|
|
12
|
-
var focused =
|
|
12
|
+
var focused = props.focused,
|
|
13
|
+
options = props.options;
|
|
13
14
|
var isOptionFocused = function isOptionFocused(option) {
|
|
14
|
-
return option
|
|
15
|
+
return option === focused;
|
|
15
16
|
};
|
|
16
|
-
var groupData =
|
|
17
|
+
var groupData = options === null || options === void 0 ? void 0 : options.find(function (option) {
|
|
17
18
|
var _option$options;
|
|
18
19
|
return (_option$options = option.options) === null || _option$options === void 0 ? void 0 : _option$options.some(isOptionFocused);
|
|
19
20
|
});
|
|
@@ -6,11 +6,12 @@ import { createPortal } from 'react-dom';
|
|
|
6
6
|
import FocusLock from 'react-focus-lock';
|
|
7
7
|
import NodeResolver from 'react-node-resolver';
|
|
8
8
|
import { Manager, Popper, Reference } from 'react-popper';
|
|
9
|
-
import { mergeStyles } from 'react-select';
|
|
9
|
+
import Select, { mergeStyles } from 'react-select';
|
|
10
10
|
import { uid } from 'react-uid';
|
|
11
11
|
import { shallowEqualObjects } from 'shallow-equal';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { N80 } from '@atlaskit/theme/colors';
|
|
13
|
-
import
|
|
14
|
+
import DefaultSelect from '../Select';
|
|
14
15
|
import baseStyles from '../styles';
|
|
15
16
|
import { countAllOptions, isOptionsGrouped, onFocus } from '../utils/grouped-options-announcement';
|
|
16
17
|
import { defaultComponents, DummyControl, MenuDialog } from './components';
|
|
@@ -52,7 +53,6 @@ export default class PopupSelect extends PureComponent {
|
|
|
52
53
|
var _this$defaultOpenStat;
|
|
53
54
|
super(...args);
|
|
54
55
|
_defineProperty(this, "menuRef", null);
|
|
55
|
-
_defineProperty(this, "selectRef", null);
|
|
56
56
|
_defineProperty(this, "targetRef", null);
|
|
57
57
|
_defineProperty(this, "unbindWindowClick", null);
|
|
58
58
|
_defineProperty(this, "unbindWindowKeydown", null);
|
|
@@ -163,7 +163,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
163
163
|
});
|
|
164
164
|
if (this.selectRef) {
|
|
165
165
|
var _this$selectRef$selec;
|
|
166
|
-
(_this$selectRef$selec = this.selectRef.select) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.openMenu('first');
|
|
166
|
+
fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef$selec = this.selectRef.select) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.openMenu('first') : this.selectRef.openMenu('first');
|
|
167
167
|
}
|
|
168
168
|
if (typeof window === 'undefined') {
|
|
169
169
|
return;
|
|
@@ -261,7 +261,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
261
261
|
|
|
262
262
|
// subtract the control height to maintain consistency
|
|
263
263
|
const showSearchControl = this.showSearchControl();
|
|
264
|
-
|
|
264
|
+
let controlRef = fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef$selec2 = this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef : this.selectRef.controlRef;
|
|
265
265
|
const offsetHeight = showSearchControl && controlRef ? controlRef.offsetHeight : 0;
|
|
266
266
|
const maxHeight = maxMenuHeight - offsetHeight;
|
|
267
267
|
return maxHeight;
|
|
@@ -309,16 +309,17 @@ export default class PopupSelect extends PureComponent {
|
|
|
309
309
|
return placeholder;
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
+
const InternalSelect = fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? DefaultSelect : Select;
|
|
312
313
|
const providedAriaLabel = getLabel();
|
|
313
314
|
const updateInputAriaLabel = ariaLabelText => {
|
|
314
|
-
var _this$selectRef, _this$selectRef$selec3;
|
|
315
|
+
var _this$selectRef, _this$selectRef$selec3, _this$selectRef2;
|
|
315
316
|
// Update aria-label to get first announcement when popup opened.
|
|
316
|
-
if ((_this$selectRef = this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef$selec3 = _this$selectRef.select) !== null && _this$selectRef$selec3 !== void 0 && _this$selectRef$selec3.inputRef) {
|
|
317
|
-
var _this$
|
|
317
|
+
if ((_this$selectRef = this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef$selec3 = _this$selectRef.select) !== null && _this$selectRef$selec3 !== void 0 && _this$selectRef$selec3.inputRef || (_this$selectRef2 = this.selectRef) !== null && _this$selectRef2 !== void 0 && _this$selectRef2.inputRef) {
|
|
318
|
+
var _this$selectRef3, _this$selectRef3$sele, _this$selectRef4, _this$selectRef4$inpu;
|
|
318
319
|
if (providedAriaLabel) {
|
|
319
320
|
ariaLabelText = `${providedAriaLabel}. ${ariaLabelText}`;
|
|
320
321
|
}
|
|
321
|
-
(_this$
|
|
322
|
+
fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 ? void 0 : (_this$selectRef3$sele = _this$selectRef3.select.inputRef) === null || _this$selectRef3$sele === void 0 ? void 0 : _this$selectRef3$sele.setAttribute('aria-label', ariaLabelText) : (_this$selectRef4 = this.selectRef) === null || _this$selectRef4 === void 0 ? void 0 : (_this$selectRef4$inpu = _this$selectRef4.inputRef) === null || _this$selectRef4$inpu === void 0 ? void 0 : _this$selectRef4$inpu.setAttribute('aria-label', ariaLabelText);
|
|
322
323
|
}
|
|
323
324
|
};
|
|
324
325
|
const generateNoGroupsAriaText = (onFocusProps, ariaLabelSuffix) => {
|
|
@@ -327,10 +328,10 @@ export default class PopupSelect extends PureComponent {
|
|
|
327
328
|
focused
|
|
328
329
|
} = onFocusProps;
|
|
329
330
|
const options = (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
330
|
-
const totalLength = options === null || options === void 0 ? void 0 : options.length;
|
|
331
|
+
const totalLength = (options === null || options === void 0 ? void 0 : options.length) + 1;
|
|
331
332
|
const optionIndex = (_options$findIndex = options === null || options === void 0 ? void 0 : options.findIndex(option => option === focused)) !== null && _options$findIndex !== void 0 ? _options$findIndex : 0;
|
|
332
333
|
const optionName = typeof (props === null || props === void 0 ? void 0 : props.getOptionLabel) === 'function' ? props.getOptionLabel(focused) : focused.label;
|
|
333
|
-
const ariaLabelText = `Option ${optionName} focused, ${optionIndex
|
|
334
|
+
const ariaLabelText = `Option ${optionName} focused, ${optionIndex} of ${totalLength}.
|
|
334
335
|
${totalLength} results available.
|
|
335
336
|
${ariaLabelSuffix}
|
|
336
337
|
`;
|
|
@@ -347,7 +348,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
347
348
|
if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
|
|
348
349
|
if (isOptionsGrouped(props.options)) {
|
|
349
350
|
const totalLength = countAllOptions(props.options);
|
|
350
|
-
ariaLiveMessage = onFocus(onFocusProps
|
|
351
|
+
ariaLiveMessage = onFocus(onFocusProps);
|
|
351
352
|
ariaLabelText = `${ariaLiveMessage} ${totalLength} results available. ${ariaLabelSuffix}`;
|
|
352
353
|
} else {
|
|
353
354
|
ariaLabelText = generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix);
|
|
@@ -356,7 +357,6 @@ export default class PopupSelect extends PureComponent {
|
|
|
356
357
|
updateInputAriaLabel(ariaLabelText);
|
|
357
358
|
return ariaLiveMessage;
|
|
358
359
|
}
|
|
359
|
-
return ariaLiveMessage;
|
|
360
360
|
};
|
|
361
361
|
const popper = /*#__PURE__*/React.createElement(Popper, _extends({}, mergedPopperProps, {
|
|
362
362
|
onFirstUpdate: state => {
|
|
@@ -382,7 +382,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
382
382
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
383
383
|
disabled: !focusLockEnabled,
|
|
384
384
|
returnFocus: true
|
|
385
|
-
}, /*#__PURE__*/React.createElement(
|
|
385
|
+
}, /*#__PURE__*/React.createElement(InternalSelect, _extends({
|
|
386
386
|
"aria-label": providedAriaLabel,
|
|
387
387
|
backspaceRemovesValue: false,
|
|
388
388
|
controlShouldRenderValue: false,
|
|
@@ -79,9 +79,16 @@ const Control = ({
|
|
|
79
79
|
innerProps: innerProps
|
|
80
80
|
})));
|
|
81
81
|
|
|
82
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
83
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
82
84
|
/**
|
|
83
85
|
* __Dummy control__
|
|
84
|
-
*
|
|
86
|
+
*
|
|
87
|
+
* A dummy control {description}.
|
|
88
|
+
*
|
|
89
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
90
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
91
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
85
92
|
*/
|
|
86
93
|
export const DummyControl = props => jsx(VisuallyHidden, null, jsx(components.Control, props));
|
|
87
94
|
|
|
@@ -90,14 +97,8 @@ const Menu = ({
|
|
|
90
97
|
children,
|
|
91
98
|
innerProps
|
|
92
99
|
}) => jsx("div", innerProps, children);
|
|
93
|
-
const IndicatorSeparator = props => jsx(components.IndicatorSeparator, props);
|
|
94
|
-
const ClearIndicator = props => jsx(components.ClearIndicator, props);
|
|
95
|
-
const MultiValueRemove = props => jsx(components.MultiValueRemove, props);
|
|
96
100
|
export const defaultComponents = {
|
|
97
101
|
Control,
|
|
98
102
|
DropdownIndicator,
|
|
99
|
-
Menu
|
|
100
|
-
IndicatorSeparator,
|
|
101
|
-
ClearIndicator,
|
|
102
|
-
MultiValueRemove
|
|
103
|
+
Menu
|
|
103
104
|
};
|
package/dist/es2019/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import ReactSelect 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 = "17.11.
|
|
5
|
+
const packageVersion = "17.11.13";
|
|
6
6
|
export const SelectWithoutAnalytics = createSelect(ReactSelect);
|
|
7
7
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
const Select = withAnalyticsContext({
|
|
@@ -70,7 +70,7 @@ export default function createSelect(WrappedComponent) {
|
|
|
70
70
|
ref: internalSelectRef,
|
|
71
71
|
"aria-live": "assertive",
|
|
72
72
|
ariaLiveMessages: isOptionsGrouped(props.options) ? {
|
|
73
|
-
onFocus
|
|
73
|
+
onFocus,
|
|
74
74
|
...ariaLiveMessages
|
|
75
75
|
} : {
|
|
76
76
|
...ariaLiveMessages
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Used for overwriting ariaLiveMessages builtin onFocus method.
|
|
2
2
|
// Returns custom built string while focusing each group option. This string is used for screen reader announcement.
|
|
3
|
-
export function onFocus(
|
|
3
|
+
export function onFocus(props) {
|
|
4
4
|
var _groupData$options$fi;
|
|
5
5
|
const {
|
|
6
|
-
focused
|
|
7
|
-
|
|
6
|
+
focused,
|
|
7
|
+
options
|
|
8
|
+
} = props;
|
|
8
9
|
const isOptionFocused = option => {
|
|
9
|
-
return option
|
|
10
|
+
return option === focused;
|
|
10
11
|
};
|
|
11
|
-
const groupData =
|
|
12
|
+
const groupData = options === null || options === void 0 ? void 0 : options.find(option => {
|
|
12
13
|
var _option$options;
|
|
13
14
|
return (_option$options = option.options) === null || _option$options === void 0 ? void 0 : _option$options.some(isOptionFocused);
|
|
14
15
|
});
|
|
@@ -18,11 +18,12 @@ import { createPortal } from 'react-dom';
|
|
|
18
18
|
import FocusLock from 'react-focus-lock';
|
|
19
19
|
import NodeResolver from 'react-node-resolver';
|
|
20
20
|
import { Manager, Popper, Reference } from 'react-popper';
|
|
21
|
-
import { mergeStyles } from 'react-select';
|
|
21
|
+
import Select, { mergeStyles } from 'react-select';
|
|
22
22
|
import { uid } from 'react-uid';
|
|
23
23
|
import { shallowEqualObjects } from 'shallow-equal';
|
|
24
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
25
|
import { N80 } from '@atlaskit/theme/colors';
|
|
25
|
-
import
|
|
26
|
+
import DefaultSelect from '../Select';
|
|
26
27
|
import baseStyles from '../styles';
|
|
27
28
|
import { countAllOptions, isOptionsGrouped, onFocus } from '../utils/grouped-options-announcement';
|
|
28
29
|
import { defaultComponents, DummyControl, MenuDialog } from './components';
|
|
@@ -75,7 +76,6 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
75
76
|
}
|
|
76
77
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
77
78
|
_defineProperty(_assertThisInitialized(_this), "menuRef", null);
|
|
78
|
-
_defineProperty(_assertThisInitialized(_this), "selectRef", null);
|
|
79
79
|
_defineProperty(_assertThisInitialized(_this), "targetRef", null);
|
|
80
80
|
_defineProperty(_assertThisInitialized(_this), "unbindWindowClick", null);
|
|
81
81
|
_defineProperty(_assertThisInitialized(_this), "unbindWindowKeydown", null);
|
|
@@ -181,7 +181,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
181
181
|
});
|
|
182
182
|
if (_this.selectRef) {
|
|
183
183
|
var _this$selectRef$selec;
|
|
184
|
-
(_this$selectRef$selec = _this.selectRef.select) === null || _this$selectRef$selec === void 0
|
|
184
|
+
fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef$selec = _this.selectRef.select) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.openMenu('first') : _this.selectRef.openMenu('first');
|
|
185
185
|
}
|
|
186
186
|
if (typeof window === 'undefined') {
|
|
187
187
|
return;
|
|
@@ -279,7 +279,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
279
279
|
|
|
280
280
|
// subtract the control height to maintain consistency
|
|
281
281
|
var showSearchControl = _this.showSearchControl();
|
|
282
|
-
var controlRef = (_this$selectRef$selec2 = _this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef;
|
|
282
|
+
var controlRef = fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef$selec2 = _this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef : _this.selectRef.controlRef;
|
|
283
283
|
var offsetHeight = showSearchControl && controlRef ? controlRef.offsetHeight : 0;
|
|
284
284
|
var maxHeight = maxMenuHeight - offsetHeight;
|
|
285
285
|
return maxHeight;
|
|
@@ -323,28 +323,29 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
323
323
|
return placeholder;
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
|
+
var InternalSelect = fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? DefaultSelect : Select;
|
|
326
327
|
var providedAriaLabel = getLabel();
|
|
327
328
|
var updateInputAriaLabel = function updateInputAriaLabel(ariaLabelText) {
|
|
328
|
-
var _this$selectRef;
|
|
329
|
+
var _this$selectRef, _this$selectRef2;
|
|
329
330
|
// Update aria-label to get first announcement when popup opened.
|
|
330
|
-
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef) {
|
|
331
|
-
var _this$
|
|
331
|
+
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef || (_this$selectRef2 = _this.selectRef) !== null && _this$selectRef2 !== void 0 && _this$selectRef2.inputRef) {
|
|
332
|
+
var _this$selectRef3, _this$selectRef4;
|
|
332
333
|
if (providedAriaLabel) {
|
|
333
334
|
ariaLabelText = "".concat(providedAriaLabel, ". ").concat(ariaLabelText);
|
|
334
335
|
}
|
|
335
|
-
(_this$
|
|
336
|
+
fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? (_this$selectRef3 = _this.selectRef) === null || _this$selectRef3 === void 0 || (_this$selectRef3 = _this$selectRef3.select.inputRef) === null || _this$selectRef3 === void 0 ? void 0 : _this$selectRef3.setAttribute('aria-label', ariaLabelText) : (_this$selectRef4 = _this.selectRef) === null || _this$selectRef4 === void 0 || (_this$selectRef4 = _this$selectRef4.inputRef) === null || _this$selectRef4 === void 0 ? void 0 : _this$selectRef4.setAttribute('aria-label', ariaLabelText);
|
|
336
337
|
}
|
|
337
338
|
};
|
|
338
339
|
var generateNoGroupsAriaText = function generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix) {
|
|
339
340
|
var _options$findIndex;
|
|
340
341
|
var focused = onFocusProps.focused;
|
|
341
342
|
var options = (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
342
|
-
var totalLength = options === null || options === void 0 ? void 0 : options.length;
|
|
343
|
+
var totalLength = (options === null || options === void 0 ? void 0 : options.length) + 1;
|
|
343
344
|
var optionIndex = (_options$findIndex = options === null || options === void 0 ? void 0 : options.findIndex(function (option) {
|
|
344
345
|
return option === focused;
|
|
345
346
|
})) !== null && _options$findIndex !== void 0 ? _options$findIndex : 0;
|
|
346
347
|
var optionName = typeof (props === null || props === void 0 ? void 0 : props.getOptionLabel) === 'function' ? props.getOptionLabel(focused) : focused.label;
|
|
347
|
-
var ariaLabelText = "Option ".concat(optionName, " focused, ").concat(optionIndex
|
|
348
|
+
var ariaLabelText = "Option ".concat(optionName, " focused, ").concat(optionIndex, " of ").concat(totalLength, ".\n\t\t\t").concat(totalLength, " results available.\n\t\t\t").concat(ariaLabelSuffix, "\n\t\t\t");
|
|
348
349
|
// Option LABEL focused, 1 of 8. 8 results available.
|
|
349
350
|
// Use Up and Down to choose options, press Enter to select the currently focused option,
|
|
350
351
|
// press Escape to exit the menu.
|
|
@@ -358,7 +359,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
358
359
|
if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
|
|
359
360
|
if (isOptionsGrouped(props.options)) {
|
|
360
361
|
var totalLength = countAllOptions(props.options);
|
|
361
|
-
ariaLiveMessage = onFocus(onFocusProps
|
|
362
|
+
ariaLiveMessage = onFocus(onFocusProps);
|
|
362
363
|
ariaLabelText = "".concat(ariaLiveMessage, " ").concat(totalLength, " results available. ").concat(ariaLabelSuffix);
|
|
363
364
|
} else {
|
|
364
365
|
ariaLabelText = generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix);
|
|
@@ -367,7 +368,6 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
367
368
|
updateInputAriaLabel(ariaLabelText);
|
|
368
369
|
return ariaLiveMessage;
|
|
369
370
|
}
|
|
370
|
-
return ariaLiveMessage;
|
|
371
371
|
};
|
|
372
372
|
var popper = /*#__PURE__*/React.createElement(Popper, _extends({}, mergedPopperProps, {
|
|
373
373
|
onFirstUpdate: function onFirstUpdate(state) {
|
|
@@ -393,7 +393,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
393
393
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
394
394
|
disabled: !focusLockEnabled,
|
|
395
395
|
returnFocus: true
|
|
396
|
-
}, /*#__PURE__*/React.createElement(
|
|
396
|
+
}, /*#__PURE__*/React.createElement(InternalSelect, _extends({
|
|
397
397
|
"aria-label": providedAriaLabel,
|
|
398
398
|
backspaceRemovesValue: false,
|
|
399
399
|
controlShouldRenderValue: false,
|
|
@@ -85,9 +85,16 @@ var Control = function Control(_ref2) {
|
|
|
85
85
|
})));
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
89
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
88
90
|
/**
|
|
89
91
|
* __Dummy control__
|
|
90
|
-
*
|
|
92
|
+
*
|
|
93
|
+
* A dummy control {description}.
|
|
94
|
+
*
|
|
95
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
96
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
97
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
91
98
|
*/
|
|
92
99
|
export var DummyControl = function DummyControl(props) {
|
|
93
100
|
return jsx(VisuallyHidden, null, jsx(components.Control, props));
|
|
@@ -99,20 +106,8 @@ var Menu = function Menu(_ref3) {
|
|
|
99
106
|
innerProps = _ref3.innerProps;
|
|
100
107
|
return jsx("div", innerProps, children);
|
|
101
108
|
};
|
|
102
|
-
var IndicatorSeparator = function IndicatorSeparator(props) {
|
|
103
|
-
return jsx(components.IndicatorSeparator, props);
|
|
104
|
-
};
|
|
105
|
-
var ClearIndicator = function ClearIndicator(props) {
|
|
106
|
-
return jsx(components.ClearIndicator, props);
|
|
107
|
-
};
|
|
108
|
-
var MultiValueRemove = function MultiValueRemove(props) {
|
|
109
|
-
return jsx(components.MultiValueRemove, props);
|
|
110
|
-
};
|
|
111
109
|
export var defaultComponents = {
|
|
112
110
|
Control: Control,
|
|
113
111
|
DropdownIndicator: DropdownIndicator,
|
|
114
|
-
Menu: Menu
|
|
115
|
-
IndicatorSeparator: IndicatorSeparator,
|
|
116
|
-
ClearIndicator: ClearIndicator,
|
|
117
|
-
MultiValueRemove: MultiValueRemove
|
|
112
|
+
Menu: Menu
|
|
118
113
|
};
|
package/dist/esm/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import ReactSelect 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 = "17.11.
|
|
5
|
+
var packageVersion = "17.11.13";
|
|
6
6
|
export var SelectWithoutAnalytics = createSelect(ReactSelect);
|
|
7
7
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
var Select = withAnalyticsContext({
|
package/dist/esm/createSelect.js
CHANGED
|
@@ -10,7 +10,7 @@ import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator
|
|
|
10
10
|
import { Input } from './components/input-aria-describedby';
|
|
11
11
|
import { NoOptionsMessage } from './components/no-options';
|
|
12
12
|
import baseStyles from './styles';
|
|
13
|
-
import { isOptionsGrouped, onFocus
|
|
13
|
+
import { isOptionsGrouped, onFocus } from './utils/grouped-options-announcement';
|
|
14
14
|
export default function createSelect(WrappedComponent) {
|
|
15
15
|
var AtlaskitSelect = /*#__PURE__*/forwardRef(function AtlaskitSelect(props, forwardedRef) {
|
|
16
16
|
var appearance = props.appearance,
|
|
@@ -80,9 +80,7 @@ export default function createSelect(WrappedComponent) {
|
|
|
80
80
|
ref: internalSelectRef,
|
|
81
81
|
"aria-live": "assertive",
|
|
82
82
|
ariaLiveMessages: isOptionsGrouped(props.options) ? _objectSpread({
|
|
83
|
-
onFocus:
|
|
84
|
-
return _onFocus(data, props.options);
|
|
85
|
-
}
|
|
83
|
+
onFocus: onFocus
|
|
86
84
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages),
|
|
87
85
|
tabSelectsValue: tabSelectsValue,
|
|
88
86
|
onClickPreventDefault: onClickPreventDefault
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// Used for overwriting ariaLiveMessages builtin onFocus method.
|
|
2
2
|
// Returns custom built string while focusing each group option. This string is used for screen reader announcement.
|
|
3
|
-
export function onFocus(
|
|
3
|
+
export function onFocus(props) {
|
|
4
4
|
var _groupData$options$fi;
|
|
5
|
-
var focused =
|
|
5
|
+
var focused = props.focused,
|
|
6
|
+
options = props.options;
|
|
6
7
|
var isOptionFocused = function isOptionFocused(option) {
|
|
7
|
-
return option
|
|
8
|
+
return option === focused;
|
|
8
9
|
};
|
|
9
|
-
var groupData =
|
|
10
|
+
var groupData = options === null || options === void 0 ? void 0 : options.find(function (option) {
|
|
10
11
|
var _option$options;
|
|
11
12
|
return (_option$options = option.options) === null || _option$options === void 0 ? void 0 : _option$options.some(isOptionFocused);
|
|
12
13
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { type KeyboardEventHandler, PureComponent, type ReactNode } from 'react';
|
|
2
2
|
import { type UnbindFn } from 'bind-event-listener';
|
|
3
3
|
import { type PopperProps } from 'react-popper';
|
|
4
|
-
import { type GroupBase } from 'react-select';
|
|
5
4
|
import { type ActionMeta, type AtlaskitSelectRefType, type OptionType, type ReactSelectProps, type StylesConfig, type ValidationState, type ValueType } from '../types';
|
|
6
5
|
type defaultModifiers = 'offset' | 'preventOverflow';
|
|
7
6
|
type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
|
|
@@ -95,7 +94,7 @@ interface State<Modifiers = string> {
|
|
|
95
94
|
}
|
|
96
95
|
export default class PopupSelect<Option = OptionType, IsMulti extends boolean = false, Modifiers = ModifierList> extends PureComponent<PopupSelectProps<Option, IsMulti, Modifiers>, State> {
|
|
97
96
|
menuRef: HTMLElement | null;
|
|
98
|
-
selectRef:
|
|
97
|
+
selectRef: any;
|
|
99
98
|
targetRef: HTMLElement | null;
|
|
100
99
|
unbindWindowClick: UnbindFn | null;
|
|
101
100
|
unbindWindowKeydown: UnbindFn | null;
|
|
@@ -109,9 +108,6 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
109
108
|
Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
|
|
110
109
|
DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
|
|
111
110
|
Menu: ({ children, innerProps }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
|
|
112
|
-
IndicatorSeparator: (props: import("react-select").IndicatorSeparatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
|
|
113
|
-
ClearIndicator: (props: import("react-select").ClearIndicatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
|
|
114
|
-
MultiValueRemove: (props: import("react-select").MultiValueRemoveProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
|
|
115
111
|
};
|
|
116
112
|
mergedPopperProps: PopperPropsNoChildren<string>;
|
|
117
113
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type CSSProperties, type FC, type ReactNode } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import { type
|
|
7
|
+
import { type ControlProps, type MenuProps, type OptionType } from '../types';
|
|
8
8
|
interface MenuDialogProps {
|
|
9
9
|
maxWidth?: number | string;
|
|
10
10
|
minWidth?: number | string;
|
|
@@ -21,15 +21,17 @@ interface MenuDialogProps {
|
|
|
21
21
|
export declare const MenuDialog: FC<MenuDialogProps>;
|
|
22
22
|
/**
|
|
23
23
|
* __Dummy control__
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* A dummy control {description}.
|
|
26
|
+
*
|
|
27
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
28
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
29
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
25
30
|
*/
|
|
26
31
|
export declare const DummyControl: FC<ControlProps<OptionType, boolean>>;
|
|
27
32
|
export declare const defaultComponents: {
|
|
28
33
|
Control: FC<ControlProps<OptionType, boolean>>;
|
|
29
34
|
DropdownIndicator: () => jsx.JSX.Element;
|
|
30
35
|
Menu: ({ children, innerProps }: MenuProps<OptionType, boolean>) => jsx.JSX.Element;
|
|
31
|
-
IndicatorSeparator: (props: IndicatorSeparatorProps) => jsx.JSX.Element;
|
|
32
|
-
ClearIndicator: (props: ClearIndicatorProps) => jsx.JSX.Element;
|
|
33
|
-
MultiValueRemove: (props: MultiValueRemoveProps) => jsx.JSX.Element;
|
|
34
36
|
};
|
|
35
37
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AriaOnFocusProps, type GroupBase, type OptionsOrGroups } from 'react-select';
|
|
2
2
|
import { type GroupType, type OptionType } from '../types';
|
|
3
|
-
export declare function onFocus(
|
|
3
|
+
export declare function onFocus(props: AriaOnFocusProps<OptionType, GroupBase<OptionType>>): string;
|
|
4
4
|
export declare const isOptionsGrouped: (arr: OptionsOrGroups<OptionType, GroupType<OptionType>> | undefined) => boolean | undefined;
|
|
5
5
|
export declare const countAllOptions: (groupsArray: readonly GroupType<OptionType>[]) => number;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { type KeyboardEventHandler, PureComponent, type ReactNode } from 'react';
|
|
2
2
|
import { type UnbindFn } from 'bind-event-listener';
|
|
3
3
|
import { type PopperProps } from 'react-popper';
|
|
4
|
-
import { type GroupBase } from 'react-select';
|
|
5
4
|
import { type ActionMeta, type AtlaskitSelectRefType, type OptionType, type ReactSelectProps, type StylesConfig, type ValidationState, type ValueType } from '../types';
|
|
6
5
|
type defaultModifiers = 'offset' | 'preventOverflow';
|
|
7
6
|
type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
|
|
@@ -95,7 +94,7 @@ interface State<Modifiers = string> {
|
|
|
95
94
|
}
|
|
96
95
|
export default class PopupSelect<Option = OptionType, IsMulti extends boolean = false, Modifiers = ModifierList> extends PureComponent<PopupSelectProps<Option, IsMulti, Modifiers>, State> {
|
|
97
96
|
menuRef: HTMLElement | null;
|
|
98
|
-
selectRef:
|
|
97
|
+
selectRef: any;
|
|
99
98
|
targetRef: HTMLElement | null;
|
|
100
99
|
unbindWindowClick: UnbindFn | null;
|
|
101
100
|
unbindWindowKeydown: UnbindFn | null;
|
|
@@ -109,9 +108,6 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
109
108
|
Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
|
|
110
109
|
DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
|
|
111
110
|
Menu: ({ children, innerProps }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
|
|
112
|
-
IndicatorSeparator: (props: import("react-select").IndicatorSeparatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
|
|
113
|
-
ClearIndicator: (props: import("react-select").ClearIndicatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
|
|
114
|
-
MultiValueRemove: (props: import("react-select").MultiValueRemoveProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
|
|
115
111
|
};
|
|
116
112
|
mergedPopperProps: PopperPropsNoChildren<string>;
|
|
117
113
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type CSSProperties, type FC, type ReactNode } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import { type
|
|
7
|
+
import { type ControlProps, type MenuProps, type OptionType } from '../types';
|
|
8
8
|
interface MenuDialogProps {
|
|
9
9
|
maxWidth?: number | string;
|
|
10
10
|
minWidth?: number | string;
|
|
@@ -21,15 +21,17 @@ interface MenuDialogProps {
|
|
|
21
21
|
export declare const MenuDialog: FC<MenuDialogProps>;
|
|
22
22
|
/**
|
|
23
23
|
* __Dummy control__
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* A dummy control {description}.
|
|
26
|
+
*
|
|
27
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
28
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
29
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
25
30
|
*/
|
|
26
31
|
export declare const DummyControl: FC<ControlProps<OptionType, boolean>>;
|
|
27
32
|
export declare const defaultComponents: {
|
|
28
33
|
Control: FC<ControlProps<OptionType, boolean>>;
|
|
29
34
|
DropdownIndicator: () => jsx.JSX.Element;
|
|
30
35
|
Menu: ({ children, innerProps }: MenuProps<OptionType, boolean>) => jsx.JSX.Element;
|
|
31
|
-
IndicatorSeparator: (props: IndicatorSeparatorProps) => jsx.JSX.Element;
|
|
32
|
-
ClearIndicator: (props: ClearIndicatorProps) => jsx.JSX.Element;
|
|
33
|
-
MultiValueRemove: (props: MultiValueRemoveProps) => jsx.JSX.Element;
|
|
34
36
|
};
|
|
35
37
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AriaOnFocusProps, type GroupBase, type OptionsOrGroups } from 'react-select';
|
|
2
2
|
import { type GroupType, type OptionType } from '../types';
|
|
3
|
-
export declare function onFocus(
|
|
3
|
+
export declare function onFocus(props: AriaOnFocusProps<OptionType, GroupBase<OptionType>>): string;
|
|
4
4
|
export declare const isOptionsGrouped: (arr: OptionsOrGroups<OptionType, GroupType<OptionType>> | undefined) => boolean | undefined;
|
|
5
5
|
export declare const countAllOptions: (groupsArray: readonly GroupType<OptionType>[]) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/select",
|
|
3
|
-
"version": "17.11.
|
|
3
|
+
"version": "17.11.13",
|
|
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/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
".": "./src/index.tsx"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@atlaskit/analytics-next": "^
|
|
45
|
+
"@atlaskit/analytics-next": "^10.0.0",
|
|
46
46
|
"@atlaskit/icon": "^22.10.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
48
48
|
"@atlaskit/primitives": "^11.1.0",
|
|
@@ -104,6 +104,9 @@
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
"platform-feature-flags": {
|
|
107
|
+
"platform.design-system-team.use-default-select-in-popup-select_46rmj": {
|
|
108
|
+
"type": "boolean"
|
|
109
|
+
},
|
|
107
110
|
"platform.design-system-team.select-new-typography_7m89c": {
|
|
108
111
|
"type": "boolean"
|
|
109
112
|
}
|