@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43
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/dist/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
- package/dist/app-shell.js +1 -1
- package/dist/attachment-TZykYNu5.js +300 -0
- package/dist/attachment.js +2 -2
- package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
- package/dist/avatar-group.js +1 -1
- package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
- package/dist/command-palette.js +1 -1
- package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
- package/dist/data-list.js +1 -1
- package/dist/detail-panel-Cke3ZFU3.js +342 -0
- package/dist/detail-panel.js +2 -2
- package/dist/docs/action-bar.examples.md +768 -0
- package/dist/docs/action-bar.json +74 -50
- package/dist/docs/action-bar.md +49 -311
- package/dist/docs/app-shell.examples.md +1221 -64
- package/dist/docs/app-shell.json +92 -60
- package/dist/docs/app-shell.md +92 -57
- package/dist/docs/attachment.examples.md +689 -0
- package/dist/docs/attachment.json +69 -37
- package/dist/docs/attachment.md +44 -203
- package/dist/docs/avatar-group.json +111 -23
- package/dist/docs/avatar-group.md +487 -28
- package/dist/docs/button-group.json +98 -2
- package/dist/docs/button-group.md +411 -8
- package/dist/docs/calendar.examples.md +512 -0
- package/dist/docs/calendar.json +72 -24
- package/dist/docs/calendar.md +18 -147
- package/dist/docs/carousel.examples.md +868 -0
- package/dist/docs/carousel.json +58 -50
- package/dist/docs/carousel.md +66 -300
- package/dist/docs/cascader.examples.md +1269 -0
- package/dist/docs/cascader.json +72 -16
- package/dist/docs/cascader.md +78 -154
- package/dist/docs/chart.examples.md +734 -24
- package/dist/docs/chart.json +93 -13
- package/dist/docs/chart.md +28 -7
- package/dist/docs/clock.json +71 -15
- package/dist/docs/clock.md +326 -21
- package/dist/docs/code-block.json +79 -55
- package/dist/docs/code-block.md +417 -74
- package/dist/docs/color-picker.json +60 -12
- package/dist/docs/color-picker.md +245 -22
- package/dist/docs/column-manager.examples.md +764 -0
- package/dist/docs/column-manager.json +68 -12
- package/dist/docs/column-manager.md +44 -203
- package/dist/docs/command-palette.examples.md +747 -0
- package/dist/docs/command-palette.json +48 -24
- package/dist/docs/command-palette.md +60 -339
- package/dist/docs/currency-field.examples.md +355 -73
- package/dist/docs/currency-field.json +96 -64
- package/dist/docs/currency-field.md +57 -50
- package/dist/docs/dashboard-grid.examples.md +629 -0
- package/dist/docs/dashboard-grid.json +64 -16
- package/dist/docs/dashboard-grid.md +34 -152
- package/dist/docs/data-list.examples.md +1556 -0
- package/dist/docs/data-list.json +58 -18
- package/dist/docs/data-list.md +139 -224
- package/dist/docs/date-field.examples.md +543 -0
- package/dist/docs/date-field.json +64 -24
- package/dist/docs/date-field.md +22 -168
- package/dist/docs/datetime-field.examples.md +699 -0
- package/dist/docs/datetime-field.json +79 -31
- package/dist/docs/datetime-field.md +24 -269
- package/dist/docs/datetime-range-picker.examples.md +682 -0
- package/dist/docs/datetime-range-picker.json +117 -61
- package/dist/docs/datetime-range-picker.md +59 -224
- package/dist/docs/description-list.examples.md +652 -0
- package/dist/docs/description-list.json +49 -25
- package/dist/docs/description-list.md +33 -188
- package/dist/docs/detail-panel.examples.md +1177 -0
- package/dist/docs/detail-panel.json +69 -53
- package/dist/docs/detail-panel.md +114 -324
- package/dist/docs/entity-picker.examples.md +1037 -0
- package/dist/docs/entity-picker.json +66 -18
- package/dist/docs/entity-picker.md +56 -246
- package/dist/docs/event-calendar.examples.md +749 -49
- package/dist/docs/event-calendar.json +46 -22
- package/dist/docs/event-calendar.md +81 -11
- package/dist/docs/field-group.examples.md +554 -0
- package/dist/docs/field-group.json +98 -34
- package/dist/docs/field-group.md +55 -133
- package/dist/docs/filter-bar.examples.md +772 -0
- package/dist/docs/filter-bar.json +41 -25
- package/dist/docs/filter-bar.md +42 -246
- package/dist/docs/form.examples.md +579 -0
- package/dist/docs/form.json +87 -39
- package/dist/docs/form.md +53 -177
- package/dist/docs/fullscreen.examples.md +558 -0
- package/dist/docs/fullscreen.json +58 -18
- package/dist/docs/fullscreen.md +50 -169
- package/dist/docs/highlight.json +57 -25
- package/dist/docs/highlight.md +402 -50
- package/dist/docs/icon.json +85 -5
- package/dist/docs/icon.md +401 -10
- package/dist/docs/image.examples.md +670 -0
- package/dist/docs/image.json +44 -28
- package/dist/docs/image.md +24 -176
- package/dist/docs/import-export-center.examples.md +1280 -0
- package/dist/docs/import-export-center.json +67 -27
- package/dist/docs/import-export-center.md +121 -226
- package/dist/docs/list-item.examples.md +769 -0
- package/dist/docs/list-item.json +110 -38
- package/dist/docs/list-item.md +84 -201
- package/dist/docs/listbox.examples.md +858 -0
- package/dist/docs/listbox.json +76 -28
- package/dist/docs/listbox.md +41 -263
- package/dist/docs/markdown.json +79 -55
- package/dist/docs/markdown.md +581 -85
- package/dist/docs/media-viewer.examples.md +1038 -0
- package/dist/docs/media-viewer.json +70 -15
- package/dist/docs/media-viewer.md +84 -135
- package/dist/docs/message-scroller.examples.md +1193 -0
- package/dist/docs/message-scroller.json +41 -17
- package/dist/docs/message-scroller.md +80 -134
- package/dist/docs/message.examples.md +944 -0
- package/dist/docs/message.json +64 -16
- package/dist/docs/message.md +34 -326
- package/dist/docs/meter.json +58 -26
- package/dist/docs/meter.md +312 -32
- package/dist/docs/navigation-menu.examples.md +1107 -0
- package/dist/docs/navigation-menu.json +57 -41
- package/dist/docs/navigation-menu.md +105 -298
- package/dist/docs/notification-center.examples.md +1045 -0
- package/dist/docs/notification-center.json +71 -15
- package/dist/docs/notification-center.md +76 -266
- package/dist/docs/otp-input.examples.md +490 -0
- package/dist/docs/otp-input.json +65 -25
- package/dist/docs/otp-input.md +20 -191
- package/dist/docs/page-header.examples.md +1041 -0
- package/dist/docs/page-header.json +75 -43
- package/dist/docs/page-header.md +79 -291
- package/dist/docs/page.examples.md +633 -0
- package/dist/docs/page.json +48 -16
- package/dist/docs/page.md +62 -129
- package/dist/docs/prompt-composer.examples.md +630 -0
- package/dist/docs/prompt-composer.json +66 -18
- package/dist/docs/prompt-composer.md +35 -161
- package/dist/docs/prose.json +69 -37
- package/dist/docs/prose.md +393 -75
- package/dist/docs/rating.examples.md +525 -0
- package/dist/docs/rating.json +92 -28
- package/dist/docs/rating.md +27 -241
- package/dist/docs/saved-views.examples.md +1108 -0
- package/dist/docs/saved-views.json +53 -21
- package/dist/docs/saved-views.md +86 -171
- package/dist/docs/scroll-area.examples.md +837 -0
- package/dist/docs/scroll-area.json +64 -24
- package/dist/docs/scroll-area.md +57 -140
- package/dist/docs/section.examples.md +676 -0
- package/dist/docs/section.json +68 -20
- package/dist/docs/section.md +39 -162
- package/dist/docs/segmented-control.examples.md +480 -0
- package/dist/docs/segmented-control.json +76 -28
- package/dist/docs/segmented-control.md +20 -191
- package/dist/docs/side-navigation.examples.md +1468 -0
- package/dist/docs/side-navigation.json +53 -53
- package/dist/docs/side-navigation.md +79 -354
- package/dist/docs/slider.examples.md +505 -0
- package/dist/docs/slider.json +91 -51
- package/dist/docs/slider.md +47 -212
- package/dist/docs/sparkline.json +60 -36
- package/dist/docs/sparkline.md +447 -71
- package/dist/docs/split-button.examples.md +509 -0
- package/dist/docs/split-button.json +73 -41
- package/dist/docs/split-button.md +64 -194
- package/dist/docs/splitter.examples.md +921 -0
- package/dist/docs/splitter.json +94 -46
- package/dist/docs/splitter.md +75 -182
- package/dist/docs/stat-card.examples.md +725 -0
- package/dist/docs/stat-card.json +89 -41
- package/dist/docs/stat-card.md +55 -227
- package/dist/docs/status-indicator.json +80 -32
- package/dist/docs/status-indicator.md +409 -65
- package/dist/docs/stepper.json +53 -21
- package/dist/docs/stepper.md +369 -48
- package/dist/docs/table-of-contents.examples.md +550 -0
- package/dist/docs/table-of-contents.json +60 -28
- package/dist/docs/table-of-contents.md +70 -205
- package/dist/docs/tags-input.examples.md +541 -0
- package/dist/docs/tags-input.json +64 -16
- package/dist/docs/tags-input.md +15 -262
- package/dist/docs/time-field.examples.md +587 -0
- package/dist/docs/time-field.json +69 -29
- package/dist/docs/time-field.md +21 -223
- package/dist/docs/time-picker.json +117 -53
- package/dist/docs/time-picker.md +499 -54
- package/dist/docs/time-range-picker.examples.md +750 -0
- package/dist/docs/time-range-picker.json +139 -75
- package/dist/docs/time-range-picker.md +63 -225
- package/dist/docs/timeline.examples.md +617 -0
- package/dist/docs/timeline.json +44 -28
- package/dist/docs/timeline.md +34 -208
- package/dist/docs/toolbar.json +56 -16
- package/dist/docs/toolbar.md +357 -63
- package/dist/docs/top-navigation.examples.md +1206 -140
- package/dist/docs/top-navigation.json +49 -33
- package/dist/docs/top-navigation.md +87 -36
- package/dist/docs/tour.examples.md +960 -0
- package/dist/docs/tour.json +57 -25
- package/dist/docs/tour.md +60 -244
- package/dist/docs/transfer.examples.md +631 -0
- package/dist/docs/transfer.json +80 -16
- package/dist/docs/transfer.md +41 -170
- package/dist/docs/typography.json +96 -0
- package/dist/docs/typography.md +352 -4
- package/dist/docs/upload.examples.md +555 -53
- package/dist/docs/upload.json +62 -30
- package/dist/docs/upload.md +46 -11
- package/dist/docs/wizard.examples.md +1389 -0
- package/dist/docs/wizard.json +89 -49
- package/dist/docs/wizard.md +122 -263
- package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +58 -58
- package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
- package/dist/media-viewer.js +2 -2
- package/dist/message-P91bEGyV.js +455 -0
- package/dist/message.js +2 -2
- package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
- package/dist/page-header.js +1 -1
- package/dist/section-CVTQdWBl.js +216 -0
- package/dist/section.js +2 -2
- package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
- package/dist/side-navigation.js +1 -1
- package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
- package/dist/stat-card.js +1 -1
- package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
- package/dist/stepper.js +2 -2
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
- package/dist/timeline.js +1 -1
- package/dist/top-navigation-YSEQzBhD.js +744 -0
- package/dist/top-navigation.js +2 -2
- package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
- package/dist/transfer.js +1 -1
- package/dist/types/attachment/attachment-parts.d.ts +24 -11
- package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
- package/dist/types/attachment/attachment.d.ts +3 -3
- package/dist/types/attachment/attachment.d.ts.map +1 -1
- package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/types/carousel/carousel-parts.d.ts +2 -2
- package/dist/types/command-palette/command-palette.d.ts.map +1 -1
- package/dist/types/data-list/data-list.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
- package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
- package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
- package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
- package/dist/types/media-viewer/index.d.ts +2 -2
- package/dist/types/media-viewer/index.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
- package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
- package/dist/types/message/message-parts.d.ts +7 -0
- package/dist/types/message/message-parts.d.ts.map +1 -1
- package/dist/types/message/message.d.ts.map +1 -1
- package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
- package/dist/types/section/section-parts.d.ts +16 -8
- package/dist/types/section/section-parts.d.ts.map +1 -1
- package/dist/types/section/section.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
- package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper-parts.d.ts +11 -2
- package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper.d.ts.map +1 -1
- package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
- package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
- package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
- package/dist/wizard.js +1 -1
- package/package.json +6 -6
- package/dist/attachment-MqczA38F.js +0 -292
- package/dist/detail-panel-EImAtksY.js +0 -327
- package/dist/message-D1Dd6Y2k.js +0 -452
- package/dist/section-D_qOfdxR.js +0 -213
- package/dist/top-navigation-D8IHPOmm.js +0 -744
|
@@ -11,15 +11,126 @@ import { ImportExportCenter, ImportExportCenterDefaultsProvider, useJobToasts }
|
|
|
11
11
|
|
|
12
12
|
## Minimal example
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Example
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
import { ImportExportCenter } from '@slotted/react/import-export-center';
|
|
18
|
+
import type { ImportExportJob } from '@slotted/react/import-export-center';
|
|
19
|
+
|
|
20
|
+
const NOW = 1790344800000;
|
|
21
|
+
|
|
22
|
+
const JOBS: ImportExportJob[] = [
|
|
23
|
+
{
|
|
24
|
+
key: 'stock-september',
|
|
25
|
+
direction: 'export',
|
|
26
|
+
title: 'Stock movements, September',
|
|
27
|
+
status: 'queued',
|
|
28
|
+
format: 'XLSX',
|
|
29
|
+
actor: 'Marina Duarte',
|
|
30
|
+
createdAt: '2026-09-25T13:59:00Z',
|
|
31
|
+
stage: 'Starts after the customer import',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: 'suppliers',
|
|
35
|
+
direction: 'import',
|
|
36
|
+
title: 'Supplier list',
|
|
37
|
+
status: 'succeeded',
|
|
38
|
+
format: 'XLSX',
|
|
39
|
+
actor: 'Rui Tavares',
|
|
40
|
+
createdAt: '2026-09-25T10:40:00Z',
|
|
41
|
+
finishedAt: '2026-09-25T10:42:00Z',
|
|
42
|
+
counts: {
|
|
43
|
+
total: 420,
|
|
44
|
+
processed: 420,
|
|
45
|
+
created: 36,
|
|
46
|
+
updated: 384,
|
|
47
|
+
},
|
|
48
|
+
source: {
|
|
49
|
+
name: 'suppliers-2026.xlsx',
|
|
50
|
+
size: 96000,
|
|
51
|
+
href: '#suppliers',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: 'catalog-autumn',
|
|
56
|
+
direction: 'import',
|
|
57
|
+
title: 'Product catalog',
|
|
58
|
+
status: 'succeeded',
|
|
59
|
+
format: 'XLSX',
|
|
60
|
+
actor: 'Marina Duarte',
|
|
61
|
+
createdAt: '2026-09-25T10:50:00Z',
|
|
62
|
+
finishedAt: '2026-09-25T11:00:00Z',
|
|
63
|
+
counts: {
|
|
64
|
+
total: 3000,
|
|
65
|
+
processed: 2988,
|
|
66
|
+
created: 2210,
|
|
67
|
+
updated: 778,
|
|
68
|
+
failed: 12,
|
|
69
|
+
},
|
|
70
|
+
errorCount: 12,
|
|
71
|
+
errors: [
|
|
72
|
+
{
|
|
73
|
+
row: 14,
|
|
74
|
+
column: 'SKU',
|
|
75
|
+
value: '',
|
|
76
|
+
message: 'Required field is empty',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
row: 208,
|
|
80
|
+
column: 'Price',
|
|
81
|
+
value: '12.5O',
|
|
82
|
+
message: 'Not a number',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
row: 391,
|
|
86
|
+
column: 'HS code',
|
|
87
|
+
value: '8471.3',
|
|
88
|
+
message: 'Code with 8 digits expected',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
source: {
|
|
92
|
+
name: 'catalog-autumn-2026.xlsx',
|
|
93
|
+
size: 1800000,
|
|
94
|
+
href: '#catalog',
|
|
95
|
+
},
|
|
96
|
+
errorsFile: {
|
|
97
|
+
name: 'catalog-autumn-2026-errors.csv',
|
|
98
|
+
size: 2048,
|
|
99
|
+
href: '#catalog-errors',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: 'invoices-q3',
|
|
104
|
+
direction: 'export',
|
|
105
|
+
title: 'Q3 invoices',
|
|
106
|
+
status: 'succeeded',
|
|
107
|
+
format: 'CSV',
|
|
108
|
+
actor: 'Marina Duarte',
|
|
109
|
+
createdAt: '2026-09-25T09:38:00Z',
|
|
110
|
+
finishedAt: '2026-09-25T09:40:00Z',
|
|
111
|
+
result: {
|
|
112
|
+
name: 'invoices-q3-2026.csv',
|
|
113
|
+
size: 640000,
|
|
114
|
+
href: '#invoices-q3',
|
|
115
|
+
expiresAt: '2026-10-02T09:40:00Z',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: 'statement',
|
|
120
|
+
direction: 'export',
|
|
121
|
+
title: 'Overdue customer statement',
|
|
122
|
+
status: 'failed',
|
|
123
|
+
format: 'PDF',
|
|
124
|
+
actor: 'Marina Duarte',
|
|
125
|
+
createdAt: '2026-09-25T07:40:00Z',
|
|
126
|
+
finishedAt: '2026-09-25T07:50:00Z',
|
|
127
|
+
message: 'The reporting service did not respond within 10 minutes.',
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
export default function ImportExportCenterBasicExample() {
|
|
132
|
+
return <ImportExportCenter jobs={JOBS} now={NOW} timeZone="UTC" />;
|
|
133
|
+
}
|
|
23
134
|
```
|
|
24
135
|
|
|
25
136
|
## Anatomy
|
|
@@ -104,8 +215,8 @@ Excerpt — not a complete module
|
|
|
104
215
|
| --- | --- | --- |
|
|
105
216
|
| `onViewChange` | `(view: string, request: ChangeRequest<string>)` | Before the view moves: a tab (pointer, keyboard) or reveal() of a job the view hides (programmatic). cancel() refuses the move. |
|
|
106
217
|
| `onExpandedChange` | `(keys: readonly string[], request: ChangeRequest<readonly string[]>)` | Before a job’s details show or hide: the toggle (pointer, keyboard) or reveal() (programmatic). A key that leaves jobs leaves an uncontrolled set on the next render. |
|
|
107
|
-
| `onCancel` | `(key: string, request: { reason, source, cancelled, cancel() })` | When the reader presses
|
|
108
|
-
| `onRetry` | `(key: string, request)` | When the reader presses
|
|
218
|
+
| `onCancel` | `(key: string, request: { reason, source, cancelled, cancel() })` | When the reader presses Cancel on a queued or running job — reasons pointer, keyboard. The store stops the job and answers by changing its status. |
|
|
219
|
+
| `onRetry` | `(key: string, request)` | When the reader presses Try again or Generate again — reasons pointer, keyboard. |
|
|
109
220
|
| `onRemove` | `({ keys }, request)` | When the reader presses remove on a finished job (pointer, keyboard) or clear in the header (clear, with every finished removable key of the view). |
|
|
110
221
|
| `onDownload` | `({ key, file }, request)` | Before a download — the primary control or a file in the details; file is source, result or errors. With an href the link navigates unless cancelled; without one the consumer produces the file here. |
|
|
111
222
|
| `onOpen` | `(key: string, request)` | Before the title’s link navigates to job.href — reasons pointer, keyboard; cancel() keeps the reader here. |
|
|
@@ -140,220 +251,4 @@ Excerpt — not a complete module
|
|
|
140
251
|
|
|
141
252
|
## Examples
|
|
142
253
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
The header with its count, clear and the consumer’s two actions; the strip; a running job with its bar; a partial import with its details open — counts, the original file, the report and the failed rows; growing by button; a footer. Every part the contract names, in one box.
|
|
146
|
-
|
|
147
|
-
Excerpt — not a complete module
|
|
148
|
-
|
|
149
|
-
```tsx
|
|
150
|
-
<ImportExportCenter
|
|
151
|
-
actions={<ImportActions />}
|
|
152
|
-
defaultExpanded={['catalog-autumn']}
|
|
153
|
-
footer={<Link href="/jobs">Ver todos os jobs</Link>}
|
|
154
|
-
growing="button"
|
|
155
|
-
hasMore
|
|
156
|
-
jobs={jobs}
|
|
157
|
-
/>;
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Five statuses, four outcomes
|
|
161
|
-
|
|
162
|
-
Queued, running, succeeded, succeeded with failed rows, failed and cancelled, each with its word, its mark and its tone. The partial row is derived: the store wrote succeeded and counts.failed 12, and the family refused to paint it green.
|
|
163
|
-
|
|
164
|
-
Excerpt — not a complete module
|
|
165
|
-
|
|
166
|
-
```tsx
|
|
167
|
-
const catalog: ImportExportJob = {
|
|
168
|
-
counts: { failed: 12, processed: 2988, total: 3000 },
|
|
169
|
-
direction: 'import',
|
|
170
|
-
key: 'catalog-autumn',
|
|
171
|
-
status: 'succeeded',
|
|
172
|
-
title: 'Product catalog',
|
|
173
|
-
};
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Progress, in the job’s unit
|
|
177
|
-
|
|
178
|
-
Rows with a percentage and the server’s eta; bytes in the size scale; a bare percentage; an indeterminate bar that says only its stage; and a job whose time left the family estimates from the updates it saw. The bar is progress-indicator at its small step and says nothing aloud.
|
|
179
|
-
|
|
180
|
-
Excerpt — not a complete module
|
|
181
|
-
|
|
182
|
-
```tsx
|
|
183
|
-
const jobs: ImportExportJob[] = [
|
|
184
|
-
{ ...rows, eta: '2026-09-25T14:03:00Z', progress: { max: 5000, value: 1204 } },
|
|
185
|
-
{ ...bytes, progress: { max: 10_000_000, unit: 'bytes', value: 2_500_000 } },
|
|
186
|
-
{ ...waiting, progress: {}, stage: 'Preparando o arquivo' },
|
|
187
|
-
];
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Rows that failed
|
|
191
|
-
|
|
192
|
-
A partial import with its details open: the counts, the report download as the job’s primary control, and a table of the rows the store sent — the message second, so it stays in view when the table scrolls sideways — with Mostrando 5 de 1.284 because the store sent a sample.
|
|
193
|
-
|
|
194
|
-
Excerpt — not a complete module
|
|
195
|
-
|
|
196
|
-
```tsx
|
|
197
|
-
const catalog: ImportExportJob = {
|
|
198
|
-
...job,
|
|
199
|
-
errorCount: 1284,
|
|
200
|
-
errors: firstPage,
|
|
201
|
-
errorsFile: { href: '/imports/481/errors.csv', name: 'catalogo-erros.csv' },
|
|
202
|
-
};
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Deadlines and permission
|
|
206
|
-
|
|
207
|
-
An export whose file expired offers Generate again in place of Download and says when it expired; an export still available says until when; an import whose original the reader may not download says why in the consumer’s words, and draws no control for it.
|
|
208
|
-
|
|
209
|
-
Excerpt — not a complete module
|
|
210
|
-
|
|
211
|
-
```tsx
|
|
212
|
-
const result: JobFile = { expiresAt: '2026-09-08T10:00:00Z', href, name: 'invoices.zip' };
|
|
213
|
-
const source: JobFile = {
|
|
214
|
-
denied: 'Only the person who imported the file or an administrator can download the original.',
|
|
215
|
-
name: 'wholesale-prices.csv',
|
|
216
|
-
};
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Views
|
|
220
|
-
|
|
221
|
-
The built-in All, Imports and Exports, filtered by direction; below, the consumer’s own views — Mine is the consumer’s query, so the family shows the jobs it is given — held in the consumer’s state, which refuses Archived with request.cancel().
|
|
222
|
-
|
|
223
|
-
Excerpt — not a complete module
|
|
224
|
-
|
|
225
|
-
```tsx
|
|
226
|
-
<ImportExportCenter
|
|
227
|
-
jobs={view === 'mine' ? mine : jobs}
|
|
228
|
-
onViewChange={(next, request) => {
|
|
229
|
-
if (next === 'archived') request.cancel();
|
|
230
|
-
else setView(next);
|
|
231
|
-
}}
|
|
232
|
-
view={view}
|
|
233
|
-
views={views}
|
|
234
|
-
/>;
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### Starting a job
|
|
238
|
-
|
|
239
|
-
Importar opens a dialog with upload as its dropzone; its adapter sends the bytes and the store creates the job, which appears at the top of the list. Exportar opens a dialog with the format and the file name. The center starts nothing itself and never transfers a byte.
|
|
240
|
-
|
|
241
|
-
Excerpt — not a complete module
|
|
242
|
-
|
|
243
|
-
```tsx
|
|
244
|
-
<ImportExportCenter
|
|
245
|
-
actions={
|
|
246
|
-
<>
|
|
247
|
-
<ImportDialog onUploaded={(file) => store.createImport(file)} />
|
|
248
|
-
<ExportDialog onConfirm={(format) => store.createExport(format)} />
|
|
249
|
-
</>
|
|
250
|
-
}
|
|
251
|
-
jobs={store.jobs}
|
|
252
|
-
/>;
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### The toast points at the job
|
|
256
|
-
|
|
257
|
-
useJobToasts in the shell raises one toast per job when it starts and replaces it when it finishes, under the job’s key; View reveals the job in the center — details open, title focused. The toast carries no progress, no cancel and no download.
|
|
258
|
-
|
|
259
|
-
Excerpt — not a complete module
|
|
260
|
-
|
|
261
|
-
```tsx
|
|
262
|
-
useJobToasts(jobs, {
|
|
263
|
-
onView: (key) => {
|
|
264
|
-
navigate('/jobs');
|
|
265
|
-
center.current?.reveal(key);
|
|
266
|
-
},
|
|
267
|
-
});
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### In a popover, on a page
|
|
271
|
-
|
|
272
|
-
The same jobs in a popover under the top bar, at size sm with a footer link to the page, and on the page at md, where from 42rem every job is a row of one grid and the states line up in one column.
|
|
273
|
-
|
|
274
|
-
Excerpt — not a complete module
|
|
275
|
-
|
|
276
|
-
```tsx
|
|
277
|
-
<Popover>
|
|
278
|
-
<PopoverTrigger render={(props) => <Button {...props}>Jobs</Button>} />
|
|
279
|
-
<PopoverLayer>
|
|
280
|
-
<PopoverContent aria-label="Imports and exports">
|
|
281
|
-
<ImportExportCenter footer={<SeeAll />} jobs={jobs} size="sm" />
|
|
282
|
-
</PopoverContent>
|
|
283
|
-
</PopoverLayer>
|
|
284
|
-
</Popover>;
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### The first wait, and the next page
|
|
288
|
-
|
|
289
|
-
Three skeleton jobs with the anatomy of a job — the tile, the name, the meta line — stand in the boxes the jobs will occupy while the list is busy; with jobs already shown, more says Carregando and refuses a second press.
|
|
290
|
-
|
|
291
|
-
Excerpt — not a complete module
|
|
292
|
-
|
|
293
|
-
```tsx
|
|
294
|
-
<ImportExportCenter jobs={[]} loading />;
|
|
295
|
-
<ImportExportCenter growing="button" hasMore jobs={jobs} loading />;
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Nothing yet, and a list that failed
|
|
299
|
-
|
|
300
|
-
An empty view draws the view’s own words — No exports — or the consumer’s empty; a list the store could not load draws the error page whose control asks onReload.
|
|
301
|
-
|
|
302
|
-
Excerpt — not a complete module
|
|
303
|
-
|
|
304
|
-
```tsx
|
|
305
|
-
<ImportExportCenter defaultView="export" jobs={[]} />;
|
|
306
|
-
<ImportExportCenter jobs={[]} onReload={() => refetch()} status="error" />;
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### Two sizes
|
|
310
|
-
|
|
311
|
-
sm for the popover and the drawer: the small type steps, tighter insets, a floor width so a panel sized to its content does not collapse; md for the page. The controls keep the button family’s small step in both.
|
|
312
|
-
|
|
313
|
-
Excerpt — not a complete module
|
|
314
|
-
|
|
315
|
-
```tsx
|
|
316
|
-
<ImportExportCenter jobs={jobs} size="sm" />;
|
|
317
|
-
<ImportExportCenter jobs={jobs} size="md" />;
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
### Content the family did not choose
|
|
321
|
-
|
|
322
|
-
A title of fourteen words, a file name of ninety characters that keeps its extension, an Arabic report in a left-to-right page, a stage longer than the line, a million rows, and a job with the consumer’s own action.
|
|
323
|
-
|
|
324
|
-
Excerpt — not a complete module
|
|
325
|
-
|
|
326
|
-
```tsx
|
|
327
|
-
<ImportExportCenter
|
|
328
|
-
jobs={jobs}
|
|
329
|
-
renderJobActions={(job) =>
|
|
330
|
-
job.direction === 'export' ? <Link href={shareUrl(job)}>Partilhar</Link> : null
|
|
331
|
-
}
|
|
332
|
-
/>;
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Defaults, once
|
|
336
|
-
|
|
337
|
-
ImportExportCenterDefaultsProvider sets the size, the rank, the time format and the zone for a whole application — here with absolute times; the second center states size="md" itself and wins. The words and the locale come from SlottedProvider.
|
|
338
|
-
|
|
339
|
-
Excerpt — not a complete module
|
|
340
|
-
|
|
341
|
-
```tsx
|
|
342
|
-
<ImportExportCenterDefaultsProvider level="3" size="sm" timeFormat="absolute">
|
|
343
|
-
<App />
|
|
344
|
-
</ImportExportCenterDefaultsProvider>;
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### Keyboard and focus
|
|
348
|
-
|
|
349
|
-
Tab through the controls: every one is named by its words and the job — Cancel Contacts from CRM. Press Cancel: the job ends, the control leaves, and focus stays in the job on its first control. Remove a job: focus goes to the same control of the job in its place.
|
|
350
|
-
|
|
351
|
-
Excerpt — not a complete module
|
|
352
|
-
|
|
353
|
-
```tsx
|
|
354
|
-
<ImportExportCenter
|
|
355
|
-
jobs={jobs}
|
|
356
|
-
onCancel={(key) => cancel(key)}
|
|
357
|
-
onRemove={({ keys }) => remove(keys)}
|
|
358
|
-
/>;
|
|
359
|
-
```
|
|
254
|
+
See [import-export-center.examples.md](./import-export-center.examples.md).
|