fuse-importer 0.23.4 → 0.23.7

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 (45) hide show
  1. package/lib/esm/Importer/FuseApi.js +1 -1
  2. package/lib/esm/Importer/ImporterContextProvider.d.ts +2 -0
  3. package/lib/esm/Importer/ImporterContextProvider.js +4 -1
  4. package/lib/esm/Importer/Review/index.js +1 -1
  5. package/lib/esm/Importer/SpreadsheetReviewContextProvider.d.ts +2 -1
  6. package/lib/esm/Importer/SpreadsheetReviewContextProvider.js +20 -9
  7. package/lib/esm/Importer/Stepper.js +4 -2
  8. package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js +1 -1
  9. package/lib/esm/Importer/Uploader/HeadersPreview.js +1 -1
  10. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.d.ts +1 -0
  11. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.js +81 -61
  12. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetRowNumbers.d.ts +3 -3
  13. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetRowNumbers.js +10 -10
  14. package/lib/esm/Importer/common/Spreadsheet/common/fields/index.d.ts +2 -2
  15. package/lib/esm/Importer/common/Spreadsheet/common/fields/index.js +32 -47
  16. package/lib/esm/Importer/common/Spreadsheet/common/index.js +11 -3
  17. package/lib/esm/Importer/common/Spreadsheet/index.js +18 -57
  18. package/lib/esm/Importer/index.js +2 -2
  19. package/lib/esm/api/index.d.ts +1 -0
  20. package/lib/esm/api/index.js +3 -3
  21. package/lib/esm/common/Modal.d.ts +7 -4
  22. package/lib/esm/common/Modal.js +2 -2
  23. package/lib/esm/common/Table/TableDataProvider.js +24 -23
  24. package/lib/esm/common/Table/TableView/TableHeaders.d.ts +3 -2
  25. package/lib/esm/common/Table/TableView/TableHeaders.js +1 -5
  26. package/lib/esm/common/Table/TableView/TableRow.d.ts +2 -2
  27. package/lib/esm/common/Table/TableView/TableRow.js +7 -10
  28. package/lib/esm/common/Table/TableView/index.d.ts +1 -2
  29. package/lib/esm/common/Table/TableView/index.js +52 -45
  30. package/lib/esm/common/TooltipProvider.d.ts +1 -0
  31. package/lib/esm/common/TooltipProvider.js +7 -7
  32. package/lib/esm/common/buttons.js +2 -2
  33. package/lib/esm/common/index.d.ts +1 -1
  34. package/lib/esm/common/index.js +2 -2
  35. package/lib/esm/common/inputs/Autocomplete.js +8 -4
  36. package/lib/esm/common/inputs/TextInput.d.ts +2 -1
  37. package/lib/esm/common/inputs/TextInput.js +3 -2
  38. package/lib/esm/styled/utils.d.ts +3 -0
  39. package/lib/esm/styled/utils.js +4 -2
  40. package/lib/esm/types.d.ts +11 -7
  41. package/lib/esm/utils/index.d.ts +1 -0
  42. package/lib/esm/utils/index.js +3 -0
  43. package/lib/main.js +1 -1
  44. package/lib/main.js.LICENSE.txt +9 -0
  45. package/package.json +18 -14
@@ -25,7 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
25
25
  return t;
26
26
  };
27
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
- import { useEffect, useState } from "react";
28
+ import { useEffect, useState, useMemo } from "react";
29
29
  import styled, { css } from "styled-components";
30
30
  import { MenuItem } from "..";
31
31
  import { Div } from "../../styled/utils";
@@ -72,9 +72,13 @@ var Autocomplete = function (_a) {
72
72
  onChange(v);
73
73
  setIsMenuOpen(false);
74
74
  };
75
- var filteredOptions = updatedText
76
- ? options.filter(function (o) { return o.label.toLowerCase().includes(text.toLowerCase()); })
77
- : options;
75
+ var filteredOptions = useMemo(function () {
76
+ return updatedText
77
+ ? options.filter(function (o) {
78
+ return o.label.toLowerCase().includes(text.toLowerCase());
79
+ })
80
+ : options;
81
+ }, [updatedText, options]);
78
82
  var inputIconUI = text ? (_jsx(ClearIcon, __assign({ clickable: true, dim: 24, centered: true, onClick: function (evt) {
79
83
  evt.preventDefault();
80
84
  evt.stopPropagation();
@@ -15,6 +15,7 @@ declare type Props = {
15
15
  onFocus?: any;
16
16
  withDebounce?: boolean;
17
17
  autoFocus?: boolean;
18
+ id?: string;
18
19
  } & DivCSSProps;
19
- declare const TextInput: ({ label, icon, placeholder, value, type, onChange, onBlur, isDisabled, hasError, onFocus, withDebounce, autoFocus, ...props }: Props) => JSX.Element;
20
+ declare const TextInput: ({ label, icon, placeholder, value, type, onChange, onBlur, isDisabled, hasError, onFocus, withDebounce, autoFocus, id, ...props }: Props) => JSX.Element;
20
21
  export { TextInput };
@@ -37,18 +37,19 @@ export var HTMLInput = styled.input(templateObject_3 || (templateObject_3 = __ma
37
37
  });
38
38
  export var TextInputIcon = styled(Div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n right: 11px;\n top: 0;\n height: 100%;\n"], ["\n position: absolute;\n right: 11px;\n top: 0;\n height: 100%;\n"])));
39
39
  var TextInput = function (_a) {
40
- var label = _a.label, _b = _a.icon, icon = _b === void 0 ? null : _b, _c = _a.placeholder, placeholder = _c === void 0 ? "" : _c, value = _a.value, _d = _a.type, type = _d === void 0 ? "text" : _d, onChange = _a.onChange, _e = _a.onBlur, onBlur = _e === void 0 ? null : _e, _f = _a.isDisabled, isDisabled = _f === void 0 ? false : _f, _g = _a.hasError, hasError = _g === void 0 ? false : _g, _h = _a.onFocus, onFocus = _h === void 0 ? null : _h, _j = _a.withDebounce, withDebounce = _j === void 0 ? true : _j, _k = _a.autoFocus, autoFocus = _k === void 0 ? false : _k, props = __rest(_a, ["label", "icon", "placeholder", "value", "type", "onChange", "onBlur", "isDisabled", "hasError", "onFocus", "withDebounce", "autoFocus"]);
40
+ var label = _a.label, _b = _a.icon, icon = _b === void 0 ? null : _b, _c = _a.placeholder, placeholder = _c === void 0 ? "" : _c, value = _a.value, _d = _a.type, type = _d === void 0 ? "text" : _d, onChange = _a.onChange, _e = _a.onBlur, onBlur = _e === void 0 ? null : _e, _f = _a.isDisabled, isDisabled = _f === void 0 ? false : _f, _g = _a.hasError, hasError = _g === void 0 ? false : _g, _h = _a.onFocus, onFocus = _h === void 0 ? null : _h, _j = _a.withDebounce, withDebounce = _j === void 0 ? true : _j, _k = _a.autoFocus, autoFocus = _k === void 0 ? false : _k, id = _a.id, props = __rest(_a, ["label", "icon", "placeholder", "value", "type", "onChange", "onBlur", "isDisabled", "hasError", "onFocus", "withDebounce", "autoFocus", "id"]);
41
41
  var _l = useDebounce(value, onChange, withDebounce ? 0 : 300), _value = _l._value, set_Value = _l.set_Value;
42
42
  var res = usePasswordVisibleIcon(type);
43
43
  var passwordVisibleIcon = res.passwordVisibleIcon, isPasswordVisible = res.isPasswordVisible;
44
44
  var _icon = passwordVisibleIcon || icon;
45
- return (_jsxs(Div, __assign({ w100: true }, props, { children: [label && (_jsx(FormInputLabel, __assign({ isDisabled: isDisabled, mb: 8 }, { children: label }))), _jsxs(Div, __assign({ pRelative: true }, { children: [_jsx(HTMLInput, __assign({}, {
45
+ return (_jsxs(Div, __assign({ w100: true }, props, { children: [label && (_jsx(FormInputLabel, __assign({ isDisabled: isDisabled, mb: 8, htmlFor: id }, { children: label }))), _jsxs(Div, __assign({ pRelative: true }, { children: [_jsx(HTMLInput, __assign({}, {
46
46
  placeholder: placeholder,
47
47
  isDisabled: isDisabled,
48
48
  onFocus: onFocus,
49
49
  hasError: hasError,
50
50
  autoFocus: autoFocus,
51
51
  disabled: isDisabled,
52
+ id: id,
52
53
  }, { type: isPasswordVisible ? "text" : type, value: _value || "", onChange: function (_a) {
53
54
  var value = _a.target.value;
54
55
  return set_Value(value);
@@ -10,10 +10,13 @@ export declare type CSSAnyProps = CSSProps | {
10
10
  export declare const Div: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, CSSProps, never>;
11
11
  export declare const HTMLButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, CSSProps, never>;
12
12
  export declare const Span: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, CSSProps, never>;
13
+ export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, CSSProps, never>;
13
14
  export declare const P: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, CSSProps, never>;
15
+ export declare const BaseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, CSSProps, never>;
14
16
  export declare type DivProps = React.HTMLAttributes<HTMLDivElement>;
15
17
  export declare type HTMLButtonProps = React.HTMLAttributes<HTMLButtonElement>;
16
18
  export declare type HTMLInputProps = React.InputHTMLAttributes<HTMLInputElement>;
19
+ export declare type HTMLLabelProps = React.InputHTMLAttributes<HTMLLabelElement>;
17
20
  export declare type DivCSSProps = DivProps & CSSProps;
18
21
  export declare type HTMLButtonCSSProps = HTMLButtonProps & CSSProps;
19
22
  export declare type HTMLInputCSSProps = HTMLInputProps & CSSProps;
@@ -11,5 +11,7 @@ export var themeProps = css(templateObject_1 || (templateObject_1 = __makeTempla
11
11
  export var Div = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), themeProps);
12
12
  export var HTMLButton = styled.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), themeProps);
13
13
  export var Span = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), themeProps);
14
- export var P = styled.p(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), themeProps);
15
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
14
+ export var Label = styled.label(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), themeProps);
15
+ export var P = styled.p(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), themeProps);
16
+ export var BaseButton = styled.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n outline: none;\n margin: none;\n padding: none;\n background: transparent;\n border: none;\n"], ["\n ", ";\n outline: none;\n margin: none;\n padding: none;\n background: transparent;\n border: none;\n"])), themeProps);
17
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const EnvironmentTypes: readonly ["local", "development", "production", "test"];
2
3
  export declare type EnvironmentType = typeof EnvironmentTypes[number];
3
4
  export declare type SpreadsheetOptions = {
@@ -8,6 +9,8 @@ export declare type ImporterOptions = {
8
9
  zIndex?: number;
9
10
  env?: EnvironmentType;
10
11
  previewMode?: boolean;
12
+ loadingComponent?: () => JSX.Element;
13
+ disableSubmitIfInvalid?: boolean;
11
14
  } & SpreadsheetOptions;
12
15
  export declare enum FieldTypes {
13
16
  boolean = "boolean",
@@ -32,15 +35,16 @@ export declare type Field = {
32
35
  export declare type SpreadsheetValidationErrors = {
33
36
  [rowId: string]: ValidationErrors;
34
37
  };
38
+ export declare type Meta = {
39
+ appValidationErrors?: ValidationErrors;
40
+ localValidationErrors?: ValidationErrors;
41
+ wasSeen?: boolean;
42
+ id: string;
43
+ rowIndex: number;
44
+ };
35
45
  export declare type Record = {
36
46
  [key: string]: any;
37
- _meta?: {
38
- appValidationErrors?: ValidationErrors;
39
- localValidationErrors?: ValidationErrors;
40
- wasSeen?: boolean;
41
- id: string;
42
- rowIndex: number;
43
- };
47
+ _meta?: Meta;
44
48
  };
45
49
  export declare type ValidationErrors = {
46
50
  [k: string]: string;
@@ -1 +1,2 @@
1
1
  export declare const isString: (variable: any) => boolean;
2
+ export declare const sleep: (n: number) => Promise<unknown>;
@@ -1,3 +1,6 @@
1
1
  export var isString = function (variable) {
2
2
  return typeof variable === "string" || variable instanceof String;
3
3
  };
4
+ export var sleep = function (n) {
5
+ return new Promise(function (resolve) { return setTimeout(resolve, n); });
6
+ };