s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Svelte · Import Export

ImportExport

No summary has been written for ImportExport. Everything below is generated from the declaration shipped in 0.57.40 and describes the real contract.

Public export

typescript
import { ImportExport } from '@happyvertical/smrt-svelte/import-export';
Import path
@happyvertical/smrt-svelte/import-export
Props
11
Props described
11 of 11
Bindable state
0
Callback events
2
Verified release
0.57.40

Props

NameTypeRequiredDescription
fieldsImportExportField[]YesColumns, usually from `fieldsFromCollectionDefinition` (manifest + resolved policy).
collectionLabelstringNoHeading context, for example the collection's plural label.
createRecord(values: Record<string, unknown>) => Promise<unknown>NoPersist one validated row. Providing it enables import; reject to fail just that row. `createCollectionImportExport(...).createRecord` fits.
loadRows(options: { signal?: AbortSignal; }) => Promise<Array<Record<string, unknown>>>NoLoad the rows to export. Providing it enables export. Throw to report a failure. `createCollectionImportExport(...).loadRows` fits.
filenamestringNoBase name for exported files. Default `export`.
maxFileBytesnumberNoLargest accepted file in bytes. Default 5 MiB.
maxRowsnumberNoMost data rows accepted per file. Default 10,000.
concurrencynumberNoParallel create requests. Default 3.
mode'both' | 'import' | 'export'NoWhich sections to show. Default `both`; a missing callback hides its side.
ondownload(file: ExportFile) => voidNoReceives every generated file. Default triggers a browser download.
onimported(result: ImportRunResult) => voidNoCalled after an import run finishes (including a stopped run).

Bindable state

This component has no bindable public state.

Callback events

  • ondownload(file: ExportFile) => void
  • onimported(result: ImportRunResult) => void

Examples and explanation