DataImportWizard
Parse a CSV, map destination fields, correct values and submit validated rows to application-owned import logic.
Live TypeScript example
Try the component here, then use the source below in your application.
- JavaScript
- 6.7 KiB
- Component CSS
- 1.4 KiB
- Shared theme CSS
- 3.8 KiBonce per application
How sizes are measured
The JavaScript figure includes this component’s required helpers. CSS includes its styling dependencies. Each entry is bundled separately for ES2022, minified, then compressed with gzip level 9. Your bundler may share helpers across components. Images, fonts, examples and application code are excluded.
Before compression: JavaScript 17.6 KiB; component CSS 6.0 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →Browse for a CSV, map fields, then use the editable review table. Validation messages are associated with each input; Go to first issue finds the earliest error.
import '@blukavantui/web/theme.css'
import {createDataImportWizard} from '@blukavantui/web/data-import-wizard';
import '@blukavantui/web/data-import-wizard.css';
export function mount(host:HTMLElement) {
const status=document.createElement("p");status.setAttribute("role","status");
const component=createDataImportWizard(host, {
"Fields": [
{
"Key": "Name",
"Label": "Customer name",
"DataType": "Text",
"IsRequired": true,
"Description": "Required customer or company name."
},
{
"Key": "Email",
"Label": "Email",
"DataType": "Text",
"IsRequired": true,
"IsUnique": true,
"Description": "Unique within this file. Your application can apply email validation."
},
{
"Key": "Seats",
"Label": "Seats",
"DataType": "Integer",
"IsRequired": true,
"DefaultValue": "1"
},
{
"Key": "Active",
"Label": "Active",
"DataType": "Boolean",
"DefaultValue": "true"
},
{
"Key": "Joined",
"Label": "Joined",
"DataType": "Date",
"IsRequired": true
}
],
"MaxRows": 10000,
"MaxFileSizeMB": 5,
"Delimiter": "Auto",
"IsDisabled": false
}, { ImportRequested: (requestId, rows, fileName) => {
// Sample acknowledgement only: connect your validated server import here.
status.textContent = `${fileName}: ${rows.length} validated records received. No database was written.`;
queueMicrotask(() => component.update({ImportResultRequestId:requestId, ImportResultSuccess:true, ImportResultMessage:'Sample received the rows.'}));
} });
host.append(status);
return {destroy(){component.destroy();status.remove();}};
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://blukavantui.blutekmedia.com/downloads/blukavantui-web-0.6.2.tgz<div id="example"></div>This example uses the downloadable @blukavantui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
createDataImportWizard
Pass options as the second argument and callbacks in the third argument. Keep the returned instance to update options or dispose it when its view is removed.
import { createDataImportWizard } from '@blukavantui/web/data-import-wizard';
import '@blukavantui/web/data-import-wizard.css';Load @blukavantui/web/theme.css once in your app shell.createDataImportWizard(host: HTMLElement, options: T.DataImportWizardOptions, events?: T.DataImportWizardEvents)Reference for @blukavantui/web 0.6.2. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
12| Name | Type / requirement | Usage |
|---|---|---|
Fields | BluImportField[]Required | Destination schema used for mapping and validation. |
MaxRows | numberOptional | Maximum data rows, from 1 to 100000. Default: 10000. |
MaxFileSizeMB | numberOptional | Maximum CSV file size in MB, from 1 to 50. Default: 5. |
Delimiter | stringOptional | Auto, Comma, Semicolon or Tab. Default: "Auto". |
IsDisabled | booleanOptional | Disables choosing, editing and submitting data. Default: False. |
ImportResultRequestId | stringOptional | Echo OnImportRequested.RequestId when the import finishes. Default: "". |
ImportResultSuccess | booleanOptional | True completes the import; False retains the file and corrections. Default: False. |
ImportResultMessage | stringOptional | Feedback for the matching import request. Default: "". |
ImportResultErrorsJson | stringOptional | Optional BluImportError array returned by the server. Default: "[]". |
ResetKey | stringOptional | Change to clear the file, mapping and review state when no import is running. Default: "". |
AccessibleLabel | stringOptional | Accessible component name; empty uses the component default. Default: "". |
ExtendedClass | stringOptional | Additional CSS classes on the Block root. Default: "". |
Callbacks
3| Name | Type / requirement | Usage |
|---|---|---|
ImportRequested | (requestId: string, rows: Record<string, string | number | boolean | null>[], fileName: string) => void | Promise<void>Optional | |
StepChanged | (step: string) => void | Promise<void>Optional | |
Error | (message: string) => void | Promise<void>Optional |
Instance methods & properties
3| Name | Signature / type | Usage |
|---|---|---|
element | HTMLElement | Root owned by this instance. Dispose before removing its host. |
update | (patch: Partial<T.DataImportWizardOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Related data types
Expand a type for its fields and allowed values.
BluImportField
interface BluImportField {
/** Unique destination field key. */
Key: string;
/** Destination field label. */
Label: string;
/** Text, Integer, Decimal, Boolean, Date or DateTime. */
DataType: "Text" | "Integer" | "Decimal" | "Boolean" | "Date" | "DateTime";
/** Rejects empty values. */
IsRequired?: boolean;
/** Rejects duplicate nonempty values within the submitted file. */
IsUnique?: boolean;
/** Used for an unmapped field or empty cell. */
DefaultValue?: string;
/** Help text shown during mapping. */
Description?: string;
}Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Part of the full commercial BluKavantUI for OutSystems edition. View OutSystems editions →
Open OutSystems showcase ↗- Web runtime
- Partially supported
- TypeScript
- Partially supported
- OutSystems
- Partially supported
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance →Purpose and use
Parse a CSV, map destination fields, correct values and submit validated rows to application-owned import logic.
Keyboard design guidance
Browse for a CSV, map fields, then use the editable review table. Validation messages are associated with each input; Go to first issue finds the earliest error.
See the support status above for review coverage and any limitations.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.