@importcsv/react 0.1.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.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +470 -0
  3. package/build/App.d.ts +2 -0
  4. package/build/api.d.ts +17 -0
  5. package/build/components/CSVImporter/CSVImporter.stories.d.ts +44 -0
  6. package/build/components/CSVImporter/index.d.ts +26 -0
  7. package/build/config/environments.d.ts +12 -0
  8. package/build/config/index.d.ts +5 -0
  9. package/build/config.d.ts +10 -0
  10. package/build/i18n/de.d.ts +32 -0
  11. package/build/i18n/es.d.ts +32 -0
  12. package/build/i18n/fr.d.ts +32 -0
  13. package/build/i18n/i18n.d.ts +2 -0
  14. package/build/i18n/it.d.ts +32 -0
  15. package/build/importer/components/Box/index.d.ts +2 -0
  16. package/build/importer/components/Box/types/index.d.ts +5 -0
  17. package/build/importer/components/Checkbox/index.d.ts +2 -0
  18. package/build/importer/components/Checkbox/types/index.d.ts +4 -0
  19. package/build/importer/components/Errors/index.d.ts +4 -0
  20. package/build/importer/components/Input/index.d.ts +2 -0
  21. package/build/importer/components/Input/types/index.d.ts +18 -0
  22. package/build/importer/components/Portal/index.d.ts +3 -0
  23. package/build/importer/components/Portal/types/index.d.ts +5 -0
  24. package/build/importer/components/Stepper/hooks/useStepper.d.ts +2 -0
  25. package/build/importer/components/Stepper/index.d.ts +2 -0
  26. package/build/importer/components/Stepper/types/index.d.ts +13 -0
  27. package/build/importer/components/Table/index.d.ts +9 -0
  28. package/build/importer/components/Table/storyData.d.ts +36 -0
  29. package/build/importer/components/Table/types/index.d.ts +42 -0
  30. package/build/importer/components/ToggleFilter/ToggleFilter.stories.d.ts +18 -0
  31. package/build/importer/components/ToggleFilter/index.d.ts +3 -0
  32. package/build/importer/components/ToggleFilter/types/index.d.ts +11 -0
  33. package/build/importer/components/Tooltip/index.d.ts +2 -0
  34. package/build/importer/components/Tooltip/types/index.d.ts +11 -0
  35. package/build/importer/components/UploaderWrapper/UploaderWrapper.d.ts +2 -0
  36. package/build/importer/components/UploaderWrapper/types/index.d.ts +2 -0
  37. package/build/importer/features/complete/index.d.ts +2 -0
  38. package/build/importer/features/complete/types/index.d.ts +5 -0
  39. package/build/importer/features/main/hooks/useMutableLocalStorage.d.ts +1 -0
  40. package/build/importer/features/main/hooks/useStepNavigation.d.ts +17 -0
  41. package/build/importer/features/main/index.d.ts +2 -0
  42. package/build/importer/features/main/types/index.d.ts +16 -0
  43. package/build/importer/features/map-columns/components/DropDownFields.d.ts +19 -0
  44. package/build/importer/features/map-columns/hooks/useMapColumnsTable.d.ts +15 -0
  45. package/build/importer/features/map-columns/hooks/useNameChange.d.ts +5 -0
  46. package/build/importer/features/map-columns/index.d.ts +2 -0
  47. package/build/importer/features/map-columns/types/index.d.ts +23 -0
  48. package/build/importer/features/row-selection/index.d.ts +2 -0
  49. package/build/importer/features/row-selection/types/index.d.ts +8 -0
  50. package/build/importer/features/uploader/hooks/useTemplateTable.d.ts +10 -0
  51. package/build/importer/features/uploader/index.d.ts +2 -0
  52. package/build/importer/features/uploader/types/index.d.ts +9 -0
  53. package/build/importer/features/validate/index.d.ts +24 -0
  54. package/build/importer/features/validation/AIFixModal.d.ts +23 -0
  55. package/build/importer/features/validation/SimpleValidation.d.ts +2 -0
  56. package/build/importer/features/validation/Validation.d.ts +2 -0
  57. package/build/importer/features/validation/ValidationFixed.d.ts +2 -0
  58. package/build/importer/features/validation/components/AISuggestionsPanel.d.ts +15 -0
  59. package/build/importer/features/validation/components/InlineFixSuggestion.d.ts +8 -0
  60. package/build/importer/features/validation/index.d.ts +1 -0
  61. package/build/importer/features/validation/types.d.ts +31 -0
  62. package/build/importer/hooks/useClickOutside.d.ts +1 -0
  63. package/build/importer/hooks/useCustomStyles.d.ts +1 -0
  64. package/build/importer/hooks/useDelayLoader.d.ts +2 -0
  65. package/build/importer/hooks/useEventListener.d.ts +4 -0
  66. package/build/importer/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  67. package/build/importer/hooks/useRect.d.ts +12 -0
  68. package/build/importer/hooks/useWindowSize.d.ts +1 -0
  69. package/build/importer/providers/Theme.d.ts +4 -0
  70. package/build/importer/providers/index.d.ts +2 -0
  71. package/build/importer/providers/types/index.d.ts +4 -0
  72. package/build/importer/services/api.d.ts +0 -0
  73. package/build/importer/services/validation-api.d.ts +14 -0
  74. package/build/importer/settings/chakra/components/alert.d.ts +31 -0
  75. package/build/importer/settings/chakra/components/button.d.ts +37 -0
  76. package/build/importer/settings/chakra/components/index.d.ts +2 -0
  77. package/build/importer/settings/chakra/foundations/blur.d.ts +11 -0
  78. package/build/importer/settings/chakra/foundations/borders.d.ts +8 -0
  79. package/build/importer/settings/chakra/foundations/breakpoints.d.ts +9 -0
  80. package/build/importer/settings/chakra/foundations/colors.d.ts +247 -0
  81. package/build/importer/settings/chakra/foundations/index.d.ts +487 -0
  82. package/build/importer/settings/chakra/foundations/radius.d.ts +12 -0
  83. package/build/importer/settings/chakra/foundations/shadows.d.ts +14 -0
  84. package/build/importer/settings/chakra/foundations/sizes.d.ts +60 -0
  85. package/build/importer/settings/chakra/foundations/spacing.d.ts +35 -0
  86. package/build/importer/settings/chakra/foundations/transition.d.ts +24 -0
  87. package/build/importer/settings/chakra/foundations/typography.d.ts +61 -0
  88. package/build/importer/settings/chakra/foundations/z-index.d.ts +16 -0
  89. package/build/importer/settings/chakra/index.d.ts +592 -0
  90. package/build/importer/settings/chakra/semantic-tokens.d.ts +32 -0
  91. package/build/importer/settings/chakra/styles.d.ts +2 -0
  92. package/build/importer/settings/chakra/theme.types.d.ts +93 -0
  93. package/build/importer/settings/chakra/utils/is-chakra-theme.d.ts +3 -0
  94. package/build/importer/settings/chakra/utils/run-if-fn.d.ts +1 -0
  95. package/build/importer/settings/theme/colors.d.ts +4 -0
  96. package/build/importer/settings/theme/index.d.ts +2 -0
  97. package/build/importer/settings/theme/sizes.d.ts +7 -0
  98. package/build/importer/stores/theme.d.ts +17 -0
  99. package/build/importer/types/index.d.ts +17 -0
  100. package/build/importer/utils/classes.d.ts +2 -0
  101. package/build/importer/utils/debounce.d.ts +2 -0
  102. package/build/importer/utils/getStringLengthOfChildren.d.ts +2 -0
  103. package/build/importer/utils/stringSimilarity.d.ts +1 -0
  104. package/build/importer/utils/template.d.ts +2 -0
  105. package/build/importer/utils/utils.d.ts +11 -0
  106. package/build/index.d.ts +2 -0
  107. package/build/index.esm.js +54893 -0
  108. package/build/index.esm.js.map +1 -0
  109. package/build/index.js +54919 -0
  110. package/build/index.js.map +1 -0
  111. package/build/js.d.ts +31 -0
  112. package/build/services/api.d.ts +18 -0
  113. package/build/services/apiClient.d.ts +21 -0
  114. package/build/settings/defaults.d.ts +3 -0
  115. package/build/types/index.d.ts +24 -0
  116. package/build/types.d.ts +91 -0
  117. package/package.json +122 -0
@@ -0,0 +1,32 @@
1
+ declare const translations: {
2
+ Upload: string;
3
+ "Select Header": string;
4
+ "Map Columns": string;
5
+ "Expected Column": string;
6
+ Required: string;
7
+ "Drop your file here": string;
8
+ or: string;
9
+ "Browse files": string;
10
+ "Download Template": string;
11
+ "Only CSV, XLS, and XLSX files can be uploaded": string;
12
+ "Select Header Row": string;
13
+ "Select the row which contains the column headers": string;
14
+ "Only the first sheet ("{{sheet}}") of the Excel file will be imported. To import multiple sheets, please upload each sheet individually.": string;
15
+ Cancel: string;
16
+ Continue: string;
17
+ "Your File Column": string;
18
+ "Your Sample Data": string;
19
+ "Destination Column": string;
20
+ Include: string;
21
+ Submit: string;
22
+ "Loading...": string;
23
+ "Please include all required columns": string;
24
+ Back: string;
25
+ "- Select one -": string;
26
+ "- empty -": string;
27
+ "Import Successful": string;
28
+ "Upload Successful": string;
29
+ Done: string;
30
+ "Upload another file": string;
31
+ };
32
+ export default translations;
@@ -0,0 +1,2 @@
1
+ import i18 from "i18next";
2
+ export default i18;
@@ -0,0 +1,32 @@
1
+ declare const translations: {
2
+ Upload: string;
3
+ "Select Header": string;
4
+ "Map Columns": string;
5
+ "Expected Column": string;
6
+ Required: string;
7
+ "Drop your file here": string;
8
+ or: string;
9
+ "Browse files": string;
10
+ "Download Template": string;
11
+ "Only CSV, XLS, and XLSX files can be uploaded": string;
12
+ "Select Header Row": string;
13
+ "Select the row which contains the column headers": string;
14
+ "Only the first sheet ("{{sheet}}") of the Excel file will be imported. To import multiple sheets, please upload each sheet individually.": string;
15
+ Cancel: string;
16
+ Continue: string;
17
+ "Your File Column": string;
18
+ "Your Sample Data": string;
19
+ "Destination Column": string;
20
+ Include: string;
21
+ Submit: string;
22
+ "Loading...": string;
23
+ "Please include all required columns": string;
24
+ Back: string;
25
+ "- Select one -": string;
26
+ "- empty -": string;
27
+ "Import Successful": string;
28
+ "Upload Successful": string;
29
+ Done: string;
30
+ "Upload another file": string;
31
+ };
32
+ export default translations;
@@ -0,0 +1,2 @@
1
+ import { BoxProps } from "./types";
2
+ export default function Box({ className, variants, ...props }: BoxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export type BoxVariant = "fluid" | "mid" | "wide" | "space-l" | "space-mid" | "space-none" | "bg-shade";
2
+ export type BoxProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ variants?: BoxVariant[];
4
+ };
5
+ export declare const boxVariants: BoxVariant[];
@@ -0,0 +1,2 @@
1
+ import { CheckboxProps } from "./types";
2
+ export default function Checkbox({ label, className, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { InputHTMLAttributes, ReactElement } from "react";
2
+ export type CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {
3
+ label?: string | ReactElement;
4
+ };
@@ -0,0 +1,4 @@
1
+ export default function Errors({ error, centered }: {
2
+ error?: unknown;
3
+ centered?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { InputProps } from "./types";
2
+ export default function Input({ as, label, icon, iconAfter, error, options, className, variants, children, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ButtonHTMLAttributes, InputHTMLAttributes, ReactElement } from "react";
2
+ export type inputTypes = "date" | "datetime-local" | "email" | "file" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
3
+ export type InputVariants = "fluid" | "small";
4
+ export type InputOption = ButtonHTMLAttributes<HTMLButtonElement> & {
5
+ required?: boolean;
6
+ };
7
+ export type InputProps = InputHTMLAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLSelectElement> & InputHTMLAttributes<HTMLTextAreaElement> & {
8
+ as?: "input" | "textarea";
9
+ label?: string | ReactElement;
10
+ icon?: ReactElement;
11
+ iconAfter?: ReactElement;
12
+ error?: string;
13
+ options?: {
14
+ [key: string]: InputOption;
15
+ };
16
+ variants?: InputVariants[];
17
+ type?: inputTypes;
18
+ };
@@ -0,0 +1,3 @@
1
+ import { ReactPortal } from "react";
2
+ import { PortalProps } from "./types";
3
+ export default function Portal({ children, className, el }: PortalProps): ReactPortal;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export type PortalProps = React.PropsWithChildren<{
3
+ className?: string;
4
+ el?: string;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ import { Step, StepperProps } from "../types";
2
+ export default function useStepper(steps: Step[], initialStep: number | undefined, skipHeader: boolean): StepperProps;
@@ -0,0 +1,2 @@
1
+ import { StepperProps } from "./types";
2
+ export default function Stepper({ steps, current, clickable, setCurrent, skipHeader }: StepperProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export type Step = {
2
+ label: string;
3
+ id?: string | number;
4
+ disabled?: boolean;
5
+ };
6
+ export type StepperProps = {
7
+ steps: Step[];
8
+ current: number;
9
+ setCurrent: (step: number) => void;
10
+ step: Step;
11
+ clickable?: boolean;
12
+ skipHeader: boolean;
13
+ };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { TableProps } from "./types";
3
+ export default function Table({ data, // An array of objects with the data to be displayed
4
+ keyAsId, // Has to be a unique property in the data array to be used as key
5
+ theme, // A CSS module object to style the table
6
+ mergeThemes, // Should 'theme' be the only style applied (false) or be merged with the default style (true)
7
+ highlightColumns, // Columns that should use the highlighted style
8
+ hideColumns, // Array of columns to be hidden in the display
9
+ emptyState, heading, background, columnWidths, columnAlignments, fixHeader, onRowClick, }: TableProps): React.ReactElement;
@@ -0,0 +1,36 @@
1
+ declare const storyData: ({
2
+ id: number;
3
+ Name: {
4
+ raw: string;
5
+ content: string;
6
+ captionInfo: string;
7
+ tooltip?: undefined;
8
+ };
9
+ Age: number;
10
+ Email: string;
11
+ email?: undefined;
12
+ } | {
13
+ id: number;
14
+ Name: {
15
+ raw: string;
16
+ content: string;
17
+ tooltip: string;
18
+ captionInfo?: undefined;
19
+ };
20
+ Age: number;
21
+ Email: string;
22
+ email?: undefined;
23
+ } | {
24
+ id: number;
25
+ Name: string;
26
+ Age: number;
27
+ Email: string;
28
+ email?: undefined;
29
+ } | {
30
+ id: number;
31
+ Name: string;
32
+ Age: number;
33
+ email: string;
34
+ Email?: undefined;
35
+ })[];
36
+ export default storyData;
@@ -0,0 +1,42 @@
1
+ import { PropsWithChildren, ReactElement } from "react";
2
+ type Style = {
3
+ readonly [key: string]: string;
4
+ };
5
+ type Primitive = string | number | boolean | null | undefined;
6
+ export type TableComposite = {
7
+ raw: Primitive;
8
+ content: Primitive | React.ReactElement;
9
+ tooltip?: string;
10
+ captionInfo?: string;
11
+ };
12
+ export type TableValue = Primitive | TableComposite;
13
+ export type TableDatum = {
14
+ [key: string]: TableValue;
15
+ };
16
+ export type TableData = TableDatum[];
17
+ export type TableProps = {
18
+ data: TableData;
19
+ keyAsId?: string;
20
+ theme?: Style;
21
+ mergeThemes?: boolean;
22
+ highlightColumns?: string[];
23
+ hideColumns?: string[];
24
+ emptyState?: ReactElement;
25
+ heading?: ReactElement;
26
+ background?: "zebra" | "dark" | "light" | "transparent";
27
+ columnWidths?: string[];
28
+ columnAlignments?: ("left" | "center" | "right" | "")[];
29
+ fixHeader?: boolean;
30
+ onRowClick?: (row: TableDatum) => void;
31
+ };
32
+ export type RowProps = {
33
+ datum: TableDatum;
34
+ isHeading?: boolean;
35
+ onClick?: (row: TableDatum) => void;
36
+ };
37
+ export type CellProps = PropsWithChildren<{
38
+ cellClass?: string;
39
+ cellStyle: Style;
40
+ tooltip?: string;
41
+ }>;
42
+ export {};
@@ -0,0 +1,18 @@
1
+ import ToggleFilter from './index';
2
+ declare const _default: {
3
+ title: string;
4
+ component: typeof ToggleFilter;
5
+ argTypes: {
6
+ options: {
7
+ control: {
8
+ type: string;
9
+ };
10
+ };
11
+ onChange: {
12
+ action: string;
13
+ };
14
+ };
15
+ };
16
+ export default _default;
17
+ export declare const Default: () => import("react/jsx-runtime").JSX.Element;
18
+ export declare const WithCustomOptions: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ToggleFilterProps } from "./types";
2
+ declare function ToggleFilter({ options, onChange, className }: ToggleFilterProps): import("react/jsx-runtime").JSX.Element;
3
+ export default ToggleFilter;
@@ -0,0 +1,11 @@
1
+ export interface Option {
2
+ label: string;
3
+ filterValue: string;
4
+ selected: boolean;
5
+ color?: string;
6
+ }
7
+ export interface ToggleFilterProps {
8
+ options: Option[];
9
+ className?: string;
10
+ onChange: (option: string) => void;
11
+ }
@@ -0,0 +1,2 @@
1
+ import { AsMap, TooltipProps } from "./types";
2
+ export default function Tooltip<T extends keyof AsMap>({ as, className, title, children, icon, ...props }: TooltipProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ export type AsMap = {
3
+ div: React.HTMLProps<HTMLDivElement>;
4
+ span: React.HTMLProps<HTMLSpanElement>;
5
+ p: React.HTMLProps<HTMLParagraphElement>;
6
+ };
7
+ export type TooltipProps<T extends keyof AsMap = "span"> = {
8
+ as?: T;
9
+ title?: string | ReactNode;
10
+ icon?: ReactNode;
11
+ } & AsMap[T];
@@ -0,0 +1,2 @@
1
+ import { UploaderWrapperProps } from "./types";
2
+ export default function UploaderWrapper({ onSuccess, setDataError, ...props }: UploaderWrapperProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { UploaderProps } from "../../../features/uploader/types";
2
+ export type UploaderWrapperProps = Omit<UploaderProps, "template"> & {};
@@ -0,0 +1,2 @@
1
+ import { CompleteProps } from "./types";
2
+ export default function Complete({ reload, close, isModal }: CompleteProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export type CompleteProps = {
2
+ reload: () => void;
3
+ close: () => void;
4
+ isModal: boolean;
5
+ };
@@ -0,0 +1 @@
1
+ export default function useMutableLocalStorage(key: string, initialValue: any): any[];
@@ -0,0 +1,17 @@
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): {
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;
@@ -0,0 +1,2 @@
1
+ import { CSVImporterProps } from "../../../types";
2
+ export default function Main(props: CSVImporterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +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
+ };
@@ -0,0 +1,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
+ 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 {};
@@ -0,0 +1,15 @@
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
+ };
@@ -0,0 +1,5 @@
1
+ declare const useTransformValue: (initialValue: string) => {
2
+ transformedValue: string;
3
+ transformValue: (value: string) => void;
4
+ };
5
+ export default useTransformValue;
@@ -0,0 +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;
@@ -0,0 +1,23 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ import { RowSelectionProps } from "./types";
2
+ export default function RowSelection({ data, onSuccess, onCancel, selectedHeaderRow, setSelectedHeaderRow }: RowSelectionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +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
+ };
@@ -0,0 +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
+ }[];
@@ -0,0 +1,2 @@
1
+ import { UploaderProps } from "./types";
2
+ export default function Uploader({ template, skipHeaderRowSelection, onSuccess, showDownloadTemplateButton, setDataError }: UploaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +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
+ };
@@ -0,0 +1,24 @@
1
+ import { Template } from '../../types';
2
+ import { TemplateColumnMapping } from '../map-columns/types';
3
+ export type ValidateProps = {
4
+ data: {
5
+ rows: Array<{
6
+ index: number;
7
+ values: Record<string, string | number>;
8
+ }>;
9
+ headers: string[];
10
+ };
11
+ template: Template;
12
+ columnMapping: {
13
+ [key: number]: TemplateColumnMapping;
14
+ };
15
+ onSubmit: (updatedData?: Array<{
16
+ index: number;
17
+ values: Record<string, string | number>;
18
+ }>) => void;
19
+ onCancel: () => void;
20
+ isSubmitting?: boolean;
21
+ importerId?: string;
22
+ backendUrl?: string;
23
+ };
24
+ export default function Validate({ data, template, columnMapping, onSubmit, onCancel, isSubmitting, importerId, backendUrl, }: ValidateProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ interface AIFixModalProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ errors: Array<{
5
+ rowIndex: number;
6
+ columnIndex: number;
7
+ message: string;
8
+ field?: string;
9
+ }>;
10
+ dataRows: any[];
11
+ headerRow: any;
12
+ templateFields: any[];
13
+ selectedHeaderRow: number;
14
+ columnMapping: Record<number, any>;
15
+ backendUrl: string;
16
+ onApplyFixes: (fixes: Array<{
17
+ rowIndex: number;
18
+ columnIndex: number;
19
+ value: string;
20
+ }>) => void;
21
+ }
22
+ export default function AIFixModal({ isOpen, onClose, errors, dataRows, headerRow, templateFields, selectedHeaderRow, columnMapping, backendUrl, onApplyFixes }: AIFixModalProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ValidationProps } from './types';
2
+ export default function SimpleValidation({ template, data: fileData, columnMapping, selectedHeaderRow, onSuccess, onCancel, isSubmitting, }: ValidationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ValidationProps } from './types';
2
+ export default function Validation({ template, data: fileData, columnMapping, selectedHeaderRow, onSuccess, onCancel, isSubmitting, backendUrl, filterInvalidRows, disableOnInvalidRows, }: ValidationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ValidationProps } from './types';
2
+ export default function Validation({ template, data: fileData, columnMapping, selectedHeaderRow, onSuccess, onCancel, isSubmitting, backendUrl, importerConfig, }: ValidationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { ValidationFix, BatchFix, ValidationError } from '../types';
3
+ type AISuggestionsPanelProps = {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ fixes: ValidationFix[];
7
+ batchFixes: BatchFix[];
8
+ errors: ValidationError[];
9
+ onApplyFix: (fix: ValidationFix) => void;
10
+ onApplyBatchFix: (batchFix: BatchFix) => void;
11
+ onApplyAllFixes: () => void;
12
+ isLoading: boolean;
13
+ };
14
+ declare const AISuggestionsPanel: React.FC<AISuggestionsPanelProps>;
15
+ export default AISuggestionsPanel;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ValidationFix } from '../types';
3
+ type InlineFixSuggestionProps = {
4
+ fix: ValidationFix;
5
+ onApplyFix: (fix: ValidationFix, applyToSimilar: boolean) => void;
6
+ };
7
+ declare const InlineFixSuggestion: React.FC<InlineFixSuggestionProps>;
8
+ export default InlineFixSuggestion;
@@ -0,0 +1 @@
1
+ export { default } from './Validation';
@@ -0,0 +1,31 @@
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
+ filterInvalidRows?: boolean;
22
+ disableOnInvalidRows?: boolean;
23
+ }
24
+ export interface ValidationState {
25
+ errors: ValidationError[];
26
+ editedValues: {
27
+ [rowIndex: number]: {
28
+ [columnIndex: number]: string | number;
29
+ };
30
+ };
31
+ }
@@ -0,0 +1 @@
1
+ export default function useClickOutside(ref: any | null, callback: (...args: any[]) => any): void;
@@ -0,0 +1 @@
1
+ export default function useCustomStyles(customStyles?: string): void;
@@ -0,0 +1,2 @@
1
+ declare const useDelayedLoader: (isLoading: boolean, delay: number) => boolean;
2
+ export default useDelayedLoader;
@@ -0,0 +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;
@@ -0,0 +1,3 @@
1
+ import { useLayoutEffect } from "react";
2
+ declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
3
+ export default useIsomorphicLayoutEffect;
@@ -0,0 +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;