@carbon/upgrade 11.44.0-rc.0 → 11.45.0-rc.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/README.md +41 -0
- package/cli.js +20552 -28286
- package/package.json +3 -3
- package/transforms/__testfixtures__/preview-pagination-no-sizer.input.tsx +21 -0
- package/transforms/__testfixtures__/preview-pagination-no-sizer.output.tsx +11 -0
- package/transforms/__testfixtures__/preview-pagination-to-pagination.input.tsx +23 -0
- package/transforms/__testfixtures__/preview-pagination-to-pagination.output.tsx +9 -0
- package/transforms/__testfixtures__/unstable-pagination-to-pagination.input.tsx +25 -0
- package/transforms/__testfixtures__/unstable-pagination-to-pagination.output.tsx +15 -0
- package/transforms/__testfixtures__/wc-add-barrel-imports.input.tsx +20 -0
- package/transforms/__testfixtures__/wc-add-barrel-imports.output.tsx +19 -0
- package/transforms/__tests__/unstable-pagination-to-pagination-test.js +29 -0
- package/transforms/__tests__/wc-add-barrel-imports-test.js +17 -0
- package/transforms/__tests__/wc-report-non-barrel-imports-test.js +181 -0
- package/transforms/carbon-wc-imports.js +129 -0
- package/transforms/unstable-pagination-to-pagination.js +157 -0
- package/transforms/wc-add-barrel-imports.js +116 -0
- package/transforms/wc-report-non-barrel-imports.js +156 -0
package/README.md
CHANGED
|
@@ -342,6 +342,47 @@ npx @carbon/upgrade migrate slug-prop-to-decorator-prop --write
|
|
|
342
342
|
<Component decorator="my-identifier">Content</Component>
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
+
### Unstable / preview Pagination to Pagination
|
|
346
|
+
|
|
347
|
+
Migrates `unstable_Pagination` / `preview_Pagination` to the stable `Pagination`
|
|
348
|
+
component. Drops `PageSelector` imports and children render-props, since the
|
|
349
|
+
stable component renders an equivalent page-select control by default.
|
|
350
|
+
|
|
351
|
+
**Usage:**
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
npx @carbon/upgrade migrate unstable-pagination-to-pagination --write
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Example:**
|
|
358
|
+
|
|
359
|
+
```jsx
|
|
360
|
+
// Before
|
|
361
|
+
import {
|
|
362
|
+
unstable_Pagination as Pagination,
|
|
363
|
+
unstable_PageSelector as PageSelector,
|
|
364
|
+
} from '@carbon/react';
|
|
365
|
+
|
|
366
|
+
<Pagination pageSizes={[10, 20, 30]} totalItems={100}>
|
|
367
|
+
{({ currentPage, onSetPage, totalPages }) => (
|
|
368
|
+
<PageSelector
|
|
369
|
+
currentPage={currentPage}
|
|
370
|
+
onChange={(event) => onSetPage(event.target.value)}
|
|
371
|
+
totalPages={totalPages}
|
|
372
|
+
/>
|
|
373
|
+
)}
|
|
374
|
+
</Pagination>;
|
|
375
|
+
|
|
376
|
+
// After
|
|
377
|
+
import { Pagination } from '@carbon/react';
|
|
378
|
+
|
|
379
|
+
<Pagination pageSizes={[10, 20, 30]} totalItems={100} />;
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Custom page-select children are removed and a `TODO` comment is left to migrate
|
|
383
|
+
them with `renderPageSelect` if needed. Omit `pageSizes` to hide the items per
|
|
384
|
+
page selector.
|
|
385
|
+
|
|
345
386
|
### FeatureFlag deprecate flags prop
|
|
346
387
|
|
|
347
388
|
Updates FeatureFlags component to use individual boolean props instead of the
|