@atlaskit/dropdown-menu 11.11.6 → 11.12.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/dropdown-menu
2
2
 
3
+ ## 11.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b66fdec7fd1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b66fdec7fd1) - Add a new prop `shouldRenderToParent` to allow render content into a DOM node within the parent DOM hierarchy instead of React portal.
8
+
3
9
  ## 11.11.6
4
10
 
5
11
  ### Patch Changes
@@ -85,6 +85,8 @@ var DropdownMenu = function DropdownMenu(props) {
85
85
  spacing = props.spacing,
86
86
  _props$shouldFlip = props.shouldFlip,
87
87
  shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip,
88
+ _props$shouldRenderTo = props.shouldRenderToParent,
89
+ shouldRenderToParent = _props$shouldRenderTo === void 0 ? false : _props$shouldRenderTo,
88
90
  _props$isLoading = props.isLoading,
89
91
  isLoading = _props$isLoading === void 0 ? false : _props$isLoading,
90
92
  _props$autoFocus = props.autoFocus,
@@ -186,7 +188,7 @@ var DropdownMenu = function DropdownMenu(props) {
186
188
  fallbackPlacements: fallbackPlacements,
187
189
  testId: testId && "".concat(testId, "--content"),
188
190
  shouldUseCaptureOnOutsideClick: true,
189
- shouldRenderToParent: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ? true : undefined,
191
+ shouldRenderToParent: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent : undefined,
190
192
  trigger: function trigger(triggerProps) {
191
193
  if (typeof _trigger === 'function') {
192
194
  var ref = triggerProps.ref,
@@ -67,6 +67,7 @@ const DropdownMenu = props => {
67
67
  trigger,
68
68
  spacing,
69
69
  shouldFlip = true,
70
+ shouldRenderToParent = false,
70
71
  isLoading = false,
71
72
  autoFocus = false,
72
73
  testId,
@@ -159,7 +160,7 @@ const DropdownMenu = props => {
159
160
  fallbackPlacements: fallbackPlacements,
160
161
  testId: testId && `${testId}--content`,
161
162
  shouldUseCaptureOnOutsideClick: true,
162
- shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? true : undefined,
163
+ shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent : undefined,
163
164
  trigger: triggerProps => {
164
165
  if (typeof trigger === 'function') {
165
166
  const {
@@ -76,6 +76,8 @@ var DropdownMenu = function DropdownMenu(props) {
76
76
  spacing = props.spacing,
77
77
  _props$shouldFlip = props.shouldFlip,
78
78
  shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip,
79
+ _props$shouldRenderTo = props.shouldRenderToParent,
80
+ shouldRenderToParent = _props$shouldRenderTo === void 0 ? false : _props$shouldRenderTo,
79
81
  _props$isLoading = props.isLoading,
80
82
  isLoading = _props$isLoading === void 0 ? false : _props$isLoading,
81
83
  _props$autoFocus = props.autoFocus,
@@ -177,7 +179,7 @@ var DropdownMenu = function DropdownMenu(props) {
177
179
  fallbackPlacements: fallbackPlacements,
178
180
  testId: testId && "".concat(testId, "--content"),
179
181
  shouldUseCaptureOnOutsideClick: true,
180
- shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? true : undefined,
182
+ shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent : undefined,
181
183
  trigger: function trigger(triggerProps) {
182
184
  if (typeof _trigger === 'function') {
183
185
  var ref = triggerProps.ref,
@@ -92,6 +92,12 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
92
92
  * fit in the viewport.
93
93
  */
94
94
  shouldFlip?: boolean;
95
+ /**
96
+ * The root element where the DropdownMenu content should be rendered.
97
+ * `true` - rendering in the DOM node closest to the trigger. `false` - rendering in React.Portal.
98
+ * Defaults to `false`.
99
+ */
100
+ shouldRenderToParent?: boolean;
95
101
  /**
96
102
  * Controls the spacing density of the menu.
97
103
  */
@@ -92,6 +92,12 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
92
92
  * fit in the viewport.
93
93
  */
94
94
  shouldFlip?: boolean;
95
+ /**
96
+ * The root element where the DropdownMenu content should be rendered.
97
+ * `true` - rendering in the DOM node closest to the trigger. `false` - rendering in React.Portal.
98
+ * Defaults to `false`.
99
+ */
100
+ shouldRenderToParent?: boolean;
95
101
  /**
96
102
  * Controls the spacing density of the menu.
97
103
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "11.11.6",
3
+ "version": "11.12.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,17 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/button": "^16.8.0",
34
+ "@atlaskit/button": "^16.9.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/menu": "^1.9.0",
38
+ "@atlaskit/menu": "^1.10.0",
39
39
  "@atlaskit/platform-feature-flags": "^0.2.2",
40
40
  "@atlaskit/popup": "^1.9.0",
41
- "@atlaskit/primitives": "^1.0.6",
41
+ "@atlaskit/primitives": "^1.2.0",
42
42
  "@atlaskit/spinner": "^15.5.0",
43
43
  "@atlaskit/theme": "^12.5.0",
44
- "@atlaskit/tokens": "^1.14.0",
44
+ "@atlaskit/tokens": "^1.17.0",
45
45
  "@atlaskit/visually-hidden": "^1.2.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1",
package/report.api.md CHANGED
@@ -147,6 +147,7 @@ export interface DropdownMenuProps<
147
147
  onOpenChange?: (args: OnOpenChangeArgs) => void;
148
148
  placement?: Placement;
149
149
  shouldFlip?: boolean;
150
+ shouldRenderToParent?: boolean;
150
151
  spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
151
152
  statusLabel?: string;
152
153
  testId?: string;
@@ -123,6 +123,7 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
123
123
  onOpenChange?: (args: OnOpenChangeArgs) => void;
124
124
  placement?: Placement;
125
125
  shouldFlip?: boolean;
126
+ shouldRenderToParent?: boolean;
126
127
  spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
127
128
  statusLabel?: string;
128
129
  testId?: string;
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/dropdown-menu",
3
- "version": "11.11.6",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/dropdown-menu",
3
- "version": "11.11.6",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/dropdown-menu",
3
- "version": "11.11.6",
4
- "sideEffects": false
5
- }