@atlaskit/dropdown-menu 12.11.0 → 12.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 +16 -1
- package/README.md +2 -1
- package/__perf__/default.tsx +12 -12
- package/__perf__/dropdown-menu.tsx +165 -195
- package/codemods/11.0.0-lite-mode.tsx +23 -23
- package/codemods/__tests__/11.0.0-lite-mode.test.tsx +7 -7
- package/codemods/__tests__/convert-position.test.tsx +70 -70
- package/codemods/__tests__/convert-triggerType.test.tsx +35 -35
- package/codemods/__tests__/deprecate-items.test.tsx +28 -28
- package/codemods/__tests__/deprecate-onItemActivated.test.tsx +28 -28
- package/codemods/__tests__/deprecate-onPositioned.test.tsx +28 -28
- package/codemods/__tests__/deprecate-shouldFitContainer.tsx +28 -28
- package/codemods/__tests__/rename-imports.tsx +48 -54
- package/codemods/__tests__/replace-position-to-placement.test.tsx +21 -21
- package/codemods/__tests__/replace-shouldAllowMultipleLine.test.tsx +28 -28
- package/codemods/__tests__/update-component-callsites.tsx +18 -20
- package/codemods/migrates/convert-trigger-type.tsx +35 -49
- package/codemods/migrates/deprecate-autoFocus.tsx +3 -11
- package/codemods/migrates/deprecate-boundariesElement.tsx +2 -2
- package/codemods/migrates/deprecate-isCompact.tsx +3 -11
- package/codemods/migrates/deprecate-isHidden.tsx +3 -11
- package/codemods/migrates/deprecate-isMenuFixed.tsx +1 -4
- package/codemods/migrates/deprecate-items.tsx +1 -4
- package/codemods/migrates/deprecate-onItemActivated.tsx +2 -2
- package/codemods/migrates/deprecate-onPositioned.tsx +2 -2
- package/codemods/migrates/deprecate-shouldFitContainer.tsx +2 -2
- package/codemods/migrates/rename-imports.tsx +12 -12
- package/codemods/migrates/replace-position-to-placement.tsx +15 -26
- package/codemods/migrates/replace-shouldAllowMultiline.tsx +21 -35
- package/codemods/migrates/update-component-callsites.tsx +6 -6
- package/codemods/utils/convert-position.tsx +14 -14
- package/codemods/utils/create-rename-import.tsx +32 -37
- package/codemods/utils/create-update-callsite.tsx +25 -28
- package/dist/cjs/dropdown-menu.js +26 -6
- package/dist/cjs/internal/components/group-title.js +4 -0
- package/dist/cjs/internal/components/menu-wrapper.js +2 -0
- package/dist/es2019/dropdown-menu.js +25 -6
- package/dist/es2019/internal/components/group-title.js +3 -0
- package/dist/es2019/internal/components/menu-wrapper.js +2 -0
- package/dist/esm/dropdown-menu.js +26 -6
- package/dist/esm/internal/components/group-title.js +3 -0
- package/dist/esm/internal/components/menu-wrapper.js +2 -0
- package/dist/types/dropdown-menu.d.ts +1 -1
- package/dist/types/internal/hooks/use-radio-state.d.ts +1 -1
- package/dist/types/types.d.ts +19 -3
- package/dist/types-ts4.5/dropdown-menu.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-radio-state.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +19 -3
- package/package.json +110 -110
- package/report.api.md +141 -145
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 12.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#111282](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111282)
|
|
8
|
+
[`7b4ccf810b526`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7b4ccf810b526) -
|
|
9
|
+
Adds a new optional `shouldFitContainer` prop, which when set to `true`, will fit the dropdown
|
|
10
|
+
menu width to its parent's width.
|
|
11
|
+
|
|
12
|
+
## 12.11.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 12.11.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -70,7 +85,7 @@
|
|
|
70
85
|
|
|
71
86
|
- [#91117](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91117)
|
|
72
87
|
[`06ed35f020fb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/06ed35f020fb) -
|
|
73
|
-
Add support for React 18.
|
|
88
|
+
Add support for React 18 in non-strict mode.
|
|
74
89
|
|
|
75
90
|
### Patch Changes
|
|
76
91
|
|
package/README.md
CHANGED
|
@@ -10,4 +10,5 @@ yarn add @atlaskit/dropdown-menu
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
Detailed docs and example usage can be found
|
|
13
|
+
Detailed docs and example usage can be found
|
|
14
|
+
[here](https://atlassian.design/components/dropdown-menu/).
|
package/__perf__/default.tsx
CHANGED
|
@@ -3,18 +3,18 @@ import React from 'react';
|
|
|
3
3
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '../src';
|
|
4
4
|
|
|
5
5
|
const DropdownMenuDefaultExample = () => (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
<DropdownMenu trigger="Cities in Australia">
|
|
7
|
+
<DropdownItemGroup>
|
|
8
|
+
<DropdownItem>Sydney</DropdownItem>
|
|
9
|
+
<DropdownItem>Melbourne</DropdownItem>
|
|
10
|
+
<DropdownItem>Adelaide</DropdownItem>
|
|
11
|
+
<DropdownItem>Perth</DropdownItem>
|
|
12
|
+
<DropdownItem>Brisbane</DropdownItem>
|
|
13
|
+
<DropdownItem>Canberra</DropdownItem>
|
|
14
|
+
<DropdownItem>Hobart</DropdownItem>
|
|
15
|
+
<DropdownItem>Darwin</DropdownItem>
|
|
16
|
+
</DropdownItemGroup>
|
|
17
|
+
</DropdownMenu>
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
export default DropdownMenuDefaultExample;
|
|
@@ -1,216 +1,186 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { fireEvent, screen, waitFor } from '@testing-library/dom';
|
|
4
|
-
import type {
|
|
5
|
-
InteractionTaskArgs,
|
|
6
|
-
PublicInteractionTask,
|
|
7
|
-
} from 'storybook-addon-performance';
|
|
4
|
+
import type { InteractionTaskArgs, PublicInteractionTask } from 'storybook-addon-performance';
|
|
8
5
|
import invariant from 'tiny-invariant';
|
|
9
6
|
|
|
10
7
|
import DropdownMenu, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
DropdownItem,
|
|
9
|
+
DropdownItemCheckbox,
|
|
10
|
+
DropdownItemCheckboxGroup,
|
|
11
|
+
DropdownItemGroup,
|
|
12
|
+
DropdownItemRadio,
|
|
13
|
+
DropdownItemRadioGroup,
|
|
17
14
|
} from '../src';
|
|
18
15
|
|
|
19
16
|
const DropdownMenuPerformance = () => (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
<DropdownMenu trigger="Page actions" testId="dropdown-menu">
|
|
18
|
+
<DropdownItemGroup>
|
|
19
|
+
<DropdownItem>Edit</DropdownItem>
|
|
20
|
+
<DropdownItem>Copy</DropdownItem>
|
|
21
|
+
<DropdownItem>Delete</DropdownItem>
|
|
22
|
+
</DropdownItemGroup>
|
|
23
|
+
<DropdownItemCheckboxGroup id="flags" title="Flags">
|
|
24
|
+
<DropdownItemCheckbox id="tokens">Tokens</DropdownItemCheckbox>
|
|
25
|
+
<DropdownItemCheckbox id="dark-mode">Dark mode</DropdownItemCheckbox>
|
|
26
|
+
</DropdownItemCheckboxGroup>
|
|
27
|
+
<DropdownItemRadioGroup id="font-size" title="Font size">
|
|
28
|
+
<DropdownItemRadio id="smaller">Smaller</DropdownItemRadio>
|
|
29
|
+
<DropdownItemRadio id="default" defaultSelected>
|
|
30
|
+
Default
|
|
31
|
+
</DropdownItemRadio>
|
|
32
|
+
<DropdownItemRadio id="larger">Larger</DropdownItemRadio>
|
|
33
|
+
</DropdownItemRadioGroup>
|
|
34
|
+
</DropdownMenu>
|
|
38
35
|
);
|
|
39
36
|
|
|
40
37
|
const getTrigger = (container: HTMLElement): HTMLElement => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
const trigger: HTMLElement | null = container.querySelector(
|
|
39
|
+
'[data-testid="dropdown-menu--trigger"]',
|
|
40
|
+
);
|
|
41
|
+
if (trigger === null) {
|
|
42
|
+
throw new Error('Could not find the dropdown menu trigger');
|
|
43
|
+
}
|
|
44
|
+
return trigger;
|
|
48
45
|
};
|
|
49
46
|
|
|
50
47
|
const interactionTasks: PublicInteractionTask[] = [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
container,
|
|
179
|
-
controls,
|
|
180
|
-
}: InteractionTaskArgs): Promise<void> => {
|
|
181
|
-
const trigger = getTrigger(container);
|
|
182
|
-
fireEvent.click(trigger);
|
|
183
|
-
|
|
184
|
-
const label = await screen.findByText('Smaller');
|
|
185
|
-
const radio: HTMLElement | null = label.closest('[role="radio"]');
|
|
186
|
-
if (radio === null) {
|
|
187
|
-
throw new Error('Could not find the radio');
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
await controls.time(async () => {
|
|
191
|
-
radio.click();
|
|
192
|
-
await waitFor(
|
|
193
|
-
() => {
|
|
194
|
-
const ariaChecked = radio.getAttribute('aria-checked');
|
|
195
|
-
invariant(
|
|
196
|
-
ariaChecked === 'true',
|
|
197
|
-
`Radio should be checked (is "${ariaChecked}")`,
|
|
198
|
-
);
|
|
199
|
-
},
|
|
200
|
-
{ timeout: 5000 },
|
|
201
|
-
);
|
|
202
|
-
});
|
|
203
|
-
},
|
|
204
|
-
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Display dropdown',
|
|
50
|
+
description: 'Click to open the dropdown menu',
|
|
51
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
52
|
+
const trigger = getTrigger(container);
|
|
53
|
+
|
|
54
|
+
await controls.time(async () => {
|
|
55
|
+
fireEvent.click(trigger);
|
|
56
|
+
await screen.findByText('Edit');
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Hide dropdown (trigger)',
|
|
62
|
+
description: 'Click the trigger to hide the dropdown menu',
|
|
63
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
64
|
+
const trigger = getTrigger(container);
|
|
65
|
+
fireEvent.click(trigger);
|
|
66
|
+
|
|
67
|
+
await screen.findByText('Edit');
|
|
68
|
+
await controls.time(async () => {
|
|
69
|
+
fireEvent.click(trigger);
|
|
70
|
+
await waitFor(() => invariant(screen.queryByText('Edit') === null));
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Hide dropdown (escape)',
|
|
76
|
+
description: 'Press escape to hide the dropdown menu',
|
|
77
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
78
|
+
const trigger = getTrigger(container);
|
|
79
|
+
fireEvent.click(trigger);
|
|
80
|
+
|
|
81
|
+
await screen.findByText('Edit');
|
|
82
|
+
await controls.time(async () => {
|
|
83
|
+
fireEvent.keyDown(container, { key: 'Escape', code: 'Escape' });
|
|
84
|
+
await waitFor(() => invariant(screen.queryByText('Edit') === null));
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Hide dropdown (outside click)',
|
|
90
|
+
description: 'Click outside to hide the dropdown menu',
|
|
91
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
92
|
+
const trigger = getTrigger(container);
|
|
93
|
+
fireEvent.click(trigger);
|
|
94
|
+
|
|
95
|
+
await screen.findByText('Edit');
|
|
96
|
+
await controls.time(async () => {
|
|
97
|
+
fireEvent.click(container);
|
|
98
|
+
await waitFor(() => invariant(screen.queryByText('Edit') === null));
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'Select item',
|
|
104
|
+
description: 'Click menu item to select it',
|
|
105
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
106
|
+
const trigger = getTrigger(container);
|
|
107
|
+
fireEvent.click(trigger);
|
|
108
|
+
|
|
109
|
+
const label = await screen.findByText('Edit');
|
|
110
|
+
await controls.time(async () => {
|
|
111
|
+
label.click();
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
/**
|
|
117
|
+
* NOTE:
|
|
118
|
+
* This test has an unhandled error on CI, but runs fine locally.
|
|
119
|
+
* It doesn't stop the pipeline, but its results aren't reported.
|
|
120
|
+
*/
|
|
121
|
+
name: 'Select checkbox',
|
|
122
|
+
description: 'Click a checkbox menu item to select it',
|
|
123
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
124
|
+
const trigger = getTrigger(container);
|
|
125
|
+
fireEvent.click(trigger);
|
|
126
|
+
|
|
127
|
+
const label = await screen.findByText('Tokens');
|
|
128
|
+
const checkbox: HTMLElement | null = label.closest('[role="checkbox"]');
|
|
129
|
+
if (checkbox === null) {
|
|
130
|
+
throw new Error('Could not find the checkbox');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
await controls.time(async () => {
|
|
134
|
+
checkbox.click();
|
|
135
|
+
await waitFor(
|
|
136
|
+
() => {
|
|
137
|
+
const ariaChecked = checkbox.getAttribute('aria-checked');
|
|
138
|
+
invariant(ariaChecked === 'true', `Checkbox should be checked (is "${ariaChecked}")`);
|
|
139
|
+
},
|
|
140
|
+
{ timeout: 5000 },
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
/**
|
|
147
|
+
* NOTE:
|
|
148
|
+
* This test has an unhandled error on CI, but runs fine locally.
|
|
149
|
+
* It doesn't stop the pipeline, but its results aren't reported.
|
|
150
|
+
*/
|
|
151
|
+
name: 'Select radio',
|
|
152
|
+
description: 'Click a radio menu item to select it',
|
|
153
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
154
|
+
const trigger = getTrigger(container);
|
|
155
|
+
fireEvent.click(trigger);
|
|
156
|
+
|
|
157
|
+
const label = await screen.findByText('Smaller');
|
|
158
|
+
const radio: HTMLElement | null = label.closest('[role="radio"]');
|
|
159
|
+
if (radio === null) {
|
|
160
|
+
throw new Error('Could not find the radio');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
await controls.time(async () => {
|
|
164
|
+
radio.click();
|
|
165
|
+
await waitFor(
|
|
166
|
+
() => {
|
|
167
|
+
const ariaChecked = radio.getAttribute('aria-checked');
|
|
168
|
+
invariant(ariaChecked === 'true', `Radio should be checked (is "${ariaChecked}")`);
|
|
169
|
+
},
|
|
170
|
+
{ timeout: 5000 },
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
},
|
|
205
175
|
];
|
|
206
176
|
|
|
207
177
|
DropdownMenuPerformance.story = {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
178
|
+
name: 'Dropdown menu',
|
|
179
|
+
parameters: {
|
|
180
|
+
performance: {
|
|
181
|
+
interactions: interactionTasks,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
214
184
|
};
|
|
215
185
|
|
|
216
186
|
export default DropdownMenuPerformance;
|
|
@@ -11,41 +11,41 @@ import deprecateOnItemActivated from './migrates/deprecate-onItemActivated';
|
|
|
11
11
|
import deprecateOnPositioned from './migrates/deprecate-onPositioned';
|
|
12
12
|
import deprecateShouldFitContainer from './migrates/deprecate-shouldFitContainer';
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
renameDropdownItemGroupCheckbox,
|
|
15
|
+
renameDropdownItemGroupRadio,
|
|
16
|
+
renameDropdownMenuStateless,
|
|
17
17
|
} from './migrates/rename-imports';
|
|
18
18
|
import updatePositionValue from './migrates/replace-position-to-placement';
|
|
19
19
|
import replaceShouldAllowMultiline from './migrates/replace-shouldAllowMultiline';
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
updateDropdownItemGroupCheckboxCallsite,
|
|
22
|
+
updateDropdownItemGroupRadioCallsite,
|
|
23
23
|
} from './migrates/update-component-callsites';
|
|
24
24
|
|
|
25
25
|
const transformer = createTransformer([
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
deprecateItems,
|
|
27
|
+
deprecateOnItemActivated,
|
|
28
|
+
deprecateOnPositioned,
|
|
29
|
+
deprecateShouldFitContainer,
|
|
30
|
+
deprecateboundariesElement,
|
|
31
|
+
deprecateIsMenuFixed,
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
// props on *Items
|
|
34
|
+
...deprecateAutoFocus(),
|
|
35
|
+
...deprecateIsCompact(),
|
|
36
|
+
...deprecateIsHidden(),
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
replaceShouldAllowMultiline,
|
|
39
|
+
updatePositionValue,
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
renameDropdownItemGroupCheckbox,
|
|
42
|
+
renameDropdownItemGroupRadio,
|
|
43
|
+
renameDropdownMenuStateless,
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
updateDropdownItemGroupCheckboxCallsite,
|
|
46
|
+
updateDropdownItemGroupRadioCallsite,
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
convertTriggerType,
|
|
49
49
|
]);
|
|
50
50
|
|
|
51
51
|
export default transformer;
|
|
@@ -6,10 +6,10 @@ import transformer from '../11.0.0-lite-mode';
|
|
|
6
6
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
7
7
|
|
|
8
8
|
describe('apply all needed codemods for version 11.0.0 major bump', () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
defineInlineTest(
|
|
10
|
+
{ default: transformer, parser: 'tsx' },
|
|
11
|
+
{},
|
|
12
|
+
`
|
|
13
13
|
import React from "react";
|
|
14
14
|
import DropdownMenu, {
|
|
15
15
|
DropdownItemGroupCheckbox as MyComponent, DropdownItemCheckbox, DropdownItem, DropdownItemRadio,
|
|
@@ -45,7 +45,7 @@ describe('apply all needed codemods for version 11.0.0 major bump', () => {
|
|
|
45
45
|
</DropdownMenu>
|
|
46
46
|
);
|
|
47
47
|
`,
|
|
48
|
-
|
|
48
|
+
`
|
|
49
49
|
import React from "react";
|
|
50
50
|
import DropdownMenu, {
|
|
51
51
|
DropdownItemCheckboxGroup as MyComponent, DropdownItemCheckbox, DropdownItem, DropdownItemRadio,
|
|
@@ -63,6 +63,6 @@ describe('apply all needed codemods for version 11.0.0 major bump', () => {
|
|
|
63
63
|
</DropdownMenu>
|
|
64
64
|
);
|
|
65
65
|
`,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
'should not change anything when items is not used ',
|
|
67
|
+
);
|
|
68
68
|
});
|