@importcsv/react 0.1.17 → 0.2.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 +16 -6
- package/build/bundle.css +1 -0
- package/build/bundled-styles.d.ts +1 -1
- package/build/components/CSVImporter/index.d.ts +32 -35
- package/build/i18n/de.d.ts +32 -32
- package/build/i18n/es.d.ts +32 -32
- package/build/i18n/fr.d.ts +32 -32
- package/build/i18n/i18n.d.ts +6 -6
- package/build/i18n/it.d.ts +32 -32
- package/build/i18n/useTranslation.d.ts +9 -9
- package/build/importer/components/Box/index.d.ts +2 -2
- package/build/importer/components/Box/types/index.d.ts +6 -6
- package/build/importer/components/Checkbox/index.d.ts +2 -2
- package/build/importer/components/Checkbox/types/index.d.ts +4 -4
- package/build/importer/components/Errors/index.d.ts +4 -4
- package/build/importer/components/IframeWrapper/index.d.ts +25 -25
- package/build/importer/components/ImporterLayout.d.ts +15 -0
- package/build/importer/components/Input/index.d.ts +2 -2
- package/build/importer/components/Input/types/index.d.ts +18 -18
- package/build/importer/components/Stepper/hooks/useStepper.d.ts +2 -2
- package/build/importer/components/Stepper/index.d.ts +2 -2
- package/build/importer/components/Stepper/types/index.d.ts +14 -13
- package/build/importer/components/Table/index.d.ts +9 -9
- package/build/importer/components/Table/types/index.d.ts +42 -42
- package/build/importer/components/ToggleFilter/index.d.ts +3 -3
- package/build/importer/components/ToggleFilter/types/index.d.ts +11 -11
- package/build/importer/components/Tooltip/index.d.ts +2 -2
- package/build/importer/components/Tooltip/types/index.d.ts +11 -11
- package/build/importer/components/UploaderWrapper/UploaderWrapper.d.ts +2 -2
- package/build/importer/components/UploaderWrapper/types/index.d.ts +2 -2
- package/build/importer/components/ui/alert.d.ts +8 -8
- package/build/importer/components/ui/button.d.ts +12 -12
- package/build/importer/components/ui/card.d.ts +8 -8
- package/build/importer/components/ui/checkbox.d.ts +4 -4
- package/build/importer/components/ui/dialog.d.ts +19 -19
- package/build/importer/components/ui/flex.d.ts +14 -14
- package/build/importer/components/ui/input.d.ts +5 -5
- package/build/importer/components/ui/select.d.ts +13 -13
- package/build/importer/components/ui/switch.d.ts +4 -4
- package/build/importer/components/ui/toast.d.ts +15 -15
- package/build/importer/components/ui/toaster.d.ts +1 -1
- package/build/importer/components/ui/tooltip.d.ts +13 -13
- package/build/importer/components/ui/use-toast.d.ts +44 -44
- package/build/importer/features/complete/index.d.ts +2 -2
- package/build/importer/features/complete/types/index.d.ts +5 -5
- package/build/importer/features/configure-import/index.d.ts +13 -13
- package/build/importer/features/configure-import/types/index.d.ts +13 -19
- package/build/importer/features/main/hooks/useMutableLocalStorage.d.ts +1 -1
- package/build/importer/features/main/hooks/useStepNavigation.d.ts +17 -18
- package/build/importer/features/main/index.d.ts +2 -2
- package/build/importer/features/main/types/index.d.ts +16 -16
- package/build/importer/features/map-columns/components/DropDownFields.d.ts +21 -19
- package/build/importer/features/map-columns/hooks/useMapColumnsTable.d.ts +16 -15
- package/build/importer/features/map-columns/index.d.ts +2 -2
- package/build/importer/features/map-columns/types/index.d.ts +16 -23
- package/build/importer/features/row-selection/index.d.ts +2 -2
- package/build/importer/features/row-selection/types/index.d.ts +8 -8
- package/build/importer/features/uploader/hooks/useTemplateTable.d.ts +10 -10
- package/build/importer/features/uploader/index.d.ts +2 -2
- package/build/importer/features/uploader/types/index.d.ts +9 -9
- package/build/importer/features/validation/Validation.d.ts +2 -2
- package/build/importer/features/validation/components/TransformModal.d.ts +18 -18
- package/build/importer/features/validation/index.d.ts +1 -1
- package/build/importer/features/validation/types.d.ts +32 -32
- package/build/importer/hooks/useClickOutside.d.ts +1 -1
- package/build/importer/hooks/useCustomStyles.d.ts +1 -1
- package/build/importer/hooks/useDemoData.d.ts +16 -0
- package/build/importer/hooks/useEventListener.d.ts +4 -4
- package/build/importer/hooks/useImporterSchema.d.ts +21 -0
- package/build/importer/hooks/useIsomorphicLayoutEffect.d.ts +3 -3
- package/build/importer/hooks/useRect.d.ts +12 -12
- package/build/importer/hooks/useWindowSize.d.ts +1 -1
- package/build/importer/providers/Theme.d.ts +5 -6
- package/build/importer/providers/index.d.ts +5 -5
- package/build/importer/providers/types/index.d.ts +4 -4
- package/build/importer/services/api.d.ts +1 -0
- package/build/importer/services/dataProcessor.d.ts +38 -0
- package/build/importer/services/mapping.d.ts +31 -31
- package/build/importer/services/transformation.d.ts +70 -70
- package/build/importer/settings/theme/colors.d.ts +4 -4
- package/build/importer/settings/theme/index.d.ts +2 -2
- package/build/importer/settings/theme/sizes.d.ts +7 -7
- package/build/importer/stores/theme.d.ts +17 -17
- package/build/importer/types/index.d.ts +9 -17
- package/build/importer/utils/colorUtils.d.ts +48 -44
- package/build/importer/utils/getStringLengthOfChildren.d.ts +2 -2
- package/build/importer/utils/stringSimilarity.d.ts +1 -1
- package/build/importer/utils/template.d.ts +2 -2
- package/build/importer/utils/utils.d.ts +19 -11
- package/build/index.d.ts +4 -3
- package/build/index.esm.js +10896 -34418
- package/build/index.esm.js.map +1 -1
- package/build/index.js +262 -37879
- package/build/index.js.map +1 -1
- package/build/js.d.ts +39 -40
- package/build/settings/defaults.d.ts +3 -3
- package/build/styles.d.ts +1 -1
- package/build/types/index.d.ts +105 -33
- package/build/utils/cn.d.ts +6 -0
- package/build/validation/transformer.d.ts +33 -0
- package/build/validation/validator.d.ts +23 -0
- package/package.json +14 -41
- package/build/App.d.ts +0 -2
- package/build/build/bundle.css +0 -3789
- package/build/config/index.d.ts +0 -5
- package/build/importer/components/Portal/index.d.ts +0 -3
- package/build/importer/components/Portal/types/index.d.ts +0 -5
- package/build/importer/components/Table/storyData.d.ts +0 -36
- package/build/importer/features/map-columns/hooks/useNameChange.d.ts +0 -5
- package/build/importer/features/validation/SimpleValidation.d.ts +0 -2
- package/build/importer/features/validation/components/SimpleSpreadsheetGrid/SimpleSpreadsheetGrid.d.ts +0 -27
- package/build/importer/features/validation/components/SimpleSpreadsheetGrid/index.d.ts +0 -1
- package/build/importer/features/validation/components/SpreadsheetGrid/CellSelection.d.ts +0 -15
- package/build/importer/features/validation/components/SpreadsheetGrid/ClipboardManager.d.ts +0 -20
- package/build/importer/features/validation/components/SpreadsheetGrid/FindReplaceModal.d.ts +0 -14
- package/build/importer/features/validation/components/SpreadsheetGrid/SpreadsheetGrid.d.ts +0 -37
- package/build/importer/features/validation/components/SpreadsheetGrid/UndoRedoManager.d.ts +0 -15
- package/build/importer/features/validation/components/SpreadsheetGrid/index.d.ts +0 -1
- package/build/importer/hooks/useDelayLoader.d.ts +0 -2
- package/build/importer/settings/chakra/components/alert.d.ts +0 -31
- package/build/importer/settings/chakra/components/button.d.ts +0 -37
- package/build/importer/settings/chakra/components/index.d.ts +0 -2
- package/build/importer/settings/chakra/foundations/blur.d.ts +0 -11
- package/build/importer/settings/chakra/foundations/borders.d.ts +0 -8
- package/build/importer/settings/chakra/foundations/breakpoints.d.ts +0 -9
- package/build/importer/settings/chakra/foundations/colors.d.ts +0 -247
- package/build/importer/settings/chakra/foundations/index.d.ts +0 -487
- package/build/importer/settings/chakra/foundations/radius.d.ts +0 -12
- package/build/importer/settings/chakra/foundations/shadows.d.ts +0 -14
- package/build/importer/settings/chakra/foundations/sizes.d.ts +0 -60
- package/build/importer/settings/chakra/foundations/spacing.d.ts +0 -35
- package/build/importer/settings/chakra/foundations/transition.d.ts +0 -24
- package/build/importer/settings/chakra/foundations/typography.d.ts +0 -61
- package/build/importer/settings/chakra/foundations/z-index.d.ts +0 -16
- package/build/importer/settings/chakra/index.d.ts +0 -592
- package/build/importer/settings/chakra/semantic-tokens.d.ts +0 -32
- package/build/importer/settings/chakra/styles.d.ts +0 -2
- package/build/importer/settings/chakra/theme.types.d.ts +0 -93
- package/build/importer/settings/chakra/utils/is-chakra-theme.d.ts +0 -3
- package/build/importer/settings/chakra/utils/run-if-fn.d.ts +0 -1
- package/build/importer/utils/classes.d.ts +0 -2
- package/build/importer/utils/debounce.d.ts +0 -2
- package/build/index.dev.d.ts +0 -1
- package/build/package.json +0 -92
- package/build/services/api.d.ts +0 -18
- package/build/services/apiClient.d.ts +0 -21
- package/build/utils/classes.d.ts +0 -6
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export declare const StepEnum: {
|
|
2
|
-
Upload: number;
|
|
3
|
-
RowSelection: number;
|
|
4
|
-
MapColumns: number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export default useStepNavigation;
|
|
1
|
+
export declare const StepEnum: {
|
|
2
|
+
Upload: number;
|
|
3
|
+
RowSelection: number;
|
|
4
|
+
MapColumns: number;
|
|
5
|
+
Validation: number;
|
|
6
|
+
Complete: number;
|
|
7
|
+
};
|
|
8
|
+
declare function useStepNavigation(initialStep: number, skipHeader: boolean, isDemoMode?: boolean): {
|
|
9
|
+
currentStep: any;
|
|
10
|
+
setStep: (newStep: number) => void;
|
|
11
|
+
goBack: (backStep?: number) => void;
|
|
12
|
+
goNext: (nextStep?: number) => void;
|
|
13
|
+
stepper: import('../../../components/Stepper/types').StepperProps;
|
|
14
|
+
stepId: string | number | undefined;
|
|
15
|
+
setStorageStep: any;
|
|
16
|
+
};
|
|
17
|
+
export default useStepNavigation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CSVImporterProps } from
|
|
2
|
-
export default function Main(props: CSVImporterProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { CSVImporterProps } from '../../../types';
|
|
2
|
+
export default function Main(props: CSVImporterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export declare enum Steps {
|
|
2
|
-
Upload = "upload",
|
|
3
|
-
RowSelection = "row-selection",
|
|
4
|
-
MapColumns = "map-columns",
|
|
5
|
-
Validation = "validation"
|
|
6
|
-
}
|
|
7
|
-
export type FileRow = {
|
|
8
|
-
index: number;
|
|
9
|
-
values: string[];
|
|
10
|
-
};
|
|
11
|
-
export type FileData = {
|
|
12
|
-
fileName: string;
|
|
13
|
-
rows: FileRow[];
|
|
14
|
-
sheetList: string[];
|
|
15
|
-
errors: string[];
|
|
16
|
-
};
|
|
1
|
+
export declare enum Steps {
|
|
2
|
+
Upload = "upload",
|
|
3
|
+
RowSelection = "row-selection",
|
|
4
|
+
MapColumns = "map-columns",
|
|
5
|
+
Validation = "validation"
|
|
6
|
+
}
|
|
7
|
+
export type FileRow = {
|
|
8
|
+
index: number;
|
|
9
|
+
values: string[];
|
|
10
|
+
};
|
|
11
|
+
export type FileData = {
|
|
12
|
+
fileName: string;
|
|
13
|
+
rows: FileRow[];
|
|
14
|
+
sheetList: string[];
|
|
15
|
+
errors: string[];
|
|
16
|
+
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { InputOption } from
|
|
2
|
-
type DropdownFieldsProps = {
|
|
3
|
-
options: {
|
|
4
|
-
[key: string]: InputOption;
|
|
5
|
-
};
|
|
6
|
-
value: string;
|
|
7
|
-
placeholder: string;
|
|
8
|
-
onChange: (value: string) => void;
|
|
9
|
-
selectedValues: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { InputOption } from '../../../components/Input/types';
|
|
2
|
+
type DropdownFieldsProps = {
|
|
3
|
+
options: {
|
|
4
|
+
[key: string]: InputOption;
|
|
5
|
+
};
|
|
6
|
+
value: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
selectedValues: {
|
|
10
|
+
id?: string;
|
|
11
|
+
key?: string;
|
|
12
|
+
selected: boolean | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
updateSelectedValues: (updatedValues: {
|
|
15
|
+
id?: string;
|
|
16
|
+
key?: string;
|
|
17
|
+
selected: boolean | undefined;
|
|
18
|
+
}[]) => void;
|
|
19
|
+
};
|
|
20
|
+
export default function DropdownFields({ options, value, placeholder, onChange, selectedValues, updateSelectedValues }: DropdownFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
1
|
+
import { UploadColumn } from '../../../types';
|
|
2
|
+
import { Column } from '../../../../types';
|
|
3
|
+
import { TemplateColumnMapping } from '../types';
|
|
4
|
+
export default function useMapColumnsTable(uploadColumns: UploadColumn[], templateColumns: Column[] | undefined, columnsValues: {
|
|
5
|
+
[uploadColumnIndex: number]: TemplateColumnMapping;
|
|
6
|
+
}, isLoading?: boolean, importerKey?: string, backendUrl?: string): {
|
|
7
|
+
rows: {
|
|
8
|
+
[x: string]: {
|
|
9
|
+
raw: string | boolean;
|
|
10
|
+
content: string | import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
formValues: {
|
|
14
|
+
[key: number]: import('../types').ColumnMapping;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MapColumnsProps } from
|
|
2
|
-
export default function MapColumns({
|
|
1
|
+
import { MapColumnsProps } from './types';
|
|
2
|
+
export default function MapColumns({ columns, data, columnMapping, selectedHeaderRow, skipHeaderRowSelection, onSuccess, onCancel, isSubmitting, importerKey, backendUrl, }: MapColumnsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FileData } from
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
columnMapping:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[index: number]: TemplateColumnMapping;
|
|
18
|
-
}) => void;
|
|
19
|
-
onCancel: () => void;
|
|
20
|
-
isSubmitting: boolean;
|
|
21
|
-
importerKey?: string;
|
|
22
|
-
backendUrl?: string;
|
|
23
|
-
};
|
|
1
|
+
import { Column, ColumnMapping, ColumnMappingDictionary } from '../../../../types';
|
|
2
|
+
import { FileData } from '../../main/types';
|
|
3
|
+
export type { ColumnMapping, ColumnMappingDictionary };
|
|
4
|
+
export type TemplateColumnMapping = ColumnMapping;
|
|
5
|
+
export type MapColumnsProps = {
|
|
6
|
+
columns?: Column[];
|
|
7
|
+
data: FileData;
|
|
8
|
+
columnMapping: ColumnMappingDictionary;
|
|
9
|
+
selectedHeaderRow: number | null;
|
|
10
|
+
skipHeaderRowSelection?: boolean;
|
|
11
|
+
onSuccess: (columnMapping: ColumnMappingDictionary) => void;
|
|
12
|
+
onCancel: () => void;
|
|
13
|
+
isSubmitting: boolean;
|
|
14
|
+
importerKey?: string;
|
|
15
|
+
backendUrl?: string;
|
|
16
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RowSelectionProps } from
|
|
2
|
-
export default function RowSelection({ data, onSuccess, onCancel, selectedHeaderRow, setSelectedHeaderRow }: RowSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { RowSelectionProps } from './types';
|
|
2
|
+
export default function RowSelection({ data, onSuccess, onCancel, selectedHeaderRow, setSelectedHeaderRow }: RowSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FileData } from
|
|
2
|
-
export type RowSelectionProps = {
|
|
3
|
-
data: FileData;
|
|
4
|
-
onSuccess: () => void;
|
|
5
|
-
onCancel: () => void;
|
|
6
|
-
selectedHeaderRow: number | null;
|
|
7
|
-
setSelectedHeaderRow: (id: number) => void;
|
|
8
|
-
};
|
|
1
|
+
import { FileData } from '../../main/types';
|
|
2
|
+
export type RowSelectionProps = {
|
|
3
|
+
data: FileData;
|
|
4
|
+
onSuccess: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
selectedHeaderRow: number | null;
|
|
7
|
+
setSelectedHeaderRow: (id: number) => void;
|
|
8
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function useTemplateTable(fields?:
|
|
3
|
-
[x: string]: string | {
|
|
4
|
-
raw: string;
|
|
5
|
-
content: import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
} | {
|
|
7
|
-
raw: number;
|
|
8
|
-
content: import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
}[];
|
|
1
|
+
import { Column } from '../../../../types';
|
|
2
|
+
export default function useTemplateTable(fields?: Column[]): {
|
|
3
|
+
[x: string]: string | {
|
|
4
|
+
raw: string;
|
|
5
|
+
content: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
} | {
|
|
7
|
+
raw: number;
|
|
8
|
+
content: import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
}[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UploaderProps } from
|
|
2
|
-
export default function Uploader({
|
|
1
|
+
import { UploaderProps } from './types';
|
|
2
|
+
export default function Uploader({ columns, skipHeaderRowSelection, onSuccess, showDownloadTemplateButton, setDataError }: UploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dispatch, SetStateAction } from
|
|
3
|
-
export type UploaderProps = {
|
|
4
|
-
|
|
5
|
-
skipHeaderRowSelection: boolean;
|
|
6
|
-
onSuccess: (file: File) => void;
|
|
7
|
-
showDownloadTemplateButton?: boolean;
|
|
8
|
-
setDataError: Dispatch<SetStateAction<string | null>>;
|
|
9
|
-
};
|
|
1
|
+
import { Column } from '../../../../types';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type UploaderProps = {
|
|
4
|
+
columns?: Column[];
|
|
5
|
+
skipHeaderRowSelection: boolean;
|
|
6
|
+
onSuccess: (file: File) => void;
|
|
7
|
+
showDownloadTemplateButton?: boolean;
|
|
8
|
+
setDataError: Dispatch<SetStateAction<string | null>>;
|
|
9
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationProps } from './types';
|
|
2
|
-
export default function Validation({
|
|
1
|
+
import { ValidationProps } from './types';
|
|
2
|
+
export default function Validation({ columns, data: fileData, columnMapping, selectedHeaderRow, onSuccess, onCancel, isSubmitting, backendUrl, importerKey, filterInvalidRows, disableOnInvalidRows, }: ValidationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { TransformationChange } from '../../../services/transformation';
|
|
2
|
-
interface TransformModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
data: any[];
|
|
6
|
-
columnMapping: Record<string, any>;
|
|
7
|
-
backendUrl: string;
|
|
8
|
-
importerKey: string;
|
|
9
|
-
validationErrors?: Array<{
|
|
10
|
-
rowIndex: number;
|
|
11
|
-
columnKey: string;
|
|
12
|
-
message: string;
|
|
13
|
-
value?: any;
|
|
14
|
-
}>;
|
|
15
|
-
onApplyTransformations: (changes: TransformationChange[]) => void;
|
|
16
|
-
}
|
|
17
|
-
export default function TransformModal({ isOpen, onClose, data, columnMapping, backendUrl, importerKey, validationErrors, onApplyTransformations }: TransformModalProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
1
|
+
import { TransformationChange } from '../../../services/transformation';
|
|
2
|
+
interface TransformModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
data: any[];
|
|
6
|
+
columnMapping: Record<string, any>;
|
|
7
|
+
backendUrl: string;
|
|
8
|
+
importerKey: string;
|
|
9
|
+
validationErrors?: Array<{
|
|
10
|
+
rowIndex: number;
|
|
11
|
+
columnKey: string;
|
|
12
|
+
message: string;
|
|
13
|
+
value?: any;
|
|
14
|
+
}>;
|
|
15
|
+
onApplyTransformations: (changes: TransformationChange[]) => void;
|
|
16
|
+
}
|
|
17
|
+
export default function TransformModal({ isOpen, onClose, data, columnMapping, backendUrl, importerKey, validationErrors, onApplyTransformations }: TransformModalProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Validation';
|
|
1
|
+
export { default } from './Validation';
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { FileData } from
|
|
2
|
-
import { TemplateColumnMapping } from
|
|
3
|
-
import {
|
|
4
|
-
export interface ValidationError {
|
|
5
|
-
rowIndex: number;
|
|
6
|
-
columnIndex: number;
|
|
7
|
-
message: string;
|
|
8
|
-
value: string | number;
|
|
9
|
-
}
|
|
10
|
-
export interface ValidationProps {
|
|
11
|
-
|
|
12
|
-
data: FileData;
|
|
13
|
-
columnMapping: {
|
|
14
|
-
[index: number]: TemplateColumnMapping;
|
|
15
|
-
};
|
|
16
|
-
selectedHeaderRow: number | null;
|
|
17
|
-
onSuccess: (validData: any) => void;
|
|
18
|
-
onCancel: () => void;
|
|
19
|
-
isSubmitting: boolean;
|
|
20
|
-
backendUrl?: string;
|
|
21
|
-
importerKey?: string;
|
|
22
|
-
filterInvalidRows?: boolean;
|
|
23
|
-
disableOnInvalidRows?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface ValidationState {
|
|
26
|
-
errors: ValidationError[];
|
|
27
|
-
editedValues: {
|
|
28
|
-
[rowIndex: number]: {
|
|
29
|
-
[columnIndex: number]: string | number;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
}
|
|
1
|
+
import { FileData } from '../main/types';
|
|
2
|
+
import { TemplateColumnMapping } from '../map-columns/types';
|
|
3
|
+
import { Column } from '../../../types';
|
|
4
|
+
export interface ValidationError {
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
columnIndex: number;
|
|
7
|
+
message: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
}
|
|
10
|
+
export interface ValidationProps {
|
|
11
|
+
columns?: Column[];
|
|
12
|
+
data: FileData;
|
|
13
|
+
columnMapping: {
|
|
14
|
+
[index: number]: TemplateColumnMapping;
|
|
15
|
+
};
|
|
16
|
+
selectedHeaderRow: number | null;
|
|
17
|
+
onSuccess: (validData: any) => void;
|
|
18
|
+
onCancel: () => void;
|
|
19
|
+
isSubmitting: boolean;
|
|
20
|
+
backendUrl?: string;
|
|
21
|
+
importerKey?: string;
|
|
22
|
+
filterInvalidRows?: boolean;
|
|
23
|
+
disableOnInvalidRows?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ValidationState {
|
|
26
|
+
errors: ValidationError[];
|
|
27
|
+
editedValues: {
|
|
28
|
+
[rowIndex: number]: {
|
|
29
|
+
[columnIndex: number]: string | number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useClickOutside(ref: any | null, callback: (...args: any[]) => any): void;
|
|
1
|
+
export default function useClickOutside(ref: any | null, callback: (...args: any[]) => any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useCustomStyles(customStyles?: string, targetElement?: HTMLElement | null): void;
|
|
1
|
+
export default function useCustomStyles(customStyles?: string, targetElement?: HTMLElement | null): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileData } from '../features/main/types';
|
|
2
|
+
interface DemoDataConfig {
|
|
3
|
+
fileName: string;
|
|
4
|
+
csvContent: string;
|
|
5
|
+
}
|
|
6
|
+
interface UseDemoDataResult {
|
|
7
|
+
data: FileData | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hook to parse and manage demo CSV data
|
|
13
|
+
* Used for demonstrating the importer with sample data
|
|
14
|
+
*/
|
|
15
|
+
export declare function useDemoData(demoData?: DemoDataConfig): UseDemoDataResult;
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from
|
|
2
|
-
declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void): void;
|
|
3
|
-
declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K, handler: (event: HTMLElementEventMap[K]) => void, element: RefObject<T>): void;
|
|
4
|
-
export default useEventListener;
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void): void;
|
|
3
|
+
declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K, handler: (event: HTMLElementEventMap[K]) => void, element: RefObject<T>): void;
|
|
4
|
+
export default useEventListener;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Column } from '../../types';
|
|
2
|
+
interface UseImporterSchemaResult {
|
|
3
|
+
columns: Column[];
|
|
4
|
+
includeUnmatchedColumns: boolean;
|
|
5
|
+
filterInvalidRows: boolean;
|
|
6
|
+
disableOnInvalidRows: boolean;
|
|
7
|
+
error: string | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface UseImporterSchemaOptions {
|
|
11
|
+
importerKey?: string;
|
|
12
|
+
backendUrl: string;
|
|
13
|
+
propColumns?: Column[];
|
|
14
|
+
isStandaloneMode: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Hook to fetch and manage importer schema
|
|
18
|
+
* Handles both standalone mode (using provided columns) and backend mode (fetching from API)
|
|
19
|
+
*/
|
|
20
|
+
export declare function useImporterSchema({ importerKey, backendUrl, propColumns, isStandaloneMode }: UseImporterSchemaOptions): UseImporterSchemaResult;
|
|
21
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { useEffect } from
|
|
2
|
-
declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
3
|
-
export default useIsomorphicLayoutEffect;
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
3
|
+
export default useIsomorphicLayoutEffect;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
type Size = {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
top: number;
|
|
7
|
-
right: number;
|
|
8
|
-
bottom: number;
|
|
9
|
-
left: number;
|
|
10
|
-
};
|
|
11
|
-
declare function useRect<T extends HTMLElement = HTMLDivElement>(): [(node: T | null) => void, Size, Function];
|
|
12
|
-
export default useRect;
|
|
1
|
+
type Size = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
top: number;
|
|
7
|
+
right: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
left: number;
|
|
10
|
+
};
|
|
11
|
+
declare function useRect<T extends HTMLElement = HTMLDivElement>(): [(node: T | null) => void, Size, Function];
|
|
12
|
+
export default useRect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useWindowSize(): number[];
|
|
1
|
+
export default function useWindowSize(): number[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export default function ThemeProvider({ children, primaryColor }: ThemeProviderProps): React.ReactElement;
|
|
1
|
+
import { ThemeProps } from './types';
|
|
2
|
+
export interface ThemeProviderProps extends ThemeProps {
|
|
3
|
+
primaryColor?: string;
|
|
4
|
+
}
|
|
5
|
+
export default function ThemeProvider({ children, primaryColor }: ThemeProviderProps): React.ReactElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProvidersProps } from
|
|
2
|
-
export interface ProvidersWithThemeProps extends ProvidersProps {
|
|
3
|
-
primaryColor?: string;
|
|
4
|
-
}
|
|
5
|
-
export default function Providers({ children, primaryColor }: ProvidersWithThemeProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { ProvidersProps } from './types';
|
|
2
|
+
export interface ProvidersWithThemeProps extends ProvidersProps {
|
|
3
|
+
primaryColor?: string;
|
|
4
|
+
}
|
|
5
|
+
export default function Providers({ children, primaryColor }: ProvidersWithThemeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
export type ProvidersProps = React.PropsWithChildren<{}>;
|
|
3
|
-
export type QueriesProps = React.PropsWithChildren<{}>;
|
|
4
|
-
export type ThemeProps = React.PropsWithChildren<{}>;
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ProvidersProps = React.PropsWithChildren<{}>;
|
|
3
|
+
export type QueriesProps = React.PropsWithChildren<{}>;
|
|
4
|
+
export type ThemeProps = React.PropsWithChildren<{}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Column, ColumnMappingDictionary } from '../../types';
|
|
2
|
+
import { FileData } from '../features/main/types';
|
|
3
|
+
interface ProcessedData {
|
|
4
|
+
data: Record<string, any>;
|
|
5
|
+
unmapped?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
interface ProcessDataOptions {
|
|
8
|
+
data: FileData;
|
|
9
|
+
columnMapping: ColumnMappingDictionary;
|
|
10
|
+
selectedHeaderRow: number | null;
|
|
11
|
+
includeUnmatchedColumns: boolean;
|
|
12
|
+
columns: Column[];
|
|
13
|
+
}
|
|
14
|
+
interface SubmitDataOptions {
|
|
15
|
+
processedData: ProcessedData[];
|
|
16
|
+
importerKey?: string;
|
|
17
|
+
backendUrl: string;
|
|
18
|
+
user?: Record<string, any>;
|
|
19
|
+
metadata?: Record<string, any>;
|
|
20
|
+
columnMapping: ColumnMappingDictionary;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Process validated data and prepare it for submission
|
|
24
|
+
*/
|
|
25
|
+
export declare function processValidatedData({ data, columnMapping, selectedHeaderRow, includeUnmatchedColumns, columns }: ProcessDataOptions): ProcessedData[];
|
|
26
|
+
/**
|
|
27
|
+
* Submit processed data to the backend
|
|
28
|
+
*/
|
|
29
|
+
export declare function submitDataToBackend({ processedData, importerKey, backendUrl, user, metadata, columnMapping }: SubmitDataOptions): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Generate CSV template for download
|
|
32
|
+
*/
|
|
33
|
+
export declare function generateTemplateCSV(columns: Column[]): string;
|
|
34
|
+
/**
|
|
35
|
+
* Download template CSV file
|
|
36
|
+
*/
|
|
37
|
+
export declare function downloadTemplate(columns: Column[], fileName?: string): void;
|
|
38
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Column mapping service with optional LLM enhancement
|
|
3
|
-
*/
|
|
4
|
-
export interface MappingSuggestion {
|
|
5
|
-
uploadIndex: number;
|
|
6
|
-
templateKey: string;
|
|
7
|
-
confidence: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Get enhanced column mapping suggestions from the backend
|
|
11
|
-
*
|
|
12
|
-
* @param uploadColumns - Array of upload columns with name and sample_data
|
|
13
|
-
* @param templateColumns - Array of
|
|
14
|
-
* @param backendUrl - Backend API URL
|
|
15
|
-
* @param importerKey - Importer key for authentication
|
|
16
|
-
* @returns Array of mapping suggestions or empty array on error
|
|
17
|
-
*/
|
|
18
|
-
export declare function getMappingSuggestions(uploadColumns: any[], templateColumns: any[], backendUrl?: string, importerKey?: string): Promise<MappingSuggestion[]>;
|
|
19
|
-
/**
|
|
20
|
-
* Apply mapping suggestions to the current state
|
|
21
|
-
* Only applies high-confidence suggestions that don't conflict
|
|
22
|
-
*
|
|
23
|
-
* @param suggestions - Array of mapping suggestions
|
|
24
|
-
* @param currentValues - Current mapping values
|
|
25
|
-
* @param usedTemplateKeys - Set of already used template keys
|
|
26
|
-
* @param handleTemplateChange - Function to update a column mapping
|
|
27
|
-
* @returns Number of mappings applied
|
|
28
|
-
*/
|
|
29
|
-
export declare function applyMappingSuggestions(suggestions: MappingSuggestion[], currentValues: {
|
|
30
|
-
[key: number]: any;
|
|
31
|
-
}, usedTemplateKeys: Set<string>, handleTemplateChange: (uploadIndex: number, templateKey: string) => void): number;
|
|
1
|
+
/**
|
|
2
|
+
* Column mapping service with optional LLM enhancement
|
|
3
|
+
*/
|
|
4
|
+
export interface MappingSuggestion {
|
|
5
|
+
uploadIndex: number;
|
|
6
|
+
templateKey: string;
|
|
7
|
+
confidence: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get enhanced column mapping suggestions from the backend
|
|
11
|
+
*
|
|
12
|
+
* @param uploadColumns - Array of upload columns with name and sample_data
|
|
13
|
+
* @param templateColumns - Array of Column objects with id, label, and validators
|
|
14
|
+
* @param backendUrl - Backend API URL
|
|
15
|
+
* @param importerKey - Importer key for authentication
|
|
16
|
+
* @returns Array of mapping suggestions or empty array on error
|
|
17
|
+
*/
|
|
18
|
+
export declare function getMappingSuggestions(uploadColumns: any[], templateColumns: any[], backendUrl?: string, importerKey?: string): Promise<MappingSuggestion[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Apply mapping suggestions to the current state
|
|
21
|
+
* Only applies high-confidence suggestions that don't conflict
|
|
22
|
+
*
|
|
23
|
+
* @param suggestions - Array of mapping suggestions
|
|
24
|
+
* @param currentValues - Current mapping values
|
|
25
|
+
* @param usedTemplateKeys - Set of already used template keys
|
|
26
|
+
* @param handleTemplateChange - Function to update a column mapping
|
|
27
|
+
* @returns Number of mappings applied
|
|
28
|
+
*/
|
|
29
|
+
export declare function applyMappingSuggestions(suggestions: MappingSuggestion[], currentValues: {
|
|
30
|
+
[key: number]: any;
|
|
31
|
+
}, usedTemplateKeys: Set<string>, handleTemplateChange: (uploadIndex: number, templateKey: string) => void): number;
|