@atlaskit/select 17.13.2 → 17.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/PopupSelect/PopupSelect.js +96 -52
- package/dist/cjs/PopupSelect/components.js +15 -13
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/components/no-options.js +7 -1
- package/dist/es2019/PopupSelect/PopupSelect.js +48 -6
- package/dist/es2019/PopupSelect/components.js +5 -3
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/components/no-options.js +7 -1
- package/dist/esm/PopupSelect/PopupSelect.js +96 -52
- package/dist/esm/PopupSelect/components.js +4 -2
- package/dist/esm/Select.js +1 -1
- package/dist/esm/components/no-options.js +7 -1
- package/dist/types/PopupSelect/PopupSelect.d.ts +1 -1
- package/dist/types/PopupSelect/components.d.ts +1 -1
- package/dist/types/components/no-options.d.ts +4 -1
- package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +1 -1
- package/dist/types-ts4.5/PopupSelect/components.d.ts +1 -1
- package/dist/types-ts4.5/components/no-options.d.ts +4 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 17.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`0d3bdaf1e3d68`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0d3bdaf1e3d68) -
|
|
8
|
+
[ux] Set the color.text.subtle token for 'No options' text to meet a 4.5:1 color contrast.
|
|
9
|
+
|
|
10
|
+
## 17.14.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [#130406](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130406)
|
|
15
|
+
[`9d04736c97bfe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d04736c97bfe) -
|
|
16
|
+
Added feature flag for fixing react18 bug(https://product-fabric.atlassian.net/browse/DSP-19701)
|
|
17
|
+
for handling menu triggers
|
|
18
|
+
|
|
3
19
|
## 17.13.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -30,7 +30,7 @@ var _Select = _interopRequireDefault(require("../Select"));
|
|
|
30
30
|
var _styles = _interopRequireDefault(require("../styles"));
|
|
31
31
|
var _groupedOptionsAnnouncement = require("../utils/grouped-options-announcement");
|
|
32
32
|
var _components = require("./components");
|
|
33
|
-
var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId"];
|
|
33
|
+
var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId", "onMenuOpen", "onMenuClose"];
|
|
34
34
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
35
35
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
36
36
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -178,7 +178,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
178
178
|
* @param options.controlOverride - Force the popup to open when it's open state is being controlled
|
|
179
179
|
*/
|
|
180
180
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "open", function (options) {
|
|
181
|
-
var
|
|
181
|
+
var _this$props2 = _this.props,
|
|
182
|
+
onOpen = _this$props2.onOpen,
|
|
183
|
+
onMenuOpen = _this$props2.onMenuOpen;
|
|
182
184
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
183
185
|
// Prevent popup opening if it's open state is already being controlled
|
|
184
186
|
return;
|
|
@@ -186,6 +188,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
186
188
|
if (onOpen) {
|
|
187
189
|
onOpen();
|
|
188
190
|
}
|
|
191
|
+
if (onMenuOpen && (0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver')) {
|
|
192
|
+
onMenuOpen();
|
|
193
|
+
}
|
|
189
194
|
_this.setState({
|
|
190
195
|
isOpen: true
|
|
191
196
|
});
|
|
@@ -211,7 +216,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
211
216
|
*/
|
|
212
217
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "close", function (options) {
|
|
213
218
|
var _this$unbindWindowKey, _this2;
|
|
214
|
-
var
|
|
219
|
+
var _this$props3 = _this.props,
|
|
220
|
+
onClose = _this$props3.onClose,
|
|
221
|
+
onMenuClose = _this$props3.onMenuClose;
|
|
215
222
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
216
223
|
// Prevent popup closing if it's open state is already being controlled
|
|
217
224
|
return;
|
|
@@ -219,6 +226,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
219
226
|
if (onClose) {
|
|
220
227
|
onClose();
|
|
221
228
|
}
|
|
229
|
+
if (onMenuClose && (0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver')) {
|
|
230
|
+
onMenuClose();
|
|
231
|
+
}
|
|
222
232
|
_this.setState({
|
|
223
233
|
isOpen: false
|
|
224
234
|
});
|
|
@@ -296,23 +306,29 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
296
306
|
});
|
|
297
307
|
// if the threshold is exceeded, AND isSearchable is true, then display the search control
|
|
298
308
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showSearchControl", function () {
|
|
299
|
-
var _this$
|
|
300
|
-
searchThreshold = _this$
|
|
301
|
-
isSearchable = _this$
|
|
309
|
+
var _this$props4 = _this.props,
|
|
310
|
+
searchThreshold = _this$props4.searchThreshold,
|
|
311
|
+
isSearchable = _this$props4.isSearchable;
|
|
302
312
|
return isSearchable && _this.getItemCount() > searchThreshold;
|
|
303
313
|
});
|
|
304
314
|
// Renderers
|
|
305
315
|
// ==============================
|
|
306
316
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSelect", function () {
|
|
307
|
-
var _this$
|
|
308
|
-
footer = _this$
|
|
309
|
-
label = _this$
|
|
310
|
-
maxMenuWidth = _this$
|
|
311
|
-
minMenuWidth = _this$
|
|
312
|
-
placeholder = _this$
|
|
313
|
-
target = _this$
|
|
314
|
-
testId = _this$
|
|
315
|
-
|
|
317
|
+
var _this$props5 = _this.props,
|
|
318
|
+
footer = _this$props5.footer,
|
|
319
|
+
label = _this$props5.label,
|
|
320
|
+
maxMenuWidth = _this$props5.maxMenuWidth,
|
|
321
|
+
minMenuWidth = _this$props5.minMenuWidth,
|
|
322
|
+
placeholder = _this$props5.placeholder,
|
|
323
|
+
target = _this$props5.target,
|
|
324
|
+
testId = _this$props5.testId,
|
|
325
|
+
onMenuOpen = _this$props5.onMenuOpen,
|
|
326
|
+
onMenuClose = _this$props5.onMenuClose,
|
|
327
|
+
props = (0, _objectWithoutProperties2.default)(_this$props5, _excluded);
|
|
328
|
+
var menuHandlers = !(0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver') ? {
|
|
329
|
+
onMenuOpen: onMenuOpen,
|
|
330
|
+
onMenuClose: onMenuClose
|
|
331
|
+
} : {};
|
|
316
332
|
var _this$state = _this.state,
|
|
317
333
|
focusLockEnabled = _this$state.focusLockEnabled,
|
|
318
334
|
isOpen = _this$state.isOpen,
|
|
@@ -389,42 +405,49 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
389
405
|
var placement = _ref2.placement,
|
|
390
406
|
ref = _ref2.ref,
|
|
391
407
|
style = _ref2.style;
|
|
392
|
-
return
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
408
|
+
return (
|
|
409
|
+
/*#__PURE__*/
|
|
410
|
+
// When the feature flag 'platform-design-system-dsp-19701-no-node-resolver' is enabled,
|
|
411
|
+
// we directly pass the ref to MenuDialog instead of wrapping it with NodeResolver.
|
|
412
|
+
_react.default.createElement(ConditionalNodeResolverWrapper, {
|
|
413
|
+
hasNodeResolver: !(0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver'),
|
|
414
|
+
innerRef: _this.resolveMenuRef(ref)
|
|
415
|
+
}, /*#__PURE__*/_react.default.createElement(_components.MenuDialog
|
|
416
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
417
|
+
, {
|
|
418
|
+
style: style,
|
|
419
|
+
"data-placement": placement,
|
|
420
|
+
minWidth: minMenuWidth,
|
|
421
|
+
maxWidth: maxMenuWidth,
|
|
422
|
+
id: _this.popperWrapperId,
|
|
423
|
+
testId: testId,
|
|
424
|
+
ref: !(0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver') ? null : _this.resolveMenuRef(ref)
|
|
425
|
+
}, /*#__PURE__*/_react.default.createElement(_reactFocusLock.default, {
|
|
426
|
+
disabled: !focusLockEnabled,
|
|
427
|
+
returnFocus: true
|
|
428
|
+
}, /*#__PURE__*/_react.default.createElement(InternalSelect, (0, _extends2.default)({
|
|
429
|
+
"aria-label": providedAriaLabel,
|
|
430
|
+
backspaceRemovesValue: false,
|
|
431
|
+
controlShouldRenderValue: false,
|
|
432
|
+
isClearable: false,
|
|
433
|
+
tabSelectsValue: false,
|
|
434
|
+
menuIsOpen: true,
|
|
435
|
+
placeholder: placeholder,
|
|
436
|
+
ref: _this.getSelectRef
|
|
437
|
+
}, props, menuHandlers, {
|
|
438
|
+
isSearchable: showSearchControl
|
|
439
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
440
|
+
,
|
|
441
|
+
styles: (0, _reactSelect.mergeStyles)(_this.defaultStyles, props.styles || {}),
|
|
442
|
+
maxMenuHeight: _this.getMaxHeight(),
|
|
443
|
+
components: selectComponents,
|
|
444
|
+
onChange: _this.handleSelectChange,
|
|
445
|
+
ariaLiveMessages: !showSearchControl ? _objectSpread({
|
|
446
|
+
// Overwriting ariaLiveMessages builtin onFocus method to announce selected option when popup has been opened
|
|
447
|
+
onFocus: onReactSelectFocus
|
|
448
|
+
}, props.ariaLiveMessages) : props.ariaLiveMessages
|
|
449
|
+
})), footer)))
|
|
450
|
+
);
|
|
428
451
|
});
|
|
429
452
|
return mergedPopperProps.strategy === 'fixed' ? popper : /*#__PURE__*/(0, _reactDom.createPortal)(popper, portalDestination);
|
|
430
453
|
});
|
|
@@ -525,4 +548,25 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
525
548
|
searchThreshold: 5,
|
|
526
549
|
styles: {},
|
|
527
550
|
options: []
|
|
528
|
-
});
|
|
551
|
+
});
|
|
552
|
+
/**
|
|
553
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
554
|
+
*
|
|
555
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
556
|
+
* is intended to be removed once the feature flag is removed.
|
|
557
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
558
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
559
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
560
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, otherwise just the children.
|
|
561
|
+
*/
|
|
562
|
+
var ConditionalNodeResolverWrapper = function ConditionalNodeResolverWrapper(_ref4) {
|
|
563
|
+
var hasNodeResolver = _ref4.hasNodeResolver,
|
|
564
|
+
children = _ref4.children,
|
|
565
|
+
innerRef = _ref4.innerRef;
|
|
566
|
+
if (hasNodeResolver) {
|
|
567
|
+
return /*#__PURE__*/_react.default.createElement(_reactNodeResolver.default, {
|
|
568
|
+
innerRef: innerRef
|
|
569
|
+
}, children);
|
|
570
|
+
}
|
|
571
|
+
return children;
|
|
572
|
+
};
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.defaultComponents = exports.MenuDialog = exports.DummyControl = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
11
12
|
var _reactSelect = require("react-select");
|
|
12
13
|
var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/search"));
|
|
13
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -23,7 +24,7 @@ var _excluded = ["innerRef", "innerProps"];
|
|
|
23
24
|
// Styled Components
|
|
24
25
|
// ==============================
|
|
25
26
|
|
|
26
|
-
var menuDialogStyles = (0,
|
|
27
|
+
var menuDialogStyles = (0, _react2.css)({
|
|
27
28
|
zIndex: _constants.layers.modal(),
|
|
28
29
|
backgroundColor: "var(--ds-surface-overlay, white)",
|
|
29
30
|
borderRadius: "var(--ds-border-radius-100, 4px)",
|
|
@@ -35,14 +36,15 @@ var menuDialogStyles = (0, _react.css)({
|
|
|
35
36
|
* Wrapper for PopupSelect component.
|
|
36
37
|
*
|
|
37
38
|
*/
|
|
38
|
-
var MenuDialog = exports.MenuDialog = function
|
|
39
|
+
var MenuDialog = exports.MenuDialog = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
39
40
|
var maxWidth = _ref.maxWidth,
|
|
40
41
|
minWidth = _ref.minWidth,
|
|
41
42
|
children = _ref.children,
|
|
42
43
|
id = _ref.id,
|
|
43
44
|
style = _ref.style,
|
|
44
45
|
testId = _ref.testId;
|
|
45
|
-
return (0,
|
|
46
|
+
return (0, _react2.jsx)("div", {
|
|
47
|
+
ref: ref,
|
|
46
48
|
css: [menuDialogStyles,
|
|
47
49
|
// There is not a limited amount of values for the widths, so they need
|
|
48
50
|
// to remain dynamic.
|
|
@@ -57,35 +59,35 @@ var MenuDialog = exports.MenuDialog = function MenuDialog(_ref) {
|
|
|
57
59
|
id: id,
|
|
58
60
|
"data-testid": testId && "".concat(testId, "--menu")
|
|
59
61
|
}, children);
|
|
60
|
-
};
|
|
62
|
+
});
|
|
61
63
|
|
|
62
64
|
// ==============================
|
|
63
65
|
// Custom Components
|
|
64
66
|
// ==============================
|
|
65
67
|
|
|
66
|
-
var dropdownStyles = (0,
|
|
68
|
+
var dropdownStyles = (0, _react2.css)({
|
|
67
69
|
width: 32,
|
|
68
70
|
marginInlineEnd: "var(--ds-space-025, 2px)",
|
|
69
71
|
textAlign: 'center'
|
|
70
72
|
});
|
|
71
73
|
var DropdownIndicator = function DropdownIndicator() {
|
|
72
|
-
return (0,
|
|
74
|
+
return (0, _react2.jsx)("div", {
|
|
73
75
|
css: dropdownStyles
|
|
74
|
-
}, (0,
|
|
76
|
+
}, (0, _react2.jsx)(_search.default, {
|
|
75
77
|
label: "open"
|
|
76
78
|
}));
|
|
77
79
|
};
|
|
78
|
-
var controlStyles = (0,
|
|
80
|
+
var controlStyles = (0, _react2.css)({
|
|
79
81
|
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-050, 4px)")
|
|
80
82
|
});
|
|
81
83
|
var Control = function Control(_ref2) {
|
|
82
84
|
var innerRef = _ref2.innerRef,
|
|
83
85
|
innerProps = _ref2.innerProps,
|
|
84
86
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
85
|
-
return (0,
|
|
87
|
+
return (0, _react2.jsx)("div", {
|
|
86
88
|
ref: innerRef,
|
|
87
89
|
css: controlStyles
|
|
88
|
-
}, (0,
|
|
90
|
+
}, (0, _react2.jsx)(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
|
|
89
91
|
innerProps: innerProps
|
|
90
92
|
})));
|
|
91
93
|
};
|
|
@@ -102,14 +104,14 @@ var Control = function Control(_ref2) {
|
|
|
102
104
|
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
103
105
|
*/
|
|
104
106
|
var DummyControl = exports.DummyControl = function DummyControl(props) {
|
|
105
|
-
return (0,
|
|
107
|
+
return (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)(_reactSelect.components.Control, props));
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
// NOTE `props` intentionally omitted from `Fragment`
|
|
109
111
|
var Menu = function Menu(_ref3) {
|
|
110
112
|
var children = _ref3.children,
|
|
111
113
|
innerProps = _ref3.innerProps;
|
|
112
|
-
return (0,
|
|
114
|
+
return (0, _react2.jsx)("div", innerProps, children);
|
|
113
115
|
};
|
|
114
116
|
var defaultComponents = exports.defaultComponents = {
|
|
115
117
|
Control: Control,
|
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.
|
|
12
|
+
var packageVersion = "17.15.0";
|
|
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)({
|
|
@@ -7,9 +7,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.NoOptionsMessage = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactSelect = require("react-select");
|
|
10
|
+
var _primitives = require("@atlaskit/primitives");
|
|
11
|
+
/**
|
|
12
|
+
* __No options message__
|
|
13
|
+
*/
|
|
10
14
|
var NoOptionsMessage = exports.NoOptionsMessage = function NoOptionsMessage(props) {
|
|
11
15
|
return /*#__PURE__*/_react.default.createElement(_reactSelect.components.NoOptionsMessage, props, /*#__PURE__*/_react.default.createElement("span", {
|
|
12
16
|
id: "no-options",
|
|
13
17
|
role: "alert"
|
|
14
|
-
},
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
19
|
+
color: "color.text.subtle"
|
|
20
|
+
}, props.children || "No options")));
|
|
15
21
|
};
|
|
@@ -149,7 +149,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
149
149
|
*/
|
|
150
150
|
_defineProperty(this, "open", options => {
|
|
151
151
|
const {
|
|
152
|
-
onOpen
|
|
152
|
+
onOpen,
|
|
153
|
+
onMenuOpen
|
|
153
154
|
} = this.props;
|
|
154
155
|
if (!(options !== null && options !== void 0 && options.controlOverride) && this.isOpenControlled) {
|
|
155
156
|
// Prevent popup opening if it's open state is already being controlled
|
|
@@ -158,6 +159,9 @@ export default class PopupSelect extends PureComponent {
|
|
|
158
159
|
if (onOpen) {
|
|
159
160
|
onOpen();
|
|
160
161
|
}
|
|
162
|
+
if (onMenuOpen && fg('platform-design-system-dsp-19701-no-node-resolver')) {
|
|
163
|
+
onMenuOpen();
|
|
164
|
+
}
|
|
161
165
|
this.setState({
|
|
162
166
|
isOpen: true
|
|
163
167
|
});
|
|
@@ -184,7 +188,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
184
188
|
_defineProperty(this, "close", options => {
|
|
185
189
|
var _this$unbindWindowKey;
|
|
186
190
|
const {
|
|
187
|
-
onClose
|
|
191
|
+
onClose,
|
|
192
|
+
onMenuClose
|
|
188
193
|
} = this.props;
|
|
189
194
|
if (!(options !== null && options !== void 0 && options.controlOverride) && this.isOpenControlled) {
|
|
190
195
|
// Prevent popup closing if it's open state is already being controlled
|
|
@@ -193,6 +198,9 @@ export default class PopupSelect extends PureComponent {
|
|
|
193
198
|
if (onClose) {
|
|
194
199
|
onClose();
|
|
195
200
|
}
|
|
201
|
+
if (onMenuClose && fg('platform-design-system-dsp-19701-no-node-resolver')) {
|
|
202
|
+
onMenuClose();
|
|
203
|
+
}
|
|
196
204
|
this.setState({
|
|
197
205
|
isOpen: false
|
|
198
206
|
});
|
|
@@ -285,8 +293,14 @@ export default class PopupSelect extends PureComponent {
|
|
|
285
293
|
placeholder,
|
|
286
294
|
target,
|
|
287
295
|
testId,
|
|
296
|
+
onMenuOpen,
|
|
297
|
+
onMenuClose,
|
|
288
298
|
...props
|
|
289
299
|
} = this.props;
|
|
300
|
+
const menuHandlers = !fg('platform-design-system-dsp-19701-no-node-resolver') ? {
|
|
301
|
+
onMenuOpen,
|
|
302
|
+
onMenuClose
|
|
303
|
+
} : {};
|
|
290
304
|
const {
|
|
291
305
|
focusLockEnabled,
|
|
292
306
|
isOpen,
|
|
@@ -368,7 +382,12 @@ export default class PopupSelect extends PureComponent {
|
|
|
368
382
|
placement,
|
|
369
383
|
ref,
|
|
370
384
|
style
|
|
371
|
-
}) =>
|
|
385
|
+
}) =>
|
|
386
|
+
/*#__PURE__*/
|
|
387
|
+
// When the feature flag 'platform-design-system-dsp-19701-no-node-resolver' is enabled,
|
|
388
|
+
// we directly pass the ref to MenuDialog instead of wrapping it with NodeResolver.
|
|
389
|
+
React.createElement(ConditionalNodeResolverWrapper, {
|
|
390
|
+
hasNodeResolver: !fg('platform-design-system-dsp-19701-no-node-resolver'),
|
|
372
391
|
innerRef: this.resolveMenuRef(ref)
|
|
373
392
|
}, /*#__PURE__*/React.createElement(MenuDialog
|
|
374
393
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -378,7 +397,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
378
397
|
minWidth: minMenuWidth,
|
|
379
398
|
maxWidth: maxMenuWidth,
|
|
380
399
|
id: this.popperWrapperId,
|
|
381
|
-
testId: testId
|
|
400
|
+
testId: testId,
|
|
401
|
+
ref: !fg('platform-design-system-dsp-19701-no-node-resolver') ? null : this.resolveMenuRef(ref)
|
|
382
402
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
383
403
|
disabled: !focusLockEnabled,
|
|
384
404
|
returnFocus: true
|
|
@@ -391,7 +411,7 @@ export default class PopupSelect extends PureComponent {
|
|
|
391
411
|
menuIsOpen: true,
|
|
392
412
|
placeholder: placeholder,
|
|
393
413
|
ref: this.getSelectRef
|
|
394
|
-
}, props, {
|
|
414
|
+
}, props, menuHandlers, {
|
|
395
415
|
isSearchable: showSearchControl
|
|
396
416
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
397
417
|
,
|
|
@@ -501,4 +521,26 @@ _defineProperty(PopupSelect, "defaultProps", {
|
|
|
501
521
|
searchThreshold: 5,
|
|
502
522
|
styles: {},
|
|
503
523
|
options: []
|
|
504
|
-
});
|
|
524
|
+
});
|
|
525
|
+
/**
|
|
526
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
527
|
+
*
|
|
528
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
529
|
+
* is intended to be removed once the feature flag is removed.
|
|
530
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
531
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
532
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
533
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, otherwise just the children.
|
|
534
|
+
*/
|
|
535
|
+
const ConditionalNodeResolverWrapper = ({
|
|
536
|
+
hasNodeResolver,
|
|
537
|
+
children,
|
|
538
|
+
innerRef
|
|
539
|
+
}) => {
|
|
540
|
+
if (hasNodeResolver) {
|
|
541
|
+
return /*#__PURE__*/React.createElement(NodeResolver, {
|
|
542
|
+
innerRef: innerRef
|
|
543
|
+
}, children);
|
|
544
|
+
}
|
|
545
|
+
return children;
|
|
546
|
+
};
|
|
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
+
import { forwardRef } from 'react';
|
|
6
7
|
|
|
7
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
9
|
import { css, jsx } from '@emotion/react';
|
|
@@ -28,14 +29,15 @@ const menuDialogStyles = css({
|
|
|
28
29
|
* Wrapper for PopupSelect component.
|
|
29
30
|
*
|
|
30
31
|
*/
|
|
31
|
-
export const MenuDialog = ({
|
|
32
|
+
export const MenuDialog = /*#__PURE__*/forwardRef(({
|
|
32
33
|
maxWidth,
|
|
33
34
|
minWidth,
|
|
34
35
|
children,
|
|
35
36
|
id,
|
|
36
37
|
style,
|
|
37
38
|
testId
|
|
38
|
-
}) => jsx("div", {
|
|
39
|
+
}, ref) => jsx("div", {
|
|
40
|
+
ref: ref,
|
|
39
41
|
css: [menuDialogStyles,
|
|
40
42
|
// There is not a limited amount of values for the widths, so they need
|
|
41
43
|
// to remain dynamic.
|
|
@@ -49,7 +51,7 @@ export const MenuDialog = ({
|
|
|
49
51
|
style: style,
|
|
50
52
|
id: id,
|
|
51
53
|
"data-testid": testId && `${testId}--menu`
|
|
52
|
-
}, children);
|
|
54
|
+
}, children));
|
|
53
55
|
|
|
54
56
|
// ==============================
|
|
55
57
|
// Custom Components
|
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.
|
|
5
|
+
const packageVersion = "17.15.0";
|
|
6
6
|
export const SelectWithoutAnalytics = createSelect(ReactSelect);
|
|
7
7
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
const Select = withAnalyticsContext({
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { components } from 'react-select';
|
|
3
|
+
import { Text } from '@atlaskit/primitives';
|
|
4
|
+
/**
|
|
5
|
+
* __No options message__
|
|
6
|
+
*/
|
|
3
7
|
export const NoOptionsMessage = props => {
|
|
4
8
|
return /*#__PURE__*/React.createElement(components.NoOptionsMessage, props, /*#__PURE__*/React.createElement("span", {
|
|
5
9
|
id: "no-options",
|
|
6
10
|
role: "alert"
|
|
7
|
-
},
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
12
|
+
color: "color.text.subtle"
|
|
13
|
+
}, props.children || `No options`)));
|
|
8
14
|
};
|
|
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId"];
|
|
10
|
+
var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId", "onMenuOpen", "onMenuClose"];
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -168,7 +168,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
168
168
|
* @param options.controlOverride - Force the popup to open when it's open state is being controlled
|
|
169
169
|
*/
|
|
170
170
|
_defineProperty(_assertThisInitialized(_this), "open", function (options) {
|
|
171
|
-
var
|
|
171
|
+
var _this$props2 = _this.props,
|
|
172
|
+
onOpen = _this$props2.onOpen,
|
|
173
|
+
onMenuOpen = _this$props2.onMenuOpen;
|
|
172
174
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
173
175
|
// Prevent popup opening if it's open state is already being controlled
|
|
174
176
|
return;
|
|
@@ -176,6 +178,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
176
178
|
if (onOpen) {
|
|
177
179
|
onOpen();
|
|
178
180
|
}
|
|
181
|
+
if (onMenuOpen && fg('platform-design-system-dsp-19701-no-node-resolver')) {
|
|
182
|
+
onMenuOpen();
|
|
183
|
+
}
|
|
179
184
|
_this.setState({
|
|
180
185
|
isOpen: true
|
|
181
186
|
});
|
|
@@ -201,7 +206,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
201
206
|
*/
|
|
202
207
|
_defineProperty(_assertThisInitialized(_this), "close", function (options) {
|
|
203
208
|
var _this$unbindWindowKey, _this2;
|
|
204
|
-
var
|
|
209
|
+
var _this$props3 = _this.props,
|
|
210
|
+
onClose = _this$props3.onClose,
|
|
211
|
+
onMenuClose = _this$props3.onMenuClose;
|
|
205
212
|
if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
|
|
206
213
|
// Prevent popup closing if it's open state is already being controlled
|
|
207
214
|
return;
|
|
@@ -209,6 +216,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
209
216
|
if (onClose) {
|
|
210
217
|
onClose();
|
|
211
218
|
}
|
|
219
|
+
if (onMenuClose && fg('platform-design-system-dsp-19701-no-node-resolver')) {
|
|
220
|
+
onMenuClose();
|
|
221
|
+
}
|
|
212
222
|
_this.setState({
|
|
213
223
|
isOpen: false
|
|
214
224
|
});
|
|
@@ -286,23 +296,29 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
286
296
|
});
|
|
287
297
|
// if the threshold is exceeded, AND isSearchable is true, then display the search control
|
|
288
298
|
_defineProperty(_assertThisInitialized(_this), "showSearchControl", function () {
|
|
289
|
-
var _this$
|
|
290
|
-
searchThreshold = _this$
|
|
291
|
-
isSearchable = _this$
|
|
299
|
+
var _this$props4 = _this.props,
|
|
300
|
+
searchThreshold = _this$props4.searchThreshold,
|
|
301
|
+
isSearchable = _this$props4.isSearchable;
|
|
292
302
|
return isSearchable && _this.getItemCount() > searchThreshold;
|
|
293
303
|
});
|
|
294
304
|
// Renderers
|
|
295
305
|
// ==============================
|
|
296
306
|
_defineProperty(_assertThisInitialized(_this), "renderSelect", function () {
|
|
297
|
-
var _this$
|
|
298
|
-
footer = _this$
|
|
299
|
-
label = _this$
|
|
300
|
-
maxMenuWidth = _this$
|
|
301
|
-
minMenuWidth = _this$
|
|
302
|
-
placeholder = _this$
|
|
303
|
-
target = _this$
|
|
304
|
-
testId = _this$
|
|
305
|
-
|
|
307
|
+
var _this$props5 = _this.props,
|
|
308
|
+
footer = _this$props5.footer,
|
|
309
|
+
label = _this$props5.label,
|
|
310
|
+
maxMenuWidth = _this$props5.maxMenuWidth,
|
|
311
|
+
minMenuWidth = _this$props5.minMenuWidth,
|
|
312
|
+
placeholder = _this$props5.placeholder,
|
|
313
|
+
target = _this$props5.target,
|
|
314
|
+
testId = _this$props5.testId,
|
|
315
|
+
onMenuOpen = _this$props5.onMenuOpen,
|
|
316
|
+
onMenuClose = _this$props5.onMenuClose,
|
|
317
|
+
props = _objectWithoutProperties(_this$props5, _excluded);
|
|
318
|
+
var menuHandlers = !fg('platform-design-system-dsp-19701-no-node-resolver') ? {
|
|
319
|
+
onMenuOpen: onMenuOpen,
|
|
320
|
+
onMenuClose: onMenuClose
|
|
321
|
+
} : {};
|
|
306
322
|
var _this$state = _this.state,
|
|
307
323
|
focusLockEnabled = _this$state.focusLockEnabled,
|
|
308
324
|
isOpen = _this$state.isOpen,
|
|
@@ -379,42 +395,49 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
379
395
|
var placement = _ref2.placement,
|
|
380
396
|
ref = _ref2.ref,
|
|
381
397
|
style = _ref2.style;
|
|
382
|
-
return
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
398
|
+
return (
|
|
399
|
+
/*#__PURE__*/
|
|
400
|
+
// When the feature flag 'platform-design-system-dsp-19701-no-node-resolver' is enabled,
|
|
401
|
+
// we directly pass the ref to MenuDialog instead of wrapping it with NodeResolver.
|
|
402
|
+
React.createElement(ConditionalNodeResolverWrapper, {
|
|
403
|
+
hasNodeResolver: !fg('platform-design-system-dsp-19701-no-node-resolver'),
|
|
404
|
+
innerRef: _this.resolveMenuRef(ref)
|
|
405
|
+
}, /*#__PURE__*/React.createElement(MenuDialog
|
|
406
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
407
|
+
, {
|
|
408
|
+
style: style,
|
|
409
|
+
"data-placement": placement,
|
|
410
|
+
minWidth: minMenuWidth,
|
|
411
|
+
maxWidth: maxMenuWidth,
|
|
412
|
+
id: _this.popperWrapperId,
|
|
413
|
+
testId: testId,
|
|
414
|
+
ref: !fg('platform-design-system-dsp-19701-no-node-resolver') ? null : _this.resolveMenuRef(ref)
|
|
415
|
+
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
416
|
+
disabled: !focusLockEnabled,
|
|
417
|
+
returnFocus: true
|
|
418
|
+
}, /*#__PURE__*/React.createElement(InternalSelect, _extends({
|
|
419
|
+
"aria-label": providedAriaLabel,
|
|
420
|
+
backspaceRemovesValue: false,
|
|
421
|
+
controlShouldRenderValue: false,
|
|
422
|
+
isClearable: false,
|
|
423
|
+
tabSelectsValue: false,
|
|
424
|
+
menuIsOpen: true,
|
|
425
|
+
placeholder: placeholder,
|
|
426
|
+
ref: _this.getSelectRef
|
|
427
|
+
}, props, menuHandlers, {
|
|
428
|
+
isSearchable: showSearchControl
|
|
429
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
430
|
+
,
|
|
431
|
+
styles: mergeStyles(_this.defaultStyles, props.styles || {}),
|
|
432
|
+
maxMenuHeight: _this.getMaxHeight(),
|
|
433
|
+
components: selectComponents,
|
|
434
|
+
onChange: _this.handleSelectChange,
|
|
435
|
+
ariaLiveMessages: !showSearchControl ? _objectSpread({
|
|
436
|
+
// Overwriting ariaLiveMessages builtin onFocus method to announce selected option when popup has been opened
|
|
437
|
+
onFocus: onReactSelectFocus
|
|
438
|
+
}, props.ariaLiveMessages) : props.ariaLiveMessages
|
|
439
|
+
})), footer)))
|
|
440
|
+
);
|
|
418
441
|
});
|
|
419
442
|
return mergedPopperProps.strategy === 'fixed' ? popper : /*#__PURE__*/createPortal(popper, portalDestination);
|
|
420
443
|
});
|
|
@@ -516,4 +539,25 @@ _defineProperty(PopupSelect, "defaultProps", {
|
|
|
516
539
|
styles: {},
|
|
517
540
|
options: []
|
|
518
541
|
});
|
|
519
|
-
export { PopupSelect as default };
|
|
542
|
+
export { PopupSelect as default };
|
|
543
|
+
/**
|
|
544
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
545
|
+
*
|
|
546
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
547
|
+
* is intended to be removed once the feature flag is removed.
|
|
548
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
549
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
550
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
551
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, otherwise just the children.
|
|
552
|
+
*/
|
|
553
|
+
var ConditionalNodeResolverWrapper = function ConditionalNodeResolverWrapper(_ref4) {
|
|
554
|
+
var hasNodeResolver = _ref4.hasNodeResolver,
|
|
555
|
+
children = _ref4.children,
|
|
556
|
+
innerRef = _ref4.innerRef;
|
|
557
|
+
if (hasNodeResolver) {
|
|
558
|
+
return /*#__PURE__*/React.createElement(NodeResolver, {
|
|
559
|
+
innerRef: innerRef
|
|
560
|
+
}, children);
|
|
561
|
+
}
|
|
562
|
+
return children;
|
|
563
|
+
};
|
|
@@ -5,6 +5,7 @@ var _excluded = ["innerRef", "innerProps"];
|
|
|
5
5
|
* @jsxRuntime classic
|
|
6
6
|
* @jsx jsx
|
|
7
7
|
*/
|
|
8
|
+
import { forwardRef } from 'react';
|
|
8
9
|
|
|
9
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
11
|
import { css, jsx } from '@emotion/react';
|
|
@@ -30,7 +31,7 @@ var menuDialogStyles = css({
|
|
|
30
31
|
* Wrapper for PopupSelect component.
|
|
31
32
|
*
|
|
32
33
|
*/
|
|
33
|
-
export var MenuDialog = function
|
|
34
|
+
export var MenuDialog = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
35
|
var maxWidth = _ref.maxWidth,
|
|
35
36
|
minWidth = _ref.minWidth,
|
|
36
37
|
children = _ref.children,
|
|
@@ -38,6 +39,7 @@ export var MenuDialog = function MenuDialog(_ref) {
|
|
|
38
39
|
style = _ref.style,
|
|
39
40
|
testId = _ref.testId;
|
|
40
41
|
return jsx("div", {
|
|
42
|
+
ref: ref,
|
|
41
43
|
css: [menuDialogStyles,
|
|
42
44
|
// There is not a limited amount of values for the widths, so they need
|
|
43
45
|
// to remain dynamic.
|
|
@@ -52,7 +54,7 @@ export var MenuDialog = function MenuDialog(_ref) {
|
|
|
52
54
|
id: id,
|
|
53
55
|
"data-testid": testId && "".concat(testId, "--menu")
|
|
54
56
|
}, children);
|
|
55
|
-
};
|
|
57
|
+
});
|
|
56
58
|
|
|
57
59
|
// ==============================
|
|
58
60
|
// Custom Components
|
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.
|
|
5
|
+
var packageVersion = "17.15.0";
|
|
6
6
|
export var SelectWithoutAnalytics = createSelect(ReactSelect);
|
|
7
7
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
var Select = withAnalyticsContext({
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { components } from 'react-select';
|
|
3
|
+
import { Text } from '@atlaskit/primitives';
|
|
4
|
+
/**
|
|
5
|
+
* __No options message__
|
|
6
|
+
*/
|
|
3
7
|
export var NoOptionsMessage = function NoOptionsMessage(props) {
|
|
4
8
|
return /*#__PURE__*/React.createElement(components.NoOptionsMessage, props, /*#__PURE__*/React.createElement("span", {
|
|
5
9
|
id: "no-options",
|
|
6
10
|
role: "alert"
|
|
7
|
-
},
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
12
|
+
color: "color.text.subtle"
|
|
13
|
+
}, props.children || "No options")));
|
|
8
14
|
};
|
|
@@ -150,7 +150,7 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
150
150
|
controlOverride?: boolean;
|
|
151
151
|
}) => void;
|
|
152
152
|
resolveTargetRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
|
|
153
|
-
resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref:
|
|
153
|
+
resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLDivElement) => void;
|
|
154
154
|
getSelectRef: (ref: AtlaskitSelectRefType) => void;
|
|
155
155
|
getItemCount: () => number;
|
|
156
156
|
getMaxHeight: () => number | undefined;
|
|
@@ -18,7 +18,7 @@ interface MenuDialogProps {
|
|
|
18
18
|
* Wrapper for PopupSelect component.
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
export declare const MenuDialog:
|
|
21
|
+
export declare const MenuDialog: import("react").ForwardRefExoticComponent<MenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
22
|
/**
|
|
23
23
|
* __Dummy control__
|
|
24
24
|
*
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
2
|
+
import { type NoticeProps, type OptionType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __No options message__
|
|
5
|
+
*/
|
|
3
6
|
export declare const NoOptionsMessage: (props: NoticeProps<OptionType>) => JSX.Element;
|
|
@@ -150,7 +150,7 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
|
|
|
150
150
|
controlOverride?: boolean;
|
|
151
151
|
}) => void;
|
|
152
152
|
resolveTargetRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
|
|
153
|
-
resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref:
|
|
153
|
+
resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLDivElement) => void;
|
|
154
154
|
getSelectRef: (ref: AtlaskitSelectRefType) => void;
|
|
155
155
|
getItemCount: () => number;
|
|
156
156
|
getMaxHeight: () => number | undefined;
|
|
@@ -18,7 +18,7 @@ interface MenuDialogProps {
|
|
|
18
18
|
* Wrapper for PopupSelect component.
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
export declare const MenuDialog:
|
|
21
|
+
export declare const MenuDialog: import("react").ForwardRefExoticComponent<MenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
22
|
/**
|
|
23
23
|
* __Dummy control__
|
|
24
24
|
*
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
2
|
+
import { type NoticeProps, type OptionType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __No options message__
|
|
5
|
+
*/
|
|
3
6
|
export declare const NoOptionsMessage: (props: NoticeProps<OptionType>) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/select",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.15.0",
|
|
4
4
|
"description": "Select allows users to make a single selection or multiple selections from a list of options.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"name": "Select",
|
|
33
33
|
"category": "Components"
|
|
34
34
|
},
|
|
35
|
-
"runReact18":
|
|
35
|
+
"runReact18": false
|
|
36
36
|
},
|
|
37
37
|
"af:exports": {
|
|
38
38
|
"./AsyncSelect": "./src/entry-points/async-select.tsx",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
46
|
-
"@atlaskit/icon": "^22.
|
|
46
|
+
"@atlaskit/icon": "^22.13.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
48
48
|
"@atlaskit/primitives": "^12.0.0",
|
|
49
49
|
"@atlaskit/spinner": "^16.3.0",
|
|
@@ -106,6 +106,9 @@
|
|
|
106
106
|
"platform-feature-flags": {
|
|
107
107
|
"platform.design-system-team.use-default-select-in-popup-select_46rmj": {
|
|
108
108
|
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"platform-design-system-dsp-19701-no-node-resolver": {
|
|
111
|
+
"type": "boolean"
|
|
109
112
|
}
|
|
110
113
|
},
|
|
111
114
|
"homepage": "https://atlassian.design/components/select/"
|