@atlaskit/dropdown-menu 16.9.7 → 16.10.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/dropdown-menu
2
2
 
3
+ ## 16.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 16.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`f6ef9f1fc7454`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f6ef9f1fc7454) -
14
+ Add an optional close-event ignore predicate to popup and dropdown menu so consumers can treat
15
+ external overlays as part of popup interactions.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 16.9.7
4
22
 
5
23
  ### Patch Changes
@@ -99,7 +99,8 @@ function DropdownMenuLegacy(_ref) {
99
99
  strategy = _ref.strategy,
100
100
  menuLabel = _ref.menuLabel,
101
101
  _ref$shouldPreventEsc = _ref.shouldPreventEscapePropagation,
102
- shouldPreventEscapePropagation = _ref$shouldPreventEsc === void 0 ? false : _ref$shouldPreventEsc;
102
+ shouldPreventEscapePropagation = _ref$shouldPreventEsc === void 0 ? false : _ref$shouldPreventEsc,
103
+ shouldIgnoreCloseEvent = _ref.shouldIgnoreCloseEvent;
103
104
  var _useControlledState = (0, _useControlled.default)(isOpen, function () {
104
105
  return defaultOpen;
105
106
  }),
@@ -280,7 +281,8 @@ function DropdownMenuLegacy(_ref) {
280
281
  role: shouldRenderToParent && currentLevel > 0 ? 'group' : undefined,
281
282
  fallbackPlacements: fallbackPlacements,
282
283
  testId: testId && "".concat(testId, "--content"),
283
- shouldUseCaptureOnOutsideClick: true
284
+ shouldUseCaptureOnOutsideClick: true,
285
+ shouldIgnoreCloseEvent: shouldIgnoreCloseEvent
284
286
  }, conditionalProps, {
285
287
  shouldDisableFocusLock: true,
286
288
  trigger: function trigger(_ref2) {
@@ -75,7 +75,8 @@ function DropdownMenuLegacy({
75
75
  interactionName,
76
76
  strategy,
77
77
  menuLabel,
78
- shouldPreventEscapePropagation = false
78
+ shouldPreventEscapePropagation = false,
79
+ shouldIgnoreCloseEvent
79
80
  }) {
80
81
  const [isLocalOpen, setLocalIsOpen] = useControlledState(isOpen, () => defaultOpen);
81
82
  const triggerRef = useRef(null);
@@ -251,7 +252,8 @@ function DropdownMenuLegacy({
251
252
  role: shouldRenderToParent && currentLevel > 0 ? 'group' : undefined,
252
253
  fallbackPlacements: fallbackPlacements,
253
254
  testId: testId && `${testId}--content`,
254
- shouldUseCaptureOnOutsideClick: true
255
+ shouldUseCaptureOnOutsideClick: true,
256
+ shouldIgnoreCloseEvent: shouldIgnoreCloseEvent
255
257
  }, conditionalProps, {
256
258
  shouldDisableFocusLock: true,
257
259
  trigger: ({
@@ -91,7 +91,8 @@ function DropdownMenuLegacy(_ref) {
91
91
  strategy = _ref.strategy,
92
92
  menuLabel = _ref.menuLabel,
93
93
  _ref$shouldPreventEsc = _ref.shouldPreventEscapePropagation,
94
- shouldPreventEscapePropagation = _ref$shouldPreventEsc === void 0 ? false : _ref$shouldPreventEsc;
94
+ shouldPreventEscapePropagation = _ref$shouldPreventEsc === void 0 ? false : _ref$shouldPreventEsc,
95
+ shouldIgnoreCloseEvent = _ref.shouldIgnoreCloseEvent;
95
96
  var _useControlledState = useControlledState(isOpen, function () {
96
97
  return defaultOpen;
97
98
  }),
@@ -272,7 +273,8 @@ function DropdownMenuLegacy(_ref) {
272
273
  role: shouldRenderToParent && currentLevel > 0 ? 'group' : undefined,
273
274
  fallbackPlacements: fallbackPlacements,
274
275
  testId: testId && "".concat(testId, "--content"),
275
- shouldUseCaptureOnOutsideClick: true
276
+ shouldUseCaptureOnOutsideClick: true,
277
+ shouldIgnoreCloseEvent: shouldIgnoreCloseEvent
276
278
  }, conditionalProps, {
277
279
  shouldDisableFocusLock: true,
278
280
  trigger: function trigger(_ref2) {
@@ -201,6 +201,11 @@ interface InternalDropdownMenuProps<TriggerElement extends HTMLElement = any> {
201
201
  * Provide an accessible label for the menu element for assistive technology.
202
202
  */
203
203
  menuLabel?: string;
204
+ /**
205
+ * Allows consumers to ignore specific close events, for example when an external overlay
206
+ * should be treated as part of the dropdown interaction.
207
+ */
208
+ shouldIgnoreCloseEvent?: (event: Event | MouseEvent | KeyboardEvent) => boolean;
204
209
  /**
205
210
  * When set to true, will call stopPropagation on the ESCAPE key event.
206
211
  * This prevents the ESCAPE event from bubbling up to parent elements.
@@ -201,6 +201,11 @@ interface InternalDropdownMenuProps<TriggerElement extends HTMLElement = any> {
201
201
  * Provide an accessible label for the menu element for assistive technology.
202
202
  */
203
203
  menuLabel?: string;
204
+ /**
205
+ * Allows consumers to ignore specific close events, for example when an external overlay
206
+ * should be treated as part of the dropdown interaction.
207
+ */
208
+ shouldIgnoreCloseEvent?: (event: Event | MouseEvent | KeyboardEvent) => boolean;
204
209
  /**
205
210
  * When set to true, will call stopPropagation on the ESCAPE key event.
206
211
  * This prevents the ESCAPE event from bubbling up to parent elements.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "16.9.7",
3
+ "version": "16.10.1",
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/"
@@ -34,16 +34,16 @@
34
34
  "@atlaskit/button": "^23.11.0",
35
35
  "@atlaskit/css": "^0.19.0",
36
36
  "@atlaskit/ds-lib": "^7.0.0",
37
- "@atlaskit/icon": "^35.1.0",
37
+ "@atlaskit/icon": "^35.4.0",
38
38
  "@atlaskit/layering": "^3.7.0",
39
39
  "@atlaskit/menu": "^8.5.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
- "@atlaskit/popup": "^4.22.0",
41
+ "@atlaskit/popup": "^4.23.0",
42
42
  "@atlaskit/primitives": "^19.0.0",
43
43
  "@atlaskit/spinner": "^19.1.0",
44
44
  "@atlaskit/theme": "^25.0.0",
45
- "@atlaskit/tokens": "^13.0.0",
46
- "@atlaskit/top-layer": "^0.12.0",
45
+ "@atlaskit/tokens": "^13.1.0",
46
+ "@atlaskit/top-layer": "^0.13.0",
47
47
  "@atlaskit/visually-hidden": "^3.1.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^0.20.0",
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/modal-dialog": "^15.2.0",
70
70
  "@atlaskit/section-message": "^8.13.0",
71
71
  "@atlaskit/textfield": "^8.3.0",
72
- "@atlaskit/toggle": "^16.0.0",
72
+ "@atlaskit/toggle": "^16.1.0",
73
73
  "@atlassian/a11y-jest-testing": "^0.11.0",
74
74
  "@atlassian/feature-flags-test-utils": "^1.1.0",
75
75
  "@atlassian/react-compiler-gating": "workspace:^",