@atlaskit/select 17.15.0 → 17.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/PopupSelect/PopupSelect.js +13 -12
- package/dist/cjs/PopupSelect/components.js +14 -9
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/createSelect.js +3 -1
- package/dist/cjs/utils/grouped-options-announcement.js +4 -5
- package/dist/es2019/PopupSelect/PopupSelect.js +14 -13
- package/dist/es2019/PopupSelect/components.js +8 -9
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/createSelect.js +1 -1
- package/dist/es2019/utils/grouped-options-announcement.js +5 -6
- package/dist/esm/PopupSelect/PopupSelect.js +14 -13
- package/dist/esm/PopupSelect/components.js +14 -9
- package/dist/esm/Select.js +1 -1
- package/dist/esm/createSelect.js +4 -2
- package/dist/esm/utils/grouped-options-announcement.js +4 -5
- package/dist/types/PopupSelect/PopupSelect.d.ts +5 -1
- package/dist/types/PopupSelect/components.d.ts +5 -7
- package/dist/types/utils/grouped-options-announcement.d.ts +1 -1
- package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +5 -1
- package/dist/types-ts4.5/PopupSelect/components.d.ts +5 -7
- package/dist/types-ts4.5/utils/grouped-options-announcement.d.ts +1 -1
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 17.15.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#131911](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/131911)
|
|
8
|
+
[`2f9601a8a634b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f9601a8a634b) -
|
|
9
|
+
This version removes `platform.design-system-team.use-default-select-in-popup-select_46rmj`
|
|
10
|
+
feature flag. The `PopupSelect` component now uses the internal `Select` component ensure the
|
|
11
|
+
accessibility of options with group labels for assistive technologies.
|
|
12
|
+
|
|
3
13
|
## 17.15.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -21,7 +21,7 @@ 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 =
|
|
24
|
+
var _reactSelect = require("react-select");
|
|
25
25
|
var _reactUid = require("react-uid");
|
|
26
26
|
var _shallowEqual = require("shallow-equal");
|
|
27
27
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -86,6 +86,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
86
|
}
|
|
87
87
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
88
88
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "menuRef", null);
|
|
89
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectRef", null);
|
|
89
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", null);
|
|
90
91
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowClick", null);
|
|
91
92
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowKeydown", null);
|
|
@@ -196,7 +197,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
196
197
|
});
|
|
197
198
|
if (_this.selectRef) {
|
|
198
199
|
var _this$selectRef$selec;
|
|
199
|
-
(
|
|
200
|
+
(_this$selectRef$selec = _this.selectRef.select) === null || _this$selectRef$selec === void 0 || _this$selectRef$selec.openMenu('first');
|
|
200
201
|
}
|
|
201
202
|
if (typeof window === 'undefined') {
|
|
202
203
|
return;
|
|
@@ -299,7 +300,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
299
300
|
|
|
300
301
|
// subtract the control height to maintain consistency
|
|
301
302
|
var showSearchControl = _this.showSearchControl();
|
|
302
|
-
var controlRef = (
|
|
303
|
+
var controlRef = (_this$selectRef$selec2 = _this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef;
|
|
303
304
|
var offsetHeight = showSearchControl && controlRef ? controlRef.offsetHeight : 0;
|
|
304
305
|
var maxHeight = maxMenuHeight - offsetHeight;
|
|
305
306
|
return maxHeight;
|
|
@@ -349,29 +350,28 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
349
350
|
return placeholder;
|
|
350
351
|
}
|
|
351
352
|
};
|
|
352
|
-
var InternalSelect = (0, _platformFeatureFlags.fg)('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? _Select.default : _reactSelect.default;
|
|
353
353
|
var providedAriaLabel = getLabel();
|
|
354
354
|
var updateInputAriaLabel = function updateInputAriaLabel(ariaLabelText) {
|
|
355
|
-
var _this$selectRef
|
|
355
|
+
var _this$selectRef;
|
|
356
356
|
// Update aria-label to get first announcement when popup opened.
|
|
357
|
-
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef
|
|
358
|
-
var _this$
|
|
357
|
+
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef) {
|
|
358
|
+
var _this$selectRef2;
|
|
359
359
|
if (providedAriaLabel) {
|
|
360
360
|
ariaLabelText = "".concat(providedAriaLabel, ". ").concat(ariaLabelText);
|
|
361
361
|
}
|
|
362
|
-
(
|
|
362
|
+
(_this$selectRef2 = _this.selectRef) === null || _this$selectRef2 === void 0 || (_this$selectRef2 = _this$selectRef2.select.inputRef) === null || _this$selectRef2 === void 0 || _this$selectRef2.setAttribute('aria-label', ariaLabelText);
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
365
|
var generateNoGroupsAriaText = function generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix) {
|
|
366
366
|
var _options$findIndex;
|
|
367
367
|
var focused = onFocusProps.focused;
|
|
368
368
|
var options = (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
369
|
-
var totalLength =
|
|
369
|
+
var totalLength = options === null || options === void 0 ? void 0 : options.length;
|
|
370
370
|
var optionIndex = (_options$findIndex = options === null || options === void 0 ? void 0 : options.findIndex(function (option) {
|
|
371
371
|
return option === focused;
|
|
372
372
|
})) !== null && _options$findIndex !== void 0 ? _options$findIndex : 0;
|
|
373
373
|
var optionName = typeof (props === null || props === void 0 ? void 0 : props.getOptionLabel) === 'function' ? props.getOptionLabel(focused) : focused.label;
|
|
374
|
-
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");
|
|
374
|
+
var ariaLabelText = "Option ".concat(optionName, " focused, ").concat(optionIndex + 1, " of ").concat(totalLength, ".\n\t\t\t").concat(totalLength, " results available.\n\t\t\t").concat(ariaLabelSuffix, "\n\t\t\t");
|
|
375
375
|
// Option LABEL focused, 1 of 8. 8 results available.
|
|
376
376
|
// Use Up and Down to choose options, press Enter to select the currently focused option,
|
|
377
377
|
// press Escape to exit the menu.
|
|
@@ -385,7 +385,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
385
385
|
if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
|
|
386
386
|
if ((0, _groupedOptionsAnnouncement.isOptionsGrouped)(props.options)) {
|
|
387
387
|
var totalLength = (0, _groupedOptionsAnnouncement.countAllOptions)(props.options);
|
|
388
|
-
ariaLiveMessage = (0, _groupedOptionsAnnouncement.onFocus)(onFocusProps);
|
|
388
|
+
ariaLiveMessage = (0, _groupedOptionsAnnouncement.onFocus)(onFocusProps, props.options);
|
|
389
389
|
ariaLabelText = "".concat(ariaLiveMessage, " ").concat(totalLength, " results available. ").concat(ariaLabelSuffix);
|
|
390
390
|
} else {
|
|
391
391
|
ariaLabelText = generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix);
|
|
@@ -394,6 +394,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
394
394
|
updateInputAriaLabel(ariaLabelText);
|
|
395
395
|
return ariaLiveMessage;
|
|
396
396
|
}
|
|
397
|
+
return ariaLiveMessage;
|
|
397
398
|
};
|
|
398
399
|
var popper = /*#__PURE__*/_react.default.createElement(_reactPopper.Popper, (0, _extends2.default)({}, mergedPopperProps, {
|
|
399
400
|
onFirstUpdate: function onFirstUpdate(state) {
|
|
@@ -425,7 +426,7 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
425
426
|
}, /*#__PURE__*/_react.default.createElement(_reactFocusLock.default, {
|
|
426
427
|
disabled: !focusLockEnabled,
|
|
427
428
|
returnFocus: true
|
|
428
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
429
|
+
}, /*#__PURE__*/_react.default.createElement(_Select.default, (0, _extends2.default)({
|
|
429
430
|
"aria-label": providedAriaLabel,
|
|
430
431
|
backspaceRemovesValue: false,
|
|
431
432
|
controlShouldRenderValue: false,
|
|
@@ -92,16 +92,9 @@ var Control = function Control(_ref2) {
|
|
|
92
92
|
})));
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
96
|
-
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
97
95
|
/**
|
|
98
96
|
* __Dummy control__
|
|
99
|
-
*
|
|
100
|
-
* A dummy control {description}.
|
|
101
|
-
*
|
|
102
|
-
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
103
|
-
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
104
|
-
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
97
|
+
* Overrides the default DummyControl component in Select.
|
|
105
98
|
*/
|
|
106
99
|
var DummyControl = exports.DummyControl = function DummyControl(props) {
|
|
107
100
|
return (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)(_reactSelect.components.Control, props));
|
|
@@ -113,8 +106,20 @@ var Menu = function Menu(_ref3) {
|
|
|
113
106
|
innerProps = _ref3.innerProps;
|
|
114
107
|
return (0, _react2.jsx)("div", innerProps, children);
|
|
115
108
|
};
|
|
109
|
+
var IndicatorSeparator = function IndicatorSeparator(props) {
|
|
110
|
+
return (0, _react2.jsx)(_reactSelect.components.IndicatorSeparator, props);
|
|
111
|
+
};
|
|
112
|
+
var ClearIndicator = function ClearIndicator(props) {
|
|
113
|
+
return (0, _react2.jsx)(_reactSelect.components.ClearIndicator, props);
|
|
114
|
+
};
|
|
115
|
+
var MultiValueRemove = function MultiValueRemove(props) {
|
|
116
|
+
return (0, _react2.jsx)(_reactSelect.components.MultiValueRemove, props);
|
|
117
|
+
};
|
|
116
118
|
var defaultComponents = exports.defaultComponents = {
|
|
117
119
|
Control: Control,
|
|
118
120
|
DropdownIndicator: DropdownIndicator,
|
|
119
|
-
Menu: Menu
|
|
121
|
+
Menu: Menu,
|
|
122
|
+
IndicatorSeparator: IndicatorSeparator,
|
|
123
|
+
ClearIndicator: ClearIndicator,
|
|
124
|
+
MultiValueRemove: MultiValueRemove
|
|
120
125
|
};
|
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.15.
|
|
12
|
+
var packageVersion = "17.15.1";
|
|
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,7 +90,9 @@ function createSelect(WrappedComponent) {
|
|
|
90
90
|
ref: internalSelectRef,
|
|
91
91
|
"aria-live": "assertive",
|
|
92
92
|
ariaLiveMessages: (0, _groupedOptionsAnnouncement.isOptionsGrouped)(props.options) ? _objectSpread({
|
|
93
|
-
onFocus:
|
|
93
|
+
onFocus: function onFocus(data) {
|
|
94
|
+
return (0, _groupedOptionsAnnouncement.onFocus)(data, props.options);
|
|
95
|
+
}
|
|
94
96
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages),
|
|
95
97
|
tabSelectsValue: tabSelectsValue,
|
|
96
98
|
onClickPreventDefault: onClickPreventDefault
|
|
@@ -7,14 +7,13 @@ 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(onFocusProps, defaultOptions) {
|
|
11
11
|
var _groupData$options$fi;
|
|
12
|
-
var focused =
|
|
13
|
-
options = props.options;
|
|
12
|
+
var focused = onFocusProps.focused;
|
|
14
13
|
var isOptionFocused = function isOptionFocused(option) {
|
|
15
|
-
return option === focused;
|
|
14
|
+
return option.label === focused.label;
|
|
16
15
|
};
|
|
17
|
-
var groupData =
|
|
16
|
+
var groupData = defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.find(function (option) {
|
|
18
17
|
var _option$options;
|
|
19
18
|
return (_option$options = option.options) === null || _option$options === void 0 ? void 0 : _option$options.some(isOptionFocused);
|
|
20
19
|
});
|
|
@@ -6,12 +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
|
|
9
|
+
import { mergeStyles } from 'react-select';
|
|
10
10
|
import { uid } from 'react-uid';
|
|
11
11
|
import { shallowEqualObjects } from 'shallow-equal';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { N80 } from '@atlaskit/theme/colors';
|
|
14
|
-
import
|
|
14
|
+
import Select from '../Select';
|
|
15
15
|
import baseStyles from '../styles';
|
|
16
16
|
import { countAllOptions, isOptionsGrouped, onFocus } from '../utils/grouped-options-announcement';
|
|
17
17
|
import { defaultComponents, DummyControl, MenuDialog } from './components';
|
|
@@ -53,6 +53,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
53
53
|
var _this$defaultOpenStat;
|
|
54
54
|
super(...args);
|
|
55
55
|
_defineProperty(this, "menuRef", null);
|
|
56
|
+
_defineProperty(this, "selectRef", null);
|
|
56
57
|
_defineProperty(this, "targetRef", null);
|
|
57
58
|
_defineProperty(this, "unbindWindowClick", null);
|
|
58
59
|
_defineProperty(this, "unbindWindowKeydown", null);
|
|
@@ -167,7 +168,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
167
168
|
});
|
|
168
169
|
if (this.selectRef) {
|
|
169
170
|
var _this$selectRef$selec;
|
|
170
|
-
|
|
171
|
+
(_this$selectRef$selec = this.selectRef.select) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.openMenu('first');
|
|
171
172
|
}
|
|
172
173
|
if (typeof window === 'undefined') {
|
|
173
174
|
return;
|
|
@@ -269,7 +270,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
269
270
|
|
|
270
271
|
// subtract the control height to maintain consistency
|
|
271
272
|
const showSearchControl = this.showSearchControl();
|
|
272
|
-
|
|
273
|
+
const controlRef = (_this$selectRef$selec2 = this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef;
|
|
273
274
|
const offsetHeight = showSearchControl && controlRef ? controlRef.offsetHeight : 0;
|
|
274
275
|
const maxHeight = maxMenuHeight - offsetHeight;
|
|
275
276
|
return maxHeight;
|
|
@@ -323,17 +324,16 @@ export default class PopupSelect extends PureComponent {
|
|
|
323
324
|
return placeholder;
|
|
324
325
|
}
|
|
325
326
|
};
|
|
326
|
-
const InternalSelect = fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? DefaultSelect : Select;
|
|
327
327
|
const providedAriaLabel = getLabel();
|
|
328
328
|
const updateInputAriaLabel = ariaLabelText => {
|
|
329
|
-
var _this$selectRef, _this$selectRef$selec3
|
|
329
|
+
var _this$selectRef, _this$selectRef$selec3;
|
|
330
330
|
// Update aria-label to get first announcement when popup opened.
|
|
331
|
-
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
|
|
332
|
-
var _this$
|
|
331
|
+
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) {
|
|
332
|
+
var _this$selectRef2, _this$selectRef2$sele;
|
|
333
333
|
if (providedAriaLabel) {
|
|
334
334
|
ariaLabelText = `${providedAriaLabel}. ${ariaLabelText}`;
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
(_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 ? void 0 : (_this$selectRef2$sele = _this$selectRef2.select.inputRef) === null || _this$selectRef2$sele === void 0 ? void 0 : _this$selectRef2$sele.setAttribute('aria-label', ariaLabelText);
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
const generateNoGroupsAriaText = (onFocusProps, ariaLabelSuffix) => {
|
|
@@ -342,10 +342,10 @@ export default class PopupSelect extends PureComponent {
|
|
|
342
342
|
focused
|
|
343
343
|
} = onFocusProps;
|
|
344
344
|
const options = (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
345
|
-
const totalLength =
|
|
345
|
+
const totalLength = options === null || options === void 0 ? void 0 : options.length;
|
|
346
346
|
const optionIndex = (_options$findIndex = options === null || options === void 0 ? void 0 : options.findIndex(option => option === focused)) !== null && _options$findIndex !== void 0 ? _options$findIndex : 0;
|
|
347
347
|
const optionName = typeof (props === null || props === void 0 ? void 0 : props.getOptionLabel) === 'function' ? props.getOptionLabel(focused) : focused.label;
|
|
348
|
-
const ariaLabelText = `Option ${optionName} focused, ${optionIndex} of ${totalLength}.
|
|
348
|
+
const ariaLabelText = `Option ${optionName} focused, ${optionIndex + 1} of ${totalLength}.
|
|
349
349
|
${totalLength} results available.
|
|
350
350
|
${ariaLabelSuffix}
|
|
351
351
|
`;
|
|
@@ -362,7 +362,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
362
362
|
if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
|
|
363
363
|
if (isOptionsGrouped(props.options)) {
|
|
364
364
|
const totalLength = countAllOptions(props.options);
|
|
365
|
-
ariaLiveMessage = onFocus(onFocusProps);
|
|
365
|
+
ariaLiveMessage = onFocus(onFocusProps, props.options);
|
|
366
366
|
ariaLabelText = `${ariaLiveMessage} ${totalLength} results available. ${ariaLabelSuffix}`;
|
|
367
367
|
} else {
|
|
368
368
|
ariaLabelText = generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix);
|
|
@@ -371,6 +371,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
371
371
|
updateInputAriaLabel(ariaLabelText);
|
|
372
372
|
return ariaLiveMessage;
|
|
373
373
|
}
|
|
374
|
+
return ariaLiveMessage;
|
|
374
375
|
};
|
|
375
376
|
const popper = /*#__PURE__*/React.createElement(Popper, _extends({}, mergedPopperProps, {
|
|
376
377
|
onFirstUpdate: state => {
|
|
@@ -402,7 +403,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
402
403
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
403
404
|
disabled: !focusLockEnabled,
|
|
404
405
|
returnFocus: true
|
|
405
|
-
}, /*#__PURE__*/React.createElement(
|
|
406
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
406
407
|
"aria-label": providedAriaLabel,
|
|
407
408
|
backspaceRemovesValue: false,
|
|
408
409
|
controlShouldRenderValue: false,
|
|
@@ -81,16 +81,9 @@ const Control = ({
|
|
|
81
81
|
innerProps: innerProps
|
|
82
82
|
})));
|
|
83
83
|
|
|
84
|
-
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
85
|
-
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
86
84
|
/**
|
|
87
85
|
* __Dummy control__
|
|
88
|
-
*
|
|
89
|
-
* A dummy control {description}.
|
|
90
|
-
*
|
|
91
|
-
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
92
|
-
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
93
|
-
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
86
|
+
* Overrides the default DummyControl component in Select.
|
|
94
87
|
*/
|
|
95
88
|
export const DummyControl = props => jsx(VisuallyHidden, null, jsx(components.Control, props));
|
|
96
89
|
|
|
@@ -99,8 +92,14 @@ const Menu = ({
|
|
|
99
92
|
children,
|
|
100
93
|
innerProps
|
|
101
94
|
}) => jsx("div", innerProps, children);
|
|
95
|
+
const IndicatorSeparator = props => jsx(components.IndicatorSeparator, props);
|
|
96
|
+
const ClearIndicator = props => jsx(components.ClearIndicator, props);
|
|
97
|
+
const MultiValueRemove = props => jsx(components.MultiValueRemove, props);
|
|
102
98
|
export const defaultComponents = {
|
|
103
99
|
Control,
|
|
104
100
|
DropdownIndicator,
|
|
105
|
-
Menu
|
|
101
|
+
Menu,
|
|
102
|
+
IndicatorSeparator,
|
|
103
|
+
ClearIndicator,
|
|
104
|
+
MultiValueRemove
|
|
106
105
|
};
|
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.15.
|
|
5
|
+
const packageVersion = "17.15.1";
|
|
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: data => onFocus(data, props.options),
|
|
74
74
|
...ariaLiveMessages
|
|
75
75
|
} : {
|
|
76
76
|
...ariaLiveMessages
|
|
@@ -1,15 +1,14 @@
|
|
|
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(onFocusProps, defaultOptions) {
|
|
4
4
|
var _groupData$options$fi;
|
|
5
5
|
const {
|
|
6
|
-
focused
|
|
7
|
-
|
|
8
|
-
} = props;
|
|
6
|
+
focused
|
|
7
|
+
} = onFocusProps;
|
|
9
8
|
const isOptionFocused = option => {
|
|
10
|
-
return option === focused;
|
|
9
|
+
return option.label === focused.label;
|
|
11
10
|
};
|
|
12
|
-
const groupData =
|
|
11
|
+
const groupData = defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.find(option => {
|
|
13
12
|
var _option$options;
|
|
14
13
|
return (_option$options = option.options) === null || _option$options === void 0 ? void 0 : _option$options.some(isOptionFocused);
|
|
15
14
|
});
|
|
@@ -18,12 +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
|
|
21
|
+
import { mergeStyles } from 'react-select';
|
|
22
22
|
import { uid } from 'react-uid';
|
|
23
23
|
import { shallowEqualObjects } from 'shallow-equal';
|
|
24
24
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
25
25
|
import { N80 } from '@atlaskit/theme/colors';
|
|
26
|
-
import
|
|
26
|
+
import Select from '../Select';
|
|
27
27
|
import baseStyles from '../styles';
|
|
28
28
|
import { countAllOptions, isOptionsGrouped, onFocus } from '../utils/grouped-options-announcement';
|
|
29
29
|
import { defaultComponents, DummyControl, MenuDialog } from './components';
|
|
@@ -76,6 +76,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
76
76
|
}
|
|
77
77
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
78
78
|
_defineProperty(_assertThisInitialized(_this), "menuRef", null);
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "selectRef", null);
|
|
79
80
|
_defineProperty(_assertThisInitialized(_this), "targetRef", null);
|
|
80
81
|
_defineProperty(_assertThisInitialized(_this), "unbindWindowClick", null);
|
|
81
82
|
_defineProperty(_assertThisInitialized(_this), "unbindWindowKeydown", null);
|
|
@@ -186,7 +187,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
186
187
|
});
|
|
187
188
|
if (_this.selectRef) {
|
|
188
189
|
var _this$selectRef$selec;
|
|
189
|
-
|
|
190
|
+
(_this$selectRef$selec = _this.selectRef.select) === null || _this$selectRef$selec === void 0 || _this$selectRef$selec.openMenu('first');
|
|
190
191
|
}
|
|
191
192
|
if (typeof window === 'undefined') {
|
|
192
193
|
return;
|
|
@@ -289,7 +290,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
289
290
|
|
|
290
291
|
// subtract the control height to maintain consistency
|
|
291
292
|
var showSearchControl = _this.showSearchControl();
|
|
292
|
-
var controlRef =
|
|
293
|
+
var controlRef = (_this$selectRef$selec2 = _this.selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : _this$selectRef$selec2.controlRef;
|
|
293
294
|
var offsetHeight = showSearchControl && controlRef ? controlRef.offsetHeight : 0;
|
|
294
295
|
var maxHeight = maxMenuHeight - offsetHeight;
|
|
295
296
|
return maxHeight;
|
|
@@ -339,29 +340,28 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
339
340
|
return placeholder;
|
|
340
341
|
}
|
|
341
342
|
};
|
|
342
|
-
var InternalSelect = fg('platform.design-system-team.use-default-select-in-popup-select_46rmj') ? DefaultSelect : Select;
|
|
343
343
|
var providedAriaLabel = getLabel();
|
|
344
344
|
var updateInputAriaLabel = function updateInputAriaLabel(ariaLabelText) {
|
|
345
|
-
var _this$selectRef
|
|
345
|
+
var _this$selectRef;
|
|
346
346
|
// Update aria-label to get first announcement when popup opened.
|
|
347
|
-
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef
|
|
348
|
-
var _this$
|
|
347
|
+
if ((_this$selectRef = _this.selectRef) !== null && _this$selectRef !== void 0 && (_this$selectRef = _this$selectRef.select) !== null && _this$selectRef !== void 0 && _this$selectRef.inputRef) {
|
|
348
|
+
var _this$selectRef2;
|
|
349
349
|
if (providedAriaLabel) {
|
|
350
350
|
ariaLabelText = "".concat(providedAriaLabel, ". ").concat(ariaLabelText);
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
(_this$selectRef2 = _this.selectRef) === null || _this$selectRef2 === void 0 || (_this$selectRef2 = _this$selectRef2.select.inputRef) === null || _this$selectRef2 === void 0 || _this$selectRef2.setAttribute('aria-label', ariaLabelText);
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
355
|
var generateNoGroupsAriaText = function generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix) {
|
|
356
356
|
var _options$findIndex;
|
|
357
357
|
var focused = onFocusProps.focused;
|
|
358
358
|
var options = (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
359
|
-
var totalLength =
|
|
359
|
+
var totalLength = options === null || options === void 0 ? void 0 : options.length;
|
|
360
360
|
var optionIndex = (_options$findIndex = options === null || options === void 0 ? void 0 : options.findIndex(function (option) {
|
|
361
361
|
return option === focused;
|
|
362
362
|
})) !== null && _options$findIndex !== void 0 ? _options$findIndex : 0;
|
|
363
363
|
var optionName = typeof (props === null || props === void 0 ? void 0 : props.getOptionLabel) === 'function' ? props.getOptionLabel(focused) : focused.label;
|
|
364
|
-
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");
|
|
364
|
+
var ariaLabelText = "Option ".concat(optionName, " focused, ").concat(optionIndex + 1, " of ").concat(totalLength, ".\n\t\t\t").concat(totalLength, " results available.\n\t\t\t").concat(ariaLabelSuffix, "\n\t\t\t");
|
|
365
365
|
// Option LABEL focused, 1 of 8. 8 results available.
|
|
366
366
|
// Use Up and Down to choose options, press Enter to select the currently focused option,
|
|
367
367
|
// press Escape to exit the menu.
|
|
@@ -375,7 +375,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
375
375
|
if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
|
|
376
376
|
if (isOptionsGrouped(props.options)) {
|
|
377
377
|
var totalLength = countAllOptions(props.options);
|
|
378
|
-
ariaLiveMessage = onFocus(onFocusProps);
|
|
378
|
+
ariaLiveMessage = onFocus(onFocusProps, props.options);
|
|
379
379
|
ariaLabelText = "".concat(ariaLiveMessage, " ").concat(totalLength, " results available. ").concat(ariaLabelSuffix);
|
|
380
380
|
} else {
|
|
381
381
|
ariaLabelText = generateNoGroupsAriaText(onFocusProps, ariaLabelSuffix);
|
|
@@ -384,6 +384,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
384
384
|
updateInputAriaLabel(ariaLabelText);
|
|
385
385
|
return ariaLiveMessage;
|
|
386
386
|
}
|
|
387
|
+
return ariaLiveMessage;
|
|
387
388
|
};
|
|
388
389
|
var popper = /*#__PURE__*/React.createElement(Popper, _extends({}, mergedPopperProps, {
|
|
389
390
|
onFirstUpdate: function onFirstUpdate(state) {
|
|
@@ -415,7 +416,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
415
416
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
416
417
|
disabled: !focusLockEnabled,
|
|
417
418
|
returnFocus: true
|
|
418
|
-
}, /*#__PURE__*/React.createElement(
|
|
419
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
419
420
|
"aria-label": providedAriaLabel,
|
|
420
421
|
backspaceRemovesValue: false,
|
|
421
422
|
controlShouldRenderValue: false,
|
|
@@ -87,16 +87,9 @@ var Control = function Control(_ref2) {
|
|
|
87
87
|
})));
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
91
|
-
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
92
90
|
/**
|
|
93
91
|
* __Dummy control__
|
|
94
|
-
*
|
|
95
|
-
* A dummy control {description}.
|
|
96
|
-
*
|
|
97
|
-
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
98
|
-
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
99
|
-
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
92
|
+
* Overrides the default DummyControl component in Select.
|
|
100
93
|
*/
|
|
101
94
|
export var DummyControl = function DummyControl(props) {
|
|
102
95
|
return jsx(VisuallyHidden, null, jsx(components.Control, props));
|
|
@@ -108,8 +101,20 @@ var Menu = function Menu(_ref3) {
|
|
|
108
101
|
innerProps = _ref3.innerProps;
|
|
109
102
|
return jsx("div", innerProps, children);
|
|
110
103
|
};
|
|
104
|
+
var IndicatorSeparator = function IndicatorSeparator(props) {
|
|
105
|
+
return jsx(components.IndicatorSeparator, props);
|
|
106
|
+
};
|
|
107
|
+
var ClearIndicator = function ClearIndicator(props) {
|
|
108
|
+
return jsx(components.ClearIndicator, props);
|
|
109
|
+
};
|
|
110
|
+
var MultiValueRemove = function MultiValueRemove(props) {
|
|
111
|
+
return jsx(components.MultiValueRemove, props);
|
|
112
|
+
};
|
|
111
113
|
export var defaultComponents = {
|
|
112
114
|
Control: Control,
|
|
113
115
|
DropdownIndicator: DropdownIndicator,
|
|
114
|
-
Menu: Menu
|
|
116
|
+
Menu: Menu,
|
|
117
|
+
IndicatorSeparator: IndicatorSeparator,
|
|
118
|
+
ClearIndicator: ClearIndicator,
|
|
119
|
+
MultiValueRemove: MultiValueRemove
|
|
115
120
|
};
|
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.15.
|
|
5
|
+
var packageVersion = "17.15.1";
|
|
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 } from './utils/grouped-options-announcement';
|
|
13
|
+
import { isOptionsGrouped, onFocus as _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,7 +80,9 @@ export default function createSelect(WrappedComponent) {
|
|
|
80
80
|
ref: internalSelectRef,
|
|
81
81
|
"aria-live": "assertive",
|
|
82
82
|
ariaLiveMessages: isOptionsGrouped(props.options) ? _objectSpread({
|
|
83
|
-
onFocus: onFocus
|
|
83
|
+
onFocus: function onFocus(data) {
|
|
84
|
+
return _onFocus(data, props.options);
|
|
85
|
+
}
|
|
84
86
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages),
|
|
85
87
|
tabSelectsValue: tabSelectsValue,
|
|
86
88
|
onClickPreventDefault: onClickPreventDefault
|
|
@@ -1,13 +1,12 @@
|
|
|
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(onFocusProps, defaultOptions) {
|
|
4
4
|
var _groupData$options$fi;
|
|
5
|
-
var focused =
|
|
6
|
-
options = props.options;
|
|
5
|
+
var focused = onFocusProps.focused;
|
|
7
6
|
var isOptionFocused = function isOptionFocused(option) {
|
|
8
|
-
return option === focused;
|
|
7
|
+
return option.label === focused.label;
|
|
9
8
|
};
|
|
10
|
-
var groupData =
|
|
9
|
+
var groupData = defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.find(function (option) {
|
|
11
10
|
var _option$options;
|
|
12
11
|
return (_option$options = option.options) === null || _option$options === void 0 ? void 0 : _option$options.some(isOptionFocused);
|
|
13
12
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
import { type ActionMeta, type AtlaskitSelectRefType, type OptionType, type ReactSelectProps, type StylesConfig, type ValidationState, type ValueType } from '../types';
|
|
5
6
|
type defaultModifiers = 'offset' | 'preventOverflow';
|
|
6
7
|
type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
|
|
@@ -94,7 +95,7 @@ interface State<Modifiers = string> {
|
|
|
94
95
|
}
|
|
95
96
|
export default class PopupSelect<Option = OptionType, IsMulti extends boolean = false, Modifiers = ModifierList> extends PureComponent<PopupSelectProps<Option, IsMulti, Modifiers>, State> {
|
|
96
97
|
menuRef: HTMLElement | null;
|
|
97
|
-
selectRef:
|
|
98
|
+
selectRef: AtlaskitSelectRefType | null;
|
|
98
99
|
targetRef: HTMLElement | null;
|
|
99
100
|
unbindWindowClick: UnbindFn | null;
|
|
100
101
|
unbindWindowKeydown: UnbindFn | null;
|
|
@@ -108,6 +109,9 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
108
109
|
Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
|
|
109
110
|
DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
|
|
110
111
|
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;
|
|
111
115
|
};
|
|
112
116
|
mergedPopperProps: PopperPropsNoChildren<string>;
|
|
113
117
|
};
|
|
@@ -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 ControlProps, type MenuProps, type OptionType } from '../types';
|
|
7
|
+
import { type ClearIndicatorProps, type ControlProps, type IndicatorSeparatorProps, type MenuProps, type MultiValueRemoveProps, type OptionType } from '../types';
|
|
8
8
|
interface MenuDialogProps {
|
|
9
9
|
maxWidth?: number | string;
|
|
10
10
|
minWidth?: number | string;
|
|
@@ -21,17 +21,15 @@ interface MenuDialogProps {
|
|
|
21
21
|
export declare const MenuDialog: import("react").ForwardRefExoticComponent<MenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
22
|
/**
|
|
23
23
|
* __Dummy control__
|
|
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)
|
|
24
|
+
* Overrides the default DummyControl component in Select.
|
|
30
25
|
*/
|
|
31
26
|
export declare const DummyControl: FC<ControlProps<OptionType, boolean>>;
|
|
32
27
|
export declare const defaultComponents: {
|
|
33
28
|
Control: FC<ControlProps<OptionType, boolean>>;
|
|
34
29
|
DropdownIndicator: () => jsx.JSX.Element;
|
|
35
30
|
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;
|
|
36
34
|
};
|
|
37
35
|
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(onFocusProps: AriaOnFocusProps<OptionType, GroupBase<OptionType>>, defaultOptions?: OptionsOrGroups<OptionType, GroupType<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,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
import { type ActionMeta, type AtlaskitSelectRefType, type OptionType, type ReactSelectProps, type StylesConfig, type ValidationState, type ValueType } from '../types';
|
|
5
6
|
type defaultModifiers = 'offset' | 'preventOverflow';
|
|
6
7
|
type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
|
|
@@ -94,7 +95,7 @@ interface State<Modifiers = string> {
|
|
|
94
95
|
}
|
|
95
96
|
export default class PopupSelect<Option = OptionType, IsMulti extends boolean = false, Modifiers = ModifierList> extends PureComponent<PopupSelectProps<Option, IsMulti, Modifiers>, State> {
|
|
96
97
|
menuRef: HTMLElement | null;
|
|
97
|
-
selectRef:
|
|
98
|
+
selectRef: AtlaskitSelectRefType | null;
|
|
98
99
|
targetRef: HTMLElement | null;
|
|
99
100
|
unbindWindowClick: UnbindFn | null;
|
|
100
101
|
unbindWindowKeydown: UnbindFn | null;
|
|
@@ -108,6 +109,9 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
108
109
|
Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
|
|
109
110
|
DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
|
|
110
111
|
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;
|
|
111
115
|
};
|
|
112
116
|
mergedPopperProps: PopperPropsNoChildren<string>;
|
|
113
117
|
};
|
|
@@ -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 ControlProps, type MenuProps, type OptionType } from '../types';
|
|
7
|
+
import { type ClearIndicatorProps, type ControlProps, type IndicatorSeparatorProps, type MenuProps, type MultiValueRemoveProps, type OptionType } from '../types';
|
|
8
8
|
interface MenuDialogProps {
|
|
9
9
|
maxWidth?: number | string;
|
|
10
10
|
minWidth?: number | string;
|
|
@@ -21,17 +21,15 @@ interface MenuDialogProps {
|
|
|
21
21
|
export declare const MenuDialog: import("react").ForwardRefExoticComponent<MenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
22
|
/**
|
|
23
23
|
* __Dummy control__
|
|
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)
|
|
24
|
+
* Overrides the default DummyControl component in Select.
|
|
30
25
|
*/
|
|
31
26
|
export declare const DummyControl: FC<ControlProps<OptionType, boolean>>;
|
|
32
27
|
export declare const defaultComponents: {
|
|
33
28
|
Control: FC<ControlProps<OptionType, boolean>>;
|
|
34
29
|
DropdownIndicator: () => jsx.JSX.Element;
|
|
35
30
|
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;
|
|
36
34
|
};
|
|
37
35
|
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(onFocusProps: AriaOnFocusProps<OptionType, GroupBase<OptionType>>, defaultOptions?: OptionsOrGroups<OptionType, GroupType<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.15.
|
|
3
|
+
"version": "17.15.1",
|
|
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/"
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
46
|
-
"@atlaskit/icon": "^22.
|
|
46
|
+
"@atlaskit/icon": "^22.14.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
48
48
|
"@atlaskit/primitives": "^12.0.0",
|
|
49
49
|
"@atlaskit/spinner": "^16.3.0",
|
|
50
50
|
"@atlaskit/theme": "^13.0.0",
|
|
51
|
-
"@atlaskit/tokens": "^1.
|
|
51
|
+
"@atlaskit/tokens": "^1.59.0",
|
|
52
52
|
"@atlaskit/visually-hidden": "^1.5.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@af/integration-testing": "*",
|
|
71
71
|
"@af/visual-regression": "*",
|
|
72
72
|
"@atlaskit/checkbox": "^13.7.0",
|
|
73
|
-
"@atlaskit/ds-lib": "^2.
|
|
73
|
+
"@atlaskit/ds-lib": "^2.5.0",
|
|
74
74
|
"@atlaskit/modal-dialog": "^12.15.0",
|
|
75
75
|
"@atlaskit/radio": "^6.5.0",
|
|
76
76
|
"@atlaskit/ssr": "*",
|
|
@@ -104,9 +104,6 @@
|
|
|
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
|
-
},
|
|
110
107
|
"platform-design-system-dsp-19701-no-node-resolver": {
|
|
111
108
|
"type": "boolean"
|
|
112
109
|
}
|