@atlaskit/dropdown-menu 11.12.0 → 11.14.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 +17 -1
- package/dist/cjs/dropdown-menu.js +23 -15
- package/dist/cjs/internal/components/focus-manager.js +5 -15
- package/dist/cjs/internal/hooks/use-radio-state.js +2 -2
- package/dist/cjs/internal/utils/handle-focus.js +2 -2
- package/dist/cjs/internal/utils/reset-options-in-group.js +2 -2
- package/dist/cjs/radio/dropdown-item-radio-group.js +2 -2
- package/dist/es2019/dropdown-menu.js +30 -24
- package/dist/es2019/internal/components/focus-manager.js +6 -16
- package/dist/es2019/internal/utils/handle-focus.js +2 -2
- package/dist/esm/dropdown-menu.js +24 -16
- package/dist/esm/internal/components/focus-manager.js +6 -16
- package/dist/esm/internal/hooks/use-radio-state.js +2 -2
- package/dist/esm/internal/utils/handle-focus.js +2 -2
- package/dist/esm/internal/utils/reset-options-in-group.js +2 -2
- package/dist/esm/radio/dropdown-item-radio-group.js +2 -2
- package/dist/types/internal/utils/handle-focus.d.ts +1 -2
- package/dist/types-ts4.5/internal/utils/handle-focus.d.ts +1 -2
- package/package.json +17 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 11.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f355884a4aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f355884a4aa) - [ux] Support to press escape key and only close the top layer
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 11.13.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [`4f211dbe626`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4f211dbe626) - [ux] We are adopting a new Button component behind a feature flag. This is necessary for the implementation of the SplitButton component. If this adoption is successful, it will be available in a later release.
|
|
18
|
+
|
|
3
19
|
## 11.12.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -1160,7 +1176,7 @@
|
|
|
1160
1176
|
|
|
1161
1177
|
## 6.1.20
|
|
1162
1178
|
|
|
1163
|
-
- [patch][fe943bb
|
|
1179
|
+
- [patch][fe943bb](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/fe943bb"
|
|
1164
1180
|
d):
|
|
1165
1181
|
|
|
1166
1182
|
- Make sure we check userAgent only if we have a DOM
|
|
@@ -13,6 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _bindEventListener = require("bind-event-listener");
|
|
15
15
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
16
|
+
var _unsafe = require("@atlaskit/button/unsafe");
|
|
16
17
|
var _keycodes = require("@atlaskit/ds-lib/keycodes");
|
|
17
18
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
18
19
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
@@ -22,7 +23,6 @@ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-
|
|
|
22
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
24
|
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
24
25
|
var _constants = require("@atlaskit/theme/constants");
|
|
25
|
-
var _context = require("./internal/components/context");
|
|
26
26
|
var _focusManager = _interopRequireDefault(require("./internal/components/focus-manager"));
|
|
27
27
|
var _menuWrapper = _interopRequireDefault(require("./internal/components/menu-wrapper"));
|
|
28
28
|
var _selectionStore = _interopRequireDefault(require("./internal/context/selection-store"));
|
|
@@ -31,8 +31,8 @@ var _useGeneratedId = _interopRequireWildcard(require("./internal/utils/use-gene
|
|
|
31
31
|
var _excluded = ["ref"]; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
|
-
function ownKeys(
|
|
35
|
-
function _objectSpread(
|
|
34
|
+
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; }
|
|
35
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
36
|
var gridSize = (0, _constants.gridSize)();
|
|
37
37
|
var MAX_HEIGHT = "calc(100vh - ".concat(gridSize * 2, "px)");
|
|
38
38
|
var opposites = {
|
|
@@ -101,7 +101,6 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
101
101
|
_useControlledState2 = (0, _slicedToArray2.default)(_useControlledState, 2),
|
|
102
102
|
isLocalOpen = _useControlledState2[0],
|
|
103
103
|
setLocalIsOpen = _useControlledState2[1];
|
|
104
|
-
var nestedLevel = (0, _react.useContext)(_context.NestedLevelContext);
|
|
105
104
|
var _useState = (0, _react.useState)(false),
|
|
106
105
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
107
106
|
isTriggeredUsingKeyboard = _useState2[0],
|
|
@@ -175,14 +174,12 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
175
174
|
});
|
|
176
175
|
}, [isFocused, isLocalOpen, handleTriggerClicked]);
|
|
177
176
|
var id = (0, _useGeneratedId.default)();
|
|
178
|
-
var isNested = nestedLevel > 0;
|
|
179
177
|
var itemRef = (0, _useRegisterItemWithFocusManager.default)();
|
|
180
178
|
return /*#__PURE__*/_react.default.createElement(_selectionStore.default, null, /*#__PURE__*/_react.default.createElement(_popup.default, {
|
|
181
179
|
id: isLocalOpen ? id : undefined,
|
|
182
180
|
shouldFlip: shouldFlip,
|
|
183
181
|
isOpen: isLocalOpen,
|
|
184
|
-
onClose:
|
|
185
|
-
,
|
|
182
|
+
onClose: handleOnClose,
|
|
186
183
|
zIndex: zIndex,
|
|
187
184
|
placement: placement,
|
|
188
185
|
fallbackPlacements: fallbackPlacements,
|
|
@@ -194,14 +191,28 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
194
191
|
var ref = triggerProps.ref,
|
|
195
192
|
providedProps = (0, _objectWithoutProperties2.default)(triggerProps, _excluded);
|
|
196
193
|
return _trigger(_objectSpread(_objectSpread(_objectSpread({}, providedProps), bindFocus), {}, {
|
|
197
|
-
triggerRef:
|
|
194
|
+
triggerRef: (0, _mergeRefs.default)([ref, itemRef]),
|
|
198
195
|
isSelected: isLocalOpen,
|
|
199
196
|
onClick: handleTriggerClicked,
|
|
200
197
|
testId: testId && "".concat(testId, "--trigger")
|
|
201
198
|
}));
|
|
202
199
|
}
|
|
203
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
204
|
-
|
|
200
|
+
return (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.new-button-adoption-in-dropdown_p8sn4') ? /*#__PURE__*/_react.default.createElement(_unsafe.UNSAFE_BUTTON, {
|
|
201
|
+
iconAfter: /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
202
|
+
size: "medium",
|
|
203
|
+
label: ""
|
|
204
|
+
}),
|
|
205
|
+
onFocus: bindFocus.onFocus,
|
|
206
|
+
onBlur: bindFocus.onBlur,
|
|
207
|
+
ref: (0, _mergeRefs.default)([triggerProps.ref, itemRef]),
|
|
208
|
+
"aria-controls": triggerProps['aria-controls'],
|
|
209
|
+
"aria-expanded": triggerProps['aria-expanded'],
|
|
210
|
+
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
211
|
+
isSelected: isLocalOpen,
|
|
212
|
+
onClick: handleTriggerClicked,
|
|
213
|
+
testId: testId && "".concat(testId, "--trigger")
|
|
214
|
+
}, _trigger) : /*#__PURE__*/_react.default.createElement(_standardButton.default, (0, _extends2.default)({}, bindFocus, {
|
|
215
|
+
ref: (0, _mergeRefs.default)([triggerProps.ref, itemRef]),
|
|
205
216
|
"aria-controls": triggerProps['aria-controls'],
|
|
206
217
|
"aria-expanded": triggerProps['aria-expanded'],
|
|
207
218
|
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
@@ -217,7 +228,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
217
228
|
content: function content(_ref) {
|
|
218
229
|
var setInitialFocusRef = _ref.setInitialFocusRef,
|
|
219
230
|
update = _ref.update;
|
|
220
|
-
|
|
231
|
+
return /*#__PURE__*/_react.default.createElement(_focusManager.default, null, /*#__PURE__*/_react.default.createElement(_menuWrapper.default, {
|
|
221
232
|
spacing: spacing,
|
|
222
233
|
maxHeight: MAX_HEIGHT,
|
|
223
234
|
maxWidth: 800,
|
|
@@ -226,10 +237,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
226
237
|
isLoading: isLoading,
|
|
227
238
|
statusLabel: statusLabel,
|
|
228
239
|
setInitialFocusRef: isTriggeredUsingKeyboard || autoFocus ? setInitialFocusRef : undefined
|
|
229
|
-
},
|
|
230
|
-
value: nestedLevel + 1
|
|
231
|
-
}, children)));
|
|
232
|
-
return isNested ? content : /*#__PURE__*/_react.default.createElement(_context.TrackLevelProvider, null, content);
|
|
240
|
+
}, children));
|
|
233
241
|
}
|
|
234
242
|
}));
|
|
235
243
|
};
|
|
@@ -9,8 +9,8 @@ exports.default = exports.FocusManagerContext = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _bindEventListener = require("bind-event-listener");
|
|
11
11
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
12
|
+
var _layering = require("@atlaskit/layering");
|
|
12
13
|
var _handleFocus = _interopRequireDefault(require("../utils/handle-focus"));
|
|
13
|
-
var _context = require("./context");
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
16
|
/**
|
|
@@ -38,24 +38,14 @@ var FocusManager = function FocusManager(_ref) {
|
|
|
38
38
|
menuItemRefs.current.push(ref);
|
|
39
39
|
}
|
|
40
40
|
}, []);
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
maxLevelRef = _useContext.maxLevelRef,
|
|
44
|
-
setMaxLevel = _useContext.setMaxLevel;
|
|
41
|
+
var _UNSAFE_useLayering = (0, _layering.UNSAFE_useLayering)(),
|
|
42
|
+
isLayerDisabled = _UNSAFE_useLayering.isLayerDisabled;
|
|
45
43
|
// Intentionally rebinding on each render
|
|
46
44
|
(0, _react.useEffect)(function () {
|
|
47
|
-
|
|
48
|
-
setMaxLevel(nestedLevel);
|
|
49
|
-
var unbind = (0, _bindEventListener.bind)(window, {
|
|
45
|
+
return (0, _bindEventListener.bind)(window, {
|
|
50
46
|
type: 'keydown',
|
|
51
|
-
listener: (0, _handleFocus.default)(menuItemRefs.current,
|
|
47
|
+
listener: (0, _handleFocus.default)(menuItemRefs.current, isLayerDisabled)
|
|
52
48
|
});
|
|
53
|
-
return function () {
|
|
54
|
-
// Always get the minimun level when multiple levels of menu are closed
|
|
55
|
-
// If the stored level is smaller, we won't update it
|
|
56
|
-
setMaxLevel(prevLevel, true);
|
|
57
|
-
unbind();
|
|
58
|
-
};
|
|
59
49
|
});
|
|
60
50
|
var contextValue = {
|
|
61
51
|
menuItemRefs: menuItemRefs.current,
|
|
@@ -11,8 +11,8 @@ var _react = require("react");
|
|
|
11
11
|
var _dropdownItemRadioGroup = require("../../radio/dropdown-item-radio-group");
|
|
12
12
|
var _selectionStore = require("../context/selection-store");
|
|
13
13
|
var _resetOptionsInGroup = _interopRequireDefault(require("../utils/reset-options-in-group"));
|
|
14
|
-
function ownKeys(
|
|
15
|
-
function _objectSpread(
|
|
14
|
+
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; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
function useRadioState(_ref) {
|
|
17
17
|
var id = _ref.id,
|
|
18
18
|
isSelected = _ref.isSelected,
|
|
@@ -41,13 +41,13 @@ var getPrevFocusableElement = function getPrevFocusableElement(refs, currentFocu
|
|
|
41
41
|
currentFocusedIdx--;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
function handleFocus(refs,
|
|
44
|
+
function handleFocus(refs, isLayerDisabled) {
|
|
45
45
|
return function (e) {
|
|
46
46
|
var currentFocusedIdx = refs.findIndex(function (el) {
|
|
47
47
|
var _document$activeEleme;
|
|
48
48
|
return (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.isSameNode(el);
|
|
49
49
|
});
|
|
50
|
-
if (
|
|
50
|
+
if (isLayerDisabled()) {
|
|
51
51
|
// if it is a nested dropdown and the level of the given dropdown is not the current level,
|
|
52
52
|
// we don't need to have focus on it
|
|
53
53
|
return;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
function ownKeys(
|
|
10
|
-
function _objectSpread(
|
|
9
|
+
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; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
var resetOptionsInGroup = function resetOptionsInGroup(group) {
|
|
12
12
|
return Object.keys(group || {}).reduce(function (accumulator, current) {
|
|
13
13
|
return _objectSpread(_objectSpread({}, accumulator), {}, (0, _defineProperty2.default)({}, current, typeof group[current] === 'undefined' ? undefined : false));
|
|
@@ -15,8 +15,8 @@ var _selectionStore = require("../internal/context/selection-store");
|
|
|
15
15
|
var _resetOptionsInGroup = _interopRequireDefault(require("../internal/utils/reset-options-in-group"));
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
-
function ownKeys(
|
|
19
|
-
function _objectSpread(
|
|
18
|
+
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; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
20
|
/**
|
|
21
21
|
* __Radio group context__
|
|
22
22
|
* Context provider that wraps each DropdownItemRadioGroup
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback,
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { bind } from 'bind-event-listener';
|
|
4
4
|
import Button from '@atlaskit/button/standard-button';
|
|
5
|
+
import { UNSAFE_BUTTON } from '@atlaskit/button/unsafe';
|
|
5
6
|
import { KEY_DOWN } from '@atlaskit/ds-lib/keycodes';
|
|
6
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
7
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -12,7 +13,6 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
12
13
|
import Popup from '@atlaskit/popup';
|
|
13
14
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
14
15
|
import { gridSize as gridSizeFn, layers } from '@atlaskit/theme/constants';
|
|
15
|
-
import { NestedLevelContext, TrackLevelProvider } from './internal/components/context';
|
|
16
16
|
import FocusManager from './internal/components/focus-manager';
|
|
17
17
|
import MenuWrapper from './internal/components/menu-wrapper';
|
|
18
18
|
import SelectionStore from './internal/context/selection-store';
|
|
@@ -75,7 +75,6 @@ const DropdownMenu = props => {
|
|
|
75
75
|
zIndex = layers.modal()
|
|
76
76
|
} = props;
|
|
77
77
|
const [isLocalOpen, setLocalIsOpen] = useControlledState(isOpen, () => defaultOpen);
|
|
78
|
-
const nestedLevel = useContext(NestedLevelContext);
|
|
79
78
|
const [isTriggeredUsingKeyboard, setTriggeredUsingKeyboard] = useState(false);
|
|
80
79
|
const fallbackPlacements = useMemo(() => getFallbackPlacements(placement), [placement]);
|
|
81
80
|
const handleTriggerClicked = useCallback(
|
|
@@ -147,14 +146,12 @@ const DropdownMenu = props => {
|
|
|
147
146
|
});
|
|
148
147
|
}, [isFocused, isLocalOpen, handleTriggerClicked]);
|
|
149
148
|
const id = useGeneratedId();
|
|
150
|
-
const isNested = nestedLevel > 0;
|
|
151
149
|
const itemRef = useRegisterItemWithFocusManager();
|
|
152
150
|
return /*#__PURE__*/React.createElement(SelectionStore, null, /*#__PURE__*/React.createElement(Popup, {
|
|
153
151
|
id: isLocalOpen ? id : undefined,
|
|
154
152
|
shouldFlip: shouldFlip,
|
|
155
153
|
isOpen: isLocalOpen,
|
|
156
|
-
onClose:
|
|
157
|
-
,
|
|
154
|
+
onClose: handleOnClose,
|
|
158
155
|
zIndex: zIndex,
|
|
159
156
|
placement: placement,
|
|
160
157
|
fallbackPlacements: fallbackPlacements,
|
|
@@ -170,14 +167,28 @@ const DropdownMenu = props => {
|
|
|
170
167
|
return trigger({
|
|
171
168
|
...providedProps,
|
|
172
169
|
...bindFocus,
|
|
173
|
-
triggerRef:
|
|
170
|
+
triggerRef: mergeRefs([ref, itemRef]),
|
|
174
171
|
isSelected: isLocalOpen,
|
|
175
172
|
onClick: handleTriggerClicked,
|
|
176
173
|
testId: testId && `${testId}--trigger`
|
|
177
174
|
});
|
|
178
175
|
}
|
|
179
|
-
return /*#__PURE__*/React.createElement(
|
|
180
|
-
|
|
176
|
+
return getBooleanFF('platform.design-system-team.new-button-adoption-in-dropdown_p8sn4') ? /*#__PURE__*/React.createElement(UNSAFE_BUTTON, {
|
|
177
|
+
iconAfter: /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
178
|
+
size: "medium",
|
|
179
|
+
label: ""
|
|
180
|
+
}),
|
|
181
|
+
onFocus: bindFocus.onFocus,
|
|
182
|
+
onBlur: bindFocus.onBlur,
|
|
183
|
+
ref: mergeRefs([triggerProps.ref, itemRef]),
|
|
184
|
+
"aria-controls": triggerProps['aria-controls'],
|
|
185
|
+
"aria-expanded": triggerProps['aria-expanded'],
|
|
186
|
+
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
187
|
+
isSelected: isLocalOpen,
|
|
188
|
+
onClick: handleTriggerClicked,
|
|
189
|
+
testId: testId && `${testId}--trigger`
|
|
190
|
+
}, trigger) : /*#__PURE__*/React.createElement(Button, _extends({}, bindFocus, {
|
|
191
|
+
ref: mergeRefs([triggerProps.ref, itemRef]),
|
|
181
192
|
"aria-controls": triggerProps['aria-controls'],
|
|
182
193
|
"aria-expanded": triggerProps['aria-expanded'],
|
|
183
194
|
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
@@ -193,21 +204,16 @@ const DropdownMenu = props => {
|
|
|
193
204
|
content: ({
|
|
194
205
|
setInitialFocusRef,
|
|
195
206
|
update
|
|
196
|
-
}) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}, /*#__PURE__*/React.createElement(NestedLevelContext.Provider, {
|
|
207
|
-
value: nestedLevel + 1
|
|
208
|
-
}, children)));
|
|
209
|
-
return isNested ? content : /*#__PURE__*/React.createElement(TrackLevelProvider, null, content);
|
|
210
|
-
}
|
|
207
|
+
}) => /*#__PURE__*/React.createElement(FocusManager, null, /*#__PURE__*/React.createElement(MenuWrapper, {
|
|
208
|
+
spacing: spacing,
|
|
209
|
+
maxHeight: MAX_HEIGHT,
|
|
210
|
+
maxWidth: 800,
|
|
211
|
+
onClose: handleOnClose,
|
|
212
|
+
onUpdate: update,
|
|
213
|
+
isLoading: isLoading,
|
|
214
|
+
statusLabel: statusLabel,
|
|
215
|
+
setInitialFocusRef: isTriggeredUsingKeyboard || autoFocus ? setInitialFocusRef : undefined
|
|
216
|
+
}, children))
|
|
211
217
|
}));
|
|
212
218
|
};
|
|
213
219
|
export default DropdownMenu;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { createContext, useCallback,
|
|
1
|
+
import React, { createContext, useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
4
|
+
import { UNSAFE_useLayering } from '@atlaskit/layering';
|
|
4
5
|
import handleFocus from '../utils/handle-focus';
|
|
5
|
-
import { NestedLevelContext, TrackMaxLevelContext } from './context';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -29,25 +29,15 @@ const FocusManager = ({
|
|
|
29
29
|
menuItemRefs.current.push(ref);
|
|
30
30
|
}
|
|
31
31
|
}, []);
|
|
32
|
-
const nestedLevel = useContext(NestedLevelContext);
|
|
33
32
|
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = useContext(TrackMaxLevelContext);
|
|
33
|
+
isLayerDisabled
|
|
34
|
+
} = UNSAFE_useLayering();
|
|
37
35
|
// Intentionally rebinding on each render
|
|
38
36
|
useEffect(() => {
|
|
39
|
-
|
|
40
|
-
setMaxLevel(nestedLevel);
|
|
41
|
-
const unbind = bind(window, {
|
|
37
|
+
return bind(window, {
|
|
42
38
|
type: 'keydown',
|
|
43
|
-
listener: handleFocus(menuItemRefs.current,
|
|
39
|
+
listener: handleFocus(menuItemRefs.current, isLayerDisabled)
|
|
44
40
|
});
|
|
45
|
-
return () => {
|
|
46
|
-
// Always get the minimun level when multiple levels of menu are closed
|
|
47
|
-
// If the stored level is smaller, we won't update it
|
|
48
|
-
setMaxLevel(prevLevel, true);
|
|
49
|
-
unbind();
|
|
50
|
-
};
|
|
51
41
|
});
|
|
52
42
|
const contextValue = {
|
|
53
43
|
menuItemRefs: menuItemRefs.current,
|
|
@@ -37,13 +37,13 @@ const getPrevFocusableElement = (refs, currentFocusedIdx) => {
|
|
|
37
37
|
currentFocusedIdx--;
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
export default function handleFocus(refs,
|
|
40
|
+
export default function handleFocus(refs, isLayerDisabled) {
|
|
41
41
|
return e => {
|
|
42
42
|
const currentFocusedIdx = refs.findIndex(el => {
|
|
43
43
|
var _document$activeEleme;
|
|
44
44
|
return (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.isSameNode(el);
|
|
45
45
|
});
|
|
46
|
-
if (
|
|
46
|
+
if (isLayerDisabled()) {
|
|
47
47
|
// if it is a nested dropdown and the level of the given dropdown is not the current level,
|
|
48
48
|
// we don't need to have focus on it
|
|
49
49
|
return;
|
|
@@ -3,11 +3,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
var _excluded = ["ref"];
|
|
6
|
-
function ownKeys(
|
|
7
|
-
function _objectSpread(
|
|
8
|
-
import React, { useCallback,
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
9
|
import { bind } from 'bind-event-listener';
|
|
10
10
|
import Button from '@atlaskit/button/standard-button';
|
|
11
|
+
import { UNSAFE_BUTTON } from '@atlaskit/button/unsafe';
|
|
11
12
|
import { KEY_DOWN } from '@atlaskit/ds-lib/keycodes';
|
|
12
13
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
13
14
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -18,7 +19,6 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
18
19
|
import Popup from '@atlaskit/popup';
|
|
19
20
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
20
21
|
import { gridSize as gridSizeFn, layers } from '@atlaskit/theme/constants';
|
|
21
|
-
import { NestedLevelContext, TrackLevelProvider } from './internal/components/context';
|
|
22
22
|
import FocusManager from './internal/components/focus-manager';
|
|
23
23
|
import MenuWrapper from './internal/components/menu-wrapper';
|
|
24
24
|
import SelectionStore from './internal/context/selection-store';
|
|
@@ -92,7 +92,6 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
92
92
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
93
93
|
isLocalOpen = _useControlledState2[0],
|
|
94
94
|
setLocalIsOpen = _useControlledState2[1];
|
|
95
|
-
var nestedLevel = useContext(NestedLevelContext);
|
|
96
95
|
var _useState = useState(false),
|
|
97
96
|
_useState2 = _slicedToArray(_useState, 2),
|
|
98
97
|
isTriggeredUsingKeyboard = _useState2[0],
|
|
@@ -166,14 +165,12 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
166
165
|
});
|
|
167
166
|
}, [isFocused, isLocalOpen, handleTriggerClicked]);
|
|
168
167
|
var id = useGeneratedId();
|
|
169
|
-
var isNested = nestedLevel > 0;
|
|
170
168
|
var itemRef = useRegisterItemWithFocusManager();
|
|
171
169
|
return /*#__PURE__*/React.createElement(SelectionStore, null, /*#__PURE__*/React.createElement(Popup, {
|
|
172
170
|
id: isLocalOpen ? id : undefined,
|
|
173
171
|
shouldFlip: shouldFlip,
|
|
174
172
|
isOpen: isLocalOpen,
|
|
175
|
-
onClose:
|
|
176
|
-
,
|
|
173
|
+
onClose: handleOnClose,
|
|
177
174
|
zIndex: zIndex,
|
|
178
175
|
placement: placement,
|
|
179
176
|
fallbackPlacements: fallbackPlacements,
|
|
@@ -185,14 +182,28 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
185
182
|
var ref = triggerProps.ref,
|
|
186
183
|
providedProps = _objectWithoutProperties(triggerProps, _excluded);
|
|
187
184
|
return _trigger(_objectSpread(_objectSpread(_objectSpread({}, providedProps), bindFocus), {}, {
|
|
188
|
-
triggerRef:
|
|
185
|
+
triggerRef: mergeRefs([ref, itemRef]),
|
|
189
186
|
isSelected: isLocalOpen,
|
|
190
187
|
onClick: handleTriggerClicked,
|
|
191
188
|
testId: testId && "".concat(testId, "--trigger")
|
|
192
189
|
}));
|
|
193
190
|
}
|
|
194
|
-
return /*#__PURE__*/React.createElement(
|
|
195
|
-
|
|
191
|
+
return getBooleanFF('platform.design-system-team.new-button-adoption-in-dropdown_p8sn4') ? /*#__PURE__*/React.createElement(UNSAFE_BUTTON, {
|
|
192
|
+
iconAfter: /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
193
|
+
size: "medium",
|
|
194
|
+
label: ""
|
|
195
|
+
}),
|
|
196
|
+
onFocus: bindFocus.onFocus,
|
|
197
|
+
onBlur: bindFocus.onBlur,
|
|
198
|
+
ref: mergeRefs([triggerProps.ref, itemRef]),
|
|
199
|
+
"aria-controls": triggerProps['aria-controls'],
|
|
200
|
+
"aria-expanded": triggerProps['aria-expanded'],
|
|
201
|
+
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
202
|
+
isSelected: isLocalOpen,
|
|
203
|
+
onClick: handleTriggerClicked,
|
|
204
|
+
testId: testId && "".concat(testId, "--trigger")
|
|
205
|
+
}, _trigger) : /*#__PURE__*/React.createElement(Button, _extends({}, bindFocus, {
|
|
206
|
+
ref: mergeRefs([triggerProps.ref, itemRef]),
|
|
196
207
|
"aria-controls": triggerProps['aria-controls'],
|
|
197
208
|
"aria-expanded": triggerProps['aria-expanded'],
|
|
198
209
|
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
@@ -208,7 +219,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
208
219
|
content: function content(_ref) {
|
|
209
220
|
var setInitialFocusRef = _ref.setInitialFocusRef,
|
|
210
221
|
update = _ref.update;
|
|
211
|
-
|
|
222
|
+
return /*#__PURE__*/React.createElement(FocusManager, null, /*#__PURE__*/React.createElement(MenuWrapper, {
|
|
212
223
|
spacing: spacing,
|
|
213
224
|
maxHeight: MAX_HEIGHT,
|
|
214
225
|
maxWidth: 800,
|
|
@@ -217,10 +228,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
217
228
|
isLoading: isLoading,
|
|
218
229
|
statusLabel: statusLabel,
|
|
219
230
|
setInitialFocusRef: isTriggeredUsingKeyboard || autoFocus ? setInitialFocusRef : undefined
|
|
220
|
-
},
|
|
221
|
-
value: nestedLevel + 1
|
|
222
|
-
}, children)));
|
|
223
|
-
return isNested ? content : /*#__PURE__*/React.createElement(TrackLevelProvider, null, content);
|
|
231
|
+
}, children));
|
|
224
232
|
}
|
|
225
233
|
}));
|
|
226
234
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { createContext, useCallback,
|
|
1
|
+
import React, { createContext, useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
4
|
+
import { UNSAFE_useLayering } from '@atlaskit/layering';
|
|
4
5
|
import handleFocus from '../utils/handle-focus';
|
|
5
|
-
import { NestedLevelContext, TrackMaxLevelContext } from './context';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -28,24 +28,14 @@ var FocusManager = function FocusManager(_ref) {
|
|
|
28
28
|
menuItemRefs.current.push(ref);
|
|
29
29
|
}
|
|
30
30
|
}, []);
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
maxLevelRef = _useContext.maxLevelRef,
|
|
34
|
-
setMaxLevel = _useContext.setMaxLevel;
|
|
31
|
+
var _UNSAFE_useLayering = UNSAFE_useLayering(),
|
|
32
|
+
isLayerDisabled = _UNSAFE_useLayering.isLayerDisabled;
|
|
35
33
|
// Intentionally rebinding on each render
|
|
36
34
|
useEffect(function () {
|
|
37
|
-
|
|
38
|
-
setMaxLevel(nestedLevel);
|
|
39
|
-
var unbind = bind(window, {
|
|
35
|
+
return bind(window, {
|
|
40
36
|
type: 'keydown',
|
|
41
|
-
listener: handleFocus(menuItemRefs.current,
|
|
37
|
+
listener: handleFocus(menuItemRefs.current, isLayerDisabled)
|
|
42
38
|
});
|
|
43
|
-
return function () {
|
|
44
|
-
// Always get the minimun level when multiple levels of menu are closed
|
|
45
|
-
// If the stored level is smaller, we won't update it
|
|
46
|
-
setMaxLevel(prevLevel, true);
|
|
47
|
-
unbind();
|
|
48
|
-
};
|
|
49
39
|
});
|
|
50
40
|
var contextValue = {
|
|
51
41
|
menuItemRefs: menuItemRefs.current,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
5
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
6
6
|
import { RadioGroupContext } from '../../radio/dropdown-item-radio-group';
|
|
7
7
|
import { SelectionStoreContext } from '../context/selection-store';
|
|
@@ -34,13 +34,13 @@ var getPrevFocusableElement = function getPrevFocusableElement(refs, currentFocu
|
|
|
34
34
|
currentFocusedIdx--;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
export default function handleFocus(refs,
|
|
37
|
+
export default function handleFocus(refs, isLayerDisabled) {
|
|
38
38
|
return function (e) {
|
|
39
39
|
var currentFocusedIdx = refs.findIndex(function (el) {
|
|
40
40
|
var _document$activeEleme;
|
|
41
41
|
return (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.isSameNode(el);
|
|
42
42
|
});
|
|
43
|
-
if (
|
|
43
|
+
if (isLayerDisabled()) {
|
|
44
44
|
// if it is a nested dropdown and the level of the given dropdown is not the current level,
|
|
45
45
|
// we don't need to have focus on it
|
|
46
46
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
4
|
var resetOptionsInGroup = function resetOptionsInGroup(group) {
|
|
5
5
|
return Object.keys(group || {}).reduce(function (accumulator, current) {
|
|
6
6
|
return _objectSpread(_objectSpread({}, accumulator), {}, _defineProperty({}, current, typeof group[current] === 'undefined' ? undefined : false));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
5
|
import React, { createContext, useContext, useState } from 'react';
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
7
|
import Section from '@atlaskit/menu/section';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
1
|
import { FocusableElement } from '../../types';
|
|
3
|
-
export default function handleFocus(refs: Array<FocusableElement>,
|
|
2
|
+
export default function handleFocus(refs: Array<FocusableElement>, isLayerDisabled: () => boolean): (e: KeyboardEvent) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
1
|
import { FocusableElement } from '../../types';
|
|
3
|
-
export default function handleFocus(refs: Array<FocusableElement>,
|
|
2
|
+
export default function handleFocus(refs: Array<FocusableElement>, isLayerDisabled: () => boolean): (e: KeyboardEvent) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.14.0",
|
|
4
4
|
"description": "A dropdown menu displays a list of actions or options to a user.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,17 +31,18 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/button": "^16.
|
|
34
|
+
"@atlaskit/button": "^16.10.0",
|
|
35
35
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
36
36
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
37
37
|
"@atlaskit/icon": "^21.12.0",
|
|
38
|
+
"@atlaskit/layering": "^0.2.0",
|
|
38
39
|
"@atlaskit/menu": "^1.10.0",
|
|
39
40
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
40
|
-
"@atlaskit/popup": "^1.
|
|
41
|
-
"@atlaskit/primitives": "^1.
|
|
41
|
+
"@atlaskit/popup": "^1.10.0",
|
|
42
|
+
"@atlaskit/primitives": "^1.6.0",
|
|
42
43
|
"@atlaskit/spinner": "^15.5.0",
|
|
43
|
-
"@atlaskit/theme": "^12.
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/theme": "^12.6.0",
|
|
45
|
+
"@atlaskit/tokens": "^1.25.0",
|
|
45
46
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
46
47
|
"@babel/runtime": "^7.0.0",
|
|
47
48
|
"@emotion/react": "^11.7.1",
|
|
@@ -109,6 +110,16 @@
|
|
|
109
110
|
},
|
|
110
111
|
"platform.design-system-team.border-checkbox_nyoiu": {
|
|
111
112
|
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"platform.design-system-team.new-button-adoption-in-dropdown_p8sn4": {
|
|
115
|
+
"type": "boolean"
|
|
116
|
+
},
|
|
117
|
+
"platform.design-system-team.icon-button-spacing-fix_o1zc5": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"referenceOnly": "true"
|
|
120
|
+
},
|
|
121
|
+
"platform.design-system-team.layering_qmiw3": {
|
|
122
|
+
"type": "boolean"
|
|
112
123
|
}
|
|
113
124
|
},
|
|
114
125
|
"homepage": "https://atlassian.design/components/dropdown-menu/",
|