@importcsv/react 0.1.17 → 0.2.1

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.
Files changed (147) hide show
  1. package/README.md +16 -6
  2. package/build/bundle.css +1 -0
  3. package/build/bundled-styles.d.ts +1 -1
  4. package/build/components/CSVImporter/index.d.ts +32 -35
  5. package/build/i18n/de.d.ts +32 -32
  6. package/build/i18n/es.d.ts +32 -32
  7. package/build/i18n/fr.d.ts +32 -32
  8. package/build/i18n/i18n.d.ts +6 -6
  9. package/build/i18n/it.d.ts +32 -32
  10. package/build/i18n/useTranslation.d.ts +9 -9
  11. package/build/importer/components/Box/index.d.ts +2 -2
  12. package/build/importer/components/Box/types/index.d.ts +6 -6
  13. package/build/importer/components/Checkbox/index.d.ts +2 -2
  14. package/build/importer/components/Checkbox/types/index.d.ts +4 -4
  15. package/build/importer/components/Errors/index.d.ts +4 -4
  16. package/build/importer/components/IframeWrapper/index.d.ts +25 -25
  17. package/build/importer/components/ImporterLayout.d.ts +15 -0
  18. package/build/importer/components/Input/index.d.ts +2 -2
  19. package/build/importer/components/Input/types/index.d.ts +18 -18
  20. package/build/importer/components/Stepper/hooks/useStepper.d.ts +2 -2
  21. package/build/importer/components/Stepper/index.d.ts +2 -2
  22. package/build/importer/components/Stepper/types/index.d.ts +14 -13
  23. package/build/importer/components/Table/index.d.ts +9 -9
  24. package/build/importer/components/Table/types/index.d.ts +42 -42
  25. package/build/importer/components/ToggleFilter/index.d.ts +3 -3
  26. package/build/importer/components/ToggleFilter/types/index.d.ts +11 -11
  27. package/build/importer/components/Tooltip/index.d.ts +2 -2
  28. package/build/importer/components/Tooltip/types/index.d.ts +11 -11
  29. package/build/importer/components/UploaderWrapper/UploaderWrapper.d.ts +2 -2
  30. package/build/importer/components/UploaderWrapper/types/index.d.ts +2 -2
  31. package/build/importer/components/ui/alert.d.ts +8 -8
  32. package/build/importer/components/ui/button.d.ts +12 -12
  33. package/build/importer/components/ui/card.d.ts +8 -8
  34. package/build/importer/components/ui/checkbox.d.ts +4 -4
  35. package/build/importer/components/ui/dialog.d.ts +19 -19
  36. package/build/importer/components/ui/flex.d.ts +14 -14
  37. package/build/importer/components/ui/input.d.ts +5 -5
  38. package/build/importer/components/ui/select.d.ts +13 -13
  39. package/build/importer/components/ui/switch.d.ts +4 -4
  40. package/build/importer/components/ui/toast.d.ts +15 -15
  41. package/build/importer/components/ui/toaster.d.ts +1 -1
  42. package/build/importer/components/ui/tooltip.d.ts +13 -13
  43. package/build/importer/components/ui/use-toast.d.ts +44 -44
  44. package/build/importer/features/complete/index.d.ts +2 -2
  45. package/build/importer/features/complete/types/index.d.ts +5 -5
  46. package/build/importer/features/configure-import/index.d.ts +13 -13
  47. package/build/importer/features/configure-import/types/index.d.ts +13 -19
  48. package/build/importer/features/main/hooks/useMutableLocalStorage.d.ts +1 -1
  49. package/build/importer/features/main/hooks/useStepNavigation.d.ts +17 -18
  50. package/build/importer/features/main/index.d.ts +2 -2
  51. package/build/importer/features/main/types/index.d.ts +16 -16
  52. package/build/importer/features/map-columns/components/DropDownFields.d.ts +21 -19
  53. package/build/importer/features/map-columns/hooks/useMapColumnsTable.d.ts +16 -15
  54. package/build/importer/features/map-columns/index.d.ts +2 -2
  55. package/build/importer/features/map-columns/types/index.d.ts +16 -23
  56. package/build/importer/features/row-selection/index.d.ts +2 -2
  57. package/build/importer/features/row-selection/types/index.d.ts +8 -8
  58. package/build/importer/features/uploader/hooks/useTemplateTable.d.ts +10 -10
  59. package/build/importer/features/uploader/index.d.ts +2 -2
  60. package/build/importer/features/uploader/types/index.d.ts +9 -9
  61. package/build/importer/features/validation/Validation.d.ts +2 -2
  62. package/build/importer/features/validation/components/TransformModal.d.ts +18 -18
  63. package/build/importer/features/validation/index.d.ts +1 -1
  64. package/build/importer/features/validation/types.d.ts +32 -32
  65. package/build/importer/hooks/useClickOutside.d.ts +1 -1
  66. package/build/importer/hooks/useCustomStyles.d.ts +1 -1
  67. package/build/importer/hooks/useDemoData.d.ts +16 -0
  68. package/build/importer/hooks/useEventListener.d.ts +4 -4
  69. package/build/importer/hooks/useImporterSchema.d.ts +21 -0
  70. package/build/importer/hooks/useIsomorphicLayoutEffect.d.ts +3 -3
  71. package/build/importer/hooks/useRect.d.ts +12 -12
  72. package/build/importer/hooks/useWindowSize.d.ts +1 -1
  73. package/build/importer/providers/Theme.d.ts +5 -6
  74. package/build/importer/providers/index.d.ts +5 -5
  75. package/build/importer/providers/types/index.d.ts +4 -4
  76. package/build/importer/services/api.d.ts +1 -0
  77. package/build/importer/services/dataProcessor.d.ts +38 -0
  78. package/build/importer/services/mapping.d.ts +31 -31
  79. package/build/importer/services/transformation.d.ts +70 -70
  80. package/build/importer/settings/theme/colors.d.ts +4 -4
  81. package/build/importer/settings/theme/index.d.ts +2 -2
  82. package/build/importer/settings/theme/sizes.d.ts +7 -7
  83. package/build/importer/stores/theme.d.ts +17 -17
  84. package/build/importer/types/index.d.ts +9 -17
  85. package/build/importer/utils/colorUtils.d.ts +48 -44
  86. package/build/importer/utils/getStringLengthOfChildren.d.ts +2 -2
  87. package/build/importer/utils/stringSimilarity.d.ts +1 -1
  88. package/build/importer/utils/template.d.ts +2 -2
  89. package/build/importer/utils/utils.d.ts +19 -11
  90. package/build/index.d.ts +4 -3
  91. package/build/index.esm.js +10896 -34418
  92. package/build/index.esm.js.map +1 -1
  93. package/build/index.js +262 -37879
  94. package/build/index.js.map +1 -1
  95. package/build/js.d.ts +39 -40
  96. package/build/settings/defaults.d.ts +3 -3
  97. package/build/styles.d.ts +1 -1
  98. package/build/types/index.d.ts +105 -33
  99. package/build/utils/cn.d.ts +6 -0
  100. package/build/validation/transformer.d.ts +33 -0
  101. package/build/validation/validator.d.ts +23 -0
  102. package/package.json +14 -41
  103. package/build/App.d.ts +0 -2
  104. package/build/build/bundle.css +0 -3789
  105. package/build/config/index.d.ts +0 -5
  106. package/build/importer/components/Portal/index.d.ts +0 -3
  107. package/build/importer/components/Portal/types/index.d.ts +0 -5
  108. package/build/importer/components/Table/storyData.d.ts +0 -36
  109. package/build/importer/features/map-columns/hooks/useNameChange.d.ts +0 -5
  110. package/build/importer/features/validation/SimpleValidation.d.ts +0 -2
  111. package/build/importer/features/validation/components/SimpleSpreadsheetGrid/SimpleSpreadsheetGrid.d.ts +0 -27
  112. package/build/importer/features/validation/components/SimpleSpreadsheetGrid/index.d.ts +0 -1
  113. package/build/importer/features/validation/components/SpreadsheetGrid/CellSelection.d.ts +0 -15
  114. package/build/importer/features/validation/components/SpreadsheetGrid/ClipboardManager.d.ts +0 -20
  115. package/build/importer/features/validation/components/SpreadsheetGrid/FindReplaceModal.d.ts +0 -14
  116. package/build/importer/features/validation/components/SpreadsheetGrid/SpreadsheetGrid.d.ts +0 -37
  117. package/build/importer/features/validation/components/SpreadsheetGrid/UndoRedoManager.d.ts +0 -15
  118. package/build/importer/features/validation/components/SpreadsheetGrid/index.d.ts +0 -1
  119. package/build/importer/hooks/useDelayLoader.d.ts +0 -2
  120. package/build/importer/settings/chakra/components/alert.d.ts +0 -31
  121. package/build/importer/settings/chakra/components/button.d.ts +0 -37
  122. package/build/importer/settings/chakra/components/index.d.ts +0 -2
  123. package/build/importer/settings/chakra/foundations/blur.d.ts +0 -11
  124. package/build/importer/settings/chakra/foundations/borders.d.ts +0 -8
  125. package/build/importer/settings/chakra/foundations/breakpoints.d.ts +0 -9
  126. package/build/importer/settings/chakra/foundations/colors.d.ts +0 -247
  127. package/build/importer/settings/chakra/foundations/index.d.ts +0 -487
  128. package/build/importer/settings/chakra/foundations/radius.d.ts +0 -12
  129. package/build/importer/settings/chakra/foundations/shadows.d.ts +0 -14
  130. package/build/importer/settings/chakra/foundations/sizes.d.ts +0 -60
  131. package/build/importer/settings/chakra/foundations/spacing.d.ts +0 -35
  132. package/build/importer/settings/chakra/foundations/transition.d.ts +0 -24
  133. package/build/importer/settings/chakra/foundations/typography.d.ts +0 -61
  134. package/build/importer/settings/chakra/foundations/z-index.d.ts +0 -16
  135. package/build/importer/settings/chakra/index.d.ts +0 -592
  136. package/build/importer/settings/chakra/semantic-tokens.d.ts +0 -32
  137. package/build/importer/settings/chakra/styles.d.ts +0 -2
  138. package/build/importer/settings/chakra/theme.types.d.ts +0 -93
  139. package/build/importer/settings/chakra/utils/is-chakra-theme.d.ts +0 -3
  140. package/build/importer/settings/chakra/utils/run-if-fn.d.ts +0 -1
  141. package/build/importer/utils/classes.d.ts +0 -2
  142. package/build/importer/utils/debounce.d.ts +0 -2
  143. package/build/index.dev.d.ts +0 -1
  144. package/build/package.json +0 -92
  145. package/build/services/api.d.ts +0 -18
  146. package/build/services/apiClient.d.ts +0 -21
  147. 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
- ConfigureImport: number;
6
- Validation: number;
7
- Complete: number;
8
- };
9
- declare function useStepNavigation(initialStep: number, skipHeader: boolean, useConsolidated?: boolean, isDemoMode?: boolean): {
10
- currentStep: any;
11
- setStep: (newStep: number) => void;
12
- goBack: (backStep?: number) => void;
13
- goNext: (nextStep?: number) => void;
14
- stepper: import("../../../components/Stepper/types").StepperProps;
15
- stepId: string | number | undefined;
16
- setStorageStep: any;
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 "../../../types";
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 "../../../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
- key: string;
11
- selected: boolean | undefined;
12
- }[];
13
- updateSelectedValues: (updatedValues: {
14
- key: string;
15
- selected: boolean | undefined;
16
- }[]) => void;
17
- };
18
- export default function DropdownFields({ options, value, placeholder, onChange, selectedValues, updateSelectedValues }: DropdownFieldsProps): import("react/jsx-runtime").JSX.Element;
19
- export {};
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 { TemplateColumn, UploadColumn } from "../../../types";
2
- import { TemplateColumnMapping } from "../types";
3
- export default function useMapColumnsTable(uploadColumns: UploadColumn[], templateColumns: TemplateColumn[] | undefined, columnsValues: {
4
- [uploadColumnIndex: number]: TemplateColumnMapping;
5
- }, isLoading?: boolean, importerKey?: string, backendUrl?: string): {
6
- rows: {
7
- [x: string]: {
8
- raw: string | boolean;
9
- content: string | import("react/jsx-runtime").JSX.Element;
10
- };
11
- }[];
12
- formValues: {
13
- [key: number]: TemplateColumnMapping;
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 "./types";
2
- export default function MapColumns({ template, data, columnMapping, selectedHeaderRow, skipHeaderRowSelection, onSuccess, onCancel, isSubmitting, importerKey, backendUrl, }: MapColumnsProps): import("react/jsx-runtime").JSX.Element | null;
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 { Template } from "../../../types";
2
- import { FileData } from "../../main/types";
3
- export type TemplateColumnMapping = {
4
- key: string;
5
- include: boolean;
6
- selected?: boolean;
7
- };
8
- export type MapColumnsProps = {
9
- template: Template;
10
- data: FileData;
11
- columnMapping: {
12
- [index: number]: TemplateColumnMapping;
13
- };
14
- selectedHeaderRow: number | null;
15
- skipHeaderRowSelection?: boolean;
16
- onSuccess: (columnMapping: {
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 "./types";
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 "../../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
+ 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 { TemplateColumn } from "../../../types";
2
- export default function useTemplateTable(fields?: TemplateColumn[]): {
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 "./types";
2
- export default function Uploader({ template, skipHeaderRowSelection, onSuccess, showDownloadTemplateButton, setDataError }: UploaderProps): import("react/jsx-runtime").JSX.Element;
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 { Template } from "../../../types";
2
- import { Dispatch, SetStateAction } from "react";
3
- export type UploaderProps = {
4
- template: Template;
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({ template, data: fileData, columnMapping, selectedHeaderRow, onSuccess, onCancel, isSubmitting, backendUrl, importerKey, filterInvalidRows, disableOnInvalidRows, }: ValidationProps): import("react/jsx-runtime").JSX.Element;
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 "../main/types";
2
- import { TemplateColumnMapping } from "../map-columns/types";
3
- import { Template } 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
- template: Template;
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 "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;
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 "react";
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
- /// <reference types="react" />
2
- import { ThemeProps } from "./types";
3
- export interface ThemeProviderProps extends ThemeProps {
4
- primaryColor?: string;
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 "./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
+ 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 "react";
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 template columns with key, name, and required
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;