fuse-importer 0.25.4 → 0.25.6

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 (58) hide show
  1. package/lib/esm/Importer/ImporterWithContext.js +2 -2
  2. package/lib/esm/Importer/Matcher/HeaderMatcher/index.js +2 -4
  3. package/lib/esm/Importer/Review/ReviewContextProvider.js +4 -14
  4. package/lib/esm/Importer/Review/ReviewWithContext.js +2 -2
  5. package/lib/esm/Importer/Stepper/index.js +4 -1
  6. package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js +2 -1
  7. package/lib/esm/Importer/Uploader/HeadersPreview.js +1 -1
  8. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.d.ts +9 -4
  9. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.js +30 -5
  10. package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetData.js +6 -3
  11. package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowCheckboxes.d.ts +2 -1
  12. package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowCheckboxes.js +79 -13
  13. package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowNumbers.js +2 -2
  14. package/lib/esm/Importer/common/Spreadsheet/components/fields/index.js +1 -1
  15. package/lib/esm/Importer/common/Spreadsheet/hooks.d.ts +2 -0
  16. package/lib/esm/Importer/common/Spreadsheet/hooks.js +61 -0
  17. package/lib/esm/Importer/common/Spreadsheet/index.d.ts +2 -2
  18. package/lib/esm/Importer/common/Spreadsheet/styles.d.ts +8 -2
  19. package/lib/esm/Importer/common/Spreadsheet/styles.js +10 -5
  20. package/lib/esm/Importer/contexts/ImporterContextProvider.d.ts +9 -2
  21. package/lib/esm/Importer/contexts/ImporterContextProvider.js +29 -9
  22. package/lib/esm/Importer/data/index.d.ts +4 -1
  23. package/lib/esm/Importer/data/index.js +6 -2
  24. package/lib/esm/common/ConfirmationModal.d.ts +10 -0
  25. package/lib/esm/common/ConfirmationModal.js +19 -0
  26. package/lib/esm/common/Table/TableActions/DeleteSelectedRows.d.ts +6 -0
  27. package/lib/esm/common/Table/TableActions/DeleteSelectedRows.js +65 -0
  28. package/lib/esm/common/Table/TableActions/SearchRows.d.ts +3 -0
  29. package/lib/esm/common/Table/TableActions/SearchRows.js +70 -0
  30. package/lib/esm/common/Table/TableActions/TableActions.d.ts +10 -0
  31. package/lib/esm/common/Table/TableActions/TableActions.js +45 -0
  32. package/lib/esm/common/Table/TableActions/common.d.ts +1 -0
  33. package/lib/esm/common/Table/TableActions/common.js +1 -0
  34. package/lib/esm/common/Table/TableActions/icons.d.ts +3 -0
  35. package/lib/esm/common/Table/TableActions/icons.js +15 -0
  36. package/lib/esm/common/Table/TableActions/index.d.ts +1 -0
  37. package/lib/esm/common/Table/TableActions/index.js +1 -0
  38. package/lib/esm/common/Table/TableView/TableCells.js +5 -1
  39. package/lib/esm/common/Table/TableView/TableRow.d.ts +2 -1
  40. package/lib/esm/common/Table/TableView/TableRow.js +3 -3
  41. package/lib/esm/common/Table/TableView/index.d.ts +2 -1
  42. package/lib/esm/common/Table/TableView/index.js +6 -5
  43. package/lib/esm/common/buttons.d.ts +1 -1
  44. package/lib/esm/common/buttons.js +10 -7
  45. package/lib/esm/common/index.d.ts +1 -0
  46. package/lib/esm/common/index.js +1 -0
  47. package/lib/esm/common/inputs/Checkbox.d.ts +3 -1
  48. package/lib/esm/common/inputs/Checkbox.js +15 -12
  49. package/lib/esm/locales/de.d.ts +2 -0
  50. package/lib/esm/locales/de.js +3 -1
  51. package/lib/esm/locales/en.d.ts +2 -0
  52. package/lib/esm/locales/en.js +3 -1
  53. package/lib/esm/locales/es.d.ts +2 -0
  54. package/lib/esm/locales/es.js +3 -1
  55. package/lib/esm/locales/fr.d.ts +2 -0
  56. package/lib/esm/locales/fr.js +3 -1
  57. package/lib/main.js +11 -11
  58. package/package.json +1 -1
@@ -28,7 +28,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
28
28
  import { get } from "lodash";
29
29
  import styled, { css } from "styled-components";
30
30
  import { Div, HTMLButton } from "../styled/utils";
31
- var types = ["primary", "secondary", "tertiary"];
31
+ var types = ["primary", "secondary", "tertiary", "link"];
32
32
  var getBgColor = function (props) {
33
33
  return get(props, "backgroundColor", get(props.theme, "colors.pink500"));
34
34
  };
@@ -63,17 +63,20 @@ var styles = {
63
63
  tertiary: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n color: ", ";\n }\n ", "\n "], ["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n color: ", ";\n }\n ", "\n "])), function (props) { return props.theme.colors.text; }, function (props) { return props.theme.colors.white50; }, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.white; }, function (props) {
64
64
  return props.isDisabled && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (props) { return props.theme.colors.gray300; });
65
65
  }),
66
+ link: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n text-decoration: underline;\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n color: ", ";\n }\n ", "\n "], ["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n text-decoration: underline;\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n color: ", ";\n }\n ", "\n "])), function (props) { return props.theme.colors.text; }, function (props) { return props.theme.colors.white50; }, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.white; }, function (props) {
67
+ return props.isDisabled && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (props) { return props.theme.colors.gray300; });
68
+ }),
66
69
  };
67
- var commonButtonStyle = css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n padding: 12px 24px;\n height: 48px;\n width: fit-content;\n\n ", "\n\n border: solid 1px black;\n border-radius: 24px;\n\n font-family: DM Sans;\n\n :focus {\n outline: none;\n }\n :hover {\n cursor: pointer;\n }\n\n ", "\n ", ";\n\n ", ";\n"], ["\n padding: 12px 24px;\n height: 48px;\n width: fit-content;\n\n ", "\n\n border: solid 1px black;\n border-radius: 24px;\n\n font-family: DM Sans;\n\n :focus {\n outline: none;\n }\n :hover {\n cursor: pointer;\n }\n\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
68
- return props.isSmall && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n height: 36px;\n padding: 6px 20px;\n "], ["\n height: 36px;\n padding: 6px 20px;\n "])));
70
+ var commonButtonStyle = css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: 12px 24px;\n height: 48px;\n width: fit-content;\n\n ", "\n\n border: solid 1px black;\n border-radius: 24px;\n\n font-family: DM Sans;\n\n :focus {\n outline: none;\n }\n :hover {\n cursor: pointer;\n }\n\n ", "\n ", ";\n\n ", ";\n"], ["\n padding: 12px 24px;\n height: 48px;\n width: fit-content;\n\n ", "\n\n border: solid 1px black;\n border-radius: 24px;\n\n font-family: DM Sans;\n\n :focus {\n outline: none;\n }\n :hover {\n cursor: pointer;\n }\n\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
71
+ return props.isSmall && css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n height: 36px;\n padding: 6px 20px;\n "], ["\n height: 36px;\n padding: 6px 20px;\n "])));
69
72
  }, function (props) {
70
- return props.isDisabled && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
73
+ return props.isDisabled && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
71
74
  }, function (props) {
72
75
  var c = props.theme.css;
73
76
  return [c.centered, c.buttonText];
74
77
  }, function (props) { return styles[props.variant || "primary"]; });
75
- export var ButtonWrapper = styled(Div)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), commonButtonStyle);
76
- export var ButtonElementWrapper = styled(HTMLButton)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), commonButtonStyle);
78
+ export var ButtonWrapper = styled(Div)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), commonButtonStyle);
79
+ export var ButtonElementWrapper = styled(HTMLButton)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), commonButtonStyle);
77
80
  export var Button = function (_a) {
78
81
  var _b = _a.onClick, onClick = _b === void 0 ? null : _b, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.variant, variant = _d === void 0 ? "primary" : _d, _e = _a.isSmall, isSmall = _e === void 0 ? false : _e, children = _a.children, _f = _a.isButtonElement, isButtonElement = _f === void 0 ? false : _f, props = __rest(_a, ["onClick", "isDisabled", "variant", "isSmall", "children", "isButtonElement"]);
79
82
  return (_jsx(_Fragment, { children: isButtonElement ? (_jsx(ButtonElementWrapper, __assign({ isSmall: isSmall, isDisabled: isDisabled, disabled: isDisabled, variant: variant, type: "submit" }, props, { children: children }))) : (_jsx(ButtonWrapper, __assign({ role: "button", w: "fit-content", p: 12, isSmall: isSmall, onClick: isDisabled ? null : onClick, onKeyDown: function (_a) {
@@ -84,4 +87,4 @@ export var Button = function (_a) {
84
87
  }
85
88
  }, tabIndex: 0 }, __assign({ variant: variant, isDisabled: isDisabled, onClick: onClick, disabled: isDisabled }, props), { children: _jsx(_Fragment, { children: children }) }))) }));
86
89
  };
87
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
90
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
@@ -22,3 +22,4 @@ export * from "./logo";
22
22
  export * from "./Modal";
23
23
  export * from "./Spinner";
24
24
  export * from "./TooltipProvider";
25
+ export * from "./ConfirmationModal";
@@ -39,4 +39,5 @@ export * from "./logo";
39
39
  export * from "./Modal";
40
40
  export * from "./Spinner";
41
41
  export * from "./TooltipProvider";
42
+ export * from "./ConfirmationModal";
42
43
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -4,6 +4,8 @@ type Props = {
4
4
  isIndeterminate?: boolean;
5
5
  icon?: any;
6
6
  onChange?: (isChecked: boolean) => void;
7
+ onShiftKeyPressed?: () => void;
8
+ isDisabled?: boolean;
7
9
  } & DivCSSProps;
8
- declare const Checkbox: ({ isChecked, isIndeterminate, icon, onChange, ...props }: Props) => JSX.Element;
10
+ declare const Checkbox: ({ isChecked, isIndeterminate, icon, onChange, onShiftKeyPressed, isDisabled, ...props }: Props) => JSX.Element;
9
11
  export { Checkbox };
@@ -27,24 +27,27 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import { jsx as _jsx } from "react/jsx-runtime";
28
28
  import styled, { css } from "styled-components";
29
29
  import { Div } from "../../styled/utils";
30
- var Container = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 20px;\n width: 20px;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 4px;\n ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n"], ["\n height: 20px;\n width: 20px;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 4px;\n ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n"])), function (props) { return props.theme.colors.gray400; }, function (props) { return props.theme.colors.white; }, function (props) {
30
+ var Container = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 20px;\n width: 20px;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 4px;\n ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n ", "\n"], ["\n height: 20px;\n width: 20px;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 4px;\n ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n ", "\n"])), function (props) { return props.theme.colors.gray400; }, function (props) { return props.theme.colors.white; }, function (props) {
31
31
  return (props.isChecked || props.isIndeterminate) && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: 1px solid white;\n background-color: ", ";\n "], ["\n border: 1px solid white;\n background-color: ", ";\n "])), props.theme.colors.pink500);
32
+ }, function (_a) {
33
+ var isDisabled = _a.isDisabled;
34
+ return isDisabled && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0.6;\n\n :hover {\n cursor: not-allowed;\n }\n "], ["\n opacity: 0.6;\n\n :hover {\n cursor: not-allowed;\n }\n "])));
32
35
  });
33
36
  var Checkbox = function (_a) {
34
- var isChecked = _a.isChecked, isIndeterminate = _a.isIndeterminate, _b = _a.icon, icon = _b === void 0 ? null : _b, onChange = _a.onChange, props = __rest(_a, ["isChecked", "isIndeterminate", "icon", "onChange"]);
35
- var handleOnChange = function () {
36
- if (onChange) {
37
- if (isChecked) {
38
- onChange(false);
39
- }
40
- else {
41
- onChange(!isIndeterminate);
42
- }
37
+ var isChecked = _a.isChecked, isIndeterminate = _a.isIndeterminate, _b = _a.icon, icon = _b === void 0 ? null : _b, onChange = _a.onChange, onShiftKeyPressed = _a.onShiftKeyPressed, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, props = __rest(_a, ["isChecked", "isIndeterminate", "icon", "onChange", "onShiftKeyPressed", "isDisabled"]);
38
+ var handleOnChange = function (event) {
39
+ if (!onChange)
40
+ return;
41
+ if (event.shiftKey && onShiftKeyPressed) {
42
+ onShiftKeyPressed();
43
+ return;
43
44
  }
45
+ var newValue = !isChecked || isIndeterminate;
46
+ onChange(newValue);
44
47
  };
45
- return (_jsx(Container, __assign({}, __assign({ isChecked: isChecked, isIndeterminate: isIndeterminate, onClick: handleOnChange }, props), { children: isIndeterminate ? (_jsx(IndeterminateIcon, {})) : (_jsx(Div, __assign({ centered: true }, { children: isChecked && (icon || checkIcon) }))) })));
48
+ return (_jsx(Container, __assign({}, __assign({ isChecked: isChecked, isDisabled: isDisabled, isIndeterminate: isIndeterminate, onClick: handleOnChange }, props), { children: isIndeterminate ? (_jsx(IndeterminateIcon, {})) : (_jsx(Div, __assign({ centered: true }, { children: isChecked && (icon || checkIcon) }))) })));
46
49
  };
47
50
  var checkIcon = (_jsx("svg", __assign({ width: "14", height: "10", viewBox: "0 0 14 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1.10254 4.74355L5.2051 8.84612L12.8974 1.15381", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
48
51
  var IndeterminateIcon = function () { return (_jsx("svg", __assign({ width: "14", height: "2", viewBox: "0 0 14 2", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1 1H13", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }) }))); };
49
52
  export { Checkbox };
50
- var templateObject_1, templateObject_2;
53
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -32,6 +32,7 @@ declare const _default: {
32
32
  title: string;
33
33
  description: string;
34
34
  button: string;
35
+ enter_data_manually: string;
35
36
  };
36
37
  };
37
38
  match: {
@@ -50,6 +51,7 @@ declare const _default: {
50
51
  };
51
52
  review: {
52
53
  title: string;
54
+ manual_importer_title: string;
53
55
  export: string;
54
56
  description: string;
55
57
  };
@@ -33,6 +33,7 @@ export default {
33
33
  title: "Ziehen & lassen Sie Ihre Datei hier",
34
34
  description: "oder",
35
35
  button: "Dateien durchsuchen",
36
+ enter_data_manually: "Daten manuell eingeben",
36
37
  },
37
38
  },
38
39
  match: {
@@ -50,7 +51,8 @@ export default {
50
51
  },
51
52
  },
52
53
  review: {
53
- title: "Überprüfen Sie Ihre Tabelle, bevor Sie sie einreichen",
54
+ title: "Überprüfen und Senden",
55
+ manual_importer_title: "Daten Eingeben und Senden",
54
56
  export: "Exportieren",
55
57
  description: "Einige Zellen im Dokument können Fehler im Format oder fehlende Informationen aufweisen. Bitte überprüfen Sie diese, um fortzufahren.",
56
58
  },
@@ -32,6 +32,7 @@ declare const _default: {
32
32
  title: string;
33
33
  description: string;
34
34
  button: string;
35
+ enter_data_manually: string;
35
36
  };
36
37
  };
37
38
  match: {
@@ -50,6 +51,7 @@ declare const _default: {
50
51
  };
51
52
  review: {
52
53
  title: string;
54
+ manual_importer_title: string;
53
55
  export: string;
54
56
  description: string;
55
57
  };
@@ -33,6 +33,7 @@ export default {
33
33
  title: "Drag & drop your file here",
34
34
  description: "or",
35
35
  button: "Browse Files",
36
+ enter_data_manually: "Enter data manually",
36
37
  },
37
38
  },
38
39
  match: {
@@ -50,7 +51,8 @@ export default {
50
51
  },
51
52
  },
52
53
  review: {
53
- title: "Review Your Spreadsheet before Submitting",
54
+ title: "Review & Submit",
55
+ manual_importer_title: "Enter Data & Submit",
54
56
  export: "Export",
55
57
  description: "Some cells in the document might have errors in format or missing information. Please review these to continue.",
56
58
  },
@@ -32,6 +32,7 @@ declare const _default: {
32
32
  title: string;
33
33
  description: string;
34
34
  button: string;
35
+ enter_data_manually: string;
35
36
  };
36
37
  };
37
38
  match: {
@@ -50,6 +51,7 @@ declare const _default: {
50
51
  };
51
52
  review: {
52
53
  title: string;
54
+ manual_importer_title: string;
53
55
  export: string;
54
56
  description: string;
55
57
  };
@@ -33,6 +33,7 @@ export default {
33
33
  title: "Arrastra y suelta tu archivo aquí",
34
34
  description: "o",
35
35
  button: "Examinar archivos",
36
+ enter_data_manually: "Ingresar datos manualmente",
36
37
  },
37
38
  },
38
39
  match: {
@@ -50,7 +51,8 @@ export default {
50
51
  },
51
52
  },
52
53
  review: {
53
- title: "Revise su hoja de cálculo antes de enviar",
54
+ title: "Revisar y Enviar",
55
+ manual_importer_title: "Ingresar Datos y Enviar",
54
56
  export: "Exportar",
55
57
  description: "Algunas celdas en el documento pueden tener errores en el formato o información faltante. Por favor revise esto para continuar.",
56
58
  },
@@ -32,6 +32,7 @@ declare const _default: {
32
32
  title: string;
33
33
  description: string;
34
34
  button: string;
35
+ enter_data_manually: string;
35
36
  };
36
37
  };
37
38
  match: {
@@ -50,6 +51,7 @@ declare const _default: {
50
51
  };
51
52
  review: {
52
53
  title: string;
54
+ manual_importer_title: string;
53
55
  export: string;
54
56
  description: string;
55
57
  };
@@ -33,6 +33,7 @@ export default {
33
33
  title: "Glissez et déposez votre fichier ici",
34
34
  description: "ou",
35
35
  button: "Parcourir les fichiers",
36
+ enter_data_manually: "Entrer les données manuellement",
36
37
  },
37
38
  },
38
39
  match: {
@@ -50,7 +51,8 @@ export default {
50
51
  },
51
52
  },
52
53
  review: {
53
- title: "Examinez votre tableur avant de soumettre",
54
+ title: "Revoir et Envoyer",
55
+ manual_importer_title: "Saisir Des Données et Envoyer",
54
56
  export: "Exporter",
55
57
  description: "Certaines cellules du document peuvent avoir des erreurs de format ou des informations manquantes. Veuillez les examiner pour continuer.",
56
58
  },